Program: 50365
Project: 50365
Buggy source:
/** 
 * Configure.
 * @param args command line arguments
 * @return this object for chaining
 * @throws java.io.IOException error parsing
 * @throws com.martiansoftware.jsap.JSAPException error parsing
 */
@Override public AbstractCommandLineMode configure(final String[] args) throws IOException, JSAPException {
  final JSAPResult jsapResult=parseJsapArguments(args);
  registeredDOClients.add(QualityScoreFilter.doc);
  registeredDOClients.add(VCFAveragingWriter.doc);
  dymamicOptions=jsapResult.getStringArray("String_Node_Str");
  for (  final String dymamicOption : dymamicOptions) {
    boolean parsed=false;
    for (    final DynamicOptionClient doc : registeredDOClients) {
      if (doc.acceptsOption(dymamicOption)) {
        parsed=true;
        break;
      }
    }
    if (!parsed) {
      System.err.println("String_Node_Str" + dymamicOption);
      System.exit(1);
    }
  }
  inputFilenames=jsapResult.getStringArray("String_Node_Str");
  outputFile=jsapResult.getString("String_Node_Str");
  outWriter="String_Node_Str".equals(outputFile) ? new PrintWriter(System.out) : new PrintWriter(outputFile);
  String groupsDefinition=jsapResult.getString("String_Node_Str");
  String groupsDefinitionFile=jsapResult.getString("String_Node_Str");
  if (groupsDefinition != null && groupsDefinitionFile != null) {
    System.err.println("String_Node_Str");
    System.exit(1);
  }
  if (groupsDefinitionFile != null) {
    groupsDefinition=parseGroupFile(groupsDefinitionFile,inputFilenames);
  }
  String compare=jsapResult.getString("String_Node_Str");
  deAnalyzer.parseGroupsDefinition(groupsDefinition,deCalculator,inputFilenames);
  groupComparisonsList=deAnalyzer.parseCompare(compare);
  boolean parallel=jsapResult.getBoolean("String_Node_Str",false);
  deAnalyzer.setRunInParallel(parallel);
  Map<String,String> sampleToGroupMap=deCalculator.getSampleToGroupMap();
  readerIndexToGroupIndex=new int[inputFilenames.length];
  groups=deAnalyzer.getGroups();
  numberOfGroups=groups.length;
  IndexedIdentifier groupIds=new IndexedIdentifier();
  for (  String group : groups) {
    groupIds.registerIdentifier(new MutableString(group));
  }
  maxThresholdPerSite=jsapResult.getInt("String_Node_Str");
  minimumVariationSupport=jsapResult.getInt("String_Node_Str");
  thresholdDistinctReadIndices=jsapResult.getInt("String_Node_Str");
  CompactAlignmentToAnnotationCountsMode.parseEval(jsapResult,deAnalyzer);
  for (  String sample : sampleToGroupMap.keySet()) {
    final String group=sampleToGroupMap.get(sample);
    System.out.printf("String_Node_Str",sample,group);
    for (int readerIndex=0; readerIndex < inputFilenames.length; readerIndex++) {
      if (AlignmentReaderImpl.getBasename(inputFilenames[readerIndex]).endsWith(sample)) {
        readerIndexToGroupIndex[readerIndex]=groupIds.get(new MutableString(group));
      }
    }
  }
  File statFile=jsapResult.getFile("String_Node_Str");
  if (statFile != null) {
    loadStatFile(statFile);
  }
 else {
    if (deAnalyzer.eval("String_Node_Str")) {
      System.err.println("String_Node_Str");
      System.exit(1);
    }
  }
  callIndels=jsapResult.getBoolean("String_Node_Str");
  realignmentFactory=configureProcessor(jsapResult);
  final String formatString=jsapResult.getString("String_Node_Str");
  final OutputFormat format=OutputFormat.valueOf(formatString.toUpperCase());
  SequenceVariationOutputFormat formatter=null;
switch (format) {
case VARIANT_DISCOVERY:
case BETWEEN_GROUPS:
    stopWhenDefaultGroupOptions();
  formatter=new BetweenGroupSequenceVariationOutputFormat();
break;
case COMPARE_GROUPS:
stopWhenDefaultGroupOptions();
formatter=new CompareGroupsVCFOutputFormat();
break;
case ALLELE_FREQUENCIES:
stopWhenDefaultGroupOptions();
formatter=new AlleleFrequencyOutputFormat();
break;
case GENOTYPES:
formatter=new GenotypesOutputFormat();
break;
case METHYLATION_REGIONS:
formatter=new MethylationRegionsOutputFormat();
methylFormat((MethylationRateVCFOutputFormat)formatter);
break;
case METHYLATION:
formatter=new MethylationRateVCFOutputFormat();
methylFormat((MethylationRateVCFOutputFormat)formatter);
break;
case INDEL_COUNTS:
formatter=new IndelCountOutputFormat();
callIndels=true;
break;
default :
ObjectArrayList<OutputFormat> values=ObjectArrayList.wrap(OutputFormat.values());
System.err.printf("String_Node_Str",values.toString());
System.exit(1);
}
genotypeFilters=new ObjectArrayList<GenotypeFilter>();
switch (format) {
case METHYLATION:
case METHYLATION_REGIONS:
if (callIndels) {
genotypeFilters.add(new RemoveIndelArtifactsFilter());
}
break;
case COMPARE_GROUPS:
case ALLELE_FREQUENCIES:
case BETWEEN_GROUPS:
case VARIANT_DISCOVERY:
genotypeFilters.add(new QualityScoreFilter());
genotypeFilters.add(new LeftOverFilter());
if (callIndels) {
genotypeFilters.add(new RemoveIndelArtifactsFilter());
}
if (!disableAtLeastQuarterFilter && callIndels) {
System.out.println("String_Node_Str");
genotypeFilters.add(new AtLeastAQuarterFilter());
}
break;
case GENOTYPES:
genotypeFilters.add(new QualityScoreFilter());
genotypeFilters.add(new LeftOverFilter());
if (callIndels) {
genotypeFilters.add(new RemoveIndelArtifactsFilter());
}
if (!disableAtLeastQuarterFilter) {
genotypeFilters.add(new AtLeastAQuarterFilter());
}
break;
case INDEL_COUNTS:
genotypeFilters.add(new QualityScoreFilter());
genotypeFilters.add(new LeftOverFilter());
genotypeFilters.add(new RemoveIndelArtifactsFilter());
if (!disableAtLeastQuarterFilter) {
genotypeFilters.add(new AtLeastAQuarterFilter());
}
break;
default :
throw new InternalError("String_Node_Str");
}
System.out.println("String_Node_Str");
for (final GenotypeFilter filter : genotypeFilters) {
System.out.println(filter.describe());
}
final RandomAccessSequenceInterface genome=configureGenome(testGenome,jsapResult);
final int startFlapSize=jsapResult.getInt("String_Node_Str",100);
if (callIndels) {
System.err.println("String_Node_Str");
}
formatConfigurator.configureFormatter(formatter);
sortedPositionIterator=new DiscoverVariantIterateSortedAlignments(formatter);
sortedPositionIterator.setCallIndels(callIndels);
sortedPositionIterator.setGenome(genome);
sortedPositionIterator.setStartFlapLength(startFlapSize);
sortedPositionIterator.parseIncludeReferenceArgument(jsapResult);
sortedPositionIterator.setMinimumVariationSupport(minimumVariationSupport);
sortedPositionIterator.setThresholdDistinctReadIndices(thresholdDistinctReadIndices);
return this;
}

Fixed version (ground truth):
/** 
 * Configure.
 * @param args command line arguments
 * @return this object for chaining
 * @throws java.io.IOException error parsing
 * @throws com.martiansoftware.jsap.JSAPException error parsing
 */
@Override public AbstractCommandLineMode configure(final String[] args) throws IOException, JSAPException {
  final JSAPResult jsapResult=parseJsapArguments(args);
  registeredDOClients.add(QualityScoreFilter.doc);
  registeredDOClients.add(VCFAveragingWriter.doc);
  registeredDOClients.add(MethylationRegionsOutputFormat.doc);
  dymamicOptions=jsapResult.getStringArray("String_Node_Str");
  for (  final String dymamicOption : dymamicOptions) {
    boolean parsed=false;
    for (    final DynamicOptionClient doc : registeredDOClients) {
      if (doc.acceptsOption(dymamicOption)) {
        parsed=true;
        break;
      }
    }
    if (!parsed) {
      System.err.println("String_Node_Str" + dymamicOption);
      System.exit(1);
    }
  }
  inputFilenames=jsapResult.getStringArray("String_Node_Str");
  outputFile=jsapResult.getString("String_Node_Str");
  outWriter="String_Node_Str".equals(outputFile) ? new PrintWriter(System.out) : new PrintWriter(outputFile);
  String groupsDefinition=jsapResult.getString("String_Node_Str");
  String groupsDefinitionFile=jsapResult.getString("String_Node_Str");
  if (groupsDefinition != null && groupsDefinitionFile != null) {
    System.err.println("String_Node_Str");
    System.exit(1);
  }
  if (groupsDefinitionFile != null) {
    groupsDefinition=parseGroupFile(groupsDefinitionFile,inputFilenames);
  }
  String compare=jsapResult.getString("String_Node_Str");
  deAnalyzer.parseGroupsDefinition(groupsDefinition,deCalculator,inputFilenames);
  groupComparisonsList=deAnalyzer.parseCompare(compare);
  boolean parallel=jsapResult.getBoolean("String_Node_Str",false);
  deAnalyzer.setRunInParallel(parallel);
  Map<String,String> sampleToGroupMap=deCalculator.getSampleToGroupMap();
  readerIndexToGroupIndex=new int[inputFilenames.length];
  groups=deAnalyzer.getGroups();
  numberOfGroups=groups.length;
  IndexedIdentifier groupIds=new IndexedIdentifier();
  for (  String group : groups) {
    groupIds.registerIdentifier(new MutableString(group));
  }
  maxThresholdPerSite=jsapResult.getInt("String_Node_Str");
  minimumVariationSupport=jsapResult.getInt("String_Node_Str");
  thresholdDistinctReadIndices=jsapResult.getInt("String_Node_Str");
  CompactAlignmentToAnnotationCountsMode.parseEval(jsapResult,deAnalyzer);
  for (  String sample : sampleToGroupMap.keySet()) {
    final String group=sampleToGroupMap.get(sample);
    System.out.printf("String_Node_Str",sample,group);
    for (int readerIndex=0; readerIndex < inputFilenames.length; readerIndex++) {
      if (AlignmentReaderImpl.getBasename(inputFilenames[readerIndex]).endsWith(sample)) {
        readerIndexToGroupIndex[readerIndex]=groupIds.get(new MutableString(group));
      }
    }
  }
  File statFile=jsapResult.getFile("String_Node_Str");
  if (statFile != null) {
    loadStatFile(statFile);
  }
 else {
    if (deAnalyzer.eval("String_Node_Str")) {
      System.err.println("String_Node_Str");
      System.exit(1);
    }
  }
  callIndels=jsapResult.getBoolean("String_Node_Str");
  realignmentFactory=configureProcessor(jsapResult);
  final String formatString=jsapResult.getString("String_Node_Str");
  final OutputFormat format=OutputFormat.valueOf(formatString.toUpperCase());
  SequenceVariationOutputFormat formatter=null;
switch (format) {
case VARIANT_DISCOVERY:
case BETWEEN_GROUPS:
    stopWhenDefaultGroupOptions();
  formatter=new BetweenGroupSequenceVariationOutputFormat();
break;
case COMPARE_GROUPS:
stopWhenDefaultGroupOptions();
formatter=new CompareGroupsVCFOutputFormat();
break;
case ALLELE_FREQUENCIES:
stopWhenDefaultGroupOptions();
formatter=new AlleleFrequencyOutputFormat();
break;
case GENOTYPES:
formatter=new GenotypesOutputFormat();
break;
case METHYLATION_REGIONS:
formatter=new MethylationRegionsOutputFormat();
methylFormat((MethylationFormat)formatter);
break;
case METHYLATION:
formatter=new MethylationRateVCFOutputFormat();
methylFormat((MethylationFormat)formatter);
break;
case INDEL_COUNTS:
formatter=new IndelCountOutputFormat();
callIndels=true;
break;
default :
ObjectArrayList<OutputFormat> values=ObjectArrayList.wrap(OutputFormat.values());
System.err.printf("String_Node_Str",values.toString());
System.exit(1);
}
genotypeFilters=new ObjectArrayList<GenotypeFilter>();
switch (format) {
case METHYLATION:
case METHYLATION_REGIONS:
if (callIndels) {
genotypeFilters.add(new RemoveIndelArtifactsFilter());
}
break;
case COMPARE_GROUPS:
case ALLELE_FREQUENCIES:
case BETWEEN_GROUPS:
case VARIANT_DISCOVERY:
genotypeFilters.add(new QualityScoreFilter());
genotypeFilters.add(new LeftOverFilter());
if (callIndels) {
genotypeFilters.add(new RemoveIndelArtifactsFilter());
}
if (!disableAtLeastQuarterFilter && callIndels) {
System.out.println("String_Node_Str");
genotypeFilters.add(new AtLeastAQuarterFilter());
}
break;
case GENOTYPES:
genotypeFilters.add(new QualityScoreFilter());
genotypeFilters.add(new LeftOverFilter());
if (callIndels) {
genotypeFilters.add(new RemoveIndelArtifactsFilter());
}
if (!disableAtLeastQuarterFilter) {
genotypeFilters.add(new AtLeastAQuarterFilter());
}
break;
case INDEL_COUNTS:
genotypeFilters.add(new QualityScoreFilter());
genotypeFilters.add(new LeftOverFilter());
genotypeFilters.add(new RemoveIndelArtifactsFilter());
if (!disableAtLeastQuarterFilter) {
genotypeFilters.add(new AtLeastAQuarterFilter());
}
break;
default :
throw new InternalError("String_Node_Str");
}
System.out.println("String_Node_Str");
for (final GenotypeFilter filter : genotypeFilters) {
System.out.println(filter.describe());
}
final RandomAccessSequenceInterface genome=configureGenome(testGenome,jsapResult);
final int startFlapSize=jsapResult.getInt("String_Node_Str",100);
if (callIndels) {
System.err.println("String_Node_Str");
}
formatConfigurator.configureFormatter(formatter);
sortedPositionIterator=new DiscoverVariantIterateSortedAlignments(formatter);
sortedPositionIterator.setCallIndels(callIndels);
sortedPositionIterator.setGenome(genome);
sortedPositionIterator.setStartFlapLength(startFlapSize);
sortedPositionIterator.parseIncludeReferenceArgument(jsapResult);
sortedPositionIterator.setMinimumVariationSupport(minimumVariationSupport);
sortedPositionIterator.setThresholdDistinctReadIndices(thresholdDistinctReadIndices);
return this;
}