diff --git a/src/main/java/CommandLineInterface.java b/src/main/java/CommandLineInterface.java index 230e57b..ee56302 100644 --- a/src/main/java/CommandLineInterface.java +++ b/src/main/java/CommandLineInterface.java @@ -146,7 +146,17 @@ public class CommandLineInterface { CellSample cells = getCells(cellFilename); //get plate Plate plate = getPlate(plateFilename); - GraphWithMapData graph = Simulator.makeGraph(cells, plate, 1, 0.0, 0.0, false); + GraphWithMapData graph; + if(line.hasOption("rd")){ + String[] readDepthArgs = line.getOptionValues("rd"); + Integer readDepth = Integer.parseInt(readDepthArgs[0]); + Double readErrorRate = Double.parseDouble(readDepthArgs[1]); + Double errorCollisionRate = Double.parseDouble(readDepthArgs[2]); + graph = Simulator.makeGraph(cells, plate, readDepth, readErrorRate, errorCollisionRate, false); + } + else{ + graph = Simulator.makeGraph(cells, plate, 1, 0.0, 0.0, false); + } if (!line.hasOption("no-binary")) { //output binary file unless told not to GraphDataObjectWriter writer = new GraphDataObjectWriter(outputFilename, graph, false); writer.writeDataToFile(); @@ -388,11 +398,18 @@ public class CommandLineInterface { .longOpt("no-binary") .desc("(Optional) Don't output serialized binary file") .build(); + Option simulateReadDepth = Option.builder("rd") + .longOpt("read-depth") + .desc("(Optional) Simulate read depth and read errors. Has three arguments: the read depth (integer >= 1), the read error probability (0.0 - 1.0), and the error collision probability (0.0 - 1.0)") + .hasArgs() + .numberOfArgs(3) + .build(); graphOptions.addOption(cellFilename); graphOptions.addOption(plateFilename); graphOptions.addOption(outputFileOption()); graphOptions.addOption(outputGraphML); graphOptions.addOption(outputSerializedBinary); + graphOptions.addOption(simulateReadDepth); return graphOptions; }