Skip to content

Commit

Permalink
Merge pull request #299 from broadinstitute/add-missing-threads-param…
Browse files Browse the repository at this point in the history
…-to-blastn

Add missing threads param to blastn call
  • Loading branch information
tomkinsc committed May 4, 2016
2 parents 64a48ea + 7d830c5 commit 038cedf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions taxon_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ def no_blast_hits(blastOutCombined, inFastq, outFastq):
outf.write(line1 + line2 + line3 + line4)


def deplete_blastn(inFastq, outFastq, refDbs, threads):
def deplete_blastn(inFastq, outFastq, refDbs, threads=1, chunkSize=1000000):
'Use blastn to remove reads that match at least one of the databases.'

# Convert to fasta
Expand All @@ -747,7 +747,7 @@ def deplete_blastn(inFastq, outFastq, refDbs, threads):
blastOutFiles = []
for db in refDbs:
log.info("running blastn on %s against %s", inFastq, db)
blastOutFiles += blastn_chunked_fasta(inFasta, db, threads)
blastOutFiles += blastn_chunked_fasta(inFasta, db, chunkSize, threads)

# Combine results from different databases
blastOutCombined = mkstempfname('.txt')
Expand Down Expand Up @@ -846,7 +846,7 @@ def deplete_blastn_bam(inBam, db, outBam, threads, chunkSize=1000000, JVMmemory=
os.unlink(fastq1)
os.unlink(fastq2)
log.info("running blastn on %s pair 2 against %s", inBam, db)
blastOutFiles = blastn_chunked_fasta(fasta, db, chunkSize)
blastOutFiles = blastn_chunked_fasta(fasta, db, chunkSize, threads)
with open(blast_hits, 'wt') as outf:
for blastOutFile in blastOutFiles:
with open(blastOutFile, 'rt') as inf:
Expand Down

0 comments on commit 038cedf

Please sign in to comment.