Re: [PyMOL] Collada export with instances?

2018-06-06 Thread Gary Oberbrunner
This is great, thanks! I created a dae file with some geometry instances
before I saw this email, but I think you guys are well beyond that point
already. And yes -- one sphere per color seems like the best that can be
done simply with Collada 1.4, and it would already be a huge improvement in
size and speed.

I also agree Collada 1.5 is DOA, too bad. If you're interested in the
future, glTF is probably the way to go, though it doesn't have breps
either. It's quite easy to write; I've written an exporter for it (not from
pymol) in python which I'm happy to share.

On Wed, Jun 6, 2018 at 4:49 PM Jared Sampson 
wrote:

> Hi Gary and Thomas -
>
> As Thomas mentioned, the sphere/cylinder/etc. primitives described in the
> COLLADA 1.5 spec as  ("boundary representation") elements would be
> the best option for spheres and basically all other PyMOL representations
> except for molecular surfaces.  Unfortunately COLLADA 1.5 is not well
> supported by other graphics applications.  However, there is still room to
> optimize the storage within the constraints of COLLADA 1.4.
>
> After looking through a couple test .dae files to refresh my memory, I see
> that the output from PyMOL does use  elements.  However,
> as Gary has noticed, it defines a separate  element for each
> sphere in the scene.  This adds up quickly for scenes with many atoms
> represented as spheres.  FWIW, the reasoning behind this when I originally
> wrote the COLLADA exporter was that color information is included in the
>  definition, and it was easier to write a separate geometry for
> each sphere than to collect information about all the different colors of
> spheres.
>
> Of course, it is possible to do this more efficiently.  Probably the
> simplest way to cut down the file size would be to write only a single
> sphere  element *per color* of sphere present in the scene, and
> then use instances of those to represent all spheres that share the same
> color.  The attached files each have two geometries (output by PyMOL with
> pseudoatom spheres at position=[0, 0, 0] and [1, 0, 0], in grey90 and red,
> respectively).  The first file, "test.dae", was output directly by PyMOL
> and has one instance of each sphere, for a total file size of 21545 bytes.
> Manually adding a second instance of each sphere (translated by +/- 4Å
> along the X axis) in "test-added.dae" adds only 1147 bytes to the file
> (look for  and  in
> your favorite text editor), compared to adding 18174 bytes if the two
> additional spheres are exported from PyMOL with their additional geometries
> by adding additional pseudoatoms (that file not attached).  That's an
> almost 94% reduction per added sphere; for scenes with many spheres, the
> storage savings would be substantial.
>
> On the other hand, if there is a way for color to be specified separately
> from the  element (which I imagine must be possible, but I
> haven't found a clear example of how to do this), that would be the most
> preferred option, as it would allow us to use a single sphere 
> element per output file.
>
> Thanks to Gary for bringing this up.  Thomas, perhaps we can talk offline
> about what might be the best way to implement this?
>
> Cheers,
> Jared
>
>
> On June 6, 2018 at 2:24:08 PM, Thomas Holder (
> thomas.hol...@schrodinger.com) wrote:
>
> Hi Gary,
>
> Do you know an application which can actually read COLLADA files with
> sphere primitives? We've faced the problem that most tools only handle
> COLLADA 1.4, so if PyMOL would use COLLADA 1.5 features, the programs we
> know wouldn't read the exported files. See
> https://pymolwiki.org/index.php/COLLADA#Limitations
>
> I fully agree that sphere primitives and other COLLADA 1.5 features would
> be better (smaller files, precise sphere representation, etc.).
>
> Thomas
>
> > On Jun 6, 2018, at 1:19 PM, Gary Oberbrunner 
> wrote:
> >
> > The collada file exported by pymol would be smaller and export/import
> faster, I think, if it used geometry_instance for spheres rather than
> giving each sphere its own geometry/mesh/accessors/etc.. Has that been
> discussed before?
> >
> > --
> > Gary Oberbrunner
>
> --
> Thomas Holder
> PyMOL Principal Developer
> Schrödinger, Inc.
>
>
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>
>

-- 
Gary Oberbrunner -- CEO -- Dark Star Systems, Inc.
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
PyMOL-users 

Re: [PyMOL] Collada export with instances?

2018-06-06 Thread Jared Sampson
Hi Gary and Thomas - 

As Thomas mentioned, the sphere/cylinder/etc. primitives described in the 
COLLADA 1.5 spec as  ("boundary representation") elements would be the 
best option for spheres and basically all other PyMOL representations except 
for molecular surfaces.  Unfortunately COLLADA 1.5 is not well supported by 
other graphics applications.  However, there is still room to optimize the 
storage within the constraints of COLLADA 1.4.

After looking through a couple test .dae files to refresh my memory, I see that 
the output from PyMOL does use  elements.  However, as Gary 
has noticed, it defines a separate  element for each sphere in the 
scene.  This adds up quickly for scenes with many atoms represented as spheres. 
 FWIW, the reasoning behind this when I originally wrote the COLLADA exporter 
was that color information is included in the  definition, and it was 
easier to write a separate geometry for each sphere than to collect information 
about all the different colors of spheres.

Of course, it is possible to do this more efficiently.  Probably the simplest 
way to cut down the file size would be to write only a single sphere  
element *per color* of sphere present in the scene, and then use instances of 
those to represent all spheres that share the same color.  The attached files 
each have two geometries (output by PyMOL with pseudoatom spheres at 
position=[0, 0, 0] and [1, 0, 0], in grey90 and red, respectively).  The first 
file, "test.dae", was output directly by PyMOL and has one instance of each 
sphere, for a total file size of 21545 bytes.  Manually adding a second 
instance of each sphere (translated by +/- 4Å along the X axis) in 
"test-added.dae" adds only 1147 bytes to the file (look for  and  in your favorite text 
editor), compared to adding 18174 bytes if the two additional spheres are 
exported from PyMOL with their additional geometries by adding additional 
pseudoatoms (that file not attached).  That's an almost 94% reduction per added 
sphere; for scenes with many spheres, the storage savings would be substantial.

On the other hand, if there is a way for color to be specified separately from 
the  element (which I imagine must be possible, but I haven't found a 
clear example of how to do this), that would be the most preferred option, as 
it would allow us to use a single sphere  element per output file.

Thanks to Gary for bringing this up.  Thomas, perhaps we can talk offline about 
what might be the best way to implement this?

Cheers, 
Jared


On June 6, 2018 at 2:24:08 PM, Thomas Holder (thomas.hol...@schrodinger.com) 
wrote:

Hi Gary,

Do you know an application which can actually read COLLADA files with sphere 
primitives? We've faced the problem that most tools only handle COLLADA 1.4, so 
if PyMOL would use COLLADA 1.5 features, the programs we know wouldn't read the 
exported files. See https://pymolwiki.org/index.php/COLLADA#Limitations

I fully agree that sphere primitives and other COLLADA 1.5 features would be 
better (smaller files, precise sphere representation, etc.).

Thomas

> On Jun 6, 2018, at 1:19 PM, Gary Oberbrunner  
> wrote:
>  
> The collada file exported by pymol would be smaller and export/import faster, 
> I think, if it used geometry_instance for spheres rather than giving each 
> sphere its own geometry/mesh/accessors/etc.. Has that been discussed before?
>  
> --  
> Gary Oberbrunner

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


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

test.dae
Description: Binary data


test-added.dae
Description: Binary data
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Re: [PyMOL] PyMOL without OpenGL (OS X)?

2018-06-06 Thread David Mathog

On 06-Jun-2018 11:29, Thomas Holder wrote:

PyMOL uses OpenGL on macOS, so if Apple drops it, we're screwed :-(


I was afraid of that.


For now they have deprecated it, let's hope that they ship the
libraries for a couple more years...


Or somebody writes OGL2MTL - a library with the OpenGL API that 
translates everything to metal.


Thanks,

David Mathog
mat...@caltech.edu
Manager, Sequence Analysis Facility, Biology Division, Caltech

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net


Re: [PyMOL] PyMOL without OpenGL (OS X)?

2018-06-06 Thread Thomas Holder
Hi David,

PyMOL uses OpenGL on macOS, so if Apple drops it, we're screwed :-( For now 
they have deprecated it, let's hope that they ship the libraries for a couple 
more years...

Thomas

> On Jun 6, 2018, at 6:23 PM, David Mathog  wrote:
> 
> As reported here:
> 
> https://arstechnica.com/gadgets/2018/06/the-end-of-opengl-support-other-updates-apple-didnt-share-at-the-keynote/
> 
> Apple has declared that they are dropping support for OpenGL from OS X.  How 
> will that affect PyMOL on OS X?  Does that version already use metal (or 
> something else) or is it still OpenGL based?
> 
> Thanks,
> 
> David Mathog
> mat...@caltech.edu
> Manager, Sequence Analysis Facility, Biology Division, Caltech

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


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Re: [PyMOL] Collada export with instances?

2018-06-06 Thread Thomas Holder
Hi Gary,

Do you know an application which can actually read COLLADA files with sphere 
primitives? We've faced the problem that most tools only handle COLLADA 1.4, so 
if PyMOL would use COLLADA 1.5 features, the programs we know wouldn't read the 
exported files. See https://pymolwiki.org/index.php/COLLADA#Limitations

I fully agree that sphere primitives and other COLLADA 1.5 features would be 
better (smaller files, precise sphere representation, etc.).

Thomas

> On Jun 6, 2018, at 1:19 PM, Gary Oberbrunner  
> wrote:
> 
> The collada file exported by pymol would be smaller and export/import faster, 
> I think, if it used geometry_instance for spheres rather than giving each 
> sphere its own geometry/mesh/accessors/etc.. Has that been discussed before?
> 
> -- 
> Gary Oberbrunner

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


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

[PyMOL] PyMOL without OpenGL (OS X)?

2018-06-06 Thread David Mathog

As reported here:

https://arstechnica.com/gadgets/2018/06/the-end-of-opengl-support-other-updates-apple-didnt-share-at-the-keynote/

Apple has declared that they are dropping support for OpenGL from OS X.  
How will that affect PyMOL on OS X?  Does that version already use metal 
(or something else) or is it still OpenGL based?


Thanks,

David Mathog
mat...@caltech.edu
Manager, Sequence Analysis Facility, Biology Division, Caltech

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net


[PyMOL] Collada export with instances?

2018-06-06 Thread Gary Oberbrunner
The collada file exported by pymol would be smaller and export/import
faster, I think, if it used geometry_instance for spheres rather than
giving each sphere its own geometry/mesh/accessors/etc.. Has that been
discussed before?

-- 
Gary Oberbrunner
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

[PyMOL] Problem with autodock_plugin.py

2018-06-06 Thread Stephen P. Molnar
I'm running PyMOL v-2.2.0a0 on my Debian Stretch Platform and installed 
the current autodock plugin.


Execution of the plugin on a test system 1ACL.pdb (I have run this 
system with MGL_Tools as the gui)  did produce correct results.


However the execution of the plugin differed from what I have seen in 
earlier versions of PyMOL.


Also, none of the run messages were displayed in PyMOL during the 
execution of autogrid and autodock.  I monitored the execution of both 
in a text editor.


Also when I attempted loading the docking log in View Poses the only 
files that were found were DME.pdbqt for the ligand and 
receptor.1acl.pdbqt for the protein.


The PyMOL messages are:

 PyMOL(TM) Molecular Graphics System, Version 2.2.0a0.
 Copyright (c) Schrodinger, LLC.
 All Rights Reserved.

Created by Warren L. DeLano, Ph.D.

PyMOL is user-supported open-source software.  Although some versions
are freely available, PyMOL is not in the public domain.

If PyMOL is helpful in your work or study, then please volunteer
support for our ongoing efforts to create open and affordable 
scientific
software by purchasing a PyMOL Maintenance and/or Support 
subscription.


More information can be found at "http://www.pymol.org;.

Enter "help" for a list of commands.
Enter "help " for information on a specific command.

 Hit ESC anytime to toggle between text and graphics.

 Detected OpenGL version 3.0. Shaders available.
 Detected GLSL version 1.30.
 OpenGL graphics engine:
  GL_VENDOR:   nouveau
  GL_RENDERER: Gallium 0.4 on NVD9
  GL_VERSION:  3.0 Mesa 13.0.6
 Detected blacklisted graphics driver.  Disabling shaders.
 Detected 8 CPU cores.  Enabled multithreaded rendering.

HEADERHYDROLASE(CARBOXYLIC ESTERASE)  18-AUG-93   1ACL
TITLE QUATERNARY LIGAND BINDING TO AROMATIC RESIDUES IN THE ACTIVE-SITE
TITLE2 GORGE OF ACETYLCHOLINESTERASE
COMPNDMOL_ID: 1;
COMPND   2 MOLECULE: ACETYLCHOLINESTERASE;
COMPND   3 CHAIN: A;
COMPND   4 EC: 3.1.1.7;
COMPND   5 ENGINEERED: YES
 ObjectMolecule: Read secondary structure assignments.
 ObjectMolecule: Read crystal symmetry information.
 CmdLoad: PDB-string loaded into object "1acl_m", state 1.
 CmdLoad: PDB-string loaded into object "DME", state 1.
/home/comp/Apps/Models/1ACL/PyMOL_Test
/home/comp/Apps/Models/1ACL/PyMOL_Test/receptor.1acl_m.pdb
Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
  File 
"/home/comp/Apps/PyMOL/modules/pmg_tk/startup/autodock_plugin.py", line 
255, in run

self.page.insert('end', "%s" % line)
  File "", line 1, in insert
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 3113, in insert
self.tk.call((self._w, 'insert', index, chars) + args)
RuntimeError: main thread is not in main loop

Exception in thread Thread-5:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
  File 
"/home/comp/Apps/PyMOL/modules/pmg_tk/startup/autodock_plugin.py", line 
255, in run

self.page.insert('end', "%s" % line)
  File "", line 1, in insert
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 3113, in insert
self.tk.call((self._w, 'insert', index, chars) + args)
RuntimeError: main thread is not in main loop

 Exception in Tk callback
  Function: > 
(type: )

  Args: ()
Traceback (innermost last):
  File "/usr/lib/python2.7/dist-packages/Pmw/Pmw_1_3/lib/PmwBase.py", 
line 1747, in __call__

return apply(self.func, args)
  File 
"/home/comp/Apps/PyMOL/modules/pmg_tk/startup/autodock_plugin.py", line 
2459, in load_ligand_file

self.load_pdbqt(filename)
  File 
"/home/comp/Apps/PyMOL/modules/pmg_tk/startup/autodock_plugin.py", line 
2513, in load_pdbqt

lst = self.fileopen(filename, 'r').readlines()
: 'NoneType' object has no attribute 
'readlines'


 Exception in Tk callback
  Function: > 
(type: )

  Args: ()
Traceback (innermost last):
  File "/usr/lib/python2.7/dist-packages/Pmw/Pmw_1_3/lib/PmwBase.py", 
line 1747, in __call__

return apply(self.func, args)
  File 
"/home/comp/Apps/PyMOL/modules/pmg_tk/startup/autodock_plugin.py", line 
2459, in load_ligand_file

self.load_pdbqt(filename)
  File 
"/home/comp/Apps/PyMOL/modules/pmg_tk/startup/autodock_plugin.py", line 
2540, in load_pdbqt

self.update_combo(name)
  File 
"/home/comp/Apps/PyMOL/modules/pmg_tk/startup/autodock_plugin.py", line 
2547, in update_combo
self.pose_viewer_ligand_pages[name] = {'name': 
self.pose_viewer_notebook.add(name)}
  File 
"/usr/lib/python2.7/dist-packages/Pmw/Pmw_1_3/lib/PmwNoteBook.py", line 
204, in add

return apply(self.insert, (pageName, len(self._pageNames)), kw)
  File 
"/usr/lib/python2.7/dist-packages/Pmw/Pmw_1_3/lib/PmwNoteBook.py", line 
153, in insert

Tkinter.Frame, self._hull), pageOptions)
  File "/usr/lib/python2.7/dist-packages/Pmw/Pmw_1_3/lib/PmwBase.py", 
line 465, in createcomponent


[PyMOL] Collada export using instances?

2018-06-06 Thread Gary Oberbrunner
The collada file exported by pymol would be smaller and export/import
faster, I think, if it used geometry_instance for spheres rather than
giving each sphere its own geometry/mesh/accessors/etc.. Has that been
discussed before?

-- 
Gary
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net