diff --git a/main.nf b/main.nf index 8174524..003c608 100644 --- a/main.nf +++ b/main.nf @@ -1,6 +1,6 @@ -nextflow.enable.dsl=2 - -nextflow.preview.output = true +// +// Nextflow pipeline for peptide identification with multiple search engines and post-processing tools +// // default python image params.python_image = 'ghcr.io/medbioinf/pipeline-of-identification:latest' @@ -30,6 +30,7 @@ params.execute_sage = true params.execute_xtandem = true // default parameter files +params.outdir = './' params.comet_params_file = "${baseDir}/config/comet.params" params.maxquant_params_file = "${baseDir}/config/mqpar.xml" params.msamanda_config_file = "${baseDir}/config/msamanda_settings.xml" @@ -86,7 +87,11 @@ workflow { } if (params.raw_files) { - raw_files = Channel.fromPath(params.raw_files).flatten() + if (params.is_timstof) { + raw_files = Channel.fromPath(params.raw_files, type: 'dir').flatten() + } else { + raw_files = Channel.fromPath(params.raw_files).flatten() + } raw_files_info = raw_files } else { raw_files_info = "no raw spectra given" @@ -143,7 +148,7 @@ workflow { if (params.execute_maxquant) { maxquant_params_file = Channel.fromPath(params.maxquant_params_file).first() - maxquant_identification(maxquant_params_file, fasta_target, mzmls, params.precursor_tol_ppm) + maxquant_identification(maxquant_params_file, fasta_target, raw_files, mzmls, params.precursor_tol_ppm) } if (params.execute_msamanda) { @@ -171,45 +176,3 @@ workflow { xtandem_identification(xtandem_config_file, fasta_target_decoy, mzmls, params.precursor_tol_ppm, params.fragment_tol_da) } } - -output { - 'mzmls' { - enabled params.keep_mzmls - path 'mzmls' - } - - 'comet' { - enabled params.execute_comet - path 'comet' - } - - 'maxquant' { - enabled params.execute_maxquant - path 'maxquant' - } - - 'msamanda' { - enabled params.execute_msamanda - path 'msamanda' - } - - 'msfragger' { - enabled params.execute_msfragger - path 'msfragger' - } - - 'msgfplus' { - enabled params.execute_msgfplus - path 'msgfplus' - } - - 'sage' { - enabled params.execute_sage - path 'sage' - } - - 'xtandem' { - enabled params.execute_xtandem - path 'xtandem' - } -} \ No newline at end of file diff --git a/src/identification/comet_identification.nf b/src/identification/comet_identification.nf index 87b4953..73aec6d 100644 --- a/src/identification/comet_identification.nf +++ b/src/identification/comet_identification.nf @@ -36,25 +36,15 @@ workflow comet_identification { psm_tsvs = psm_tsvs_and_pin.psm_tsv pin_files = psm_tsvs_and_pin.pin_file - pout_files = psm_percolator(pin_files) + psm_percolator(pin_files, 'comet') psm_tsvs_and_mzmls = psm_tsvs.map { it -> [ it.name, it.name.take(it.name.lastIndexOf('.mzid')) + '.mzML' ] } - ms2rescore_pins = ms2rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.comet_psm_id_pattern, params.comet_spectrum_id_pattern, '^DECOY_', 'comet') - oktoberfest_pins = oktoberfest_rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.comet_scan_id_pattern) + ms2rescore_pins = ms2rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.comet_spectrum_id_pattern, 'comet') + oktoberfest_pins = oktoberfest_rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.comet_scan_id_pattern, 'comet') // perform percolation - ms2rescore_percolator_results = ms2rescore_percolator(ms2rescore_pins.ms2rescore_pins) - oktoberfest_percolator_results = oktoberfest_percolator(oktoberfest_pins.oktoberfest_pins) - - publish: - comet_mzids >> 'comet' - psm_tsvs >> 'comet' - pin_files >> 'comet' - pout_files >> 'comet' - ms2rescore_pins >> 'comet' - ms2rescore_percolator_results >> 'comet' - oktoberfest_pins >> 'comet' - oktoberfest_percolator_results >> 'comet' + ms2rescore_percolator(ms2rescore_pins.ms2rescore_pins, 'comet') + oktoberfest_percolator(oktoberfest_pins.oktoberfest_pins, 'comet') } @@ -99,6 +89,8 @@ process identification_with_comet { memory { params.comet_mem } container { params.comet_image } + publishDir "${params.outdir}/comet", mode: 'copy' + input: path fasta path mzmls diff --git a/src/identification/maxquant_identification.nf b/src/identification/maxquant_identification.nf index 54b9476..07a87e6 100644 --- a/src/identification/maxquant_identification.nf +++ b/src/identification/maxquant_identification.nf @@ -24,13 +24,14 @@ workflow maxquant_identification { take: maxquant_params_file fasta + raw_files mzmls precursor_tol_ppm main: // for TimsTOF data, always process the .d path instead of the mzML files if (params.is_timstof) { - process_files = Channel.fromPath(params.raw_files).flatten() + process_files = raw_files } else { process_files = mzmls } @@ -41,7 +42,7 @@ workflow maxquant_identification { psm_tsvs = psm_tsvs_and_pin.psm_tsv pin_files = psm_tsvs_and_pin.pin_file - pout_files = psm_percolator(pin_files) + psm_percolator(pin_files, 'maxquant') if (params.maxquant_psm_id_pattern) { psm_id_pattern = params.maxquant_psm_id_pattern @@ -75,22 +76,12 @@ workflow maxquant_identification { psm_tsvs_and_spectra_oktoberfest = psm_tsvs_and_spectrafiles } - ms2rescore_pins = ms2rescore_workflow(psm_tsvs_and_spectrafiles, psm_tsvs.collect(), process_files.collect(), psm_id_pattern, spectrum_id_pattern, '', 'maxquant') - oktoberfest_pins = oktoberfest_rescore_workflow(psm_tsvs_and_spectra_oktoberfest, psm_tsvs.collect(), mzmls.collect(), scan_id_pattern) + ms2rescore_pins = ms2rescore_workflow(psm_tsvs_and_spectrafiles, psm_tsvs.collect(), process_files.collect(), spectrum_id_pattern, 'maxquant') + oktoberfest_pins = oktoberfest_rescore_workflow(psm_tsvs_and_spectra_oktoberfest, psm_tsvs.collect(), mzmls.collect(), scan_id_pattern, 'maxquant') // perform percolation - ms2rescore_percolator_results = ms2rescore_percolator(ms2rescore_pins.ms2rescore_pins) - oktoberfest_percolator_results = oktoberfest_percolator(oktoberfest_pins.oktoberfest_pins) - - publish: - maxquant_results >> 'maxquant' - psm_tsvs >> 'maxquant' - pin_files >> 'maxquant' - pout_files >> 'maxquant' - ms2rescore_pins >> 'maxquant' - ms2rescore_percolator_results >> 'maxquant' - oktoberfest_pins >> 'maxquant' - oktoberfest_percolator_results >> 'maxquant' + ms2rescore_percolator(ms2rescore_pins.ms2rescore_pins, 'maxquant') + oktoberfest_percolator(oktoberfest_pins.oktoberfest_pins, 'maxquant') } @@ -99,8 +90,10 @@ process identification_with_maxquant { memory { params.maxquant_mem } container { params.maxquant_image } + publishDir "${params.outdir}/maxquant", mode: 'copy' + stageInMode 'copy' // MaxQuant respectively Mono does not support symlinks - + input: path maxquant_params_file path fasta diff --git a/src/identification/msamanda_identification.nf b/src/identification/msamanda_identification.nf index abbe794..b746108 100644 --- a/src/identification/msamanda_identification.nf +++ b/src/identification/msamanda_identification.nf @@ -41,25 +41,15 @@ workflow msamanda_identification { psm_tsvs = psm_tsvs_and_pin.psm_tsv pin_files = psm_tsvs_and_pin.pin_file - pout_files = psm_percolator(pin_files) + psm_percolator(pin_files, 'msamanda') psm_tsvs_and_mzmls = psm_tsvs.map { it -> [ it.name, it.name.take(it.name.lastIndexOf('_msamanda.csv')) + '.mzML' ] } - ms2rescore_pins = ms2rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.msamanda_psm_id_pattern, params.msamanda_spectrum_id_pattern, '^DECOY_', 'msamanda') - oktoberfest_pins = oktoberfest_rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.msamanda_scan_id_pattern) + ms2rescore_pins = ms2rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.msamanda_spectrum_id_pattern, 'msamanda') + oktoberfest_pins = oktoberfest_rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.msamanda_scan_id_pattern, 'msamanda') // perform percolation - ms2rescore_percolator_results = ms2rescore_percolator(ms2rescore_pins.ms2rescore_pins) - oktoberfest_percolator_results = oktoberfest_percolator(oktoberfest_pins.oktoberfest_pins) - - publish: - msamanda_results.msamanda_csv >> 'msamanda' - psm_tsvs >> 'msamanda' - pin_files >> 'msamanda' - pout_files >> 'msamanda' - ms2rescore_pins >> 'msamanda' - ms2rescore_percolator_results >> 'msamanda' - oktoberfest_pins >> 'msamanda' - oktoberfest_percolator_results >> 'msamanda' + ms2rescore_percolator(ms2rescore_pins.ms2rescore_pins, 'msamanda') + oktoberfest_percolator(oktoberfest_pins.oktoberfest_pins, 'msamanda') } @@ -68,6 +58,8 @@ process identification_with_msamanda { memory { params.msamanda_mem } container { params.msamanda_image } + publishDir "${params.outdir}/msamanda", mode: 'copy' + input: path msamanda_config_file path fasta diff --git a/src/identification/msfragger_identification.nf b/src/identification/msfragger_identification.nf index 7a21f0b..7c69d57 100644 --- a/src/identification/msfragger_identification.nf +++ b/src/identification/msfragger_identification.nf @@ -35,25 +35,15 @@ workflow msfragger_identification { psm_tsvs = psm_tsvs_and_pin.psm_tsv pin_files = psm_tsvs_and_pin.pin_file - pout_files = psm_percolator(pin_files) + psm_percolator(pin_files, 'msfragger') psm_tsvs_and_mzmls = psm_tsvs.map { it -> [ it.name, it.name.take(it.name.lastIndexOf('.pepXML')) + '.mzML' ] } - ms2rescore_pins = ms2rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.msfragger_psm_id_pattern, params.msfragger_spectrum_id_pattern, '^DECOY_', 'msfragger') - oktoberfest_pins = oktoberfest_rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.msfragger_scan_id_pattern) + ms2rescore_pins = ms2rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.msfragger_spectrum_id_pattern, 'msfragger') + oktoberfest_pins = oktoberfest_rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.msfragger_scan_id_pattern, 'msfragger') // perform percolation - ms2rescore_percolator_results = ms2rescore_percolator(ms2rescore_pins.ms2rescore_pins) - oktoberfest_percolator_results = oktoberfest_percolator(oktoberfest_pins.oktoberfest_pins) - - publish: - fragger_results_pepxml >> 'msfragger' - psm_tsvs >> 'msfragger' - pin_files >> 'msfragger' - pout_files >> 'msfragger' - ms2rescore_pins >> 'msfragger' - ms2rescore_percolator_results >> 'msfragger' - oktoberfest_pins >> 'msfragger' - oktoberfest_percolator_results >> 'msfragger' + ms2rescore_percolator(ms2rescore_pins.ms2rescore_pins, 'msfragger') + oktoberfest_percolator(oktoberfest_pins.oktoberfest_pins, 'msfragger') } @@ -100,6 +90,8 @@ process identification_with_msfragger { cpus { params.msfragger_threads } memory { params.msfragger_mem_gb + " GB" } container { params.msfragger_image } + + publishDir "${params.outdir}/msfragger", mode: 'copy' input: path fasta diff --git a/src/identification/msgfplus_identification.nf b/src/identification/msgfplus_identification.nf index 489855c..88b9ea5 100644 --- a/src/identification/msgfplus_identification.nf +++ b/src/identification/msgfplus_identification.nf @@ -53,7 +53,7 @@ workflow msgfplus_identification { fasta_idx_mzml_chunk_combo = fasta_index.combine(mzmls_to_chunks) - msgfplus_results = identification_with_msgfplus(msgfplus_params_file, fasta_idx_mzml_chunk_combo, precursor_tol_ppm) + msgfplus_results = identification_with_msgfplus(msgfplus_params_file, fasta_idx_mzml_chunk_combo, precursor_tol_ppm, (params.msgfplus_split_fasta == 0)) if ((params.msgfplus_split_fasta > 0)) { grouped_results = msgfplus_results.map { it -> @@ -89,25 +89,15 @@ workflow msgfplus_identification { psm_tsvs = psm_tsvs_and_pin.psm_tsv pin_files = psm_tsvs_and_pin.pin_file - pout_files = psm_percolator(pin_files) + psm_percolator(pin_files, 'msgfplus') psm_tsvs_and_mzmls = psm_tsvs.map { it -> [ it.name, it.name.take(it.name.lastIndexOf('.mzid')) + '.mzML' ] } - ms2rescore_pins = ms2rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.msgfplus_psm_id_pattern, params.msgfplus_spectrum_id_pattern, '^DECOY_', 'msgfplus') - oktoberfest_pins = oktoberfest_rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.msgfplus_scan_id_pattern) + ms2rescore_pins = ms2rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.msgfplus_spectrum_id_pattern, 'msgfplus') + oktoberfest_pins = oktoberfest_rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.msgfplus_scan_id_pattern, 'msgfplus') // perform percolation - ms2rescore_percolator_results = ms2rescore_percolator(ms2rescore_pins.ms2rescore_pins) - oktoberfest_percolator_results = oktoberfest_percolator(oktoberfest_pins.oktoberfest_pins) - - publish: - fasta_merged_results.map{ it -> it[1] } >> 'msgfplus' - psm_tsvs >> 'msgfplus' - pin_files >> 'msgfplus' - pout_files >> 'msgfplus' - ms2rescore_pins >> 'msgfplus' - ms2rescore_percolator_results >> 'msgfplus' - oktoberfest_pins >> 'msgfplus' - oktoberfest_percolator_results >> 'msgfplus' + ms2rescore_percolator(ms2rescore_pins.ms2rescore_pins, 'msgfplus') + oktoberfest_percolator(oktoberfest_pins.oktoberfest_pins, 'msgfplus') } process identification_with_msgfplus { @@ -115,10 +105,13 @@ process identification_with_msgfplus { memory { params.msgfplus_mem_gb + " GB" } container { params.msgfplus_image } + publishDir "${params.outdir}/msgfplus", mode: 'copy', enabled: { publish_results } + input: path msgfplus_params_file tuple path(fasta), path(canno), path(cnlcp), path(csarr), path(cseq), val(original_mzml_basename), path(mzml) val precursor_tol_ppm + val publish_results output: tuple val(original_mzml_basename), path("${mzml.baseName}*.mzid") @@ -199,6 +192,8 @@ process mzid_merger { memory "8 GB" container { params.mzidmerger_image } + publishDir "${params.outdir}/msgfplus", mode: 'copy' + input: tuple val(original_mzml_basename), val(mzml_split), path(mzid_files) diff --git a/src/identification/sage_identification.nf b/src/identification/sage_identification.nf index 8a126d8..0e69d79 100644 --- a/src/identification/sage_identification.nf +++ b/src/identification/sage_identification.nf @@ -35,37 +35,21 @@ workflow sage_identification { // all mzMLs are processed at once in sage for now -> much faster sage_results = identification_with_sage(sage_config_file, fasta, mzmls.collect()) - separated_results = separate_sage_results(sage_results.sage_pin, sage_results.sage_tsv) - - // transpose to tuples containing [pin, tsv] files for each mzML - return_files = separated_results.sage_pin.collect() - .concat(separated_results.sage_tsv.collect()) - .toList() - .transpose() - + separated_results = separate_sage_results(sage_results.sage_tsv) + psm_tsvs_and_pin = convert_and_enhance_psm_tsv(separated_results.sage_tsv.flatten(), 'sage_tsv', 'sage') psm_tsvs = psm_tsvs_and_pin.psm_tsv pin_files = psm_tsvs_and_pin.pin_file - pout_files = psm_percolator(pin_files) + psm_percolator(pin_files, 'sage') psm_tsvs_and_mzmls = psm_tsvs.map { it -> [ it.name, it.name.take(it.name.lastIndexOf('.sage')) ] } - ms2rescore_pins = ms2rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.sage_psm_id_pattern, params.sage_spectrum_id_pattern, '^DECOY_', 'sage') - oktoberfest_pins = oktoberfest_rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.sage_scan_id_pattern) + ms2rescore_pins = ms2rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.sage_spectrum_id_pattern, 'sage') + oktoberfest_pins = oktoberfest_rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.sage_scan_id_pattern, 'sage') // perform percolation - ms2rescore_percolator_results = ms2rescore_percolator(ms2rescore_pins.ms2rescore_pins) - oktoberfest_percolator_results = oktoberfest_percolator(oktoberfest_pins.oktoberfest_pins) - - publish: - return_files >> 'sage' - psm_tsvs >> 'sage' - pin_files >> 'sage' - pout_files >> 'sage' - ms2rescore_pins >> 'sage' - ms2rescore_percolator_results >> 'sage' - oktoberfest_pins >> 'sage' - oktoberfest_percolator_results >> 'sage' + ms2rescore_percolator(ms2rescore_pins.ms2rescore_pins, 'sage') + oktoberfest_percolator(oktoberfest_pins.oktoberfest_pins, 'sage') } @@ -119,7 +103,6 @@ process identification_with_sage { path mzmls output: - path "results.sage.pin", emit: sage_pin path "results.sage.tsv", emit: sage_tsv script: @@ -134,23 +117,16 @@ process separate_sage_results { memory "1 GB" container { params.python_image } + publishDir "${params.outdir}/sage", mode: 'copy' + input: - path sage_pin path sage_tsv output: - path "*.sage.pin", emit: sage_pin path "*.sage.tsv", emit: sage_tsv script: """ - # process the pin file and create one file for each input file - for filename in \$(awk 'NR>1{a[\$6]++} END{for(b in a) print b}' ${sage_pin}); - do - head -n1 ${sage_pin} > \${filename}.sage.pin - awk -v f1="\${filename}" '\$6==f1' ${sage_pin} >> \${filename}.sage.pin - done - # process the tsv file and create one file for each input file for filename in \$(awk 'NR>1{a[\$5]++} END{for(b in a) print b}' ${sage_tsv}); do diff --git a/src/identification/xtandem_identification.nf b/src/identification/xtandem_identification.nf index 38c6459..3f7856a 100644 --- a/src/identification/xtandem_identification.nf +++ b/src/identification/xtandem_identification.nf @@ -37,25 +37,15 @@ workflow xtandem_identification { psm_tsvs = psm_tsvs_and_pin.psm_tsv pin_files = psm_tsvs_and_pin.pin_file - pout_files = psm_percolator(pin_files) + psm_percolator(pin_files, 'xtandem') psm_tsvs_and_mzmls = psm_tsvs.map { it -> [ it.name, it.name.take(it.name.lastIndexOf('.xtandem_identification')) + '.mzML' ] } - ms2rescore_pins = ms2rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.xtandem_psm_id_pattern, params.xtandem_spectrum_id_pattern, '^DECOY_', 'xtandem') - oktoberfest_pins = oktoberfest_rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.xtandem_scan_id_pattern) - + ms2rescore_pins = ms2rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.xtandem_spectrum_id_pattern, 'xtandem') + oktoberfest_pins = oktoberfest_rescore_workflow(psm_tsvs_and_mzmls, psm_tsvs.collect(), mzmls.collect(), params.xtandem_scan_id_pattern, 'xtandem') + // perform percolation - ms2rescore_percolator_results = ms2rescore_percolator(ms2rescore_pins.ms2rescore_pins) - oktoberfest_percolator_results = oktoberfest_percolator(oktoberfest_pins.oktoberfest_pins) - - publish: - tandem_xmls >> 'xtandem' - psm_tsvs >> 'xtandem' - pin_files >> 'xtandem' - pout_files >> 'xtandem' - ms2rescore_pins >> 'xtandem' - ms2rescore_percolator_results >> 'xtandem' - oktoberfest_pins >> 'xtandem' - oktoberfest_percolator_results >> 'xtandem' + ms2rescore_percolator(ms2rescore_pins.ms2rescore_pins, 'xtandem') + oktoberfest_percolator(oktoberfest_pins.oktoberfest_pins, 'xtandem') } /** @@ -127,6 +117,8 @@ process identification_with_xtandem { cpus { params.xtandem_threads } memory { params.xtandem_mem } container { params.xtandem_image } + + publishDir "${params.outdir}/xtandem", mode: 'copy' input: path xtandem_param_file diff --git a/src/postprocessing/convert_and_enhance_psm_tsv.nf b/src/postprocessing/convert_and_enhance_psm_tsv.nf index 45676a4..b43a54b 100644 --- a/src/postprocessing/convert_and_enhance_psm_tsv.nf +++ b/src/postprocessing/convert_and_enhance_psm_tsv.nf @@ -93,6 +93,8 @@ process enhance_psms_and_create_pin { memory { params.enhance_psm_tsv_mem } container { params.python_image } + publishDir "${params.outdir}/${searchengine}", mode: 'copy' + input: path psm_utils_tsv val searchengine diff --git a/src/postprocessing/ms2rescore.nf b/src/postprocessing/ms2rescore.nf index 3bbf2a3..a9c3ffd 100644 --- a/src/postprocessing/ms2rescore.nf +++ b/src/postprocessing/ms2rescore.nf @@ -11,14 +11,12 @@ workflow ms2rescore_workflow { psm_tsvs_and_mzmls psm_tsvs mzmls - psm_id_pattern spectrum_id_pattern - id_decoy_pattern searchengine main: ms2rescore_pre_pins = run_chunked_ms2rescore(psm_tsvs_and_mzmls, psm_tsvs, mzmls, spectrum_id_pattern, params.fragment_tol_da) - ms2rescore_pins = correct_psm_utils_pins(ms2rescore_pre_pins) + ms2rescore_pins = correct_psm_utils_pins(ms2rescore_pre_pins, searchengine) emit: ms2rescore_pins @@ -62,8 +60,11 @@ process correct_psm_utils_pins { container { params.python_image } + publishDir "${params.outdir}/${searchengine}", mode: 'copy' + input: path psm_utils_pins + val searchengine output: path "${psm_utils_pins.baseName}.corrected.pin" diff --git a/src/postprocessing/oktoberfest.nf b/src/postprocessing/oktoberfest.nf index 28e9165..cc87213 100644 --- a/src/postprocessing/oktoberfest.nf +++ b/src/postprocessing/oktoberfest.nf @@ -22,10 +22,11 @@ workflow oktoberfest_rescore_workflow { psm_tsvs mzmls scan_id_regex + searchengine main: oktoberfest_features = run_oktoberfest_feature_gen(psm_tsvs_and_mzmls, psm_tsvs, mzmls, params.fragment_tol_da, scan_id_regex) - oktoberfest_pins = oktoberfest_features_to_pin(oktoberfest_features) + oktoberfest_pins = oktoberfest_features_to_pin(oktoberfest_features, searchengine) emit: @@ -88,8 +89,11 @@ process oktoberfest_features_to_pin { container { params.oktoberfest_image } + publishDir "${params.outdir}/${searchengine}", mode: 'copy' + input: path okt_features_tsv + val searchengine output: path "${okt_features_tsv.baseName}.oktoberfest.pin" diff --git a/src/postprocessing/percolator.nf b/src/postprocessing/percolator.nf index 0c44840..8c227f7 100644 --- a/src/postprocessing/percolator.nf +++ b/src/postprocessing/percolator.nf @@ -14,9 +14,10 @@ params.percolator_mem = "4 GB" workflow psm_percolator { take: pin_files + searchengine main: - pout_files = run_percolator(pin_files) + pout_files = run_percolator(pin_files, searchengine) emit: pout_files @@ -28,8 +29,11 @@ process run_percolator { memory { params.percolator_mem } container { params.percolator_image } + publishDir "${params.outdir}/${searchengine}", mode: 'copy' + input: path pin_file + val searchengine output: path "${pin_file.baseName}.pout" diff --git a/src/preprocess/convert_to_mzml.nf b/src/preprocess/convert_to_mzml.nf index 5feb7b1..c7a96c2 100644 --- a/src/preprocess/convert_to_mzml.nf +++ b/src/preprocess/convert_to_mzml.nf @@ -18,9 +18,6 @@ workflow convert_to_mzml { emit: mzml - - publish: - mzml >> 'mzmls' } process convert_thermo_raw { @@ -28,6 +25,8 @@ process convert_thermo_raw { memory "8 GB" container { params.msconvert_image } + publishDir "${params.outdir}/mzmls", mode: 'copy', enabled: params.keep_mzmls + input: path input_raw @@ -66,6 +65,8 @@ process adjust_mzML { memory "8 GB" container { params.msconvert_image } + publishDir "${params.outdir}/mzmls", mode: 'copy', enabled: params.keep_mzmls + input: path input_mzML