Skip to content

Add JSON parameter files and complete the GUI workflow (#287) - #297

Merged
martin-raden merged 13 commits into
feat/286-wasm-webinterfacefrom
feat/287-json-gui-review
Oct 26, 2026
Merged

martin-raden merged 13 commits into
feat/286-wasm-webinterfacefrom
feat/287-json-gui-review

Conversation

@Alexander-Mitrofanov

Copy link
Copy Markdown
Collaborator

Addresses the October 23 review of #287. This PR targets feat/286-wasm-webinterface and has a separate implementation commit for each of the seven requested sections.

IntaRNA now reads portable JSON parameter files with embedded input text, and the GUI uses that format for WASM calls, Load/Store, examples and reproducible ZIP exports. Existing key/value parameter files remain supported.

Changes

  • Rename webinterface/ to gui/, including imports, documentation, staging and the combined Pages deployment at /IntaRNA/gui/.
  • Auto-detect JSON through --parameterFile. Reuse native option validation and CLI precedence; apply file personalities before selecting defaults. Embed FASTA, accessibility, SHAPE and ViennaRNA energy-parameter text with temporary files owned for the full prediction lifetime. Reject malformed schemas, duplicate keys and recursive parameter files.
  • Use one embedded-input JSON document for each WASM invocation.
  • Add Load and Store beside Reset. Preserve task, indices, selected CSV column order and additional outputs. ZIPs contain only parameter.json and output files, with compiled versions and runnable reproduction commands in JSON _comment metadata.
  • Clear inputs/results on Reset; keep example sequences only as placeholders. Add an Example dropdown backed by two editable JSON examples and a manifest.
  • Add Upload buttons and drag/drop to both FASTA fields, with validation before replacement and protection against stale asynchronous reads.
  • Replace the task dropdown with visible, keyboard-operable Prediction/Evaluation choices and descriptions; update the Seeds/Accessibility heading.

The JSON format and the Boost.JSON vs. nlohmann/json decision are documented in doc/json-parameters.md. The pinned, unmodified nlohmann/json 3.12.0 header adds no linked/system dependency and keeps the current Boost minimum. Its license and checksums are included. Matching local WASM builds grew by 145,234 bytes raw / 41,504 bytes gzip; the document records versions and reproduction details.

Validation

  • GCC 14 native release and debug: make tests -j2, all 9 API/CLI groups passed. The existing out-of-tree CLI harness required tracked fixtures linked into each build's tests/data directory. Focused JSON checks also passed after the final header adjustment.
  • npm test --prefix gui: 18 tests passed.
  • Actual Emscripten 4.0.23 / ViennaRNA 2.7.2 / Boost 1.87.0 WASM build; node scripts/wasm/smoke.mjs and node scripts/wasm/smoke-protocol.mjs passed. Fresh-engine JSON replay reproduced CSV and every additional output byte for byte, including multi-FASTA, signed indices, SHAPE/accessibility inputs and text reports.
  • Real Chromium and Firefox suites passed on nested URLs: blank startup/reset, JSON examples and Load/Store, upload/drop, stale reads, task keyboard controls, ZIP contents, output exploration, mobile overflow, abort and recovery. Desktop screenshot inspected.
  • Embedded ViennaRNA energy parameters matched native file input. Dependency download/release tests, shell syntax, workflow YAML, make dist contents, vendor checksums and git diff --check passed.

JSON comment headers use ordinary _comment data so files remain strict JSON. The browser accepts the settings it can represent and explicitly rejects native-only settings or external file paths; unfinished forms can be stored, with full job validation at Compute. Binary .agz accessibility caches remain available by native filesystem path; embedded accessibility uses text.

@martin-raden

martin-raden commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

@Alexander-Mitrofanov

thanks, please extend with the following idea within a new PR targeting this branch "feat/287-json-gui-review"

  • so far changing a parameter resets the output

new idea to implement

I want the user to be able to run and compare different parameter setting and results. thus they have to be (temporarily) preserved in the browser memory.

  • each parameter set that was computed is stored (together with its input in JSON format) as a "session" (with an internal (random?) ID and a (default) name)
  • each session gets its own (foldable) output area
  • selecting a session (output area) reloads its input parameters, unfolds the sessions output area and folds other sessions
  • the header of the session
    • shows and allows to set/change the name of the session
    • shows the ZIP export button (for archiving)
    • shows a "garbage bin" button to delete the session

@martin-raden
martin-raden merged commit a884313 into feat/286-wasm-webinterface Oct 26, 2026
5 checks passed
@martin-raden
martin-raden deleted the feat/287-json-gui-review branch October 26, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants