は例えば、私はPythonスクリプトsnakemake.py
ありますsnakemakeの `run`ブロックをリセットします。
from snakemake import snakemake
cfg={'a':'aaaa', 'b':'bbbb', 'c': 'cccc'}
snakemake(
'Snakefile',
targets=['all'],
printshellcmds=True,
forceall=True,
config=cfg,
# configfile=config,
keep_target_files=True,
keep_logger=False)
Snakefile
を次のようになります。私はpython snakemake.py
を実行すると
print(config)
print('------------------------------------------------------------------------------------------')
rule a:
output:
'a.out'
shell:
"echo %s ; "
"touch {output[0]}" % config['a']
rule b:
output:
'b.out'
shell:
"echo %s ; touch {output[0]}" % config['b']
rule c:
output:
'c.out'
run:
print(config['c'])
import os
os.system('touch ' + output[0])
rule all:
input:
'a.out', 'b.out', 'c.out'
、私はエラーに会った:
{'a': 'aaaa', 'c': 'cccc', 'b': 'bbbb'}
------------------------------------------------------------------------------------------
Provided cores: 1
Rules claiming more threads will be scaled down.
Job counts:
count jobs
1 a
1 all
1 b
1 c
4
rule c:
output: c.out
jobid: 1
{}
------------------------------------------------------------------------------------------
KeyError in line 8 of /Users/zech/Desktop/snakemake/Snakefile:
'a'
File "/Users/zech/Desktop/snakemake/Snakefile", line 8, in <module>
Will exit after finishing currently running jobs.
Exiting because a job execution failed. Look above for error message
私が削除した場合c.out
からrule all
までは、完全に正常に動作します。それはrun
のブロックがリセットされたconfig
のブロックをsnakemake
に渡して空にするように設定されているようです。それは奇妙な行動ではありませんか?回避策はありますか?
最新のOSXでsnackemakeバージョン3.11.2(anacondaのbiocondaチャンネルからインストール)を使用しています。
注: snakemakeコマンドラインsnakemake -p --keep-target-files all --config a="aaaa" b="bbb" c="cccc"
を実行すると正常に動作します。したがって、これはAPIの問題のように見えます。
はSnakemakeコマンドラインクライアントが、APIを使用しないように、特定の理由はありますか? –
@JohannesKöster、私は独自のパッケージの中でsnakemakeを呼びたいので、コマンドを実行する代わりにAPIを使う方が良いです。 – RNA
bitbucketで問題を提出できますか?私はバグだと思う。 –