Class BaseQualityClipReadTransformer

java.lang.Object
org.broadinstitute.hellbender.transformers.BaseQualityClipReadTransformer
All Implemented Interfaces:
Serializable, Function<GATKRead,GATKRead>, UnaryOperator<GATKRead>, ReadTransformer, SerializableFunction<GATKRead,GATKRead>

public final class BaseQualityClipReadTransformer extends Object implements ReadTransformer
Clips reads on both ends using base quality scores
See Also:
  • Constructor Details

    • BaseQualityClipReadTransformer

      public BaseQualityClipReadTransformer(int trim_thresh)
  • Method Details

    • apply

      public GATKRead apply(GATKRead read)
      Clip bases on the right end of the read from

      argmax_x{ \sum{i = x + 1}^l (qTrimmingThreshold - qual).

      Walk through the read from the right end (in machine cycle order) to the left end, calculating the running sum of qTrimmingThreshold - qual. While we do this, we track the maximum value of this sum where the delta > 0. After the loop, clipPoint is either -1 (don't do anything) or the clipping index in the read (from the end). Repeat in reverse to clip the left end of the read.

      Specified by:
      apply in interface Function<GATKRead,GATKRead>
      Specified by:
      apply in interface SerializableFunction<GATKRead,GATKRead>
    • getRightClipPoint

      public int getRightClipPoint(byte[] quals)
      Returns right clip point or -1 if no clip
    • getLeftClipPoint

      public int getLeftClipPoint(byte[] quals)
      Returns left clip point or -1 if no clip