[Chimera-users] drawing a symmetry axis
Tom Goddard
goddard at cgl.ucsf.edu
Fri Dec 12 09:34:00 PST 2008
Hi Philip,
Indentation of lines is important in Python. All the lines except the
ones with "#" in front (which are not executed) have to be indented by
the same amount.
Tom
Philip wrote:
> Hi Tom,
> thanks for your answer. I modified the file, but unfortunately it does not work. I get this error, when i execute "ac ai":
>
>
> <type 'exceptions.IndentationError'> Exception in Tk callback
> Function: <bound method MidasUI.processCommand of <Midas.midas_ui.MidasUI instance at 0x0A805670>> (type: <type 'instancemethod'>)
> Args: (<Tkinter.Event instance at 0x042A2EE0>,)
> Event type: KeyPress (type num: 2)
> Traceback (innermost last):
> File "D:\programme\Chimera\bin\lib\site-packages\Pmw\Pmw_1_3\lib\PmwBase.py", line 1747, in __call__
> return apply(self.func, args)
> File "D:\programme\Chimera\share\Midas\midas_ui.py", line 247, in processCommand
> midas_text.makeCommand(text)
> File "D:\programme\Chimera\share\Midas\midas_text.py", line 62, in makeCommand
> f(c, args)
> File "D:\programme\Chimera\share\Accelerators\ChimeraExtension.py", line 25, in accel_cmd
> accelerator_command(cmdname, args)
> File "D:\programme\Chimera\share\Accelerators\__init__.py", line 160, in accelerator_command
> d.accelerator_command(cmdname, args)
> File "D:\programme\Chimera\share\Accelerators\gui.py", line 169, in accelerator_command
> a.invoke()
> File "D:\programme\Chimera\share\Accelerators\__init__.py", line 19, in invoke
> self.function()
> File "D:\programme\Chimera\share\Accelerators\standard_accelerators.py", line 213, in illustrate_alignment
> import MatchDomains
> <type 'exceptions.IndentationError'>: unexpected indent (__init__.py, line 183)
>
> ================================================
> Event contents:
> char:
>
> delta: 13
> height: ??
> keycode: 13
> keysym: Return
> keysym_num: 65293
> num: ??
> serial: 3506
> state: 8
> time: 144097452
> type: 2
> widget: .92813112.176183536.176196984.177090688.177090928
> width: ??
> x: -28
> x_root: 652
> y: 18
> y_root: 681
>
> Maybe this helps to find the problem.
>
> Philip
>
>
>
>
>
> -------- Original-Nachricht --------
>
>> Datum: Thu, 11 Dec 2008 16:49:56 -0800
>> Von: Thomas Goddard <goddard at cgl.ucsf.edu>
>> An: Philip Wurm <jpw1 at gmx.de>
>> CC: chimera-users at cgl.ucsf.edu
>> Betreff: Re: [Chimera-users] drawing a symmetry axis
>>
>
>
>> Hi Philip,
>>
>> I don't know an easy way to show the symmetry axis of your dimer as a
>> line or rod using the normal Chimera commands. But you could do this by
>> modifying the keyboard shortcut ai Python code.
>>
>> You would edit the file
>>
>> chimera/share/MatchDomains/__init__.py
>>
>> or on the Mac it would be
>>
>> Chimera.app/Contents/Resources/share/MatchDomains/__init__.py
>>
>> (and on the Mac you'd need to click the Chimera icon and choose "Show
>> package contents" to see in the Chimera.app folder).
>>
>> You would change the transform_schematic() routine (line 171) code from
>>
>> # tarray = ((0,1,2),(0,2,3))
>> tarray = ((0,1,2),(0,2,3),(0,1,5),(0,5,4),(1,2,6),(1,6,5),
>> (2,3,7),(2,7,6),(3,0,4),(3,4,7),(4,5,6),(4,6,7))
>> g1 = sm.addPiece(varray, tarray, from_rgba)
>> # g1.displayStyle = g1.Mesh
>>
>> from Matrix import xform_matrix, apply_matrix
>> tf = xform_matrix(xform)
>> corners2 = [apply_matrix(tf, p) for p in corners]
>> varray2 = corners2
>> g2 = sm.addPiece(varray2, tarray, to_rgba)
>> # g2.displayStyle = g2.Mesh
>>
>>
>> to
>>
>> # tarray = ((0,1,2),(0,2,3))
>> tarray = ((0,1,1),)
>> # tarray = ((0,1,2),(0,2,3),(0,1,5),(0,5,4),(1,2,6),(1,6,5),
>> # (2,3,7),(2,7,6),(3,0,4),(3,4,7),(4,5,6),(4,6,7))
>> g1 = sm.addPiece(varray, tarray, from_rgba)
>> g1.displayStyle = g1.Mesh
>> g1.lineThickness = 3
>>
>> from Matrix import xform_matrix, apply_matrix
>> tf = xform_matrix(xform)
>> corners2 = [apply_matrix(tf, p) for p in corners]
>> varray2 = corners2
>> # g2 = sm.addPiece(varray2, tarray, to_rgba)
>> # g2.displayStyle = g2.Mesh
>>
>> Then restart Chimera and use the script you referred to. It will draw a
>> line for the axis with width 3 pixels. In the future we will try to add
>> some simpler capability to find and show symmetry axes.
>>
>> Tom
>>
>>
>> Philip Wurm wrote:
>>
>>> Hi,
>>> i have a protein dimer and i would like to show the symmetry axis. I
>>> found a script in this mailing list:
>>>
>>> http://www.cgl.ucsf.edu/pipermail/chimera-users/2008-October/003140.html
>>>
>>> which works quite nice. But i would like to have a nicer representation
>>> of my symmetry axis, not this two slabs. Just a line or thin rod would
>>> be nice.
>>>
>>> Does anyone know how to do this?
>>>
>>> Thanks,
>>> Philip
>>> _______________________________________________
>>> Chimera-users mailing list
>>> Chimera-users at cgl.ucsf.edu
>>> http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users
>>>
>
>
More information about the Chimera-users
mailing list