Skip to content

Commit

Permalink
DB quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
replikation committed Jan 10, 2024
1 parent 18b39e0 commit d09808c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 42 deletions.
10 changes: 5 additions & 5 deletions workflows/phage_annotation_wf.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
21 changes: 5 additions & 16 deletions workflows/phage_tax_classification_wf.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
7 changes: 1 addition & 6 deletions workflows/pprmeta_wf.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 3 additions & 15 deletions workflows/sourmash_wf.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d09808c

Please sign in to comment.