# Class ReadBaseStratification

java.lang.Object
picard.sam.SamErrorMetric.ReadBaseStratification

public class ReadBaseStratification extends Object
Classes, methods, and enums that deal with the stratification of read bases and reference information.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`ReadBaseStratification.BinnedReadCycleStratifier`
Stratifies into quintiles of read cycle.
`static class`
`ReadBaseStratification.CigarOperatorsInReadStratifier`
Stratifies according to the number of matching cigar operators (from CIGAR string) that the read has.
`static class`
`ReadBaseStratification.CollectionStratifier`
A CollectionStratifier is a stratifier that uses a collection of stratifiers to inform the stratification.
`static enum`
`ReadBaseStratification.Consensus`
Types of consensus reads as determined by the number of duplicates used from first and second strands.
`static class`
`ReadBaseStratification.ConsensusStratifier`
Stratify by tags used during duplex and single index consensus calling.
`static enum`
`ReadBaseStratification.CycleBin`
An enum designed to hold a binned version of any probability-like number (between 0 and 1) in quintiles
`static class`
`ReadBaseStratification.FlowCellTileStratifier`
Stratifies base into their read's tile which is parsed from the read-name.
`static class`
`ReadBaseStratification.FlowCellXStratifier`
Stratifies base into their read's X coordinate which is parsed from the read-name.
`static class`
`ReadBaseStratification.FlowCellYStratifier`
Stratifies base into their read's Y coordinate which is parsed from the read-name.
`static class`
`ReadBaseStratification.GCContentStratifier`
A stratifier that uses GC (of the read) to stratify.
`static class`
`ReadBaseStratification.IndelLengthStratifier`
Stratifies according to the length of an insertion or deletion.
`static class`
`ReadBaseStratification.IndelsInReadStratifier`
Stratifies according to the number of indel bases (from CIGAR string) that the read has.
`static enum`
`ReadBaseStratification.LongShortHomopolymer`
`static class`
`ReadBaseStratification.LongShortHomopolymerStratifier`
Stratify bases according to the type of Homopolymer that they belong to (repeating element, final reference base and whether the length is "long" or not).
`static class`
`ReadBaseStratification.MismatchesInReadStratifier`
Stratifies according to the overall mismatches (from `SAMTag.NM`) that the read has against the reference, NOT including the current base.
`static class`
`ReadBaseStratification.NsInReadStratifier`
Stratify by the number of Ns found in the read.
`static enum`
`ReadBaseStratification.PairOrientation`
An enum for holding a reads read-pair's Orientation (i.e.
`static class`
`ReadBaseStratification.PairStratifier<T extends Comparable<T>, R extends Comparable<R>>`
A PairStratifier is a stratifier that uses two other stratifiers to inform the stratification.
`static enum`
`ReadBaseStratification.ProperPaired`
An enum to hold information about the "properness" of a read pair
`static enum`
`ReadBaseStratification.ReadDirection`
An enum for holding the direction for a read (positive strand or negative strand
`static enum`
`ReadBaseStratification.ReadOrdinality`
An enum to hold the ordinality of a read
`static interface`
`ReadBaseStratification.RecordAndOffsetStratifier<T extends Comparable<T>>`
The main interface for a stratifier.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final ReadBaseStratification.RecordAndOffsetStratifier<Integer>`
`baseCycleStratifier`
Get the one-based cycle number of the base, taking the direction of the read into account
`static final ReadBaseStratification.RecordAndOffsetStratifier<Byte>`
`baseQualityStratifier`
Stratifies into the base-quality of the base under consideration
`static final htsjdk.samtools.util.Lazy<ReadBaseStratification.PairStratifier<ReadBaseStratification.LongShortHomopolymer, Pair<Character, Character>>>`
`binnedHomopolymerStratifier`
Stratifies a base onto the make up (repeating base and following reference base) and length-scale of the homopolymer from whence it came.
`static final ReadBaseStratification.BinnedReadCycleStratifier`
`binnedReadCycleStratifier`
Stratifies into quintiles of read cycle.
`static final ReadBaseStratification.ConsensusStratifier`
`consensusStratifier`
Stratify by tags used during duplex and single index consensus calling.
`static final ReadBaseStratification.RecordAndOffsetStratifier<Character>`
`currentReadBaseStratifier`
Stratifies bases into the current (uppercase) base as it was read from the sequencer (i.e.
`static final ReadBaseStratification.CigarOperatorsInReadStratifier`
`deletionsInReadStratifier`
Stratify by Deletions in the read cigars.
`static final ReadBaseStratification.FlowCellTileStratifier`
`flowCellTileStratifier`
Stratifies base into their read's tile which is parsed from the read-name.
`static final ReadBaseStratification.FlowCellXStratifier`
`flowCellXStratifier`
Stratifies base into their read's tile which is parsed from the read-name.
`static final ReadBaseStratification.FlowCellYStratifier`
`flowCellYStratifier`
Stratifies base into their read's tile which is parsed from the read-name.
`static final ReadBaseStratification.GCContentStratifier`
`gcContentStratifier`
A stratifier that uses GC (of the read) to stratify.
`static final ReadBaseStratification.RecordAndOffsetStratifier<Integer>`
`homoPolymerLengthStratifier`
Stratifies a base onto the length of the homopolymer preceding it (in the read direction).
`static final ReadBaseStratification.PairStratifier<Integer, Pair<Character, Character>>`
`homopolymerStratifier`
Stratifies a base onto the make up (repeating base and following reference base) and length of the homopolymer from whence it came.
`static final ReadBaseStratification.IndelLengthStratifier`
`indelLengthStratifier`
Stratifies into the number of bases in an insertion
`static final ReadBaseStratification.IndelsInReadStratifier`
`indelsInReadStratifier`
Stratify by Indels in the read cigars.
`static final ReadBaseStratification.CigarOperatorsInReadStratifier`
`insertionsInReadStratifier`
Stratify by Insertions in the read cigars.
`static final ReadBaseStratification.RecordAndOffsetStratifier<Integer>`
`insertLengthStratifier`
Stratifies into the read-pairs estimated insert-length, as long as it isn't larger than 10x the length of the read
`static final ReadBaseStratification.RecordAndOffsetStratifier<Integer>`
`mappingQualityStratifier`
Stratifies into the mapping-quality of the read under consideration
`static final ReadBaseStratification.MismatchesInReadStratifier`
`mismatchesInReadStratifier`
Stratifies according to the overall mismatches (from NM) that the read has against the reference, NOT including the current base.
`static final ReadBaseStratification.RecordAndOffsetStratifier<Character>`
`nextReadBaseStratifier`
Stratifies bases into the following (uppercase) base as it was read from the sequencer (i.e.
`static final picard.sam.SamErrorMetric.ReadBaseStratification.RecordStratifier<String>`
`nonStratifier`
A constant stratifier which places all the reads into a single stratum.
`static final int`
`NOT_ALIGNED_ERROR`
`static final ReadBaseStratification.NsInReadStratifier`
`nsInReadStratifier`
Stratify by the number of Ns found in the read.
`static final ReadBaseStratification.RecordAndOffsetStratifier<String>`
`oneBasePaddedContextStratifier`
Stratifies into the one base context of the base, which includes one read-base on each side and the reference base from where the current base is the bases will be reverse-complemented so that the bases are in the original order they were read from the sequencer
`static final ReadBaseStratification.PairStratifier<Character, Character>`
`postDiNucleotideStratifier`
Stratifies a base onto the reference base that it covers and the following base, possibly reverse complemented if the read has been reversed by the aligner.
`static final ReadBaseStratification.PairStratifier<Character, Character>`
`preDiNucleotideStratifier`
Stratifies a base onto the reference base that it covers and the preceding base, possibly reverse complemented if the read has been reversed by the aligner.
`static final ReadBaseStratification.RecordAndOffsetStratifier<Character>`
`previousReadBaseStratifier`
Stratifies bases into the previous (uppercase) base as it was read from the sequencer (i.e.
`static final ReadBaseStratification.RecordAndOffsetStratifier<ReadBaseStratification.ReadDirection>`
`readDirectionStratifier`
Stratifies bases into their read's Direction (i.e.
`static final picard.sam.SamErrorMetric.ReadBaseStratification.RecordStratifier<String>`
`readgroupStratifier`
Stratifies to the readgroup id of the read.
`static final ReadBaseStratification.RecordAndOffsetStratifier<ReadBaseStratification.ReadOrdinality>`
`readOrdinalityStratifier`
Stratifies bases into their read's Ordinality (i.e.
`static final ReadBaseStratification.RecordAndOffsetStratifier<ReadBaseStratification.PairOrientation>`
`readOrientationStratifier`
Stratifies bases into their read-pair's Orientation (i.e.
`static final ReadBaseStratification.RecordAndOffsetStratifier<ReadBaseStratification.ProperPaired>`
`readPairednessStratifier`
Stratifies bases into their read's Proper-pairedness
`static final ReadBaseStratification.RecordAndOffsetStratifier<Character>`
`referenceBaseStratifier`
Stratifies a base onto the reference base that it covers, possibly reverse complemented if the read has been reversed by the aligner.
`static final ReadBaseStratification.RecordAndOffsetStratifier<Integer>`
`softClipsLengthStratifier`
Stratifies into the number of soft-clipped bases that the read has in its alignment, or -1 if not aligned.
`static final ReadBaseStratification.RecordAndOffsetStratifier<String>`
`twoBasePaddedContextStratifier`
Stratifies into the two base context of the base, which includes two read-bases on each side and the reference base from where the current base is the bases will be reverse-complemented so that the bases are in the original order they were read from the sequencer

## Constructor Summary

Constructors
Constructor
Description
`ReadBaseStratification()`

## Method Summary

Modifier and Type
Method
Description
`static htsjdk.samtools.CigarElement`
`getIndelElement(htsjdk.samtools.util.SamLocusIterator.RecordAndOffset recordAndOffset)`
`static <T extends Comparable<T>, S extends Comparable<S>>
ReadBaseStratification.PairStratifier<T,S>`
`PairStratifierFactory(ReadBaseStratification.RecordAndOffsetStratifier<T> leftStratifier, ReadBaseStratification.RecordAndOffsetStratifier<S> rightStratifier, String suffix)`
A factory for generating "pair" stratifier instances from two stratifiers and a string
`static void`
`setGcCacheSize(int gcCacheSize)`
`static void`
`setLocationBinSize(int locationBinSize)`
defaults to 2500
`static void`
`setLongHomopolymer(int longHomopolymer)`
defaults to 6

### Methods inherited from class Object

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

## Field Details

### currentReadBaseStratifier

public static final ReadBaseStratification.RecordAndOffsetStratifier<Character> currentReadBaseStratifier
Stratifies bases into the current (uppercase) base as it was read from the sequencer (i.e. complemented if needed)

### previousReadBaseStratifier

public static final ReadBaseStratification.RecordAndOffsetStratifier<Character> previousReadBaseStratifier
Stratifies bases into the previous (uppercase) base as it was read from the sequencer (i.e. complemented if needed)

### nextReadBaseStratifier

public static final ReadBaseStratification.RecordAndOffsetStratifier<Character> nextReadBaseStratifier
Stratifies bases into the following (uppercase) base as it was read from the sequencer (i.e. complemented if needed)

### referenceBaseStratifier

public static final ReadBaseStratification.RecordAndOffsetStratifier<Character> referenceBaseStratifier
Stratifies a base onto the reference base that it covers, possibly reverse complemented if the read has been reversed by the aligner.

### postDiNucleotideStratifier

public static final ReadBaseStratification.PairStratifier<Character, Character> postDiNucleotideStratifier
Stratifies a base onto the reference base that it covers and the following base, possibly reverse complemented if the read has been reversed by the aligner.

### preDiNucleotideStratifier

public static final ReadBaseStratification.PairStratifier<Character, Character> preDiNucleotideStratifier
Stratifies a base onto the reference base that it covers and the preceding base, possibly reverse complemented if the read has been reversed by the aligner.

### homoPolymerLengthStratifier

public static final ReadBaseStratification.RecordAndOffsetStratifier<Integer> homoPolymerLengthStratifier
Stratifies a base onto the length of the homopolymer preceding it (in the read direction). Read direction and only the preceding bases are taken into account (i.e. ignoring reference and current base).

### homopolymerStratifier

public static final ReadBaseStratification.PairStratifier<Integer, Pair<Character, Character>> homopolymerStratifier
Stratifies a base onto the make up (repeating base and following reference base) and length of the homopolymer from whence it came. Read direction and only the preceding bases are taken into account.

### binnedHomopolymerStratifier

public static final htsjdk.samtools.util.Lazy<ReadBaseStratification.PairStratifier<ReadBaseStratification.LongShortHomopolymer, Pair<Character, Character>>> binnedHomopolymerStratifier
Stratifies a base onto the make up (repeating base and following reference base) and length-scale of the homopolymer from whence it came. Read direction and only the preceding bases are taken into account.

This is done with a Lazy wrapper since it requires access to `LONG_HOMOPOLYMER` which can be set with `setLongHomopolymer(int)`.

### oneBasePaddedContextStratifier

public static final ReadBaseStratification.RecordAndOffsetStratifier<String> oneBasePaddedContextStratifier
Stratifies into the one base context of the base, which includes one read-base on each side and the reference base from where the current base is the bases will be reverse-complemented so that the bases are in the original order they were read from the sequencer

### twoBasePaddedContextStratifier

public static final ReadBaseStratification.RecordAndOffsetStratifier<String> twoBasePaddedContextStratifier
Stratifies into the two base context of the base, which includes two read-bases on each side and the reference base from where the current base is the bases will be reverse-complemented so that the bases are in the original order they were read from the sequencer

### nonStratifier

public static final picard.sam.SamErrorMetric.ReadBaseStratification.RecordStratifier<String> nonStratifier
A constant stratifier which places all the reads into a single stratum.

### gcContentStratifier

public static final ReadBaseStratification.GCContentStratifier gcContentStratifier
A stratifier that uses GC (of the read) to stratify. Since the reads are expected to be seen over and over again, the GC is cached

Stratification happens into (integer) percents.

### flowCellTileStratifier

public static final ReadBaseStratification.FlowCellTileStratifier flowCellTileStratifier
Stratifies base into their read's tile which is parsed from the read-name.

### flowCellXStratifier

public static final ReadBaseStratification.FlowCellXStratifier flowCellXStratifier
Stratifies base into their read's tile which is parsed from the read-name.

### flowCellYStratifier

public static final ReadBaseStratification.FlowCellYStratifier flowCellYStratifier
Stratifies base into their read's tile which is parsed from the read-name.

### readgroupStratifier

public static final picard.sam.SamErrorMetric.ReadBaseStratification.RecordStratifier<String> readgroupStratifier
Stratifies to the readgroup id of the read.

### readOrdinalityStratifier

public static final ReadBaseStratification.RecordAndOffsetStratifier<ReadBaseStratification.ReadOrdinality> readOrdinalityStratifier
Stratifies bases into their read's Ordinality (i.e. First or Second)

### readPairednessStratifier

public static final ReadBaseStratification.RecordAndOffsetStratifier<ReadBaseStratification.ProperPaired> readPairednessStratifier
Stratifies bases into their read's Proper-pairedness

### readDirectionStratifier

public static final ReadBaseStratification.RecordAndOffsetStratifier<ReadBaseStratification.ReadDirection> readDirectionStratifier
Stratifies bases into their read's Direction (i.e. forward or reverse)

### readOrientationStratifier

public static final ReadBaseStratification.RecordAndOffsetStratifier<ReadBaseStratification.PairOrientation> readOrientationStratifier
Stratifies bases into their read-pair's Orientation (i.e. F1R2, F2R1, F1F2 or R1R2)

### binnedReadCycleStratifier

public static final ReadBaseStratification.BinnedReadCycleStratifier binnedReadCycleStratifier
Stratifies into quintiles of read cycle.

### baseCycleStratifier

public static final ReadBaseStratification.RecordAndOffsetStratifier<Integer> baseCycleStratifier
Get the one-based cycle number of the base, taking the direction of the read into account

### insertLengthStratifier

public static final ReadBaseStratification.RecordAndOffsetStratifier<Integer> insertLengthStratifier
Stratifies into the read-pairs estimated insert-length, as long as it isn't larger than 10x the length of the read

### softClipsLengthStratifier

public static final ReadBaseStratification.RecordAndOffsetStratifier<Integer> softClipsLengthStratifier
Stratifies into the number of soft-clipped bases that the read has in its alignment, or -1 if not aligned.

### baseQualityStratifier

public static final ReadBaseStratification.RecordAndOffsetStratifier<Byte> baseQualityStratifier
Stratifies into the base-quality of the base under consideration

### mappingQualityStratifier

public static final ReadBaseStratification.RecordAndOffsetStratifier<Integer> mappingQualityStratifier
Stratifies into the mapping-quality of the read under consideration

### mismatchesInReadStratifier

public static final ReadBaseStratification.MismatchesInReadStratifier mismatchesInReadStratifier
Stratifies according to the overall mismatches (from NM) that the read has against the reference, NOT including the current base.

### consensusStratifier

public static final ReadBaseStratification.ConsensusStratifier consensusStratifier
Stratify by tags used during duplex and single index consensus calling.

### nsInReadStratifier

public static final ReadBaseStratification.NsInReadStratifier nsInReadStratifier
Stratify by the number of Ns found in the read. This is particularly useful for data that has been consensus-called (a process that can add 'N' bases when there is no consensus)

### insertionsInReadStratifier

public static final ReadBaseStratification.CigarOperatorsInReadStratifier insertionsInReadStratifier
Stratify by Insertions in the read cigars.

### deletionsInReadStratifier

public static final ReadBaseStratification.CigarOperatorsInReadStratifier deletionsInReadStratifier
Stratify by Deletions in the read cigars.

### indelsInReadStratifier

public static final ReadBaseStratification.IndelsInReadStratifier indelsInReadStratifier
Stratify by Indels in the read cigars.

### indelLengthStratifier

public static final ReadBaseStratification.IndelLengthStratifier indelLengthStratifier
Stratifies into the number of bases in an insertion

### NOT_ALIGNED_ERROR

public static final int NOT_ALIGNED_ERROR

See Also:
  - Constant Field Values

## Constructor Details

### ReadBaseStratification

public ReadBaseStratification()

## Method Details

### setGcCacheSize

public static void setGcCacheSize(int gcCacheSize)

### setLongHomopolymer

public static void setLongHomopolymer(int longHomopolymer)
defaults to 6

### setLocationBinSize

public static void setLocationBinSize(int locationBinSize)
defaults to 2500

### PairStratifierFactory

public static <T extends Comparable<T>, S extends Comparable<S>> ReadBaseStratification.PairStratifier<T,S> PairStratifierFactory(ReadBaseStratification.RecordAndOffsetStratifier<T> leftStratifier, ReadBaseStratification.RecordAndOffsetStratifier<S> rightStratifier, String suffix)
A factory for generating "pair" stratifier instances from two stratifiers and a string

Type Parameters:
  `T` - the type of the left Stratifier
  `S` - the type of the right Stratifier
Parameters:
  `leftStratifier` - a `ReadBaseStratification.RecordAndOffsetStratifier` to use
  `rightStratifier` - a `ReadBaseStratification.RecordAndOffsetStratifier` to use
  `suffix` - the suffix to use for the new stratifier
Returns:
  an instance of `ReadBaseStratification.PairStratifier` that will stratify according to both `leftStratifier` and `rightStratifier`

### getIndelElement

public static htsjdk.samtools.CigarElement getIndelElement(htsjdk.samtools.util.SamLocusIterator.RecordAndOffset recordAndOffset)