Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
OpenFold
Commits
fb34a0cb
Commit
fb34a0cb
authored
Oct 17, 2023
by
Jennifer
Browse files
Remove openmm patches
parent
4fde713c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
70 deletions
+8
-70
lib/openmm.patch
lib/openmm.patch
+0
-42
openfold/np/relax/amber_minimize.py
openfold/np/relax/amber_minimize.py
+4
-12
openfold/np/relax/cleanup.py
openfold/np/relax/cleanup.py
+2
-8
openfold/np/relax/utils.py
openfold/np/relax/utils.py
+2
-8
No files found.
lib/openmm.patch
deleted
100644 → 0
View file @
4fde713c
Index: simtk/openmm/app/topology.py
===================================================================
--- simtk.orig/openmm/app/topology.py
+++ simtk/openmm/app/topology.py
@@ -356,19 +356,35 @@
def isCyx(res):
names = [atom.name for atom in res._atoms]
return 'SG' in names and 'HG' not in names
+ # This function is used to prevent multiple di-sulfide bonds from being
+ # assigned to a given atom. This is a DeepMind modification.
+ def isDisulfideBonded(atom):
+ for b in self._bonds:
+ if (atom in b and b[0].name == 'SG' and
+ b[1].name == 'SG'):
+ return True
+
+ return False
cyx = [res for res in self.residues() if res.name == 'CYS' and isCyx(res)]
atomNames = [[atom.name for atom in res._atoms] for res in cyx]
for i in range(len(cyx)):
sg1 = cyx[i]._atoms[atomNames[i].index('SG')]
pos1 = positions[sg1.index]
+ candidate_distance, candidate_atom = 0.3*nanometers, None
for j in range(i):
sg2 = cyx[j]._atoms[atomNames[j].index('SG')]
pos2 = positions[sg2.index]
delta = [x-y for (x,y) in zip(pos1, pos2)]
distance = sqrt(delta[0]*delta[0] + delta[1]*delta[1] + delta[2]*delta[2])
- if distance < 0.3*nanometers:
- self.addBond(sg1, sg2)
+ if distance < candidate_distance and not isDisulfideBonded(sg2):
+ candidate_distance = distance
+ candidate_atom = sg2
+ # Assign bond to closest pair.
+ if candidate_atom:
+ self.addBond(sg1, candidate_atom)
+
+
class Chain(object):
"""A Chain object represents a chain within a Topology."""
openfold/np/relax/amber_minimize.py
View file @
fb34a0cb
...
@@ -28,18 +28,10 @@ import openfold.utils.loss as loss
...
@@ -28,18 +28,10 @@ import openfold.utils.loss as loss
from
openfold.np.relax
import
cleanup
,
utils
from
openfold.np.relax
import
cleanup
,
utils
import
ml_collections
import
ml_collections
import
numpy
as
np
import
numpy
as
np
try
:
import
openmm
# openmm >= 7.6
from
openmm
import
unit
import
openmm
from
openmm
import
app
as
openmm_app
from
openmm
import
unit
from
openmm.app.internal.pdbstructure
import
PdbStructure
from
openmm
import
app
as
openmm_app
from
openmm.app.internal.pdbstructure
import
PdbStructure
except
ImportError
:
# openmm < 7.6 (requires DeepMind patch)
from
simtk
import
openmm
from
simtk
import
unit
from
simtk.openmm
import
app
as
openmm_app
from
simtk.openmm.app.internal.pdbstructure
import
PdbStructure
ENERGY
=
unit
.
kilocalories_per_mole
ENERGY
=
unit
.
kilocalories_per_mole
LENGTH
=
unit
.
angstroms
LENGTH
=
unit
.
angstroms
...
...
openfold/np/relax/cleanup.py
View file @
fb34a0cb
...
@@ -20,14 +20,8 @@ cases like removing chains of length one (see clean_structure).
...
@@ -20,14 +20,8 @@ cases like removing chains of length one (see clean_structure).
import
io
import
io
import
pdbfixer
import
pdbfixer
try
:
from
openmm
import
app
# openmm >= 7.6
from
openmm.app
import
element
from
openmm
import
app
from
openmm.app
import
element
except
ImportError
:
# openmm < 7.6 (requires DeepMind patch)
from
simtk.openmm
import
app
from
simtk.openmm.app
import
element
def
fix_pdb
(
pdbfile
,
alterations_info
):
def
fix_pdb
(
pdbfile
,
alterations_info
):
...
...
openfold/np/relax/utils.py
View file @
fb34a0cb
...
@@ -18,14 +18,8 @@ import io
...
@@ -18,14 +18,8 @@ import io
from
openfold.np
import
residue_constants
from
openfold.np
import
residue_constants
from
Bio
import
PDB
from
Bio
import
PDB
import
numpy
as
np
import
numpy
as
np
try
:
from
openmm
import
app
as
openmm_app
# openmm >= 7.6
from
openmm.app.internal.pdbstructure
import
PdbStructure
from
openmm
import
app
as
openmm_app
from
openmm.app.internal.pdbstructure
import
PdbStructure
except
ImportError
:
# openmm < 7.6 (requires DeepMind patch)
from
simtk.openmm
import
app
as
openmm_app
from
simtk.openmm.app.internal.pdbstructure
import
PdbStructure
def
overwrite_pdb_coordinates
(
pdb_str
:
str
,
pos
)
->
str
:
def
overwrite_pdb_coordinates
(
pdb_str
:
str
,
pos
)
->
str
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment