42Cummer commited on
Commit
cd1d82d
·
verified ·
1 Parent(s): 42531ff

Upload refine.py

Browse files
Files changed (1) hide show
  1. 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
- # Standardize Forcefield
 
 
29
  forcefield = ForceField('amber14-all.xml', 'amber14/tip3p.xml')
 
30
 
31
- # Add Hydrogens (Standardizes the Nitrogen typenames)
32
- modeller.addHydrogens(forcefield, pH=7.4)
33
 
34
- # Run the wiggle to kill the 8 clashes
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)