Please read the warnings below. This program was put together as a quick hack and has some odd quirks!

You are recommended to use pdbtorsions from our BiopTools package instead.

Torsions is a simple program to read a PDB file and calculate backbone torsion angles. It calculates phi, psi and omega and can also calculate C-alpha pseudo-torsions.

A couple of warnings... This was hacked together fairly quickly for my own purposes and has a few quirks as a result! Use at your own risk - it's only here because lots of people ask for a program to do this calculation. It doesn't handle multiple chains very well (a torsion will be calculated between the chains and chain labels are not printed) and the omega angles are printed with the residue before rather than the residue after as is conventional. It requires that the backbone atoms be listed in the correct order from N- to C-terminus within the PDB file (i.e. N,CA,C). It also doesn't compile as cleanly as my code normally does!

You are recommended to use pdbtorsions from our BiopTools package instead.


Torsions is freely available for use by not-for-profit organisations. Commercial use is not permitted without the permission of the author.


Torsions is supplied as a C source file. A Windows binary is also available for those who don't have access to a Windows C compiler.

Compile the program with:

cc -o torsions torsions.c -lm

Note that some browsers will add returns to the ends of lines and thus create a DOS file for you even on a un*x computer. This is likely to confuse your un*x C compiler! The following line of perl will sort it out:

perl -e 'while(<>) { s/\r\n/\n/g; print; }' torsions.c > tor.c
mv tor.c torsions.c