Spaces:
Running
Running
Commit History
-
feat: techspec additions — de novo tier-6 branch, structure export, page capture + final synthesis
Pre-work A1-A7: pymol2-wheel cleanup + fpocket source builds, migration 008 structure_prep_jobs with RLS, user-scoped reads, input validation, SSRF routing, chain_integrity + castp/fpocket status tags. S1: zero-hit proteins complete as de novo runs — composition/hints bundle, InterProScan5 sequence-search domains, ESMFold structure card; confidence tiers (identified/homolog/de_novo) threaded backend-to-frontend with badges, DeNovoPanel, unavailable-state messaging. S2: /api/structure-export router (PDB/CIF/styled PyMOL .pse), docking complex.pdb + ligand.sdf exports, StructureExportMenu on viewer + docking page, honest ChimeraX/VMD file+script bundles. S3: migration 009 page_captures, rate-limited allowlisted capture service wired per source, deterministic final-synthesis findings with confidence-tier tagging, FinalReport panel. 84 backend tests green across five suites; frontend tsc + lint clean.4939f56 -
feat: optimize CASTp SASA with KDTree, add sequence input to CASTp + Structure Prep, ESMFold integration for unknown genes
Backend: - castp.py: Replace O(n²) adjacency loop with scipy KDTree O(n log n), compute SASA on first model only - castp router: Accept pdb_id, sequence (auto-ESMFold), or pdb_text input - structure_prep.py: Add esmfold_predict() for raw sequences via HF Inference API - structure_prep router: Accept sequences for full pipeline (ESMFold → chain detection → repair → cleanup → pockets) Frontend: - CASTp page: PDB ID / amino acid sequence toggle, textarea with residue counter - Structure Prep page: PDB ID / amino acid sequence toggle, progress bar with ESMFold step - api.ts: Add runCastpSequence(), runStructurePrepSequence(), sequence_source on CastpResulte21c532
-
feat: structure preparation pipeline — broken chains → SWISS-MODEL repair → PyMOL cleanup → fpocket + CASTp
- Broken chain detection: Biopython REMARK 465 + CA-CA gap >4.2Å - SWISS-MODEL auto-repair when broken chains found (SMR Repository API) - PyMOL cleanup (waters/hetero removal) with Biopython fallback - fpocket local pocket detection (compiled from source in Docker) - CASTp remote async via CASTpFold server (polls for results) - Combined pocket results panel (fpocket + CASTp side by side) - Pipeline status stepper UI with progress bar - Both Dockerfiles: fpocket compiled from Discngine/fpocket source - Frontend: analyze/structure-prep/page.tsx with full pipeline visualization - Wired into main.py + api.ts, TypeScript clean1b28e93 -
feat: add CASTp pockets, SWISS-MODEL, ESMFold + fix Dockerfiles
- CASTp pocket analysis: Biopython SASA + grid-based cavity detection, 3 endpoints - SWISS-MODEL Repository: query SMR API for homology models + experimental structures - ESMFold structure prediction: HF Inference API proxy, async job with progress - Fix root Dockerfile: add g++/libgl1/libgomp1/libopenblas-dev/libxml2/libxslt1.1 - Fix primer3-py quoting bug in both Dockerfiles (shell redirect issue) - Wire 3 routers into main.py, add API client functions, update analyze hub - TypeScript clean, zero errorsbe36a29
-
chore: remove NGS rate limits
86f2851 -
feat: add igv.js genome browser + proper 6-step NGS pipeline
Backend (ngs.py): - Step 1 QC: per-base quality distribution, GC windows, read length stats - Step 2 Trim: quality/length filtering with before/after metrics - Step 3 Align: Python seed-and-extend alignment (mapped reads, CIGAR) - Step 4 Variant: pileup-based variant calling with VCF output - Step 5 Annotation: SnpEff/cross-reference with protein changes - Step 6 Visualization: upload BAM/SAM/VCF/FASTA to Supabase Storage Frontend: - IgvBrowser component: lazy-loads igv.js, loads BAM/SAM + VCF tracks - Rebuilt NGS page with all 6 steps, per-base quality SVG chart - Download links for BAM/SAM/VCF/FASTA - TypeScript types updated for file_urls, quality charts, annotations Verified: end-to-end test produced 50 variants, uploaded SAM+VCF+reference.95e9035 -
fix: NGS pipeline stuck in queued - worker fallback + migration fix
Root cause: ngs_jobs table was created manually without created_at column and the claim_next_ngs_job RPC was never executed. Fix: - worker.py: _claim_direct() fallback uses direct Supabase queries when RPC is missing (no FOR UPDATE SKIP LOCKED, but atomic update prevents double-processing) - ngs.py: _ensure_ngs_table() attempts auto-migration on first job - 007_ngs_jobs.sql: adds IF NOT EXISTS for created_at column and uses EXCEPTION blocks for idempotent RLS policies Verified: end-to-end test claimed, ran, and completed both queued jobs.8b17c40 -
feat: add full 6-step NGS pipeline + fix sequencing WinError 193
NGS Pipeline (new): - tools/ngs.py: 6-step pipeline (QC, trim, align, variants, annotate, report) with native tool detection (fastqc/fastp/minimap2/samtools/bcftools/snpEff) and pure-Python fallbacks for every step (works on Windows + Linux/Docker) - routers/ngs.py: FastAPI router with POST /run, GET /status, GET /references - migrations/007_ngs_jobs.sql: ngs_jobs table + claim RPC + RLS policies - worker.py: wired ngs_jobs into durable worker dispatch - rate_limit.py: 5 NGS jobs/day per user - Frontend: /analyze/ngs page with 6-step progress stepper, QC stats, trimming retention, alignment mapping rate, variant table, annotation with known variant lookup, consensus FASTA download, BLAST bridge - api.ts: NGS types + runNGS/getNGSStatus/listNGSReferences functions Sequencing Pipeline fix: - Fixed [WinError 193] by detecting platform and refusing to execute Linux ELF binary on Windows; added Python fallback alignment5fa9145
-
feat(pipeline): multi-database UniProt identifier resolution
Resolve ANY BLAST-hit accession (RefSeq, GenBank, PDB, Ensembl, ...) or raw protein sequence to a UniProt accession via a strategy ladder: 1. direct - already a UniProt accession (Swiss-Prot / TrEMBL) 2. xref - synchronous xref: search (~1s, no job queue) 3. name - reviewed full-text search on hit description + gene hint 4. sequence - EBI BLAST of query against UniProtKB (e-value gated) 5. idmapping - UniProt ID-mapping queue as last resort _pipeline _run_uniprot now delegates to the resolver; the expensive sequence-BLAST fallback runs only for the top hit. Results carry a resolution block (accession, method, original accession). Verified live across 6 species and 6 accession types. 29 unit tests.59ba48b
-
fix(pipeline): stop abandoning slow NCBI BLAST jobs + EBI fallback
NCBI BLAST routinely exceeds its optimistic RTOE under load, but the stuck heuristic (max(RTOE*5, 180s)) declared jobs STUCK after ~3 minutes even with a 900s poll budget, then re-submitted and failed 3x. The poll now gives a job at least half its budget before declaring STUCK. Add a resilience net: when NCBI fails or returns unparsable output, the pipeline BLAST step falls back to EBI BLAST (uncached, so transient errors are not cached for 24h), mapping NCBI databases to EBI equivalents. The pipeline only fails when both providers fail. BlastTool stype mapping fixed for blastx/tblastn. Verified: 8 new resilience tests + full seq_tools (48) pass; frontend tsc clean.60c8e2d
-
feat(admet): ProTox 3.0 ML toxicity prediction — backend client + endpoint, frontend ProTox tab, restored sidebar chevron
38e4510
-
feat(seq-tools): motif categories & structure overlay, dot-plot scoring & features, cross-tool links
033540e -
feat(seq-tools): add sequence utilities, motif scanner and dot plot tools with frontend pages
60aee05
-
feat(primers): add NCBI gene search + sequence retrieval, oligo QC and in-silico PCR verification with recharts graphs
5d5e978
-
Fix pipeline MSA/AI stall, add SwissADME-parity ADMET panel, PubChem search, docking ligand data
- Pipeline: lazy litellm loading in interpreter/llm_client, brace-safe prompt building, EBI MSA best-effort (clustalo->muscle) + in-process progressive MSA fallback (msa_fallback.py), robust polling with consecutive-failure detection in PipelineResults. - ADMET: SwissADME-parity block (BOILED-Egg polygons, ESOL, Martin bioavailability, Muegge, radar, SA score), HBA as pure N+O count, recharts radar/BOILED-Egg/range-bar panel, chemical name in header. - PubChem: /api/admet/search autocomplete + name/CID->SMILES resolution, debounced compound search box on ADMET page. - Docking: ligand essential-data table (formula, MW, heavy atoms, H count, HBA/HBD/TPSA/RB/LogP) and per-pose hydrogen counts. - Pin backend start scripts to backend/.venv.5bb077e
-
Add MSA pairwise refinement, new UI components (SmoothLoader, Reveal, CursorGlow, Parallax), rate-limit handling in AIInterpretation
ace64e6 -
Fix share links, persist wizard jobs, add AI interpretation fallback, animate landing
- Share: hydrated context on shared pages, allow anonymous/guest jobs, Web Share API with custom message, surface real API errors, add Share button to wizard results - Wizard: persist v2 jobs to Supabase (history + shareable), attach auth token to v2 runs, surface MSA failures and add FASTA download, render MSA + phylo on jobs/shared pages - AI: retry/backoff honoring provider rate-limit delays, provider cascade with fallback models, friendly streaming errors and notices, retry button - Landing: cursor-tracking TiltCard with spotlight, database marquee, animated pipeline connectors, scroll reveals, refreshed semantic gradients1f74aa2 -
Add global/local BLAST modes, full-length pairwise alignment view, standalone pairwise tool
8321d59
-
feat(docking): Vina full-detail — parse 1.2.7 log (RMSD l.b./u.b., version, seed), RMSD table + run-config UI (3e)
4320faf
-
feat(uniprot,domains): reviewed/organism filters + debounce/fast-path, PROSITE raw-sequence scan UI (3c,3d)
7acf89d -
feat(alignment): multi-method MSA (clustalo/muscle/kalign/mafft/tcoffee) with method selector (3b)
cc7ed3f -
feat(alignment): pairwise global/local alignment via BLAST hit 'Align pair' (3a)
- POST /api/alignment/pairwise: Biopython PairwiseAligner (Needleman-Wunsch global default / Smith-Waterman local), BLOSUM62/PAM250, configurable gap penalties; subject fetched by accession (NCBI efetch -> UniProt fallback, ttl_cache 86400); clear 400 on dead/obsolete accession - Degenerate no-overlap local alignment returns empty result, not an error - BlastPanel 'Align pair' button: full query seq threaded from all 4 render sites, dimmed overhang beyond the aligned region, coverage note, fetch-failure UI - biopython>=1.80 pinned; 18 offline testsf0992bc -
feat(md): verified force field/solvent menu (ff14SB/ff15ipq/ff19SB/amberfb15/CHARMM36 x OBC1/OBC2/GBN2) with alanine-dipeptide createSystem startup probe; explicit errors for invalid combos; dynamic frontend menu
2583376 -
fix(blast): honor program/db/max_hits params, accept DNA queries, poll cap 65 min
- pipeline_v2: resolve program/database/sequence-type via blast_config, thread blast_params through /run -> run_pipeline -> _execute -> _run_blast, clamp max_hits to 5-100, record query_sequence_type/query_accession. - pipelines + pipeline_worker: persist database/program/max_hits/query_accession in context_json and forward as blast_params. - validators: accept DNA/RNA in validate_fasta (was rejecting with 400). - sequence_utils: fix detect_sequence_type so ACGT-only strings are nucleotide (protein alphabet overlaps, so nucleotide check now wins). - frontend jobs page: POLL_TIMEOUT_MS 10min -> 65min to match backend window. - tests: unit coverage for resolve_blast_params + nucleotide validation.1f75a84
-
feat(md): clay simulation-parameter controls (force field, solvent, run length)
09fc54e
-
fix(md): reflect OXT across C-CA axis so GBSA stops NaNing on Linux CPU
The terminal OXT was placed by point-reflecting the carbonyl O through C, which drove it into the backbone (1.4 A from CA/CB on 1TIM HIS248). That clash made the initial GBSA force ~3.7e8 kJ/mol/nm - finite on Windows but NaN on the Linux CPU platform in the deployed container, aborting minimizeEnergy with 'Particle coordinate is NaN' and degrading every job to the BioPython fallback. Reflect O across the C-CA line instead (correct ~120 deg carboxylate angle, pointing away from the sidechain): initial max force drops to ~3.9e5 and minimize converges. Also switch GBSA to CutoffNonPeriodic (2.0 nm), the OpenMM-recommended implicit-solvent setup, which is ~3.5x faster than the O(N^2) NoCutoff path and lets jobs finish inside the Space's CPU-only limits. Supporting changes: per-job platform override, /health reports openmm version/platforms, debug meta (version/platform/init max force) attached to results and fallback diagnostics, cheaper SASA (48 pts, 5 frames), eq 300 steps, job timeou…d040f58
-
fix(blast): handle NCBI server overload gracefully
- Sync-mode fallback now uses a 300s httpx timeout (was 60s, which broke NCBI blocking responses for slow nr queries) and short-circuits inline READY results without a second poll cycle - Poll interval lowered to 5s when an API key is present (NCBI allows 3 req/s with a key) - Stuck-job threshold raised to max(5x RTOE, 180s) so overloaded NCBI jobs aren't abandoned prematurely - Fast-mode BLAST budget raised 180s -> 600s, normal mode 600s -> 900s to survive NCBI overload windows908c122
-
fix: harden BLAST pipeline against NCBI timeouts and server overload
- Add EMAIL parameter to NCBI submit_blast (required by NCBI API) - Catch httpx.TimeoutException and HTTPStatusError in _request_with_retry - Add stuck-job detection in check_status_until_ready (5x RTOE threshold) - Add synchronous mode fallback when async RTOE is unreasonable (>300s) - Tolerate up to 3 consecutive poll failures before giving up - Increase retries from 1 to 2 (3 total attempts) - Increase poll start delay from 5s to 10s (NCBI rate limit guidance) - Add QUEUED status handling in poll loop - Fix EBI BlastTool: increase poll timeout (120->180s), add failure tolerance - Pipeline v2: pass retries=2 to run_blast_with_retry - Add comprehensive BLAST test suite (test_blast_comprehensive.py) with: * Multiple protein datasets (crambin, insulin, GFP, lysozyme, hemoglobin) * Full NCBI roundtrip tests, XML parsing, retry verification * EBI BLAST tool tests, error handling (empty/invalid/long sequences) * Random fuzz tests (5 random sequences), consecutive reliability tests …2dadeea -
feat: expanded Domain & Motif Analysis with all features and cross-project links
- Added domain_analysis.py tool with 12 analysis functions (InterPro, UniProt features, sites, PTMs, topology, motifs, variants, disulfide, composition, GO, pathways, full analysis) - Expanded domains router with 12 endpoints (/features, /sites, /ptm, /topology, /motifs, /variants, /disulfide, /composition, /go, /pathways, /all) - Updated DomainArchitecture.tsx with tabbed interface (9 tabs), multi-track SVG visualizations, cross-feature links - Updated domains page.tsx with richer UI, example accessions, bridge links to BLAST/Structure/UniProt/Interactions - Fixed fetch_uniprot_raw to handle 400 status codes gracefully - Added 19 new domain/motif endpoint tests (206 passed, 17 skipped, 0 failed)9c0c10a -
test: comprehensive validation & fuzz testing with bug fixes
- Add 84-test feature validation suite (test_feature_validation.py) covering all 19 platform features against real biological data (aspirin, caffeine, ibuprofen, 4HHB, TP53, P00698, etc.) - Add 71-test fuzz/random data suite (test_fuzz_random.py) with random SMILES, PDB IDs, sequences, SQL injection, XSS, path traversal, huge payloads, malformed JSON, Unicode, control characters - Fix Foldseek structure comparison: handle nested list-of-lists alignment format from updated API (structure_analysis.py:257) - Fix input sanitization for control characters in interactions, pathways, uniprot, and domains routers to prevent httpx.InvalidURL unhandled 500s - Fix KEGG search URL encoding with urllib.parse.quote - Fix ADMET BalabanJ segfault on Windows (os.name guard) and MolVolume exception handling - Add subprocess isolation for RDKit on Windows (admet router) - Add missing reportlab submodule mocks to conftest.py - Add asyncio_mode=auto to pytest.ini for async test support - 187 …d17fdb8
-
fix: increase BLAST timeout from 5min to 10min for long proteins
- blast.py: max_wait_seconds default 300 -> 600 - pipeline_v2.py: non-fast-mode timeout 300 -> 600 - TP63 (761aa) against nr needs >5min, was timing out1ed0170
-
fix: remove all rate limiters blocking pipeline runs
- deps.py: remove slowapi 60/minute default limit - pipelines.py: remove daily limit + 10/minute limiter from /run - pipeline_v2.py: remove daily limit + 10/minute limiter from /run - ai.py: remove daily limit from /interpret and /interpret/stream - sequencing.py: remove daily limit + 10/minute limiter from /run51ed454 -
fix: UniProt fallback search by protein name when NCBI mapping fails
When BLAST returns NCBI accessions that can't be mapped to UniProt, the pipeline now searches UniProt by protein name (from BLAST hit description) to find the real entry with PDB cross-references. This fixes missing Ramachandran, Comparison, Domains, Interactions, and AlphaFold for proteins like TP63 where BLAST returns NCBI-only hits.579ccb3 -
feat: Gemini fallback for AI interpretation when Groq fails
336a23e -
fix: PDB IDs like 1TIM rejected as NCBI accessions causing 400 error
- detect_source_from_accession: add 4-char alphanumeric PDB detection before fallthrough - sequences.py: add PDB branch that resolves PDB -> protein sequence via RCSB FASTA - PDB IDs no longer misclassified as NCBI, eliminating the 400 Bad Request826daa4 -
fix: case-insensitive accession lookup - normalize to uppercase at entry points
- sequences.py: .upper() accession before detect_source and API calls - ncbi_service.py: .upper() accession in fetch_by_accession - uniprot.py: .upper() accession in run() - Fixes: p04637 vs P04637 producing different results / cache misses9be3066 -
fix: UniProt mapping resilience - skip gracefully instead of failing pipeline
- map_refseq_to_uniprot(): skip direct lookup for known UniProt accessions - map_refseq_to_uniprot(): try RefSeq_Protein first for NP_/XP_/YP_ IDs - map_refseq_to_uniprot(): add logging for debugging mapping failures - map_refseq_to_uniprot(): extend poll to 15 iterations - _run_uniprot(): when mapping fails, return partial BLAST data instead of error - Pipeline continues with BLAST-only results when UniProt is unavailable3683b86 -
perf: parallelize post-BLAST steps + fast_mode Swiss-Prot toggle
- _execute(): UniProt, MSA, Pathway Enrichment run in parallel via asyncio.gather - _execute(): Domains + AlphaFold run in parallel after UniProt completes - Total post-BLAST time: ~8min sequential -> ~4min (limited by MSA) - Add fast_mode toggle: Swiss-Prot (~560K seqs, 5-10s) vs nr (~300M seqs, 30s-2min) - Frontend: fast mode toggle in BLAST wizard advanced settings - Backend: fast_mode flows through pipelines.py -> worker -> pipeline_v2 -> blast.pyf3682aa -
fix: BLAST reliability - API key, exponential backoff, retry, error tracking
7bbb868
-
feat: live pipeline status progression — worker pushes status to Supabase at each step
- Add status_callback parameter to run_pipeline() and _execute() - Worker passes async callback that PATCHes job status in Supabase - BLAST sub-phases: submitted_to_ncbi -> polling_ncbi -> parsing - Post-BLAST phases: fetching_uniprot, running_msa, pathway_enrichment, fetching_alphafold, interpreting - Frontend STATUS_ORDER, isActive, STEP_LABELS updated with new statuses - Progress tracker now animates through each step in real-time96b3a54
-
chore: increase rate limit 3/min -> 10/min for pipeline and sequencing endpoints
dd97183 -
fix: prevent GROQ restricted-key hang in interpret and audit steps
- Wrap acompletion() in asyncio.wait_for(timeout=30) to prevent indefinite hang when GROQ API key is restricted/organization blocked - Add proper logging for GROQ timeouts and errors - Fix audit engine: add timeout=15, strip markdown fences from LLM JSON output, handle json.JSONDecodeError separately6891fff -
fix: wrap sequence/length under query key for frontend AssembledContext
cacae61 -
fix: strip NCBI QBlastInfo preamble before XML parsing
a0c9dbc -
fix: hydrate context_json from storage_url so frontend can render pipeline results
804afcc
-
fix: pipeline robustness — UniProt hit fallback, sweep timeout, heartbeat
- pipeline_v2 _execute: try next BLAST hits for UniProt if top hit fails - worker: increase STUCK_JOB_TIMEOUT_MIN from 10 to 30 minutes - pipeline_worker: add heartbeat that refreshes claimed_at every 2 min to prevent sweep from reclaiming legitimately-running pipelines7abea8b
-
fix: BLAST pipeline crash — accession misclassification + missing error handling
Root cause: NCBI accession QMS45324 (insulin hit) was misclassified as UniProt by detect_source_from_accession due to bare 'P/Q/O' prefix check. UniProt lookup then failed with 400, crashing the entire pipeline. Fixes: - detect_source_from_accession: regex-based detection ([OPQ][0-9]xxx for UniProt, A0A[A-Z0-9]{5,}[0-9] for new format) — QMS45324 now correctly classified as NCBI - UniprotTool._fetch: handle 400/500 errors (not just 404) - _run_uniprot: wrap in try/except so UniProt failures don't crash pipeline - pipeline_v2._execute: each step wrapped in individual try/except so one failed step doesn't kill the whole pipeline - map_refseq_to_uniprot: try RefSeq_Protein, EMBL, and PDB sourceseb567da -
fix: BLAST sequence not read - store full sequence in query_preview, fix context_json fallback
211c4f9 -
fix: BLAST pipeline stuck in queue — 3 root causes
1. Full sequence never stored: only 100 chars in query_preview, worker reads non-existent query_sequence/query columns - Fix: store full sequence in context_json, read from there with fallbacks 2. Wrong status 'completed' violates DB constraint (allows 'complete' only) - Fix: 'completed' -> 'complete' 3. 'updated_at' column doesn't exist on jobs table, silently rejected by PostgREST - Fix: removed from all pipeline_worker PATCH payloads59765e9
-
fix: include smiles in docking payload dict for when ligand_smiles column is missing
2e692a0