Package htsjdk.samtools.util

# Class TrimmingUtil

java.lang.Object
htsjdk.samtools.util.TrimmingUtil

public class TrimmingUtil extends Object
Utility code for performing quality trimming.

## Constructor Summary

Constructors
Constructor
Description
`TrimmingUtil()`

## Method Summary

Modifier and Type
Method
Description
`static int`
`findQualityTrimPoint(byte[] quals, int trimQual)`
Implements phred-style quality trimming.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### TrimmingUtil

public TrimmingUtil()

## Method Details

### findQualityTrimPoint

public static int findQualityTrimPoint(byte[] quals, int trimQual)
Implements phred-style quality trimming. Takes in an array of quality values as a byte[] and return the first index within the byte array that should be clipped, such that the caller can then invoke things like: int retval = findQualityTrimPoint(10, quals); final byte[] trimmedQuals = Arrays.copyOfRange(quals, 0, retval); final String trimmedBases = bases.substring(0, retval); If the entire read is of low quality this function may return 0! It is left to the caller to decide whether or not to trim reads down to 0-bases, or to enforce some minimum length.

Parameters:
  `quals` - a byte[] of quality scores in phred scaling (i.e. integer values between 0 and ~60)
  `trimQual` - the lowest quality that is considered "good". In the simplest case where a read is composed exclusively of "good" qualities followed by "bad" qualities, this is the lowest quality value left after trimming.
Returns:
  The zero-based index of the first base within the quality string that should be trimmed. When no trimming is required, quals.length (i.e. an index one greater than the last valid index) will be returned.