Skip to content
Snippets Groups Projects
Commit 30233108 authored by Celine Noirot's avatar Celine Noirot
Browse files

Add skip_clean if type=HiFi to avoid db download

Add check SR parameters
parent 26537612
No related branches found
No related tags found
3 merge requests!15DSL2,!13DSL2 version,!12Merge dsl2 in dev to finalize dsl1 to dsl2 transition
......@@ -23,7 +23,7 @@ include { DATABASES } from './subworkflows/00_databases'
Options:
01_clean_qc options:
--skip_01_clean_qc Skip 01_clean_qc step.
--skip_clean Skip 01_clean_qc step.
--adapter1 Sequence of adapter 1. Default: Illumina TruSeq adapter.
--adapter2 Sequence of adapter 2. Default: Illumina TruSeq adapter.
--skip_sickle Skip sickle process.
......@@ -72,6 +72,13 @@ include { DATABASES } from './subworkflows/00_databases'
""".stripIndent()
}
// Show help message.
if (params.help){
helpMessage()
exit 0
}
def getAndCheckHeader() {
File file = new File(params.input)
......@@ -115,12 +122,29 @@ workflow {
// Check mandatory parameters
////////////
// Start check samplesheet
////////////
if (params.input) { ch_input = file(params.input) } else { exit 1, 'Input samplesheet not specified!' }
skip_clean = params.skip_clean
if (params.type == 'SR') {
if (!['metaspades','megahit'].contains(params.assembly)){
exit 1, "Invalid short read aligner option: ${params.assembly}. Valid options: 'metaspades', 'megahit'"
}
if (!["solexa","illumina","sanger"].contains(params.quality_type)){
exit 1, "Invalid quality_type option: ${params.quality_type}. Valid options:'solexa','illumina','sanger'"
}
if (!(params.skip_removal_host) && !(params.host_fasta) && !(params.skip_clean)) {
exit 1, "You must specify --host_fasta or skip cleaning host step with option --skip_removal_host or skip all clean and qc modules with --skip_clean"
}
}
else {
skip_clean = true
}
println(params)
header = getAndCheckHeader()
Channel.from(file(params.input)
......@@ -142,12 +166,14 @@ Channel.from(file(params.input)
}
.set { ch_inputs }
ch_inputs.view { it -> "FF ${it} " }
////////////
// End check samplesheet
////////////
DATABASES ()
DATABASES (skip_clean)
ch_kaiju_db = DATABASES.out.kaiju_db
ch_eggnog_db = DATABASES.out.eggnog
ch_taxonomy = DATABASES.out.taxonomy
......
workflow DATABASES {
take :
skip_clean
main:
ch_kaiju_db = Channel.empty()
if (!params.skip_clean && !params.skip_kaiju) { //kaiju_db
if (!skip_clean && !params.skip_kaiju) { //kaiju_db
if (!params.kaiju_db_dir && params.kaiju_db_url) {
INDEX_KAIJU(params.kaiju_db)
ch_kaiju_db = INDEX_KAIJU.out.kaiju_db
println("INDEX_KAIJU")
INDEX_KAIJU(params.kaiju_db_url)
ch_kaiju_db = INDEX_KAIJU.out.kaiju_db_dir
} else if (params.kaiju_db_dir) {
if (file(params.kaiju_db_dir + "/kaiju_db*.fmi").size == 1) {
println("Creating kaiju_db channel")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment