|
@@ -18,6 +18,9 @@ import { Mat4 } from 'molstar/lib/mol-math/linear-algebra';
|
|
|
import { MembraneOrientationPreset } from 'molstar/lib/extensions/anvil/behavior';
|
|
|
import { Target } from '@rcsb/rcsb-molstar/build/src/viewer/helpers/selection';
|
|
|
import { TMDET_STRUCTURE_PRESET_ID } from '@rcsb/rcsb-molstar/build/src/tmdet-extension/behavior';
|
|
|
+import { TmDetDescriptorCache } from '@rcsb/rcsb-molstar/build/src/tmdet-extension/prop';
|
|
|
+import { DebugUtil } from '@rcsb/rcsb-molstar/build/src/tmdet-extension/debug-utils';
|
|
|
+import { StateTransforms } from 'molstar/lib/mol-plugin-state/transforms';
|
|
|
|
|
|
type BaseProps = {
|
|
|
assemblyId?: string
|
|
@@ -162,12 +165,38 @@ export const TmDetRcsbPreset = TrajectoryHierarchyPresetProvider({
|
|
|
} else if (p.kind === 'nakb') {
|
|
|
console.warn('nakb case not implemented in TmDetRcsbPreset');
|
|
|
} else {
|
|
|
+
|
|
|
console.log('HERE WE GO:', { structure: structure, structureProps: structureProperties, presetParams: presetParams });
|
|
|
//representation = await plugin.builders.structure.representation.applyPreset(structureProperties!, 'auto', presetParams);
|
|
|
representation = await plugin.builders.structure.representation.applyPreset(
|
|
|
structureProperties!, 'auto', { theme: { globalName: 'tmdet-custom-color-theme' } });
|
|
|
- await plugin.builders.structure.hierarchy.applyPreset(
|
|
|
+ const selector = await plugin.builders.structure.hierarchy.applyPreset(
|
|
|
trajectory, 'default', { representationPreset: TMDET_STRUCTURE_PRESET_ID as any });
|
|
|
+
|
|
|
+ // Transformation:
|
|
|
+ // const pdbtmDescriptor = TmDetDescriptorCache.get('1afo'); // TODO
|
|
|
+ // let matrix = undefined;
|
|
|
+ // if (pdbtmDescriptor) {
|
|
|
+ // matrix = DebugUtil.descriptorMxToMat4(pdbtmDescriptor!.additional_entry_annotations.membrane.transformation_matrix as any);
|
|
|
+ // }
|
|
|
+
|
|
|
+ // if (matrix && selector?.structureProperties) {
|
|
|
+ // const params = {
|
|
|
+ // transform: {
|
|
|
+ // name: 'matrix' as const,
|
|
|
+ // params: { data: matrix, transpose: false }
|
|
|
+ // }
|
|
|
+ // };
|
|
|
+ // setTimeout(async () => {
|
|
|
+ // console.log(this.plugin);
|
|
|
+ // // const b = this.plugin.state.data.build().to(selector.structureProperties)
|
|
|
+ // // .insert(StateTransforms.Model.TransformStructureConformation, params);
|
|
|
+ // // await this.plugin.runTask(this.plugin.state.data.updateTree(b));
|
|
|
+ // },
|
|
|
+ // 2000
|
|
|
+ // );
|
|
|
+ // }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
console.log('STRUCTURE REPRESENTATION:', representation);
|