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

Fix genomeAttribute usage #1252

Merged
merged 11 commits into from
Apr 22, 2024
28 changes: 14 additions & 14 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,28 @@ include { RNASEQ } from './workflows/rnaseq'
include { PREPARE_GENOME } from './subworkflows/local/prepare_genome'
include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_rnaseq_pipeline'
include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_rnaseq_pipeline'
include { getGenomeAttribute } from './subworkflows/local/utils_nfcore_rnaseq_pipeline'
include { checkMaxContigSize } from './subworkflows/local/utils_nfcore_rnaseq_pipeline'
include { getGenomeAttribute } from './subworkflows/local/utils_nfcore_rnaseq_pipeline'

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GENOME PARAMETER VALUES
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

params.fasta = getGenomeAttribute('fasta')
params.transcript_fasta = getGenomeAttribute('transcript_fasta')
params.additional_fasta = getGenomeAttribute('additional_fasta')
params.gtf = getGenomeAttribute('gtf')
params.gff = getGenomeAttribute('gff')
params.gene_bed = getGenomeAttribute('bed12')
params.bbsplit_index = getGenomeAttribute('bbsplit')
params.sortmerna_index = getGenomeAttribute('sortmerna')
params.star_index = getGenomeAttribute('star')
params.hisat2_index = getGenomeAttribute('hisat2')
params.rsem_index = getGenomeAttribute('rsem')
params.salmon_index = getGenomeAttribute('salmon')
params.kallisto_index = getGenomeAttribute('kallisto')
getGenomeAttribute('additional_fasta', 'additional_fasta')
getGenomeAttribute('bbsplit', 'bbsplit_index')
getGenomeAttribute('bed12', 'gene_bed')
getGenomeAttribute('fasta', 'fasta')
getGenomeAttribute('gff', 'gff')
getGenomeAttribute('gtf', 'gtf')
getGenomeAttribute('hisat2', 'hisat2')
getGenomeAttribute('kallisto', 'kallisto_index')
getGenomeAttribute('rsem', 'rsem')
getGenomeAttribute('salmon', 'salmon')
getGenomeAttribute('sortmerna', 'sortmerna_index')
getGenomeAttribute('star', 'star_index')
getGenomeAttribute('transcript_fasta', 'transcript_fasta')

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ params {
// Schema validation default options
validationFailUnrecognisedParams = false
validationLenientMode = false
validationSchemaIgnoreParams = 'genomes,igenomes_base,additional_fasta,bbsplit_index,fasta,gene_bed,gff,gtf,hisat2_index,kallisto_index,rsem_index,salmon_index,star_index,transcript_fasta'
validationSchemaIgnoreParams = 'genomes,igenomes_base'
validationShowHiddenParams = false
validate_params = true

Expand Down
13 changes: 5 additions & 8 deletions subworkflows/local/utils_nfcore_rnaseq_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,12 @@ def validateInputParameters() {
}

//
// Get attribute from genome config file e.g. fasta
// Get key from genome config file e.g. fasta, and initialize a params with the given attribute
//
def getGenomeAttribute(attribute) {
if (params.genomes && params.genome && params.genomes.containsKey(params.genome)) {
if (params.genomes[ params.genome ].containsKey(attribute)) {
return params.genomes[ params.genome ][ attribute ]
}
}
return null
def getGenomeAttribute(key, attribute) {
if ((params.genomes && params.genome && params.genomes.containsKey(params.genome) && params.genomes[ params.genome ].containsKey(key) )) {
params."$attribute" = params.genomes[ params.genome ][ key ]
} else params."$attribute" = null
maxulysse marked this conversation as resolved.
Show resolved Hide resolved
}

//
Expand Down
Loading