DRAM icon indicating copy to clipboard operation
DRAM copied to clipboard

-o option should have argument `required=True`

Open cmkobel opened this issue 3 years ago • 1 comments

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.

cmkobel avatar Sep 08 '22 04:09 cmkobel

Will do in the next release

rmFlynn avatar Sep 08 '22 14:09 rmFlynn

Did this

rmFlynn avatar Feb 03 '23 16:02 rmFlynn