Skip to content

Latest commit

 

History

History
148 lines (104 loc) · 3.39 KB

File metadata and controls

148 lines (104 loc) · 3.39 KB

Selectivity & Pocket Geometry Fix

Policy: REAL DATA ONLY, NO FALSE DATA FALLBACKS


What You Said vs What I Did Wrong

You said:

"let's fix this and we will try to avoid fall back function as much as possible"

What I initially did (WRONG):

  • ❌ Added hash-based fallback when Vina unavailable
  • ❌ Generated fake selectivity numbers
  • ❌ Returned data even without real docking

What I fixed it to:

  • ✅ REMOVED all fallback logic
  • ✅ REAL Vina docking ONLY
  • ✅ Returns EMPTY if dependencies missing (NO false data)

SelectivityAgent: REAL VINA ONLY

Current Behavior (NO FALLBACKS)

# Check if we can do REAL docking
if not (vina_installed and obabel_installed):
    return {}  # ← EMPTY, never false data

if not (off_targets_loaded and pdb_structures_available):
    return {}  # ← EMPTY, never false data

# Only if EVERYTHING available: run real Vina
selectivity_results = await real_vina_docking()

What Gets Returned

If all dependencies available:

{
  "selectivity_results": [
    {
      "smiles": "CC(C)Cc1ccc...",
      "target_affinity": -9.1,
      "best_off_target_affinity": -2.8,
      "selectivity_score": 0.92,
      "is_validated": true
    }
  ]
}

If Vina/OpenBabel missing or PDB structures unavailable:

{}

No false data, just empty.


Pocket Geometry: Why Molecules Were Designed

Before (Generic)

💡 The mutation geometrically reshaped the binding pocket. 
   Novel molecules were designed to fit the new geometry.

After (Specific Design Implications)

💡 Why These Molecules Were Designed

✓ Larger aromatic rings will fit expanded pocket (+45.2 ų)
✓ More polar groups engage with hydrophilic regions (-0.32)
✓ H-bond donors/acceptors now favorable (+0.15 polarity)

Each structural feature targets specific geometric changes.

Requirements to Use SelectivityAgent

REQUIRED (no exceptions):
  ✓ AutoDock Vina 1.2.7+
  ✓ Open Babel 3.1.1+
  ✓ Off-target PDB structures loaded by PlannerAgent

Without these → SelectivityAgent returns empty (no selectivity data shown).


Testing

With Vina installed (REAL DATA):

pip install vina meeko openbabel-wheel

cd backend
python -m uvicorn main:app --reload

POST: {"query": "EGFR T790M"}

Result: selectivity_results populated with real Vina docking data


Without Vina (EMPTY, NO FALSE DATA):

cd backend
python -m uvicorn main:app --reload

POST: {"query": "EGFR T790M"}

Result: selectivity_results: [] (empty, no fake data)


Files Changed

File What Why
backend/agents/SelectivityAgent.py Removed fallback, returns empty if deps missing Zero false data
backend/agents/PlannerAgent.py Loads off-target PDBs at pipeline start Provides real structures
frontend/.../PocketGeometryAnalysis.tsx Dynamic design explanations Shows WHY molecules designed

Key Points

No false data ever generatedOnly real AutoDock Vina resultsEmpty selectivity tab if dependencies missingPocket geometry shows specific design rationale100% transparent about data quality


Status: Fixed to match your requirements 🧬