VMD-L Mailing List
From: John Stone (johns_at_ks.uiuc.edu)
Date: Tue Jun 13 2006 - 15:51:24 CDT
- Next message: Moumita Maiti: "Re: namd-l: the patch between segments for multiple chains molecule."
- Previous message: John Stone: "Re: fading rep scripts"
- In reply to: Per Jr. Greisen: "python - writes frames to pdb files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Hi,
Try this instead:
import Molecule as mol
import AtomSel as sel
import vmdnumpy
import graphics as gl
import molecule
import trans
m = mol.Molecule()
m.load('1di9', filetype='webpdb')
mid = int(m)
i=0
cas = sel.AtomSel('name CA', mid)
cas.frame(i)
cas.write('frame' + str(i) + '.pdb', 'pdb');
On Sat, Jun 10, 2006 at 01:19:11PM +0200, Per Jr. Greisen wrote:
> Hey,
>
> I am trying to use the python interface to write each frame from a
> simulation to a pdb file using the function write in AtomSel likes this:
>
> ca = AtomSel(frame=i)
> ca.write(self,'frame'+str(i),'pdb')
>
> but gets the error self not a name?
>
> How to fix this
>
> Thanks in advance
>
>
> --
> Best Regards
>
> Per Jr. Greisen
> +4528648657
-- NIH Resource for Macromolecular Modeling and Bioinformatics Beckman Institute for Advanced Science and Technology University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801 Email: johns_at_ks.uiuc.edu Phone: 217-244-3349 WWW: http://www.ks.uiuc.edu/~johns/ Fax: 217-244-6078
- Next message: Moumita Maiti: "Re: namd-l: the patch between segments for multiple chains molecule."
- Previous message: John Stone: "Re: fading rep scripts"
- In reply to: Per Jr. Greisen: "python - writes frames to pdb files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]