Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pdbfixer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pdbfixer
Commits
a078b0ee
Commit
a078b0ee
authored
Sep 12, 2013
by
Peter Eastman
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/peastman/pdbfixer
parents
5e418ca9
7f82266b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
pdbfixer.py
+9
-4
No files found.
pdbfixer.py
View file @
a078b0ee
...
@@ -31,7 +31,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
...
@@ -31,7 +31,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
__author__
=
"Peter Eastman"
__author__
=
"Peter Eastman"
__version__
=
"1.0"
__version__
=
"1.0"
import
ui
import
simtk.openmm
as
mm
import
simtk.openmm
as
mm
import
simtk.openmm.app
as
app
import
simtk.openmm.app
as
app
import
simtk.unit
as
unit
import
simtk.unit
as
unit
...
@@ -242,7 +241,10 @@ class PDBFixer(object):
...
@@ -242,7 +241,10 @@ class PDBFixer(object):
newResidue
=
chain
.
topology
.
addResidue
(
residueName
,
chain
)
newResidue
=
chain
.
topology
.
addResidue
(
residueName
,
chain
)
translate
=
startPosition
+
(
endPosition
-
startPosition
)
*
(
i
+
1.0
)
/
(
len
(
residueNames
)
+
1.0
)
translate
=
startPosition
+
(
endPosition
-
startPosition
)
*
(
i
+
1.0
)
/
(
len
(
residueNames
)
+
1.0
)
for
atom
in
template
.
topology
.
atoms
():
templateAtoms
=
list
(
template
.
topology
.
atoms
())
if
newResidue
==
chain
.
residues
()
.
next
():
templateAtoms
=
[
atom
for
atom
in
templateAtoms
if
atom
.
name
not
in
(
'P'
,
'OP1'
,
'OP2'
)]
for
atom
in
templateAtoms
:
newAtom
=
chain
.
topology
.
addAtom
(
atom
.
name
,
atom
.
element
,
newResidue
)
newAtom
=
chain
.
topology
.
addAtom
(
atom
.
name
,
atom
.
element
,
newResidue
)
newAtoms
.
append
(
newAtom
)
newAtoms
.
append
(
newAtom
)
templatePosition
=
template
.
positions
[
atom
.
index
]
.
value_in_unit
(
unit
.
nanometer
)
templatePosition
=
template
.
positions
[
atom
.
index
]
.
value_in_unit
(
unit
.
nanometer
)
...
@@ -345,11 +347,14 @@ class PDBFixer(object):
...
@@ -345,11 +347,14 @@ class PDBFixer(object):
if
residue
.
name
in
self
.
templates
:
if
residue
.
name
in
self
.
templates
:
template
=
self
.
templates
[
residue
.
name
]
template
=
self
.
templates
[
residue
.
name
]
atomNames
=
set
(
atom
.
name
for
atom
in
residue
.
atoms
())
atomNames
=
set
(
atom
.
name
for
atom
in
residue
.
atoms
())
templateAtoms
=
list
(
template
.
topology
.
atoms
())
if
residue
==
chainResidues
[
0
]
and
(
chain
.
index
,
0
)
not
in
self
.
missingResidues
:
templateAtoms
=
[
atom
for
atom
in
templateAtoms
if
atom
.
name
not
in
(
'P'
,
'OP1'
,
'OP2'
)]
# Add atoms from the template that are missing.
# Add atoms from the template that are missing.
missing
=
[]
missing
=
[]
for
atom
in
template
.
topology
.
atoms
()
:
for
atom
in
template
Atoms
:
if
atom
.
name
not
in
atomNames
:
if
atom
.
name
not
in
atomNames
:
missing
.
append
(
atom
)
missing
.
append
(
atom
)
if
len
(
missing
)
>
0
:
if
len
(
missing
)
>
0
:
...
@@ -420,7 +425,6 @@ class PDBFixer(object):
...
@@ -420,7 +425,6 @@ class PDBFixer(object):
if
nearest
>=
0.15
:
if
nearest
>=
0.15
:
break
break
context
.
setState
(
state
)
context
.
setState
(
state
)
mm
.
LocalEnergyMinimizer
.
minimize
(
context
)
state
=
context
.
getState
(
getPositions
=
True
)
state
=
context
.
getState
(
getPositions
=
True
)
# Now create a new Topology, including all atoms from the original one and adding the missing atoms.
# Now create a new Topology, including all atoms from the original one and adding the missing atoms.
...
@@ -523,6 +527,7 @@ class PDBFixer(object):
...
@@ -523,6 +527,7 @@ class PDBFixer(object):
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
if
len
(
sys
.
argv
)
<
2
:
if
len
(
sys
.
argv
)
<
2
:
import
ui
ui
.
launchUI
()
ui
.
launchUI
()
else
:
else
:
fixer
=
PDBFixer
(
PdbStructure
(
open
(
sys
.
argv
[
1
])))
fixer
=
PDBFixer
(
PdbStructure
(
open
(
sys
.
argv
[
1
])))
...
...
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