Пример #1
0
  /**
   * Checks if a read contains adaptor sequences. If it does, hard clips them out.
   *
   * <p>Note: To see how a read is checked for adaptor sequence see 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);
  }