FunVIP 0.3.20__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- FunVIP-0.3.20.dist-info/LICENSE +674 -0
- FunVIP-0.3.20.dist-info/METADATA +32 -0
- FunVIP-0.3.20.dist-info/RECORD +36 -0
- FunVIP-0.3.20.dist-info/WHEEL +5 -0
- FunVIP-0.3.20.dist-info/entry_points.txt +3 -0
- FunVIP-0.3.20.dist-info/top_level.txt +3 -0
- data/__init__.py +0 -0
- external/BLAST_Windows/bin/cleanup-blastdb-volumes.py +162 -0
- external/__init__.py +0 -0
- src/__init__.py +0 -0
- src/align.py +124 -0
- src/cluster.py +510 -0
- src/command.py +360 -0
- src/concatenate.py +356 -0
- src/dataset.py +716 -0
- src/ext.py +448 -0
- src/hasher.py +98 -0
- src/initialize.py +335 -0
- src/logger.py +69 -0
- src/logics.py +104 -0
- src/modeltest.py +443 -0
- src/ncbi.py +160 -0
- src/opt_generator.py +72 -0
- src/patch.py +261 -0
- src/reporter.py +875 -0
- src/save.py +181 -0
- src/search.py +440 -0
- src/tool.py +309 -0
- src/tree.py +222 -0
- src/tree_interpretation.py +1379 -0
- src/tree_interpretation_pipe.py +679 -0
- src/trim.py +118 -0
- src/validate_input.py +846 -0
- src/validate_option.py +1609 -0
- src/validation.py +38 -0
- src/version.py +337 -0
src/command.py
ADDED
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
# FunVIP_dev/FunVIP/src/command.py
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
from importlib.metadata import version
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class CommandParser:
|
|
8
|
+
def __init__(self) -> None:
|
|
9
|
+
self.parser = argparse.ArgumentParser(
|
|
10
|
+
description="Fungal Validation & Identification Pipeline", prog="FunVIP"
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
def get_args(self) -> argparse.Namespace:
|
|
14
|
+
# Mandatory options
|
|
15
|
+
group_required = self.parser.add_argument_group(
|
|
16
|
+
title="required", description="Main options"
|
|
17
|
+
)
|
|
18
|
+
group_required.add_argument(
|
|
19
|
+
"--query",
|
|
20
|
+
"-q",
|
|
21
|
+
nargs="*",
|
|
22
|
+
help="Query fasta or table files, delimitated by space",
|
|
23
|
+
type=str,
|
|
24
|
+
)
|
|
25
|
+
group_required.add_argument(
|
|
26
|
+
"--db",
|
|
27
|
+
"-d",
|
|
28
|
+
nargs="+",
|
|
29
|
+
help="Database table files, delimitated by space",
|
|
30
|
+
type=str,
|
|
31
|
+
)
|
|
32
|
+
group_required.add_argument(
|
|
33
|
+
"--gene", "-g", nargs="*", help="Gene names to be analyzed", type=str
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
# Mandatory when NCBI download - raise Exception when manage input
|
|
37
|
+
group_ncbi = self.parser.add_mutually_exclusive_group(required=False)
|
|
38
|
+
group_ncbi.add_argument(
|
|
39
|
+
"--email",
|
|
40
|
+
"-e",
|
|
41
|
+
help="E-mail notation to download data from GenBank",
|
|
42
|
+
type=str,
|
|
43
|
+
)
|
|
44
|
+
group_ncbi.add_argument(
|
|
45
|
+
"--api",
|
|
46
|
+
"-a",
|
|
47
|
+
help="NCBI API strings to download data from GenBank",
|
|
48
|
+
type=str,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
# Test settings
|
|
52
|
+
group_test = self.parser.add_argument_group(
|
|
53
|
+
title="test", description="Test run setups"
|
|
54
|
+
)
|
|
55
|
+
group_test.add_argument(
|
|
56
|
+
"--test",
|
|
57
|
+
help="Use test dataset, [Penicillium]",
|
|
58
|
+
type=str,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
# Running options
|
|
62
|
+
group_run = self.parser.add_argument_group(
|
|
63
|
+
title="run", description="Running options"
|
|
64
|
+
)
|
|
65
|
+
group_run.add_argument(
|
|
66
|
+
"--thread",
|
|
67
|
+
"-t",
|
|
68
|
+
help="Threads to be used for pipeline, default : system maximum",
|
|
69
|
+
type=int,
|
|
70
|
+
)
|
|
71
|
+
group_run.add_argument(
|
|
72
|
+
"--memory",
|
|
73
|
+
"-m",
|
|
74
|
+
help="Max memory limit in 'nG' form, ex: '16G', should be more than 4G, default : system maximum",
|
|
75
|
+
type=str,
|
|
76
|
+
)
|
|
77
|
+
group_run.add_argument(
|
|
78
|
+
"--outdir", help="Out file location, default : current directory", type=str
|
|
79
|
+
)
|
|
80
|
+
group_run.add_argument(
|
|
81
|
+
"--runname",
|
|
82
|
+
help="Name prefix to current run : default : current timestamp",
|
|
83
|
+
type=str,
|
|
84
|
+
)
|
|
85
|
+
group_run.add_argument(
|
|
86
|
+
"--mode",
|
|
87
|
+
help="Mode setup in species identification, see documents for detailed explanations, [validation, identification] default : validation",
|
|
88
|
+
type=str,
|
|
89
|
+
)
|
|
90
|
+
group_run.add_argument(
|
|
91
|
+
"--continue",
|
|
92
|
+
dest="continue_from_previous",
|
|
93
|
+
action="store_true",
|
|
94
|
+
help="Continue from previous run",
|
|
95
|
+
)
|
|
96
|
+
group_run.add_argument(
|
|
97
|
+
"--step",
|
|
98
|
+
help="[WIP] Steps to continue from previous run, will be ignored if invalid --continue option [setup, search, cluster, align, trim, concatenate, modeltest, tree, visualize, report]",
|
|
99
|
+
type=str,
|
|
100
|
+
)
|
|
101
|
+
group_run.add_argument(
|
|
102
|
+
"--level",
|
|
103
|
+
help="Taxonomic level for each phylogenetic tree. Should be one of [subseries, series, subsection, section, subtribe, tribe, subfamily, family, suborder, order, subclass, class, subphylum, phylum, subdivision, division, subkingdom, kingdom]",
|
|
104
|
+
type=str,
|
|
105
|
+
)
|
|
106
|
+
group_run.add_argument(
|
|
107
|
+
"--all",
|
|
108
|
+
action="store_true",
|
|
109
|
+
help="Run FunVIP for all database sequences, regardless of corrresponding sequences exists in query, default : False",
|
|
110
|
+
)
|
|
111
|
+
group_run.add_argument(
|
|
112
|
+
"--confident",
|
|
113
|
+
help="Skip blast analysis among database sequences, use it when your database sequences contains large number of misidentified sequences, default : False",
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
# Method options
|
|
117
|
+
group_method = self.parser.add_argument_group(
|
|
118
|
+
title="method", description="Methods for each step of pipeline"
|
|
119
|
+
)
|
|
120
|
+
group_method.add_argument(
|
|
121
|
+
"--search",
|
|
122
|
+
help="Search methods to be used in selecting genes, groups and outgroups, [blast, mmseqs], default : mmseqs",
|
|
123
|
+
type=str,
|
|
124
|
+
)
|
|
125
|
+
group_method.add_argument(
|
|
126
|
+
"--alignment",
|
|
127
|
+
help="Multiple sequence alignment methods, [mafft], default : mafft",
|
|
128
|
+
type=str,
|
|
129
|
+
)
|
|
130
|
+
group_method.add_argument(
|
|
131
|
+
"--trim",
|
|
132
|
+
help="Trimming methods, [trimal, gblocks, none], default : trimal",
|
|
133
|
+
type=str,
|
|
134
|
+
)
|
|
135
|
+
group_method.add_argument(
|
|
136
|
+
"--modeltest",
|
|
137
|
+
help="Model test methods, [iqtree, modeltestng, none], default : none",
|
|
138
|
+
type=str,
|
|
139
|
+
)
|
|
140
|
+
group_method.add_argument(
|
|
141
|
+
"--tree",
|
|
142
|
+
help="Tree methods to build phylogenetic tree, [fasttree, iqtree, raxml], default : fasttree",
|
|
143
|
+
type=str,
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
# Visualize
|
|
147
|
+
group_visualize = self.parser.add_argument_group(
|
|
148
|
+
title="visualize",
|
|
149
|
+
description="Visualization options for drawing phylogenetic tree",
|
|
150
|
+
)
|
|
151
|
+
group_visualize.add_argument(
|
|
152
|
+
"--bscutoff",
|
|
153
|
+
help="Bootstrap cutoff for visualize, default : 70",
|
|
154
|
+
type=int,
|
|
155
|
+
)
|
|
156
|
+
group_visualize.add_argument(
|
|
157
|
+
"--highlight",
|
|
158
|
+
help="Color to highlight query sequences in tree visualization. Either in html svg recognizable string or hex code, default: #AA0000",
|
|
159
|
+
type=str,
|
|
160
|
+
)
|
|
161
|
+
group_visualize.add_argument(
|
|
162
|
+
"--heightmultiplier",
|
|
163
|
+
help="Height multiplier in drawing collapsing nodes. Change it if you want to show collapse node more or less expanded. Default: 6",
|
|
164
|
+
type=float,
|
|
165
|
+
)
|
|
166
|
+
group_visualize.add_argument(
|
|
167
|
+
"--maxwordlength",
|
|
168
|
+
help="Maximum letters to be shown in single line of tree annotation. Default: 48",
|
|
169
|
+
type=int,
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
group_visualize.add_argument(
|
|
173
|
+
"--backgroundcolor",
|
|
174
|
+
help='List of background colors to be shown in tree, default: #f4f4f4, #c6c6c6. Input should be used with quotes, delimit with spaces and recommended to be used as hex codes. To remove background, use --backgroundcolor "#FFFFFF" "#FFFFFF" ',
|
|
175
|
+
nargs="*",
|
|
176
|
+
type=str,
|
|
177
|
+
)
|
|
178
|
+
group_visualize.add_argument(
|
|
179
|
+
"--outgroupcolor",
|
|
180
|
+
help="Background colors to indicate outgroup, default: #999999",
|
|
181
|
+
type=str,
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
group_visualize.add_argument(
|
|
185
|
+
"--ftype",
|
|
186
|
+
help="Font to use for phylogenetic tree, default: Arial",
|
|
187
|
+
type=str,
|
|
188
|
+
)
|
|
189
|
+
group_visualize.add_argument(
|
|
190
|
+
"--fsize",
|
|
191
|
+
help="Font size to use for phylogenetic tree, default: 10",
|
|
192
|
+
type=float,
|
|
193
|
+
)
|
|
194
|
+
group_visualize.add_argument(
|
|
195
|
+
"--fsize_bootstrap",
|
|
196
|
+
help="Font size to use for bootstrap support in phylogenetic tree, default: 9",
|
|
197
|
+
type=float,
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
# Advanced
|
|
201
|
+
group_advanced = self.parser.add_argument_group(
|
|
202
|
+
title="advanced", description="Advanced options for minor controls"
|
|
203
|
+
)
|
|
204
|
+
group_advanced.add_argument(
|
|
205
|
+
"--verbose",
|
|
206
|
+
"-v",
|
|
207
|
+
help="Verbosity level, 0: quiet, 1: info, 2: warning, 3: debug, default : 2",
|
|
208
|
+
type=int,
|
|
209
|
+
)
|
|
210
|
+
group_run.add_argument(
|
|
211
|
+
"--maxoutgroup",
|
|
212
|
+
help="Maximum outgroup numbers to include in phylogenetic analysis, default : 1",
|
|
213
|
+
)
|
|
214
|
+
group_advanced.add_argument(
|
|
215
|
+
"--collapsedistcutoff",
|
|
216
|
+
help="Maximum tree distance to be considered as same species, default : 0.01",
|
|
217
|
+
type=float,
|
|
218
|
+
)
|
|
219
|
+
group_advanced.add_argument(
|
|
220
|
+
"--collapsebscutoff",
|
|
221
|
+
help="Minimum bootstrap to be considered as same species, default : 100",
|
|
222
|
+
type=float,
|
|
223
|
+
)
|
|
224
|
+
group_advanced.add_argument(
|
|
225
|
+
"--bootstrap",
|
|
226
|
+
help="Boostrap number for tree analysis, will be ignored if fasttree is selected for tree method, default : 1000",
|
|
227
|
+
type=int,
|
|
228
|
+
)
|
|
229
|
+
group_advanced.add_argument(
|
|
230
|
+
"--solveflat",
|
|
231
|
+
action="store_true",
|
|
232
|
+
help="Whether to automatically detect 0 length branch and automatically solve them, default : True",
|
|
233
|
+
)
|
|
234
|
+
group_advanced.add_argument(
|
|
235
|
+
"--regex",
|
|
236
|
+
nargs="*",
|
|
237
|
+
help="Regex groups to parse strain numbers from your input. Maybe useful if your sequence descriptions are dirty. See documentation",
|
|
238
|
+
type=str,
|
|
239
|
+
)
|
|
240
|
+
|
|
241
|
+
group_advanced.add_argument(
|
|
242
|
+
"--cluster-cutoff",
|
|
243
|
+
dest="cluster_cutoff",
|
|
244
|
+
help="Minimum percent identity to be considered as same group in clustering analysis. Should be between 0 and 1, default : 0.97",
|
|
245
|
+
type=float,
|
|
246
|
+
)
|
|
247
|
+
group_advanced.add_argument(
|
|
248
|
+
"--cluster-evalue",
|
|
249
|
+
dest="cluster_evalue",
|
|
250
|
+
help="E-value cutoffs for blast/mmseqs search, default : 0.0000001",
|
|
251
|
+
type=float,
|
|
252
|
+
)
|
|
253
|
+
group_advanced.add_argument(
|
|
254
|
+
"--cluster-wordsize",
|
|
255
|
+
dest="cluster_wordsize",
|
|
256
|
+
help="Word size for blast/mmseqs search, default : 7",
|
|
257
|
+
type=int,
|
|
258
|
+
)
|
|
259
|
+
group_advanced.add_argument(
|
|
260
|
+
"--mafft-algorithm",
|
|
261
|
+
dest="mafft_algorithm",
|
|
262
|
+
help="MAFFT algorithm for alignment, see mafft documents, will be ignored if mafft not selected for alignment option, default : auto",
|
|
263
|
+
)
|
|
264
|
+
group_advanced.add_argument(
|
|
265
|
+
"--mafft-op",
|
|
266
|
+
dest="mafft_op",
|
|
267
|
+
help="MAFFT op (gap opening penalty) value, default : 1.3",
|
|
268
|
+
type=float,
|
|
269
|
+
)
|
|
270
|
+
group_advanced.add_argument(
|
|
271
|
+
"--mafft-ep",
|
|
272
|
+
dest="mafft_ep",
|
|
273
|
+
help="MAFFT ep value, default : 0.1",
|
|
274
|
+
type=float,
|
|
275
|
+
)
|
|
276
|
+
group_advanced.add_argument(
|
|
277
|
+
"--trimal-algorithm",
|
|
278
|
+
dest="trimal_algorithm",
|
|
279
|
+
help="Trimal algorithm for trimming, see trimal documents, will be ignored if trimal not selected for trimming option, default : gt",
|
|
280
|
+
)
|
|
281
|
+
group_advanced.add_argument(
|
|
282
|
+
"--trimal-gt", dest="trimal_gt", help="gt value for trimal", type=float
|
|
283
|
+
)
|
|
284
|
+
group_advanced.add_argument(
|
|
285
|
+
"--allow-innertrimming",
|
|
286
|
+
dest="allow_innertrimming",
|
|
287
|
+
help="Turn off FunVIP adjustment to not to trim inner alignment columns",
|
|
288
|
+
action="store_true",
|
|
289
|
+
)
|
|
290
|
+
group_advanced.add_argument(
|
|
291
|
+
"--criterion",
|
|
292
|
+
help="Modeltest criterion to use, either AIC, AICc or BIC",
|
|
293
|
+
type=str,
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
group_advanced.add_argument(
|
|
297
|
+
"--noavx",
|
|
298
|
+
action="store_true",
|
|
299
|
+
help="do not use AVX for RAxML, default: False",
|
|
300
|
+
)
|
|
301
|
+
group_advanced.add_argument(
|
|
302
|
+
"--outgroupoffset",
|
|
303
|
+
help="outgroupoffset value. Highering this value may select more distant outgroup, default : 20",
|
|
304
|
+
type=int,
|
|
305
|
+
)
|
|
306
|
+
|
|
307
|
+
# Cache
|
|
308
|
+
group_cache = self.parser.add_argument_group(
|
|
309
|
+
title="cache",
|
|
310
|
+
description="Save search database for faster run in next time",
|
|
311
|
+
)
|
|
312
|
+
group_cache.add_argument(
|
|
313
|
+
"--cachedb",
|
|
314
|
+
action="store_true",
|
|
315
|
+
help="Cache current search database, turn off if your database is too big for system directory, default : True",
|
|
316
|
+
)
|
|
317
|
+
group_cache.add_argument(
|
|
318
|
+
"--usecache",
|
|
319
|
+
action="store_true",
|
|
320
|
+
help="Use cached search database, turn off if your cached database makes error, default : True",
|
|
321
|
+
)
|
|
322
|
+
|
|
323
|
+
# Save
|
|
324
|
+
group_save = self.parser.add_argument_group(
|
|
325
|
+
title="save", description="Run saving options"
|
|
326
|
+
)
|
|
327
|
+
# Compatibility test required for this one
|
|
328
|
+
"""
|
|
329
|
+
group_save.add_argument(
|
|
330
|
+
"--tableformat",
|
|
331
|
+
help="Default format for table files, [csv, xlsx, parquet, feather], default : csv",
|
|
332
|
+
)
|
|
333
|
+
"""
|
|
334
|
+
group_save.add_argument(
|
|
335
|
+
"--tableformat",
|
|
336
|
+
help="Default format for table files, [csv, xlsx], default : csv",
|
|
337
|
+
)
|
|
338
|
+
|
|
339
|
+
group_save.add_argument(
|
|
340
|
+
"--nosearchresult",
|
|
341
|
+
action="store_true",
|
|
342
|
+
help="Do not save blast/mmseqs search matrix, use when dataset gets too big and generates IO bottleneck",
|
|
343
|
+
)
|
|
344
|
+
|
|
345
|
+
# Preset
|
|
346
|
+
group_setting = self.parser.add_argument_group(
|
|
347
|
+
title="setting", description="Presets for one-step settings"
|
|
348
|
+
)
|
|
349
|
+
group_setting.add_argument(
|
|
350
|
+
"--preset",
|
|
351
|
+
help="[fast, accurate], or json formatted option config file. Check documentation for each preset, default : fast",
|
|
352
|
+
type=str,
|
|
353
|
+
)
|
|
354
|
+
|
|
355
|
+
# version
|
|
356
|
+
self.parser.add_argument(
|
|
357
|
+
"--version", action="version", version=f"FunVIP {version('FunVIP')}"
|
|
358
|
+
)
|
|
359
|
+
|
|
360
|
+
return self.parser.parse_args()
|