Beispiel #1
0
 public void Compute(ProteinGraph graph)
 {
     Graph = graph;
     foreach (var node in graph.Nodes)
     {
         var totalHydrophobicity = Hydrophobicity.GetHydrophobicity(node.Data.Residue.Code);
         foreach (var neighbour in node.Neighbours)
         {
             totalHydrophobicity += Hydrophobicity.GetHydrophobicity(neighbour.Data.Residue.Code);
         }
         totalHydrophobicity /= (node.Neighbours.Count() + 1);
         logic.Values.Add(node.Data.Residue, (totalHydrophobicity + maxEntry) / (2 * maxEntry));
     }
 }
Beispiel #2
0
 public void Compute(ProteinGraph graph, IDictionary <Residue, double> rasaValues)
 {
     Graph = graph;
     foreach (var node in graph.Nodes)
     {
         var rasasum             = rasaValues[node.Data.Residue];
         var totalHydrophobicity = Hydrophobicity.GetHydrophobicity(node.Data.Residue.Code) * rasaValues[node.Data.Residue];
         foreach (var neighbour in node.Neighbours)
         {
             rasasum             += rasaValues[neighbour.Data.Residue];
             totalHydrophobicity += Hydrophobicity.GetHydrophobicity(neighbour.Data.Residue.Code) * rasaValues[neighbour.Data.Residue];
         }
         totalHydrophobicity /= rasasum;
         logic.Values.Add(node.Data.Residue, (totalHydrophobicity + maxEntry) / (2 * maxEntry));
     }
 }