Program: 37718
Project: 37718
Buggy source:
public static void identifyNegativeBinomialChangePointsInLongSegments(SAMFileReader sfr,File spliced_exon_gtf,File intronic_exon_gtf,GTFWriter changepointWriter,int minLength,int maxBins,int binSize,int minCP,Strandedness strandedness,double alpha_0,double beta_0,int nb_r,int r,double p,boolean internal,double min_fold,int min_terminal,int confidence_interval) throws FileNotFoundException {
  StrandedGenomicIntervalTree<Map<String,Object>> continuousSegments=new StrandedGenomicIntervalTree<Map<String,Object>>();
  StrandedGenomicIntervalTree<Map<String,Object>> exons=new StrandedGenomicIntervalTree<Map<String,Object>>();
  for (  File gtf : Util.list(spliced_exon_gtf,intronic_exon_gtf)) {
    TranscriptIterator ti=new TranscriptIterator(gtf);
    for (    AnnotatedRegion segment : ti) {
      SegmentFragmenter.add(continuousSegments,segment.chr,segment.start,segment.end,segment.strand);
      exons.add(segment.chr,segment.start,segment.end,segment.strand,segment.attributes);
    }
  }
  for (  AnnotatedRegion segment : continuousSegments) {
    if (segment.size - min_terminal >= minLength) {
      Set<String> annotations=new HashSet<String>();
      for (      AnnotatedRegion exon : exons.overlappingRegions(segment.chr,segment.start,segment.end,segment.strand)) {
        String type=(String)exon.getAttribute("String_Node_Str");
        if (type != null) {
          annotations.add(type);
        }
      }
      if (annotations.size() == 1) {
        String type=annotations.iterator().next();
        if (internal && "String_Node_Str".equals(type)) {
          identifyUnconstrainedNegativeBinomialPoints(sfr,segment.chr,segment.start,segment.end,maxBins,binSize,minCP,strandedness,segment.isNegativeStrand(),alpha_0,beta_0,nb_r,r,p,min_fold,confidence_interval,changepointWriter);
        }
 else         if ("String_Node_Str".equals(type)) {
          boolean constrained_decreasing=segment.isNegativeStrand();
          int[] i=IntervalTools.offsetInterval(segment.start,segment.end,-min_terminal,0,segment.isNegativeStrand());
          identifyConstrainedNegativeBinomialPoints(sfr,segment.chr,i[0],i[1],maxBins,binSize,minCP,strandedness,segment.isNegativeStrand(),alpha_0,beta_0,nb_r,r,p,constrained_decreasing,min_fold,confidence_interval,changepointWriter);
        }
 else         if ("String_Node_Str".equals(type)) {
          boolean constrained_decreasing=!segment.isNegativeStrand();
          int[] i=IntervalTools.offsetInterval(segment.start,segment.end,0,-min_terminal,segment.isNegativeStrand());
          identifyConstrainedNegativeBinomialPoints(sfr,segment.chr,i[0],i[1],maxBins,binSize,minCP,strandedness,segment.isNegativeStrand(),alpha_0,beta_0,nb_r,r,p,constrained_decreasing,min_fold,confidence_interval,changepointWriter);
        }
      }
    }
  }
}

Fixed version (ground truth):
public static void identifyNegativeBinomialChangePointsInLongSegments(SAMFileReader sfr,File spliced_exon_gtf,File intronic_exon_gtf,GTFWriter changepointWriter,int minLength,int maxBins,int binSize,int minCP,Strandedness strandedness,double alpha_0,double beta_0,int nb_r,int r,double p,boolean internal,double min_fold,int min_terminal) throws FileNotFoundException {
  StrandedGenomicIntervalTree<Map<String,Object>> continuousSegments=new StrandedGenomicIntervalTree<Map<String,Object>>();
  StrandedGenomicIntervalTree<Map<String,Object>> exons=new StrandedGenomicIntervalTree<Map<String,Object>>();
  for (  File gtf : Util.list(spliced_exon_gtf,intronic_exon_gtf)) {
    TranscriptIterator ti=new TranscriptIterator(gtf);
    for (    AnnotatedRegion segment : ti) {
      SegmentFragmenter.add(continuousSegments,segment.chr,segment.start,segment.end,segment.strand);
      exons.add(segment.chr,segment.start,segment.end,segment.strand,segment.attributes);
    }
  }
  for (  AnnotatedRegion segment : continuousSegments) {
    if (segment.size - min_terminal >= minLength) {
      Set<String> annotations=new HashSet<String>();
      for (      AnnotatedRegion exon : exons.overlappingRegions(segment.chr,segment.start,segment.end,segment.strand)) {
        String type=(String)exon.getAttribute("String_Node_Str");
        if (type != null) {
          annotations.add(type);
        }
      }
      if (annotations.size() == 1) {
        String type=annotations.iterator().next();
        if (internal && "String_Node_Str".equals(type)) {
          identifyUnconstrainedNegativeBinomialPoints(sfr,segment.chr,segment.start,segment.end,maxBins,binSize,minCP,strandedness,segment.isNegativeStrand(),alpha_0,beta_0,nb_r,r,p,min_fold,changepointWriter);
        }
 else         if ("String_Node_Str".equals(type)) {
          boolean constrained_decreasing=segment.isNegativeStrand();
          int[] i=IntervalTools.offsetInterval(segment.start,segment.end,-min_terminal,0,segment.isNegativeStrand());
          identifyConstrainedNegativeBinomialPoints(sfr,segment.chr,i[0],i[1],maxBins,binSize,minCP,strandedness,segment.isNegativeStrand(),alpha_0,beta_0,nb_r,r,p,constrained_decreasing,min_fold,changepointWriter);
        }
 else         if ("String_Node_Str".equals(type)) {
          boolean constrained_decreasing=!segment.isNegativeStrand();
          int[] i=IntervalTools.offsetInterval(segment.start,segment.end,0,-min_terminal,segment.isNegativeStrand());
          identifyConstrainedNegativeBinomialPoints(sfr,segment.chr,i[0],i[1],maxBins,binSize,minCP,strandedness,segment.isNegativeStrand(),alpha_0,beta_0,nb_r,r,p,constrained_decreasing,min_fold,changepointWriter);
        }
      }
    }
  }
}