# Path: graftm/taxonomy_cleaner.py
# class TaxonomyCleaner:
# 
#     meaningless_taxonomic_names = set([
#         'k__', 'd__', 'p__', 'c__', 'o__','f__', 'g__', 's__'])
# 
#     def remove_empty_ranks(self, tax_list):
#         '''
#         Removes empty rank prefixes
# 
#         Parameters
#         ----------
#         tax_list    : list
#             A list of taxonomic ranks.
#         Returns
#         -------
#         A list of taxonomic ranks with empty prefixes removed.
#         '''
#         new_tax_list = []
#         for rank in tax_list:
#             if rank not in self.meaningless_taxonomic_names:
#                 new_tax_list.append(rank)
#         return new_tax_list


import re
import string
import logging
from graftm.taxonomy_cleaner import TaxonomyCleaner
            seq_name = splits[0]
            taxon = splits[1]
            lineage_index = taxon_to_lineage_index[taxon]
            if lineage_index==0:
                # Don't include Root in the taxonomy
                taxonomy_dictionary[seq_name] = []
            else:
                full_taxonomy_rev = []
                while lineage_index > 0:
                    full_taxonomy_rev.append(taxon)
                    taxon = lineages[lineage_index][taxon]
                    lineage_index = lineage_index-1
                taxonomy_dictionary[seq_name] = list(reversed(full_taxonomy_rev))

        return taxonomy_dictionary

    def write_taxonomy_and_seqinfo_files(self, taxonomies, output_taxonomy_file, output_seqinfo_file):
        '''Write out taxonomy and seqinfo files as required by taxtastic
        from known taxonomies

        Parameters
        ----------
        taxonomies:
            hash of taxon_id to array of taxonomic information
        output_taxonomy_file:
            write taxtastic-compatible 'taxonomy' file here
        output_seqinfo_file:
            write taxtastic-compatible 'seqinfo' file here'''

        first_pass_id_and_taxonomies = []

# Path: graftm/taxonomy_cleaner.py
# class TaxonomyCleaner:
# 
#     meaningless_taxonomic_names = set([
#         'k__', 'd__', 'p__', 'c__', 'o__','f__', 'g__', 's__'])
# 
#     def remove_empty_ranks(self, tax_list):
#         '''
#         Removes empty rank prefixes
# 
#         Parameters
#         ----------
#         tax_list    : list
#             A list of taxonomic ranks.
#         Returns
#         -------
#         A list of taxonomic ranks with empty prefixes removed.
#         '''
#         new_tax_list = []
#         for rank in tax_list:
#             if rank not in self.meaningless_taxonomic_names:
#                 new_tax_list.append(rank)
#         return new_tax_list


# Path: graftm/getaxnseq.py
import re
import string
import logging
from graftm.taxonomy_cleaner import TaxonomyCleaner

            seq_name = splits[0]
            taxon = splits[1]
            lineage_index = taxon_to_lineage_index[taxon]
            if lineage_index==0:
                # Don't include Root in the taxonomy
                taxonomy_dictionary[seq_name] = []
            else:
                full_taxonomy_rev = []
                while lineage_index > 0:
                    full_taxonomy_rev.append(taxon)
                    taxon = lineages[lineage_index][taxon]
                    lineage_index = lineage_index-1
                taxonomy_dictionary[seq_name] = list(reversed(full_taxonomy_rev))

        return taxonomy_dictionary

    def write_taxonomy_and_seqinfo_files(self, taxonomies, output_taxonomy_file, output_seqinfo_file):
        '''Write out taxonomy and seqinfo files as required by taxtastic
        from known taxonomies

        Parameters
        ----------
        taxonomies:
            hash of taxon_id to array of taxonomic information
        output_taxonomy_file:
            write taxtastic-compatible 'taxonomy' file here
        output_seqinfo_file:
            write taxtastic-compatible 'seqinfo' file here'''

        first_pass_id_and_taxonomies = []

        tc=TaxonomyCleaner()