Program: 50248
Project: 50248
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);
  inputFilenames=jsapResult.getStringArray("String_Node_Str");
  String outputFile=jsapResult.getString("String_Node_Str");
  outputInfo=new OutputInfo(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");
  diploid=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 SOMATIC_VARIATIONS:
formatter=new SomaticVariationOutputFormat();
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(minimumVariationSupport));
if (callIndels) {
genotypeFilters.add(new RemoveIndelArtifactsFilter());
}
if (!disableAtLeastQuarterFilter && callIndels) {
System.out.println("String_Node_Str");
genotypeFilters.add(new AtLeastAQuarterFilter());
}
if (diploid) {
genotypeFilters.add(new DiploidFilter());
}
break;
case GENOTYPES:
genotypeFilters.add(new QualityScoreFilter());
genotypeFilters.add(new LeftOverFilter(minimumVariationSupport));
if (callIndels) {
genotypeFilters.add(new RemoveIndelArtifactsFilter());
genotypeFilters.add(new CommonIndelArtifactFilter());
}
if (!disableAtLeastQuarterFilter) {
genotypeFilters.add(new AtLeastAQuarterFilter());
}
if (diploid) {
genotypeFilters.add(new DiploidFilter());
}
break;
case SOMATIC_VARIATIONS:
genotypeFilters.add(new QualityScoreFilter());
if (callIndels) {
genotypeFilters.add(new EntropicIndelArtifactFilter());
genotypeFilters.add(new RemoveIndelArtifactsFilter());
genotypeFilters.add(new CommonIndelArtifactFilter());
}
break;
case INDEL_COUNTS:
genotypeFilters.add(new QualityScoreFilter());
genotypeFilters.add(new LeftOverFilter(minimumVariationSupport));
genotypeFilters.add(new RemoveIndelArtifactsFilter());
if (!disableAtLeastQuarterFilter) {
genotypeFilters.add(new AtLeastAQuarterFilter());
}
if (diploid) {
genotypeFilters.add(new DiploidFilter());
}
break;
default :
throw new InternalError("String_Node_Str");
}
System.out.println("String_Node_Str");
for (final GenotypeFilter filter : genotypeFilters) {
System.out.println(filter.describe());
int numSamples=sampleToGroupMap.keySet().size();
filter.initStorage(numSamples);
}
String covInfoFilename=jsapResult.getString("String_Node_Str");
if (covInfoFilename != null) {
covInfo=CovariateInfo.parse(covInfoFilename);
}
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);
  inputFilenames=jsapResult.getStringArray("String_Node_Str");
  String outputFile=jsapResult.getString("String_Node_Str");
  outputInfo=new OutputInfo(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");
  diploid=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 SOMATIC_VARIATIONS:
formatter=new SomaticVariationOutputFormat();
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(minimumVariationSupport));
if (callIndels) {
genotypeFilters.add(new RemoveIndelArtifactsFilter());
}
if (!disableAtLeastQuarterFilter && callIndels) {
System.out.println("String_Node_Str");
genotypeFilters.add(new AtLeastAQuarterFilter());
}
if (diploid) {
genotypeFilters.add(new DiploidFilter());
}
break;
case GENOTYPES:
genotypeFilters.add(new QualityScoreFilter());
genotypeFilters.add(new LeftOverFilter(minimumVariationSupport));
if (callIndels) {
genotypeFilters.add(new RemoveIndelArtifactsFilter());
genotypeFilters.add(new CommonIndelArtifactFilter());
}
if (!disableAtLeastQuarterFilter) {
genotypeFilters.add(new AtLeastAQuarterFilter());
}
if (diploid) {
genotypeFilters.add(new DiploidFilter());
}
break;
case SOMATIC_VARIATIONS:
genotypeFilters.add(new QualityScoreFilter());
if (callIndels) {
genotypeFilters.add(new EntropicIndelArtifactFilter());
genotypeFilters.add(new RemoveIndelArtifactsFilter());
genotypeFilters.add(new CommonIndelArtifactFilter());
}
break;
case INDEL_COUNTS:
genotypeFilters.add(new QualityScoreFilter());
genotypeFilters.add(new LeftOverFilter(minimumVariationSupport));
genotypeFilters.add(new RemoveIndelArtifactsFilter());
if (!disableAtLeastQuarterFilter) {
genotypeFilters.add(new AtLeastAQuarterFilter());
}
if (diploid) {
genotypeFilters.add(new DiploidFilter());
}
break;
default :
throw new InternalError("String_Node_Str");
}
System.out.println("String_Node_Str");
for (final GenotypeFilter filter : genotypeFilters) {
System.out.println(filter.describe());
}
String covInfoFilename=jsapResult.getString("String_Node_Str");
if (covInfoFilename != null) {
covInfo=CovariateInfo.parse(covInfoFilename);
}
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;
}