Quellcode durchsuchen

Issue #805: register symmetry moved into preset2

cycle20 vor 1 Jahr
Ursprung
Commit
f32d9beb31

+ 5 - 1
src/examples/assembly-tm/preset2.ts

@@ -17,6 +17,7 @@ import { MembraneOrientationPreset } from './tmdet-extension/behavior';
 import { StateTransforms } from 'molstar/lib/mol-plugin-state/transforms';
 import { applyTransformations } from './tmdet-extension/transformation';
 import { TmDetDescriptorCache } from './tmdet-extension/prop';
+import { registerTmDetSymmetry } from './tmdet-extension/symmetry';
 
 type BaseProps = {
     assemblyId?: string
@@ -101,6 +102,10 @@ export const TmDetRcsbPreset = TrajectoryHierarchyPresetProvider({
     params: RcsbParams,
     async apply(trajectory: StateObjectRef<PluginStateObject.Molecule.Trajectory>, params, plugin) {
         console.log('TMDET RCSB PRESET: apply start', params);
+        const entryId = (trajectory as any).obj?.data.representative.entryId;
+        console.log('TRAJECTORY entry ID:', entryId);
+        const descriptor = TmDetDescriptorCache.get(entryId);
+        registerTmDetSymmetry(descriptor!);
 
         const modelParams = { modelIndex: 0 };
 
@@ -129,7 +134,6 @@ export const TmDetRcsbPreset = TrajectoryHierarchyPresetProvider({
         const structureProperties = await builder.insertStructureProperties(structure);
         const representation = await plugin.builders.structure.representation.applyPreset<any>(structureProperties, MembraneOrientationPreset, {});
 
-        const descriptor = TmDetDescriptorCache.get(structure.data.model.entryId);
         applyTransformations(plugin, descriptor!);
 
         (window as any).plugin = plugin;

+ 0 - 2
src/examples/assembly-tm/tmdet-extension/transformation.ts

@@ -138,8 +138,6 @@ export function createMembraneOrientation(pdbtmDescriptor: PDBTMDescriptor): Mem
         planePoint2: vneg(membraneNormal),
         centroid: Vec3.zero(),
         normalVector: membraneNormal,
-
-        // (NOTE: the TMDET extension calculates and sets it during applying preset)
         radius: membrane.radius
     };
 

+ 0 - 2
src/examples/assembly-tm/tmdet-viewer/TmViewer.ts

@@ -39,8 +39,6 @@ export class TmViewer extends Viewer {
     }
 
     public async initBehavior() {
-        registerTmDetSymmetry(TmDetDescriptorCache.get('1afo')!);
-
         let tree = this.plugin.state.behaviors.build();