molstar
Version:
A comprehensive macromolecular library.
142 lines (141 loc) • 6.1 kB
TypeScript
/**
* Copyright (c) 2017-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 { UUID } from '../../../mol-util/uuid';
import { StructureSequence } from './properties/sequence';
import { AtomicHierarchy, AtomicConformation, AtomicRanges } from './properties/atomic';
import { CoarseHierarchy, CoarseConformation } from './properties/coarse';
import { Entities, ChemicalComponentMap, MissingResidues, StructAsymMap } from './properties/common';
import { CustomProperties } from '../../custom-property';
import { SaccharideComponentMap } from '../structure/carbohydrates/constants';
import { ModelFormat } from '../../../mol-model-formats/format';
import { Vec3 } from '../../../mol-math/linear-algebra';
import { Coordinates } from '../coordinates';
import { Topology } from '../topology';
import { Task } from '../../../mol-task';
import { ChainIndex, ElementIndex } from './indexing';
import { SymmetryOperator } from '../../../mol-math/geometry';
import { Trajectory } from '../trajectory';
import { Unit } from '../structure';
import { SortedArray } from '../../../mol-data/int/sorted-array';
/**
* Interface to the "source data" of the molecule.
*
* "Atoms" are integers in the range [0, atomCount).
*/
export interface Model extends Readonly<{
id: UUID;
entryId: string;
label: string;
/** the name of the entry/file/collection the model is part of */
entry: string;
/**
* corresponds to
* - for IHM: `ihm_model_list.model_id`
* - for standard mmCIF: `atom_site.pdbx_PDB_model_num`
* - for models from coordinates: frame index
*/
modelNum: number;
sourceData: ModelFormat;
parent: Model | undefined;
entities: Entities;
sequence: StructureSequence;
atomicHierarchy: AtomicHierarchy;
atomicConformation: AtomicConformation;
atomicRanges: AtomicRanges;
atomicChainOperatorMappinng: Map<ChainIndex, SymmetryOperator>;
properties: {
/** map that holds details about unobserved or zero occurrence residues */
readonly missingResidues: MissingResidues;
/** maps residue name to `ChemicalComponent` data */
readonly chemicalComponentMap: ChemicalComponentMap;
/** maps residue name to `SaccharideComponent` data */
readonly saccharideComponentMap: SaccharideComponentMap;
/** maps label_asym_id name to `StructAsym` data */
readonly structAsymMap: StructAsymMap;
};
customProperties: CustomProperties;
/**
* Not to be accessed directly, each custom property descriptor
* defines property accessors that use this field to store the data.
*/
_staticPropertyData: {
[name: string]: any;
};
_dynamicPropertyData: {
[name: string]: any;
};
coarseHierarchy: CoarseHierarchy;
coarseConformation: CoarseConformation;
}> {
}
export declare namespace Model {
function trajectoryFromModelAndCoordinates(model: Model, coordinates: Coordinates): Trajectory;
function trajectoryFromTopologyAndCoordinates(topology: Topology, coordinates: Coordinates): Task<Trajectory>;
function getCenter(model: Model): Vec3;
function getInvertedAtomSourceIndex(model: Model): {
isIdentity: boolean;
invertedIndex: ArrayLike<ElementIndex>;
};
type TrajectoryInfo = {
readonly index: number;
readonly size: number;
};
const TrajectoryInfo: {
get(model: Model): TrajectoryInfo;
set(model: Model, trajectoryInfo: TrajectoryInfo): TrajectoryInfo;
};
type AsymIdCount = {
readonly auth: number;
readonly label: number;
};
const AsymIdCount: {
get(model: Model): AsymIdCount;
};
type AsymIdOffset = {
auth: number;
label: number;
};
const AsymIdOffset: import("../../../mol-model-props/common/custom-property").CustomProperty.Provider<Model, {
value: import("../../../mol-util/param-definition").ParamDefinition.Value<AsymIdOffset | undefined>;
}, AsymIdOffset | undefined>;
type Index = number;
const Index: import("../../../mol-model-props/common/custom-property").CustomProperty.Provider<Model, {
value: import("../../../mol-util/param-definition").ParamDefinition.Value<number | undefined>;
}, number | undefined>;
function getRoot(model: Model): Model;
function areHierarchiesEqual(a: Model, b: Model): boolean;
type CoordinatesHistory = {
areEqual(elements: SortedArray<ElementIndex>, kind: Unit.Kind, model: Model): boolean;
};
const CoordinatesHistory: {
get(model: Model): CoordinatesHistory | undefined;
set(model: Model, coordinatesHistory: CoordinatesHistory): CoordinatesHistory;
};
/**
* Has typical coarse grained atom names (BB, SC1) or less than three times as many
* atoms as polymer residues (C-alpha only models).
*/
function isCoarseGrained(model: Model): boolean;
function hasCarbohydrate(model: Model): boolean;
function hasProtein(model: Model): boolean;
function hasNucleic(model: Model): boolean;
function isFromPdbArchive(model: Model): boolean;
function hasSecondaryStructure(model: Model): boolean;
function hasCrystalSymmetry(model: Model): boolean;
function isFromXray(model: Model): boolean;
function isFromEm(model: Model): boolean;
function isFromNmr(model: Model): boolean;
function hasXrayMap(model: Model): boolean;
/**
* Also checks for `content_type` of 'associated EM volume' to exclude cases
* like 6TEK which are solved with 'X-RAY DIFFRACTION' but have an related
* EMDB entry of type 'other EM volume'.
*/
function hasEmMap(model: Model): boolean;
function hasDensityMap(model: Model): boolean;
function probablyHasDensityMap(model: Model): boolean;
}