Hello All,
I managed to solve the problem where many objects were not getting
included into a script created session "all" meta object  with help
from Jason .

Once I got rid of duplicate object names either using python or the
setting "auto_rename_duplicates"..I could load around 250 objects
without any issues into the session file. All resulting objects were
bound by "all" and could be toggled on and off.

I am reproducing the exchange with Jason below.

Thanks again
Hari


Jason Vertrees jason.vertr...@schrodinger.com
to: hari jayaram <hari...@gmail.com>
date: Thu, Mar 22, 2012 at 10:31 AM
Hari,

Thanks for the feedback.

If you have duplicate object names, look into the setting,
"autor_ename_duplicates". Also, look into using the get_unused_name
command. It's helpful for scripts like this.

Cheers,

-- Jason
---------- Forwarded message ----------
From: hari jayaram <hari...@gmail.com>
Date: Thu, Mar 22, 2012 at 10:22 AM
Subject: Re: [PyMOL] Maximum number of objects/menu items in internal
GUI ? machine has lots of RAM and big GPU
To: Jason Vertrees <jason.vertr...@schrodinger.com>


Hi Jason,
I finally think I know why I was having objects that were not included
in the "all" object selection from inside Pymol when I ran my script.

When I had duplicate objects 1LZ1-remodel-1.pdb and 1LZ1-remodel-2.pdb
and both were loaded and renamed during my script to 1LZ1-remodel
..some of the objects escaped being bound by all once I added code
that does not allow duplicate object names  all of my objects are
toggled off by clicking "all".

So it definitely does not seem to be a graphics card memory issue.

I will probe further and write in once I understand exactly whats going on.

Thanks for your help

Hari

Here is the current version of my script

import cmd
import os
import pymol
import re

cpi = re.compile("(\d{6})")
pymol.finish_launching()

mymax = 60
count = 1
file_roots = []
for root,dirs,files in os.walk("Y:/Projects/Xtal structure/"):
    for afile in files:
        print "FILE",afile
        if ("pdb" in afile and "CPI-" in afile ) and not ("badcoords"
in afile) and count <= mymax :
            if afile[:10] in file_roots:
                altname = "V%d"% count + str(afile)
            else:
                altname = afile
            try:
                cmd.load(os.path.join(root,afile),altname)
                file_roots.append(afile[:10])
                count = count + 1
            except:
                print "Problem Loading:", afile
groups = []
done = []
for i in cmd.get_names():
    try:
        # To weed out duplicates
        if i[:10] not in done:
            group_pool = []
            cmd.extract ("waste%s" %i,"%s and not (resi 66 or resi
68-1114 or resi 119 or resi 123-161 or (organic within 3.5 of (resi 66
or resi 68-1114 or resi 119 or resi 123-161)) \
              or (resn HOH within 3.5 of(resi 66 or resi 68-1114 or
resi 119 or resi 123-161) ))" % i)
            cmd.delete("waste%s"%i)
            surfdonor = "surfdonor-%s" % i[:10]
            surfname = "surf-%s" % i[:10]
            cartoon_object = "cartoon-%s" % i[:10]
            ligands = "ligands-%s" % i[:10]
            solvent = "solvent-%s" %i[:10]

            # Create Object for surface and cartoon

            cmd.copy(surfdonor,i)
            cmd.copy(cartoon_object,i)

            # Create selection containing ligands and make them into
their own object
            cmd.select(ligands+"sel","organic and " + surfdonor)
            cmd.create(ligands,"(%s)"%ligands)
            cmd.delete(ligands+"sel")
            group_pool.append(ligands)

            # Create selection containing solvent
            cmd.select(solvent+"sel","resn HOH and " + surfdonor)
            cmd.create(solvent,"(%s)" % solvent)
            cmd.delete(solvent+"sel")
            group_pool.append(solvent)

            # Extract ligand object and solvent from surface clone object
            cmd.extract(surfname,"%s and not (resn HOH or organic)" % surfdonor)
            cmd.delete(surfdonor)
            group_pool.append(surfname)
            pymol.preset.ligand_cartoon(cartoon_object)
            group_pool.append(cartoon_object)
            group_pool.append(cartoon_object + "_pol_conts")
            group_pool.append(i)
            try:
                group_name = "%s%s" % (str(i[0:3]),cpi.search(i).groups()[0])
            except AttributeError:
                group_name = "group"+ i
            print group_name
            cmd.group(group_name," ".join(group_pool))
            done.append(i[:10])
        else:
            print "SKIPPING"*3, i
    except :
            print "Problem with" , i

On Thu, Mar 15, 2012 at 2:44 PM, Jason Vertrees
<jason.vertr...@schrodinger.com> wrote:
>
> Hari,
>
> You might want to find a video memory profiler and see if PyMOL's
> using all the memory.
>
> Cheers,
>
> -- Jason
>
> On Thu, Mar 15, 2012 at 12:44 PM, hari jayaram <hari...@gmail.com> wrote:
> > Hi Jason,
> >
> > I think it does seem like  a memory issue, but I would like you to confirm
> >
> > I tried 10,20,30,40 objects ..and they all worked . "All" did indeed bind
> > all displayed objects which I could toggle off by clicking "all"
> >
> > When I set the max to 50 , there were 48 objects loaded ..And the 49th
> > object showed up only as "lines" with the prefix surf-
> > This object was not bound to "All" and was just an orphan object
> >
> >
> > I am wondering if this could be a memory issue. Its strange that the objects
> > all load after this number ( 50 , 60 ) but just dont get bound to "all"
> >
> >
> > Thanks
> > Hari
> >
> > On Thu, Mar 15, 2012 at 11:57 AM, hari jayaram <hari...@gmail.com> wrote:
> >>
> >> Hi Jason..
> >>
> >> I am trying a modified version where I am looking for the break point..i.e
> >> at what number of objects do I start to run into issues
> >>
> >> Pymol puts up an "Error in Background function" Tk window with some
> >> information ( see below):
> >>
> >> The resulting session ..still has "all" bound to the 10 objects in the
> >> session. I will gradually increase this number upto 50 and get back to you
> >> with how that works.
> >>
> >> Thanks for your help in figuring this out
> >>
> >> Hari
> >>
> >>
> >> Error: 1
> >> CmdException Exception in Tk callback
> >>   Function: <function callit at 0x000000000BBC3F28> (type: <type
> >> 'function'>)
> >>   Args: ()
> >> Traceback (innermost last):
> >>   File "C:\Program Files\PyMOL\PyMOL/modules\Pmw\Pmw_1_2\lib\PmwBase.py",
> >> line 1747, in __call__
> >>     return apply(self.func, args)
> >>   File "C:\Program Files\PyMOL\PyMOL\py27\lib\lib-tk\Tkinter.py", line
> >> 495, in callit
> >>     func(*args)
> >>   File "C:\Program
> >> Files\PyMOL\PyMOL/modules\pmg_tk\skins\normal\__init__.py", line 518, in
> >> update_volume
> >>     if len(self.cmd.get_names_of_type("object:volume",public=1))>0:
> >>   File "C:\Program Files\PyMOL\PyMOL/modules\pymol\querying.py", line
> >> 1447, in get_names_of_type
> >>     types = map(_self.get_type,obj)
> >>   File "C:\Program Files\PyMOL\PyMOL/modules\pymol\querying.py", line
> >> 1214, in get_type
> >>     if _raising(r,_self): raise pymol.CmdException
> >> CmdException: <pymol.CmdException instance at 0x000000000BC4F048>
> >>
> >>
> >> My modified script is:
> >>
> >> for root,dirs,files in os.walk("Y:/Projects/Xtal structure/"):
> >>     for afile in files:
> >>         print "FILE",afile
> >>         if ("pdb" in afile and "CPI-" in afile )  and count <= mymax:
> >>             try:
> >>                 cmd.load(os.path.join(root,afile))
> >>                 count = count + 1
> >>             except:
> >>                 print "Problem Loading:", afile
> >> groups = []
> >> for i in cmd.get_names():
> >>     try:
> >>         group_pool = []
> >>
> >>         surfdonor = "surfdonor-%s" % i[:10]
> >>         surfname = "surf-%s" % i[:10]
> >>         cartoon_object = "cartoon-%s" % i[:10]
> >>         ligands = "ligands-%s" % i[:10]
> >>         solvent = "solvent-%s" %i[:10]
> >>
> >>         # Create Object for surface and cartoon
> >>
> >>         cmd.copy(surfdonor,i)
> >>         cmd.copy(cartoon_object,i)
> >>
> >>         # Create selection containing ligands and make them into their own
> >> object
> >>         cmd.select(ligands+"sel","organic and " + surfdonor)
> >>         cmd.create(ligands,"(%s)"%ligands)
> >>         cmd.delete(ligands+"sel")
> >>         group_pool.append(ligands)
> >>
> >>         # Create selection containing solvent
> >>         cmd.select(solvent+"sel","resn HOH and " + surfdonor)
> >>         cmd.create(solvent,"(%s)" % solvent)
> >>         cmd.delete(solvent+"sel")
> >>         group_pool.append(solvent)
> >>
> >>         # Extract ligand object and solvent from surface clone object
> >>         cmd.extract(surfname,"%s and not (resn HOH or organic)" %
> >> surfdonor)
> >>         cmd.delete(surfdonor)
> >>         group_pool.append(surfname)
> >>         pymol.preset.ligand_cartoon(cartoon_object)
> >>         group_pool.append(cartoon_object)
> >>         group_pool.append(cartoon_object + "_pol_conts")
> >>         group_pool.append(i)
> >>         try:
> >>             group_name = "%s%s" % (str(i[0:3]),cpi.search(i).groups()[0])
> >>         except AttributeError:
> >>             group_name = "group"+ i
> >>         print group_name
> >>         cmd.group(group_name," ".join(group_pool))
> >>     except :
> >>         print "Problem with" , i
> >>
> >>
> >> On Thu, Mar 15, 2012 at 11:41 AM, hari jayaram <hari...@gmail.com> wrote:
> >>>
> >>>
> >>> Hi Jason ,
> >>> Thanks for your email.
> >>> I tried this with script with around 50 pdbs - that would be around 200
> >>> objects in the final session present in 50 groups.
> >>> The proteins are all in the 14-18 kDa range and monomeric.
> >>>
> >>> My async_builds is off
> >>> My auto_defer_builds is set at 500
> >>>
> >>> I used two versions :
> >>>
> >>> 1.5.0.3 on Windows XP 64 bit
> >>> with  Quadro FX 880M
> >>>
> >>> And
> >>> 1.4.1 on a 64 bit Ubuntu Machine
> >>> With Quadro FX 3700
> >>>
> >>> On both versions and machines I had the same behavior.
> >>>
> >>> The Interesting thing is that, in  the final session rotation is very
> >>> smooth ..and all the object seem to be loaded and responding fine. Its 
> >>> only
> >>> that most of the objects dont seem to be encompassed by "all"..So hiding
> >>> everything is not possible in this  session rendering the session very
> >>> cluttered and the groups un-useable.  Any idea what else may be affecting 
> >>> my
> >>> session.
> >>>
> >>>
> >>>
> >>> Thanks
> >>> Hari
> >>>
> >>>
> >>>
> >>> On Thu, Mar 15, 2012 at 11:13 AM, Jason Vertrees
> >>> <jason.vertr...@schrodinger.com> wrote:
> >>>>
> >>>> Hi Hari,
> >>>>
> >>>> I've tried your script on hundreds of objects and it seems to work
> >>>> fine for me. What version of PyMOL are you using?
> >>>>
> >>>> Do you have the async_builds setting on? If so, set to what value?
> >>>> What about the auto_defer_builds settings?
> >>>>
> >>>> I wonder if your video card is out of memory.
> >>>>
> >>>> Cheers,
> >>>>
> >>>> -- Jason
> >>>>
> >>>> On Fri, Mar 9, 2012 at 5:59 PM, hari jayaram <hari...@gmail.com> wrote:
> >>>> > Hi I am scripting a visualization that involves roughly thirty to
> >>>> > fifty PDB
> >>>> > files with four objects each i.e 120 to 150 objects.  I have a 64 bit
> >>>> > machine with 16 GB RAM and a Quadro FX 3700 card running Ubuntu Lucid.
> >>>> >
> >>>> > At the end of the script I get a menu with what seems like all of the
> >>>> > objects suitably processed and grouped.
> >>>> > After this  when I click "all"  and say hide..everything , a whole lot
> >>>> > of
> >>>> > objects still stay displayed . Getting the ids for some of them by
> >>>> > right
> >>>> > clicking , it seems like they are not being included on the internal
> >>>> > GUI
> >>>> > menu even when I scroll to the bottom.
> >>>> > These objects are clearly created by my script but it seems like they
> >>>> > are
> >>>> > not part of "all"
> >>>> > Is it that "all" is not representing all of my objects because of some
> >>>> > limit
> >>>> > to number of objects that I am handling. The interesting thing is that
> >>>> > even
> >>>> > when all the objects are loaded Pymol remains very performant.
> >>>> >
> >>>> > Here is my script...nothing fancy but just a loader and a grouper of
> >>>> > PDBs
> >>>> > from a directory.
> >>>> >
> >>>> > Any help will be greatly appreciated
> >>>> > Thanks
> >>>> > Hari
> >>>> >
> >>>> >
> >>>> > import cmd
> >>>> > import os
> >>>> > import pymol
> >>>> > import re
> >>>> >
> >>>> > cpi = re.compile("(\d{6})")
> >>>> > pymol.finish_launching()
> >>>> >
> >>>> > for root,dirs,files in os.walk("/home/hari/mydownloadedPDbs/"):
> >>>> >     for afile in files:
> >>>> >         print "FILE",afile
> >>>> >         if "pdb" in afile:
> >>>> >             try:
> >>>> >                 cmd.load(os.path.join(root,afile))
> >>>> >             except:
> >>>> >                 print "Problem Loading:", afile
> >>>> >
> >>>> > groups = []
> >>>> > for i in cmd.get_names():
> >>>> >     try:
> >>>> >         group_pool = []
> >>>> >
> >>>> >         surfdonor = "surfdonor-%s" % i[:10]
> >>>> >         surfname = "surf-%s" % i[:10]
> >>>> >         cartoon_object = "cartoon-%s" % i[:10]
> >>>> >         ligands = "ligands-%s" % i[:10]
> >>>> >         solvent = "solvent-%s" %i[:10]
> >>>> >
> >>>> >         # Create Object for surface and cartoon
> >>>> >
> >>>> >         cmd.copy(surfdonor,i)
> >>>> >         cmd.copy(cartoon_object,i)
> >>>> >
> >>>> >         # Create selection containing ligands and make them into their
> >>>> > own
> >>>> > object
> >>>> >         cmd.select(ligands+"sel","organic and " + surfdonor)
> >>>> >         cmd.create(ligands,"(%s)"%ligands)
> >>>> >         cmd.delete(ligands+"sel")
> >>>> >         group_pool.append(ligands)
> >>>> >
> >>>> >         # Create selection containing solvent
> >>>> >         cmd.select(solvent+"sel","resn HOH and " + surfdonor)
> >>>> >         cmd.create(solvent,"(%s)" % solvent)
> >>>> >         cmd.delete(solvent+"sel")
> >>>> >         group_pool.append(solvent)
> >>>> >
> >>>> >         # Extract ligand object and solvent from surface clone object
> >>>> >         cmd.extract(surfname,"%s and not (resn HOH or organic)" %
> >>>> > surfdonor)
> >>>> >         cmd.delete(surfdonor)
> >>>> >         group_pool.append(surfname)
> >>>> >         pymol.preset.ligand_cartoon(cartoon_object)
> >>>> >         group_pool.append(cartoon_object)
> >>>> >         group_pool.append(cartoon_object + "_pol_conts")
> >>>> >         group_pool.append(i)
> >>>> >         try:
> >>>> >             group_name = "%s%s" %
> >>>> > (str(i[0:3]),cpi.search(i).groups()[0])
> >>>> >         except AttributeError:
> >>>> >             group_name = "group"+ i
> >>>> >         print group_name
> >>>> >         cmd.group(group_name," ".join(group_pool))
> >>>> >     except :
> >>>> >         print "Problem with" , i
> >>>> >
> >>>> >
> >>>> >
> >>>> > ------------------------------------------------------------------------------
> >>>> > Virtualization & Cloud Management Using Capacity Planning
> >>>> > Cloud computing makes use of virtualization - but cloud computing
> >>>> > also focuses on allowing computing to be delivered as a service.
> >>>> > http://www.accelacomm.com/jaw/sfnl/114/51521223/
> >>>> > _______________________________________________
> >>>> > 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
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> Jason Vertrees, PhD
> >>>> PyMOL Product Manager
> >>>> Schrödinger, LLC
> >>>>
> >>>> (e) jason.vertr...@schrodinger.com
> >>>> (o) +1 (603) 374-7120
> >>>
> >>>
> >>
> >
>
>
>
> --
> Jason Vertrees, PhD
> PyMOL Product Manager
> Schrödinger, LLC
>
> (e) jason.vertr...@schrodinger.com
> (o) +1 (603) 374-7120

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
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

Reply via email to