Quellcode durchsuchen

Issue #805: almost good rotation around x-axis

cycle20 vor 1 Jahr
Ursprung
Commit
4665c8f503
2 geänderte Dateien mit 17 neuen und 3 gelöschten Zeilen
  1. 3 2
      src/examples/assembly-tm/FeatureViewConfig.ts
  2. 14 1
      src/examples/assembly-tm/index.ts

+ 3 - 2
src/examples/assembly-tm/FeatureViewConfig.ts

@@ -26,7 +26,7 @@ import {
 import {ViewerProps} from "@rcsb/rcsb-molstar/build/src/viewer";
 import { updateSiteColors } from "./UniTmpColor";
 import { fetchHtpDescriptor, fetchPdbtmJsvLibDescriptor, htpDescriptorToTrackData, jsvLibDescriptorToTrackData } from "./UniTmpHelper";
-import { TmDetRcsbPreset } from "./preset";
+import { TmDetRcsbPreset } from "./preset2";
 
 export async function createFeatureViewerConfing(params: { pdbEntry: string, pdbtmEntry: string, htpEntry: string, labelAsymId: string, side1: string }) {
     const modelId = `${params.pdbEntry}_model`;
@@ -130,6 +130,7 @@ export async function createFeatureViewerConfing(params: { pdbEntry: string, pdb
             loadParams: {
                 //url: `https://pdbtm.unitmp.org/api/v1/entry/${params.pdbEntry}.trpdb`,
                 url: `https://www.ebi.ac.uk/pdbe/entry-files/download/${params.pdbEntry}_updated.cif`,
+                //url: `/${params.pdbEntry}.cif`,
                 format: 'mmcif',
                 isBinary: false,
                 id: `${params.pdbEntry}_model`,
@@ -139,7 +140,7 @@ export async function createFeatureViewerConfing(params: { pdbEntry: string, pdb
         structureViewerConfig: {
             viewerProps:{
                 showImportControls: true,
-                showSessionControls: false,
+                showSessionControls: false
             }
         }
     };

+ 14 - 1
src/examples/assembly-tm/index.ts

@@ -4,6 +4,9 @@ import { createFeatureViewerConfing } from "./FeatureViewConfig";
 import { registerRegionDescriptorData } from "./UniTmpHelper";
 import { TmDetDescriptorCache } from "./tmdet-extension/prop";
 import { applyTransformations } from "./tmdet-extension/transformation";
+import { PluginContext } from "molstar/lib/mol-plugin/context";
+import { StateTransforms } from "molstar/lib/mol-plugin-state/transforms";
+import { Vec3 } from "molstar/lib/mol-math/linear-algebra";
 
 export { DebugUtil };
 
@@ -42,7 +45,17 @@ document.addEventListener("DOMContentLoaded", (event) => {
 
         setTimeout(() => {
                 const descriptor = TmDetDescriptorCache.get('1afo');
-                applyTransformations((window as any).plugin as any, descriptor!);
+                const plugin = (window as any).plugin as PluginContext;
+                applyTransformations(plugin, descriptor!);
+                plugin.state.data.build().to('assembly')
+                    .apply(StateTransforms.Model.TransformStructureConformation, {
+                            transform: {
+                                name: 'components',
+                                params: { axis: Vec3.unitY, angle: 90, translation: Vec3.zero() }
+                            }
+                        })
+                    .commit();
+
             },
             2000
         );