Exemplo n.º 1
0
        self.planeD2 = planeD2
        self.planeD3 = planeD3

    def measure(self, structure):
        try:
            point = lookup(self.pointD, structure).center
            plane1 = lookup(self.planeD1, structure).center
            plane2 = lookup(self.planeD2, structure).center
            plane3 = lookup(self.planeD3, structure).center
            return signedPointPlaneDistance(point, plane1, plane2, plane3)
        except AttributeError, ae:
            print str(ae)    

filename = sys.argv[1]
pdbdir = sys.argv[2]

def parse(line):
    pdbid, chain, start, stop = line.split(".")
    return ExampleDescription(pdbid, chain, start, stop)

metal = constructSelection(chainType="Ligand", residuePosition=1, atomName="CA")
o1 = constructSelection(chainType="Protein", residuePosition=1, atomName="O")
o2 = constructSelection(chainType="Protein", residuePosition=3, atomName="O")
o3 = constructSelection(chainType="Protein", residuePosition=6, atomName="O")
measure = PointPlaneDistanceMeasure(metal, o1, o2, o3)

for e in generateExamples(filename, pdbdir, parse):
    # XXX hack!
    print measure.measure(e[0][0])

Exemplo n.º 2
0
            print str(ae)    

filename = sys.argv[1]
pdbdir = sys.argv[2]

def parse(line):
    bits = line.split("\t")
    pdbid, chain = bits[0].split(".")
    start, stop = bits[1].split("-")
    ligands = eval(bits[-1])
    for lig in ligands:
        name = lig[0:3]
        if name == "HOH":
            ligand_num = lig[3:]
            break
    return ExampleDescription(pdbid, chain, start, stop, ligand_num)

hoh = constructSelection(chainType="Water", residuePosition=1, atomName="O")
o1 = constructSelection(chainType="Protein", residuePosition=1, atomName="O")
o2 = constructSelection(chainType="Protein", residuePosition=2, atomName="O")
o3 = constructSelection(chainType="Protein", residuePosition=3, atomName="O")
measure = OXOMeasure(hoh, o1, o2, o3)

for e in generateExamples(filename, pdbdir, parse):
    try:
        # XXX hack!
        print "%s\t%s\t%s" % (e, e[0][0].residueRange, measure.measure(e))
    except Exception, ex:
        sys.stderr.write("%s in %s\n" % (str(ex), e))

Exemplo n.º 3
0
# test the list reader

import sys
from Tailor.Engine import TmpDistanceMeasure, constructSelection
from Tailor.Description import ChainDescription
from Tailor.ResultParser import ExampleDescription, generateExamples

filename = sys.argv[1]
pdbdir = sys.argv[2]


def parse(line):
    pdbid, chain, start, stop = line.split(".")
    return ExampleDescription(pdbid, chain, start, stop)


abstractDescription = ChainDescription({"chainID": " "})
abstractDescription.createResidues(3)

o = constructSelection(residuePosition=1, atomName="O")
n = constructSelection(residuePosition=3, atomName="N")
measures = [TmpDistanceMeasure(o, n)]

for e in generateExamples(filename, pdbdir, parse):
    for measure in measures:
        # XXX hack!
        print measure.measure(e[0][0])