-
Notifications
You must be signed in to change notification settings - Fork 77
/
cat.py
58 lines (46 loc) · 1.63 KB
/
cat.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
52
53
54
55
56
57
58
"""concatenate signature files"""
usage="""
### `sourmash signature cat` - concatenate multiple signatures together
Concatenate signature files.
For example,
sourmash signature cat file1.sig file2.sig -o all.sig
will combine all signatures in `file1.sig` and `file2.sig` and put them
in the file `all.sig`.
"""
from sourmash.cli.utils import (add_moltype_args, add_ksize_arg,
add_picklist_args, add_pattern_args)
def subparser(subparsers):
# working on this
subparser = subparsers.add_parser('cat', description=__doc__, usage=usage)
subparser.add_argument('signatures', nargs='*')
subparser.add_argument(
'--from-file',
help='a text file containing a list of files to load signatures from'
)
subparser.add_argument(
'-q', '--quiet', action='store_true',
help='suppress non-error output'
)
subparser.add_argument(
'-d', '--debug', action='store_true',
help='provide debugging output'
)
subparser.add_argument(
'-o', '--output', metavar='FILE', default='-',
help='output signature to this file (default stdout)'
)
subparser.add_argument(
'-u', '--unique', action='store_true',
help='keep only distinct signatures, removing duplicates (based on md5sum)'
)
subparser.add_argument(
'-f', '--force', action='store_true',
help='try to load all files as signatures'
)
add_ksize_arg(subparser)
add_moltype_args(subparser)
add_pattern_args(subparser)
add_picklist_args(subparser)
def main(args):
import sourmash
return sourmash.sig.__main__.cat(args)