jolespin / veba

A modular end-to-end suite for in silico recovery, clustering, and analysis of prokaryotic, microeukaryotic, and viral genomes from metagenomes
GNU Affero General Public License v3.0
77 stars 9 forks source link

[Question] Why do I get permission error for binning-prokaryotic.py only and not for binning-viral modules? #26

Closed the-eon-flux closed 1 year ago

the-eon-flux commented 1 year ago

Hi, I was trying to run VEBA on an HPC cluster for a small test dataset. I am getting some permission errors only when I run the prokaryotic-binning script 'binning-prokaryotic.py'. I followed the guided instructions and successfully ran the viral-binning script 'binning-viral.py' before the prokaryotic binning.

The error file when I run the prokaryotic-binning script gives the following message.

Traceback (most recent call last):
 File "/home/....../conda_mamba/envs/VEBA-binning-prokaryotic_env/bin/binning-prokaryotic.py", line 1326, in <module>
    `main()`
  File "/home/....../conda_mamba/envs/VEBA-binning-prokaryotic_env/bin/binning-prokaryotic.py", line 1286, in main
    directories["project"] = create_directory(opts.project_directory)
  File "/home/....../conda_mamba/envs/VEBA-binning-prokaryotic_env/lib/python3.8/site-packages/genopype/genopype.py", line 56, in create_directory
    os.makedirs(directory)
  File "/home/....../conda_mamba/envs/VEBA-binning-prokaryotic_env/lib/python3.8/os.py", line 213, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/home/....../conda_mamba/envs/VEBA-binning-prokaryotic_env/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/binning'

None of the following things worked for me :

  1. Delete the /binning folder and re-run prokaryotic-binning
  2. Change the folder permissions of the /binning folder to give write access.
  3. Delete the viral-binning folder and run prokaryotic-binning first. It still gave the same error. But when I ran viral-binning afterward it was fine. No permission error for binning-viral

Am I doing something wrong? Did I not install the modules correctly or something? I am using srun instead of sbatch to run all these cmds. I also tried it without the cluster but I still get the error.

My prokaryotic-binning cmd looks like this. binning-prokaryotic.py -f ${FASTA} -b ${BAM} -n ${SampleID} -p ${N_JOBS} -m 1500 -I ${N_ITER} -o ${OUT_DIR}/binning/prokaryotic

My viral binning cmd looks like this. binning-viral.py -f ${FASTA} -b ${BAM} -n ${SampleID} -p ${N_JOBS} -m 1500 -o ${OutDir}/binning/viral --include_provirus_detection

Thank you for your help!

jolespin commented 1 year ago

Looks like your OUT_DIR is an empty string.

OUT_DIR != OutDir

$ OutDir="veba_output"
$ echo ${OutDir}/binning/viral
veba_output/binning/viral
$ echo ${OUT_DIR}/binning/prokaryotic
/binning/prokaryotic

If you fix those variables it should work.

Plz reopen if it doesn't solve your issue.