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
5719a05d
Commit
5719a05d
authored
Sep 05, 2013
by
peastman
Browse files
PdbStructure records SEQRES records
parent
30b4cf1c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
wrappers/python/simtk/openmm/app/internal/pdbstructure.py
wrappers/python/simtk/openmm/app/internal/pdbstructure.py
+13
-0
wrappers/python/simtk/openmm/app/pdbfile.py
wrappers/python/simtk/openmm/app/pdbfile.py
+7
-4
No files found.
wrappers/python/simtk/openmm/app/internal/pdbstructure.py
View file @
5719a05d
...
...
@@ -138,6 +138,7 @@ class PdbStructure(object):
self
.
default_model
=
None
self
.
models_by_number
=
{}
self
.
_unit_cell_dimensions
=
None
self
.
sequences
=
[]
# read file
self
.
_load
(
input_stream
)
...
...
@@ -172,6 +173,11 @@ class PdbStructure(object):
except
:
pass
self
.
_current_model
.
connects
.
append
(
atoms
)
elif
(
pdb_line
.
find
(
"SEQRES"
)
==
0
):
chain_id
=
pdb_line
[
11
]
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
())
self
.
_finalize
()
def
write
(
self
,
output_stream
=
sys
.
stdout
):
...
...
@@ -266,6 +272,13 @@ class PdbStructure(object):
return
self
.
_unit_cell_dimensions
class
Sequence
(
object
):
"""Sequence holds the sequence of a chain, as specified by SEQRES records."""
def
__init__
(
self
,
chain_id
):
self
.
chain_id
=
chain_id
self
.
residues
=
[]
class
Model
(
object
):
"""Model holds one model of a PDB structure.
...
...
wrappers/python/simtk/openmm/app/pdbfile.py
View file @
5719a05d
...
...
@@ -70,6 +70,9 @@ class PDBFile(object):
# Load the PDB file
if
isinstance
(
file
,
PdbStructure
):
pdb
=
file
else
:
inputfile
=
file
if
isinstance
(
file
,
str
):
inputfile
=
open
(
file
)
...
...
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