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

mirtrace_species variable not defined #488

Closed
kopichris opened this issue Dec 12, 2024 · 4 comments
Closed

mirtrace_species variable not defined #488

kopichris opened this issue Dec 12, 2024 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@kopichris
Copy link

kopichris commented Dec 12, 2024

Description of the bug

According to the docs, the --mirtrace_species variable is set when the --genome variable is defined; however, setting the --genome parameter results in the following error:

Reference species for miRTrace is not defined via the `--mirtrace_species` parameter.

The error occurs because the --mirtrace_species variable is not globally defined, and is accessed by a function that does not have access to it in the pipeline_initialisation workflow:

def validateInputParameters() {
    genomeExistsError()

    if (!params.mirgenedb && !params.mirtrace_species) {
            error("Reference species for miRTrace is not defined via the `--mirtrace_species` parameter.")
    }
...

I am working on making a pull request to the dev branch if there are no issues!

Command used and terminal output

$ nextflow run main.nf -profile docker --input samplesheet.csv --outdir debug_test --genome "GRCh38"

 N E X T F L O W   ~  version 24.04.2

Launching `main.nf` [adoring_bell] DSL2 - revision: 96a86dc2ea

[-        ] process > PREPARE_GENOME:CLEAN_FASTA  -
[-        ] process > PREPARE_GENOME:INDEX_GENOME -
Reference species for miRTrace is not defined via the `--mirtrace_species` parameter.

Relevant files

No response

System information

Nextflow version: 24.04.2
Hardware: HPC
Executor: local
Container engine: Docker
OS: Linux
Version of nf-core/smrnaseq: 2.4.0

@kopichris kopichris added the bug Something isn't working label Dec 12, 2024
@nschcolnicov
Copy link
Contributor

nschcolnicov commented Dec 12, 2024

Hi @kopichris Thanks for opening this issue, I see that you are right. The validateInput() function is running before these parameters have a chance to be set with params.mirtrace_species = getGenomeAttribute('mirtrace_species').
Also tagging @atrigila who suggested that validateInput() was the one causing this issue.
Please tag me or her on the PR once its ready

@kopichris
Copy link
Author

kopichris commented Dec 13, 2024

Hi @nschcolnicov, that's what I suspected at first too, but I think it's just a parameter visibility issue.

The params.mirtrace_species is correctly defined and set prior to validateInputParameters() being called - this can be seen on line 31 in main.nf.

The parameter is then passed as input to the prepare_genome workflow, where the following check happens:

if (!params.mirgenedb && !val_mirtrace_species) {
    exit 1, "Reference species for miRTrace is not defined via the --mirtrace_species parameter."
}

A similar check is subsequently performed within the pipeline_initialisation workflow, where the validateInputParameters() function is implemented:

if (!params.mirgenedb && !params.mirtrace_species) {
    error("Reference species for miRTrace is not defined via the `--mirtrace_species` parameter.")
}

The error occurs because params.mirtrace_species was not passed as input to the pipeline_initialization workflow, so params.mirtrace_species is null instead of hsa, for example.

I chose to remove this logic from the pipeline_initialization workflow because it was already being correctly handled in prepare_genome (69ef3aa).

Thoughts @nschcolnicov @atrigila?

@nschcolnicov
Copy link
Contributor

@kopichris I think that change makes sense, not sure why the same check is run twice, probably some leftover code that we missed when refactoring the pipeline. Please go ahead and create the PR. Thanks for looking into this! 😄

@apeltzer apeltzer added this to the 2.4.2 milestone Dec 16, 2024
@atrigila
Copy link
Contributor

Closed via #493 . Thank you for reporting this issue and the proposed solution :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants