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={'YI': -4.63, 'MC': -5.05, 'FF': -6.85, 'LL': -5.79, 'PH': -2.17, 'RM': -3.49, 'WF': -6.02, 'RI': -3.33, 'SF': -3.56, 'QM': -3.17, 'GD': -1.62, 'CC': -5.44, 'CL': -5.03, 'SW': -2.95, 'VS': -2.79, 'LW': -5.5, 'LG': -3.43, 'CD': -2.66, 'ES': -1.48, 'TD': -1.66, 'AI': -4.41, 'NI': -2.99, 'PA': -1.81, 'AS': -1.89, 'EC': -2.08, 'IR': -3.33, 'TE': -1.45, 'DS': -1.46, 'IL': -6.17, 'SK': -0.83, 'YK': -2.01, 'QN': -1.36, 'QL': -3.09, 'RQ': -1.85, 'CF': -5.63, 'WD': -2.91, 'DE': -1.23, 'IT': -3.74, 'GG': -2.17, 'FA': -4.36, 'QY': -2.53, 'NR': -1.41, 'IN': -2.99, 'IV': -5.58, 'LN': -2.99, 'VM': -5.52, 'FT': -3.76, 'TH': -2.31, 'VN': -2.36, 'HP': -2.17, 'GL': -3.43, 'NQ': -1.36, 'FE': -3.51, 'MR': -3.49, 'RY': -2.75, 'LV': -5.38, 'GF': -3.72, 'VP': -2.96, 'YS': -2.3, 'HT': -2.31, 'EF': -3.51, 'VH': -3.38, 'QT': -1.59, 'IG': -3.65, 'WR': -3.56, 'HN': -2.01, 'PW': -3.66, 'DF': -3.31, 'MT': -3.73, 'KL': -2.63, 'PD': -1.19, 'EM': -3.19, 'HC': -3.63, 'CQ': -2.73, 'LC': -5.03, 'TM': -3.73, 'WC': -4.76, 'IA': -4.41, 'GM': -3.75, 'PT': -1.66, 'PN': -1.43, 'HW': -4.02, 'GW': -3.37, 'HV': -3.38, 'KP': -0.67, 'TK': -1.02, 'IF': -6.39, 'WY': -4.44, 'TY': -2.48, 'DA': -1.57, 'QD': -1.26, 'HM': -3.31, 'GE': -1.22, 'EY': -2.42, 'MA': -3.99, 'YY': -3.55, 'EP': -1.4, 'QG': -1.54, 'RK': -0.06, 'QA': -1.7, 'SC': -2.86, 'GP': -1.72, 'RC': -2.7, 'VI': -5.58, 'FV': -5.75, 'PF': -3.73, 'FR': -3.54, 'VT': -2.95, 'VW': -5.05, 'FK': -2.83, 'DN': -1.33, 'IQ': -3.22, 'CP': -2.92, 'CH': -3.63, 'YT': -2.48, 'TR': -1.97, 'KQ': -1.02, 'MV': -5.52, 'YL': -4.26, 'YD': -2.25, 'EN': -1.43, 'PS': -1.35, 'NG': -1.56, 'TW': -3.31, 'WE': -2.94, 'TN': -1.51, 'DK': -1.32, 'WM': -6.37, 'CM': -5.05, 'PC': -2.92, 'RS': -1.22, 'KS': -0.83, 'DT': -1.66, 'TG': -2.03, 'FH': -4.61, 'GN': -1.56, 'NP': -1.43, 'VQ': -2.67, 'TI': -3.74, 'GA': -2.15, 'EI': -3.23, 'LY': -4.26, 'CK': -1.54, 'SS': -1.48, 'EH': -2.27, 'CA': -3.38, 'YR': -2.75, 'RP': -1.85, 'KH': -1.09, 'GH': -1.94, 'IC': -5.03, 'EW': -2.94, 'PE': -1.4, 'EE': -1.18, 'HS': -1.94, 'TF': -3.76, 'KV': -1.95, 'SL': -3.16, 'DL': -2.59, 'QK': -1.02, 'FP': -3.73, 'AL': -3.96, 'DY': -2.25, 'NY': -2.47, 'RA': -1.5, 'MK': -3.11, 'GK': -0.84, 'SN': -1.31, 'RG': -1.68, 'ST': -1.59, 'YE': -2.42, 'KE': -1.6, 'VK': -1.95, 'SA': -1.89, 'IP': -3.47, 'NC': -2.59, 'HH': -2.78, 'WA': -3.93, 'EV': -2.56, 'LI': -6.17, 'RD': -1.98, 'DR': -1.98, 'RE': -2.07, 'KY': -2.01, 'KA': -1.1, 'AA': -2.51, 'QP': -1.73, 'PY': -2.8, 'TS': -1.59, 'SI': -3.43, 'LQ': -3.09, 'NE': -1.43, 'PP': -1.18, 'YM': -4.92, 'IS': -3.43, 'NN': -1.59, 'PR': -1.85, 'LH': -3.84, 'QW': -3.16, 'TP': -1.66, 'PI': -3.47, 'DI': -2.91, 'NW': -3.11, 'IW': -5.64, 'DH': -2.14, 'SH': -1.94, 'WK': -2.49, 'WL': -5.5, 'PK': -0.67, 'HK': -1.09, 'HE': -2.27, 'AQ': -1.7, 'NL': -2.99, 'SV': -2.79, 'EA': -1.51, 'KK': 0.13, 'RF': -3.54, 'NK': -0.91, 'TV': -2.95, 'RT': -1.97, 'IE': -3.23, 'AY': -2.85, 'QC': -2.73, 'IH': -3.76, 'FI': -6.39, 'FQ': -3.3, 'ME': -3.19, 'VL': -5.38, 'FG': -3.72, 'GY': -2.5, 'WH': -4.02, 'LK': -2.63, 'KC': -1.54, 'KR': -0.06, 'QF': -3.3, 'MD': -2.9, 'CG': -3.16, 'ID': -2.91, 'YQ': -2.53, 'HD': -2.14, 'FM': -6.68, 'MS': -3.55, 'CI': -5.03, 'DW': -2.91, 'AN': -1.44, 'HR': -2.12, 'AR': -1.5, 'NS': -1.31, 'TQ': -1.59, 'KN': -0.91, 'VV': -4.94, 'IM': -6.33, 'LD': -2.59, 'SR': -1.22, 'VC': -4.46, 'WN': -3.11, 'VE': -2.56, 'YG': -2.5, 'NF': -3.55, 'KG': -0.84, 'HG': -1.94, 'TA': -2.15, 'YH': -3.33, 'GR': -1.68, 'GI': -3.65, 'RV': -2.78, 'DV': -2.25, 'FN': -3.55, 'CR': -2.7, 'DM': -2.9, 'VA': -3.62, 'SY': -2.3, 'RW': -3.56, 'NT': -1.51, 'WI': -5.64, 'WQ': -3.16, 'IK': -2.7, 'NH': -2.01, 'RR': -1.39, 'YA': -2.85, 'CV': -4.46, 'CS': -2.86, 'IY': -4.63, 'PG': -1.72, 'LT': -3.43, 'WW': -5.42, 'MM': -6.06, 'YN': -2.47, 'II': -6.22, 'MY': -4.92, 'AE': -1.51, 'KT': -1.02, 'MH': -3.31, 'RL': -3.15, 'YW': -4.44, 'MN': -3.5, 'DC': -2.66, 'MI': -6.33, 'SE': -1.48, 'FS': -3.56, 'GV': -3.06, 'DP': -1.19, 'AV': -3.62, 'AG': -2.15, 'VY': -4.05, 'CY': -3.89, 'KW': -2.49, 'MQ': -3.17, 'TT': -1.72, 'QH': -1.85, 'MF': -6.68, 'NV': -2.36, 'KD': -1.32, 'WV': -5.05, 'EG': -1.22, 'WT': -3.31, 'NA': -1.44, 'CE': -2.08, 'HI': -3.76, 'YC': -3.89, 'AT': -2.15, 'GC': -3.16, 'ED': -1.23, 'VD': -2.25, 'MW': -6.37, 'SM': -3.55, 'DD': -0.96, 'EQ': -1.33, 'SQ': -1.37, 'QE': -1.33, 'SD': -1.46, 'EK': -1.6, 'LS': -3.16, 'AC': -3.38, 'TL': -3.43, 'LM': -6.01, 'PL': -3.06, 'GQ': -1.54, 'VR': -2.78, 'HL': -3.84, 'NM': -3.5, 'SP': -1.35, 'ND': -1.33, 'AK': -1.1, 'VF': -5.75, 'HA': -2.09, 'MG': -3.75, 'LE': -2.91, 'PV': -2.96, 'FW': -6.02, 'KM': -3.11, 'GT': -2.03, 'FD': -3.31, 'KF': -2.83, 'WG': -3.37, 'KI': -2.7, 'PM': -4.11, 'AP': -1.81, 'AM': -3.99, 'QQ': -0.89, 'SG': -1.7, 'QS': -1.37, 'WP': -3.66, 'ET': -1.45, 'QV': -2.67, 'LR': -3.15, 'CN': -2.59, 'YF': -4.95, 'FC': -5.63, 'TC': -2.88, 'DQ': -1.26, 'RH': -2.12, 'CW': -4.76, 'MP': -4.11, 'AH': -2.09, 'RN': -1.41, 'ER': -2.07, 'EL': -2.91, 'HY': -3.33, 'HQ': -1.85, 'LP': -3.06, 'PQ': -1.73, 'WS': -2.95, 'YV': -4.05, 'FY': -4.95, 'HF': -4.61, 'QI': -3.22, 'DG': -1.62, 'LA': -3.96, 'ML': -6.01, 'AW': -3.93, 'AF': -4.36, 'AD': -1.57, 'CT': -2.88, 'YP': -2.8, 'VG': -3.06, 'QR': -1.85, 'GS': -1.7, 'FL': -6.26, 'LF': -6.26})

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={'YI': -4.63, 'MC': -5.05, 'FF': -6.85, 'LL': -5.79, 'PH': -2.17, 'RM': -3.49, 'WF': -6.02, 'RI': -3.33, 'SF': -3.56, 'QM': -3.17, 'GD': -1.62, 'CC': -5.44, 'CL': -5.03, 'SW': -2.95, 'VS': -2.79, 'LW': -5.5, 'LG': -3.43, 'CD': -2.66, 'ES': -1.48, 'TD': -1.66, 'AI': -4.41, 'NI': -2.99, 'PA': -1.81, 'AS': -1.89, 'EC': -2.08, 'IR': -3.33, 'TE': -1.45, 'DS': -1.46, 'IL': -6.17, 'SK': -0.83, 'YK': -2.01, 'QN': -1.36, 'QL': -3.09, 'RQ': -1.85, 'CF': -5.63, 'WD': -2.91, 'DE': -1.23, 'IT': -3.74, 'GG': -2.17, 'FA': -4.36, 'QY': -2.53, 'NR': -1.41, 'IN': -2.99, 'IV': -5.58, 'LN': -2.99, 'VM': -5.52, 'FT': -3.76, 'TH': -2.31, 'VN': -2.36, 'HP': -2.17, 'GL': -3.43, 'NQ': -1.36, 'FE': -3.51, 'MR': -3.49, 'RY': -2.75, 'LV': -5.38, 'GF': -3.72, 'VP': -2.96, 'YS': -2.3, 'HT': -2.31, 'EF': -3.51, 'VH': -3.38, 'QT': -1.59, 'IG': -3.65, 'WR': -3.56, 'HN': -2.01, 'PW': -3.66, 'DF': -3.31, 'MT': -3.73, 'KL': -2.63, 'PD': -1.19, 'EM': -3.19, 'HC': -3.63, 'CQ': -2.73, 'LC': -5.03, 'TM': -3.73, 'WC': -4.76, 'IA': -4.41, 'GM': -3.75, 'PT': -1.66, 'PN': -1.43, 'HW': -4.02, 'GW': -3.37, 'HV': -3.38, 'KP': -0.67, 'TK': -1.02, 'IF': -6.39, 'WY': -4.44, 'TY': -2.48, 'DA': -1.57, 'QD': -1.26, 'HM': -3.31, 'GE': -1.22, 'EY': -2.42, 'MA': -3.99, 'YY': -3.55, 'EP': -1.4, 'QG': -1.54, 'RK': -0.06, 'QA': -1.7, 'SC': -2.86, 'GP': -1.72, 'RC': -2.7, 'VI': -5.58, 'FV': -5.75, 'PF': -3.73, 'FR': -3.54, 'VT': -2.95, 'VW': -5.05, 'FK': -2.83, 'DN': -1.33, 'IQ': -3.22, 'CP': -2.92, 'CH': -3.63, 'YT': -2.48, 'TR': -1.97, 'KQ': -1.02, 'MV': -5.52, 'YL': -4.26, 'YD': -2.25, 'EN': -1.43, 'PS': -1.35, 'NG': -1.56, 'TW': -3.31, 'WE': -2.94, 'TN': -1.51, 'DK': -1.32, 'WM': -6.37, 'CM': -5.05, 'PC': -2.92, 'RS': -1.22, 'KS': -0.83, 'DT': -1.66, 'TG': -2.03, 'FH': -4.61, 'GN': -1.56, 'NP': -1.43, 'VQ': -2.67, 'TI': -3.74, 'GA': -2.15, 'EI': -3.23, 'LY': -4.26, 'CK': -1.54, 'SS': -1.48, 'EH': -2.27, 'CA': -3.38, 'YR': -2.75, 'RP': -1.85, 'KH': -1.09, 'GH': -1.94, 'IC': -5.03, 'EW': -2.94, 'PE': -1.4, 'EE': -1.18, 'HS': -1.94, 'TF': -3.76, 'KV': -1.95, 'SL': -3.16, 'DL': -2.59, 'QK': -1.02, 'FP': -3.73, 'AL': -3.96, 'DY': -2.25, 'NY': -2.47, 'RA': -1.5, 'MK': -3.11, 'GK': -0.84, 'SN': -1.31, 'RG': -1.68, 'ST': -1.59, 'YE': -2.42, 'KE': -1.6, 'VK': -1.95, 'SA': -1.89, 'IP': -3.47, 'NC': -2.59, 'HH': -2.78, 'WA': -3.93, 'EV': -2.56, 'LI': -6.17, 'RD': -1.98, 'DR': -1.98, 'RE': -2.07, 'KY': -2.01, 'KA': -1.1, 'AA': -2.51, 'QP': -1.73, 'PY': -2.8, 'TS': -1.59, 'SI': -3.43, 'LQ': -3.09, 'NE': -1.43, 'PP': -1.18, 'YM': -4.92, 'IS': -3.43, 'NN': -1.59, 'PR': -1.85, 'LH': -3.84, 'QW': -3.16, 'TP': -1.66, 'PI': -3.47, 'DI': -2.91, 'NW': -3.11, 'IW': -5.64, 'DH': -2.14, 'SH': -1.94, 'WK': -2.49, 'WL': -5.5, 'PK': -0.67, 'HK': -1.09, 'HE': -2.27, 'AQ': -1.7, 'NL': -2.99, 'SV': -2.79, 'EA': -1.51, 'KK': 0.13, 'RF': -3.54, 'NK': -0.91, 'TV': -2.95, 'RT': -1.97, 'IE': -3.23, 'AY': -2.85, 'QC': -2.73, 'IH': -3.76, 'FI': -6.39, 'FQ': -3.3, 'ME': -3.19, 'VL': -5.38, 'FG': -3.72, 'GY': -2.5, 'WH': -4.02, 'LK': -2.63, 'KC': -1.54, 'KR': -0.06, 'QF': -3.3, 'MD': -2.9, 'CG': -3.16, 'ID': -2.91, 'YQ': -2.53, 'HD': -2.14, 'FM': -6.68, 'MS': -3.55, 'CI': -5.03, 'DW': -2.91, 'AN': -1.44, 'HR': -2.12, 'AR': -1.5, 'NS': -1.31, 'TQ': -1.59, 'KN': -0.91, 'VV': -4.94, 'IM': -6.33, 'LD': -2.59, 'SR': -1.22, 'VC': -4.46, 'WN': -3.11, 'VE': -2.56, 'YG': -2.5, 'NF': -3.55, 'KG': -0.84, 'HG': -1.94, 'TA': -2.15, 'YH': -3.33, 'GR': -1.68, 'GI': -3.65, 'RV': -2.78, 'DV': -2.25, 'FN': -3.55, 'CR': -2.7, 'DM': -2.9, 'VA': -3.62, 'SY': -2.3, 'RW': -3.56, 'NT': -1.51, 'WI': -5.64, 'WQ': -3.16, 'IK': -2.7, 'NH': -2.01, 'RR': -1.39, 'YA': -2.85, 'CV': -4.46, 'CS': -2.86, 'IY': -4.63, 'PG': -1.72, 'LT': -3.43, 'WW': -5.42, 'MM': -6.06, 'YN': -2.47, 'II': -6.22, 'MY': -4.92, 'AE': -1.51, 'KT': -1.02, 'MH': -3.31, 'RL': -3.15, 'YW': -4.44, 'MN': -3.5, 'DC': -2.66, 'MI': -6.33, 'SE': -1.48, 'FS': -3.56, 'GV': -3.06, 'DP': -1.19, 'AV': -3.62, 'AG': -2.15, 'VY': -4.05, 'CY': -3.89, 'KW': -2.49, 'MQ': -3.17, 'TT': -1.72, 'QH': -1.85, 'MF': -6.68, 'NV': -2.36, 'KD': -1.32, 'WV': -5.05, 'EG': -1.22, 'WT': -3.31, 'NA': -1.44, 'CE': -2.08, 'HI': -3.76, 'YC': -3.89, 'AT': -2.15, 'GC': -3.16, 'ED': -1.23, 'VD': -2.25, 'MW': -6.37, 'SM': -3.55, 'DD': -0.96, 'EQ': -1.33, 'SQ': -1.37, 'QE': -1.33, 'SD': -1.46, 'EK': -1.6, 'LS': -3.16, 'AC': -3.38, 'TL': -3.43, 'LM': -6.01, 'PL': -3.06, 'GQ': -1.54, 'VR': -2.78, 'HL': -3.84, 'NM': -3.5, 'SP': -1.35, 'ND': -1.33, 'AK': -1.1, 'VF': -5.75, 'HA': -2.09, 'MG': -3.75, 'LE': -2.91, 'PV': -2.96, 'FW': -6.02, 'KM': -3.11, 'GT': -2.03, 'FD': -3.31, 'KF': -2.83, 'WG': -3.37, 'KI': -2.7, 'PM': -4.11, 'AP': -1.81, 'AM': -3.99, 'QQ': -0.89, 'SG': -1.7, 'QS': -1.37, 'WP': -3.66, 'ET': -1.45, 'QV': -2.67, 'LR': -3.15, 'CN': -2.59, 'YF': -4.95, 'FC': -5.63, 'TC': -2.88, 'DQ': -1.26, 'RH': -2.12, 'CW': -4.76, 'MP': -4.11, 'AH': -2.09, 'RN': -1.41, 'ER': -2.07, 'EL': -2.91, 'HY': -3.33, 'HQ': -1.85, 'LP': -3.06, 'PQ': -1.73, 'WS': -2.95, 'YV': -4.05, 'FY': -4.95, 'HF': -4.61, 'QI': -3.22, 'DG': -1.62, 'LA': -3.96, 'ML': -6.01, 'AW': -3.93, 'AF': -4.36, 'AD': -1.57, 'CT': -2.88, 'YP': -2.8, 'VG': -3.06, 'QR': -1.85, 'GS': -1.7, 'FL': -6.26, 'LF': -6.26})

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={'YI': -4.63, 'MC': -5.05, 'FF': -6.85, 'LL': -5.79, 'PH': -2.17, 'RM': -3.49, 'WF': -6.02, 'RI': -3.33, 'SF': -3.56, 'QM': -3.17, 'GD': -1.62, 'CC': -5.44, 'CL': -5.03, 'SW': -2.95, 'VS': -2.79, 'LW': -5.5, 'LG': -3.43, 'CD': -2.66, 'ES': -1.48, 'TD': -1.66, 'AI': -4.41, 'NI': -2.99, 'PA': -1.81, 'AS': -1.89, 'EC': -2.08, 'IR': -3.33, 'TE': -1.45, 'DS': -1.46, 'IL': -6.17, 'SK': -0.83, 'YK': -2.01, 'QN': -1.36, 'QL': -3.09, 'RQ': -1.85, 'CF': -5.63, 'WD': -2.91, 'DE': -1.23, 'IT': -3.74, 'GG': -2.17, 'FA': -4.36, 'QY': -2.53, 'NR': -1.41, 'IN': -2.99, 'IV': -5.58, 'LN': -2.99, 'VM': -5.52, 'FT': -3.76, 'TH': -2.31, 'VN': -2.36, 'HP': -2.17, 'GL': -3.43, 'NQ': -1.36, 'FE': -3.51, 'MR': -3.49, 'RY': -2.75, 'LV': -5.38, 'GF': -3.72, 'VP': -2.96, 'YS': -2.3, 'HT': -2.31, 'EF': -3.51, 'VH': -3.38, 'QT': -1.59, 'IG': -3.65, 'WR': -3.56, 'HN': -2.01, 'PW': -3.66, 'DF': -3.31, 'MT': -3.73, 'KL': -2.63, 'PD': -1.19, 'EM': -3.19, 'HC': -3.63, 'CQ': -2.73, 'LC': -5.03, 'TM': -3.73, 'WC': -4.76, 'IA': -4.41, 'GM': -3.75, 'PT': -1.66, 'PN': -1.43, 'HW': -4.02, 'GW': -3.37, 'HV': -3.38, 'KP': -0.67, 'TK': -1.02, 'IF': -6.39, 'WY': -4.44, 'TY': -2.48, 'DA': -1.57, 'QD': -1.26, 'HM': -3.31, 'GE': -1.22, 'EY': -2.42, 'MA': -3.99, 'YY': -3.55, 'EP': -1.4, 'QG': -1.54, 'RK': -0.06, 'QA': -1.7, 'SC': -2.86, 'GP': -1.72, 'RC': -2.7, 'VI': -5.58, 'FV': -5.75, 'PF': -3.73, 'FR': -3.54, 'VT': -2.95, 'VW': -5.05, 'FK': -2.83, 'DN': -1.33, 'IQ': -3.22, 'CP': -2.92, 'CH': -3.63, 'YT': -2.48, 'TR': -1.97, 'KQ': -1.02, 'MV': -5.52, 'YL': -4.26, 'YD': -2.25, 'EN': -1.43, 'PS': -1.35, 'NG': -1.56, 'TW': -3.31, 'WE': -2.94, 'TN': -1.51, 'DK': -1.32, 'WM': -6.37, 'CM': -5.05, 'PC': -2.92, 'RS': -1.22, 'KS': -0.83, 'DT': -1.66, 'TG': -2.03, 'FH': -4.61, 'GN': -1.56, 'NP': -1.43, 'VQ': -2.67, 'TI': -3.74, 'GA': -2.15, 'EI': -3.23, 'LY': -4.26, 'CK': -1.54, 'SS': -1.48, 'EH': -2.27, 'CA': -3.38, 'YR': -2.75, 'RP': -1.85, 'KH': -1.09, 'GH': -1.94, 'IC': -5.03, 'EW': -2.94, 'PE': -1.4, 'EE': -1.18, 'HS': -1.94, 'TF': -3.76, 'KV': -1.95, 'SL': -3.16, 'DL': -2.59, 'QK': -1.02, 'FP': -3.73, 'AL': -3.96, 'DY': -2.25, 'NY': -2.47, 'RA': -1.5, 'MK': -3.11, 'GK': -0.84, 'SN': -1.31, 'RG': -1.68, 'ST': -1.59, 'YE': -2.42, 'KE': -1.6, 'VK': -1.95, 'SA': -1.89, 'IP': -3.47, 'NC': -2.59, 'HH': -2.78, 'WA': -3.93, 'EV': -2.56, 'LI': -6.17, 'RD': -1.98, 'DR': -1.98, 'RE': -2.07, 'KY': -2.01, 'KA': -1.1, 'AA': -2.51, 'QP': -1.73, 'PY': -2.8, 'TS': -1.59, 'SI': -3.43, 'LQ': -3.09, 'NE': -1.43, 'PP': -1.18, 'YM': -4.92, 'IS': -3.43, 'NN': -1.59, 'PR': -1.85, 'LH': -3.84, 'QW': -3.16, 'TP': -1.66, 'PI': -3.47, 'DI': -2.91, 'NW': -3.11, 'IW': -5.64, 'DH': -2.14, 'SH': -1.94, 'WK': -2.49, 'WL': -5.5, 'PK': -0.67, 'HK': -1.09, 'HE': -2.27, 'AQ': -1.7, 'NL': -2.99, 'SV': -2.79, 'EA': -1.51, 'KK': 0.13, 'RF': -3.54, 'NK': -0.91, 'TV': -2.95, 'RT': -1.97, 'IE': -3.23, 'AY': -2.85, 'QC': -2.73, 'IH': -3.76, 'FI': -6.39, 'FQ': -3.3, 'ME': -3.19, 'VL': -5.38, 'FG': -3.72, 'GY': -2.5, 'WH': -4.02, 'LK': -2.63, 'KC': -1.54, 'KR': -0.06, 'QF': -3.3, 'MD': -2.9, 'CG': -3.16, 'ID': -2.91, 'YQ': -2.53, 'HD': -2.14, 'FM': -6.68, 'MS': -3.55, 'CI': -5.03, 'DW': -2.91, 'AN': -1.44, 'HR': -2.12, 'AR': -1.5, 'NS': -1.31, 'TQ': -1.59, 'KN': -0.91, 'VV': -4.94, 'IM': -6.33, 'LD': -2.59, 'SR': -1.22, 'VC': -4.46, 'WN': -3.11, 'VE': -2.56, 'YG': -2.5, 'NF': -3.55, 'KG': -0.84, 'HG': -1.94, 'TA': -2.15, 'YH': -3.33, 'GR': -1.68, 'GI': -3.65, 'RV': -2.78, 'DV': -2.25, 'FN': -3.55, 'CR': -2.7, 'DM': -2.9, 'VA': -3.62, 'SY': -2.3, 'RW': -3.56, 'NT': -1.51, 'WI': -5.64, 'WQ': -3.16, 'IK': -2.7, 'NH': -2.01, 'RR': -1.39, 'YA': -2.85, 'CV': -4.46, 'CS': -2.86, 'IY': -4.63, 'PG': -1.72, 'LT': -3.43, 'WW': -5.42, 'MM': -6.06, 'YN': -2.47, 'II': -6.22, 'MY': -4.92, 'AE': -1.51, 'KT': -1.02, 'MH': -3.31, 'RL': -3.15, 'YW': -4.44, 'MN': -3.5, 'DC': -2.66, 'MI': -6.33, 'SE': -1.48, 'FS': -3.56, 'GV': -3.06, 'DP': -1.19, 'AV': -3.62, 'AG': -2.15, 'VY': -4.05, 'CY': -3.89, 'KW': -2.49, 'MQ': -3.17, 'TT': -1.72, 'QH': -1.85, 'MF': -6.68, 'NV': -2.36, 'KD': -1.32, 'WV': -5.05, 'EG': -1.22, 'WT': -3.31, 'NA': -1.44, 'CE': -2.08, 'HI': -3.76, 'YC': -3.89, 'AT': -2.15, 'GC': -3.16, 'ED': -1.23, 'VD': -2.25, 'MW': -6.37, 'SM': -3.55, 'DD': -0.96, 'EQ': -1.33, 'SQ': -1.37, 'QE': -1.33, 'SD': -1.46, 'EK': -1.6, 'LS': -3.16, 'AC': -3.38, 'TL': -3.43, 'LM': -6.01, 'PL': -3.06, 'GQ': -1.54, 'VR': -2.78, 'HL': -3.84, 'NM': -3.5, 'SP': -1.35, 'ND': -1.33, 'AK': -1.1, 'VF': -5.75, 'HA': -2.09, 'MG': -3.75, 'LE': -2.91, 'PV': -2.96, 'FW': -6.02, 'KM': -3.11, 'GT': -2.03, 'FD': -3.31, 'KF': -2.83, 'WG': -3.37, 'KI': -2.7, 'PM': -4.11, 'AP': -1.81, 'AM': -3.99, 'QQ': -0.89, 'SG': -1.7, 'QS': -1.37, 'WP': -3.66, 'ET': -1.45, 'QV': -2.67, 'LR': -3.15, 'CN': -2.59, 'YF': -4.95, 'FC': -5.63, 'TC': -2.88, 'DQ': -1.26, 'RH': -2.12, 'CW': -4.76, 'MP': -4.11, 'AH': -2.09, 'RN': -1.41, 'ER': -2.07, 'EL': -2.91, 'HY': -3.33, 'HQ': -1.85, 'LP': -3.06, 'PQ': -1.73, 'WS': -2.95, 'YV': -4.05, 'FY': -4.95, 'HF': -4.61, 'QI': -3.22, 'DG': -1.62, 'LA': -3.96, 'ML': -6.01, 'AW': -3.93, 'AF': -4.36, 'AD': -1.57, 'CT': -2.88, 'YP': -2.8, 'VG': -3.06, 'QR': -1.85, 'GS': -1.7, 'FL': -6.26, 'LF': -6.26})

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={'YI': -4.63, 'MC': -5.05, 'FF': -6.85, 'LL': -5.79, 'PH': -2.17, 'RM': -3.49, 'WF': -6.02, 'RI': -3.33, 'SF': -3.56, 'QM': -3.17, 'GD': -1.62, 'CC': -5.44, 'CL': -5.03, 'SW': -2.95, 'VS': -2.79, 'LW': -5.5, 'LG': -3.43, 'CD': -2.66, 'ES': -1.48, 'TD': -1.66, 'AI': -4.41, 'NI': -2.99, 'PA': -1.81, 'AS': -1.89, 'EC': -2.08, 'IR': -3.33, 'TE': -1.45, 'DS': -1.46, 'IL': -6.17, 'SK': -0.83, 'YK': -2.01, 'QN': -1.36, 'QL': -3.09, 'RQ': -1.85, 'CF': -5.63, 'WD': -2.91, 'DE': -1.23, 'IT': -3.74, 'GG': -2.17, 'FA': -4.36, 'QY': -2.53, 'NR': -1.41, 'IN': -2.99, 'IV': -5.58, 'LN': -2.99, 'VM': -5.52, 'FT': -3.76, 'TH': -2.31, 'VN': -2.36, 'HP': -2.17, 'GL': -3.43, 'NQ': -1.36, 'FE': -3.51, 'MR': -3.49, 'RY': -2.75, 'LV': -5.38, 'GF': -3.72, 'VP': -2.96, 'YS': -2.3, 'HT': -2.31, 'EF': -3.51, 'VH': -3.38, 'QT': -1.59, 'IG': -3.65, 'WR': -3.56, 'HN': -2.01, 'PW': -3.66, 'DF': -3.31, 'MT': -3.73, 'KL': -2.63, 'PD': -1.19, 'EM': -3.19, 'HC': -3.63, 'CQ': -2.73, 'LC': -5.03, 'TM': -3.73, 'WC': -4.76, 'IA': -4.41, 'GM': -3.75, 'PT': -1.66, 'PN': -1.43, 'HW': -4.02, 'GW': -3.37, 'HV': -3.38, 'KP': -0.67, 'TK': -1.02, 'IF': -6.39, 'WY': -4.44, 'TY': -2.48, 'DA': -1.57, 'QD': -1.26, 'HM': -3.31, 'GE': -1.22, 'EY': -2.42, 'MA': -3.99, 'YY': -3.55, 'EP': -1.4, 'QG': -1.54, 'RK': -0.06, 'QA': -1.7, 'SC': -2.86, 'GP': -1.72, 'RC': -2.7, 'VI': -5.58, 'FV': -5.75, 'PF': -3.73, 'FR': -3.54, 'VT': -2.95, 'VW': -5.05, 'FK': -2.83, 'DN': -1.33, 'IQ': -3.22, 'CP': -2.92, 'CH': -3.63, 'YT': -2.48, 'TR': -1.97, 'KQ': -1.02, 'MV': -5.52, 'YL': -4.26, 'YD': -2.25, 'EN': -1.43, 'PS': -1.35, 'NG': -1.56, 'TW': -3.31, 'WE': -2.94, 'TN': -1.51, 'DK': -1.32, 'WM': -6.37, 'CM': -5.05, 'PC': -2.92, 'RS': -1.22, 'KS': -0.83, 'DT': -1.66, 'TG': -2.03, 'FH': -4.61, 'GN': -1.56, 'NP': -1.43, 'VQ': -2.67, 'TI': -3.74, 'GA': -2.15, 'EI': -3.23, 'LY': -4.26, 'CK': -1.54, 'SS': -1.48, 'EH': -2.27, 'CA': -3.38, 'YR': -2.75, 'RP': -1.85, 'KH': -1.09, 'GH': -1.94, 'IC': -5.03, 'EW': -2.94, 'PE': -1.4, 'EE': -1.18, 'HS': -1.94, 'TF': -3.76, 'KV': -1.95, 'SL': -3.16, 'DL': -2.59, 'QK': -1.02, 'FP': -3.73, 'AL': -3.96, 'DY': -2.25, 'NY': -2.47, 'RA': -1.5, 'MK': -3.11, 'GK': -0.84, 'SN': -1.31, 'RG': -1.68, 'ST': -1.59, 'YE': -2.42, 'KE': -1.6, 'VK': -1.95, 'SA': -1.89, 'IP': -3.47, 'NC': -2.59, 'HH': -2.78, 'WA': -3.93, 'EV': -2.56, 'LI': -6.17, 'RD': -1.98, 'DR': -1.98, 'RE': -2.07, 'KY': -2.01, 'KA': -1.1, 'AA': -2.51, 'QP': -1.73, 'PY': -2.8, 'TS': -1.59, 'SI': -3.43, 'LQ': -3.09, 'NE': -1.43, 'PP': -1.18, 'YM': -4.92, 'IS': -3.43, 'NN': -1.59, 'PR': -1.85, 'LH': -3.84, 'QW': -3.16, 'TP': -1.66, 'PI': -3.47, 'DI': -2.91, 'NW': -3.11, 'IW': -5.64, 'DH': -2.14, 'SH': -1.94, 'WK': -2.49, 'WL': -5.5, 'PK': -0.67, 'HK': -1.09, 'HE': -2.27, 'AQ': -1.7, 'NL': -2.99, 'SV': -2.79, 'EA': -1.51, 'KK': 0.13, 'RF': -3.54, 'NK': -0.91, 'TV': -2.95, 'RT': -1.97, 'IE': -3.23, 'AY': -2.85, 'QC': -2.73, 'IH': -3.76, 'FI': -6.39, 'FQ': -3.3, 'ME': -3.19, 'VL': -5.38, 'FG': -3.72, 'GY': -2.5, 'WH': -4.02, 'LK': -2.63, 'KC': -1.54, 'KR': -0.06, 'QF': -3.3, 'MD': -2.9, 'CG': -3.16, 'ID': -2.91, 'YQ': -2.53, 'HD': -2.14, 'FM': -6.68, 'MS': -3.55, 'CI': -5.03, 'DW': -2.91, 'AN': -1.44, 'HR': -2.12, 'AR': -1.5, 'NS': -1.31, 'TQ': -1.59, 'KN': -0.91, 'VV': -4.94, 'IM': -6.33, 'LD': -2.59, 'SR': -1.22, 'VC': -4.46, 'WN': -3.11, 'VE': -2.56, 'YG': -2.5, 'NF': -3.55, 'KG': -0.84, 'HG': -1.94, 'TA': -2.15, 'YH': -3.33, 'GR': -1.68, 'GI': -3.65, 'RV': -2.78, 'DV': -2.25, 'FN': -3.55, 'CR': -2.7, 'DM': -2.9, 'VA': -3.62, 'SY': -2.3, 'RW': -3.56, 'NT': -1.51, 'WI': -5.64, 'WQ': -3.16, 'IK': -2.7, 'NH': -2.01, 'RR': -1.39, 'YA': -2.85, 'CV': -4.46, 'CS': -2.86, 'IY': -4.63, 'PG': -1.72, 'LT': -3.43, 'WW': -5.42, 'MM': -6.06, 'YN': -2.47, 'II': -6.22, 'MY': -4.92, 'AE': -1.51, 'KT': -1.02, 'MH': -3.31, 'RL': -3.15, 'YW': -4.44, 'MN': -3.5, 'DC': -2.66, 'MI': -6.33, 'SE': -1.48, 'FS': -3.56, 'GV': -3.06, 'DP': -1.19, 'AV': -3.62, 'AG': -2.15, 'VY': -4.05, 'CY': -3.89, 'KW': -2.49, 'MQ': -3.17, 'TT': -1.72, 'QH': -1.85, 'MF': -6.68, 'NV': -2.36, 'KD': -1.32, 'WV': -5.05, 'EG': -1.22, 'WT': -3.31, 'NA': -1.44, 'CE': -2.08, 'HI': -3.76, 'YC': -3.89, 'AT': -2.15, 'GC': -3.16, 'ED': -1.23, 'VD': -2.25, 'MW': -6.37, 'SM': -3.55, 'DD': -0.96, 'EQ': -1.33, 'SQ': -1.37, 'QE': -1.33, 'SD': -1.46, 'EK': -1.6, 'LS': -3.16, 'AC': -3.38, 'TL': -3.43, 'LM': -6.01, 'PL': -3.06, 'GQ': -1.54, 'VR': -2.78, 'HL': -3.84, 'NM': -3.5, 'SP': -1.35, 'ND': -1.33, 'AK': -1.1, 'VF': -5.75, 'HA': -2.09, 'MG': -3.75, 'LE': -2.91, 'PV': -2.96, 'FW': -6.02, 'KM': -3.11, 'GT': -2.03, 'FD': -3.31, 'KF': -2.83, 'WG': -3.37, 'KI': -2.7, 'PM': -4.11, 'AP': -1.81, 'AM': -3.99, 'QQ': -0.89, 'SG': -1.7, 'QS': -1.37, 'WP': -3.66, 'ET': -1.45, 'QV': -2.67, 'LR': -3.15, 'CN': -2.59, 'YF': -4.95, 'FC': -5.63, 'TC': -2.88, 'DQ': -1.26, 'RH': -2.12, 'CW': -4.76, 'MP': -4.11, 'AH': -2.09, 'RN': -1.41, 'ER': -2.07, 'EL': -2.91, 'HY': -3.33, 'HQ': -1.85, 'LP': -3.06, 'PQ': -1.73, 'WS': -2.95, 'YV': -4.05, 'FY': -4.95, 'HF': -4.61, 'QI': -3.22, 'DG': -1.62, 'LA': -3.96, 'ML': -6.01, 'AW': -3.93, 'AF': -4.36, 'AD': -1.57, 'CT': -2.88, 'YP': -2.8, 'VG': -3.06, 'QR': -1.85, 'GS': -1.7, 'FL': -6.26, 'LF': -6.26})

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.