Skip to content

Commit

Permalink
Merge pull request #263 from BuysDB/mate_iter_bugfix
Browse files Browse the repository at this point in the history
Mate iter bugfix
  • Loading branch information
BuysDB authored Apr 13, 2023
2 parents e2d62fa + 192664c commit 2857320
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions singlecellmultiomics/bamProcessing/bamFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@ def sorted_bam_file(
)
else:
os.rename(unsorted_path, write_path)
pysam.index(write_path,'-@4')

def write_program_tag(input_header,
program_name,
Expand Down Expand Up @@ -1086,3 +1087,9 @@ def mate_iter(alignments, **kwargs):
yield buffer.pop(read.query_name), read
else:
buffer[read.query_name] = read
# Yield remains from buffer:
for qname, read in buffer.items():
if read.is_read1:
yield read, buffer.pop(read.query_name)
elif read.is_read2:
yield buffer.pop(read.query_name), read

0 comments on commit 2857320

Please sign in to comment.