On Apr 24, 2018, at 1:20 AM, Pablo Solar Rodríguez <pablosolar.r@gmail.com> wrote:

Hello Eric and the rest of mates!

Hi Pablo!

I would like to know if when you open a PDB through Midas 'open' method, the opened model is returned.

Since opening a file may generate multiple models (e.g. an NMR ensemble), the open method returns a list of models.  If you expect your file to generate a single model, you can just use ‘open(…)[0]’ to get the model.

I need to have access to that specific model all the time, even when IDs in the Model Panel are changed due to some other models are closed or opened.

Model IDs for existing models don’t change when other models are opened in closed.  In fact, they cannot be changed!


The idea is something like:

if os.path.exists(model_path):
    from Midas import open
    self.model_path_pointer = open(model_path, filetype="pdb”)

That almost works, but like I said above you would ‘[0]’ to the open command in order to get the model out of the returned list.


And whenever I need, make:


You can change a model’s name freely, e.g.:

self.model_path_pointer.name = “New name”


Again, you can’t change a model ID, though if you use the “model” keyword of the open() call, you can have it initially assigned to any available model number that you want.

—Eric

Eric Pettersen
UCSF Computer Graphics Lab


....

​Thank you in advance and kind regards!​


_______________________________________________
Chimera-dev mailing list
Chimera-dev@cgl.ucsf.edu
http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev