UNPKG

molstar

Version:

A comprehensive macromolecular library.

152 lines (151 loc) 6.5 kB
/** * Copyright (c) 2019-2025 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose <alexander.rose@weirdbyte.de> * @author David Sehnal <david.sehnal@gmail.com> */ import { ParamDefinition as PD } from '../../../mol-util/param-definition'; import { Structure, Unit } from '../../../mol-model/structure'; import { Features } from './features'; import { InteractionsIntraContacts, InteractionsInterContacts } from './common'; import { IntMap } from '../../../mol-data/int'; import { CustomProperty } from '../../common/custom-property'; import { DataLocation } from '../../../mol-model/location'; import { Sphere3D } from '../../../mol-math/geometry'; import { DataLoci } from '../../../mol-model/loci'; export { Interactions }; interface Interactions { /** Features of each unit */ unitsFeatures: IntMap<Features>; /** Interactions of each unit */ unitsContacts: IntMap<InteractionsIntraContacts>; /** Interactions between units */ contacts: InteractionsInterContacts; } declare namespace Interactions { type StructureInteractions = { readonly structure: Structure; readonly interactions: Interactions; }; export interface Element { unitA: Unit; /** Index into features of unitA */ indexA: Features.FeatureIndex; unitB: Unit; /** Index into features of unitB */ indexB: Features.FeatureIndex; } export interface Location extends DataLocation<StructureInteractions, Element> { } export function Location(interactions: Interactions, structure: Structure, unitA?: Unit, indexA?: Features.FeatureIndex, unitB?: Unit, indexB?: Features.FeatureIndex): Location; export function isLocation(x: any): x is Location; export function areLocationsEqual(locA: Location, locB: Location): boolean; export function locationLabel(location: Location): string; export interface Loci extends DataLoci<StructureInteractions, Element> { } export function Loci(structure: Structure, interactions: Interactions, elements: ReadonlyArray<Element>): Loci; export function isLoci(x: any): x is Loci; export function getBoundingSphere(interactions: Interactions, elements: ReadonlyArray<Element>, boundingSphere: Sphere3D): Sphere3D; export function getLabel(structure: Structure, interactions: Interactions, elements: ReadonlyArray<Element>): string; export {}; } export declare const ContactProviderParams: { ionic: PD.Mapped<PD.NamedParams<{}, "off"> | PD.NamedParams<{ distanceMax: PD.Numeric; }, "on">>; 'pi-stacking': PD.Mapped<PD.NamedParams<{}, "off"> | PD.NamedParams<{ distanceMax: PD.Numeric; offsetMax: PD.Numeric; angleDevMax: PD.Numeric; }, "on">>; 'cation-pi': PD.Mapped<PD.NamedParams<{}, "off"> | PD.NamedParams<{ distanceMax: PD.Numeric; offsetMax: PD.Numeric; }, "on">>; 'halogen-bonds': PD.Mapped<PD.NamedParams<{}, "off"> | PD.NamedParams<{ distanceMax: PD.Numeric; angleMax: PD.Numeric; }, "on">>; 'hydrogen-bonds': PD.Mapped<PD.NamedParams<{}, "off"> | PD.NamedParams<{ water: PD.BooleanParam; sulfurDistanceMax: PD.Numeric; distanceMax: PD.Numeric; backbone: PD.BooleanParam; accAngleDevMax: PD.Numeric; ignoreHydrogens: PD.BooleanParam; donAngleDevMax: PD.Numeric; accOutOfPlaneAngleMax: PD.Numeric; donOutOfPlaneAngleMax: PD.Numeric; }, "on">>; 'weak-hydrogen-bonds': PD.Mapped<PD.NamedParams<{}, "off"> | PD.NamedParams<{ distanceMax: PD.Numeric; backbone: PD.BooleanParam; accAngleDevMax: PD.Numeric; ignoreHydrogens: PD.BooleanParam; donAngleDevMax: PD.Numeric; accOutOfPlaneAngleMax: PD.Numeric; donOutOfPlaneAngleMax: PD.Numeric; }, "on">>; hydrophobic: PD.Mapped<PD.NamedParams<{}, "off"> | PD.NamedParams<{ distanceMax: PD.Numeric; }, "on">>; 'metal-coordination': PD.Mapped<PD.NamedParams<{}, "off"> | PD.NamedParams<{ distanceMax: PD.Numeric; }, "on">>; }; export declare const InteractionsParams: { providers: PD.Group<PD.Normalize<{ ionic: PD.NamedParams<{}, "off"> | PD.NamedParams<{ distanceMax: PD.Numeric; }, "on">; 'pi-stacking': PD.NamedParams<{}, "off"> | PD.NamedParams<{ distanceMax: PD.Numeric; offsetMax: PD.Numeric; angleDevMax: PD.Numeric; }, "on">; 'cation-pi': PD.NamedParams<{}, "off"> | PD.NamedParams<{ distanceMax: PD.Numeric; offsetMax: PD.Numeric; }, "on">; 'halogen-bonds': PD.NamedParams<{}, "off"> | PD.NamedParams<{ distanceMax: PD.Numeric; angleMax: PD.Numeric; }, "on">; 'hydrogen-bonds': PD.NamedParams<{}, "off"> | PD.NamedParams<{ water: PD.BooleanParam; sulfurDistanceMax: PD.Numeric; distanceMax: PD.Numeric; backbone: PD.BooleanParam; accAngleDevMax: PD.Numeric; ignoreHydrogens: PD.BooleanParam; donAngleDevMax: PD.Numeric; accOutOfPlaneAngleMax: PD.Numeric; donOutOfPlaneAngleMax: PD.Numeric; }, "on">; 'weak-hydrogen-bonds': PD.NamedParams<{}, "off"> | PD.NamedParams<{ distanceMax: PD.Numeric; backbone: PD.BooleanParam; accAngleDevMax: PD.Numeric; ignoreHydrogens: PD.BooleanParam; donAngleDevMax: PD.Numeric; accOutOfPlaneAngleMax: PD.Numeric; donOutOfPlaneAngleMax: PD.Numeric; }, "on">; hydrophobic: PD.NamedParams<{}, "off"> | PD.NamedParams<{ distanceMax: PD.Numeric; }, "on">; 'metal-coordination': PD.NamedParams<{}, "off"> | PD.NamedParams<{ distanceMax: PD.Numeric; }, "on">; }>>; contacts: PD.Group<PD.Normalize<{ lineOfSightDistFactor: number; }>>; }; export type InteractionsParams = typeof InteractionsParams; export type InteractionsProps = PD.Values<InteractionsParams>; export interface ComputeInterctionsOptions { skipIntraContacts?: boolean; unitPairTest?: (unitA: Unit, unitB: Unit) => boolean; } export declare function computeInteractions(ctx: CustomProperty.Context, structure: Structure, props: Partial<InteractionsProps>, options?: ComputeInterctionsOptions): Promise<Interactions>;