Spaces:
Sleeping
Sleeping
Commit History
-
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 -
Plasmid: richer common-features auto-annotation (SnapGene-style)
Tengo Gzirishvili +1: Claude Opus 4.8Expand the _MOTIFS library from 8 → ~22 curated, highly-specific signatures so pasted/raw plasmids auto-annotate like Benchling/SnapGene: sequencing-primer sites (CMV-fwd, BGH-rev, M13), epitope/purification tags (His ×2 codon variants, FLAG ×2, HA, Myc, Strep-II, V5, T7), recombination sites (loxP, FRT, attB1/B2), plus the existing promoters/terminator/lac operator. All matched on both strands by find_motifs (exact, ≥18 bp → no false positives). GenBank imports keep their own curated features; this enriches the bare FASTA/raw case. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1755b9c
-
Security hardening: RLS-as-user, rate limiting, headers, PII + endpoint cleanup
Tengo Gzirishvili +1: Claude Opus 4.8Defense-in-depth pass so a single mistake or leak can't expose user data: - RLS enforcement: per-user reads/writes now run AS THE USER (anon apikey + the requester's verified JWT) so Postgres RLS enforces row isolation — a forgotten user_id=eq. filter can no longer leak another user's rows. New _user_pgrst_headers() with graceful fallback to the service key when SUPABASE_ANON_KEY is unset (reversible rollout). Background workers and the genuine cross-user aggregates keep the service key. - user_id chokepoint: reject any JWT whose `sub` isn't a UUID (closes PostgREST filter-injection via a crafted sub at the single entry point). - Rate limiting: in-process per-(client,rule) sliding window on /api/* with 429 + Retry-After; bounded memory, fail-open, env escape hatch. - Security headers: X-Content-Type-Options, Referrer-Policy, Permissions-Policy, HSTS, and CSP frame-ancestors allowlisting turingdna.com (iframe-safe). - PII minimization: store only a /24-anonymized IP + s…702b153
-
feat: richer DE aggregate — substitution × ESM ΔLL bin (opt-in, gated)
Tengo Gzirishvili +1: Claude Opus 4.8aggregate.py: keys can carry an ESM-confidence bin → (wt, mut, bin); bin_ll() buckets the wild-type-marginal ΔLL (lo/mid/hi). build_priors gains an optional ll_maps arg (per-library {label: ΔLL}); apply_global_prior is bin-aware, matching each pool mutation's OWN ΔLL bin (free at blend time) and falling back to the unbinned key. Fully backward compatible — no ll_maps ⇒ plain (wt,mut) keys, so existing behavior + tests are unchanged. +4 tests (binning, split-by-ll, blend, serialize). server.py: DE rebuild accepts an opt-in `esm_bins` flag that recomputes ΔLL per library (WT from libraries.wt_protein) — guarded, never runs pre-gate, degrades to unbinned on any ESM failure. auth.py: lib-aware grouping + get_library_wt. Suite 285. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>21b1923 -
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: wire the CRISPR on-target prior into scoring (data-out, guarded)
Tengo Gzirishvili +1: Claude Opus 4.8Completes the CRISPR loop's consumption side. outcomes.py: shared crispr_features (used by both extractor + scorer so keys match), crispr_feature_delta (bounded to ±0.15 of the [0,1] score), and a pure calibrate_crispr_guides (folds the prior in, re-sorts, re-ranks). server.py: cached _load_tool_prior(tool); the /api/crispr/design endpoint now calibrates guides before returning ("calibrated" flag). Strict no-op until public.outcome_priors has a 'crispr' aggregate (post effective date) — verified inert: design returns unchanged scores + calibrated:false. +4 tests; suite 278. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>05da2fa -
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 -
feat: unified outcomes framework — tool-agnostic capture + aggregate + calibrate
Tengo Gzirishvili +1: Claude Opus 4.8The platform-wide version of the DE flywheel so the moat isn't DE-only. One tool-tagged layer any tool plugs into via a ToolSpec; privacy/gating identical for all. - dee/core/outcomes.py: generic engine (ToolSpec registry, within-design standardize, k-anonymity, EFFECTIVE_DATE gate, Prior with blend/serialize). DE registered as first consumer, delegating to the proven aggregate.py — verified DE-through-framework == aggregate.py exactly. - migration 0009_outcomes.sql: generic public.outcomes (tool-tagged, owner RLS, TTL) + public.outcome_priors (tool, feature_key; service-role; CHECK n_users>=3). Leaves the live DE tables (de_outcomes/mutation_priors) untouched. - auth.py: save/list_outcomes, list_all_outcomes_grouped(tool), get/replace_outcome_priors(tool). - server.py: POST /api/outcomes, GET /api/outcomes/<tool>/<design_id>, admin GET /api/admin/priors/<tool> + POST /api/admin/rebuild-priors/<tool> (date-gated). 8 new tests (genericity via synthetic spec, k-anon, gate, …674bee6 -
feat: primer/PCR versatility — design, multiplex, local specificity (backend)
Tengo Gzirishvili +1: Claude Opus 4.8Three offline (no-NCBI) additions to dee/core/primers.py + endpoints: - design_primers(): de novo F/R pair design from a template (+ optional target region). Enumerates candidates per flank, scores Tm/GC/clamp/hairpin/dimer, pairs by product size + Tm match + cross-dimer. POST /api/primers/design. - multiplex_check(): pairwise 3' cross-dimers + amplicon size clashes for a primer set. POST /api/primers/multiplex. - local_specificity(): in-silico PCR against a user-uploaded genome/FASTA — runs on our server so primers never leave (unlike the NCBI scan). find_sites gained a max_template override so it scans whole chromosomes. POST /api/primers/local-specificity (<=12 Mb). All sign-in gated; offline so no consent step. 12 new tests (structural correctness, k of geometry, dimer/size detection, off-target copies). Verified via test-client (anon->403; design/multiplex/local-spec happy paths). Suite 264. Frontend UI + virtual gel land next. Co-Authored-By: Claud…867ce54 -
feat: cross-user aggregate prior (the data moat) — built, run gated to 2026-07-07
Tengo Gzirishvili +1: Claude Opus 4.8Pools wet-lab outcomes ACROSS users into a de-identified substitution-effect prior that nudges round-1 designs. Aggregated-only per the v2.0 policy; nothing attributable to a person. - dee/core/aggregate.py: pool by amino-acid substitution TYPE (positions are protein-specific, so only type generalizes); standardize within each library before pooling (no assay scale/raw value survives); k-anonymity floor of >=3 DISTINCT users; execution gated to EFFECTIVE_DATE (2026-07-07). Folds in via apply_global_prior (additive, same as the per-user surrogate). numpy-only. - migration 0008_mutation_priors.sql: server-only table (RLS, no policies), CHECK(n_users>=3) k-anon guard at the DB layer too. (USER must run it.) - auth.py: list_all_de_outcomes_grouped (the only cross-user read; service-role, pulls just mutations+value), get/replace_mutation_priors. - server.py: admin-token-gated GET /api/admin/mutation-priors + POST /api/admin/rebuild-priors (date-gated → 423 before effective da…3317015
-
test: cover DE active-learning surrogate (Design→Build→Test→Learn)
Tengo Gzirishvili +1: Claude Opus 4.8Adds tests/test_active_learning.py (16 cases) for dee/core/active_learning.py, the round-2 learning core that previously had no committed test: - label parsing (1→0 indexing) + malformed rejection - honest fallback below the measurement floor / with no value spread / empty - headline property: a deliberately anti-correlated ESM-2 prior is overridden by bench measurements (Spearman recovery >0.6, large lift over the prior) - adjust_pool swaps delta_ll into the SA Mutation pool without touching position/wt_aa/mut_aa (frozen dataclass intact) - unmeasured mutations fall back toward the prior, not invented Pure numpy — no torch/ESM needed. Full suite now 241 passing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>2d37996
-
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 -
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 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
-
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 -
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
-
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
-
CRISPR M5: structure viewer — cut site on the AlphaFold model
Tengo Gzirishvili +1: Claude Opus 4.8Reuses the Mol* 5.9.0 viewer already loaded for the directed-evolution page to show a guide's cut site on the gene's predicted 3-D structure. Backend: - Guide.cut_residue: maps each Cas9 cut → 1-based protein residue when a reading frame is resolvable (gene+organism aligned to CDS, or the input is itself a coding sequence). Exposed in /api/crispr/design. - resolve.resolve_uniprot(): gene symbol + organism → reviewed UniProt accession via the UniProt REST API → AlphaFold-DB model URL. Only the (gene, organism) leaves the Space. - GET-style POST /api/crispr/structure (sign-in gated) returns the UniProt accession + AlphaFold URLs. Frontend: - A "View 3-D structure · cut at residue N" button inside the M3 "why this guide" panel (shown only when a human/mouse gene context + a resolved residue exist — no new table column). - Structure modal mounts AlphaFold-DB via the proven mountAlphaFold path; header reads "GENE · UniProt XXXXX · cut at residue N…73b3e85 -
CRISPR M2: paste-anything input + fix phantom progress bar
Tengo Gzirishvili +1: Claude Opus 4.8Resolver (dee/core/resolve.py, new): one input box auto-detects and resolves a gene symbol, an accession (ENST…/ENSG…/NM_…/XM_…), or raw DNA into an editable sequence + a human label. - gene symbol → Ensembl canonical-transcript CDS (reuses exon.fetch_gene_structure; human/mouse). - Ensembl ID → /sequence/id?type=cds (gene IDs resolve to canonical tx). - RefSeq → NCBI efetch FASTA. - raw / FASTA → used as-is, makes NO network call (privacy: a pasted sequence never leaves the Space; only the identifier is sent). Conservative classifier: a long DNA-dominant blob is always a sequence. Endpoint POST /api/crispr/resolve (sign-in gated, same as design), returns {ok, kind, sequence, gene_symbol, label, source}. Frontend: a resolver row above the paste box (input + Fetch, Enter to submit) fills the textarea with the resolved sequence, shows a result chip, and auto-sets the gene-symbol field so base-edit AA consequences and exon context get the reading frame. Bug fix surfaced…4229225 -
CRISPR M1: base-editing design mode (CBE/ABE + iSTOP + AA consequence)
Tengo Gzirishvili +1: Claude Opus 4.8Promotes the base-editor flag into a first-class design mode that out-classes tools which only flag editability. Backend (dee/core/base_editor.py, new): - Editor library: BE4max/BE3/evoCDA (CBE C→T), ABE8e/ABE7.10 (ABE A→G), each with activity window + per-position profile (Komor/Koblan/ Thuronyi/Gaudelli/Richter). - predict_base_edits(): edits in window, per-position efficiency, bystander detection, editability score. - codon_consequence(): frame-aware AA call — silent/missense/nonsense/ stop-loss + CRISPR-STOP / iSTOP detection. Returns None (never guesses) on alignment mismatch or incomplete codon. find_guides() gains mode="base_edit" + base_editor= kwargs (defaults keep every existing caller unchanged). New Guide fields are all defaulted. AA consequence fills only when a reading frame is trusted — gene_symbol+ organism aligned to CDS, or the input is itself a clean coding sequence (_looks_like_cds). Base editing is SpCas9-only; annotation is gated to it.…dd2d535 -
CRISPR M0: validation test suite + fix KO cut-position copy-paste bug
Tengo Gzirishvili +1: Claude Opus 4.8Establishes a regression net for the live guide-design engine (65 tests, dev-only — not shipped in the image, not in requirements.txt): tests/test_crispr.py guide coordinates round-trip on both strands; CFD vs Doench 2016 matrix; on-target/KO/indel/ base-editor ranges; Cas12a TTTV PAM; hostile input fails safe; CSV/XLSX width + ;-locale safety tests/test_cloning.py cloning-oligo overhangs match the published Zhang (Cas9) / Zetsche (Cas12a) conventions exactly — the highest-consequence output tests/test_offtarget.py genome off-target search via injected in-memory index + temp-FASTA builder (no network) tests/test_exon.py CDS alignment + exon mapping + NMD rule against a hand-built GeneStructure (no Ensembl calls) Fix surfaced by the net: the KO position-bias used a ternary whose two branches wer…36858f4