Skip to content

Commit

Permalink
Remove deprecated parameter 'IS_NOVASEQ' from CollectIlluminaLaneMetr…
Browse files Browse the repository at this point in the history
…ics. (#1736)

Additional minor cleanup
  • Loading branch information
gbggrant authored Nov 10, 2021
1 parent 90a5c3b commit 80e79fe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
19 changes: 7 additions & 12 deletions src/main/java/picard/illumina/CollectIlluminaLaneMetrics.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
)
@DocumentedFeature
public class CollectIlluminaLaneMetrics extends CommandLineProgram {
static final String USAGE_SUMMARY = "Collects Illumina lane metrics for the given BaseCalling analysis directory. ";
static final String USAGE_DETAILS = "This tool produces quality control metrics on cluster density for each lane of an Illumina flowcell." +
" This tool takes Illumina TileMetrics data and places them into directories containing lane- and phasing-level metrics. " +
static final String USAGE_SUMMARY = "Collects Illumina lane metrics for the given BaseCalling analysis directory.";
static final String USAGE_DETAILS = "This tool produces quality control metrics on cluster density for each lane of an Illumina flowcell. " +
"This tool takes Illumina TileMetrics data and places them into directories containing lane- and phasing-level metrics. " +
"In this context, phasing refers to the fraction of molecules that fall behind or jump ahead (prephasing) during a read cycle." +
"" +
"<h4>Usage example:</h4>" +
Expand Down Expand Up @@ -93,13 +93,9 @@ public class CollectIlluminaLaneMetrics extends CommandLineProgram {
@Argument(doc = ReadStructure.PARAMETER_DOC + "\nIf not given, will use the RunInfo.xml in the run directory.", shortName = "RS", optional = true)
public ReadStructure READ_STRUCTURE;

@Argument(shortName = "EXT", doc="Append the given file extension to all metric file names (ex. OUTPUT.illumina_lane_metrics.EXT). None if null", optional=true)
@Argument(doc="Append the given file extension to all metric file names (ex. OUTPUT.illumina_lane_metrics.EXT). None if null", shortName = "EXT", optional = true)
public String FILE_EXTENSION = null;

@Deprecated
@Argument(doc = "Boolean that determines if this run is a NovaSeq run or not. (NovaSeq tile metrics files are in cycle 25 directory). (Deprectated: no longer necessary)", optional = true)
public boolean IS_NOVASEQ = false;

@Override
protected int doWork() {
final MetricsFile<MetricBase, Comparable<?>> laneMetricsFile = this.getMetricsFile();
Expand Down Expand Up @@ -203,7 +199,7 @@ private static void writePhasingMetrics(final Map<Integer, ? extends Collection<
writeMetrics(phasingMetricsFile, outputDirectory, outputPrefix, IlluminaPhasingMetrics.getExtension() + fileExtension);
}

public static File writeLaneMetrics(final Map<Integer, ? extends Collection<Tile>> laneTiles, final File outputDirectory,
private static void writeLaneMetrics(final Map<Integer, ? extends Collection<Tile>> laneTiles, final File outputDirectory,
final String outputPrefix, final MetricsFile<MetricBase, Comparable<?>> laneMetricsFile,
final String fileExtension) {
laneTiles.forEach((key, value) -> {
Expand All @@ -213,15 +209,14 @@ public static File writeLaneMetrics(final Map<Integer, ? extends Collection<Tile
laneMetricsFile.addMetric(laneMetric);
});

return writeMetrics(laneMetricsFile, outputDirectory, outputPrefix, IlluminaLaneMetrics.getExtension() + fileExtension);
writeMetrics(laneMetricsFile, outputDirectory, outputPrefix, IlluminaLaneMetrics.getExtension() + fileExtension);
}

private static File writeMetrics(final MetricsFile<MetricBase, Comparable<?>> metricsFile, final File outputDirectory,
private static void writeMetrics(final MetricsFile<MetricBase, Comparable<?>> metricsFile, final File outputDirectory,
final String outputPrefix, final String outputExtension) {
final File outputFile = new File(outputDirectory, String.format("%s.%s", outputPrefix, outputExtension));
LOG.info(String.format("Writing %s lane metrics to %s ...", metricsFile.getMetrics().size(), outputFile));
metricsFile.write(outputFile);
return outputFile;
}

private static double calculateLaneDensityFromTiles(final Collection<Tile> tiles) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ public void testIndexedRunLane1(final boolean useBarcodesDir) throws Exception {

final IlluminaBasecallingMetrics laneMetric = metricsFile.getMetrics().get(34);
Assert.assertEquals(laneMetric.LANE, "1");
Assert.assertEquals(laneMetric.MOLECULAR_BARCODE_SEQUENCE_1, null);
Assert.assertEquals(laneMetric.MOLECULAR_BARCODE_NAME, null);
Assert.assertNull(laneMetric.MOLECULAR_BARCODE_SEQUENCE_1);
Assert.assertNull(laneMetric.MOLECULAR_BARCODE_NAME);
Assert.assertEquals(laneMetric.MEAN_CLUSTERS_PER_TILE, 60.0);
Assert.assertEquals(laneMetric.SD_CLUSTERS_PER_TILE, 0.0);
Assert.assertEquals(laneMetric.MEAN_PF_CLUSTERS_PER_TILE, 50.0);
Expand All @@ -136,8 +136,8 @@ public void testNonIndexedRunLane1() throws Exception {
final IlluminaBasecallingMetrics laneMetric = metricsFile.getMetrics().get(0);

Assert.assertEquals(laneMetric.LANE, "1");
Assert.assertEquals(laneMetric.MOLECULAR_BARCODE_SEQUENCE_1, null);
Assert.assertEquals(laneMetric.MOLECULAR_BARCODE_NAME, null);
Assert.assertNull(laneMetric.MOLECULAR_BARCODE_SEQUENCE_1);
Assert.assertNull(laneMetric.MOLECULAR_BARCODE_NAME);
Assert.assertEquals(laneMetric.MEAN_CLUSTERS_PER_TILE, 2000.0);
Assert.assertEquals(laneMetric.SD_CLUSTERS_PER_TILE, 0.0);
Assert.assertEquals(laneMetric.MEAN_PF_CLUSTERS_PER_TILE,1863.0);
Expand Down Expand Up @@ -182,7 +182,7 @@ private MetricsFile<IlluminaBasecallingMetrics, Integer> runIt(final int lane, f
final File metricsFile = File.createTempFile("cibm.", ".metrics");
metricsFile.deleteOnExit();

ArrayList<String> argsList = new ArrayList<String>();
ArrayList<String> argsList = new ArrayList<>();
argsList.add("BASECALLS_DIR=" + basecallsDir.getPath());
if (null != barcodesDir) argsList.add("BARCODES_DIR=" + barcodesDir.getPath());
argsList.add("LANE=" + lane);
Expand All @@ -196,8 +196,7 @@ private MetricsFile<IlluminaBasecallingMetrics, Integer> runIt(final int lane, f

Assert.assertEquals(new CollectIlluminaBasecallingMetrics().instanceMain(args),0);

final MetricsFile<IlluminaBasecallingMetrics,Integer> retval =
new MetricsFile<IlluminaBasecallingMetrics,Integer>();
final MetricsFile<IlluminaBasecallingMetrics,Integer> retval = new MetricsFile<>();
retval.read(new FileReader(metricsFile));
return retval;
}
Expand Down

0 comments on commit 80e79fe

Please sign in to comment.