Mercurial > repos > iuc > cwpair2
changeset 2:abc464ca7260 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/cwpair2 commit 0e7c1b37cf73425c6637b4e196fdeb290e042bc1
author | iuc |
---|---|
date | Tue, 26 Jul 2016 06:06:17 -0400 |
parents | d4db13c9dd7f |
children | 436dc65bd902 |
files | cwpair2.xml cwpair2_util.py cwpair2_util.pyc test-data/closest_f_output2.pdf test-data/largest_f_output2.pdf test-data/magic.pdf test-data/mode_c_output2.pdf test-data/mode_f_output2.pdf test-data/mode_p_output2.pdf tool_dependencies.xml |
diffstat | 10 files changed, 28 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- a/cwpair2.xml Wed Dec 23 09:26:01 2015 -0500 +++ b/cwpair2.xml Tue Jul 26 06:06:17 2016 -0400 @@ -85,9 +85,9 @@ <param name="output_files" value="matched_pair" /> <output name="statistics_output" file="statistics1.tabular" ftype="tabular" /> <output_collection name="MP" type="list"> - <element name="f0u25d100_on_data_1" file="closest_mp_output1.gff" ftype="gff" compare="contains"/> - <element name="f0u25d100_on_data_1" file="largest_mp_output1.gff" ftype="gff" compare="contains"/> - <element name="f0u25d100_on_data_1" file="mode_mp_output1.gff" ftype="gff" compare="contains"/> + <element name="data_MP_closest_f0u25d100_on_data_1.gff" file="closest_mp_output1.gff" ftype="gff" compare="contains"/> + <element name="data_MP_largest_f0u25d100_on_data_1.gff" file="largest_mp_output1.gff" ftype="gff" compare="contains"/> + <element name="data_MP_mode_f0u25d100_on_data_1.gff" file="mode_mp_output1.gff" ftype="gff" compare="contains"/> </output_collection> </test> <test> @@ -101,26 +101,26 @@ <param name="output_files" value="all" /> <output name="statistics_output" file="statistics2.tabular" ftype="tabular" /> <output_collection name="H" type="list"> - <element name="histogram_C_mode_f0u50d100_on_data_1" file="mode_c_output2.pdf" ftype="pdf" compare="contains" lines_diff="12"/> - <element name="histogram_F_closest_f0u50d100_on_data_1" file="closest_f_output2.pdf" ftype="pdf" compare="contains" lines_diff="12"/> - <element name="histogram_F_largest_f0u50d100_on_data_1" file="largest_f_output2.pdf" ftype="pdf" compare="contains" lines_diff="12"/> - <element name="histogram_F_mode_f0u50d100_on_data_1" file="mode_f_output2.pdf" ftype="pdf" compare="contains" lines_diff="12"/> - <element name="histogram_P_mode_f0u50d100_on_data_1" file="mode_p_output2.pdf" ftype="pdf" compare="contains" lines_diff="12"/> + <element name="histogram_C_mode_f0u50d100_on_data_1.pdf" file="magic.pdf" ftype="pdf" compare="contains" /> + <element name="histogram_F_closest_f0u50d100_on_data_1.pdf" file="magic.pdf" ftype="pdf" compare="contains" /> + <element name="histogram_F_largest_f0u50d100_on_data_1.pdf" file="magic.pdf" ftype="pdf" compare="contains" /> + <element name="histogram_F_mode_f0u50d100_on_data_1.pdf" file="magic.pdf" ftype="pdf" compare="contains" /> + <element name="histogram_P_mode_f0u50d100_on_data_1.pdf" file="magic.pdf" ftype="pdf" compare="contains" /> </output_collection> <output_collection name="D" type="list"> - <element name="data_D_closest_f0u50d100_on_data_1" file="closest_d_output2.tabular" ftype="tabular" compare="comntains"/> - <element name="data_D_largest_f0u50d100_on_data_1" file="largest_d_output2.tabular" ftype="tabular" compare="contains"/> - <element name="data_D_mode_f0u50d100_on_data_1" file="mode_d_output2.tabular" ftype="tabular" compare="contains"/> + <element name="data_D_closest_f0u50d100_on_data_1.tabular" file="closest_d_output2.tabular" ftype="tabular" compare="contains"/> + <element name="data_D_largest_f0u50d100_on_data_1.tabular" file="largest_d_output2.tabular" ftype="tabular" compare="contains"/> + <element name="data_D_mode_f0u50d100_on_data_1.tabular" file="mode_d_output2.tabular" ftype="tabular" compare="contains"/> </output_collection> <output_collection name="O" type="list"> - <element name="data_O_closest_f0u50d100_on_data_1" file="closest_o_output2.tabular" ftype="tabular" compare="contains"/> - <element name="data_O_largest_f0u50d100_on_data_1" file="largest_o_output2.tabular" ftype="tabular" compare="contains"/> - <element name="data_O_mode_f0u50d100_on_data_1" file="mode_o_output2.tabular" ftype="tabular" compare="contains"/> + <element name="data_O_closest_f0u50d100_on_data_1.tabular" file="closest_o_output2.tabular" ftype="tabular" compare="contains"/> + <element name="data_O_largest_f0u50d100_on_data_1.tabular" file="largest_o_output2.tabular" ftype="tabular" compare="contains"/> + <element name="data_O_mode_f0u50d100_on_data_1.tabular" file="mode_o_output2.tabular" ftype="tabular" compare="contains"/> </output_collection> <output_collection name="MP" type="list"> - <element name="data_MP_closest_f0u50d100_on_data_1" file="closest_mp_output2.gff" ftype="gff" compare="contains"/> - <element name="data_MP_largest_f0u50d100_on_data_1" file="largest_mp_output2.gff" ftype="gff" compare="contains"/> - <element name="data_MP_mode_f0u50d100_on_data_1" file="mode_mp_output2.gff" ftype="gff" compare="contains"/> + <element name="data_MP_closest_f0u50d100_on_data_1.gff" file="closest_mp_output2.gff" ftype="gff" compare="contains"/> + <element name="data_MP_largest_f0u50d100_on_data_1.gff" file="largest_mp_output2.gff" ftype="gff" compare="contains"/> + <element name="data_MP_mode_f0u50d100_on_data_1.gff" file="mode_mp_output2.gff" ftype="gff" compare="contains"/> </output_collection> </test> </tests>
--- a/cwpair2_util.py Wed Dec 23 09:26:01 2015 -0500 +++ b/cwpair2_util.py Tue Jul 26 06:06:17 2016 -0400 @@ -3,9 +3,10 @@ import os import sys import traceback + import matplotlib matplotlib.use('Agg') -from matplotlib import pyplot +from matplotlib import pyplot # noqa: E402 # Data outputs DETAILS = 'D' @@ -47,7 +48,7 @@ """ Returns the bin in which a data point falls """ - return self.start + (x-self.start) // self.binsize * self.binsize + self.binsize/2.0 + return self.start + (x - self.start) // self.binsize * self.binsize + self.binsize / 2.0 def add(self, x): x = self.get_bin(x) @@ -75,7 +76,7 @@ def distance(peak1, peak2): - return (peak2[1]+peak2[2])/2 - (peak1[1]+peak1[2])/2 + return (peak2[1] + peak2[2]) / 2 - (peak1[1] + peak1[2]) / 2 def gff_row(cname, start, end, score, source, type='.', strand='.', phase='.', attrs={}): @@ -114,7 +115,7 @@ values.append(peak[3]) values.sort() # Get 95% value - return values[int(len(values)*0.95)] + return values[int(len(values) * 0.95)] def filter(chromosomes, threshold=0.05): @@ -149,7 +150,7 @@ def make_keys(crick): - return [(data[1] + data[2])//2 for data in crick] + return [(data[1] + data[2]) // 2 for data in crick] def get_window(crick, peak, up_distance, down_distance, keys=None): @@ -190,7 +191,7 @@ def match_mode(window, peak, mode): if not window: return None - return min(window, key=lambda cpeak: abs(distance(peak, cpeak)-mode)) + return min(window, key=lambda cpeak: abs(distance(peak, cpeak) - mode)) METHODS = {'mode': match_mode, 'closest': match_closest, 'largest': match_largest} @@ -351,9 +352,9 @@ match[2], match[3], '-', midpoint, - peak[3]+match[3], + peak[3] + match[3], d)) - i = bisect.bisect_left(keys, (match[1]+match[2])/2) + i = bisect.bisect_left(keys, (match[1] + match[2]) / 2) del crick[i] del keys[i] else:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/magic.pdf Tue Jul 26 06:06:17 2016 -0400 @@ -0,0 +1,1 @@ +%PDF-
--- a/tool_dependencies.xml Wed Dec 23 09:26:01 2015 -0500 +++ b/tool_dependencies.xml Tue Jul 26 06:06:17 2016 -0400 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <tool_dependency> <package name="anaconda" version="2.3.0"> - <repository changeset_revision="94d978ebbfd4" name="package_anaconda_2_3_0" owner="iuc" prior_installation_required="True" toolshed="https://toolshed.g2.bx.psu.edu" /> + <repository changeset_revision="94d978ebbfd4" name="package_anaconda_2_3_0" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" /> </package> </tool_dependency>