|
@@ -27,6 +27,7 @@ import { PluginUIContext } from '../../mol-plugin-ui/context';
|
|
import { StateObjectSelector } from "../../mol-state/object";
|
|
import { StateObjectSelector } from "../../mol-state/object";
|
|
import { applyTransformations, createMembraneOrientation, getAtomGroupExpression } from './transformation';
|
|
import { applyTransformations, createMembraneOrientation, getAtomGroupExpression } from './transformation';
|
|
import { PDBTMDescriptor, PDBTMRegion, PMS } from './types';
|
|
import { PDBTMDescriptor, PDBTMRegion, PMS } from './types';
|
|
|
|
+import { registerTmDetSymmetry } from './symmetry';
|
|
|
|
|
|
type StructureComponentType = StateObjectSelector<
|
|
type StructureComponentType = StateObjectSelector<
|
|
PMS,
|
|
PMS,
|
|
@@ -111,11 +112,9 @@ export const isTransmembrane = StructureSelectionQuery('Residues Embedded in Mem
|
|
// //////////////////////////// TMDET VIEWER FUNCTIONS
|
|
// //////////////////////////// TMDET VIEWER FUNCTIONS
|
|
|
|
|
|
export let membraneOrientation: MembraneOrientation;
|
|
export let membraneOrientation: MembraneOrientation;
|
|
-export let pdbtmDescriptor: PDBTMDescriptor;
|
|
|
|
|
|
|
|
export async function loadWithUNITMPMembraneRepresentation(plugin: PluginUIContext, params: any) {
|
|
export async function loadWithUNITMPMembraneRepresentation(plugin: PluginUIContext, params: any) {
|
|
- // const pdbtmDescriptor: any = await downloadRegionDescriptor(plugin, params);
|
|
|
|
- pdbtmDescriptor = await downloadRegionDescriptor(plugin, params);
|
|
|
|
|
|
+ const pdbtmDescriptor = await downloadRegionDescriptor(plugin, params);
|
|
|
|
|
|
membraneOrientation = createMembraneOrientation(pdbtmDescriptor);
|
|
membraneOrientation = createMembraneOrientation(pdbtmDescriptor);
|
|
|
|
|
|
@@ -130,6 +129,13 @@ export async function loadWithUNITMPMembraneRepresentation(plugin: PluginUIConte
|
|
requestAnimationFrame(() => plugin.canvas3d?.requestCameraReset());
|
|
requestAnimationFrame(() => plugin.canvas3d?.requestCameraReset());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+async function downloadRegionDescriptor(plugin: PluginUIContext, params: any): Promise<any> {
|
|
|
|
+ // run a fetch task
|
|
|
|
+ const downloadResult: string = await plugin.runTask(plugin.fetch({ url: params.regionDescriptorUrl })) as string;
|
|
|
|
+ const pdbtmDescriptor: any = JSON.parse(downloadResult);
|
|
|
|
+ return pdbtmDescriptor;
|
|
|
|
+}
|
|
|
|
+
|
|
async function createStructureRepresentation(plugin: PluginUIContext, pdbtmDescriptor: any) {
|
|
async function createStructureRepresentation(plugin: PluginUIContext, pdbtmDescriptor: any) {
|
|
// get the first structure of the first model
|
|
// get the first structure of the first model
|
|
const structure: StateObjectRef<PMS> = plugin.managers.structure.hierarchy.current.models[0].structures[0].cell;
|
|
const structure: StateObjectRef<PMS> = plugin.managers.structure.hierarchy.current.models[0].structures[0].cell;
|
|
@@ -212,6 +218,10 @@ async function buildStructureRepresentation(plugin: PluginUIContext, components:
|
|
}
|
|
}
|
|
|
|
|
|
async function loadStructure(ctx: PluginUIContext, params: any, pdbtmDescriptor: PDBTMDescriptor): Promise<void> {
|
|
async function loadStructure(ctx: PluginUIContext, params: any, pdbtmDescriptor: PDBTMDescriptor): Promise<void> {
|
|
|
|
+
|
|
|
|
+ // replace original symmetry format function
|
|
|
|
+ registerTmDetSymmetry(pdbtmDescriptor);
|
|
|
|
+
|
|
const builders = ctx.builders;
|
|
const builders = ctx.builders;
|
|
const data = await builders.data.download({
|
|
const data = await builders.data.download({
|
|
url: params.structureUrl,
|
|
url: params.structureUrl,
|
|
@@ -233,13 +243,6 @@ async function loadStructure(ctx: PluginUIContext, params: any, pdbtmDescriptor:
|
|
trajectory, 'default', { representationPreset: 'preset-membrane-orientation' as any });
|
|
trajectory, 'default', { representationPreset: 'preset-membrane-orientation' as any });
|
|
}
|
|
}
|
|
|
|
|
|
-async function downloadRegionDescriptor(plugin: PluginUIContext, params: any): Promise<any> {
|
|
|
|
- // run a fetch task
|
|
|
|
- const downloadResult: string = await plugin.runTask(plugin.fetch({ url: params.regionDescriptorUrl })) as string;
|
|
|
|
- const pdbtmDescriptor: any = JSON.parse(downloadResult);
|
|
|
|
- return pdbtmDescriptor;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
// //////////////////////////// END OF TMDET VIEWER SECTION
|
|
// //////////////////////////// END OF TMDET VIEWER SECTION
|
|
|
|
|
|
//
|
|
//
|