Sorry if this is a naive question, but I'm still trying to wrap my head around the intricacies of Snakemake.
I have a directory containing a number of files that I want to apply a rule to in parallel (i.e. I want to submit the same script to the cluster, specifying a different input file for each submission).
I first tried using expand for the input files, but this only resulted in one job submission:
CHROMS = [str(c) for c in range(1, 23)] + ["X"]
rule vep:
input:
expand("data/split/chr{chrom}.vcf",
chrom=CHROMS)
output:
expand("data/vep/split/chr{chrom}.ann.vcf",
chrom=CHROMS)
shell:
"vep "
"{input} "
"{output}"
Is there an alternative approach here?
Thank you!
shell
command in current form would result in error as each line in it would act as a separate command. Instead you have to escape newlines with`
i.e."vep \ {input} \ {output}"
. Note: Newlines next to\
do not seem to format properly in stackoverflow comments. – Manavalan Gajapathy-p
flag in snakemake to see the command that will be executed. – Manavalan Gajapathy