Hey Ram,

Okay, back on a normal keyboard. Managed even to misspell my own name!
Anyway, the solution is quite simple. But does require a bit of python
on the command line as explained below. First, make a script
'nload.py' with the following contents:

#------

import glob

def npdb(pattern="*.pdb",n=10):
    pdblist = glob.glob(pattern)
    for i in xrange(0,len(pdblist),n):
        yield pdblist[i:i+n]

def nload(pattern="*.pdb",n=10):
    for pdbNames in npdb(pattern,n):
        for j in pdbNames:
            cmd.load(j,object=j)
        print "Loaded structures:\n","\n".join(pdbNames)
        yield pdbNames

#-------

Start pymol with the script as argument:

pymol nload.py

Then on the command line, type:

pdbiter=nload()

If you want to go through a specific set of pdb files or want to load
from a different directory, give an argument as you would on the unix
command line:

pdbiter=nload("/path/to/*.pdb")

The default is to take by tens, if you want to have a different
number, add an argument:

pdbiter=nload(n=25)

Neither of these seems to do much; they generate an object for
iteration, which has a method .next() for invoking a next cycle, i.e.,
loading the next set of structures. So type

pdbiter.next()

and do it again if you want the next set. Don't forget to delete the
objects that are loaded, unless you want to add the next set to it.
And maybe have a script at hand for setting the appearance after
loading. If you care to script things, invoking pdbiter.next() returns
the list of object names that are loaded.

I would suggest finding a Python tutorial, if you haven't done so
already. It will really allow you to get the most out of PyMOL.

Hope it helps,

Tsjerk



On Fri, Jul 15, 2011 at 9:56 PM, Marius Retegan
<marius.s.rete...@gmail.com> wrote:
> You could try something like this in a terminal
>
> for i in $(seq 1 1 100); do pymol $i.pdb; done
>
> if your file name are 1.pdb, 2.pdb ... 100.pdb
>
> Marius
>
> On Fri, Jul 15, 2011 at 9:00 PM, Tsjerk Wassenaar <tsje...@gmail.com> wrote:
>> Hey Ram,
>>
>> It's scriptable, but not very doable on this Android :p
>> The best solution would involve a generator funtion that takes a file
>> pattern and a number, using glob to expand the file list, and using yield at
>> each cycle.
>> For a pythonista that should make sense ;) I may take it up when I'm typing
>> with two hands again :)
>>
>> Cheers,
>>
>> Tsjerl
>>
>> On Jul 15, 2011 7:40 PM, "r n" <ramm...@yahoo.com> wrote:
>>
>> Hi
>> I wanted to load 100 pdbs from 2000 pdb files.
>>
>> also is there way to load first 100 then second 200 etc.,?
>>
>> Is there any command that could control the number of PDB to load to pymol
>> or script?
>>
>> I did downloaded PDBDIR from pymol wiki, but not much help. It did hang up
>> for long time.
>> Is there any commands like pymol  c*.pdb, number=10 or file=10?
>>
>> any immediate help will be appreciated.
>> thanks
>> ram
>>
>>
>>
>> ------------------------------------------------------------------------------
>> AppSumo Presents a FREE Video for the SourceForge Community by Eric
>> Ries, the creator of the Lean Startup Methodology on "Lean Startup
>> Secrets Revealed." This video shows you how to validate your ideas,
>> optimize your ideas and identify your business strategy.
>> http://p.sf.net/sfu/appsumosfdev2dev
>> _______________________________________________
>> 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
>>
>> ------------------------------------------------------------------------------
>> AppSumo Presents a FREE Video for the SourceForge Community by Eric
>> Ries, the creator of the Lean Startup Methodology on "Lean Startup
>> Secrets Revealed." This video shows you how to validate your ideas,
>> optimize your ideas and identify your business strategy.
>> http://p.sf.net/sfu/appsumosfdev2dev
>> _______________________________________________
>> 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
>>
>



-- 
Tsjerk A. Wassenaar, Ph.D.

post-doctoral researcher
Molecular Dynamics Group
* Groningen Institute for Biomolecular Research and Biotechnology
* Zernike Institute for Advanced Materials
University of Groningen
The Netherlands

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
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