From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Tue Jun 30 2009 - 09:48:45 CDT

On Tue, 2009-06-30 at 10:02 -0300, Alberto Sergio Garay wrote:

alberto,

> Could any one give any clue of what I'am doing wrong?
> Thank you in advance.

first thing. please use proper indenting.
your code is impossible to read. if you
use sytematic indentation, it is _much_
easier to follow the flow of the code.

[...]

> puts "###################################"
> puts "WRAPING TRAYECTORY .........."

FYI: those are spelled "WRAPPING" and "TRAJECTORY".

[...]

> #Wrapping the all molecules around the selected residue
> pbc wrap -centersel "resid $resid" -center com -all
>
> #####################################################################################
> #####################################################################################
>
> for {set frame 1} {$frame < $num_steps} {incr frame} {
>
> puts "Starting calculus on frame $frame"
>
> #Making a list of water and lipids molecules inside a sphere defined
> around a residue
>
> set water [atomselect top "same residue as (resname SOL) and within
> $radius2 of (resid $resid and name CD)" frame $frame]
> #selecting some particular atoms.....
> set lipids [atomselect top "(resname DMP) and (name CD and within
> $radius of (resid $resid and name CD))" frame $frame]

why create the selections here? they are invariant and selection
creation is a very expensive process. better to create them
outside the loop and then do
$water frame $frame
$water update

and

$lipids frame $frame
$lipids update

[...]

> #writing the number of ceramide_water_hBonds found
> set n 0
> foreach a [lindex $ceramide_water_hBonds 0] {
> set n [expr $n + 1]
> }

where are those $ceramide_XXX_hBonds variables defined???
not in the script fragment you post here.

cheers,
   axel.

> puts "lipids_water_hBonds found:# $n #"
>
> #writing the number of water_ceramide_hBonds found
> set n 0
> foreach a [lindex $water_ceramide_hBonds 0] {
> set n [expr $n + 1]
> }
> puts "water_lipids_hBonds found:# $n #"
>
>

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.