Skip to content
Snippets Groups Projects
Commit b47d0465 authored by JonStargaryen's avatar JonStargaryen
Browse files

mapping still needed for #132

parent 74aa24bf
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment