Commit 00469843 by John Chodera (MSKCC)

Updated tests to use URL download.

parent 19e9c1f4
language: c
install:
- 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 conda init
- conda config --add channels http://conda.binstar.org/omnia
......
......@@ -4,57 +4,61 @@ from pdbfixer.pdbfixer import *
import os
import sys
# 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.
pdblist = PDBList()
for pdbcode in pdbcodes:
try:
input_pdb_filename = pdblist.retrieve_pdb_file(pdbcode, pdir='.')
except:
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-'
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
# Set up PDB retrieval.
pdblist = PDBList(server=PDBList.alternative_download_url)
success = True
for pdbcode in pdbcodes:
try:
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-'
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)
success = False
if not success:
raise Exception("build test failed on one or more PDB files.")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment