Skip to main content
. 2014 Jun 17;140(23):234105. doi: 10.1063/1.4882258

fFRI algorithm.

Input: atoms(N) ▷ XYZ coordinates from PDB file
mincoorminval(atoms) ▷ Compute dimensions of bounding box
maxcoormaxval(atoms)  
Rboxsize ▷ Set size of grid
Nboxceiling((maxcoormincoor)/R) ▷ Compute number of boxes in each direction
for ii ← 1, Natoms do  
i, j, kceiling((atoms(ii) − mincoor)/R) ▷ Count the number of atoms in each box
Natoms(i, j, k) ← Natoms(i, j, k) + 1  
end for  
for k ← 1, Nbox[3] do  
for j ← 1, Nbox[2] do  
   for i ← 1, Nbox[1] do  
    allocate(box(i, j, k)) ▷ Allocate space for each box
   end for  
end for  
end for  
for ii ← 1, Natoms do ▷ Copy coordinates to appropriate box based on 3D coordinates
i, j, kceiling((atoms(ii) − mincoor)/R)  
box(i, j, k) ← atoms(ii)  
end for  
for k ← 1, Nbox[3] do ▷ Iterate over boxes
for j ← 1, Nbox[2] do  
   for i ← 1, Nbox[1] do  
    for na ← 1, Natoms(i, j, k) do ▷ Iterate over atoms in current box
     for nk − 1, k + 1 do ▷ Iterate over adjacent boxes
      for mj − 1, j + 1 do  
       for li − 1, i + 1 do  
        for nb ← 1, Natoms(l, m, n) do ▷ Iterate over atoms in adjacent boxes
         distdistance(box(i, j, k)(na), box(l, m, n)(nb))  
         FRI(na) ← kernel(dist)  
        end for  
       end for  
      end for  
     end for  
    end for  
   end for  
end for  
end for