Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create config utils module for managing common functions in config #14

Open
jerdra opened this issue Dec 2, 2020 · 0 comments
Open

Comments

@jerdra
Copy link
Owner

jerdra commented Dec 2, 2020

Some groovy code snippets are duplicated across config files. For example the snippet:

Closure get_partition;
if (partition instanceof Closure){
    get_partition = partition
}else{
    get_partition = { t -> partition }
}

Closure cacheDir;
if (params.cache_dir){
    cacheDir = { f ->
                    def d = new File("$params.cache_dir/$f")
                    d.mkdirs()
                    "$params.cache_dir/$f"
               }
}else{
    cacheDir = { f -> "" }
}

Is re-used in multiple config files. Originally thought to define all config specs in the main boonstim.nf.config file but the scope induced by includeConfig doesn't seem to carry over function definitions - they are local.

The solution here would be to create a groovy script containing function definitions that can be imported in each of the config files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant