Search in sources :

Example 36 with TaxonSet

use of beast.evolution.alignment.TaxonSet in project beast2 by CompEvol.

the class GeneTreeForSpeciesTreeDistribution method getSetID.

/**
 * @param lineageID
 * @return species ID to which the lineage ID belongs according to the TaxonSets
 */
String getSetID(final String lineageID) {
    final TaxonSet taxonSuperset = speciesTreePriorInput.get().taxonSetInput.get();
    final List<Taxon> taxonSets = taxonSuperset.taxonsetInput.get();
    for (final Taxon taxonSet : taxonSets) {
        final List<Taxon> taxa = ((TaxonSet) taxonSet).taxonsetInput.get();
        for (final Taxon aTaxa : taxa) {
            if (aTaxa.getID().equals(lineageID)) {
                return taxonSet.getID();
            }
        }
    }
    return null;
}
Also used : Taxon(beast.evolution.alignment.Taxon) TaxonSet(beast.evolution.alignment.TaxonSet)

Aggregations

TaxonSet (beast.evolution.alignment.TaxonSet)36 Taxon (beast.evolution.alignment.Taxon)19 ArrayList (java.util.ArrayList)13 Alignment (beast.evolution.alignment.Alignment)11 RealParameter (beast.core.parameter.RealParameter)10 Test (org.junit.Test)10 Tree (beast.evolution.tree.Tree)9 ConstantPopulation (beast.evolution.tree.coalescent.ConstantPopulation)8 MRCAPrior (beast.math.distributions.MRCAPrior)8 Locus (bacter.Locus)5 SiteModel (beast.evolution.sitemodel.SiteModel)5 Node (beast.evolution.tree.Node)5 RandomTree (beast.evolution.tree.RandomTree)5 HashMap (java.util.HashMap)4 HashSet (java.util.HashSet)4 List (java.util.List)4 Conversion (bacter.Conversion)3 ConversionGraph (bacter.ConversionGraph)3 BEASTInterface (beast.core.BEASTInterface)3 CompoundDistribution (beast.core.util.CompoundDistribution)3