# HG changeset patch -- Bitbucket.org # Project galaxy-dist # URL http://bitbucket.org/galaxy/galaxy-dist/overview # User jeremy goecks <jeremy.goecks@emory.edu> # Date 1288019385 14400 # Node ID 141e7055d2c633afee5262932adb1896ad0f937e # Parent 7114d0f8d487536853cf25cf30bb86636bf0b24c Update to Cufflinks tool suite: (a) better path joining; (b) update test data for cufflinks so that functional tests pass for v0.9.1; (c) add extensions to cuffcompare wrapper temporary inputs to fix #404. --- a/test-data/cufflinks_out3.expr +++ b/test-data/cufflinks_out3.expr @@ -1,2 +1,2 @@ -gene_id bundle_id chr left right FPKM FPKM_conf_lo FPKM_conf_hi -CUFF.1 6 test_chromosome 52 550 3.3557e+06 2.6976e+06 4.01381e+06 +gene_id bundle_id chr left right FPKM FPKM_conf_lo FPKM_conf_hi status +CUFF.1 3 test_chromosome 52 550 4.46429e+06 4.46006e+06 4.46851e+06 OK --- a/tools/ngs_rna/cuffcompare_wrapper.py +++ b/tools/ngs_rna/cuffcompare_wrapper.py @@ -42,13 +42,15 @@ def __main__(): # Add input files. - # Need to symlink inputs so that output files are written to temp directory. - input1_file_name = tmp_output_dir + "/input1" + # Need to symlink inputs so that output files are written to temp directory. + # Also need an extension for input file names so that cuffcompare produces + # output files properly. + input1_file_name = os.path.join( tmp_output_dir, "input1.gtf" ) os.symlink( options.input1, input1_file_name ) cmd += " %s" % input1_file_name two_inputs = ( options.input2 != None) if two_inputs: - input2_file_name = tmp_output_dir + "/input2" + input2_file_name = os.path.join( tmp_output_dir, "input2.gtf" ) os.symlink( options.input2, input2_file_name ) cmd += " %s" % input2_file_name @@ -78,7 +80,8 @@ def __main__(): raise Exception, stderr # check that there are results in the output file - if len( open( tmp_output_dir + "/cc_output", 'rb' ).read().strip() ) == 0: + cc_output_fname = os.path.join( tmp_output_dir, "cc_output") + if len( open( cc_output_fname, 'rb' ).read().strip() ) == 0: raise Exception, 'The main output file is empty, there may be an error with your input file or settings.' except Exception, e: stop_err( 'Error running cuffcompare. ' + str( e ) ) @@ -86,14 +89,14 @@ def __main__(): # Copy output files from tmp directory to specified files. try: try: - shutil.copyfile( tmp_output_dir + "/cc_output", options.transcripts_accuracy_output_file ) - shutil.copyfile( tmp_output_dir + "/input1.tmap", options.input1_tmap_output_file ) - shutil.copyfile( tmp_output_dir + "/input1.refmap", options.input1_refmap_output_file ) + shutil.copyfile( os.path.join( tmp_output_dir, "cc_output" ), options.transcripts_accuracy_output_file ) + shutil.copyfile( os.path.join( tmp_output_dir, "input1.tmap" ), options.input1_tmap_output_file ) + shutil.copyfile( os.path.join( tmp_output_dir, "input1.refmap" ), options.input1_refmap_output_file ) if two_inputs: - shutil.copyfile( tmp_output_dir + "/cc_output.combined.gtf", options.transcripts_combined_output_file ) - shutil.copyfile( tmp_output_dir + "/cc_output.tracking", options.transcripts_tracking_output_file ) - shutil.copyfile( tmp_output_dir + "/input2.tmap", options.input2_tmap_output_file ) - shutil.copyfile( tmp_output_dir + "/input2.refmap", options.input2_refmap_output_file ) + shutil.copyfile( os.path.join( tmp_output_dir, "cc_output.combined.gtf" ), options.transcripts_combined_output_file ) + shutil.copyfile( os.path.join( tmp_output_dir, "cc_output.tracking" ), options.transcripts_tracking_output_file ) + shutil.copyfile( os.path.join( tmp_output_dir, "input2.tmap" ), options.input2_tmap_output_file ) + shutil.copyfile( os.path.join( tmp_output_dir, "input2.refmap" ), options.input2_refmap_output_file ) except Exception, e: stop_err( 'Error in cuffcompare:\n' + str( e ) ) finally: --- a/test-data/cufflinks_out1.gtf +++ b/test-data/cufflinks_out1.gtf @@ -1,4 +1,4 @@ -test_chromosome Cufflinks transcript 53 550 1000 + . gene_id "CUFF.1"; transcript_id "CUFF.1.1"; FPKM "3355704.6979865772"; frac "1.000000"; conf_lo "2697596.861952"; conf_hi "4013812.534021"; cov "46.057047"; -test_chromosome Cufflinks exon 53 250 1000 + . gene_id "CUFF.1"; transcript_id "CUFF.1.1"; exon_number "1"; FPKM "3355704.6979865772"; frac "1.000000"; conf_lo "2697596.861952"; conf_hi "4013812.534021"; cov "46.057047"; -test_chromosome Cufflinks exon 351 400 1000 + . gene_id "CUFF.1"; transcript_id "CUFF.1.1"; exon_number "2"; FPKM "3355704.6979865772"; frac "1.000000"; conf_lo "2697596.861952"; conf_hi "4013812.534021"; cov "46.057047"; -test_chromosome Cufflinks exon 501 550 1000 + . gene_id "CUFF.1"; transcript_id "CUFF.1.1"; exon_number "3"; FPKM "3355704.6979865772"; frac "1.000000"; conf_lo "2697596.861952"; conf_hi "4013812.534021"; cov "46.057047"; +test_chromosome Cufflinks transcript 53 550 1000 + . gene_id "CUFF.1"; transcript_id "CUFF.1.1"; FPKM "4464285.7142857295"; frac "1.000000"; conf_lo "4460059.943012"; conf_hi "4468511.485559"; cov "61.272321"; +test_chromosome Cufflinks exon 53 250 1000 + . gene_id "CUFF.1"; transcript_id "CUFF.1.1"; exon_number "1"; FPKM "4464285.7142857295"; frac "1.000000"; conf_lo "4460059.943012"; conf_hi "4468511.485559"; cov "61.272321"; +test_chromosome Cufflinks exon 351 400 1000 + . gene_id "CUFF.1"; transcript_id "CUFF.1.1"; exon_number "2"; FPKM "4464285.7142857295"; frac "1.000000"; conf_lo "4460059.943012"; conf_hi "4468511.485559"; cov "61.272321"; +test_chromosome Cufflinks exon 501 550 1000 + . gene_id "CUFF.1"; transcript_id "CUFF.1.1"; exon_number "3"; FPKM "4464285.7142857295"; frac "1.000000"; conf_lo "4460059.943012"; conf_hi "4468511.485559"; cov "61.272321"; --- a/tools/ngs_rna/cuffdiff_wrapper.py +++ b/tools/ngs_rna/cuffdiff_wrapper.py @@ -98,7 +98,7 @@ def __main__(): raise Exception, stderr # check that there are results in the output file - if len( open( tmp_output_dir + "/isoforms.fpkm_tracking", 'rb' ).read().strip() ) == 0: + if len( open( os.path.join( tmp_output_dir, "isoforms.fpkm_tracking" ), 'rb' ).read().strip() ) == 0: raise Exception, 'The main output file is empty, there may be an error with your input file or settings.' except Exception, e: stop_err( 'Error running cuffdiff. ' + str( e ) ) @@ -107,17 +107,17 @@ def __main__(): # Copy output files from tmp directory to specified files. try: try: - shutil.copyfile( tmp_output_dir + "/isoforms.fpkm_tracking", options.isoforms_fpkm_tracking_output ) - shutil.copyfile( tmp_output_dir + "/genes.fpkm_tracking", options.genes_fpkm_tracking_output ) - shutil.copyfile( tmp_output_dir + "/cds.fpkm_tracking", options.cds_fpkm_tracking_output ) - shutil.copyfile( tmp_output_dir + "/tss_groups.fpkm_tracking", options.tss_groups_fpkm_tracking_output ) - shutil.copyfile( tmp_output_dir + "/0_1_isoform_exp.diff", options.isoforms_exp_output ) - shutil.copyfile( tmp_output_dir + "/0_1_gene_exp.diff", options.genes_exp_output ) - shutil.copyfile( tmp_output_dir + "/0_1_tss_group_exp.diff", options.tss_groups_exp_output ) - shutil.copyfile( tmp_output_dir + "/0_1_splicing.diff", options.splicing_diff_output ) - shutil.copyfile( tmp_output_dir + "/0_1_cds.diff", options.cds_diff_output ) - shutil.copyfile( tmp_output_dir + "/0_1_cds_exp.diff", options.cds_diff_output ) - shutil.copyfile( tmp_output_dir + "/0_1_promoters.diff", options.promoters_diff_output ) + shutil.copyfile( os.path.join( tmp_output_dir, "isoforms.fpkm_tracking" ), options.isoforms_fpkm_tracking_output ) + shutil.copyfile( os.path.join( tmp_output_dir, "genes.fpkm_tracking" ), options.genes_fpkm_tracking_output ) + shutil.copyfile( os.path.join( tmp_output_dir, "cds.fpkm_tracking" ), options.cds_fpkm_tracking_output ) + shutil.copyfile( os.path.join( tmp_output_dir, "tss_groups.fpkm_tracking" ), options.tss_groups_fpkm_tracking_output ) + shutil.copyfile( os.path.join( tmp_output_dir, "0_1_isoform_exp.diff" ), options.isoforms_exp_output ) + shutil.copyfile( os.path.join( tmp_output_dir, "0_1_gene_exp.diff" ), options.genes_exp_output ) + shutil.copyfile( os.path.join( tmp_output_dir, "0_1_tss_group_exp.diff" ), options.tss_groups_exp_output ) + shutil.copyfile( os.path.join( tmp_output_dir, "0_1_splicing.diff" ), options.splicing_diff_output ) + shutil.copyfile( os.path.join( tmp_output_dir, "0_1_cds.diff" ), options.cds_diff_output ) + shutil.copyfile( os.path.join( tmp_output_dir, "0_1_cds_exp.diff" ), options.cds_diff_output ) + shutil.copyfile( os.path.join( tmp_output_dir, "0_1_promoters.diff" ), options.promoters_diff_output ) except Exception, e: stop_err( 'Error in cuffdiff:\n' + str( e ) ) finally: --- a/test-data/cufflinks_out2.expr +++ b/test-data/cufflinks_out2.expr @@ -1,2 +1,2 @@ -trans_id bundle_id chr left right FPKM FMI frac FPKM_conf_lo FPKM_conf_hi coverage length -CUFF.1.1 6 test_chromosome 52 550 3.3557e+06 1 1 2.6976e+06 4.01381e+06 46.057 298 +trans_id bundle_id chr left right FPKM FMI frac FPKM_conf_lo FPKM_conf_hi coverage length effective_length status +CUFF.1.1 3 test_chromosome 52 550 4.46429e+06 1 1 4.46006e+06 4.46851e+06 61.2723 298 224 OK --- a/tools/ngs_rna/cufflinks_wrapper.py +++ b/tools/ngs_rna/cufflinks_wrapper.py @@ -91,7 +91,7 @@ def __main__(): raise Exception, stderr # check that there are results in the output file - if len( open( tmp_output_dir + "/transcripts.gtf", 'rb' ).read().strip() ) == 0: + if len( open( os.path.join( tmp_output_dir, "transcripts.gtf" ), 'rb' ).read().strip() ) == 0: raise Exception, 'The main output file is empty, there may be an error with your input file or settings.' except Exception, e: stop_err( 'Error running cufflinks. ' + str( e ) ) @@ -99,9 +99,9 @@ def __main__(): # Copy output files from tmp directory to specified files. try: try: - shutil.copyfile( tmp_output_dir + "/transcripts.gtf", options.assembled_isoforms_output_file ) - shutil.copyfile( tmp_output_dir + "/transcripts.expr", options.transcripts_expression_output_file ) - shutil.copyfile( tmp_output_dir + "/genes.expr", options.genes_expression_output_file ) + shutil.copyfile( os.path.join( tmp_output_dir, "transcripts.gtf" ), options.assembled_isoforms_output_file ) + shutil.copyfile( os.path.join( tmp_output_dir, "transcripts.expr" ), options.transcripts_expression_output_file ) + shutil.copyfile( os.path.join( tmp_output_dir, "genes.expr" ), options.genes_expression_output_file ) except Exception, e: stop_err( 'Error in tophat:\n' + str( e ) ) finally: