Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions taxtastic/subcommands/lineage_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
('order', 'o'),
('class', 'c'),
('phylum', 'p'),
('superkingdom', 'k'),
('domain', 'd'),

Lineages are truncated to either the most specific defined rank or
species, and missing tax_names at a given rank are replaced with the
Expand Down Expand Up @@ -122,7 +122,7 @@ def action(args):
('order', 'o'),
('class', 'c'),
('phylum', 'p'),
('superkingdom', 'k'),
('domain', 'd'),
]

def clean(tax_name, rexp=re.compile(r'[^-A-Z0-9_\[\]]+', re.I)):
Expand Down
4 changes: 2 additions & 2 deletions testfiles/lactobacillus2-0.2.refpkg/CONTENTS.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"md5": {
"profile": "7b36841cae1db2a2c4d60ea44db4aba9",
"phylo_model": "f288a37a50b2a113110185fbc8f48028",
"taxonomy": "9bc2edc9c67801c4a9acd7e166144f4a",
"taxonomy": "09fe0f3f9bc813154af0e42ce4b6645d",
"tree": "2f11faa616fc7f04d7694436b5cca05f",
"aln_fasta": "fd8a198c0215f3577f9b083da87128bb",
"aln_fasta": "ff1fa6a07a090b96c2f77f8449010331",
"seq_info": "230bfb5a78075a012e114bef635a4b18",
"aln_sto": "6420db16bded3a5b119b16e2972be66e",
"tree_stats": "2e57e7e56708f4b31db8025ef99722ef"
Expand Down
92 changes: 46 additions & 46 deletions testfiles/lactobacillus2-0.2.refpkg/chosen.fasta

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions testfiles/lactobacillus2-0.2.refpkg/taxtable.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"tax_id","parent_id","rank","tax_name","root","below_root","superkingdom","phylum","class","order","family","genus","species_group","species"
"tax_id","parent_id","rank","tax_name","root","cellular_root","domain","phylum","class","order","family","genus","species_group","species"
"1","1","root","root","1","","","","","","","","",""
"131567","1","below_root","cellular organisms","1","131567","","","","","","","",""
"2","131567","superkingdom","Bacteria","1","131567","2","","","","","","",""
"131567","1","cellular_root","cellular organisms","1","131567","","","","","","","",""
"2","131567","domain","Bacteria","1","131567","2","","","","","","",""
"1239","2","phylum","Firmicutes","1","131567","2","1239","","","","","",""
"1224","2","phylum","Proteobacteria","1","131567","2","1224","","","","","",""
"91061","1239","class","Bacilli","1","131567","2","1239","91061","","","","",""
Expand Down
6 changes: 3 additions & 3 deletions testfiles/minimal_taxonomy.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"tax_id","parent_id","rank","tax_name","root","below_root","superkingdom","phylum","class","order","family","genus","species"
"tax_id","parent_id","rank","tax_name","root","cellular_root","domain","phylum","class","order","family","genus","species"
"1","1","root","root","1","","","","","","","",""
"131567","1","below_root","cellular organisms","1","131567","","","","","","",""
"2","131567","superkingdom","Bacteria","1","131567","2","","","","","",""
"131567","1","cellular_root","cellular organisms","1","131567","","","","","","",""
"2","131567","domain","Bacteria","1","131567","2","","","","","",""
"1239","2","phylum","Firmicutes","1","131567","2","1239","","","","",""
"91061","1239","class","Bacilli","1","131567","2","1239","91061","","","",""
"186826","91061","order","Lactobacillales","1","131567","2","1239","91061","186826","","",""
Expand Down
6 changes: 3 additions & 3 deletions testfiles/simple_taxtable.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"tax_id","parent_id","rank","tax_name","root","below_root","superkingdom","superphylum","phylum","subphylum","class","subclass","order","below_order","below_below_order","suborder","family","below_family","genus","subgenus","species_group","species","below_species","below_below_species","subspecies","below_subspecies"
"tax_id","parent_id","rank","tax_name","root","cellular_root","domain","superphylum","phylum","subphylum","class","subclass","order","below_order","below_below_order","suborder","family","below_family","genus","subgenus","species_group","species","below_species","below_below_species","subspecies","below_subspecies"
"1","1","root","root","1","","","","","","","","","","","","","","","","","","","","",""
"131567","1","below_root","cellular organisms","1","131567","","","","","","","","","","","","","","","","","","","",""
"2","131567","superkingdom","Bacteria","1","131567","2","","","","","","","","","","","","","","","","","","",""
"131567","1","cellular_root","cellular organisms","1","131567","","","","","","","","","","","","","","","","","","","",""
"2","131567","domain","Bacteria","1","131567","2","","","","","","","","","","","","","","","","","","",""
"68336","2","superphylum","Bacteroidetes/Chlorobi group","1","131567","2","68336","","","","","","","","","","","","","","","","","",""
"201174","2","phylum","Actinobacteria","1","131567","2","","201174","","","","","","","","","","","","","","","","",""
"976","68336","phylum","Bacteroidetes","1","131567","2","68336","976","","","","","","","","","","","","","","","","",""
Expand Down
Binary file modified testfiles/small_taxonomy.db
Binary file not shown.
10 changes: 5 additions & 5 deletions testfiles/tax_table.csv
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"tax_id","parent_id","rank","tax_name","root","below_root","superkingdom","below_superkingdom","below_below_superkingdom","superphylum","phylum","class","subclass","order","below_order","below_below_order","suborder","family","below_family","genus","species_group","species_subgroup","species","below_species"
"tax_id","parent_id","rank","tax_name","root","cellular_root","domain","below_domain","below_below_domain","superphylum","phylum","class","subclass","order","below_order","below_below_order","suborder","family","below_family","genus","species_group","species_subgroup","species","below_species"
"1","1","root","root","1","","","","","","","","","","","","","","","","","","",""
"131567","1","below_root","cellular organisms","1","131567","","","","","","","","","","","","","","","","","",""
"2","131567","superkingdom","Bacteria","1","131567","2","","","","","","","","","","","","","","","","",""
"2323","2","below_superkingdom","unclassified Bacteria","1","131567","2","2323","","","","","","","","","","","","","","","",""
"95818","2323","below_below_superkingdom","candidate division TM7","1","131567","2","2323","95818","","","","","","","","","","","","","","",""
"131567","1","cellular_root","cellular organisms","1","131567","","","","","","","","","","","","","","","","","",""
"2","131567","domain","Bacteria","1","131567","2","","","","","","","","","","","","","","","","",""
"2323","2","below_domain","unclassified Bacteria","1","131567","2","2323","","","","","","","","","","","","","","","",""
"95818","2323","below_below_domain","candidate division TM7","1","131567","2","2323","95818","","","","","","","","","","","","","","",""
"68336","2","superphylum","Bacteroidetes/Chlorobi group","1","131567","2","","","68336","","","","","","","","","","","","","",""
"201174","2","phylum","Actinobacteria","1","131567","2","","","","201174","","","","","","","","","","","","",""
"976","68336","phylum","Bacteroidetes","1","131567","2","","","68336","976","","","","","","","","","","","","",""
Expand Down
Binary file modified testfiles/taxdmp.zip
Binary file not shown.
6 changes: 3 additions & 3 deletions testfiles/taxids1.taxtable
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"tax_id","parent_id","rank","tax_name","root","below_root","superkingdom","superphylum","phylum","class","subclass","order","below_order","suborder","family","genus","species"
"tax_id","parent_id","rank","tax_name","root","cellular_root","domain","superphylum","phylum","class","subclass","order","below_order","suborder","family","genus","species"
"1","1","root","root","1","","","","","","","","","","","",""
"131567","1","below_root","cellular organisms","1","131567","","","","","","","","","","",""
"2","131567","superkingdom","Bacteria","1","131567","2","","","","","","","","","",""
"131567","1","cellular_root","cellular organisms","1","131567","","","","","","","","","","",""
"2","131567","domain","Bacteria","1","131567","2","","","","","","","","","",""
"68336","2","superphylum","Bacteroidetes/Chlorobi group","1","131567","2","68336","","","","","","","","",""
"201174","2","phylum","Actinobacteria","1","131567","2","","201174","","","","","","","",""
"976","68336","phylum","Bacteroidetes","1","131567","2","68336","976","","","","","","","",""
Expand Down
4 changes: 2 additions & 2 deletions tests/test_taxit.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def test_all_ranks(self):
with open(self.outfile, **self.openargs) as fp:
self.assertEqual("""tax_name,tax_id,rank
Bacilli,91061,class
Bacteria,2,superkingdom
Bacteria,2,domain
Enterobacteriaceae,543,family
Enterobacteriales,91347,order
Escherichia,561,genus
Expand All @@ -138,7 +138,7 @@ def test_all_ranks(self):
Lactobacillaceae,33958,family
Lactobacillales,186826,order
Lactobacillus,1578,genus
cellular organisms,131567,below_root
cellular organisms,131567,cellular_root
""", fp.read())

def test_species(self):
Expand Down
11 changes: 7 additions & 4 deletions tests/test_taxonomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,15 @@ def test_is_below(self):
self.assertFalse(self.tax.is_below('kingdom', 'family'))
self.assertEqual(
self.tax.ranks_below('species'),
['forma', 'varietas', 'subspecies'])
['forma', 'subvariety', 'varietas', 'serogroup',
'pathogroup', 'morph', 'genotype', 'biotype', 'subspecies'])
self.assertEqual(
self.tax.ranks_below('family'),
['forma', 'varietas', 'subspecies', 'species',
'species_subgroup', 'species_group', 'subgenus',
'genus', 'subtribe', 'tribe', 'subfamily'])
['forma', 'subvariety', 'varietas', 'serogroup', 'pathogroup',
'morph', 'genotype', 'biotype', 'subspecies', 'species',
'species_subgroup', 'species_group', 'subseries', 'series',
'subsection', 'section', 'subgenus', 'genus', 'subtribe',
'tribe', 'subfamily'])

def test_nary_subtree(self):
self.assertRaises(ValueError, self.tax.nary_subtree, None)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_taxtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ def test_lineage(self):
[i.tax_id for i in lineage])

def test_write_taxtable(self):
expected = '''"tax_id","parent_id","rank","tax_name","root","below_root","superkingdom","phylum","class","order","family","genus","species"
expected = '''"tax_id","parent_id","rank","tax_name","root","cellular_root","domain","phylum","class","order","family","genus","species"
"1","1","root","root","1","","","","","","","",""
"131567","1","below_root","cellular organisms","1","131567","","","","","","",""
"2","131567","superkingdom","Bacteria","1","131567","2","","","","","",""
"131567","1","cellular_root","cellular organisms","1","131567","","","","","","",""
"2","131567","domain","Bacteria","1","131567","2","","","","","",""
"1239","2","phylum","Firmicutes","1","131567","2","1239","","","","",""
"91061","1239","class","Bacilli","1","131567","2","1239","91061","","","",""
"186826","91061","order","Lactobacillales","1","131567","2","1239","91061","186826","","",""
Expand Down