[Chimera-users] weighted distance
Bala subramanian
bala.biophysics at gmail.com
Tue May 18 02:04:53 PDT 2010
Dear Eric and Elaine,
*Thank you so much for your inputs*. I could implement the 'weighted
distance' representation. I have certain queries. I would appreciate your
inputs for the same.
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.
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.
[cbala at RAMANA ~]$ python
Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38)
[GCC 4.3.2 20080917 (Red Hat 4.3.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymol
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.
4)What is the syntax to change the color of pseudobonds ?
*I am pasting the script below so that it may be useful to someone who wants
to do a similar thing.
*
>>> import chimera
>>> from StructMeasure.DistMonitor import *
>>> model=chimera.openModels.open('trial.pdb')
>>> res=model[0].residues
>>> don_atom=[];acp_atom=[]
#collecting CB atoms of donor and acceptor residues
>>> for x in res:
if x.type in ['ARG','GLN']: don_atom.append(x.atomsMap['CB'][0])
elif x.type=='GLU': acp_atom.append(x.atomsMap['CB'][0])
else: continue
#open the distance weight data
>>> weight={}
>>> for line in open('rad.dat'):
line=line.split()
weight[float(line[0])]=line[1]
>>> b=[]
#pseudo bond list
>>> for v1 in don_atom:
for v2 in acp_atom:
b.append(distanceMonitor.newPseudoBond(v1,v2))
#changing pseudo bond features
>>> for pb in b:
pb.drawMode=1
chi=round(pb.length())
if chi in weight: pb.radius=float(weight[chi])
Thanks,
Bala
On Mon, May 10, 2010 at 8:07 PM, Eric Pettersen <pett at cgl.ucsf.edu> wrote:
> Oops. The module name is "StructMeasure", not "StructureMeasure", so the
> correct line of Python would be:
>
> from StructMeasure.DistMonitor import distanceMonitor
>>
>
> --Eric
>
>
> On May 10, 2010, at 3:36 AM, Bala subramanian wrote:
>
> Dear Elaine and Eric,
> 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.
>
> >>> from StructureMeasure import *
> Traceback (most recent call last):
> File "<pyshell#8>", line 1, in <module>
> from StructureMeasure import *
> ImportError: No module named StructureMeasure
>
>
> Bala
>
> On Wed, May 5, 2010 at 8:37 PM, Eric Pettersen <pett at cgl.ucsf.edu> wrote:
>
>> On May 5, 2010, at 10:28 AM, Elaine Meng wrote:
>>
>> With Chimera commands, you can create a distance monitor and set its stick
>> thickness, color, etc.:
>> open 1zik
>> alias pair1 #0:22.a at oe2:25 at ne
>> dist pair1
>> setattr p drawMode 1 pair1
>> setattr p radius .05 pair1
>> setattr p color hot pink pair1
>> setattr p label " " pair1
>>
>> However, it sounds like python will be necessary to conditionally set
>> radius or color depending on the value of the distance.
>>
>>
>> A little more info on this possibility. You can get the distance-monitor
>> pseudobond group in Chimera with:
>>
>> from StructureMeasure.DistMonitor import distanceMonitor
>>
>> and run through the distance-monitor pseudobonds with:
>>
>> for pb in distanceMonitor.pseudoBonds:
>> ...do something that sets pb.radius based on pb.length()...
>>
>> --Eric
>>
>> Eric Pettersen
>> UCSF Computer Graphics Lab
>> http://www.cgl.ucsf.edu
>>
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20100518/8d47e3bd/attachment.html>
More information about the Chimera-users
mailing list