Closed shaman-narayanasamy closed 2 years ago
It looks l DRAM-v wants to make the folder 'VS2/Virsorter2/dramv-annotate' its self, it does not understand that you did this work for it. If you make the output more like folder('VS2/Virsorter2/dramv-annotate'), other_output
the folder should be removed by Snakemakes cleanup process, thus preventing the file exists error. Let me know if that helps.
Hi @rmFlynn,
Thanks for the response quick response!
Indeed, I used the directory
as a Snakemake output. I now removed those folders from the output directive and here is the error I currently receive:
$ TS_DIR="/scratch/users/snarayanasamy/test_data/Virsorter2/Assemblies"
TS_SAMPLES="VS2" MGE_OUTDIR="/scratch/users/snarayanasamy/test_data/Virsorter2/resu
lts" snakemake -j 6 -ps workflows/MgePrediction virsorter2_prediction_workflow.done
Building DAG of jobs...
Using shell: /usr/bin/bash
Provided cores: 6
Rules claiming more threads will be scaled down.
Conda environments: ignored
Job counts:
count jobs
1 VS2_PREDICTION
1 run_dramv
2
[Mon Aug 9 20:06:44 2021]
rule run_dramv:
input: VS2/Virsorter2/pass_2/for-dramv/final-viral-combined-for-dramv.fa, VS2/V
irsorter2/pass_2/for-dramv/viral-affi-contigs-for-dramv.tab
output: VS2/Virsorter2/dramv-annotate/annotations.tsv
log: logs/VS2/dramv.log
jobid: 2
benchmark: benchmarks/VS2/dramv.txt
wildcards: ts_sample=VS2
threads: 6
DRAM-v.py annotate -i VS2/Virsorter2/pass_2/for-dramv/final-viral-combined-for-dramv.fa -v VS2/Virsorter2/pass_2/for-dramv/viral-affi-contigs-for-dramv.tab -o VS2/Virsorter2/dramv-annotate --skip_trnascan --threads 6 --min_contig_size 1000
DRAM-v.py distill -i VS2/Virsorter2/dramv-annotate/annotations.tsv -o VS2/Virsorter2/dramv-distill
2021-08-09 20:06:45.583115: Viral annotation started
Traceback (most recent call last):
File "/home/users/snarayanasamy/miniconda3/envs/vs2/bin/DRAM-v.py", line 140, in <module>
args.func(**args_dict)
File "/home/users/snarayanasamy/miniconda3/envs/vs2/lib/python3.8/site-packages/mag_annotator/annotate_vgfs.py", line 383, in annotate_vgfs
mkdir(output_dir)
FileExistsError: [Errno 17] File exists: 'VS2/Virsorter2/dramv-annotate'
[Mon Aug 9 20:06:45 2021]
Error in rule run_dramv:
jobid: 2
output: VS2/Virsorter2/dramv-annotate/annotations.tsv
log: logs/VS2/dramv.log (check log file(s) for error message)
shell:
DRAM-v.py annotate -i VS2/Virsorter2/pass_2/for-dramv/final-viral-combined-for-dramv.fa -v VS2/Virsorter2/pass_2/for-dramv/viral-affi-contigs-for-dramv.tab -o VS2/Virsorter2/dramv-annotate --skip_trnascan --threads 6 --min_contig_size 1000
DRAM-v.py distill -i VS2/Virsorter2/dramv-annotate/annotations.tsv -o VS2/Virsorter2/dramv-distill
(one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: /mnt/irisgpfs/users/snarayanasamy/repositories/gitlab/LAO_multiomics_CRISPR_iMGEs/.snakemake/log/2021-08-09T200644.023453.snakemake.log
It looks like folders are created based on the path of the output files given to Snakemake and not only based on the directory("path/to/folder")
Therefore, I appended rm -rf {wildcards.ts_sample}/Virsorter2/dramv-annotate {wildcards.ts_sample}/Virsorter2/dramv-distill
within my rule, just before the DRAM-v.py
command, which fixes the issue. Not really liking this solution, though. According to this post on Stackoverflow, this is the way one would handle it.
I can also confirm that it works with the --use-conda
parameter.
Let me know if you have any further question :)
Dear authors,
I am attempting to run the entire viral identification SOP on the test dataset.
I am implementing workflow with Snakemake. To ensure reproducibility, I am running the protocol using Snakemake's
--use-conda
parameter (with the relevant conda environment.yml
files, ofcourse). When running interactively, DRAMv works with no issues:However, when running it within a Snakemake workflow, it seems to fail:
I also attempted loading the conda environment and launching without the
--use-conda
parameter.Any idea on why this happens and if there is a way to circumvent this issue?
Best regards, Shaman