Skip to content

Commit

Permalink
Fixed incorrect reporting of number of marker genes/sets for taxonomi…
Browse files Browse the repository at this point in the history
…c-specific marker sets.
  • Loading branch information
donovan-h-parks committed Sep 2, 2016
1 parent 3af2772 commit 82cb6d9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion checkm/VERSION
@@ -1 +1 @@
1.0.6
1.0.7
15 changes: 4 additions & 11 deletions checkm/checkmData.py
Expand Up @@ -174,7 +174,7 @@ def setRoot(self, path=None):
return None

# validate the supplied path or prompt for a new one
path = self.confirmPath(path=path)
path = self.confirmPath(path=path)
if path is None:
# The user is not interested
return None
Expand All @@ -193,11 +193,11 @@ def confirmPath(self, path=None):
minimal = False
while not path_set:
if not path:
if(minimal):
if(minimal):
path = raw_input("Please specify a location or type 'abort' to stop trying: \n")
else:
else:
path = raw_input("Where should CheckM store it's data?\n" \
"Please specify a location or type 'abort' to stop trying: \n")
"Please specify a location or type 'abort' to stop trying: \n")

if path.upper() == "ABORT":
# user has given up
Expand Down Expand Up @@ -242,10 +242,3 @@ def checkPermissions(self):
return False

return True



###############################################################################
###############################################################################
###############################################################################
###############################################################################
11 changes: 11 additions & 0 deletions checkm/markerSets.py
Expand Up @@ -179,6 +179,17 @@ def getMarkerGenes(self):
markerGenes.add(marker)

return markerGenes

def removeMarkers(self, markersToRemove):
"""Remove specified markers from marker sets."""
newMarkerSet = []
for ms in self.markerSet:
newMS = ms - markersToRemove

if len(newMS) != 0:
newMarkerSet.append(newMS)

self.markerSet = newMarkerSet

def genomeCheck(self, hits, bIndividualMarkers):
"""Calculate genome completeness and contamination."""
Expand Down
5 changes: 4 additions & 1 deletion checkm/taxonParser.py
Expand Up @@ -44,8 +44,11 @@ def readMarkerSets(self):
lineage = lineSplit[2]
numGenomes = int(lineSplit[3])
markerSet = eval(lineSplit[6].rstrip())

ms = MarkerSet(ranksByLabel[rank], lineage, numGenomes, markerSet)
ms.removeMarkers(DefaultValues.MARKERS_TO_EXCLUDE)

taxonMarkerSets[rank][taxon] = MarkerSet(ranksByLabel[rank], lineage, numGenomes, markerSet)
taxonMarkerSets[rank][taxon] = ms

return taxonMarkerSets

Expand Down

0 comments on commit 82cb6d9

Please sign in to comment.