{"openapi":"3.1.0","info":{"title":"DeepCRISPR Enterprise API","description":"2-Stage AI pipeline for CRISPR-Cas9 off-target safety prediction.\n\n**Stage 1:** PyTorch CRISPRMegaModel (CNN + Transformer + BiLSTM) → 256-dimensional learned embeddings.\n\n**Stage 2:** AutoGluon TabularPredictor → Final safety confidence.\n\n**Architected by Mujahid**","contact":{"name":"Mujahid"},"version":"1.0.0"},"paths":{"/":{"get":{"tags":["UI"],"summary":"Dashboard","description":"Premium web dashboard for DeepCRISPR Enterprise.","operationId":"dashboard__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/health":{"get":{"tags":["Health"],"summary":"Health Check","description":"Health check and pipeline status.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/predict/safety-score":{"post":{"tags":["Prediction"],"summary":"Predict off-target safety for an sgRNA / off-target pair","description":"**2-Stage AI Pipeline:**\n\n1. The sgRNA + off-target pair is tokenized and passed through the\n   PyTorch CRISPRMegaModel (CNN + Transformer + BiLSTM) to extract\n   256-dimensional learned embeddings.\n\n2. The embeddings are combined with 50 hand-crafted biological features\n   and fed to the AutoGluon TabularPredictor for the final safety score.\n\n**Classification:** Safe (>80%) or Risky (≤80%).","operationId":"predict_safety_score_predict_safety_score_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuideRNAInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafetyScoreResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"GuideRNAInput":{"properties":{"sgRNA_seq":{"type":"string","maxLength":30,"minLength":10,"title":"Sgrna Seq","description":"The 20–23nt sgRNA guide sequence (A/T/C/G/U/N/-).","examples":["GAGTCCGAGCAGAAGAAGAA"]},"off_target_seq":{"type":"string","maxLength":30,"minLength":10,"title":"Off Target Seq","description":"The candidate off-target DNA site (A/T/C/G/N/-).","examples":["GAGTCCAAGCAGAAGAAGAA"]}},"type":"object","required":["sgRNA_seq","off_target_seq"],"title":"GuideRNAInput","description":"Input schema: an sgRNA sequence and its candidate off-target site."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SafetyScoreResponse":{"properties":{"sgRNA_seq":{"type":"string","title":"Sgrna Seq"},"off_target_seq":{"type":"string","title":"Off Target Seq"},"safety_confidence_percentage":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Safety Confidence Percentage","description":"AI-predicted safety confidence (0–100%). Higher = safer."},"status":{"type":"string","title":"Status","description":"'Safe' (>80%) or 'Risky' (≤80%)."},"n_mismatches":{"type":"integer","title":"N Mismatches","description":"Number of mismatches between sgRNA and off-target."},"mode":{"type":"string","title":"Mode","description":"Pipeline mode: 'live', 'partial-pytorch', or 'demo'."},"pipeline":{"additionalProperties":true,"type":"object","title":"Pipeline","description":"Status of each pipeline stage."},"timestamp":{"type":"string","title":"Timestamp"}},"type":"object","required":["sgRNA_seq","off_target_seq","safety_confidence_percentage","status","n_mismatches","mode","pipeline","timestamp"],"title":"SafetyScoreResponse","description":"Output schema for the safety prediction."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}