public static Covariate[] makeInitializedStandardCovariates() { final RecalibrationArgumentCollection RAC = new RecalibrationArgumentCollection(); final Covariate[] covariates = new Covariate[4]; covariates[0] = new ReadGroupCovariate(); covariates[1] = new QualityScoreCovariate(); covariates[2] = new ContextCovariate(); covariates[3] = new CycleCovariate(); for (Covariate cov : covariates) cov.initialize(RAC); return covariates; }
public RecalibrationReport(final File recalFile, final SortedSet<String> allReadGroups) { final GATKReport report = new GATKReport(recalFile); argumentTable = report.getTable(RecalUtils.ARGUMENT_REPORT_TABLE_TITLE); RAC = initializeArgumentCollectionTable(argumentTable); GATKReportTable quantizedTable = report.getTable(RecalUtils.QUANTIZED_REPORT_TABLE_TITLE); quantizationInfo = initializeQuantizationTable(quantizedTable); Pair<ArrayList<Covariate>, ArrayList<Covariate>> covariates = RecalUtils.initializeCovariates(RAC); // initialize the required and optional covariates ArrayList<Covariate> requiredCovariates = covariates.getFirst(); ArrayList<Covariate> optionalCovariates = covariates.getSecond(); requestedCovariates = new Covariate[requiredCovariates.size() + optionalCovariates.size()]; optionalCovariateIndexes = new HashMap<String, Integer>(optionalCovariates.size()); int covariateIndex = 0; for (final Covariate covariate : requiredCovariates) requestedCovariates[covariateIndex++] = covariate; for (final Covariate covariate : optionalCovariates) { requestedCovariates[covariateIndex] = covariate; final String covariateName = covariate .getClass() .getSimpleName() .split("Covariate")[ 0]; // get the name of the covariate (without the "covariate" part of it) so we can // match with the GATKReport optionalCovariateIndexes.put(covariateName, covariateIndex - 2); covariateIndex++; } for (Covariate cov : requestedCovariates) cov.initialize( RAC); // initialize any covariate member variables using the shared argument collection recalibrationTables = new RecalibrationTables(requestedCovariates, allReadGroups.size()); initializeReadGroupCovariates(allReadGroups); parseReadGroupTable( report.getTable(RecalUtils.READGROUP_REPORT_TABLE_TITLE), recalibrationTables.getReadGroupTable()); parseQualityScoreTable( report.getTable(RecalUtils.QUALITY_SCORE_REPORT_TABLE_TITLE), recalibrationTables.getQualityScoreTable()); parseAllCovariatesTable( report.getTable(RecalUtils.ALL_COVARIATES_REPORT_TABLE_TITLE), recalibrationTables); }