Skip to content

Commit

Permalink
Check scaled values in range between 0-100
Browse files Browse the repository at this point in the history
  • Loading branch information
sgsutcliffe committed Dec 12, 2024
1 parent 8de39dd commit a70d030
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions workflows/fastmatchirida.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit a70d030

Please sign in to comment.