Commit a2c8f4e9 authored by d-alvarez's avatar d-alvarez

Added error checking in sdtether and sdrmsd

parent 4edd6f45
......@@ -127,12 +127,16 @@ def updateCoords(obmol, newcoords):
if __name__ == "__main__":
import sys
import sys, os
(opts, args) = parseArguments()
xtal = args[0]
poses = args[1]
if not os.path.exists(xtal) or not os.path.exists(poses):
sys.exit("Input files not found. Please check the path given is correct.")
fit = opts.fit
outfname = opts.outfilename
......
......@@ -143,6 +143,9 @@ if __name__ == "__main__":
refMatchIds = smarts.findall(ref)
numRefMatchs = len(refMatchIds)
if not numRefMatchs:
sys.exit("No match found in the reference structure and the SMARTS string given. Please check it.")
if numRefMatchs > 1:
print "More than one match in the reference molecule for the SMARTS string given. Will tether each input molecule all possible ways."
......@@ -157,18 +160,18 @@ if __name__ == "__main__":
molSupp = pybel.readfile("sdf", molsdf)
ff = pybel.ob.OBForceField_FindForceField('MMFF94')
for i,mol in enumerate(molSupp):
print "## Molecule %i"%(i+1)
print "## Molecule %i"%(i+1),
mol.OBMol.DeleteNonPolarHydrogens()
molMatchAllIds = smarts.findall(mol)
numMatchs = len(molMatchAllIds)
if numMatchs == 0:
print "No match"
print "No_Match",
continue
elif numMatchs ==1:
print "Match"
print "Match",
elif numMatchs > 1:
print "Multiple SMART Matches for this molecule (%d)"%numMatchs
print "Multiple_Match SMART Matches for this molecule (%d)"%numMatchs,
# If more than one match, write an output of the same molecule for each match
# Start a default bestcoord and rmsd for later looping for each pose
......
......@@ -326,7 +326,7 @@ SOURCES = ../import/simplex/src/NMSearch.cxx \
../src/lib/RbtVdwIntraSF.cxx \
../src/lib/RbtVdwSF.cxx \
../src/lib/RbtWorkSpace.cxx
VERSION = rDock_2013.1_src
VERSION = rdock-code.0
INCLUDEPATH = ../include;../include/GP;../import/simplex/include;../import/tnt/include
DEPENDPATH = $INCLUDEPATH
DEFINES += _NDEBUG
......
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