Dear Eric and Elaine,<br><br><b>Thank you so much for your inputs</b>. I could implement the 'weighted distance' representation. I have certain queries. I would appreciate your inputs for the same.<br><br>1) When i type help(object) in chimera's python shell, it shows the help message, is there any to way to make the help information to be displayed in a separate window. I tried in config setting but i couldnt make it.<br>
<br>2) Is there any way to invoke chimera within normal python interpreter. I am able to do this for pymol. But i dnt know if i can do the same with chimera. I tried to set PYTHONPATH, but it vain.<br><br><span style="color: rgb(51, 51, 51);">[cbala@RAMANA ~]$ python</span><br style="color: rgb(51, 51, 51);">
<span style="color: rgb(51, 51, 51);">Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38) </span><br style="color: rgb(51, 51, 51);"><span style="color: rgb(51, 51, 51);">[GCC 4.3.2 20080917 (Red Hat 4.3.2-4)] on linux2</span><br style="color: rgb(51, 51, 51);">
<span style="color: rgb(51, 51, 51);">Type "help", "copyright", "credits" or "license" for more information.</span><br style="color: rgb(51, 51, 51);"><span style="color: rgb(51, 51, 51);">>>> import pymol</span><br style="color: rgb(51, 51, 51);">
<br>3) In the following code, i am collecting Cbeta atoms from two groups of residues and calculating the cb-cb distance. If instead of Cbeta, i have to calculate the side chain COM-COM (center of mass) distance between two groups of residues, how can i do it or which module should i use.<br>
<br>4)What is the syntax to change the color of pseudobonds ?<br><br><i>I am pasting the script below so that it may be useful to someone who wants to do a similar thing.<br></i><br>>>> import chimera<br>>>> from StructMeasure.DistMonitor import *<br>
<br>>>> model=chimera.openModels.open('trial.pdb')<br>>>> res=model[0].residues<br>>>> don_atom=[];acp_atom=[]<br><br>#collecting CB atoms of donor and acceptor residues<br><br>>>> for x in res:<br>
if x.type in ['ARG','GLN']: don_atom.append(x.atomsMap['CB'][0])<br> elif x.type=='GLU': acp_atom.append(x.atomsMap['CB'][0])<br> else: continue<br><br>#open the distance weight data<br>
<br>>>> weight={}<br>>>> for line in open('rad.dat'):<br> line=line.split()<br> weight[float(line[0])]=line[1]<br><br>>>> b=[]<br>#pseudo bond list<br><br>>>> for v1 in don_atom:<br>
for v2 in acp_atom: b.append(distanceMonitor.newPseudoBond(v1,v2))<br><br>#changing pseudo bond features<br>>>> for pb in b:<br> pb.drawMode=1<br> chi=round(pb.length())<br>
if chi in weight: pb.radius=float(weight[chi])<br><br><br>Thanks,<br>Bala<br><br><div class="gmail_quote">On Mon, May 10, 2010 at 8:07 PM, Eric Pettersen <span dir="ltr"><<a href="mailto:pett@cgl.ucsf.edu">pett@cgl.ucsf.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style="">Oops. The module name is "StructMeasure", not "StructureMeasure", so the correct line of Python would be:<div>
<br></div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div>from StructMeasure.DistMonitor import distanceMonitor</div>
</div></blockquote></div><div><br></div><font color="#888888">--Eric</font></div><div><div></div><div class="h5"><div><br></div><div><br><div><div>On May 10, 2010, at 3:36 AM, Bala subramanian wrote:</div><br><blockquote type="cite">
Dear Elaine and Eric,<br>Thanks for the inputs. I started the chimera interface and tried to use the StructureMeasure module using the IDLE that is present in chimera but it shows me import Error. I dnt understand why. I am using chimera 1.5 alpha version 29904. Do i need to set some path to use the module.<br>
<br>>>> from StructureMeasure import *<br>Traceback (most recent call last):<br> File "<pyshell#8>", line 1, in <module><br> from StructureMeasure import *<br>ImportError: No module named StructureMeasure<br>
<br><br>Bala<br><br><div class="gmail_quote">On Wed, May 5, 2010 at 8:37 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="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div><div><div>On May 5, 2010, at 10:28 AM, Elaine Meng wrote:</div><br><blockquote type="cite"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="font-family: monospace;">With Chimera commands, you can create a distance monitor and set its stick thickness, color, etc.:<br>
open 1zik<br>alias pair1 #0:22.a@oe2:25@ne<br>dist pair1<br>setattr p drawMode 1 pair1<br>setattr p radius .05 pair1<br>setattr p color hot pink pair1<br>setattr p label " " pair1<br><br>However, it sounds like python will be necessary to conditionally set radius or color depending on the value of the distance.</span></span></blockquote>
<br></div></div><div>A little more info on this possibility. You can get the distance-monitor pseudobond group in Chimera with:</div><div><br></div><div>from StructureMeasure.DistMonitor import distanceMonitor</div><div>
<br></div><div>and run through the distance-monitor pseudobonds with:</div><div><br></div><div>for pb in distanceMonitor.pseudoBonds:</div><div><span style="white-space: pre;"> </span>...do something that sets pb.radius based on pb.length()...</div>
<div><br></div><div>--Eric</div><br><div> <span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div>
<div style="margin: 0px;"><font style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 16px; line-height: normal; font-size-adjust: none; font-stretch: normal;" face="Helvetica" size="5"><span> <span> </span></span>Eric Pettersen</font></div>
<div style="margin: 0px;"><font style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 16px; line-height: normal; font-size-adjust: none; font-stretch: normal;" face="Helvetica" size="5"><span> <span> </span></span>UCSF Computer Graphics Lab</font></div>
<div><div style="margin: 0px;"><font style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 16px; line-height: normal; font-size-adjust: none; font-stretch: normal;" face="Helvetica" size="5"><span> </span><a href="http://www.cgl.ucsf.edu" target="_blank">http://www.cgl.ucsf.edu</a></font></div>
<br></div></div></span> </div><br></div></blockquote></div><br></blockquote></div></div><br></div></div></div></blockquote></div><br>