Usually when I run a shell command without arguments I expect it to show me all possible flags. Running bioprov kaiju
does just that:
usage: kaiju [-h] -i INPUT [-o OUTPUT_DIRECTORY] -db KAIJU_DB -no NODES -na
NAMES [--kaiju_params KAIJU_PARAMS]
[--kaiju2table_params KAIJU2TABLE_PARAMS] [-t TAG] [-v]
[-p THREADS]
kaiju: error: the following arguments are required: -i/--input, -db/--kaiju_db, -no/--nodes, -na/--names
Traceback (most recent call last):
File "/home/jvfe/miniconda3/envs/bioprov/bin/bioprov", line 7, in <module>
exec(compile(f.read(), __file__, 'exec'))
File "bioprov/bioprov", line 14, in <module>
main()
File "bioprov/bioprov.py", line 54, in main
parser.parse_options(args)
File "bioprov/workflows/wf_parser.py", line 66, in parse_options
subparsers[options.subparser_name](options)
File "bioprov/workflows/wf_parser.py", line 61, in <lambda>
"genome_annotation": lambda _options: self._genome_annotation(_options),
File "bioprov/workflows/wf_parser.py", line 33, in _genome_annotation
main.run_steps(steps)
File "bioprov/src/workflow.py", line 181, in run_steps
self.generate_sampleset()
File "bioprov/src/workflow.py", line 117, in generate_sampleset
self.sampleset = _generate_sampleset[self.input_type]()
File "bioprov/src/workflow.py", line 255, in _load_dataframe_input
assert path.isfile(input_), Warnings()["not_exist"]
File "/home/jvfe/miniconda3/envs/bioprov/lib/python3.7/genericpath.py", line 30, in isfile
st = os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
usage: genome_annotation [-h] [-i INPUT] [-c CPUS] [--verbose] [-t TAG]
[--steps STEPS]
Genome annotation with Prodigal, Prokka and the COG database.
optional arguments:
-h, --help show this help message and exit
-i INPUT, --input INPUT
Input file, may be a tab delimited file or a
directory. If a file, must contain column 'sample-id'
for sample ID and 'assembly' for files. See program
help for information. (default: None)
-c CPUS, --cpus CPUS Default is set in BioProv config (half of the CPUs).
(default: 2)
--verbose More verbose output (default: False)
-t TAG, --tag TAG A tag for the dataset (default: None)
--steps STEPS A comma-delimited string of which steps will be run in
the workflow. Possible steps: ['prodigal'] (default:
['prodigal'])
I don't know enough about argparse to think of a fix for this, though checking for len(sys.argv)
might be a possible workaround.