构建 BLAST 管道时出现 Nextflow DSL2 错误

问题描述 投票:0回答:1
''' #! /usr/bin/env nextflow

    nextflow.enable.dsl=2

    println "\nI want to BLAST $params.query to $params.dbDir/$params.dbName using $params.threads CPUs and output it to $params.outdir\n"
  
  
    process runBlast {

    script:
        """
        blastn  -num_threads $params.threads -db $params.dbDir/$params.dbName -query $params.query -outfmt 6 -out input.blastout
        """

    }


    params {
    query = "$PWD/input.fasta"
    dbDir = "$PWD/DB/"
    dbName = "blastDB"
    threads = 2
    outdir = "out_dir"
    }

我应该将什么工作流 {} 语句添加到 main.nf 文件中?基本的 BLAST 命令可以工作,但添加到命令行时不需要附加参数。我得到的错误如下:

错误〜没有这样的变量:查询

如果可以请帮忙,谢谢!

我一直在关注这个教程: https://bioinformaticsworkbook.org/dataAnalysis/nextflow/02_creatingAworkflow.html#gsc.tab=0

并使用此 DSL2 文档获取支持: https://www.nextflow.io/docs/latest/dsl2.html

dsl nextflow blast
1个回答
0
投票

请仔细检查该教程。

params
范围应写入
projectDir
中名为
nextflow.config
的单独文件中,而不是写入
main.nf
中。但如果你确实把它写在
main.nf
中,你需要确保它位于脚本的顶部,否则
params.query
将不会被设置。

关于您关于工作流程的问题:我认为您应该首先了解一下

Channels
的概念,而不是使用任何工作流程中编写的流程。快速浏览完该教程后,我发现很难了解 nextflow 的真正含义,并且只会向读者抛出无法开箱即用的代码片段。另外,我发现它不是很有帮助,它很早就引入了参数,但没有处理输入/输出,并且在第 9 节之前没有提到
Channels
。也许你应该从官方文档的基本概念开始? https://www.nextflow.io/docs/latest/basic.html

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