molstar
Version:
A comprehensive macromolecular library.
57 lines (56 loc) • 2.82 kB
TypeScript
/**
* Copyright (c) 2025 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
*/
import { Table } from '../../mol-data/db';
import { mmCIF_Schema } from '../../mol-io/reader/cif/schema/mmcif';
import { Mat4, Vec3 } from '../../mol-math/linear-algebra';
import { MolstarBondSiteTypeId, MolstarBondSiteValueOrder } from '../../mol-model/structure/export/categories/molstar_bond_site';
import { JSONCifDataBlock } from './model';
type Atom = Partial<Table.Row<mmCIF_Schema['atom_site']>>;
export interface JSONCifLigandGraphBondProps {
value_order: MolstarBondSiteValueOrder | undefined;
type_id: MolstarBondSiteTypeId | undefined;
}
export interface JSONCifLigandGraphAtom {
key: string;
final_id: number | undefined;
row: Atom;
}
export interface JSONCifLigandGraphBond {
atom_1: JSONCifLigandGraphAtom;
atom_2: JSONCifLigandGraphAtom;
props: JSONCifLigandGraphBondProps;
}
export interface JSONCifLigandGraphData {
block: JSONCifDataBlock;
atomIdRemapping: Map<number, number>;
addedAtomIds: number[];
removedAtomIds: number[];
}
export declare class JSONCifLigandGraph {
private data;
readonly atoms: JSONCifLigandGraphAtom[];
readonly atomsByKey: Map<string, JSONCifLigandGraphAtom>;
readonly atomsById: Map<number, JSONCifLigandGraphAtom>;
/** Bond with the provided key is always atom_1 */
readonly bondByKey: Map<string, JSONCifLigandGraphBond[]>;
readonly removedAtomIds: Set<number>;
getAtomAtIndex(index: number): JSONCifLigandGraphAtom;
getAtom(atomOrId: number | JSONCifLigandGraphAtom): JSONCifLigandGraphAtom | undefined;
getBonds(atomOrId: number | JSONCifLigandGraphAtom): JSONCifLigandGraphBond[];
getAtomCoords(atomOrId: number | JSONCifLigandGraphAtom, out?: Vec3): Vec3;
getBondDirection(bond: JSONCifLigandGraphBond, out?: Vec3): Vec3;
modifyAtom(atomOrId: number | JSONCifLigandGraphAtom, data: Omit<Atom, 'id'>): void;
addAtom(data: Omit<Atom, 'id'>): JSONCifLigandGraphAtom;
removeAtom(atomOrId: number | JSONCifLigandGraphAtom): void;
addOrUpdateBond(atom1: number | JSONCifLigandGraphAtom, atom2: number | JSONCifLigandGraphAtom, props: JSONCifLigandGraphBondProps): void;
removeBond(atom1: number | JSONCifLigandGraphAtom, atom2: number | JSONCifLigandGraphAtom): void;
private transformAtomCoords;
transformCoords(xform: Mat4, atoms?: (number | JSONCifLigandGraphAtom)[]): void;
traverse<S>(atomOrId: number | JSONCifLigandGraphAtom, how: 'dfs' | 'bfs', state: S, visitAtom: (atom: JSONCifLigandGraphAtom, state: S, pred: JSONCifLigandGraphBond | undefined, graph: JSONCifLigandGraph) => void): S;
getData(): JSONCifLigandGraphData;
constructor(data: JSONCifDataBlock);
}
export {};