mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
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.
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user