-
Notifications
You must be signed in to change notification settings - Fork 76
/
collect.py
62 lines (50 loc) · 2.01 KB
/
collect.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
59
60
61
62
"""collect manifest information across many files"""
usage="""
sourmash sig collect <filenames> -o all.sqlmf
This will collect manifests from across many files and save the information
into a standalone manifest database.
By default, 'sig collect' requires a pre-existing manifest for collections;
this prevents potentially slow manifest rebuilding. You
can turn this check off with '--no-require-manifest'.
"""
from sourmash.cli.utils import (add_moltype_args, add_ksize_arg,
add_picklist_args, add_pattern_args)
def subparser(subparsers):
subparser = subparsers.add_parser('collect', usage=usage)
subparser.add_argument('locations', nargs='*',
help='locations of input signatures')
subparser.add_argument('-o', '--output', help='manifest output file',
required=True)
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(
'--from-file',
help='a text file containing a list of files to load signatures from'
)
subparser.add_argument(
'--no-require-manifest',
help='do not require a manifest; generate dynamically if needed',
action='store_true'
)
subparser.add_argument(
'-F', '--manifest-format',
help="format of manifest output file; default is 'csv')",
default='sql',
choices=['csv', 'sql'],
)
subparser.add_argument('--merge-previous', action='store_true',
help='merge new manifests into existing')
subparser.add_argument('--abspath',
help="convert all locations to absolute paths",
action='store_true')
add_ksize_arg(subparser, 31)
add_moltype_args(subparser)
def main(args):
import sourmash
return sourmash.sig.__main__.collect(args)