Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
61cb61fd
Commit
61cb61fd
authored
Sep 17, 2013
by
peastman
Browse files
PdbStructure records MODRES records
parent
933f2688
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
wrappers/python/simtk/openmm/app/internal/pdbstructure.py
wrappers/python/simtk/openmm/app/internal/pdbstructure.py
+12
-1
No files found.
wrappers/python/simtk/openmm/app/internal/pdbstructure.py
View file @
61cb61fd
...
...
@@ -8,7 +8,7 @@ Simbios, the NIH National Center for Physics-Based Simulation of
Biological Structures at Stanford, funded under the NIH Roadmap for
Medical Research, grant U54 GM072970. See https://simtk.org.
Portions copyright (c) 2012 Stanford University and the Authors.
Portions copyright (c) 2012
-2013
Stanford University and the Authors.
Authors: Christopher M. Bruns
Contributors: Peter Eastman
...
...
@@ -139,6 +139,7 @@ class PdbStructure(object):
self
.
models_by_number
=
{}
self
.
_unit_cell_dimensions
=
None
self
.
sequences
=
[]
self
.
modified_residues
=
[]
# read file
self
.
_load
(
input_stream
)
...
...
@@ -178,6 +179,8 @@ class PdbStructure(object):
if
len
(
self
.
sequences
)
==
0
or
chain_id
!=
self
.
sequences
[
-
1
].
chain_id
:
self
.
sequences
.
append
(
Sequence
(
chain_id
))
self
.
sequences
[
-
1
].
residues
.
extend
(
pdb_line
[
19
:].
split
())
elif
(
pdb_line
.
find
(
"MODRES"
)
==
0
):
self
.
modified_residues
.
append
(
ModifiedResidue
(
pdb_line
[
16
],
int
(
pdb_line
[
18
:
22
]),
pdb_line
[
12
:
15
],
pdb_line
[
24
:
27
]))
self
.
_finalize
()
def
write
(
self
,
output_stream
=
sys
.
stdout
):
...
...
@@ -278,6 +281,14 @@ class Sequence(object):
self
.
chain_id
=
chain_id
self
.
residues
=
[]
class
ModifiedResidue
(
object
):
"""ModifiedResidue holds information about a modified residue, as specified by a MODRES record."""
def
__init__
(
self
,
chain_id
,
number
,
residue_name
,
standard_name
):
self
.
chain_id
=
chain_id
self
.
number
=
number
self
.
residue_name
=
residue_name
self
.
standard_name
=
standard_name
class
Model
(
object
):
"""Model holds one model of a PDB structure.
...
...
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