Latticeproteins¶
Latticeproteins is a python package for evaluating 2d lattice protein models. For a basic example of how to use this package, see the documentation below.
This package was originally written by Jesse Bloom, and later adapted by Zach Sailer. If you use this package, please cite Jesse’s papers:
Install¶
To get the latest release from Pypi:
pip install latticeproteins
Tutorials¶
A few things before you start¶
There are a few things you need to know before you get started. Due to the
poor scaling of lattice protein calculations, the latticeproteins
package takes
a few precautions. First, folding a sequence is done in separate steps (and functions) rather than
through a single call. This forces you to be aware of the magnitude of each call.
You’ll notice in these tutorials, we have to import many functions.
Second, the hardest step (most memory and time) in the calculation, by far, is enumerating conformations on
the grid. latticeproteins
tries to reduce the pain by creating a
database of conformations in pickle files after the first creation. If you delete this directory,
it will have to recreate it next time you run calculations.
A basic example of a lattice protein¶
Import the latticeproteins package.
Input:
import latticeproteins as lp
The LatticeThermodyanmics
class creates objects that can calculate
lattice protein thermodynamics for any sequences of a specified length.
In the example below, we initialize this object for sequences of length
10. Note that to avoid repeating expensive conformation enumerations,
the LatticeThermodynamics
object creates a directory in your current
location called database
. Inside this directory, it stores python
pickle
files that include a database of all conformations on a 2d
grid.
Input:
seq_length = 10
temperature = 1.0
lattice = lp.LatticeThermodynamics.from_length(seq_length, 1.0)
Now, we’ll create a random sequence with the given length and start evaluating thermodynamic values.
Input:
seq = lp.random_sequence(seq_length)
print(seq)
Output:
['L', 'E', 'V', 'R', 'A', 'H', 'F', 'K', 'G', 'F']
Input:
print("Energy of native conformation: %f" % lattice.nativeE(seq))
print("stability of native conformation: %f" % lattice.stability(seq))
print("fraction folded: %f" % lattice.fracfolded(seq))
Output:
Energy of native conformation: -22.400000
stability of native conformation: 0.608617
fraction folded: 0.352375
The lattice protein package comes with a drawing module that creates SVG drawing of the lattice conformations.
Input:
conf = lattice.native_conf(seq)
lp.draw.in_notebook(seq, conf)
Output:
Fold lattice protein to nonnative state¶
The LatticeThermodynamics
object can also do the above calculations
while using a specified target native state.
Input:
# Find the 5 lowest energy conformations.
alt_conf = lattice.k_lowest_confs(seq, 5)
# Choose the 5th lowest as the target fold.
target = alt_conf[-1]
lp.draw.in_notebook(seq, target)
Output:
Input:
print("Energy of native conformation: %f" % lattice.nativeE(seq, target=target))
print("stability of native conformation: %f" % lattice.stability(seq, target=target))
print("fraction folded: %f" % lattice.fracfolded(seq, target=target))
Output:
Energy of native conformation: -20.110000
stability of native conformation: 3.296724
fraction folded: 0.035684
API documentation¶
latticeproteins package¶
Submodules¶
latticeproteins.conformations module¶
Module for constructing conformation database for sequences of set length.
Originally written by Jesse Bloom, 2004.
Updated by Zach Sailer, 2017.
-
class
latticeproteins.conformations.
ConformationList
(length, conflist, interaction_energies={'TF': -3.76, 'RY': -2.75, 'FN': -3.55, 'LD': -2.59, 'VT': -2.95, 'WL': -5.5, 'FR': -3.54, 'KD': -1.32, 'NL': -2.99, 'VW': -5.05, 'LE': -2.91, 'AA': -2.51, 'NI': -2.99, 'FA': -4.36, 'GA': -2.15, 'YI': -4.63, 'IN': -2.99, 'DV': -2.25, 'CV': -4.46, 'DF': -3.31, 'QW': -3.16, 'AL': -3.96, 'NH': -2.01, 'GT': -2.03, 'CL': -5.03, 'KM': -3.11, 'NR': -1.41, 'WN': -3.11, 'AT': -2.15, 'CW': -4.76, 'WI': -5.64, 'LV': -5.38, 'QD': -1.26, 'PF': -3.73, 'PY': -2.8, 'DQ': -1.26, 'PG': -1.72, 'TL': -3.43, 'CH': -3.63, 'PA': -1.81, 'QQ': -0.89, 'TD': -1.66, 'FW': -6.02, 'IM': -6.33, 'HV': -3.38, 'GG': -2.17, 'ML': -6.01, 'WV': -5.05, 'AY': -2.85, 'KT': -1.02, 'DS': -1.46, 'WH': -4.02, 'QM': -3.17, 'GF': -3.72, 'VL': -5.38, 'PK': -0.67, 'RR': -1.39, 'EN': -1.43, 'NV': -2.36, 'MS': -3.55, 'VG': -3.06, 'LK': -2.63, 'HC': -3.63, 'CE': -2.08, 'AK': -1.1, 'WQ': -3.16, 'WS': -2.95, 'YW': -4.44, 'GP': -1.72, 'LH': -3.84, 'FC': -5.63, 'SD': -1.46, 'IS': -3.43, 'EW': -2.94, 'NP': -1.43, 'GC': -3.16, 'HN': -2.01, 'EH': -2.27, 'HR': -2.12, 'QL': -3.09, 'VF': -5.75, 'CD': -2.66, 'MF': -6.68, 'IE': -3.23, 'EM': -3.19, 'HK': -1.09, 'MQ': -3.17, 'DK': -1.32, 'RS': -1.22, 'CF': -5.63, 'PN': -1.43, 'KA': -1.1, 'RF': -3.54, 'IG': -3.65, 'AS': -1.89, 'KG': -0.84, 'WY': -4.44, 'HW': -4.02, 'HI': -3.76, 'EF': -3.51, 'MK': -3.11, 'HF': -4.61, 'YM': -4.92, 'WR': -3.56, 'KS': -0.83, 'KN': -0.91, 'ME': -3.19, 'VR': -2.78, 'IC': -5.03, 'GK': -0.84, 'LW': -5.5, 'CI': -5.03, 'QY': -2.53, 'NT': -1.51, 'AQ': -1.7, 'FY': -4.95, 'SS': -1.48, 'EL': -2.91, 'PP': -1.18, 'KR': -0.06, 'RW': -3.56, 'LR': -3.15, 'CY': -3.89, 'IY': -4.63, 'MP': -4.11, 'GL': -3.43, 'TR': -1.97, 'WA': -3.93, 'WC': -4.76, 'LC': -5.03, 'HE': -2.27, 'FV': -5.75, 'LS': -3.16, 'DY': -2.25, 'GM': -3.75, 'WT': -3.31, 'WK': -2.49, 'QI': -3.22, 'TY': -2.48, 'MI': -6.33, 'II': -6.22, 'VC': -4.46, 'NN': -1.59, 'LY': -4.26, 'PI': -3.47, 'GQ': -1.54, 'LQ': -3.09, 'KL': -2.63, 'CN': -2.59, 'EG': -1.22, 'SN': -1.31, 'DP': -1.19, 'SK': -0.83, 'FK': -2.83, 'HL': -3.84, 'YV': -4.05, 'PS': -1.35, 'MA': -3.99, 'RE': -2.07, 'MH': -3.31, 'QR': -1.85, 'IH': -3.76, 'IF': -6.39, 'PL': -3.06, 'SE': -1.48, 'YD': -2.25, 'RN': -1.41, 'SR': -1.22, 'GD': -1.62, 'SY': -2.3, 'DC': -2.66, 'IR': -3.33, 'NM': -3.5, 'AE': -1.51, 'YG': -2.5, 'MG': -3.75, 'DH': -2.14, 'HM': -3.31, 'CK': -1.54, 'EV': -2.56, 'ET': -1.45, 'TC': -2.88, 'HQ': -1.85, 'RI': -3.33, 'HT': -2.31, 'AC': -3.38, 'YP': -2.8, 'HH': -2.78, 'YC': -3.89, 'DE': -1.23, 'EI': -3.23, 'WG': -3.37, 'ED': -1.23, 'VK': -1.95, 'EK': -1.6, 'CC': -5.44, 'LI': -6.17, 'TE': -1.45, 'TN': -1.51, 'AI': -4.41, 'CM': -5.05, 'TG': -2.03, 'NE': -1.43, 'PH': -2.17, 'GW': -3.37, 'FD': -3.31, 'RG': -1.68, 'AG': -2.15, 'MY': -4.92, 'IK': -2.7, 'QC': -2.73, 'KK': 0.13, 'QA': -1.7, 'DN': -1.33, 'DI': -2.91, 'SI': -3.43, 'FL': -6.26, 'GS': -1.7, 'FI': -6.39, 'YF': -4.95, 'CA': -3.38, 'PV': -2.96, 'IW': -5.64, 'DA': -1.57, 'TK': -1.02, 'TW': -3.31, 'PE': -1.4, 'AV': -3.62, 'QE': -1.33, 'TM': -3.73, 'NS': -1.31, 'FF': -6.85, 'WP': -3.66, 'VY': -4.05, 'MD': -2.9, 'SL': -3.16, 'CG': -3.16, 'QH': -1.85, 'PR': -1.85, 'DL': -2.59, 'IA': -4.41, 'PC': -2.92, 'MM': -6.06, 'GY': -2.5, 'QF': -3.3, 'DG': -1.62, 'VN': -2.36, 'AF': -4.36, 'RH': -2.12, 'KF': -2.83, 'SA': -1.89, 'VI': -5.58, 'ES': -1.48, 'TA': -2.15, 'EP': -1.4, 'SV': -2.79, 'GI': -3.65, 'LN': -2.99, 'IV': -5.58, 'YL': -4.26, 'MV': -5.52, 'YY': -3.55, 'VV': -4.94, 'FS': -3.56, 'HS': -1.94, 'MW': -6.37, 'CR': -2.7, 'NY': -2.47, 'PM': -4.11, 'RP': -1.85, 'IL': -6.17, 'WW': -5.42, 'NA': -1.44, 'GV': -3.06, 'YH': -3.33, 'VM': -5.52, 'SM': -3.55, 'YA': -2.85, 'KH': -1.09, 'RD': -1.98, 'DW': -2.91, 'SP': -1.35, 'RL': -3.15, 'NG': -1.56, 'CT': -2.88, 'LG': -3.43, 'PD': -1.19, 'NW': -3.11, 'YR': -2.75, 'AR': -1.5, 'QV': -2.67, 'IT': -3.74, 'FG': -3.72, 'KW': -2.49, 'NK': -0.91, 'RT': -1.97, 'MR': -3.49, 'EC': -2.08, 'VE': -2.56, 'KV': -1.95, 'PT': -1.66, 'EY': -2.42, 'QS': -1.37, 'TH': -2.31, 'NQ': -1.36, 'LL': -5.79, 'HP': -2.17, 'KY': -2.01, 'SF': -3.56, 'YE': -2.42, 'LF': -6.26, 'MT': -3.73, 'RK': -0.06, 'DM': -2.9, 'MN': -3.5, 'KQ': -1.02, 'TQ': -1.59, 'RA': -1.5, 'DR': -1.98, 'CP': -2.92, 'FM': -6.68, 'ER': -2.07, 'DD': -0.96, 'DT': -1.66, 'TS': -1.59, 'FE': -3.51, 'WM': -6.37, 'RV': -2.78, 'AM': -3.99, 'FH': -4.61, 'QN': -1.36, 'TP': -1.66, 'CS': -2.86, 'YS': -2.3, 'KI': -2.7, 'ND': -1.33, 'AH': -2.09, 'SQ': -1.37, 'YK': -2.01, 'KP': -0.67, 'VH': -3.38, 'QP': -1.73, 'YQ': -2.53, 'YT': -2.48, 'TI': -3.74, 'RC': -2.7, 'ID': -2.91, 'LT': -3.43, 'HY': -3.33, 'TT': -1.72, 'RQ': -1.85, 'GE': -1.22, 'YN': -2.47, 'LP': -3.06, 'QK': -1.02, 'ST': -1.59, 'AW': -3.93, 'TV': -2.95, 'KE': -1.6, 'EA': -1.51, 'FP': -3.73, 'IP': -3.47, 'WD': -2.91, 'RM': -3.49, 'FT': -3.76, 'AD': -1.57, 'PQ': -1.73, 'HA': -2.09, 'VS': -2.79, 'IQ': -3.22, 'SW': -2.95, 'QT': -1.59, 'WE': -2.94, 'PW': -3.66, 'GR': -1.68, 'VA': -3.62, 'QG': -1.54, 'WF': -6.02, 'NC': -2.59, 'SH': -1.94, 'GN': -1.56, 'LA': -3.96, 'VQ': -2.67, 'CQ': -2.73, 'LM': -6.01, 'SC': -2.86, 'AP': -1.81, 'VD': -2.25, 'EE': -1.18, 'HG': -1.94, 'KC': -1.54, 'VP': -2.96, 'HD': -2.14, 'FQ': -3.3, 'GH': -1.94, 'SG': -1.7, 'EQ': -1.33, 'NF': -3.55, 'AN': -1.44, 'MC': -5.05})¶ Bases:
object
Build an Conformations like object without the database. Uses a list of conformations provided by user to construct a Conformations object.
Note This will likely be much slower at calculating large lists of conformations.
Parameters: - length – is an integer specifying the length of the protein for which we are computing the contacts. It must be >= 2.
- conflist – a list of conformations.
- interaction_energies – specifies the interaction energies between residues. By default, this is interactions.miyazawa_jernigan.
-
fold_sequence
(seq, temp)¶ Folds a protein sequence, calculate native energy and partition sum.
Parameters: - seq (string) – is the sequence of the protein to be folded as one-letter amino acid codes. It should be a string or list of length ‘c.Length()’.
- temp – is the temperature at which the protein is to be folded. It must be a number > 0. It represents a reduced temperature, scaled so that a value of 1 represents 273 K.
Returns: - minE (float) – The energy of the lowest energy conformation.
- conf (str) – Lowest energy conformation.
- partitionsum (float) – Total partition function sum.
- numcontacts (int) – Number of contacts in the native conformation.
- folds (bool) – True if lattice protein has a single lowest energy.
-
length
()¶ Returns the length of the protein these conformations are for.
-
max_contacts
()¶ Gets the most contacts of any conformation.
Returns: n – is returned as the number of contacts for the conformation with the most contacts. Return type: int
-
num_conformations
(contacts=None)¶ Returns the number of conformations.
- If ‘contacts’ has its default value of ‘None’, returns the total
- number of conformations (self-avoiding walks).
- If ‘contacts’ has an integer value, returns the number of conformations
- with ‘contacts’ contacts. If there are no walks with this number of contacts, returns 0.
-
num_contact_sets
(contacts=None)¶ Returns the number of unique contact sets.
- If ‘contacts’ has its default value of ‘None’, returns the total
- number of unique contact sets (defined as the list of all contacts of non-adjacent residues).
- If ‘contacts’ has an integer value, returns the number of unique
- contact sets with ‘contacts’ contacts. If there are no contact sets with this number of contacts, returns 0.
-
unique_conformations
(numcontacts)¶ Gets all unique conformations with specified number of contacts.
Parameters: numcontacts (int) – Number of contacts to include in unique conformations list. Returns: clist – is of all unique conformations with exactly ‘numcontacts’ contacts. A conformation is “unique” if it is the only conformation that gives rise to its particular contact set. If there are no unique conformations with ‘numcontacts’ contacts, ‘clist’ is an empty list. Conformations are specified as strings of ‘U’, ‘R’, ‘L’, and ‘D’ as described in ‘FoldSequence’. Return type: list
-
class
latticeproteins.conformations.
Conformations
(length, database_dir='database/', interaction_energies={'TF': -3.76, 'RY': -2.75, 'FN': -3.55, 'LD': -2.59, 'VT': -2.95, 'WL': -5.5, 'FR': -3.54, 'KD': -1.32, 'NL': -2.99, 'VW': -5.05, 'LE': -2.91, 'AA': -2.51, 'NI': -2.99, 'FA': -4.36, 'GA': -2.15, 'YI': -4.63, 'IN': -2.99, 'DV': -2.25, 'CV': -4.46, 'DF': -3.31, 'QW': -3.16, 'AL': -3.96, 'NH': -2.01, 'GT': -2.03, 'CL': -5.03, 'KM': -3.11, 'NR': -1.41, 'WN': -3.11, 'AT': -2.15, 'CW': -4.76, 'WI': -5.64, 'LV': -5.38, 'QD': -1.26, 'PF': -3.73, 'PY': -2.8, 'DQ': -1.26, 'PG': -1.72, 'TL': -3.43, 'CH': -3.63, 'PA': -1.81, 'QQ': -0.89, 'TD': -1.66, 'FW': -6.02, 'IM': -6.33, 'HV': -3.38, 'GG': -2.17, 'ML': -6.01, 'WV': -5.05, 'AY': -2.85, 'KT': -1.02, 'DS': -1.46, 'WH': -4.02, 'QM': -3.17, 'GF': -3.72, 'VL': -5.38, 'PK': -0.67, 'RR': -1.39, 'EN': -1.43, 'NV': -2.36, 'MS': -3.55, 'VG': -3.06, 'LK': -2.63, 'HC': -3.63, 'CE': -2.08, 'AK': -1.1, 'WQ': -3.16, 'WS': -2.95, 'YW': -4.44, 'GP': -1.72, 'LH': -3.84, 'FC': -5.63, 'SD': -1.46, 'IS': -3.43, 'EW': -2.94, 'NP': -1.43, 'GC': -3.16, 'HN': -2.01, 'EH': -2.27, 'HR': -2.12, 'QL': -3.09, 'VF': -5.75, 'CD': -2.66, 'MF': -6.68, 'IE': -3.23, 'EM': -3.19, 'HK': -1.09, 'MQ': -3.17, 'DK': -1.32, 'RS': -1.22, 'CF': -5.63, 'PN': -1.43, 'KA': -1.1, 'RF': -3.54, 'IG': -3.65, 'AS': -1.89, 'KG': -0.84, 'WY': -4.44, 'HW': -4.02, 'HI': -3.76, 'EF': -3.51, 'MK': -3.11, 'HF': -4.61, 'YM': -4.92, 'WR': -3.56, 'KS': -0.83, 'KN': -0.91, 'ME': -3.19, 'VR': -2.78, 'IC': -5.03, 'GK': -0.84, 'LW': -5.5, 'CI': -5.03, 'QY': -2.53, 'NT': -1.51, 'AQ': -1.7, 'FY': -4.95, 'SS': -1.48, 'EL': -2.91, 'PP': -1.18, 'KR': -0.06, 'RW': -3.56, 'LR': -3.15, 'CY': -3.89, 'IY': -4.63, 'MP': -4.11, 'GL': -3.43, 'TR': -1.97, 'WA': -3.93, 'WC': -4.76, 'LC': -5.03, 'HE': -2.27, 'FV': -5.75, 'LS': -3.16, 'DY': -2.25, 'GM': -3.75, 'WT': -3.31, 'WK': -2.49, 'QI': -3.22, 'TY': -2.48, 'MI': -6.33, 'II': -6.22, 'VC': -4.46, 'NN': -1.59, 'LY': -4.26, 'PI': -3.47, 'GQ': -1.54, 'LQ': -3.09, 'KL': -2.63, 'CN': -2.59, 'EG': -1.22, 'SN': -1.31, 'DP': -1.19, 'SK': -0.83, 'FK': -2.83, 'HL': -3.84, 'YV': -4.05, 'PS': -1.35, 'MA': -3.99, 'RE': -2.07, 'MH': -3.31, 'QR': -1.85, 'IH': -3.76, 'IF': -6.39, 'PL': -3.06, 'SE': -1.48, 'YD': -2.25, 'RN': -1.41, 'SR': -1.22, 'GD': -1.62, 'SY': -2.3, 'DC': -2.66, 'IR': -3.33, 'NM': -3.5, 'AE': -1.51, 'YG': -2.5, 'MG': -3.75, 'DH': -2.14, 'HM': -3.31, 'CK': -1.54, 'EV': -2.56, 'ET': -1.45, 'TC': -2.88, 'HQ': -1.85, 'RI': -3.33, 'HT': -2.31, 'AC': -3.38, 'YP': -2.8, 'HH': -2.78, 'YC': -3.89, 'DE': -1.23, 'EI': -3.23, 'WG': -3.37, 'ED': -1.23, 'VK': -1.95, 'EK': -1.6, 'CC': -5.44, 'LI': -6.17, 'TE': -1.45, 'TN': -1.51, 'AI': -4.41, 'CM': -5.05, 'TG': -2.03, 'NE': -1.43, 'PH': -2.17, 'GW': -3.37, 'FD': -3.31, 'RG': -1.68, 'AG': -2.15, 'MY': -4.92, 'IK': -2.7, 'QC': -2.73, 'KK': 0.13, 'QA': -1.7, 'DN': -1.33, 'DI': -2.91, 'SI': -3.43, 'FL': -6.26, 'GS': -1.7, 'FI': -6.39, 'YF': -4.95, 'CA': -3.38, 'PV': -2.96, 'IW': -5.64, 'DA': -1.57, 'TK': -1.02, 'TW': -3.31, 'PE': -1.4, 'AV': -3.62, 'QE': -1.33, 'TM': -3.73, 'NS': -1.31, 'FF': -6.85, 'WP': -3.66, 'VY': -4.05, 'MD': -2.9, 'SL': -3.16, 'CG': -3.16, 'QH': -1.85, 'PR': -1.85, 'DL': -2.59, 'IA': -4.41, 'PC': -2.92, 'MM': -6.06, 'GY': -2.5, 'QF': -3.3, 'DG': -1.62, 'VN': -2.36, 'AF': -4.36, 'RH': -2.12, 'KF': -2.83, 'SA': -1.89, 'VI': -5.58, 'ES': -1.48, 'TA': -2.15, 'EP': -1.4, 'SV': -2.79, 'GI': -3.65, 'LN': -2.99, 'IV': -5.58, 'YL': -4.26, 'MV': -5.52, 'YY': -3.55, 'VV': -4.94, 'FS': -3.56, 'HS': -1.94, 'MW': -6.37, 'CR': -2.7, 'NY': -2.47, 'PM': -4.11, 'RP': -1.85, 'IL': -6.17, 'WW': -5.42, 'NA': -1.44, 'GV': -3.06, 'YH': -3.33, 'VM': -5.52, 'SM': -3.55, 'YA': -2.85, 'KH': -1.09, 'RD': -1.98, 'DW': -2.91, 'SP': -1.35, 'RL': -3.15, 'NG': -1.56, 'CT': -2.88, 'LG': -3.43, 'PD': -1.19, 'NW': -3.11, 'YR': -2.75, 'AR': -1.5, 'QV': -2.67, 'IT': -3.74, 'FG': -3.72, 'KW': -2.49, 'NK': -0.91, 'RT': -1.97, 'MR': -3.49, 'EC': -2.08, 'VE': -2.56, 'KV': -1.95, 'PT': -1.66, 'EY': -2.42, 'QS': -1.37, 'TH': -2.31, 'NQ': -1.36, 'LL': -5.79, 'HP': -2.17, 'KY': -2.01, 'SF': -3.56, 'YE': -2.42, 'LF': -6.26, 'MT': -3.73, 'RK': -0.06, 'DM': -2.9, 'MN': -3.5, 'KQ': -1.02, 'TQ': -1.59, 'RA': -1.5, 'DR': -1.98, 'CP': -2.92, 'FM': -6.68, 'ER': -2.07, 'DD': -0.96, 'DT': -1.66, 'TS': -1.59, 'FE': -3.51, 'WM': -6.37, 'RV': -2.78, 'AM': -3.99, 'FH': -4.61, 'QN': -1.36, 'TP': -1.66, 'CS': -2.86, 'YS': -2.3, 'KI': -2.7, 'ND': -1.33, 'AH': -2.09, 'SQ': -1.37, 'YK': -2.01, 'KP': -0.67, 'VH': -3.38, 'QP': -1.73, 'YQ': -2.53, 'YT': -2.48, 'TI': -3.74, 'RC': -2.7, 'ID': -2.91, 'LT': -3.43, 'HY': -3.33, 'TT': -1.72, 'RQ': -1.85, 'GE': -1.22, 'YN': -2.47, 'LP': -3.06, 'QK': -1.02, 'ST': -1.59, 'AW': -3.93, 'TV': -2.95, 'KE': -1.6, 'EA': -1.51, 'FP': -3.73, 'IP': -3.47, 'WD': -2.91, 'RM': -3.49, 'FT': -3.76, 'AD': -1.57, 'PQ': -1.73, 'HA': -2.09, 'VS': -2.79, 'IQ': -3.22, 'SW': -2.95, 'QT': -1.59, 'WE': -2.94, 'PW': -3.66, 'GR': -1.68, 'VA': -3.62, 'QG': -1.54, 'WF': -6.02, 'NC': -2.59, 'SH': -1.94, 'GN': -1.56, 'LA': -3.96, 'VQ': -2.67, 'CQ': -2.73, 'LM': -6.01, 'SC': -2.86, 'AP': -1.81, 'VD': -2.25, 'EE': -1.18, 'HG': -1.94, 'KC': -1.54, 'VP': -2.96, 'HD': -2.14, 'FQ': -3.3, 'GH': -1.94, 'SG': -1.7, 'EQ': -1.33, 'NF': -3.55, 'AN': -1.44, 'MC': -5.05})¶ Bases:
object
Creates a database of conformations for a protein of specified length.
- The created ‘Conformations’ object ‘c’ stores the contact
- lists and the number of conformations with these contact sets for all self-avoiding walks of length ‘length’. It can then be used to compute the free energy of a protein folding to the lowest energy conformation.
Parameters: - length – is an integer specifying the length of the protein for which we are computing the contacts. It must be >= 2.
- database_dir – specifies the name of the database directory storing existing conformations. If the conformation instance already exists in this database we return the existing data, and if it doesn’t we store it in the database.
- interaction_energies – specifies the interaction energies between residues. By default, this is interactions.miyazawa_jernigan.
-
_numconformations
¶ dict – A dictionary mapping the number of contact sets to the number of conformations with that contact set.
-
_contactsets
¶ list of lists – ‘self._contactsets’ is a list of contact sets. ‘self._contactsets[i]’ is the contact set for contact i. It is a list of numbers. ‘x = self._contactsets[i]’ describes the residues in contact in contact ‘i’. If this contact is between residues ‘ires’ and ‘jres’, then ‘x = self._length * ires + jres’ where 0 <= ires, jres < ‘self._length’, and ires < jres + 1 contact sets
-
_contactsetdegeneracy
¶ list – ‘self._contactsetdegeneracy’ is a list of integers giving the degeneracy of the contact sets (the number of different conformations with this contact set). ‘self_contactsetdegeneracy[i]’ is the degeneracy of the contact set ‘self._contactsets[i]’
-
_contactsetconformation
¶ list – ‘self._contactsetconformation’ is a list of the conformations associated with each contact set. If contact set ‘self._contactsets[i]’ is degenerate (‘self._contactsetdegeneracy[i]’ > 1), the value ‘self._contactsetconformation[i]’ is ‘None’. Otherwise, it is the string representing the conformation that gives rise to contact set ‘self._contactsets[i]’. The conformations are given such that ‘self._contactsetconformation[i][j]’ gives the conformation of bond ‘j’ (0 <= j < ‘self._length’ - 1) as ‘U’ (Up), ‘R’ (Right), ‘D’ (Down), or ‘L’ (Left). We require the first bond to be Up, and the first non-Up bond to be Right.
-
_numcontactsets
¶ dict – ‘self._numcontactsets[i]’ holds the number of different contact sets with ‘i’ contacts.
-
fold_sequence
(seq, temp)¶ Folds a protein sequence; calculates native energy and partition sum.
Parameters: - seq (string) – is the sequence of the protein to be folded as one-letter amino acid codes. It should be a string or list of length ‘c.Length()’.
- temp – is the temperature at which the protein is to be folded. It must be a number > 0. It represents a reduced temperature, scaled so that a value of 1 represents 273 K.
Returns: - minE (float) – The energy of the lowest energy conformation.
- conf (str) – Lowest energy conformation.
- partitionsum (float) – Total partition function sum.
- numcontacts (int) – Number of contacts in the native conformation.
- folds (bool) – True if lattice protein has a single lowest energy.
-
k_lowest_confs
(seq, temp, k)¶ Get the k lowest conformations in the sequence’s conformational ensemble.
-
length
()¶ Returns the length of the protein these conformations are for.
-
max_contacts
()¶ Gets the most contacts of any conformation.
Returns: n – is returned as the number of contacts for the conformation with the most contacts. Return type: int
-
num_conformations
(contacts=None)¶ Returns the number of conformations.
- If ‘contacts’ has its default value of ‘None’, returns the total
- number of conformations (self-avoiding walks).
- If ‘contacts’ has an integer value, returns the number of conformations
- with ‘contacts’ contacts. If there are no walks with this number of contacts, returns 0.
-
num_contact_sets
(contacts=None)¶ Returns the number of unique contact sets.
- If ‘contacts’ has its default value of ‘None’, returns the total
- number of unique contact sets (defined as the list of all contacts of non-adjacent residues).
- If ‘contacts’ has an integer value, returns the number of unique
- contact sets with ‘contacts’ contacts. If there are no contact sets with this number of contacts, returns 0.
-
unique_conformations
(numcontacts)¶ Gets all unique conformations with specified number of contacts.
Parameters: numcontacts (int) – Number of contacts to include in unique conformations list. Returns: clist – is of all unique conformations with exactly ‘numcontacts’ contacts. A conformation is “unique” if it is the only conformation that gives rise to its particular contact set. If there are no unique conformations with ‘numcontacts’ contacts, ‘clist’ is an empty list. Conformations are specified as strings of ‘U’, ‘R’, ‘L’, and ‘D’ as described in ‘FoldSequence’. Return type: list
-
exception
latticeproteins.conformations.
ConformationsError
¶ Bases:
Exception
Error finding or storing a conformation.
-
exception
latticeproteins.conformations.
PickleProtocolError
¶ Bases:
Exception
Error is pickle version is too old.
-
latticeproteins.conformations.
fold_energy
(sequence, conformation, interactions={'TF': -3.76, 'RY': -2.75, 'FN': -3.55, 'LD': -2.59, 'VT': -2.95, 'WL': -5.5, 'FR': -3.54, 'KD': -1.32, 'NL': -2.99, 'VW': -5.05, 'LE': -2.91, 'AA': -2.51, 'NI': -2.99, 'FA': -4.36, 'GA': -2.15, 'YI': -4.63, 'IN': -2.99, 'DV': -2.25, 'CV': -4.46, 'DF': -3.31, 'QW': -3.16, 'AL': -3.96, 'NH': -2.01, 'GT': -2.03, 'CL': -5.03, 'KM': -3.11, 'NR': -1.41, 'WN': -3.11, 'AT': -2.15, 'CW': -4.76, 'WI': -5.64, 'LV': -5.38, 'QD': -1.26, 'PF': -3.73, 'PY': -2.8, 'DQ': -1.26, 'PG': -1.72, 'TL': -3.43, 'CH': -3.63, 'PA': -1.81, 'QQ': -0.89, 'TD': -1.66, 'FW': -6.02, 'IM': -6.33, 'HV': -3.38, 'GG': -2.17, 'ML': -6.01, 'WV': -5.05, 'AY': -2.85, 'KT': -1.02, 'DS': -1.46, 'WH': -4.02, 'QM': -3.17, 'GF': -3.72, 'VL': -5.38, 'PK': -0.67, 'RR': -1.39, 'EN': -1.43, 'NV': -2.36, 'MS': -3.55, 'VG': -3.06, 'LK': -2.63, 'HC': -3.63, 'CE': -2.08, 'AK': -1.1, 'WQ': -3.16, 'WS': -2.95, 'YW': -4.44, 'GP': -1.72, 'LH': -3.84, 'FC': -5.63, 'SD': -1.46, 'IS': -3.43, 'EW': -2.94, 'NP': -1.43, 'GC': -3.16, 'HN': -2.01, 'EH': -2.27, 'HR': -2.12, 'QL': -3.09, 'VF': -5.75, 'CD': -2.66, 'MF': -6.68, 'IE': -3.23, 'EM': -3.19, 'HK': -1.09, 'MQ': -3.17, 'DK': -1.32, 'RS': -1.22, 'CF': -5.63, 'PN': -1.43, 'KA': -1.1, 'RF': -3.54, 'IG': -3.65, 'AS': -1.89, 'KG': -0.84, 'WY': -4.44, 'HW': -4.02, 'HI': -3.76, 'EF': -3.51, 'MK': -3.11, 'HF': -4.61, 'YM': -4.92, 'WR': -3.56, 'KS': -0.83, 'KN': -0.91, 'ME': -3.19, 'VR': -2.78, 'IC': -5.03, 'GK': -0.84, 'LW': -5.5, 'CI': -5.03, 'QY': -2.53, 'NT': -1.51, 'AQ': -1.7, 'FY': -4.95, 'SS': -1.48, 'EL': -2.91, 'PP': -1.18, 'KR': -0.06, 'RW': -3.56, 'LR': -3.15, 'CY': -3.89, 'IY': -4.63, 'MP': -4.11, 'GL': -3.43, 'TR': -1.97, 'WA': -3.93, 'WC': -4.76, 'LC': -5.03, 'HE': -2.27, 'FV': -5.75, 'LS': -3.16, 'DY': -2.25, 'GM': -3.75, 'WT': -3.31, 'WK': -2.49, 'QI': -3.22, 'TY': -2.48, 'MI': -6.33, 'II': -6.22, 'VC': -4.46, 'NN': -1.59, 'LY': -4.26, 'PI': -3.47, 'GQ': -1.54, 'LQ': -3.09, 'KL': -2.63, 'CN': -2.59, 'EG': -1.22, 'SN': -1.31, 'DP': -1.19, 'SK': -0.83, 'FK': -2.83, 'HL': -3.84, 'YV': -4.05, 'PS': -1.35, 'MA': -3.99, 'RE': -2.07, 'MH': -3.31, 'QR': -1.85, 'IH': -3.76, 'IF': -6.39, 'PL': -3.06, 'SE': -1.48, 'YD': -2.25, 'RN': -1.41, 'SR': -1.22, 'GD': -1.62, 'SY': -2.3, 'DC': -2.66, 'IR': -3.33, 'NM': -3.5, 'AE': -1.51, 'YG': -2.5, 'MG': -3.75, 'DH': -2.14, 'HM': -3.31, 'CK': -1.54, 'EV': -2.56, 'ET': -1.45, 'TC': -2.88, 'HQ': -1.85, 'RI': -3.33, 'HT': -2.31, 'AC': -3.38, 'YP': -2.8, 'HH': -2.78, 'YC': -3.89, 'DE': -1.23, 'EI': -3.23, 'WG': -3.37, 'ED': -1.23, 'VK': -1.95, 'EK': -1.6, 'CC': -5.44, 'LI': -6.17, 'TE': -1.45, 'TN': -1.51, 'AI': -4.41, 'CM': -5.05, 'TG': -2.03, 'NE': -1.43, 'PH': -2.17, 'GW': -3.37, 'FD': -3.31, 'RG': -1.68, 'AG': -2.15, 'MY': -4.92, 'IK': -2.7, 'QC': -2.73, 'KK': 0.13, 'QA': -1.7, 'DN': -1.33, 'DI': -2.91, 'SI': -3.43, 'FL': -6.26, 'GS': -1.7, 'FI': -6.39, 'YF': -4.95, 'CA': -3.38, 'PV': -2.96, 'IW': -5.64, 'DA': -1.57, 'TK': -1.02, 'TW': -3.31, 'PE': -1.4, 'AV': -3.62, 'QE': -1.33, 'TM': -3.73, 'NS': -1.31, 'FF': -6.85, 'WP': -3.66, 'VY': -4.05, 'MD': -2.9, 'SL': -3.16, 'CG': -3.16, 'QH': -1.85, 'PR': -1.85, 'DL': -2.59, 'IA': -4.41, 'PC': -2.92, 'MM': -6.06, 'GY': -2.5, 'QF': -3.3, 'DG': -1.62, 'VN': -2.36, 'AF': -4.36, 'RH': -2.12, 'KF': -2.83, 'SA': -1.89, 'VI': -5.58, 'ES': -1.48, 'TA': -2.15, 'EP': -1.4, 'SV': -2.79, 'GI': -3.65, 'LN': -2.99, 'IV': -5.58, 'YL': -4.26, 'MV': -5.52, 'YY': -3.55, 'VV': -4.94, 'FS': -3.56, 'HS': -1.94, 'MW': -6.37, 'CR': -2.7, 'NY': -2.47, 'PM': -4.11, 'RP': -1.85, 'IL': -6.17, 'WW': -5.42, 'NA': -1.44, 'GV': -3.06, 'YH': -3.33, 'VM': -5.52, 'SM': -3.55, 'YA': -2.85, 'KH': -1.09, 'RD': -1.98, 'DW': -2.91, 'SP': -1.35, 'RL': -3.15, 'NG': -1.56, 'CT': -2.88, 'LG': -3.43, 'PD': -1.19, 'NW': -3.11, 'YR': -2.75, 'AR': -1.5, 'QV': -2.67, 'IT': -3.74, 'FG': -3.72, 'KW': -2.49, 'NK': -0.91, 'RT': -1.97, 'MR': -3.49, 'EC': -2.08, 'VE': -2.56, 'KV': -1.95, 'PT': -1.66, 'EY': -2.42, 'QS': -1.37, 'TH': -2.31, 'NQ': -1.36, 'LL': -5.79, 'HP': -2.17, 'KY': -2.01, 'SF': -3.56, 'YE': -2.42, 'LF': -6.26, 'MT': -3.73, 'RK': -0.06, 'DM': -2.9, 'MN': -3.5, 'KQ': -1.02, 'TQ': -1.59, 'RA': -1.5, 'DR': -1.98, 'CP': -2.92, 'FM': -6.68, 'ER': -2.07, 'DD': -0.96, 'DT': -1.66, 'TS': -1.59, 'FE': -3.51, 'WM': -6.37, 'RV': -2.78, 'AM': -3.99, 'FH': -4.61, 'QN': -1.36, 'TP': -1.66, 'CS': -2.86, 'YS': -2.3, 'KI': -2.7, 'ND': -1.33, 'AH': -2.09, 'SQ': -1.37, 'YK': -2.01, 'KP': -0.67, 'VH': -3.38, 'QP': -1.73, 'YQ': -2.53, 'YT': -2.48, 'TI': -3.74, 'RC': -2.7, 'ID': -2.91, 'LT': -3.43, 'HY': -3.33, 'TT': -1.72, 'RQ': -1.85, 'GE': -1.22, 'YN': -2.47, 'LP': -3.06, 'QK': -1.02, 'ST': -1.59, 'AW': -3.93, 'TV': -2.95, 'KE': -1.6, 'EA': -1.51, 'FP': -3.73, 'IP': -3.47, 'WD': -2.91, 'RM': -3.49, 'FT': -3.76, 'AD': -1.57, 'PQ': -1.73, 'HA': -2.09, 'VS': -2.79, 'IQ': -3.22, 'SW': -2.95, 'QT': -1.59, 'WE': -2.94, 'PW': -3.66, 'GR': -1.68, 'VA': -3.62, 'QG': -1.54, 'WF': -6.02, 'NC': -2.59, 'SH': -1.94, 'GN': -1.56, 'LA': -3.96, 'VQ': -2.67, 'CQ': -2.73, 'LM': -6.01, 'SC': -2.86, 'AP': -1.81, 'VD': -2.25, 'EE': -1.18, 'HG': -1.94, 'KC': -1.54, 'VP': -2.96, 'HD': -2.14, 'FQ': -3.3, 'GH': -1.94, 'SG': -1.7, 'EQ': -1.33, 'NF': -3.55, 'AN': -1.44, 'MC': -5.05})¶ Calculate the energy of the sequence with the given conformation.
Parameters: - sequence (str) – Amino acid sequence to fold.
- conformation (str) – Conformation according to latticemodel’s conformations format (e.g. ‘UDLLDRU’)
Returns: energy – energy of the conformation (sum of all contact energies)
Return type: float
-
latticeproteins.conformations.
lattice_contacts
(sequence, conformation)¶ Find all contacts in conformation.
Parameters: - sequence (str) – Amino acid sequence to fold.
- conformation (str) – Conformation according to latticemodel’s conformations format (e.g. ‘UDLLDRU’)
Returns: contacts – list of contact pairs
Return type: list
latticeproteins.draw module¶
Module for creating SVG’s of protein lattice configurations.
Originally written by Jesse Bloom, 2004.
Updated by Zach Sailer, 2017.
Example call:
>>> # Create an instance
>>> drawing = latticegpm.svg.Configuration(sequence, configuration, filename="drawing1.svg")
>>> # Save to file
>>> # drawing.save()
>>> # Print in Jupyter (IPython) notebook
>>> drawing.notebook
-
class
latticeproteins.draw.
Configuration
(sequence, configuration, color_sequence=None, rotation=0, font_size=20, dot_scale=1.0, font_weight='normal')¶ Bases:
IPython.core.display.SVG
Main class for drawing an SVG of a lattice protein’s fold.
Parameters: - sequence (str) – Amino acid sequence
- configuration (str) – sequence of direction letters describing the 2d configuration.
- colors (list of strings) – list of colors for each amino acid in sequence
- rotation (int) – rotate the configuration by 0, 90, 180, or 270 degrees
- font_size (int) – Font size, in pixels, of sequence in configuration. The svg will scale with the font size of the letters.
Examples
>>> # Create an instance >>> drawing = Configuration(sequence, configuration) >>> # Save to file >>> # drawing.save() >>> # Print in Jupyter (IPython) notebook >>> drawing.notebook
-
data
¶ Return svg as a string.
-
notebook
¶ Display SVG in Jupyther notebook.
-
rotate
(rotation)¶ Rotate the drawing by 90, 180, or 270.
-
save
(filename)¶ save svg
-
latticeproteins.draw.
configuration_to_array
(sequence, configuration)¶ Create a square numpy array with the configuration laid out.
-
latticeproteins.draw.
in_notebook
(sequence, conf, **kwargs)¶ Creates a Python SVG configuration object. Automagically displays in notebook.
-
latticeproteins.draw.
to_file
(sequence, conf, filename, **kwargs)¶
latticeproteins.interactions module¶
Originally written by Jesse Bloom, 2004.
Updated by Zach Sailer, 2017.
latticeproteins.sequences module¶
Originally written by Jesse Bloom, 2004.
Updated by Zach Sailer, 2017.
-
exception
latticeproteins.sequences.
SequenceError
¶ Bases:
Exception
Error with a lattice protein sequence.
-
latticeproteins.sequences.
hamming_distance
(seq1, seq2)¶ Returns the Hamming distance between two sequences.
-
latticeproteins.sequences.
mutate_sequence
(seq, mutrate)¶ Mutates a protein sequence.
Parameters: - seq – is a protein sequence, specified as either a string or a list.
- mutrate – Mutates each residue in ‘seq’ to some different residue with probability ‘mutrate’. So ‘mutrate’ is the per residue mutation rate.
Returns: the new sequence as a list.
Return type: newseq
-
latticeproteins.sequences.
n_mutants
(seq, nmutations, nsequences)¶ Returns sequences with a specified number of mutations.
Parameters: - seq – is a string or list specifying the protein we wish to mutate.
- nmutations – is the number of mutations each mutant of ‘seq’ should have. It must be <= ‘len(seq)’ and > 0.
- nsequences – is the number of mutant sequences to make. It can be ‘ALL’, in which case we make all possible mutants with ‘nmutations’, or it can be some positive integer in which case we make this many randomly chosen mutants with ‘nmutations’ mutations. ‘ALL’ is only a valid option only when ‘nmutations’ is 1 or 2.
Returns: seqlist – List of mutant sequences n mutations away.
Return type: list
-
latticeproteins.sequences.
random_sequence
(length)¶ Returns a random sequence of the specified length.
latticeproteins.thermodynamics module¶
Module for calculating thermodynamics of lattice protein sequences.
Originally written by Jesse Bloom, 2004.
Updated by Zach Sailer, 2017.
-
class
latticeproteins.thermodynamics.
GroupThermodynamics
(seqlist, temp, confs, target=None)¶ Bases:
object
Efficiently calculates thermodynamic properties for a list of lattice proteins.
Parameters: - seqlist (list) – List of lattice proteins.
- temp (float) – temperature of the system.
- confs (Conformations or ConformationList object) – Conformation database for lattice with set length
- target (str (optional, default=None)) – target conformation to fold protein list
-
seqlist
¶ list – list of sequences.
-
temp
¶ float – temperature of the system.
-
nativeEs
¶ array – native (or target) energy for sequences in seqlist
-
stabilities
¶ array – array of stabilities for sequences in seqlist
-
fracfolded
¶ array – array of fraction folded for sequences in seqlist
-
fracfolded
Fracfolded folded for all sequences in seqlist.
-
stabilities
Folding stability for all sequences in seqlist.
-
class
latticeproteins.thermodynamics.
LatticeThermodynamics
(temp, confs)¶ Bases:
object
Attaches thermodynamic evaluators to a lattice protein conformation database.
Parameters: - temp (float) – the temperature at which the fitness is computed.
- confs (conformations.Conformations object) – is the ‘conformations.Conformations’ object used to fold the protein sequences. ‘conformations.Length()’ specifies the length of the protein sequences that can be folded.
-
all_metrics
(seq)¶ Compute lattice NativeE, Stability, and Fitness of a given sequence.
Parameters: seq (str) – protein sequence string. Returns: - nativeE (float) – energy of the native state.
- dG (float) – stability of the native state.
- fitness (float) – fitness of the native state.
-
fracfolded
(seq, target=None)¶ Compute the fraction folded of the sequence.
Parameters: seq (str or list) – sequence to fold. Returns: fracfolded – fractioned folded. Return type: float
-
classmethod
from_length
(length, temp, database_dir='database/', interactions={'TF': -3.76, 'RY': -2.75, 'FN': -3.55, 'LD': -2.59, 'VT': -2.95, 'WL': -5.5, 'FR': -3.54, 'KD': -1.32, 'NL': -2.99, 'VW': -5.05, 'LE': -2.91, 'AA': -2.51, 'NI': -2.99, 'FA': -4.36, 'GA': -2.15, 'YI': -4.63, 'IN': -2.99, 'DV': -2.25, 'CV': -4.46, 'DF': -3.31, 'QW': -3.16, 'AL': -3.96, 'NH': -2.01, 'GT': -2.03, 'CL': -5.03, 'KM': -3.11, 'NR': -1.41, 'WN': -3.11, 'AT': -2.15, 'CW': -4.76, 'WI': -5.64, 'LV': -5.38, 'QD': -1.26, 'PF': -3.73, 'PY': -2.8, 'DQ': -1.26, 'PG': -1.72, 'TL': -3.43, 'CH': -3.63, 'PA': -1.81, 'QQ': -0.89, 'TD': -1.66, 'FW': -6.02, 'IM': -6.33, 'HV': -3.38, 'GG': -2.17, 'ML': -6.01, 'WV': -5.05, 'AY': -2.85, 'KT': -1.02, 'DS': -1.46, 'WH': -4.02, 'QM': -3.17, 'GF': -3.72, 'VL': -5.38, 'PK': -0.67, 'RR': -1.39, 'EN': -1.43, 'NV': -2.36, 'MS': -3.55, 'VG': -3.06, 'LK': -2.63, 'HC': -3.63, 'CE': -2.08, 'AK': -1.1, 'WQ': -3.16, 'WS': -2.95, 'YW': -4.44, 'GP': -1.72, 'LH': -3.84, 'FC': -5.63, 'SD': -1.46, 'IS': -3.43, 'EW': -2.94, 'NP': -1.43, 'GC': -3.16, 'HN': -2.01, 'EH': -2.27, 'HR': -2.12, 'QL': -3.09, 'VF': -5.75, 'CD': -2.66, 'MF': -6.68, 'IE': -3.23, 'EM': -3.19, 'HK': -1.09, 'MQ': -3.17, 'DK': -1.32, 'RS': -1.22, 'CF': -5.63, 'PN': -1.43, 'KA': -1.1, 'RF': -3.54, 'IG': -3.65, 'AS': -1.89, 'KG': -0.84, 'WY': -4.44, 'HW': -4.02, 'HI': -3.76, 'EF': -3.51, 'MK': -3.11, 'HF': -4.61, 'YM': -4.92, 'WR': -3.56, 'KS': -0.83, 'KN': -0.91, 'ME': -3.19, 'VR': -2.78, 'IC': -5.03, 'GK': -0.84, 'LW': -5.5, 'CI': -5.03, 'QY': -2.53, 'NT': -1.51, 'AQ': -1.7, 'FY': -4.95, 'SS': -1.48, 'EL': -2.91, 'PP': -1.18, 'KR': -0.06, 'RW': -3.56, 'LR': -3.15, 'CY': -3.89, 'IY': -4.63, 'MP': -4.11, 'GL': -3.43, 'TR': -1.97, 'WA': -3.93, 'WC': -4.76, 'LC': -5.03, 'HE': -2.27, 'FV': -5.75, 'LS': -3.16, 'DY': -2.25, 'GM': -3.75, 'WT': -3.31, 'WK': -2.49, 'QI': -3.22, 'TY': -2.48, 'MI': -6.33, 'II': -6.22, 'VC': -4.46, 'NN': -1.59, 'LY': -4.26, 'PI': -3.47, 'GQ': -1.54, 'LQ': -3.09, 'KL': -2.63, 'CN': -2.59, 'EG': -1.22, 'SN': -1.31, 'DP': -1.19, 'SK': -0.83, 'FK': -2.83, 'HL': -3.84, 'YV': -4.05, 'PS': -1.35, 'MA': -3.99, 'RE': -2.07, 'MH': -3.31, 'QR': -1.85, 'IH': -3.76, 'IF': -6.39, 'PL': -3.06, 'SE': -1.48, 'YD': -2.25, 'RN': -1.41, 'SR': -1.22, 'GD': -1.62, 'SY': -2.3, 'DC': -2.66, 'IR': -3.33, 'NM': -3.5, 'AE': -1.51, 'YG': -2.5, 'MG': -3.75, 'DH': -2.14, 'HM': -3.31, 'CK': -1.54, 'EV': -2.56, 'ET': -1.45, 'TC': -2.88, 'HQ': -1.85, 'RI': -3.33, 'HT': -2.31, 'AC': -3.38, 'YP': -2.8, 'HH': -2.78, 'YC': -3.89, 'DE': -1.23, 'EI': -3.23, 'WG': -3.37, 'ED': -1.23, 'VK': -1.95, 'EK': -1.6, 'CC': -5.44, 'LI': -6.17, 'TE': -1.45, 'TN': -1.51, 'AI': -4.41, 'CM': -5.05, 'TG': -2.03, 'NE': -1.43, 'PH': -2.17, 'GW': -3.37, 'FD': -3.31, 'RG': -1.68, 'AG': -2.15, 'MY': -4.92, 'IK': -2.7, 'QC': -2.73, 'KK': 0.13, 'QA': -1.7, 'DN': -1.33, 'DI': -2.91, 'SI': -3.43, 'FL': -6.26, 'GS': -1.7, 'FI': -6.39, 'YF': -4.95, 'CA': -3.38, 'PV': -2.96, 'IW': -5.64, 'DA': -1.57, 'TK': -1.02, 'TW': -3.31, 'PE': -1.4, 'AV': -3.62, 'QE': -1.33, 'TM': -3.73, 'NS': -1.31, 'FF': -6.85, 'WP': -3.66, 'VY': -4.05, 'MD': -2.9, 'SL': -3.16, 'CG': -3.16, 'QH': -1.85, 'PR': -1.85, 'DL': -2.59, 'IA': -4.41, 'PC': -2.92, 'MM': -6.06, 'GY': -2.5, 'QF': -3.3, 'DG': -1.62, 'VN': -2.36, 'AF': -4.36, 'RH': -2.12, 'KF': -2.83, 'SA': -1.89, 'VI': -5.58, 'ES': -1.48, 'TA': -2.15, 'EP': -1.4, 'SV': -2.79, 'GI': -3.65, 'LN': -2.99, 'IV': -5.58, 'YL': -4.26, 'MV': -5.52, 'YY': -3.55, 'VV': -4.94, 'FS': -3.56, 'HS': -1.94, 'MW': -6.37, 'CR': -2.7, 'NY': -2.47, 'PM': -4.11, 'RP': -1.85, 'IL': -6.17, 'WW': -5.42, 'NA': -1.44, 'GV': -3.06, 'YH': -3.33, 'VM': -5.52, 'SM': -3.55, 'YA': -2.85, 'KH': -1.09, 'RD': -1.98, 'DW': -2.91, 'SP': -1.35, 'RL': -3.15, 'NG': -1.56, 'CT': -2.88, 'LG': -3.43, 'PD': -1.19, 'NW': -3.11, 'YR': -2.75, 'AR': -1.5, 'QV': -2.67, 'IT': -3.74, 'FG': -3.72, 'KW': -2.49, 'NK': -0.91, 'RT': -1.97, 'MR': -3.49, 'EC': -2.08, 'VE': -2.56, 'KV': -1.95, 'PT': -1.66, 'EY': -2.42, 'QS': -1.37, 'TH': -2.31, 'NQ': -1.36, 'LL': -5.79, 'HP': -2.17, 'KY': -2.01, 'SF': -3.56, 'YE': -2.42, 'LF': -6.26, 'MT': -3.73, 'RK': -0.06, 'DM': -2.9, 'MN': -3.5, 'KQ': -1.02, 'TQ': -1.59, 'RA': -1.5, 'DR': -1.98, 'CP': -2.92, 'FM': -6.68, 'ER': -2.07, 'DD': -0.96, 'DT': -1.66, 'TS': -1.59, 'FE': -3.51, 'WM': -6.37, 'RV': -2.78, 'AM': -3.99, 'FH': -4.61, 'QN': -1.36, 'TP': -1.66, 'CS': -2.86, 'YS': -2.3, 'KI': -2.7, 'ND': -1.33, 'AH': -2.09, 'SQ': -1.37, 'YK': -2.01, 'KP': -0.67, 'VH': -3.38, 'QP': -1.73, 'YQ': -2.53, 'YT': -2.48, 'TI': -3.74, 'RC': -2.7, 'ID': -2.91, 'LT': -3.43, 'HY': -3.33, 'TT': -1.72, 'RQ': -1.85, 'GE': -1.22, 'YN': -2.47, 'LP': -3.06, 'QK': -1.02, 'ST': -1.59, 'AW': -3.93, 'TV': -2.95, 'KE': -1.6, 'EA': -1.51, 'FP': -3.73, 'IP': -3.47, 'WD': -2.91, 'RM': -3.49, 'FT': -3.76, 'AD': -1.57, 'PQ': -1.73, 'HA': -2.09, 'VS': -2.79, 'IQ': -3.22, 'SW': -2.95, 'QT': -1.59, 'WE': -2.94, 'PW': -3.66, 'GR': -1.68, 'VA': -3.62, 'QG': -1.54, 'WF': -6.02, 'NC': -2.59, 'SH': -1.94, 'GN': -1.56, 'LA': -3.96, 'VQ': -2.67, 'CQ': -2.73, 'LM': -6.01, 'SC': -2.86, 'AP': -1.81, 'VD': -2.25, 'EE': -1.18, 'HG': -1.94, 'KC': -1.54, 'VP': -2.96, 'HD': -2.14, 'FQ': -3.3, 'GH': -1.94, 'SG': -1.7, 'EQ': -1.33, 'NF': -3.55, 'AN': -1.44, 'MC': -5.05})¶ Create a thermodynamic object for sequences of a given length.
-
length
()¶ Returns the sequence length for which fitnesses are computed.
-
nativeE
(seq, target=None)¶ Compute the native energy and return it.
Parameters: seq (str or list) – sequence to fold. Returns: minE – Energy of the native state. Return type: float
-
native_conf
(seq)¶ Return the native conformation.
-
stability
(seq, target=None)¶ Computes the stability of a sequence if it is below cutoff.
Parameters: seq (str or list) – sequence to fold. Returns: stability – Folding stability of the native state. Return type: float
-
exception
latticeproteins.thermodynamics.
ThermodynamicsError
¶ Bases:
Exception
Error computing lattice protein thermodynamics.
Module contents¶
This package contains utilities for lattice protein conformations.
Uses 2-dimensional non-compact models.
Originally written by Jesse Bloom.
Extended by Zach Sailer.