molstar
Version:
A comprehensive macromolecular library.
247 lines (246 loc) • 23.8 kB
TypeScript
/**
* Copyright (c) 2019-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { PresetProvider } from '../preset-provider';
import { PluginStateObject } from '../../objects';
import { ParamDefinition as PD } from '../../../mol-util/param-definition';
import { ColorTheme } from '../../../mol-theme/color';
import { Structure } from '../../../mol-model/structure';
import { PluginContext } from '../../../mol-plugin/context';
import { StateObjectRef, StateObjectSelector } from '../../../mol-state';
import { StaticStructureComponentType } from '../../helpers/structure-component';
import { StructureSelectionQueries as Q } from '../../helpers/structure-selection-query';
export interface StructureRepresentationPresetProvider<P = any, S extends _Result = _Result> extends PresetProvider<PluginStateObject.Molecule.Structure, P, S> {
}
export declare function StructureRepresentationPresetProvider<P, S extends _Result>(repr: StructureRepresentationPresetProvider<P, S>): StructureRepresentationPresetProvider<P, S>;
export declare namespace StructureRepresentationPresetProvider {
type Params<P extends StructureRepresentationPresetProvider> = P extends StructureRepresentationPresetProvider<infer T> ? T : never;
type State<P extends StructureRepresentationPresetProvider> = P extends StructureRepresentationPresetProvider<infer _, infer S> ? S : never;
type Result = {
components?: {
[name: string]: StateObjectSelector | undefined;
};
representations?: {
[name: string]: StateObjectSelector | undefined;
};
};
const CommonParams: {
ignoreHydrogens: PD.Base<boolean | undefined>;
quality: PD.Base<"custom" | "auto" | "highest" | "higher" | "high" | "medium" | "low" | "lower" | "lowest" | undefined>;
theme: PD.Base<PD.Normalize<{
globalName: "occupancy" | "uniform" | "atom-id" | "carbohydrate-symbol" | "chain-id" | "element-index" | "operator-name" | "element-symbol" | "entity-id" | "entity-source" | "hydrophobicity" | "illustrative" | "model-index" | "molecule-type" | "operator-hkl" | "partial-charge" | "polymer-id" | "polymer-index" | "residue-name" | "secondary-structure" | "sequence-id" | "shape-group" | "uncertainty" | "unit-index" | undefined;
carbonColor: "chain-id" | "operator-name" | "element-symbol" | undefined;
symmetryColor: "occupancy" | "uniform" | "atom-id" | "carbohydrate-symbol" | "chain-id" | "element-index" | "operator-name" | "element-symbol" | "entity-id" | "entity-source" | "hydrophobicity" | "illustrative" | "model-index" | "molecule-type" | "operator-hkl" | "partial-charge" | "polymer-id" | "polymer-index" | "residue-name" | "secondary-structure" | "sequence-id" | "shape-group" | "uncertainty" | "unit-index" | undefined;
focus: PD.Normalize<{
name: any;
params: any;
}> | undefined;
}> | undefined>;
};
type CommonParams = PD.ValuesFor<typeof CommonParams>;
function reprBuilder(plugin: PluginContext, params: CommonParams, structure?: Structure): {
update: import("../../../mol-state/state/builder").StateBuilder.Root;
builder: import("./representation").StructureRepresentationBuilder;
color: "occupancy" | "uniform" | "atom-id" | "carbohydrate-symbol" | "chain-id" | "element-index" | "operator-name" | "element-symbol" | "entity-id" | "entity-source" | "hydrophobicity" | "illustrative" | "model-index" | "molecule-type" | "operator-hkl" | "partial-charge" | "polymer-id" | "polymer-index" | "residue-name" | "secondary-structure" | "sequence-id" | "shape-group" | "uncertainty" | "unit-index" | undefined;
symmetryColor: "occupancy" | "uniform" | "atom-id" | "carbohydrate-symbol" | "chain-id" | "element-index" | "operator-name" | "element-symbol" | "entity-id" | "entity-source" | "hydrophobicity" | "illustrative" | "model-index" | "molecule-type" | "operator-hkl" | "partial-charge" | "polymer-id" | "polymer-index" | "residue-name" | "secondary-structure" | "sequence-id" | "shape-group" | "uncertainty" | "unit-index" | undefined;
typeParams: {
quality: "custom" | "auto" | "highest" | "higher" | "high" | "medium" | "low" | "lower" | "lowest";
ignoreHydrogens: boolean;
};
ballAndStickColor: Partial<PD.Values<{
carbonColor: PD.Mapped<PD.NamedParams<PD.Normalize<{
palette: PD.NamedParams<PD.Normalize<{
maxCount: any;
hue: any;
chroma: any;
luminance: any;
clusteringStepCount: any;
minSampleCount: any;
}>, "generate"> | PD.NamedParams<PD.Normalize<{
list: any;
}>, "colors">;
asymId: "label" | "auth";
}>, "chain-id"> | PD.NamedParams<PD.Normalize<{
palette: PD.NamedParams<PD.Normalize<{
maxCount: any;
hue: any;
chroma: any;
luminance: any;
clusteringStepCount: any;
minSampleCount: any;
}>, "generate"> | PD.NamedParams<PD.Normalize<{
list: any;
}>, "colors">;
}>, "operator-name"> | PD.NamedParams<PD.Normalize<unknown>, "element-symbol">>;
saturation: PD.Numeric;
lightness: PD.Numeric;
}>>;
};
function updateFocusRepr<T extends ColorTheme.BuiltIn>(plugin: PluginContext, structure: Structure, themeName: T | undefined, themeParams: ColorTheme.BuiltInParams<T> | undefined): Promise<void>;
}
declare type _Result = StructureRepresentationPresetProvider.Result;
export declare function presetStaticComponent(plugin: PluginContext, structure: StateObjectRef<PluginStateObject.Molecule.Structure>, type: StaticStructureComponentType, params?: {
label?: string;
tags?: string[];
}): Promise<StateObjectSelector<PluginStateObject.Molecule.Structure, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>> | undefined>;
export declare function presetSelectionComponent(plugin: PluginContext, structure: StateObjectRef<PluginStateObject.Molecule.Structure>, query: keyof typeof Q, params?: {
label?: string;
tags?: string[];
}): Promise<StateObjectSelector<PluginStateObject.Molecule.Structure, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>> | undefined>;
export declare const PresetStructureRepresentations: {
empty: StructureRepresentationPresetProvider<unknown, {}>;
auto: StructureRepresentationPresetProvider<{
ignoreHydrogens: boolean | undefined;
quality: "custom" | "auto" | "highest" | "higher" | "high" | "medium" | "low" | "lower" | "lowest" | undefined;
theme: PD.Normalize<{
globalName: any;
carbonColor: any;
symmetryColor: any;
focus: any;
}> | undefined;
}, {
components?: undefined;
representations?: undefined;
} | {
components: {
polymer: StateObjectSelector<PluginStateObject.Molecule.Structure, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>> | undefined;
};
representations: {
polymer: StateObjectSelector<PluginStateObject.Molecule.Structure.Representation3D, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>>;
};
} | {
components: {
all: StateObjectSelector<PluginStateObject.Molecule.Structure, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>> | undefined;
branched: undefined;
};
representations: {
all: StateObjectSelector<PluginStateObject.Molecule.Structure.Representation3D, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>>;
};
}>;
'atomic-detail': StructureRepresentationPresetProvider<{
showCarbohydrateSymbol: boolean;
ignoreHydrogens: boolean | undefined;
quality: "custom" | "auto" | "highest" | "higher" | "high" | "medium" | "low" | "lower" | "lowest" | undefined;
theme: PD.Normalize<{
globalName: any;
carbonColor: any;
symmetryColor: any;
focus: any;
}> | undefined;
}, {
components?: undefined;
representations?: undefined;
} | {
components: {
all: StateObjectSelector<PluginStateObject.Molecule.Structure, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>> | undefined;
branched: undefined;
};
representations: {
all: StateObjectSelector<PluginStateObject.Molecule.Structure.Representation3D, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>>;
};
}>;
'polymer-cartoon': StructureRepresentationPresetProvider<{
ignoreHydrogens: boolean | undefined;
quality: "custom" | "auto" | "highest" | "higher" | "high" | "medium" | "low" | "lower" | "lowest" | undefined;
theme: PD.Normalize<{
globalName: any;
carbonColor: any;
symmetryColor: any;
focus: any;
}> | undefined;
}, {
components?: undefined;
representations?: undefined;
} | {
components: {
polymer: StateObjectSelector<PluginStateObject.Molecule.Structure, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>> | undefined;
};
representations: {
polymer: StateObjectSelector<PluginStateObject.Molecule.Structure.Representation3D, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>>;
};
}>;
'polymer-and-ligand': StructureRepresentationPresetProvider<{
ignoreHydrogens: boolean | undefined;
quality: "custom" | "auto" | "highest" | "higher" | "high" | "medium" | "low" | "lower" | "lowest" | undefined;
theme: PD.Normalize<{
globalName: any;
carbonColor: any;
symmetryColor: any;
focus: any;
}> | undefined;
}, {
components?: undefined;
representations?: undefined;
} | {
components: {
polymer: StateObjectSelector<PluginStateObject.Molecule.Structure, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>> | undefined;
ligand: StateObjectSelector<PluginStateObject.Molecule.Structure, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>> | undefined;
nonStandard: StateObjectSelector<PluginStateObject.Molecule.Structure, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>> | undefined;
branched: StateObjectSelector<PluginStateObject.Molecule.Structure, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>> | undefined;
water: StateObjectSelector<PluginStateObject.Molecule.Structure, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>> | undefined;
ion: StateObjectSelector<PluginStateObject.Molecule.Structure, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>> | undefined;
lipid: StateObjectSelector<PluginStateObject.Molecule.Structure, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>> | undefined;
coarse: StateObjectSelector<PluginStateObject.Molecule.Structure, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>> | undefined;
};
representations: {
polymer: StateObjectSelector<PluginStateObject.Molecule.Structure.Representation3D, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>>;
ligand: StateObjectSelector<PluginStateObject.Molecule.Structure.Representation3D, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>>;
nonStandard: StateObjectSelector<PluginStateObject.Molecule.Structure.Representation3D, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>>;
branchedBallAndStick: StateObjectSelector<PluginStateObject.Molecule.Structure.Representation3D, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>>;
branchedSnfg3d: StateObjectSelector<PluginStateObject.Molecule.Structure.Representation3D, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>>;
water: StateObjectSelector<PluginStateObject.Molecule.Structure.Representation3D, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>>;
ion: StateObjectSelector<PluginStateObject.Molecule.Structure.Representation3D, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>>;
lipid: StateObjectSelector<PluginStateObject.Molecule.Structure.Representation3D, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>>;
coarse: StateObjectSelector<PluginStateObject.Molecule.Structure.Representation3D, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>>;
};
}>;
'protein-and-nucleic': StructureRepresentationPresetProvider<{
ignoreHydrogens: boolean | undefined;
quality: "custom" | "auto" | "highest" | "higher" | "high" | "medium" | "low" | "lower" | "lowest" | undefined;
theme: PD.Normalize<{
globalName: any;
carbonColor: any;
symmetryColor: any;
focus: any;
}> | undefined;
}, {
components?: undefined;
representations?: undefined;
} | {
components: {
protein: StateObjectSelector<PluginStateObject.Molecule.Structure, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>> | undefined;
nucleic: StateObjectSelector<PluginStateObject.Molecule.Structure, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>> | undefined;
};
representations: {
protein: StateObjectSelector<PluginStateObject.Molecule.Structure.Representation3D, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>>;
nucleic: StateObjectSelector<PluginStateObject.Molecule.Structure.Representation3D, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>>;
};
}>;
'coarse-surface': StructureRepresentationPresetProvider<{
ignoreHydrogens: boolean | undefined;
quality: "custom" | "auto" | "highest" | "higher" | "high" | "medium" | "low" | "lower" | "lowest" | undefined;
theme: PD.Normalize<{
globalName: any;
carbonColor: any;
symmetryColor: any;
focus: any;
}> | undefined;
}, {
components?: undefined;
representations?: undefined;
} | {
components: {
polymer: StateObjectSelector<PluginStateObject.Molecule.Structure, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>> | undefined;
lipid: StateObjectSelector<PluginStateObject.Molecule.Structure, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>> | undefined;
};
representations: {
polymer: StateObjectSelector<PluginStateObject.Molecule.Structure.Representation3D, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>>;
lipid: StateObjectSelector<PluginStateObject.Molecule.Structure.Representation3D, import("../../../mol-state/transformer").StateTransformer<import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>>, any>>;
};
}>;
};
export declare type PresetStructureRepresentations = typeof PresetStructureRepresentations;
export {};