Can someone tell me how to use os.path in snakemake
It's my code
import os
(SAMPLES,) = glob_wildcards("../exom/NIST7035/{sample}_L001_R1_001.fastq.gz")
SAMPLE_PATH=os.path.dirname(config["sample"])
print(SAMPLE_PATH)
rule all:
input:
expand("{sample}_R1.fastq", sample=SAMPLES)
rule sort:
output:
output1="{sample}_R1.fastq"
shell:
" zcat SAMPLE_PATH/{wildcards.sample}*R1*.fastq.gz | paste - - - - | sort -k1,1 -S 30G | tr '\t' '\n' > {output.output1} "
Now the snakemake does not understand the variable
gzip: SAMPLE_PATH/NIST7035_TAAGGCGA*R1*.fastq.gz: No such file or directory
what are you trying to do? you define both SAMPLES and INTERVALS, but you do not use them in the code?
I do not use intervals, because this is the first rule from a large pipeline. SAMPLES contains the name of the samples. For example NIST7035_TAAGGCGA_L001_R1_001.fastq.gz I want to use the first rule only for samples with R1 and add the same shell for R2