Browse Source

saguaro && molstar updates

bioinsilico 3 years ago
parent
commit
eedb44e05b
3 changed files with 18 additions and 7098 deletions
  1. 4 7080
      package-lock.json
  2. 3 3
      package.json
  3. 11 15
      src/RcsbFvStructure/StructurePlugins/MolstarPlugin.ts

File diff suppressed because it is too large
+ 4 - 7080
package-lock.json


+ 3 - 3
package.json

@@ -1,6 +1,6 @@
 {
   "name": "@rcsb/rcsb-saguaro-3d",
-  "version": "0.0.42",
+  "version": "0.0.44",
   "description": "RCSB Molstar/Saguaro Web App",
   "main": "build/dist/RcsbFv3DBuilder.js",
   "files": [
@@ -76,9 +76,9 @@
     "webpack-cli": "^3.3.12"
   },
   "dependencies": {
-    "@rcsb/rcsb-molstar": "file:../rcsb-molstar",
+    "@rcsb/rcsb-molstar": "^2.0.0-dev.2",
     "@rcsb/rcsb-saguaro": "^1.8.0",
-    "@rcsb/rcsb-saguaro-app": "^2.0.0-beta.4",
+    "@rcsb/rcsb-saguaro-app": "^2.0.0",
     "molstar": "^2.0.7",
     "react-select": "^3.0.8"
   },

+ 11 - 15
src/RcsbFvStructure/StructurePlugins/MolstarPlugin.ts

@@ -2,8 +2,7 @@ import {Viewer, ViewerProps} from '@rcsb/rcsb-molstar/build/src/viewer';
 import {PresetProps} from '@rcsb/rcsb-molstar/build/src/viewer/helpers/preset';
 import {
     SaguaroPluginInterface,
-    SaguaroPluginModelMapType,
-    SaguaroPluginPublicInterface
+    SaguaroPluginModelMapType
 } from "./SaguaroPluginInterface";
 
 import {PluginContext} from "molstar/lib/mol-plugin/context";
@@ -12,7 +11,6 @@ import {Mat4} from "molstar/lib/mol-math/linear-algebra";
 import {BuiltInTrajectoryFormat} from "molstar/lib/mol-plugin-state/formats/trajectory";
 import {PluginState} from "molstar/lib/mol-plugin/state";
 import {
-    ResidueIndex,
     Structure,
     StructureElement,
     StructureProperties as SP,
@@ -23,17 +21,15 @@ import {
 import {OrderedSet} from "molstar/lib/mol-data/int";
 import { PluginStateObject as PSO } from 'molstar/lib/mol-plugin-state/objects';
 import {State, StateObject} from "molstar/lib/mol-state";
-import {StructureComponentRef, StructureRef} from "molstar/lib/mol-plugin-state/manager/structure/hierarchy-state";
+import {StructureRef} from "molstar/lib/mol-plugin-state/manager/structure/hierarchy-state";
 import {RcsbFvSelection, ResidueSelectionInterface} from "../../RcsbFvSelection/RcsbFvSelection";
 import {AbstractPlugin} from "./AbstractPlugin";
 import {Subscription} from "rxjs";
-import {InteractivityManager} from "molstar/lib/mol-plugin-state/manager/interactivity";
 import {Script} from "molstar/lib/mol-script/script";
 import {MolScriptBuilder} from "molstar/lib/mol-script/language/builder";
 import {SetUtils} from "molstar/lib/mol-util/set";
 import {StructureRepresentationRegistry} from "molstar/lib/mol-repr/structure/registry";
 import {ColorTheme} from "molstar/lib/mol-theme/color";
-import {StateObjectCell} from "molstar/lib/mol-state/object";
 
 export enum LoadMethod {
     loadPdbId = "loadPdbId",
@@ -156,21 +152,21 @@ export class MolstarPlugin extends AbstractPlugin implements SaguaroPluginInterf
         if(mode == null || mode === 'select') {
             this.innerSelectionFlag = true;
         }
-        this.viewer.select({modelId:this.getModelId(modelId), label_asym_id: asymId, label_seq_range:{beg: begin, end:end}}, mode,operation);
+        this.viewer.select({modelId:this.getModelId(modelId), labelAsymId: asymId, labelSeqRange:{beg: begin, end:end}}, mode,operation);
         this.innerSelectionFlag = false;
     }
     private selectSet(selection: Array<{modelId:string; asymId: string; position: number;}>, mode: 'select'|'hover', operation:'add'|'set'): void {
         if(mode == null || mode === 'select') {
             this.innerSelectionFlag = true;
         }
-        this.viewer.select(selection.map(r=>({modelId: this.getModelId(r.modelId), label_seq_id:r.position, label_asym_id: r.asymId})), mode, operation);
+        this.viewer.select(selection.map(r=>({modelId: this.getModelId(r.modelId), labelSeqId:r.position, labelAsymId: r.asymId})), mode, operation);
         this.innerSelectionFlag = false;
     }
     private selectMultipleRanges(selection: Array<{modelId:string; asymId: string; begin: number; end:number;}>, mode: 'select'|'hover', operation:'add'|'set'): void {
         if(mode == null || mode === 'select') {
             this.innerSelectionFlag = true;
         }
-        this.viewer.select(selection.map(r=>({modelId: this.getModelId(r.modelId), label_asym_id: r.asymId, label_seq_range:{beg:r.begin, end: r.end}})), mode, operation);
+        this.viewer.select(selection.map(r=>({modelId: this.getModelId(r.modelId), labelAsymId: r.asymId, labelSeqRange:{beg:r.begin, end: r.end}})), mode, operation);
         this.innerSelectionFlag = false;
     }
 
@@ -180,14 +176,14 @@ export class MolstarPlugin extends AbstractPlugin implements SaguaroPluginInterf
             this.innerSelectionFlag = true;
         }
         if(option != null)
-            this.viewer.clearSelection(mode, {modelId: this.getModelId(option.modelId), label_asym_id: option.labelAsymId});
+            this.viewer.clearSelection(mode, {modelId: this.getModelId(option.modelId), labelAsymId: option.labelAsymId});
         else
             this.viewer.clearSelection(mode);
         this.innerSelectionFlag = false;
     }
 
     public setFocus(modelId: string, asymId: string, begin: number, end: number): void{
-        this.viewer.setFocus({modelId: this.getModelId(modelId), label_asym_id: asymId, label_seq_range:{beg:begin, end: end}});
+        this.viewer.setFocus({modelId: this.getModelId(modelId), labelAsymId: asymId, labelSeqRange:{beg:begin, end: end}});
     }
     public clearFocus(): void {
         this.viewer.clearFocus();
@@ -234,16 +230,16 @@ export class MolstarPlugin extends AbstractPlugin implements SaguaroPluginInterf
         if(args.length === 4){
             if( args[2] instanceof Array && args[2].length > 0 ) {
                 if(typeof args[2][0].position === "number"){
-                    await this.viewer.createComponent(args[0], args[2].map(r=>({modelId: this.getModelId(args[1]), label_asym_id: r.asymId, label_seq_id: r.position})), args[3]);
+                    await this.viewer.createComponent(args[0], args[2].map(r=>({modelId: this.getModelId(args[1]), labelAsymId: r.asymId, labelSeqId: r.position})), args[3]);
                 }else{
-                    await this.viewer.createComponent(args[0], args[2].map(r=>({modelId: this.getModelId(args[1]), label_asym_id: r.asymId, label_seq_range:{beg:r.begin, end: r.end}})), args[3]);
+                    await this.viewer.createComponent(args[0], args[2].map(r=>({modelId: this.getModelId(args[1]), labelAsymId: r.asymId, labelSeqRange:{beg:r.begin, end: r.end}})), args[3]);
                 }
             }else{
-                await this.viewer.createComponent(args[0], {modelId: this.getModelId(args[1]), label_asym_id:args[2]}, args[3]);
+                await this.viewer.createComponent(args[0], {modelId: this.getModelId(args[1]), labelAsymId:args[2]}, args[3]);
             }
         }
         else if(args.length === 6){
-            await this.viewer.createComponent(args[0], {modelId: this.getModelId(args[1]), label_asym_id: args[2], label_seq_range:{beg:args[3], end:args[4]}}, args[5]);
+            await this.viewer.createComponent(args[0], {modelId: this.getModelId(args[1]), labelAsymId: args[2], labelSeqRange:{beg:args[3], end:args[4]}}, args[5]);
         }
     }
 

Some files were not shown because too many files changed in this diff