From d09808c9c56d31a20f2aac5857d65176032e8d73 Mon Sep 17 00:00:00 2001 From: replikation Date: Wed, 10 Jan 2024 12:29:41 +0100 Subject: [PATCH] DB quick fix --- workflows/phage_annotation_wf.nf | 10 +++++----- workflows/phage_tax_classification_wf.nf | 21 +++++---------------- workflows/pprmeta_wf.nf | 7 +------ workflows/sourmash_wf.nf | 18 +++--------------- 4 files changed, 14 insertions(+), 42 deletions(-) diff --git a/workflows/phage_annotation_wf.nf b/workflows/phage_annotation_wf.nf index 6dff716..fb32e0d 100644 --- a/workflows/phage_annotation_wf.nf +++ b/workflows/phage_annotation_wf.nf @@ -17,12 +17,12 @@ workflow phage_annotation_wf { //Databases //Database for hmmscan // local storage via storeDir - if (!params.cloudProcess) { pvog_DB(); db = pvog_DB.out } + if (!params.cloudProcess) { pvog_DB(); dbpvog = pvog_DB.out } // cloud storage via db_preload.exists() if (params.cloudProcess) { db_preload = file("${params.databases}/pvogs/", type: 'dir') - if (db_preload.exists()) { db = db_preload } - else { pvog_DB(); db = pvog_DB.out } + if (db_preload.exists()) { dbpvog = db_preload } + else { pvog_DB(); dbpvog = pvog_DB.out } } //Vog table // local storage via storeDir @@ -35,9 +35,9 @@ workflow phage_annotation_wf { } //annotation-process prodigal(fasta) - if (!params.annotation_db) {hmmscan(prodigal.out, pvog_DB.out)} + if (!params.annotation_db) {hmmscan(prodigal.out, dbpvog)} else {hmmscan(prodigal.out, annotation_custom_db_ch)} - chromomap_parser(fasta.join(hmmscan.out), vogtable_DB.out) + chromomap_parser(fasta.join(hmmscan.out), db) chromomap(chromomap_parser.out[0].mix(chromomap_parser.out[1])) annotationtable_markdown_input = chromomap_parser.out.annotationfile_combined_ch diff --git a/workflows/phage_tax_classification_wf.nf b/workflows/phage_tax_classification_wf.nf index e5d8558..64fce02 100644 --- a/workflows/phage_tax_classification_wf.nf +++ b/workflows/phage_tax_classification_wf.nf @@ -7,23 +7,12 @@ workflow phage_tax_classification_wf { take: fasta_and_tool_results main: fasta = fasta_and_tool_results.map {it -> tuple(it[0],it[1])} - // local storage via storeDir - if (!params.cloudProcess) { download_references(); db = download_references.out } - // cloud storage via db_preload.exists() - if (params.cloudProcess) { - db_preload = file("${params.databases}/references/phage_references.fa") - if (db_preload.exists()) { db = db_preload } - else { download_references(); db = download_references.out } - } + // get refs + download_references() // sourmash db build - // local storage via storeDir - if (!params.cloudProcess) { sourmash_download_DB(download_references.out); db = sourmash_download_DB.out } - // cloud storage via db_preload.exists() - if (params.cloudProcess) { - db_preload = file("${params.databases}/sourmash/phages.sbt.zip") - if (db_preload.exists()) { db = db_preload } - else { sourmash_download_DB(references); db = sourmash_download_DB.out } - } + sourmash_download_DB(download_references.out) + sourmash_for_tax(split_multi_fasta_2(fasta), sourmash_download_DB.out).groupTuple(remainder: true) + emit: sourmash_for_tax.out } \ No newline at end of file diff --git a/workflows/pprmeta_wf.nf b/workflows/pprmeta_wf.nf index 9268a89..d58d065 100644 --- a/workflows/pprmeta_wf.nf +++ b/workflows/pprmeta_wf.nf @@ -6,13 +6,8 @@ include { ppr_download_dependencies } from './process/pprmeta/ppr_download_depen workflow pprmeta_wf { take: fasta main: if (!params.pp) { - if (!params.cloudProcess) { ppr_download_dependencies(); db = ppr_download_dependencies.out } + ppr_download_dependencies() // cloud storage via db_preload.exists() - if (params.cloudProcess) { - db_preload = file("${params.databases}/pprmeta/PPR-Meta", type: 'dir') - if (db_preload.exists()) { db = db_preload } - else { ppr_download_dependencies(); db = ppr_download_dependencies.out } - } filter_PPRmeta(pprmeta(fasta, ppr_download_dependencies.out).groupTuple(remainder: true)) // raw data collector diff --git a/workflows/sourmash_wf.nf b/workflows/sourmash_wf.nf index 1eaed01..c931784 100644 --- a/workflows/sourmash_wf.nf +++ b/workflows/sourmash_wf.nf @@ -10,22 +10,10 @@ workflow sourmash_wf { main: if (!params.sm) { // local storage via storeDir - if (!params.cloudProcess) { download_references(); db = download_references.out } - // cloud storage via db_preload.exists() - if (params.cloudProcess) { - db_preload = file("${params.databases}/references/phage_references.fa") - if (db_preload.exists()) { db = db_preload } - else { download_references(); db = download_references.out } - } + download_references() // sourmash db build - // local storage via storeDir - if (!params.cloudProcess) { sourmash_download_DB(download_references.out); db = sourmash_download_DB.out } - // cloud storage via db_preload.exists() - if (params.cloudProcess) { - db_preload = file("${params.databases}/sourmash/phages.sbt.zip") - if (db_preload.exists()) { db = db_preload } - else { sourmash_download_DB(references); db = sourmash_download_DB.out } - } + sourmash_download_DB(download_references.out) + // sourmash prediction filter_sourmash(sourmash(split_multi_fasta(fasta), sourmash_download_DB.out).groupTuple(remainder: true)) // raw data collector