Hi! My snakemake code is throwing this error.
SyntaxError in line 53 of /storage1/GatkBwaTest/SnakemakeDir/tumor_pipeline/snakefile:
invalid syntax. Perhaps you forgot a comma?
53 line is first line in shell. I suspect it has something to do with the characters in the group. I would be glad for any help!
rule bwamem:
input:
ref=config["ref"], forward_reads=rules.repair.output.forward_fastrepair,
reverse_fastrepair=rules.repair.output.reverse_fastrepair
output:
bam=config["out"] + "/{sample}/{sample}.sorted.mkdup.bam"
params:
bwa_threads=config["bwamem_threads"], fixmate_threads=config["fixmate_threads"],
per_thread_sort_mem=config["per_thread_sort_mem"], markdup_threads=config["markdup_threads"]
log:
bwa=config["out_logs"]+"/{sample}/{sample}.bwa.log", fixmate=config["out_logs"]+"/{sample}/{sample}.fixmate.log",
sort=config["out_logs"]+"/{sample}/{sample}.sort.log", markdup=config["out_logs"]+"/{sample}/{sample}.markdup.log"
shell:
" {bwa_mem} mem -t {params.bwa_threads} {input.ref} {input.forward_reads} {input.reverse_fastrepair} "
" -R \'@RG\\tID:{wildcards.sample}\\tPU:unit1\\tSM:{wildcards.sample}\\tPL:Illumina\\tLB:lib1\' 2>{log.bwa_threads} | "
" samtools fixmate -@ {params.fixmate_threads} -m - - 2>{log.fixmate_threads}| "
" samtools sort -T "sort_temorary" -@ {params.sort_threads} -m {params.per_thread_sort_mem} 2>{log.sort}| "
" samtools markdup -@ {params.markdup_threads} - {output.bam} 2>{log.markdup} "
Thank you
Hi,
I think you need to use single-quotes in the
sort_temorary
(add instead...sort -T 'sort_temorary' -@...
) parameter and not double-quotes. Double-quotes define the beginning and end of the shell commands in this case.I hope this helps,
António
Thank you! But now I have another error without description(
Not sure if the following mistake is a parsing problem of the error message or it is actually a mistake, but some of your paths have two slashes
//
like in here:out/out_logs//NIST7035_TAAGGCGA/NIST7035_TAAGGCGA.markdup.log
. Just edit your code to remove one slash character.The error seems to be related with the command given. So, it does not seem related with
snakemake
anymore.Running
snakemake
with the option--verbose
might provide further details about what is going on.I hope this helps,
António