Program: 37720
Project: 37720
Buggy source:
public static void main(String[] args) throws IOException, JAXBException {
  JCommander jc=new JCommander();
  jc.setProgramName("String_Node_Str");
  AssembleCommand assemble=new AssembleCommand();
  SegmentCommand segment=new SegmentCommand();
  CompareCommand compare=new CompareCommand();
  EnumerateCommand enumerate=new EnumerateCommand();
  HelpCommand help=new HelpCommand();
  jc.addCommand("String_Node_Str",assemble);
  jc.addCommand("String_Node_Str",segment);
  jc.addCommand("String_Node_Str",compare);
  jc.addCommand("String_Node_Str",enumerate);
  jc.addCommand("String_Node_Str",help);
  jc.parse(args);
  if (jc.getParsedCommand() == null || jc.getParsedCommand().equals("String_Node_Str")) {
    jc.usage();
  }
 else   if (jc.getParsedCommand().equals("String_Node_Str")) {
    File out_dir=assemble.dir;
    if (!out_dir.exists())     out_dir.mkdirs();
    File configuration_file=FileUtils.getFile(out_dir,Util.sprintf("String_Node_Str",assemble.base));
    ConfigurationIO.writeConfiguration(assemble,configuration_file);
{
      File bamFile=assemble.bam;
      File tmp_dir=FileUtils.getFile(out_dir,"String_Node_Str");
      if (!tmp_dir.exists())       tmp_dir.mkdirs();
      if (!tmp_dir.exists())       tmp_dir.mkdirs();
      File splice_junction_bed=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File splice_count_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File segment_bed=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      Strandedness strandedness=Strandedness.valueOf(assemble.strandedness);
      SAMFileReader.setDefaultValidationStringency(ValidationStringency.SILENT);
      SAMFileReader sfr=new SAMFileReader(bamFile);
      System.out.println("String_Node_Str");
      BEDWriter sj_bw=new BEDWriter(IO.bufferedPrintstream(splice_junction_bed));
      FindSpliceJunctions.tabulateSpliceJunctions(sfr,sj_bw);
      sj_bw.close();
      System.out.println("String_Node_Str");
      GTFWriter counted_sj_gtf=new GTFWriter(IO.bufferedPrintstream(splice_count_gtf));
      FindSpliceJunctions.countJunctionSupportingReads(sfr,strandedness,splice_junction_bed,counted_sj_gtf);
      counted_sj_gtf.close();
      System.out.println("String_Node_Str");
      BEDWriter seg_bw=new BEDWriter(IO.bufferedPrintstream(segment_bed));
      SlidingWindow.identifyExpressed(sfr,strandedness,1,assemble.threshold,1,seg_bw);
      seg_bw.close();
      if (assemble.insert_size_quantile != null) {
        File matepair_bed=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
        File scaffolded_bed=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
        System.out.println("String_Node_Str");
        int insert_size=ClusterExpressedSegments.estimateMateInsertSize(sfr,strandedness,segment_bed,assemble.insert_size_quantile);
        System.out.printf("String_Node_Str",assemble.insert_size_quantile,insert_size);
        System.out.println("String_Node_Str");
        BEDWriter matepair_bw=new BEDWriter(IO.bufferedPrintstream(matepair_bed));
        ClusterExpressedSegments.identifySpannableRegions(sfr,strandedness,matepair_bw,insert_size);
        matepair_bw.close();
        System.out.println("String_Node_Str");
        BEDWriter scaffolded_bw=new BEDWriter(IO.bufferedPrintstream(scaffolded_bed));
        ClusterExpressedSegments.scaffoldSpannableRegions(segment_bed,matepair_bed,scaffolded_bw);
        scaffolded_bw.close();
      }
      sfr.close();
    }
{
      File assembly_gtf=new File(Util.sprintf("String_Node_Str",assemble.dir,assemble.base));
      File unspliced=new File(Util.sprintf("String_Node_Str",assemble.dir,assemble.base));
      if (assembly_gtf.getParentFile() != null && !assembly_gtf.getParentFile().exists())       assembly_gtf.getParentFile().mkdirs();
      File bamFile=assemble.bam;
      File tmp_dir=FileUtils.getFile(out_dir,"String_Node_Str");
      if (!tmp_dir.exists())       tmp_dir.mkdirs();
      File splice_junction_bed=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File splice_count_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File segment_bed=assemble.insert_size_quantile == null ? FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str") : FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      double jnct_alpha=assemble.jnct_alpha;
      File merged_segment_bed=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File inferred_strand_segment_bed=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File spliced_exon_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File acc_jnct_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File rej_jnct_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File trimmed_exon_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File intronic_exon_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File changepoint_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File filtered_changepoint_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File changepoint_exon_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      Strandedness strandedness=Strandedness.valueOf(assemble.strandedness);
      SAMFileReader.setDefaultValidationStringency(ValidationStringency.SILENT);
      SAMFileReader sfr=new SAMFileReader(bamFile);
      System.out.println("String_Node_Str");
      BEDWriter merged_segments=new BEDWriter(IO.bufferedPrintstream(merged_segment_bed));
      File merge_regions=assemble.filled_gap_segments == null ? null : new File(assemble.filled_gap_segments);
      ClusterExpressedSegments.mergeSegments(segment_bed,merge_regions,merged_segments,assemble.merge_radius);
      merged_segments.close();
      System.out.println("String_Node_Str");
      GTFWriter passed_jnct_gw=new GTFWriter(IO.bufferedPrintstream(acc_jnct_gtf));
      GTFWriter failed_jnct_gw=new GTFWriter(IO.bufferedPrintstream(rej_jnct_gtf));
      FindSpliceJunctions.filterCountedJunctions(splice_junction_bed,splice_count_gtf,jnct_alpha,passed_jnct_gw,failed_jnct_gw);
      passed_jnct_gw.close();
      failed_jnct_gw.close();
      if (strandedness == Strandedness.unstranded) {
        System.out.println("String_Node_Str");
        BEDWriter inferred_strand_segment=new BEDWriter(IO.bufferedPrintstream(inferred_strand_segment_bed));
        ClusterExpressedSegments.inferSegmentStrand(acc_jnct_gtf,merged_segment_bed,inferred_strand_segment);
        inferred_strand_segment.close();
        merged_segment_bed=inferred_strand_segment_bed;
      }
      System.out.println("String_Node_Str");
      GTFWriter spliced_exons=new GTFWriter(IO.bufferedPrintstream(spliced_exon_gtf));
      ClusterExpressedSegments.identifySplicedExons(acc_jnct_gtf,merged_segment_bed,spliced_exons);
      spliced_exons.close();
      if (strandedness == Strandedness.unstranded) {
        System.out.println("String_Node_Str");
        GTFWriter trimmed_exons=new GTFWriter(IO.bufferedPrintstream(trimmed_exon_gtf));
        ClusterExpressedSegments.trimInferredExons(spliced_exon_gtf,trimmed_exons);
        trimmed_exons.close();
        spliced_exon_gtf=trimmed_exon_gtf;
      }
      GTFWriter intronic_exon_writer=new GTFWriter(IO.bufferedPrintstream(intronic_exon_gtf));
      if (false) {
        System.out.println("String_Node_Str");
        ClusterExpressedSegments.identifyIntronicExons(merged_segment_bed,acc_jnct_gtf,spliced_exon_gtf,sfr,strandedness,intronic_exon_writer,10,.2);
      }
      intronic_exon_writer.close();
      System.out.println("String_Node_Str");
      double alpha_0=1.0;
      double beta_0=1.0;
      int nb_r=assemble.nb_r;
      int r=assemble.segment_r;
      double p=assemble.segment_p;
      int maxBins=20000;
      int binSize=assemble.w;
      int minCP=0;
      int minLength=binSize * 2;
      GTFWriter changepoint_writer=new GTFWriter(IO.bufferedPrintstream(changepoint_gtf));
      boolean internal=assemble.internal;
      double min_fold=assemble.min_fold;
      int min_terminal=-assemble.min_terminal;
      IdentifyChangePoints.identifyNegativeBinomialChangePointsInLongSegments(sfr,spliced_exon_gtf,intronic_exon_gtf,changepoint_writer,minLength,maxBins,binSize,minCP,strandedness,alpha_0,beta_0,nb_r,r,p,internal,min_fold,min_terminal);
      changepoint_writer.close();
      System.out.println("String_Node_Str");
      int sj_radius=binSize * 1;
      GTFWriter filtered_changepoint_writer=new GTFWriter(IO.bufferedPrintstream(filtered_changepoint_gtf));
      IdentifyChangePoints.filterChangePoints(sfr,spliced_exon_gtf,intronic_exon_gtf,acc_jnct_gtf,changepoint_gtf,filtered_changepoint_writer,sj_radius);
      filtered_changepoint_writer.close();
      System.out.println("String_Node_Str");
      GTFWriter changepoint_exon_writer=new GTFWriter(IO.bufferedPrintstream(changepoint_exon_gtf));
      IdentifyChangePoints.enumerateChangepointExons(spliced_exon_gtf,intronic_exon_gtf,filtered_changepoint_gtf,changepoint_exon_writer);
      changepoint_exon_writer.close();
      System.out.println("String_Node_Str");
      GTFWriter assembly_writer=new GTFWriter(IO.bufferedPrintstream(assembly_gtf));
      ExonSpliceGraph.labelConnectedComponents(acc_jnct_gtf,spliced_exon_gtf,intronic_exon_gtf,changepoint_exon_gtf,assembly_writer);
      assembly_writer.close();
      System.out.println("String_Node_Str");
      GTFWriter remainder_writer=new GTFWriter(IO.bufferedPrintstream(unspliced));
      ClusterExpressedSegments.writeUnsplicedRemainder(merged_segment_bed,assembly_gtf,remainder_writer);
      remainder_writer.close();
      if (assemble.coverage) {
        System.out.println("String_Node_Str");
        File coverage_gtf=new File(Util.sprintf("String_Node_Str",assemble.dir,assemble.base));
        File coverage_unspliced=new File(Util.sprintf("String_Node_Str",assemble.dir,assemble.base));
        GTFWriter coverage_gw=new GTFWriter(IO.bufferedPrintstream(coverage_gtf));
        IdentifyChangePoints.calculate_spliced_coverage(sfr,assembly_gtf,strandedness,coverage_gw);
        coverage_gw.close();
        GTFWriter coverage_unspliced_gw=new GTFWriter(IO.bufferedPrintstream(coverage_unspliced));
        IdentifyChangePoints.calculate_coverage(sfr,unspliced,strandedness,coverage_unspliced_gw);
        coverage_unspliced_gw.close();
      }
      sfr.close();
    }
  }
 else   if (jc.getParsedCommand().equals("String_Node_Str")) {
{
      File assembly_gtf=new File(Util.sprintf("String_Node_Str",segment.dir,segment.base));
      File unspliced=new File(Util.sprintf("String_Node_Str",segment.dir,segment.base));
      if (assembly_gtf.getParentFile() != null && !assembly_gtf.getParentFile().exists())       assembly_gtf.getParentFile().mkdirs();
      File bamFile=segment.bam;
      File out_dir=new File(segment.dir);
      File tmp_dir=FileUtils.getFile(out_dir,"String_Node_Str");
      if (!tmp_dir.exists())       tmp_dir.mkdirs();
      File splice_junction_bed=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File splice_count_gtf=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File segment_bed=!FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str").exists() ? FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str") : FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      double jnct_alpha=segment.jnct_alpha;
      File merged_segment_bed=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File inferred_strand_segment_bed=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File spliced_exon_gtf=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File acc_jnct_gtf=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File rej_jnct_gtf=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File trimmed_exon_gtf=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File intronic_exon_gtf=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File changepoint_gtf=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File filtered_changepoint_gtf=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File changepoint_exon_gtf=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      Strandedness strandedness=Strandedness.valueOf(segment.strandedness);
      SAMFileReader.setDefaultValidationStringency(ValidationStringency.SILENT);
      SAMFileReader sfr=new SAMFileReader(bamFile);
      System.out.println("String_Node_Str");
      BEDWriter merged_segments=new BEDWriter(IO.bufferedPrintstream(merged_segment_bed));
      File merge_regions=segment.filled_gap_segments == null ? null : new File(segment.filled_gap_segments);
      ClusterExpressedSegments.mergeSegments(segment_bed,merge_regions,merged_segments,segment.merge_radius);
      merged_segments.close();
      System.out.println("String_Node_Str");
      GTFWriter passed_jnct_gw=new GTFWriter(IO.bufferedPrintstream(acc_jnct_gtf));
      GTFWriter failed_jnct_gw=new GTFWriter(IO.bufferedPrintstream(rej_jnct_gtf));
      FindSpliceJunctions.filterCountedJunctions(splice_junction_bed,splice_count_gtf,jnct_alpha,passed_jnct_gw,failed_jnct_gw);
      passed_jnct_gw.close();
      failed_jnct_gw.close();
      if (strandedness == Strandedness.unstranded) {
        System.out.println("String_Node_Str");
        BEDWriter inferred_strand_segment=new BEDWriter(IO.bufferedPrintstream(inferred_strand_segment_bed));
        ClusterExpressedSegments.inferSegmentStrand(acc_jnct_gtf,merged_segment_bed,inferred_strand_segment);
        inferred_strand_segment.close();
        merged_segment_bed=inferred_strand_segment_bed;
      }
      System.out.println("String_Node_Str");
      GTFWriter spliced_exons=new GTFWriter(IO.bufferedPrintstream(spliced_exon_gtf));
      ClusterExpressedSegments.identifySplicedExons(acc_jnct_gtf,merged_segment_bed,spliced_exons);
      spliced_exons.close();
      if (strandedness == Strandedness.unstranded) {
        System.out.println("String_Node_Str");
        GTFWriter trimmed_exons=new GTFWriter(IO.bufferedPrintstream(trimmed_exon_gtf));
        ClusterExpressedSegments.trimInferredExons(spliced_exon_gtf,trimmed_exons);
        trimmed_exons.close();
        spliced_exon_gtf=trimmed_exon_gtf;
      }
      GTFWriter intronic_exon_writer=new GTFWriter(IO.bufferedPrintstream(intronic_exon_gtf));
      if (false) {
        System.out.println("String_Node_Str");
        ClusterExpressedSegments.identifyIntronicExons(merged_segment_bed,acc_jnct_gtf,spliced_exon_gtf,sfr,strandedness,intronic_exon_writer,10,.2);
      }
      intronic_exon_writer.close();
      System.out.println("String_Node_Str");
      double alpha_0=1.0;
      double beta_0=1.0;
      int nb_r=segment.nb_r;
      int r=segment.segment_r;
      double p=segment.segment_p;
      int maxBins=20000;
      int binSize=segment.w;
      int minCP=0;
      int minLength=binSize * 2;
      GTFWriter changepoint_writer=new GTFWriter(IO.bufferedPrintstream(changepoint_gtf));
      boolean internal=segment.internal;
      double min_fold=segment.min_fold;
      int min_terminal=-segment.min_terminal;
      IdentifyChangePoints.identifyNegativeBinomialChangePointsInLongSegments(sfr,spliced_exon_gtf,intronic_exon_gtf,changepoint_writer,minLength,maxBins,binSize,minCP,strandedness,alpha_0,beta_0,nb_r,r,p,internal,min_fold,min_terminal);
      changepoint_writer.close();
      System.out.println("String_Node_Str");
      int sj_radius=binSize * 1;
      GTFWriter filtered_changepoint_writer=new GTFWriter(IO.bufferedPrintstream(filtered_changepoint_gtf));
      IdentifyChangePoints.filterChangePoints(sfr,spliced_exon_gtf,intronic_exon_gtf,acc_jnct_gtf,changepoint_gtf,filtered_changepoint_writer,sj_radius);
      filtered_changepoint_writer.close();
      System.out.println("String_Node_Str");
      GTFWriter changepoint_exon_writer=new GTFWriter(IO.bufferedPrintstream(changepoint_exon_gtf));
      IdentifyChangePoints.enumerateChangepointExons(spliced_exon_gtf,intronic_exon_gtf,filtered_changepoint_gtf,changepoint_exon_writer);
      changepoint_exon_writer.close();
      System.out.println("String_Node_Str");
      GTFWriter assembly_writer=new GTFWriter(IO.bufferedPrintstream(assembly_gtf));
      ExonSpliceGraph.labelConnectedComponents(acc_jnct_gtf,spliced_exon_gtf,intronic_exon_gtf,changepoint_exon_gtf,assembly_writer);
      assembly_writer.close();
      System.out.println("String_Node_Str");
      GTFWriter remainder_writer=new GTFWriter(IO.bufferedPrintstream(unspliced));
      ClusterExpressedSegments.writeUnsplicedRemainder(merged_segment_bed,assembly_gtf,remainder_writer);
      remainder_writer.close();
      if (segment.coverage) {
        System.out.println("String_Node_Str");
        File coverage_gtf=new File(Util.sprintf("String_Node_Str",segment.dir,segment.base));
        File coverage_unspliced=new File(Util.sprintf("String_Node_Str",segment.dir,segment.base));
        GTFWriter coverage_gw=new GTFWriter(IO.bufferedPrintstream(coverage_gtf));
        IdentifyChangePoints.calculate_spliced_coverage(sfr,assembly_gtf,strandedness,coverage_gw);
        coverage_gw.close();
        GTFWriter coverage_unspliced_gw=new GTFWriter(IO.bufferedPrintstream(coverage_unspliced));
        IdentifyChangePoints.calculate_coverage(sfr,unspliced,strandedness,coverage_unspliced_gw);
        coverage_unspliced_gw.close();
      }
      sfr.close();
    }
  }
 else   if (jc.getParsedCommand().equals("String_Node_Str")) {
    AssembleCommand assemblyConfiguration=ConfigurationIO.readAssemblyConfiguration(enumerate.assemblyXml);
    File out_dir=assemble.dir;
    File configuration_xml=FileUtils.getFile(out_dir,Util.sprintf("String_Node_Str",assemble.base));
    ConfigurationIO.writeConfiguration(enumerate,configuration_xml);
    PrintStream gtfFile=IO.bufferedPrintstream(FileUtils.getFile(assemblyConfiguration.dir,Util.sprintf("String_Node_Str",assemblyConfiguration.base)));
    PrintStream skipped=IO.bufferedPrintstream(FileUtils.getFile(assemblyConfiguration.dir,Util.sprintf("String_Node_Str",assemblyConfiguration.base)));
    File assembly_gtf=new File(Util.sprintf("String_Node_Str",assemblyConfiguration.dir,assemblyConfiguration.base));
    GTFWriter gw=new GTFWriter(gtfFile);
    splicegraph.ExonSpliceGraph.iterateSpliceIsoforms(assembly_gtf,gw,skipped,enumerate.max_paths);
    gw.close();
    skipped.close();
  }
 else   if (jc.getParsedCommand().equals("String_Node_Str")) {
    if (!compare.dir.exists())     compare.dir.mkdirs();
    File configuration_xml=FileUtils.getFile(compare.dir,Util.sprintf("String_Node_Str",compare.base));
    ConfigurationIO.writeConfiguration(compare,configuration_xml);
    AssembleCommand assemblyConfiguration1=ConfigurationIO.readAssemblyConfiguration(compare.assemblyXml1);
    AssembleCommand assemblyConfiguration2=ConfigurationIO.readAssemblyConfiguration(compare.assemblyXml2);
    File spliced_exon_gtf1=FileUtils.getFile(assemblyConfiguration1.dir,"String_Node_Str",assemblyConfiguration1.base + "String_Node_Str");
    File spliced_exon_gtf2=FileUtils.getFile(assemblyConfiguration1.dir,"String_Node_Str",assemblyConfiguration1.base + "String_Node_Str");
    File table=FileUtils.getFile(compare.dir,Util.sprintf("String_Node_Str",compare.base));
    File gtf=FileUtils.getFile(compare.dir,Util.sprintf("String_Node_Str",compare.base));
    int maxBins=20000;
    int binSize=assemblyConfiguration1.w;
    int minCP=0;
    double alpha_0=1;
    double beta_0=1;
    int nb_r=assemblyConfiguration1.nb_r;
    int r=assemblyConfiguration1.segment_r;
    double p=assemblyConfiguration1.segment_p;
    double min_fold=assemblyConfiguration1.min_fold;
    JointSegmentation.performJointSegmentation(assemblyConfiguration1.base,assemblyConfiguration2.base,spliced_exon_gtf1,spliced_exon_gtf2,assemblyConfiguration1.bam,assemblyConfiguration2.bam,table,gtf,Strandedness.valueOf(assemblyConfiguration1.strandedness),Strandedness.valueOf(assemblyConfiguration2.strandedness),maxBins,binSize,minCP,alpha_0,beta_0,nb_r,r,p,min_fold);
  }
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException, JAXBException {
  JCommander jc=new JCommander();
  jc.setProgramName("String_Node_Str");
  AssembleCommand assemble=new AssembleCommand();
  SegmentCommand segment=new SegmentCommand();
  CompareCommand compare=new CompareCommand();
  EnumerateCommand enumerate=new EnumerateCommand();
  HelpCommand help=new HelpCommand();
  jc.addCommand("String_Node_Str",assemble);
  jc.addCommand("String_Node_Str",segment);
  jc.addCommand("String_Node_Str",compare);
  jc.addCommand("String_Node_Str",enumerate);
  jc.addCommand("String_Node_Str",help);
  jc.parse(args);
  if (jc.getParsedCommand() == null || jc.getParsedCommand().equals("String_Node_Str")) {
    jc.usage();
  }
 else   if (jc.getParsedCommand().equals("String_Node_Str")) {
    File out_dir=assemble.dir;
    if (!out_dir.exists())     out_dir.mkdirs();
    File configuration_file=FileUtils.getFile(out_dir,Util.sprintf("String_Node_Str",assemble.base));
    ConfigurationIO.writeConfiguration(assemble,configuration_file);
{
      File bamFile=assemble.bam;
      File tmp_dir=FileUtils.getFile(out_dir,"String_Node_Str");
      if (!tmp_dir.exists())       tmp_dir.mkdirs();
      if (!tmp_dir.exists())       tmp_dir.mkdirs();
      File splice_junction_bed=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File splice_count_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File segment_bed=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      Strandedness strandedness=Strandedness.valueOf(assemble.strandedness);
      SAMFileReader.setDefaultValidationStringency(ValidationStringency.SILENT);
      SAMFileReader sfr=new SAMFileReader(bamFile);
      System.out.println("String_Node_Str");
      BEDWriter sj_bw=new BEDWriter(IO.bufferedPrintstream(splice_junction_bed));
      FindSpliceJunctions.tabulateSpliceJunctions(sfr,sj_bw);
      sj_bw.close();
      System.out.println("String_Node_Str");
      GTFWriter counted_sj_gtf=new GTFWriter(IO.bufferedPrintstream(splice_count_gtf));
      FindSpliceJunctions.countJunctionSupportingReads(sfr,strandedness,splice_junction_bed,counted_sj_gtf);
      counted_sj_gtf.close();
      System.out.println("String_Node_Str");
      BEDWriter seg_bw=new BEDWriter(IO.bufferedPrintstream(segment_bed));
      SlidingWindow.identifyExpressed(sfr,strandedness,1,assemble.threshold,1,seg_bw);
      seg_bw.close();
      if (assemble.insert_size_quantile != null) {
        File matepair_bed=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
        File scaffolded_bed=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
        System.out.println("String_Node_Str");
        int insert_size=ClusterExpressedSegments.estimateMateInsertSize(sfr,strandedness,segment_bed,assemble.insert_size_quantile);
        System.out.printf("String_Node_Str",assemble.insert_size_quantile,insert_size);
        System.out.println("String_Node_Str");
        BEDWriter matepair_bw=new BEDWriter(IO.bufferedPrintstream(matepair_bed));
        ClusterExpressedSegments.identifySpannableRegions(sfr,strandedness,matepair_bw,insert_size);
        matepair_bw.close();
        System.out.println("String_Node_Str");
        BEDWriter scaffolded_bw=new BEDWriter(IO.bufferedPrintstream(scaffolded_bed));
        ClusterExpressedSegments.scaffoldSpannableRegions(segment_bed,matepair_bed,scaffolded_bw);
        scaffolded_bw.close();
      }
      sfr.close();
    }
{
      File assembly_gtf=new File(Util.sprintf("String_Node_Str",assemble.dir,assemble.base));
      File unspliced=new File(Util.sprintf("String_Node_Str",assemble.dir,assemble.base));
      if (assembly_gtf.getParentFile() != null && !assembly_gtf.getParentFile().exists())       assembly_gtf.getParentFile().mkdirs();
      File bamFile=assemble.bam;
      File tmp_dir=FileUtils.getFile(out_dir,"String_Node_Str");
      if (!tmp_dir.exists())       tmp_dir.mkdirs();
      File splice_junction_bed=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File splice_count_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File segment_bed=assemble.insert_size_quantile == null ? FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str") : FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      double jnct_alpha=assemble.jnct_alpha;
      File merged_segment_bed=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File inferred_strand_segment_bed=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File spliced_exon_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File acc_jnct_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File rej_jnct_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File trimmed_exon_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File intronic_exon_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File changepoint_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File filtered_changepoint_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      File changepoint_exon_gtf=FileUtils.getFile(tmp_dir,assemble.base + "String_Node_Str");
      Strandedness strandedness=Strandedness.valueOf(assemble.strandedness);
      SAMFileReader.setDefaultValidationStringency(ValidationStringency.SILENT);
      SAMFileReader sfr=new SAMFileReader(bamFile);
      System.out.println("String_Node_Str");
      BEDWriter merged_segments=new BEDWriter(IO.bufferedPrintstream(merged_segment_bed));
      File merge_regions=assemble.filled_gap_segments == null ? null : new File(assemble.filled_gap_segments);
      ClusterExpressedSegments.mergeSegments(segment_bed,merge_regions,merged_segments,assemble.merge_radius);
      merged_segments.close();
      System.out.println("String_Node_Str");
      GTFWriter passed_jnct_gw=new GTFWriter(IO.bufferedPrintstream(acc_jnct_gtf));
      GTFWriter failed_jnct_gw=new GTFWriter(IO.bufferedPrintstream(rej_jnct_gtf));
      FindSpliceJunctions.filterCountedJunctions(splice_junction_bed,splice_count_gtf,jnct_alpha,passed_jnct_gw,failed_jnct_gw);
      passed_jnct_gw.close();
      failed_jnct_gw.close();
      if (strandedness == Strandedness.unstranded) {
        System.out.println("String_Node_Str");
        BEDWriter inferred_strand_segment=new BEDWriter(IO.bufferedPrintstream(inferred_strand_segment_bed));
        ClusterExpressedSegments.inferSegmentStrand(acc_jnct_gtf,merged_segment_bed,inferred_strand_segment);
        inferred_strand_segment.close();
        merged_segment_bed=inferred_strand_segment_bed;
      }
      System.out.println("String_Node_Str");
      GTFWriter spliced_exons=new GTFWriter(IO.bufferedPrintstream(spliced_exon_gtf));
      ClusterExpressedSegments.identifySplicedExons(acc_jnct_gtf,merged_segment_bed,spliced_exons);
      spliced_exons.close();
      if (strandedness == Strandedness.unstranded) {
        System.out.println("String_Node_Str");
        GTFWriter trimmed_exons=new GTFWriter(IO.bufferedPrintstream(trimmed_exon_gtf));
        ClusterExpressedSegments.trimInferredExons(spliced_exon_gtf,trimmed_exons);
        trimmed_exons.close();
        spliced_exon_gtf=trimmed_exon_gtf;
      }
      GTFWriter intronic_exon_writer=new GTFWriter(IO.bufferedPrintstream(intronic_exon_gtf));
      if (false) {
        System.out.println("String_Node_Str");
        ClusterExpressedSegments.identifyIntronicExons(merged_segment_bed,acc_jnct_gtf,spliced_exon_gtf,sfr,strandedness,intronic_exon_writer,10,.2);
      }
      intronic_exon_writer.close();
      System.out.println("String_Node_Str");
      double alpha_0=1.0;
      double beta_0=1.0;
      int nb_r=assemble.nb_r;
      int r=assemble.segment_r;
      double p=assemble.segment_p;
      int maxBins=20000;
      int binSize=assemble.w;
      int minCP=0;
      int minLength=binSize * 2;
      GTFWriter changepoint_writer=new GTFWriter(IO.bufferedPrintstream(changepoint_gtf));
      boolean internal=assemble.internal;
      double min_fold=assemble.min_fold;
      int min_terminal=-assemble.min_terminal;
      IdentifyChangePoints.identifyNegativeBinomialChangePointsInLongSegments(sfr,spliced_exon_gtf,intronic_exon_gtf,changepoint_writer,minLength,maxBins,binSize,minCP,strandedness,alpha_0,beta_0,nb_r,r,p,internal,min_fold,min_terminal);
      changepoint_writer.close();
      System.out.println("String_Node_Str");
      int sj_radius=binSize * 1;
      GTFWriter filtered_changepoint_writer=new GTFWriter(IO.bufferedPrintstream(filtered_changepoint_gtf));
      IdentifyChangePoints.filterChangePoints(sfr,spliced_exon_gtf,intronic_exon_gtf,acc_jnct_gtf,changepoint_gtf,filtered_changepoint_writer,sj_radius);
      filtered_changepoint_writer.close();
      System.out.println("String_Node_Str");
      GTFWriter changepoint_exon_writer=new GTFWriter(IO.bufferedPrintstream(changepoint_exon_gtf));
      IdentifyChangePoints.enumerateChangepointExons(spliced_exon_gtf,intronic_exon_gtf,filtered_changepoint_gtf,changepoint_exon_writer);
      changepoint_exon_writer.close();
      System.out.println("String_Node_Str");
      GTFWriter assembly_writer=new GTFWriter(IO.bufferedPrintstream(assembly_gtf));
      ExonSpliceGraph.labelConnectedComponents(acc_jnct_gtf,spliced_exon_gtf,intronic_exon_gtf,changepoint_exon_gtf,assembly_writer);
      assembly_writer.close();
      System.out.println("String_Node_Str");
      GTFWriter remainder_writer=new GTFWriter(IO.bufferedPrintstream(unspliced));
      ClusterExpressedSegments.writeUnsplicedRemainder(merged_segment_bed,assembly_gtf,remainder_writer);
      remainder_writer.close();
      if (assemble.coverage) {
        System.out.println("String_Node_Str");
        File coverage_gtf=new File(Util.sprintf("String_Node_Str",assemble.dir,assemble.base));
        File coverage_unspliced=new File(Util.sprintf("String_Node_Str",assemble.dir,assemble.base));
        GTFWriter coverage_gw=new GTFWriter(IO.bufferedPrintstream(coverage_gtf));
        IdentifyChangePoints.calculate_spliced_coverage(sfr,assembly_gtf,strandedness,coverage_gw);
        coverage_gw.close();
        GTFWriter coverage_unspliced_gw=new GTFWriter(IO.bufferedPrintstream(coverage_unspliced));
        IdentifyChangePoints.calculate_coverage(sfr,unspliced,strandedness,coverage_unspliced_gw);
        coverage_unspliced_gw.close();
      }
      sfr.close();
    }
  }
 else   if (jc.getParsedCommand().equals("String_Node_Str")) {
{
      File assembly_gtf=new File(Util.sprintf("String_Node_Str",segment.dir,segment.base));
      File unspliced=new File(Util.sprintf("String_Node_Str",segment.dir,segment.base));
      if (assembly_gtf.getParentFile() != null && !assembly_gtf.getParentFile().exists())       assembly_gtf.getParentFile().mkdirs();
      File bamFile=segment.bam;
      File out_dir=new File(segment.dir);
      File tmp_dir=FileUtils.getFile(out_dir,"String_Node_Str");
      if (!tmp_dir.exists())       tmp_dir.mkdirs();
      File splice_junction_bed=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File splice_count_gtf=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File segment_bed=!FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str").exists() ? FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str") : FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      double jnct_alpha=segment.jnct_alpha;
      File merged_segment_bed=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File inferred_strand_segment_bed=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File spliced_exon_gtf=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File acc_jnct_gtf=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File rej_jnct_gtf=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File trimmed_exon_gtf=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File intronic_exon_gtf=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File changepoint_gtf=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File filtered_changepoint_gtf=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      File changepoint_exon_gtf=FileUtils.getFile(tmp_dir,segment.base + "String_Node_Str");
      Strandedness strandedness=Strandedness.valueOf(segment.strandedness);
      SAMFileReader.setDefaultValidationStringency(ValidationStringency.SILENT);
      SAMFileReader sfr=new SAMFileReader(bamFile);
      System.out.println("String_Node_Str");
      BEDWriter merged_segments=new BEDWriter(IO.bufferedPrintstream(merged_segment_bed));
      File merge_regions=segment.filled_gap_segments == null ? null : new File(segment.filled_gap_segments);
      ClusterExpressedSegments.mergeSegments(segment_bed,merge_regions,merged_segments,segment.merge_radius);
      merged_segments.close();
      System.out.println("String_Node_Str");
      GTFWriter passed_jnct_gw=new GTFWriter(IO.bufferedPrintstream(acc_jnct_gtf));
      GTFWriter failed_jnct_gw=new GTFWriter(IO.bufferedPrintstream(rej_jnct_gtf));
      FindSpliceJunctions.filterCountedJunctions(splice_junction_bed,splice_count_gtf,jnct_alpha,passed_jnct_gw,failed_jnct_gw);
      passed_jnct_gw.close();
      failed_jnct_gw.close();
      if (strandedness == Strandedness.unstranded) {
        System.out.println("String_Node_Str");
        BEDWriter inferred_strand_segment=new BEDWriter(IO.bufferedPrintstream(inferred_strand_segment_bed));
        ClusterExpressedSegments.inferSegmentStrand(acc_jnct_gtf,merged_segment_bed,inferred_strand_segment);
        inferred_strand_segment.close();
        merged_segment_bed=inferred_strand_segment_bed;
      }
      System.out.println("String_Node_Str");
      GTFWriter spliced_exons=new GTFWriter(IO.bufferedPrintstream(spliced_exon_gtf));
      ClusterExpressedSegments.identifySplicedExons(acc_jnct_gtf,merged_segment_bed,spliced_exons);
      spliced_exons.close();
      if (strandedness == Strandedness.unstranded) {
        System.out.println("String_Node_Str");
        GTFWriter trimmed_exons=new GTFWriter(IO.bufferedPrintstream(trimmed_exon_gtf));
        ClusterExpressedSegments.trimInferredExons(spliced_exon_gtf,trimmed_exons);
        trimmed_exons.close();
        spliced_exon_gtf=trimmed_exon_gtf;
      }
      GTFWriter intronic_exon_writer=new GTFWriter(IO.bufferedPrintstream(intronic_exon_gtf));
      if (false) {
        System.out.println("String_Node_Str");
        ClusterExpressedSegments.identifyIntronicExons(merged_segment_bed,acc_jnct_gtf,spliced_exon_gtf,sfr,strandedness,intronic_exon_writer,10,.2);
      }
      intronic_exon_writer.close();
      System.out.println("String_Node_Str");
      double alpha_0=1.0;
      double beta_0=1.0;
      int nb_r=segment.nb_r;
      int r=segment.segment_r;
      double p=segment.segment_p;
      int maxBins=20000;
      int binSize=segment.w;
      int minCP=0;
      int minLength=binSize * 2;
      GTFWriter changepoint_writer=new GTFWriter(IO.bufferedPrintstream(changepoint_gtf));
      boolean internal=segment.internal;
      double min_fold=segment.min_fold;
      int min_terminal=-segment.min_terminal;
      IdentifyChangePoints.identifyNegativeBinomialChangePointsInLongSegments(sfr,spliced_exon_gtf,intronic_exon_gtf,changepoint_writer,minLength,maxBins,binSize,minCP,strandedness,alpha_0,beta_0,nb_r,r,p,internal,min_fold,min_terminal);
      changepoint_writer.close();
      System.out.println("String_Node_Str");
      int sj_radius=binSize * 1;
      GTFWriter filtered_changepoint_writer=new GTFWriter(IO.bufferedPrintstream(filtered_changepoint_gtf));
      IdentifyChangePoints.filterChangePoints(sfr,spliced_exon_gtf,intronic_exon_gtf,acc_jnct_gtf,changepoint_gtf,filtered_changepoint_writer,sj_radius);
      filtered_changepoint_writer.close();
      System.out.println("String_Node_Str");
      GTFWriter changepoint_exon_writer=new GTFWriter(IO.bufferedPrintstream(changepoint_exon_gtf));
      IdentifyChangePoints.enumerateChangepointExons(spliced_exon_gtf,intronic_exon_gtf,filtered_changepoint_gtf,changepoint_exon_writer);
      changepoint_exon_writer.close();
      System.out.println("String_Node_Str");
      GTFWriter assembly_writer=new GTFWriter(IO.bufferedPrintstream(assembly_gtf));
      ExonSpliceGraph.labelConnectedComponents(acc_jnct_gtf,spliced_exon_gtf,intronic_exon_gtf,changepoint_exon_gtf,assembly_writer);
      assembly_writer.close();
      System.out.println("String_Node_Str");
      GTFWriter remainder_writer=new GTFWriter(IO.bufferedPrintstream(unspliced));
      ClusterExpressedSegments.writeUnsplicedRemainder(merged_segment_bed,assembly_gtf,remainder_writer);
      remainder_writer.close();
      if (segment.coverage) {
        System.out.println("String_Node_Str");
        File coverage_gtf=new File(Util.sprintf("String_Node_Str",segment.dir,segment.base));
        File coverage_unspliced=new File(Util.sprintf("String_Node_Str",segment.dir,segment.base));
        GTFWriter coverage_gw=new GTFWriter(IO.bufferedPrintstream(coverage_gtf));
        IdentifyChangePoints.calculate_spliced_coverage(sfr,assembly_gtf,strandedness,coverage_gw);
        coverage_gw.close();
        GTFWriter coverage_unspliced_gw=new GTFWriter(IO.bufferedPrintstream(coverage_unspliced));
        IdentifyChangePoints.calculate_coverage(sfr,unspliced,strandedness,coverage_unspliced_gw);
        coverage_unspliced_gw.close();
      }
      sfr.close();
    }
  }
 else   if (jc.getParsedCommand().equals("String_Node_Str")) {
    AssembleCommand assemblyConfiguration=ConfigurationIO.readAssemblyConfiguration(enumerate.assemblyXml);
    File out_dir=assemble.dir;
    File configuration_xml=FileUtils.getFile(out_dir,Util.sprintf("String_Node_Str",assemble.base));
    ConfigurationIO.writeConfiguration(enumerate,configuration_xml);
    PrintStream gtfFile=IO.bufferedPrintstream(FileUtils.getFile(assemblyConfiguration.dir,Util.sprintf("String_Node_Str",assemblyConfiguration.base)));
    PrintStream skipped=IO.bufferedPrintstream(FileUtils.getFile(assemblyConfiguration.dir,Util.sprintf("String_Node_Str",assemblyConfiguration.base)));
    File assembly_gtf=new File(Util.sprintf("String_Node_Str",assemblyConfiguration.dir,assemblyConfiguration.base));
    GTFWriter gw=new GTFWriter(gtfFile);
    splicegraph.ExonSpliceGraph.iterateSpliceIsoforms(assembly_gtf,gw,skipped,enumerate.max_paths);
    gw.close();
    skipped.close();
  }
 else   if (jc.getParsedCommand().equals("String_Node_Str")) {
    if (!compare.dir.exists())     compare.dir.mkdirs();
    File configuration_xml=FileUtils.getFile(compare.dir,Util.sprintf("String_Node_Str",compare.base));
    ConfigurationIO.writeConfiguration(compare,configuration_xml);
    AssembleCommand assemblyConfiguration1=ConfigurationIO.readAssemblyConfiguration(compare.assemblyXml1);
    AssembleCommand assemblyConfiguration2=ConfigurationIO.readAssemblyConfiguration(compare.assemblyXml2);
    Strandedness s1=Strandedness.valueOf(assemblyConfiguration1.strandedness);
    Strandedness s2=Strandedness.valueOf(assemblyConfiguration2.strandedness);
    File spliced_exon_gtf1=FileUtils.getFile(assemblyConfiguration1.dir,"String_Node_Str",assemblyConfiguration1.base + "String_Node_Str" + (s1 == Strandedness.unstranded ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
    File spliced_exon_gtf2=FileUtils.getFile(assemblyConfiguration1.dir,"String_Node_Str",assemblyConfiguration1.base + "String_Node_Str" + (s2 == Strandedness.unstranded ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
    File table=FileUtils.getFile(compare.dir,Util.sprintf("String_Node_Str",compare.base));
    File gtf=FileUtils.getFile(compare.dir,Util.sprintf("String_Node_Str",compare.base));
    int maxBins=20000;
    int binSize=assemblyConfiguration1.w;
    int minCP=0;
    double alpha_0=1;
    double beta_0=1;
    int nb_r=assemblyConfiguration1.nb_r;
    int r=assemblyConfiguration1.segment_r;
    double p=assemblyConfiguration1.segment_p;
    double min_fold=assemblyConfiguration1.min_fold;
    JointSegmentation.performJointSegmentation(assemblyConfiguration1.base,assemblyConfiguration2.base,spliced_exon_gtf1,spliced_exon_gtf2,assemblyConfiguration1.bam,assemblyConfiguration2.bam,table,gtf,s1,s2,maxBins,binSize,minCP,alpha_0,beta_0,nb_r,r,p,min_fold);
  }
}