From: Jack Bulat (jack.bulat_at_gmail.com)
Date: Mon Dec 24 2012 - 12:13:29 CST

Hi Adrian,

This may be the issue. Apparently, AtomSel is depreciated since VMD 1.8.6, and atomsel is used instead:

http://www.ks.uiuc.edu/Research/vmd/current/ug/node161.html

This would make sense, since the Python interpreter is expecting an atomsel type (note the case-sensitivity). Try using the atomsel type instead.

Good luck!
Jack Bulat

On Dec 21, 2012, at 5:52 AM, Adrian JasiƄski <jasinski.adrian_at_gmail.com> wrote:

> hi all
>
> I just want to write simple python script
> I want to read psf pdb and dcd
> make a selection of protein structure and write it to file for some of frames (each frame to indyvidual file).
> but I have some error with selection and I don't know why
> can you help me?
> my script look like that:
>
> from Molecule import *
> from AtomSel import AtomSel
>
> mol1=Molecule()
> mol1.load('/home/user/protein.pdb')
> mol1.load('/home/user/protein.psf')
> mol1.load('/home/user/protein.dcd')
> prot=AtomSel('protein')
>
> for i in range(0, 24001, 1000):
> mol1.save('/home/user/frames/frame%s.pdb' % i, 'pdb', first = i, last = i, step = 1, sel=prot)
>
>
> ----
> I run this script by command:
>
> vmd -python -e vmd_python.py
> and I get the error:
>
> Traceback (most recent call last):
> File "VMD", line 23, in <module>
> File "/usr/local/lib/vmd/scripts/python/Molecule.py", line 139, in save
> nframes = molecule.write(self.id, filetype, filename, first, last, step, waitfor, selection=sel)
> TypeError: expected atomsel
>
> but script is working when I put sel=None
>
>
>