diff cwpair2_util.py @ 2:279cdc63bcff draft

Uploaded
author greg
date Sat, 21 Nov 2015 09:01:24 -0500
parents 4d86371aafa8
children 2e0ddcc726f9
line wrap: on
line diff
--- a/cwpair2_util.py	Tue Nov 17 16:53:50 2015 -0500
+++ b/cwpair2_util.py	Sat Nov 21 09:01:24 2015 -0500
@@ -22,6 +22,7 @@
 X_LABEL = 'Peak-pair distance (bp)'
 TICK_WIDTH = 3
 ADJUST = [0.140, 0.9, 0.9, 0.1]
+PLOT_FORMAT = 'pdf'
 pyplot.rc('xtick.major', size=10.00)
 pyplot.rc('ytick.major', size=10.00)
 pyplot.rc('lines', linewidth=4.00)
@@ -223,8 +224,8 @@
         os.mkdir('%s_%s' % (match_method, STATS_GRAPH))
 
 
-def process_file(dataset_path, galaxy_hid, method, threshold, up_distance, down_distance,
-                 binsize, output_files, plot_format, sort_chromosome, sort_score):
+def process_file(dataset_path, galaxy_hid, method, threshold, up_distance,
+                 down_distance, binsize, output_files, sort_chromosome, sort_score):
     if method == 'all':
         match_methods = METHODS.keys()
     else:
@@ -239,7 +240,6 @@
                                 down_distance,
                                 binsize,
                                 output_files,
-                                plot_format,
                                 sort_chromosome,
                                 sort_score)
         statistics.append(stats)
@@ -251,7 +251,7 @@
 
 
 def perform_process(dataset_path, galaxy_hid, method, threshold, up_distance,
-                    down_distance, binsize, output_files, plot_format, sort_chromosome, sort_score):
+                    down_distance, binsize, output_files, sort_chromosome, sort_score):
     output_details = output_files in ["all", "simple_orphan_detail"]
     output_plots = output_files in ["all"]
     output_orphans = output_files in ["all", "simple_orphan", "simple_orphan_detail"]
@@ -286,19 +286,19 @@
         detailed_output.writerow(('chrom', 'start', 'end', 'value', 'strand') * 2 + ('midpoint', 'c-w reads sum', 'c-w distance (bp)'))
     if output_plots:
         # Final Plot
-        final_plot_path = make_path('%s_%s' % (method, FINAL_PLOTS), plot_format)
+        final_plot_path = make_path('%s_%s' % (method, FINAL_PLOTS), PLOT_FORMAT)
     if output_orphans:
         # Orphans
         orphan_output = td_writer('%s_%s' % (method, ORPHANS), extension=TABULAR_EXT)
         orphan_output.writerow(('chrom', 'strand', 'start', 'end', 'value'))
     if output_plots:
         # Preview Plot
-        preview_plot_path = make_path('%s_%s' % (method, PREVIEW_PLOTS), plot_format)
+        preview_plot_path = make_path('%s_%s' % (method, PREVIEW_PLOTS), PLOT_FORMAT)
     # Simple
     simple_output = td_writer('%s_%s' % (method, SIMPLES), extension=GFF_EXT)
     statistics['stats_path'] = 'statistics.%s' % TABULAR_EXT
     if output_plots:
-        statistics['graph_path'] = make_path('%s_%s' % (method, STATS_GRAPH), plot_format)
+        statistics['graph_path'] = make_path('%s_%s' % (method, STATS_GRAPH), PLOT_FORMAT)
     statistics['perc95'] = perc95(chromosomes)
     if threshold > 0:
         # Apply filter