Exemple #1
0
    def __taxonomy(self, img, genomeIds, outputTaxonomy):
        metadata = img.genomeMetadata()

        fout = open(outputTaxonomy, "w")
        for genomeId in genomeIds:
            fout.write("IMG_" + genomeId + "\t")
            taxonomy = appendTaxonomyRanks(metadata[genomeId]["taxonomy"])
            taxonomy = [x.replace("unclassified", "") for x in taxonomy]
            fout.write("; ".join(taxonomy) + "\n")

        fout.close()
Exemple #2
0
    def __taxonomy(self, img, genomeIds, outputTaxonomy):
        metadata = img.genomeMetadata()

        fout = open(outputTaxonomy, 'w')
        for genomeId in genomeIds:
            fout.write('IMG_' + genomeId + '\t')
            taxonomy = appendTaxonomyRanks(metadata[genomeId]['taxonomy'])
            taxonomy = [x.replace('unclassified', '') for x in taxonomy]
            fout.write('; '.join(taxonomy) + '\n')

        fout.close()
Exemple #3
0
    def testAppendTaxonomyRanks(self):
        """Verify computation of base count on mixed-case sequence."""
        r = appendTaxonomyRanks(['k', 'p', 'c'], ranks=3)

        self.assertEqual(r, ['k__k', 'p__p', 'c__c'])