/
plot.py
51 lines (48 loc) · 1.57 KB
/
plot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""plot distance matrix made by 'compare'"""
def subparser(subparsers):
subparser = subparsers.add_parser('plot')
subparser.add_argument(
'distances', help='output from "sourmash compare"'
)
subparser.add_argument(
'--pdf', action='store_true',
help='output PDF; default is PNG'
)
subparser.add_argument(
'--labels', action='store_true',
help='show sample labels on dendrogram/matrix'
)
subparser.add_argument(
'--labeltext',
help='filename containing list of labels (overrides signature names)'
)
subparser.add_argument(
'--indices', action='store_false',
help='show sample indices but not labels'
)
subparser.add_argument(
'--vmin', default=0.0, type=float,
help='lower limit of heatmap scale; default=%(default)f'
)
subparser.add_argument(
'--vmax', default=1.0, type=float,
help='upper limit of heatmap scale; default=%(default)f'
)
subparser.add_argument(
'--subsample', type=int, metavar='N',
help='randomly downsample to this many samples, max'
)
subparser.add_argument(
'--subsample-seed', type=int, default=1, metavar='S',
help='random seed for --subsample; default=1'
)
subparser.add_argument(
'-f', '--force', action='store_true',
help='forcibly plot non-distance matrices'
)
subparser.add_argument(
'--output-dir', metavar='DIR', help='directory for output plots'
)
def main(args):
import sourmash
return sourmash.commands.plot(args)