展开

nextflow plugin

最后发布时间 : 2023-12-24 13:07:32 浏览量 :

nextflow restful api example
https://github.com/nextflow-io/nf-tweet/blob/master/plugins/nf-tweet/src/main/nextflow/tweet/TweetExtension.groovy

./nextflow plugin install nf-hello

gitpod ~/.nextflow/plugins $ tree .
.
└── nf-hello-0.3.0
    ├── classes
    │   ├── META-INF
    │   │   ├── extensions.idx
    │   │   └── MANIFEST.MF
    │   └── nextflow
    │       └── hello
    │           ├── HelloExtension$_goodbye_closure2.class
    │           ├── HelloExtension$_goodbye_closure3.class
    │           ├── HelloExtension$_randomString_closure4$_closure5.class
    │           ├── HelloExtension$_randomString_closure4.class
    │           ├── HelloExtension$_reverse_closure1.class
    │           ├── HelloExtension.class
    │           ├── HelloFactory.class
    │           ├── HelloObserver.class
    │           └── HelloPlugin.class
    └── META-INF
        └── MANIFEST.MF
gitpod ~/.nextflow/plugins/nf-sqldb-0.5.0 (master) $ tree .
.
├── classes
│   ├── META-INF
│   │   ├── extensions.idx
│   │   └── MANIFEST.MF
│   └── nextflow
│       └── sql
│           ├── ChannelSqlExtension$_dataSourceFromOpts_closure2.class
│           ├── ChannelSqlExtension$_queryToChannel_closure1.class
│           ├── ChannelSqlExtension$_sqlInsert_closure3.class
│           ├── ChannelSqlExtension$_sqlInsert_closure4.class
│           ├── ChannelSqlExtension.class
│           ├── config
│           │   ├── SqlConfig.class
│           │   └── SqlDataSource.class
│           ├── InsertHandler$_closure1.class
│           ├── InsertHandler$_cols0_closure2.class
│           ├── InsertHandler$_fetchColNames1_closure5.class
│           ├── InsertHandler$_performAsMap_closure3.class
│           ├── InsertHandler$_performAsTuple_closure4.class
│           ├── InsertHandler.class
│           ├── QueryHandler$_queryAsync_closure1.class
│           ├── QueryHandler.class
│           ├── QueryOp.class
│           └── SqlPlugin.class
├── lib
│   ├── AthenaJDBC42_2.0.25.1001.jar
│   ├── checker-qual-3.5.0.jar
│   ├── duckdb_jdbc-0.3.0.jar
│   ├── groovy-sql-3.0.10.jar
│   ├── h2-1.4.200.jar
│   ├── mariadb-java-client-2.7.0.jar
│   ├── mysql-connector-java-8.0.22.jar
│   ├── postgresql-42.2.23.jar
│   ├── protobuf-java-3.11.4.jar
│   └── sqlite-jdbc-3.36.0.3.jar
└── META-INF
    └── MANIFEST.MF

./nextflow run main.nf -plugins nf-hello

#!/usr/bin/env nextflow
nextflow.enable.dsl=2 

process sayHello {
  input: 
    val x
  output:
    path("${x}.txt")
  script:
    """
    sleep 1
    echo '$x world!' > ${x}.txt
    """
}


println params.input
include { randomString } from 'plugin/nf-hello'

workflow {
  Channel.of('Bonjour', 'Ciao', 'Hello', 'Hola') | sayHello   
   println(randomString(5))
}

Executors

import nextflow.executor.Executor
import nextflow.util.ServiceName
import org.pf4j.ExtensionPoint

@ServiceName('my-executor')
class MyExecutor extends Executor implements ExtensionPoint {

    // ...

}
process foo {
    executor 'my-executor'
}