From: l.spitzer_at_fr.fournierpharma.com
Date: Fri Nov 18 2005 - 04:48:26 CST

Hi!
I think you may have a problem with the loading of your pdbs, by loading
multiple pdb with the same ID!
Your poor script may be lost with all that!
I think you should begin your script by loading all your pdbs once for all.
I mean, you add a loop before you begin calclating rmsd that would be like
:
for { set k 2 } { $k < 100 } { incr k } {
    mol load pdb pro_$k.pdb
}

and that's all!you don't add any other load instruction in your code, so
you only deal with the IDs of your protein.

And one last advice : don't forget to close your outfile (close $outfile)
at the end of your script. If not, you'll get no results in it!

Regards,

Luc SPITZER

                                                                                                                                       
                      andrea spitaleri
                      <spitaleri.andrea Pour : vmd-l_at_ks.uiuc.edu
                      @hsr.it> cc :
                      Envoyé par : Objet : Re: vmd-l: calculate rmsd in a loop:feedback [sorry if you get it twice]
                      owner-vmd-l_at_ks.ui
                      uc.edu
                                                                                                                                       
                                                                                                                                       
                      18/11/2005 10:42
                                                                                                                                       
                                                                                                                                       

Hi,
thanks to all for the precious help. My problem is that I don't know tcl
.... (prefer python/perl)
Anyway, this below works fine but it does only the rmsd calculation for the
first pro_1.pdb with the rest of the files.
set outfile [open rmsd.dat w]
mol load pdb pro_1.pdb
set sel1 [atomselect 0 "protein and backbone"]
set lig1 [atomselect 0 "segid B"]
for { set j 2 } { $j < 100 } { incr j } {
    mol load pdb pro_$j.pdb
    set ID1 [expr $j-1]
    set sel2 [atomselect $ID1 "protein and backbone"]
    set lig2 [atomselect $ID1 "segid B"]
    set all [atomselect $ID1 all]
    $all move [measure fit $sel2 $sel1]
    set rmsd [measure rmsd $lig2 $lig1]
    puts "RMSD of 1 and $j is $rmsd"
    puts $outfile "RMSD of 1 and $j is $rmsd"
    puts Done
}
In fact, if I use another loop to compare pro_2.pdb with rest and so on,
vmd or tcl or whatsoever obscure to me does not go inside of the second
loop (Loop 2) and I don't know why:
set outfile [open rmsd.dat w]
# 1st Loop
for {set i 1} {$i < 100} {incr i} {
    mol load pdb pro_$i.pdb
    set ID [expr $i-1]
    set sel1 [atomselect $ID "protein and backbone"]
    set lig1 [atomselect $ID "segid B"]
# 2nd Loop
    for { set j 2 } { $j < 100 } { incr j } {
             mol load pdb pro_$j.pdb
             set ID1 [expr $j-1]
             set sel2 [atomselect $ID1 "protein and backbone"]
             set lig2 [atomselect $ID1 "segid B"]
             set all [atomselect $ID1 all]
             $all move [measure fit $sel2 $sel1]
             set rmsd [measure rmsd $lig2 $lig1]
             puts "RMSD of $i and $j is $rmsd"
             puts $outfile "RMSD of $i and $j is $rmsd"
             puts "Done"
             }
}

Then, Luis could you send me the procedure how to test your plugin? Reading
in your web page, it seem working only on trajectories, or am I wrong?

Regards,

andrea

--
-------------------------------
Andrea Spitaleri
Dulbecco Telethon Institute
c/o DIBIT Scientific Institute
Biomolecular NMR, 1B4
Via Olgettina 58
20132 Milano (Italy)
-------------------------------