Spaces:
Sleeping
Sleeping
Commit History
-
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 -
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
-
Bump v2.0 effective date 2026-07-07 -> 2026-07-08 (full 30-day notice)β
Tengo Gzirishvili +1: Claude Opus 4.8The user notice now goes out 2026-06-08, so move the effective date one day to 2026-07-08 to keep the >=30-day advance-notice commitment exact. Updates the aggregation gate constant in both aggregate.py and outcomes.py (the functional gate), the in-app policy-notice banner, and the dating in code/migration comments. Legal docs, emails, and the landing privacy/terms pages updated in their respective trees. Tests: 315 passing (gate tests track the constant symbolically). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>a0ee590
-
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
-
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
-
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: 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 -
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
-
Genome off-target β non-blocking + background prewarm + status bannerβ
Tengo Gzirishvili +1: Claude Opus 4.7Founder report: human-index build went 300+ s, browser request had timed out, user staring at frozen spinner. Architecture was broken β the synchronous kmer-index build inside the HTTP request handler can easily blow past HF Spaces' ~120 s request timeout. Three fixes: 1. offtarget.find_genomic_offtargets() no longer blocks on a build. If the cached index isn't ready when the request arrives, we kick off a background daemon-thread build (idempotent β won't duplicate if one is already running) and return EMPTY hits + a per-organism "building" status. The user's design request returns immediately with on-target / CFD-self / indel / oligo data, just without the genome off-target column populated. 2. server.serve() prewarms all ready organisms (ecoli + human + mouse) in daemon threads at Flask startup. The Space rebuild itself takes 1-2 min; by the time it goes green and a user arrives, the small E. coli index is done (~5 s) and the largeβ¦6983e3b -
Off-target β enable Homo sapiens + Mus musculus (exome / CDS only)β
Tengo Gzirishvili +1: Claude Opus 4.7Promotes human + mouse from "pre-build pending" placeholders to real, working off-target organisms on the free HF tier. Realistic tradeoff: full genome (3 GB human, 2.7 GB mouse) won't download + index inside a free container in any reasonable time. But the exome (CDS only) catches what users actually care about β off- targets *inside genes* β while skipping introns + intergenic regions where a Cas9 cut is biologically inert. Source: Ensembl's pre-bundled CDS FASTAs: - Homo_sapiens.GRCh38.cds.all.fa.gz (~30 MB compressed β 80 MB) - Mus_musculus.GRCm39.cds.all.fa.gz (~25 MB compressed β 70 MB) Implementation: - GENOME_SOURCES extended with `is_gzip` + `scope` fields; ready=True. - _ensure_genome_downloaded handles gzip decompression on download, caches uncompressed FASTA in /tmp for the container's lifetime. - _build_kmer_index runs as-is β same 8-mer seeded NGG index, just scaled up to ~12 M sites per organism. In-memory index ~500 MB, fits the freeβ¦f2706e2 -
CRISPR Phase 2C-1 β cloning oligos + vendor buttons + vector pickerβ
Tengo Gzirishvili +1: Claude Opus 4.7Ports the directed-evolution page's "design β order" loop to CRISPR. Three things, all matching the design-page pattern: 1. Vector picker (dropdown above results table). 5 popular Cas9 vectors + 1 Cas12a vector seeded: - px330 (Addgene 42230, BbsI) β original Zhang Cas9+gRNA - pX458 (Addgene 48138, BbsI) β px330 + 2A-GFP, FACS sortable - pX459 V2 (Addgene 62988, BbsI) β px330 + 2A-Puro - lentiCRISPRv2 (Addgene 52961, BsmBI) β lentiviral all-in-one - pLentiGuide-Puro (Addgene 52963, BsmBI) β gRNA-only lentiviral - pY094 (Addgene 84739, BsmBI) β lentiCpf1 for Cas12a Default = pX459 V2 (covers the most common knockout workflow). 2. Per-guide oligo pair. Standard Zhang-lab format: sense: 5'-CACCG[20 nt spacer]-3' antisense: 5'-AAAC[reverse complement]C-3' Cas12a (pY094) uses the AGAT / AAAA overhang convention from Zetsche 2017. Two new table columns (Sense oligo, Antisense oligo) each with a Copy buβ¦7a41c01 -
CRISPR Phase 2B-1 β E. coli genome off-target + Ensembl exon-aware designβ
Tengo Gzirishvili +1: Claude Opus 4.7Two new optional features, both backward-compatible (no params = pre-2B behavior): 1. Genome off-target search. New dee/core/offtarget.py: - Lazy NCBI download (~3 s) on first request after a cold start. - 8-mer-seeded kmer index in memory; pure-Python (no BWA/bowtie deps). - For each Cas9 guide: search every NGG site in the genome with up to 4 mismatches in the spacer + 1 mismatch in the seed (positions 13-20), CFD-score each candidate, return top hits. - E. coli K-12 MG1655 ready today (5 MB FASTA, ~240k sites, ~5 s build). - Human / mouse stubbed as placeholders pending pre-built indexes hosted externally (Phase 2B-2). - Thread-safe build lock; degrades open on any error. 2. Exon-aware annotation. New dee/core/exon.py: - Ensembl REST lookup for (organism, gene_symbol) β canonical transcript + exon structure + CDS sequence. Cached in-memory. - Align user's pasted DNA to the gene's CDS via fast substring seed β¦345b9c9 -
CRISPR Phase 2A polish β replace Cleanliness (saturated at 6) with Dominance %β
Tengo Gzirishvili +1: Claude Opus 4.7Founder feedback: every guide on EGFP showed Cleanliness=6. The count was useless β algorithm caps top_n at 5 + "other" = 6 items, and the 5% threshold lets all of them through. Replaced with top_dominance_pct: the frequency of the single most- likely repair outcome. Direct biological readout β answers "will I get one main edit product or many?" with one number: 40%+ = clean predictable cut (one dominant edit) β green 25-40% = typical heterogeneous repair β amber <25% = messy (smear of alleles) β red API field renamed outcome_diversity β top_dominance_pct. CSV column "Outcome diversity" β "Top outcome dominance %". UI column "Cleanliness" β "Dominance". Frontend keeps a soft fallback for one deploy cycle so cached browsers don't render "β". XLSX column width adjusted. Cache buster bumped to 20260529-crispr-dominance. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>7c54abf -
CRISPR Phase 2A β inDelphi-inspired indel prediction + base-editor flagβ
Tengo Gzirishvili +1: Claude Opus 4.7Two new capabilities, both empirical heuristics that ship as pure Python with no new deps (defer the neural-network inDelphi to Phase 2B if benchmark gap demands). 1. Indel outcome prediction. For each Cas9 guide we scan Β±17 bp of the cut site for microhomologies (2-6 bp), score MMEJ deletions by MH_length Γ exp(-del_length/10) per Bae 2014, add the templated +1 insertion class (~32% of events, templated from position -4 per van Overbeek 2016 / Lemos 2018), plus a small MH-less baseline. Aggregate per-guide: top_indel_label "-3 (ATG) (28%)" / "+1 T (32%)" / ... frameshift_pct total % of outcomes that are frameshift outcome_diversity # of outcomes β₯ 5% (low = clean cut) predicted_indels top-5 outcomes with frequencies Smoke-tested against EGFP β predictions are biologically plausible: in-frame -3 dels dominate in coding sequence (trinucleotide periodicity β frequent microhomologies), templated +1 inseβ¦db7532c -
Replace CRISPR CSV export with native XLSX (fixes ;-locale Excel mangle)β
Tengo Gzirishvili +1: Claude Opus 4.7Founder hit the bug immediately after the Phase 1 ship: opening the downloaded CSV in Excel on macOS with a Georgian locale split every data row on ";" instead of ",", because Excel's CSV import uses the OS list-separator (";" in most non-English locales) regardless of what the file actually uses. Visible symptom: 15-column data showing up as 2 columns with the KO reasoning text broken in half on the embedded semicolon. Two fixes, shipped together: 1. dee/core/crispr.py β KO reasoning strings now use en-dash "β" instead of ";" so even the fallback CSV path is safe. 2. dee/server.py β /api/crispr/download now emits a proper XLSX via openpyxl. Native Excel format: no delimiter ambiguity, opens cleanly in Excel / Numbers / Google Sheets regardless of locale. Headers bold + paper-fill, numeric columns emitted as proper numbers so sort + cell formats work natively, header row frozen, sensible column widths. 3. Frontend β button label "Download CSV" β β¦ec5933d -
CRISPR Phase 1 β Doench-inspired scoring + CFD self-off-target + Cas12a + KO efficacyβ
Tengo Gzirishvili +1: Claude Opus 4.7Closes the credibility gap vs CRISPOR/CHOPCHOP. Five things: 1. Doench-inspired on-target scoring. Strongest published sequence-only features from Doench 2016 (RS2) β per-position single-nt weights at all 20 positions (was 5), dinucleotide weights at PAM-coupled positions, kept GC + homopolymer + PAM contributions. Honest UI label: "TuringDNA on-target" β not "Doench RS2", since we skipped the gradient-boosted ML layer. 2. CFD self-off-target scoring. The exact 20-position mismatch-penalty matrix from Doench 2016 Supplementary Table 19 plus PAM multiplier table. For each guide, scores every OTHER NGG site in the pasted input as a potential off-target. None of CRISPOR/CHOPCHOP/Synthego does CFD-within-input β defensible novel angle, especially useful when editing tagged constructs where the tag may harbor an unintended cut site. Returns per-guide max_cfd_offtarget + offtarget_count. 3. Cas12a / Cpf1 support. TTTV PAM aβ¦995ee2a
-
Fix CRISPR reverse-strand position formula (off-by-GUIDE_LEN bug)
Verified signatured9c7298 -
CRISPR MVP: Cas9 knockout gRNA designer (sign-in gated, free for accounts)
Verified signaturefeeac92
-
Audit H/M cleanup: H2/H3/H5/H6/M3/M4/M5/M6/M7
Verified signature8a67e28
-
Truthful restriction-site reporting + UI gate
Verified signature44bdb52
-
Initial deploy Β· DEE Flask app via Docker SDK
Verified signature060bb47