Paride,

cmd.pseudoatom is only for creating atoms, not adding coordinates.  What
you're doing is creating a separate atom for each molecular state, which
means N-atoms x M-states = a huge inefficiency!.

Look at what particle01.py is doing in terms of merely updating existing
coordinates using alter_state.  Then, the only additional trick to
incorporate is to copy the first state before using alter_state to modify
coordinates for the copied state.

see examples/devel/particle02.py (just added) for a working example of what
your code should do instead.

Cheers,
Warren

--
DeLano Scientific LLC
Subscriber Support Services
mailto:del...@delsci.info
 
"Not yet a PyMOL Subscriber, but want to support the project?  Email
sa...@delsci.com to quote your lab, school, or employer.  Thank you for
sponsoring this open-source endeavor!" -WLD
 

> -----Original Message-----
> From: Paride Legovini [mailto:legov...@spiro.fisica.unipd.it] 
> Sent: Tuesday, November 06, 2007 4:48 PM
> To: DeLano Scientific
> Cc: pymol-users@lists.sourceforge.net
> Subject: Re: [PyMOL] file format for homebrew MD software
> 
> DeLano Scientific wrote:
> > One option is to simply create and modify coordinates 
> real-time using 
> > Python.  See example particle01.py
> 
> I'm trying the code I'm pasting at the end of this email, but 
> I have a strange problem with pseudoatom: it is EXTREMELY 
> slow, and I mean that is takes AGES to read 100 files, eating 
> 100% of my CPU. Loading files with 'load' works fine. What's wrong?
> 
> The dat files are just xyz coordinates and I'm experimenting 
> with no ten atoms per file. A partial example:
> 
> $ cat data/step000011.dat
> 0.097806 0.094156 0.934356
> 0.083930 0.020571 1.938765
> and so on...
> 
> ---------- code starts here ----------
> 
> from glob import glob
> from pymol import cmd
> 
> file_list = glob("data/step*.dat")
> 
> # for some reason file_list is unsorted.
> file_list.sort()
> 
> counter = 0
> 
> for file in file_list:
>         counter = counter + 1
>         f = open(file, "r")
>         for line in f:
>                 position = line.split()
>               cmd.pseudoatom("polymer", pos=position)
>         f.close()
> 


Reply via email to