Skip to content
Snippets Groups Projects
Commit 9699a23a authored by David Sehnal's avatar David Sehnal
Browse files

started annotations

parent 4f77ec1c
Branches
Tags
No related merge requests found
/**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
*/
import { Structure, ElementSet, Element } from '../structure'
interface Annotation<E = any> {
definition: Annotation.Definition<E>,
getValue(l: Element.Location): E | undefined,
getAll(l: ElementSet): { annotations: E[], /* TODO: map annotations to elements */ }
}
namespace Annotation {
export const enum Kind {
Atom,
Residue,
Sequence,
Chain,
Entity,
Coarse,
Spatial
}
export const enum Type {
Num,
Str,
Obj
}
export interface Definition<E = any> {
name: string,
kind: Kind,
type: Type,
prepare<Data>(s: Structure, data: Data): Annotation<E>,
}
}
export { Annotation }
\ No newline at end of file
/**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
*/
import { Annotation } from './annotation/annotation'
import { UUID } from 'mol-util'
interface Annotations {
id: UUID,
all: Annotation[],
byKind: { [kind: number]: Annotation }
//getAll()
}
export { Annotations }
\ No newline at end of file
......@@ -18,6 +18,7 @@ import computeBonds from './utils/compute-bonds'
import from_gro from './formats/gro'
import from_mmCIF from './formats/mmcif'
import { Annotations } from '../../annotations'
/**
* Interface to the "source data" of the molecule.
......@@ -35,6 +36,7 @@ interface Model extends Readonly<{
conformation: Conformation,
symmetry: Symmetry,
coarseGrained: CoarseGrained,
annotations: Annotations,
atomCount: number,
}> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment