|
@@ -24,6 +24,9 @@ import { StateTransforms } from 'molstar/lib/mol-plugin-state/transforms';
|
|
|
import { TmDetDescriptorCache } from '../TmFv3DApp/tmdet-extension/prop';
|
|
|
import { registerTmDetSymmetry } from '../TmFv3DApp/tmdet-extension/symmetry';
|
|
|
import { PresetProps } from '@rcsb/rcsb-molstar/build/src/viewer/helpers/preset';
|
|
|
+import { createStructureRepresentationParams } from 'molstar/lib/mol-plugin-state/helpers/structure-representation-params';
|
|
|
+import { ColorNames } from 'molstar/lib/mol-util/color/names';
|
|
|
+import { Script } from 'molstar/lib/mol-script/script';
|
|
|
|
|
|
const RcsbParams = () => ({
|
|
|
preset: PD.Value<PresetProps>({ kind: 'standard', assemblyId: '' }, { isHidden: true })
|
|
@@ -62,6 +65,20 @@ export const TmDetRcsbPreset = TrajectoryHierarchyPresetProvider({
|
|
|
const structureProperties = await builder.insertStructureProperties(structure);
|
|
|
const representation = await plugin.builders.structure.representation.applyPreset<any>(structureProperties, MembraneOrientationPreset, {});
|
|
|
|
|
|
+ const script = `(sel.atom.atom-groups :chain-test (= TM_ atom.label_asym_id))`;
|
|
|
+ const update = plugin.build().to(structure)
|
|
|
+ .apply(StateTransforms.Model.StructureSelectionFromScript, {
|
|
|
+ script: Script(script, 'mol-script'), label: 'TMDET MEMBRANE'
|
|
|
+ })
|
|
|
+ .apply(StateTransforms.Representation.StructureRepresentation3D, createStructureRepresentationParams(plugin, structure.data, {
|
|
|
+ type: 'ball-and-stick',
|
|
|
+ color: 'uniform', colorParams: { value: ColorNames.white },
|
|
|
+ size: 'uniform', sizeParams: { value: 10 }
|
|
|
+ }));
|
|
|
+ await update.commit();
|
|
|
+
|
|
|
+ // 'export' plugin
|
|
|
+ // WARNING: this refers only to the latest viewer plugin; it is useful during in some init process.
|
|
|
(window as any).plugin = plugin;
|
|
|
|
|
|
const result = {
|