Jelajahi Sumber

move ASA request

JonStargaryen 4 tahun lalu
induk
melakukan
10bd7853f3

+ 3 - 0
src/mol-model-props/computed/membrane.ts

@@ -11,6 +11,8 @@ import { CustomStructureProperty } from '../common/custom-structure-property';
 import { CustomProperty } from '../common/custom-property';
 import { CustomPropertyDescriptor } from '../../mol-model/custom-property';
 import { ANVILParams, Membrane } from './membrane/ANVIL';
+import { strict } from 'assert';
+import { AccessibleSurfaceAreaProvider } from './accessible-surface-area';
 
 export const MembraneParams = {
     ...ANVILParams
@@ -31,6 +33,7 @@ export const MembraneProvider: CustomStructureProperty.Provider<MembraneParams,
     // TODO needs ASA to be computed (or 'resolved' before trying computing topology) - how to achieve?
     // TODO potentially, this could behave like secondary structure info where data can be either parsed or computed
     obtain: async (ctx: CustomProperty.Context, data: Structure, props: Partial<MembraneProps>) => {
+        await AccessibleSurfaceAreaProvider.attach(ctx, data);
         const p = { ...PD.getDefaultValues(MembraneParams), ...props };
         return { value: await Membrane.compute(data, p).runInContext(ctx.runtime) };
     }

+ 0 - 4
src/tests/browser/render-structure.ts

@@ -150,10 +150,6 @@ async function init() {
     await SecondaryStructureProvider.attach(ctx, structure);
     console.timeEnd('compute SecondaryStructure');
 
-    console.time('compute AccessibleSurfaceArea');
-    await AccessibleSurfaceAreaProvider.attach(ctx, structure);
-    console.timeEnd('compute AccessibleSurfaceArea');
-
     console.time('compute Membrane');
     await MembraneProvider.attach(ctx, structure);
     console.timeEnd('compute Membrane');