首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >Nextflow中的错误nextflow.cli.Launcher -@未知

Nextflow中的错误nextflow.cli.Launcher -@未知
EN

Stack Overflow用户
提问于 2022-10-02 11:55:37
回答 1查看 80关注 0票数 1

我刚刚开始学习nextflow,我遇到了一个奇怪的错误,我寻求一些指导。

这是我的密码

代码语言:javascript
代码运行次数:0
运行
复制
#!/usr/bin/env nextflow  
// Example1 from https://gist.github.com/elowy01/e9995d7ee8d6305930f868a10aeabbe9


params.str = 'Hello world!'

process AFcalc {

    """
    echo  '${params.str}'
    """
}

//this is necessary to print the output
result.subscribe {
    println it.trim()
}

当我运行代码时

代码语言:javascript
代码运行次数:0
运行
复制
nextflow run example1.nf 

我犯了以下错误:

代码语言:javascript
代码运行次数:0
运行
复制
N E X T F L O W  ~  version 22.04.5
Launching `example1.nf` [nostalgic_brahmagupta] DSL2 - revision: 17976728a8
No such variable: result
 -- Check script 'example1.nf' at line: 15 or see '.nextflow.log' file for more details

当我看着

代码语言:javascript
代码运行次数:0
运行
复制
less .nextflow.log

我看到了这个

代码语言:javascript
代码运行次数:0
运行
复制
Oct-02 13:51:35.370 [main] DEBUG nextflow.cli.Launcher - $> nextflow run example1.nf
Oct-02 13:51:35.413 [main] INFO  nextflow.cli.CmdRun - N E X T F L O W  ~  version 22.04.5
Oct-02 13:51:35.446 [main] DEBUG nextflow.cli.CmdRun - Applied DSL=2 by global default
Oct-02 13:51:35.460 [main] INFO  nextflow.cli.CmdRun - Launching `example1.nf` [nostalgic_brahmagupta] DSL2 - revision: 17976728a8
Oct-02 13:51:35.468 [main] DEBUG nextflow.plugin.PluginsFacade - Setting up plugin manager > mode=prod; plugins-dir=/Users/theodosiou/.nextflow/plugins; core-plugins: nf-amazon@1.7.2,nf-azure@0.13.2,nf-console@1.0.3,nf-ga4gh@1.0.3,nf-google@1.1.4,nf-sqldb@0.4.0,nf-tower@1.4.0
Oct-02 13:51:35.469 [main] DEBUG nextflow.plugin.PluginsFacade - Plugins default=[]
Oct-02 13:51:35.474 [main] INFO  org.pf4j.DefaultPluginStatusProvider - Enabled plugins: []
Oct-02 13:51:35.474 [main] INFO  org.pf4j.DefaultPluginStatusProvider - Disabled plugins: []
Oct-02 13:51:35.476 [main] INFO  org.pf4j.DefaultPluginManager - PF4J version 3.4.1 in 'deployment' mode
Oct-02 13:51:35.481 [main] INFO  org.pf4j.AbstractPluginManager - No plugins
Oct-02 13:51:35.511 [main] DEBUG nextflow.Session - Session uuid: ef770a53-e834-4fcd-8ae5-6216009b4ebc
Oct-02 13:51:35.511 [main] DEBUG nextflow.Session - Run name: nostalgic_brahmagupta
Oct-02 13:51:35.512 [main] DEBUG nextflow.Session - Executor pool size: 8
Oct-02 13:51:35.831 [main] DEBUG nextflow.cli.CmdRun - 
  Version: 22.04.5 build 5708
  Created: 15-07-2022 16:09 UTC (18:09 CEST)
  System: Mac OS X 12.6
  Runtime: Groovy 3.0.10 on Java HotSpot(TM) 64-Bit Server VM 17+35-LTS-2724
  Encoding: UTF-8 (UTF-8)
  Process: 50922@LOUKASs-Air [192.168.0.207]
  CPUs: 8 - Mem: 16 GB (90.5 MB) - Swap: 2 GB (356.6 MB)
Oct-02 13:51:35.840 [main] DEBUG nextflow.Session - Work-dir: /Users/theodosiou/Documents/Projects/nextflow/nextflow-example/work [Mac OS X]
Oct-02 13:51:35.840 [main] DEBUG nextflow.Session - Script base path does not exist or is not a directory: /Users/theodosiou/Documents/Projects/nextflow/nextflow-example/bin
Oct-02 13:51:35.846 [main] DEBUG nextflow.executor.ExecutorFactory - Extension executors providers=[]
Oct-02 13:51:35.851 [main] DEBUG nextflow.Session - Observer factory: DefaultObserverFactory
Oct-02 13:51:35.861 [main] DEBUG nextflow.cache.CacheFactory - Using Nextflow cache factory: nextflow.cache.DefaultCacheFactory
Oct-02 13:51:35.867 [main] DEBUG nextflow.util.CustomThreadPool - Creating default thread pool > poolSize: 9; maxThreads: 1000
Oct-02 13:51:35.903 [main] DEBUG nextflow.Session - Session start invoked
Oct-02 13:51:36.227 [main] DEBUG nextflow.script.ScriptRunner - > Launching execution
Oct-02 13:51:36.235 [main] DEBUG nextflow.Session - Session aborted -- Cause: No such property: result for class: Script_0f3fefb4
Oct-02 13:51:36.241 [main] ERROR nextflow.cli.Launcher - @unknown
groovy.lang.MissingPropertyException: No such property: result for class: Script_0f3fefb4
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:65)
        at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:51)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:341)
        at Script_0f3fefb4.runScript(Script_0f3fefb4:15)
        at nextflow.script.BaseScript.runDsl2(BaseScript.groovy:170)
        at nextflow.script.BaseScript.run(BaseScript.groovy:217)
        at nextflow.script.ScriptParser.runScript(ScriptParser.groovy:220)
        at nextflow.script.ScriptRunner.run(ScriptRunner.groovy:212)
        at nextflow.script.ScriptRunner.execute(ScriptRunner.groovy:120)
        at nextflow.cli.CmdRun.run(CmdRun.groovy:337)
        at nextflow.cli.Launcher.run(Launcher.groovy:480)
        at nextflow.cli.Launcher.main(Launcher.groovy:639)

我查看了其他建议将DSL=1更改为DSL=2的帖子,但这并不影响我的代码。我知道这是个愚蠢的问题,但在这个层次上的一些指导可能会帮助我踢得很顺利。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-10-02 13:50:27

没有这样的变量:结果

Nextflow抱怨是因为您试图在尚未定义的通道上调用subscribe操作符。使用新的DSL 2,只需定义一个工作流块就可以调用流程:

代码语言:javascript
代码运行次数:0
运行
复制
params.greeting = 'Hello world!'


process test {

    """
    echo '${params.greeting}'
    """
}

workflow {

    test()
}

结果:

代码语言:javascript
代码运行次数:0
运行
复制
$ nextflow run example1.nf 
N E X T F L O W  ~  version 22.04.4
Launching `example1.nf` [suspicious_bell] DSL2 - revision: 71213886a4
executor >  local (1)
[cc/9abb46] process > test [100%] 1 of 1 ✔

然后,要通过通道发送测试过程的stdout,只需定义一个输出块。在这个简单的例子中,您可以在这里使用stdout限定符。要查看输出通道中的项,只需调用视图将其打印到控制台:

代码语言:javascript
代码运行次数:0
运行
复制
params.greeting = 'Hello world!'


process test {

    output:
    stdout

    """
    echo '${params.greeting}'
    """
}

workflow {

    result = test()

    result.view()
}

结果:

代码语言:javascript
代码运行次数:0
运行
复制
$ nextflow run example1.nf 
N E X T F L O W  ~  version 22.04.4
Launching `example1.nf` [curious_raman] DSL2 - revision: 1fa31253d3
executor >  local (1)
[4e/bcd504] process > test [100%] 1 of 1 ✔
Hello world!
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73925605

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档