Skip to content

Commit

Permalink
respond to review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yfarjoun committed Nov 30, 2024
1 parent 588b4ec commit 50fec4b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/main/java/htsjdk/samtools/SamPairUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static enum PairOrientation
* @param record the record for which the pair orientation is requested
* @return PairOrientation of the given SAMRecord.
* @throws IllegalArgumentException If the record is not a paired read, or
* one or both reads are unmapped, or is the two records do are not mapped to the
* one or both reads are unmapped, or if the two records are not mapped to the
* same reference.
*
* NOTA BENE: This is NOT the orientation byte as used in Picard's MarkDuplicates. For that please look
Expand All @@ -73,14 +73,15 @@ public static PairOrientation getPairOrientation(final SAMRecord record)
final boolean readIsOnReverseStrand = record.getReadNegativeStrandFlag();

if(record.getReadUnmappedFlag() || !record.getReadPairedFlag() || record.getMateUnmappedFlag()) {
throw new IllegalArgumentException("Invalid SAMRecord: " + record.getReadName() + ". This method only works for SAMRecords " +
"that are paired reads with both reads aligned.");
throw new IllegalArgumentException("Invalid SAMRecord: " + record.getReadName() +
". This method only works for SAMRecords that are paired reads with both reads aligned.");
}

if (!record.getReferenceIndex().equals(record.getMateReferenceIndex())) {
throw new IllegalArgumentException("Invalid SAMRecord: " + record.getReadName() + ". This method only works for SAMRecords " +
"that are paired reads with both reads aligned to the same reference. Found difference references:" +
record.getReferenceName() + " and " + record.getMateReferenceName() + ".");
throw new IllegalArgumentException("Invalid SAMRecord: " + record.getReadName() +
". This method only works for SAMRecords that are paired reads with both reads aligned to the" +
" same reference. Found difference references:" + record.getReferenceName() + " and " +
record.getMateReferenceName() + ".");
}

if(readIsOnReverseStrand == record.getMateNegativeStrandFlag() ) {
Expand Down

0 comments on commit 50fec4b

Please sign in to comment.