neherlab / treetime

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

Get probability values for ASR #119

Closed sokoloko closed 4 years ago

sokoloko commented 4 years ago

Thank you for making available treetime. Wondering how to get probability values for ancestral states and if less optimal reconstructions can be outputted somehow.

Thanks again, Sergios

rneher commented 4 years ago

are you interested in sequence reconstructions, or discrete trait reconstruction. for the latter, this is possible via

treetime mugration --confidence ...

probabilities for regular sequence reconstructions are available if you use treetime in a script and do marginal ancestral inference. each node will have an attribute marginal_profile which has the probability of each state.

sokoloko commented 4 years ago

Ancestral sequence reconstruction, thanks. You're referring to this script, yes? https://github.com/neherlab/treetime_examples/blob/master/scripts/ancestral_sequence_inference.py. thank you-

d-j-e commented 4 years ago

Any chance of same for joint reconstruction - would be handy to be able to check the actual probability that lead to a particular call (indication of support or otherwise for the particular call).

rneher commented 4 years ago

For a joint reconstruction, you can't specify the probability of an individual state. Only the most like global configuration is calculated along with its probability.