Skip to content

Commit 2950beb

Browse files
authored
Merge pull request #1633 from nf-core/copilot/sub-pr-1632
Add validation error for incompatible transcript_fasta and additional_fasta params
2 parents ae9bda9 + 81bda46 commit 2950beb

File tree

1 file changed

+10
-7
lines changed
  • subworkflows/local/utils_nfcore_rnaseq_pipeline

1 file changed

+10
-7
lines changed

subworkflows/local/utils_nfcore_rnaseq_pipeline/main.nf

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,16 @@ def validateInputParameters() {
267267
// (i.e., no pre-built salmon/kallisto index provided). If the user provides a pre-built
268268
// index that already contains the spike-ins, the combination is valid.
269269
if (params.additional_fasta) {
270-
def building_pseudo_index = (
271-
!params.skip_pseudo_alignment &&
272-
params.pseudo_aligner &&
273-
!params.salmon_index &&
274-
!params.kallisto_index
275-
)
276-
if (building_pseudo_index) {
270+
def needs_to_build_index = false
271+
if (!params.skip_pseudo_alignment && params.pseudo_aligner) {
272+
// Check if the relevant index for the selected pseudo-aligner is missing
273+
if (params.pseudo_aligner == 'salmon' && !params.salmon_index) {
274+
needs_to_build_index = true
275+
} else if (params.pseudo_aligner == 'kallisto' && !params.kallisto_index) {
276+
needs_to_build_index = true
277+
}
278+
}
279+
if (needs_to_build_index) {
277280
transcriptFastaAdditionalFastaError()
278281
}
279282
}

0 commit comments

Comments
 (0)