Commit d6933e91 authored by Joanna Fourquet's avatar Joanna Fourquet
Browse files

authorized several steps into --step

parent 0ddd21bd
...@@ -87,12 +87,14 @@ ...@@ -87,12 +87,14 @@
*/ */
// Show help message. // Show help message.
if (params.help){ if (params.help){
helpMessage() helpMessage()
exit 0 exit 0
} }
// Define list of available steps // Define list of available steps.
def defineStepList() { def defineStepList() {
return [ return [
'01_clean_qc', '01_clean_qc',
...@@ -106,7 +108,7 @@ def defineStepList() { ...@@ -106,7 +108,7 @@ def defineStepList() {
] ]
} }
// Check step existence // Check step existence.
def checkParameterExistence(list_it, list) { def checkParameterExistence(list_it, list) {
nb_false_step = 0 nb_false_step = 0
...@@ -120,27 +122,13 @@ def checkParameterExistence(list_it, list) { ...@@ -120,27 +122,13 @@ def checkParameterExistence(list_it, list) {
else {return true} else {return true}
} }
// Check number of steps // Check number of steps.
def numberParameter(list_it, list) {
nb_step = 0
filtering_step = false
for(it in list_it) {
nb_step = nb_step + 1
if(it == '03_filtering') {filtering_step = true}
}
if(nb_step > 2) {return false}
else {
if((nb_step == 2) && (!filtering_step)){return false}
else {return true}
}
}
// Set up parameters. // Set up parameters.
step = params.step.split(",") step = params.step.split(",")
stepList = defineStepList() stepList = defineStepList()
if (!checkParameterExistence(step, stepList)) exit 1, "Unknown step ${step}, see --help for more information" if (!checkParameterExistence(step, stepList)) exit 1, "Unknown step(s) upon ${step}, see --help for more information"
if (!numberParameter(step, stepList)) exit 1, "You can choose one step (or two step only if one of two is 03_filtering step)"
if (!['metaspades','megahit'].contains(params.assembly)){ if (!['metaspades','megahit'].contains(params.assembly)){
exit 1, "Invalid aligner option: ${params.assembly}. Valid options: 'metaspades', 'megahit'" exit 1, "Invalid aligner option: ${params.assembly}. Valid options: 'metaspades', 'megahit'"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment