Skip to content

Instantly share code, notes, and snippets.

@lindenb
Created January 3, 2023 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lindenb/9e3f9294b2cc3f4dd649dbcab4b94d56 to your computer and use it in GitHub Desktop.
Save lindenb/9e3f9294b2cc3f4dd649dbcab4b94d56 to your computer and use it in GitHub Desktop.
https://www.biostars.org/p/9549996/ nextflow class java groovy

with include{MyTest}

Cannot find a component with name 'MyTest' in module: .../20230103.nf.class/./class.nf

 -- Check script 'test.nf' at line: 2 or see '.nextflow.log' file for more details

without include{MyTest}

No such variable: MyTest
public class MyTest {
private static MyTest INSTANCE = new MyTest();
private MyTest() {
}
public static MyTest getInstance() {
return INSTANCE;
}
public String getMessage() {
return "Hello world";
}
}
process SAY {
input:
val(msg)
script:
"""
echo "${msg}"
"""
}
include {SAY;MyTest} from './class.nf'
nextflow.enable.dsl=2
workflow {
SAY( MyTest.getInstance().getMessage() )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment