Search in sources :

Example 1 with CollectGridssMetrics

use of gridss.analysis.CollectGridssMetrics in project gridss by PapenfussLab.

the class SAMEvidenceSource method ensureMetrics.

public void ensureMetrics() {
    if (metrics == null) {
        File idsvFile = getContext().getFileSystemContext().getIdsvMetrics(getFile());
        File cigarFile = getContext().getFileSystemContext().getCigarMetrics(getFile());
        File mapqFile = getContext().getFileSystemContext().getMapqMetrics(getFile());
        if (!idsvFile.exists() || !cigarFile.exists() || !mapqFile.exists()) {
            log.info("Calculating metrics for " + getFile().getAbsolutePath());
            List<String> args = Lists.newArrayList("INPUT=" + getFile().getAbsolutePath(), "OUTPUT=" + getContext().getFileSystemContext().getMetricsPrefix(getFile()).getAbsolutePath(), "THRESHOLD_COVERAGE=" + getContext().getConfig().maxCoverage, "FILE_EXTENSION=null", "GRIDSS_PROGRAM=null", "GRIDSS_PROGRAM=CollectCigarMetrics", "GRIDSS_PROGRAM=CollectMapqMetrics", "GRIDSS_PROGRAM=CollectTagMetrics", "GRIDSS_PROGRAM=CollectIdsvMetrics", "GRIDSS_PROGRAM=ReportThresholdCoverage", // use yet
            "PROGRAM=null", "PROGRAM=CollectAlignmentSummaryMetrics", "PROGRAM=QualityScoreDistribution");
            if (!knownSingleEnded()) {
                // Don't run CollectInsertSizeMetrics
                args.add("PROGRAM=CollectInsertSizeMetrics");
            }
            if (getContext().getCalculateMetricsRecordCount() < Integer.MAX_VALUE) {
                args.add("STOP_AFTER=" + getContext().getCalculateMetricsRecordCount());
            }
            execute(new CollectGridssMetrics(), args);
        }
        metrics = new IdsvSamFileMetrics(getContext(), getFile(), knownSingleEnded());
    }
}
Also used : IdsvSamFileMetrics(au.edu.wehi.idsv.metrics.IdsvSamFileMetrics) MetricsFile(htsjdk.samtools.metrics.MetricsFile) File(java.io.File) CollectGridssMetrics(gridss.analysis.CollectGridssMetrics)

Aggregations

IdsvSamFileMetrics (au.edu.wehi.idsv.metrics.IdsvSamFileMetrics)1 CollectGridssMetrics (gridss.analysis.CollectGridssMetrics)1 MetricsFile (htsjdk.samtools.metrics.MetricsFile)1 File (java.io.File)1