[Overlappings,Pos] = CheckConstraint(Pos,pos,vector) CheckConstraint: Given the configuration of residues, calculates the number of Overlappings that the addition of move mov at position pos provokesn INPUT Pos: Configuration of the sequence being repaired pos: position in the sequence being inspected vector: original sequence OUTPUT Collisions: Number of non contiguous H residues that are neighbors in the lattice Pos: Configuration of the sequence being repaired Ovelappings: Number of residues that self-intersect in the lattice Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es)
0001 function[Overlappings,Pos] = CheckConstraint(Pos,pos,vector) 0002 % [Overlappings,Pos] = CheckConstraint(Pos,pos,vector) 0003 % CheckConstraint: Given the configuration of residues, calculates the number of 0004 % Overlappings that the addition of move mov at position pos provokesn 0005 % INPUT 0006 % Pos: Configuration of the sequence being repaired 0007 % pos: position in the sequence being inspected 0008 % vector: original sequence 0009 % OUTPUT 0010 % Collisions: Number of non contiguous H residues that are neighbors in the lattice 0011 % Pos: Configuration of the sequence being repaired 0012 % Ovelappings: Number of residues that self-intersect in the lattice 0013 % 0014 % Last version 8/26/2008. Roberto Santana (roberto.santana@ehu.es) 0015 global HPInitConf; 0016 0017 0018 Overlappings = 0; 0019 if(pos < 3) 0020 return; 0021 end 0022 0023 [Pos] = PutMoveAtPos(Pos,pos,vector(pos)); 0024 0025 for j=1:pos-2, % Check for Overlappings and Collissions in all the molecules except the previous one 0026 if(Pos(pos,1)==Pos(j,1) & Pos(pos,2)==Pos(j,2)) 0027 Overlappings = Overlappings + 1; 0028 end 0029 end 0030