neherlab / treetime

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

get states of all tips #172

Closed antoine4ucsd closed 2 years ago

antoine4ucsd commented 2 years ago

Hello I ran treetime mugration and get annotated phylogenies with location states. I am looking for the equivalent of the getstates function from phytools to summarize/extract the ancestral location of each tip in the output tree. (and ideally some selected tips : e.g. summarize state ancestor of all tips from location A) All advices are welcome

thank you!

rneher commented 2 years ago

Hi Antoine,

are you using treetime in python as a library, or the command line tool? In the latter case, there should be a tabular output file with all states. there is no straightforward function in the library to do this. but you can access the states as is done here:

https://github.com/neherlab/treetime/blob/master/treetime/wrappers.py#L890

antoine4ucsd commented 2 years ago

I am using the cmd line (witihn conda env dedicated to treetime). I will have to look closely into it... I will keep you posted. thank you!