This script was developed for my bachelor thesis in mathematics.
Given a protein consisting of a single polypeptide chain available on the Protein Data Bank, this script creates an H-tangle diagram of the protein and computes a polynomial invariant (single-strand Gamma) of this diagram.
Run main.py
with Python 3, and a Wolfram Language Script containing the data of the H-tangle diagram will be automatically generated in the same directory. This script may be evaluated with Mathematica to produce the Gamma polynomial of the protein.
Note: this program is only designed to work for proteins consisting of a single polypeptide chain.
The following variables in main.py
may be configured:
PROTEIN_NAME
: the name of the protein as found on the Protein Data Bank (e.g., 1R02)PROJECTION_PLANE_NORMAL
: a numpy array denoting the normal of the plane onto which the 3D structure of the protein is projected. In principle the choice of normal does not matter, however one should note that Gamma is only an invariant up to a factor of t^k in the polynomial, and only for diagrams of writhe zero (i.e., for diagrams with equal number of positive and negative crossings, which one can force by adding any number of positive or negative loops to each strand).PLOT_GRAPH
: ifTrue
, plots all the residues in the chain with all relevant bonds and crossings.
- numpy
- scipy
- prody
- matplotlib (only for
ProteinProjection.plotCrossings()
)