From f82f789298bfb874d81b44ffbb5c90f860a31b68 Mon Sep 17 00:00:00 2001 From: Kishori M Konwar <43380010+kishorikonwar@users.noreply.github.com> Date: Tue, 28 Jul 2020 13:59:50 -0400 Subject: [PATCH] Changed the intermediate files written during SplitBamByCellBarcodes from BAM to SAM (#79) * changed the intermediate bam file writing of the SplitBam command to simply sam * changed the intermediate bam file writing of the SplitBam command to simply sam --- src/sctools/bam.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/sctools/bam.py b/src/sctools/bam.py index 8565d5a..d847738 100644 --- a/src/sctools/bam.py +++ b/src/sctools/bam.py @@ -325,11 +325,8 @@ def write_barcodes_to_bins( for i in range(len(bins)): out_bam_name = os.path.join(f"{dirname}", f"{dirname}_{i}.bam") filepaths.append(out_bam_name) - # For now, bam writing uses one thread for compression. Better logic could support more processes without - # starving the machine for resources - open_bam = pysam.AlignmentFile( - out_bam_name, "wb", template=input_alignments - ) + + open_bam = pysam.AlignmentFile(out_bam_name, "w", template=input_alignments) files.append(open_bam) # Loop over input; check each tag in priority order and partition barcodes into files based