AAMut.run
- AAMut.run(from_aa=None, to_aa=None, scales=None)[source]
Compute the signed per-scale impact of amino acid substitutions.
For every
from_aa->to_aapair and every scale, the impact is the signed differencedelta = df_scales.loc[to_aa, scale] - df_scales.loc[from_aa, scale]. With bothfrom_aaandto_aaunset, all 20x19 ordered substitution pairs are returned (a long, AAontology-annotated substitution table).- Parameters:
from_aa (str or list of str, optional) – Amino acid(s) to substitute from. If
None, all canonical amino acids are used.to_aa (str or list of str, optional) – Amino acid(s) to substitute to. If
None, all canonical amino acids are used.scales (list of str, optional) – Subset of scale ids to evaluate. If
None, all scales ofdf_scalesare used.
- Returns:
df_impact – Tidy substitution-impact table with columns
from_aa,to_aa,scale_id,category,subcategory,delta(signed), andabs_delta(magnitude).- Return type:
pd.DataFrame, shape (n_pairs * n_scales, 7)
Examples
AAMutquantifies how substituting one amino acid for another shifts each physicochemical scale, independent of any sequence or task. :meth:AAMut.runreturns a tidy per-scale substitution-impact table; here we restrict to theM -> V/M -> Asubstitutions.import aaanalysis as aa aamut = aa.AAMut() df_impact = aamut.run(from_aa="M", to_aa=["V", "A"]) aa.display_df(df_impact, n_rows=10, show_shape=True)
DataFrame shape: (1172, 7)
from_aa to_aa scale_id category subcategory delta abs_delta 1 M V ANDN920101 Structure-Activity Backbone-dynamics (-CH) -0.704000 0.704000 2 M V ARGP820101 Polarity Hydrophobicity 0.053000 0.053000 3 M V ARGP820102 Polarity Amphiphilicity (α-helix) -0.500000 0.500000 4 M V ARGP820103 ASA/Volume Buried -0.645000 0.645000 5 M V BEGF750101 Conformation α-helix -0.191000 0.191000 6 M V BEGF750102 Conformation β-sheet 0.000000 0.000000 7 M V BEGF750103 Conformation β-turn -0.450000 0.450000 8 M V BHAR880101 Structure-Activity Flexibility 0.365000 0.365000 9 M V BIGC670101 ASA/Volume Volume -0.128000 0.128000 10 M V BIOV880101 ASA/Volume Buried -0.003000 0.003000 Leaving
from_aa/to_aaunset returns all 20x19 ordered pairs;scalesrestricts to a subset of scale ids.