Nextflow 配置中的 Conda 环境 withLabel 字段不起作用?

问题描述 投票:0回答:1

我试图强制在 withLabel 上下文中使用特定的 conda 环境。这是一个 nextflow 脚本示例:

process testConda {
    label 'test_process'

    script:
    """
    which conda
    conda env list
    echo "Current Conda env: \$CONDA_PREFIX"
    """
}

workflow {
    testConda()
}

通过

nextflow run test.nf -profile test

使用配置文件时可以使用
profiles {
    test {
        conda.enabled = true
        process {
            conda = "/data/user/miniconda3/envs/test" 
        }
    }
}

但是,如果我使用标签定义定义全局进程并运行

nextflow run test.nf
,它不起作用:

process {
    conda.enabled = true
    withLabel: 'test_process' {
        conda = "/data/user/miniconda3/envs/test"
        beforeScript = "echo 'Using test_process'"
    }
}

检查 .command.log 时,存在

Using test_process
,因此它使用了正确的配置,但标准输出表明它使用的是
base
env,而不是
test
。 conda 配置在 withLabel 上下文中不起作用吗?

conda nextflow
1个回答
0
投票

此配置适用于我使用 nextflow 版本 23.04.3.5875:

profiles {
  conda {
    conda.enabled = true
}
}

process {
    withLabel: foo {
        conda = '/data/user/miniconda3/envs/test'
    }
}

nextflow run main.nf -profile conda

当配置文件范围内未启用 conda 时,尝试将

withLabel
conda.enabled
组合对我来说也不起作用。

© www.soinside.com 2019 - 2024. All rights reserved.