-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
152 lines (106 loc) · 3.93 KB
/
__init__.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# Copyright (c) 2022 Dr. K. D. Murray/Gekkonid Consulting <spam@gekkonid.com>
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from sys import argv, exit, stderr
__version__ = "0.4.4"
cmds = {}
from .telogrep import telogrep_main
cmds["telogrep"] = telogrep_main
from .n50 import n50_main
cmds["n50"] = n50_main
from .falen import falen_main
cmds["falen"] = falen_main
from .mask2bed import mask2bed_main
cmds["mask2bed"] = mask2bed_main
from .pansn_rename import main as pansn_rename_main
cmds["pansn-rename"] = pansn_rename_main
from .genigvjs import genigvjs_main
cmds["genigvjs"] = genigvjs_main
from .ildemux import main as ildemux_main
cmds["ildemux"] = ildemux_main
from .ilsample import main as ilsample_main
cmds["ilsample"] = ilsample_main
from .regionbed import main as regionbed_main
cmds["regionbed"] = regionbed_main
from .uniref_accessionmap import main as uniref_main
cmds["uniref-acc2taxid"] = uniref_main
from .nstitch import nstitch_main
cmds["nstitch"] = nstitch_main
from .gg2k import gg2k_main
cmds["gg2k"] = gg2k_main
from .equalbestblast import equalbestblast_main
cmds["equalbestblast"] = equalbestblast_main
from .tabcat import tabcat_main
cmds["tabcat"] = tabcat_main
from .esearchandfetch import main as esf_main
cmds["esearchandfetch"] = esf_main
from .deepclust2fa import deepclust2fa_main
cmds["deepclust2fa"] = deepclust2fa_main
from .farename import farename_main
cmds["farename"] = farename_main
from .gffcat import gffcat_main
cmds["gffcat"] = gffcat_main
from .gffparse import gffparse_main
cmds["gffparse"] = gffparse_main
from .gffcsqify import main as gffcsqify_main
cmds["gffcsqify"] = gffcsqify_main
from .gfftagsane import main as gfftagsane_main
cmds["gfftagsane"] = gfftagsane_main
from .genebed import main as genebed_main
cmds["genebed"] = genebed_main
from .liftoff_gff3 import liftoff_gff3_main
cmds["liftoff-gff3"] = liftoff_gff3_main
from .ebiosra2rl2s import main as rl2s_main
cmds["ebiosra2rl2s"] = rl2s_main
from .galhist import main as galhist_main
cmds["galhist"] = galhist_main
from .pairslash import main as pairslash_main
cmds["pairslash"] = pairslash_main
from .pairs import main as pairs_main
cmds["pairs"] = pairs_main
from .fqstat import main as fqstat_main
cmds["fqstat"] = fqstat_main
try:
from .vcfstats import main as vcfstats_main
cmds["vcfstats"] = vcfstats_main
except ImportError as exc:
if len(argv) < 2:
print(str(exc), "-- disabling vcfstats command", file=stderr)
try:
from .vcfparallel import main as vcfparallel_main
cmds["vcfparallel"] = vcfparallel_main
except ImportError as exc:
if len(argv) < 2:
print(str(exc), "-- disabling vcfparallel command", file=stderr)
try:
from .vcfreport import main as vcfreport_main
cmds["vcfreport"] = vcfreport_main
except ImportError as exc:
if len(argv) < 2:
print(str(exc), "-- disabling vcfreport command", file=stderr)
from .shannon import main as shannon_main
cmds["shannon-entropy"] = shannon_main
from .fastasanitiser import main as fastasanitiser_main
cmds["fastasanitiser"] = fastasanitiser_main
from .tidyqc import main as tidyqc_main
cmds["tidyqc"] = tidyqc_main
from .jsonl2csv import main as jsonl2csv_main
cmds["jsonl2csv"] = jsonl2csv_main
def mainhelp(argv=None):
"""Print this help message"""
print("USAGE: blsl <subtool> [options...]\n\n")
print("Where <subtool> is one of:\n")
for tool, func in cmds.items():
print(" {:<19}".format(tool + ":"), " ", func.__doc__.split("\n")[0])
print("\n\nUse blsl subtool --help to get help about a specific tool")
cmds["help"] = mainhelp
def main():
if len(argv) < 2:
mainhelp()
exit(0)
if argv[1] not in cmds:
print("ERROR:", argv[1], "is not a known subtool. See help below")
mainhelp()
exit(1)
cmds[argv[1]](argv[2:])