Spaces:
Sleeping
Sleeping
Commit History
-
Reframe app around Design→Build→Edit→Learn loop
Tengo Gzirishvili +1: Claude Sonnet 4.6Reorders the sidebar and Start-Here router to lead with Directed Evolution, adds loop-anchoring copy to the DE/Plasmid/CRISPR/Primer view headers, and gives DE variant panels an "Open in Plasmid Editor" hand-off that sends the designed insert straight into the Plasmid Editor's import box. Also drops the topbar glow-line accent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1fdd762
-
P0 hardening: model OOM gate + cached scorer + poll give-up
Tengo Gzirishvili +1: Claude Opus 4.8Three reliability fixes from the platform audit: C1 — CPU model gate. The run settings offered ESM-2 650M/3B; the server accepted them; the free Space has no GPU, so a 3B fp32 load (~12–24 GB) OOM-killed the whole container for EVERY user — even an anonymous visitor's one free run could trigger it. Now: _validate_run_settings + _get_scorer downgrade medium/large -> small and drop any cuda/quant request on a non-GPU host; the UI disables the 650M/3B options ("Pro · GPU — coming soon"). Effective model is reflected in settings so analytics + the methods note stay truthful. C2 — Cached scorer. ESM-2 was rebuilt on every /api/run (model reload tax; concurrent runs each resident-loaded a copy → memory multiplied toward OOM). New process-global, lock-guarded _get_scorer() loads weights at most once per effective config and reuses them (warm runs now ~instant on small). M1 — Poll give-up. The frontend polled forever on transient errors. Added a consecutive-error cap (12) and an overall wal…5dde9d0
-
Plasmid: accept SnapGene .dna; fix button hover (black fill, both themes)
Tengo Gzirishvili +1: Claude Opus 4.8Two things: 1) Plasmid Editor now imports SnapGene .dna (binary) alongside GenBank/FASTA/ raw. Biopython 1.87 ships a SnapGene reader, so: - plasmid.py: _record_to_plasmid() shared mapper; parse_snapgene(bytes) + parse_binary() dispatcher (detects .dna by extension OR the 0x09+"SnapGene" signature; size-bounded; filename fallback for unnamed records). - server.py: /api/plasmid/import accepts a base64 `b64` payload (decodes, bounds, parses) in addition to the existing `text` path. - app.js: the Upload-file handler reads .dna/.snapgene/.xdna as bytes → base64 → import; text formats still load into the box. Parsed sequence is dropped into the editor so it's visible + editable. - index.html: accept=".dna,…"; label now says "SnapGene .dna". 2) White/cream buttons now invert to a near-black rectangle with white text on hover — in BOTH themes. The old hover used theme tokens that, in dark mode, flipped to off-white-on-dark (the filled CTAs visib…21dfced -
Alignment: highlight non-matching residues in red
Tengo Gzirishvili +1: Claude Opus 4.8In the pairwise alignment card, every column the server's midline doesn't mark "|" — i.e. mismatches AND gaps — now renders its residue in red (bold, faint red tint) in both strands, so divergence is scannable at a glance. Matching residues stay in the normal ink. - app.js: colorRow() wraps consecutive non-matching runs in <span.align-mm> using the authoritative per-column midline; render() uses it for both rows. - app.css: .align-mm = var(--danger) + weight + var(--danger-light) tint, with no padding/border so the monospace columns stay perfectly aligned (adapts to light/dark via the danger tokens). - index.html: bump asset cache-buster. Verified in preview: red lands on exactly the mismatch + gap columns of both strands, colour resolves to the danger token, alignment columns unshifted. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>dbb031b -
Add pairwise sequence alignment (Needleman–Wunsch / Smith–Waterman)
Tengo Gzirishvili +1: Claude Opus 4.8Closes the biggest "looks incomplete vs Benchling" gap from the competitive audit — we couldn't align two sequences at all. - dee/core/align.py: numpy global + local pairwise alignment with identity %, match midline, gaps, score; |a|×|b| size cap. +8 unit tests. - POST /api/align (stateless utility, rate-limited, no sign-in gate). - "Align two sequences" card in the Plasmid workbench: two inputs, Global/Local toggle, blocked alignment view + identity/score stats. Verified live: global 88.9% identity with correct midline, local finds the shared region (100%, 0 gaps), empty→400. Full suite 324 passing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>91ed780 -
Fix ESMFold + AlphaFold viewers: lazy, resilient Mol* loader + ESMFold retries
Tengo Gzirishvili +1: Claude Opus 4.8Root cause of "both viewers malfunction a lot": the shared 3-D library Mol* (~4.9 MB) was eager-loaded with `defer` on every page view, and both viewers waited only 8 s for window.molstar — on any slow link or CDN blip the global wasn't ready in time, so BOTH fell back to "Mol* viewer failed to load." - ensureMolstar(): lazy-load on first Fold/AlphaFold use, jsDelivr → unpkg fallback, resolves on the real load event (no fixed timeout); cached, retries on a later click if a source failed. Removes the 4.9 MB from every page load. - ESMFold fetch now auto-retries transient failures (network, 5xx, the occasional HTML-200) up to 3× with backoff; 413/429 still fail fast. - AlphaFold "loader failed" now offers Retry instead of telling the user to refresh. Added CDN preconnects. Verified end-to-end in a browser: fold → valid 51 KB PDB in ~0.8 s → Mol* rendered the canvas; Mol* no longer eager-loaded. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>64f2cf2
-
Plasmid Editor: double-stranded sequence + companion map with linked selection
Tengo Gzirishvili +1: Claude Opus 4.8Benchling-style workspace in Sequence view: - the sequence and a companion circular map now sit side by side (the editor takes full card width; Features flow below). Stacks under 880px. - complement (antisense) strand rendered under each line, 5'→3' over 3'→5'. - selecting a region in the sequence highlights both strands AND mirrors the span as a live arc on the circular map (updated during drag without a full map rebuild); clicking the map jumps the caret to that position. Refactored renderCircular into buildCircularSVG (reused by the full map and the companion), added a #pmSelArc path + updateSelArc, and a seqcSpans track for the complement. No backend change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>4b21a7f -
UI: accent → charcoal/espresso monochrome (drop the bronze)
Tengo Gzirishvili +1: Claude Opus 4.8The bronze read as gold once it was the primary button fill — replace it with a monochrome ink treatment: primary CTAs are near-black charcoal on warm paper (cream text) and flip to parchment with dark text in dark mode, both via the neutral tokens so contrast holds. Retoned --brand (links/focus/nav/caret/ selection) to a quiet graphite (light) / warm-grey (dark). Also fixed the authoritative editorial .primary block that hardcoded background:var(--brand) + white text (which would've been white-on-light in dark mode) and carried leftover blue shadows. A position-strength data ramp is now monochrome too. No blue, no yellow anywhere. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>6f3dd42 -
Plasmid Editor: Benchling-style inline sequence editing
Tengo Gzirishvili +1: Claude Opus 4.8Replace the indirect From/To + Delete/Insert flow with direct, click-and-type editing on the sequence canvas: - click to place a blinking caret between bases; drag to select a region - type A/C/G/T/N to insert at the caret (or replace the selection) - Backspace / Delete; arrow keys to move; Shift+arrows to extend selection; Home/End; Cmd/Ctrl+A select-all; Cmd/Ctrl+C copy; paste sanitised to ACGTN - live position + length; features + map remap and restriction sites rescan (debounced while typing so we don't hit the backend on every keystroke) Per-base interactive render below EDIT_CAP (20 kb); larger sequences keep the read-only run view. Also fixes a latent bug where applyEdit refreshed the small meta line but not the Length/GC chips or the methods box — now both update on every edit (affected the old Delete/Insert buttons too). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>d566e10 -
UI: replace archival-blue/teal accent with warm bronze across the engine
Tengo Gzirishvili +1: Claude Opus 4.8The single archival-blue --brand token (plus a scattering of hardcoded blue and teal hexes) drove every primary button, link, focus ring and nav highlight — and clashed with the warm-paper editorial theme. Retone the whole accent to a warm bronze/brass that matches the TuringDNA brand (espresso + brass), in both light and dark modes, including button-shadow tints. 56 CSS + 6 JS swaps, zero residual blue/teal. Bumped the asset cache-buster so returning users get it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>a52c6ca
-
feat: primer + cloning capture loops on the unified framework
Tengo Gzirishvili +1: Claude Opus 4.8Two more tools on the shared outcomes layer (moat now spans DE, CRISPR, primer, cloning): - outcomes.py: `primer` ToolSpec (Tm/GC/3'-end/length buckets → amplification success) and `cloning` ToolSpec (method/fragment-count/overlap buckets → assembly success). Both use a signed worked/partial/failed contribution (success/failure, not a continuous assay; one outcome per design). +3 tests. - UI: self-contained "Log amplification result" (Primer view) and "Log cloning result" (Plasmid view) cards → POST /api/outcomes {tool: primer|cloning}. Verified in preview: both send correct bodies (subject formats match the extractors), status renders, no console errors. Suite 281. Cache-buster -> v=20260608-loops. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>8f6819e -
feat: CRISPR learning loop on the unified framework (capture editing efficiency)
Tengo Gzirishvili +1: Claude Opus 4.8First tool added on top of the unified outcomes framework — proves the payoff (a ToolSpec + a capture box, no new infra): - outcomes.py: register a `crispr` ToolSpec — extractor turns logged editing rates into non-identifying position-nucleotide + GC-bucket features (standardized within design), pooled into a learned on-target signal. +2 tests (position-nucleotide recovery, k-anon, bad input). - CRISPR results: a "Log editing efficiency" card (#crisprOutcomeCard) listing the guides with a %-edit input; Save → POST /api/outcomes {tool:'crispr', …} via the generic capture endpoint. Client-generated design grouping id. Verified in preview: card populates from guides, save sends correct body, status renders, no console errors. iOS-safe inputs. Suite 274. Cache-buster -> v=20260608-crisprloop. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>3c2de37 -
notice: align in-app policy bar with the v2.0 user email (+ recourse, re-surface)
Tengo Gzirishvili +1: Claude Opus 4.8Add the export/delete-before-the-effective-date recourse + a contact link to the #policyNotice bar so it matches the 30-day user-notice email (Terms allow email OR in-app notice; we do both). Bump the dismiss key (td_policy_v2_ack -> td_policy_v2_ack_r2) so the updated notice re-surfaces once even to users who dismissed the earlier wording. Verified in preview: re-shows despite old ack, recourse + contact link present, dismiss persists. Cache-buster -> v=20260607-notice2. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>385e30c -
feat: multiplex check + local-specificity (genome upload) UI — primer epic complete
Tengo Gzirishvili +1: Claude Opus 4.8Two more self-contained cards in the Primer Analysis view, completing the versatility epic: - Multiplex compatibility: paste a primer set (+ optional product sizes) -> POST /api/primers/multiplex -> 3' cross-dimer pairs + amplicon size clashes, or "compatible". - Specificity vs your own genome: paste/upload a FASTA (<=12 Mb, read client- side) -> POST /api/primers/local-specificity -> predicted products + a virtual gel; runs on-server so primers never leave (unlike the NCBI scan). Verified both render paths in preview (cross-dimer + size clash; off-target products + gel bands); no console errors. Cache-buster -> v=20260607-pcr2. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>35d1c3b -
feat: de novo primer design UI + amplicon virtual gel (Primer tool)
Tengo Gzirishvili +1: Claude Opus 4.8Self-contained "Design primers from a template" card in the Primer Analysis view: template (+ optional target region + product-size window) -> POST /api/primers/design -> a Tm-matched F/R pair table + a virtual gel of the predicted product sizes (reuses the .gel-* styling). Theme-aware, iOS-safe inputs (16px / 40px). Example button loads a deterministic demo template. Verified in preview: card renders, example populates, render path produces the pair table + gel bands, 403 -> sign-in, zero console errors. Cache-buster -> v=20260607-pdesign. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>94f48ef -
feat: cite TuringDNA (turingdna.com) in every tool's methods paragraph
Tengo Gzirishvili +1: Claude Opus 4.8The methods/citation box (DE, CRISPR, Primer, Plasmid — all via tdRenderMethods) cited the underlying papers but not the platform. Append a platform citation so a researcher's Methods section credits TuringDNA: "Analyses were performed with TuringDNA (turingdna.com)." Rendered as a link; stripped to plain "turingdna.com" in the copy-paste text. One change in tdRenderMethods covers all four tools. Cache-buster -> v=20260607-cite. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>b465637 -
perf: throttle + pause the living-logo animation (laptop fans)
Tengo Gzirishvili +1: Claude Opus 4.8initPlasmidLogo ran an UNTHROTTLED infinite requestAnimationFrame doing ~264 shadow-blurred canvas strokes per frame — at 60/120Hz that pegs a CPU core and spins fans, and it never stopped (background tab, off-screen sidebar). Now: - cap to ~30fps via a time accumulator (2-4x fewer expensive frames) - pause entirely when the tab is hidden (visibilitychange) or the logo is scrolled off-screen (IntersectionObserver) - reduced-motion still draws one static frame Verified in preview: draws << raw rAF when visible; 0 draws when off-screen. Cache-buster -> v=20260607-perf. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>0c44e17 -
app: reflect data-policy v2.0 (aggregated model improvement)
Tengo Gzirishvili +1: Claude Opus 4.8Privacy/Terms v2.0 (effective 2026-07-07) narrows the no-training promise to INDIVIDUAL content only and permits aggregated, de-identified model improvement. App surfaces updated to match (individual sequences still private/never exposed): - run card sub-copy, workbench "how it works" note, footer → accurate aggregated-only framing + Privacy/Terms links - one-time dismissible material-change notice bar (#policyNotice; localStorage 'td_policy_v2_ack'), shown until acknowledged - cache-buster → v=20260607-policy No engine/algorithm changes. Legal source docs + landing HTML are uploaded to Hostinger separately. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>f94392e
-
Learning flywheel v1: Directed-Evolution active-learning loop (DBTL)
Tengo Gzirishvili +1: Claude Opus 4.8The first durable-moat feature: TuringDNA learns from a researcher's wet-lab results to design a smarter next round, on data no competitor has. Scoped to Directed Evolution (the only tool with quantitative per-variant fitness). Surrogate (dee/core/active_learning.py): additive ridge over single-site effects with the ESM-2 ΔLL as the prior — y ≈ b + w_prior·ΣΔLL + Σβ_m. Fit closed-form in numpy (no sklearn/scipy needed) on the user's measured variants; β shrinks unseen mutations to the prior; an exploration bonus rewards under-tested positions. Plugs straight into the existing additive SA: round 2 re-runs evolve() with per-mutation score = w_prior·ΔLL + β + κ·uncertainty. Numpy-tested: measured data overrides a misleading prior (Spearman 0.77), 0 labels → pure prior, <4 → honest fallback. Backend: migration 0007_de_outcomes.sql (USER RUNS IT); auth.py save/list/cleanup_de_outcomes; /api/de/outcomes (POST/GET) + /api/de/round2 (score WT → fit surrogate → evolve adjusted pool → assemble…26914b4 -
Port methods paragraph + Primer export; adversarial audit fixes
Tengo Gzirishvili +1: Claude Opus 4.8Cross-pollination (DE → other tools): - "Materials & methods (copy-paste)" paragraph + run-parameter pills now render on CRISPR, Primer Analysis and Plasmid Editor (shared tdRenderMethods() helper, reuses .run-meta CSS + wireCopyButtons). Citable, paste-ready. - Primer Analysis export: new /api/primers/export (CSV + .xlsx via openpyxl, sign-in gated, client posts the held result) + an Export menu in the results head. Primer Analysis had no export before. Adversarial audit (whole platform): - FIXED (high): stored/reflected XSS — the methods paragraphs interpolated user-controlled strings (sequence identifier, primer name, plasmid name; can arrive via a pasted FASTA header or an imported GenBank file) raw into innerHTML. Now escaped (escapeHtml/esc) in all four builders, incl. the pre-existing DE runMeta wtId. - FIXED (low): /api/preview 500 returned the raw exception string to the client (confusing + minor internal leak) → generic message; detail still logged. - Verif…7446d10
-
First-timer UX: identifier fix + goal router + contextual topbar + results key
Tengo Gzirishvili +1: Claude Opus 4.8Bug — sequence identifier showed random letters: Raw (non-FASTA) pastes/uploads fell back to the temp-file stem (tmpXXXX) as their identifier; only sequences pasted WITH a > header (e.g. GFP) worked. Added _humanize_paste_name + _clean_record_identifier (server.py) at both parse sites → raw paste = "Pasted sequence", upload = the real filename, FASTA/GenBank names untouched. UX (the three parked first-timer wins): - "Start here" goal router: dismissible modal ("What are you working on?" → 4 goals route to the right tool). Auto-shows once after the first-use disclaimer; re-openable from a new "Start here" sidebar item. - Contextual topbar: the vague "Engine" title is now the current tool name + a one-line description, updated per route in showRoute() (sub hidden on mobile). - Inline "How to read this": a collapsed-by-default plain-English score key on the Directed Evolution, CRISPR and Primer results cards (ΣΔLL fitness, CFD self-off, KO/FS/Dominance, Tm/specifici…a5e129b -
Add one-click "Try an example" to every tool
Tengo Gzirishvili +1: Claude Opus 4.8A first-time researcher's fastest path to understanding a tool is seeing it work in one click — but only Primer Analysis and Plasmid Editor had a "Load example". The two flagships (Directed Evolution, CRISPR) had none. - Shared TD_EXAMPLE_GFP_CDS constant: the verified EGFP coding sequence already in the repo (clean single ORF). GFP is the universal teaching target. - Directed Evolution: new "Try an example" button (§1 card header) → loads GFP onto the Paste tab, ready to "Use this sequence". - CRISPR: new "Try an example" button (§1 card header) → loads the GFP CDS as a knockout target, clears the resolve/gene fields, scrolls to Design. - Both populate-only (no auto-run of the slow/gated step), so they behave the same for anonymous trial users and signed-in researchers. - Plasmid + Primer: relabelled "Load example" → "Try an example" + added a tooltip describing each case. Headers wrapped in .card-header-left so the new button right-aligns cleanly (text still stacks). Ve…a9f0d6b -
Retention 90→45 days + live auto-delete countdown in the saved hub
Tengo Gzirishvili +1: Claude Opus 4.8- TTL: FREE_LIBRARY_TTL_DAYS default 90 → 45 (one constant; applies to all four per-user tables — libraries, crispr_designs, plasmids, primer_analyses — for newly saved items). Updated all "90 day(s)" copy across the engine (auth.js trial modal, docs, members-only modal, saved-hub subtitle) and the 0006 migration comment. - Saved hub: each row now shows a live "44d 23:59:58 left" countdown to auto-deletion, ticking every second while the panel is open (interval cleared on close). <24h flags urgent; null expires_at (future pro plans) shows "kept". All four list endpoints already return expires_at. Mobile: the countdown + download wrap below the label, no overflow. Verified live in preview: countdown decrements, urgent state, "kept" state, timer stops on close, zero console errors. Bump cache-busters to v=20260605-ttl. (Landing privacy page retention 90→45 edited too — manual Hostinger upload.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>94b29e6 -
Unified "My designs" hub: save every tool, not just CRISPR
Tengo Gzirishvili +1: Claude Opus 4.8"My designs" was CRISPR-only; plasmids lived in a separate list and primer/ evolution results couldn't be saved. Now it's one hub with a section per tool. Backend: - migration 0006_primer_analyses.sql (user runs it) — per-user table mirroring crispr_designs (owner-only RLS, 90-day expires_at). - auth.py: save/list/get/delete_primer_analysis (+ lazy cleanup); list_libraries and library_csv_url (signed, owner-checked) reusing the existing public.libraries + Storage bucket from DE auto-save. - server.py: /api/primers/{save,analyses,analyses/<id> GET+DELETE} and per-user /api/library + /api/library/<id>/download — all sign-in gated + owner-guarded. Frontend: - New #savedModal unified hub (Plasmids · CRISPR · Primer sets · Evolution libraries); each tool registers a reopen fn on window.TDSaved. navMyDesigns, the CRISPR "My designs" button, and the Plasmid "My plasmids" button all open it. - Primer Analysis gains a Save button; evolution libraries list with Download CSV (sign…1ee54b6 -
Workbench hub + full-capability docs + fix stuck toolbar dropdowns
Tengo Gzirishvili +1: Claude Opus 4.8Plasmid Editor becomes the central workbench (per user direction): - Default + first nav item ('plasmid' leads ROUTES; no-hash fallback). - Hub-and-spoke hand-offs: new sendToEvolve() sends a construct/region to Directed Evolution (the missing third leg); "Use in ▾" now lists CRISPR, Primer Analysis AND Directed Evolution; new region "→ Evolve" button. - Editorial "one workbench" home strip in the empty state (type-led, not a SaaS card grid); hidden once a construct loads; reflows 1-col ≤540px. Docs: rewritten from DE-only into a four-tool reference (Plasmid Editor, CRISPR, Primer Analysis, Directed Evolution) with method + citations + honest limits each; broadened local-vs-network + citations. Fix stuck toolbar dropdowns (real root cause): .plasmid-export-menu set display:flex unconditionally, which beats the UA [hidden]{display:none} rule (author > UA) — so menu.hidden=true could never hide them and BOTH the "Use in" and "GenBank" menus sat open + overlapping the moment a con…29f4874 -
Rename vague nav tabs to descriptive tool names
Tengo Gzirishvili +1: Claude Opus 4.8The sidebar tabs read "Design / CRISPR / Primers / Plasmid" — too vague to tell users what each tool does. Renamed (hash routes unchanged, so no routing impact): Design → Directed Evolution (ESM-2 variant-library generator; avoided "Protein Design" since the docs state it is NOT de novo design) Primers → Primer Analysis (it ranks the user's candidate primers, not de novo design) Plasmid → Plasmid Editor CRISPR → unchanged (already recognizable) Aligned the hero titles + members-only modal + plasmid→primer handoff labels/toasts so the page no longer says "Primer Picker" / "Plasmid Studio" while the tab says the new name. Bumped app.js cache-buster to v=20260604-names. Verified in a real browser: labels render, no sidebar overflow at 232px, hash routing + active-state still correct, zero console errors. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com…93b09d3 -
Fix reported production bugs: stuck dropdowns, blocked SNP, session loop
Tengo Gzirishvili +1: Claude Opus 4.8From a user bug report (4 issues): (4) Stuck/overlapping toolbar dropdowns — opening "GenBank ▾" then "Use in ▾" left BOTH open and overlapping: each button's stopPropagation blocked the other menu's outside-click close. Now opening one closes the other (operate on all .plasmid-export-menu); outside-click closes all. Verified. (2) "Couldn't do a single-nucleotide mutation" on the DE engine — a SNP that creates a stop codon was hard-blocked at BOTH layers (client save disabled; server 400) with a FALSE "synthesis vendors will reject this" claim. A premature stop is a legitimate nonsense/truncation mutation; vendors synthesize it fine. Now allowed: server truncates the product at the first stop (no raise); client downgrades the warning high→medium so Save works. Frame-break (non-×3) and non-ACGT still correctly block. +4 tests. (1) "Session out of sync" that reload/re-signin won't clear — confirmed a stale-token loop (works in a fresh/incognito …e52101b
-
Adversarial audit of Plasmid Studio: fix XSS, DoS, and input-validation gaps
Tengo Gzirishvili +1: Claude Opus 4.8Findings + fixes from a full security/robustness pass over M1–M5: 1) Stored XSS (HIGH) — a feature `color` was injected unescaped into an inline `style="--featc:…"` (sequence view), so a saved plasmid whose feature colour broke out of the attribute (`red" onmouseover=…`) ran script on reopen. Fix: client only emits a validated hex colour into any SVG/style attr (pmColor gate); server sanitize_features() forces every stored/exported colour to a safe hex. Verified live: a malicious saved plasmid renders inert (handler never fires) on map, swatch, and sequence views. 2) DoS — find_orfs was O(n²): a long, ATG-rich, stop-less paste pinned the worker. Rewrote to a single linear pass per frame + an ORF cap. (120 kb stop-less input now returns in <2 s vs many seconds.) 3) DoS / crash — unbounded inputs: - parse_plasmid now rejects import text > 2 MB before parsing; GenBank feature parse capped at 5,000. - sanitize_features() clamps coords to [0,len], drops…d67ba8e -
Plasmid Studio M5: hand a construct (or region) to CRISPR + Primer Picker
Tengo Gzirishvili +1: Claude Opus 4.8The integration that makes the suite more than separate tools — from a loaded or assembled plasmid you can jump straight into guide design or primer checking with the sequence already in place. - Toolbar "Use in ▾" (whole plasmid): "CRISPR guides" prefills #crisprInput + routes to #crispr; "Primer Picker (template)" prefills #primerTemplate + routes to #primers. - Sequence editor "→ CRISPR" / "→ Primers": same hand-off but for the CURRENT selection (From/To, Find, or click-a-feature) — design guides for just the inserted gene, or check primers that flank a feature. - Drives the other controllers through their public inputs (set value + fire 'input' so the CRISPR base-ruler/stats react), then routes via the hash; a toast confirms what was loaded. CRISPR ≥23 bp guard. Frontend-only; 201 pytest still pass. Verified live: whole-plasmid → CRISPR (1,201 bp, base-ruler rewrap, content correct) + Primer template (1,201 bp); region 100–159 → both tools receive exactly 60 bp; navig…8803cb4 -
Plasmid Studio M3 + M4: sequence editor + cloning simulation
Tengo Gzirishvili +1: Claude Opus 4.8M3 — Sequence editor (new "Sequence" view tab): - Feature-colored sequence with position ruler; runs grouped by feature so even big plasmids render cheaply (capped at 60 kb). - Find (forward + reverse-complement) with match count + next/prev, highlights + jumps; selection via From/To coords or clicking a feature. - Operations on the selection: Copy, Copy rev-comp, Translate (client genetic code), Annotate (add a feature), Delete, Insert at position, Reverse- complement the whole plasmid. Edits rewrite the sequence, REMAP feature coordinates (delete/insert shift, revcomp flips), and re-scan restriction. M4 — Cloning simulation (dee/core/cloning.py + /api/plasmid/clone + "Clone & assemble" panel): - Gibson / overlap assembly: auto-orders fragments by terminal overlap; native overlaps assemble scarlessly, bare junctions get homology arms DESIGNED into per-fragment primers (annealing core via the codon engine + the neighbour's tail). Circular or linear. - Golden Gate (Type…ec0167c -
Plasmid Studio (M1+M2): import/annotate/map + restriction/digest + library
Tengo Gzirishvili +1: Claude Opus 4.8New "Plasmid" tool — a Benchling/SnapGene-style plasmid design studio, built on primitives we already had (Biopython GenBank I/O + 1,088 REBASE enzymes, ORF detection, Supabase per-user save). Sign-in gated like CRISPR / the Primer Picker; per-user library from day one. Core (dee/core/plasmid.py, fully unit-tested): - parse_plasmid: GenBank / FASTA / raw DNA → one normalized model {name, sequence, topology, gc, length, features[]}. - auto_annotate: ORF detection + curated motif library (T7/T3/SP6/M13/lac/His) when a record has no features; GenBank features kept as-is. - build_genbank / build_fasta export. - restriction_analysis: per-enzyme cut sites over the common set (or any), circular-aware, classified single/double/multi/non-cutters. - digest: combined cut positions → fragment sizes (circular wraps the origin). API (server.py, sign-in gated): /api/plasmid/import, /restriction, /digest, /export, plus the library: /save, /library (list), /library/<id> (get/delete). auth.py: s…be23b1b -
Primer Picker: add strict 3'-end matching knob for the specificity scan
Tengo Gzirishvili +1: Claude Opus 4.8Off-target predictions are *priming sites*, not guaranteed amplicons — and whether a polymerase extends is governed by the 3' terminus. This adds an opt-in stringency control: when on, an off-target priming site only counts if its 3'-terminal 5 bases match the subject perfectly (no mismatch, no gap), trimming borderline sites that share a body but mismatch at the 3' end. - server.py: _three_prime_clean() inspects the tail of the BLAST alignment strings (match/query/sbjct); _hsp_to_event(strict_3p) rejects a hit whose 3' end isn't clean. PrimerJob.three_prime_strict; /api/primers/analyze accepts `strict_3p` (folded into the cache key). Degrades to lenient if the alignment strings aren't present. - Frontend: "Strict 3'-end matching" sub-toggle under the organism selector (shown with the scan), sent as strict_3p. Default off = catch borderline sites too (safer for screening); on = fewer, higher-confidence predictions. Tests: _three_prime_clean (perfect / 3'-mismatch / within…438edb5 -
Primer Picker: separate intended product from off-targets; collapse redundant hits
Tengo Gzirishvili +1: Claude Opus 4.8Live test surfaced a real problem: running the GAPDH/ACTB primers against Human reported "60 unintended products" and branded a perfectly specific pair with "38 off-target products." Those weren't off-targets at all — `nt` holds dozens of redundant GAPDH records, so the ONE intended 197 bp amplicon was counted once per database entry. That's the opposite of helpful. Fix (rank()): - Collapse in-silico PCR hits that are the same primer pair at the same size (±5 bp) into ONE distinct amplicon, with a "seen in N records" count. - Classify distinct amplicons: a detected F/R pair's amplicon at its expected size (on-template size when given, else the pair's dominant size) is the INTENDED product; the same pair at a different size (e.g. a pseudogene) or any cross-/unpaired combo is a genuine off-target. - Per-primer off-target count now counts only true off-target distinct amplicons, so fitness + chips stop punishing specific primers. Frontend: results now show an "Intended product…7df48f4 -
Primer Picker: full in-silico PCR specificity — no more "go to NCBI Primer-BLAST"
Tengo Gzirishvili +1: Claude Opus 4.8The footer used to send users to NCBI Primer-BLAST to finish the job, which defeats the point of an in-house tool. The reason was v1 only counted per-primer matches, not the paired off-target AMPLICONS that Primer-BLAST uniquely finds. Now we do that check ourselves so the workflow is complete here and the user never leaves. - core/primers.py: insilico_pcr() pairs every forward-oriented priming site with every downstream reverse-oriented site on the same subject within MAX_PRODUCT (4 kb) → predicted PCR products, exactly like Primer-BLAST's specificity step. rank() now folds off-target *product* counts (not raw match counts) into fitness + reasoning and surfaces the product list. - server.py: _hsp_to_event() converts a BLAST HSP to a 3'-anchored priming event (strand from sbjct_start/end; rejects 5'-only / low-identity hits); _run_primer_blast() builds events across ALL primers, runs in-silico PCR, and attributes products per primer. Adds organism targeting (entrez_query…eeea851 -
Gate the Primer Picker behind sign-in (mirror CRISPR)
Tengo Gzirishvili +1: Claude Opus 4.8The /api/primers/analyze endpoint was already sign-in gated server-side (403 signin_required for anonymous). This adds the matching front-end gate so the tool is consistently members-only: - Extend the proactive tab-click hook to a[href="#primers"] (alongside #crispr): an anonymous user clicking the Primers tab gets the dismissible sign-in modal, same as CRISPR. - analyze() already dispatches td:signin-required on the backend 403; now it also surfaces a one-line banner so a user who dismisses the modal still sees why nothing ran. - Generalise the shared #crisprSigninModal copy to cover both tools ("These tools are members-only" · names the CRISPR designer + Primer Picker), keeping the 90-day-save promise scoped to CRISPR only (honest — primers aren't persisted). Verified in-app: anonymous → clicking the Primers nav opens the modal; the td:signin-required (403) path opens it too; signed-in users analyse normally. Cache-buster → v=20260603-primersgate. Co-Authored-By: Cl…73c780f
-
Add Primer Picker: batch-analyse primers, rank, recommend the best
Tengo Gzirishvili +1: Claude Opus 4.8New feature requested by the user: instead of BLASTing candidate primers one at a time and eyeballing which best amplifies their template, paste them all, analyse in one shot, and get a ranked recommendation. What it does: * Parse a batch (FASTA or one-per-line) with optional names + F/R tags; forward/reverse pairs are auto-detected by name stem. * Score each primer ON the user's template (private, on-server): 3'-anchored binding site(s), uniqueness, Tm (NN), GC, 3' G/C clamp, hairpin, 3' self-dimer. * For F/R pairs: amplicon size, Tm match, 3' cross-dimer. * Opt-in NCBI specificity scan — ALL primers in ONE blastn-short submission ("blast them all together"); NCBIXML yields one record per primer, mapped back by query order; counts strong full-length off-target matches. * Transparent fitness rubric in [0,1] (Tm/GC/clamp/dimer/uniqueness/ specificity) ranks them and recommends the best primer + best pair, with the reasoning shown — not a black box.…f0c3f5a -
Fix: Identify/AlphaFold dead-ends on heavily-sequenced proteins (e.g. Cas9)
Tengo Gzirishvili +1: Claude Opus 4.8Reported: opening the closest-structure view on a Cas9 variant said "NO ALPHAFOLD MODEL AVAILABLE" even though SpCas9 obviously has one (UniProt Q99ZW2). Root cause: the Identify BLAST hits `nr`, which is excellent for identification but crowded with redundant GenBank/TPA records — Cas9's top hits are all `tpg|HER…` third-party annotations with NO UniProt accession, so the curated entry is buried and _extract_uniprot finds nothing → no AlphaFold model resolved. Fix: when no parsed `nr` hit carries a UniProt accession, fall back to a homology search against the small curated `swissprot` database. Every UniProtKB/Swiss-Prot entry has an AlphaFold-DB model, so this reliably surfaces the closest KNOWN structure (Cas9 → Q99ZW2). The resolved accession is pinned onto the top hit, with its organism + identity kept separate so the UI labels it honestly as the closest reviewed homolog rather than the exact query. - server.py: _swissprot_uniprot() + _attach_structure_homolog(); called at the…a635fbe -
DE engine: add AlphaFold next to ESMFold for large proteins
Tengo Gzirishvili +1: Claude Opus 4.8ESMFold folds the exact variant but its free public endpoint caps at ~400 aa, so for larger proteins the Fold button was a dead end (disabled with a "use BLAST → AlphaFold" tooltip and no way to act on it). Add a second per-variant structure button — "AlphaFold" — beside the ESMFold one. AlphaFold-DB can't fold a novel sequence (it only serves precomputed models keyed by UniProt), so this honestly shows the CLOSEST KNOWN structure: it BLASTs the wild-type (reusing /api/identify, cached by sequence hash) to find the nearest UniProt match and renders its AlphaFold-DB model. No length cap, so it's the structure path for proteins too large for ESMFold. - Row actions: ESMFold + AlphaFold buttons; for >400 aa the ESMFold button stays disabled and the AlphaFold one gets a brand-tinted "suggested" accent so the eye lands on the working path. Tooltips on both explain exact-variant (ESMFold) vs closest-known (AlphaFold). - openAlphaFoldModal(): reuses the shared #foldModal, adds an in-mo…4af235d -
IP Radar: make it runnable per-guide, not just guide #1
Tengo Gzirishvili +1: Claude Opus 4.8The radar previously only ever checked the top-ranked guide (a single button + banner above the table calling _radarTopGuide()). Users had no way to scan any of the other generated variations for prior art. - Extract the inline handler into _runRadarFor(guide, triggerBtn, bannerEl) so any guide can be scanned, rendering into any target banner. - Generalize _renderRadar(data, top, bannerEl) to write into a passed banner. - Add a per-guide "⌖ IP radar · check guide #N" button inside each guide's "why" panel (next to the 3-D structure action), with its own inline result banner so the finding stays beside the guide it checked. - Wire those buttons in the tbody render block; they look the guide up by rank in lastGuides and call _runRadarFor with the guide's own spacer. - The top button now delegates to _runRadarFor(_radarTopGuide(), ...) — behaviour unchanged. - CSS: .crispr-why-actions flex-wraps multiple actions; .ip-radar-inline spacing. Cache-buster bumped to v=20260602-rad…b54cfd9 -
Oracle: gate ALL synthesis vendors + the directed-evolution export
Tengo Gzirishvili +1: Claude Opus 4.8Closes the two coverage gaps: - Vendor order gate was Twist-only; now every vendor (Twist/IDT/Synthego/…) routes through the Red Team check before ordering. Synthesis rules are vendor-agnostic. - Wired the Oracle into the directed-evolution variant-library export (wireDownloadMenu / /api/download). Runs the synthesis checks on the full evolved constructs (tableState.variants[].Optimized_DNA_Seq) for every format. No essential-gene check there (evolution isn't a knockout). Bypassable like the CRISPR gate. Verified live: DE CSV export -> red report (GC/homopolymer/hairpin) labelled 'Before exporting your variant library'. Cache-buster -> v=20260602-oracle2. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>5025379 -
IP Radar patents (env-gated) + Toxicity & Synthesis Oracle (Red Team)
Tengo Gzirishvili +1: Claude Opus 4.8PART A — free patent layer for the IP Radar (env-gated): - core/ip_radar.check_patents(): recent patents mentioning the target gene + editing terms via the FREE PatentsView Search API. Needs a free, registered PATENTSVIEW_API_KEY env var; without it the radar stays literature-only (graceful). Cached. GENE-LEVEL 'related patents in this space' — NOT a precise sequence-to-claim match (that needs Lens PatSeq, paid), framed accordingly. Merged into /api/crispr/ip_radar; banner shows a 'Related patents' subsection. Mocked tests (no-key + parse). NOTE: Lens.org is NOT free for commercial use (14-day trial only); the free route is PatentsView (metadata) + optional NCBI patent BLAST later. PART B — Toxicity & Synthesis Oracle (pre-export Red Team gate): Pure client-side, ZERO new deps (the engine is vanilla JS + Flask, not React/pnpm — so no installs; minimal bundle). - Synthesis (Twist-style): global+local GC (<20% / >65%), homopolymer (>6), lightweigh…13a90b2 -
Live Collision IP Radar v1 — opt-in literature scan (Europe PMC)
Tengo Gzirishvili +1: Claude Opus 4.8Warns when a generated guide overlaps existing work. v1 = literature only (preprints + papers via free Europe PMC); patents deferred to v2 (needs a Lens.org token). Per the agreed posture: OPT-IN, METADATA-FIRST — only the gene + validated point-mutation set + 20-mer guide leave the Space; never the full novel sequence (the endpoint refuses arbitrary strings in 'mutations'). Matching is on SPECIFIC identifiers, not noise: exact guide spacer (full-text phrase) or gene + mutation set. A novel guide returns 0 hits; a published one returns the papers that printed it (verified: EMX1 guide -> real matches). - core/ip_radar.py: Europe PMC client, query builder, recency classify, result shaping (authors/date/source/link), 24h thread-safe TTL cache that also caches empty results -> 50 users checking the same guide ping PMC once (the rate-limit requirement). Pure stdlib. - POST /api/crispr/ip_radar: sign-in gated; validates spacer (ACGT) + HGVS-ish mutations; non-critical (…61e171c -
Mobile CRISPR cards: compact-by-default + clean edges
Tengo Gzirishvili +1: Claude Opus 4.8Two issues from the iPhone screenshot: - 'Edges' / doubled line under the rank header: the header had a 2px border-bottom AND the first field a 1px border-top, reading as a messy double rule. Removed the header border; the first field's single hairline now divides it — consistent 1px hairlines throughout, no doubling. - 'Endless / so big': each of 50 guides rendered ~13 tall rows. Cards are now COLLAPSED by default to the primary fields (rank, position, spacer + copy, composite, on-target, KO/editability) — ~287px vs ~600px. A faint 'DETAILS' hint + the rank '›' expands the card to the full field list + the 'why' panel (existing toggle, now also flips .crispr-row--open). Three cards now fit where one did. Desktop table unchanged. Cache-buster -> v=20260602-compactcards. Verified at 375px: collapsed shows 5 fields, tap expands to 16 + why; no page overflow. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1b8382f -
Paste editor: cap height + fit bases/line to the box (not a fixed 10)
Tengo Gzirishvili +1: Claude Opus 4.8A 10-base/line wrap turned a 1,128-nt gene into 113 lines, and the editor had no height cap — the tall line-numbered gutter stretched the whole .paste-shell down the page and shoved the form ~2,700px below the fold. Two fixes (both editors — directed-evolution #pasteArea and CRISPR #crisprInput, shared code): - Cap .paste-shell at max-height:340px (it already had overflow:hidden + synced gutter/textarea scroll) and disable textarea resize. A long sequence now scrolls INSIDE a compact box; the form stays right below it. - _fitBasesPerLine(): wrap to a whole number of 10-base blocks that fit the box's measured width, clamped [10,60]. Desktop ~50–60/line (1,128 nt → 19 lines), phone ~20/line (no horizontal scroll). Gutter still numbers by base position; the step just follows the line width (1·61·121 desktop, 1·21·41 mobile). Debounced resize re-fits on width change. Cache-buster -> v=20260602-fit. 112 tests pass. Verified at 1280px (60/line, capped 340px box)…68f3abb
-
Fix CRISPR form horizontal overflow + base-ruler paste gutters
Tengo Gzirishvili +1: Claude Opus 4.81) Off-target genome <select> caused horizontal scroll on mobile: its long option labels ('Homo sapiens (GRCh38) · coding regions · first run…') forced the grid track wider than the viewport. Root cause was grid 'grid-template-columns: 1fr' (the 1fr track has an implicit min-content floor). Switched to minmax(0, 1fr), added min-width:0 on the field, and width/max-width:100% + text-overflow:ellipsis on the select so it clips instead of stretching the page. Page stays locked to viewport width. 2) Paste editors (directed-evolution #pasteArea AND CRISPR #crisprInput) now wrap to 10 bases/line and number the gutter by base POSITION (1, 11, 21…) instead of meaningless line indices — a real nucleotide ruler. Shared reflowSeqEditor(): wraps on input (incl. paste), preserves the caret by base offset, keeps FASTA headers verbatim (no number, resets the counter), and falls back to a 60-wide wrap above 30k chars so a huge paste can't spawn 100k gutter nodes. Re…224927d -
Mobile cards for CRISPR results + dark Mol* structure viewers
Tengo Gzirishvili +1: Claude Opus 4.8CRISPR results table → cards on mobile (<=540px): - Each guide row re-flows into a card of LABEL : value pairs (label via data-label + ::before). Rank cell becomes a card-header bar; spacer + oligos stack with their Copy buttons; vendor order buttons inline. - Empty (em-dash) cells are tagged in JS and hidden on mobile so a card isn't a wall of blank genome/exon/cloning fields. - 'Why this guide' expander still works inline. Desktop table untouched (all rules scoped to the 540px breakpoint). ESMFold + AlphaFold + CRISPR structure viewers — dark, site-matched: - Root cause of the white viewer box: Mol* paints the WebGL canvas on its OWN clear color (CSS can't touch it) and Viewer.create ignores an {r,g,b} backgroundColor. Set it via canvas3d.setProps({renderer:{ backgroundColor: 0x0E141B}}) (Color is a plain int at runtime) — shared _afApplyBg() called from all three mounts. - Dark-themed Mol*'s own floating controls (its default cream 'sem…4615fe6 -
Harden AlphaFold viewer + add CSV export to CRISPR download
Tengo Gzirishvili +1: Claude Opus 4.8AlphaFold (today's 'malfunction' = transient EBI/AlphaFold-DB outage; all deps healthy, nothing regressed in our code). The viewer was fragile to it: a single-shot load + hardcoded model_v6 + a misleading 'model doesn't exist' error with no recovery. Now: - _afFetch: abort-timeout + one retry on network/5xx/429 - _afResolve: ask the prediction API for the CURRENT model URL, then build a fallback ladder (alt .cif format + version walk v6/v5/v4); report whether the entry actually exists - _afTryLoad: walk candidates until a structure really enters the hierarchy - _afShowError: honest copy — 'AlphaFold-DB temporarily unreachable' + a Retry button for transient failures; 'no model for this entry' only when the API confirms absence Applied to both mountAlphaFoldViewer (DE) and _mountCrisprStructure (CRISPR). CSV export: /api/crispr/download was XLSX-only (hardcoded) while the UI still said 'CSV' — users had no real CSV. Added a format param (csv|xlsx); CSV via std…0360d9f
-
Living logo: choreograph the plasmid⇄helix morph (calmer, not chaotic)
Tengo Gzirishvili +1: Claude Sonnet 4.6The simultaneous stretch+twist made the mid-morph self-cross into a tangle. Now it's staged — only one transformation at a time: hold ring → STRETCH round→tall (no winding) → TWIST that loop into the double helix → hold → untwist → unstretch. Still one closed loop, no free ends. Slowed to an 11s cycle. Cache-buster → v=20260530-logo3. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>bb6a5eb -
Living logo: closed plasmid ⇄ double-helix metamorphosis (engine sidebar)
Tengo Gzirishvili +1: Claude Sonnet 4.6Replaces the static favicon mark with an animated Canvas plasmid. It morphs between a closed supercoiled ring (plasmid) and a 3-D double helix — but as ONE continuous closed loop: the strands wind an integer number of turns, so the helix has no free ends (it just twists tighter / relaxes, like real circular DNA supercoiling). Centreline is a closed ellipse that breathes round ↔ tall-and-narrow. Theme-aware (re-reads --accent), pauses in background tabs, honours prefers-reduced-motion. Cache-buster → v=20260530-logo2. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>a432a49
-
Fix AlphaFold viewer showing nothing (stale model version + silent 404)
Tengo Gzirishvili +1: Claude Sonnet 4.6Root cause: AlphaFold-DB bumped its model version DB-wide (v4 → v6), so the hardcoded …AF-{acc}-F1-model_v4.pdb URLs now 404. And Mol*'s loadStructureFromUrl does NOT throw on a 404 — it loads the XML error body, ends up with zero structures, removes our loading overlay, and silently leaves an empty viewer. Net effect: "won't show predicted models." Verified empirically: v4 → HTTP 404; AlphaFold's prediction API (/api/prediction/{acc}, CORS-enabled) reports latestVersion 6; loading the v6 .pdb yields 1 structure in the Mol* hierarchy. Fix (both the directed-evolution embed and the CRISPR M5 cut-site viewer): - _afResolveModelUrl(): pull the accession out of whatever URL we were given and resolve the CURRENT file URL from the AlphaFold API (falls back to the given URL on any error). Future-proof against the next version bump. - _afHasStructure(): after loadStructureFromUrl, assert a structure actually landed in the hierarchy; if not, throw so the catch surfaces a real message …20cdca4