[chimera-dev] scripting rotation around a bond

Eric Pettersen pett at cgl.ucsf.edu
Wed May 6 10:48:03 PDT 2009


On May 6, 2009, at 1:13 AM, Jean Didier Pie Marechal wrote:

> Hi Eric,
>
> thanks a lot that is what I wanted. One question though: How do you  
> inverse the part of the molecule you want to rotate? (The reverse in  
> the GUI).

Well, since you're always specifying what sides moves:

>> 	Then you can change it by a delta (in degrees) from it's
>> _original_
>> (not current) position with the angle() method.  You also have to
>> specify which side of the bond doesn't move:
>>
>> br.angle = (10, br.biggerSide())

you just specify that you want the _other_ side to move, something like:

br.angle = (10, bond.otherAtom(br.biggerSide()))

--Eric



>
>
> ----- Missatge original -----
> De: Eric Pettersen
> Data: Dimecres, Abril 29, 2009 9:16 pm
> Assumpte: Re: [chimera-dev] scripting rotation around a bond
>
>> On Apr 29, 2009, at 3:34 AM, Jean Didier Pie Marechal wrote:
>>
>>> Dear all,
>>>
>>> I'd like to generate from my script an ensemble of structures
>>> obtained by the rotation of a subgroup of the molecule  around a
>>> given bond. Said in another way, I want to do something similar
>> to
>>> the  adjust torsion tools without getting to the interfase but
>>> defining myself the value of the angle I want to test.
>>> I can't figure out what is the module to load and how to use it
>> and
>>> it seems there is no command line for this (rotation seems to
>> accept
>>> only the atom specification for the bond as an argument). Could
>> you
>>> give me a hand on this?
>>
>> Hi JD,
>> 	Basically, given a bond you want to rotate around, you create a
>> BondRot instance to do it:
>>
>> br = chimera.BondRot(bond)
>>
>> 	Then you can change it by a delta (in degrees) from it's
>> _original_
>> (not current) position with the angle() method.  You also have to
>> specify which side of the bond doesn't move:
>>
>> br.angle = (10, br.biggerSide())
>>
>> 	You can get back to the original position with br.reset() (or with
>> a
>> delta of zero).  Make sure to dispose of the BondRot with
>> br.destroy()
>> when you're done with it.
>> 	You probably want to use a daily build here, otherwise the bond-
>> rotation GUI will pop up as you work with the BondRot.  Which can
>> be
>> kind of cool as the adjustment dial flies around like a movie clock
>> in
>> a fast-forward sequence.
>> 	
>>> By the way, I wanted to get the to the programmers's guide but I
>>> can't. You removed it from your server correct?
>>>
>>> All the best,
>>> JD
>>
>> The Programmer's Guide is still there, it's just not a direct link
>> off
>> the home page.  Instead you have to click on the "Documentation"
>> link
>> and it's in the list on the resulting page.  We removed the auto-
>> generated reference section since it was very big and of little
>> utility.
>> --Eric
>>
>>                        Eric Pettersen
>>                        UCSF Computer Graphics Lab
>>                        http://www.cgl.ucsf.edu
>>
>>
>




More information about the Chimera-dev mailing list