From 687125bdad51a5bade428c095f2942df1a81a6bc Mon Sep 17 00:00:00 2001 From: Christopher Kachulis Date: Thu, 27 Oct 2022 16:50:51 -0400 Subject: [PATCH 1/3] METRICS_NOT_REQUIRED --- .../java/picard/analysis/CompareMetrics.java | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/src/main/java/picard/analysis/CompareMetrics.java b/src/main/java/picard/analysis/CompareMetrics.java index bfc4713d96..c7feb55c92 100644 --- a/src/main/java/picard/analysis/CompareMetrics.java +++ b/src/main/java/picard/analysis/CompareMetrics.java @@ -28,6 +28,7 @@ import htsjdk.samtools.metrics.MetricsFile; import htsjdk.samtools.util.IOUtil; import htsjdk.samtools.util.Log; +import htsjdk.samtools.util.StringUtil; import org.broadinstitute.barclay.argparser.Argument; import org.broadinstitute.barclay.argparser.CommandLineProgramProperties; import org.broadinstitute.barclay.help.DocumentedFeature; @@ -88,10 +89,19 @@ public class CompareMetrics extends CommandLineProgram { public File OUTPUT; @Argument(shortName = "MI", - doc = "Metrics to ignore. Any metrics specified here will be excluded from comparison by the tool.", + doc = "Metrics to ignore. Any metrics specified here will be excluded from comparison by the tool. " + + "Note that while the values of these metrics are not compared, if they are missing from either file that will be considered a difference. " + + "Use METRICS_NOT_REQUIRED to specify metrics which can be missing from either file without being considered a difference.", optional = true) public List METRICS_TO_IGNORE; + @Argument(shortName = "MNR", + doc = "Metrics which are not required. Any metrics specified here may be missing from either of the files in the comparison, and this will not affect " + + "the result of the comparison. If metrics specified here are included in both files, their results will not be compared (they will be treated as " + + "METRICS_TO_IGNORE.", + optional = true) + public List METRICS_NOT_REQUIRED; + @Argument(shortName = "MARC", doc = "Metric Allowable Relative Change. A colon separate pair of metric name and an absolute relative change. For any metric specified here, " + " when the values are compared between the two files, the program will allow that much relative change between the " + @@ -131,7 +141,7 @@ protected int doWork() { } return retVal; } catch (final Exception e) { - throw new PicardException(e.getMessage()); + throw new PicardException(e.getMessage(), e); } } @@ -203,11 +213,23 @@ else if (!mf2.getMetrics().isEmpty()) { differences.add("Number of metric rows differ between " + metricFile1.getAbsolutePath() + " and " + metricFile2.getAbsolutePath()); return 1; } - else if (!mf1.getMetrics().get(0).getClass().equals(mf2.getMetrics().get(0).getClass())) { + if (!mf1.getMetrics().get(0).getClass().equals(mf2.getMetrics().get(0).getClass())) { throw new PicardException("Metrics are of differing class between " + metricFile1.getAbsolutePath() + " and " + metricFile2.getAbsolutePath()); } - else if (!mf1.getMetricsColumnLabels().equals(mf2.getMetricsColumnLabels())) { - differences.add("Metric columns differ between " + metricFile1.getAbsolutePath() + " and " + metricFile2.getAbsolutePath()); + + final Set columns1 = new HashSet<>(mf1.getMetricsColumnLabels()); + final Set columns2 = new HashSet<>(mf2.getMetricsColumnLabels()); + columns1.removeAll(METRICS_NOT_REQUIRED); + columns2.removeAll(METRICS_NOT_REQUIRED); + if (!columns1.equals(columns2)) { + final Set missingColumns = new HashSet<>(columns1); + missingColumns.removeAll(columns2); + final Set inColumns2NotColumns1 = new HashSet<>(columns2); + inColumns2NotColumns1.removeAll(columns1); + missingColumns.addAll(inColumns2NotColumns1); + differences.add("Metric columns differ between " + metricFile1.getAbsolutePath() + " and " + metricFile2.getAbsolutePath() + " (" + + StringUtil.join(",", missingColumns) + ")"); + return 1; } @@ -215,6 +237,7 @@ else if (!mf1.getMetricsColumnLabels().equals(mf2.getMetricsColumnLabels())) { validateMetricNames(mf1, metricFile1, MetricToAllowableRelativeChange.keySet()); Set metricsToIgnore = new HashSet<>(METRICS_TO_IGNORE); + metricsToIgnore.addAll(METRICS_NOT_REQUIRED); final Class metricClass = mf1.getMetrics().get(0).getClass(); From 853c8b1391ca0ed8941006c148743e6548cf59f7 Mon Sep 17 00:00:00 2001 From: Christopher Kachulis Date: Fri, 28 Oct 2022 16:10:41 -0400 Subject: [PATCH 2/3] test, output table, keys --- .../java/picard/analysis/CompareMetrics.java | 121 ++++++-- .../picard/analysis/CompareMetricsTest.java | 48 ++-- ...test1.2rows.fingerprinting_summary_metrics | 9 + .../wgs_test1.missing_metric.wgs_metrics | 263 ++++++++++++++++++ ...test2.2rows.fingerprinting_summary_metrics | 9 + 5 files changed, 413 insertions(+), 37 deletions(-) create mode 100644 testdata/picard/analysis/metrics/wgs_test1.2rows.fingerprinting_summary_metrics create mode 100644 testdata/picard/analysis/metrics/wgs_test1.missing_metric.wgs_metrics create mode 100644 testdata/picard/analysis/metrics/wgs_test2.2rows.fingerprinting_summary_metrics diff --git a/src/main/java/picard/analysis/CompareMetrics.java b/src/main/java/picard/analysis/CompareMetrics.java index c7feb55c92..63f9d25117 100644 --- a/src/main/java/picard/analysis/CompareMetrics.java +++ b/src/main/java/picard/analysis/CompareMetrics.java @@ -48,6 +48,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -88,6 +89,9 @@ public class CompareMetrics extends CommandLineProgram { doc = "Output file to write comparison results to.", optional = true) public File OUTPUT; + @Argument + public File OUTPUT_TABLE; + @Argument(shortName = "MI", doc = "Metrics to ignore. Any metrics specified here will be excluded from comparison by the tool. " + "Note that while the values of these metrics are not compared, if they are missing from either file that will be considered a difference. " + @@ -114,7 +118,14 @@ public class CompareMetrics extends CommandLineProgram { optional = true) public boolean IGNORE_HISTOGRAM_DIFFERENCES = false; + @Argument( + doc = "Columns to use as keys for matching metrics rows that should agree. If not specified, it is assumed that rows should be in the same order.", + optional = true + ) + public List KEY; + private final List differences = new ArrayList<>(); + private final List valueDifferences = new ArrayList<>(); private String metricClassName = "Unknown"; @@ -139,6 +150,11 @@ protected int doWork() { + INPUT.get(0).getAbsolutePath() + " and " + INPUT.get(1).getAbsolutePath() + "\n\nMetrics are " + status; writeTextToFile(OUTPUT, header, differences); } + if (OUTPUT_TABLE != null) { + final MetricsFile metricDifferencesFile = getMetricsFile(); + metricDifferencesFile.addAllMetrics(valueDifferences); + metricDifferencesFile.write(OUTPUT_TABLE); + } return retVal; } catch (final Exception e) { throw new PicardException(e.getMessage(), e); @@ -180,7 +196,7 @@ protected String[] customCommandLineValidation() { return errs.toArray(new String[0]); } - private int compareMetricsFiles(final File metricFile1, final File metricFile2) throws IOException, IllegalAccessException { + private int compareMetricsFiles(final File metricFile1, final File metricFile2) throws IOException, IllegalAccessException, NoSuchFieldException { final MetricsFile mf1 = new MetricsFile<>(); final MetricsFile mf2 = new MetricsFile<>(); mf1.read(new FileReader(metricFile1)); @@ -241,28 +257,46 @@ else if (!mf2.getMetrics().isEmpty()) { final Class metricClass = mf1.getMetrics().get(0).getClass(); - int retVal = 0; - int rowNumber = -1; final Field[] fields = metricClass.getFields(); - Iterator mf1Iterator = mf1.getMetrics().iterator(); - Iterator mf2Iterator = mf2.getMetrics().iterator(); - while (mf1Iterator.hasNext()) { - rowNumber++; - MetricBase metric1 = (MetricBase) mf1Iterator.next(); - MetricBase metric2 = (MetricBase) mf2Iterator.next(); - for (Field field : fields) { - if (!metricsToIgnore.contains(field.getName())) { - final Object value1 = field.get(metric1); - final Object value2 = field.get(metric2); - SimpleResult result = compareMetricValues(value1, value2, field.getName()); - if (!result.equal) { + + int retVal = 0; + if (KEY.size() == 0) { + //key by row number + int rowNumber = -1; + Iterator mf1Iterator = mf1.getMetrics().iterator(); + Iterator mf2Iterator = mf2.getMetrics().iterator(); + while (mf1Iterator.hasNext()) { + rowNumber++; + MetricBase metric1 = (MetricBase) mf1Iterator.next(); + MetricBase metric2 = (MetricBase) mf2Iterator.next(); + if (compareMetricsForEntry(metric1, metric2, fields, metricsToIgnore, String.valueOf(rowNumber)) == 1) { + retVal = 1; + } + } + } else { + //build each map of metrics + final Map, ? extends MetricBase> metricMap1 = buildMetricsMap(mf1.getMetrics()); + final Map, ? extends MetricBase> metricMap2 = buildMetricsMap(mf2.getMetrics()); + + for (final Map.Entry, ? extends MetricBase> entry1 : metricMap1.entrySet()) { + final List key = entry1.getKey(); + final MetricBase metric1 = entry1.getValue(); + + final MetricBase metric2 = metricMap2.remove(key); + if (metric2 != null) { + if (compareMetricsForEntry(metric1, metric2, fields, metricsToIgnore, StringUtil.join(",", key)) == 1) { retVal = 1; - final String diffString = "Row: " + rowNumber + " Metric: " + field.getName() + - " values differ. Value1: " + value1 + " Value2: " + value2 + " " + result.description; - differences.add(diffString); } + } else { + differences.add("KEY " + StringUtil.join(",", key) + " found in " + metricFile1 + " but not in " + metricFile2); + retVal = 1; } } + //check that all entries in metricMap2 have been matched + for (final Map.Entry, ? extends MetricBase> entry : metricMap2.entrySet()) { + differences.add("KEY " + StringUtil.join(",", entry.getKey()) + " found in " + metricFile2 + " but not in " + metricFile1); + retVal = 1; + } } if (!IGNORE_HISTOGRAM_DIFFERENCES) { @@ -278,6 +312,50 @@ else if (!mf2.getMetrics().isEmpty()) { return retVal; } + protected Map, MetricBase> buildMetricsMap(final List metrics) throws NoSuchFieldException, IllegalAccessException { + final HashMap, MetricBase> retMap = new LinkedHashMap<>(); + final Class clazz = metrics.get(0).getClass(); + final List keyFields = new ArrayList<>(); + for (final String key : KEY) { + final Field keyField = clazz.getField(key); + keyFields.add(keyField); + } + + for (final MetricBase metric : metrics) { + final List mapKey = new ArrayList<>(); + for (final Field keyField : keyFields) { + mapKey.add(keyField.get(metric)); + } + retMap.put(mapKey, metric); + } + + return retMap; + } + + protected int compareMetricsForEntry(final MetricBase metric1, final MetricBase metric2, final Field[] fields, final Set metricsToIgnore, final String key) throws IllegalAccessException { + int retVal = 0; + for (Field field : fields) { + if (!metricsToIgnore.contains(field.getName())) { + final Object value1 = field.get(metric1); + final Object value2 = field.get(metric2); + SimpleResult result = compareMetricValues(value1, value2, field.getName()); + if (!result.equal) { + retVal = 1; + final String diffString = "Key: " + key + " Metric: " + field.getName() + + " values differ. Value1: " + value1 + " Value2: " + value2 + " " + result.description; + differences.add(diffString); + final MetricComparisonDifferences metricDifferences = new MetricComparisonDifferences(); + metricDifferences.KEY = key; + metricDifferences.METRIC = field.getName(); + metricDifferences.VALUE1 = value1; + metricDifferences.VALUE2 = value2; + valueDifferences.add(metricDifferences); + } + } + } + return retVal; + } + protected SimpleResult compareMetricValues(final Object value1, final Object value2, final String metricName) { boolean equal = true; String description = ""; @@ -346,4 +424,11 @@ public SimpleResult(boolean equal, String description) { this.description = description; } } + + static public class MetricComparisonDifferences extends MetricBase { + public String KEY; + public String METRIC; + public Object VALUE1; + public Object VALUE2; + } } diff --git a/src/test/java/picard/analysis/CompareMetricsTest.java b/src/test/java/picard/analysis/CompareMetricsTest.java index bdd8dfdaab..aa85ea1a33 100644 --- a/src/test/java/picard/analysis/CompareMetricsTest.java +++ b/src/test/java/picard/analysis/CompareMetricsTest.java @@ -17,31 +17,35 @@ public class CompareMetricsTest { @DataProvider(name = "testCompareMetricsDataProvider") public Object[][] testCompareMetricsDataProvider() { return new Object[][]{ - { "wgs_test1.wgs_metrics", "wgs_test2.wgs_metrics", null, null, null, 1 }, - { "wgs_test1.wgs_metrics", "wgs_test2.wgs_metrics", "GENOME_TERRITORY", Collections.singletonList("SD_COVERAGE:0.00002"), true, 0 }, - { "wgs_test1.wgs_metrics", "wgs_test2.wgs_metrics", "GENOME_TERRITORY", Collections.singletonList("SD_COVERAGE:0.00002"), false, 1 }, - { "wgs_test1.wgs_metrics", "wgs_test2.wgs_metrics", "GENOME_TERRITORY", Collections.singletonList("SD_COVERAGE:0.00002"), null, 1 }, - { "wgs_test1.wgs_metrics", "wgs_test2.wgs_metrics", "GENOME_TERRITORY", Collections.singletonList("SD_COVERAGE:0.00001"), null, 1 }, - { "wgs_test1.wgs_metrics", "wgs_test2.wgs_metrics", null, asList("GENOME_TERRITORY:0.0001", "SD_COVERAGE:0.00002"), true, 0 }, - { "wgs_test1.wgs_metrics", "wgs_test2.wgs_metrics", null, asList("GENOME_TERRITORY:0.0001", "SD_COVERAGE:0.00002"), false, 1 }, - { "wgs_test1.wgs_metrics", "wgs_test2.wgs_metrics", null, asList("GENOME_TERRITORY:0.0001", "SD_COVERAGE:0.00002"), null, 1 }, - { "wgs_test1.wgs_metrics", "wgs_test2.wgs_metrics", null, asList("GENOME_TERRITORY:0.0001", "SD_COVERAGE:0.00001"), null, 1 }, - { "wgs_test1.wgs_metrics", "wgs_test1.wgs_metrics", null, null, null, 0 }, - { "wgs_test1.raw_wgs_metrics", "wgs_test2.raw_wgs_metrics", null, null, null, 1 }, - { "wgs_test1.2rows.raw_wgs_metrics", "wgs_test1.2rows.raw_wgs_metrics", null, null, null, 0 }, - { "wgs_test1.2rows.raw_wgs_metrics", "wgs_test2.2rows.raw_wgs_metrics", null, null, null, 1 }, - { "wgs_test1.raw_wgs_metrics", "wgs_test2.2rows.raw_wgs_metrics", null, null, null, 1 }, - { "wgs_test1.fingerprinting_summary_metrics", "wgs_test2.fingerprinting_summary_metrics", null, null, null, 1 }, - { "test1.arrays_variant_calling_detail_metrics", "test2.arrays_variant_calling_detail_metrics", null, null, null, 1 }, - { "test1.arrays_variant_calling_detail_metrics", "test2.arrays_variant_calling_detail_metrics", "AUTOCALL_DATE", null, null, 0 }, - { "test1.arrays_variant_calling_summary_metrics", "test2.arrays_variant_calling_summary_metrics", null, null, null, 0 }, + { "wgs_test1.wgs_metrics", "wgs_test2.wgs_metrics", null, null, null, null, null, 1 }, + { "wgs_test1.wgs_metrics", "wgs_test2.wgs_metrics", "GENOME_TERRITORY", Collections.singletonList("SD_COVERAGE:0.00002"), true, null, null, 0 }, + { "wgs_test1.wgs_metrics", "wgs_test2.wgs_metrics", "GENOME_TERRITORY", Collections.singletonList("SD_COVERAGE:0.00002"), false, null, null, 1 }, + { "wgs_test1.wgs_metrics", "wgs_test2.wgs_metrics", "GENOME_TERRITORY", Collections.singletonList("SD_COVERAGE:0.00002"), null, null, null, 1 }, + { "wgs_test1.wgs_metrics", "wgs_test2.wgs_metrics", "GENOME_TERRITORY", Collections.singletonList("SD_COVERAGE:0.00001"), null, null, null, 1 }, + { "wgs_test1.wgs_metrics", "wgs_test2.wgs_metrics", null, asList("GENOME_TERRITORY:0.0001", "SD_COVERAGE:0.00002"), true, null, null, 0 }, + { "wgs_test1.wgs_metrics", "wgs_test2.wgs_metrics", null, asList("GENOME_TERRITORY:0.0001", "SD_COVERAGE:0.00002"), false, null, null, 1 }, + { "wgs_test1.wgs_metrics", "wgs_test2.wgs_metrics", null, asList("GENOME_TERRITORY:0.0001", "SD_COVERAGE:0.00002"), null, null, null, 1 }, + { "wgs_test1.wgs_metrics", "wgs_test2.wgs_metrics", null, asList("GENOME_TERRITORY:0.0001", "SD_COVERAGE:0.00001"), null, null, null, 1 }, + { "wgs_test1.wgs_metrics", "wgs_test1.wgs_metrics", null, null, null, null, null, 0 }, + { "wgs_test1.raw_wgs_metrics", "wgs_test2.raw_wgs_metrics", null, null, null, null, null, 1 }, + { "wgs_test1.2rows.raw_wgs_metrics", "wgs_test1.2rows.raw_wgs_metrics", null, null, null, null, null, 0 }, + { "wgs_test1.2rows.raw_wgs_metrics", "wgs_test2.2rows.raw_wgs_metrics", null, null, null, null, null, 1 }, + { "wgs_test1.raw_wgs_metrics", "wgs_test2.2rows.raw_wgs_metrics", null, null, null, null, null, 1 }, + { "wgs_test1.fingerprinting_summary_metrics", "wgs_test2.fingerprinting_summary_metrics", null, null, null, null, null, 1 }, + { "test1.arrays_variant_calling_detail_metrics", "test2.arrays_variant_calling_detail_metrics", null, null, null, null, null, 1 }, + { "test1.arrays_variant_calling_detail_metrics", "test2.arrays_variant_calling_detail_metrics", "AUTOCALL_DATE", null, null, null, null, 0 }, + { "test1.arrays_variant_calling_summary_metrics", "test2.arrays_variant_calling_summary_metrics", null, null, null, null, null, 0 }, + { "wgs_test1.2rows.fingerprinting_summary_metrics", "wgs_test2.2rows.fingerprinting_summary_metrics", null, null, false, null, null, 1}, + { "wgs_test1.2rows.fingerprinting_summary_metrics", "wgs_test2.2rows.fingerprinting_summary_metrics", null, null, false, Collections.singletonList("SAMPLE"), null, 0}, + { "wgs_test1.missing_metric.wgs_metrics", "wgs_test1.wgs_metrics", null, null, false, null, null, 1}, + { "wgs_test1.missing_metric.wgs_metrics", "wgs_test1.wgs_metrics", null, null, false, null, Collections.singletonList("HET_SNP_SENSITIVITY"), 0} }; } @Test(dataProvider = "testCompareMetricsDataProvider") public void testCompareMetrics(final String file1, final String file2, final String metricsToIgnore, final List metricsToAllowableRelativeChange, - final Boolean ignoreHistogramDifferences, final int expectedReturnValue) { + final Boolean ignoreHistogramDifferences, final List keys, final List metricsNotRequired, final int expectedReturnValue) { final File input1 = new File(TEST_DATA_DIR, file1); final File input2 = new File(TEST_DATA_DIR, file2); final CompareMetrics compareMetrics = new CompareMetrics(); @@ -55,6 +59,12 @@ public void testCompareMetrics(final String file1, final String file2, if (ignoreHistogramDifferences != null) { compareMetrics.IGNORE_HISTOGRAM_DIFFERENCES = ignoreHistogramDifferences; } + if (keys != null) { + compareMetrics.KEY = keys; + } + if (metricsNotRequired != null) { + compareMetrics.METRICS_NOT_REQUIRED = metricsNotRequired; + } compareMetrics.customCommandLineValidation(); Assert.assertEquals(compareMetrics.instanceMain(new String[0]), expectedReturnValue); } diff --git a/testdata/picard/analysis/metrics/wgs_test1.2rows.fingerprinting_summary_metrics b/testdata/picard/analysis/metrics/wgs_test1.2rows.fingerprinting_summary_metrics new file mode 100644 index 0000000000..7a656b6f32 --- /dev/null +++ b/testdata/picard/analysis/metrics/wgs_test1.2rows.fingerprinting_summary_metrics @@ -0,0 +1,9 @@ +## htsjdk.samtools.metrics.StringHeader +# CheckFingerprint INPUT=/cromwell_root/broad-gotc-dev-cromwell-execution/WholeGenomeGermlineSingleSample/e36be5d3-ddbf-4ee6-a98d-2a1933826550/call-UnmappedBamToAlignedBam/UnmappedBamToAlignedBam/da7029e5-cf73-4d9b-8369-23c3aea72f19/call-GatherBamFiles/NA12878_PLUMBING.bam SUMMARY_OUTPUT=NA12878_PLUMBING.fingerprinting_summary_metrics DETAIL_OUTPUT=NA12878_PLUMBING.fingerprinting_detail_metrics GENOTYPES=/cromwell_root/broad-gotc-test-storage/germline_single_sample/wgs/plumbing/bams/NA12878_PLUMBING.hg38.reference.fingerprint.vcf.gz EXPECTED_SAMPLE_ALIAS=NA12878 PLUMBING HAPLOTYPE_MAP=/cromwell_root/broad-references-private/hg38/v0/Homo_sapiens_assembly38.haplotype_database.txt IGNORE_READ_GROUPS=true GENOTYPE_LOD_THRESHOLD=5.0 VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false GA4GH_CLIENT_SECRETS=client_secrets.json USE_JDK_DEFLATER=false USE_JDK_INFLATER=false +## htsjdk.samtools.metrics.StringHeader +# Started on: Fri Mar 20 20:48:22 UTC 2020 + +## METRICS CLASS picard.analysis.FingerprintingSummaryMetrics +READ_GROUP SAMPLE LL_EXPECTED_SAMPLE LL_RANDOM_SAMPLE LOD_EXPECTED_SAMPLE HAPLOTYPES_WITH_GENOTYPES HAPLOTYPES_CONFIDENTLY_CHECKED HAPLOTYPES_CONFIDENTLY_MATCHING HET_AS_HOM HOM_AS_HET HOM_AS_OTHER_HOM + NA12878 PLUMBING -151.58161 -152.354205 0.772594 170 0 0 0 0 0 + NA12345 PLUMBING -152.354205 -151.58161 -0.772594 170 0 0 0 0 0 \ No newline at end of file diff --git a/testdata/picard/analysis/metrics/wgs_test1.missing_metric.wgs_metrics b/testdata/picard/analysis/metrics/wgs_test1.missing_metric.wgs_metrics new file mode 100644 index 0000000000..74024e1be2 --- /dev/null +++ b/testdata/picard/analysis/metrics/wgs_test1.missing_metric.wgs_metrics @@ -0,0 +1,263 @@ +## htsjdk.samtools.metrics.StringHeader +# CollectWgsMetrics INPUT=/cromwell_root/broad-gotc-dev-cromwell-execution/WholeGenomeGermlineSingleSample/e36be5d3-ddbf-4ee6-a98d-2a1933826550/call-UnmappedBamToAlignedBam/UnmappedBamToAlignedBam/da7029e5-cf73-4d9b-8369-23c3aea72f19/call-GatherBamFiles/NA12878_PLUMBING.bam OUTPUT=NA12878_PLUMBING.wgs_metrics INCLUDE_BQ_HISTOGRAM=true INTERVALS=/cromwell_root/gcp-public-data--broad-references/hg38/v0/wgs_coverage_regions.hg38.interval_list USE_FAST_ALGORITHM=true READ_LENGTH=250 VALIDATION_STRINGENCY=SILENT REFERENCE_SEQUENCE=/cromwell_root/gcp-public-data--broad-references/hg38/v0/Homo_sapiens_assembly38.fasta MINIMUM_MAPPING_QUALITY=20 MINIMUM_BASE_QUALITY=20 COVERAGE_CAP=250 LOCUS_ACCUMULATION_CAP=100000 STOP_AFTER=-1 COUNT_UNPAIRED=false SAMPLE_SIZE=10000 ALLELE_FRACTION=[0.001, 0.005, 0.01, 0.02, 0.05, 0.1, 0.2, 0.3, 0.5] VERBOSITY=INFO QUIET=false COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false GA4GH_CLIENT_SECRETS=client_secrets.json USE_JDK_DEFLATER=false USE_JDK_INFLATER=false +## htsjdk.samtools.metrics.StringHeader +# Started on: Fri Mar 20 20:49:11 UTC 2020 + +## METRICS CLASS picard.analysis.WgsMetrics +GENOME_TERRITORY MEAN_COVERAGE SD_COVERAGE MEDIAN_COVERAGE MAD_COVERAGE PCT_EXC_ADAPTER PCT_EXC_MAPQ PCT_EXC_DUPE PCT_EXC_UNPAIRED PCT_EXC_BASEQ PCT_EXC_OVERLAP PCT_EXC_CAPPED PCT_EXC_TOTAL PCT_1X 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_Q +2745186692 0.003328 0.059988 0 0 0.000045 0.044363 0.000482 0.00674 0.121016 0.090623 0 0.263269 0.003305 0.000001 0 0 0 0 0 0 0 0 0 0 0 0 0 + +## HISTOGRAM java.lang.Integer +coverage high_quality_coverage_count unfiltered_baseq_count +0 2736113146 0 +1 9041943 0 +2 24393 0 +3 3102 730 +4 1433 940 +5 779 10184 +6 861 1526 +7 236 0 +8 149 0 +9 83 0 +10 75 45052 +11 54 0 +12 0 0 +13 0 0 +14 0 0 +15 0 0 +16 0 0 +17 1 0 +18 1 0 +19 10 0 +20 0 67107 +21 2 0 +22 0 0 +23 3 0 +24 11 0 +25 7 0 +26 16 0 +27 1 0 +28 13 0 +29 17 0 +30 23 10192669 +31 12 0 +32 22 0 +33 5 0 +34 9 0 +35 25 0 +36 14 0 +37 27 0 +38 26 0 +39 11 0 +40 23 0 +41 4 0 +42 6 0 +43 17 0 +44 14 0 +45 46 0 +46 39 0 +47 22 0 +48 9 0 +49 2 0 +50 0 0 +51 0 0 +52 0 0 +53 0 0 +54 0 0 +55 0 0 +56 0 0 +57 0 0 +58 0 0 +59 0 0 +60 0 0 +61 0 0 +62 0 0 +63 0 0 +64 0 0 +65 0 0 +66 0 0 +67 0 0 +68 0 0 +69 0 0 +70 0 0 +71 0 0 +72 0 0 +73 0 0 +74 0 0 +75 0 0 +76 0 0 +77 0 0 +78 0 0 +79 0 0 +80 0 0 +81 0 0 +82 0 0 +83 0 0 +84 0 0 +85 0 0 +86 0 0 +87 0 0 +88 0 0 +89 0 0 +90 0 0 +91 0 0 +92 0 0 +93 0 0 +94 0 0 +95 0 0 +96 0 0 +97 0 0 +98 0 0 +99 0 0 +100 0 0 +101 0 0 +102 0 0 +103 0 0 +104 0 0 +105 0 0 +106 0 0 +107 0 0 +108 0 0 +109 0 0 +110 0 0 +111 0 0 +112 0 0 +113 0 0 +114 0 0 +115 0 0 +116 0 0 +117 0 0 +118 0 0 +119 0 0 +120 0 0 +121 0 0 +122 0 0 +123 0 0 +124 0 0 +125 0 0 +126 0 0 +127 0 0 +128 0 0 +129 0 0 +130 0 0 +131 0 0 +132 0 0 +133 0 0 +134 0 0 +135 0 0 +136 0 0 +137 0 0 +138 0 0 +139 0 0 +140 0 0 +141 0 0 +142 0 0 +143 0 0 +144 0 0 +145 0 0 +146 0 0 +147 0 0 +148 0 0 +149 0 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 0 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 0 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 0 0 + diff --git a/testdata/picard/analysis/metrics/wgs_test2.2rows.fingerprinting_summary_metrics b/testdata/picard/analysis/metrics/wgs_test2.2rows.fingerprinting_summary_metrics new file mode 100644 index 0000000000..a5e354f3a7 --- /dev/null +++ b/testdata/picard/analysis/metrics/wgs_test2.2rows.fingerprinting_summary_metrics @@ -0,0 +1,9 @@ +## htsjdk.samtools.metrics.StringHeader +# CheckFingerprint INPUT=/cromwell_root/broad-gotc-dev-cromwell-execution/WholeGenomeGermlineSingleSample/e36be5d3-ddbf-4ee6-a98d-2a1933826550/call-UnmappedBamToAlignedBam/UnmappedBamToAlignedBam/da7029e5-cf73-4d9b-8369-23c3aea72f19/call-GatherBamFiles/NA12878_PLUMBING.bam SUMMARY_OUTPUT=NA12878_PLUMBING.fingerprinting_summary_metrics DETAIL_OUTPUT=NA12878_PLUMBING.fingerprinting_detail_metrics GENOTYPES=/cromwell_root/broad-gotc-test-storage/germline_single_sample/wgs/plumbing/bams/NA12878_PLUMBING.hg38.reference.fingerprint.vcf.gz EXPECTED_SAMPLE_ALIAS=NA12878 PLUMBING HAPLOTYPE_MAP=/cromwell_root/broad-references-private/hg38/v0/Homo_sapiens_assembly38.haplotype_database.txt IGNORE_READ_GROUPS=true GENOTYPE_LOD_THRESHOLD=5.0 VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false GA4GH_CLIENT_SECRETS=client_secrets.json USE_JDK_DEFLATER=false USE_JDK_INFLATER=false +## htsjdk.samtools.metrics.StringHeader +# Started on: Fri Mar 20 20:48:22 UTC 2020 + +## METRICS CLASS picard.analysis.FingerprintingSummaryMetrics +READ_GROUP SAMPLE LL_EXPECTED_SAMPLE LL_RANDOM_SAMPLE LOD_EXPECTED_SAMPLE HAPLOTYPES_WITH_GENOTYPES HAPLOTYPES_CONFIDENTLY_CHECKED HAPLOTYPES_CONFIDENTLY_MATCHING HET_AS_HOM HOM_AS_HET HOM_AS_OTHER_HOM + NA12345 PLUMBING -152.354205 -151.58161 -0.772594 170 0 0 0 0 0 + NA12878 PLUMBING -151.58161 -152.354205 0.772594 170 0 0 0 0 0 \ No newline at end of file From c7d84958105b1b424791f98e8b8b4721fe4b4571 Mon Sep 17 00:00:00 2001 From: Christopher Kachulis Date: Fri, 28 Oct 2022 16:36:56 -0400 Subject: [PATCH 3/3] doc --- src/main/java/picard/analysis/CompareMetrics.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/picard/analysis/CompareMetrics.java b/src/main/java/picard/analysis/CompareMetrics.java index 63f9d25117..fe4bb304e7 100644 --- a/src/main/java/picard/analysis/CompareMetrics.java +++ b/src/main/java/picard/analysis/CompareMetrics.java @@ -89,7 +89,10 @@ public class CompareMetrics extends CommandLineProgram { doc = "Output file to write comparison results to.", optional = true) public File OUTPUT; - @Argument + @Argument( + doc = "Output file to write table of differences to.", + optional = true + ) public File OUTPUT_TABLE; @Argument(shortName = "MI",