Home > Mateda2.0 > functions > protein > EvaluateOffHPProtein.m

# EvaluateOffHPProtein

## PURPOSE

[Evals] = EvaluateOffHPProtein(Pop)

## SYNOPSIS

function[Evals] = EvaluateOffHPProtein(Pop)

## DESCRIPTION

     [Evals] =  EvaluateOffHPProtein(Pop)
     EvaluateOffHPProtein:  Calculates the energy corresponding to the sequence lattice configuration determined by the lattice in vector.
     Fixing the lengths of the edges, each angle defines the position of the next residue respective the two previous ones.
     From the residues positions, the interaction energies are calculated by the energy function
     For reference on the Offline HP model see:
    -- H. P. Hsu, V. Mehra and  P. Grassberger (2003)  Structure optimization in an off-lattice protein model.
    -- Phys Rev E Stat Nonlin Soft Matter Phys. 2003 Sep;68(3 Pt 2):037703. Epub 2003 Sep 30.
    -- http://scitation.aip.org/getabs/servlet/GetabsServlet?prog=normal&id=PLEEE8000068000003037703000001&idtype=cvips&gifs=yes
     INPUTS
     Pop: Population
     OUTPUTS
     Evals: Energy evaluation of each individual

     Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)

## CROSS-REFERENCE INFORMATION

This function calls:

- OffFindPos OffFindPos translates the vector of angles to the positions into the lattice.

This function is called by:

- Greedy_search_OffHP [NewPop,NumbEvals] = Greedy_search_OffHP(k,Pop,FunVal,local_opt_params)
- local_search_OffHP [NewPop,NumbEvals] = local_search_OffHP(k,Pop,FunVal,local_opt_params)

## SOURCE CODE

    0001 function[Evals] =  EvaluateOffHPProtein(Pop)
    0002 % [Evals] =  EvaluateOffHPProtein(Pop)
    0003 % EvaluateOffHPProtein:  Calculates the energy corresponding to the sequence lattice configuration determined by the lattice in vector.
    0004 % Fixing the lengths of the edges, each angle defines the position of the next residue respective the two previous ones.
    0005 % From the residues positions, the interaction energies are calculated by the energy function
    0006 % For reference on the Offline HP model see:
    0007 %-- H. P. Hsu, V. Mehra and  P. Grassberger (2003)  Structure optimization in an off-lattice protein model.
    0008 %-- Phys Rev E Stat Nonlin Soft Matter Phys. 2003 Sep;68(3 Pt 2):037703. Epub 2003 Sep 30.
    0009 %-- http://scitation.aip.org/getabs/servlet/GetabsServlet?prog=normal&id=PLEEE8000068000003037703000001&idtype=cvips&gifs=yes
    0010 % INPUTS
    0011 % Pop: Population
    0012 % OUTPUTS
    0013 % Evals: Energy evaluation of each individual
    0014 %
    0015 % Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)
    0016
    0017
    0018 % HPInitConf has been initialized with a sequence
    0019 global HPInitConf;
    0020
    0021 % The position of the sequence in the latticce are calculated
    0022
    0023 sizeChain = size(HPInitConf,2);
    0024 PopSize = size(Pop,1);
    0025 for k=1:PopSize
    0026   vector = Pop(k,:);
    0027   [Pos] =  OffFindPos(vector);
    0028   totcos = 0;
    0029 % Cosine part of the evaluation
    0030  for i=1:sizeChain-1,
    0031   totcos = totcos + (1-cos(vector(i)));
    0032  end
    0033 % Distance part of the evaluation
    0034  totAB = 0;
    0035  for i=1:sizeChain-2,
    0036   for j=i+2:sizeChain,
    0037    dist = sqrt ((Pos(i,1) - Pos(j,1))^2 +  (Pos(i,2) - Pos(j,2))^2);
    0038    if (HPInitConf(i)==1 & HPInitConf(j)==1)
    0039        ABeffect = 1;
    0040    elseif (HPInitConf(i)==0 & HPInitConf(j)==0)
    0041        ABeffect = 0.5;
    0042    else
    0043        ABeffect = -0.5;
    0044    end
    0045    totAB = totAB + (1/(dist^12) - ABeffect/(dist^6));
    0046   end
    0047  end
    0048
    0049  Evals(k) = -1.0*(totcos*0.25 + totAB*4);
    0050 end
    0051
    0052