tgvaughan / MultiTypeTree

BEAST 2 package which provides support for multi-type trees: phylogenetic trees on structured populations.
http://tgvaughan.github.io/MultiTypeTree
GNU General Public License v3.0
21 stars 16 forks source link

Bayes Factor in SpreaD3 #22

Closed amymariecampbell closed 1 year ago

amymariecampbell commented 1 year ago

Is it possible to obtain Bayes Factor for MultiTypeTree structured coalescent models in SpreaD3? (https://rega.kuleuven.be/cev/ecv/software/SpreaD3_tutorial#sectionFourTwo)

It seems this relies on a rateIndicator column in the log file but I can't see this in my MultiTypeTree log file. I'd like some way to compare the likelihood of my models to find those with most statistical support for the locations.

Thanks so much in advance.

tgvaughan commented 1 year ago

Hi @amymariecampbell, I don't know anything about SpreaD3, but no this isn't directly possible. The phylogeography method mentioned in the document that you referenced uses a state space augmentation technique, "BSSVS", to turn individual rates matrix elements on and off during the analysis. MultiTypeTree doesn't generally work this way - at least "out of the box", so would require a bit of technical work to set this up, for instance by using ModelSelectionParameter to sample the presence/absence of different transition rates.

Cheers, Tim

amymariecampbell commented 1 year ago

Hi Tim,

OK, thank you for your rapid response! Is there a more intuitive way to compare model performance (in terms of the allocated types/locations) of MultiTypeTree models?

Thanks,

Amy


From: Tim Vaughan @.> Sent: Friday, October 14, 2022 5:16 PM To: tgvaughan/MultiTypeTree @.> Cc: Amy Campbell (Cefas) @.>; Mention @.> Subject: Re: [tgvaughan/MultiTypeTree] Bayes Factor in SpreaD3 (Issue #22)

WARNING - This email originated from outside of the organisation. Do not click links , forward or open attachments unless you recognise the sender and have established the content is safe.

Hi @amymariecampbellhttps://github.com/amymariecampbell, I don't know anything about SpreaD3, but no this isn't directly possible. The phylogeography method mentioned in the document that you referenced uses a state space augmentation technique, "BSSVS", to turn individual rates matrix elements on and off during the analysis. MultiTypeTree doesn't generally work this way - at least "out of the box", so would require a bit of technical work to set this up, for instance by using ModelSelectionParameterhttps://github.com/tgvaughan/feast#model-selection-using-modelselectionparameter to sample the presence/absence of different transition rates.

Cheers, Tim

— Reply to this email directly, view it on GitHubhttps://github.com/tgvaughan/MultiTypeTree/issues/22#issuecomment-1279208235, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATB2IWOACTZGFPANH66FNTTWDGBPVANCNFSM6AAAAAARFL7EBQ. You are receiving this because you were mentioned.Message ID: @.***>


This email and any attachments are intended for the named recipient only. Its unauthorised use, distribution, disclosure, storage or copying is not permitted. If you have received it in error, please destroy all copies and notify the sender. In messages of a non-business nature, the views and opinions expressed are the author's own and do not necessarily reflect those of Cefas. Communications on Cefas’ computer systems may be monitored and/or recorded to secure the effective operation of the system and for other lawful purposes. All messages sent and received by the Centre for Environment, Fisheries and Aquaculture Science may be monitored in line with relevant UK legislation . https://www.gov.uk/government/organisations/centre-for-environment-fisheries-and-aquaculture-science/about/personal-information-charter

liamxg commented 1 year ago

@tgvaughan how to do that using Modelselectionparameter, and tutorials on this ?

tgvaughan commented 1 year ago

@LiXingguangBrandonStark The documentation I linked above is all I've written on that, but if you're familiar with BSSVS and BEAST XML you should be able to put something together. The BEAST 2 documentation is a good place to start getting to grips with the XML format, while Phillipe Lemey's phylogeography paper (https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1000520) is a good point to start learning about BSSVS.

@amymariecampbell The posterior distribution yields marginal posteriors for each of the internal node locations. These can be directly computed using TreeAnnotator to generate a summary tree and can be explored by loading that tree into FigTree. The relevant tutorials on taming-the-beast.org give details on how to do this.

liamxg commented 1 year ago

@tgvaughan thanks, i am not familiar with xml, and I do not find multitypetree in beast 2.7.1?

image
tgvaughan commented 1 year ago

MultiTypeTree is not compatible with BEAST 2.7. You'll have to use BEAST 2.6.

liamxg commented 1 year ago

@tgvaughan, thanks. When will it compatible with 2.7?

tgvaughan commented 1 year ago

@LiXingguangBrandonStark when I get a chance to update it. 2.7 is a major update, and supporting it means I'll have to rewrite MultiTypeTree's BEAUti code, which is not straight-forward. Hopefully this will be possible by the end of this year. (I have many other packages which require similar rewrites, so together it's a fair amount of work.)

liamxg commented 1 year ago

@tgvaughan thanks for your great work.

amymariecampbell commented 1 year ago

@tgvaughan Hi Tim, thanks for your reply. The summary trees are what is making me question which model of mine is strongest. I'm interested in when and where the variant I am looking at originated. It seems slightly different parameters or MCMC runs seem to provide a similar tree structure (an initial split into two clear groups), however the type allocation to the root and the the branches splitting into these two groups are completely different for each run. I have three demes (locations) and I've had the root and the two groups attributed to each of these 3 with high 'type' probability (>0.9) posterior support. So I'm trying to work out if there are any robust results here, and why it seems to confidently allocate the branches to one deme, but then a slight change in parameters completely changes this to highly support another deme. And trying to work out which of these estimates has the most support. Does that make sense?