[chimera-dev] [Chimera-users] programmatic representation

Eric Pettersen pett at cgl.ucsf.edu
Tue Feb 13 11:55:03 PST 2007


Hi Randy,
	I've also gone ahead and improved the polymorphism of those Midas  
functions, so what you did originally will work starting with the  
next snapshot release.

--Eric

On Feb 12, 2007, at 1:39 PM, Eric Pettersen wrote:

> Hi Randy,
> 	The second argument to Midas.represent() is polymorphic, and if it  
> is a list then is is expected to be a list of atoms.  You're giving  
> it a list of models, which results in the 'drawMode' attribute of  
> those models being set (to no effect).  Perhaps the polymorphism of  
> the second argument could be improved to handle lists of models (or  
> residues), but right now it doesn't. My suggestion is to use a  
> Selection object based on your list of models, which Midas.represent 
> () can handle, perhaps like so:
>
>       self.model = ReadSDF.readSDF(tmpfile.name)
>       chimera.openModels.add(self.model)
>
>       from chimera.selection import ItemizedSelection
>       sel = ItemizedSelection()
>       sel.add(self.model)
>       Midas.represent('cpk', sel)
>
> --Eric
>
>                         Eric Pettersen
>                         UCSF Computer Graphics Lab
>                         pett at cgl.ucsf.edu
>                         http://www.cgl.ucsf.edu
>
>
> On Feb 12, 2007, at 12:28 PM, Randy Heiland wrote:
>
>> I'd like to be able to set the representation (wire, stick, bs,  
>> cpk) of
>> a model programmatically, in this case, from a plugin.  I was  
>> trying the
>> following, but the newly displayed model would always be displayed in
>> wire:
>>
>>       self.model = ReadSDF.readSDF(tmpfile.name)
>>       chimera.openModels.add(self.model)
>>
>>       #Midas.represent('stick', self.model)
>>       Midas.represent('cpk', self.model)
>>
>> Suggestions?
>> thanks, Randy
>>
>> _______________________________________________
>> Chimera-users mailing list
>> Chimera-users at cgl.ucsf.edu
>> http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users
>
> _______________________________________________
> Chimera-users mailing list
> Chimera-users at cgl.ucsf.edu
> http://www.cgl.ucsf.edu/mailman/listinfo/chimera-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-dev/attachments/20070213/507c73bd/attachment.html>


More information about the Chimera-dev mailing list