Open adamrp opened 11 years ago
Good catch. This is a little tricky to handle, but the way to do it would be to modify line 78 of Qiime/scripts/assign_taxonomy.py
to something like:
qiime_config_reference_seqs_fp = qiime_config['assign_taxonomy_reference_seqs_fp']
if os.path.exists(qiime_config_reference_seqs_fp):
default_reference_seqs_fp = qiime_config_reference_seqs_fp
else:
default_reference_seqs_fp = None
The issue with this is that it will be confusing if you don't know that the assign_taxonomy_reference_seqs_fp
in your qiime_config
is bad, but I guess the solution to that is that you run print_qiime_config.py -t
.
E.g., if you have in your qiime_config file:
assign_taxonomy_reference_seqs_fp some/nonexistent/file.txt
and then call assign_taxonomy.py -h (or --help), you will get this error:
Traceback (most recent call last): File "/Users/adro2179/git_repos/qiime/scripts/assign_taxonomy.py", line 305, in
main()
File "/Users/adro2179/git_repos/qiime/scripts/assign_taxonomy.py", line 157, in main
option_parser, opts, args = parse_command_line_parameters(**script_info)
File "/Users/adro2179/git_repos/pycogent/cogent/util/option_parsing.py", line 243, in parse_command_line_parameters
opts,args = parser.parse_args(command_line_args)
File "/Users/adro2179/bin/python-2.7.1-release/lib/python2.7/optparse.py", line 1378, in parse_args
values = self.get_default_values()
File "/Users/adro2179/bin/python-2.7.1-release/lib/python2.7/optparse.py", line 1323, in get_default_values
defaults[option.dest] = option.check_value(opt_str, default)
File "/Users/adro2179/bin/python-2.7.1-release/lib/python2.7/optparse.py", line 769, in check_value
return checker(self, opt, value)
File "/Users/adro2179/git_repos/pycogent/cogent/util/option_parsing.py", line 31, in check_existing_filepath
"option %s: file does not exist: %r" % (opt, value))
optparse.OptionValueError: option --id_to_taxonomy_fp: file does not exist: 'some/nonexistent/file.txt'
Whereas executing assign_taxonomy.py without _any_options kind of works, but does not print the various options.
In my opinion, the -h option should categorically not raise errors.