Skip to content

v2.6.0

Latest

Choose a tag to compare

@wenbostar wenbostar released this 06 Jul 14:26

PDV 2.6.0

This release focuses on predicted-spectrum matching: a new auto-predict mirror mode that fetches a Koina prediction for every PSM on demand, a rebuilt Koina client on the canonical koina.wilhelmlab.org host with three new models and proper test coverage, and a tidier Import-predicted dialog. It also adds a View → Export Window Screenshot action (PNG/TIFF/PDF/SVG at a chosen DPI), a render guard for too-small plot areas, and fixes confidence-track alignment for N-terminally modified residues.

✨ New: auto-predict mirror mode

The Import predicted dialog gains an "Auto-generate for all PSMs" checkbox. Once enabled, PDV fetches a predicted mirror spectrum from Koina on demand for every peptide PSM, reusing the chosen model / instrument / collision energy — no need to import a prediction file per spectrum.

  • The dialog restores this state (checkbox plus model/instrument/CE settings) when reopened.
  • Predicted cache entries are provenance-tracked (autoPredictedKeys) and invalidated when the prediction settings change, while any manual file imports are preserved.
  • The prediction cache is now a ConcurrentHashMap, since it is written from background fetch threads while the EDT reads it.

🔮 Rebuilt Koina predicted-spectra client

The predicted-spectra client now targets the canonical Koina server (koina.wilhelmlab.org) and was reworked to be robust and easy to extend:

  • One base URL — the inference URL is built from the model name instead of a per-model branch.
  • Name-based response parsing — outputs are read by name (mz / intensities) rather than a fixed per-model index, and numbers are cast via Number, so integer-formatted JSON values no longer risk a ClassCastException.
  • Category-driven request bodies — the request body is generated from model-category sets (instrument / fragmentation / charge-only) instead of seven copied per-model JSON blocks, so adding a model needs no new request code.
  • Three new models: UniSpec, ms2pip_Immuno_HCD, and ms2pip_timsTOF2024.
  • The dialog's instrument/fragment combos are driven by the model name, and the instrument dropdown is filtered to the instruments each model supports (e.g. UniSpec accepts only QE and LUMOS).
  • Fixed a malformed instrument list entry (Exploris480:QE) that broke the ": " suffix parse.

🖼️ New: Export Window Screenshot

A new View → Export Window Screenshot action saves the main window as PNG, TIFF, PDF, or SVG via a save dialog.

  • Resolution (DPI) selector (default 300): raster output is re-rendered at dpi/96 scale for genuine high resolution and the DPI is embedded; vector formats (PDF/SVG) are unaffected.
  • Optional border line (default on) and drop shadow (default off) for PNG.
  • The file-name extension stays in sync with the selected format, and a wrong known extension is replaced at save time (no more name.png.pdf).
  • Scaled image dimensions now use floor, so a rounded-up size no longer leaves an unpainted black sliver on the right/bottom edge.

🛡️ Plot-too-small render guard

The underlying compomics GraphicsPanel can hang in its Y-axis tag loop when given too little vertical height (worse in the halved mirror/check views). Below a mode-aware height threshold the spectrum is no longer drawn; a centered "Increase the panel size to show the plot" message is shown instead and the match-stat labels are cleared. The size gate is centralized in gatePlotArea() and applied on render, on resize, and on view switch, rebuilding all panes when the area grows back.

🎨 Import predicted dialog layout

  • Mid-row labels (Precursor Charge, Collision Energy, Fragment Method) size to their natural width so they no longer truncate.
  • The charge and collision-energy spinners are widened (50 → 60) so their values show in full.
  • Leading Model / Instrument labels are narrowed (100 → 80) to cut the gap before the dropdowns while keeping the two dropdown columns aligned.
  • The modification table's preferred height is reduced (300 → 150) so the dialog packs compact instead of leaving a large empty area.

🐞 Bug fixes

  • Confidence track misalignment for N-terminally modified residues. The per-residue confidence track measures the strip's N-terminal prefix (NH2-) to line residue 1 up under the sequence, but it read that width from the raw first layout component, which still carried the modification tag (e.g. NH2-M<Oxidation of M>), inflating the prefix (~36px → ~158px) and shoving the whole track off the panel. The <...> tag is now stripped the same way the strip does at paint time before measuring, so all bars align under their residues. Verified with Casanovo PSMs carrying Oxidation (M), Carbamidomethyl (C), and Deamidated (N/Q).

🧪 Tests

  • New GetPredictedOnlineTest (JUnit 4.13.2) covers URL building, request-body generation, name-based / integer-tolerant response parsing, the model categories, and a network test across all exposed models (skipped when offline).

⬆️ Dependencies

  • Added JUnit 4.13.2 (junit:junit, test scope) for the new predicted-spectra client tests.

🔄 Compatibility

  • Existing projects, import formats, and command-line modes continue to work unchanged.
  • Auto-predict is off until you enable the checkbox; manual prediction-file imports behave exactly as before.
  • The migration to koina.wilhelmlab.org is transparent — existing models still resolve, and the three new models are additive.

🙌 Contributors

  • Bo Wen (@wenbostar) — auto-predict mirror mode, Koina client rebuild and new models, window screenshot export, plot-too-small render guard, Import-predicted layout, confidence-track fix, and tests.

📦 Full changelog

  • Add auto-predict mirror mode and a plot-too-small render guard (e2a655a)
  • Tidy the Import predicted dialog layout (4274bb9)
  • Migrate Koina to wilhelmlab host, add UniSpec / ms2pip_Immuno_HCD / ms2pip_timsTOF2024, and add tests (566aa41)
  • Add Export Window Screenshot to the View menu (f1c1a99)
  • Fix confidence track misalignment for N-terminally modified residues (bde15b6)

Full diff: v2.5.0...v2.6.0