diff --git a/main.nf b/main.nf index 4ff48dd..e8eae7d 100644 --- a/main.nf +++ b/main.nf @@ -77,23 +77,41 @@ workflow WF_WISPS { params.colabfold_batch_size, params.interaction_neighbours, params.pool, - params.pool_size, - params.iptm_threshold + params.pool_size ) ch_versions = ch_versions.mix(WISPS.out.versions) emit: - colabfold_predictions = WISPS.out.colabfold_predictions - boltz_predictions = WISPS.out.boltz_predictions - af3_predictions = WISPS.out.af3_predictions multiqc_report = WISPS.out.multiqc_report versions = WISPS.out.versions collated_versions = WISPS.out.collated_versions ipsae_report = WISPS.out.ipsae_report - msa_a3m = WISPS.out.msa_a3m - msa_json = WISPS.out.msa_json - msa_yaml = WISPS.out.msa_yaml - msa_csv = WISPS.out.msa_csv + msa_a3m = WISPS.out.msa_a3m.map{['a3m': it[1]]} + msa_json = WISPS.out.msa_json.map{['json': it[1]]} + msa_yaml = WISPS.out.msa_yaml.map{['yaml': it[1]]} + msa_csv = WISPS.out.msa_csv.map{['csv': it[1]]} + colabfold_predictions = WISPS.out.colabfold_scores + .join(WISPS.out.colabfold_pdb) + .map { ['score': params.iptm_threshold > 0 ? new groovy.json.JsonSlurper().parseText(it[1].text).iptm : null, + 'pdb': it[2], + 'confidence': it[1]] } + .filter{params.iptm_threshold == 0 || it.score >= params.iptm_threshold} + + boltz_predictions = WISPS.out.boltz_pae + .join(WISPS.out.boltz_cif) + .join(WISPS.out.boltz_confidence) + .map { ['confidence': it[3], + 'cif': it[2], + 'pae': it[1], + 'score': params.iptm_threshold > 0 ? new groovy.json.JsonSlurper().parseText(it[3].text).iptm : null] } + .filter{params.iptm_threshold == 0 || it.score >= params.iptm_threshold} + + af3_predictions = WISPS.out.alphafold3_confidence + .join(WISPS.out.alphafold3_cif) + .map { ['confidence': it[1], + 'cif': it[2], + 'score': params.iptm_threshold > 0 ? new groovy.json.JsonSlurper().parseText(it[1].text).iptm : null] } + .filter{params.iptm_threshold == 0 || it.score >= params.iptm_threshold} } /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -139,10 +157,11 @@ workflow { multiqc_report = WF_WISPS.out.multiqc_report // channel: /path/to/multiqc_report.html //collated_versions = WF_WISPS.out.collated_versions ipsae_report = WF_WISPS.out.ipsae_report - msa_a3m = WF_WISPS.out.msa_a3m.map{it[1]} + msa_a3m = WF_WISPS.out.msa_a3m.ifEmpty([]) msa_json = WF_WISPS.out.msa_json.ifEmpty([]) msa_yaml = WF_WISPS.out.msa_yaml.ifEmpty([]) msa_csv = WF_WISPS.out.msa_csv.ifEmpty([]) + } output { @@ -175,16 +194,20 @@ output { path "ipsae/" } msa_a3m { - path "mmseqs/" + path "mmseqs/a3m/" + enabled params.save_mmseqs_out } msa_json { - path "mmseqs/" + path "mmseqs/json/" + enabled params.save_mmseqs_out } msa_yaml { - path 'mmseqs/' + path "mmseqs/yaml/" + enabled params.save_mmseqs_out } - msa_csv { - path 'mmseqs/' + msa_csv { + path "mmseqs/csv/" + enabled params.save_mmseqs_out } } diff --git a/nextflow.config b/nextflow.config index c717e89..59256c0 100644 --- a/nextflow.config +++ b/nextflow.config @@ -22,8 +22,8 @@ params { colabfold_num_recycles = 3 tools = "boltz,colabfold" db = null - iptm_threshold = 0.6 - + iptm_threshold = 0 + save_mmseqs_out = true ipsae_pae_cutoff = 10 ipsae_dist_cutoff = 10 @@ -78,7 +78,7 @@ params { } outputDir = params.outdir - +workflow.output.mode = params.publish_dir_mode // Load base.config by default for all pipelines includeConfig 'conf/base.config' diff --git a/nextflow_schema.json b/nextflow_schema.json index 4eafbfa..7237a78 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -94,6 +94,12 @@ "description": "Use spire DB for search", "fa_icon": "fas fa-folder-open" }, + "save_mmseqs_out": { + "type": "boolean", + "default": true, + "description": "Save the output of mmseqs in the output directory. (disable if you want to reduce storage foot print)", + "fa_icon": "fas fa-microchip" + }, "email": { "type": "string", "description": "Email address for completion summary.", diff --git a/workflows/wisps.nf b/workflows/wisps.nf index 0518647..5ae2771 100644 --- a/workflows/wisps.nf +++ b/workflows/wisps.nf @@ -79,8 +79,7 @@ workflow WISPS { interaction_neighbours pool pool_size - iptm_threshold - + main: ch_multiqc_files = Channel.empty() ch_confidence_scores = Channel.empty() @@ -783,28 +782,13 @@ workflow WISPS { msa_json = MMSEQS_COLABFOLDSEARCH.out.json msa_yaml = MMSEQS_COLABFOLDSEARCH.out.yaml msa_csv = MMSEQS_COLABFOLDSEARCH.out.msa_csv - - colabfold_predictions = ch_colabfold_scores - .join(ch_colabfold_pdb) - .map { ['score': iptm_threshold > 0 ? new groovy.json.JsonSlurper().parseText(it[1].text).iptm : null, - 'pdb': it[2], - 'confidence': it[1]] } - .filter{iptm_threshold == 0 || it.score >= iptm_threshold} - - boltz_predictions = ch_boltz_pae - .join(ch_boltz_cif) - .join(ch_boltz_confidence) - .map { ['confidence': it[3], - 'cif': it[2], - 'pae': it[1], - 'score': iptm_threshold > 0 ? new groovy.json.JsonSlurper().parseText(it[3].text).iptm : null] } - .filter{iptm_threshold == 0 || it.score >= iptm_threshold} - - af3_predictions = ch_alphafold3_confidence - .join(ch_alphafold3_cif) - .map { ['confidence': it[1], - 'cif': it[2], - 'score': iptm_threshold > 0 ? new groovy.json.JsonSlurper().parseText(it[1].text).iptm : null] } - .filter{iptm_threshold == 0 || it.score >= iptm_threshold} + colabfold_scores = ch_colabfold_scores + colabfold_pdb = ch_colabfold_pdb + boltz_pae = ch_boltz_pae + boltz_cif = ch_boltz_cif + boltz_confidence = ch_boltz_confidence + alphafold3_confidence = ch_alphafold3_confidence + alphafold3_cif = ch_alphafold3_cif + }