neherlab / treetime

Maximum likelihood inference of time stamped phylogenies and ancestral reconstruction
MIT License
223 stars 55 forks source link

Dated phylogeny on gapped alignment -- possible? #139

Closed phiweger closed 3 years ago

phiweger commented 3 years ago

Say a have a gapped alignment

ATGTAGTC
ATG--GTC
ATG-TG-C

Is it possible to use Treetime to construct a dated phylogeny? I would like to not drop columns with a gap.

The use case is that I would like to include pangenome-wide SNVs in an outbreak reconstruction; in this case not all SNV "positions" are present in all genomes, eg those in accessory genes.

Thank you for your help!

rneher commented 3 years ago

Yes, treetime should work with gapped alignments. but it will ignore gaps in branch length calculations. You could either mark those missing SNPs with - or N.

phiweger commented 3 years ago

Will Treetime use any "information" from those positions or just ignore them?

rneher commented 3 years ago

It will use them in ancestral state reconstruction, but will ignore them in branch length calculations.

phiweger commented 3 years ago

perfect, thanks a lot!