我正在做一个非常短的工作流程,其中我使用了一个工具,我的分析称为鲑鱼。在我正在工作的hpc
中,我无法安装这个工具,所以我决定从biocontainers
中提取容器。在特殊情况下,我们没有安装docker
(我也没有这样做的权限),但是我们有singularity
。所以我必须拉码头容器(from: quay.io/biocontainers/salmon:1.2.1--hf69c8f4_0)
使用奇点)。我正在使用的工作流管理系统是nextflow
。这是我创建的简短工作流(index.nf
):
#!/usr/bin/env nextflow
nextflow.preview.dsl=2
container = 'quay.io/biocontainers/salmon:1.2.1--hf69c8f4_0'
shell = ['/bin/bash', '-euo', 'pipefail']
process INDEX {
script:
"""
salmon index \
-t /hpc/genome/gencode.v39.transcripts.fa \
-i index \
"""
}
workflow {
INDEX()
}
我使用以下命令运行它:
nextflow run index.nf -resume
但是得到了这个错误:
salmon: command not found
你知道我怎样才能解决这个问题吗?
发布于 2022-01-29 11:36:38
你离我太近了!您所需要做的就是将这些指令移动到您的nextflow.config中,或者在流程主体的顶部声明它们:
container = 'quay.io/biocontainers/salmon:1.2.1--hf69c8f4_0'
shell = ['/bin/bash', '-euo', 'pipefail']
我的首选是使用过程选择器来分配容器指令。例如,您的nextflow.config
可能如下所示:
process {
shell = ['/bin/bash', '-euo', 'pipefail']
withName: INDEX {
container = 'quay.io/biocontainers/salmon:1.2.1--hf69c8f4_0'
}
}
singularity {
enabled = true
// not strictly necessary, but highly recommended
cacheDir = '/path/to/singularity/cache'
}
然后,您的index.nf
可能看起来像:
nextflow.enable.dsl=2
params.transcripts = '/hpc/genome/gencode.v39.transcripts.fa'
process INDEX {
input:
path fasta
output:
path 'index'
"""
salmon index \\
-t "${fasta}" \\
-i index \\
"""
}
workflow {
transcripts = file( params.transcripts )
INDEX( transcripts )
}
如果使用以下方法运行:
nextflow run -ansi-log false index.nf
您应该看到以下结果:
N E X T F L O W ~ version 21.04.3
Launching `index.nf` [clever_bassi] - revision: d235de22c4
Pulling Singularity image docker://quay.io/biocontainers/salmon:1.2.1--hf69c8f4_0 [cache /path/to/singularity/cache/quay.io-biocontainers-salmon-1.2.1--hf69c8f4_0.img]
[8a/279df4] Submitted process > INDEX
https://stackoverflow.com/questions/70904487
复制相似问题