Pārlūkot izejas kodu

add membrane preset

JonStargaryen 4 gadi atpakaļ
vecāks
revīzija
ee12501f83
2 mainītis faili ar 20 papildinājumiem un 2 dzēšanām
  1. 12 1
      src/viewer/helpers/preset.ts
  2. 8 1
      src/viewer/index.html

+ 12 - 1
src/viewer/helpers/preset.ts

@@ -27,6 +27,8 @@ import { StructureRepresentationRegistry } from 'molstar/lib/mol-repr/structure/
 import { StructureSelectionQueries as Q } from 'molstar/lib/mol-plugin-state/helpers/structure-selection-query';
 import { PluginCommands } from 'molstar/lib/mol-plugin/commands';
 import { InteractivityManager } from 'molstar/lib/mol-plugin-state/manager/interactivity';
+import { EnableMembraneOrientation } from '../ui/membrane';
+import { MembraneOrientationProvider } from 'molstar/lib/extensions/anvil/prop';
 
 type Target = {
     readonly auth_seq_id?: number
@@ -121,7 +123,11 @@ type DensityProps = {
     kind: 'density'
 } & BaseProps
 
-export type PresetProps = ValidationProps | StandardProps | SymmetryProps | FeatureProps | DensityProps | PropsetProps
+type MembraneProps = {
+    kind: 'membrane',
+} & BaseProps
+
+export type PresetProps = ValidationProps | StandardProps | SymmetryProps | FeatureProps | DensityProps | PropsetProps | MembraneProps
 
 const RcsbParams = (a: PluginStateObject.Molecule.Trajectory | undefined, plugin: PluginContext) => ({
     preset: PD.Value<PresetProps>({ kind: 'standard', assemblyId: '' }, { isHidden: true })
@@ -333,6 +339,11 @@ export const RcsbPreset = TrajectoryHierarchyPresetProvider({
             });
         }
 
+        if (p.kind === 'membrane' && structure?.obj) {
+            const params = MembraneOrientationProvider.defaultParams;
+            await plugin.runTask(plugin.state.data.applyAction(EnableMembraneOrientation, params, structure.ref));
+        }
+
         return {
             model,
             modelProperties,

+ 8 - 1
src/viewer/index.html

@@ -286,9 +286,16 @@
                         }
                     }
                 },
+                {
+                    id: '1BRR',
+                    info: 'membrane: X-RAY STRUCTURE OF THE BACTERIORHODOPSIN TRIMER/LIPID COMPLEX'
+                },
                 {
                     id: '3SN6',
-                    info: 'membrane: Crystal structure of the beta2 adrenergic receptor-Gs protein complex'
+                    info: 'membrane: Crystal structure of the beta2 adrenergic receptor-Gs protein complex with ANVIL membrane prediction',
+                    props: {
+                        kind: 'membrane'
+                    }
                 }
             ];