在使用expand函数时,我很难使用正则表达式。由于某些原因,通配符总是作为纯文本而不是执行的正则表达式导入。不管regex是作为通配符引入还是与expand函数相连接都没有区别(请参见all_decompress vs.all\u decompress2)。错误总是:
Missing input files for rule DECOMPRESS:
Resources/raw/run1_lane1_read[1,2]_index\d+-\d+=[1-9], [11-32].fastq.gz
-
^{pr2}$
Tags:
我想在expand中执行正则表达式是不可能的。但是我找到了一个解决办法。对于其中两个通配符,我找到了不同的描述方式(“read”和“index”),对于第三个通配符,我准备了一个函数并将其用作输入。在
你查过bli的链接吗?在
具体来说,this part of the documentation。在
下面是一个简单的示例,说明我如何使用它来生成png、pdf或两者兼而有之:
希望这有帮助。在
如果我是对的,函数expand in Snakemake生成一个字符串列表。此函数用于文件名,就像您使用它一样。在
我不知道expand函数是否可以与regex关联以创建列表。在
但是您可以用python生成这个列表并将其交给ruleall或expand函数。在
在您的情况下,您可以使用以下代码来获取并生成文件名列表:
然后在listoffiles中,你有你所有的文件名,你只需要像这样使用你的扩展:
^{pr2}$那么一切都应该完美运作。在
记住,在创建所有规则和dag之前,snakefile中的所有python代码都将在工作流开始时执行。所以它可以很强大。在
相关问题 更多 >
编程相关推荐