Skip to content
Snippets Groups Projects
Commit af6a625f authored by Lukas Pravda's avatar Lukas Pravda
Browse files

change CI process

parent 617bd918
No related branches found
No related tags found
No related merge requests found
Pipeline #53248 failed with stage
in 14 seconds
.vscode
.mypy_cache
node_modules
\ No newline at end of file
node_modules
build/*.js*
\ No newline at end of file
image: alpine:3.8
image: docker:latest
before_script:
- npm install
- npm install --save-dev webpack
- webpack --mode=production
- npm run build
pages:
script:
......
declare namespace Model {
class UIParameters {
reinitialize: boolean;
downloadImage: boolean;
downloadData: boolean;
center: boolean;
help: boolean;
residueLabel: boolean;
tooltip: boolean;
constructor();
}
/**
*
*
* @export
* @enum {number}
*/
enum InteractionType {
AtomAtom = 0,
AtomPlane = 1,
PlanePlane = 2,
GroupPlane = 3,
GroupGroup = 4
}
class InteractionTypeUtil {
static parse(value: string): InteractionType;
}
class Interaction {
sourceAtoms: string[];
targetAtoms: string[];
interactionType: InteractionType;
interactionsClases: string[];
distance: number;
constructor(srcAtoms: string[], targetAtoms: string[], type: InteractionType, intClasses: string[], d: number);
}
/**
* Data model representing a single residue, which is a part of the
* bound molecule. This residue is unique in the entire binding site.
*/
class Residue {
id: string;
chainId: string;
authorResidueNumber: number;
chemCompId: string;
authorInsertionCode: string;
isLigand: boolean;
constructor(data: any, isLigand: boolean);
/**
* Infer type of the residue, which is then used as a CSS source
* for proper residue aesthetics.
*/
getResidueType(): string;
equals(other: Residue): boolean;
toString(): string;
}
class InteractionNode implements d3.SimulationNodeDatum {
id: string;
residue: Residue;
scale: number;
index?: number;
x?: number;
y?: number;
vx?: number;
vy?: number;
fx?: number;
fy?: number;
constructor(r: Residue, scale: number, id: string, x?: number, y?: number);
equals(other: InteractionNode): boolean;
toString(): string;
toTooltip(): string;
}
interface Link {
source: InteractionNode;
target: InteractionNode;
getLinkClass(): string;
toTooltip(): string;
}
class ResidueResidueLink implements Link {
target: InteractionNode;
source: InteractionNode;
interactions: Map<InteractionType, Array<string>>;
constructor(source: InteractionNode, target: InteractionNode, interactions: any);
/**
* Checks if the link contains a given node.
*/
containsNode(n: InteractionNode): boolean;
/**
* Shorthand to check if the link contains particular underlying
* residue.
*/
containsResidue(n: Residue): boolean;
isBoundMoleculeLink(): boolean;
toTooltip(): string;
/**
* Check all the interactions, which are a part of the contact
* and determine their class. This is later on used for selection
* of the correct aesthetics with CSS.
*/
getLinkClass(): string;
}
class LigandResidueLink implements Link {
source: InteractionNode;
target: InteractionNode;
interaction: Array<Interaction>;
constructor(begin: InteractionNode, end: InteractionNode, beginAtoms: string[], endAtoms: string[], interactionType: string, interactionDetails: string[], distance: number);
containsBothNodes(a: InteractionNode, b: InteractionNode): boolean;
addInteraction(beginAtoms: string[], endAtoms: string[], interactionType: string, interactionDetails: string[], distance: number): void;
/**
* Check all the interactions, which are a part of the contact
* and determine their class. This is later on used for selection
* of the correct aesthetics with CSS.
*/
getLinkClass(): string;
containsInteractionNode(node: InteractionNode): boolean;
hasClash(): boolean;
toTooltip(): string;
}
/**
* DataObject representing the entire binding site with the bound
* molecule and all its interactions.
*/
class BindingSite {
pdbId: string;
bmId: string;
residues: Residue[];
interactionNodes: InteractionNode[];
links: Link[];
constructor();
fromBoundMolecule(pdbId: string, data: any): BindingSite;
private processResidueInteractionPartner;
private processLigandInteractionPartner;
fromLigand(pdbId: string, data: any, ligand: Depiction): BindingSite;
}
}
/**
* Provider of glycan depictions for a given hetcode. Uses two external
* resources. One configuration XML with the glycan classes and their
* depictions and a file providing mapping between glycan class and het
* codes.
*
* @class VisualsMapper
*/
declare class VisualsMapper {
glycanImages: Map<string, SVGElement>;
glycanMapping: Map<string, string>;
graphicsPromise: Promise<void>;
mappingPromise: Promise<void>;
constructor();
/**
* Gets proper glycan in the SVG format based on teh glycan class.
*
* @param {string} compId Class id.
* @returns {SVGElement} glycan representation in the SVG format.
* @memberof GlycanMapper
*/
getGlycanImage(compId: string): SVGElement;
/**
* Parse external file with glycan representation and stores it for
* further use.
*
* @private
* @param {string} symbolsLink external link to the XML mapping file.
* @returns {Promise} To check later if it has been processed.
* @memberof GlycanMapper
*/
private parseSymbols;
/**
* Parses an external JSON configuration file which provides a mapping
* between glycan id (e.g. GlcA) and het codes.
*/
private parseGlycanMapping;
}
/**
* This class contains all the details which are necessary for redrawing
* RDKIt style 2D molecule depiction on a client side as well as some
* other logic which should hopefully help with the initial placement of
* binding partners in the residue-level view.
*
* @author Lukas Pravda <lpravda@ebi.ac.uk>
* @class Depiction
* @param {string} ccdId PDB CCD id.
* @param {Atom[]} atoms List of atoms.
* @param {Bond[]} bonds Visual representation of bonds.
* They do not correlate 1:1 with a number of bonds!
* @param {Vector2D} resolution x,y dimension of the image. Needs to be used
* for a scene shift, so it is centered.
*/
declare class Depiction {
ccdId: string;
atoms: Atom[];
bonds: Bond[];
resolution: Vector2D;
constructor(data: any);
/**
* Returns an initial position of Residue node bound to a list of
* atom.
*
* Present implementation sorts all the partners based on the atom
* degree and then gets the one with the lovest degree and places
* the initial residue position along the vector pointing from it.
*
* @param {string[]} atomNames list of atom names the bound residue
* has a contact with.
* @returns {Vector2D} Returns an initial placement of the residue in contact.
* @memberof Depiction
*/
getInitalNodePosition(atomNames: string[]): Vector2D;
/**
* Appends to a given selection the visual representation of bonds as svg:path elements.
*
* @param {d3.Selection<d3.BaseType, {}, HTMLElement, any>} selection where to append SVG
* representation of the bond visuals.
* @memberof Depiction
*/
appendBondVisualsTo(root: d3.Selection<d3.BaseType, {}, HTMLElement, any>): void;
/**
* Append depiction labels to the visualization. Because RDKIt places
* the labels slightly differently this information needs to be
* consumed too, because we cannot use just atom position directly.
* Also there are all sorts of colorful subscripts and superscripts,
* so it is much easier to use it this way.
*
* @param {d3.Selection<d3.BaseType, {}, HTMLElement, any>} root where to append SVG
* representation of compounds' labels.
* @memberof Depiction
*/
appendTextsTo(root: any): void;
/**
* Add small white circle on the background of atoms with label
* just to make the interaction lines pretty.
*
* @param {*} root
* @memberof Depiction
*/
appendClarityNodes(root: any): void;
getCenter(ids: string[]): Vector2D;
/**
*
*
* @param {Map<string, number>} map
* @returns
* @memberof Depiction
*/
sortMap(map: Map<string, number>): Map<string, number>;
}
/**
* Atom from the depiction
*
* @class Atom
* @param {string} name Unique atom name.
* @param {any} label Atom label
* @param {Vector2D} position Position of the atom in 2D coordinate system.
*/
declare class Atom {
name: string;
label: any;
position: Vector2D;
constructor(item: any);
/**
*
*
* @param {Atom} other
* @returns true if the atoms are equal
* @memberof Atom
*/
equals(other: Atom): boolean;
}
/**
* 2D point definition
*
* @class Point
* @param {number} x coordinate
* @param {number} y coordinate
*/
declare class Vector2D {
x: number;
y: number;
constructor(x: number, y: number);
/**
* Returns a string representation of the object in a format: [x, y]
*
* @returns {string} String representation of the object
* @memberof Point
*/
toString(): string;
/**
* Checks whether or not two Vector2D objects are equal.
*
* @param {Vector2D} other instance of an object to check.
* @returns {boolean} whether or not the objects are equal.
* @memberof Point
*/
equals(other: Vector2D): boolean;
/**
* Measures a distance between this atom and another atom.
*
* @param {Vector2D} other atom to measure a distance to.
* @returns {number} Returns the distance to another object.
* @memberof Point
*/
distanceTo(other: Vector2D): number;
/**
* Composes vectors to a single one. This is used in infering the
* original placement of the residue nodes.
*
* @static
* @param {Vector2D[]} points Vectors to be composed.
* @returns {Vector2D} Result of a vector composition.
* @memberof Point
*/
static composeVectors(points: Vector2D[]): Vector2D;
}
/**
* Represents a bond in a 2D depiction.
*
* @class Bond
* @param {Atom} bgn one side of the bond.
* @param {Atom} end the other side of the bond.
* @param {string} coords coordinates of the bonds graphical primitive.
* @param {string} style Style of the bonds graphical primitive.
*/
declare class Bond {
bgn: Atom;
end: Atom;
coords: string;
style: string;
/**
*Creates an instance of the bond.
* @param {Atom} a
* @param {Atom} b
* @memberof Bond
*/
constructor(a: Atom, b: Atom, coords: string, style: string);
/**
* Get the other atom for a given bond.
*
* @param {Atom} other
* @returns {Atom} The other atom from the bond.
* @throws {Error} if the atom is not part of that bond at all.
* @memberof Bond
*/
getOtherAtom(other: Atom): Atom;
/**
* Check whether or not a bond contains the atom.
*
* @param {Atom} other The other side of the bond
* @returns True if the atom is a part of the bond, false otherwise.
* @memberof Bond
*/
containsAtom(other: Atom): boolean;
/**
* Hide bond from the representation.
*
* @memberof Bond
*/
hide(): void;
}
declare const server: string;
declare const clickEvent = "PDB.interactions.click";
declare const mouseoverEvent = "PDB.interactions.mouseover";
declare const mouseoutEvent = "PDB.interactions.mouseout";
declare class Visualization {
private parent;
private canvas;
private simulation;
private svg;
private visualization;
private nodes;
private links;
private residueLabel;
private tooltip;
private pdbId;
private bindingSite;
private depiction;
private visualsMapper;
private interactionsData;
private selectedResidueHash;
constructor(element: HTMLElement);
private nodeMouseEnterEventHandler;
private nodeMouseLeaveEventHandler;
private linkMouseClickEventHandler;
private linkMouseOverEventHandler;
private linkMouseOutEventHandler;
private zoom_handler;
private drag_handler;
initialiseBoundMolecule(pdbid: string, bmId: string): Promise<void>;
initialiseLigand(pdbId: string, resId: number, chainId: string): Promise<void>;
saveSvg(ctx: Visualization): void;
downloadInteractionsData(ctx: Visualization): void;
reinitialize(ctx: Visualization): void;
private resize;
centerScene(ctx: Visualization): void;
private fireNodeMouseEnterEvent;
private fireNodeMouseLeaveEvent;
private fireLinkEvent;
private fireNodeEvent;
private fireLinkLeaveEvent;
private showLabel;
private selectLigand;
private setupLigandScene;
private setupScene;
private simulationStep;
private nodeHighlight;
private nodeDim;
private addMarkers;
}
declare let helpLigands: string;
declare let helpBonds: string;
declare class UI {
private root;
private display;
private residueLabel;
private tooltip;
constructor(element: HTMLElement, vis: Visualization);
register(params: Model.UIParameters): void;
private saveSVG;
private reinitialize;
private download;
private center;
private changeHelp;
showHelp(): void;
displayToolbarPanel(show: boolean): void;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment