public final class RecalUtils
extends java.lang.Object
Constructor and Description |
---|
RecalUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
combineTables(NestedIntegerArray<RecalDatum> table1,
NestedIntegerArray<RecalDatum> table2)
Combines the recalibration data for table1 and table2 into table1
Note that table1 is the destination, so it is modified
|
static ReadCovariates |
computeCovariates(GATKRead read,
htsjdk.samtools.SAMFileHeader header,
StandardCovariateList covariates,
boolean recordIndelValues,
CovariateKeyCache keyCache)
Computes all requested covariates for every offset in the given read
by calling covariate.getValues(..).
|
static void |
computeCovariates(GATKRead read,
htsjdk.samtools.SAMFileHeader header,
StandardCovariateList covariates,
ReadCovariates resultsStorage,
boolean recordIndelValues)
Computes all requested covariates for every offset in the given read
by calling covariate.getValues(..).
|
static GATKReport |
createRecalibrationGATKReport(GATKReportTable argumentTable,
GATKReportTable quantizationTable,
java.util.List<GATKReportTable> recalTables)
Creates a consolidated GATK report from the tables.
|
static GATKReport |
createRecalibrationGATKReport(GATKReportTable argumentTable,
QuantizationInfo quantizationInfo,
RecalibrationTables recalibrationTables,
StandardCovariateList covariates)
Creates a consolidated GATK report, first generating report tables.
|
static RecalibrationReport |
createRecalibrationReport(GATKReportTable argumentTable,
GATKReportTable quantizationTable,
java.util.List<GATKReportTable> recalTables)
Creates a consolidated RecalibrationReport report from the tables.
|
protected static org.broadinstitute.hellbender.utils.recalibration.RecalUtils.CsvPrinter |
csvPrinter(java.io.File out,
StandardCovariateList covs)
Returns a csv output printer.
|
static void |
generateCsv(java.io.File out,
java.util.Map<java.lang.String,RecalibrationReport> reports)
Prints out a collection of reports into a file in Csv format in a way
that can be used by R scripts (such as the plot generator script).
|
static void |
generatePlots(java.io.File csvFile,
java.io.File maybeGzipedExampleReportFile,
java.io.File output)
s
Write recalibration plots into a file
|
static java.util.List<GATKReportTable> |
generateReportTables(RecalibrationTables recalibrationTables,
StandardCovariateList covariates) |
static void |
incrementDatumOrPutIfNecessary2keys(NestedIntegerArray<RecalDatum> table,
byte qual,
double isError,
int key0,
int key1)
Increments the RecalDatum at the specified position in the specified table, or put a new item there
if there isn't already one.
|
static void |
incrementDatumOrPutIfNecessary3keys(NestedIntegerArray<RecalDatum> table,
byte qual,
double isError,
int key0,
int key1,
int key2)
Increments the RecalDatum at the specified position in the specified table, or put a new item there
if there isn't already one.
|
static void |
incrementDatumOrPutIfNecessary4keys(NestedIntegerArray<RecalDatum> table,
byte qual,
double isError,
int key0,
int key1,
int key2,
int key3)
Increments the RecalDatum at the specified position in the specified table, or put a new item there
if there isn't already one.
|
protected static Resource |
loadBQSRScriptResource()
Retrieve the BQSR.R script
|
static void |
outputRecalibrationReport(java.io.PrintStream recalTableStream,
RecalibrationArgumentCollection RAC,
QuantizationInfo quantizationInfo,
RecalibrationTables recalibrationTables,
StandardCovariateList covariates)
Outputs the GATK report to RAC.RECAL_TABLE.
|
static void |
parsePlatformForRead(GATKRead read,
htsjdk.samtools.SAMFileHeader header,
RecalibrationArgumentCollection RAC)
Section of code shared between the two recalibration walkers which uses the command line arguments to adjust attributes of the read such as quals or platform string
|
public static final java.lang.String ARGUMENT_REPORT_TABLE_TITLE
public static final java.lang.String QUANTIZED_REPORT_TABLE_TITLE
public static final java.lang.String READGROUP_REPORT_TABLE_TITLE
public static final java.lang.String QUALITY_SCORE_REPORT_TABLE_TITLE
public static final java.lang.String ALL_COVARIATES_REPORT_TABLE_TITLE
public static final java.lang.String ARGUMENT_COLUMN_NAME
public static final java.lang.String ARGUMENT_VALUE_COLUMN_NAME
public static final java.lang.String QUANTIZED_VALUE_COLUMN_NAME
public static final java.lang.String QUANTIZED_COUNT_COLUMN_NAME
public static final java.lang.String READGROUP_COLUMN_NAME
public static final java.lang.String EVENT_TYPE_COLUMN_NAME
public static final java.lang.String EMPIRICAL_QUALITY_COLUMN_NAME
public static final java.lang.String ESTIMATED_Q_REPORTED_COLUMN_NAME
public static final java.lang.String QUALITY_SCORE_COLUMN_NAME
public static final java.lang.String COVARIATE_VALUE_COLUMN_NAME
public static final java.lang.String COVARIATE_NAME_COLUMN_NAME
public static final java.lang.String NUMBER_OBSERVATIONS_COLUMN_NAME
public static final java.lang.String NUMBER_ERRORS_COLUMN_NAME
public static final int EMPIRICAL_QUAL_DECIMAL_PLACES
public static final int EMPIRICAL_Q_REPORTED_DECIMAL_PLACES
public static final int NUMBER_ERRORS_DECIMAL_PLACES
protected static org.broadinstitute.hellbender.utils.recalibration.RecalUtils.CsvPrinter csvPrinter(java.io.File out, StandardCovariateList covs) throws java.io.FileNotFoundException
out
- the output file. It will be overriddencovs
- list of covariates to print out.null
java.io.FileNotFoundException
- if out
could not be created anew.public static void generateCsv(java.io.File out, java.util.Map<java.lang.String,RecalibrationReport> reports) throws java.io.FileNotFoundException
out
- the output file. It will be overridden.reports
- map where keys are the unique 'mode' (ORIGINAL, RECALIBRATED, ...)
of each report and the corresponding value the report itself.java.io.FileNotFoundException
- if out
could not be created anew.public static java.util.List<GATKReportTable> generateReportTables(RecalibrationTables recalibrationTables, StandardCovariateList covariates)
public static void outputRecalibrationReport(java.io.PrintStream recalTableStream, RecalibrationArgumentCollection RAC, QuantizationInfo quantizationInfo, RecalibrationTables recalibrationTables, StandardCovariateList covariates)
RAC
- The list of shared command line argumentsquantizationInfo
- Quantization inforecalibrationTables
- Recalibration tablescovariates
- The list of requested covariatespublic static RecalibrationReport createRecalibrationReport(GATKReportTable argumentTable, GATKReportTable quantizationTable, java.util.List<GATKReportTable> recalTables)
argumentTable
- Argument tablequantizationTable
- Quantization TablerecalTables
- Other recal tablespublic static GATKReport createRecalibrationGATKReport(GATKReportTable argumentTable, QuantizationInfo quantizationInfo, RecalibrationTables recalibrationTables, StandardCovariateList covariates)
argumentTable
- Argument tablequantizationInfo
- Quantization inforecalibrationTables
- Recalibration tablescovariates
- The list of covariatespublic static GATKReport createRecalibrationGATKReport(GATKReportTable argumentTable, GATKReportTable quantizationTable, java.util.List<GATKReportTable> recalTables)
argumentTable
- Argument tablequantizationTable
- Quantization TablerecalTables
- Other recal tablespublic static void generatePlots(java.io.File csvFile, java.io.File maybeGzipedExampleReportFile, java.io.File output)
csvFile
- location of the intermediary filemaybeGzipedExampleReportFile
- where the report arguments are collected from.output
- result plot file name.public static void parsePlatformForRead(GATKRead read, htsjdk.samtools.SAMFileHeader header, RecalibrationArgumentCollection RAC)
read
- The read to adjustRAC
- The list of shared command line argumentspublic static ReadCovariates computeCovariates(GATKRead read, htsjdk.samtools.SAMFileHeader header, StandardCovariateList covariates, boolean recordIndelValues, CovariateKeyCache keyCache)
read
- The read for which to compute covariate values.header
- SAM header for the readcovariates
- The list of requested covariates.recordIndelValues
- should we compute covariates for indel BQSR?public static void computeCovariates(GATKRead read, htsjdk.samtools.SAMFileHeader header, StandardCovariateList covariates, ReadCovariates resultsStorage, boolean recordIndelValues)
read
- The read for which to compute covariate values.header
- SAM header for the readcovariates
- The list of covariates.resultsStorage
- The object to store the covariate valuesrecordIndelValues
- should we compute covariates for indel BQSR?public static void combineTables(NestedIntegerArray<RecalDatum> table1, NestedIntegerArray<RecalDatum> table2)
table1
- the destination table to merge table2 intotable2
- the source table to merge into table1public static void incrementDatumOrPutIfNecessary2keys(NestedIntegerArray<RecalDatum> table, byte qual, double isError, int key0, int key1)
table
- the table that holds/will hold our itemqual
- qual for this eventisError
- error value for this eventkey0,
- key1 location in table of our itempublic static void incrementDatumOrPutIfNecessary3keys(NestedIntegerArray<RecalDatum> table, byte qual, double isError, int key0, int key1, int key2)
table
- the table that holds/will hold our itemqual
- qual for this eventisError
- error value for this eventkey0,
- key1, key2 location in table of our itempublic static void incrementDatumOrPutIfNecessary4keys(NestedIntegerArray<RecalDatum> table, byte qual, double isError, int key0, int key1, int key2, int key3)
table
- the table that holds/will hold our itemqual
- qual for this eventisError
- error value for this eventkey0,
- key1, key2, key3 location in table of our itemprotected static Resource loadBQSRScriptResource()