我想知道为有许多中间文件的脚本编写规则的最佳实践是什么?
R脚本示例如下所示:
data <- read_rds(snakemake@input[["data"]])
# generate and save many plots for sanity check
plt1
ggsave("plt1.pdf", plt1)
plt2
ggsave("plt2.pdf", plt2)
# and many other figs
# No actual output
我写的规则是:
rule transform:
input:
我遇到了一个问题,当我尝试一条规则时,我会收到这样的信息.
The code used to generate one or several output files has changed:
To inspect which output files have changes, run 'snakemake --list-code-changes'.
To trigger a re-run, use 'snakemake -R $(snakemake --list-code-changes)'.
当我查看有更改的文件时,它们的时间戳比用于生成它
关于snakemake
我得到了
Building DAG of jobs...
Nothing to be done.
如果我试着
snakemake -n dag
我得到了
Building DAG of jobs...
MissingRuleException:
No rule to produce dag (if you use input functions make sure that they don't raise unexpected exceptions).
我不知道问题出在哪里。
我的主要snake文件:
configfile: "config_rules
我发现输出为'BAM未排序‘。
Q1:有没有办法将其更改为:
-outSAMtype SortedByCoordinate
当我在“额外”选项中添加该选项时,会收到关于重复定义的错误消息:
EXITING: FATAL INPUT ERROR: duplicate parameter "outSAMtype" in input "Command-Line"
SOLUTION: keep only one definition of input parameters in each input source
Nov 15 09:46:07 ...
有没有办法让snakemake在输入丢失的情况下表现得像make一样?snakemake当前的行为是bug还是一个特性? $ ls
b Makefile Snakefile
$ cat Makefile
b: a
touch b
a:
touch a
$ make -n
touch a
touch b
$ cat Snakefile
rule b:
input: "a"
output: touch("b")
rule a:
output: touch("a")
$ snakemake -n
B
我已经在snakemake中创建了一个工作流,当我只想运行一个规则时,我遇到了一个问题。实际上,它为我运行规则,其中的输出是我的规则的输入,即使这些规则之前已经创建过。
示例:
rule A:
input A
output A
rule b:
input b = output A
output b
rule c:
input c = output b
output c
我怎么能只运行规则C呢?
我正在尝试让snakemake (运行在Ubuntu20.04上的5.20.0版本)的--profile参数正常工作。我设置了一个配置文件目录,其中包含一个config.yaml文件。如果我把这个放到config.yaml中
verbose: 1
然后运行snakemake --profile xxx target,一切都很顺利。但是,如果配置文件包含
set-threads: "trim=7 diamond_dna=5"
snakemake抱怨道:
MissingRuleException:
No rule to produce --set-threads=trim=7 di