[chimera-dev] Retrieving model_id / model_name via API

Eric Pettersen pett at cgl.ucsf.edu
Wed Mar 6 15:40:47 PST 2019


Hi Lars,
	The model attributes for the ID are ‘id’/‘subid’ for the parts before and after any ‘.’ respectively, and the ‘name’ attribute has the model name.  You would loop through all volume models with something like:

from chimera import openModels
from VolumeViewer import Volume
for vol in openModels.list(modelTypes=[Volume]):
	print “%d.%d %s” % (vol.id <http://vol.id/>, vol.subid, vol.name)

We realize the programmer documentation isn’t great.  What little we have you can find here: https://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/index.html <https://www.cgl.ucsf.edu/chimera/docs/ProgrammersGuide/index.html> .  One of our objectives for ChimeraX is much better programmer documentation.

—Eric

	Eric Pettersen
	UCSF Computer Graphics Lab


> On Mar 6, 2019, at 10:40 AM, Lars Hangartner <lhangart at scripps.edu> wrote:
> 
> Hi guys,
> 
> I am desperately looking to get the model_id / model name from all open volume objects. I have tried openModel.list()[0].model_id  in many iterations but no success… I would like to iterate through models and identify the resampled ones.
> 
> Can anybody help?
> 
> Thanks,
> 
> Lars
> 
> 
> P.S: API documentation would really be helpful. 
> 
> 
> 
> _______________________________________________
> Chimera-dev mailing list
> Chimera-dev at cgl.ucsf.edu
> http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-dev
> 

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


More information about the Chimera-dev mailing list