snakemake - 具有特定文件组合作为输入的 Snakemake
问题描述
你知道如何用特定的文件组合运行snakemake吗?即在这个 txt 文件中,我有序列 ID 的列表:
bob.txt
steve.txt
john.txt
从这些文件中,我想提取上述文件中 ID 的序列:
bob.fa
steve.fa
john.fa
所以来自 bob 的序列 ID 应该在 bob.fa 中查找序列,而在 john.fa 中查找 john,依此类推。
workdir: "/path/to/dir/" (SAMPLES,) =glob_wildcards('path/to/dir/{sample}.fa') rule all: input: expand("{sample}.unique.fa", sample=SAMPLES) rule seqkit: input: infa ="path/to/dir/{sample}.fa" intxt = "path/to/dir/{sample}.txt output: outfa = "{sample}.unique.fa" shell: ("/Tools/seqkit grep -f {input.intxt} {input.infa} > {output.outfa}")
所以我不需要所有的组合,而只需要特定的组合,比如 bob.txt 和 bob.fa,steve.txt 和 steve.fa。因为我当前的代码也会在 steve.fa 中做 bob.txt
解决方案
rule seqkit
输入中缺少逗号。
rule seqkit:
input:
infa ="path/to/dir/{sample}.fa",
intxt = "path/to/dir/{sample}.txt
推荐阅读
- google-assistant-sdk - 嵌入式设备上的谷歌助手 sdk 有什么方法可以获取会话 ID?
- python - 为什么相同的逻辑方程在 python 和 c++ 中返回 2 个不同的结果?
- c++ - 将成员函数传递给 glfwSet*Callback
- python - Teradata Python:如何重命名数据框中的列?
- javascript - 在 Laravel Mix 项目中使用 Vue 组件
- arrays - 我在 python 中处理数组,一个叫做类型数组类的术语让我很困惑
- sql-server - 如何从多个可为空的列创建备用键
- python - 找出在 argparse 中显式传递的参数
- javascript - 如何遍历 DOM 并显示所有标签?
- angular - 将数组显示为 TS 中的选择选项