Skip to content

Commit

Permalink
Working with multiqc enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jscgh committed Nov 29, 2024
1 parent 30ffcd6 commit 6a4f6ac
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 27 deletions.
14 changes: 7 additions & 7 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ if (params.mode.toLowerCase().split(",").contains("esmfold")) {
include { PREPARE_ESMFOLD_DBS } from './subworkflows/local/prepare_esmfold_dbs'
include { ESMFOLD } from './workflows/esmfold'
}
if (params.mode == "helixfold3") {
include { PREPARE_HELIXFOLD3_DBS } from './subworkflows/local/prepare_helixfold3_dbs'
if (params.mode.toLowerCase().split(",").contains("helixfold3")) {
include { PREPARE_HELIXFOLD3_DBS } from './subworkflows/local/prepare_helixfold3_dbs'
include { HELIXFOLD3 } from './workflows/helixfold3'
}

Expand Down Expand Up @@ -213,7 +213,7 @@ workflow NFCORE_PROTEINFOLD {
//
// WORKFLOW: Run helixfold3
//
if(params.mode == "helixfold3") {
if(requested_modes.contains("helixfold3")) {
//
// SUBWORKFLOW: Prepare helixfold3 DBs
//
Expand Down Expand Up @@ -266,10 +266,10 @@ workflow NFCORE_PROTEINFOLD {
PREPARE_HELIXFOLD3_DBS.out.helixfold3_init_models,
PREPARE_HELIXFOLD3_DBS.out.helixfold3_maxit_src
)
ch_helixfold3_top_ranked_pdb = helixfold3.out.top_ranked_pdb
ch_multiqc = ch_multiqc.mix(helixfold3.out.multiqc_report.collect())
ch_versions = ch_versions.mix(helixfold3.out.versions)
ch_report_input = ch_report_input.mix(helixfold3.out.pdb_msa)
ch_helixfold3_top_ranked_pdb = HELIXFOLD3.out.top_ranked_pdb
ch_multiqc = ch_multiqc.mix(HELIXFOLD3.out.multiqc_report.collect())
ch_versions = ch_versions.mix(HELIXFOLD3.out.versions)
ch_report_input = ch_report_input.mix(HELIXFOLD3.out.pdb_msa)
}

//
Expand Down
5 changes: 2 additions & 3 deletions modules/local/run_helixfold3.nf
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ process RUN_HELIXFOLD3 {

output:
path ("${fasta.baseName}*")
tuple val(meta), path ("${meta.id}_helixfold3.cif") , emit: main_cif
tuple val(meta), path ("${meta.id}_helixfold3.pdb") , emit: main_pdb
tuple val(meta), path ("${meta.id}_helixfold3.pdb") , emit: top_ranked_pdb
tuple val(meta), path ("ranked*pdb") , emit: pdb
tuple val(meta), path ("${meta.id}_helixfold3.cif") , emit: main_cif
tuple val(meta), path ("*_mqc.tsv") , emit: multiqc
path "versions.yml", emit: versions

Expand Down Expand Up @@ -74,7 +74,6 @@ process RUN_HELIXFOLD3 {
--model_name allatom_demo \
--init_model "./init_models/HelixFold3-240814.pdparams" \
--infer_times 4 \
--diff_batch_size 1 \
--logging_level "ERROR" \
--precision "bf16"
Expand Down
25 changes: 8 additions & 17 deletions workflows/helixfold3.nf
Original file line number Diff line number Diff line change
Expand Up @@ -65,27 +65,17 @@ workflow HELIXFOLD3 {
ch_helixfold3_maxit_src
)

RUN_HELIXFOLD3_ALL_ATOM
RUN_HELIXFOLD3
.out
.multiqc
.map { it[1] }
.toSortedList()
.map { [ [ "model": "helixfold3" ], it.flatten() ] }
.set { ch_multiqc_report }

ch_pdb = ch_pdb.mix(RUN_HELIXFOLD3_ALL_ATOM.out.pdb)
ch_top_ranked_pdb = ch_top_ranked_pdb.mix(RUN_HELIXFOLD3_ALL_ATOM.out.top_ranked_pdb)
ch_versions = ch_versions.mix(RUN_HELIXFOLD3_ALL_ATOM.out.versions)

RUN_HELIXFOLD3_ALL_ATOM
.out
.pdb
.combine(ch_dummy_file)
.map {
it[0]["model"] = "helixfold3"
it
}
.set { ch_pdb_msa }
ch_pdb = ch_pdb.mix(RUN_HELIXFOLD3.out.pdb)
ch_top_ranked_pdb = ch_top_ranked_pdb.mix(RUN_HELIXFOLD3.out.top_ranked_pdb)
ch_versions = ch_versions.mix(RUN_HELIXFOLD3.out.versions)

ch_top_ranked_pdb
.map { [ it[0]["id"], it[0], it[1] ] }
Expand All @@ -100,9 +90,10 @@ workflow HELIXFOLD3 {
.set { ch_pdb_msa }

emit:
top_ranked_pdb = ch_top_ranked_pdb // channel: [ id, /path/to/*.pdb ]
multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html
versions = ch_versions // channel: [ path(versions.yml) ]
pdb_msa = ch_pdb_msa // channel: [ meta, /path/to/*.pdb, dummy_file ]
top_ranked_pdb = ch_top_ranked_pdb // channel: [ id, /path/to/*.pdb ]
multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html
versions = ch_versions // channel: [ path(versions.yml) ]
}

/*
Expand Down

0 comments on commit 6a4f6ac

Please sign in to comment.