@Override public int getAdaptor(final GATKSAMRecord record) { return ReadUtils.getAdaptorBoundary(record); } }});
/** * A caching version of ReadUtils.getAdaptorBoundary() * * see #ReadUtils.getAdaptorBoundary(SAMRecord) for more information about the meaning of this function * * WARNING -- this function caches a value depending on the inferred insert size and alignment starts * and stops of this read and its mate. Changing these values in any way will invalidate the cached value. * However, we do not monitor those setter functions, so modifying a GATKSAMRecord in any way may * result in stale cached values. * * @return the result of calling ReadUtils.getAdaptorBoundary on this read */ @Ensures("result == ReadUtils.getAdaptorBoundary(this)") public int getAdaptorBoundary() { if ( adapterBoundary == null ) adapterBoundary = ReadUtils.getAdaptorBoundary(this); return adapterBoundary; } }
/** * Checks if a read contains adaptor sequences. If it does, hard clips them out. * * Note: To see how a read is checked for adaptor sequence see {@link ReadUtils::getAdaptorBoundary} * * @return a new read without adaptor sequence */ private GATKSAMRecord hardClipAdaptorSequence () { final int adaptorBoundary = ReadUtils.getAdaptorBoundary(read); if (adaptorBoundary == ReadUtils.CANNOT_COMPUTE_ADAPTOR_BOUNDARY || !ReadUtils.isInsideRead(read, adaptorBoundary)) return read; return read.getReadNegativeStrandFlag() ? hardClipByReferenceCoordinatesLeftTail(adaptorBoundary) : hardClipByReferenceCoordinatesRightTail(adaptorBoundary); } public static GATKSAMRecord hardClipAdaptorSequence (GATKSAMRecord read) {