Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

Snakemake: how to include config parameters in rule all

$
0
0

I am pretty new at Python and using Snakemake, and I am trying to use a config file to modify my parameter more easily and output them in different files, but I am stuck at the definition of the rule all with the error :

'expression cannot contain assignment' or 'Missing files for rule all'

I understand that Snakemake or expand doesn't do well with the "params." part but if I change it for example 'm_qual=config["mqual"] and {mlength} in the expand part ' the file is considered missing / is not recognized later.

Can you suggest an alternative with some explication please :) ? And/or maybe some documentation a bit more advance than what is on the Snakemake tutorial page?

config.yaml

adapt1: 'AGAT exemple'mlength: 15mqual: 45

Snakefile

configfile:"config.yaml" print(config)SAMPLES= ["HgSim"]rule all:    input:        expand("01_fastQC/{samples}_fastqc.log",samples=SAMPLES),expand("Resume_Stats/AR.mlength{params.m_length}.mqual{params.qual}/{samples}.settings",samples=SAMPLES,params.m_length=config["mlength"],params.m_qual=config["mqual"])rule fastQC:    input: "reads/{samples}.fq"    output: "01_fastQC/{samples}_fastqc.log"    shell: "fastqc {input} > {output}"rule AdapterRemoval_se:    input: "reads/{samples}.fq"    output:         Settings="Resume_Stats/AR.mlength{params.m_length}.mqual{params.m_qual}/{samples}.settings",        Truncated="02_AdapterRemoval_pe/mlength{params.mlength}.mqual{params.mqual}/{samples}.truncated",        Discarded="02_AdapterRemoval_pe/mlength{params.mlength}.mqual{params.mqual}/{samples}.discarded"    threads: 20       params:        adapter_1=config["adapt1"],        m_length=config["mlength"],        m_qual=config["mqual"]    shell: "AdapterRemoval --file1 {input}  --discarded {output.Discarded}  --settings {output.Settings} --output1 {output.Truncated} --adapter1 {params.adapter_1} --threads {threads} --minlength {params.m_length} --minquality {params.m_qual} --trimns --trimqualities "

Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>