Mercurial > repos > greg > repmatch_gff3
changeset 5:53cbf79396d7 draft
Uploaded
author | greg |
---|---|
date | Sat, 28 Nov 2015 14:54:22 -0500 |
parents | 1cea96c461a2 |
children | 6df81aade62c |
files | repmatch_gff3_util.py |
diffstat | 1 files changed, 6 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/repmatch_gff3_util.py Tue Nov 24 08:16:39 2015 -0500 +++ b/repmatch_gff3_util.py Sat Nov 28 14:54:22 2015 -0500 @@ -21,7 +21,6 @@ pyplot.rc('axes', linewidth=3.00) pyplot.rc('font', family='Bitstream Vera Sans', size=32.0) -PLOT_FORMATS = ['png', 'pdf', 'svg'] COLORS = 'krb' @@ -254,19 +253,19 @@ return (cname, source, type, start, end, score, strand, phase, gff_attrs(attrs)) -def get_temporary_plot_path(plot_format): +def get_temporary_plot_path(): """ Return the path to a temporary file with a valid image format file extension that can be used with bioformats. """ tmp_dir = tempfile.mkdtemp(prefix='tmp-repmatch-') - fd, name = tempfile.mkstemp(suffix='.%s' % plot_format, dir=tmp_dir) + fd, name = tempfile.mkstemp(suffix='.pdf', dir=tmp_dir) os.close(fd) return name def process_files(dataset_paths, galaxy_hids, method, distance, step, replicates, up_limit, low_limit, output_files, - plot_format, output_summary, output_orphan, output_detail, output_key, output_histogram): + output_summary, output_orphan, output_detail, output_key, output_histogram): output_histogram_file = output_files in ["all"] and method in ["all"] if len(dataset_paths) < 2: return @@ -284,14 +283,13 @@ up_limit, low_limit, output_files, - plot_format, output_summary, output_orphan, output_detail, output_key, output_histogram) if output_histogram_file: - tmp_histogram_path = get_temporary_plot_path(plot_format) + tmp_histogram_path = get_temporary_plot_path() frequency_histogram([stat['distribution'] for stat in [statistics]], tmp_histogram_path, METHODS.keys()) @@ -299,7 +297,7 @@ def perform_process(dataset_paths, galaxy_hids, method, distance, step, num_required, up_limit, low_limit, output_files, - plot_format, output_summary, output_orphan, output_detail, output_key, output_histogram): + output_summary, output_orphan, output_detail, output_key, output_histogram): output_detail_file = output_files in ["all"] and output_detail is not None output_key_file = output_files in ["all"] and output_key is not None output_orphan_file = output_files in ["all", "simple_orphan"] and output_orphan is not None @@ -458,7 +456,7 @@ orphan.distance, orphan.replicate.id)) if output_histogram_file: - tmp_histogram_path = get_temporary_plot_path(plot_format) + tmp_histogram_path = get_temporary_plot_path() frequency_histogram([freq], tmp_histogram_path) shutil.move(tmp_histogram_path, output_histogram) return {'distribution': freq}