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

impl is-transmembrane symbol correctly

parent 99415ef2
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@
*/
import { ParamDefinition as PD } from '../../mol-util/param-definition';
import { Structure, StructureProperties } from '../../mol-model/structure';
import { Structure, StructureProperties, Unit } from '../../mol-model/structure';
import { CustomPropertyDescriptor } from '../../mol-model/custom-property';
import { ANVILParams, ANVILProps, computeANVIL, isInMembranePlane } from './ANVIL';
import { CustomStructureProperty } from '../../mol-model-props/common/custom-structure-property';
......@@ -41,11 +41,11 @@ const pos = Vec3();
export const MembraneOrientationSymbols = {
isTransmembrane: QuerySymbolRuntime.Dynamic(CustomPropSymbol('computed', 'membrane-orientation.is-transmembrane', Type.Bool),
ctx => {
const structure = ctx.currentStructure;
const { unit, structure } = ctx.element;
const { x, y, z } = StructureProperties.atom;
if (!structure.isAtomic) return false;
if (!Unit.isAtomic(unit)) return 0;
const membraneOrientation = MembraneOrientationProvider.get(structure).value;
if (!membraneOrientation) return false;
if (!membraneOrientation) return 0;
Vec3.set(pos, x(ctx.element), y(ctx.element), z(ctx.element));
const { normalVector, planePoint1, planePoint2 } = membraneOrientation!;
return isInMembranePlane(pos, normalVector, planePoint1, planePoint2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment