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))
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))
# 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()