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
8d902d07
Commit
8d902d07
authored
Sep 17, 2013
by
Peter Eastman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added option to download files directly from RCSB
parent
72f2ac89
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
4 deletions
+47
-4
html/addHydrogens.html
+1
-1
html/error.html
+9
-0
html/start.html
+22
-2
ui.py
+15
-1
No files found.
html/addHydrogens.html
View file @
8d902d07
...
@@ -18,7 +18,7 @@ A heterogen is any residue other than a standard amino acid or nucleotide. Do y
...
@@ -18,7 +18,7 @@ A heterogen is any residue other than a standard amino acid or nucleotide. Do y
<option
value=
"water"
>
Delete heterogens except water
</option>
<option
value=
"water"
>
Delete heterogens except water
</option>
<option
value=
"none"
>
Delete all heterogens
</option>
<option
value=
"none"
>
Delete all heterogens
</option>
</select>
</select>
<h1>
Add Missing Hyrogens
</h1>
<h1>
Add Missing Hy
d
rogens
</h1>
Add missing hydrogen atoms?
Add missing hydrogen atoms?
<p>
<p>
<input
type=
"checkbox"
id=
"addCheckbox"
name=
"add"
checked
>
Add hydrogens appropriate for pH
<input
type=
"text"
id=
"phfield"
name=
"ph"
value=
"7.0"
size=
"5"
>
<input
type=
"checkbox"
id=
"addCheckbox"
name=
"add"
checked
>
Add hydrogens appropriate for pH
<input
type=
"text"
id=
"phfield"
name=
"ph"
value=
"7.0"
size=
"5"
>
...
...
html/error.html
0 → 100644
View file @
8d902d07
<p>
<form
method=
"post"
action=
"/controls"
>
<input
type=
"submit"
name=
"newfile"
value=
"Start Over"
/>
</form>
<script>
setCurrentStep
(
1
)
</script>
</body>
<html>
html/start.html
View file @
8d902d07
<script>
function
enableInputs
()
{
if
(
document
.
getElementById
(
"localtype"
).
checked
)
{
document
.
getElementById
(
"pdbfile"
).
disabled
=
false
;
document
.
getElementById
(
"pdbid"
).
disabled
=
true
;
document
.
getElementById
(
"submit"
).
disabled
=
(
document
.
getElementById
(
"pdbfile"
).
value
==
""
);
}
else
{
document
.
getElementById
(
"pdbfile"
).
disabled
=
true
;
document
.
getElementById
(
"pdbid"
).
disabled
=
false
;
document
.
getElementById
(
"submit"
).
disabled
=
(
document
.
getElementById
(
"pdbid"
).
value
.
length
!=
4
);
}
}
</script>
<h1>
Welcome To PDBFixer!
</h1>
<h1>
Welcome To PDBFixer!
</h1>
Select a PDB file to load. It will be analyzed for problems.
Select a PDB file to load. It will be analyzed for problems.
<p>
<p>
<form
method=
"post"
action=
"/"
enctype=
"multipart/form-data"
>
<form
method=
"post"
action=
"/"
enctype=
"multipart/form-data"
>
PDB File:
<input
type=
"file"
name=
"pdbfile"
onchange=
"document.getElementById('submit').disabled=false;"
/>
<input
type=
"radio"
name=
"type"
id=
"localtype"
value=
"local"
onchange=
"enableInputs()"
checked
>
Load a local file
<p>
<p
style=
"margin-left:50px"
>
PDB File:
<input
type=
"file"
id=
"pdbfile"
name=
"pdbfile"
onchange=
"enableInputs()"
/>
</p>
<input
type=
"radio"
name=
"type"
id=
"remotetype"
value=
"remote"
onchange=
"enableInputs()"
>
Download a file from RCSB
<p
style=
"margin-left:50px"
>
PDB Identifier:
<input
type=
"text"
id=
"pdbid"
name=
"pdbid"
size=
"4"
onchange=
"enableInputs()"
onkeyup=
"enableInputs()"
oninput=
"enableInputs()"
disabled
>
</p>
<input
type=
"submit"
id=
"submit"
value=
"Analyze File"
disabled
/>
<input
type=
"submit"
id=
"submit"
value=
"Analyze File"
disabled
/>
</form>
</form>
<script>
<script>
...
...
ui.py
View file @
8d902d07
...
@@ -4,6 +4,8 @@ from pdbfixer import PDBFixer, substitutions, proteinResidues, dnaResidues, rnaR
...
@@ -4,6 +4,8 @@ from pdbfixer import PDBFixer, substitutions, proteinResidues, dnaResidues, rnaR
import
uiserver
import
uiserver
import
webbrowser
import
webbrowser
import
os.path
import
os.path
import
urllib2
import
gzip
from
cStringIO
import
StringIO
from
cStringIO
import
StringIO
def
loadHtmlFile
(
name
):
def
loadHtmlFile
(
name
):
...
@@ -19,11 +21,23 @@ def controlsCallback(parameters, handler):
...
@@ -19,11 +21,23 @@ def controlsCallback(parameters, handler):
uiserver
.
server
.
shutdown
()
uiserver
.
server
.
shutdown
()
def
startPageCallback
(
parameters
,
handler
):
def
startPageCallback
(
parameters
,
handler
):
if
'pdbfile'
in
parameters
:
global
fixer
global
fixer
if
'type'
in
parameters
:
if
parameters
.
getfirst
(
'type'
)
==
'local'
:
pdb
=
PdbStructure
(
parameters
[
'pdbfile'
]
.
value
.
splitlines
())
pdb
=
PdbStructure
(
parameters
[
'pdbfile'
]
.
value
.
splitlines
())
fixer
=
PDBFixer
(
pdb
)
fixer
=
PDBFixer
(
pdb
)
displayDeleteChainsPage
()
displayDeleteChainsPage
()
else
:
id
=
parameters
.
getfirst
(
'pdbid'
)
url
=
"ftp://ftp.wwpdb.org/pub/pdb/data/structures/all/pdb/pdb"
+
id
.
lower
()
+
".ent.gz"
try
:
response
=
urllib2
.
urlopen
(
url
)
content
=
gzip
.
GzipFile
(
fileobj
=
StringIO
(
response
.
read
()))
.
read
()
pdb
=
PdbStructure
(
content
.
splitlines
())
fixer
=
PDBFixer
(
pdb
)
displayDeleteChainsPage
()
except
:
handler
.
sendResponse
(
header
+
"Unable to download the PDB file. This may indicate an invalid PDB identifier, or an error in network connectivity."
+
loadHtmlFile
(
"error.html"
))
def
deleteChainsPageCallback
(
parameters
,
handler
):
def
deleteChainsPageCallback
(
parameters
,
handler
):
numChains
=
len
(
list
(
fixer
.
topology
.
chains
()))
numChains
=
len
(
list
(
fixer
.
topology
.
chains
()))
...
...
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