Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

The HP model

This notebook contains code that exhaustively enumerates all possible conformations of an HP lattice protein. There are also functions to

  • count the number of topological contacts

  • compute the energy of a given conformation and sequence

  • select the compact conformations out of a set of generic conformations

  • given a sequence and a set of conformations, find the lowest-energy structures

  • use matplotlib to show a conformation

At the end you can also find some example code that uses these functions.

Number of total conformations: 110188
Number of compact conformations: 360 (7 topological contacts)
Number of lowest-energy conformations: 1
Lowest Energy: -7
<Figure size 640x480 with 1 Axes>
Number of total conformations: 2034
Number of compact conformations: 98 (4 topological contacts)
<Figure size 640x480 with 1 Axes>