GithubHelp home page GithubHelp logo

exomiser-test-nf's People

Contributors

julesjacobsen avatar

Watchers

 avatar

Forkers

cgpu

exomiser-test-nf's Issues

Provide absolut path to exomiser-data

If a relative path is provided, it is possible that Exomiser is trying to infer the absolute path but prepending the provided path with the absolut path of the directory where Exomiser is running from.

Inside the Nextflow process script, we only have access to the basename of the exomiser-data directory.
To find the directory we can use the unix command readlink -f (Stack Overflow reference) to capture the full path in a bash variable and provide it to exomiser.

--exomiser.data-directory='.'

The code could look like this:

ch_exomiser_data_path = Channel.fromPath("${params.exomiser_data_path}")
// Define Process
process run_exomiser {
    input:
    ...
    file(exomiser_data_path) from ch_exomiser_data_path

    output:
    ...

    script:
    """
    ABSOLUTE_EXOMISER_DATA_PATH=`readlink -f ${exomiser_data_path}`
    exomiser-cli  \
     --analysis exomiser_analysis.yml  \
     --spring.config.location=${template_application_properties}
     --exomiser.data-directory=\$ABSOLUTE_EXOMISER_DATA_PATH
     --exomiser.${params.assembly}.data-version=${params.assembly_data_version}
     --exomiser.phenotype.data-version=${params.phenotype_data_version}
    """
  }

NOTE:
Q: Why do we need to escape the dollar in this case --exomiser.data-directory=\$ABSOLUTE_EXOMISER_DATA_PATH?

A: Nextflow reserves the dollar for groovy variables. We created a bash variable with the snippet

ABSOLUTE_EXOMISER_DATA_PATH=`readlink -f ${exomiser_data_path}`

To use a bash variable within the script directive of a Nextflow process, escaping the $ with a backslash is required so that the variable is correctly evaluated as a bash variable and not groovy.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.