[Chimera-users] Getting an extension handle
Charles Moad
cmoad at indiana.edu
Mon Feb 7 10:50:41 PST 2005
Charles Moad wrote:
> Elaine Meng wrote:
>
>>> How would I get get a handle on a running instance of an extension?
>>> Specifically, I want to be able to associate my own structures to
>>> sequences in the MultAlignViewer.
>>
>>
>>
>> Hi Charlie,
>> If I understand you correctly, this is something you
>> can do this in the user interface (without dealing with code).
>> Your structures should automatically associate with the
>> sequences when opened in Chimera, if the structure's sequence
>> and the sequence in the alignment match well enough. Even
>> if they don't, you can "force" the structure to associate
>> using Multalign Viewer's menu option
>> Structure... Associations
>> This option brings up a dialog in which you can specify
>> which of the structures open in Chimera should be
>> associated with a sequence in the alignment.
>>
>
> I am working on a plugin so I do want to be able to do this
> programatically. Thanks for the hint on the auto-association. The
> problem I have now is matching too well. Both sequences are matching
> the second model loaded. I see I can fix this in the interface, but any
> clue on how to access this for scripting?
>
I think I found my answer by looking at some sources. The following
works given my list of models, mdls:
for mdl,mseq in map(lambda x,y: (x[0],y), mdls, mav.seqs):
mav.disassociate(mdl)
mav.associate(mdl.sequences()[0], seq=mseq, force=1)
Thanks,
More information about the Chimera-users
mailing list