Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
Empty file modified .hooks/block_pipeline_outdir.sh
100644 → 100755
Empty file.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### `Fixed`

- Support independent LFQ groups selected by explicit SDRF columns (`lfq_group_by`). Preserve the complete input and run identities, keep fractionated samples together, and pair each consensusXML with its group-specific SDRF for separately named QPX outputs. The groups are split by `quantmsutilsc splitlfqgroups` from quantms-utils, and the group table is passed to the pmultiqc report.
- Add optional Comet bin settings (native full-width `comet_fragment_bin_tol`, `comet_fragment_bin_offset` and `comet_instrument`) with per-run overrides, divide the width by two for OpenMS, and log the original SDRF tolerance and effective Comet settings without changing metadata used by other engines or rescoring. Without these settings, Da and ppm tolerances keep their existing automatic binning.
- Preserve the SDRF fragment tolerance value and Da/ppm unit in MS2-based rescoring; use the configured fallback only when both fields are absent, and reject incomplete pairs or unsupported units. MS2PIP with ppm uses MS2PIP 4.2 in the default quantms-rescoring `0.0.25` container.
- Allow an empty fixed-modification set from SDRF without adding a default modification. Reject searches using MS-GF+ when both modification sets remain empty after the variable-modification fallback, to prevent OpenMS MSGFPlusAdapter from silently enabling fixed Carbamidomethyl (C).
- Trim the selected variable-modification value before validation so a whitespace-only fallback cannot bypass the MS-GF+ empty-modification check.
- Match each Sage identification file to its run by exact name. A run such as `fr1` no longer also collects the identifications of `fr10` after IDRipper splits a multi-run search.
- Declare Sage outputs for Bruker `.d` runs without the `.d` suffix, as IDRipper names them.

### `Dependencies`

- Bumped `quantms-rescoring` to `0.0.25`: MS2PIP 4.2 with Da and ppm fragment tolerances, and unique identification indices when `PSM_CLEAN` merges several search engines.
- `PREPARE_LFQ_GROUPS` uses `quantms-utils` `0.0.31`, which provides `quantmsutilsc splitlfqgroups`.

## [1.10.0] bigbio/quantms - [15/08/2026] - [London]

### `Changed`
Expand Down
17 changes: 17 additions & 0 deletions conf/modules/lfq.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,21 @@ process {
withName: '.*:LFQ:PROTEOMICSLFQ' {
ext.args = "-debug $params.plfq_debug"
}

withName: '.*:PREPARE_LFQ_GROUPS' {
publishDir = [
path: { "${params.outdir}/sdrf/lfq_groups" },
mode: params.publish_dir_mode,
pattern: '*.tsv'
]
}

withName: '.*:LFQ:QPX_OPENMSCONSENSUS' {
ext.prefix = { params.lfq_group_by ? "${params.accession ?: 'openms'}__${sdrf.baseName}" : null }
publishDir = [
path: { params.lfq_group_by ? "${params.outdir}/qpx/${sdrf.baseName}" : "${params.outdir}/qpx" },
mode: 'copy',
saveAs: { filename -> filename.equals('versions.yml') ? null : filename.tokenize('/').last() }
]
}
}
6 changes: 6 additions & 0 deletions docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ QPX is the published quantification artifact for both DDA-LFQ and DDA-ISO. It is
channel labels. The dataset is published flat under `qpx/`, the same layout as the DIA-NN (`quantmsdiann`) QPX
output. See the [QPX specification](https://bigbio.github.io/qpx/) for the view schemas and file layout.

When `--lfq_group_by` is set, `sdrf/lfq_groups/lfq_groups.tsv` records every run's group, the original grouping values, and the generated SDRF/design filenames. The corresponding files preserve the selected rows and reindex only structural OpenMS sample/fraction-group IDs. Conditions and biological-replicate values are retained. QPX datasets are published separately under `qpx/<group>.sdrf/`, with distinct filename prefixes to prevent collisions during reporting. MSstats tables also have distinct group-specific design prefixes. The ungrouped output layout is unchanged.

#### MSstats post-processing (external)

The pipeline no longer runs MSstats post-processing. Instead, quantms produces MSstats-compatible input files (`quant_tables/*_msstats_in.csv`) that users can provide directly to MSstats outside the pipeline for normalization, imputation, and statistical analysis.
Expand All @@ -266,3 +268,7 @@ The pipeline no longer runs MSstats post-processing. Instead, quantms produces M
All the QC results for proteomics are currently generated by the [pMultiQC](https://github.com/bigbio/pmultiqc) library, a plugin of the popular visualization tool [MultiQC](http://multiqc.info). MultiQC is a visualization tool that generates a single HTML report summarising all samples in your project. Most of the pipeline QC results are visualised in the report and further statistics are available in the report data directory.

Results generated by pMultiQC collate pipeline QC from identifications and quantities throughout the pipeline. The pipeline has special steps which also allow the software versions to be reported in the MultiQC output for future traceability. For more information about how to use pMultiQC reports in general, see <https://github.com/bigbio/pmultiqc>.

### Comet binning provenance

For each Comet run, `.nextflow.log` records the original fragment tolerance, the native full bin width in Da, the half width passed to OpenMS, the offset and instrument mode, and the source of those settings. Per-task `.command.sh` records the actual adapter arguments. These Comet-specific settings do not replace the SDRF tolerance supplied to other engines or rescoring.
50 changes: 50 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,56 @@ nextflow run bigbio/quantms --input '/url/path/to/your/experiment_design.sdrf.ts

The input file must be in [Sample-to-data-relationship format (SDRF)](https://pubs.acs.org/doi/abs/10.1021/acs.jproteome.0c00376) and can have `.sdrf`, `.tsv`, or `.csv` file extensions.

### Independent LFQ groups

Use `--lfq_group_by 'comment[instrument],comment[gradient duration]'` when a complete LFQ SDRF contains acquisitions that must be quantified separately. The named columns must exist and contain a value for every run. The default is a single LFQ analysis, as before.

All runs are retained. The pipeline creates an OpenMS design and an SDRF for each combination of grouping values, then performs alignment, linking, protein inference and quantification independently within that group. A fractionated sample cannot cross groups. Missing runs or conflicting group assignments are errors. The original SDRF is not modified; condition and biological-replicate annotations are preserved in the generated files. Choose columns from the experimental design, not from the observed quantification results.

Search and rescoring remain per run and precede grouping. They can be reused with `-resume` when their inputs and settings are unchanged. Each group's QPX retains the original project accession and has a distinct output prefix. Groups are separate analyses, not extra independent studies or biological replicates; cross-group feature matching is not performed.

### Search modifications from SDRF

Fixed modifications are read exclusively from the SDRF modification annotations. If the parsed `FixedModifications` value is empty, quantms preserves an empty fixed-modification set instead of rejecting the input or adding a default modification such as Carbamidomethyl (C). Annotate modifications according to the experimental protocol; a modification that is variable must not be declared fixed just to make the input pass validation.

Variable modifications are read from the SDRF when present. If the parsed variable-modification set is empty or contains only whitespace, quantms uses `--variable_mods`, whose default is `Oxidation (M)`. Leading and trailing whitespace is removed from the selected SDRF or fallback value before validation; a whitespace-only fallback is treated as an empty set. An empty fixed-modification set with a nonempty variable-modification set is supported with Comet, MS-GF+, and Sage.

For a search without either fixed or variable modifications, select Comet and/or Sage and set `variable_mods` to an empty string. When `--search_engines` includes `msgf`, quantms rejects an empty final set of both modification types: the current OpenMS MSGFPlusAdapter would otherwise enable fixed Carbamidomethyl (C). This check runs after the variable-modification fallback has been applied.

### Comet fragment binning

Comet scores spectra using fixed-width fragment bins. Its native `fragment_bin_tol` is a **full bin width in Da**, not a ppm matching window. OpenMS `CometAdapter -fragment_mass_tolerance` takes **half** that width. quantms exposes the native width as `--comet_fragment_bin_tol` and divides it by two when calling the adapter.

For ppm fragment tolerances without Comet-specific settings, quantms guesses the binning from the ppm value and logs a warning: below 50 ppm it uses a 0.03 Da full bin with offset 0 and `high_res`; from 50 ppm it uses a 1.0005 Da full bin with offset 0.4 and `low_res`. This guess is **not an equivalent conversion from ppm**. To choose the binning yourself, set all three Comet options: `--comet_fragment_bin_tol`, `--comet_fragment_bin_offset`, and `--comet_instrument`. For example, `--comet_fragment_bin_tol 0.03 --comet_fragment_bin_offset 0 --comet_instrument high_res` uses a 0.03 Da full bin, passing 0.015 Da to OpenMS. Select the settings based on the acquisition and the intended Comet search protocol.

Without Comet-specific bin settings, a Da SDRF tolerance keeps its existing interpretation as the adapter's half width, including the existing offset and instrument defaults. Supplying an explicit width or offset requires both values and an instrument mode. Width must be finite and at least 0.01 Da (also checked for the inherited Da path, so input tolerances below 0.005 Da are rejected); offset must be finite and between 0 and 1. An explicit offset of zero is preserved.

For projects with mixed acquisition settings, use `ext.comet_fragment_bin_tol`, `ext.comet_fragment_bin_offset`, and `ext.comet_instrument` closures under `process.withName: 'COMET'`. These override the corresponding global settings. For the instrument mode, `params.instrument` is a final compatibility fallback shared with MS-GF+; use `comet_instrument` or its per-run override to change only Comet. Use verified run identifiers rather than inferring resolution from the ppm value:

```groovy
process {
withName: 'COMET' {
ext.comet_fragment_bin_tol = { meta.mzml_id == 'verified_high_res_run' ? 0.03 : null }
ext.comet_fragment_bin_offset = { meta.mzml_id == 'verified_high_res_run' ? 0.0 : null }
ext.comet_instrument = { meta.mzml_id == 'verified_high_res_run' ? 'high_res' : null }
}
}
```

Keep global Comet-specific options unset when unlisted runs should keep their automatic settings. Do not additionally override these options through `ext.args` or a Comet parameter file: those adapter options can take precedence over quantms' reported settings.

The original SDRF value and unit are never changed. Other engines and rescoring continue to receive their original metadata. The Nextflow log records the run ID, input tolerance, full width, adapter half width, offset, instrument mode, and whether settings were explicit, derived from Da input (which may itself come from the configured fallback), or guessed from ppm. These details are logged at DEBUG level, so they appear in `.nextflow.log` but not on the console; errors remain visible.

See the [Comet parameter documentation](https://uwpr.github.io/Comet/parameters/parameters_202602/fragment_bin_tol.html) and [OpenMS adapter documentation](https://openms.de/documentation/html/TOPP_CometAdapter.html).

### Fragment tolerance for MS2-based rescoring

`MSRESCORE_FEATURES` passes the SDRF fragment mass tolerance value and unit together to quantms-rescoring. A value such as `20 ppm` remains `20 ppm`; it is not replaced with the configured Da fallback. Unit spelling is normalized to `Da` or `ppm` without changing the numeric value.

The module uses `--ms2features_tolerance` and `--ms2features_tolerance_unit` only when both SDRF tolerance fields are absent. If only one field is missing, or the unit is unsupported, it stops with an error instead of combining SDRF and fallback values.

MS2PIP with ppm requires MS2PIP 4.2 or newer, which the default quantms-rescoring `0.0.25` container provides. AlphaPeptDeep supports both Da and ppm.

### Supported file formats

The pipeline supports the following mass spectrometry data file formats:
Expand Down
3 changes: 2 additions & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"qpx/openmsconsensus": {
"branch": "main",
"git_sha": "c2c00e74fa8495c219a517631f6c3c9d3554712a",
"installed_by": ["modules"]
"installed_by": ["modules"],
"patch": "modules/bigbio/qpx/openmsconsensus/qpx-openmsconsensus.diff"
},
"thermorawfileparser": {
"branch": "main",
Expand Down
7 changes: 3 additions & 4 deletions modules/bigbio/qpx/openmsconsensus/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ process QPX_OPENMSCONSENSUS {
container "ghcr.io/bigbio/qpx:1.1.5"

input:
path(consensusxml)
path(sdrf)
tuple path(consensusxml), path(sdrf)
val(project_accession)
// Optional: the FASTA used for the search, or [] when it is not available.
// qpx fills null pg.sequence_coverage / pg.molecular_weight and
Expand All @@ -32,7 +31,7 @@ process QPX_OPENMSCONSENSUS {

script:
def args = task.ext.args ?: ''
def prefix = project_accession ?: 'openms'
def prefix = task.ext.prefix ?: project_accession ?: 'openms'
def acc_arg = project_accession ? "--project-accession ${project_accession}" : ''
def fasta_arg = fasta ? "--fasta ${fasta}" : ''
"""
Expand Down Expand Up @@ -69,7 +68,7 @@ END_VERSIONS
"""

stub:
def prefix = project_accession ?: 'openms'
def prefix = task.ext.prefix ?: project_accession ?: 'openms'
"""
mkdir -p qpx_output
touch qpx_output/stub.parquet
Expand Down
56 changes: 56 additions & 0 deletions modules/bigbio/qpx/openmsconsensus/qpx-openmsconsensus.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Changes in component 'bigbio/qpx/openmsconsensus'
'modules/bigbio/qpx/openmsconsensus/meta.yml' is unchanged
'modules/bigbio/qpx/openmsconsensus/environment.yml' is unchanged
Changes in 'qpx/openmsconsensus/main.nf':
--- modules/bigbio/qpx/openmsconsensus/main.nf
+++ modules/bigbio/qpx/openmsconsensus/main.nf
@@ -11,8 +11,7 @@
container "ghcr.io/bigbio/qpx:1.1.5"

input:
- path(consensusxml)
- path(sdrf)
+ tuple path(consensusxml), path(sdrf)
val(project_accession)
// Optional: the FASTA used for the search, or [] when it is not available.
// qpx fills null pg.sequence_coverage / pg.molecular_weight and
@@ -32,7 +31,7 @@

script:
def args = task.ext.args ?: ''
- def prefix = project_accession ?: 'openms'
+ def prefix = task.ext.prefix ?: project_accession ?: 'openms'
def acc_arg = project_accession ? "--project-accession ${project_accession}" : ''
def fasta_arg = fasta ? "--fasta ${fasta}" : ''
"""
@@ -69,7 +68,7 @@
"""

stub:
- def prefix = project_accession ?: 'openms'
+ def prefix = task.ext.prefix ?: project_accession ?: 'openms'
"""
mkdir -p qpx_output
touch qpx_output/stub.parquet

Changes in 'qpx/openmsconsensus/tests/main.nf.test':
--- modules/bigbio/qpx/openmsconsensus/tests/main.nf.test
+++ modules/bigbio/qpx/openmsconsensus/tests/main.nf.test
@@ -23,10 +23,9 @@
when {
process {
"""
- input[0] = file("stub.consensusXML", checkIfExists: false)
- input[1] = file("stub_sample.sdrf.tsv", checkIfExists: false)
- input[2] = "PXD026600"
- input[3] = []
+ input[0] = [file("stub.consensusXML", checkIfExists: false), file("stub_sample.sdrf.tsv", checkIfExists: false)]
+ input[1] = "PXD026600"
+ input[2] = []
"""
}
}

'modules/bigbio/qpx/openmsconsensus/tests/nextflow.config' is unchanged
'modules/bigbio/qpx/openmsconsensus/tests/main.nf.test.snap' is unchanged
************************************************************
7 changes: 3 additions & 4 deletions modules/bigbio/qpx/openmsconsensus/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ nextflow_process {
when {
process {
"""
input[0] = file("stub.consensusXML", checkIfExists: false)
input[1] = file("stub_sample.sdrf.tsv", checkIfExists: false)
input[2] = "PXD026600"
input[3] = []
input[0] = [file("stub.consensusXML", checkIfExists: false), file("stub_sample.sdrf.tsv", checkIfExists: false)]
input[1] = "PXD026600"
input[2] = []
"""
}
}
Expand Down
Loading
Loading