From: Jim Phillips (jim_at_ks.uiuc.edu)
Date: Tue Feb 17 2004 - 17:14:42 CST

Hi again,

On Tue, 17 Feb 2004, Satyavani Vemparala wrote:

> (1) the atoms are displaced. i was assuming that by giving t "0 0 0", the
> atoms would not be displaced. e.g.,
> Before script:
> -------------
> ATOM 1 C1 OLEO 1 25.238 -18.360 17.677 0.00 0.00 L001
> ATOM 2 O1 OLEO 1 24.822 -17.975 16.590 0.00 0.00 L001
>
> After Script:
> -----------
> ATOM 1 C1 OLEO 1 20.652 -21.504 -18.456 1.00 0.00 L001
> ATOM 2 O1 OLEO 1 20.521 -20.344 -18.821 1.00 0.00 L001

The atoms are not simply displaced, since the coordinates of these two
atoms do not differ by the same vector. The coordinates are different,
probably because the lipid segments have been switched.

The script uses the z coordinate to split into top and bottom layers, and
then does the bottom layer (lipidsegs1/lipidsel1) first. I expect that if
you reverse the order of sl or just eliminate this division you will get
what you are expecting.

> (2) some of the hydrogens have (0,0,0) as coordinates

You must not have those coordinates in your PDB file. Add "guesscoord"
just before writepsf and the hydrogens should have reasonable coordinates.

-Jim

> is there a mistake iam doing in the script? the lipid is DOPC, hence OLEO
> & PCGL residues.
>
> ================================================================
> package forget
> package require psfgen 1.3
>
> topology top_all27_lipid
>
> mol load pdb dopc_only.pdb
>
> set lipidsegs1 [[atomselect top "name N and z < 0"] get segid]
> set lipidsegs2 [[atomselect top "name N and z > 0"] get segid]
> set lipidsel1 [atomselect top "segid $lipidsegs1"]
> set lipidsel2 [atomselect top "segid $lipidsegs2"]
>
> set tl ""
> lappend tl "0 0 0"
>
> set sl "$lipidsel1 $lipidsel2"
>
> set lid 1
>
> foreach lipidsel $sl {
> foreach t $tl {
> $lipidsel moveby $t
>
> set oldsegs [lsort -unique [$lipidsel get segid]]
> foreach s $oldsegs {
> set segid [format "L%03d" $lid]
> incr lid
>
> set segsel [atomselect top "segid $s"]
> $segsel set segid $segid
> $segsel delete
>
> segment $segid {
> auto none
> first NONE
> last NONE
> residue 1 OLEO
> residue 2 PCGL
> residue 3 OLEO
> }
> patch EST1 $segid:2 $segid:1
> patch EST2 $segid:2 $segid:3
> }
>
> $lipidsel writepdb lipids.pdb.tmp
> coordpdb lipids.pdb.tmp
> }
> }
>
> regenerate angles dihedrals
>
> writepsf dopc.psf
> writepdb dopc.pdb
>
> mol delete all
>
> mol load psf dopc.psf pdb dopc.pdb
>
> exit
> ====================================================================
> On Mon, 16 Feb 2004, Jim Phillips wrote:
>
> > Hi,
> >
> > The easy way is to use a Tcl foreach loop over all of your segments.
> > I've attached a script I used to build a DPPC patch from similar input.
> > There is some extra code to replicate the lipids, but otherwise this is a
> > full example.
> >
> > Also, be sure to use "regenerate angles dihedrals" after building all of
> > the lipid segments or you'll be missing several angles and dihedrals.
> >
> > -Jim
>