annotate hist_plot.py @ 3:bba993929f69 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
author iuc
date Mon, 14 Jun 2021 18:00:30 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
1 #!/usr/bin/env python3
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
2 # read depth histogram plot
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
3
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
4 # imported from https://github.com/dfguan/purge_dups/blob/master/scripts/hist_plot.py
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
5
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
6 import argparse
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
7
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
8 import matplotlib as mpl
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
9 import matplotlib.pyplot as plt
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
10
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
11 mpl.use("Agg")
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
12
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
13
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
14 def col_hist(stat_fn, delim):
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
15 hists = []
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
16 # we consider the coverage histogram start with 0
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
17 with open(stat_fn) as f:
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
18 for ln in f:
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
19 lnlist = ln.strip().split(delim)
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
20 hists.append(int(lnlist[1]))
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
21 return hists
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
22
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
23
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
24 def get_cutoffs(con):
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
25 if con:
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
26 lnlst = []
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
27 with open(con) as f:
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
28 lnlst = f.readline().strip().split("\t")
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
29 if len(lnlst):
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
30 return [int(lnlst[0]), int(lnlst[3]), int(lnlst[5])]
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
31 else:
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
32 return []
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
33 else:
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
34 return []
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
35
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
36
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
37 def mk_plot(hists, cutoffs, ttle, xm, xM, ym, yM, out_fl):
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
38
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
39 if ttle is None:
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
40 ttle = "read depth histogram"
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
41 if xm is None:
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
42 xm = 0
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
43 if xM is None:
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
44 xM = len(hists) - 2 # ignore the last read depth count
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
45 if ym is None:
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
46 ym = 0
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
47 if yM is None:
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
48 yM = 1.2 * max(hists)
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
49 x = [t for t in range(xm, xM)]
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
50 plt.axis([xm, xM, ym, yM])
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
51 width = 8
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
52 height = 6
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
53 plt.figure(num=None, figsize=(width, height))
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
54 plt.plot(x, hists[xm:xM], label="l", color="blue") #
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
55 plt.xticks([z for z in range(xm, xM, 10)], fontsize=3)
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
56 # cutoffs
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
57 colors = ["r", "g", "c"]
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
58 if len(cutoffs):
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
59 for i in range(len(cutoffs)):
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
60 plt.text(cutoffs[i], 0, str(cutoffs[i]), fontsize=5, color=colors[i])
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
61 plt.axvline(x=cutoffs[i], linewidth=1, color=colors[i])
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
62
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
63 plt.title(ttle)
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
64 plt.gca().xaxis.grid(True, color="black", alpha=0.2)
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
65
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
66 # plt.grid(True, color="black", alpha=0.2)
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
67 # plt.gca().get_legend().remove()
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
68
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
69 plt.tight_layout()
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
70 plt.savefig(out_fl, dpi=300)
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
71
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
72
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
73 if __name__ == "__main__":
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
74 parser = argparse.ArgumentParser(description="read depth histogram plot")
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
75
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
76 parser.add_argument(
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
77 "-c",
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
78 "--cutoffs",
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
79 type=str,
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
80 action="store",
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
81 dest="con",
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
82 help="read depth cutoffs",
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
83 )
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
84 parser.add_argument(
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
85 "-y", "--ymin", type=int, action="store", dest="ymin", help="set ymin"
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
86 )
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
87 parser.add_argument(
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
88 "-x", "--xmin", type=int, action="store", dest="xmin", help="set xmin"
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
89 )
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
90 parser.add_argument(
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
91 "-Y", "--ymax", type=int, action="store", dest="ymax", help="set ymax"
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
92 )
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
93 parser.add_argument(
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
94 "-X", "--xmax", type=int, action="store", dest="xmax", help="set xmax"
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
95 )
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
96 parser.add_argument(
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
97 "-t",
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
98 "--title",
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
99 type=str,
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
100 action="store",
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
101 dest="title",
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
102 help="figure title [NULL]",
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
103 default="",
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
104 )
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
105 parser.add_argument(
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
106 "-d",
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
107 "--delim",
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
108 type=str,
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
109 action="store",
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
110 dest="delim",
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
111 help="delimiter",
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
112 default="\t",
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
113 )
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
114 parser.add_argument("-v", "--version", action="version", version="hist_plot 0.0.0")
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
115 parser.add_argument("stat_fn", type=str, action="store", help="stat file")
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
116 parser.add_argument("out_fn", type=str, action="store", help="output file")
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
117 opts = parser.parse_args()
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
118 hists = col_hist(opts.stat_fn, opts.delim)
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
119 cutoffs = get_cutoffs(opts.con)
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
120 mk_plot(
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
121 hists,
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
122 cutoffs,
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
123 opts.title,
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
124 opts.xmin,
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
125 opts.xmax,
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
126 opts.ymin,
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
127 opts.ymax,
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
128 opts.out_fn,
bba993929f69 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
129 )