The Molecular Graphics Laboratory Forum

AutoDock, AutoLigand, MGLTools, Vina, PyRx and more.
It is currently Mon Jan 22, 2018 7:53 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Tue Apr 03, 2012 6:51 pm 
Offline
Millimolar User
Millimolar User
User avatar

Joined: Thu Mar 22, 2012 7:29 pm
Posts: 4
Location: boston for now...
Hi, Ludo,

Mike and I were testing the Atoms Representations in our project by using the callback, mv.displayCPK from epmvGUI.py.

The code is able to generate atoms per chain for a given molecule, e.g., 1CRN, but when I was testing out 2PTC and 1C1E, I noticed that the program hung for some time for each molecule, gave some output (e.g., DMR, ENH, HOH depending on which molecule I was trying to create atoms for...), and then arrived at generating the atoms representation in the Blender viewport.

I jotted the times down for each molecule, using your code in our project and then second set of times with just using EPMV....
Our Project:
1CRN: 1.37297582634277
2PTC: 219.45819091796875

EPMV Blender:
1CRN: 0.95885396003723314
2PTC: 188.27791595458984

If a molecule has more than one chain as in the case of 2PTC (2 chains), should EPMV be taking this long to generate the Atoms representation?

If you need more information, just let us know.

Thanks well in advance for your assistance. Cheers. - Rise


Top
 Profile  
 
PostPosted: Tue Apr 03, 2012 10:08 pm 
Offline
Picomolar User
Picomolar User
User avatar

Joined: Wed Apr 22, 2009 2:08 am
Posts: 235
Hi,

well first of all this is a common issue with molecular viewer how to display thousands of sphere at run time. It is even more difficult for blender. So something like GroEL in CPK representation will hang out any host. About the difference of time between a script approach and a plugin approach I can't tell especially if you use the exact same command. Maybe some object are already made when you use the plugin..I dont know. Are you running the script in background mode ?

A reason for the low performance for CPK rendering is that its based on python loop that generates all theses instance of spheres....this why now more an more molecular viewer start to use GPU procedural spheres (imposter) that make a huge difference. Another alternative I use is to produce a MSMS with a probe radius of 0.1



I will try to have a look at it !

thanks

Ludo


Top
 Profile  
 
PostPosted: Wed Apr 04, 2012 4:11 pm 
Offline
Millimolar User
Millimolar User
User avatar

Joined: Thu Mar 22, 2012 7:29 pm
Posts: 4
Location: boston for now...
Hi, Ludo,

We ran a script through the text editor in EPMV Blender which called displayCPK. I noticed that you have the PDB stored locally in .mgltools/pdbcache. Is 1CRN's geometry cached anywhere by any chance?

Here is the simple script that we used for the following PDBs (1CRN, 2PTC, and 1C1E). Let us know if you need more information. Much thanks. - Rise

import ePMV
from time import time

# launch an EPMV instance in 2nd Blender instance;
epmv = ePMV.epmv_start('blender25',debug=0)
epmv.initOption()

#get modules: MolecularViewer,
mv = epmv.mv

# Test with 1CRN, 2PTC, 1C1E
#mv.readMolecule("/Users/rise/Dropbox/MVB/pdb/1CRN.pdb", log=0)
#mv.readMolecule("/Users/rise/Dropbox/MVB/pdb/1c1e.pdb", log=0)
mv.readMolecule("/Users/rise/Dropbox/MVB/pdb/2PTC.pdb", log=0)
mol = mv.Mols[-1]
print("epmv_meshgenerator.mol = {0}".format(mol))

# surface type to display: 0=CoarseMS, 1=MSMS, Atoms=2
displaytype = 2

if displaytype == 2:
t1 = time()
sel = mol.name
display = True
scale = 1.0
mol.doCPK = True # draw Atoms question.
mv.displayCPK(sel,log=0,negate=(not display),scaleFactor=scale, redraw =0)

print("cpktest: time =", time()-t1)

pdbblend = "1CRN_b_cpk.blend"
print("pdbblend = {0}".format(pdbblend))


Top
 Profile  
 
PostPosted: Fri Apr 06, 2012 4:35 pm 
Offline
Picomolar User
Picomolar User
User avatar

Joined: Wed Apr 22, 2009 2:08 am
Posts: 235
Hi,

sorry I didn't answer earlier. I did some change and reduce the time for generating the spheres.
moreover, I was not able to reproduce the difference in time between a script and using the GUI.
The updated code is in the repository :
svn co https://subversion.assembla.com/svn/epmv/trunk ePMV
you can also use the repository for upy :
svn co https://subversion.assembla.com/svn/upy/trunk/upy upy

I get ('time ', 52.169325828552246) for both using 2PTC.
the script I used is :
Code:
from time import time
import ePMV
epmv = ePMV.get_ePMV()
if epmv is None :
    #crete a epmv instance
    epmv = ePMV.epmv_start('blender25',debug=0)
    epmv.initOption()
    self = epmv.mv
t1 = time()
self.readMolecule("/Users/ludo/.mgltools/1.5.6rc3/pdbcache/2ptc.pdb")
self.displayCPK(self.Mols[0], negate=False, quality=20, only=False, scaleFactor=1.0, log=0)
print(("time ", time()-t1))


What do you mean by "Is 1CRN's geometry cached anywhere by any chance? " are you talking about the pdb or the 3D objects ? only the PDB coordinate file are stored in the pdbcahe folder when you use the fetch commands. Would you like to have the geometry cached as well ?

Ludo


Top
 Profile  
 
PostPosted: Fri Apr 06, 2012 8:30 pm 
Offline
Millimolar User
Millimolar User
User avatar

Joined: Thu Mar 22, 2012 7:29 pm
Posts: 4
Location: boston for now...
Hi, Ludo,

Hm. Well, that's odd... I am still getting some hanging for PDBs such as 2PTC and 1C1E using our script with EPMV Blender 2.60.0 r14226 for the Mac OS X w/Lion. I've also used the EPMV plugin directly, and it takes awhile as well.

I'll use your script and see how all goes...I'll also download and take a look at the updated code in the EPMV repository and see if that speeds up things... I'll let you know...

I know that you are *very* busy... so once again thanks *very* much in advance. :-)

Have a great weekend. Cheers. - Rise


Top
 Profile  
 
PostPosted: Fri Apr 06, 2012 8:34 pm 
Offline
Picomolar User
Picomolar User
User avatar

Joined: Wed Apr 22, 2009 2:08 am
Posts: 235
You are very welcome,

Try to use the last code from the repo, this should gave you some speed up.
Next week I will try to see how can I find some other optimization..

Ludo


Top
 Profile  
 
PostPosted: Fri Apr 06, 2012 9:08 pm 
Offline
Millimolar User
Millimolar User
User avatar

Joined: Thu Mar 22, 2012 7:29 pm
Posts: 4
Location: boston for now...
Will do! Cheers. - Rise :ugeek:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
POWERED_BY
Translated by MaĆ«l Soucaze © 2009 phpBB.fr