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
fc191ebd
Commit
fc191ebd
authored
Mar 28, 2014
by
John Chodera (MSKCC)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed debug code.
parent
f902ca3d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
62 deletions
+63
-62
.travis.yml
+2
-3
tests/test_build.py
+2
-15
tests/test_simulate.py
+59
-44
No files found.
.travis.yml
View file @
fc191ebd
...
...
@@ -10,9 +10,8 @@ install:
script
:
-
python setup.py install
# - nosetests tests/test_build.py
# - nosetests tests/test_simulate.py
-
python tests/test_build.py
-
nosetests tests/test_build.py
-
nosetests tests/test_simulate.py
after_script
:
-
pyflakes pdbfixer/*.py
...
...
tests/test_build.py
View file @
fc191ebd
...
...
@@ -7,7 +7,7 @@ import sys
def
test_build
():
# These are tough PDB codes from http://www.umass.edu/microbio/chime/pe_beta/pe/protexpl/badpdbs.htm
pdbcodes
=
[
'1AS5'
,
'1CBN'
,
'1DPO'
,
'1IGY'
,
'1HAG'
,
'1IAO'
,
'4CPA'
,
'1QCQ'
]
pdbcodes
=
[
'1VII'
]
# DEBUG
pdbcodes
=
[
'1VII'
]
# DEBUG
: just use one
# Set up PDB retrieval.
pdblist
=
PDBList
(
server
=
PDBList
.
alternative_download_url
)
...
...
@@ -35,34 +35,22 @@ def test_build():
positiveIon
=
'Na+'
negativeIon
=
'Cl-'
print
"Running PDBFixer..."
infile
=
open
(
input_pdb_filename
)
outfile
=
open
(
output_pdb_filename
,
'w'
)
try
:
print
"Creating PDBFixer..."
fixer
=
PDBFixer
(
PdbStructure
(
infile
))
print
"Finding missing residues..."
fixer
.
findMissingResidues
()
print
"Finding nonstandard residues..."
fixer
.
findNonstandardResidues
()
print
"Replacing nonstandard residues..."
fixer
.
replaceNonstandardResidues
()
print
"Finding missing atoms..."
fixer
.
findMissingAtoms
()
print
"Adding missing atoms..."
fixer
.
addMissingAtoms
()
print
"Removing heterogens..."
fixer
.
removeHeterogens
(
False
)
print
"Adding missing hydrogens..."
fixer
.
addMissingHydrogens
(
pH
)
#fixer.addSolvent(box*unit.nanometer, positiveIon, negativeIon, ionic*unit.molar)
print
"Writing PDB file..."
app
.
PDBFile
.
writeFile
(
fixer
.
topology
,
fixer
.
positions
,
outfile
)
infile
.
close
()
outfile
.
close
()
print
"Done."
fg
# Delete input file.
os
.
remove
(
input_pdb_filename
)
...
...
@@ -74,5 +62,4 @@ def test_build():
if
not
success
:
raise
Exception
(
"build test failed on one or more PDB files."
)
test_build
()
tests/test_simulate.py
View file @
fc191ebd
...
...
@@ -4,47 +4,62 @@ from pdbfixer.pdbfixer import *
import
os
import
sys
pdbcodes
=
[
'1PGB'
,
'1VII'
]
for
pdbcode
in
pdbcodes
:
pdblist
=
PDBList
()
input_pdb_filename
=
pdblist
.
retrieve_pdb_file
(
pdbcode
,
pdir
=
'.'
)
output_pdb_filename
=
'output.pdb'
pH
=
7.0
ionic
=
50.0
*
unit
.
millimolar
box
=
10.0
*
unit
.
angstrom
positiveIon
=
'Na+'
negativeIon
=
'Cl-'
print
"Running PDBFixer..."
infile
=
open
(
input_pdb_filename
)
outfile
=
open
(
output_pdb_filename
,
'w'
)
try
:
fixer
=
PDBFixer
(
PdbStructure
(
infile
))
fixer
.
findMissingResidues
()
fixer
.
findNonstandardResidues
()
fixer
.
replaceNonstandardResidues
()
fixer
.
findMissingAtoms
()
fixer
.
addMissingAtoms
()
fixer
.
removeHeterogens
(
False
)
fixer
.
addMissingHydrogens
(
pH
)
#fixer.addSolvent(box*unit.nanometer, positiveIon, negativeIon, ionic*unit.molar)
app
.
PDBFile
.
writeFile
(
fixer
.
topology
,
fixer
.
positions
,
outfile
)
infile
.
close
()
outfile
.
close
()
# Delete input file.
os
.
remove
(
input_pdb_filename
)
os
.
remove
(
output_pdb_filename
)
except
Exception
as
e
:
print
str
(
e
)
sys
.
exit
(
1
)
# Signal success.
sys
.
exit
(
0
)
def
test_build
():
# These are tough PDB codes from http://www.umass.edu/microbio/chime/pe_beta/pe/protexpl/badpdbs.htm
pdbcodes
=
[
'1AS5'
,
'1CBN'
,
'1DPO'
,
'1IGY'
,
'1HAG'
,
'1IAO'
,
'4CPA'
,
'1QCQ'
]
pdbcodes
=
[
'1VII'
]
# DEBUG: just use one
# Set up PDB retrieval.
pdblist
=
PDBList
(
server
=
PDBList
.
alternative_download_url
)
success
=
True
for
pdbcode
in
pdbcodes
:
print
pdbcode
try
:
print
"Attempting to retrieve PDB code '
%
s' from
%
s..."
%
(
pdbcode
,
PDBList
.
alternative_download_url
)
input_pdb_filename
=
pdblist
.
retrieve_pdb_file
(
pdbcode
,
pdir
=
'.'
)
except
Exception
as
e
:
print
str
(
e
)
print
"Could not download PDB code '
%
s'"
%
pdbcode
continue
output_pdb_filename
=
'output.pdb'
# PDB setup parameters.
# TODO: Try several combinations?
pH
=
7.0
ionic
=
50.0
*
unit
.
millimolar
box
=
10.0
*
unit
.
angstrom
positiveIon
=
'Na+'
negativeIon
=
'Cl-'
infile
=
open
(
input_pdb_filename
)
outfile
=
open
(
output_pdb_filename
,
'w'
)
try
:
fixer
=
PDBFixer
(
PdbStructure
(
infile
))
fixer
.
findMissingResidues
()
fixer
.
findNonstandardResidues
()
fixer
.
replaceNonstandardResidues
()
fixer
.
findMissingAtoms
()
fixer
.
addMissingAtoms
()
fixer
.
removeHeterogens
(
False
)
fixer
.
addMissingHydrogens
(
pH
)
#fixer.addSolvent(box*unit.nanometer, positiveIon, negativeIon, ionic*unit.molar)
app
.
PDBFile
.
writeFile
(
fixer
.
topology
,
fixer
.
positions
,
outfile
)
infile
.
close
()
outfile
.
close
()
# Delete input file.
os
.
remove
(
input_pdb_filename
)
os
.
remove
(
output_pdb_filename
)
except
Exception
as
e
:
print
str
(
e
)
success
=
False
if
not
success
:
raise
Exception
(
"build test failed on one or more PDB files."
)
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