Re: [PyMOL] View manger (and how to store arbitrary data on the session?)

2019-10-30 Thread Pedro Lacerda
Hi Jared,

Glad you liked and thank you for the patch and incentive. I'll pull it on
the repo and create a wiki page.

Best regards,
Pedro Lacerda


Em qua, 30 de out de 2019 14:16, Jared Sampson 
escreveu:

> Hi Pedro -
>
> I just took a look at the plugin, and it seems quite convenient.  I
> imagine using this as a tool to complement PyMOL's default scenes, as a way
> of looking at different representations or objects from the same viewpoint.
>
> Looking at the code, I was curious about all the Q* global variable
> assignments near the top, and thought they might be cleaner and easier to
> maintain as imports.  (Plus many of them were unused in the plugin code.)
>  Apparently due to the way pymol.Qt is a wrapper for PyQt5, we can't do
> `from pymol.Qt.QtWidgets import *`, but the following does work:
>
> ```
> from pymol.Qt import QtWidgets, QtCore, QtGui
> ```
>
> then use e.g. `QtWidgets.QWidget()` in the body of the code; see the
> attached patch (I hope you don't mind my sending it!).  As a side note,
> this appears to be—at least unofficially—a preferred way to do it,
> according to an example plugin
> 
>  by
> PyMOL lead developer Thomas Holder (speleo3).
>
> Also, I would encourage you to add your plugin to the PyMOL scripts repo
>  on Github, and to
> create a PyMOL Wiki page for it.
>
> Thanks for sharing!
>
> Cheers,
> Jared
>
> On October 26, 2019 at 12:39:35 PM, Pedro Lacerda (pslace...@gmail.com)
> wrote:
>
> And the plugin, of course!
>
> Em sáb, 26 de out de 2019 às 13:37, Pedro Lacerda 
> escreveu:
>
>> Hi,
>>
>> I just made a graphical plugin to set and get views. It uses the set_view
>> and get_view functions.
>>
>> It is available in the last option ("Show views") on the "Scene" menu.
>> Double-click to rename a view. Erase it's name to delete it.
>>
>> In order to persist data in the PSE session it stores data into the
>> mesh_clear_selection setting. It was the only way I found.
>>
>> How to store arbitrary data on the session? Some "ostate" string settings
>> are preserved on the PSE session. But not all support set arbitrary data
>> (eg, bg_image_filename). It is very hackish and not a definite solution.
>>
>> Just wondering, maybe a hidden "setting" (not visible to can be be used
>> as a key-value store. It would hold serialized data (eg json or pickle) and
>> have a pair of functions set_key(key, obj) and get(key) that read and write
>> the setting.
>>
>> Another great addition would be able to set arbitrary strings to objects
>> and atoms. But in case of implementing a key-value store would be some
>> overlap.
>>
>> Best regards,
>>
>>
>> [image: image.png]
>>
>> --
>> Pedro Sousa Lacerda
>>
>>
>> *Laboratório de Bioinformática e Modelagem Molecular*
>> *Faculdade de Farmácia / UFBA*
>>
>> *@pslacerda*
>>
>> *+55 71 9 9981-1856*
>>
>
>
> --
> Pedro Sousa Lacerda
>
>
> *Laboratório de Bioinformática e Modelagem Molecular*
> *Faculdade de Farmácia / UFBA*
>
> *@pslacerda*
>
> *+55 71 9 9981-1856*
> ___
> PyMOL-users mailing list
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubsc
> 
>
>
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Get surface coordinates

2019-10-30 Thread Thomas Holder
Hi Pedro,

There is a "dump" command which exports all surface points and normals to a 
text file.

  dump /tmp/dump.txt, acceptor_17

Each line will have 6 numbers, 3 for the position, and 3 for the normal.

For cmd.get_volume_field you need the map name, not the surface name.

  data = cmd.get_volume_field('acceptor')
  print(data)


Hope that helps.

Cheers,
  Thomas


> On Oct 30, 2019, at 6:42 AM, Pedro Lacerda  wrote:
> 
> And cmd.get_volume_field is returning -1.
> 
> Em qua, 30 de out de 2019 às 02:00, Pedro Lacerda  
> escreveu:
> Hi,
> 
> How can I access the underlying coordinates of acceptor, donor and apolar 
> surface objects on the given session given by the following server? Coords 
> akin to dot representation would suffice.
> 
> http://fragment-hotspot-maps.ccdc.cam.ac.uk/results_table
> http://fragment-hotspot-maps.ccdc.cam.ac.uk/result/1542
> 
> An example of session is attached.
> 
> -- 
> Pedro Sousa Lacerda
> 
> Laboratório de Bioinformática e Modelagem Molecular
> Faculdade de Farmácia / UFBA
> 
> @pslacerda
> +55 71 9 9981-1856
> 
>  ARSB_hotspots.pse
> 
> 
> -- 
> Pedro Sousa Lacerda
> 
> Laboratório de Bioinformática e Modelagem Molecular
> Faculdade de Farmácia / UFBA
> 
> @pslacerda
> +55 71 9 9981-1856
> ___
> PyMOL-users mailing list
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> Unsubscribe: 
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.



___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe