Browse Source

tmp vis of asa

JonStargaryen 5 years ago
parent
commit
5e6eb7ed49
2 changed files with 13 additions and 1 deletions
  1. 2 0
      src/mol-theme/color.ts
  2. 11 1
      src/tests/browser/render-structure.ts

+ 2 - 0
src/mol-theme/color.ts

@@ -32,6 +32,7 @@ import { ModelIndexColorThemeProvider } from './color/model-index';
 import { OccupancyColorThemeProvider } from './color/occupancy';
 import { OperatorNameColorThemeProvider } from './color/operator-name';
 import { OperatorHklColorThemeProvider } from './color/operator-hkl';
+import { AccessibleSurfaceAreaColorThemeProvider } from '../mol-model-props/computed/themes/accessible-surface-area';
 
 export type LocationColor = (location: Location, isSecondary: boolean) => Color
 
@@ -100,6 +101,7 @@ namespace ColorTheme {
         'uncertainty': UncertaintyColorThemeProvider,
         'unit-index': UnitIndexColorThemeProvider,
         'uniform': UniformColorThemeProvider,
+        'accessible-surface-area': AccessibleSurfaceAreaColorThemeProvider,
     };
     type _BuiltIn = typeof BuiltIn
     export type BuiltIn = keyof _BuiltIn

+ 11 - 1
src/tests/browser/render-structure.ts

@@ -26,6 +26,7 @@ import { InteractionsProvider } from '../../mol-model-props/computed/interaction
 import { SecondaryStructureProvider } from '../../mol-model-props/computed/secondary-structure';
 import { SyncRuntimeContext } from '../../mol-task/execution/synchronous';
 import { AssetManager } from '../../mol-util/assets';
+import { AccessibleSurfaceAreaProvider } from '../../mol-model-props/computed/accessible-surface-area';
 
 const parent = document.getElementById('app')!;
 parent.style.width = '100%';
@@ -127,6 +128,14 @@ 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 Topology');
+    await TopologyProvider.attach(ctx, structure);
+    console.timeEnd('compute Topology');
+
     console.time('compute Interactions');
     await InteractionsProvider.attach(ctx, structure);
     console.timeEnd('compute Interactions');
@@ -148,7 +157,8 @@ async function init() {
 
     if (show.cartoon) {
         cartoonRepr.setTheme({
-            color: reprCtx.colorThemeRegistry.create('element-symbol', { structure }),
+            // TODO remove from mol-theme/color.ts again
+            color: reprCtx.colorThemeRegistry.create('accessible-surface-area', { structure }),
             size: reprCtx.sizeThemeRegistry.create('uniform', { structure })
         });
         await cartoonRepr.createOrUpdate({ ...CartoonRepresentationProvider.defaultValues, quality: 'auto' }, structure).run();