MattiaPandolfoVR / MetaPhage

GNU General Public License v3.0
35 stars 9 forks source link

virsorter error #70

Open jEMMa7777 opened 8 months ago

jEMMa7777 commented 8 months ago

I am currently trying to run the demo with MetaPhage-0.3.3, I ran into a problem when executing the pipeline

 Step 5 : /home/jm2338/miniconda3/envs/metaphage/bin/Scripts/Step_5_get_phage_fasta-gb.pl VIRSorter SRR8653090_virsorter >> SRR8653090_virsorter/logs/out 2>> SRR8653090_virsorter/logs/err

  ## Verify if this should have been a virome decontamination mode based on 10kb+ contigs
  Cleaning the output directory
  rm -r SRR8653090_virsorter/r_0/db : 

Command error:
  mv: cannot stat '*': No such file or directory

Work dir:
  /local/workdir/jm2338/MetaPhage-0.3.3/work/04/a7441cd0e8ab03e5e303e900777cb1

Tip: you can replicate the issue by changing to the process work dir and entering the command `bash .command.run`

I tried debugging it with the steps mentioned in a another post because it is the same file that failed, #57 , but I wasn't able to do the step re-run the virsorter2 download and setup virsorter setup --db-dir "$METAPHAGE_DIR"/db/virsorter/virsorter2 --jobs 4

I got this error

[2023-11-12 15:43 INFO] VirSorter 2.2.4
[2023-11-12 15:43 INFO] /home/jm2338/miniconda3/envs/metaphage/bin/virsorter setup --db-dir /db/virsorter/virsorter2 --jobs 4
[2023-11-12 15:43 INFO] Setting up VirSorter2 database; this might take ~10 mins and only needs to be done once.
Traceback (most recent call last):
  File "/home/jm2338/miniconda3/envs/metaphage/bin/snakemake", line 10, in <module>
    sys.exit(main())
  File "/home/jm2338/miniconda3/envs/metaphage/lib/python3.7/site-packages/snakemake/__init__.py", line 2574, in main
    log_handler=log_handler,
  File "/home/jm2338/miniconda3/envs/metaphage/lib/python3.7/site-packages/snakemake/__init__.py", line 493, in snakemake
    os.makedirs(workdir)
  File "/home/jm2338/miniconda3/envs/metaphage/lib/python3.7/os.py", line 213, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/home/jm2338/miniconda3/envs/metaphage/lib/python3.7/os.py", line 213, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/home/jm2338/miniconda3/envs/metaphage/lib/python3.7/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/db'
[2023-11-12 15:43 INFO] First attempt failed; trying the second time.
Traceback (most recent call last):
  File "/home/jm2338/miniconda3/envs/metaphage/bin/snakemake", line 10, in <module>
    sys.exit(main())
  File "/home/jm2338/miniconda3/envs/metaphage/lib/python3.7/site-packages/snakemake/__init__.py", line 2574, in main
    log_handler=log_handler,
  File "/home/jm2338/miniconda3/envs/metaphage/lib/python3.7/site-packages/snakemake/__init__.py", line 493, in snakemake
    os.makedirs(workdir)
  File "/home/jm2338/miniconda3/envs/metaphage/lib/python3.7/os.py", line 213, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/home/jm2338/miniconda3/envs/metaphage/lib/python3.7/os.py", line 213, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/home/jm2338/miniconda3/envs/metaphage/lib/python3.7/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/db'
[2023-11-12 15:43 CRITICAL] Command 'snakemake --snakefile /home/jm2338/miniconda3/envs/metaphage/lib/python3.7/site-packages/virsorter/rules/setup-retry.smk --directory /db/virsorter/virsorter2 --quiet --config Skip_deps_install=False --jobs 4 --rerun-incomplete --latency-wait 600 --nolock  --use-conda --conda-prefix /db/virsorter/virsorter2/conda_envs --conda-frontend mamba ' returned non-zero exit status 1.

Then when I was trying to run the pipeline again, I got this error

Error executing process > 'virsorter (megahit-SRR8653090)'

Caused by:
  Process `virsorter (megahit-SRR8653090)` terminated with an error exit status (127)

Command executed:

  wrapper_phage_contigs_sorter_iPlant.pl         -f SRR8653090_megahit_contigs.fasta         --db 2         --wdir SRR8653090_virsorter         --ncpu 16         --data-dir /local/workdir/jm2338/MetaPhage-0.3.3/db/virsorter/legacy/
  cd SRR8653090_virsorter/Predicted_viral_sequences/
  for FILENAME in *;
  do
      mv $FILENAME SRR8653090_$FILENAME;
      if [ ! -e SRR8653090_VIRSorter_cat-1.fasta ]; then
          touch SRR8653090_VIRSorter_cat-1.fasta
      elif [ ! -e  SRR8653090_VIRSorter_prophages_cat-4.fasta ]; then
          touch SRR8653090_VIRSorter_prophages_cat-4.fasta
      else
          break
      fi
  done
  # add a space after sequenceID in header (before flag)
  sed 's/_flag=/ flag=/' SRR8653090_VIRSorter_cat-1.fasta > SRR8653090_correct_virsorter_cat-1.fasta;
  sed 's/_flag=/ flag=/' SRR8653090_VIRSorter_prophages_cat-4.fasta > SRR8653090_correct_virsorter_prophages_cat-4.fasta

Command exit status:
  127

Command output:
  (empty)

Command error:
  .command.sh: line 2: wrapper_phage_contigs_sorter_iPlant.pl: command not found

Work dir:
  /local/workdir/jm2338/MetaPhage-0.3.3/work/1a/b3b6ad4dcf2854af9d83d4e0c5efe5

Tip: you can replicate the issue by changing to the process work dir and entering the command `bash .command.run`

How should I fix this?

MattiaPandolfoVR commented 8 months ago

Hi there, can you please tell me if you are using the main branch or the dev? I suggest you to follow the tutorial of the latter, for the most updated version of our tool