Skip to content

Commit

Permalink
allow samtools merge to use multicore
Browse files Browse the repository at this point in the history
  • Loading branch information
nsheff committed Aug 5, 2019
1 parent 3c2672d commit 3775eb7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pypiper/ngstk.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ class of inputs (which can in turn be a string or a list).
if all([self.get_input_ext(x) == ".bam" for x in input_args]):
sample_merged = local_base + ".merged.bam"
output_merge = os.path.join(raw_folder, sample_merged)
cmd = self.merge_bams(input_args, output_merge)
cmd = self.merge_bams_samtools(input_args, output_merge)
self.pm.debug("cmd: {}".format(cmd))
self.pm.run(cmd, output_merge)
cmd2 = self.validate_bam(output_merge)
Expand Down Expand Up @@ -654,7 +654,8 @@ def merge_bams(self, input_bams, merged_bam, in_sorted="TRUE", tmp_dir=None):

def merge_bams_samtools(self, input_bams, merged_bam):
cmd = self.tools.samtools + " merge "
cmd += merged_bam + " "
cmd += " -@ " + str(self.pm.cores)
cmd += " " + merged_bam + " "
cmd += " ".join(input_bams)
return cmd

Expand Down

0 comments on commit 3775eb7

Please sign in to comment.