@Override public String generateReadName(final ClusterData cluster, final Integer pairNumber) { return new StringBuilder().append(instrumentName).append(":") .append(runId).append(":") .append(flowcellId).append(":") .append(cluster.getLane()).append(":") .append(cluster.getTile()).append(":") .append(cluster.getX()).append(":") .append(cluster.getY()).append(" ") .append(StringUtil.asEmptyIfNull(pairNumber)).append(":") .append(IsFilteredLabel.get(cluster.isPf())).append(":") .append(CONTROL_FIELD_VALUE).append(":") .append(StringUtil.asEmptyIfNull(cluster.getMatchedBarcode())).toString(); } }
@Override public String generateReadName(final ClusterData cluster, final Integer pairNumber) { return new StringBuilder().append(instrumentName).append(":") .append(runId).append(":") .append(flowcellId).append(":") .append(cluster.getLane()).append(":") .append(cluster.getTile()).append(":") .append(cluster.getX()).append(":") .append(cluster.getY()).append(" ") .append(StringUtil.asEmptyIfNull(pairNumber)).append(":") .append(IsFilteredLabel.get(cluster.isPf())).append(":") .append(CONTROL_FIELD_VALUE).append(":") .append(StringUtil.asEmptyIfNull(cluster.getMatchedBarcode())).toString(); } }
@Override protected void setup(final SAMFileHeader header, final File samFile) { IOUtil.assertFileIsWritable(CHART_OUTPUT); // If we're working with a single library, assign that library's name // as a suffix to the plot title final List<SAMReadGroupRecord> readGroups = header.getReadGroups(); if (readGroups.size() == 1) { plotSubtitle = StringUtil.asEmptyIfNull(readGroups.get(0).getLibrary()); } }
@Override protected void setup(final SAMFileHeader header, final File samFile) { IOUtil.assertFileIsWritable(CHART_OUTPUT); // If we're working with a single library, assign that library's name // as a suffix to the plot title final List<SAMReadGroupRecord> readGroups = header.getReadGroups(); if (readGroups.size() == 1) { plotSubtitle = StringUtil.asEmptyIfNull(readGroups.get(0).getLibrary()); } }
@Override protected void setup(final SAMFileHeader header, final File samFile) { IOUtil.assertFileIsWritable(CHART_OUTPUT); final List<SAMReadGroupRecord> readGroups = header.getReadGroups(); if (readGroups.size() == 1) { plotSubtitle = StringUtil.asEmptyIfNull(readGroups.get(0).getLibrary()); } hist = new HistogramGenerator(); }
@Override protected void setup(final SAMFileHeader header, final File samFile) { IOUtil.assertFileIsWritable(CHART_OUTPUT); final List<SAMReadGroupRecord> readGroups = header.getReadGroups(); if (readGroups.size() == 1) { plotSubtitle = StringUtil.asEmptyIfNull(readGroups.get(0).getLibrary()); } hist = new HistogramGenerator(); }
@Override protected int doWork() { IOUtil.assertFileIsWritable(CHART_OUTPUT); IOUtil.assertFileIsReadable(INPUT); // Initialize the SamReader, so the header is available prior to super.doWork, for getIntervalsToExamine call. */ getSamReader(); this.collector = new WgsMetricsWithNonZeroCoverageCollector(this, COVERAGE_CAP, getIntervalsToExamine()); super.doWork(); final List<SAMReadGroupRecord> readGroups = getSamFileHeader().getReadGroups(); final String plotSubtitle = (readGroups.size() == 1) ? StringUtil.asEmptyIfNull(readGroups.get(0).getLibrary()) : ""; if (collector.areHistogramsEmpty()) { log.warn("No valid bases found in input file. No plot will be produced."); } else { final int rResult = RExecutor.executeFromClasspath("picard/analysis/wgsHistogram.R", OUTPUT.getAbsolutePath(), CHART_OUTPUT.getAbsolutePath(), INPUT.getName(), plotSubtitle); if (rResult != 0) { throw new PicardException("R script wgsHistogram.R failed with return code " + rResult); } } return 0; }
@Override protected int doWork() { IOUtil.assertFileIsWritable(CHART_OUTPUT); IOUtil.assertFileIsReadable(INPUT); // Initialize the SamReader, so the header is available prior to super.doWork, for getIntervalsToExamine call. */ getSamReader(); this.collector = new WgsMetricsWithNonZeroCoverageCollector(this, COVERAGE_CAP, getIntervalsToExamine()); super.doWork(); final List<SAMReadGroupRecord> readGroups = getSamFileHeader().getReadGroups(); final String plotSubtitle = (readGroups.size() == 1) ? StringUtil.asEmptyIfNull(readGroups.get(0).getLibrary()) : ""; if (collector.areHistogramsEmpty()) { log.warn("No valid bases found in input file. No plot will be produced."); } else { final int rResult = RExecutor.executeFromClasspath("picard/analysis/wgsHistogram.R", OUTPUT.getAbsolutePath(), CHART_OUTPUT.getAbsolutePath(), INPUT.getName(), plotSubtitle); if (rResult != 0) { throw new PicardException("R script wgsHistogram.R failed with return code " + rResult); } } return 0; }