Re: [Chimera-users] Getting an extension handle
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 hope this helps, Elaine --- Elaine C. Meng, Ph.D. meng@cgl.ucsf.edu Computer Graphics Lab and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco http://www.cgl.ucsf.edu/home/meng/index.html
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? Thanks again, Charlie
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,
On Feb 7, 2005, at 10:50 AM, Charles Moad wrote:
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)
I was preparing a more extensive answer, but you clearly don't need some of the basic stuff I was covering. What I would point out is that if your code is launching the mav instance, you can give "autoAssociate=False" to the constructor so that you don't have to bother with the "disassociate" part of your loop above. Eric Pettersen UCSF Computer Graphics Lab pett@cgl.ucsf.edu http://www.cgl.ucsf.edu
participants (3)
-
Charles Moad
-
Elaine Meng
-
Eric Pettersen