question on tcl script for rmsd calculation

From: Olya Kravchenko (okrav_at_ucdavis.edu)
Date: Mon Feb 14 2005 - 13:44:41 CST

Dear all! I have a question about rmsd calculation. When I try to run scripts
I have error that say:
-------------------------------------------
wrong # args: should be "proc name args body"
GET-RMSD) Defining structure and trajectories...
2chains.psf
2chains.pdb
min01.dcd
GET-RMSD) Computnig RMSD for entire protein...
2chains.psf 2chains.pdb min01.dcd
invalid command name "get_rmsd"
ERROR) No molecules loaded.
GET-RMSD) Computing RMSD for protein backbone...
2chains.psf 2chains.pdb min01.dcd
invalid command name "get_rmsd"
ERROR) No molecules loaded.
GET-RMSD) Computing RMSD for heme...
invalid command name "get_rmsd"
ERROR) No molecules loaded.
------------------------------------------------
I can't figure out what is wrong with description of get_rmsd process. I would
really appreciate your help.

Here are the scripts I use for this:
--------------------------------------------------------------------
proc get_rmsd {selstring outfile pdbfile psffile dcdfilelist}
{
    # open output file (or quit if file exists already)
    if {[file exists "${outfile}"]}{
        puts "File \"${outfile}\" exists; delete it and re-run"
        quit
    }
    set FIN [open "${putfile}"w]
    
    #read crystallographic structure
    puts "RMSD) Loading ${psffile}/${pdbfile}..."
    mol load psf "${psffile}" pdb "${pdbfile}"
    
    #set reference selections
    puts "RMSD) Setting reference selection..."
    set selref [atomselect top "$selstring"]
    
    #analyze trajectories one by one
    set netframenum 1
    foreach dcdfile $dcdfilelist {
        
        #load trajectory
        puts -nonewhile "RMSD) Loading ${dcdfile}..."
        mol new "$psffile" type {psf} first 0 last -1 step 1 waitfor all
        set n [molinfo top get numframes]
        puts -nonewline " read ${n} frames..."
        
        #measure RMSD
        for {set i 0} {$i < $n} {incr i} {
            puts -nonewline $FIN "${netframenum}\t"
            set selecomp [atomselect top "$selstring" frame $i]
            set matrix [ measure fit $selcomp $selref]
            $selcomp move $matrix
            set r [ measure rmsd $selcomp $selref]
            puts -nonewline $FIN "${r}\t"
            puts $FIN ""
            $selcomp delete
            incr netframenum
        }
        mol delete top
        puts " done."
    }
    close $FIN
}
---------------------------------------

and second (sources the first one):
 
--------------------------------
source rmsdByGroup.tcl

puts "GET-RMSD) Defining structure and trajectories..."
set dcdfilelist {}
set psffile "2chains.psf"
set pdbfile "2chains.pdb"
lappend dcdfilelist "min01.dcd"
lappend dcdfilelist "eq01.dcd"
lappend dcdfilelist "eq02.dcd"
lappend dcdfilelist "eq03.dcd"

puts "GET-RMSD) Computnig RMSD for entire protein..."
puts "$psffile $pdbfile $dcdfilelist"
get_rmsd "protein" "protein.dat" $pdbfile $psffile $dcdfilelist
mol delete all

puts "GET-RMSD) Computing RMSD for protein backbone..."
puts "$psffile $pdbfile $dcdfilelist"
get_rmsd "protein and backbone" "backbone.dat" $pdbfile $psffile $dcdfilelist
mol delete all

puts "GET-RMSD) Computing RMSD for heme..."
get_rmsd "noh and segid HEM" "heme.dat" $pdbfile $psffile $dcdfilelist
mol delete all

puts "GET-RMSD) COmputing RMSD for heme and environment..."
get_rmsd "noh and (segid HEM or protein and resid $hemenv)" "heme-env.dat"
$pdbfile $psffile $dcdfilelist
mol delete all

#end of file
------------------------------------

Thank you very much!

Olya

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:40:31 CST