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
892470c1
Commit
892470c1
authored
Sep 05, 2013
by
Peter Eastman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preliminary support for adding missing residues
parent
f8d71ec9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
18 deletions
+15
-18
pdbfixer.py
+0
-0
ui.py
+15
-18
No files found.
pdbfixer.py
View file @
892470c1
This diff is collapsed.
Click to expand it.
ui.py
View file @
892470c1
import
simtk.openmm.app
as
app
from
simtk.openmm.app.internal.pdbstructure
import
PdbStructure
from
pdbfixer
import
PDBFixer
,
substitutions
import
uiserver
import
webbrowser
...
...
@@ -7,19 +8,17 @@ from cStringIO import StringIO
def
startPageCallback
(
parameters
,
handler
):
if
'pdbfile'
in
parameters
:
global
fixer
pdb
=
app
.
PDBFil
e
(
parameters
[
'pdbfile'
]
.
value
.
splitlines
())
pdb
=
PdbStructur
e
(
parameters
[
'pdbfile'
]
.
value
.
splitlines
())
fixer
=
PDBFixer
(
pdb
)
displayConvertResiduesPage
()
def
convertResiduesPageCallback
(
parameters
,
handler
):
global
nonstandard
nonstandard
=
[
residue
for
i
,
residue
in
enumerate
(
nonstandard
)
if
'convert'
+
str
(
i
)
in
parameters
]
fixer
.
replaceNonstandardResidues
(
nonstandard
)
nonstandard
=
[]
fixer
.
nonstandardResidues
=
[
residue
for
i
,
residue
in
enumerate
(
fixer
.
nonstandardResidues
)
if
'convert'
+
str
(
i
)
in
parameters
]
fixer
.
replaceNonstandardResidues
()
displayMissingAtomsPage
()
def
missingAtomsPageCallback
(
parameters
,
handler
):
fixer
.
addMissingAtoms
(
missingAtoms
,
missingTerminals
)
fixer
.
addMissingAtoms
()
displayDownloadPage
()
def
downloadPageCallback
(
parameters
,
handler
):
...
...
@@ -50,9 +49,9 @@ PDB File: <input type="file" name="pdbfile"/>
def
displayConvertResiduesPage
():
uiserver
.
setCallback
(
convertResiduesPageCallback
)
global
nonstandard
nonstandard
=
fixer
.
findNonstandardResidues
()
if
len
(
nonstandard
)
==
0
:
fixer
.
findMissingResidues
()
fixer
.
findNonstandardResidues
()
if
len
(
fixer
.
nonstandardResidues
)
==
0
:
displayMissingAtomsPage
()
return
indexInChain
=
{}
...
...
@@ -60,7 +59,7 @@ def displayConvertResiduesPage():
for
i
,
residue
in
enumerate
(
chain
.
residues
()):
indexInChain
[
residue
]
=
i
+
1
table
=
""
for
i
,
residue
in
enumerate
(
nonstandard
):
for
i
,
residue
in
enumerate
(
fixer
.
nonstandardResidues
):
table
+=
' <tr><td>
%
d</td><td>
%
s
%
d</td><td>
%
s</td><td><input type="checkbox" name="convert
%
d" checked></td></tr>
\n
'
%
(
residue
.
chain
.
index
+
1
,
residue
.
name
,
indexInChain
[
residue
],
substitutions
[
residue
.
name
],
i
)
uiserver
.
setContent
(
"""
<html>
...
...
@@ -82,10 +81,8 @@ This PDB file contains non-standard residues. Do you want to convert them to th
def
displayMissingAtomsPage
():
uiserver
.
setCallback
(
missingAtomsPageCallback
)
global
missingAtoms
global
missingTerminals
missingAtoms
,
missingTerminals
=
fixer
.
findMissingAtoms
()
allResidues
=
list
(
set
(
missingAtoms
.
iterkeys
())
.
union
(
missingTerminals
.
iterkeys
()))
fixer
.
findMissingAtoms
()
allResidues
=
list
(
set
(
fixer
.
missingAtoms
.
iterkeys
())
.
union
(
fixer
.
missingTerminals
.
iterkeys
()))
allResidues
.
sort
(
key
=
lambda
x
:
x
.
index
)
if
len
(
allResidues
)
==
0
:
displayDownloadPage
()
...
...
@@ -97,10 +94,10 @@ def displayMissingAtomsPage():
table
=
""
for
residue
in
allResidues
:
atoms
=
[]
if
residue
in
missingAtoms
:
atoms
.
extend
(
atom
.
name
for
atom
in
missingAtoms
[
residue
])
if
residue
in
missingTerminals
:
atoms
.
extend
(
atom
for
atom
in
missingTerminals
[
residue
])
if
residue
in
fixer
.
missingAtoms
:
atoms
.
extend
(
atom
.
name
for
atom
in
fixer
.
missingAtoms
[
residue
])
if
residue
in
fixer
.
missingTerminals
:
atoms
.
extend
(
atom
for
atom
in
fixer
.
missingTerminals
[
residue
])
table
+=
' <tr><td>
%
d</td><td>
%
s
%
d</td><td>
%
s</td></tr>
\n
'
%
(
residue
.
chain
.
index
+
1
,
residue
.
name
,
indexInChain
[
residue
],
', '
.
join
(
atoms
))
uiserver
.
setContent
(
"""
<html>
...
...
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