annotate hist_plot.py @ 5:e9bd16ba5ebd draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit a272692329ad5a5c9062ec7450e73e3fdd9447e3
author iuc
date Mon, 06 Jun 2022 07:49:11 +0000
parents 76d4cbefff85
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
76d4cbefff85 "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
76d4cbefff85 "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
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
3
76d4cbefff85 "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
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
5
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
6 import argparse
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
7
76d4cbefff85 "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
76d4cbefff85 "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
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
10
76d4cbefff85 "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")
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
12
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
13
76d4cbefff85 "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):
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
15 hists = []
76d4cbefff85 "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
76d4cbefff85 "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:
76d4cbefff85 "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:
76d4cbefff85 "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)
76d4cbefff85 "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]))
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
21 return hists
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
22
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
23
76d4cbefff85 "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):
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
25 if con:
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
26 lnlst = []
76d4cbefff85 "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:
76d4cbefff85 "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")
76d4cbefff85 "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):
76d4cbefff85 "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])]
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
31 else:
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
32 return []
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
33 else:
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
34 return []
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
35
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
36
76d4cbefff85 "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):
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
38
76d4cbefff85 "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:
76d4cbefff85 "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"
76d4cbefff85 "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:
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
42 xm = 0
76d4cbefff85 "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:
76d4cbefff85 "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
76d4cbefff85 "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:
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
46 ym = 0
76d4cbefff85 "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:
76d4cbefff85 "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)
76d4cbefff85 "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)]
76d4cbefff85 "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])
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
51 width = 8
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
52 height = 6
76d4cbefff85 "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))
76d4cbefff85 "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") #
76d4cbefff85 "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)
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
56 # cutoffs
76d4cbefff85 "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"]
76d4cbefff85 "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):
76d4cbefff85 "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)):
76d4cbefff85 "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])
76d4cbefff85 "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])
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
62
76d4cbefff85 "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)
76d4cbefff85 "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)
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
65
76d4cbefff85 "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)
76d4cbefff85 "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()
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
68
76d4cbefff85 "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()
76d4cbefff85 "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)
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
71
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
72
76d4cbefff85 "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__":
76d4cbefff85 "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")
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
75
76d4cbefff85 "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(
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
77 "-c",
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
78 "--cutoffs",
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
79 type=str,
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
80 action="store",
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
81 dest="con",
76d4cbefff85 "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",
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
83 )
76d4cbefff85 "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(
76d4cbefff85 "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"
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
86 )
76d4cbefff85 "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(
76d4cbefff85 "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"
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
89 )
76d4cbefff85 "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(
76d4cbefff85 "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"
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
92 )
76d4cbefff85 "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(
76d4cbefff85 "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"
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
95 )
76d4cbefff85 "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(
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
97 "-t",
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
98 "--title",
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
99 type=str,
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
100 action="store",
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
101 dest="title",
76d4cbefff85 "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]",
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
103 default="",
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
104 )
76d4cbefff85 "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(
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
106 "-d",
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
107 "--delim",
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
108 type=str,
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
109 action="store",
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
110 dest="delim",
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
111 help="delimiter",
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
112 default="\t",
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
113 )
76d4cbefff85 "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")
76d4cbefff85 "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")
76d4cbefff85 "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")
76d4cbefff85 "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()
76d4cbefff85 "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)
76d4cbefff85 "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)
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
120 mk_plot(
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
121 hists,
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
122 cutoffs,
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
123 opts.title,
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
124 opts.xmin,
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
125 opts.xmax,
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
126 opts.ymin,
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
127 opts.ymax,
76d4cbefff85 "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,
76d4cbefff85 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/purge_dups commit 5d56aa02b0f905507e1d98a2d74f0629b7591cd3"
iuc
parents:
diff changeset
129 )