Class BQSRReadTransformer
- All Implemented Interfaces:
Serializable
,Function<GATKRead,
,GATKRead> UnaryOperator<GATKRead>
,ReadTransformer
,SerializableFunction<GATKRead,
GATKRead>
- See Also:
-
Constructor Summary
ConstructorDescriptionBQSRReadTransformer
(htsjdk.samtools.SAMFileHeader header, File bqsrRecalFile, ApplyBQSRArgumentCollection args) Constructor using a GATK Report fileBQSRReadTransformer
(htsjdk.samtools.SAMFileHeader header, RecalibrationReport recalInfo, ApplyBQSRArgumentCollection args) Constructor using a RecalibrationReport -
Method Summary
Modifier and TypeMethodDescriptionRecalibrates the base qualities of a readstatic byte[]
constructStaticQuantizedMapping
(List<Integer> staticQuantizedQuals, boolean roundDown) Constructs an array that maps particular quantized values to a rounded value in staticQuantizedQuals Rounding is done in probability space.static double
hierarchicalBayesianQualityEstimate
(double epsilon, RecalDatum empiricalQualRG, RecalDatum empiricalQualQS, RecalDatum... empiricalQualCovs) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.broadinstitute.hellbender.transformers.ReadTransformer
andThen, compose
-
Constructor Details
-
BQSRReadTransformer
public BQSRReadTransformer(htsjdk.samtools.SAMFileHeader header, File bqsrRecalFile, ApplyBQSRArgumentCollection args) Constructor using a GATK Report file- Parameters:
header
- header for the readsbqsrRecalFile
- a GATK Report file containing the recalibration informationargs
- ApplyBQSR args
-
BQSRReadTransformer
public BQSRReadTransformer(htsjdk.samtools.SAMFileHeader header, RecalibrationReport recalInfo, ApplyBQSRArgumentCollection args) Constructor using a RecalibrationReport- Parameters:
header
- header for the readsrecalInfo
- the output of BaseRecalibration, containing the recalibration informationargs
- a set of arguments to control how bqsr is applied
-
-
Method Details
-
apply
Recalibrates the base qualities of a readIt updates the base qualities of the read with the new recalibrated qualities (for all event types)
Implements a serial recalibration of the reads using the combinational table. First, we perform a positional recalibration, and then a subsequent dinuc correction.
Given the full recalibration table, we perform the following preprocessing steps:
- calculate the global quality score shift across all data [DeltaQ] - calculate for each of cycle and dinuc the shift of the quality scores relative to the global shift -- i.e., DeltaQ(dinuc) = Sum(pos) Sum(Qual) Qempirical(pos, qual, dinuc) - Qreported(pos, qual, dinuc) / Npos * Nqual - The final shift equation is:
Qrecal = Qreported + DeltaQ + DeltaQ(pos) + DeltaQ(dinuc) + DeltaQ( ... any other covariate ... )
-
hierarchicalBayesianQualityEstimate
public static double hierarchicalBayesianQualityEstimate(double epsilon, RecalDatum empiricalQualRG, RecalDatum empiricalQualQS, RecalDatum... empiricalQualCovs) -
constructStaticQuantizedMapping
public static byte[] constructStaticQuantizedMapping(List<Integer> staticQuantizedQuals, boolean roundDown) Constructs an array that maps particular quantized values to a rounded value in staticQuantizedQuals Rounding is done in probability space. When roundDown is true, we simply round down to the nearest available qual in staticQuantizedQuals- Parameters:
staticQuantizedQuals
- the list of qualities to round toroundDown
- round down if true, round to nearest (in probability space) otherwise- Returns:
- Array where index representing the quality score to be mapped and the value is the rounded quality score
-