diff --git a/src/main/java/CommandLineInterface.java b/src/main/java/CommandLineInterface.java index ea5ca23..d10fb3d 100644 --- a/src/main/java/CommandLineInterface.java +++ b/src/main/java/CommandLineInterface.java @@ -153,17 +153,24 @@ public class CommandLineInterface { else if (line.hasOption("match")) { //can add a flag for which match type in future, spit this in two line = parser.parse(matchOptions, Arrays.copyOfRange(args, 1, args.length)); String graphFilename = line.getOptionValue("g"); - String outputFilename = line.getOptionValue("o"); + + String outputFilename; + if(line.hasOption("o")) { + outputFilename = line.getOptionValue("o"); + } + else { + outputFilename = null; + } Integer minThreshold = Integer.parseInt(line.getOptionValue("min")); Integer maxThreshold = Integer.parseInt(line.getOptionValue("max")); - Integer minOverlapPct; + int minOverlapPct; if (line.hasOption("minpct")) { //see if this filter is being used minOverlapPct = Integer.parseInt(line.getOptionValue("minpct")); } else { minOverlapPct = 0; } - Integer maxOccupancyDiff; + int maxOccupancyDiff; if (line.hasOption("maxdiff")) { //see if this filter is being used maxOccupancyDiff = Integer.parseInt(line.getOptionValue("maxdiff")); } @@ -173,10 +180,17 @@ public class CommandLineInterface { GraphWithMapData graph = getGraph(graphFilename); MatchingResult result = Simulator.matchCDR3s(graph, graphFilename, minThreshold, maxThreshold, maxOccupancyDiff, minOverlapPct, false); - MatchingFileWriter writer = new MatchingFileWriter(outputFilename, result); - writer.writeResultsToFile(); + if(outputFilename != null){ + MatchingFileWriter writer = new MatchingFileWriter(outputFilename, result); + writer.writeResultsToFile(); + } //can put a bunch of ifs for outputting various things from the MatchingResult to System.out here //after I put those flags in the matchOptions + if(line.hasOption("print-metadata")) { + for (String k : result.getMetadata().keySet()) { + System.out.println(k + ": " + result.getMetadata().get(k)); + } + } } } catch (ParseException exp) { @@ -297,7 +311,7 @@ public class CommandLineInterface { .desc("Randomize well populations on sample plate. Takes two arguments: the minimum possible population and the maximum possible population.") .hasArgs() .numberOfArgs(2) - .argName("minimum maximum") + .argName("min>