Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting custom database directory for download_eggnog_data.py does not work with custom directory #499

Open
ndeimler99 opened this issue Mar 18, 2024 · 1 comment

Comments

@ndeimler99
Copy link

Running the command "download_eggnog_data.py -y --data_dir ./data" does not work. I have tried creating an empty "data" directory. Both result in the following error message.

"usage: download_eggnog_data.py [-h] [-D] [-F] [-P] [-M] [-H] [-d HMMER_DBS]
[--dbname DBNAME] [-y] [-f] [-s] [-q]
[--data_dir]
download_eggnog_data.py: error: argument --data_dir: invalid existing_dir value: './data'"

The command works as expected when run without --data_dir

@Cantalapiedra
Copy link
Collaborator

Dear @ndeimler99 ,

The code checking this is:

def existing_dir(dname):
    dname = os.path.realpath(dname)
    if os.path.isdir(dname):
        return dname
    else:
        raise TypeError('not a valid directory "%s"' %dname)

I created a test script, like this:

#!/usr/bin/env python

import os, sys

def existing_dir(dname):
    dname = os.path.realpath(dname)
    if os.path.isdir(dname):
        return dname
    else:
        raise TypeError('not a valid directory "%s"' %dname)

dname = sys.argv[1]
print(dname)

mydir = existing_dir(dname)
print(mydir)

In linux command-line, I run:

./test_dir.py ./data
./data
Traceback (most recent call last):
  File "/home/cantalapiedra/test_dir/./test_dir.py", line 15, in <module>
    mydir = existing_dir(dname)
  File "/home/cantalapiedra/test_dir/./test_dir.py", line 10, in existing_dir
    raise TypeError('not a valid directory "%s"' %dname)
TypeError: not a valid directory "/home/cantalapiedra/test_dir/data"

and

mkdir data
./test_dir.py ./data
./data
/home/cantalapiedra/test_dir/data

Does this work for you?

Best,
Carlos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants