I have one PDB structure. This structure has 13 residues. I have to find the distance between two atoms(only C,O,N,S) using for loop. First I have to find the distance between first and second residue. after that first and third residue.up to first and 13 th residue and so on. How can I write the python script using for loop?
Share
Using the xyz coordinates you can calculate distances between each atom. First you’ll have to parse the PDB file and store the coordinates. Then just iterate over the list of atoms (for atom in list_of_atoms) and calculate the euclidean distance between them..
http://en.wikipedia.org/wiki/Euclidean_distance#Three_dimensions
Biopython’s Bio.PDB module also allows such calculation easily.