Skip to content

Frechet states and more - #41

Merged
jonas-fuchs merged 27 commits into
masterfrom
dev
Sep 21, 2026
Merged

jonas-fuchs merged 27 commits into
masterfrom
dev

Conversation

@jonas-fuchs

Copy link
Copy Markdown
Collaborator

WebApp

  • Upload cancellation — in-flight uploads (single and batch) can now be aborted mid-transfer via a new × button on the upload progress bar. apiUpload captures the XHR (onAbort callback), handles the browser abort event explicitly, and canceled uploads are no longer surfaced as errors (api.js, useProfileSubmit.js, useBatchManager.js, AnalyzeTab.jsx).
  • Batch upload robustness — batch uploads use an in-flight counter (not a boolean) so multi-file batches keep the "uploading" state until every file finishes; the Analyze button is gated until uploads complete, and a cancel cannot leak into subsequent files in the loop (useBatchManager.js).
  • Clear-all control for batch file lists, plus a batch file-count row (styles.css, AnalyzeTab.jsx).
  • Persistent upload progress bar — stays visible in both input and results views so the last upload's outcome remains readable; the "Analyze multiple samples" heading was simplified to a single "Analyze" heading.
  • 5-rank severity coloring — database plots now classify phenotypes into the 5-rank vocabulary mirroring phenotype_ranks.py (replacing the old 3-tone resist/intermediate/susceptible heuristic). Contradictory labels get their own tone, and legends show the database's original wording (labelToRank, shared-helpers.js, position-builders.js, DatabasePositionPlot.jsx).
  • Iframe origin fix — report iframe URLs are now resolved against window.location.href (new URL(src, window.location.href)), fixing silent rejection of all report messages when the iframe remounts on submode switch with relative URLs (AnalyzeTab.jsx).

CLI

Added

  • Combinatorial SNP codon assessment from BAM files — new module combined_snp.py (+768). When --bam is passed in VCF mode, exact same-codon SNP co-occurrence is measured from spanning reads (per-CHROM BamCooccurrence contexts, MAPQ/base-quality gated), replacing the conservative Fréchet lower-bound estimate. Combined-codon frequencies are tagged observed vs estimated in reports.
  • Fréchet bounds for combination (formula) rules — formula AND clauses now fire only when the guaranteed minimum co-occurrence fraction of members (Fréchet lower/upper bound) reaches a threshold; applied to both the codon path and the combination path, with tightened codon-combination gating.
  • Custom TOML configuration — new --config / -c option on profile-vcf, profile-fasta, and regenerate. User TOML deep-merges over bundled defaults.toml with strict type validation (bool-vs-int guard, per-section/key type checks). New knobs include min_cooccurrence_codon_fraction, min_cooccurrence_combination_fraction, frechet_epsilon (codon & combination paths), min_read_mapping_quality, bam_base_quality_threshold, and GenBank fetch retry settings (genbank_timeout, genbank_max_retries, genbank_backoff_base).
  • Technical reference documentation — new technical-reference.md (+1,160 lines) and a comprehensive configuration guide (+152 lines); MathJax support added to the docs site.

Changed

  • DB schema extended (schema.py, models.py): new columns combined_states, single_exchange_aa_freq, rule_effect_aa_freq, rule_effect_alt, freq_method with automatic migration; CodonState dataclass with frechet_lower, forced_fraction, member_count.
  • Report/exports — HTML report, TSV, and JSON exports now include combined codon states and Fréchet bounds; amino-acid effect formatting handles combined members whose single-SNP state is Fréchet-impossible.
  • GenBank efetch retry with exponential backoff promoted to configurable settings.

Fixed

  • Rule matching display; Fréchet logic and display issues; a displaying issue in annotation; flaky test behaviour.

@codecov

codecov Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

@jonas-fuchs
jonas-fuchs merged commit 7b33e79 into master Sep 21, 2026
13 checks passed
@jonas-fuchs
jonas-fuchs deleted the dev branch September 21, 2026 12:06
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.

1 participant