From: Vermaas, Joshua (Joshua.Vermaas_at_nrel.gov)
Date: Wed Jan 02 2019 - 15:17:33 CST

Hi Steve,

There are a few things going on here. The first is that if you look inside distance.tcl, you'll see that the parameters it expects are the atomselection strings (eg "protein and resid 450"), not the atomselection objects you've passed along, since internally the script is trying to make its own atomselection objects. So the "correct" way of calling the distance function would be:

distance "protein and resid 450" "protein and resid 471" 10 test-r.dat test-d.dat

The second bit of confusion is that atomselections operate on atoms, not residues. If, at the end, you had asked for "$sel1 get name", you would get the name of each atom that is part of the protein and has resid 450. Between the backbone atoms and the minimal sidechain, 9 atoms fit that criteria on the N-terminus (8 normally), and all have resname "GLY", which is what the last line reports.

-Josh

On 2019-01-02 13:52:22-07:00 owner-vmd-l_at_ks.uiuc.edu wrote:
Hello
I think this is a simple problem, but I can’t seem to fix it…

I have loaded into vmd my psf file and the accompanying dcd file.

Then, using the TkConsole,:
>set sel1 [atomselect top “protein and resid 450”]
>atomselect0
>set sel2 [atomselect top “protein and resid 471”]
>atomselect1
>source distance.tcl
>distance $sel1 $sel2 10 test-r.dat test-d.dat
Atomselect: cannot parse selection text : atomselect0
>$sel1 get resname
GLY GLY GLY GLY GLY GLY GLY GLY GLY

GLY is the first three residues of the peptide…450, 451, 452…

Can someone tell me what I am doing incorrectly?

Thanks, Steve