bobeobibo / phigaro

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

output directory name generation :: breaks when local dir used #20

Closed EricDeveaud closed 4 years ago

EricDeveaud commented 4 years ago

Hello,

while testing phigaro-2.2.1 I encounter the following problem

[gensoft@e211aa82115c 0.2.1.8-3]$ phigaro -f ../../datas/phigaro/Bacillus_anthracis_str_ames.fna -o out.phg -p --not-open

Traceback (most recent call last):
  File "/local/gensoft2/exe/phigaro/2.2.1/bin/phigaro", line 11, in <module>
    load_entry_point('phigaro==2.2.1', 'console_scripts', 'phigaro')()
  File "/local/gensoft2/exe/phigaro/2.2.1/venv/lib/python3.8/site-packages/phigaro-2.2.1-py3.8.egg/phigaro/cli/batch.py", line 126, in main
    os.mkdir(fold)
FileNotFoundError: [Errno 2] No such file or directory: ''

problem is located in phigaro/cli/batch.py as fold is defined this way:

fold = '/'.join(config['phigaro']['output'].replace('\\', '/').split('/')[:-1])
'str_whitout_/_inside'.split('/')[:-1]) => returns empty string  

nb works with following command line.

but it is legit to name a local file without dot-slahs

regards

Eric

chris-rands commented 4 years ago

This should have been fixed in https://github.com/bobeobibo/phigaro/pull/15

@PollyTikhonova @bobeobibo can it be updated on PyPI (i.e. bump the version) so the fix is available for people doing pip3 install phigaro?

PollyTikhonova commented 4 years ago

I thought it was fixed on pypi too, but I'll check this moment

chris-rands commented 4 years ago

Thanks @PollyTikhonova but it looks like the PyPI version badge was accidentally deleted instead of the "Phigaro v2.2.1" version line. Also the continuous integration tests failed- can you update it again, when you have time of course?

PollyTikhonova commented 4 years ago

@chris-rands Yes, I tried to update the pypi version and met with some unpredictable problems, which, as I found out now (I hope it is true), were induced by some issues related to git clone operations of pickle files. So, now, I'm on my way to fix it...

P.s. By the way, thanks a lot to your attention and help! I really appreciate that)

chris-rands commented 4 years ago

@PollyTikhonova Great thanks, happy to help :) You could add the pypi badge back into the README (optionally)

[![PyPI version](https://badge.fury.io/py/phigaro.svg)](https://badge.fury.io/py/phigaro)

also the github description has got some typos and is quite long, maybe just change it to "Phigaro is a scalable command-line tool for predicting phages and prophages"

PollyTikhonova commented 4 years ago

@chris-rands @EricDeveaud, I updated the pypi version, returned the pypi badge and now the package passes all Git action tests . In case, if you are still dealing with problems like ModuleNotFoundError: No module named 'copy_reg\r', try to install it with --no-cache parameter: pip install phigaro --no-cache.

P.s. The description on Pypi will be updated with the next versions and @bobeobibo will update it on github (cause github does not allow me to to do it).