Spaces:
Running
Running
Commit History
-
Genome off-target: four complete genomes, and an honest answer on mammals
Tengo GzirishviliAdds S. cerevisiae, C. elegans and D. melanogaster alongside E. coli as COMPLETE-genome off-target targets — for these an off-target anywhere (intron, intergenic, regulatory) is found, not just coding sequence. Verified end to end: yeast builds in 18.5s -> 944,171 sites across 17 chromosomes (16 + mito), 0.25s queries, and a positive control pulling a real protospacer out of the index finds itself at I:79 with CFD 1.000. Also fixes a latent bug that would have silently disabled every new organism: server.py validated target_organism against a hardcoded ("", "ecoli", "human", "mouse") tuple in TWO places, so anything else fell back to "no genome search". Now validated against offtarget.GENOME_SOURCES, so registering a genome is enough to enable it end to end. Whole-genome human/mouse is NOT added, and the methods text now says why rather than leaving it looking like an oversight. Measured in clean processes: the seed index costs ~90-260 bytes per site depending how the baseline is cou…35fa528
-
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 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