Entering edit mode
22 months ago
brunobsouzaa
▴
840
Hi everyone, good morning. I'm falling into an issue using bwa mem
inside Snakemake + Singularity
, which I've investigated and can't find a way to override. BWA
works fine outside singularity
. The code is:
import os
import snakemake.io
import glob
configfile: "../config.yaml"
(SAMPLES,) = glob_wildcards("/home/ubuntu/samples/{sample}_R1.fastq.gz")
# generate dag.svg diagram
# snakemake --dag all | dot -Tsvg > dag.svg
rule all:
input:
expand("/home/ubuntu/Germinativo/aln/inter_files/SAM/{sample}.aln.sam", sample=SAMPLES)
rule bwa_map:
input:
R1="/home/ubuntu/samples/{sample}_R1.fastq.gz",
R2="/home/ubuntu/samples/{sample}_R2.fastq.gz",
ref=config['REF']
output:
sam_out="/home/ubuntu/Germinativo/aln/inter_files/SAM/{sample}.aln.sam"
params:
rg="@RG\\tID:lab\\tLB:AGILENT\\tSM:{sample}\\tPL:ILLUMINA"
threads: 2
singularity:
"docker://biocontainers/bwa:v0.7.17_cv1"
shell:
"bwa mem -M -t {threads} -R '{params.rg}' {input.ref} {input.R1} {input.R2} > {output.sam_out}"
I've already followed this thread and this other thread but nothing seems to work. So, that's probably something I'm missing.
The error it shows is :
RuleException:
CalledProcessError in line 29 of /home/ubuntu/scripts/snakemake/singularity/Snakefile:
Command ' singularity exec --home /home/ubuntu/scripts/snakemake/singularity -B /home/ubuntu/samples:/data --bind /usr/lib/python3/dist-packages:/mnt/snakemake /home/ubuntu/scripts/snakem
ake/singularity/.snakemake/singularity/6443b3814f9b68bb6a33e838b8d4b84c.simg bash -c 'set -euo pipefail; bwa mem -M -t 2 /home/ubuntu/Germinativo/GenRef/hg19/chromFa/hg19.fa /home/ubuntu
/samples/1124274_R1.fastq.gz /home/ubuntu/samples/1124274_R2.fastq.gz > /home/ubuntu/Germinativo/aln/inter_files/SAM/1124274.aln.sam'' returned non-zero exit status 1.
File "/home/ubuntu/scripts/snakemake/singularity/Snakefile", line 29, in __rule_bwa_map
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
Code is being run with:
snakemake -j2 --use-singularity --singularity-args "-B /home/ubuntu/samples/:/data" --verbose
Appreciate any help. Thanks in advance.
how would Snakemake know you are now using
/data
instead of/home/ubuntu/samples/
? and what about/home/ubuntu/Germinativo/aln/inter_files/SAM/
?I'm mounting
/data
inside container using--singularity-args "-B /home/ubuntu/samples/:/data"
The output dir is located on my local server, it should have no problem saving on it!normally binding syntax source_on_host:destination_in_container. so Snakemake doesn't know anything about a directory called "data" because your script hardcodes the host directories.
bwa_map
did you resolve this?
I did not... I'm using Docker instead.