use of org.broadinstitute.barclay.argparser.Argument in project gatk by broadinstitute.
the class EvaluateCopyNumberTriStateCallsIntegrationTest method runCommandLine.
private void runCommandLine(final File truth, final File calls, final File targets, final File vcfOutput, final File sampleOutput, final File caseOutput, final EvaluationFiltersArgumentCollection filtersOptions) {
final List<String> arguments = new ArrayList<>();
arguments.add("-" + EvaluateCopyNumberTriStateCalls.TRUTH_FILE_SHORT_NAME);
arguments.add(truth.getAbsolutePath());
arguments.add("-" + EvaluateCopyNumberTriStateCalls.CALLS_FILE_SHORT_NAME);
arguments.add(calls.getAbsolutePath());
arguments.add("-" + TargetArgumentCollection.TARGET_FILE_SHORT_NAME);
arguments.add(targets.getAbsolutePath());
arguments.add("-includeOverall");
for (final Field field : filtersOptions.getClass().getFields()) {
final Argument annotation = field.getAnnotation(Argument.class);
if (annotation == null) {
continue;
}
final Class<?> type = field.getType();
try {
if (type.equals(Boolean.class) || type.equals(Boolean.TYPE)) {
if (field.get(filtersOptions).equals(Boolean.TRUE)) {
arguments.add("-" + annotation.shortName());
}
} else {
arguments.add("-" + annotation.shortName());
arguments.add(String.valueOf(field.get(filtersOptions)));
}
} catch (final IllegalAccessException e) {
throw new RuntimeException(e);
}
}
if (vcfOutput != null) {
arguments.add("-" + StandardArgumentDefinitions.OUTPUT_SHORT_NAME);
arguments.add(vcfOutput.getAbsolutePath());
}
if (sampleOutput != null) {
arguments.add("-" + EvaluateCopyNumberTriStateCalls.SAMPLE_SUMMARY_OUTPUT_SHORT_NAME);
arguments.add(sampleOutput.getAbsolutePath());
}
if (caseOutput != null) {
arguments.add("-" + EvaluateCopyNumberTriStateCalls.DETAIL_CALL_OUTPUT_SHORT_NAME);
arguments.add(caseOutput.getAbsolutePath());
}
runCommandLine(arguments);
}
use of org.broadinstitute.barclay.argparser.Argument in project gatk-protected by broadinstitute.
the class EvaluateCopyNumberTriStateCallsIntegrationTest method runCommandLine.
private void runCommandLine(final File truth, final File calls, final File targets, final File vcfOutput, final File sampleOutput, final File caseOutput, final EvaluationFiltersArgumentCollection filtersOptions) {
final List<String> arguments = new ArrayList<>();
arguments.add("-" + EvaluateCopyNumberTriStateCalls.TRUTH_FILE_SHORT_NAME);
arguments.add(truth.getAbsolutePath());
arguments.add("-" + EvaluateCopyNumberTriStateCalls.CALLS_FILE_SHORT_NAME);
arguments.add(calls.getAbsolutePath());
arguments.add("-" + TargetArgumentCollection.TARGET_FILE_SHORT_NAME);
arguments.add(targets.getAbsolutePath());
arguments.add("-includeOverall");
for (final Field field : filtersOptions.getClass().getFields()) {
final Argument annotation = field.getAnnotation(Argument.class);
if (annotation == null) {
continue;
}
final Class<?> type = field.getType();
try {
if (type.equals(Boolean.class) || type.equals(Boolean.TYPE)) {
if (field.get(filtersOptions).equals(Boolean.TRUE)) {
arguments.add("-" + annotation.shortName());
}
} else {
arguments.add("-" + annotation.shortName());
arguments.add(String.valueOf(field.get(filtersOptions)));
}
} catch (final IllegalAccessException e) {
throw new RuntimeException(e);
}
}
if (vcfOutput != null) {
arguments.add("-" + StandardArgumentDefinitions.OUTPUT_SHORT_NAME);
arguments.add(vcfOutput.getAbsolutePath());
}
if (sampleOutput != null) {
arguments.add("-" + EvaluateCopyNumberTriStateCalls.SAMPLE_SUMMARY_OUTPUT_SHORT_NAME);
arguments.add(sampleOutput.getAbsolutePath());
}
if (caseOutput != null) {
arguments.add("-" + EvaluateCopyNumberTriStateCalls.DETAIL_CALL_OUTPUT_SHORT_NAME);
arguments.add(caseOutput.getAbsolutePath());
}
runCommandLine(arguments);
}