Commit b95a495f authored by Jean Mainguy's avatar Jean Mainguy
Browse files

add additional checking for kaiju db dir

parent a4d66930
...@@ -25,11 +25,18 @@ workflow DATABASES { ...@@ -25,11 +25,18 @@ workflow DATABASES {
INDEX_KAIJU(params.kaiju_db_url) INDEX_KAIJU(params.kaiju_db_url)
ch_kaiju_db = INDEX_KAIJU.out.kaiju_db ch_kaiju_db = INDEX_KAIJU.out.kaiju_db
} else if (params.kaiju_db_dir) { } else if (params.kaiju_db_dir) {
if (file(params.kaiju_db_dir + "/kaiju_db*.fmi").size == 1) { if (file(params.kaiju_db_dir + "/kaiju_db*.fmi").size == 1) {
ch_kaiju_db = Channel.value([file(params.kaiju_db_dir + "/nodes.dmp"), file(params.kaiju_db_dir + "/kaiju_db*.fmi"), file(params.kaiju_db_dir + "/names.dmp")]) ch_kaiju_db = Channel.value([file(params.kaiju_db_dir + "/nodes.dmp"), file(params.kaiju_db_dir + "/kaiju_db*.fmi"), file(params.kaiju_db_dir + "/names.dmp")])
} else { }
exit 1, "There is more than one file ending with .fmi in ${params.kaiju_db_dir}" else if (!file(params.kaiju_db_dir).isDirectory()) {
} exit 1, "kaiju_db_dir ${params.kaiju_db_dir} does not exists."
}
else if (file(params.kaiju_db_dir + "/kaiju_db*.fmi").size > 1) {
exit 1, "There is more than one file ending with .fmi in kaiju_db_dir: ${params.kaiju_db_dir}"
}
else if (file(params.kaiju_db_dir + "/kaiju_db*.fmi").size == 0) {
exit 1, "There is no file ending with .fmi in kaiju_db_dir: ${params.kaiju_db_dir}"
}
} else { } else {
exit 1, "You must specify --kaiju_db_url or --kaiju_db_dir" exit 1, "You must specify --kaiju_db_url or --kaiju_db_dir"
} }
......
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