Search code examples
bioinformaticspymol

PYMOL: Output Polar Contacts Between Chains to Text File


I am new to PyMOL but have a very specific task that I need to do.

I have a PDB structure file of protein homo-oligomer, and I want to use PyMol to determine polar contacts between chain A and all other chains.

However, I not only want to visualize these polar contacts (which is easy to do via PyMOL GUI), but I also want to be able to store/save pairs of interacting residues in a dictionary or whatever may be the most convenient data structure to do this. The end goal to create a csv or text file where each interacting pair of residues has its own line.

I would ideally like to do this via a Python script where I call the PyMOL API or through a PYMOL script - whichever is easier.

I have reviewed a similar question on Stack Overflow but found it unhelpful because I not only want to select and visualize these polar contacts but also want to save/record them in a list or dictionary (and then to a text or csv file), which the above question does not address.


Solution

  • here is the instrument, which can print polar contacts: https://proteintools.uni-bayreuth.de/bonds/structure in format

    Network ID Donor - Acceptor Distance (Å) DHA (º)
    0 ARG65-NE -- GLN150-OE1 2.7 136.6

    And here is script in pymol, which can show same contacts: https://pymolwiki.org/index.php/Show_contacts

    But I didn't find python script printing contacts.