rotifer.db.local.ete3.TaxonomyCursor#
- class rotifer.db.local.ete3.TaxonomyCursor(*args, **kwargs)[source]#
Bases:
BaseCursorFetch NCBI Taxonomy data from the local ETE toolkit database.
Phased out taxonomy identifiers are transparently replaced by their current equivalents, and the original identifiers are reported in the
alternative_taxidscolumn.- Parameters:
- progressbool, default False
Whether to print a progress bar.
- Attributes:
- ete3ete3.ncbi_taxonomy.ncbiquery.NCBITaxa
The underlying ETE toolkit database handle.
- taxcolslist of str
Columns of the returned dataframes:
taxid,organism,superkingdom,lineage,classificationandalternative_taxids.
See also
rotifer.db.ncbi.TaxonomyCursordelegator that falls back to NCBI Entrez
Examples
>>> from rotifer.db.local import ete3 >>> tc = ete3.TaxonomyCursor() >>> t = tc.fetchall([2599])
- __getitem__(accessions)[source]#
Fetch taxonomy data for one or more taxids, dictionary style.
- Parameters:
- accessionsint, str or iterable
NCBI Taxonomy identifiers.
- Returns:
- pandas.DataFrame
One row per taxon, with the columns listed in
taxcols. Identifiers not found in the database are registered as missing.
- fetchall(accessions)[source]#
Fetch taxonomy data for all taxids as one dataframe.
- Parameters:
- accessionsiterable
NCBI Taxonomy identifiers.
- Returns:
- pandas.DataFrame
One row per taxon, with the columns listed in
taxcols.
- fetchone(accessions)[source]#
Iterate over taxonomy records, one taxon at a time.
- Parameters:
- accessionsiterable
NCBI Taxonomy identifiers.
- Yields:
- pandas.DataFrame
The rows of one taxon.