docker - Nextflow配置文件问题

标签 docker containers nextflow

Nextflow config file issue

嗨 请在下面找到一个 nf 脚本和一个配置文件。 我已经在两台计算机上运行它们。两台计算机都安装了 nextflow (v 22.04.5) 和 docker。但是,一台计算机显示错误消息。请参阅随附的屏幕截图。我检查了日志文件,只有一个“未找到命令”。 我想知道你能否指出这台电脑缺少什么。谢谢。

nextflow 脚本

#!/usr/bin/env nextflow

//data_location
params.outdir = './results'
params.in = "$PWD/*.fastq"
datasetA = Channel
                .fromPath(params.in)
                .map { file -> tuple(file.baseName, file) }
        

// fastqc

process fastqc {
    tag "${datasetIDA}"
    publishDir "${params.outdir}", mode:'copy'

    input:
    set datasetIDA, file(x) from datasetA

    output:
    file ("${x.baseName}_fastqc.html") into fastqc_ch
            
    script:
    """
    fastqc -Xmx20g $x > ${x.baseName}_fastqc.html
    """
}

配置文件


process {
    withName:fastqc                            { container = 'staphb/fastqc:latest' }
}

最佳答案

问题是 Docker execution默认情况下不启用。当它被禁用时,Nextflow 只是尝试在容器外部执行进程。要启用 Docker 执行,请将以下行添加到您的 Nextflow 配置中:

docker.enabled = true

Nextflow 查找 configuration files在多个地方。检查两台机器是否使用同一组配置文件。例如,一台计算机可能已在其 $HOME/.nextflow/config 中设置了上述内容,但另一台计算机上可能不存在该文件。

测试:

$ touch {A,B,C}.fastq
$ cat nextflow.config 
docker.enabled = true

process {
  withName: 'fastqc' {
    container = 'staphb/fastqc:latest'
  }
}

结果:

$ nextflow run main.nf -dsl1
N E X T F L O W  ~  version 22.04.4
Launching `main.nf` [jolly_brown] DSL1 - revision: 2c6f171a28
executor >  local (3)
[97/7b5758] process > fastqc (B) [100%] 3 of 3 ✔
Completed at: 03-Oct-2022 21:08:43
Duration    : 2m 50s
CPU hours   : 0.1
Succeeded   : 3

关于docker - Nextflow配置文件问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73933649/

相关文章:

dns - 在公司网络上构建镜像期间网络调用失败

.net - 在不需要的地方运行 dotnet 的 Rider 中的 Docker-compose

docker - Nginx 在多容器 docker compose 设置中找不到上游主机

c - 在 C 语言中,通用容器还是安全容器?

unix - Docker - 无法远程登录链接的容器

Nextflow DSL2 : how to combine outputs (channels) from multiple processes into input of another process by part of filename?

Snakemake 显式处理内存不足 (OOM) 故障

python - 如何在 Web 应用程序的 Docker 镜像中安装并启动 CouchDB 服务器?

kubernetes - Nextflow 未使用正确的服务帐户将工作流部署到 ​​Kubernetes

docker - 删除容器 docker for mac 的日志