VMD-L Mailing List
From: Laura X Sepulveda (lsepcl1_at_lsu.edu)
Date: Thu Jul 18 2024 - 12:52:06 CDT
- Next message: Roni Saiba: "Re: Working with trajectory and updating frames dependents on current frame"
- Previous message: Raman Preet Singh: "Re: Opening file after i downloaded vmd"
- Next in thread: Roni Saiba: "Re: Working with trajectory and updating frames dependents on current frame"
- Reply: Roni Saiba: "Re: Working with trajectory and updating frames dependents on current frame"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Dear all,
I have this script that is selects the closest 15 water molecules closer to residue named ACE NME(from the O distance to the N of ACE NME) and writes a pdb file per frame with this selection. However, I noticed that the molecules written to the pdb file depend on the current frame selected in the main window of VMD. Aren't they supposed to be in the order of the for loop? I am updating all selections and unsetting all variables, but still the pdb for frame n is different if the selected frame on the main window is not the same always.
Thanks, in advance!
set numframes [molinfo top get numframes]
set solvent_molecues_num 15
for { set f 0 } { $f < $numframes } { incr f 1} {
set sel_probe [atomselect top "resname ACE NME and name N"]
set sel_solv [atomselect top "resname WAT and name O and within 6.0 of resname ACE NME and name N"]
$sel_probe frame $f
$sel_probe update
$sel_solv frame $f
$sel_solv update
set satom_index_list [$sel_solv get index]
set patom_index [$sel_probe get index]
foreach s_atom $satom_index_list {
set d [measure bond "$s_atom $patom_index"]
lappend l1 [list $s_atom $d]
}
#puts "l1: $l1"
for { set i 0 } { $i < $solvent_molecues_num } { incr i 1} {
lappend l2 "[lindex [lsort -index 1 $l1] $i 0]"
}
#puts "l2: $l2"
set sel_write [atomselect top "resname ACE NME or same residue as index $l2"]
$sel_write frame $f
$sel_write update
$sel_write writepdb nma_h2o_within_$f.pdb
unset l1 l2 d satom_index_list patom_index s_atom sel_probe sel_solv
}
- Next message: Roni Saiba: "Re: Working with trajectory and updating frames dependents on current frame"
- Previous message: Raman Preet Singh: "Re: Opening file after i downloaded vmd"
- Next in thread: Roni Saiba: "Re: Working with trajectory and updating frames dependents on current frame"
- Reply: Roni Saiba: "Re: Working with trajectory and updating frames dependents on current frame"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]