Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions checkm/coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def __init__(self, threads):
# pysam can be a challenge to install and most users
# will not use this functionality so importing pysam here
import pysam
self.pysam = pysam

self.logger = logging.getLogger('timestamp')
self.totalThreads = threads
Expand Down Expand Up @@ -128,7 +129,7 @@ def _processBam(self, bamFile, bAllReads, minAlignPer, maxEditDistPer, minQC, co
workerQueue = mp.Queue()
writerQueue = mp.Queue()

bamfile = pysam.Samfile(bamFile, 'rb')
bamfile = self.pysam.Samfile(bamFile, 'rb')
refSeqIds = bamfile.references
refSeqLens = bamfile.lengths

Expand Down Expand Up @@ -190,7 +191,7 @@ def __workerThread(self, bamFile, bAllReads, minAlignPer, maxEditDistPer, minQC,
if seqIds == None:
break

bamfile = pysam.Samfile(bamFile, 'rb')
bamfile = self.pysam.Samfile(bamFile, 'rb')

for seqId, seqLen in zip(seqIds, seqLens):
numReads = 0
Expand Down