From: Peter Freddolino (petefred_at_ks.uiuc.edu)
Date: Sat Feb 14 2009 - 08:01:53 CST

Hi Bo,
it's because I messed up the syntax for measure bond (I said it was
untested ;-)
Try:
foreach molid [molinfo list] {
    set sel1 [atomselect $molid "resid 621 and name C9A"]
    set sel2 [atomselect $molid "resid 900 and name C1A"]
    set ind1 [join [$sel1 get index]]
    set ind2 [join [$sel2 get index]]
    $sel1 delete
    $sel2 delete

    puts [measure bond [list [list $ind1 $molid] [list $ind2 $molid]]]
}

Sorry about that.
Peter
> Hi, Peter:
>
> I am quite confused. Not sure if something wrong with VMD itself.
>
> Here is how I did:
>
> ---load two pdb files (two conformations from protein docking)
> ---use your script to plot the atoms distances, such as:
> resid 621 and name C9A
> resid 900 and name C1A
>
> Result is shown in "test-dist1.txt" file (attached)
>
> ----in VMD main window, creat graph presentatives from "selection"
> using exact words above . Then measure bond distance between the two
> atoms using "lable - bond".
>
> And the results are totally different.
>
> I have the two pdb files attached. I use VMD 1.8.6.
>
> Thank you for advice
>
> Bo
>
> On 2/14/09, Peter Freddolino <petefred_at_ks.uiuc.edu> wrote:
>
>> Hi Bo,
>> are you sure that the atoms you've labeled have the same indices as the
>> ones being requested in the script? I'd suggest manually adding a Bonds
>> label, and then looking in the console to find the indices of those
>> atoms and verifying that you get the same answer using the measure bonds
>> command.
>>
>> By the way, in your initial email it was ambiguous what you meant by
>> "615 O1P" and "900 OG". My script was written assuming the numbers are
>> residue IDs, but I don't know if that's what you meant.
>>
>>
>> Peter
>>
>>
>> bo baker wrote:
>> > ---------- Forwarded message ----------
>> > From: bo baker <bo.bybaker_at_gmail.com>
>> > Date: Feb 13, 2009 4:48 PM
>> > Subject: Re: vmd-l: Atom distances from trajotory
>> > To: Peter Freddolino <petefred_at_ks.uiuc.edu>
>> >
>> >
>> > Hi, Peter:
>> >
>> > I have a problem here with the script.
>> >
>> > The script itselfl works fine. I am able to get a set of data from all
>> > the pdb files loaded. But when I exam the data, there are big
>> > differences. I manullly measure ("label" ) the distance between the
>> > two atoms from the main VMD window from individaul pdb files, the
>> > value is much greater than those by the script. I wonder what could be
>> > wrong?
>> >
>> >
>> > Thank you for your advice
>> >
>> > Bo
>> >
>> >
>> > On 2/13/09, bo baker <bo.bybaker_at_gmail.com> wrote:
>> > > Thanks, Peter:
>> > >
>> > > Your script works perfect. And need "ind1" as well.
>> > >
>> > > Cheers
>> > >-
>> > >
>> > > Bo
>> > >
>> > >
>> > > On 2/13/09, Peter Freddolino <petefred_at_ks.uiuc.edu> wrote:
>> > > > You would need to do some scripting for this, something like (not tested)
>> > > >
>> > > > foreach molid [molinfo list] {
>> > > > set sel1 [atomselect $molid "resid 615 and name OP1"]
>> > > > set sel2 [atomselect $molid "resid 900 and name OG"]
>> > > > set ind1 [join [$sel1 get index]]
>> > > > set ind2 [join [$sel2 get index]]
>> > > > $sel1 delete
>> > > > $sel2 delete
>> > > >
>> > > > puts [measure bond [list $molid $ind1] [list $molid $ind2]]
>> > > > }
>> > > >
>> > > > Note that if the indices of the two atoms you care about are the same in
>> > > > all molecules, you don't need to use atoms selections to define ind1 and
>> > > > ind2. If all of your molecules have the *same* number of atoms, then you
>> > > > ought to load them all into one molecule as a trajectory instead, which
>> > > > makes this much easier.
>> > > >
>> > > > Best,
>> > > >
>> > > > Peter
>> > > >
>> > > >
>> > > >
>> > > >
>> > > > bo baker wrote:
>> > > > > Hi, VMD:
>> > > > >
>> > > > > I have a set of pdb files and would like to plot the atomic distances
>> > > > > from all of them. I ckecked "Lable" and "VolMap" tools. Both gives the
>> > > > > distance from individue files but not of the all files.
>> > > > >
>> > > > > Can any one suggest if VMD could perform this task? For example, I
>> > > > > would like to know the distance between 615 O1P and 900 OG through the
>> > > > > entire pdb filed loaded.
>> > > > >
>> > > > > Thank you for your advice
>> > > > >
>> > > > > Bo
>> > > > >
>> > > >
>> > >
>> >
>>
>>