Primary manager for collections of Taxon objects.
__init__ handles keyword arguments: oid, label or “is_mutable”. If an iterable is passed as the first argument, then for every string in the iterable a Taxon object with the string is constructed and added to the set, while for every Taxon object in the iterable a new (distinct) Taxon object with the same label is constructed and added to the set.
Adds taxon to self.
Returns mask of all taxa.
Removes all taxa from this list.
Returns complement of the split bitmask.
Returns description of object, up to level depth.
Retrieves list of taxon objects with given id OR label (if both are given, the any match is included). If taxon does not exist then an empty list is returned.
Retrieves bitmask represent all taxa specified by keyword-specified list of taxon objects (taxa=), labels (labels=) or oids (oids=).
Retrieves taxon object with given id OR label (if both are given, the first match found is returned). If taxon does not exist then None is returned. Also accepts case_insensitive as a keyword argument; if label is used as a selection criterion, and case_insensitive is True [default=False], then matching is case insensitive.
Returns True if all taxon given by keyword argument taxa in self, or at least one Taxon object exists in self with oid or label for every oid given in list of oid’s by keyword arg oids, or every label in list of labels given by keyword arg labels.
Returns True if taxon taxon, or with oid or label, exists (supplied by keywords; matches any)
Convenience method to return all taxa labels.
Creates and add a new Taxon if not already in the taxon index.
Returns a TaxonSetPartition object, corresponding to this object partition according to criteria/values given in keyword arguments:
- membership_func
- A function that takes a Taxon object as an argument and returns a a population membership identifier or flag (e.g., a string, an integer) .
- membership_attr_name
- Name of an attribute of Taxon objects that serves as an identifier for subset membership.
- membership_dict
- A dictionary with Taxon objects as keys and population membership identifier or flag as values (e.g., a string, an integer).
- membership_lists
- A container of containers of Taxon objects, with every Taxon object in taxon_set represented once and only once in the sub-containers.
Retrieves taxon object with given id OR label (if both are given, the first match found is returned). If taxon does not exist and the TaxonSet is not mutable, an exception is raised. If taxon does not exist and the TaxonSet is mutable, then a new taxon is created, added, and returned. Also accepts case_insensitive as a keyword argument; if label is used as a selection criterion, and case_insensitive is True [default=False], then matching is case insensitive.
Represents a split as a newick string.
Returns bitstring representation of split_bitmask.
Returns list of taxa represented by split.
Returns unique bitmask of given taxon. Will raise index error if taxon does not exist.
A taxon associated with a sequence or a node on a tree.
__init__ can take the kwargs needed by base.IdTagged, or the label keyword can be inferred from the label of an unnamed argument
Compares taxon1 and taxon2 based on label.
Returns description of object, up to level depth.