Dear Eric,<br>I tried the following code but no luck. I dnt see get any error but i dnt see the connection lines between the atoms.<br><br>import chimera<br>from numpy import loadtxt,matrix,arange<br>from chimera.colorTable import getColorByName<br>
from chimera.misc import getPseudoBondGroup<br><br>model=chimera.openModels.open('mypdb.pdb')<br>res=model[0].residues<br>grp = getPseudoBondGroup("mybonds", associateWith=[model])<br>MAT=loadtxt('mymatrix',dtype=float)<br>
<br>for x in range(len(res)):<br> for y in range(len(res)):<br> if x <> y :<br> value=MAT[x,y]<br> if value > 0.75:<br> b=grp.newPseudoBond(res[x].atomsMap['CA'][0], res[y].atomsMap['CA'][0])<br>
b.lineType = chimera.Dash<br> b.drawmode=1<br> b.color = getColorByName("lime green")<br> <br> else: pass<br> <br> else: continue<br>
<br>Is there something i am missing,<br>
Bala<br><br><br><div class="gmail_quote">On Tue, Jun 5, 2012 at 8:27 PM, Eric Pettersen <span dir="ltr"><<a href="mailto:pett@cgl.ucsf.edu" target="_blank">pett@cgl.ucsf.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div class="h5"><div><div>On Jun 4, 2012, at 11:54 PM, Bala subramanian wrote:</div><br><blockquote type="cite">Friends,<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
I have written a script to draw lines between atoms (using distance monitor). I dnt want the distance label to be displayed with the pseudo bond. Kindly write me the way to remove the label. My script is below.<br> <br>model=chimera.openModels.open('myavg.pdb') <br>
res=model[0].residues<br>MAT=loadtxt('mymatrix',dtype=float) <br>chimera.runCommand('focus')<br>for x in range(len(res)):<br> for y in range(len(res)):<br> if x <> y :<br> value=MAT[x,y]<br>
<br> if 0.5 < value > 0.75:<br> b=distanceMonitor.newPseudoBond(res[x].atomsMap['CA'][0],res[y].atomsMap['CA'][0])<br> b.drawMode=1<br> b.radius=0.05<br> <span style="color:rgb(255,102,102)">#b.label=None I tried keeping this value as None and empty string but it doesnt help.</span><br>
b.color=getColorByName('red')<br><br> else: pass<br><br> else: continue<br><br> </blockquote></div></blockquote></div><br></div></div><div>Hi Bala,</div><div><span style="white-space:pre-wrap"> </span>distanceMonitor pseudobonds are designed to do exactly what you find them to be doing: showing an updated distance as the model is moved. What you need to do is make a normal pseudobond group for your own use that doesn't have all the special processing that distanceMonitor provides. Here is some example code:</div>
<div><br></div><div>from chimera.misc import getPseudoBondGroup</div><div>grp = getPseudoBondGroup("matrix bonds", associateWith=[model])</div><div><br></div><div>...then later...</div><div><br></div><div>b = grp.newPseudoBond(res[x].atomsMap['CA'][0], res[y].atomsMap['CA'][0])</div>
<div><br></div><div>You will probably want to set some attributes of your group, like color and line type (dashed vs. solid). Here's some code for that:</div><div><br></div><div>import chimera</div><div>from chimera.colorTable import getColorByName</div>
<div>grp.color = getColorByName("lime green")</div><div>grp.lineType = chimera.Dash</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>--Eric</div></font></span><div><br></div><div>P.S. BTW, this question is probably better for chimera-dev than chimera-users...</div>
<div><br></div><div><br></div></div></blockquote></div><br><br clear="all"><br>-- <br>C. Balasubramanian<br><br>