Beispiel #1
0
import sys

from Tailor.Description import ChainDescription 
from Tailor.Measure import DistanceMeasure
from Tailor.Run import Run, Pipe

path = sys.argv[1]

catmat3 = ChainDescription({"chainID" : "c3"})
catmat3.createResidues(4)

for i in range(1, 5):
    print(catmat3.getResidue(i).children.pop())

catmat3.createPhiBoundCondition(2,  -85, 45)
catmat3.createPsiBoundCondition(2,   -5, 45)
catmat3.createPhiBoundCondition(3,  -70, 40)
catmat3.createPsiBoundCondition(3,  135, 45)

measures3 = []
measures3.extend(catmat3.createPhiPsiMeasures([2, 3]))

catmat4 = ChainDescription({"chainID" : "c4"})
catmat4.createResidues(5)

for i in range(1, 6):
    print(catmat4.getResidue(i).children.pop())

catmat4.createPhiBoundCondition(2,  -75, 45)
catmat4.createPsiBoundCondition(2,  -15, 45)
catmat4.createPhiBoundCondition(3,  -95, 45)
Beispiel #2
0
import sys

from Tailor.Condition import HBondCondition, NoneCombiner
from Tailor.Description import ChainDescription, AtomDescription
from Tailor.Measure import PropertyMeasure, DistanceMeasure
from Tailor.Run import Run, Pipe

path = sys.argv[1]

maxHO = 3.5
minHOC = 90.0
minNHO = 90.0

helixTerm = ChainDescription({"chainID" : "h"})
helixTerm.createResidues(9)
helixTerm.createBackboneHBondCondition(6, 2, maxHO, minHOC, minNHO)
helixTerm.createBackboneHBondCondition(7, 3, maxHO, minHOC, minNHO)

helixTerm.getResidue(8).addPropertyCondition("resname", "PRO")
helixTerm.getResidue(8).children.pop()
helixTerm.getResidue(8).children.append(AtomDescription({"name" : "2HD"}))

measures = []
measures.extend(helixTerm.createPhiPsiMeasures([6, 7, 8]))
o = helixTerm.selectResidue(5).selectAtom("O")
h = helixTerm.selectResidue(8).selectAtom("2HD")
measures.append(DistanceMeasure(o, h))
pipes = [Pipe(helixTerm, measures, sys.stdout)]
run = Run(pipes, path)
run.run()
Beispiel #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])
Beispiel #4
0
import sys

from Tailor.Description import ChainDescription 
from Tailor.Measure import DistanceMeasure
from Tailor.Run import Run, Pipe

path = sys.argv[1]

rlNest = ChainDescription({"chainID" : "RL"})
rlNest.createResidues(4)

for i in range(1, 5):
    print(rlNest.getResidue(i).children.pop())

rlNest.createPhiBoundCondition(2, -90, 45)
rlNest.createPsiBoundCondition(2,   0, 45)
rlNest.createPhiBoundCondition(3,  80, 45)
rlNest.createPsiBoundCondition(3,  10, 45)

measuresRL = []
measuresRL.extend(rlNest.createPhiPsiMeasures([2, 3]))

lrNest = ChainDescription({"chainID" : "LR"})
lrNest.createResidues(4)

for i in range(1, 5):
    print(lrNest.getResidue(i).children.pop())

lrNest.createPhiBoundCondition(2,  80, 45)
lrNest.createPsiBoundCondition(2,  10, 45)
lrNest.createPhiBoundCondition(3, -90, 45)
import sys

from Tailor.Condition import HBondCondition, NoneCombiner
from Tailor.Description import ChainDescription, AtomDescription
from Tailor.Measure import PropertyMeasure, DistanceMeasure
from Tailor.Run import Run, Pipe

path = sys.argv[1]

maxHO = 2.5
minHOC = 90.0
minNHO = 120.0

helixTerm = ChainDescription({"chainID" : "h"})
helixTerm.createResidues(7)
helixTerm.createBackboneHBondCondition(4, 1, maxHO, minHOC, minNHO)
helixTerm.createBackboneHBondCondition(5, 2, maxHO, minHOC, minNHO)

helixTerm.createPhiBoundCondition(2, -90, 60)
helixTerm.createPsiBoundCondition(2,   0, 60)

helixTerm.createPhiBoundCondition(3, -90, 60)
helixTerm.createPsiBoundCondition(3,   0, 60)

helixTerm.createPhiBoundCondition(4, -90, 60)
helixTerm.createPsiBoundCondition(4,   0, 60)

hbond = helixTerm.createBackboneHBondCondition(6, 3, maxHO, minHOC, minNHO)
hbond.negate()

# for proline searches
Beispiel #6
0
import sys

from Tailor.Description import ChainDescription
from Tailor.DataSource import structureFromFile
from Tailor.Engine import Matcher
from Tailor.Measure import DistanceMeasure

# read in the structure
filepath = sys.argv[1]
structure = structureFromFile(filepath)

# create a simple description
description = ChainDescription({"chainType" : "Protein"})
description.createResidues(3)
description.createPhiBoundCondition(2, -30, 100) 

# create a simple measure
o = description.selectResidue(1).selectAtom("O")
n = description.selectResidue(3).selectAtom("N")
distanceMeasure = DistanceMeasure(o, n)

# match and measure
matcher = Matcher(description)
for fragment in matcher.findAll(structure):
    print(fragment.chainID, "".join([str(r) for r in fragment]), distanceMeasure.measure(fragment))

Beispiel #7
0
import sys

from Tailor.Description import ChainDescription
from Tailor.DataSource import structureFromFile
from Tailor.Engine import Matcher
from Tailor.Measure import DistanceMeasure

# read in the structure
filepath = sys.argv[1]
structure = structureFromFile(filepath)

# create a simple description
description = ChainDescription({"chainType" : "Protein"})
description.createResidues(3)

# create a simple measure
o = description.selectResidue(1).selectAtom("O")
n = description.selectResidue(3).selectAtom("N")
distanceMeasure = DistanceMeasure(o, n)

# match and measure
matcher = Matcher(description)
for fragment in matcher.findAll(structure):
    print fragment.chainID, "".join([str(r) for r in fragment]), distanceMeasure.measure(fragment)

Beispiel #8
0
import sys

from Tailor.Condition import HBondCondition, NoneCombiner
from Tailor.Description import ChainDescription
from Tailor.Measure import PropertyMeasure
from Tailor.Run import Run

path = sys.argv[1]

maxHO = 3.5
minHOC = 90.0
minNHO = 90.0

helixTerm = ChainDescription({"chainID" : "helix_terminus"})
helixTerm.createResidues(9)
helixTerm.createBackboneHBondCondition(6, 2, maxHO, minHOC, minNHO)
helixTerm.createBackboneHBondCondition(7, 3, maxHO, minHOC, minNHO)

antiBond = helixTerm.createBackboneHBondCondition(8, 4, maxHO, minHOC, minNHO)
antiBond.negate()

helixTerm.createPhiBoundCondition(7, 75, 50)
helixTerm.createPsiBoundCondition(7, 30, 50)

#antiPhiBound8 = helixTerm.createPhiBoundCondition(8, -50, 50)
#antiPhiBound8.negate()

#antiPsiBound8 = helixTerm.createPsiBoundCondition(8, -50, 50)
#antiPsiBound8.negate()

#helixTerm.conditions.remove(antiPhiBound8)
Beispiel #9
0
# a copy of SimpleExample.java, for comparative testing
import sys

from Tailor.Description import ChainDescription, ResidueDescription, AtomDescription
from Tailor.Condition import PropertyCondition
from Tailor.Measure import DistanceMeasure
from Tailor.Run import Run


motif = ChainDescription({"chainID" : "valmot"})
residueDescription = ResidueDescription({"position" : 1, "resname" : "VAL"})
nAtom = AtomDescription({"name" : "N"})
oAtom = AtomDescription({"name" : "O"})

residueDescription.addSubDescription(nAtom)
residueDescription.addSubDescription(oAtom)
motif.addSubDescription(residueDescription)

atom1 = motif.selectResidue(1).selectAtom("N")
atom2 = motif.selectResidue(1).selectAtom("O")

Run(motif, sys.argv[1], [], [DistanceMeasure(atom1, atom2)]).run()
Beispiel #10
0
import sys
from Tailor.Condition import DistanceBoundCondition
from Tailor.Description import StructureDescription, ChainDescription, ResidueDescription, constructSelection
from Tailor.Measure import DistanceMeasure, AngleMeasure
from Tailor.Run import Pipe, Run

# read in the structure
filepath = sys.argv[1]

# create a multichain description
backboneChain = ChainDescription({"chainType" : "Protein", "chainID" : ""})
backboneChain.createResidues(4)

sidechainResidue = ResidueDescription({"position" : 1, "resname" : "ASN" })
sidechainResidue.addAtom("ND2")
sidechainChain = ChainDescription({"chainType" : "Protein"})
sidechainChain.addResidue(sidechainResidue)

description = StructureDescription({}, name="classAStructure")
description.addChain(backboneChain)
description.addChain(sidechainChain)

# create some simple measures and conditions
o1 = constructSelection(chainType="Protein", residuePosition=1, atomName="O")
o3 = constructSelection(chainType="Protein", residuePosition=3, atomName="O")
n  = constructSelection(chainType="Protein", residuePosition=1, atomName="ND2")
phi1, psi1 = backboneChain.createPhiPsiMeasure(2)
phi2, psi2 = backboneChain.createPhiPsiMeasure(3)

description.addCondition(DistanceBoundCondition(o1, n, 1.8, 1.8))
description.addCondition(DistanceBoundCondition(o3, n, 1.8, 1.8))
Beispiel #11
0
import sys

from Tailor.Condition import HBondCondition, NoneCombiner
from Tailor.Description import ChainDescription
from Tailor.Measure import PropertyMeasure
from Tailor.Run import Run, Pipe

path = sys.argv[1]

maxHO = 3.5
minHOC = 90.0
minNHO = 90.0

helixTerm = ChainDescription({"chainID" : "h"})
helixTerm.createResidues(12)
helixTerm.createBackboneHBondCondition(6, 2, maxHO, minHOC, minNHO)
helixTerm.createBackboneHBondCondition(7, 3, maxHO, minHOC, minNHO)
helixTerm.createBackboneHBondCondition(8, 4, maxHO, minHOC, minNHO)
helixTerm.createBackboneHBondCondition(9, 5, maxHO, minHOC, minNHO)
helixTerm.createBackboneHBondCondition(10, 6, maxHO, minHOC, minNHO)

helixTerm.getResidue(11).addPropertyCondition("resname", "PRO")
helixTerm.getResidue(11).children.pop()
#antiBond = helixTerm.createBackboneHBondCondition(11, 7, maxHO, minHOC, minNHO)
#antiBond.negate()

#antiPhiBound9 = helixTerm.createPhiBoundCondition(11, -90, 90)
#antiPsiBound9 = helixTerm.createPsiBoundCondition(11, -30, 60)

#helixTerm.conditions.remove(antiPhiBound9)
#helixTerm.conditions.remove(antiPsiBound9)
Beispiel #12
0
import sys

from Tailor.Description import ChainDescription
from Tailor.Measure import DistanceMeasure
from Tailor.Run import Run, Pipe

path = sys.argv[1]

rlCatgrip = ChainDescription({"chainID": "RL"})
rlCatgrip.createResidues(4)

for i in range(1, 5):
    print rlCatgrip.getResidue(i).children.pop()

rlCatgrip.createPhiBoundCondition(2, -90, 45)
rlCatgrip.createPsiBoundCondition(2, 135, 45)
rlCatgrip.createPhiBoundCondition(3, 90, 45)
rlCatgrip.createPsiBoundCondition(3, -135, 45)

measuresRL = []
measuresRL.extend(rlCatgrip.createPhiPsiMeasures([2, 3]))

lrCatgrip = ChainDescription({"chainID": "LR"})
lrCatgrip.createResidues(4)

for i in range(1, 5):
    print lrCatgrip.getResidue(i).children.pop()

lrCatgrip.createPhiBoundCondition(2, 90, 45)
lrCatgrip.createPsiBoundCondition(2, -135, 45)
lrCatgrip.createPhiBoundCondition(3, -90, 45)
Beispiel #13
0
import sys

from Tailor.Condition import HBondCondition, NoneCombiner
from Tailor.Description import ChainDescription, AtomDescription
from Tailor.Measure import PropertyMeasure, DistanceMeasure
from Tailor.Run import Run, Pipe

path = sys.argv[1]

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

# for proline searches
#tripep.getResidue(2).children.pop()

measures = []
measures.extend(tripep.createPhiPsiMeasure(2))
measures.append(PropertyMeasure(tripep.selectResidue(1), "resname", str))
measures.append(PropertyMeasure(tripep.selectResidue(2), "resname", str))
measures.append(PropertyMeasure(tripep.selectResidue(3), "resname", str))
pipes = [Pipe(tripep, measures, sys.stdout)]
run = Run(pipes, path)
run.run()
Beispiel #14
0
                    ["c3_3r",  9, [(1,  9), ( 9, 1), (3, 7), (7, 3)], [], [4, 5, 6]],
                    ["c3_5r",  9, [(1,  9), ( 9, 1), (3, 7)],   [(7, 3)], [4, 5, 6]],
                    ["c3_7r",  9, [(1,  9), ( 9, 1)],   [(3, 7), (7, 3)], [4, 5, 6]],
                    ["c3_9r",  9, [(1,  9)],   [( 9, 1), (3, 7), (7, 3)], [4, 5, 6]],

                    ["c4_4r", 10, [(1, 10), (10, 1), (3, 8), (8, 3)], [], [4, 5, 6, 7]],
                    ["c4_6r", 10, [(1, 10), (10, 1), (3, 8)],   [(8, 3)], [4, 5, 6, 7]],
                    ["c4_8r", 10, [(1, 10), (10, 1)],   [(3, 8), (8, 3)], [4, 5, 6, 7]],
                    ["c4_10r", 10, [(1, 10)],  [(10, 1), (3, 8), (8, 3)], [4, 5, 6, 7]],
                ]

pipes = []
for name, resnum, hBondNumberList, antiHBondNumberList, phipsiNums in hairpin_data:

    # description
    hairpin = ChainDescription({"chainID" : name})
    hairpin.createResidues(resnum)
    hairpin.createBackboneHBondConditions(hBondNumberList, maxHO, minHOC, minNHO)

    # antibonds
    for i, j in antiHBondNumberList:
        bond = hairpin.createBackboneHBondCondition(i, j, maxHO, minHOC, minNHO)
        bond.negate()

    # measures
    measures = []

    measures.extend(hairpin.createPhiPsiMeasures(phipsiNums))

    # either this line or the other 3 would do...
    #measures.extend(hairpin.createBackboneHBondMeasures(hBondNumberList))
import sys
from Tailor.Condition import DistanceBoundCondition
from Tailor.Description import StructureDescription, ChainDescription, ResidueDescription, constructSelection
from Tailor.Measure import DistanceMeasure, AngleMeasure
from Tailor.Run import Pipe, Run

# read in the structure
filepath = sys.argv[1]

# create a multichain description
proteinChain = ChainDescription({"chainType" : "Protein", "chainID" : ""})
proteinChain.createResidues(4)

waterResidue = ResidueDescription({"position" : 1 })
waterResidue.addAtom("O")
waterChain = ChainDescription({"chainType" : "Water"})
waterChain.addResidue(waterResidue)

description = StructureDescription({}, name="classAStructure")
description.addChain(proteinChain)
description.addChain(waterChain)

# create some simple measures and conditions
o1 = constructSelection(chainType="Protein", residuePosition=1, atomName="O")
o3 = constructSelection(chainType="Protein", residuePosition=3, atomName="O")
ow = constructSelection(chainType="Water",   residuePosition=1, atomName="O")
phi1, psi1 = proteinChain.createPhiPsiMeasure(2)
phi2, psi2 = proteinChain.createPhiPsiMeasure(3)

description.addCondition(DistanceBoundCondition(o1, ow, 1.8, 1.8))
description.addCondition(DistanceBoundCondition(o3, ow, 1.8, 1.8))
Beispiel #16
0
import sys
from Tailor.Condition import DistanceBoundCondition
from Tailor.Description import StructureDescription, ChainDescription, ResidueDescription, constructSelection
from Tailor.Measure import DistanceMeasure, AngleMeasure
from Tailor.Run import Pipe, Run

# read in the structure
filepath = sys.argv[1]

# create a multichain description
proteinChain = ChainDescription({"chainType": "Protein", "chainID": ""})
proteinChain.createResidues(3)

waterResidue = ResidueDescription({"position": 1})
waterResidue.addAtom("O")
waterChain = ChainDescription({"chainType": "Water"})
waterChain.addResidue(waterResidue)

description = StructureDescription({}, name="niche")
description.addChain(proteinChain)
description.addChain(waterChain)

# create some simple measures and conditions
c1 = constructSelection(chainType="Protein", residuePosition=1, atomName="C")
n3 = constructSelection(chainType="Protein", residuePosition=3, atomName="N")
ow = constructSelection(chainType="Water", residuePosition=1, atomName="O")
phi, psi = proteinChain.createPhiPsiMeasure(2)

description.addCondition(DistanceBoundCondition(c1, ow, 1.5, 1.5))
description.addCondition(DistanceBoundCondition(n3, ow, 1.5, 1.5))
Beispiel #17
0
# turns defined by a CAlpha(i)<->CAlpha(i + 3) < 7.0 Ang
import sys

from Tailor.Condition import DistanceBoundCondition, AllCombiner, NoneCombiner
from Tailor.Description import ChainDescription, AtomDescription
from Tailor.Measure import PropertyMeasure, DistanceMeasure
from Tailor.Run import Run, Pipe

path = sys.argv[1]

tetrapep = ChainDescription({"chainID" : "t"})
tetrapep.createResidues(4)

# the < 7 distance constraint
ca1 = tetrapep.selectResidue(1).selectAtom("CA")
ca2 = tetrapep.selectResidue(4).selectAtom("CA")
tetrapep.addCondition(DistanceBoundCondition(ca1, ca2, 3.5, 3.5))

# no helical angles
#phi2 = tetrapep.createPhiBoundCondition(2, -60, 10)
#psi2 = tetrapep.createPsiBoundCondition(2, -60, 10)
#phi3 = tetrapep.createPhiBoundCondition(3, -60, 10)
#psi3 = tetrapep.createPsiBoundCondition(3, -60, 10)
#for torsion in [phi2, psi2, phi3, psi3]: tetrapep.conditions.remove(torsion)
#tetrapep.addCondition(NoneCombiner([phi2, psi2]))
#tetrapep.addCondition(NoneCombiner([phi3, psi3]))

# for proline searches
#for i in range(1, 5): tetrapep.getResidue(i).children.pop()

measures = []