makefile - Snakemake: name rule instead of target file -


here short example advanced section of snakemake tutorial:

rule bwa_map: input:     "data/genome.fa",     lambda wildcards: config["samples"][wildcards.sample] output:     "mapped_reads/{sample}.bam" threads: 8 shell:     "bwa mem -t {threads} {input} | samtools view -sb - > {output}" 

now lets wrote rule months ago , don't remember output file name. understanding cannot run snakemake invoking rule name because lead error:

$ snakemake bwa_map inputfunctionexception in line 9 of snakefile: attributeerror: 'wildcards' object has no attribute 'sample' wildcards:  $ 

first, don't understand why snakemake cannot use lambda function deduce input files configuration file quite clear refer "samples" section.

second, there workaround this? because easy old makefile use old makefile , run same bwa_map rule typing like

$ make bwa_map input=data/samples/a.fastq 

thanks in advance help. benoist

if specify rule name target , rule contains wildcards, snakemake can't know values use wildcards. can determined concrete output file in case. output file can come downstream rule, e.g. real ´all´ target @ top of snakefile, or providing directly @ command line.

however if have proper target rule @ top of snakefile, there --until flag, allows execute workflow until given rule.

regarding make example, not aware of functionality. can point me docs this? might add similar snakemake well.

please note improved error message case in development version of snakemake. more informative , explains issue.


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -