Skip to content

Parallelize per-file feature detection in ProteomicsLFQ #739

Open

Description

@chunxubioinfor

Description of feature

Hi quantms team! I'm Chunxu, a Research Assistant in the Isoform Analysis Group at DTU HealthTech. We're using quantms for isoform-level proteomics analysis and I really like this fantastic and well-maintainted tool! :) Now we are looking to scale up to larger cohorts, which led us to profile where wall-clock time actually goes.

The bottleneck: In our own timing breakdown of a 96-file LFQ run, ProteomicsLFQ was the single largest non-parallelized cost — it does real per-file work (feature detection, mzML reloading) for every input file, but inside one serial process, unlike the per-file search/rescoring steps upstream which Nextflow already parallelizes across tasks. Looking at modules/local/openms/proteomicslfq/main.nf on master, this is because it joins every file into one invocation: -in ${mzml_sorted.join(' ')} -ids ${id_sorted.join(' ')}

Potential opportunity: I was trying to figure out if it's possible to parallelize then found out OpenMS 3.6.0 (released Sept 30) added exactly the mechanism needed to split this, via PR #9989 ("resumable and distributable feature detection via -feat_dir"), merged Aug 29 into develop. It adds:

▎ - -detect_only : run per-file feature detection as an independent invocation, one per raw file
▎ - -feat_dir: a checkpoint directory those per-file runs write into
▎ - A final combination invocation with no -in/-ids at all just -design, -fasta, and -feat_dir — that reads the checkpoints and does alignment/linking/protein inference/quantification across the whole study

I have to say I'm new to this area and not quite familiar with the Nextflow, but it seems like a close match for exactly what a Nextflow-based pipeline wants: one -detect_only task per file (parallel, like the existing search/rescoring steps), then one lightweight combination task. Ideally it will saves lots of compute time at this step.

I would appreciate if you could look into and assess the feasibility when you have time. Happy to help test this against our own dataset once there's something to try, or to discuss the design if useful. :)

Activity

  1. added
    enhancement
    on Oct 7, 2026
  2. jpfeuffer commented on Oct 7, 2026

    @jpfeuffer
    Collaborator

    Hi!

    Yes, this should now be possible with the current version of OpenMS. OpenMS/OpenMS#9989
    There are a lot of optimizations that could be done with the newest version. We plan to do a larger overhaul with the new features in the near future.
    But we are also happy to accept a PR (even AI-supported if tested locally) from you if you want to dive in right now.

  3. jpfeuffer commented on Oct 7, 2026

    @jpfeuffer
    Collaborator

    And I think your intutition is right. That is roughly what the workflow would need to do.

    Here another summary of what an LLM suggested:

    How the split works

    • Pass any subset of the design's runs per task. The shared -design still lists every run. When -in is given, the code filters the design down to those basenames (design_.filterByBasenames) and warns about the rows it dropped. The tests do this: detect_a takes 3 runs and detect_b takes the other 3, both with the full design.
    • Each run's checkpoint name comes from its design row. The name is <mzML stem>_fg<FractionGroup>_f<Fraction>.featureParquet. Because it comes from the design row and not from the task, different tasks never collide on a name, and the final combine finds each run by that name.
    • Pair -in[i] with -ids[i]. The lists must be the same length and are matched by file basename.

    Granularity options

    • One task per run is the usual choice, and the PR's example does this: -in a.mzML -ids a.idXML. In Nextflow it is simply mzml_ids_ch.map { ... } into a -detect_only process.
    • N runs per task also works if you want to batch. Runs within one invocation are processed sequentially in a loop, and -threads applies within a run.
    • Grouping by fraction is not required. The detect step never needs a whole fraction. Only the combine step needs all runs of a fraction together.

    Duplicate or overlapping assignments are safe

    • If two tasks get the same run, each writes to a temp name and renames it into place. The loser sees the existing checkpoint and keeps it ("written concurrently by another process; keeping theirs"). This relies on a rename into a shared directory being atomic, so it assumes a POSIX-like shared filesystem.
    • Re-running a task is a no-op for runs that already have a valid checkpoint. That is what makes it resumable. A failed or retried job just redoes its missing runs.

    What you do need to guarantee

    • Every run in the design needs a checkpoint before you combine. Otherwise the combine fails with "No feature checkpoint for '' and no identification file given for it".
    • Include every row in the design. A run that is in the design but not detected anywhere blocks the combine, so the combine step must wait for all detect tasks. In Nextflow that means .collect() before the final process.
    • Don't shrink the design in the combine step. With no -in, the combine run uses the whole design as its roster. To combine a subset, pass a reduced -design. This changes the design row only if you also change the fraction group, sample or fraction values, so keep those values unchanged.
  4. jpfeuffer commented on Oct 7, 2026

    @jpfeuffer
    Collaborator

    Note that in the final step they will still need to be merged and refined, therefore I think the overall peak RAM usage will not decrease significantly for the final merging step if that was expected.

  5. chunxubioinfor commented on Oct 8, 2026

    @chunxubioinfor
    Author

    Yes @jpfeuffer ! I'll give a try! Thank you again for your quick and super detailed answers! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions