diff --git a/src/mol-model-props/computed/accessible-surface-area/shrake-rupley.ts b/src/mol-model-props/computed/accessible-surface-area/shrake-rupley.ts index 8ed538ea805ae620c276d50f678b2f7485a98c4f..8dd046a34cde98336b0c600886b95d6ee279639e 100644 --- a/src/mol-model-props/computed/accessible-surface-area/shrake-rupley.ts +++ b/src/mol-model-props/computed/accessible-surface-area/shrake-rupley.ts @@ -102,11 +102,18 @@ namespace AccessibleSurfaceArea { export function getValue(location: StructureElement.Location, accessibleSurfaceArea: AccessibleSurfaceArea) { const { area, serialResidueIndex } = accessibleSurfaceArea; - const rSI = serialResidueIndex[location.element]; + const rSI = serialResidueIndex[indexOf(location.structure.root.serialMapping.elementIndices, location.element)]; if (rSI === -1) return -1; return area[rSI]; } + function indexOf<T>(a: ArrayLike<T>, e: T): number { + for (let i = 0, il = a.length; i < il; i++) { + if (a[i] === e) return i; + } + return -1; + } + export function getNormalizedValue(location: StructureElement.Location, accessibleSurfaceArea: AccessibleSurfaceArea) { const value = getValue(location, accessibleSurfaceArea); return value === -1 ? -1 : normalize(StructureProperties.atom.label_comp_id(location), value);