run_resfinder.py errors with no arguments
The new-user experience could be improved.
Using resfinder 4.1.6 on Linux:
$ python run_resfinder.py
Traceback (most recent call last):
File "run_resfinder.py", line 197, in <module>
sample_name = os.path.basename(args.inputfastq[0])
TypeError: 'NoneType' object is not subscriptable
Or:
$ ./run_resfinder.py
Traceback (most recent call last):
File "./run_resfinder.py", line 197, in <module>
sample_name = os.path.basename(args.inputfastq[0])
TypeError: 'NoneType' object is not subscriptable
It would be sensible to just show the help text if no arguments are given, or version information, or at least a short message suggest running with -h instead.
Comments (5)
-
-
reporter I see the change made in 7c26c8dee4b2736883d880ab625807d784638373 but that looks wrong - n Python ``A or B is None`` means ``A or (B is None)`` not ``(A is None) or (B is None)``.
$ python3 run_resfinder.py -ifa example.fasta ERROR: No input file given. Please provide path(s) to input file(s) either using --inputfasta or --inputfastq.
Also comparing the arguments to None is unusual style, perhaps just evaluating as a boolean would suffice, as in
if not (args.inputfasta or args.inputfastq):
-
Thank you for your input. It has now been changed.
Best,
Karen, CGE Helpdesk -
reporter Confirmed, b720ed1669a53add4419dffd943a751c46bebd26 fixed this - which I see you have tagged as v4.1.10
-
reporter - changed status to resolved
- Log in to comment
Dear Peter,
Thank you for your interest in ResFinder.
The latest ResFinder version (4.1.9) prints the relevant arguments to add to the command line if no input files are given.
Best,
Karen, CGE Helpdesk