Function
Static Public Summary | ||
public |
AVHash(atomsX: Float32Array, atomsY: Float32Array, atomsZ: Float32Array, atomsR: Float32Array, min: Float32Array, max: Float32Array, maxDistance: Float) Modifed from SpatialHash |
|
public |
|
|
public |
BinaryHeap(scoreFunction: Function) Binary heap implementation |
|
public |
|
|
public |
|
|
public |
|
|
public |
Kdtree(points: Float32Array, metric: Function) Kdtree |
|
public |
Kdtree() |
|
public |
|
|
public |
|
|
public |
Matrix() |
|
public |
|
|
public |
Spline() |
|
public |
Stats() |
|
public |
Viewer class |
|
public |
|
|
public |
Worker() |
|
public |
|
|
public |
addCols() |
|
public |
addRows() |
|
public |
|
|
public |
|
|
public |
|
|
public |
arrayMax() |
|
public |
|
|
public |
arrayMin() |
|
public |
arrayRms() |
|
public |
|
|
public |
|
|
public |
arraySum() |
|
public |
assignResidueTypeBonds(structure: Structure): undefined Assigns ResidueType bonds. |
|
public |
|
|
public |
autoLoad(file: String | File | Blob, params: LoaderParameters): Promise Load a file |
|
public |
binarySearchIndexOf(array: Array, element: Anything, compareFunction: Function): Number Does a binary search to get the index of an element in the input array |
|
public |
boolean() |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
clamp() |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
deepCopy() |
|
public |
defaults() |
|
public |
download() |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
flatten() |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
getQuery() |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
lerp() |
|
public |
lineLineIntersect(p1: Vector3, p2: Vector3, p3: Vector3, p4: Vector3): Array<Vector3, Vector3> | null Converted to JavaScript from http://paulbourke.net/geometry/pointlineplane/lineline.c |
|
public |
|
|
public |
m3new() |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
m4new() |
|
public |
|
|
public |
|
|
public |
makeImage(viewer: Viewer, params: ImageParameters): Promise Make image from what is shown in a viewer canvas |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
meanCols() |
|
public |
meanRows() |
|
public |
multiply() |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
open() |
|
public |
parseNestedAtoms(sview: Structure, atoms: Array): Float32Array MeasurementRepresentations take atom[Pair|Triple|Quad] parameters. |
|
public |
|
|
public |
parseXml() |
|
public |
pclamp() |
|
public |
pick() |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
quicksortIP(arr: TypedArray, eleSize: Integer, orderElement: Integer, begin: Integer, end: Integer): TypedArray quicksortIP |
|
public |
radToDeg() |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
saturate() |
|
public |
|
|
public |
|
|
public |
setDebug() |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
spline() |
|
public |
subCols() |
|
public |
subRows() |
|
public |
submit() |
|
public |
superpose(s1: Structure | StructureView, s2: Structure | StructureView, align: Boolean, sele1: String, sele2: String): undefined Perform structural superposition of two structures, optionally guided by a sequence alignment |
|
public |
svd() |
|
public |
|
|
public |
throttle() |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
v3add() |
|
public |
|
|
public |
v3angle() |
|
public |
v3ceil() |
|
public |
v3cross() |
|
public |
v3divide() |
|
public |
|
|
public |
v3dot() |
|
public |
v3floor() |
|
public |
|
|
public |
|
|
public |
v3length() |
|
public |
|
|
public |
|
|
public |
v3negate() |
|
public |
v3new() |
|
public |
|
|
public |
v3round() |
|
public |
v3sub() |
|
public |
|
|
public |
|
Static Private Summary | ||
private |
Grid() |
|
private |
Queue() |
|
private |
|
|
private |
|
|
private |
|
|
private |
degToRad() |
Static Public
public AVHash(atomsX: Float32Array, atomsY: Float32Array, atomsZ: Float32Array, atomsR: Float32Array, min: Float32Array, max: Float32Array, maxDistance: Float) source
import {AVHash} from 'ngl/src/surface/av-surface.js'
Modifed from SpatialHash
Main differences are:
- Optimized grid size to ensure we only ever need to look +/-1 cell
- Aware of atomic radii and will only output atoms within rAtom + rExtra (see withinRadii method)
(Uses rounding rather than bitshifting as consequence of arbitrary grid size)
Params:
Name | Type | Attribute | Description |
atomsX | Float32Array | x coordinates |
|
atomsY | Float32Array | y coordinates |
|
atomsZ | Float32Array | z coordinates |
|
atomsR | Float32Array | atom radii |
|
min | Float32Array | xyz min coordinates |
|
max | Float32Array | xyz max coordinates |
|
maxDistance | Float | max distance |
public BinaryHeap(scoreFunction: Function) source
import BinaryHeap from 'ngl/src/utils/binary-heap.js'
Binary heap implementation
Params:
Name | Type | Attribute | Description |
scoreFunction | Function | the heap scoring function |
public Kdtree(points: Float32Array, metric: Function) source
import Kdtree from 'ngl/src/utils/kdtree.js'
Kdtree
Params:
Name | Type | Attribute | Description |
points | Float32Array | points |
|
metric | Function | metric |
Example:
points: [x, y, z, x, y, z, x, y, z, ...]
metric: function(a, b){
return Math.pow(a[0]-b[0], 2) + Math.pow(a[1]-b[1], 2) + Math.pow(a[2]-b[2], 2);
}
public Viewer(idOrElement: String | Element) source
import Viewer from 'ngl/src/viewer/viewer.js'
Viewer class
Params:
Name | Type | Attribute | Description |
idOrElement | String | Element |
|
dom id or element |
public applyMatrix3toVector3array() source
import {applyMatrix3toVector3array} from 'ngl/src/math/vector-utils.js'
public applyMatrix4toVector3array() source
import {applyMatrix4toVector3array} from 'ngl/src/math/vector-utils.js'
public assignResidueTypeBonds(structure: Structure): undefined source
import {assignResidueTypeBonds} from 'ngl/src/structure/structure-utils.js'
Assigns ResidueType bonds.
Params:
Name | Type | Attribute | Description |
structure | Structure | the structure object |
public assignSecondaryStructure() source
import {assignSecondaryStructure} from 'ngl/src/structure/structure-utils.js'
public autoLoad(file: String | File | Blob, params: LoaderParameters): Promise source
import {autoLoad} from 'ngl/src/loader/loader-utils.js'
Load a file
Params:
Name | Type | Attribute | Description |
file | String | File | Blob | either a URL or an object containing the file data |
|
params | LoaderParameters | loading parameters |
Example:
// load from URL
NGL.autoLoad( "http://files.rcsb.org/download/5IOS.cif" );
// load binary data in CCP4 format via a Blob
var binaryBlob = new Blob( [ ccp4Data ], { type: 'application/octet-binary'} );
NGL.autoLoad( binaryBlob, { ext: "ccp4" } );
// load string data in PDB format via a Blob
var stringBlob = new Blob( [ pdbData ], { type: 'text/plain'} );
NGL.autoLoad( stringBlob, { ext: "pdb" } );
// load a File object
NGL.autoLoad( file );
public binarySearchIndexOf(array: Array, element: Anything, compareFunction: Function): Number source
import {binarySearchIndexOf} from 'ngl/src/utils.js'
Does a binary search to get the index of an element in the input array
Example:
var array = [ 1, 2, 3, 4, 5, 6 ];
var element = 4;
binarySearchIndexOf( array, element ); // returns 3
public buildUnitcellAssembly() source
import {buildUnitcellAssembly} from 'ngl/src/structure/structure-utils.js'
public calcArcPoint() source
import {calcArcPoint} from 'ngl/src/representation/measurement-representation.js'
public calculateBondsBetween() source
import {calculateBondsBetween} from 'ngl/src/structure/structure-utils.js'
public calculateBondsWithin() source
import {calculateBondsWithin} from 'ngl/src/structure/structure-utils.js'
public calculateCenterArray() source
import {calculateCenterArray} from 'ngl/src/math/array-utils.js'
public calculateChainnames() source
import {calculateChainnames} from 'ngl/src/structure/structure-utils.js'
public calculateDirectionArray() source
import {calculateDirectionArray} from 'ngl/src/math/array-utils.js'
public calculateMeanVector3() source
import {calculateMeanVector3} from 'ngl/src/math/vector-utils.js'
public calculateResidueBonds() source
import {calculateResidueBonds} from 'ngl/src/structure/structure-utils.js'
public computeVertexNormals() source
import {computeVertexNormals} from 'ngl/src/surface/surface-utils.js'
public getSymmetryOperations() source
import {getSymmetryOperations} from 'ngl/src/symmetry/symmetry-utils.js'
public lineLineIntersect(p1: Vector3, p2: Vector3, p3: Vector3, p4: Vector3): Array<Vector3, Vector3> | null source
import {lineLineIntersect} from 'ngl/src/math/vector-utils.js'
Converted to JavaScript from http://paulbourke.net/geometry/pointlineplane/lineline.c
public makeImage(viewer: Viewer, params: ImageParameters): Promise source
import {makeImage} from 'ngl/src/viewer/viewer-utils.js'
Make image from what is shown in a viewer canvas
Params:
Name | Type | Attribute | Description |
viewer | Viewer | the viewer |
|
params | ImageParameters | parameters object |
public makeRepresentation() source
import {makeRepresentation} from 'ngl/src/representation/representation-utils.js'
public makeTrajectory() source
import {makeTrajectory} from 'ngl/src/trajectory/trajectory-utils.js'
public normalizeVector3array() source
import {normalizeVector3array} from 'ngl/src/math/vector-utils.js'
public parseNestedAtoms(sview: Structure, atoms: Array): Float32Array source
import {parseNestedAtoms} from 'ngl/src/representation/measurement-representation.js'
MeasurementRepresentations take atom[Pair|Triple|Quad] parameters.
Parses nested array of either integer atom indices or selection expressions into a flat array of coordinates.
NB: Unlike previous version, this peeks at first entry to determine if atoms are given by int index or selection expression. It cannot cope with mixtures
public polarBackboneContacts() source
import {polarBackboneContacts} from 'ngl/src/geometry/contact-utils.js'
public projectPointOnVector() source
import {projectPointOnVector} from 'ngl/src/math/vector-utils.js'
public quicksortIP(arr: TypedArray, eleSize: Integer, orderElement: Integer, begin: Integer, end: Integer): TypedArray source
import {quicksortIP} from 'ngl/src/math/array-utils.js'
quicksortIP
Params:
Name | Type | Attribute | Description |
arr | TypedArray | array to be sorted |
|
eleSize | Integer | element size |
|
orderElement | Integer | index of element used for sorting, < eleSize |
|
begin | Integer |
|
start index for range to be sorted |
end | Integer |
|
end index for range to be sorted |
Example:
points: [x, y, z, x, y, z, x, y, z, ...]
eleSize: 3 //because of (x, y, z)
orderElement: 0 //order according to x
public replicateArray3Entries() source
import {replicateArray3Entries} from 'ngl/src/math/array-utils.js'
public setSupportsReadPixelsFloat() source
import {setSupportsReadPixelsFloat} from 'ngl/src/globals.js'
public sortProjectedPosition() source
import {sortProjectedPosition} from 'ngl/src/viewer/viewer-utils.js'
public superpose(s1: Structure | StructureView, s2: Structure | StructureView, align: Boolean, sele1: String, sele2: String): undefined source
import {superpose} from 'ngl/src/align/align-utils.js'
Perform structural superposition of two structures, optionally guided by a sequence alignment
Params:
Name | Type | Attribute | Description |
s1 | Structure | StructureView | structure 1 which is superposed onto structure 2 |
|
s2 | Structure | StructureView | structure 2 onto which structure 1 is superposed |
|
align | Boolean |
|
guide the superposition by a sequence alignment |
sele1 | String |
|
selection string for structure 1 |
sele2 | String |
|
selection string for structure 2 |
public testTextureSupport() source
import {testTextureSupport} from 'ngl/src/viewer/viewer-utils.js'
public updateMaterialUniforms() source
import {updateMaterialUniforms} from 'ngl/src/viewer/viewer-utils.js'
Static Private
private StructureBuilder() source
import StructureBuilder from 'ngl/src/structure/structure-builder.js'