Skip to content

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

Description

@jerdra

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions