Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using a MRCA + snapper made mismatches with Taxon ~ TaxonSet labels #1106

Closed
drelo opened this issue Apr 17, 2023 · 2 comments
Closed

using a MRCA + snapper made mismatches with Taxon ~ TaxonSet labels #1106

drelo opened this issue Apr 17, 2023 · 2 comments

Comments

@drelo
Copy link

drelo commented Apr 17, 2023

Dear BEAST users,

I have used BEAST2 before with other routines but I am stuck in this analysis.
I am using snapper to try to date a dataset using some secondary calibrations. I noticed the best approach to establish Species/Population in the Taxon Set tab was using the 'guess' option, so I relabeled the data to conform to this and I used the "everything before first '_'" . Since samples under the same species are labeled like this 'agu_H8' or 'agu_F5' etc, a Species label 'agu' is generated and it seemed to work, i.e. if I don't specify a taxon prior I can run this analysis just fine.

As soon as I include 2 sequences of agu + mk in a MRCA Taxon prior in the Priors panel the analysis fails.
For example I have these labels in the dataset

mk_B2
agu_A8
agu_H7

and the MRCA built has this

<distribution id="prior" spec="CompoundDistribution">
                <distribution id="AG.prior" spec="beast.base.evolution.tree.MRCAPrior" tree="@Tree.t:shorty">
                    <taxonset id="AG" spec="TaxonSet">
                        <taxon id="agu_A8_" spec="TaxonSet">
                            <taxon id="agu_A81" spec="Taxon"/>
                        </taxon>
                        <taxon id="agu_H7_" spec="TaxonSet">
                            <taxon id="agu_H71" spec="Taxon"/>
                        </taxon>
                        <taxon id="mk_B2_" spec="TaxonSet">
                            <taxon id="mk_B21" spec="Taxon"/>

and I got this error

validate and intialize error: Taxon <agu_A8_> could not be found in list of taxa. Choose one of [mob, olb, rz, oli, mk, agu]

If I use agu as a label for both I get another error

IDs should be unique. Duplicate id 'agu' found

Is there a way to fix this? I have no problem to manually edit the xml as a workaround now, but I haven't found a way to conciliate this.

Maybe this is related to this issue #957

Please find attached the xml generated moreprior.xml, the shorty.fasta file and the modified xml I tried to use replace.xml

shorty.txt
moreprior.txt
replace.txt

Thanks for your help.

Andrés

@rbouckaert
Copy link
Member

rbouckaert commented Apr 18, 2023

Hi Andrés,

In snapper, there is only a single tree: the species tree, and the taxa of that tree are [mob, olb, rz, oli, mk, agu], so the MRCA prior should refer to these taxa, not the lineage taxa specified in the alignment. So, you were on the right way replacing agu_A8_ withagu. But since the agu taxon was already specified in the taxonset for the tree, an idref attribute should be used instead of an id attribute. If you replace in replace.txt

                    <taxonset id="AG" spec="TaxonSet">
                        <taxon id="agu" spec="TaxonSet">
                            <taxon id="agu_A81" spec="Taxon"/>
                        </taxon>
                        <taxon id="agu" spec="TaxonSet">
                            <taxon id="agu_H71" spec="Taxon"/>
                        </taxon>
                        <taxon id="mk" spec="TaxonSet">
                            <taxon id="mk_B21" spec="Taxon"/>
                        </taxon>
                    </taxonset>

with

                    <taxonset id="AG" spec="TaxonSet">
                        <taxon idref="agu"/>
                        <taxon idref="mk"/>
                    </taxonset>

it will run.

In BEAUti, there seems to be a problem with the MRCAPriorInputEditor picking up the correct taxon sets after they have been edited in the TaxonSetInputEditor in the snapper template, which is a BeastFX issues, so I'll create an issue there (CompEvol/BeastFX#50) and close this one.

@drelo
Copy link
Author

drelo commented Apr 18, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants