Я только начал изучать nextflow и столкнулся со странной ошибкой, для которой мне нужно руководство.
Вот мой код
#!/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()
}
Когда я запускаю код с
nextflow run example1.nf
Я принимаю следующую ОШИБКУ:
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
когда я смотрю на
less .nextflow.log
я вижу это
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: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
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
, но это не влияет на мой код. Я знаю, что это глупый вопрос, но некоторые рекомендации на этом уровне могли бы помочь мне начать плавно.
Нет такой переменной: результат
Nextflow жалуется, потому что вы пытаетесь вызвать оператора подписки на канале, который еще не определен. Используя новый DSL 2, вам просто нужно определить блок рабочего процесса, чтобы иметь возможность вызывать процесс:
params.greeting = 'Hello world!'
process test {
"""
echo '${params.greeting}'
"""
}
workflow {
test()
}
Результаты:
$ 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 . Чтобы просмотреть элементы в выходном канале, просто вызовите view, чтобы распечатать их на консоли:
params.greeting = 'Hello world!'
process test {
output:
stdout
"""
echo '${params.greeting}'
"""
}
workflow {
result = test()
result.view()
}
Результаты:
$ 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!
Большое спасибо, Стив. Этот ответ был таким поучительным