Skip to content

Commit 650d06a

Browse files
committed
The function to check proper pairing was wrong before. It returned false if the insert size was within the expected range!
1 parent bc51ff9 commit 650d06a

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2.3.3
2+
3+
* Fixed a bug wherein proper pairs where being incorrectly called improper pairs, thereby causing slightly incorrect read extension.
4+
15
2.3.2
26

37
* The deeptoolsinterval module was modified to speed up plotEnrichment, which was taking forever to finish.

deeptools/countReadsPerBin.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -700,13 +700,17 @@ def is_proper_pair():
700700
return False
701701
if read.reference_id != read.next_reference_id:
702702
return False
703-
if self.maxPairedFragmentLength > abs(read.template_length) > 0:
703+
if not self.maxPairedFragmentLength > abs(read.template_length) > 0:
704704
return False
705705
# check that the mates face each other (inward)
706-
if read.reference_start < read.next_reference_start and not read.is_reverse and read.mate_is_reverse:
707-
return True
708-
if read.reference_start >= read.next_reference_start and read.is_reverse and not read.mate_is_reverse:
709-
return True
706+
if read.is_reverse is read.mate_is_reverse:
707+
return False
708+
if read.is_reverse:
709+
if read.reference_start >= read.next_reference_start:
710+
return True
711+
else:
712+
if read.reference_start <= read.next_reference_start:
713+
return True
710714
return False
711715
# if no extension is needed, use pysam get_blocks
712716
# to identify start and end reference positions.

0 commit comments

Comments
 (0)