Skip to content

Commit

Permalink
update tests for strain addition
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Feb 18, 2018
1 parent 9a38ac6 commit ef6cd39
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 28 deletions.
42 changes: 21 additions & 21 deletions tests/test-data/lca/classify-by-both.csv
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
ID,status,superkingdom,phylum,class,order,family,genus,species
TARA_ANE_MAG_00011,found,Bacteria,Proteobacteria,Alphaproteobacteria,Rickettsiales,,,
TARA_ANE_MAG_00015,found,Bacteria,Chloroflexi,Dehalococcoidetes,,,,
TARA_ANE_MAG_00041,found,Bacteria,Bacteroidetes,Flavobacteriia,Flavobacteriales,,,
TARA_ANE_MAG_00044,found,Bacteria,Proteobacteria,Alphaproteobacteria,Rickettsiales,,,
TARA_ANE_MAG_00063,found,Archaea,Euryarchaeota,,,,,
TARA_ANE_MAG_00068,found,Bacteria,Candidatus_Marinimicrobia ,,,,,
TARA_ANE_MAG_00069,found,Bacteria,Proteobacteria,Alphaproteobacteria,Rickettsiales,,,
TARA_ANW_MAG_00005,found,Bacteria,Proteobacteria,Gammaproteobacteria,,,,
TARA_ANW_MAG_00020,found,Bacteria,Proteobacteria,Alphaproteobacteria,Rhodospirillales,Rhodospirillaceae,,
TARA_ANW_MAG_00034,found,Bacteria,Bacteroidetes,Flavobacteriia,Flavobacteriales,,,
TARA_ANW_MAG_00051,found,Bacteria,Proteobacteria,Alphaproteobacteria,Rickettsiales,Pelagibacteraceae,,
TARA_ANW_MAG_00083,found,Eukaryota,Haptophyta,Prymnesiophyceae,Isochrysidales,Noelaerhabdaceae,Emiliania,
TARA_ANW_MAG_00084,found,Eukaryota,Cryptophyta,Cryptophyceae,Pyrenomonadales,Geminigeraceae,Guillardia,
TARA_ANW_MAG_00085,found,Eukaryota,Haptophyta,Prymnesiophyceae,Isochrysidales,Noelaerhabdaceae,Emiliania,
TARA_ASE_MAG_00007,found,Bacteria,Proteobacteria,Gammaproteobacteria,,,,
TARA_ASE_MAG_00009,found,Archaea,Euryarchaeota,,,,,
TARA_ASE_MAG_00015,found,Bacteria,Bacteroidetes,Flavobacteriia,Flavobacteriales,,,
TARA_ASE_MAG_00018,found,Archaea,Euryarchaeota,,,,,
TARA_ASE_MAG_00028,found,Bacteria,Planctomycetes,Planctomycetia,Planctomycetales,Planctomycetaceae,,
TARA_ASE_MAG_00031,found,Bacteria,Proteobacteria,Gammaproteobacteria,Alteromonadales,Alteromonadaceae,Alteromonas,Alteromonas_macleodii
ID,status,superkingdom,phylum,class,order,family,genus,species,strain
TARA_ANE_MAG_00011,found,Bacteria,Proteobacteria,Alphaproteobacteria,Rickettsiales,,,,
TARA_ANE_MAG_00015,found,Bacteria,Chloroflexi,Dehalococcoidetes,,,,,
TARA_ANE_MAG_00041,found,Bacteria,Bacteroidetes,Flavobacteriia,Flavobacteriales,,,,
TARA_ANE_MAG_00044,found,Bacteria,Proteobacteria,Alphaproteobacteria,Rickettsiales,,,,
TARA_ANE_MAG_00063,found,Archaea,Euryarchaeota,,,,,,
TARA_ANE_MAG_00068,found,Bacteria,Candidatus_Marinimicrobia ,,,,,,
TARA_ANE_MAG_00069,found,Bacteria,Proteobacteria,Alphaproteobacteria,Rickettsiales,,,,
TARA_ANW_MAG_00005,found,Bacteria,Proteobacteria,Gammaproteobacteria,,,,,
TARA_ANW_MAG_00020,found,Bacteria,Proteobacteria,Alphaproteobacteria,Rhodospirillales,Rhodospirillaceae,,,
TARA_ANW_MAG_00034,found,Bacteria,Bacteroidetes,Flavobacteriia,Flavobacteriales,,,,
TARA_ANW_MAG_00051,found,Bacteria,Proteobacteria,Alphaproteobacteria,Rickettsiales,Pelagibacteraceae,,,
TARA_ANW_MAG_00083,found,Eukaryota,Haptophyta,Prymnesiophyceae,Isochrysidales,Noelaerhabdaceae,Emiliania,,
TARA_ANW_MAG_00084,found,Eukaryota,Cryptophyta,Cryptophyceae,Pyrenomonadales,Geminigeraceae,Guillardia,,
TARA_ANW_MAG_00085,found,Eukaryota,Haptophyta,Prymnesiophyceae,Isochrysidales,Noelaerhabdaceae,Emiliania,,
TARA_ASE_MAG_00007,found,Bacteria,Proteobacteria,Gammaproteobacteria,,,,,
TARA_ASE_MAG_00009,found,Archaea,Euryarchaeota,,,,,,
TARA_ASE_MAG_00015,found,Bacteria,Bacteroidetes,Flavobacteriia,Flavobacteriales,,,,
TARA_ASE_MAG_00018,found,Archaea,Euryarchaeota,,,,,,
TARA_ASE_MAG_00028,found,Bacteria,Planctomycetes,Planctomycetia,Planctomycetales,Planctomycetaceae,,,
TARA_ASE_MAG_00031,found,Bacteria,Proteobacteria,Gammaproteobacteria,Alteromonadales,Alteromonadaceae,Alteromonas,Alteromonas_macleodii,
16 changes: 9 additions & 7 deletions tests/test_lca.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def test_single_classify_empty():
print(out)
print(err)

assert 'data/GCF_000005845.2_ASM584v2_genomic.fna.gz,nomatch,,,,,,,' in out
assert 'data/GCF_000005845.2_ASM584v2_genomic.fna.gz,nomatch,,,,,,,,' in out
assert 'classified 1 signatures total' in err
assert 'loaded 1 LCA databases' in err

Expand Down Expand Up @@ -452,7 +452,7 @@ def test_unassigned_last_index_and_classify():
print(err)

assert 'ID,status,superkingdom,phylum,class,order,family,genus,species' in out
assert 'TARA_ASE_MAG_00031,found,Bacteria,Proteobacteria,Gammaproteobacteria,Alteromonadales,Alteromonadaceae,,\r\n' in out
assert 'TARA_ASE_MAG_00031,found,Bacteria,Proteobacteria,Gammaproteobacteria,Alteromonadales,Alteromonadaceae,,,\r\n' in out
assert 'classified 1 signatures total' in err
assert 'loaded 1 LCA databases' in err

Expand Down Expand Up @@ -487,7 +487,7 @@ def test_index_and_classify_internal_unassigned_multi():
print(err)

assert 'ID,status,superkingdom,phylum,class,order,family,genus,species' in out
assert 'TARA_ASE_MAG_00031,found,Bacteria,Proteobacteria,unassigned,unassigned,Alteromonadaceae,,\r\n' in out
assert 'TARA_ASE_MAG_00031,found,Bacteria,Proteobacteria,unassigned,unassigned,Alteromonadaceae,,,\r\n' in out
assert 'classified 1 signatures total' in err
assert 'loaded 1 LCA databases' in err

Expand All @@ -500,7 +500,7 @@ def test_index_and_classify_internal_unassigned_multi():
print(err)

assert 'ID,status,superkingdom,phylum,class,order,family,genus,species' in out
assert 'TARA_PSW_MAG_00136,found,Eukaryota,Chlorophyta,Prasinophyceae,unassigned,unassigned,Ostreococcus,\r\n' in out
assert 'TARA_PSW_MAG_00136,found,Eukaryota,Chlorophyta,Prasinophyceae,unassigned,unassigned,Ostreococcus,,\r\n' in out
assert 'classified 1 signatures total' in err
assert 'loaded 1 LCA databases' in err

Expand All @@ -519,7 +519,7 @@ def test_multi_db_classify():
print(err)

assert 'ID,status,superkingdom,phylum,class,order,family,genus,species' in out
assert 'TARA_ASE_MAG_00031,found,Bacteria,Proteobacteria,Gammaproteobacteria,Alteromonadales,,,' in out
assert 'TARA_ASE_MAG_00031,found,Bacteria,Proteobacteria,Gammaproteobacteria,Alteromonadales,,,,' in out
assert 'classified 1 signatures total' in err
assert 'loaded 2 LCA databases' in err

Expand Down Expand Up @@ -719,6 +719,7 @@ def test_rankinfo_on_multi():
lines.remove('family: 695 (19.2%)')
lines.remove('genus: 681 (18.8%)')
lines.remove('species: 200 (5.5%)')
lines.remove('strain: 0 (0.0%)')

assert not lines

Expand All @@ -742,6 +743,7 @@ def test_rankinfo_on_single():
lines.remove('family: 695 (19.2%)')
lines.remove('genus: 681 (18.8%)')
lines.remove('species: 200 (5.5%)')
lines.remove('strain: 0 (0.0%)')

assert not lines

Expand Down Expand Up @@ -806,7 +808,7 @@ def test_single_gather():
print(out)
print(err)

assert '2.0 Mbp 100.0% Alteromonas Alteromonas_macleodii' in out
assert '2.0 Mbp 100.0% 100.0% Alteromonas Alteromonas_macleodii' in out
assert 'Query is completely assigned.'


Expand Down Expand Up @@ -836,5 +838,5 @@ def test_gather_unknown_hashes():
print(out)
print(err)

assert '270.0 kbp 11.5% Archaea; family novelFamily_I' in out
assert '270.0 kbp 11.5% 21.4% Archaea; family novelFamily_I' in out
assert '88.5% (2.1 Mbp) have no assignment.' in out

0 comments on commit ef6cd39

Please sign in to comment.