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
00469843
Commit
00469843
authored
Mar 28, 2014
by
John Chodera (MSKCC)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated tests to use URL download.
parent
19e9c1f4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
55 deletions
+59
-55
.travis.yml
+1
-1
tests/test_build.py
+58
-54
No files found.
.travis.yml
View file @
00469843
language
:
c
language
:
c
install
:
install
:
-
sudo apt-get update -qq
-
sudo apt-get update -qq
-
sudo apt-get install -qq python-dev python-pip python-yaml g++
-
sudo apt-get install -qq python-dev python-pip python-yaml g++
ftp
-
sudo pip install conda
-
sudo pip install conda
-
sudo conda init
-
sudo conda init
-
conda config --add channels http://conda.binstar.org/omnia
-
conda config --add channels http://conda.binstar.org/omnia
...
...
tests/test_build.py
View file @
00469843
...
@@ -4,57 +4,61 @@ from pdbfixer.pdbfixer import *
...
@@ -4,57 +4,61 @@ from pdbfixer.pdbfixer import *
import
os
import
os
import
sys
import
sys
# These are tough PDB codes from http://www.umass.edu/microbio/chime/pe_beta/pe/protexpl/badpdbs.htm
def
test_build
():
pdbcodes
=
[
'1AS5'
,
'1CBN'
,
'1DPO'
,
'1IGY'
,
'1HAG'
,
'1IAO'
,
'4CPA'
,
'1QCQ'
]
# 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'
]
# Set up PDB retrieval.
pdbcodes
=
[
'1VII'
]
# DEBUG
pdblist
=
PDBList
()
# Set up PDB retrieval.
for
pdbcode
in
pdbcodes
:
pdblist
=
PDBList
(
server
=
PDBList
.
alternative_download_url
)
try
:
input_pdb_filename
=
pdblist
.
retrieve_pdb_file
(
pdbcode
,
pdir
=
'.'
)
success
=
True
except
:
print
"Could not download PDB code '
%
s'"
%
pdbcode
for
pdbcode
in
pdbcodes
:
continue
try
:
input_pdb_filename
=
pdblist
.
retrieve_pdb_file
(
pdbcode
,
pdir
=
'.'
)
output_pdb_filename
=
'output.pdb'
except
Exception
as
e
:
print
str
(
e
)
# PDB setup parameters.
print
"Could not download PDB code '
%
s'"
%
pdbcode
# TODO: Try several combinations?
continue
pH
=
7.0
ionic
=
50.0
*
unit
.
millimolar
output_pdb_filename
=
'output.pdb'
box
=
10.0
*
unit
.
angstrom
positiveIon
=
'Na+'
# PDB setup parameters.
negativeIon
=
'Cl-'
# TODO: Try several combinations?
pH
=
7.0
print
"Running PDBFixer..."
ionic
=
50.0
*
unit
.
millimolar
infile
=
open
(
input_pdb_filename
)
box
=
10.0
*
unit
.
angstrom
outfile
=
open
(
output_pdb_filename
,
'w'
)
positiveIon
=
'Na+'
negativeIon
=
'Cl-'
try
:
fixer
=
PDBFixer
(
PdbStructure
(
infile
))
print
"Running PDBFixer..."
fixer
.
findMissingResidues
()
infile
=
open
(
input_pdb_filename
)
fixer
.
findNonstandardResidues
()
outfile
=
open
(
output_pdb_filename
,
'w'
)
fixer
.
replaceNonstandardResidues
()
fixer
.
findMissingAtoms
()
try
:
fixer
.
addMissingAtoms
()
fixer
=
PDBFixer
(
PdbStructure
(
infile
))
fixer
.
removeHeterogens
(
False
)
fixer
.
findMissingResidues
()
fixer
.
addMissingHydrogens
(
pH
)
fixer
.
findNonstandardResidues
()
#fixer.addSolvent(box*unit.nanometer, positiveIon, negativeIon, ionic*unit.molar)
fixer
.
replaceNonstandardResidues
()
app
.
PDBFile
.
writeFile
(
fixer
.
topology
,
fixer
.
positions
,
outfile
)
fixer
.
findMissingAtoms
()
infile
.
close
()
fixer
.
addMissingAtoms
()
outfile
.
close
()
fixer
.
removeHeterogens
(
False
)
fixer
.
addMissingHydrogens
(
pH
)
# Delete input file.
#fixer.addSolvent(box*unit.nanometer, positiveIon, negativeIon, ionic*unit.molar)
os
.
remove
(
input_pdb_filename
)
app
.
PDBFile
.
writeFile
(
fixer
.
topology
,
fixer
.
positions
,
outfile
)
os
.
remove
(
output_pdb_filename
)
infile
.
close
()
outfile
.
close
()
except
Exception
as
e
:
print
str
(
e
)
# Delete input file.
sys
.
exit
(
1
)
os
.
remove
(
input_pdb_filename
)
os
.
remove
(
output_pdb_filename
)
# Signal success.
except
Exception
as
e
:
sys
.
exit
(
0
)
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