/** * Returns the reference index in the given header of the contig of the read's mate, or {@link * SAMRecord#NO_ALIGNMENT_REFERENCE_INDEX} if the read's mate is unmapped. * * @param read read whose mate's reference index to look up * @param header SAM header defining contig indices * @return the reference index in the given header of the contig of the read's mate, or {@link * SAMRecord#NO_ALIGNMENT_REFERENCE_INDEX} if the read's mate is unmapped. */ public static int getMateReferenceIndex(final GATKRead read, final SAMFileHeader header) { if (read.mateIsUnmapped()) { return SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX; } return header.getSequenceIndex(read.getMateContig()); }