VMD-L Mailing List
From: Monika Madhavi (monikamadhavi_at_gmail.com)
Date: Sun Mar 08 2015 - 09:33:03 CDT
- Next message: Joaquim Rui de Castro Rodrigues: "RE: How to write coordinates to a pdb without replacing existing entries"
- Previous message: Monika Madhavi: "How to select a particular water molecule from a water box"
- Next in thread: Joaquim Rui de Castro Rodrigues: "RE: How to write coordinates to a pdb without replacing existing entries"
- Reply: Joaquim Rui de Castro Rodrigues: "RE: How to write coordinates to a pdb without replacing existing entries"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Dear all,
I want to write coordinates of some selected molecules to a separate pdb
and I want to add the entries to the same pdb file for each molecule I
select in each iteration of the for loop.
I used this tcl command
set outfile [open out.pdb w]
for {set i 0} {$i<N} {incr i} {
set sel [atomselect top "resid $i"]
$sel writepdb out.pdb
}
this code keeps writing the coordinates of each selection to a new file at
each iteration so at the end I only have the coordinates of the last atom
selected. How can I keep writing the coordinates to the same pdb without
deleting the old entries. Any help is greatly appreciated.
Regards,
Monika
-- W.A.Monika Madhavi Lecturer (Probation), Department of Physics, University of Colombo.
- Next message: Joaquim Rui de Castro Rodrigues: "RE: How to write coordinates to a pdb without replacing existing entries"
- Previous message: Monika Madhavi: "How to select a particular water molecule from a water box"
- Next in thread: Joaquim Rui de Castro Rodrigues: "RE: How to write coordinates to a pdb without replacing existing entries"
- Reply: Joaquim Rui de Castro Rodrigues: "RE: How to write coordinates to a pdb without replacing existing entries"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]