Snakemake 警告用于生成一个或多个输出文件的代码已更改,但它们尚未更改
我遇到了一个问题,当我试运行(或真正运行)规则时,我收到此消息...
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)'.
当我查看有更改的文件时,它们的时间戳比用于生成它们的代码新并且这些文件具有顺序正确的时间戳。其中一些文件需要很长时间才能生成,我真的不想重新创建它们。
另外,如果文件已更改,那么为什么 DAG 不指示需要创建它们?下次运行规则时,应该有更改的文件不会更新。
谷歌搜索错误消息并没有让我走得太远。
例如,snakemake --list-code-changes
包括 data/references/silva.v4.align
和 data/references/silva.v4.tax< /代码>。规则如下...
rule silva:
input:
script="code/get_silva.sh"
output:
"data/references/silva.v4.align",
"data/references/silva.v4.tax"
resources:
cpus=8,
shell:
"""
{input.script} {resources.cpus}
"""
这是 ls -lth 输出...
-rw-rw-r-- 1 pschloss schloss-lab 589K Apr 2 09:29 data/references/silva.v4.tax
-rw-rw-r-- 1 pschloss schloss-lab 53M Apr 2 09:29 data/references/silva.v4.align
-rwxrwxr-x 1 pschloss schloss-lab 1.4K Mar 29 09:52 code/get_silva.sh
最初我使用 v.7.3.1 执行此操作,然后升级到 7.3.8。我仍然收到消息。
I'm running into an issue where when I dry-run (or run for real) a rule I get this message...
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)'.
When I look at the files that have changes, their time stamps are newer than the code used to generate them and the files have time stamps that are in the correct order. Some of these files take a long time to generate and I'd really rather not have to recreate them.
Also, if the files have changed, then why wouldn't the DAG indicate that they need to be created? The files that supposedly have changes aren't getting updated the next time I run a rule.
googling the error message hasn't gotten me very far.
As an example, snakemake --list-code-changes
includes data/references/silva.v4.align
and data/references/silva.v4.tax
. Here's the rule...
rule silva:
input:
script="code/get_silva.sh"
output:
"data/references/silva.v4.align",
"data/references/silva.v4.tax"
resources:
cpus=8,
shell:
"""
{input.script} {resources.cpus}
"""
Here is the ls -lth
output...
-rw-rw-r-- 1 pschloss schloss-lab 589K Apr 2 09:29 data/references/silva.v4.tax
-rw-rw-r-- 1 pschloss schloss-lab 53M Apr 2 09:29 data/references/silva.v4.align
-rwxrwxr-x 1 pschloss schloss-lab 1.4K Mar 29 09:52 code/get_silva.sh
Initially I was doing this with v.7.3.1 and upgraded to 7.3.8. I am still getting the message.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用
7.3.2
之前的版本,请考虑升级。有一个代码更改检测错误,已在7.3.2 中修复
,因此升级snakemake
应该会删除您看到的消息:If you are using version before
7.3.2
, consider upgrading. There was a code change detection bug and it was fixed in7.3.2
, so upgradingsnakemake
should remove the message you've been seeing:它说代码已更改(据我所知,蛇文件本身的代码)。蛇文件是最新的吗?你做了什么改变吗?
正如您所说,文件及其来源具有正确的时间戳,因此原则上实际上不需要执行任何操作。但规则本身的代码可能已经更改,因此,即使源文件没有更改,snakemake 也假设可能应该重新运行某些规则来执行新代码。
您可以使用建议的参数 --list-code-changes 找出哪些规则已更改。也许您在执行规则后最近对蛇文件的代码进行了更改。
It says that the code has changed (the code of the snakefile itself as I understand). Is the snakefile more recent? Did you make any change?
As you say, the files and their sources have correct timestamps so actually nothing needs to be done in principle. But possibly the code of rules itself have changed so snakemake is assuming that possibly some rule should be re-run to execute the new code even if the source files haven't changed.
You can find out which rules have changed by using the suggested argument --list-code-changes. Maybe you made a recent change in the code of the snakefile after executing a rule.