From cfbe298088c9bb7cb0817248ef17cf954e412fab Mon Sep 17 00:00:00 2001 From: Chengxin Dai <37200167+daichengxin@users.noreply.github.com> Date: Sun, 24 Mar 2024 15:24:49 +0800 Subject: [PATCH] Revert "first PR about identification subworkflow" --- assets/adaptivecard.json | 3 +- bin/mzml_statistics.py | 24 +--- bin/psm_conversion.py | 117 ------------------ conf/modules.config | 10 -- modules/local/extract_psm/main.nf | 36 ------ modules/local/extract_psm/meta.yml | 34 ----- modules/local/mzmlstatistics/main.nf | 2 - modules/local/mzmlstatistics/meta.yml | 4 - .../thirdparty/searchenginemsgf/main.nf | 4 +- nextflow.config | 5 - nextflow_schema.json | 18 --- subworkflows/local/dda_id.nf | 104 ---------------- subworkflows/local/file_preparation.nf | 5 - workflows/quantms.nf | 42 +++---- 14 files changed, 24 insertions(+), 384 deletions(-) delete mode 100644 bin/psm_conversion.py delete mode 100644 modules/local/extract_psm/main.nf delete mode 100644 modules/local/extract_psm/meta.yml delete mode 100644 subworkflows/local/dda_id.nf diff --git a/assets/adaptivecard.json b/assets/adaptivecard.json index db2612fc..5af06e53 100644 --- a/assets/adaptivecard.json +++ b/assets/adaptivecard.json @@ -54,8 +54,7 @@ "body": [ { "type": "FactSet", - "facts": [<% out << summary.collect{ k,v -> "{\"title\": \"$k\", \"value\" : \"$v\"}" - }.join(",\n") %> + "facts": [<% out << summary.collect{ k,v -> "{\"title\": \"$k\", \"value\" : \"$v\"}"}.join(",\n") %> ] } ] diff --git a/bin/mzml_statistics.py b/bin/mzml_statistics.py index 208ad3ab..f4f0d298 100755 --- a/bin/mzml_statistics.py +++ b/bin/mzml_statistics.py @@ -7,12 +7,12 @@ import sys from pathlib import Path import sqlite3 -import re + import pandas as pd from pyopenms import MSExperiment, MzMLFile -def ms_dataframe(ms_path: str, id_only: bool = False) -> None: +def ms_dataframe(ms_path: str) -> None: file_columns = [ "SpectrumID", "MSLevel", @@ -25,9 +25,8 @@ def ms_dataframe(ms_path: str, id_only: bool = False) -> None: "AcquisitionDateTime", ] - def parse_mzml(file_name: str, file_columns: list, id_only: bool = False): + def parse_mzml(file_name: str, file_columns: list): info = [] - psm_part_info = [] exp = MSExperiment() acquisition_datetime = exp.getDateTime().get() MzMLFile().load(file_name, exp) @@ -55,23 +54,11 @@ def parse_mzml(file_name: str, file_columns: list, id_only: bool = False): charge_state = spectrum.getPrecursors()[0].getCharge() emz = spectrum.getPrecursors()[0].getMZ() if spectrum.getPrecursors()[0].getMZ() else None info_list = [id_, MSLevel, charge_state, peak_per_ms, bpc, tic, rt, emz, acquisition_datetime] - mz_array = peaks_tuple[0] - intensity_array = peaks_tuple[1] else: info_list = [id_, MSLevel, None, None, None, None, rt, None, acquisition_datetime] - if id_only and MSLevel == 2: - psm_part_info.append([re.findall(r"[scan|spectrum]=(\d+)", id_)[0], MSLevel, mz_array, intensity_array]) info.append(info_list) - if id_only and len(psm_part_info) > 0: - pd.DataFrame(psm_part_info, columns=["scan", "ms_level", "mz", "intensity"]).to_csv( - f"{Path(ms_path).stem}_spectrum_df.csv", - mode="w", - index=False, - header=True, - ) - return pd.DataFrame(info, columns=file_columns) def parse_bruker_d(file_name: str, file_columns: list): @@ -152,7 +139,7 @@ def parse_bruker_d(file_name: str, file_columns: list): if Path(ms_path).suffix == ".d" and Path(ms_path).is_dir(): ms_df = parse_bruker_d(ms_path, file_columns) elif Path(ms_path).suffix in [".mzML", ".mzml"]: - ms_df = parse_mzml(ms_path, file_columns, id_only) + ms_df = parse_mzml(ms_path, file_columns) else: msg = f"Unrecognized or inexistent mass spec file '{ms_path}'" raise RuntimeError(msg) @@ -168,8 +155,7 @@ def parse_bruker_d(file_name: str, file_columns: list): def main(): ms_path = sys.argv[1] - id_only = sys.argv[2] - ms_dataframe(ms_path, id_only) + ms_dataframe(ms_path) if __name__ == "__main__": diff --git a/bin/psm_conversion.py b/bin/psm_conversion.py deleted file mode 100644 index c122a24f..00000000 --- a/bin/psm_conversion.py +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env python -import numpy as np -import pyopenms as oms -import pandas as pd -import re -import os -from pathlib import Path -import sys - -_parquet_field = [ - "sequence", "protein_accessions", "protein_start_positions", "protein_end_positions", - "modifications", "retention_time", "charge", "calc_mass_to_charge", "reference_file_name", - "scan_number", "peptidoform", "posterior_error_probability", "global_qvalue", "is_decoy", - "consensus_support", "mz_array", "intensity_array", "num_peaks", "search_engines", "id_scores", "hit_rank" -] - - -def mods_position(peptide): - pattern = re.compile(r"\((.*?)\)") - original_mods = pattern.findall(peptide) - peptide = re.sub(r"\(.*?\)", ".", peptide) - position = [i.start() for i in re.finditer(r"\.", peptide)] - for j in range(1, len(position)): - position[j] -= j - - for k in range(0, len(original_mods)): - original_mods[k] = str(position[k]) + "-" + original_mods[k] - - original_mods = [str(i) for i in original_mods] if len(original_mods) > 0 else np.nan - - return original_mods - - -def convert_psm(idxml, spectra_file, export_decoy_psm): - prot_ids = [] - pep_ids = [] - parquet_data = [] - consensus_support = np.nan - mz_array = [] - intensity_array = [] - num_peaks = np.nan - id_scores = [] - search_engines = [] - - oms.IdXMLFile().load(idxml, prot_ids, pep_ids) - if "ConsensusID" in prot_ids[0].getSearchEngine(): - if prot_ids[0].getSearchParameters().metaValueExists("SE:MS-GF+"): - search_engines = ["MS-GF+"] - if prot_ids[0].getSearchParameters().metaValueExists("SE:Comet"): - search_engines.append("Comet") - if prot_ids[0].getSearchParameters().metaValueExists("SE:Sage"): - search_engines.append("Sage") - else: - search_engines = [prot_ids[0].getSearchEngine()] - - reference_file_name = os.path.splitext(prot_ids[0].getMetaValue("spectra_data")[0].decode("UTF-8"))[0] - spectra_df = pd.read_csv(spectra_file) if spectra_file else None - - for peptide_id in pep_ids: - retention_time = peptide_id.getRT() - calc_mass_to_charge = peptide_id.getMZ() - scan_number = int(re.findall(r"(spectrum|scan)=(\d+)", peptide_id.getMetaValue("spectrum_reference"))[0][1]) - - if isinstance(spectra_df, pd.DataFrame): - spectra = spectra_df[spectra_df["scan"] == scan_number] - mz_array = spectra["mz"].values[0] - intensity_array = spectra["intensity"].values[0] - num_peaks = len(mz_array) - - for hit in peptide_id.getHits(): - # if remove decoy when mapped to target+decoy? - is_decoy = 0 if hit.getMetaValue("target_decoy") == "target" else 1 - if export_decoy_psm == "false" and is_decoy: - continue - global_qvalue = np.nan - if len(search_engines) > 1: - if "q-value" in peptide_id.getScoreType(): - global_qvalue = hit.getScore() - consensus_support = hit.getMetaValue("consensus_support") - elif search_engines == "Comet": - id_scores = ["Comet:Expectation value: " + str(hit.getScore())] - elif search_engines == "MS-GF+": - id_scores = ["MS-GF:SpecEValue: " + str(hit.getScore())] - elif search_engines == "Sage": - id_scores = ["Sage:hyperscore: " + str(hit.getScore())] - - charge = hit.getCharge() - peptidoform = hit.getSequence().toString() - modifications = mods_position(peptidoform) - sequence = hit.getSequence().toUnmodifiedString() - protein_accessions = [ev.getProteinAccession() for ev in hit.getPeptideEvidences()] - posterior_error_probability = hit.getMetaValue("Posterior Error Probability_score") - protein_start_positions = [ev.getStart() for ev in hit.getPeptideEvidences()] - protein_end_positions = [ev.getEnd() for ev in hit.getPeptideEvidences()] - hit_rank = hit.getRank() - - parquet_data.append([sequence, protein_accessions, protein_start_positions, protein_end_positions, - modifications, retention_time, charge, calc_mass_to_charge, reference_file_name, - scan_number, peptidoform, posterior_error_probability, global_qvalue, is_decoy, - consensus_support, mz_array, intensity_array, num_peaks, search_engines, id_scores, - hit_rank]) - - pd.DataFrame(parquet_data, columns=_parquet_field).to_csv(f"{Path(idxml).stem}_psm.csv", - mode="w", - index=False, - header=True) - - -def main(): - idxml_path = sys.argv[1] - spectra_file = sys.argv[2] - export_decoy_psm = sys.argv[3] - convert_psm(idxml_path, spectra_file, export_decoy_psm) - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/conf/modules.config b/conf/modules.config index c220be03..1f9ea163 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -245,16 +245,6 @@ process { ] } - withName: '.*:DDA_ID:PSMFDRCONTROL:IDFILTER' { - ext.args = "-score:pep \"$params.run_fdr_cutoff\"" - ext.suffix = '.idXML' - publishDir = [ - path: { "${params.outdir}/idfilter" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] - } - // PROTEOMICSLFQ withName: '.*:LFQ:PROTEOMICSLFQ' { ext.args = "-debug $params.plfq_debug" diff --git a/modules/local/extract_psm/main.nf b/modules/local/extract_psm/main.nf deleted file mode 100644 index a640316a..00000000 --- a/modules/local/extract_psm/main.nf +++ /dev/null @@ -1,36 +0,0 @@ -process PSMCONVERSION { - tag "$meta.mzml_id" - label 'process_medium' - - conda "bioconda::pyopenms=3.1.0" - if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) { - container "https://depot.galaxyproject.org/singularity/pyopenms:3.1.0--py39h9b8898c_0" - } else { - container "biocontainers/pyopenms:3.1.0--py39h9b8898c_0" - } - - input: - tuple val(meta), path(idxml_file), path(spectrum_df) - - output: - path "*_psm.csv", emit: psm_info - path "versions.yml", emit: version - path "*.log", emit: log - - script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.mzml_id}" - - - """ - psm_conversion.py "${idxml_file}" \\ - ${spectrum_df} \\ - $params.export_decoy_psm \\ - 2>&1 | tee extract_idxml.log - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - pyopenms: \$(pip show pyopenms | grep "Version" | awk -F ': ' '{print \$2}') - END_VERSIONS - """ -} diff --git a/modules/local/extract_psm/meta.yml b/modules/local/extract_psm/meta.yml deleted file mode 100644 index 23586d7e..00000000 --- a/modules/local/extract_psm/meta.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: PSMCONVERSION -description: A module to extract PSM information from idXML file -keywords: - - PSM - - conversion -tools: - - custom: - description: | - A custom module for PSM extraction. - homepage: https://github.com/bigbio/quantms - documentation: https://github.com/bigbio/quantms/tree/readthedocs -input: - - idxml_file: - type: file - description: idXML identification file - pattern: "*.idXML" - - spectrum_df: - type: file - description: spectrum data file - pattern: "_spectrum_df.csv" - - meta: - type: map - description: Groovy Map containing sample information -output: - - psm_info: - type: file - description: PSM csv file - pattern: "*_psm.csv" - - version: - type: file - description: File containing software version - pattern: "versions.yml" -authors: - - "@daichengxin" diff --git a/modules/local/mzmlstatistics/main.nf b/modules/local/mzmlstatistics/main.nf index 51770947..f39c8bb6 100644 --- a/modules/local/mzmlstatistics/main.nf +++ b/modules/local/mzmlstatistics/main.nf @@ -15,7 +15,6 @@ process MZMLSTATISTICS { output: path "*_ms_info.tsv", emit: ms_statistics - tuple val(meta), path("*_spectrum_df.csv"), emit: spectrum_df path "versions.yml", emit: version path "*.log", emit: log @@ -25,7 +24,6 @@ process MZMLSTATISTICS { """ mzml_statistics.py "${ms_file}" \\ - $params.id_only \\ 2>&1 | tee mzml_statistics.log cat <<-END_VERSIONS > versions.yml diff --git a/modules/local/mzmlstatistics/meta.yml b/modules/local/mzmlstatistics/meta.yml index 59a1b451..d1fab0da 100644 --- a/modules/local/mzmlstatistics/meta.yml +++ b/modules/local/mzmlstatistics/meta.yml @@ -19,10 +19,6 @@ output: type: file description: mzMLs statistics file pattern: "*_mzml_info.tsv" - - spectrum_df: - type: file - description: spectrum data file - pattern: "_spectrum_df.csv" - version: type: file description: File containing software version diff --git a/modules/local/openms/thirdparty/searchenginemsgf/main.nf b/modules/local/openms/thirdparty/searchenginemsgf/main.nf index b76b1106..cfa0eb2a 100644 --- a/modules/local/openms/thirdparty/searchenginemsgf/main.nf +++ b/modules/local/openms/thirdparty/searchenginemsgf/main.nf @@ -49,11 +49,9 @@ process SEARCHENGINEMSGF { } num_enzyme_termini = "" - max_missed_cleavages = "-max_missed_cleavages ${params.allowed_missed_cleavages}" if (meta.enzyme == "unspecific cleavage") { num_enzyme_termini = "none" - max_missed_cleavages = "" } else if (params.num_enzyme_termini == "fully") { @@ -77,7 +75,7 @@ process SEARCHENGINEMSGF { -max_precursor_charge $params.max_precursor_charge \\ -min_peptide_length $params.min_peptide_length \\ -max_peptide_length $params.max_peptide_length \\ - ${max_missed_cleavages} \\ + -max_missed_cleavages $params.allowed_missed_cleavages \\ -isotope_error_range $params.isotope_error_range \\ -enzyme "${enzyme}" \\ -tryptic ${msgf_num_enzyme_termini} \\ diff --git a/nextflow.config b/nextflow.config index 8cd10ce8..09aeb989 100644 --- a/nextflow.config +++ b/nextflow.config @@ -15,7 +15,6 @@ params { local_input_type = 'mzML' database = null acquisition_method = null - id_only = false // Input options input = null @@ -23,7 +22,6 @@ params { // Tools flags posterior_probabilities = 'percolator' add_decoys = false - skip_rescoring = false search_engines = 'comet' sage_processes = 1 run_fdr_cutoff = 0.10 @@ -108,9 +106,6 @@ params { // IDPEP flags outlier_handling = "none" - // DDA_ID flags - export_decoy_psm = true - // Percolator flags train_FDR = 0.05 test_FDR = 0.05 diff --git a/nextflow_schema.json b/nextflow_schema.json index 8375cfa3..b3dd125b 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -58,18 +58,6 @@ "description": "Proteomics data acquisition method", "enum": ["dda", "dia"], "fa_icon": "far fa-list-ol" - }, - "id_only": { - "type": "boolean", - "description": "Only perform identification subworkflow.", - "fa_icon": "far fa-check-square", - "help_text": "Only perform identification subworkflow for specific cases." - }, - "export_decoy_psm": { - "type": "boolean", - "description": "Whether export PSM from decoy in final identification results", - "fa_icon": "far fa-check-square", - "help_text": "Whether export PSM from decoy in final identification results for dda_id subworkflow for specific cases." } } }, @@ -428,12 +416,6 @@ "description": "Choose between different rescoring/posterior probability calculation methods and set them up.", "default": "", "properties": { - "skip_rescoring": { - "type": "boolean", - "description": "Skip PSM rescoring steps for specific cases, such as studying pure search engine results and search engine ranks", - "default": false, - "fa_icon": "far fa-check-square" - }, "posterior_probabilities": { "type": "string", "description": "How to calculate posterior probabilities for PSMs:\n\n* 'percolator' = Re-score based on PSM-feature-based SVM and transform distance\n to hyperplane for posteriors\n* 'fit_distributions' = Fit positive and negative distributions to scores\n (similar to PeptideProphet)", diff --git a/subworkflows/local/dda_id.nf b/subworkflows/local/dda_id.nf deleted file mode 100644 index c98b1c55..00000000 --- a/subworkflows/local/dda_id.nf +++ /dev/null @@ -1,104 +0,0 @@ -// -// MODULE: Local to the pipeline -// -include { DECOYDATABASE } from '../../modules/local/openms/decoydatabase/main' -include { CONSENSUSID } from '../../modules/local/openms/consensusid/main' -include { EXTRACTPSMFEATURES } from '../../modules/local/openms/extractpsmfeatures/main' -include { PERCOLATOR } from '../../modules/local/openms/thirdparty/percolator/main' -include { FALSEDISCOVERYRATE as FDRIDPEP } from '../../modules/local/openms/falsediscoveryrate/main' -include { IDPEP } from '../../modules/local/openms/idpep/main' -include { PSMCONVERSION } from '../../modules/local/extract_psm/main' - -// -// SUBWORKFLOW: Consisting of a mix of local and nf-core/modules -// -include { DATABASESEARCHENGINES } from './databasesearchengines' -include { PSMFDRCONTROL } from './psmfdrcontrol' - -workflow DDA_ID { - take: - ch_file_preparation_results - ch_database_wdecoy - ch_spectrum_data - - main: - - ch_software_versions = Channel.empty() - - // - // SUBWORKFLOW: DatabaseSearchEngines - // - DATABASESEARCHENGINES ( - ch_file_preparation_results, - ch_database_wdecoy - ) - ch_software_versions = ch_software_versions.mix(DATABASESEARCHENGINES.out.versions.ifEmpty(null)) - ch_id_files = DATABASESEARCHENGINES.out.ch_id_files_idx - - ch_id_files.branch{ meta, filename -> - sage: filename.name.contains('sage') - return [meta, filename] - nosage: true - return [meta, filename] - }.set{ch_id_files_branched} - - - // - // SUBWORKFLOW: Rescoring - // - if (params.skip_rescoring == false) { - if (params.posterior_probabilities == 'percolator') { - EXTRACTPSMFEATURES(ch_id_files_branched.nosage) - ch_id_files_feats = ch_id_files_branched.sage.mix(EXTRACTPSMFEATURES.out.id_files_feat) - ch_software_versions = ch_software_versions.mix(EXTRACTPSMFEATURES.out.version) - PERCOLATOR(ch_id_files_feats) - ch_software_versions = ch_software_versions.mix(PERCOLATOR.out.version) - ch_consensus_input = PERCOLATOR.out.id_files_perc - } - - - if (params.posterior_probabilities != 'percolator') { - ch_fdridpep = Channel.empty() - if (params.search_engines.split(",").size() == 1) { - FDRIDPEP(ch_id_files) - ch_software_versions = ch_software_versions.mix(FDRIDPEP.out.version) - ch_id_files = Channel.empty() - ch_fdridpep = FDRIDPEP.out.id_files_idx_ForIDPEP_FDR - } - IDPEP(ch_fdridpep.mix(ch_id_files)) - ch_software_versions = ch_software_versions.mix(IDPEP.out.version) - ch_consensus_input = IDPEP.out.id_files_ForIDPEP - } - - // - // SUBWORKFLOW: PSMFDRCONTROL - // - ch_psmfdrcontrol = Channel.empty() - ch_consensus_results = Channel.empty() - if (params.search_engines.split(",").size() > 1) { - CONSENSUSID(ch_consensus_input.groupTuple(size: params.search_engines.split(",").size())) - ch_software_versions = ch_software_versions.mix(CONSENSUSID.out.version.ifEmpty(null)) - ch_psmfdrcontrol = CONSENSUSID.out.consensusids - ch_consensus_results = CONSENSUSID.out.consensusids - } else { - ch_psmfdrcontrol = ch_consensus_input - } - - PSMFDRCONTROL(ch_psmfdrcontrol) - ch_software_versions = ch_software_versions.mix(PSMFDRCONTROL.out.version.ifEmpty(null)) - - // - // Extract PSMs and export parquet format - // - ch_spectrum_data.view() - PSMFDRCONTROL.out.id_filtered.view() - PSMCONVERSION(PSMFDRCONTROL.out.id_filtered.combine(ch_spectrum_data, by: 0)) - - } else { - PSMCONVERSION(ch_id_files.combine(ch_spectrum_data, by: 0)) - } - - - emit: - version = ch_software_versions -} diff --git a/subworkflows/local/file_preparation.nf b/subworkflows/local/file_preparation.nf index a2b73fa1..41d6e637 100644 --- a/subworkflows/local/file_preparation.nf +++ b/subworkflows/local/file_preparation.nf @@ -18,7 +18,6 @@ workflow FILE_PREPARATION { ch_results = Channel.empty() ch_statistics = Channel.empty() ch_mqc_data = Channel.empty() - ch_spectrum_df = Channel.empty() // Divide the compressed files ch_rawfiles @@ -81,11 +80,8 @@ workflow FILE_PREPARATION { ch_results = indexed_mzml_bundle.mix(ch_branched_input.dotd) } - MZMLSTATISTICS(ch_results) ch_statistics = ch_statistics.mix(MZMLSTATISTICS.out.ms_statistics.collect()) - ch_spectrum_df = ch_spectrum_df.mix(MZMLSTATISTICS.out.spectrum_df) - ch_versions = ch_versions.mix(MZMLSTATISTICS.out.version) if (params.openms_peakpicking) { @@ -101,7 +97,6 @@ workflow FILE_PREPARATION { emit: results = ch_results // channel: [val(mzml_id), indexedmzml|.d.tar] statistics = ch_statistics // channel: [ *_ms_info.tsv ] - spectrum_data = ch_spectrum_df // channel: [val(mzml_id), *_spectrum_df.csv] version = ch_versions // channel: [ *.version.txt ] } diff --git a/workflows/quantms.nf b/workflows/quantms.nf index e0772204..75097a7b 100644 --- a/workflows/quantms.nf +++ b/workflows/quantms.nf @@ -21,7 +21,6 @@ include { DECOYDATABASE } from '../modules/local/openms/decoydatabase/main' include { INPUT_CHECK } from '../subworkflows/local/input_check' include { FILE_PREPARATION } from '../subworkflows/local/file_preparation' include { CREATE_INPUT_CHANNEL } from '../subworkflows/local/create_input_channel' -include { DDA_ID } from '../subworkflows/local/dda_id' /* @@ -104,34 +103,27 @@ workflow QUANTMS { ch_versions = ch_versions.mix(DECOYDATABASE.out.version.ifEmpty(null)) } - if (params.id_only) { - DDA_ID( FILE_PREPARATION.out.results, ch_searchengine_in_db, FILE_PREPARATION.out.spectrum_data) - ch_versions = ch_versions.mix(DDA_ID.out.version.ifEmpty(null)) - } else { - TMT(ch_fileprep_result.iso, CREATE_INPUT_CHANNEL.out.ch_expdesign, ch_searchengine_in_db) - ch_ids_pmultiqc = ch_ids_pmultiqc.mix(TMT.out.ch_pmultiqc_ids) - ch_consensus_pmultiqc = ch_consensus_pmultiqc.mix(TMT.out.ch_pmultiqc_consensus) - ch_pipeline_results = ch_pipeline_results.mix(TMT.out.final_result) - ch_msstats_in = ch_msstats_in.mix(TMT.out.msstats_in) - ch_versions = ch_versions.mix(TMT.out.versions.ifEmpty(null)) - - LFQ(ch_fileprep_result.lfq, CREATE_INPUT_CHANNEL.out.ch_expdesign, ch_searchengine_in_db) - ch_ids_pmultiqc = ch_ids_pmultiqc.mix(LFQ.out.ch_pmultiqc_ids) - ch_consensus_pmultiqc = ch_consensus_pmultiqc.mix(LFQ.out.ch_pmultiqc_consensus) - ch_pipeline_results = ch_pipeline_results.mix(LFQ.out.final_result) - ch_msstats_in = ch_msstats_in.mix(LFQ.out.msstats_in) - ch_versions = ch_versions.mix(LFQ.out.versions.ifEmpty(null)) - - DIA(ch_fileprep_result.dia, CREATE_INPUT_CHANNEL.out.ch_expdesign, FILE_PREPARATION.out.statistics) - ch_pipeline_results = ch_pipeline_results.mix(DIA.out.diann_report) - ch_msstats_in = ch_msstats_in.mix(DIA.out.msstats_in) - ch_versions = ch_versions.mix(DIA.out.versions.ifEmpty(null)) - } + + TMT(ch_fileprep_result.iso, CREATE_INPUT_CHANNEL.out.ch_expdesign, ch_searchengine_in_db) + ch_ids_pmultiqc = ch_ids_pmultiqc.mix(TMT.out.ch_pmultiqc_ids) + ch_consensus_pmultiqc = ch_consensus_pmultiqc.mix(TMT.out.ch_pmultiqc_consensus) + ch_pipeline_results = ch_pipeline_results.mix(TMT.out.final_result) + ch_msstats_in = ch_msstats_in.mix(TMT.out.msstats_in) + + LFQ(ch_fileprep_result.lfq, CREATE_INPUT_CHANNEL.out.ch_expdesign, ch_searchengine_in_db) + ch_ids_pmultiqc = ch_ids_pmultiqc.mix(LFQ.out.ch_pmultiqc_ids) + ch_consensus_pmultiqc = ch_consensus_pmultiqc.mix(LFQ.out.ch_pmultiqc_consensus) + ch_pipeline_results = ch_pipeline_results.mix(LFQ.out.final_result) + ch_msstats_in = ch_msstats_in.mix(LFQ.out.msstats_in) + + DIA(ch_fileprep_result.dia, CREATE_INPUT_CHANNEL.out.ch_expdesign, FILE_PREPARATION.out.statistics) + ch_pipeline_results = ch_pipeline_results.mix(DIA.out.diann_report) + ch_msstats_in = ch_msstats_in.mix(DIA.out.msstats_in) // // Collate and save software versions // - ch_versions + DIA.out.versions.mix(LFQ.out.versions).mix(TMT.out.versions).mix(ch_versions) .branch { yaml : it.asBoolean() other : true