I have a snakemake problem! I want to download fastq file by giving the SRR accesion number as sample. But when I run my code it says name sample is unknown. But it is defined!
config.yaml
samples: ["SRR8181579"]
SRAToolKit: sratoolkit.2.9.6-centos_linux64/bin/fastq-dump
snakefile:
configfile: "config.yaml"
rule all:
input:
expand("{sample}.fastq", sample = config["samples"])
rule get_fastq:
output:
'{sample}.fastq'
wildcard_constraints:
sample="SRR\d+"
message:
"Downloading the fastq files"
shell:
'{config[SRAToolKit]} {sample}'
The error I get:
RuleException in line 7 of /data/storix2/student/Thema11/dme/projectThema11/fastq.Pipeline: NameError: The name 'sample' is unknown in this context. Please make sure that you defined that variable. Also note that braces not used for variable access have to be escaped by repeating them, i.e. {{print $1}}