:py:mod:`micom.taxonomy` ======================== .. py:module:: micom.taxonomy .. autoapi-nested-parse:: Helpers to convert external data to a MICOM taxonomy. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: micom.taxonomy.build_from_qiime micom.taxonomy.qiime_to_micom micom.taxonomy.rank_prefixes micom.taxonomy.unify_rank_prefixes Attributes ~~~~~~~~~~ .. autoapisummary:: micom.taxonomy.RANKS .. py:data:: RANKS :value: ['kingdom', 'phylum', 'class', 'order', 'family', 'genus', 'species', 'strain'] .. py:function:: build_from_qiime(abundance: pandas.DataFrame, taxonomy: pandas.Series, collapse_on: str = 'genus', trim_rank_prefix: bool = False) -> pandas.DataFrame Build the specification for the community models. .. py:function:: qiime_to_micom(feature_table, taxonomy, collapse_on='genus') Load a micom taxonomy from Qiime 2 data. :param feature_table: Path to a Qiime 2 FeatureTable artifact. :type feature_table: str :param taxonomy: Path to a Qiime 2 FeatureData[Taxonomy] artifact. :type taxonomy: str :param collapse_on: The taxa ranks to collapse on. This will dictate how strict the database matching will be as well. :type collapse_on: str or List[str] :returns: A micom taxonomy containing abundances and taxonomy calls in long format. :rtype: pd.DataFrame .. py:function:: rank_prefixes(manifest: pandas.DataFrame) -> pandas.Series Get the used prefixes for taxonomic ranks. :param manifest: A model database manifest. :type manifest: pandas.DataFrame :returns: The detected prefix for each taxonomic rank in the manifest. :rtype: pandas.Series .. py:function:: unify_rank_prefixes(taxonomy: pandas.DataFrame, manifest: pandas.DataFrame) -> pandas.DataFrame Handle taxonomic rank prefixes in the taxonomy or database manifest. :param taxonomy: A taxonomy table. :type taxonomy: pandas.DataFrame :param manifest: A database manifest. :type manifest: pandas.DataFrame :returns: The taxonomy with adjusted taxa names consistent with the database. :rtype: tuple of pandas.DataFrame