VMD-L Mailing List
From: Michael Kreim (mkreim_at_keychem.de)
Date: Tue Jul 21 2009 - 06:49:44 CDT
- Next message: ltrabuco_at_ks.uiuc.edu: "of diet pills, like a racing heart or queasy stomach"
- Previous message: John Stone: "Re: need convert when using VMD to make a movie under Mac"
- Next in thread: Axel Kohlmeyer: "Re: error using Molecule.save() (vmd python)"
- Reply: Axel Kohlmeyer: "Re: error using Molecule.save() (vmd python)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Hello,
I have (again) some trouble in using python 2.2.3 inside vmd 1.8.6.
I want to save each segment of a pdb file in an own pdb file. I am doing
this using this function:
def split_PDB_into_Segments(pdb):
import Molecule
import atomsel
mid=Molecule.Molecule()
mid.load(pdb, filetype='pdb', first=0, last=-1, step=1, waitfor=-1)
sorted_segnames = _uniq(atomsel.atomsel("all").get("segname"))
for seg in sorted_segnames:
segstr = "segname " + seg
sel_seg = atomsel.atomsel(segstr)
mid.save(seg+".pdb", filetype='pdb', first=0, last=-1, step=1,
waitfor=-1, sel=sel_seg)
mid.delete()
(_uniq() is a small function that works similar as the unix uniq command)
If I run this code, I get the following error:
Traceback (most recent call last):
File "VMD", line 30, in ?
File "/x/x.py", line 45, in split_PDB_into_Segments
mid.save(seg+".pdb", filetype='pdb', first=0, last=-1, step=1,
waitfor=-1, sel=sel_seg)
File "/x/vmd/linux/vmd_amd64/lib/vmd/scripts/python/Molecule.py", line
121, in save
if isinstance(sel, VMD.AtomSel.AtomSel):
AttributeError: 'module' object has no attribute 'AtomSel'
Maybe somebody can help me in how to use the Molecule.save() routine
correctly. I followed the documentation given by help(Molecule).
Thanks a lot.
Best regards,
Michael
- Next message: ltrabuco_at_ks.uiuc.edu: "of diet pills, like a racing heart or queasy stomach"
- Previous message: John Stone: "Re: need convert when using VMD to make a movie under Mac"
- Next in thread: Axel Kohlmeyer: "Re: error using Molecule.save() (vmd python)"
- Reply: Axel Kohlmeyer: "Re: error using Molecule.save() (vmd python)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]