Skip to content

Commit

Permalink
v1.0.1: fixes to ecoli test case and proper pypi installation
Browse files Browse the repository at this point in the history
  • Loading branch information
donovan-h-parks committed Jun 12, 2015
1 parent c400db4 commit dd0b476
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
1 change: 1 addition & 0 deletions MANIFEST
@@ -1,6 +1,7 @@
# file GENERATED by distutils, do NOT edit
CHANGES.txt
LICENSE.txt
README.md
README.txt
setup.py
bin/checkm
Expand Down
3 changes: 3 additions & 0 deletions MANIFEST.in
@@ -1,2 +1,5 @@
include *.txt
recursive-include docs *.txt
include README.md
include LICENSE
include ./checkm/VERSION
2 changes: 1 addition & 1 deletion checkm/VERSION
@@ -1 +1 @@
1.0.0
1.0.1
3 changes: 2 additions & 1 deletion checkm/resultsParser.py
Expand Up @@ -35,7 +35,8 @@
from checkm.hmmer import HMMERParser

from checkm.util.pfam import PFAM
from checkm.util.seqUtils import readFasta, writeFasta
from checkm.util.seqUtils import readFasta


class ResultsParser():
"""Parse output of Prodigal+HMMER run and derived statistics."""
Expand Down
19 changes: 9 additions & 10 deletions checkm/test/test_ecoli.py
Expand Up @@ -25,6 +25,7 @@
import ast
import shutil

from checkm.resultsParser import ResultsParser
from checkm.markerSets import MarkerSet
from checkm.defaultValues import DefaultValues
from checkm.common import makeSurePathExists, checkFileExists
Expand Down Expand Up @@ -107,11 +108,13 @@ def run(self, parser, outputDir):
options.alignment_file = None
options.analyze_folder = options.out_folder
options.out_format = 1
options.exclude_markers = None
options.bSkipPseudoGeneCorrection = False
options.bSkipAdjCorrection = False
options.file = os.path.join(options.out_folder, 'qa_test.tsv')
options.bIndividualMarkers = False
options.bSkipOrfCorrection = False
options.bIgnoreThresholds = False
options.aai_strain = 0.95
options.aai_strain = 0.9
options.e_value = 1e-10
options.length = 0.7
options.coverage_file = None
Expand All @@ -124,9 +127,7 @@ def verifyTree(self, outdir):
"""Verify output of tree command."""

# verify bin stats using independently verified ground truth values
with open(os.path.join(outdir, 'storage', DefaultValues.BIN_STATS_PHYLO_OUT), 'r') as f:
s = f.read()
binStats = ast.literal_eval(s)
binStats = ResultsParser(None).parseBinStats(outdir, DefaultValues.BIN_STATS_PHYLO_OUT)

np.testing.assert_almost_equal(binStats['637000110']['GC'], 0.508, decimal=3, err_msg="Failed GC test")
np.testing.assert_almost_equal(binStats['637000110']['GC std'], 0.0, err_msg="Failed GC std test")
Expand Down Expand Up @@ -187,7 +188,7 @@ def verifyLineageSet(self, markerSetFile, bRequireTaxonomy):
uid = lineSplit[2]
lineage = lineSplit[3]
numGenomes = int(lineSplit[4])
markerSet = MarkerSet(uid, lineage, numGenomes, eval(lineSplit[5].rstrip()))
_markerSet = MarkerSet(uid, lineage, numGenomes, eval(lineSplit[5].rstrip()))

np.testing.assert_almost_equal(int(binId), 637000110, err_msg="Failed bin ID test")
if not bRequireTaxonomy:
Expand All @@ -203,10 +204,8 @@ def verifyLineageSet(self, markerSetFile, bRequireTaxonomy):
def verifyAnalyze(self, outdir):
"""Verify output of analyze command."""

# verify bin stats using independently verified ground truth values
with open(os.path.join(outdir, 'storage', DefaultValues.BIN_STATS_OUT), 'r') as f:
s = f.read()
binStats = ast.literal_eval(s)
# verify bin stats using independently verified ground truth values
binStats = ResultsParser(None).parseBinStats(outdir, DefaultValues.BIN_STATS_OUT)

np.testing.assert_almost_equal(binStats['637000110']['GC'], 0.508, decimal=3, err_msg="Failed GC test")
np.testing.assert_almost_equal(binStats['637000110']['GC std'], 0.0, err_msg="Failed GC std test")
Expand Down
3 changes: 1 addition & 2 deletions checkm/treeParser.py
Expand Up @@ -25,7 +25,6 @@
import json

import dendropy
from dendropy.datamodel.taxonmodel import Taxon

import checkm.prettytable as prettytable

Expand Down Expand Up @@ -128,7 +127,7 @@ def reportNewickTree(self, outDir, outFile, leafLabels=None):
curLeaf = leaf.parent_node.remove_child(leaf)
newParent.new_child(taxon=curLeaf.taxon, edge_length=0)
for d in duplicates:
newParent.new_child(taxon=Taxon(label=d), edge_length=0)
newParent.new_child(taxon=dendropy.Taxon(label=d), edge_length=0)

# append taxonomy to leaf nodes
if leafLabels == 'taxonomy':
Expand Down

0 comments on commit dd0b476

Please sign in to comment.