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
3 changes: 3 additions & 0 deletions sinto/filterbarcodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ def _iterate_reads(
bamlist = [pysam.AlignmentFile(x, filemode, header=newhead) for x in filelist]
for i in intervals:
for r in inputBam.fetch(i[0], i[1], i[2]):
# skip reads owned by the previous chunk (fetch returns overlaps); unmapped reads have reference_start < 0
if r.reference_start >= 0 and r.reference_start < i[1]:
continue
if readname_barcode is not None:
re_match = readname_barcode.search(r.qname)
cell_barcode = re_match.group()
Expand Down