From a70d03039ae8400c205711b74878cd8fb327fb09 Mon Sep 17 00:00:00 2001 From: Steven Sutcliffe Date: Thu, 12 Dec 2024 11:08:01 -0500 Subject: [PATCH] Check scaled values in range between 0-100 --- workflows/fastmatchirida.nf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/workflows/fastmatchirida.nf b/workflows/fastmatchirida.nf index 05c2698..122a4e2 100644 --- a/workflows/fastmatchirida.nf +++ b/workflows/fastmatchirida.nf @@ -131,10 +131,18 @@ workflow FASTMATCH { exit 1, "--pd_columns ${params.pd_columns}: Does not exist but was passed to the pipeline. Exiting now." } + // Check that only 'hamming' or 'scaled' are provided to pd_distm if ((params.pd_distm != 'hamming') & (params.pd_distm != 'scaled')) { exit 1, "'--pd_distm ${params.pd_distm}' is an invalid value. Please set to either 'hamming' or 'scaled'." } + // Check that when using scaled the threshold exists between 0-100 + if (params.pd_distm == 'scaled') { + if ((params.threshold < 0.0) || (params.threshold > 100.0)) { + exit 1, ("'--pd_distm ${params.pd_distm}' is set, but '--threshold ${params.threshold}' contains thresholds outside of range [0, 100]." + + " Please either set '--threshold' or adjust the threshold values.") + } + } // Options related to profile dists mapping_format = Channel.value(params.pd_outfmt)