metageni / SUPER-FOCUS

A tool for agile functional analysis of shotgun metagenomic data
GNU General Public License v3.0
21 stars 12 forks source link

superfocus_downloadDB: Error opening database file #68

Closed ModelMEMS closed 2 years ago

ModelMEMS commented 3 years ago

Hello,

I'm trying to run Superfocus on our computer cluster, but I can't get the DB set up. I've downloaded the db.zip with the clusters, and now try to run the following line (according to your instructions):

superfocus_downloadDB -i clusters -a diamond -c 95

But I get the following error:

[2021-06-28 14:55:25,976 - INFO] Formating Database for aligner(s): diamond and cluster(s): 95 [2021-06-28 14:55:25,976 - INFO] Joining files [2021-06-28 14:56:06,931 - INFO] Formatting Database [2021-06-28 14:56:06,931 - INFO] DIAMOND: DB_95 diamond v2.0.6.144 Documentation, support and updates available at http://www.diamondsearch.org

CPU threads: 16

Scoring parameters: (Matrix=BLOSUM62 Lambda=0.267 K=0.041 Penalties=11/1) Database input file: 95_clusters.fasta Opening the database file... No such file or directory [0.255s] Error: Error opening file /home/username/.local/lib/python3.8/site-packages/superfocus-0.0.0-py3.8.egg/superfocus_app/db/static/diamond/95_clusters.db.dmnd [2021-06-28 14:56:07,215 - INFO] Done :)

Any ideas on what is going on here? I'm not even sure why it is looking for the db in a local library path...

Thanks in advance!

metageni commented 3 years ago

hi - do you have writing permission to /home/username/.local/lib/python3.8/site-packages/superfocus-0.0.0-py3.8.egg/superfocus_app/db/static/diamond/. If not, maybe try to change the permissions and run it again? thanks

ModelMEMS commented 3 years ago

The db directory doesn't appear to exist at all:

ls -h /home/username/.local/lib/python3.8/site-packages/superfocus-0.0.0-py3.8.egg/superfocus_app/
do_alignment.py  __init__.py  __pycache__  superfocus_downloadDB.py  superfocus.py

I have tried relaxing permissions on the .local folder, but that doesn't appear to do anything.

metageni commented 3 years ago

Odd. I think it has something to do with the permission of the user on the system. How did you install the tool? pip or conda?

Could you please try to create /home/username/.local/lib/python3.8/site-packages/superfocus-0.0.0-py3.8.egg/superfocus_app/db/static/diamond/ and re-run the database build?

thanks

ModelMEMS commented 3 years ago

I've just done that, but still no luck. It never even writes the file 90_clusters.db.dmnd there. I'll get IT here to find me a permissions work-around, but it's probably something you may want to fix in the future. This shouldn't require sudo rights :/


EDIT For future trouble shooters: I've now (after 4 days... ^^) discovered that there was 1 specific way to get around this on our computer cluster, which required me to use a specific python module, reset a path to .local/bin, and use pip3.7 with --user enabled:

module load python/3.7.1
export PATH=/home/REDACTED/.local/bin:$PATH
pip3.7  install --user superfocus

After that I could finally set up the database, but it would be easiest if superfocus_downloadDB had an option to determine where it would output the db, so that you can avoid these issues.

theo-allnutt-bioinformatics commented 2 years ago

I have the same issue.

superfocus_downloadDB -i clusters -a diamond -c 90 [2021-11-04 12:27:55,609 - INFO] Formating Database for aligner(s): diamond and cluster(s): 90 [2021-11-04 12:27:55,609 - INFO] Joining files [2021-11-04 12:31:58,490 - INFO] Formatting Database [2021-11-04 12:31:58,490 - INFO] DIAMOND: DB_90 diamond v2.0.11.149 (C) Max Planck Society for the Advancement of Science Documentation, support and updates available at http://www.diamondsearch.org Please cite: http://dx.doi.org/10.1038/s41592-021-01101-x Nature Methods (2021)

CPU threads: 48

Scoring parameters: (Matrix=BLOSUM62 Lambda=0.267 K=0.041 Penalties=11/1) Database input file: 90_clusters.fasta Opening the database file... No such file or directory [0.119s] Error: Error opening file /home/xxx/xxx/.local/lib/python3.9/site-packages/superfocus-0.0.0-py3.9.egg/superfocus_app/db/static/diamond/90_clusters.db.dmnd

Will it only work in pyton 3.7? I don't have that option, only 3.9.

theo-allnutt-bioinformatics commented 2 years ago

The db is too large for the home directory of the cluster I am using. It would have to be on an attached storage directory.

theo-allnutt-bioinformatics commented 2 years ago

I fixed this by manually building a diamond db and making a symlink in the expected .local directory to the db directory on my storage:

git clone https://github.com/metageni/SUPER-FOCUS.git cd SUPER-FOCUS && python3 setup.py install wget edwards.sdsu.edu/superfocus/downloads/db.zip unzip db.zip cat clusters/90_clusters/*.faa >90_clusters.fasta diamond makedb --in 90_clusters.fasta --db superfocus_app/db/static/diamond/90_clusters.db ln -s /mystorage/bin/SUPER-FOCUS/superfocus_app/db/ /home/xxxx/.local/lib/python3.9/site-packages/superfocus-0.0.0-py3.9.egg/superfocus_app/db

SergeyBaikal commented 2 years ago

Same problem.

SergeyBaikal commented 2 years ago

theo-allnutt-bioinformatics, many thanks! It helped me!