bobeobibo / phigaro

Phigaro is a scalable command-line tool for predicting phages and prophages
MIT License
46 stars 15 forks source link

Fix output path when not in the form -o dir/file #15

Closed chris-rands closed 4 years ago

chris-rands commented 4 years ago

Previously, the output file had to be specified in the form-o dir/file otherwise you got an error:

$ phigaro -f test_data/Bacillus_anthracis_str_ames.fna -o test -p --not-open
Traceback (most recent call last):
  File "/home/rands/miniconda3/envs/phigaro_env/bin/phigaro", line 8, in <module>
    sys.exit(main())
  File "/home/rands/miniconda3/envs/phigaro_env/lib/python3.7/site-packages/phigaro/cli/batch.py", line 126, in main
    os.mkdir(fold)
FileNotFoundError: [Errno 2] No such file or directory: ''

This fixes it for the case where only the file is specified, e.g. -o test or when there are multiple directories, e.g. -o dir/subdir/test