WrightonLabCSU / DRAM

Distilled and Refined Annotation of Metabolism: A tool for the annotation and curation of function for microbial and viral genomes
GNU General Public License v3.0
239 stars 50 forks source link

-o option should have argument `required=True` #213

Closed cmkobel closed 1 year ago

cmkobel commented 1 year ago

https://github.com/WrightonLabCSU/DRAM/blob/a5f225718c5ff312ec8ccaefbb61daaa12452705/scripts/DRAM.py#L35

Shouldn't the -o 'output' option be required? If I omit it an exception is thrown because the default -o parameter is NoneType

(DRAM) cmkobel@login-5 ~/userwork/dram $ DRAM.py annotate -i ../assemblycomparator2/tests/E._faecium/116_2.fna                                      
1 fastas found
2022-09-08 06:30:31.400566: Annotation started
Traceback (most recent call last):
  File "/cluster/work/users/cmkobel/miniconda3/envs/DRAM/bin/DRAM.py", line 189, in <module>
    args.func(**args_dict)
  File "/cluster/work/users/cmkobel/miniconda3/envs/DRAM/lib/python3.10/site-packages/mag_annotator/annotate_bins.py", line 1040, in annotate_bins_cmd
    annotate_bins(list(set(fasta_locs)), output_dir, min_contig_size, prodigal_mode, trans_table, bit_score_threshold,
  File "/cluster/work/users/cmkobel/miniconda3/envs/DRAM/lib/python3.10/site-packages/mag_annotator/annotate_bins.py", line 1077, in annotate_bins
    mkdir(output_dir)
TypeError: mkdir: path should be string, bytes or os.PathLike, not NoneType

A quick fix would be to simply add required=True to the annotate_parser.add_argument-call A different fix would be to add a default value, but that might raise problems if the user is rerunning the DRAM call.

rmFlynn commented 1 year ago

Will do in the next release

rmFlynn commented 1 year ago

Did this