Mercurial > repos > iuc > cwpair2
comparison cwpair2_util.py @ 5:71188f3f4b76 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cwpair2 commit cb490a0eee9efc2cd6c98d5bb714b75b5894c56c
author | iuc |
---|---|
date | Mon, 06 Nov 2017 23:19:50 -0500 |
parents | 436dc65bd902 |
children | c4b926c9831c |
comparison
equal
deleted
inserted
replaced
4:d843468aeb8f | 5:71188f3f4b76 |
---|---|
4 import sys | 4 import sys |
5 import traceback | 5 import traceback |
6 | 6 |
7 import matplotlib | 7 import matplotlib |
8 matplotlib.use('Agg') | 8 matplotlib.use('Agg') |
9 from matplotlib import pyplot # noqa: E402 | 9 from matplotlib import pyplot # noqa: I202,E402 |
10 | 10 |
11 # Data outputs | 11 # Data outputs |
12 DETAILS = 'D' | 12 DETAILS = 'D' |
13 MATCHED_PAIRS = 'MP' | 13 MATCHED_PAIRS = 'MP' |
14 ORPHANS = 'O' | 14 ORPHANS = 'O' |
90 | 90 |
91 | 91 |
92 def parse_chromosomes(reader): | 92 def parse_chromosomes(reader): |
93 # This version of cwpair2 accepts only gff format as input. | 93 # This version of cwpair2 accepts only gff format as input. |
94 chromosomes = {} | 94 chromosomes = {} |
95 reader.next() | 95 next(reader) |
96 for line in reader: | 96 for line in reader: |
97 cname, junk, junk, start, end, value, strand, junk, junk = line | 97 cname, junk, junk, start, end, value, strand, junk, junk = line |
98 start = int(start) | 98 start = int(start) |
99 end = int(end) | 99 end = int(end) |
100 value = float(value) | 100 value = float(value) |
243 output_files) | 243 output_files) |
244 statistics.append(stats) | 244 statistics.append(stats) |
245 if output_files == 'all' and method == 'all': | 245 if output_files == 'all' and method == 'all': |
246 frequency_plot([s['dist'] for s in statistics], | 246 frequency_plot([s['dist'] for s in statistics], |
247 statistics[0]['graph_path'], | 247 statistics[0]['graph_path'], |
248 labels=METHODS.keys()) | 248 labels=list(METHODS.keys())) |
249 return statistics | 249 return statistics |
250 | 250 |
251 | 251 |
252 def perform_process(dataset_path, galaxy_hid, method, threshold, up_distance, | 252 def perform_process(dataset_path, galaxy_hid, method, threshold, up_distance, |
253 down_distance, binsize, output_files): | 253 down_distance, binsize, output_files): |