Describing your problem in terms that only another biochemist will understand means that most of us here will only be able to guess at what your program needs to do.
- What do co-ordinates for mulit-chain proteins look like?
- What does an interaction between each of the residues look like and how do you calculate it?
The best way to speed up iteration is to avoid iterating. Lookups are fast.
If your dataset is too large to fit in memory forcing you to re-read files, then the first pass I would make is to avoid having to re-parse the files each time. A pre-processing step that parses your files into convenient data structures and then writes these to disk in packed or Storable binary format would probably speed up the loading considerably.
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algoritm, algorithm on the code side." - tachyon