Re: residue_rmsd.tcl question

From: Ilya Chorny (ichorny_at_gmail.com)
Date: Fri Nov 02 2007 - 10:57:19 CDT

Christian,

Below is a script which I wrote to calculate the per residue RMSD. I have a
trimer, thus the loop over segments. It's probably not the most efficient
code but it does the trick.

Ilya

    # the frame being compared
     set reference [atomselect top "protein and backbone" frame 0]
    set compare [atomselect top "protein and backbone"]
    set num_steps [molinfo top get numframes]
    for {set frame 0} {$frame < $num_steps} {incr frame} {
        # get the correct frame
        $compare frame $frame
        # compute the transformation
        set trans_mat [measure fit $compare $reference]
        # do the alignment
        $compare move $trans_mat
        }

set filename "test.txt"
set fileId [open $filename "w"]
for {set segment 1} {$segment < 2} {incr segment} {
    puts -nonewline $fileId "segment P$segment\n"
    set resid [atomselect top "protein and segname P$segment and name CA"]
    foreach array [$resid get resid] {
        puts -nonewline $fileId "$array\t"
        set reference [atomselect top "protein and resid $array" frame 0]
        set compare [atomselect top "protein and resid $array"]
        for {set frame 0} {$frame < $num_steps} {incr frame} {
            $compare frame $frame
            set rmsd [measure rmsd $compare $reference]
            puts -nonewline $fileId "$rmsd\t"
        }
        puts -nonewline $fileId "\n"
    }
close $fileId
#}

On 11/2/07, Christian Blouin <cblouin_at_cs.dal.ca> wrote:
>
> Greetings,
>
>
>
> We are attempting to apply the RMSD for individual residues
> (NAMD tutorial) on a protein that has two residues with negative indexes.
> The line:
>
>
>
> rmsd_residue_over_time top $sel_resid
>
>
>
> fails with the message:
>
>
>
> Calculating rmsd for frame 0
>
> Atomselect: cannot parse selection text: protein and resid -2
> and noh
>
>
>
> Can anyone on this list help us understand the nature of this
> problem and how to get around it.
>
>
>
> Thanks,
>
>
>
> Christian
>
>
>
>
>

-- 
Ilya Chorny Ph.D.

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:47:11 CST