From 666467da42372a14495cd2f8a79953cd6191ccd5 Mon Sep 17 00:00:00 2001 From: Chengxin Dai <37200167+daichengxin@users.noreply.github.com> Date: Sun, 14 Jan 2024 00:15:39 +0800 Subject: [PATCH] library creation --- nextflow.config | 11 +++++++---- nextflow_schema.json | 13 +++++++++++++ workflows/dia.nf | 6 +++++- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/nextflow.config b/nextflow.config index 7182f12e..7978011d 100644 --- a/nextflow.config +++ b/nextflow.config @@ -174,10 +174,13 @@ params { species_genes = false diann_normalize = true diann_speclib = null - - /// DIA-NN: Extras - skip_preliminary_analysis = false - empirical_assembly_log = null + + // DIA-NN: Extras + skip_preliminary_analysis = false + empirical_assembly_log = null + random_preanalysis = false + empirical_assembly_ms_n = 200 + // MSstats general options msstats_remove_one_feat_prot = true diff --git a/nextflow_schema.json b/nextflow_schema.json index c8574be9..f70e01b3 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -967,6 +967,19 @@ "description": "Enable cross-run normalization between runs by diann.", "default": true, "fa_icon": "far fa-check-square" + }, + "random_preanalysis": { + "type": "boolean", + "description": "Enable random selection of spectrum files to generate empirical library.", + "default": false, + "fa_icon": "far fa-check-square" + }, + "empirical_assembly_ms_n": { + "type": "integer", + "description": "The number of randomly selected spectrum files.", + "default": 200, + "fa_icon": "fas fa-filter", + "hidden": true } }, "fa_icon": "fas fa-braille" diff --git a/workflows/dia.nf b/workflows/dia.nf index 0f703620..69bc2538 100644 --- a/workflows/dia.nf +++ b/workflows/dia.nf @@ -75,7 +75,11 @@ workflow DIA { // // MODULE: DIANN_PRELIMINARY_ANALYSIS // - DIANN_PRELIMINARY_ANALYSIS(ch_file_preparation_results.combine(speclib)) + if (params.random_preanalysis){ + DIANN_PRELIMINARY_ANALYSIS(ch_file_preparation_results.randomSample(params.empirical_assembly_ms_n, 2024).combine(speclib)) + } else{ + DIANN_PRELIMINARY_ANALYSIS(ch_file_preparation_results.combine(speclib)) + } ch_software_versions = ch_software_versions .mix(DIANN_PRELIMINARY_ANALYSIS.out.version.ifEmpty(null))