[Chimera-users] python/model panel

Dougherty, Matthew T matthewd at bcm.edu
Fri Oct 9 17:42:00 PDT 2015


thanks.

suggestion on feature


when exiting session, chimera auto writes out a csv file of model id, name and path. file name equals session name with csv extension. The file could be incorporated into a database.


Would make organizing assets & archiving session files easier.


Matthew Dougherty
National Center for Macromolecular Imaging
Baylor College of Medicine
=================================================
=================================================


________________________________
From: Eric Pettersen <pett at cgl.ucsf.edu>
Sent: Friday, October 9, 2015 5:37 PM
To: Dougherty, Matthew T
Cc: chimera-users at cgl.ucsf.edu
Subject: Re: [Chimera-users] python/model panel


On Oct 9, 2015, at 1:34 PM, Dougherty, Matthew T <matthewd at bcm.edu<mailto:matthewd at bcm.edu>> wrote:

I would like to print out the model ID, name and input files as they are listed in the model panel.

Can you point me in the direction of how to loop over the model panel ?
Such as elevant variables, and what would be a block of code in chimera that I should study.

Hi Matt,
I don't know that you need to go through the Model Panel per se, you could just go through Chimera's open models list:

chimera.openModels.list()


Each model in the list has:

id ID number
subid Sub-ID number (None if it doesn't have a sub-ID)
name Name
openedAs If it came from a file, a 4-tuple of stuff you mostly don't care about, but the first element is the file name

Since some models don't come from files (e.g. on-the-fly VRML models), you may want to use the model panel's "inputPath" function to always get a usable/readable string:

from ModelPanel import inputPath
path = inputPath(model)

-Eric

Eric Pettersen
UCSF Computer Graphics Lab

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-users/attachments/20151010/90f67dc1/attachment-0001.html>


More information about the Chimera-users mailing list