I am using the internal_coords module from BioPython in order to compare dihedral angles of two different conformations of the same protein. The conformations are processed by me in order to make sure that their residues are aligned and they always contain exactly the same atoms, so that in the end I expect to have the same number of dihedral angles in the two structures.

However, despite the match in the residues and atoms, I obtain a different number of dihedral angles for the two conformations.

You can find a reproducible code sample here. These are the two PDB files protein1.pdb and protein2.pdb used.

As you can see, the number of chains, the number of residues, the residue names and the atom names in each residue are the same, yet there are 4 extra dihedral angles in the second protein.

My question is, am I missing something from my comparison? Is it unreasonable to expect the same dihedral angles for these two structures? (And if yes, why?). Is this the expected behaviour of the atom_to_internal_coordinates() function?

And extra: do you have any recommendations for other tools that can easily compute all dihedral angles (including the ones in side chains) for a protein?

  • 1
    $\begingroup$ By different you mean wildly different? Do the residues look like different when you superpose the protein in PyMOL (align) and look at the residues by eye —PyMOL does have the command get_dihedral, but the laziest way would be to click the four atoms (in edit mode) and it will show the dihedral. Do the values differ? $\endgroup$ Mar 10 at 8:50
  • 1
    $\begingroup$ I should also say, the two conformers should have some slight differences. Especially, surface sidechains and especially if the two protein are crystallised under different conditions... $\endgroup$ Mar 10 at 8:54
  • $\begingroup$ @MatteoFerla Thanks for your input! The problem in this case was not that the angles are different (which was indeed expected as the proteins were coming from different structures), but rather that BioPython just didn't output certain angles at all for one of the proteins. $\endgroup$
    – CubeHead
    Mar 11 at 15:03

1 Answer 1


The problem got solved after posting on the official BioPython repo.

Because of the processing (where some residues were removed in order to align the proteins), some consecutive residues were too far away from each other and thus the bond length was too large. The solution was to increase the maximum peptide bond allowed, as follows:

internal_coords.IC_Chain.MaxPeptideBond = 5.0
ic_chain = internal_coords.IC_Chain(structure, verbose=True)
  • 2
    $\begingroup$ Thanks for posting back @cubehead. If you mark the post as accepted that would be cool $\endgroup$
    – M__
    Mar 11 at 15:11
  • $\begingroup$ Just out of curiosity: were these naughty bonds Asp-Pro or Glu-Pro in loops (self-cleavage and isoglutamate)? Or the more classic case of bad density fitting of loops? $\endgroup$ Mar 11 at 16:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.