Skip to content

Commit

Permalink
Merge pull request #354 from alienzj/support_compressed_protein
Browse files Browse the repository at this point in the history
Support gzipped proteins as input
  • Loading branch information
donovan-h-parks committed Oct 31, 2022
2 parents 8b42a8c + 8f76830 commit 753a315
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion checkm/markerGeneFinder.py
Expand Up @@ -19,6 +19,7 @@
# #
###############################################################################

import gzip
import os
import sys
import shutil
Expand Down Expand Up @@ -116,7 +117,14 @@ def _processBin(self, outDir, tableOut, hmmerOut, markerFile, bKeepAlignment, bN
aaGeneFile = prodigal.aaGeneFile
else:
aaGeneFile = binFile
shutil.copyfile(aaGeneFile, os.path.join(binDir, DefaultValues.PRODIGAL_AA))
aaGeneFileSave = os.path.join(binDir, DefaultValues.PRODIGAL_AA)
if not aaGeneFile.endswith(".gz"):
shutil.copyfile(aaGeneFile, aaGeneFileSave)
else:
with gzip.open(aaGeneFile, 'rt') as f_in:
with open(aaGeneFileSave, 'w') as f_out:
shutil.copyfileobj(f_in, f_out)
aaGeneFile = aaGeneFileSave

# extract HMMs into temporary file
hmmModelFile = markerSetParser.createHmmModelFile(binId, markerFile)
Expand Down

0 comments on commit 753a315

Please sign in to comment.