File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed
main/java/htsjdk/samtools
test/java/htsjdk/samtools Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -338,6 +338,7 @@ private boolean hasReferenceName() {
338338 */
339339 public boolean isPair (final SAMRecord record ) {
340340 return record != null
341+ && Objects .equals (this .getReadName (), record .getReadName ())
341342 && this .getMateAlignmentStart () == record .getAlignmentStart ()
342343 && record .getMateAlignmentStart () == this .getAlignmentStart ()
343344 && !NO_ALIGNMENT_REFERENCE_NAME .equals (this .getMateReferenceName ())
Original file line number Diff line number Diff line change @@ -1124,9 +1124,11 @@ public void testRecordsArePairIfTheyLinkEachOtherInMateFields() {
11241124 @ Test
11251125 public void testRecordsArePairIfTheyHaveNoMateFields () {
11261126 final SAMRecord first = new SAMRecord (new SAMFileHeader (new SAMSequenceDictionary ()));
1127+ first .setReadName ("example1" );
11271128 first .setAlignmentStart (42 );
11281129 first .setReferenceName ("chrm1" );
11291130 final SAMRecord second = new SAMRecord (new SAMFileHeader (new SAMSequenceDictionary ()));
1131+ first .setReadName ("example1" );
11301132 second .setAlignmentStart (142 );
11311133 second .setReferenceName ("chrm2" );
11321134
You can’t perform that action at this time.
0 commit comments