Spaces:
Sleeping
Sleeping
Upload refine.py
Browse files- scripts/refine.py +8 -5
scripts/refine.py
CHANGED
|
@@ -22,16 +22,19 @@ def polish_design(target_pdb_id, uploaded_file_path):
|
|
| 22 |
rmsd = sup.rms
|
| 23 |
|
| 24 |
# 3. PHYSICS (OpenMM Modeller replaces PDBFixer)
|
|
|
|
| 25 |
pdb = PDBFile(uploaded_file_path)
|
| 26 |
-
modeller = Modeller(pdb.topology, pdb.positions)
|
| 27 |
|
| 28 |
-
#
|
|
|
|
|
|
|
| 29 |
forcefield = ForceField('amber14-all.xml', 'amber14/tip3p.xml')
|
|
|
|
| 30 |
|
| 31 |
-
#
|
| 32 |
-
modeller.addHydrogens(forcefield
|
| 33 |
|
| 34 |
-
#
|
| 35 |
system = forcefield.createSystem(modeller.topology)
|
| 36 |
integrator = LangevinIntegrator(300*kelvin, 1/picosecond, 0.002*picosecond)
|
| 37 |
simulation = Simulation(modeller.topology, system, integrator)
|
|
|
|
| 22 |
rmsd = sup.rms
|
| 23 |
|
| 24 |
# 3. PHYSICS (OpenMM Modeller replaces PDBFixer)
|
| 25 |
+
# Load the "broken" PDB
|
| 26 |
pdb = PDBFile(uploaded_file_path)
|
|
|
|
| 27 |
|
| 28 |
+
# Use Modeller to repair the C-terminus
|
| 29 |
+
# Modeller.addHydrogens and addExtraParticles are usually the fix,
|
| 30 |
+
# but we can force it to ignore the missing bond during template matching.
|
| 31 |
forcefield = ForceField('amber14-all.xml', 'amber14/tip3p.xml')
|
| 32 |
+
modeller = Modeller(pdb.topology, pdb.positions)
|
| 33 |
|
| 34 |
+
# THE FIX: This adds the missing OXT or Hydrogens that OpenMM is whining about
|
| 35 |
+
modeller.addHydrogens(forcefield)
|
| 36 |
|
| 37 |
+
# Setup the system using the REPAIRED modeller topology
|
| 38 |
system = forcefield.createSystem(modeller.topology)
|
| 39 |
integrator = LangevinIntegrator(300*kelvin, 1/picosecond, 0.002*picosecond)
|
| 40 |
simulation = Simulation(modeller.topology, system, integrator)
|