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

authorized several steps into --step

parent 0ddd21bd
......@@ -87,12 +87,14 @@
*/
// Show help message.
if (params.help){
helpMessage()
exit 0
}
// Define list of available steps
// Define list of available steps.
def defineStepList() {
return [
'01_clean_qc',
......@@ -106,7 +108,7 @@ def defineStepList() {
]
}
// Check step existence
// Check step existence.
def checkParameterExistence(list_it, list) {
nb_false_step = 0
......@@ -120,27 +122,13 @@ def checkParameterExistence(list_it, list) {
else {return true}
}
// 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}
}
}
// Check number of steps.
// Set up parameters.
step = params.step.split(",")
stepList = defineStepList()
if (!checkParameterExistence(step, stepList)) exit 1, "Unknown step ${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 (!checkParameterExistence(step, stepList)) exit 1, "Unknown step(s) upon ${step}, see --help for more information"
if (!['metaspades','megahit'].contains(params.assembly)){
exit 1, "Invalid aligner option: ${params.assembly}. Valid options: 'metaspades', 'megahit'"
......
Markdown is supported
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