If we have a PDB structrure, how can we find residues physically interacting with each other in space? I know that we must find the distance between residues and if the distance is less than 5-6 Angstrom, we say that residues are physically interacting. But how can we find the distance between all residues and how can we finally determine the distances between all residues? Is there a software or webserver for that?
If you need to process multiple files, you could use Biopython to parse a PDB structure.
from Bio.PDB import PDBParser # create parser parser = PDBParser() # read structure from file structure = parser.get_structure('PHA-L', '1fat.pdb') model = structure chain = model['A'] # this example uses only the first residue of a single chain. # it is easy to extend this to multiple chains and residues. for residue1 in chain: for residue2 in chain: if residue1 != residue2: # compute distance between CA atoms try: distance = residue1['CA'] - residue2['CA'] except KeyError: ## no CA atom, e.g. for H_NAG continue if distance < 6: print(residue1, residue2, distance) # stop after first residue break
If you need to look at one structure, using a viewer perhaps would be easier. You could try PyMOL: (how to measure distance). There are other PDB viewers, some of which can work even through a browser.
Could you use CCP4's NCONT program? There's a GUI and a command line interface, whatever suits. You can specify which chains you want to target and interact with and set a cut off for distance. The bonus here is once you're in you have a nice suite of other structural tools to use.
If you're just doing it once, the GUI is friendly enough to work things out, if you're doing a batch then you can run it across several files via the command line.
As part of a project me and some teammates did a script that outputs visual maps of distances between residues. It uses Biopython.
The module contact_map.py does what you are looking for. As an example, if you want to find the residues whose CA are below 5 you can run the following command:
python3 contact_map.py pdb1cd8.ent -a CA -CA 5
This will produce three files:
distance_map_pdb1cd8_CA.png # Heatmap of the distance between the residues contact_map_pdb1cd8_CA.png # Black/White heatmap: If it is at that min distance contact_map.log # The actions taken
If you don't have downloaded already the pdb structue you can use the main module:
python3 cozmic.py real 1cd8 -a CA -CA 5
You can use MDtraj. The package is easy to install using Anaconda.
You can get the interacting residues using the following snippet (taken from http://mdtraj.org/1.6.2/examples/native-contact.html)
heavy_pairs = np.array( [(i,j) for (i,j) in combinations(heavy, 2) if abs(native.topology.atom(i).residue.index - \ native.topology.atom(j).residue.index) > 3]) # compute the distances between these pairs in the native state heavy_pairs_distances = md.compute_distances(native, heavy_pairs) # and get the pairs s.t. the distance is less than NATIVE_CUTOFF native_contacts = heavy_pairs[heavy_pairs_distances < NATIVE_CUTOFF] print("Number of native contacts", len(native_contacts))
Distance between C-alphas can also be found using the BioStructures.jl package in Julia:
using BioStructures struc = read("1AKE.pdb", PDB) calphas = collectatoms(struc['A'], calphaselector) dm = DistanceMap(calphas)
dm[5, 10] gives
Other variations also work, see the docs.