1
Snakemakeが新しく、ネストされた設定値がどのように動作するかを把握しようとしています。私は次の設定ファイルを作成しました...ルール内のネストされた設定変数へのアクセス
# dummyconfig.json
{
"fam1": {
"numchr": 1,
"chrlen": 2500000,
"seeds": {
"genome": 8013785666,
"simtrio": 1776,
"simseq": {
"mother": 2053695854357871005,
"father": 4517457392071889495,
"proband": 2574020394472462046
}
},
"ninherited": 100,
"ndenovo": 5,
"numreads": 375000
}
}
...私のSnakefileの中で(この中でも)一緒に行ってください。
# Snakefile
rule simgenome:
input:
"human.order6.mm",
output:
"{family}-refr.fa.gz"
shell:
"nuclmm simulate --out - --order 6 --numseqs {config[wildcards.family][numchr]} --seqlen {config[wildcards.family][chrlen]} --seed {config[wildcards.family][seeds][genome]} {input} | gzip -c > {output}"
私はその後snakemake --configfile dummyconfig.json fam1-refr.fa.gz
を呼び出すことによってfam1-refr.fa.gz
を作成したいと思います。そうすると、次のエラーメッセージが表示されます。
Building DAG of jobs...
rule simgenome:
input: human.order6.mm
output: fam1-refr.fa.gz
jobid: 0
wildcards: family=fam1
RuleException in line 1 of /Users/standage/Projects/noble/Snakefile:
NameError: The name 'wildcards.family' 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}}
のでfam1
は正しくfamily
ワイルドカードの値として認識されているが、変数が{config[wildcards.family][numchr]}
仕事のようにアクセスすることは表示されません。
この方法でネストされた設定をトラバースすることは可能ですか、Snakemakeはトップレベル変数のアクセスのみをサポートしていますか?