Commit 00469843 by John Chodera (MSKCC)

Updated tests to use URL download.

parent 19e9c1f4
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
......
...@@ -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.")
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