Very often in Struc Bio it is necessary to determine the contacts between two molecules. Most of us in the group have written a snippet of code to compute precisely that or they have adapted the Biopython functionality or one of the tools in pdbtools. The piece of code written in Python presented here is a Biopython variety that gives you the intermolecular contacts and it annotates the interface neighborhood. An example of the program output is given in the Figure below:
You can download it from here. There are three files inside:
- GetInterfaces.py – the main source/runnable file
- README.txt – instructions, very similar to this post (quite a lot copy/pasted)
- 1A2Y.pdb – the PDB file used in the example to practice on.
How to use it?
As the bare minimum, you need to provide the structure of the pdb(s) and the chains that you want to examine contacts in.
- –f1 : first pdb file [Required]
- –f2 : second pdb file (if the contacts are to be calculated in the same molecule, just submit the same pdb in both cases) [Required]
- –c1 : Chains to be used for the first molecule [Required]
- –c2 : Chains to be used for the second molecule [Required]
- –c : contact cutoff for intermolecular contacts (Optional, set to 4.5A if not supplied on input)
- –i : interface neighbor cutoff for intramolecular neighborhood of the contacting interface (Optional, set to 10.0A if not supplied on input). Set this option to zero (0.0) if you only want to get the intermolecular contacts in the interface, without the interface neighborhood.
- –jobid : name for the output folder (Set to out_<random number> if not supplied on input)
An example which you can just copy paste and run when in the same directory as the python script:
python GetInterfaces.py --f1 1A2Y.pdb --f2 1A2Y.pdb --c1 AB --c2 C --c 4.5 --i 10.0 --jobid example_output
Above command will calculate the contacts between antibody in 1a2y (chains A and B) and the antigen (chain C). The contact distance was defined as 4.5A and the interface distance was defined as 10A. All the output files are saved in the folder out_example_output.
Output folder is placed in the current directory. If you specify the output folder name (–jobid) it will be saved under the name ‘out_[whateveryoutyped]’, otherwise it will be ‘out_[randomgeneratednumber]’. The program tells you at the end where it saved all the files.
- molecule_1.pdb – the first supplied molecule with b-factor fields of contacts set to 100 and interface neighborhood set to 50
- molecule_2.pdb – the second supplied molecule with b-factor fields of contacts set to 100 and interface neighborhood set to 50
- molecule_1.txt – whitespace delimited file specifying the contacts and interface neighborhood in the second molecule in the format: [chain] [residue id] [contact ‘C’ or interface residues ‘I’]
- molecule_2.txt – whitespace delimited file specifying the contacts and interface neighborhood in the second molecule in the format: [chain] [residue id] [contact ‘C’ or interface residues ‘I’]
- molecule_1_constrained.pdb – the first molecule, which is constrained only to the residues in the interface.
- molecule_2_constrained.pdb – the second molecule, which is constrained only to the residues in the interface.
- parameters.txt – the contact distance and neighborhood distance used for the particular run.