I'm trying to use some files as input for a bioinformatics tool. My basic code follows:
configfile: "config.yaml"
WORK_DATA = config["WORK_DATA"]
rule all:
input:
expand(WORK_DATA + "{sample}_{read}_quality-pass.fastq", sample=config["samples"], read=[1, 2])
rule filter:
input:
R1 = expand(WORK_DATA + "{sample}_1.fastq", sample=config["samples"]),
R2 = expand(WORK_DATA + "{sample}_2.fastq", sample=config["samples"])
output:
expand(WORK_DATA + "{sample}_{read}_quality-pass.fastq", sample=config["samples"], read=[1, 2])
params:
outname1 = expand("{sample}_1", sample=config["samples"]),
outname2 = expand("{sample}_2", sample=config["samples"])
shell:
"FilterSeq.py quality -s {input.R1} -q 20 --outname {params.outname1} --log FS1.log\n"
"FilterSeq.py quality -s {input.R2} -q 20 --outname {params.outname2} --log FS2.log"
However, I get an error looking something like this:
Error in rule filter:
jobid: 1
output: /home/path/SRR1383456_1_quality-pass.fastq, /home/path/SRR1383456_2_quality-pass.fastq, /home/path/SRR1383457_1_quality-pass.fastq, /home/path/SRR1383457_2_quality-pass.fastq
shell:
FilterSeq.py quality -s /home/path/SRR1383456_1.fastq /home/path/SRR1383457_1.fastq -q 20 --outname SRR1383456_1 SRR1383457_1 --log FS1.log
FilterSeq.py quality -s /home/path/SRR1383456_2.fastq /home/path/SRR1383457_2.fastq -q 20 --outname SRR1383456_2 SRR1383457_2 --log FS2.log
(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: .snakemake/log/2022-04-28T113611.757898.snakemake.log
I don't know exactly the cause of this error, but it seems that those files are being placed as input (input.R1/R2) at the same time. Consequently, the FilterSeq.py program get's confused since it accepts only one input per run. I wonder how could I solve this issue, so that I could run all my intended files smoothly. Any help on this will be appreciated!