Package picard.illumina.parser.readers

# Class BclQualityEvaluationStrategy

java.lang.Object
picard.illumina.parser.readers.BclQualityEvaluationStrategy

public class BclQualityEvaluationStrategy extends Object
Describes a mechanism for revising and evaluating qualities read from a BCL file. This class accumulates observations about low quality scores that it evaluates, so distinct instances should be used for unrelated sets of BCL readers. The mechanism for revising qualities is not configurable. The qualities that are less than 1 are revised to 1, and other qualities are not affected. This class is thread-safe and a single instance can and should be passed to `BclReader`s running in separate threads. To replicate the functionality of `BclReader`s prior to the introduction of this class, create a single instance passing `ILLUMINA_ALLEGED_MINIMUM_QUALITY` to the constructor, and then call `assertMinimumQualities()` once the readers finish their work.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`ILLUMINA_ALLEGED_MINIMUM_QUALITY`

## Constructor Summary

Constructors
Constructor
Description
`BclQualityEvaluationStrategy(int minimumRevisedQuality)`

## Method Summary

Modifier and Type
Method
Description
`void`
`assertMinimumQualities()`
Reviews the qualities observed thus far and throws an exception if any are below the minimum quality threshold.
`Map<Byte,Integer>`
`getPoorQualityFrequencies()`
Returns a view of number of qualities that failed, where the key is the quality score and the value is the number of observations.
`byte`
`reviseAndConditionallyLogQuality(byte quality)`
Accepts a quality read from a BCL file and (1) returns a 1 if the value was 0 and (2) makes a note of the provided quality if it is low.

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

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

## Field Details

### ILLUMINA_ALLEGED_MINIMUM_QUALITY

public static final int ILLUMINA_ALLEGED_MINIMUM_QUALITY

See Also:
  - Constant Field Values

## Constructor Details

### BclQualityEvaluationStrategy

public BclQualityEvaluationStrategy(int minimumRevisedQuality)

Parameters:
  `minimumRevisedQuality` - The minimum quality that should be seen from revised qualities; controls whether or not an exception is thrown when calling `assertMinimumQualities()`

## Method Details

### reviseAndConditionallyLogQuality

public byte reviseAndConditionallyLogQuality(byte quality)
Accepts a quality read from a BCL file and (1) returns a 1 if the value was 0 and (2) makes a note of the provided quality if it is low. Because of (2) each record's quality should be passed only once to this method, otherwise it will be observed multiple times.

Parameters:
  `quality` - The quality score read from the BCL
Returns:
  The revised new quality score

### assertMinimumQualities

public void assertMinimumQualities()
Reviews the qualities observed thus far and throws an exception if any are below the minimum quality threshold.

### getPoorQualityFrequencies

public Map<Byte,Integer> getPoorQualityFrequencies()
Returns a view of number of qualities that failed, where the key is the quality score and the value is the number of observations.