diff --git a/main.nf b/main.nf index d98c6f9..bcdbe27 100644 --- a/main.nf +++ b/main.nf @@ -13,10 +13,53 @@ println "Starting time: $nextflow.timestamp" println "Workdir location:" println " $workflow.workDir\u001B[0m" println " " +// error codes +if (params.profile) { exit 1, "--profile is WRONG use -profile" } +if ( !workflow.revision ) { + println "\033[0;33mWARNING: It is recommended to use a stable relese version via -r." + println "Use 'nextflow info hoelzer/pocp' to check for available release versions.\033[0m\n" +} +// help if (params.help) { exit 0, helpMSG() } +// input error codes if (params.genomes == '' && params.proteins == '') {exit 1, "input missing, use either [--genomes] or [--proteins]"} if (params.genomes != '' && params.proteins != '') {exit 1, "provide one input, use either [--genomes] or [--proteins]"} if (params.genome && params.protein) {exit 1, "provide only one input, use either [--genome] or [--protein]"} +// print if default params are used: +if (params.evalue == '1e-5' && params.seqidentity == 0.4 && params.alnlength == 0.5 && !params.blastp ) { + if ( !workflow.revision ) { + println "\u001B[32mPOCP-nf was executed \033[0;31mwithout a stable release version\033[0m\u001B[32m and default paramters according to the original publication by Qin et al. (2014)." + } else { + println "\u001B[32mPOCP-nf was executed in version '${workflow.revision}' with default paramters according to the original publication by Qin et al. (2014)." + } + println "" + println "e-value:\t\t${params.evalue}" + println "Sequence identity:\t${params.seqidentity}" + println "Alignment length:\t${params.alnlength}" + println "\033[0m" + // print if NO default params are used +} else { + if ( !workflow.revision ) { + println "\033[0;31mPOCP-nf was executed without a stable release version and non-default paramters in comparison to the original publication by Qin et al. (2014)." + println "" + println "e-value used:\t\t${params.evalue}\t(original definition: 1e-5)" + println "Sequence identity used:\t${params.seqidentity}\t(original definition: 0.4)" + println "Alignment length used:\t${params.alnlength}\t(original definition: 0.5)" + } else { + println "\033[0;31mPOCP-nf was executed in version '${workflow.revision}' with non-default paramters in comparison to the original publication by Qin et al. (2014)." + println "" + println "e-value used:\t\t${params.evalue}\t(original definition: 1e-5)" + println "Sequence identity used:\t${params.seqidentity}\t(original definition: 0.4)" + println "Alignment length used:\t${params.alnlength}\t(original definition: 0.5)" + } + println "" + println "This will change your POCP results." + println "If you really want to use adjusted parameters, you must report them together with the used version of POCP-nf to ensure reproducibility!" + println "" + println "\033[0m" +} + + // genomes fasta input & --list support if (params.genomes && params.list) { genome_input_ch = Channel @@ -155,7 +198,7 @@ def helpMSG() { --evalue Evalue for DIAMOND protein search [default: $params.evalue] --seqidentity Sequence identity for DIAMOD alignments [default: $params.seqidentity] --alnlength Alignment length for DIAMOND hits [default: $params.alnlength] - --blastp Use BLASTP instead of DIAMOND for protein alignment (slower, as in the original 2014 publication) [default: $params.blastp] + --blastp Use BLASTP instead of DIAMOND for protein alignment (slower but as in the original 2014 publication) [default: $params.blastp] ${c_dim}Nextflow options: -with-report rep.html cpu / ram usage (may cause errors)