From: Justin Gullingsrud (justin_at_ks.uiuc.edu)
Date: Mon Sep 16 2002 - 09:44:49 CDT

Hi,

You've almost got it, there is indeed a setbonds command for atom selections,
but it's a little more complicated to just add a bond (maybe we should create
an addbond command or something). Anyway, assuming the Fe and N atoms are in
the same residue, something like the following should work:

set sel [atomselect top "resid 2814 and name FE N"]
set bonds [$sel getbonds]
set ids [$sel get index]
lassign $bonds atom1bonds atom2bonds
lassign $ids atom1id atom2id
lappend atom1bonds $atom2id
lappend atom2bonds $atom1id
$sel setbonds [list $atom1bonds $atom2bonds]

What I did was to get the list of bonds for each atom, and then append the
id of each atom to the other's bond list. Then I took the new bond lists
and applied them to those atoms.

Let me if that doesn't work for you.

Cheers,

Justin

On Mon, Sep 16, 2002 at 04:08:13PM +0000, Yves Frapart wrote:
> Hi,
>
> How can I force the drawing of a bond beetween two known atoms (an Fe
> and a N in a protein structure) ?
> I have a PDB input file and I would like to draw the active site with
> VMD 1.8a21, first I tried to ad a conect to the pdb file, then I notice
> VMD does'nt take care of the conect wrote in the pdb file, then I tried
> to write a source using setbonds (it seems i am not good enough to do
> so, and i received different message.
> Here is the source I wrote :
>
> set sel1 [atomselect 0 "name Fe"]
> set sel2 [atomselect 1 "resid 2814"]
> setbonds 0 1
>
> The effect was : Cannot find molecule 1 in atomselect's 'molId
>
> Thank you very much.
>
> Yves Frapart

-- 
  Justin Gullingsrud        3111 Beckman Institute        217-244-8946
  I been dropping the new science, and I be kicking the new knowledge,
  and I'm seeing to a degree that you can't get in college.  -- b.boys