-
Notifications
You must be signed in to change notification settings - Fork 145
/
Copy pathanvi-gen-contigs-database
executable file
·69 lines (53 loc) · 2.75 KB
/
anvi-gen-contigs-database
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
63
64
65
66
67
68
69
#!/usr/bin/env python
# -*- coding: utf-8
import sys
import anvio
import anvio.dbops as dbops
import anvio.terminal as terminal
from anvio.errors import ConfigError, FilesNPathsError
__copyright__ = "Copyleft 2015-2024, The Anvi'o Project (http://anvio.org/)"
__credits__ = []
__license__ = "GPL 3.0"
__version__ = anvio.__version__
__authors__ = ['meren', 'ekiefl', 'ozcan']
__requires__ = ['contigs-fasta', 'external-gene-calls']
__provides__ = ['contigs-db']
__anvio_workflows__ = ['metagenomics']
__description__ = "Generate a new anvi'o contigs database"
run = terminal.Run()
progress = terminal.Progress()
@terminal.time_program
def main(args):
a = dbops.ContigsDatabase(args.output_db_path, run, progress, quiet=False, skip_init = True)
a.create(args)
if __name__ == '__main__':
from anvio.argparse import ArgumentParser
parser = ArgumentParser(description=__description__)
groupA = parser.add_argument_group('MANDATORY INPUTS', 'Things you really need to provide to be in business.')
groupA.add_argument(*anvio.A('contigs-fasta'), **anvio.K('contigs-fasta'))
groupA.add_argument(*anvio.A('project-name'), **anvio.K('project-name'))
groupB = parser.add_argument_group('PERFORMANCE', 'You have multiple cores? WELL, USE THEM MAYBE?.')
groupB.add_argument(*anvio.A('num-threads'), **anvio.K('num-threads'))
groupC = parser.add_argument_group('OPTIONAL INPUTS', 'Things you may want to tweak.')
groupC.add_argument(*anvio.A('output-db-path'), **anvio.K('output-db-path', {'default': 'CONTIGS.db'}))
groupC.add_argument(*anvio.A('db-variant'), **anvio.K('db-variant'))
groupC.add_argument(*anvio.A('description'), **anvio.K('description'))
groupC.add_argument(*anvio.A('split-length'), **anvio.K('split-length'))
groupC.add_argument(*anvio.A('skip-mindful-splitting'), **anvio.K('skip-mindful-splitting'))
groupC.add_argument(*anvio.A('kmer-size'), **anvio.K('kmer-size'))
groupD = parser.add_argument_group('GENES IN CONTIGS', 'Expert thingies.')
groupD.add_argument(*anvio.A('skip-gene-calling'), **anvio.K('skip-gene-calling'))
groupD.add_argument(*anvio.A('prodigal-single-mode'), **anvio.K('prodigal-single-mode'))
groupD.add_argument(*anvio.A('prodigal-translation-table'), **anvio.K('prodigal-translation-table'))
groupD.add_argument(*anvio.A('external-gene-calls'), **anvio.K('external-gene-calls'))
groupD.add_argument(*anvio.A('ignore-internal-stop-codons'), **anvio.K('ignore-internal-stop-codons'))
groupD.add_argument(*anvio.A('skip-predict-frame'), **anvio.K('skip-predict-frame'))
try:
args = parser.get_args(parser)
main(args)
except ConfigError as e:
print(e)
sys.exit(-1)
except FilesNPathsError as e:
print(e)
sys.exit(-2)