diff --git a/src/mol-model/structure/model/properties/utils/accessible-surface-area.ts b/src/mol-model/structure/model/properties/utils/accessible-surface-area.ts index 5291218dbc2d7f4a7812c946b56c9d7bb84152e6..2ee085fabac386d70113f9ec4ead53a76f7c1011 100644 --- a/src/mol-model/structure/model/properties/utils/accessible-surface-area.ts +++ b/src/mol-model/structure/model/properties/utils/accessible-surface-area.ts @@ -1,6 +1,7 @@ import { Vec3 } from 'mol-math/linear-algebra'; import { AtomicHierarchy, AtomicConformation } from '../atomic'; -import { ElementSymbol, VdwRadii } from '../../types'; +import { ElementSymbol, VdwRadii, MaxAsa, DefaultMaxAsa } from '../../types'; +import { max } from 'mol-data/int/impl/ordered-set'; const defaultNumberOfPoints = 960; const defaultProbeSize = 1.4; @@ -132,7 +133,18 @@ function calculateASA(ctx: ASAContext) { residueAsa[residueAtomSegments.index[i]] += value; } - // TODO (optionally) normalize by maximum value expected for a particular amino acid - needs lookup of max values + console.log(residueAsa); + + // normalize by maximum value expected for a particular amino acid - needs lookup of max values + for (let i = 0; i < residues.label_comp_id.rowCount; ++i) { + // skip entities not part of a peptide chain + if (derived.residue.moleculeType[i] !== 4) + continue; + + const maxAsa = (MaxAsa as any)[residues.label_comp_id.value(i)]; + residueAsa[i] /= (maxAsa === undefined ? DefaultMaxAsa : maxAsa); + } + console.log(residueAsa); } diff --git a/src/mol-model/structure/model/types.ts b/src/mol-model/structure/model/types.ts index 89293da9605b464d3eec6efe7ec3f9d136258b0e..1361395d7064bf4607f18930dfbdb7e8b193dcdc 100644 --- a/src/mol-model/structure/model/types.ts +++ b/src/mol-model/structure/model/types.ts @@ -390,6 +390,31 @@ export namespace SecondaryStructureType { } } +/** Maximum accessible surface area observed for amino acids. Taken from: http://dx.doi.org/10.1371/journal.pone.0080635 */ +export const MaxAsa = { + 'ALA': 121.0, + 'ARG': 265.0, + 'ASN': 187.0, + 'ASP': 187.0, + 'CYS': 148.0, + 'GLU': 214.0, + 'GLN': 214.0, + 'GLY': 97.0, + 'HIS': 216.0, + 'ILE': 195.0, + 'LEU': 191.0, + 'LYS': 230.0, + 'MET': 203.0, + 'PHE': 228.0, + 'PRO': 154.0, + 'SER': 143.0, + 'THR': 163.0, + 'TRP': 264.0, + 'TYR': 255.0, + 'VAL': 165.0 +} +export const DefaultMaxAsa = 121.0 + export const VdwRadii = { 'H': 1.1, 'HE': 1.4,