INNER CODE UNIT · Python

to_tbl

steineggerlab/Metabuli · util/gtdb_to_taxdump.py:193

    def to_tbl(self):
        """ Writing table of values [taxID, name, rank] """
        ## writing header
        x = ['taxID', 'name', 'rank']
        print('\t'.join(x))
        ## writing root
        self.__seen = {}
        x = [str(self.__graph_nodeIDs['root']), 'root', 'no rank']
        print('\t'.join(x))
        self._to_tbl_iter('root')

    def _to_tbl_iter_idx(self, vertex, idx):        
        for child in self.__graph_dict[vertex]:
            if child in self.__seen:
                continue
            self.__seen[child] = 1
            # tbl row
            idx[child] = str(self.__graph_nodeIDs[child])

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…