def __init_taxonomy_from_frame(self, taxonomy_dataframe: pd.DataFrame, taxonomy_notation: Optional[str], order_ranks: Optional[Sequence[str]]) -> pd.DataFrame:
    "Main method that produces taxonomy sheet from dataframe.\n\n        Parameters\n        ----------\n        taxonomy_dataframe\n            :class:`~pandas.DataFrame` with taxa split by ranks.\n        taxonomy_notation\n            Taxonomy lineage notation style. Can be one of :const:`pmaf.internals._constants.AVAIL_TAXONOMY_NOTATIONS`\n        order_ranks\n            List with the target rank order. Default is set to None. The 'silva' notation require `order_ranks`.\n\n        Returns\n        -------\n            :class:`~pandas.DataFrame`\n        "
    valid_ranks = extract_valid_ranks(taxonomy_dataframe.columns, VALID_RANKS)
    if (valid_ranks is not None):
        if (len(valid_ranks) > 0):
            return pd.concat([taxonomy_dataframe, pd.DataFrame(data='', index=taxonomy_dataframe.index, columns=[rank for rank in VALID_RANKS if (rank not in valid_ranks)])], axis=1)
        else:
            taxonomy_series = taxonomy_dataframe.apply((lambda taxa: ';'.join(taxa.values.tolist())), axis=1)
            return self.__init_taxonomy_from_lineages(taxonomy_series, taxonomy_notation, order_ranks)
    else:
        valid_ranks = cols2ranks(taxonomy_dataframe.columns)
        taxonomy_dataframe.columns = valid_ranks
        taxonomy_series = taxonomy_dataframe.apply((lambda taxa: ';'.join([(t if isinstance(t, str) else '') for t in taxa.values])), axis=1)
        return self.__init_taxonomy_from_lineages(taxonomy_series, taxonomy_notation, order_ranks)
Main method that produces taxonomy sheet from dataframe.

Parameters
----------
taxonomy_dataframe
    :class:`~pandas.DataFrame` with taxa split by ranks.
taxonomy_notation
    Taxonomy lineage notation style. Can be one of :const:`pmaf.internals._constants.AVAIL_TAXONOMY_NOTATIONS`
order_ranks
    List with the target rank order. Default is set to None. The 'silva' notation require `order_ranks`.

Returns
-------
    :class:`~pandas.DataFrame`
def __init_taxonomy_from_frame(self, taxonomy_dataframe: pd.DataFrame, taxonomy_notation: Optional[str], order_ranks: Optional[Sequence[str]]) -> pd.DataFrame:
    "Main method that produces taxonomy sheet from dataframe.\n\n        Parameters\n        ----------\n        taxonomy_dataframe\n            :class:`~pandas.DataFrame` with taxa split by ranks.\n        taxonomy_notation\n            Taxonomy lineage notation style. Can be one of :const:`pmaf.internals._constants.AVAIL_TAXONOMY_NOTATIONS`\n        order_ranks\n            List with the target rank order. Default is set to None. The 'silva' notation require `order_ranks`.\n\n        Returns\n        -------\n            :class:`~pandas.DataFrame`\n        "
    valid_ranks = extract_valid_ranks(taxonomy_dataframe.columns, VALID_RANKS)
    if (valid_ranks is not None):
        if (len(valid_ranks) > 0):
            return pd.concat([taxonomy_dataframe, pd.DataFrame(data=, index=taxonomy_dataframe.index, columns=[rank for rank in VALID_RANKS if (rank not in valid_ranks)])], axis=1)
        else:
            taxonomy_series = taxonomy_dataframe.apply((lambda taxa: ';'.join(taxa.values.tolist())), axis=1)
            return self.__init_taxonomy_from_lineages(taxonomy_series, taxonomy_notation, order_ranks)
    else:
        valid_ranks = cols2ranks(taxonomy_dataframe.columns)
        taxonomy_dataframe.columns = valid_ranks
        taxonomy_series = taxonomy_dataframe.apply((lambda taxa: ';'.join([(t if isinstance(t, str) else ) for t in taxa.values])), axis=1)
        return self.__init_taxonomy_from_lineages(taxonomy_series, taxonomy_notation, order_ranks)