Skip to content

Commit

Permalink
added test cases for new dynamic thresholding
Browse files Browse the repository at this point in the history
  • Loading branch information
crosenth committed Feb 21, 2015
1 parent f5d6a52 commit b8f3bdd
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 6 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
43 changes: 37 additions & 6 deletions tests/test_classifier.py
Expand Up @@ -327,10 +327,9 @@ def test09(self):
self.assertTrue(filecmp.cmp(classify_ref, classify_out))
self.assertTrue(filecmp.cmp(details_ref, details_out))


def test10(self):
"""
Parse non-default blast result files that have haders
Parse non-default blast result files that have headers
"""

thisdatadir = self.thisdatadir
Expand All @@ -340,7 +339,6 @@ def test10(self):
outdir = self.mkoutdir()

classify_out = os.path.join(outdir, 'classifications.csv')
details_out = os.path.join(outdir, 'details.csv')

blast = os.path.join(thisdatadir, 'blast_extrafields.csv.bz2')
taxonomy = os.path.join(thisdatadir, 'taxonomy.csv.bz2')
Expand All @@ -349,12 +347,9 @@ def test10(self):
outdir = self.mkoutdir()

classify_out = os.path.join(outdir, 'classifications.csv.bz2')
details_out = os.path.join(outdir, 'details.csv.bz2')

classify_ref = os.path.join(
thisdatadir, this_test, 'classifications.csv.bz2')
details_ref = os.path.join(
thisdatadir, this_test, 'details.csv.bz2')

args = [
'--has-header',
Expand All @@ -368,3 +363,39 @@ def test10(self):
self.main(args)

self.assertTrue(filecmp.cmp(classify_ref, classify_out))

def test11(self):
"""
Test dynamic thresholding
github issue #32
"""

thisdatadir = self.thisdatadir

this_test = sys._getframe().f_code.co_name

blast = os.path.join(thisdatadir, this_test, 'blast.csv.bz2')
taxonomy = os.path.join(thisdatadir, this_test, 'taxonomy.csv.bz2')
seq_info = os.path.join(thisdatadir, this_test, 'seq_info.csv.bz2')

outdir = self.mkoutdir()

classify_out = os.path.join(outdir, 'classifications.csv.bz2')
details_out = os.path.join(outdir, 'details.csv.bz2')

classify_ref = os.path.join(
thisdatadir, this_test, 'classifications.csv.bz2')
details_ref = os.path.join(
thisdatadir, this_test, 'details.csv.bz2')

args = ['--details-out', details_out,
'--out', classify_out,
blast, seq_info, taxonomy]

log.info(self.log_info.format(' '.join(map(str, args))))

self.main(args)

self.assertTrue(filecmp.cmp(classify_ref, classify_out))
self.assertTrue(filecmp.cmp(details_ref, details_out))

0 comments on commit b8f3bdd

Please sign in to comment.