Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ workflow {
infiles = Channel.fromPath("${params.indir}/*${params.infile_extension}") // TODO: add input file extension as a parameter

infiles
.take(5)
.combine(bakta_db)
.set { infiles_and_bakta_db }

Expand Down Expand Up @@ -96,7 +97,10 @@ workflow {
.combine(bakta_db)
.set { rep_proteins_and_bakta_db }

ANNOTATE_PROTEINS(rep_proteins_and_bakta_db)
hmm_ch = params.user_hmms ? Channel.of(file(params.user_hmms)) : []
prots_ch = params.user_proteins ? Channel.of(file(params.user_proteins)) : []

ANNOTATE_PROTEINS(rep_proteins_and_bakta_db, hmm_ch, prots_ch)

//-----------------------------
// Merge annotations
Expand Down
6 changes: 6 additions & 0 deletions modules/annotate_proteins.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@ process ANNOTATE_PROTEINS {

input:
tuple path(proteins_fa), path(bakta_db)
path(user_hmms)
path(user_proteins)

output:
path("annotated_proteins_bakta/unique_proteins_annotation.json")

script:
user_proteins_bakta = user_proteins ? "--proteins ${user_proteins}" : ""
hmms_bakta = user_hmms ? "--hmms ${user_hmms}" : ""
"""
bakta_proteins --db ${bakta_db} \
--output annotated_proteins_bakta \
--prefix unique_proteins_annotation \
${user_proteins_bakta} \
${hmms_bakta} \
--threads ${task.cpus} \
${proteins_fa}
"""
Expand Down
8 changes: 6 additions & 2 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ params {

bakta_args = ""

// Bakta expert systems parameters
user_proteins = null
user_hmms = null

// Sequence clustering
mmseqs_clusterPrefix = "mmseqs_clustering"
mmseqs_tmpDir = "mmseqs_clustering"
Expand Down Expand Up @@ -74,7 +78,7 @@ process {

withName: ANNOTATE_PROTEINS_MODULE {
cpus = { 8 * task.attempt } // cpu_48
memory = { 32.GB * task.attempt } // mem_32
memory = { 8.GB * task.attempt } // mem_32
time = { 2.h * task.attempt } // time_2
}

Expand All @@ -85,7 +89,7 @@ process {

withName: DETECT_PSEUDOGENES_MODULE {
cpus = { 8 * task.attempt } // cpu_16
memory = { 32.GB * task.attempt } // mem_32
memory = { 16.GB * task.attempt } // mem_32
}
}

Expand Down
6 changes: 4 additions & 2 deletions subworkflows/annotate_proteins.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ include { ANNOTATE_PROTEINS as ANNOTATE_PROTEINS_MODULE; PARSE_BAKTA_JSON_ANNOTA

workflow ANNOTATE_PROTEINS {
take:
unique_proteins_channel // path(proteins_fa)
unique_proteins_channel // path(proteins_fa), path(bakta_db)
hmm_ch //path(user_hmms)
prots_ch // path(user_proteins)

main:
ANNOTATE_PROTEINS_MODULE(unique_proteins_channel)
ANNOTATE_PROTEINS_MODULE(unique_proteins_channel, hmm_ch, prots_ch)
ANNOTATE_PROTEINS_MODULE.out
.set { protein_annotations }

Expand Down