Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,19 @@ process {
]
}

withName: ".*:DIA:SILICOLIBRARYGENERATION" {
ext.args = [
"--met-excision",
].join(' ').trim()
}

withName: ".*:DIA:DIANN_PRELIMINARY_ANALYSIS" {
ext.args = [
params.quick_mass_acc ? "--quick-mass-acc" : '', // if mass-acc is given, this will be ignored
params.performance_mode ? "--min-corr 2 --corr-diff 1 --time-corr-only" : ''
].join(' ').trim()
}

// MS2RESCORE
withName: 'MS2RESCORE' {
ext.args = [
Expand Down
8 changes: 4 additions & 4 deletions modules/local/assemble_empirical_library/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ process ASSEMBLE_EMPIRICAL_LIBRARY {
def args = task.ext.args ?: ''

if (params.mass_acc_automatic) {
mass_acc = '--quick-mass-acc --individual-mass-acc'
mass_acc = '--individual-mass-acc'
} else if (meta['precursormasstoleranceunit'].toLowerCase().endsWith('ppm') && meta['fragmentmasstoleranceunit'].toLowerCase().endsWith('ppm')){
mass_acc = "--mass-acc ${meta['fragmentmasstolerance']} --mass-acc-ms1 ${meta['precursormasstolerance']}"
} else {
mass_acc = '--quick-mass-acc --individual-mass-acc'
mass_acc = '--individual-mass-acc'
}
scan_window = params.scan_window_automatic ? '--individual-windows' : "--window $params.scan_window"

Expand All @@ -53,9 +53,9 @@ process ASSEMBLE_EMPIRICAL_LIBRARY {
${mass_acc} \\
${scan_window} \\
--gen-spec-lib \\
$args \\
2>&1 | tee assemble_empirical_library.log
$args

cp report.log.txt assemble_empirical_library.log

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
14 changes: 5 additions & 9 deletions modules/local/diann_preliminary_analysis/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,16 @@ process DIANN_PRELIMINARY_ANALYSIS {
// was evaluating to null when using the dot notation.

if (params.mass_acc_automatic) {
mass_acc = '--quick-mass-acc --individual-mass-acc'
mass_acc = ""
} else if (meta['precursormasstoleranceunit'].toLowerCase().endsWith('ppm') && meta['fragmentmasstoleranceunit'].toLowerCase().endsWith('ppm')){
mass_acc = "--mass-acc ${meta['fragmentmasstolerance']} --mass-acc-ms1 ${meta['precursormasstolerance']}"
} else {
log.info "Warning: DIA-NN only supports ppm unit tolerance for MS1 and MS2. Falling back to `mass_acc_automatic`=`true` to automatically determine the tolerance by DIA-NN!"
mass_acc = '--quick-mass-acc --individual-mass-acc'
mass_acc = ""
}

// Notes: Use double quotes for params, so that it is escaped in the shell.
scan_window = params.scan_window_automatic ? '--individual-windows' : "--window $params.scan_window"
time_corr_only = params.time_corr_only ? '--time-corr-only' : ''
scan_window = params.scan_window_automatic ? '' : "--window $params.scan_window"

"""
# Precursor Tolerance value was: ${meta['precursormasstolerance']}
Expand All @@ -51,13 +50,10 @@ process DIANN_PRELIMINARY_ANALYSIS {
--verbose $params.diann_debug \\
${scan_window} \\
--temp ./ \\
--min-corr $params.min_corr \\
--corr-diff $params.corr_diff \\
${mass_acc} \\
${time_corr_only} \\
$args \\
2>&1 | tee ${ms_file.baseName}_diann.log
$args

cp report.log.txt ${ms_file.baseName}_diann.log

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
26 changes: 8 additions & 18 deletions modules/local/diannsummary/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ process DIANNSUMMARY {

output:
// DIA-NN 2.0 don't return report in tsv format
path "diann_report.tsv", emit: main_report optional true
path "diann_report.parquet", emit: report_parquet optional true
path "diann_report.manifest.txt", emit: report_manifest optional true
path "diann_report.protein_description.tsv", emit: protein_description optional true
path "diann_report.tsv", emit: main_report, optional: true
path "diann_report.parquet", emit: report_parquet, optional: true
path "diann_report.manifest.txt", emit: report_manifest, optional: true
path "diann_report.protein_description.tsv", emit: protein_description, optional: true
path "diann_report.stats.tsv", emit: report_stats
path "diann_report.pr_matrix.tsv", emit: pr_matrix
path "diann_report.pg_matrix.tsv", emit: pg_matrix
Expand All @@ -32,8 +32,8 @@ process DIANNSUMMARY {
path "diannsummary.log", emit: log

// Different library files format are exported due to different DIA-NN versions
path "empirical_library.tsv", emit: final_speclib optional true
path "empirical_library.tsv.skyline.speclib", emit: skyline_speclib optional true
path "empirical_library.tsv", emit: final_speclib, optional: true
path "empirical_library.tsv.skyline.speclib", emit: skyline_speclib, optional: true
path "versions.yml", emit: versions

when:
Expand All @@ -42,14 +42,6 @@ process DIANNSUMMARY {
script:
def args = task.ext.args ?: ''

if (params.mass_acc_automatic) {
mass_acc = '--quick-mass-acc --individual-mass-acc'
} else if (meta['precursormasstoleranceunit'].toLowerCase().endsWith('ppm') && meta['fragmentmasstoleranceunit'].toLowerCase().endsWith('ppm')){
mass_acc = "--mass-acc ${meta['fragmentmasstolerance']} --mass-acc-ms1 ${meta['precursormasstolerance']}"
} else {
mass_acc = '--quick-mass-acc --individual-mass-acc'
}

scan_window = params.scan_window_automatic ? "--individual-windows" : "--window $params.scan_window"
species_genes = params.species_genes ? "--species-genes": ""
report_decoys = params.diann_report_decoys ? "--report-decoys": ""
Expand All @@ -64,8 +56,6 @@ process DIANNSUMMARY {
--f ${(ms_files as List).join(' --f ')} \\
--threads ${task.cpus} \\
--verbose $params.diann_debug \\
${scan_window} \\
${mass_acc} \\
--temp ./quant/ \\
--relaxed-prot-inf \\
--pg-level $params.pg_level \\
Expand All @@ -76,9 +66,9 @@ process DIANNSUMMARY {
--qvalue $params.protein_level_fdr_cutoff \\
${report_decoys} \\
${diann_export_xic} \\
$args \\
2>&1 | tee diannsummary.log
$args

cp diann_report.log.txt diannsummary.log

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
5 changes: 3 additions & 2 deletions modules/local/individual_final_analysis/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ process INDIVIDUAL_FINAL_ANALYSIS {
--no-main-report \\
--relaxed-prot-inf \\
--pg-level $params.pg_level \\
$args \\
2>&1 | tee ${ms_file.baseName}_final_diann.log
$args

cp report.log.txt ${ms_file.baseName}_final_diann.log

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
3 changes: 2 additions & 1 deletion modules/local/silicolibrarygeneration/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ process SILICOLIBRARYGENERATION {
--predictor \\
--verbose $params.diann_debug \\
--gen-spec-lib \\
2>&1 | tee silicolibrarygeneration.log
${args}

cp *lib.log.txt silicolibrarygeneration.log

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
13 changes: 10 additions & 3 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,8 @@ params {
diann_debug = 3
scan_window = 8
scan_window_automatic = true
min_corr = 2.0
corr_diff = 1.0
time_corr_only = true
performance_mode = true // add '--min-corr 2 --corr-diff 1 --time-corr-only'
quick_mass_acc = true
mass_acc_automatic = true
pg_level = 2
species_genes = false
Expand Down Expand Up @@ -492,6 +491,14 @@ manifest {
github: 'jpfeuffer',
contribution: ['author', 'maintainer'], // List of contribution types ('author', 'maintainer' or 'contributor')
orcid: '0000-0001-8948-9209'
],
[
name: 'Dongze He',
affiliation: 'Altos Labs, Inc.',
email: '[email protected]',
github: 'DongzeHe',
contribution: ['contributor'], // List of contribution types ('author', 'maintainer' or 'contributor')
orcid: '0000-0001-8259-7434'
]
]
homePage = 'https://github.com/bigbio/quantms'
Expand Down
22 changes: 8 additions & 14 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1001,22 +1001,16 @@
"help_text": " Ideally, should be approximately equal to the average number of data points per peak",
"default": 8
},
"min_corr": {
"type": "number",
"description": "Only peaks with correlation sum exceeding min_corr will be considered",
"fa_icon": "fas fa-filter",
"default": 2.0
},
"corr_diff": {
"type": "number",
"description": "Peaks with correlation sum below corr_diff from maximum will not be considered",
"fa_icon": "fas fa-filter",
"default": 1.0
"performance_mode": {
"type": "boolean",
"description": "Set Low RAM & High Speed Mode for DIANN, including min-corr, corr-diff, and time-corr-only three parameters",
"fa_icon": "far fa-check-square",
"default": true
},
"time_corr_only": {
"quick_mass_acc": {
"type": "boolean",
"description": "A single score will be used until RT alignment to save memory",
"fa_icon": "fas fa-filter",
"description": "when choosing the MS2 mass accuracy setting automatically, DIA-NN will use a fast heuristical algorithm instead of IDs number optimisation",
"fa_icon": "far fa-check-square",
"default": true
},
"pg_level": {
Expand Down
8 changes: 4 additions & 4 deletions workflows/dia.nf
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ workflow DIA {
//
if (params.random_preanalysis) {
preanalysis_subset = ch_file_preparation_results
.toSortedList()
.toSortedList{ a, b -> a[1].getName() <=> b[1].getName() }
.flatMap()
.randomSample(params.empirical_assembly_ms_n, params.random_preanalysis_seed)
empirical_lib_files = preanalysis_subset
.map { result -> result[1] }
.collect()
.collect( sort: { a, b -> a.getName() <=> b.getName() } )
DIANN_PRELIMINARY_ANALYSIS(preanalysis_subset.combine(speclib))
} else {
empirical_lib_files = ch_file_preparation_results
.map { result -> result[1] }
.collect()
.collect( sort: { a, b -> a.getName() <=> b.getName() } )
DIANN_PRELIMINARY_ANALYSIS(ch_file_preparation_results.combine(speclib))
}
ch_software_versions = ch_software_versions
Expand Down Expand Up @@ -128,7 +128,7 @@ workflow DIA {
// locally, evey element in ch_result is a string, whilst on cloud it is a path.
ch_result
.ms_file.map { msfile -> file(msfile).getName() }
.collect()
.collect(sort: true)
.set { ms_file_names }

DIANNSUMMARY(
Expand Down