diff --git a/build.gradle b/build.gradle index 0812d183e..93f3cf651 100644 --- a/build.gradle +++ b/build.gradle @@ -149,7 +149,7 @@ tasks.withType(Test) { ext.htmlDir = new File("build/docs/html") ext.htmlDirInc = new File(htmlDir, "_includes") ext.commandClasses = ["picard.sam.AddCommentsToBam", "picard.sam.AddOrReplaceReadGroups", "picard.util.BaitDesigner", "picard.fastq.BamToBfq", - "picard.sam.BamIndexStats", "picard.util.BedToIntervalList", "picard.sam.BuildBamIndex", "picard.analysis.directed.CalculateHsMetrics", + "picard.sam.BamIndexStats", "picard.util.BedToIntervalList", "picard.sam.BuildBamIndex", "picard.sam.CalculateReadGroupChecksum", "picard.sam.CleanSam", "picard.analysis.CollectAlignmentSummaryMetrics", "picard.analysis.CollectBaseDistributionByCycle", "picard.analysis.CollectGcBiasMetrics", "picard.illumina.quality.CollectHiSeqXPfFailMetrics", "picard.analysis.directed.CollectHsMetrics", "picard.illumina.CollectIlluminaBasecallingMetrics", "picard.illumina.CollectIlluminaLaneMetrics", @@ -157,7 +157,6 @@ ext.commandClasses = ["picard.sam.AddCommentsToBam", "picard.sam.AddOrReplaceRea "picard.analysis.CollectOxoGMetrics", "picard.analysis.CollectQualityYieldMetrics", "picard.analysis.CollectRawWgsMetrics", "picard.analysis.directed.CollectTargetedPcrMetrics", "picard.analysis.CollectRnaSeqMetrics", "picard.analysis.CollectRrbsMetrics", "picard.analysis.artifacts.CollectSequencingArtifactMetrics", "picard.vcf.CollectVariantCallingMetrics", "picard.analysis.CollectWgsMetrics", - "picard.analysis.CollectWgsMetricsFromQuerySorted", "picard.analysis.CollectWgsMetricsFromSampledSites", "picard.analysis.CollectWgsMetricsWithNonZeroCoverage", "picard.analysis.CompareMetrics", "picard.sam.CompareSAMs", "picard.analysis.artifacts.ConvertSequencingArtifactToOxoG", "picard.sam.CreateSequenceDictionary", "picard.sam.DownsampleSam", "picard.illumina.ExtractIlluminaBarcodes", "picard.sam.markduplicates.EstimateLibraryComplexity", "picard.sam.FastqToSam", "picard.util.FifoBuffer", diff --git a/src/main/java/picard/analysis/CollectWgsMetrics.java b/src/main/java/picard/analysis/CollectWgsMetrics.java index 645adb3d7..2c7912a16 100644 --- a/src/main/java/picard/analysis/CollectWgsMetrics.java +++ b/src/main/java/picard/analysis/CollectWgsMetrics.java @@ -126,8 +126,7 @@ @Option(doc = "An interval list file that contains the positions to restrict the assessment. Please note that " + "all bases of reads that overlap these intervals will be considered, even if some of those bases extend beyond the boundaries of " + - "the interval. The ideal use case for this argument is to use it to restrict the calculation to a subset of (whole) contigs. To " + - "restrict the calculation just to individual positions without overlap, please see CollectWgsMetricsFromSampledSites.", + "the interval. The ideal use case for this argument is to use it to restrict the calculation to a subset of (whole) contigs.", optional = true, overridable = true) public File INTERVALS = null; diff --git a/src/main/java/picard/analysis/CollectWgsMetricsFromQuerySorted.java b/src/main/java/picard/analysis/CollectWgsMetricsFromQuerySorted.java deleted file mode 100644 index c147db0bc..000000000 --- a/src/main/java/picard/analysis/CollectWgsMetricsFromQuerySorted.java +++ /dev/null @@ -1,460 +0,0 @@ -/* - * The MIT License - * - * Copyright (c) 2015 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package picard.analysis; - -import htsjdk.samtools.*; -import htsjdk.samtools.metrics.MetricsFile; -import htsjdk.samtools.util.*; -import picard.cmdline.CommandLineProgram; -import picard.cmdline.CommandLineProgramProperties; -import picard.cmdline.Option; -import picard.cmdline.StandardOptionDefinitions; -import picard.cmdline.programgroups.Metrics; -import picard.util.QuerySortedReadPairIteratorUtil; - -import java.io.File; -import java.util.List; - -/** - * Computes a number of metrics that are useful for evaluating coverage and performance of sequencing experiments. - * - * This tool is deprecated; please use CollectWgsMetrics instead. - * - * @author ebanks - */ -@Deprecated -@CommandLineProgramProperties( - usage = "Computes a number of metrics that are useful for evaluating coverage and performance of " + - "sequencing experiments.", - usageShort = "Writes sequencing-related metrics for a SAM or BAM file", - programGroup = Metrics.class -) -public class CollectWgsMetricsFromQuerySorted extends CommandLineProgram { - - @Option(shortName = StandardOptionDefinitions.INPUT_SHORT_NAME, doc = "Input SAM or BAM file.") - public File INPUT; - - @Option(shortName = StandardOptionDefinitions.OUTPUT_SHORT_NAME, doc = "Output metrics file.") - public File OUTPUT; - - @Option(shortName = "USABLE_MQ", doc = "Minimum mapping quality for a read to contribute to usable coverage.", overridable = true, optional = true) - public int MINIMUM_USABLE_MAPPING_QUALITY = 20; - - @Option(shortName = "USABLE_Q", doc = "Minimum base quality for a base to contribute to usable coverage.", overridable = true, optional = true) - public int MINIMUM_USABLE_BASE_QUALITY = 20; - - @Option(shortName = "RAW_MQ", doc = "Minimum mapping quality for a read to contribute to raw coverage.", overridable = true, optional = true) - public int MINIMUM_RAW_MAPPING_QUALITY = 0; - - @Option(shortName = "RAW_Q", doc = "Minimum base quality for a base to contribute to raw coverage.", overridable = true, optional = true) - public int MINIMUM_RAW_BASE_QUALITY = 3; - - @Option(doc = "The number of bases in the genome build of the input file to be used for calculating MEAN_COVERAGE. If not provided, we will assume that ALL bases in the genome should be used (including e.g. Ns)", overridable = true, optional = true) - public Long GENOME_TERRITORY = null; - - private final Log log = Log.getInstance(CollectWgsMetricsFromQuerySorted.class); - - //the adapter utility class - private AdapterUtility adapterUtility; - - /** the various metrics types */ - public enum FILTERING_STRINGENCY { RAW, USABLE } - - /** Metrics for evaluating the performance of whole genome sequencing experiments. */ - public static class QuerySortedSeqMetrics extends CollectWgsMetrics.WgsMetrics { - /** Identifier for metrics type */ - public FILTERING_STRINGENCY TYPE; - - /** The total number of bases, before any filters are applied. */ - public long PF_BASES = 0; - /** The number of passing bases, after all filters are applied. */ - public long PF_PASSING_BASES = 0; - - /** The number of read pairs, before all filters are applied. */ - public long PF_READ_PAIRS = 0; - /** The number of duplicate read pairs, before any filters are applied. */ - public long PF_DUPE_PAIRS = 0; - - /** The number of aligned reads, before any filters are applied. */ - public long PF_READS_ALIGNED = 0; - - /** - * The number of PF reads that are marked as noise reads. A noise read is one which is composed - * entirely of A bases and/or N bases. These reads are marked as they are usually artifactual and - * are of no use in downstream analysis. - */ - public long PF_NOISE_READS = 0; - - /** - * The number of PF reads that map outside of a maximum insert size (100kb) or that have - * the two ends mapping to different chromosomes. - */ - public long PF_CHIMERIC_PAIRS = 0; - - /** - * The number of PF reads that are unaligned and match to a known adapter sequence right from the - * start of the read. - */ - public long PF_ADAPTER_READS = 0; - - /** The number of read pairs with standard orientations from which to calculate mean insert size, after filters are applied. */ - public long PF_ORIENTED_PAIRS = 0; - /** The mean insert size, after filters are applied. */ - public double MEAN_INSERT_SIZE = 0.0; - } - - /** A private class to track the intermediate values of certain metrics */ - private class IntermediateMetrics { - final QuerySortedSeqMetrics metrics = new QuerySortedSeqMetrics(); - long basesExcludedByDupes = 0; - long basesExcludedByMapq = 0; - long basesExcludedByPairing = 0; - long basesExcludedByBaseq = 0; - long basesExcludedByOverlap = 0; - double insertSizeSum = 0.0; - } - - public static void main(final String[] args) { - new CollectWgsMetricsFromQuerySorted().instanceMainWithExit(args); - } - - @Override - protected int doWork() { - IOUtil.assertFileIsReadable(INPUT); - IOUtil.assertFileIsWritable(OUTPUT); - - // progress tracker - final ProgressLogger progress = new ProgressLogger(log, 50000000, "Processed", "read pairs"); - - // the SAM reader - final SamReader reader = SamReaderFactory.makeDefault().open(INPUT); - final PeekableIterator iterator = new PeekableIterator<>(reader.iterator()); - - // the metrics to keep track of - final IntermediateMetrics usableMetrics = new IntermediateMetrics(); - usableMetrics.metrics.TYPE = FILTERING_STRINGENCY.USABLE; - final IntermediateMetrics rawMetrics = new IntermediateMetrics(); - rawMetrics.metrics.TYPE = FILTERING_STRINGENCY.RAW; - - adapterUtility = new AdapterUtility(AdapterUtility.DEFAULT_ADAPTER_SEQUENCE); - - // Loop through all the loci by read pairs - QuerySortedReadPairIteratorUtil.ReadPair pairToAnalyze = QuerySortedReadPairIteratorUtil.getNextReadPair(iterator); - while (pairToAnalyze != null) { - // calculate intermediate metrics - calculateMetricsForRead(pairToAnalyze, usableMetrics, MINIMUM_USABLE_MAPPING_QUALITY, MINIMUM_USABLE_BASE_QUALITY); - calculateMetricsForRead(pairToAnalyze, rawMetrics, MINIMUM_RAW_MAPPING_QUALITY, MINIMUM_RAW_BASE_QUALITY); - - // record progress - progress.record(pairToAnalyze.read1); - - // iterate - pairToAnalyze = QuerySortedReadPairIteratorUtil.getNextReadPair(iterator); - } - - // finalize and write the metrics - final long genomeTerritory = (GENOME_TERRITORY == null || GENOME_TERRITORY < 1L) ? reader.getFileHeader().getSequenceDictionary().getReferenceLength() : GENOME_TERRITORY; - usableMetrics.metrics.GENOME_TERRITORY = genomeTerritory; - finalizeMetrics(usableMetrics); - rawMetrics.metrics.GENOME_TERRITORY = genomeTerritory; - finalizeMetrics(rawMetrics); - - final MetricsFile out = getMetricsFile(); - out.addMetric(usableMetrics.metrics); - out.addMetric(rawMetrics.metrics); - out.write(OUTPUT); - return 0; - } - - /** - * Calculate the contribution to the intermediate metrics for a given read pair - * - * @param pairToAnalyze the read pair to grab metrics from - * @param metrics the intermediate metrics with all the data we need - * @param minimumMappingQuality the minimum mapping quality - * @param minimumBaseQuality the minimum base quality - */ - private void calculateMetricsForRead(final QuerySortedReadPairIteratorUtil.ReadPair pairToAnalyze, - final IntermediateMetrics metrics, - final int minimumMappingQuality, - final int minimumBaseQuality) { - // don't bother at all with non-PF read pairs; if one is non-PF then the other is too so we only need to check the first one - if (pairToAnalyze.read1.getReadFailsVendorQualityCheckFlag()) { - return; - } - - final boolean isPaired = (pairToAnalyze.read2 != null); - - // how many bases do we have? - final int read1bases = pairToAnalyze.read1.getReadLength(); - final int read2bases = isPaired ? pairToAnalyze.read2.getReadLength() : 0; - final int totalReadBases = read1bases + read2bases; - - // now compute metrics... - metrics.metrics.PF_BASES += totalReadBases; - if (isNoiseRead(pairToAnalyze.read1)) metrics.metrics.PF_NOISE_READS++; - - if (!pairToAnalyze.read1.getReadUnmappedFlag()) metrics.metrics.PF_READS_ALIGNED++; - else if (isAdapterRead(pairToAnalyze.read1)) metrics.metrics.PF_ADAPTER_READS++; - - if (isPaired) { - metrics.metrics.PF_READ_PAIRS++; - if (!pairToAnalyze.read2.getReadUnmappedFlag()) metrics.metrics.PF_READS_ALIGNED++; - else if (isAdapterRead(pairToAnalyze.read2)) metrics.metrics.PF_ADAPTER_READS++; - - if (isChimericReadPair(pairToAnalyze, minimumMappingQuality)) metrics.metrics.PF_CHIMERIC_PAIRS++; - } - - // We note here several differences between this tool and CollectWgsMetrics: - // 1. CollectWgsMetrics does NOT count paired reads that are both unmapped in the PCT_EXC_UNPAIRED, but we do so here - // because this tool isn't a locus iterator and we need to ensure that our passing base numbers are accurate in the end. - // 2. For a similar reason, we DO count soft-clipped bases (and they are usually - but not always - filtered as part of - // PCT_EXC_BASEQ), while CollectWgsMetrics does not count them. - // 3. We DO count bases from insertions as part of the total coverage, while CollectWgsMetrics does not (because it cannot). - if (!isPaired || pairToAnalyze.read1.getMateUnmappedFlag() || pairToAnalyze.read2.getMateUnmappedFlag()) { - metrics.basesExcludedByPairing += totalReadBases; - } else if (pairToAnalyze.read1.getDuplicateReadFlag()) { - metrics.metrics.PF_DUPE_PAIRS++; - metrics.basesExcludedByDupes += totalReadBases; - } else { - - // determine the bad bases from the reads - final BaseExclusionHelper read1exclusions = determineBaseExclusions(pairToAnalyze.read1, minimumMappingQuality, minimumBaseQuality); - final BaseExclusionHelper read2exclusions = determineBaseExclusions(pairToAnalyze.read2, minimumMappingQuality, minimumBaseQuality); - metrics.basesExcludedByMapq += read1exclusions.basesExcludedByMapq + read2exclusions.basesExcludedByMapq; - metrics.basesExcludedByBaseq += read1exclusions.lowBQcount + read2exclusions.lowBQcount; - - // keep track of the total usable bases - int usableBaseCount = totalReadBases; - usableBaseCount -= (read1exclusions.basesExcludedByMapq + read1exclusions.lowBQcount); - usableBaseCount -= (read2exclusions.basesExcludedByMapq + read2exclusions.lowBQcount); - - // subtract out bad bases from overlaps between the reads, but only if both reads pass mapping quality thresholds - if (read1exclusions.basesExcludedByMapq == 0 && read2exclusions.basesExcludedByMapq == 0) { - final int overlapCount = getOverlappingBaseCount(read1exclusions, read2exclusions, minimumBaseQuality); - metrics.basesExcludedByOverlap += overlapCount; - usableBaseCount -= overlapCount; - } - - metrics.metrics.PF_PASSING_BASES += usableBaseCount; - - final int insertSize = Math.abs(pairToAnalyze.read1.getInferredInsertSize()); - if (insertSize > 0 && pairToAnalyze.read1.getProperPairFlag()) { - metrics.metrics.PF_ORIENTED_PAIRS++; - metrics.insertSizeSum += insertSize; - } - } - } - - /** - * Finalize the metrics by doing some fun but easy math - * - * @param metrics the intermediate metrics with all the data we need - */ - private void finalizeMetrics(final IntermediateMetrics metrics) { - setUnusedMetrics(metrics.metrics); - metrics.metrics.MEAN_COVERAGE = metrics.metrics.PF_PASSING_BASES / (double)metrics.metrics.GENOME_TERRITORY; - metrics.metrics.PCT_EXC_DUPE = metrics.basesExcludedByDupes / (double)metrics.metrics.PF_BASES; - metrics.metrics.PCT_EXC_MAPQ = metrics.basesExcludedByMapq / (double)metrics.metrics.PF_BASES; - metrics.metrics.PCT_EXC_UNPAIRED = metrics.basesExcludedByPairing / (double)metrics.metrics.PF_BASES; - metrics.metrics.PCT_EXC_BASEQ = metrics.basesExcludedByBaseq / (double)metrics.metrics.PF_BASES; - metrics.metrics.PCT_EXC_OVERLAP = metrics.basesExcludedByOverlap / (double)metrics.metrics.PF_BASES; - final double totalExcludedBases = metrics.metrics.PF_BASES - metrics.metrics.PF_PASSING_BASES; - metrics.metrics.PCT_EXC_TOTAL = totalExcludedBases / metrics.metrics.PF_BASES; - metrics.metrics.MEAN_INSERT_SIZE = metrics.insertSizeSum / metrics.metrics.PF_ORIENTED_PAIRS; - } - - /** - * @param record the read - * @return true if the read is considered a "noise" read (all As and/or Ns), false otherwise - */ - private boolean isNoiseRead(final SAMRecord record) { - final Object noiseAttribute = record.getAttribute(ReservedTagConstants.XN); - return (noiseAttribute != null && noiseAttribute.equals(1)); - } - - /** - * @param record the read - * @return true if the read is from known adapter sequence, false otherwise - */ - private boolean isAdapterRead(final SAMRecord record) { - final byte[] readBases = record.getReadBases(); - if (!(record instanceof BAMRecord)) StringUtil.toUpperCase(readBases); - return adapterUtility.isAdapterSequence(readBases); - } - - /** - * @param readPair the read pair - * @param minimumMappingQuality the minimum mapping quality - * @return true if the read pair is considered chimeric, false otherwise - */ - private boolean isChimericReadPair(final QuerySortedReadPairIteratorUtil.ReadPair readPair, final int minimumMappingQuality) { - // Check that both ends are aligned, have mapq > minimum, and fit the bill for chimeras - return (readPair.read1.getMappingQuality() >= minimumMappingQuality && readPair.read2.getMappingQuality() >= minimumMappingQuality && - ChimeraUtil.isChimeric(readPair.read1, readPair.read2, ChimeraUtil.DEFAULT_INSERT_SIZE_LIMIT, ChimeraUtil.DEFAULT_EXPECTED_ORIENTATIONS)); - } - - /** - * Get the count of low quality and/or softclip bases in the given read - * - * @param exclusions the helper object - * @param minimumBaseQuality the minimum base quality - * @return non-negative int - */ - private int getLowQualityOrSoftclipBaseCount(final BaseExclusionHelper exclusions, final int minimumBaseQuality) { - final byte[] quals = exclusions.read.getBaseQualities(); - - int badCount = exclusions.firstUnclippedBaseIndex + (quals.length - exclusions.firstTrailingClippedBaseIndex); - for (int i = exclusions.firstUnclippedBaseIndex; i < exclusions.firstTrailingClippedBaseIndex; i++) { - if (quals[i] < minimumBaseQuality) - badCount++; - } - return badCount; - } - - /** - * set the values of the unused metrics to -1 - * - * @param metrics the metrics object - */ - private void setUnusedMetrics(final QuerySortedSeqMetrics metrics) { - metrics.SD_COVERAGE = -1; - metrics.MEDIAN_COVERAGE = -1; - metrics.MAD_COVERAGE = -1; - metrics.PCT_1X = -1; - metrics.PCT_5X = -1; - metrics.PCT_10X = -1; - metrics.PCT_15X = -1; - metrics.PCT_20X = -1; - metrics.PCT_25X = -1; - metrics.PCT_30X = -1; - metrics.PCT_40X = -1; - metrics.PCT_50X = -1; - metrics.PCT_60X = -1; - metrics.PCT_70X = -1; - metrics.PCT_80X = -1; - metrics.PCT_90X = -1; - metrics.PCT_100X = -1; - metrics.PCT_EXC_CAPPED = -1; - } - - /** - * Get the count of overlapping bases for the given reads - * - * @param read1exclusions the 1st read exclusions - * @param read2exclusions the 2nd read exclusions - * @param minimumBaseQuality the minimum base quality - * @return non-negative int - */ - private int getOverlappingBaseCount(final BaseExclusionHelper read1exclusions, final BaseExclusionHelper read2exclusions, final int minimumBaseQuality) { - // make life easy by ensuring that reads come in coordinate order - if ( read2exclusions.read.getAlignmentStart() < read1exclusions.read.getAlignmentStart() ) { - return getOverlappingBaseCount(read2exclusions, read1exclusions, minimumBaseQuality); - } - - // must be overlapping - if ( read1exclusions.read.getAlignmentEnd() < read2exclusions.read.getAlignmentStart() || - !read1exclusions.read.getReferenceIndex().equals(read2exclusions.read.getReferenceIndex()) ) - return 0; - - final byte[] read1quals = read1exclusions.read.getBaseQualities(); - final byte[] read2quals = read2exclusions.read.getBaseQualities(); - final int indexOfOverlapInFirstRead = read1exclusions.read.getReadPositionAtReferencePosition(read2exclusions.read.getAlignmentStart(), true) - 1; - final int maxPossibleOverlap = read1exclusions.firstTrailingClippedBaseIndex - indexOfOverlapInFirstRead; - // the overlap cannot actually be larger than the usable bases in read2 - final int actualOverlap = Math.min(maxPossibleOverlap, read2exclusions.firstTrailingClippedBaseIndex - read2exclusions.firstUnclippedBaseIndex); - int numHighQualityOverlappingBases = 0; - - for (int i = 0; i < actualOverlap; i++) { - // we count back from the end of the aligned bases (i.e. not included soft-clips) in read1 and from the front of read2 - final int posInRead1 = read1exclusions.firstTrailingClippedBaseIndex - actualOverlap + i; - final int posInRead2 = read2exclusions.firstUnclippedBaseIndex + i; - - // we only want to count it if they are both high quality (i.e. not already counted among bad bases) - if (read1quals[posInRead1] >= minimumBaseQuality && read2quals[posInRead2] >= minimumBaseQuality) { - numHighQualityOverlappingBases++; - } - } - - return numHighQualityOverlappingBases; - } - - /** - * Determine how many bases are excluded because of low mapping or base quality. - * - * @param read the read - * @param minimumMappingQuality the minimum mapping quality - * @param minimumBaseQuality the minimum base quality - * @return non-null object - */ - private BaseExclusionHelper determineBaseExclusions(final SAMRecord read, final int minimumMappingQuality, final int minimumBaseQuality) { - final BaseExclusionHelper exclusions = new BaseExclusionHelper(read); - - if (read.getMappingQuality() < minimumMappingQuality) { - exclusions.basesExcludedByMapq = read.getReadLength(); - } else { - exclusions.lowBQcount = getLowQualityOrSoftclipBaseCount(exclusions, minimumBaseQuality); - } - - return exclusions; - } - - private static class BaseExclusionHelper { - public SAMRecord read; - public int firstUnclippedBaseIndex; - public int firstTrailingClippedBaseIndex; - public int basesExcludedByMapq = 0; - public int lowBQcount = 0; - - public BaseExclusionHelper(final SAMRecord read) { - this.read = read; - - final List cigarElements = read.getCigar().getCigarElements(); - firstUnclippedBaseIndex = 0; - for (final CigarElement element : cigarElements) { - final CigarOperator op = element.getOperator(); - - if (op == CigarOperator.SOFT_CLIP) { - firstUnclippedBaseIndex = element.getLength(); - } else if (op != CigarOperator.HARD_CLIP) { - break; - } - } - - firstTrailingClippedBaseIndex = read.getReadLength(); - for (int i = cigarElements.size() - 1; i >= 0; --i) { - final CigarElement element = cigarElements.get(i); - final CigarOperator op = element.getOperator(); - - if (op == CigarOperator.SOFT_CLIP) { - firstTrailingClippedBaseIndex -= element.getLength(); - } else if (op != CigarOperator.HARD_CLIP) { - break; - } - } - } - } -} - diff --git a/src/main/java/picard/analysis/CollectWgsMetricsFromSampledSites.java b/src/main/java/picard/analysis/CollectWgsMetricsFromSampledSites.java deleted file mode 100644 index 8cfa86d99..000000000 --- a/src/main/java/picard/analysis/CollectWgsMetricsFromSampledSites.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * The MIT License - * - * Copyright (c) 2015 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package picard.analysis; - -import htsjdk.samtools.SamReader; -import htsjdk.samtools.util.*; -import picard.cmdline.CommandLineProgramProperties; -import picard.cmdline.Option; -import picard.cmdline.programgroups.Metrics; -import picard.filter.CountingFilter; - -import java.io.File; - -/** - * Computes a number of metrics that are useful for evaluating coverage and performance of whole genome sequencing experiments, - * but only at a set of sampled positions. - * It is important that the sampled positions be chosen so that they are spread out at least further than a read's length apart; - * otherwise, you run the risk of double-counting reads in the metrics. - * - * This tool is deprecated; please use CollectWgsMetrics instead. - * - * @author ebanks - */ -@Deprecated -@CommandLineProgramProperties( - usage = "Computes a number of metrics that are useful for evaluating coverage and performance of " + - "whole genome sequencing experiments, but only at a set of sampled positions. " + - "It is important that the sampled positions be chosen so that they are spread out " + - "at least further than a read's length apart; otherwise, you run the risk of double-counting " + - "reads in the metrics. If contig-sized intervals are needed, use INTERVALS argument in CollectWgsMetrics.", - usageShort = "Writes whole genome sequencing-related metrics for a SAM or BAM file", - programGroup = Metrics.class -) - -public class CollectWgsMetricsFromSampledSites extends CollectWgsMetrics { - - @Option(doc = "An interval list file that contains the locations of the positions to assess.", optional = false) - public File INTERVALS = null; - - public static void main(final String[] args) { - new CollectWgsMetricsFromSampledSites().instanceMainWithExit(args); - } - - @Override - protected SamLocusIterator getLocusIterator(final SamReader in) { - IOUtil.assertFileIsReadable(INTERVALS); - return new SamLocusIterator(in, IntervalList.fromFile(INTERVALS)); - } - - /** - * By design we want to count just those bases at the positions we care about, not across the entire read. - * Therefore, we call filter.getFilteredRecords() so that only the bases in the pileup at a given position - * are included in the calculations (with filter.getFilteredBases() we would be including other bases in - * the read too). - */ - @Override - protected long getBasesExcludedBy(final CountingFilter filter) { - return filter.getFilteredRecords(); - } - - // rename the class so that in the metric file it is annotated differently. - public static class SampledWgsMetrics extends WgsMetrics { - public SampledWgsMetrics() { - super(); - } - - public SampledWgsMetrics(final IntervalList intervals, - final Histogram highQualityDepthHistogram, - final Histogram unfilteredDepthHistogram, - final double pctExcludedByMapq, - final double pctExcludedByDupes, - final double pctExcludedByPairing, - final double pctExcludedByBaseq, - final double pctExcludedByOverlap, - final double pctExcludedByCapping, - final double pctTotal, - final int coverageCap, - final Histogram unfilteredBaseQHistogram, - final int sampleSize) { - super(intervals, highQualityDepthHistogram, unfilteredDepthHistogram, pctExcludedByMapq, pctExcludedByDupes, pctExcludedByPairing, pctExcludedByBaseq, - pctExcludedByOverlap, pctExcludedByCapping, pctTotal, coverageCap, unfilteredBaseQHistogram, sampleSize); - } - } - - @Override - protected WgsMetrics generateWgsMetrics(final IntervalList intervals, - final Histogram highQualityDepthHistogram, - final Histogram unfilteredDepthHistogram, - final double pctExcludedByMapq, - final double pctExcludedByDupes, - final double pctExcludedByPairing, - final double pctExcludedByBaseq, - final double pctExcludedByOverlap, - final double pctExcludedByCapping, - final double pctTotal, - final int coverageCap, - final Histogram unfilteredBaseQHistogram, - final int sampleSize) { - return new SampledWgsMetrics( - intervals, - highQualityDepthHistogram, - unfilteredDepthHistogram, - pctExcludedByMapq, - pctExcludedByDupes, - pctExcludedByPairing, - pctExcludedByBaseq, - pctExcludedByOverlap, - pctExcludedByCapping, - pctTotal, - coverageCap, - unfilteredBaseQHistogram, - sampleSize); - }} - diff --git a/src/main/java/picard/analysis/directed/CalculateHsMetrics.java b/src/main/java/picard/analysis/directed/CalculateHsMetrics.java deleted file mode 100644 index 68a465ca3..000000000 --- a/src/main/java/picard/analysis/directed/CalculateHsMetrics.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * The MIT License - * - * Copyright (c) 2009 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package picard.analysis.directed; - -import picard.cmdline.CommandLineProgramProperties; -import picard.cmdline.Option; -import picard.cmdline.programgroups.Metrics; - -import static picard.cmdline.StandardOptionDefinitions.MINIMUM_MAPPING_QUALITY_SHORT_NAME; - -/** - * Calculates a set of HS metrics from a sam or bam file. See HsMetricsCollector and CollectTargetedMetrics for more details. - * - * @author Tim Fennell - */ - -@CommandLineProgramProperties( - usage = "DEPRECATED: Use CollectHsMetrics instead. Calculates a set of Hybrid Selection specific metrics from an aligned SAM" + - "or BAM file. If a reference sequence is provided, AT/GC dropout metrics will " + - "be calculated, and the PER_TARGET_COVERAGE option can be used to output GC and " + - "mean coverage information for every target.", - usageShort = "DEPRECATED: Use CollectHsMetrics instead.", - programGroup = Metrics.class -) -@Deprecated -public class CalculateHsMetrics extends CollectHsMetrics { - - @Option(shortName = MINIMUM_MAPPING_QUALITY_SHORT_NAME, doc = "Minimum mapping quality for a read to contribute coverage.", overridable = true) - public int MINIMUM_MAPPING_QUALITY = 1; - - @Option(shortName = "Q", doc = "Minimum base quality for a base to contribute coverage.", overridable = true) - public int MINIMUM_BASE_QUALITY = 0; - - @Option(doc = "True if we are to clip overlapping reads, false otherwise.", optional=true) - public boolean CLIP_OVERLAPPING_READS = false; - -} diff --git a/src/main/java/picard/analysis/directed/CollectHsMetrics.java b/src/main/java/picard/analysis/directed/CollectHsMetrics.java index 4c66a6230..716de1d6c 100644 --- a/src/main/java/picard/analysis/directed/CollectHsMetrics.java +++ b/src/main/java/picard/analysis/directed/CollectHsMetrics.java @@ -126,7 +126,7 @@ protected String getProbeSetName() { /** Stock main method. */ public static void main(final String[] argv) { - System.exit(new CalculateHsMetrics().instanceMain(argv)); + System.exit(new CollectHsMetrics().instanceMain(argv)); } @Override diff --git a/src/main/java/picard/fingerprint/GenotypeReader.java b/src/main/java/picard/fingerprint/GenotypeReader.java deleted file mode 100644 index 564aea5bf..000000000 --- a/src/main/java/picard/fingerprint/GenotypeReader.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * The MIT License - * - * Copyright (c) 2010 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package picard.fingerprint; - -import htsjdk.tribble.readers.SynchronousLineReader; -import picard.PicardException; -import htsjdk.samtools.util.IOUtil; -import htsjdk.samtools.util.Interval; -import htsjdk.samtools.util.IntervalList; -import htsjdk.samtools.util.OverlapDetector; -import htsjdk.samtools.SAMSequenceDictionary; -import htsjdk.samtools.util.CloseableIterator; -import htsjdk.tribble.readers.LineIterator; -import htsjdk.tribble.readers.LineIteratorImpl; -import htsjdk.variant.variantcontext.VariantContext; -import htsjdk.variant.vcf.VCFCodec; - -import java.io.BufferedInputStream; -import java.io.File; -import java.util.Collection; - -/** - * Class that abstracts away the source of genotypes and provides abilities to read them - * in from various sources into VariantContext objects - * - * @deprecated Please use VCFFileReader instead of this class. - */ -public class GenotypeReader { - /** Small class to encapsulate an iterator over variants, optionally with a sequence dictionary. */ - public abstract static class VariantIterator implements CloseableIterator { - private final SAMSequenceDictionary dictionary; - private final Object header; - - protected VariantIterator(final SAMSequenceDictionary dictionary, final Object header) { - this.dictionary = dictionary; - this.header = header; - } - - public SAMSequenceDictionary getSequenceDictionary() { - return this.dictionary; - } - - public Object getHeader() { - return header; - } - } - - /** - * Reads in a file that contains genotype data and returns an iterator over every entry - * in the file as VariantContext objects. - * - * @deprecated Please use VCFFileReader in Picard-public instead of this class. - */ - public VariantIterator read(final File file) { - if (isVcf(file)) return readVcf(file); - else throw new PicardException("File doe not appear to be of a supported type: " + file); - } - - /** - * Reads in the file and returns an iterator over the set of entries in the file - * that overlap with the interval supplied. - * - * @deprecated Please use VCFFileReader in Picard-public instead of this class. - */ - public VariantIterator read(final File file, final IntervalList intervals) { - final VariantIterator i = read(file); - final OverlapDetector detector = new OverlapDetector(0,0); - detector.addAll(intervals.getIntervals(), intervals.getIntervals()); - - // A little iterator that iterates over the full set of genotypes and returns just the ones - // the client is interested in. - return new VariantIterator(i.getSequenceDictionary(), i.getHeader()) { - private VariantContext next = null; - - @Override public boolean hasNext() { - if (next == null) { - while (i.hasNext()) { - final VariantContext ctx = i.next(); - final Interval ctxInterval = new Interval(ctx.getContig(), ctx.getStart(), ctx.getEnd()); - final Collection hits = detector.getOverlaps(ctxInterval); - if (hits != null && !hits.isEmpty()) { - next = ctx; - break; - } - } - } - - return next != null; - } - - /** Returns the next VariantContext object if available. */ - @Override public VariantContext next() { - if (!hasNext()) throw new IllegalStateException("next() called on exhausted iterator."); - - final VariantContext ctx = next; - next = null; - return ctx; - } - - @Override public void remove() { throw new UnsupportedOperationException(); } - - @Override - public void close() { - i.close(); - } - }; - } - - /** Tests whether a file is a VCF file or not. */ - boolean isVcf(final File f) { - final String name = f.getName(); - return (name.endsWith(".vcf") || name.endsWith(".vcf.gz")); - } - - /** - * Opens a VCF file and returns an iterator over VariantContext objects. - * - * @deprecated Please use VCFFileReader in Picard-public instead of this class. - */ - VariantIterator readVcf(final File file) { - final LineIterator reader = new LineIteratorImpl(new SynchronousLineReader(new BufferedInputStream(IOUtil.openFileForReading(file)))); - final VCFCodec codec = new VCFCodec(); - final Object header; - header = codec.readActualHeader(reader); - - return new VariantIterator(null, header) { - @Override public boolean hasNext() { - return reader.hasNext(); - } - - @Override public VariantContext next() { - return codec.decode(reader.next()); - } - - @Override public void remove() { - throw new UnsupportedOperationException(); - } - - @Override - public void close() { - codec.close(reader); - } - }; - } -} diff --git a/src/test/java/picard/analysis/CollectWgsMetricsFromQuerySortedTest.java b/src/test/java/picard/analysis/CollectWgsMetricsFromQuerySortedTest.java deleted file mode 100644 index 1ad9cc7dd..000000000 --- a/src/test/java/picard/analysis/CollectWgsMetricsFromQuerySortedTest.java +++ /dev/null @@ -1,83 +0,0 @@ -package picard.analysis; - -import htsjdk.samtools.metrics.MetricsFile; -import org.testng.Assert; -import org.testng.annotations.Test; -import picard.cmdline.CommandLineProgramTest; - -import java.io.*; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.List; - -/** - * Tests for methods in CollectWgsMetricsFromQuerySorted - * - * - * @author Eric Banks - */ -@Deprecated -public class CollectWgsMetricsFromQuerySortedTest extends CommandLineProgramTest { - - private static final File TEST_DATA_DIR = new File("testdata/picard/sam"); - - public String getCommandLineProgramName() { - return CollectWgsMetricsFromQuerySorted.class.getSimpleName(); - } - - - @Test - public void testMetricsFromClippedOverhangs() throws IOException { - final File input = new File(TEST_DATA_DIR, "namesorted.test.sam"); - final File outfile = File.createTempFile("metrics", ".txt"); - outfile.deleteOnExit(); - final String[] args = new String[] { - "INPUT=" + input.getAbsolutePath(), - "OUTPUT=" + outfile.getAbsolutePath() - }; - Assert.assertEquals(runPicardCommandLine(args), 0); - - final MetricsFile> output = new MetricsFile>(); - output.read(new FileReader(outfile)); - validateMetrics(output.getMetrics(), 3095693981L); - } - - @Test - public void testPassingInGenomeTerritory() throws IOException { - final File input = new File(TEST_DATA_DIR, "namesorted.test.sam"); - final File outfile = File.createTempFile("metrics", ".txt"); - outfile.deleteOnExit(); - final String[] args = new String[] { - "INPUT=" + input.getAbsolutePath(), - "OUTPUT=" + outfile.getAbsolutePath(), - "GENOME_TERRITORY=1000" - }; - Assert.assertEquals(runPicardCommandLine(args), 0); - - final MetricsFile> output = new MetricsFile>(); - output.read(new FileReader(outfile)); - validateMetrics(output.getMetrics(), 1000L); - } - - private void validateMetrics(final List metrics, final long genomeSize) { - for (final CollectWgsMetricsFromQuerySorted.QuerySortedSeqMetrics row : metrics) { - final boolean isRaw = row.TYPE == CollectWgsMetricsFromQuerySorted.FILTERING_STRINGENCY.RAW; - - Assert.assertEquals(row.GENOME_TERRITORY, genomeSize); - Assert.assertEquals(row.PF_BASES, 606); - Assert.assertEquals(row.PF_PASSING_BASES, isRaw ? 238 : 200); - Assert.assertEquals(row.PCT_EXC_OVERLAP, isRaw ? 0.085809 : 0.013201); // raw: 52/606, usable: 8/606 - Assert.assertEquals(row.PCT_EXC_BASEQ, isRaw ? 0.188119 : 0.156766); // raw: 114/606, usable 95/606 - Assert.assertEquals(row.PCT_EXC_MAPQ, isRaw ? 0.0 : 0.166667); // raw: 0/606, usable:101/606 - Assert.assertEquals(row.PCT_EXC_DUPE, 0.333333); // both: 202/606 - Assert.assertEquals(row.PF_READ_PAIRS, 3); - Assert.assertEquals(row.PF_DUPE_PAIRS, 1); - Assert.assertEquals(row.PF_READS_ALIGNED, 6); - Assert.assertEquals(row.PF_ORIENTED_PAIRS, 2); - Assert.assertEquals(row.MEAN_INSERT_SIZE, 118.0); - - final BigDecimal meanCov = new BigDecimal((double)row.PF_PASSING_BASES / genomeSize).setScale(6, RoundingMode.HALF_UP); - Assert.assertEquals(Double.compare(row.MEAN_COVERAGE, meanCov.doubleValue()), 0); - } - } -} \ No newline at end of file diff --git a/src/test/java/picard/analysis/CollectWgsMetricsFromSampledSitesTest.java b/src/test/java/picard/analysis/CollectWgsMetricsFromSampledSitesTest.java deleted file mode 100644 index bbf3df9e1..000000000 --- a/src/test/java/picard/analysis/CollectWgsMetricsFromSampledSitesTest.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * The MIT License - * - * Copyright (c) 2010 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package picard.analysis; - -import htsjdk.samtools.metrics.MetricsFile; -import org.testng.Assert; -import org.testng.annotations.Test; -import picard.cmdline.CommandLineProgramTest; - -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -/** - * Tests CollectWgsMetricsFromSampledSites - */ -@Deprecated -public class CollectWgsMetricsFromSampledSitesTest extends CommandLineProgramTest { - private static final File TEST_DATA_DIR = new File("testdata/picard/sam/"); - - public String getCommandLineProgramName() { - return CollectWgsMetricsFromSampledSites.class.getSimpleName(); - } - - @Test - public void testOnePos() throws IOException { - final File input = new File(TEST_DATA_DIR, "forMetrics.sam"); - final File outfile = File.createTempFile("test", ".wgs_metrics"); - final File ref = new File(TEST_DATA_DIR, "merger.fasta"); - final File intervals = new File(TEST_DATA_DIR, "onePos.interval_list"); - final int sampleSize = 1000; - outfile.deleteOnExit(); - final String[] args = new String[] { - "INPUT=" + input.getAbsolutePath(), - "OUTPUT=" + outfile.getAbsolutePath(), - "REFERENCE_SEQUENCE=" + ref.getAbsolutePath(), - "INTERVALS=" + intervals.getAbsolutePath(), - "INCLUDE_BQ_HISTOGRAM=true", - "SAMPLE_SIZE=" + sampleSize - }; - Assert.assertEquals(runPicardCommandLine(args), 0); - - final MetricsFile> output = new MetricsFile<>(); - output.read(new FileReader(outfile)); - - for (final CollectWgsMetrics.WgsMetrics metrics : output.getMetrics()) { - Assert.assertEquals(metrics.GENOME_TERRITORY, 1); - Assert.assertEquals(metrics.MEAN_COVERAGE, 3.0); - Assert.assertEquals(metrics.PCT_EXC_MAPQ, 0.272727); // 3 of 11 - Assert.assertEquals(metrics.PCT_EXC_DUPE, 0.181818); // 2 of 11 - Assert.assertEquals(metrics.PCT_EXC_UNPAIRED, 0.090909); // 1 of 9 - Assert.assertEquals(metrics.PCT_EXC_BASEQ, 0.090909); // 1 of 9 - - // R code below computes the expected het sensitivity at this single base pair locus - //# sample a lot of points to reduce variance around the true mean - //sample_size <- 100000 - //T <- 3 - // - //# coverage is always 4 - //n <- 4 - // - //# draw alt reads from n total reads - //m <- rbinom(n = sample_size, size = n, prob = 0.5) - // - //# at this site we only have BQ = 32 bases - //base_quality = 32 - //C_n = 10*(n*log10(2) + T) - //sum(base_quality*m > C_n)/length(base_quality*m) - // # get ~0.68791 += 0.02 - - Assert.assertEquals(metrics.HET_SNP_SENSITIVITY, 0.68791, .02); - - - } - } - - @Test - public void testContiguousIntervals() throws IOException { - final File input = new File(TEST_DATA_DIR, "forMetrics.sam"); - final File outfile = File.createTempFile("test", ".wgs_metrics"); - final File ref = new File(TEST_DATA_DIR, "merger.fasta"); - final File intervals = new File(TEST_DATA_DIR, "contiguous.interval_list"); - final int sampleSize = 1000; - outfile.deleteOnExit(); - final String[] args = new String[] { - "INPUT=" + input.getAbsolutePath(), - "OUTPUT=" + outfile.getAbsolutePath(), - "REFERENCE_SEQUENCE=" + ref.getAbsolutePath(), - "INTERVALS=" + intervals.getAbsolutePath(), - "SAMPLE_SIZE=" + sampleSize - }; - Assert.assertEquals(runPicardCommandLine(args), 0); - - final MetricsFile> output = new MetricsFile<>(); - output.read(new FileReader(outfile)); - - for (final CollectWgsMetrics.WgsMetrics metrics : output.getMetrics()) { - Assert.assertEquals(metrics.GENOME_TERRITORY, 5); - Assert.assertEquals(metrics.MEAN_COVERAGE, 2.6); - Assert.assertEquals(metrics.PCT_EXC_MAPQ, 0.0); - Assert.assertEquals(metrics.PCT_EXC_DUPE, 0.066667); - Assert.assertEquals(metrics.HET_SNP_SENSITIVITY, 0.393802, .02); - } - } - - /* - * Tests the same inputs for CollectWgsMetrics vs CollectWgsMetricsFromSampledSites in order to make sure the results are different. - */ - @Test - public void testLargeIntervals() throws IOException { - final File input = new File(TEST_DATA_DIR, "forMetrics.sam"); - final File outfile = File.createTempFile("test", ".wgs_metrics"); - final File ref = new File(TEST_DATA_DIR, "merger.fasta"); - final File intervals = new File(TEST_DATA_DIR, "largeIntervals.interval_list"); - final int sampleSize = 1000; - outfile.deleteOnExit(); - - final Map args = new HashMap<>(5); - args.put("INPUT", "INPUT=" + input.getAbsolutePath()); - args.put("REFERENCE_SEQUENCE", "REFERENCE_SEQUENCE=" + ref.getAbsolutePath()); - args.put("INTERVALS", "INTERVALS=" + intervals.getAbsolutePath()); - args.put("SAMPLE_SIZE", "SAMPLE_SIZE=" + sampleSize); - - args.put("OUTPUT", "OUTPUT=" + outfile.getAbsolutePath()); - Assert.assertEquals(runPicardCommandLine(args.values().toArray(new String[]{})), 0); - - final MetricsFile> output = new MetricsFile<>(); - output.read(new FileReader(outfile)); - - final File collectWgsOutfile = File.createTempFile("collectWgsMetrics.test", ".wgs_metrics"); - collectWgsOutfile.deleteOnExit(); - - /* - * Replace the output file in order to be able to run CollectWgsMetrics with a different output file but leave all - * other arguments the same. - */ - args.put("OUTPUT", "OUTPUT=" + collectWgsOutfile.getAbsolutePath()); - - CollectWgsMetrics collectWgsMetrics = new CollectWgsMetrics(); - collectWgsMetrics.instanceMain(args.values().toArray(new String[]{})); - - final MetricsFile> collectWgsMetricsOutput = new MetricsFile<>(); - collectWgsMetricsOutput.read(new FileReader(collectWgsOutfile)); - - for (final CollectWgsMetrics.WgsMetrics metrics : output.getMetrics()) { - Assert.assertEquals(metrics.GENOME_TERRITORY, 404); - for (final CollectWgsMetrics.WgsMetrics collectWgsMetricsOut : collectWgsMetricsOutput.getMetrics()) { - Assert.assertNotEquals(metrics.PCT_EXC_MAPQ, collectWgsMetricsOut.PCT_EXC_MAPQ); - Assert.assertNotEquals(metrics.PCT_EXC_DUPE, collectWgsMetricsOut.PCT_EXC_DUPE); - Assert.assertNotEquals(metrics.PCT_EXC_UNPAIRED, collectWgsMetricsOut.PCT_EXC_UNPAIRED); - } - } - } -} diff --git a/src/test/java/picard/analysis/TheoreticalSensitivityTest.java b/src/test/java/picard/analysis/TheoreticalSensitivityTest.java index 66b4aa4fd..c36974088 100644 --- a/src/test/java/picard/analysis/TheoreticalSensitivityTest.java +++ b/src/test/java/picard/analysis/TheoreticalSensitivityTest.java @@ -197,16 +197,12 @@ public void testHetSensDistributions() throws Exception { @DataProvider(name = "hetSensDataProvider") public Object[][] hetSensDataProvider() { final File wgsMetricsFile = new File(TEST_DIR, "test_Solexa-332667.wgs_metrics"); - final File hsMetricsFile = new File(TEST_DIR, "test_NexPond-359781.hsMetrics"); final File targetedMetricsFile = new File(TEST_DIR, "test_25103070136.targeted_pcr_metrics"); - final File wgsSampledMetricsFile = new File(TEST_DIR, "test_Solexa-316269_sampled.wgs_metrics"); //These magic numbers come from a separate implementation of the code in R. return new Object[][] { {0.897_342_54, wgsMetricsFile}, - {0.967_707_04, hsMetricsFile}, - {0.956_186_66, targetedMetricsFile}, - {0.995_084_32, wgsSampledMetricsFile} + {0.956_186_66, targetedMetricsFile} }; } diff --git a/testdata/picard/analysis/TheoreticalSensitivity/test_NexPond-359781.hsMetrics b/testdata/picard/analysis/TheoreticalSensitivity/test_NexPond-359781.hsMetrics deleted file mode 100644 index 1dc2d2529..000000000 --- a/testdata/picard/analysis/TheoreticalSensitivity/test_NexPond-359781.hsMetrics +++ /dev/null @@ -1,1013 +0,0 @@ -## htsjdk.samtools.metrics.StringHeader -# picard.analysis.directed.CalculateHsMetrics -## htsjdk.samtools.metrics.StringHeader -# Started on: Thu Dec 03 13:58:35 EST 2015 - -## METRICS CLASS picard.analysis.directed.HsMetrics -BAIT_SET GENOME_SIZE BAIT_TERRITORY TARGET_TERRITORY BAIT_DESIGN_EFFICIENCY TOTAL_READS PF_READS PF_UNIQUE_READS PCT_PF_READS PCT_PF_UQ_READS PF_UQ_READS_ALIGNED PCT_PF_UQ_READS_ALIGNED PF_UQ_BASES_ALIGNED ON_BAIT_BASES NEAR_BAIT_BASES OFF_BAIT_BASES ON_TARGET_BASES PCT_SELECTED_BASES PCT_OFF_BAIT ON_BAIT_VS_SELECTED MEAN_BAIT_COVERAGE MEAN_TARGET_COVERAGE PCT_USABLE_BASES_ON_BAIT PCT_USABLE_BASES_ON_TARGET FOLD_ENRICHMENT ZERO_CVG_TARGETS_PCT FOLD_80_BASE_PENALTY PCT_TARGET_BASES_2X PCT_TARGET_BASES_10X PCT_TARGET_BASES_20X PCT_TARGET_BASES_30X PCT_TARGET_BASES_40X PCT_TARGET_BASES_50X PCT_TARGET_BASES_100X HS_LIBRARY_SIZE HS_PENALTY_10X HS_PENALTY_20X HS_PENALTY_30X HS_PENALTY_40X HS_PENALTY_50X HS_PENALTY_100X AT_DROPOUT GC_DROPOUT HET_SNP_SENSITIVITY HET_SNP_Q SAMPLE LIBRARY READ_GROUP -whole_exome_illumina_coding_v1 3101976562 28665628 37693246 1.314928 174464766 174464766 103793651 1 0.594926 93835960 0.904063 7061118624 3692561508 2442094561 926462555 4278932271 0.868794 0.131206 0.601918 128.814952 115.622534 0.278488 0.322711 56.588904 0.021594 2.408803 0.972666 0.953571 0.923559 0.882375 0.831861 0.775202 0.481278 62814838 4.298481 4.710999 5.240267 5.987469 7.164313 -1 7.510191 1.918392 0.968006 15 - -## HISTOGRAM java.lang.Integer -coverage count baseq_count -0 919673 0 -1 110620 5018 -2 101178 2432605 -3 85083 50038 -4 87005 188212 -5 83331 386520 -6 88695 714864 -7 89455 1228643 -8 92059 2948220 -9 92979 5090201 -10 97157 4673584 -11 99047 3256965 -12 103143 4433519 -13 106798 3909398 -14 111385 2999384 -15 113867 2735852 -16 118549 2656600 -17 122652 3699582 -18 126326 4832306 -19 132310 5311969 -20 137384 6284419 -21 140943 8054146 -22 144532 10257202 -23 149242 12919039 -24 154010 17023983 -25 157233 21393773 -26 161570 28294058 -27 165843 52362120 -28 169009 120902803 -29 172582 261245428 -30 176174 450851980 -31 180601 574096440 -32 182797 711301560 -33 186345 661668517 -34 189570 620040737 -35 192993 482862968 -36 194724 187819618 -37 198505 0 -38 200020 0 -39 202305 0 -40 204973 0 -41 207156 0 -42 209176 0 -43 210954 0 -44 212871 0 -45 214280 0 -46 216460 0 -47 218927 0 -48 219788 0 -49 221098 0 -50 223681 0 -51 225261 0 -52 223855 0 -53 226153 0 -54 226779 0 -55 226340 0 -56 227597 0 -57 227809 0 -58 229952 0 -59 230104 0 -60 229537 0 -61 229208 0 -62 229779 0 -63 231647 0 -64 230097 0 -65 230839 0 -66 231354 0 -67 230111 0 -68 231207 0 -69 229502 0 -70 232115 0 -71 230375 0 -72 230232 0 -73 228423 0 -74 227378 0 -75 227891 0 -76 226324 0 -77 224671 0 -78 223957 0 -79 223304 0 -80 221950 0 -81 221654 0 -82 220093 0 -83 219246 0 -84 218621 0 -85 217087 0 -86 216262 0 -87 214950 0 -88 213821 0 -89 213004 0 -90 211915 0 -91 210523 0 -92 208795 0 -93 207208 0 -94 205784 0 -95 204720 0 -96 203630 0 -97 203424 0 -98 201312 0 -99 199469 0 -100 199037 0 -101 197398 0 -102 195701 0 -103 194353 0 -104 192460 0 -105 191096 0 -106 188788 0 -107 188762 0 -108 186235 0 -109 185718 0 -110 184151 0 -111 182639 0 -112 180819 0 -113 179253 0 -114 177219 0 -115 175953 0 -116 174671 0 -117 172800 0 -118 171730 0 -119 170181 0 -120 168354 0 -121 166976 0 -122 165824 0 -123 164705 0 -124 162479 0 -125 160810 0 -126 159510 0 -127 158059 0 -128 156810 0 -129 154541 0 -130 153962 0 -131 152343 0 -132 151255 0 -133 149112 0 -134 148782 0 -135 147180 0 -136 145018 0 -137 142886 0 -138 141770 0 -139 140395 0 -140 139631 0 -141 138042 0 -142 136018 0 -143 135028 0 -144 132516 0 -145 132082 0 -146 130855 0 -147 128269 0 -148 128055 0 -149 126204 0 -150 125068 0 -151 123596 0 -152 122277 0 -153 121261 0 -154 119256 0 -155 117465 0 -156 116089 0 -157 115333 0 -158 114244 0 -159 113307 0 -160 111401 0 -161 109900 0 -162 109120 0 -163 107615 0 -164 105289 0 -165 104453 0 -166 102626 0 -167 102159 0 -168 100607 0 -169 99254 0 -170 98935 0 -171 97931 0 -172 97129 0 -173 95481 0 -174 94100 0 -175 93205 0 -176 92166 0 -177 90676 0 -178 89589 0 -179 88772 0 -180 87885 0 -181 86286 0 -182 85618 0 -183 84382 0 -184 83592 0 -185 82665 0 -186 81804 0 -187 80782 0 -188 79764 0 -189 78536 0 -190 77804 0 -191 77069 0 -192 76604 0 -193 75282 0 -194 74004 0 -195 73011 0 -196 72622 0 -197 71735 0 -198 70447 0 -199 69954 0 -200 69110 0 -201 68095 0 -202 67640 0 -203 67045 0 -204 66326 0 -205 65506 0 -206 64125 0 -207 63645 0 -208 62667 0 -209 61828 0 -210 60889 0 -211 60500 0 -212 60046 0 -213 59125 0 -214 58689 0 -215 57551 0 -216 57316 0 -217 56168 0 -218 55879 0 -219 54828 0 -220 54303 0 -221 53560 0 -222 52646 0 -223 52035 0 -224 51746 0 -225 51092 0 -226 50573 0 -227 49834 0 -228 49265 0 -229 48629 0 -230 47571 0 -231 47399 0 -232 47209 0 -233 46154 0 -234 45376 0 -235 45065 0 -236 44452 0 -237 43680 0 -238 43347 0 -239 42745 0 -240 42180 0 -241 41488 0 -242 40803 0 -243 41227 0 -244 40206 0 -245 39936 0 -246 39415 0 -247 38640 0 -248 38386 0 -249 37685 0 -250 37282 0 -251 36878 0 -252 36064 0 -253 35587 0 -254 35527 0 -255 34917 0 -256 34627 0 -257 34127 0 -258 33753 0 -259 33492 0 -260 32484 0 -261 32425 0 -262 31736 0 -263 31427 0 -264 31183 0 -265 30498 0 -266 30436 0 -267 29833 0 -268 29584 0 -269 29280 0 -270 28974 0 -271 28333 0 -272 27812 0 -273 27367 0 -274 27321 0 -275 26606 0 -276 26453 0 -277 26463 0 -278 25900 0 -279 25789 0 -280 25479 0 -281 24897 0 -282 24621 0 -283 24283 0 -284 24450 0 -285 23761 0 -286 23668 0 -287 23202 0 -288 22848 0 -289 22319 0 -290 22198 0 -291 21864 0 -292 21719 0 -293 21434 0 -294 20907 0 -295 20308 0 -296 20348 0 -297 20208 0 -298 20044 0 -299 19503 0 -300 19645 0 -301 19410 0 -302 18916 0 -303 18372 0 -304 18337 0 -305 18176 0 -306 17845 0 -307 17705 0 -308 17644 0 -309 17358 0 -310 17361 0 -311 16753 0 -312 16545 0 -313 16462 0 -314 15984 0 -315 15745 0 -316 15468 0 -317 15340 0 -318 15144 0 -319 14956 0 -320 14632 0 -321 14623 0 -322 14524 0 -323 14079 0 -324 14089 0 -325 13785 0 -326 13543 0 -327 13474 0 -328 13182 0 -329 13037 0 -330 12926 0 -331 12718 0 -332 12345 0 -333 12264 0 -334 12138 0 -335 12011 0 -336 11676 0 -337 11586 0 -338 11524 0 -339 11175 0 -340 11113 0 -341 11193 0 -342 10938 0 -343 10749 0 -344 10528 0 -345 10535 0 -346 10512 0 -347 10130 0 -348 9842 0 -349 9938 0 -350 9685 0 -351 9575 0 -352 9506 0 -353 9148 0 -354 9374 0 -355 9055 0 -356 9047 0 -357 8794 0 -358 8735 0 -359 8515 0 -360 8344 0 -361 8039 0 -362 7988 0 -363 7823 0 -364 7715 0 -365 7486 0 -366 7518 0 -367 7436 0 -368 7250 0 -369 7341 0 -370 6971 0 -371 6994 0 -372 6901 0 -373 6714 0 -374 6502 0 -375 6592 0 -376 6526 0 -377 6321 0 -378 6233 0 -379 6111 0 -380 5953 0 -381 5912 0 -382 5798 0 -383 5778 0 -384 5663 0 -385 5586 0 -386 5522 0 -387 5370 0 -388 5219 0 -389 5425 0 -390 5250 0 -391 5192 0 -392 4989 0 -393 4944 0 -394 4852 0 -395 4617 0 -396 4739 0 -397 4492 0 -398 4518 0 -399 4518 0 -400 4319 0 -401 4184 0 -402 4030 0 -403 4145 0 -404 4080 0 -405 3973 0 -406 3879 0 -407 3842 0 -408 3748 0 -409 3718 0 -410 3661 0 -411 3609 0 -412 3454 0 -413 3450 0 -414 3457 0 -415 3319 0 -416 3379 0 -417 3320 0 -418 3277 0 -419 3212 0 -420 3185 0 -421 3154 0 -422 3012 0 -423 2981 0 -424 2934 0 -425 2924 0 -426 2796 0 -427 2713 0 -428 2731 0 -429 2554 0 -430 2589 0 -431 2565 0 -432 2531 0 -433 2402 0 -434 2349 0 -435 2433 0 -436 2373 0 -437 2276 0 -438 2316 0 -439 2226 0 -440 2153 0 -441 2212 0 -442 2226 0 -443 2067 0 -444 2053 0 -445 2065 0 -446 2011 0 -447 1918 0 -448 1908 0 -449 1831 0 -450 1805 0 -451 1723 0 -452 1783 0 -453 1766 0 -454 1696 0 -455 1648 0 -456 1624 0 -457 1572 0 -458 1604 0 -459 1540 0 -460 1588 0 -461 1526 0 -462 1520 0 -463 1449 0 -464 1457 0 -465 1476 0 -466 1417 0 -467 1341 0 -468 1250 0 -469 1288 0 -470 1211 0 -471 1212 0 -472 1244 0 -473 1233 0 -474 1190 0 -475 1149 0 -476 1043 0 -477 1097 0 -478 1082 0 -479 1069 0 -480 1046 0 -481 958 0 -482 958 0 -483 956 0 -484 899 0 -485 955 0 -486 876 0 -487 889 0 -488 878 0 -489 894 0 -490 800 0 -491 872 0 -492 816 0 -493 792 0 -494 754 0 -495 722 0 -496 712 0 -497 720 0 -498 725 0 -499 717 0 -500 680 0 -501 701 0 -502 689 0 -503 649 0 -504 636 0 -505 643 0 -506 605 0 -507 572 0 -508 635 0 -509 623 0 -510 646 0 -511 561 0 -512 541 0 -513 538 0 -514 578 0 -515 561 0 -516 511 0 -517 545 0 -518 548 0 -519 506 0 -520 482 0 -521 438 0 -522 414 0 -523 470 0 -524 455 0 -525 441 0 -526 446 0 -527 397 0 -528 434 0 -529 437 0 -530 410 0 -531 418 0 -532 414 0 -533 394 0 -534 415 0 -535 405 0 -536 353 0 -537 355 0 -538 347 0 -539 347 0 -540 305 0 -541 346 0 -542 302 0 -543 317 0 -544 316 0 -545 288 0 -546 305 0 -547 306 0 -548 315 0 -549 301 0 -550 263 0 -551 268 0 -552 261 0 -553 211 0 -554 222 0 -555 243 0 -556 229 0 -557 226 0 -558 256 0 -559 216 0 -560 226 0 -561 211 0 -562 204 0 -563 202 0 -564 219 0 -565 172 0 -566 209 0 -567 161 0 -568 211 0 -569 180 0 -570 184 0 -571 167 0 -572 181 0 -573 172 0 -574 161 0 -575 167 0 -576 167 0 -577 169 0 -578 165 0 -579 136 0 -580 156 0 -581 144 0 -582 178 0 -583 149 0 -584 132 0 -585 132 0 -586 146 0 -587 154 0 -588 136 0 -589 141 0 -590 135 0 -591 138 0 -592 124 0 -593 142 0 -594 127 0 -595 130 0 -596 119 0 -597 128 0 -598 118 0 -599 105 0 -600 126 0 -601 89 0 -602 107 0 -603 110 0 -604 106 0 -605 119 0 -606 117 0 -607 100 0 -608 91 0 -609 95 0 -610 84 0 -611 94 0 -612 103 0 -613 102 0 -614 100 0 -615 85 0 -616 89 0 -617 96 0 -618 105 0 -619 97 0 -620 90 0 -621 106 0 -622 92 0 -623 74 0 -624 91 0 -625 82 0 -626 73 0 -627 104 0 -628 95 0 -629 84 0 -630 69 0 -631 80 0 -632 86 0 -633 81 0 -634 76 0 -635 83 0 -636 76 0 -637 100 0 -638 69 0 -639 76 0 -640 79 0 -641 80 0 -642 86 0 -643 80 0 -644 69 0 -645 86 0 -646 73 0 -647 84 0 -648 89 0 -649 84 0 -650 71 0 -651 64 0 -652 68 0 -653 69 0 -654 65 0 -655 73 0 -656 52 0 -657 82 0 -658 63 0 -659 59 0 -660 50 0 -661 63 0 -662 58 0 -663 69 0 -664 58 0 -665 73 0 -666 50 0 -667 41 0 -668 41 0 -669 41 0 -670 73 0 -671 59 0 -672 62 0 -673 45 0 -674 45 0 -675 47 0 -676 52 0 -677 44 0 -678 43 0 -679 45 0 -680 49 0 -681 45 0 -682 43 0 -683 62 0 -684 45 0 -685 42 0 -686 43 0 -687 43 0 -688 29 0 -689 31 0 -690 52 0 -691 43 0 -692 36 0 -693 47 0 -694 45 0 -695 44 0 -696 49 0 -697 43 0 -698 46 0 -699 46 0 -700 40 0 -701 53 0 -702 47 0 -703 53 0 -704 49 0 -705 41 0 -706 31 0 -707 43 0 -708 39 0 -709 40 0 -710 36 0 -711 38 0 -712 25 0 -713 41 0 -714 48 0 -715 32 0 -716 35 0 -717 34 0 -718 43 0 -719 37 0 -720 45 0 -721 23 0 -722 33 0 -723 54 0 -724 48 0 -725 44 0 -726 37 0 -727 38 0 -728 42 0 -729 36 0 -730 32 0 -731 35 0 -732 38 0 -733 35 0 -734 35 0 -735 28 0 -736 29 0 -737 34 0 -738 41 0 -739 35 0 -740 24 0 -741 31 0 -742 30 0 -743 21 0 -744 23 0 -745 26 0 -746 28 0 -747 23 0 -748 28 0 -749 21 0 -750 28 0 -751 22 0 -752 34 0 -753 23 0 -754 14 0 -755 26 0 -756 34 0 -757 25 0 -758 31 0 -759 25 0 -760 19 0 -761 26 0 -762 23 0 -763 17 0 -764 25 0 -765 28 0 -766 21 0 -767 15 0 -768 21 0 -769 24 0 -770 25 0 -771 24 0 -772 18 0 -773 21 0 -774 20 0 -775 19 0 -776 25 0 -777 16 0 -778 22 0 -779 25 0 -780 19 0 -781 23 0 -782 17 0 -783 29 0 -784 22 0 -785 23 0 -786 30 0 -787 30 0 -788 18 0 -789 27 0 -790 36 0 -791 21 0 -792 21 0 -793 35 0 -794 26 0 -795 23 0 -796 30 0 -797 24 0 -798 31 0 -799 23 0 -800 23 0 -801 27 0 -802 25 0 -803 26 0 -804 24 0 -805 20 0 -806 13 0 -807 18 0 -808 17 0 -809 16 0 -810 18 0 -811 22 0 -812 18 0 -813 25 0 -814 28 0 -815 10 0 -816 23 0 -817 25 0 -818 13 0 -819 19 0 -820 18 0 -821 16 0 -822 13 0 -823 19 0 -824 17 0 -825 13 0 -826 27 0 -827 23 0 -828 25 0 -829 19 0 -830 20 0 -831 20 0 -832 21 0 -833 19 0 -834 15 0 -835 14 0 -836 16 0 -837 17 0 -838 20 0 -839 9 0 -840 21 0 -841 12 0 -842 20 0 -843 12 0 -844 21 0 -845 12 0 -846 20 0 -847 18 0 -848 16 0 -849 19 0 -850 22 0 -851 14 0 -852 27 0 -853 20 0 -854 19 0 -855 22 0 -856 11 0 -857 7 0 -858 18 0 -859 13 0 -860 24 0 -861 11 0 -862 14 0 -863 13 0 -864 18 0 -865 18 0 -866 22 0 -867 25 0 -868 10 0 -869 14 0 -870 13 0 -871 17 0 -872 19 0 -873 15 0 -874 19 0 -875 16 0 -876 13 0 -877 18 0 -878 16 0 -879 15 0 -880 11 0 -881 12 0 -882 13 0 -883 17 0 -884 13 0 -885 13 0 -886 14 0 -887 16 0 -888 10 0 -889 13 0 -890 12 0 -891 12 0 -892 18 0 -893 14 0 -894 10 0 -895 13 0 -896 13 0 -897 12 0 -898 14 0 -899 9 0 -900 17 0 -901 7 0 -902 13 0 -903 6 0 -904 10 0 -905 8 0 -906 13 0 -907 20 0 -908 16 0 -909 10 0 -910 16 0 -911 16 0 -912 11 0 -913 12 0 -914 15 0 -915 14 0 -916 10 0 -917 16 0 -918 13 0 -919 13 0 -920 11 0 -921 7 0 -922 11 0 -923 8 0 -924 12 0 -925 18 0 -926 13 0 -927 9 0 -928 5 0 -929 11 0 -930 13 0 -931 13 0 -932 9 0 -933 14 0 -934 13 0 -935 10 0 -936 8 0 -937 13 0 -938 13 0 -939 6 0 -940 11 0 -941 8 0 -942 11 0 -943 13 0 -944 11 0 -945 14 0 -946 13 0 -947 15 0 -948 6 0 -949 17 0 -950 8 0 -951 10 0 -952 12 0 -953 11 0 -954 11 0 -955 13 0 -956 11 0 -957 14 0 -958 13 0 -959 11 0 -960 8 0 -961 9 0 -962 6 0 -963 17 0 -964 11 0 -965 10 0 -966 15 0 -967 14 0 -968 12 0 -969 10 0 -970 15 0 -971 5 0 -972 11 0 -973 17 0 -974 11 0 -975 10 0 -976 11 0 -977 6 0 -978 7 0 -979 8 0 -980 8 0 -981 9 0 -982 11 0 -983 9 0 -984 9 0 -985 15 0 -986 11 0 -987 12 0 -988 13 0 -989 5 0 -990 22 0 -991 13 0 -992 11 0 -993 7 0 -994 8 0 -995 6 0 -996 10 0 -997 4 0 -998 6 0 -999 12 0 -1000 3769 0 - diff --git a/testdata/picard/analysis/TheoreticalSensitivity/test_Solexa-316269_sampled.wgs_metrics b/testdata/picard/analysis/TheoreticalSensitivity/test_Solexa-316269_sampled.wgs_metrics deleted file mode 100644 index 28932dafe..000000000 --- a/testdata/picard/analysis/TheoreticalSensitivity/test_Solexa-316269_sampled.wgs_metrics +++ /dev/null @@ -1,263 +0,0 @@ -## htsjdk.samtools.metrics.StringHeader -# picard.analysis.CollectWgsMetricsFromSampledSites -## htsjdk.samtools.metrics.StringHeader -# Started on: Fri Dec 04 16:40:10 EST 2015 - -## METRICS CLASS picard.analysis.CollectWgsMetricsFromSampledSites$SampledWgsMetrics -GENOME_TERRITORY MEAN_COVERAGE SD_COVERAGE MEDIAN_COVERAGE MAD_COVERAGE PCT_EXC_MAPQ PCT_EXC_DUPE PCT_EXC_UNPAIRED PCT_EXC_BASEQ PCT_EXC_OVERLAP PCT_EXC_CAPPED PCT_EXC_TOTAL PCT_5X PCT_10X PCT_15X PCT_20X PCT_25X PCT_30X PCT_40X PCT_50X PCT_60X PCT_70X PCT_80X PCT_90X PCT_100X HET_SNP_SENSITIVITY HET_SNP_Q -12537 89.411023 15.888243 90 9 0.007874 0.0881 0.005697 0.119761 0.016499 0.000285 0.238216 0.995055 0.994097 0.993459 0.992981 0.992582 0.991705 0.988913 0.982053 0.967297 0.925261 0.79724 0.532504 0.235942 0.994971 23 - -## HISTOGRAM java.lang.Integer -coverage count baseq_count -0 52 0 -1 6 0 -2 2 0 -3 0 0 -4 2 0 -5 2 0 -6 2 0 -7 2 0 -8 4 0 -9 2 0 -10 2 0 -11 2 0 -12 1 0 -13 1 0 -14 2 0 -15 1 0 -16 3 0 -17 0 0 -18 2 0 -19 0 0 -20 1 15343 -21 0 16643 -22 1 38608 -23 1 39355 -24 2 37916 -25 2 34107 -26 2 59004 -27 3 150470 -28 3 318206 -29 1 247261 -30 2 111650 -31 2 41249 -32 1 10249 -33 4 874 -34 4 11 -35 6 0 -36 6 0 -37 3 0 -38 2 0 -39 5 0 -40 6 0 -41 4 0 -42 7 0 -43 11 0 -44 9 0 -45 9 0 -46 15 0 -47 10 0 -48 8 0 -49 7 0 -50 12 0 -51 16 0 -52 17 0 -53 21 0 -54 17 0 -55 16 0 -56 16 0 -57 20 0 -58 29 0 -59 21 0 -60 26 0 -61 26 0 -62 27 0 -63 36 0 -64 49 0 -65 65 0 -66 65 0 -67 70 0 -68 75 0 -69 88 0 -70 94 0 -71 112 0 -72 99 0 -73 143 0 -74 159 0 -75 161 0 -76 164 0 -77 182 0 -78 241 0 -79 250 0 -80 235 0 -81 287 0 -82 310 0 -83 305 0 -84 340 0 -85 343 0 -86 326 0 -87 373 0 -88 408 0 -89 392 0 -90 416 0 -91 411 0 -92 403 0 -93 373 0 -94 384 0 -95 358 0 -96 398 0 -97 334 0 -98 312 0 -99 329 0 -100 288 0 -101 273 0 -102 211 0 -103 269 0 -104 212 0 -105 206 0 -106 201 0 -107 157 0 -108 150 0 -109 138 0 -110 127 0 -111 116 0 -112 97 0 -113 72 0 -114 67 0 -115 57 0 -116 66 0 -117 55 0 -118 29 0 -119 24 0 -120 24 0 -121 25 0 -122 13 0 -123 16 0 -124 10 0 -125 17 0 -126 5 0 -127 7 0 -128 6 0 -129 4 0 -130 2 0 -131 1 0 -132 2 0 -133 1 0 -134 1 0 -135 1 0 -136 0 0 -137 0 0 -138 0 0 -139 1 0 -140 0 0 -141 0 0 -142 0 0 -143 1 0 -144 1 0 -145 0 0 -146 0 0 -147 0 0 -148 0 0 -149 1 0 -150 0 0 -151 0 0 -152 0 0 -153 0 0 -154 0 0 -155 0 0 -156 0 0 -157 0 0 -158 0 0 -159 0 0 -160 0 0 -161 0 0 -162 0 0 -163 0 0 -164 0 0 -165 0 0 -166 0 0 -167 0 0 -168 0 0 -169 0 0 -170 0 0 -171 0 0 -172 1 0 -173 0 0 -174 0 0 -175 0 0 -176 0 0 -177 0 0 -178 0 0 -179 0 0 -180 0 0 -181 0 0 -182 0 0 -183 0 0 -184 0 0 -185 0 0 -186 0 0 -187 0 0 -188 0 0 -189 0 0 -190 0 0 -191 0 0 -192 0 0 -193 0 0 -194 0 0 -195 0 0 -196 0 0 -197 0 0 -198 0 0 -199 0 0 -200 0 0 -201 0 0 -202 0 0 -203 0 0 -204 0 0 -205 0 0 -206 0 0 -207 0 0 -208 1 0 -209 0 0 -210 0 0 -211 0 0 -212 0 0 -213 0 0 -214 0 0 -215 0 0 -216 0 0 -217 0 0 -218 0 0 -219 0 0 -220 0 0 -221 0 0 -222 0 0 -223 0 0 -224 0 0 -225 0 0 -226 0 0 -227 0 0 -228 0 0 -229 0 0 -230 0 0 -231 0 0 -232 0 0 -233 0 0 -234 0 0 -235 0 0 -236 0 0 -237 0 0 -238 0 0 -239 0 0 -240 0 0 -241 0 0 -242 0 0 -243 0 0 -244 0 0 -245 0 0 -246 0 0 -247 0 0 -248 0 0 -249 0 0 -250 2 0 -