- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试创建一个 snakemake 管道,其输出由特定文件夹中存在的一组排序文件决定。我的文件路径结构如下:
project_dir
> Snakefile
> code
> python_scripts
> ab1_to_fastq.py
> data
> 1.ab1_files
> A.ab1
> B.ab1
> C.ab1
> 2.fastq_files
这是我实际的 Snakefile 的代码
import glob
import os
def collect_reads():
ab1_files = glob.glob("data/1.ab1_files/*.ab1")
ab1_files.sort()
ab1_reads = [ab1_file.split('/')[-1].replace('.ab1', '') for ab1_file in ab1_files]
return ab1_reads
READS = collect_reads()
print(expand("data/2.fastq_files/{read}.fastq", read=READS))
rule convert_ab1_to_fastq:
input:
ab1="data/1.ab1_files/{read}.ab1"
output:
fastq="data/2.fastq_files/{read}.fastq"
shell:
"python code/python_scripts/ab1_to_fastq.py --ab1 {input.ab1} --fastq {output.fastq}"
rule all:
input:
fastq=expand("data/2.fastq_files/{read}.fastq", read=READS)
我的理解是 all
应该是我的目标规则,并且该规则中 fastq 的输入变量计算为
['data/2.fastq_files/A.fastq', 'data/2.fastq_files/B.fastq', 'data/2.fastq_files/C.fastq']
当我运行我的脚本时,管道中的打印输出似乎证实了这一点。但是,我收到错误 WorkflowError: Target rules may not contain wildcards。请指定具体文件或不带通配符的规则。
每当我运行此脚本时。
奇怪的是,我可以从 expand 生成的列表中复制其中一个路径来直接调用 snakemake,例如snakemake data/2.fastq_files/A.fastq
管道成功完成。
我错过了什么?
最佳答案
可能是 snakemake 认为你的目标规则是 convert_ab1_to_fastq
而不是 all
。默认情况下,snakemake 将第一个规则作为目标规则。首先声明all
,看看这是否能解决您的问题。
关于python - Q : Target rules may not contain wildcards Error in Snakemake - No wildcards in Target?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48671421/
我想使用 Snakemake 使用 SRR ID 从 SRA 数据库下载 fastq 文件。我读取了一个文件以使用 python 代码获取 SRR ID。 我想一个一个解析Variable作为输入。我
这更多是关于 snakemake 功能的技术问题。我想知道是否可以在 snakemake 运行期间动态更改输入样本集。 我想这样做的原因如下:让我们假设一组样本相关的 bam 文件。第一条规则确定每个
我正在创建一个 snakemake 管道,在某些时候,我可以在其中过滤我的结果。但是我可以应用两种过滤器,所以我想在启动管道时将其作为参数提供,然后根据参数,我想应用一个或另一个规则。 举个例子: s
我有以下 Snakemake 文件: rule test: params: a = "a" shell: "echo {params.a}" 按预期工作
我有以下 Snakemake 文件: rule test: params: a = "a" shell: "echo {params.a}" 按预期工作
我有一个复杂的工作流程,我逐渐扩展了它。最后一个扩展导致 AmbiguousRuleException。我试图在以下示例中重现工作流的关键结构: NUMBERS = ["1", "2"] LETTER
上下文 规则 A 在 shell 指令中使用 split 命令。rule A 生成的文件数量取决于用户在配置中指定的值,因此是已知的。 在this question存在差异,因为输出文件的数量未知,但
我正在尝试创建一种简单的方法来在一个规则中创建工作流所需的所有子目录。但是,每当我尝试执行在工作流顶部创建所有必需目录的规则时,我都会收到 ChildIOException ,这对我来说毫无意义: B
我有一个 Snakemake 规则,适用于数据存档并本质上解压其中的数据。文件包含我在规则开始之前知道的不同数量的文件,因此我想利用它并执行类似的操作 rule unpack: input:
我想将每个 snakemake 作业执行的 shell 命令保存到日志文件中。 使用 --printshellcmds 我可以在提交时将 shell 命令打印到标准输出,但我想将它们保存到单独的文件中
我有一个很长的蛇形工作流程,处理 9 个具有许多并行规则的样本。当我为 DAG 创建图片时: snakemake --forceall --dag | dot -Tpdf > dag.pdf 生成的
我有一个奇怪的问题,它来来去去,我真的不知道什么时候以及为什么。 我正在运行这样的蛇形管道: conda activate $myEnv snakemake -s $snakefile --co
在snakemake 中,我想从config 访问 key 。从内部shell:指示。我可以用 {input.foo} , {output.bar} , 和 {params.baz} ,但是 {con
在我的第一次运行中,我有两类样本要由不同的参数处理,然后在第二次运行中将它们合并在一起。像下面的例子: SAMPLES = ['1', '2', '3'] CLASS1 = ['1', '2'] CL
我想问 Snakemake 社区是否有人在 AWS Batch 中成功实现了 Snakemake 工作流程。 2018 年 10 月最近发布的第 4 页似乎表明 Snakemake 在 AWS 上不起
问题很简单: 我想从规则调用脚本,并且我希望该规则同时适用于: 执行 stdout 和 stderr 重定向 从脚本中访问snakemake变量(变量可以是列表和文字) 如果我使用 shell:,那么
由于 conda 环境未处于事件状态,工作流的一些非常晚的作业崩溃了。 现在,当我尝试使用 snakemake deploy_all --ignore-incomplete 重新运行时,所有作业都直接
我开始尝试在 Snakemake 中使用容器,我有一个问题,什么需要预先构建到容器中,什么不需要。例如: 我想在一个容器中运行一个 python 脚本(例如,存储在 workflow_root/scr
以下蛇形脚本: rule all: input: 'test.done' rule pipe: output: 'test.done' shell:
我使用的所有脚本都将输出文件放在调用脚本的当前目录中,因此在我的 shell 脚本管道中,我会让 cd 命令转到特定目录以运行命令,而输出文件将仅保存在相关目录中。我的脚本没有输出目录的参数,大多数脚
我是一名优秀的程序员,十分优秀!