Browse Source

Merge branch 'master' of https://github.com/molstar/molstar into pr/corredD/252

Alexander Rose 3 years ago
parent
commit
bf67546a61
100 changed files with 391 additions and 379 deletions
  1. 15 2
      .eslintrc.json
  2. 1 1
      src/apps/docking-viewer/viewport.tsx
  3. 1 1
      src/cli/chem-comp-dict/create-table.ts
  4. 1 1
      src/cli/cifschema/util/cif-dic.ts
  5. 3 3
      src/cli/cifschema/util/generate.ts
  6. 1 1
      src/cli/cifschema/util/schema.ts
  7. 1 1
      src/examples/domain-annotation-server/mapping.ts
  8. 1 1
      src/examples/proteopedia-wrapper/index.ts
  9. 5 5
      src/extensions/anvil/algorithm.ts
  10. 1 1
      src/extensions/anvil/behavior.ts
  11. 3 3
      src/extensions/cellpack/curve.ts
  12. 2 2
      src/extensions/cellpack/data.ts
  13. 26 27
      src/extensions/cellpack/model.ts
  14. 3 3
      src/extensions/cellpack/state.ts
  15. 1 1
      src/extensions/cellpack/util.ts
  16. 2 2
      src/extensions/dnatco/confal-pyramids/behavior.ts
  17. 1 1
      src/extensions/dnatco/confal-pyramids/color.ts
  18. 1 1
      src/extensions/dnatco/confal-pyramids/util.ts
  19. 1 1
      src/extensions/g3d/model.ts
  20. 1 1
      src/extensions/pdbe/preferred-assembly.ts
  21. 1 1
      src/extensions/pdbe/structure-quality-report/color.ts
  22. 1 1
      src/extensions/rcsb/assembly-symmetry/behavior.ts
  23. 1 1
      src/extensions/rcsb/assembly-symmetry/representation.ts
  24. 1 1
      src/extensions/rcsb/assembly-symmetry/ui.tsx
  25. 1 1
      src/extensions/rcsb/validation-report/prop.ts
  26. 2 2
      src/extensions/rcsb/validation-report/representation.ts
  27. 1 1
      src/mol-canvas3d/camera.ts
  28. 2 2
      src/mol-canvas3d/camera/util.ts
  29. 1 1
      src/mol-canvas3d/helper/bounding-sphere-helper.ts
  30. 2 2
      src/mol-canvas3d/passes/draw.ts
  31. 1 1
      src/mol-canvas3d/util.ts
  32. 1 1
      src/mol-data/generic/_spec/linked-list.spec.ts
  33. 1 1
      src/mol-data/int/impl/sorted-array.ts
  34. 1 1
      src/mol-data/int/tuple.ts
  35. 5 5
      src/mol-data/util/_spec/chunked-array.spec.ts
  36. 3 3
      src/mol-geo/geometry/mesh/mesh-builder.ts
  37. 4 4
      src/mol-geo/geometry/text/font-atlas.ts
  38. 2 2
      src/mol-geo/geometry/text/text-builder.ts
  39. 7 7
      src/mol-geo/primitive/box.ts
  40. 20 20
      src/mol-geo/primitive/dodecahedron.ts
  41. 10 10
      src/mol-geo/primitive/icosahedron.ts
  42. 10 10
      src/mol-geo/primitive/octahedron.ts
  43. 1 1
      src/mol-geo/primitive/plane.ts
  44. 2 2
      src/mol-geo/primitive/pyramid.ts
  45. 1 1
      src/mol-geo/primitive/sphere.ts
  46. 4 4
      src/mol-geo/primitive/tetrahedron.ts
  47. 5 5
      src/mol-geo/util.ts
  48. 2 2
      src/mol-geo/util/location-iterator.ts
  49. 30 30
      src/mol-gl/_spec/gl.shim.ts
  50. 1 1
      src/mol-gl/compute/marching-cubes/tables.ts
  51. 2 2
      src/mol-gl/compute/util.ts
  52. 1 1
      src/mol-gl/renderable/util.ts
  53. 1 1
      src/mol-gl/shader-code.ts
  54. 1 1
      src/mol-gl/webgl/compat.ts
  55. 8 8
      src/mol-gl/webgl/context.ts
  56. 1 1
      src/mol-gl/webgl/renderbuffer.ts
  57. 1 1
      src/mol-gl/webgl/texture.ts
  58. 9 9
      src/mol-gl/webgl/uniform.ts
  59. 2 2
      src/mol-io/common/binary-cif/decoder.ts
  60. 1 1
      src/mol-io/reader/_spec/mol.spec.ts
  61. 3 3
      src/mol-io/reader/_spec/mol2.spec.ts
  62. 1 1
      src/mol-io/reader/_spec/sdf.spec.ts
  63. 2 2
      src/mol-io/reader/cif/schema.ts
  64. 3 3
      src/mol-io/reader/cif/text/parser.ts
  65. 2 2
      src/mol-io/reader/common/text/column/token.ts
  66. 2 2
      src/mol-io/reader/common/text/tokenizer.ts
  67. 12 12
      src/mol-io/reader/csv/parser.ts
  68. 3 3
      src/mol-io/reader/psf/parser.ts
  69. 3 3
      src/mol-io/writer/cif/encoder.ts
  70. 1 1
      src/mol-io/writer/cif/encoder/text.ts
  71. 1 1
      src/mol-io/writer/ligand-encoder.ts
  72. 2 2
      src/mol-math/approx.ts
  73. 1 1
      src/mol-math/geometry/gaussian-density.ts
  74. 1 1
      src/mol-math/geometry/gaussian-density/cpu.ts
  75. 2 2
      src/mol-math/geometry/gaussian-density/gpu.ts
  76. 4 4
      src/mol-math/geometry/molecular-surface.ts
  77. 1 1
      src/mol-math/geometry/spacegroup/construction.ts
  78. 33 33
      src/mol-math/geometry/spacegroup/tables.ts
  79. 11 11
      src/mol-math/interpolate.ts
  80. 5 5
      src/mol-math/linear-algebra/3d/quat.ts
  81. 3 3
      src/mol-math/linear-algebra/matrix/evd.ts
  82. 5 5
      src/mol-math/misc.ts
  83. 1 1
      src/mol-model-formats/shape/ply.ts
  84. 1 1
      src/mol-model-formats/structure/basic/properties.ts
  85. 1 1
      src/mol-model-formats/structure/cif-core.ts
  86. 3 3
      src/mol-model-formats/structure/common/component.ts
  87. 1 1
      src/mol-model-formats/structure/common/util.ts
  88. 6 6
      src/mol-model-formats/structure/util.ts
  89. 1 1
      src/mol-model-props/computed/accessible-surface-area/shrake-rupley/common.ts
  90. 1 1
      src/mol-model-props/computed/accessible-surface-area/shrake-rupley/radii.ts
  91. 7 7
      src/mol-model-props/computed/chemistry/functional-group.ts
  92. 3 3
      src/mol-model-props/computed/chemistry/geometry.ts
  93. 3 3
      src/mol-model-props/computed/chemistry/valence-model.ts
  94. 2 2
      src/mol-model-props/computed/interactions/charged.ts
  95. 1 1
      src/mol-model-props/computed/interactions/halogen-bonds.ts
  96. 2 2
      src/mol-model-props/computed/interactions/hydrogen-bonds.ts
  97. 2 2
      src/mol-model/loci.ts
  98. 8 8
      src/mol-model/sequence/alignment/alignment.ts
  99. 22 22
      src/mol-model/sequence/alignment/substitution-matrix.ts
  100. 3 3
      src/mol-model/sequence/constants.ts

+ 15 - 2
.eslintrc.json

@@ -48,7 +48,13 @@
         "prefer-const": ["error", {
             "destructuring": "all",
             "ignoreReadBeforeAssign": false
-        }]
+        }],
+        "space-before-function-paren": "off",
+        "func-call-spacing": "off",
+        "no-multi-spaces": "error",
+        "block-spacing": "error",
+        "keyword-spacing": "off",
+        "space-before-blocks": "error"
     },
     "overrides": [
         {
@@ -99,7 +105,14 @@
                     "error",
                     "1tbs", { "allowSingleLine": true }
                 ],
-                "@typescript-eslint/comma-spacing": "error"
+                "@typescript-eslint/comma-spacing": "error",
+                "@typescript-eslint/space-before-function-paren": ["error", {
+                    "anonymous": "always",
+                    "named": "never",
+                    "asyncArrow": "always"
+                }],
+                "@typescript-eslint/func-call-spacing": ["error"],
+                "@typescript-eslint/keyword-spacing": ["error"]
             }
         }
     ]

+ 1 - 1
src/apps/docking-viewer/viewport.tsx

@@ -238,7 +238,7 @@ export class ViewportComponent extends PluginUIComponent {
     pocketPreset = () => this.set(PocketPreset);
     interactionsPreset = () => this.set(InteractionsPreset);
 
-    get showButtons () {
+    get showButtons() {
         return this.plugin.config.get(ShowButtons);
     }
 

+ 1 - 1
src/cli/chem-comp-dict/create-table.ts

@@ -171,7 +171,7 @@ async function createBonds(
         pdbx_aromatic_flag, pdbx_stereo_config, molstar_protonation_variant
     });
 
-    const bondDatabase =  Database.ofTables(
+    const bondDatabase = Database.ofTables(
         CCB_TABLE_NAME,
         { chem_comp_bond: mmCIF_chemCompBond_schema },
         { chem_comp_bond: bondTable }

+ 1 - 1
src/cli/cifschema/util/cif-dic.ts

@@ -316,7 +316,7 @@ export function generateSchema(frames: CifFrame[], imports: Imports = new Map())
     frames.forEach(d => {
         // category definitions in mmCIF start with '_' and don't include a '.'
         // category definitions in cifCore don't include a '.'
-        if (d.header[0] === '_'  || d.header.includes('.')) return;
+        if (d.header[0] === '_' || d.header.includes('.')) return;
         const categoryName = d.header.toLowerCase();
         // console.log(d.header, d.categoryNames, d.categories)
         let descriptionField: Data.CifField | undefined;

+ 3 - 3
src/cli/cifschema/util/generate.ts

@@ -8,7 +8,7 @@ import { Database, Filter, Column } from './schema';
 import { indentString } from '../../../mol-util/string';
 import { FieldPath } from '../../../mol-io/reader/cif/schema';
 
-function header (name: string, info: string, moldataImportPath: string) {
+function header(name: string, info: string, moldataImportPath: string) {
     return `/**
  * Copyright (c) 2017-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
  *
@@ -22,7 +22,7 @@ import { Database, Column } from '${moldataImportPath}/db';
 import Schema = Column.Schema;`;
 }
 
-function footer (name: string) {
+function footer(name: string) {
     return `
 export type ${name}_Schema = typeof ${name}_Schema;
 export interface ${name}_Database extends Database<${name}_Schema> {};`;
@@ -89,7 +89,7 @@ function doc(description: string, spacesCount: number) {
     ].join('\n');
 }
 
-export function generate (name: string, info: string, schema: Database, fields: Filter | undefined, moldataImportPath: string, addAliases: boolean) {
+export function generate(name: string, info: string, schema: Database, fields: Filter | undefined, moldataImportPath: string, addAliases: boolean) {
     const codeLines: string[] = [];
 
     if (fields) {

+ 1 - 1
src/cli/cifschema/util/schema.ts

@@ -51,7 +51,7 @@ export function ListCol(subType: 'int' | 'str' | 'float' | 'coord', separator: s
 
 export type Filter = { [ table: string ]: { [ column: string ]: true } }
 
-export function mergeFilters (...filters: Filter[]) {
+export function mergeFilters(...filters: Filter[]) {
     const n = filters.length;
     const mergedFilter: Filter = {};
     const fields: Map<string, number> = new Map();

+ 1 - 1
src/examples/domain-annotation-server/mapping.ts

@@ -38,7 +38,7 @@ type MappingRow = Table.Row<S.mapping>;
 
 function writeDomain(enc: CifWriter.Encoder, domain: DomainAnnotation | undefined) {
     if (!domain) return;
-    enc.writeCategory({ name: `pdbx_${domain.name}_domain_annotation`, instance: () =>  CifWriter.Category.ofTable(domain.domains) });
+    enc.writeCategory({ name: `pdbx_${domain.name}_domain_annotation`, instance: () => CifWriter.Category.ofTable(domain.domains) });
     enc.writeCategory({ name: `pdbx_${domain.name}_domain_mapping`, instance: () => CifWriter.Category.ofTable(domain.mappings) });
 }
 

+ 1 - 1
src/examples/proteopedia-wrapper/index.ts

@@ -250,7 +250,7 @@ class MolStarProteopediaWrapper {
     setBackground(color: number) {
         if (!this.plugin.canvas3d) return;
         const renderer = this.plugin.canvas3d.props.renderer;
-        PluginCommands.Canvas3D.SetSettings(this.plugin, { settings: { renderer: { ...renderer,  backgroundColor: Color(color) } } });
+        PluginCommands.Canvas3D.SetSettings(this.plugin, { settings: { renderer: { ...renderer, backgroundColor: Color(color) } } });
     }
 
     toggleSpin() {

+ 5 - 5
src/extensions/anvil/algorithm.ts

@@ -183,7 +183,7 @@ export async function calculate(runtime: RuntimeContext, structure: Structure, p
     }
 
     const normalVector = v3zero();
-    const center =  v3zero();
+    const center = v3zero();
     v3sub(normalVector, membrane.planePoint1, membrane.planePoint2);
     v3normalize(normalVector, normalVector);
 
@@ -404,7 +404,7 @@ function membraneSegments(ctx: ANVILContext, membrane: MembraneCandidate): Array
                 }
                 lastAuthSeqId = authSeqId;
                 endOffset = k;
-            } else  {
+            } else {
                 lastAuthSeqId++;
                 endOffset++;
             }
@@ -476,11 +476,11 @@ function adjustExtent(ctx: ANVILContext, membrane: MembraneCandidate, centroid:
 }
 
 function qValue(currentStats: HphobHphil, initialStats: HphobHphil): number {
-    if(initialStats.hphob < 1) {
+    if (initialStats.hphob < 1) {
         initialStats.hphob = 0.1;
     }
 
-    if(initialStats.hphil < 1) {
+    if (initialStats.hphil < 1) {
         initialStats.hphil += 1;
     }
 
@@ -505,7 +505,7 @@ function generateSpherePoints(ctx: ANVILContext, numberOfSpherePoints: number):
     const { centroid, extent } = ctx;
     const points = [];
     let oldPhi = 0, h, theta, phi;
-    for(let k = 1, kl = numberOfSpherePoints + 1; k < kl; k++) {
+    for (let k = 1, kl = numberOfSpherePoints + 1; k < kl; k++) {
         h = -1 + 2 * (k - 1) / (2 * numberOfSpherePoints - 1);
         theta = Math.acos(h);
         phi = (k === 1 || k === numberOfSpherePoints) ? 0 : (oldPhi + 3.6 / Math.sqrt(2 * numberOfSpherePoints * (1 - h * h))) % (2 * Math.PI);

+ 1 - 1
src/extensions/anvil/behavior.ts

@@ -150,7 +150,7 @@ export const MembraneOrientationPreset = StructureRepresentationPresetProvider({
     params: () => StructureRepresentationPresetProvider.CommonParams,
     async apply(ref, params, plugin) {
         const structureCell = StateObjectRef.resolveAndCheck(plugin.state.data, ref);
-        const structure  = structureCell?.obj?.data;
+        const structure = structureCell?.obj?.data;
         if (!structureCell || !structure) return {};
 
         if (!MembraneOrientationProvider.get(structure).value) {

+ 3 - 3
src/extensions/cellpack/curve.ts

@@ -111,7 +111,7 @@ function GetSmoothNormals(points: Vec3[]) {
     let p1 = points[1];
     let p2 = points[2];
     const p21 = Vec3.sub(tmpV1, p2, p1);
-    const p01 =  Vec3.sub(tmpV2, p0, p1);
+    const p01 = Vec3.sub(tmpV2, p0, p1);
     const p0121 = Vec3.cross(tmpV3, p01, p21);
     Vec3.normalize(prevV, p0121);
     smoothNormals.push(Vec3.clone(prevV));
@@ -179,7 +179,7 @@ function GetMiniFrame(points: Vec3[], normals: Vec3[]) {
         const v1t = Vec3.scale(mfTmpV5, v1, (2.0 / c1) * Vec3.dot(v1, frames[i].t));
         const tan_L_i = Vec3.sub(mfTmpV6, frames[i].t, v1t);
         // # compute reflection vector of R_2
-        const v2 =  Vec3.sub(mfTmpV7, t2, tan_L_i);
+        const v2 = Vec3.sub(mfTmpV7, t2, tan_L_i);
         const c2 = Vec3.dot(v2, v2);
         // compute r_(i+1) = R_2 * r_i^L
         const v2l = Vec3.scale(mfTmpV8, v1, (2.0 / c2) * Vec3.dot(v2, ref_L_i));
@@ -195,7 +195,7 @@ export function getMatFromResamplePoints(points: NumberArray, segmentLength: num
     let new_points: Vec3[] = [];
     if (resample) new_points = ResampleControlPoints(points, segmentLength);
     else {
-        for (let idx = 0; idx < points.length / 3; ++idx){
+        for (let idx = 0; idx < points.length / 3; ++idx) {
             new_points.push(Vec3.fromArray(Vec3.zero(), points, idx * 3));
         }
     }

+ 2 - 2
src/extensions/cellpack/data.ts

@@ -93,9 +93,9 @@ export interface Ingredient {
 
 export interface IngredientSource {
     pdb: string;
-    bu?: string;  /** biological unit e.g AU,BU1,etc.. */
+    bu?: string; /** biological unit e.g AU,BU1,etc.. */
     selection?: string; /** NGL selection or :A or :B etc.. */
-    model?: string;     /** model number e.g 0,1,2... */
+    model?: string; /** model number e.g 0,1,2... */
     transform: {
         center: boolean;
         translate?: Vec3;

+ 26 - 27
src/extensions/cellpack/model.ts

@@ -73,7 +73,7 @@ async function getModel(plugin: PluginContext, id: string, ingredient: Ingredien
                 throw new Error(`unsupported file type '${file.name}'`);
             }
         } else if (id.match(/^[1-9][a-zA-Z0-9]{3,3}$/i)) {
-            if (surface){
+            if (surface) {
                 try {
                     const data = await getFromOPM(plugin, id, assetManager);
                     assets.push(data.asset);
@@ -114,11 +114,10 @@ async function getStructure(plugin: PluginContext, model: Model, source: Ingredi
         structure = await plugin.runTask(StructureSymmetry.buildAssembly(structure, assembly));
     }
     let query;
-    if (source.source.selection){
-        let sel: any = source.source.selection;
+    if (source.source.selection) {
+        const sel = source.source.selection;
         // selection can have the model ID as well. remove it
-        const asymIds: string[] = sel.replaceAll(' ', '').replaceAll(':', '').split('or').slice(1);
-        // console.log("selection is ", source.selection, asymIds);
+        const asymIds: string[] = sel.replace(/ /g, '').replace(/:/g, '').split('or').slice(1);
         query = MS.struct.modifier.union([
             MS.struct.generator.atomGroups({
                 'chain-test': MS.core.set.has([MS.set(...asymIds), MS.ammp('auth_asym_id')])
@@ -165,9 +164,9 @@ function getCurveTransforms(ingredient: Ingredient) {
     const n = ingredient.nbCurve || 0;
     const instances: Mat4[] = [];
     let segmentLength = 3.4;
-    if (ingredient.uLength){
+    if (ingredient.uLength) {
         segmentLength = ingredient.uLength;
-    } else if (ingredient.radii){
+    } else if (ingredient.radii) {
         segmentLength = ingredient.radii[0].radii
             ? ingredient.radii[0].radii[0] * 2.0
             : 3.4;
@@ -339,9 +338,9 @@ async function getIngredientStructure(plugin: PluginContext, ingredient: Ingredi
     if (nbCurve) {
         structure = await getCurve(plugin, name, ingredient, getCurveTransforms(ingredient), model);
     } else {
-        if ( (!results || results.length === 0)) return;
+        if ((!results || results.length === 0)) return;
         let bu: string|undefined = source.bu ? source.bu : undefined;
-        if (bu){
+        if (bu) {
             if (bu === 'AU') {
                 bu = undefined;
             } else {
@@ -351,18 +350,18 @@ async function getIngredientStructure(plugin: PluginContext, ingredient: Ingredi
         structure = await getStructure(plugin, model, ingredient, { assembly: bu });
         // transform with offset and pcp
         let legacy: boolean = true;
-        let pcp = ingredient.principalVector ? ingredient.principalVector : ingredient.principalAxis;
-        if (pcp){
+        const pcp = ingredient.principalVector ? ingredient.principalVector : ingredient.principalAxis;
+        if (pcp) {
             legacy = false;
             const structureMean = getStructureMean(structure);
             Vec3.negate(structureMean, structureMean);
             const m1: Mat4 = Mat4.identity();
             Mat4.setTranslation(m1, structureMean);
             structure = Structure.transform(structure, m1);
-            if (ingredient.offset){
-                let o: Vec3 = Vec3.create(ingredient.offset[0], ingredient.offset[1], ingredient.offset[2]);
-                if (!Vec3.exactEquals(o, Vec3.zero())){ // -1, 1, 4e-16 ??
-                    if (location !== 'surface'){
+            if (ingredient.offset) {
+                const o: Vec3 = Vec3.create(ingredient.offset[0], ingredient.offset[1], ingredient.offset[2]);
+                if (!Vec3.exactEquals(o, Vec3.zero())) { // -1, 1, 4e-16 ??
+                    if (location !== 'surface') {
                         Vec3.negate(o, o);
                     }
                     const m: Mat4 = Mat4.identity();
@@ -370,9 +369,9 @@ async function getIngredientStructure(plugin: PluginContext, ingredient: Ingredi
                     structure = Structure.transform(structure, m);
                 }
             }
-            if (pcp){
-                let p: Vec3 = Vec3.create(pcp[0], pcp[1], pcp[2]);
-                if (!Vec3.exactEquals(p, Vec3.unitZ)){
+            if (pcp) {
+                const p: Vec3 = Vec3.create(pcp[0], pcp[1], pcp[2]);
+                if (!Vec3.exactEquals(p, Vec3.unitZ)) {
                     const q: Quat = Quat.identity();
                     Quat.rotationTo(q, p, Vec3.unitZ);
                     const m: Mat4 = Mat4.fromQuat(Mat4.zero(), q);
@@ -402,7 +401,7 @@ export function createStructureFromCellPack(plugin: PluginContext, packing: Cell
                 structures.push(ingredientStructure.structure);
                 assets.push(...ingredientStructure.assets);
                 const c = ingredients[iName].color;
-                if (c){
+                if (c) {
                     colors.push(Color.fromNormalizedRgb(c[0], c[1], c[2]));
                 } else {
                     colors.push(Color.fromNormalizedRgb(1, 0, 0));
@@ -429,8 +428,8 @@ export function createStructureFromCellPack(plugin: PluginContext, packing: Cell
         }
 
         if (ctx.shouldUpdate) await ctx.update(`${name} - structure`);
-        const structure = Structure.create(units, {label: name + '.' + location});
-        for(let i = 0, il = structure.models.length; i < il; ++i) {
+        const structure = Structure.create(units, { label: name + '.' + location });
+        for (let i = 0, il = structure.models.length; i < il; ++i) {
             Model.TrajectoryInfo.set(structure.models[i], { size: il, index: i });
         }
         return { structure, assets, colors: colors };
@@ -468,7 +467,7 @@ async function loadMembrane(plugin: PluginContext, name: string, state: State, p
                 break;
             }
         }
-        if (!file){
+        if (!file) {
             // check for cif directly
             const cifileName = `${name}.cif`;
             for (const f of params.ingredients) {
@@ -506,7 +505,7 @@ async function loadMembrane(plugin: PluginContext, name: string, state: State, p
             params: { id: '1' }
         }
     };
-    if ( legacy_membrane ){
+    if (legacy_membrane) {
         // old membrane
         const membrane = await b.apply(StateTransforms.Data.ParseCif, undefined, { state: { isGhost: true } })
             .apply(StateTransforms.Model.TrajectoryFromMmCif, undefined, { state: { isGhost: true } })
@@ -611,9 +610,9 @@ async function loadPackings(plugin: PluginContext, runtime: RuntimeContext, stat
         await CellpackPackingPreset.apply(packing, packingParams, plugin);
         if (packings[i].location === 'surface') {
             console.log('ok surface ' + params.membrane);
-            if (params.membrane === 'lipids'){
+            if (params.membrane === 'lipids') {
                 console.log('ok packings[i].geom_type ' + packings[i].geom_type);
-                if (packings[i].geom_type){
+                if (packings[i].geom_type) {
                     if (packings[i].geom_type === 'file') {
                         await loadMembrane(plugin, packings[i].geom!, state, params);
                     } else if (packings[i].mb) {
@@ -625,7 +624,7 @@ async function loadPackings(plugin: PluginContext, runtime: RuntimeContext, stat
                         await loadMembrane(plugin, packings[i].name, state, params);
                     }
                 }
-            } else if (params.membrane === 'spheres'){
+            } else if (params.membrane === 'spheres') {
                 if (packings[i].mb) {
                     await handleMembraneSpheres(state, packings[i].mb!);
                 }
@@ -649,7 +648,7 @@ const LoadCellPackModelParams = {
         'file': PD.File({ accept: '.json,.cpr,.zip', description: 'Open model definition from .json/.cpr file or open .zip file containing model definition plus ingredients.', label: 'Recipe file' }),
     }, { options: [['id', 'Id'], ['file', 'File']] }),
     baseUrl: PD.Text(DefaultCellPackBaseUrl),
-    results : PD.File({ accept: '.bin', description: 'open results file in binary format from cellpackgpu for the specified recipe', label: 'Results file'}),
+    results: PD.File({ accept: '.bin', description: 'open results file in binary format from cellpackgpu for the specified recipe', label: 'Results file' }),
     membrane: PD.Select('lipids', PD.arrayToOptions(['lipids', 'spheres', 'none'])),
     ingredients: PD.FileList({ accept: '.cif,.bcif,.pdb', label: 'Ingredient files' }),
     preset: PD.Group({

+ 3 - 3
src/extensions/cellpack/state.ts

@@ -230,7 +230,7 @@ const StructureFromCellpack = PluginStateTransform.BuiltIn({
     },
     dispose({ b, cache }) {
         const assets = (cache as any).assets as Asset.Wrapper[];
-        if(assets) {
+        if (assets) {
             for (const a of assets) a.dispose();
         }
 
@@ -266,7 +266,7 @@ const StructureFromAssemblies = PluginStateTransform.BuiltIn({
             let structure: Structure = initial_structure;
             // the list of asambly *?
             const symmetry = ModelSymmetry.Provider.get(model);
-            if (symmetry && symmetry.assemblies.length !== 0){
+            if (symmetry && symmetry.assemblies.length !== 0) {
                 for (const a of symmetry.assemblies) {
                     const s = await StructureSymmetry.buildAssembly(initial_structure, a.id).runInContext(ctx);
                     structures.push(s);
@@ -283,7 +283,7 @@ const StructureFromAssemblies = PluginStateTransform.BuiltIn({
                     offsetInvariantId += maxInvariantId + 1;
                 }
                 structure = builder.getStructure();
-                for(let i = 0, il = structure.models.length; i < il; ++i) {
+                for (let i = 0, il = structure.models.length; i < il; ++i) {
                     Model.TrajectoryInfo.set(structure.models[i], { size: il, index: i });
                 }
             }

+ 1 - 1
src/extensions/cellpack/util.ts

@@ -43,7 +43,7 @@ export async function getFromPdb(plugin: PluginContext, pdbId: string, assetMana
     return { mmcif: cif.blocks[0], asset };
 }
 
-export async function getFromOPM(plugin: PluginContext, pdbId: string, assetManager: AssetManager){
+export async function getFromOPM(plugin: PluginContext, pdbId: string, assetManager: AssetManager) {
     const asset = await plugin.runTask(assetManager.resolve(Asset.getUrlAsset(assetManager, `https://opm-assets.storage.googleapis.com/pdb/${pdbId.toLowerCase()}.pdb`), 'string'));
     return { pdb: await parsePDBfile(plugin, asset.data, pdbId), asset };
 }

+ 2 - 2
src/extensions/dnatco/confal-pyramids/behavior.ts

@@ -41,10 +41,10 @@ export const DnatcoConfalPyramidsPreset = StructureRepresentationPresetProvider(
 
         let pyramidsRepr;
         if (representations)
-            pyramidsRepr = builder.buildRepresentation(update, pyramids,  { type: ConfalPyramidsRepresentationProvider, typeParams, color: ConfalPyramidsColorThemeProvider }, { tag: 'confal-pyramdis' });
+            pyramidsRepr = builder.buildRepresentation(update, pyramids, { type: ConfalPyramidsRepresentationProvider, typeParams, color: ConfalPyramidsColorThemeProvider }, { tag: 'confal-pyramdis' });
 
         await update.commit({ revertOnError: true });
-        return  { components: { ...components, pyramids }, representations: { ...representations, pyramidsRepr } };
+        return { components: { ...components, pyramids }, representations: { ...representations, pyramidsRepr } };
     }
 });
 

+ 1 - 1
src/extensions/dnatco/confal-pyramids/color.ts

@@ -27,7 +27,7 @@ const ColorMapping: ReadonlyMap<ConformerClasses, Color> = new Map([
     ['B', Color(0xC8CFFF)],
     ['BII', Color(0x0059DA)],
     ['miB', Color(0x3BE8FB)],
-    ['Z',  Color(0x01F60E)],
+    ['Z', Color(0x01F60E)],
     ['IC', Color(0xFA5CFB)],
     ['OPN', Color(0xE90000)],
     ['SYN', Color(0xFFFF01)],

+ 1 - 1
src/extensions/dnatco/confal-pyramids/util.ts

@@ -95,7 +95,7 @@ export namespace ConfalPyramidsUtil {
             const first = residueInfoFromLocation(locFirst);
             const second = residueInfoFromLocation(locSecond);
             const model_id = this.hasMultipleModels ? `-m${modelNum}` : '';
-            const alt_id_1 =  fakeAltId_1 !== '' ? `.${fakeAltId_1}` : (first.alt_id.length ? `.${first.alt_id}` : '');
+            const alt_id_1 = fakeAltId_1 !== '' ? `.${fakeAltId_1}` : (first.alt_id.length ? `.${first.alt_id}` : '');
             const alt_id_2 = fakeAltId_2 !== '' ? `.${fakeAltId_2}` : (second.alt_id.length ? `.${second.alt_id}` : '');
             const ins_code_1 = first.ins_code.length ? `.${first.ins_code}` : '';
             const ins_code_2 = second.ins_code.length ? `.${second.ins_code}` : '';

+ 1 - 1
src/extensions/g3d/model.ts

@@ -61,7 +61,7 @@ function getColumns(block: G3dDataBlock) {
     objectForEach(data, (hs, h) => {
         objectForEach(hs, (chs, ch) => {
             const entity_id = `${ch}-${h}`;
-            const l =  chs.start.length;
+            const l = chs.start.length;
             if (l === 0) return;
 
             let x = chs.x[0];

+ 1 - 1
src/extensions/pdbe/preferred-assembly.ts

@@ -62,7 +62,7 @@ export namespace PDBePreferredAssembly {
         if (model.customProperties.has(Descriptor)) return true;
 
         let asmName: string | undefined = fromCifData(model);
-        if (asmName === void 0 &&  params.PDBe_apiSourceJson) {
+        if (asmName === void 0 && params.PDBe_apiSourceJson) {
             const data = await params.PDBe_apiSourceJson(model);
             if (!data) return false;
             asmName = asmNameFromJson(model, data);

+ 1 - 1
src/extensions/pdbe/structure-quality-report/color.ts

@@ -87,7 +87,7 @@ export function StructureQualityReportColorTheme(ctx: ThemeDataContext, props: P
     };
 }
 
-export const StructureQualityReportColorThemeProvider: ColorTheme.Provider<Params, 'pdbe-structure-quality-report'> =  {
+export const StructureQualityReportColorThemeProvider: ColorTheme.Provider<Params, 'pdbe-structure-quality-report'> = {
     name: 'pdbe-structure-quality-report',
     label: 'Structure Quality Report',
     category: ColorTheme.Category.Validation,

+ 1 - 1
src/extensions/rcsb/assembly-symmetry/behavior.ts

@@ -85,7 +85,7 @@ export const InitAssemblySymmetry3D = StateAction.build({
         const assemblySymmetryData = AssemblySymmetryDataProvider.get(a.data).value;
         const symmetryIndex = assemblySymmetryData ? AssemblySymmetry.firstNonC1(assemblySymmetryData) : -1;
         await AssemblySymmetryProvider.attach(propCtx, a.data, { symmetryIndex });
-    } catch(e) {
+    } catch (e) {
         plugin.log.error(`Assembly Symmetry: ${e}`);
         return;
     }

+ 1 - 1
src/extensions/rcsb/assembly-symmetry/representation.ts

@@ -310,7 +310,7 @@ function setSymbolTransform(t: Mat4, symbol: string, axes: AssemblySymmetry.Rota
     }
 }
 
-const unitCircleDirections = (function() {
+const unitCircleDirections = (function () {
     const dirs: Vec3[] = [];
     const circle = polygon(12, false, 1);
     for (let i = 0, il = circle.length; i < il; i += 3) {

+ 1 - 1
src/extensions/rcsb/assembly-symmetry/ui.tsx

@@ -7,7 +7,7 @@
 import { CollapsableState, CollapsableControls } from '../../../mol-plugin-ui/base';
 import { ApplyActionControl } from '../../../mol-plugin-ui/state/apply-action';
 import { InitAssemblySymmetry3D, AssemblySymmetry3D, AssemblySymmetryPreset, tryCreateAssemblySymmetry } from './behavior';
-import { AssemblySymmetryProvider,  AssemblySymmetryProps, AssemblySymmetryDataProvider, AssemblySymmetry } from './prop';
+import { AssemblySymmetryProvider, AssemblySymmetryProps, AssemblySymmetryDataProvider, AssemblySymmetry } from './prop';
 import { ParameterControls } from '../../../mol-plugin-ui/controls/parameters';
 import { ParamDefinition as PD } from '../../../mol-util/param-definition';
 import { StructureHierarchyManager } from '../../../mol-plugin-state/manager/structure/hierarchy';

+ 1 - 1
src/extensions/rcsb/validation-report/prop.ts

@@ -112,7 +112,7 @@ namespace ValidationReport {
     }
 
     export async function obtain(ctx: CustomProperty.Context, model: Model, props: ValidationReportProps): Promise<CustomProperty.Data<ValidationReport>> {
-        switch(props.source.name) {
+        switch (props.source.name) {
             case 'file': return open(ctx, model, props.source.params);
             case 'server': return fetch(ctx, model, props.source.params);
         }

+ 2 - 2
src/extensions/rcsb/validation-report/representation.ts

@@ -107,7 +107,7 @@ function getIntraClashLabel(structure: Structure, unit: Unit.Atomic, clashes: In
 
 function IntraClashLoci(structure: Structure, unit: Unit.Atomic, clashes: IntraUnitClashes, elements: number[]) {
     return DataLoci('intra-clashes', { unit, clashes }, elements,
-        (boundingSphere: Sphere3D) =>  getIntraClashBoundingSphere(unit, clashes, elements, boundingSphere),
+        (boundingSphere: Sphere3D) => getIntraClashBoundingSphere(unit, clashes, elements, boundingSphere),
         () => getIntraClashLabel(structure, unit, clashes, elements));
 }
 
@@ -226,7 +226,7 @@ function getInterClashLabel(structure: Structure, clashes: InterUnitClashes, ele
 
 function InterClashLoci(structure: Structure, clashes: InterUnitClashes, elements: number[]) {
     return DataLoci('inter-clashes', clashes, elements,
-        (boundingSphere: Sphere3D) =>  getInterClashBoundingSphere(structure, clashes, elements, boundingSphere),
+        (boundingSphere: Sphere3D) => getInterClashBoundingSphere(structure, clashes, elements, boundingSphere),
         () => getInterClashLabel(structure, clashes, elements));
 }
 

+ 1 - 1
src/mol-canvas3d/camera.ts

@@ -34,7 +34,7 @@ class Camera implements ICamera {
     readonly inverseProjectionView: Mat4 = Mat4.identity();
 
     private pixelScale: number
-    get pixelRatio () {
+    get pixelRatio() {
         const dpr = (typeof window !== 'undefined') ? window.devicePixelRatio : 1;
         return dpr * this.pixelScale;
     }

+ 2 - 2
src/mol-canvas3d/camera/util.ts

@@ -61,7 +61,7 @@ const FAR_RANGE = 1;
 const tmpVec4 = Vec4();
 
 /** Transform point into 2D window coordinates. */
-export function cameraProject (out: Vec4, point: Vec3, viewport: Viewport, projectionView: Mat4) {
+export function cameraProject(out: Vec4, point: Vec3, viewport: Viewport, projectionView: Mat4) {
     const { x: vX, y: vY, width: vWidth, height: vHeight } = viewport;
 
     // clip space -> NDC -> window coordinates, implicit 1.0 for w component
@@ -90,7 +90,7 @@ export function cameraProject (out: Vec4, point: Vec3, viewport: Viewport, proje
  * Transform point from screen space to 3D coordinates.
  * The point must have x and y set to 2D window coordinates and z between 0 (near) and 1 (far).
  */
-export function cameraUnproject (out: Vec3, point: Vec3, viewport: Viewport, inverseProjectionView: Mat4) {
+export function cameraUnproject(out: Vec3, point: Vec3, viewport: Viewport, inverseProjectionView: Mat4) {
     const { x: vX, y: vY, width: vWidth, height: vHeight } = viewport;
 
     const x = point[0] - vX;

+ 1 - 1
src/mol-canvas3d/helper/bounding-sphere-helper.ts

@@ -121,7 +121,7 @@ export class BoundingSphereHelper {
     }
     get props() { return this._props as Readonly<DebugHelperProps>; }
 
-    setProps (props: Partial<DebugHelperProps>) {
+    setProps(props: Partial<DebugHelperProps>) {
         Object.assign(this._props, props);
         if (this.isEnabled) this.update();
     }

+ 2 - 2
src/mol-canvas3d/passes/draw.ts

@@ -58,8 +58,8 @@ const CopySchema = {
     tColor: TextureSpec('texture', 'rgba', 'ubyte', 'nearest'),
     uTexSize: UniformSpec('v2'),
 };
-const  CopyShaderCode = ShaderCode('copy', quad_vert, copy_frag);
-type  CopyRenderable = ComputeRenderable<Values<typeof CopySchema>>
+const CopyShaderCode = ShaderCode('copy', quad_vert, copy_frag);
+type CopyRenderable = ComputeRenderable<Values<typeof CopySchema>>
 
 function getCopyRenderable(ctx: WebGLContext, colorTexture: Texture): CopyRenderable {
     const values: Values<typeof CopySchema> = {

+ 1 - 1
src/mol-canvas3d/util.ts

@@ -12,7 +12,7 @@ export function setCanvasSize(canvas: HTMLCanvasElement, width: number, height:
 }
 
 /** Resize canvas to container element taking `devicePixelRatio` into account */
-export function resizeCanvas (canvas: HTMLCanvasElement, container: HTMLElement, scale = 1) {
+export function resizeCanvas(canvas: HTMLCanvasElement, container: HTMLElement, scale = 1) {
     let width = window.innerWidth;
     let height = window.innerHeight;
     if (container !== document.body) {

+ 1 - 1
src/mol-data/generic/_spec/linked-list.spec.ts

@@ -33,7 +33,7 @@ describe('linked list', () => {
         expect(list.count).toBe(5);
     });
 
-    it ('remove', () => {
+    it('remove', () => {
         const list = create([1, 2, 3, 4]);
         const fst = list.removeFirst();
         expect(fst).toBe(1);

+ 1 - 1
src/mol-data/int/impl/sorted-array.ts

@@ -25,7 +25,7 @@ export function is(xs: any): xs is Nums { return xs && (Array.isArray(xs) || !!x
 export function isRange(xs: Nums) { return xs[xs.length - 1] - xs[0] + 1 === xs.length; }
 
 export function start(xs: Nums) { return xs[0]; }
-export function end(xs: Nums) { return xs[xs.length - 1] + 1;  }
+export function end(xs: Nums) { return xs[xs.length - 1] + 1; }
 export function min(xs: Nums) { return xs[0]; }
 export function max(xs: Nums) { return xs[xs.length - 1]; }
 export function size(xs: Nums) { return xs.length; }

+ 1 - 1
src/mol-data/int/tuple.ts

@@ -15,7 +15,7 @@ interface IntTuple { '@type': 'int-tuple' }
 namespace IntTuple {
     export const Zero: IntTuple = 0 as any;
 
-    const { _int32, _float64, _int32_1, _float64_1 } = (function() {
+    const { _int32, _float64, _int32_1, _float64_1 } = (function () {
         const data = new ArrayBuffer(8);
         const data_1 = new ArrayBuffer(8);
         return {

+ 5 - 5
src/mol-data/util/_spec/chunked-array.spec.ts

@@ -8,14 +8,14 @@ import { ChunkedArray } from '../chunked-array';
 
 describe('Chunked Array', () => {
     it('creation', () => {
-        const arr  = ChunkedArray.create<number, 2>(Array, 2, 2);
+        const arr = ChunkedArray.create<number, 2>(Array, 2, 2);
         ChunkedArray.add2(arr, 1, 2);
         ChunkedArray.add2(arr, 3, 4);
         expect(ChunkedArray.compact(arr)).toEqual([1, 2, 3, 4]);
     });
 
     it('initial', () => {
-        const arr  = ChunkedArray.create(Int32Array, 2, 6, new Int32Array([1, 2, 3, 4]));
+        const arr = ChunkedArray.create(Int32Array, 2, 6, new Int32Array([1, 2, 3, 4]));
         ChunkedArray.add2(arr, 4, 3);
         ChunkedArray.add2(arr, 2, 1);
         ChunkedArray.add2(arr, 5, 6);
@@ -23,13 +23,13 @@ describe('Chunked Array', () => {
     });
 
     it('add many', () => {
-        const arr  = ChunkedArray.create<number, 2>(Array, 2, 2);
+        const arr = ChunkedArray.create<number, 2>(Array, 2, 2);
         ChunkedArray.addMany(arr, [1, 2, 3, 4]);
         expect(ChunkedArray.compact(arr)).toEqual([1, 2, 3, 4]);
     });
 
     it('resize', () => {
-        const arr  = ChunkedArray.create<number, 2>(Int32Array, 2, 2);
+        const arr = ChunkedArray.create<number, 2>(Int32Array, 2, 2);
         ChunkedArray.add2(arr, 1, 2);
         ChunkedArray.add2(arr, 3, 4);
         ChunkedArray.add2(arr, 5, 6);
@@ -39,7 +39,7 @@ describe('Chunked Array', () => {
     });
 
     it('resize-fraction', () => {
-        const arr  = ChunkedArray.create<number, 2>(Int32Array, 2, 2.5);
+        const arr = ChunkedArray.create<number, 2>(Int32Array, 2, 2.5);
         ChunkedArray.add2(arr, 1, 2);
         ChunkedArray.add2(arr, 3, 4);
         ChunkedArray.add2(arr, 5, 6);

+ 3 - 3
src/mol-geo/geometry/mesh/mesh-builder.ts

@@ -61,8 +61,8 @@ export namespace MeshBuilder {
 
         v3triangleNormal(tmpV, a, b, c);
         for (let i = 0; i < 3; ++i) {
-            caAdd3(normals, tmpV[0], tmpV[1], tmpV[2]);  // normal
-            caAdd(groups, currentGroup);  // group
+            caAdd3(normals, tmpV[0], tmpV[1], tmpV[2]); // normal
+            caAdd(groups, currentGroup); // group
         }
         caAdd3(indices, offset, offset + 1, offset + 2);
     }
@@ -152,7 +152,7 @@ export namespace MeshBuilder {
         });
     }
 
-    export function getMesh (state: State): Mesh {
+    export function getMesh(state: State): Mesh {
         const { vertices, normals, indices, groups, mesh } = state;
         const vb = ChunkedArray.compact(vertices, true) as Float32Array;
         const ib = ChunkedArray.compact(indices, true) as Uint32Array;

+ 4 - 4
src/mol-geo/geometry/text/font-atlas.ts

@@ -10,7 +10,7 @@ import { createTextureImage, TextureImage } from '../../../mol-gl/renderable/uti
 
 const TextAtlasCache: { [k: string]: FontAtlas } = {};
 
-export function getFontAtlas (props: Partial<FontAtlasProps>) {
+export function getFontAtlas(props: Partial<FontAtlasProps>) {
     const hash = JSON.stringify(props);
     if (TextAtlasCache[hash] === undefined) {
         TextAtlasCache[hash] = new FontAtlas(props);
@@ -69,7 +69,7 @@ export class FontAtlas {
     private readonly maxWidth: number
     private readonly middle: number
 
-    constructor (props: Partial<FontAtlasProps> = {}) {
+    constructor(props: Partial<FontAtlasProps> = {}) {
         const p = { ...PD.getDefaultValues(FontAtlasParams), ...props };
         this.props = p;
 
@@ -110,7 +110,7 @@ export class FontAtlas {
         this.placeholder = this.get(String.fromCharCode(0xFFFD));
     }
 
-    get (char: string) {
+    get(char: string) {
         if (this.mapped[char] === undefined) {
             this.draw(char);
 
@@ -144,7 +144,7 @@ export class FontAtlas {
         return this.mapped[char];
     }
 
-    draw (char: string) {
+    draw(char: string) {
         const h = this.lineHeight;
         const ctx = this.scratchContext;
         const data = this.scratchData;

+ 2 - 2
src/mol-geo/geometry/text/text-builder.ts

@@ -69,7 +69,7 @@ export namespace TextBuilder {
                 } else if (attachment.startsWith('middle')) {
                     yShift = bHeight / 2;
                 } else {
-                    yShift = 0;  // "bottom"
+                    yShift = 0; // "bottom"
                 }
                 // horizontal
                 if (attachment.endsWith('right')) {
@@ -77,7 +77,7 @@ export namespace TextBuilder {
                 } else if (attachment.endsWith('center')) {
                     xShift = bWidth / 2;
                 } else {
-                    xShift = 0;  // "left"
+                    xShift = 0; // "left"
                 }
 
                 if (tether) {

+ 7 - 7
src/mol-geo/primitive/box.ts

@@ -73,18 +73,18 @@ let boxCage: Cage;
 export function BoxCage() {
     if (!boxCage) {
         boxCage = createCage([
-            0.5,  0.5, -0.5, // bottom
-            -0.5,  0.5, -0.5,
+            0.5, 0.5, -0.5, // bottom
+            -0.5, 0.5, -0.5,
             -0.5, -0.5, -0.5,
             0.5, -0.5, -0.5,
-            0.5,  0.5, 0.5,  // top
-            -0.5,  0.5, 0.5,
+            0.5, 0.5, 0.5, // top
+            -0.5, 0.5, 0.5,
             -0.5, -0.5, 0.5,
             0.5, -0.5, 0.5
         ], [
-            0, 4,  1, 5,  2, 6,  3, 7, // sides
-            0, 1,  1, 2,  2, 3,  3, 0,  // bottom base
-            4, 5,  5, 6,  6, 7,  7, 4   // top base
+            0, 4, 1, 5, 2, 6, 3, 7, // sides
+            0, 1, 1, 2, 2, 3, 3, 0, // bottom base
+            4, 5, 5, 6, 6, 7, 7, 4 // top base
         ]);
     }
     return boxCage;

+ 20 - 20
src/mol-geo/primitive/dodecahedron.ts

@@ -14,10 +14,10 @@ const b = 1 / t;
 const c = 2 - t;
 
 export const dodecahedronVertices: ReadonlyArray<number> = [
-    c, 0, a,    -c, 0, a,    -b, b, b,    0, a, c,     b, b, b,
-    b, -b, b,    0, -a, c,   -b, -b, b,   c, 0, -a,   -c, 0, -a,
-    -b, -b, -b,   0, -a, -c,   b, -b, -b,  b,  b, -b,   0, a, -c,
-    -b, b, -b,    a, c, 0,    -a, c, 0,   -a, -c, 0,    a, -c, 0
+    c, 0, a, -c, 0, a, -b, b, b, 0, a, c, b, b, b,
+    b, -b, b, 0, -a, c, -b, -b, b, c, 0, -a, -c, 0, -a,
+    -b, -b, -b, 0, -a, -c, b, -b, -b, b, b, -b, 0, a, -c,
+    -b, b, -b, a, c, 0, -a, c, 0, -a, -c, 0, a, -c, 0
 ];
 
 /** indices of pentagonal faces, groups of five  */
@@ -36,25 +36,25 @@ export const dodecahedronFaces: ReadonlyArray<number> = [
     7, 1, 2, 17, 18
 ];
 
-const dodecahedronIndices: ReadonlyArray<number> = [  // pentagonal faces
-    4, 3, 2,     2, 1, 0,     4, 2, 0,    // 4, 3, 2, 1, 0
-    7, 6, 5,     5, 0, 1,     7, 5, 1,    // 7, 6, 5, 0, 1
-    12, 11, 10,  10, 9, 8,    12, 10, 8,   // 12, 11, 10, 9, 8
-    15, 14, 13,  13, 8, 9,    15, 13, 9,   // 15, 14, 13, 8, 9
-    14, 3, 4,     4, 16, 13,  14, 4, 13,   // 14, 3, 4, 16, 13
-    3, 14, 15,   15, 17, 2,   3, 15, 2,   // 3, 14, 15, 17, 2
-    11, 6, 7,     7, 18, 10,  11, 7, 10,   // 11, 6, 7, 18, 10
-    6, 11, 12,  12, 19, 5,    6, 12, 5,   // 6, 11, 12, 19, 5
-    4, 0, 5,     5, 19, 16,   4, 5, 16,   // 4, 0, 5, 19, 16
-    12, 8, 13,   13, 16, 19,  12, 13, 19,  // 12, 8, 13, 16, 19
-    15, 9, 10,   10, 18, 17,  15, 10, 17,  // 15, 9, 10, 18, 17
-    7, 1, 2,     2, 17, 18,   7, 2, 18,   // 7, 1, 2, 17, 18
+const dodecahedronIndices: ReadonlyArray<number> = [ // pentagonal faces
+    4, 3, 2, 2, 1, 0, 4, 2, 0, // 4, 3, 2, 1, 0
+    7, 6, 5, 5, 0, 1, 7, 5, 1, // 7, 6, 5, 0, 1
+    12, 11, 10, 10, 9, 8, 12, 10, 8, // 12, 11, 10, 9, 8
+    15, 14, 13, 13, 8, 9, 15, 13, 9, // 15, 14, 13, 8, 9
+    14, 3, 4, 4, 16, 13, 14, 4, 13, // 14, 3, 4, 16, 13
+    3, 14, 15, 15, 17, 2, 3, 15, 2, // 3, 14, 15, 17, 2
+    11, 6, 7, 7, 18, 10, 11, 7, 10, // 11, 6, 7, 18, 10
+    6, 11, 12, 12, 19, 5, 6, 12, 5, // 6, 11, 12, 19, 5
+    4, 0, 5, 5, 19, 16, 4, 5, 16, // 4, 0, 5, 19, 16
+    12, 8, 13, 13, 16, 19, 12, 13, 19, // 12, 8, 13, 16, 19
+    15, 9, 10, 10, 18, 17, 15, 10, 17, // 15, 9, 10, 18, 17
+    7, 1, 2, 2, 17, 18, 7, 2, 18, // 7, 1, 2, 17, 18
 ];
 
 const dodecahedronEdges: ReadonlyArray<number> = [
-    0, 1,   0, 4,    0, 5,    1, 2,    1, 7,    2, 3,    2, 17,   3, 4,    3, 14,   4, 16,
-    5, 6,   5, 19,   6, 7,    6, 11,   7, 18,   8, 9,    8, 12,   8, 13,   9, 10,   9, 15,
-    10, 11, 10, 18,  11, 12,  12, 19,  13, 14,  13, 16,  14, 15,  15, 17,  16, 19,  17, 18,
+    0, 1, 0, 4, 0, 5, 1, 2, 1, 7, 2, 3, 2, 17, 3, 4, 3, 14, 4, 16,
+    5, 6, 5, 19, 6, 7, 6, 11, 7, 18, 8, 9, 8, 12, 8, 13, 9, 10, 9, 15,
+    10, 11, 10, 18, 11, 12, 12, 19, 13, 14, 13, 16, 14, 15, 15, 17, 16, 19, 17, 18,
 ];
 
 let dodecahedron: Primitive;

+ 10 - 10
src/mol-geo/primitive/icosahedron.ts

@@ -10,22 +10,22 @@ import { Cage, createCage } from './cage';
 const t = (1 + Math.sqrt(5)) / 2;
 
 const icosahedronVertices: ReadonlyArray<number> = [
-    -1, t, 0,   1, t, 0,  -1, -t, 0,   1, -t, 0,
-    0, -1, t,  0, 1, t,   0, -1, -t,  0, 1, -t,
-    t, 0, -1,  t, 0, 1,  -t, 0, -1,  -t, 0, 1
+    -1, t, 0, 1, t, 0, -1, -t, 0, 1, -t, 0,
+    0, -1, t, 0, 1, t, 0, -1, -t, 0, 1, -t,
+    t, 0, -1, t, 0, 1, -t, 0, -1, -t, 0, 1
 ];
 
 const icosahedronIndices: ReadonlyArray<number> = [
-    0, 11, 5,  0, 5, 1,    0, 1, 7,    0, 7, 10,  0, 10, 11,
-    1, 5, 9,   5, 11, 4,  11, 10, 2,  10, 7, 6,   7, 1, 8,
-    3, 9, 4,   3, 4, 2,    3, 2, 6,    3, 6, 8,   3, 8, 9,
-    4, 9, 5,   2, 4, 11,   6, 2, 10,   8, 6, 7,   9, 8, 1
+    0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11,
+    1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8,
+    3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9,
+    4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1
 ];
 
 const icosahedronEdges: ReadonlyArray<number> = [
-    0, 11,  5, 11,  0, 5,   1, 5,  0, 1,  1, 7,  0, 7,   7, 10,  0, 10,  10, 11,
-    5, 9,   4, 11,  2, 10,  6, 7,  1, 8,  3, 9,  4, 9,   3, 4,   2, 4,   2, 3,
-    2, 6,   3, 6,   6, 8,   3, 8,  8, 9,  4, 5,  2, 11,  6, 10,  7, 8,   1, 9
+    0, 11, 5, 11, 0, 5, 1, 5, 0, 1, 1, 7, 0, 7, 7, 10, 0, 10, 10, 11,
+    5, 9, 4, 11, 2, 10, 6, 7, 1, 8, 3, 9, 4, 9, 3, 4, 2, 4, 2, 3,
+    2, 6, 3, 6, 6, 8, 3, 8, 8, 9, 4, 5, 2, 11, 6, 10, 7, 8, 1, 9
 ];
 
 let icosahedron: Primitive;

+ 10 - 10
src/mol-geo/primitive/octahedron.ts

@@ -8,27 +8,27 @@ import { createPrimitive, Primitive } from './primitive';
 import { createCage, Cage } from './cage';
 
 export const octahedronVertices: ReadonlyArray<number> = [
-    0.5, 0, 0,   -0.5, 0, 0,    0, 0.5, 0,
-    0, -0.5, 0,   0, 0, 0.5,    0, 0, -0.5
+    0.5, 0, 0, -0.5, 0, 0, 0, 0.5, 0,
+    0, -0.5, 0, 0, 0, 0.5, 0, 0, -0.5
 ];
 
 export const octahedronIndices: ReadonlyArray<number> = [
-    0, 2, 4,  0, 4, 3,  0, 3, 5,
-    0, 5, 2,  1, 2, 5,  1, 5, 3,
-    1, 3, 4,  1, 4, 2
+    0, 2, 4, 0, 4, 3, 0, 3, 5,
+    0, 5, 2, 1, 2, 5, 1, 5, 3,
+    1, 3, 4, 1, 4, 2
 ];
 
 export const perforatedOctahedronIndices: ReadonlyArray<number> = [
-    0, 2, 4,   0, 4, 3,
+    0, 2, 4, 0, 4, 3,
     // 0, 3, 5,   0, 5, 2,
-    1, 2, 5,   1, 5, 3,
+    1, 2, 5, 1, 5, 3,
     // 1, 3, 4,   1, 4, 2
 ];
 
 const octahedronEdges: ReadonlyArray<number> = [
-    0, 2,  1, 3,  2, 1,  3, 0,
-    0, 4,  1, 4,  2, 4,  3, 4,
-    0, 5,  1, 5,  2, 5,  3, 5,
+    0, 2, 1, 3, 2, 1, 3, 0,
+    0, 4, 1, 4, 2, 4, 3, 4,
+    0, 5, 1, 5, 2, 5, 3, 5,
 ];
 
 let octahedron: Primitive;

+ 1 - 1
src/mol-geo/primitive/plane.ts

@@ -28,7 +28,7 @@ const plane: Primitive = {
 
 const planeCage: Cage = {
     vertices: plane.vertices,
-    edges: new Uint32Array([0, 1,  2, 3,  3, 1,  2, 0])
+    edges: new Uint32Array([0, 1, 2, 3, 3, 1, 2, 0])
 };
 
 export function Plane(): Primitive {

+ 2 - 2
src/mol-geo/primitive/pyramid.ts

@@ -83,8 +83,8 @@ export function PerforatedOctagonalPyramid() {
         vertices[8 * 3 + 4] = 0;
         vertices[8 * 3 + 5] = 0.5;
         const indices: ReadonlyArray<number> = [
-            0, 1, 8,  1, 2, 8,  4, 5, 8,  5, 6, 8,
-            2, 3, 9,  3, 4, 9,  6, 7, 9,  7, 0, 9
+            0, 1, 8, 1, 2, 8, 4, 5, 8, 5, 6, 8,
+            2, 3, 9, 3, 4, 9, 6, 7, 9, 7, 0, 9
         ];
         perforatedOctagonalPyramid = createPrimitive(vertices, indices);
     }

+ 1 - 1
src/mol-geo/primitive/sphere.ts

@@ -5,7 +5,7 @@
  */
 
 import { Polyhedron } from './polyhedron';
-import { Icosahedron } from  './icosahedron';
+import { Icosahedron } from './icosahedron';
 import { Primitive } from './primitive';
 
 const { vertices, indices } = Icosahedron();

+ 4 - 4
src/mol-geo/primitive/tetrahedron.ts

@@ -8,16 +8,16 @@ import { createPrimitive, Primitive } from './primitive';
 import { createCage, Cage } from './cage';
 
 export const tetrahedronVertices: ReadonlyArray<number> = [
-    0.5, 0.5, 0.5,  -0.5, -0.5, 0.5,  -0.5, 0.5, -0.5,  0.5, -0.5, -0.5
+    0.5, 0.5, 0.5, -0.5, -0.5, 0.5, -0.5, 0.5, -0.5, 0.5, -0.5, -0.5
 ];
 
 export const tetrahedronIndices: ReadonlyArray<number> = [
-    2, 1, 0,  0, 3, 2,  1, 3, 0,  2, 3, 1
+    2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1
 ];
 
 const tetrahedronEdges: ReadonlyArray<number> = [
-    0, 1,  1, 2,  2, 0,
-    0, 3,  1, 3,  2, 3,
+    0, 1, 1, 2, 2, 0,
+    0, 3, 1, 3, 2, 3,
 ];
 
 let tetrahedron: Primitive;

+ 5 - 5
src/mol-geo/util.ts

@@ -8,7 +8,7 @@ import { Vec3, Mat4, Mat3 } from '../mol-math/linear-algebra';
 import { NumberArray } from '../mol-util/type-helpers';
 import { arrayMax } from '../mol-util/array';
 
-export function normalizeVec3Array<T extends NumberArray> (a: T, count: number) {
+export function normalizeVec3Array<T extends NumberArray>(a: T, count: number) {
     for (let i = 0, il = count * 3; i < il; i += 3) {
         const x = a[i];
         const y = a[i + 1];
@@ -23,7 +23,7 @@ export function normalizeVec3Array<T extends NumberArray> (a: T, count: number)
 
 const tmpV3 = Vec3();
 
-export function transformPositionArray (t: Mat4, array: NumberArray, offset: number, count: number) {
+export function transformPositionArray(t: Mat4, array: NumberArray, offset: number, count: number) {
     for (let i = 0, il = count * 3; i < il; i += 3) {
         Vec3.fromArray(tmpV3, array, offset + i);
         Vec3.transformMat4(tmpV3, tmpV3, t);
@@ -31,7 +31,7 @@ export function transformPositionArray (t: Mat4, array: NumberArray, offset: num
     }
 }
 
-export function transformDirectionArray (n: Mat3, array: NumberArray, offset: number, count: number) {
+export function transformDirectionArray(n: Mat3, array: NumberArray, offset: number, count: number) {
     for (let i = 0, il = count * 3; i < il; i += 3) {
         Vec3.fromArray(tmpV3, array, offset + i);
         Vec3.transformMat3(tmpV3, tmpV3, n);
@@ -60,7 +60,7 @@ const ab = Vec3();
  *      http://www.iquilezles.org/www/articles/normals/normals.htm
  * - normals array must contain only zeros
  */
-export function computeIndexedVertexNormals<T extends NumberArray> (vertices: NumberArray, indices: NumberArray, normals: T, vertexCount: number, triangleCount: number) {
+export function computeIndexedVertexNormals<T extends NumberArray>(vertices: NumberArray, indices: NumberArray, normals: T, vertexCount: number, triangleCount: number) {
 
     for (let i = 0, il = triangleCount * 3; i < il; i += 3) {
         const ai = indices[i] * 3;
@@ -95,7 +95,7 @@ export function computeIndexedVertexNormals<T extends NumberArray> (vertices: Nu
  * vertex normals for unindexed triangle soup
  * - normals array must contain only zeros
  */
-export function computeVertexNormals<T extends NumberArray> (vertices: NumberArray, normals: T, vertexCount: number) {
+export function computeVertexNormals<T extends NumberArray>(vertices: NumberArray, normals: T, vertexCount: number) {
     for (let i = 0, il = vertexCount * 3; i < il; i += 9) {
         Vec3.fromArray(a, vertices, i);
         Vec3.fromArray(b, vertices, i + 3);

+ 2 - 2
src/mol-geo/util/location-iterator.ts

@@ -53,8 +53,8 @@ export function LocationIterator(groupCount: number, instanceCount: number, stri
     let voidInstances = false;
 
     return {
-        get hasNext () { return hasNext; },
-        get isNextNewInstance () { return isNextNewInstance; },
+        get hasNext() { return hasNext; },
+        get isNextNewInstance() { return isNextNewInstance; },
         groupCount,
         instanceCount,
         count: groupCount * instanceCount,

+ 30 - 30
src/mol-gl/_spec/gl.shim.ts

@@ -335,37 +335,37 @@ export function createGl(width: number, height: number, contextAttributes: WebGL
         canvas: {
             width, height
         } as HTMLCanvasElement,
-        getAttachedShaders: function(program: WebGLProgram) {
+        getAttachedShaders: function (program: WebGLProgram) {
             return [] as WebGLShader[];
         },
-        getBufferParameter: function(target: number, pname: number) {
+        getBufferParameter: function (target: number, pname: number) {
             return 0;
         },
-        getContextAttributes: function() { return contextAttributes; },
-        getFramebufferAttachmentParameter: function() {},
-        getProgramInfoLog: function() { return ''; },
-        getShaderInfoLog: function() { return ''; },
-        getRenderbufferParameter: function() {},
-        getShaderPrecisionFormat: function(shadertype: number, precisiontype: number) {
+        getContextAttributes: function () { return contextAttributes; },
+        getFramebufferAttachmentParameter: function () {},
+        getProgramInfoLog: function () { return ''; },
+        getShaderInfoLog: function () { return ''; },
+        getRenderbufferParameter: function () {},
+        getShaderPrecisionFormat: function (shadertype: number, precisiontype: number) {
             return {
                 precision: 0,
                 rangeMax: 0,
                 rangeMin: 0
             };
         },
-        getShaderSource: function(shader: WebGLShader | null) { return ''; },
-        getTexParameter: function() {},
-        getUniform: function() {},
-        getVertexAttrib: function() {},
-        getVertexAttribOffset: function(index: number, pname: number) { return 0; },
-        hint: function(target: number, mode: number) {},
-        isBuffer: function(buffer: WebGLBuffer | null) { return true; },
-        isEnabled: function(cap: number) { return true; },
-        isFramebuffer: function(framebuffer: WebGLFramebuffer | null) { return true; },
-        isProgram: function(program: WebGLProgram | null) { return true; },
-        isRenderbuffer: function(renderbuffer: WebGLRenderbuffer | null) { return true; },
-        isShader: function(shader: WebGLShader | null) { return true; },
-        isTexture: function(texture: WebGLTexture | null) { return true; },
+        getShaderSource: function (shader: WebGLShader | null) { return ''; },
+        getTexParameter: function () {},
+        getUniform: function () {},
+        getVertexAttrib: function () {},
+        getVertexAttribOffset: function (index: number, pname: number) { return 0; },
+        hint: function (target: number, mode: number) {},
+        isBuffer: function (buffer: WebGLBuffer | null) { return true; },
+        isEnabled: function (cap: number) { return true; },
+        isFramebuffer: function (framebuffer: WebGLFramebuffer | null) { return true; },
+        isProgram: function (program: WebGLProgram | null) { return true; },
+        isRenderbuffer: function (renderbuffer: WebGLRenderbuffer | null) { return true; },
+        isShader: function (shader: WebGLShader | null) { return true; },
+        isTexture: function (texture: WebGLTexture | null) { return true; },
         getExtension: function (extensionName: string): any {
             switch (extensionName) {
                 case 'EXT_blend_minmax': return {
@@ -386,10 +386,10 @@ export function createGl(width: number, height: number, contextAttributes: WebGL
                 } as EXT_sRGB;
                 case 'OES_vertex_array_object': return {
                     VERTEX_ARRAY_BINDING_OES: 0,
-                    bindVertexArrayOES: function(arrayObject: WebGLVertexArrayObjectOES) { },
-                    createVertexArrayOES: function(): WebGLVertexArrayObjectOES { return {}; },
-                    deleteVertexArrayOES: function(arrayObject: WebGLVertexArrayObjectOES) { },
-                    isVertexArrayOES: function(value: any) { return true; }
+                    bindVertexArrayOES: function (arrayObject: WebGLVertexArrayObjectOES) { },
+                    createVertexArrayOES: function (): WebGLVertexArrayObjectOES { return {}; },
+                    deleteVertexArrayOES: function (arrayObject: WebGLVertexArrayObjectOES) { },
+                    isVertexArrayOES: function (value: any) { return true; }
                 } as OES_vertex_array_object;
                 case 'WEBGL_color_buffer_float': return {
                     FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: 0,
@@ -404,8 +404,8 @@ export function createGl(width: number, height: number, contextAttributes: WebGL
                 } as WEBGL_debug_shaders;
                 case 'WEBGL_draw_buffers': return null;
                 case 'WEBGL_lose_context': return {
-                    loseContext: function() { },
-                    restoreContext: function() { },
+                    loseContext: function () { },
+                    restoreContext: function () { },
                 } as WEBGL_lose_context;
                 case 'WEBGL_depth_texture': return {
                     UNSIGNED_INT_24_8_WEBGL: 0
@@ -426,9 +426,9 @@ export function createGl(width: number, height: number, contextAttributes: WebGL
                 } as OES_standard_derivatives;
                 case 'OES_element_index_uint': return {} as OES_element_index_uint;
                 case 'ANGLE_instanced_arrays': return {
-                    drawArraysInstancedANGLE: function(mode: number, first: number, count: number, primcount: number) {},
-                    drawElementsInstancedANGLE: function(mode: number, count: number, type: number, offset: number, primcount: number) {},
-                    vertexAttribDivisorANGLE: function(index: number, divisor: number) {},
+                    drawArraysInstancedANGLE: function (mode: number, first: number, count: number, primcount: number) {},
+                    drawElementsInstancedANGLE: function (mode: number, count: number, type: number, offset: number, primcount: number) {},
+                    vertexAttribDivisorANGLE: function (index: number, divisor: number) {},
                     VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: 0
                 } as ANGLE_instanced_arrays;
             }

+ 1 - 1
src/mol-gl/compute/marching-cubes/tables.ts

@@ -4,7 +4,7 @@
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
  */
 
-import { TriTable,  } from '../../../mol-geo/util/marching-cubes/tables';
+import { TriTable, } from '../../../mol-geo/util/marching-cubes/tables';
 import { TextureImage, createTextureImage } from '../../../mol-gl/renderable/util';
 
 let TriCount: TextureImage<Uint8Array> | undefined;

+ 2 - 2
src/mol-gl/compute/util.ts

@@ -14,8 +14,8 @@ import { GLRenderingContext } from '../../mol-gl/webgl/compat';
 import { PixelData } from '../../mol-util/image';
 
 export const QuadPositions = new Float32Array([
-    1.0,  1.0,  -1.0,  1.0,  -1.0, -1.0, // First triangle
-    -1.0, -1.0,   1.0, -1.0,   1.0,  1.0  // Second triangle
+    1.0, 1.0, -1.0, 1.0, -1.0, -1.0, // First triangle
+    -1.0, -1.0, 1.0, -1.0, 1.0, 1.0 // Second triangle
 ]);
 
 export const QuadSchema = {

+ 1 - 1
src/mol-gl/renderable/util.ts

@@ -9,7 +9,7 @@ import { Vec3, Mat4 } from '../../mol-math/linear-algebra';
 import { BoundaryHelper } from '../../mol-math/geometry/boundary-helper';
 import { TextureFilter } from '../webgl/texture';
 
-export function calculateTextureInfo (n: number, itemSize: number) {
+export function calculateTextureInfo(n: number, itemSize: number) {
     n = Math.max(n, 2); // observed issues with 1 pixel textures
     const sqN = Math.sqrt(n);
     let width = Math.ceil(sqN);

+ 1 - 1
src/mol-gl/shader-code.ts

@@ -137,7 +137,7 @@ import { cylinders_vert } from './shader/cylinders.vert';
 import { cylinders_frag } from './shader/cylinders.frag';
 export const CylindersShaderCode = ShaderCode('cylinders', cylinders_vert, cylinders_frag, { fragDepth: 'required', drawBuffers: 'optional' });
 
-import { text_vert }from './shader/text.vert';
+import { text_vert } from './shader/text.vert';
 import { text_frag } from './shader/text.frag';
 export const TextShaderCode = ShaderCode('text', text_vert, text_frag, { standardDerivatives: 'required', drawBuffers: 'optional' });
 

+ 1 - 1
src/mol-gl/webgl/compat.ts

@@ -339,7 +339,7 @@ void main() {
 }`;
 
 const TextureTestTexCoords = new Float32Array([
-    -1.0, -1.0, 1.0, -1.0, -1.0,  1.0, -1.0,  1.0, 1.0, -1.0, 1.0,  1.0
+    -1.0, -1.0, 1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, 1.0
 ]);
 
 // adapted from https://stackoverflow.com/questions/28827511/

+ 8 - 8
src/mol-gl/webgl/context.ts

@@ -51,7 +51,7 @@ export function checkError(gl: GLRenderingContext) {
     }
 }
 
-function unbindResources (gl: GLRenderingContext) {
+function unbindResources(gl: GLRenderingContext) {
     // bind null to all texture units
     const maxTextureImageUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);
     for (let i = 0; i < maxTextureImageUnits; ++i) {
@@ -280,7 +280,7 @@ export function createContext(gl: GLRenderingContext, props: Partial<{ pixelScal
     return {
         gl,
         isWebGL2: isWebGL2(gl),
-        get pixelRatio () {
+        get pixelRatio() {
             const dpr = (typeof window !== 'undefined') ? window.devicePixelRatio : 1;
             return dpr * (props.pixelScale || 1);
         },
@@ -290,17 +290,17 @@ export function createContext(gl: GLRenderingContext, props: Partial<{ pixelScal
         stats,
         resources,
 
-        get maxTextureSize () { return parameters.maxTextureSize; },
-        get max3dTextureSize () { return parameters.max3dTextureSize; },
-        get maxRenderbufferSize () { return parameters.maxRenderbufferSize; },
-        get maxDrawBuffers () { return parameters.maxDrawBuffers; },
-        get maxTextureImageUnits () { return parameters.maxTextureImageUnits; },
+        get maxTextureSize() { return parameters.maxTextureSize; },
+        get max3dTextureSize() { return parameters.max3dTextureSize; },
+        get maxRenderbufferSize() { return parameters.maxRenderbufferSize; },
+        get maxDrawBuffers() { return parameters.maxDrawBuffers; },
+        get maxTextureImageUnits() { return parameters.maxTextureImageUnits; },
 
         namedComputeRenderables: Object.create(null),
         namedFramebuffers: Object.create(null),
         namedTextures: Object.create(null),
 
-        get isContextLost () {
+        get isContextLost() {
             return isContextLost || gl.isContextLost();
         },
         contextRestored,

+ 1 - 1
src/mol-gl/webgl/renderbuffer.ts

@@ -53,7 +53,7 @@ function getRenderbuffer(gl: GLRenderingContext) {
     return renderbuffer;
 }
 
-export function createRenderbuffer (gl: GLRenderingContext, format: RenderbufferFormat, attachment: RenderbufferAttachment, _width: number, _height: number): Renderbuffer {
+export function createRenderbuffer(gl: GLRenderingContext, format: RenderbufferFormat, attachment: RenderbufferAttachment, _width: number, _height: number): Renderbuffer {
     let _renderbuffer = getRenderbuffer(gl);
 
     const bind = () => gl.bindRenderbuffer(gl.RENDERBUFFER, _renderbuffer);

+ 1 - 1
src/mol-gl/webgl/texture.ts

@@ -400,7 +400,7 @@ export function createTextures(ctx: WebGLContext, schema: RenderableSchema, valu
  */
 export function loadImageTexture(src: string, cell: ValueCell<Texture>, texture: Texture) {
     const img = new Image();
-    img.onload = function() {
+    img.onload = function () {
         texture.load(img);
         ValueCell.update(cell, texture);
     };

+ 9 - 9
src/mol-gl/webgl/uniform.ts

@@ -45,15 +45,15 @@ export function getUniformType(gl: GLRenderingContext, kind: UniformKind) {
 export type UniformSetter = (gl: GLRenderingContext, location: number, value: any) => void
 export type UniformSetters = { [k: string]: UniformSetter }
 
-function uniform1f (gl: GLRenderingContext, location: number, value: any) { gl.uniform1f(location, value); }
-function uniform1fv (gl: GLRenderingContext, location: number, value: any) { gl.uniform1fv(location, value); }
-function uniform1i (gl: GLRenderingContext, location: number, value: any) { gl.uniform1i(location, value); }
-function uniform1iv (gl: GLRenderingContext, location: number, value: any) { gl.uniform1iv(location, value); }
-function uniform2fv (gl: GLRenderingContext, location: number, value: any) { gl.uniform2fv(location, value); }
-function uniform3fv (gl: GLRenderingContext, location: number, value: any) { gl.uniform3fv(location, value); }
-function uniform4fv (gl: GLRenderingContext, location: number, value: any) { gl.uniform4fv(location, value); }
-function uniformMatrix3fv (gl: GLRenderingContext, location: number, value: any) { gl.uniformMatrix3fv(location, false, value); }
-function uniformMatrix4fv (gl: GLRenderingContext, location: number, value: any) { gl.uniformMatrix4fv(location, false, value); }
+function uniform1f(gl: GLRenderingContext, location: number, value: any) { gl.uniform1f(location, value); }
+function uniform1fv(gl: GLRenderingContext, location: number, value: any) { gl.uniform1fv(location, value); }
+function uniform1i(gl: GLRenderingContext, location: number, value: any) { gl.uniform1i(location, value); }
+function uniform1iv(gl: GLRenderingContext, location: number, value: any) { gl.uniform1iv(location, value); }
+function uniform2fv(gl: GLRenderingContext, location: number, value: any) { gl.uniform2fv(location, value); }
+function uniform3fv(gl: GLRenderingContext, location: number, value: any) { gl.uniform3fv(location, value); }
+function uniform4fv(gl: GLRenderingContext, location: number, value: any) { gl.uniform4fv(location, value); }
+function uniformMatrix3fv(gl: GLRenderingContext, location: number, value: any) { gl.uniformMatrix3fv(location, false, value); }
+function uniformMatrix4fv(gl: GLRenderingContext, location: number, value: any) { gl.uniformMatrix4fv(location, false, value); }
 
 function getUniformSetter(kind: UniformKind): UniformSetter {
     switch (kind) {

+ 2 - 2
src/mol-io/common/binary-cif/decoder.ts

@@ -104,8 +104,8 @@ function runLength(data: Int32Array, encoding: Encoding.RunLength) {
     const output = getIntArray(encoding.srcType, encoding.srcSize);
     let dataOffset = 0;
     for (let i = 0, il = data.length; i < il; i += 2) {
-        const value = data[i];  // value to be repeated
-        const length = data[i + 1];  // number of repeats
+        const value = data[i]; // value to be repeated
+        const length = data[i + 1]; // number of repeats
         for (let j = 0; j < length; ++j) {
             output[dataOffset++] = value;
         }

+ 1 - 1
src/mol-io/reader/_spec/mol.spec.ts

@@ -51,7 +51,7 @@ M  END`;
 
 describe('mol reader', () => {
     it('basic', async () => {
-        const parsed =  await parseMol(MolString).run();
+        const parsed = await parseMol(MolString).run();
         if (parsed.isError) {
             throw new Error(parsed.message);
         }

+ 3 - 3
src/mol-io/reader/_spec/mol2.spec.ts

@@ -246,7 +246,7 @@ GASTEIGER
 
 describe('mol2 reader', () => {
     it('basic', async () => {
-        const parsed =  await parseMol2(Mol2String, '').run();
+        const parsed = await parseMol2(Mol2String, '').run();
         if (parsed.isError) {
             throw new Error(parsed.message);
         }
@@ -297,7 +297,7 @@ describe('mol2 reader', () => {
     });
 
     it('multiblocks', async () => {
-        const parsed =  await parseMol2(Mol2StringMultiBlocks, '').run();
+        const parsed = await parseMol2(Mol2StringMultiBlocks, '').run();
         if (parsed.isError) {
             throw new Error(parsed.message);
         }
@@ -348,7 +348,7 @@ describe('mol2 reader', () => {
     });
 
     it('minimal', async () => {
-        const parsed =  await parseMol2(Mol2StringMinimal, '').run();
+        const parsed = await parseMol2(Mol2StringMinimal, '').run();
         if (parsed.isError) {
             throw new Error(parsed.message);
         }

+ 1 - 1
src/mol-io/reader/_spec/sdf.spec.ts

@@ -334,7 +334,7 @@ $$$$
 
 describe('sdf reader', () => {
     it('basic', async () => {
-        const parsed =  await parseSdf(SdfString).run();
+        const parsed = await parseSdf(SdfString).run();
         if (parsed.isError) {
             throw new Error(parsed.message);
         }

+ 2 - 2
src/mol-io/reader/cif/schema.ts

@@ -131,7 +131,7 @@ class CategoryTable implements Table<any> { // tslint:disable-line:class-name
         const cache = Object.create(null);
         for (const k of fieldKeys) {
             Object.defineProperty(this, k, {
-                get: function() {
+                get: function () {
                     if (cache[k]) return cache[k];
                     const fType = schema[k];
                     if (fType.valueType === 'list') {
@@ -166,7 +166,7 @@ function flattenFrame(frame: Data.CifFrame): FlatFrame {
     const flatFrame = Object.create(null);
     for (const c of Object.keys(frame.categories)) {
         for (const f of frame.categories[c].fieldNames) {
-            const p =  FieldPath.create(c, f, true);
+            const p = FieldPath.create(c, f, true);
             flatFrame[p] = frame.categories[c].getField(f);
         }
     }

+ 3 - 3
src/mol-io/reader/cif/text/parser.ts

@@ -64,7 +64,7 @@ interface TokenizerState {
 function eatValue(state: TokenizerState) {
     while (state.position < state.length) {
         switch (state.data.charCodeAt(state.position)) {
-            case 9:  // \t
+            case 9: // \t
             case 10: // \n
             case 13: // \r
             case 32: // ' '
@@ -96,7 +96,7 @@ function eatEscaped(state: TokenizerState, esc: number) {
         if (c === esc) {
             next = state.data.charCodeAt(state.position + 1);
             switch (next) {
-                case 9:  // \t
+                case 9: // \t
                 case 10: // \n
                 case 13: // \r
                 case 32: // ' '
@@ -198,7 +198,7 @@ function eatImportGet(state: TokenizerState) {
     // skipWhitespace(state)
     while (state.position < state.length) {
         switch (state.data.charCodeAt(state.position)) {
-            case 93:  // ]
+            case 93: // ]
                 ++state.position;
                 state.tokenEnd = state.position;
                 state.isImportGet = false;

+ 2 - 2
src/mol-io/reader/common/text/column/token.ts

@@ -39,10 +39,10 @@ export function TokenColumn<T extends Column.Schema>(tokens: Tokens, schema: T):
 
 export function areValuesEqualProvider(tokens: Tokens) {
     const { data, indices } = tokens;
-    return function(rowA: number, rowB: number) {
+    return function (rowA: number, rowB: number) {
         const aS = indices[2 * rowA], bS = indices[2 * rowB];
         const len = indices[2 * rowA + 1] - aS;
-        if (len !== indices[2 *  rowB + 1] - bS) return false;
+        if (len !== indices[2 * rowB + 1] - bS) return false;
         for (let i = 0; i < len; i++) {
             if (data.charCodeAt(i + aS) !== data.charCodeAt(i + bS)) {
                 return false;

+ 2 - 2
src/mol-io/reader/common/text/tokenizer.ts

@@ -44,7 +44,7 @@ namespace Tokenizer {
     }
 
     /** Resets the state */
-    export function reset (state: Tokenizer) {
+    export function reset(state: Tokenizer) {
         state.position = 0;
         state.lineNumber = 1;
         state.tokenStart = 0;
@@ -185,7 +185,7 @@ namespace Tokenizer {
     export function eatValue(state: Tokenizer) {
         while (state.position < state.length) {
             switch (state.data.charCodeAt(state.position)) {
-                case 9:  // \t
+                case 9: // \t
                 case 10: // \n
                 case 13: // \r
                 case 32: // ' '

+ 12 - 12
src/mol-io/reader/csv/parser.ts

@@ -72,13 +72,13 @@ function eatValue(state: Tokenizer, delimiterCharCode: number) {
         const c = state.data.charCodeAt(state.position);
         ++state.position;
         switch (c) {
-            case 10:  // \n
-            case 13:  // \r
+            case 10: // \n
+            case 13: // \r
                 return true;
             case delimiterCharCode:
                 return;
-            case 9:  // \t
-            case 32:  // ' '
+            case 9: // \t
+            case 32: // ' '
                 break;
             default:
                 ++state.tokenEnd;
@@ -120,8 +120,8 @@ function eatQuoted(state: Tokenizer, quoteCharCode: number, delimiterCharCode: n
 function skipEmpty(state: Tokenizer, delimiterCharCode: number) {
     while (state.position < state.length) {
         const c = state.data.charCodeAt(state.position);
-        if (c !== 9 && c !== 32 && c !== delimiterCharCode) {  // \t or ' '
-            return c === 10 || c === 13;  // \n or \r
+        if (c !== 9 && c !== 32 && c !== delimiterCharCode) { // \t or ' '
+            return c === 10 || c === 13; // \n or \r
         }
         ++state.position;
     }
@@ -132,12 +132,12 @@ function skipWhitespace(state: Tokenizer) {
     while (state.position < state.length) {
         const c = state.data.charCodeAt(state.position);
         switch (c) {
-            case 9:  // '\t'
-            case 32:  // ' '
+            case 9: // '\t'
+            case 32: // ' '
                 prev = c;
                 ++state.position;
                 break;
-            case 10:  // \n
+            case 10: // \n
                 // handle \r\n
                 if (prev !== 13) {
                     ++state.lineNumber;
@@ -145,7 +145,7 @@ function skipWhitespace(state: Tokenizer) {
                 prev = c;
                 ++state.position;
                 break;
-            case 13:  // \r
+            case 13: // \r
                 prev = c;
                 ++state.position;
                 ++state.lineNumber;
@@ -159,7 +159,7 @@ function skipWhitespace(state: Tokenizer) {
 function skipLine(state: Tokenizer) {
     while (state.position < state.length) {
         const c = state.data.charCodeAt(state.position);
-        if (c === 10 || c === 13) return;  // \n or \r
+        if (c === 10 || c === 13) return; // \n or \r
         ++state.position;
     }
 }
@@ -233,7 +233,7 @@ function readRecordsChunks(state: State) {
         (ctx, state) => ctx.update({ message: 'Parsing...', current: state.tokenizer.position, max: state.data.length }));
 }
 
-function addColumn (state: State) {
+function addColumn(state: State) {
     state.columnNames.push(Tokenizer.getTokenString(state.tokenizer));
     state.tokens.push(TokenBuilder.create(state.tokenizer.data, state.data.length / 80));
 }

+ 3 - 3
src/mol-io/reader/psf/parser.ts

@@ -169,12 +169,12 @@ async function parseInternal(data: string, ctx: RuntimeContext): Promise<Result<
     const state = State(tokenizer, ctx);
 
     let title = undefined as string[] | undefined;
-    let atoms = undefined  as PsfFile['atoms'] | undefined;
-    let bonds = undefined  as PsfFile['bonds'] | undefined;
+    let atoms = undefined as PsfFile['atoms'] | undefined;
+    let bonds = undefined as PsfFile['bonds'] | undefined;
 
     const id = readLine(state.tokenizer).trim();
 
-    while(tokenizer.tokenEnd < tokenizer.length) {
+    while (tokenizer.tokenEnd < tokenizer.length) {
         const line = readLine(state.tokenizer).trim();
         if (line.includes('!NTITLE')) {
             const numTitle = parseInt(line.split(reWhitespace)[0]);

+ 3 - 3
src/mol-io/writer/cif/encoder.ts

@@ -47,7 +47,7 @@ export namespace Field {
         return { name, type: Type.Str, value, valueKind: params && params.valueKind, defaultFormat: params && params.encoder ? { encoder: params.encoder } : void 0, shouldInclude: params && params.shouldInclude };
     }
 
-    export function int<K, D = any>(name: string, value: (k: K, d: D, index: number) => number, params?:  ParamsBase<K, D> & { typedArray?: ArrayEncoding.TypedArrayCtor }): Field<K, D> {
+    export function int<K, D = any>(name: string, value: (k: K, d: D, index: number) => number, params?: ParamsBase<K, D> & { typedArray?: ArrayEncoding.TypedArrayCtor }): Field<K, D> {
         return {
             name,
             type: Type.Int,
@@ -86,7 +86,7 @@ export namespace Field {
             return this;
         }
 
-        int(name: N, value: (k: K, d: D, index: number) => number, params?:  ParamsBase<K, D> & { typedArray?: ArrayEncoding.TypedArrayCtor }) {
+        int(name: N, value: (k: K, d: D, index: number) => number, params?: ParamsBase<K, D> & { typedArray?: ArrayEncoding.TypedArrayCtor }) {
             this.fields.push(Field.int(name, value, params));
             return this;
         }
@@ -116,7 +116,7 @@ export namespace Field {
         getFields() { return this.fields; }
     }
 
-    export function build<K = number, D = any, N extends string  = string>() {
+    export function build<K = number, D = any, N extends string = string>() {
         return new Builder<K, D, N>();
     }
 }

+ 1 - 1
src/mol-io/writer/cif/encoder/text.ts

@@ -161,7 +161,7 @@ function writeCifLoop(category: Category, instance: Category.Instance, source: C
         if (src.rowCount === 0) continue;
 
         const it = src.keys();
-        while (it.hasNext)  {
+        while (it.hasNext) {
             const key = it.move();
 
             let multiline = false;

+ 1 - 1
src/mol-io/writer/ligand-encoder.ts

@@ -105,7 +105,7 @@ export abstract class LigandEncoder implements Encoder<string> {
             if (src.rowCount === 0) continue;
 
             const it = src.keys();
-            while (it.hasNext)  {
+            while (it.hasNext) {
                 const key = it.move();
 
                 const lai = label_atom_id.value(key, data, index) as string;

+ 2 - 2
src/mol-math/approx.ts

@@ -172,14 +172,14 @@ const _a_fasterHalfCos = new ArrayBuffer(4);
 const _i_fasterHalfCos = new Int32Array(_a_fasterHalfCos);
 const _f_fasterHalfCos = new Float32Array(_a_fasterHalfCos);
 
-function fasterHalfCos (v: number) {
+function fasterHalfCos(v: number) {
     _f_fasterHalfCos[0] = v;
     _i_fasterHalfCos[0] &= 0x7FFFFFFF;
     const qpprox = 1.0 - twoOverPi * _f_fasterHalfCos[0];
     return qpprox + _p_fasterHalfCos * qpprox * (1.0 - qpprox * qpprox);
 }
 
-export function fastTan (v: number) {
+export function fastTan(v: number) {
     const k = (v * invTwoPi) | 0;
     const half = (v < 0) ? -0.5 : 0.5;
     const x = v - (half + k) * twoPi;

+ 1 - 1
src/mol-math/geometry/gaussian-density.ts

@@ -29,7 +29,7 @@ export type GaussianDensityTextureData = {
     resolution: number
 } & DensityTextureData
 
-export function computeGaussianDensity(position: PositionData, box: Box3D, radius: (index: number) => number,  props: GaussianDensityProps) {
+export function computeGaussianDensity(position: PositionData, box: Box3D, radius: (index: number) => number, props: GaussianDensityProps) {
     return Task.create('Gaussian Density', async ctx => {
         return await GaussianDensityCPU(ctx, position, box, radius, props);
     });

+ 1 - 1
src/mol-math/geometry/gaussian-density/cpu.ts

@@ -12,7 +12,7 @@ import { OrderedSet } from '../../../mol-data/int';
 import { GaussianDensityProps, GaussianDensityData } from '../gaussian-density';
 import { fasterExp } from '../../approx';
 
-export async function GaussianDensityCPU(ctx: RuntimeContext, position: PositionData, box: Box3D, radius: (index: number) => number,  props: GaussianDensityProps): Promise<GaussianDensityData> {
+export async function GaussianDensityCPU(ctx: RuntimeContext, position: PositionData, box: Box3D, radius: (index: number) => number, props: GaussianDensityProps): Promise<GaussianDensityData> {
     const { resolution, radiusOffset, smoothness } = props;
     const scaleFactor = 1 / resolution;
 

+ 2 - 2
src/mol-math/geometry/gaussian-density/gpu.ts

@@ -361,7 +361,7 @@ function createGaussianDensityRenderable(webgl: WebGLContext, drawCount: number,
 
     const schema = { ...GaussianDensitySchema };
     const shaderCode = ShaderCode(GaussianDensityName, gaussianDensity_vert, gaussianDensity_frag);
-    const renderItem =  createComputeRenderItem(webgl, 'points', shaderCode, schema, values);
+    const renderItem = createComputeRenderItem(webgl, 'points', shaderCode, schema, values);
 
     return createComputeRenderable(renderItem, values);
 }
@@ -461,7 +461,7 @@ function fieldFromTexture2d(ctx: WebGLContext, texture: Texture, dim: Vec3, texD
         for (let iy = 0; iy < dy; ++iy) {
             for (let ix = 0; ix < dx; ++ix) {
                 const idx = 4 * (tmpCol * dx + (iy + tmpRow) * width + ix);
-                data[j] = image[idx + 3]  / 255;
+                data[j] = image[idx + 3] / 255;
                 idData[j] = decodeFloatRGB(image[idx], image[idx + 1], image[idx + 2]);
                 j++;
             }

+ 4 - 4
src/mol-math/geometry/molecular-surface.ts

@@ -17,7 +17,7 @@ import { Box3D, GridLookup3D, fillGridDim } from '../../mol-math/geometry';
 import { BaseGeometry } from '../../mol-geo/geometry/base';
 import { Boundary } from './boundary';
 
-function normalToLine (out: Vec3, p: Vec3) {
+function normalToLine(out: Vec3, p: Vec3) {
     out[0] = out[1] = out[2] = 1.0;
     if (p[0] !== 0) {
         out[0] = (p[1] + p[2]) / -p[0];
@@ -30,7 +30,7 @@ function normalToLine (out: Vec3, p: Vec3) {
 }
 
 type AnglesTables = { cosTable: Float32Array, sinTable: Float32Array }
-function getAngleTables (probePositions: number): AnglesTables {
+function getAngleTables(probePositions: number): AnglesTables {
     let theta = 0.0;
     const step = 2 * Math.PI / probePositions;
 
@@ -112,7 +112,7 @@ export async function calcMolecularSurface(ctx: RuntimeContext, position: Requir
      *             Calculate delta distance and set grid value to minimum of
      *             itself and delta
      */
-    function projectPointsRange (begI: number, endI: number) {
+    function projectPointsRange(begI: number, endI: number) {
         for (let i = begI; i < endI; ++i) {
             const j = OrderedSet.getAt(indices, i);
             const vx = px[j], vy = py[j], vz = pz[j];
@@ -292,7 +292,7 @@ export async function calcMolecularSurface(ctx: RuntimeContext, position: Requir
         }
     }
 
-    function projectToriiRange (begI: number, endI: number) {
+    function projectToriiRange(begI: number, endI: number) {
         for (let i = begI; i < endI; ++i) {
             const k = OrderedSet.getAt(indices, i);
             lookup3d.find(px[k], py[k], pz[k], radius[k]);

+ 1 - 1
src/mol-math/geometry/spacegroup/construction.ts

@@ -120,7 +120,7 @@ namespace Spacegroup {
      */
     export function getSymmetryOperatorRef(spacegroup: Spacegroup, spgrOp: number, i: number, j: number, k: number, ref: Vec3) {
 
-        const operator =  Mat4.zero();
+        const operator = Mat4.zero();
 
         Vec3.set(_ijkVec, i, j, k);
         Vec3.floor(_translationRef, ref);

+ 33 - 33
src/mol-math/geometry/spacegroup/tables.ts

@@ -971,12 +971,12 @@ export const GroupData = [
     [0, 52, 16, 1, 26, 59, 20, 65],
     [0, 31, 1, 63],
     [0, 1, 24, 62],
-    [0, 15, 1, 9],  // 'P 1 21/n 1'
+    [0, 15, 1, 9], // 'P 1 21/n 1'
     // X,Y,Z
     // -X+1/2,Y+1/2,-Z+1/2
     // -X,-Y,-Z
     // X+1/2,-Y+1/2,Z+1/2
-    [0, 5, 1, 8],  // 'P 1 21/a 1'
+    [0, 5, 1, 8], // 'P 1 21/a 1'
     // X,Y,Z
     // -X+1/2,Y+1/2,-Z
     // -X,-Y,-Z
@@ -1357,37 +1357,37 @@ export function getSpacegroupIndexFromNumber(num: number) {
         case 1166: return 171;
         case 1167: return 173;
 
-        case 1003: return 237;  // 'P 1 1 2'  !(dyad along z)
-        case 1004: return 238;  // 'P 1 1 21'  !(unique axis c)
-        case 1005: return 239;  // 'B 1 1 2' 'B 2'
-        case 2005: return 240;  // 'A 1 2 1'
-        case 3005: return 241;  // 'C 1 21 1' ! (Origin on screw at 1/4X)
-        case 4005: return 242;  // 'I 1 2 1' 'I 2' !!! GJK @ 2003-06-02
-        case 5005: return 243;  // 'I 1 21 1'
-        case 1006: return 244;  // 'P 1 1 m'
-        case 1007: return 245;  // 'P 1 1 b'
-        case 1008: return 246;  // 'B 1 1 m'
-        case 1009: return 247;  // 'B 1 1 b'
-        case 1010: return 248;  // 'P 1 1 2/m'
-        case 1011: return 249;  // 'P 1 1 21/m'
-        case 1012: return 250;  // 'B 1 1 2/m'
-        case 1013: return 251;  // 'P 1 1 2/b'
-        case 1014: return 252;  // 'P 1 1 21/b'
-        case 2014: return 253;  // 'P 1 21/n 1'
-        case 3014: return 254;  // 'P 1 21/a 1'
-        case 1015: return 255;  // 'B 1 1 2/b'
-        case 1017: return 256;  // 'P 21 2 2' !(unique axis a)
-        case 2017: return 257;  // 'P 2 21 2' !(unique axis b)
-        case 1018: return 258;  // 'P 21 21 2 (a)' ! origin on 21 21, shift (1/4,1/4,0)
-        case 2018: return 259;  // 'P 21 2 21'  !(unique axis b)
-        case 3018: return 260;  // 'P 2 21 21'  !(unique axis a)
-        case 1020: return 261;  // 'C 2 2 21a)' ! P212121 with C centring, shift(1/4,0,0)
-        case 1021: return 262;  // 'C 2 2 2a'  ! C21212a origin on 21 21
-        case 1022: return 263;  // 'F 2 2 2a' ! same as 1018 with face centring  shift (1/4,0,0)
-        case 1023: return 264;  // 'I 2 2 2a'  ! as 1018 with origin shift (1/4,1/4,1/4)
-        case 1059: return 265;  // 'P 21/m 21/m 2/n a'
-        case 1094: return 266;  // 'P 42 21 2a' ! (as P21212a) origin on 21 21 ie Shift 1/4,1/4,1/4
-        case 1197: return 267;  // 'I 2 3a' ! Expansion of 1023 which is an expansion of 1018
+        case 1003: return 237; // 'P 1 1 2'  !(dyad along z)
+        case 1004: return 238; // 'P 1 1 21'  !(unique axis c)
+        case 1005: return 239; // 'B 1 1 2' 'B 2'
+        case 2005: return 240; // 'A 1 2 1'
+        case 3005: return 241; // 'C 1 21 1' ! (Origin on screw at 1/4X)
+        case 4005: return 242; // 'I 1 2 1' 'I 2' !!! GJK @ 2003-06-02
+        case 5005: return 243; // 'I 1 21 1'
+        case 1006: return 244; // 'P 1 1 m'
+        case 1007: return 245; // 'P 1 1 b'
+        case 1008: return 246; // 'B 1 1 m'
+        case 1009: return 247; // 'B 1 1 b'
+        case 1010: return 248; // 'P 1 1 2/m'
+        case 1011: return 249; // 'P 1 1 21/m'
+        case 1012: return 250; // 'B 1 1 2/m'
+        case 1013: return 251; // 'P 1 1 2/b'
+        case 1014: return 252; // 'P 1 1 21/b'
+        case 2014: return 253; // 'P 1 21/n 1'
+        case 3014: return 254; // 'P 1 21/a 1'
+        case 1015: return 255; // 'B 1 1 2/b'
+        case 1017: return 256; // 'P 21 2 2' !(unique axis a)
+        case 2017: return 257; // 'P 2 21 2' !(unique axis b)
+        case 1018: return 258; // 'P 21 21 2 (a)' ! origin on 21 21, shift (1/4,1/4,0)
+        case 2018: return 259; // 'P 21 2 21'  !(unique axis b)
+        case 3018: return 260; // 'P 2 21 21'  !(unique axis a)
+        case 1020: return 261; // 'C 2 2 21a)' ! P212121 with C centring, shift(1/4,0,0)
+        case 1021: return 262; // 'C 2 2 2a'  ! C21212a origin on 21 21
+        case 1022: return 263; // 'F 2 2 2a' ! same as 1018 with face centring  shift (1/4,0,0)
+        case 1023: return 264; // 'I 2 2 2a'  ! as 1018 with origin shift (1/4,1/4,1/4)
+        case 1059: return 265; // 'P 21/m 21/m 2/n a'
+        case 1094: return 266; // 'P 42 21 2a' ! (as P21212a) origin on 21 21 ie Shift 1/4,1/4,1/4
+        case 1197: return 267; // 'I 2 3a' ! Expansion of 1023 which is an expansion of 1018
     }
 
     let offset = 0;

+ 11 - 11
src/mol-math/interpolate.ts

@@ -4,33 +4,33 @@
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
  */
 
-export function normalize (value: number, min: number, max: number) {
+export function normalize(value: number, min: number, max: number) {
     return (value - min) / (max - min);
 }
 
-export function clamp (value: number, min: number, max: number) {
+export function clamp(value: number, min: number, max: number) {
     return Math.max(min, Math.min(max, value));
 }
 
-export function pclamp (value: number) {
+export function pclamp(value: number) {
     return clamp(value, 0, 100);
 }
 
-export function saturate (value: number) {
+export function saturate(value: number) {
     return clamp(value, 0, 1);
 }
 
-export function damp (value: number, dampingFactor: number) {
+export function damp(value: number, dampingFactor: number) {
     const dampedValue = value * dampingFactor;
     return Math.abs(dampedValue) < 0.1 ? 0 : dampedValue;
 }
 
-export function lerp (start: number, stop: number, alpha: number) {
+export function lerp(start: number, stop: number, alpha: number) {
     return start + (stop - start) * alpha;
 }
 
 /** Catmul-Rom spline */
-export function spline (p0: number, p1: number, p2: number, p3: number, t: number, tension: number) {
+export function spline(p0: number, p1: number, p2: number, p3: number, t: number, tension: number) {
     const v0 = (p2 - p0) * tension;
     const v1 = (p3 - p1) * tension;
     const t2 = t * t;
@@ -43,22 +43,22 @@ export function quadraticBezier(p0: number, p1: number, p2: number, t: number) {
     return (k * k * p0) + (2 * k * t * p1) + (t * t * p2);
 }
 
-export function smoothstep (min: number, max: number, x: number) {
+export function smoothstep(min: number, max: number, x: number) {
     x = saturate(normalize(x, min, max));
     return x * x * (3 - 2 * x);
 }
 
-export function smootherstep (min: number, max: number, x: number) {
+export function smootherstep(min: number, max: number, x: number) {
     x = saturate(normalize(x, min, max));
     return x * x * x * (x * (x * 6 - 15) + 10);
 }
 
-export function smootheststep (min: number, max: number, x: number) {
+export function smootheststep(min: number, max: number, x: number) {
     x = saturate(normalize(x, min, max));
     return -20 * Math.pow(x, 7) + 70 * Math.pow(x, 6) - 84 * Math.pow(x, 5) + 35 * Math.pow(x, 4);
 }
 
-export function almostIdentity (value: number, start: number, stop: number) {
+export function almostIdentity(value: number, start: number, stop: number) {
     if (value > start) return value;
     const a = 2 * stop - start;
     const b = 2 * start - 3 * stop;

+ 5 - 5
src/mol-math/linear-algebra/3d/quat.ts

@@ -193,8 +193,8 @@ namespace Quat {
         // calculate coefficients
         if ((1.0 - cosom) > 0.000001) {
             // standard case (slerp)
-            omega  = Math.acos(cosom);
-            sinom  = Math.sin(omega);
+            omega = Math.acos(cosom);
+            sinom = Math.sin(omega);
             scale0 = Math.sin((1.0 - t) * omega) / sinom;
             scale1 = Math.sin(t * omega) / sinom;
         } else {
@@ -252,9 +252,9 @@ namespace Quat {
 
         if (fTrace > 0.0) {
             // |w| > 1/2, may as well choose w > 1/2
-            fRoot = Math.sqrt(fTrace + 1.0);  // 2w
+            fRoot = Math.sqrt(fTrace + 1.0); // 2w
             out[3] = 0.5 * fRoot;
-            fRoot = 0.5 / fRoot;  // 1/(4w)
+            fRoot = 0.5 / fRoot; // 1/(4w)
             out[0] = (m[5] - m[7]) * fRoot;
             out[1] = (m[6] - m[2]) * fRoot;
             out[2] = (m[1] - m[3]) * fRoot;
@@ -279,7 +279,7 @@ namespace Quat {
 
     const fromUnitVec3Temp = [0, 0, 0] as Vec3;
     /** Quaternion from two normalized unit vectors. */
-    export function fromUnitVec3 (out: Quat, a: Vec3, b: Vec3) {
+    export function fromUnitVec3(out: Quat, a: Vec3, b: Vec3) {
         // assumes a and b are normalized
         let r = Vec3.dot(a, b) + 1;
         if (r < EPSILON) {

+ 3 - 3
src/mol-math/linear-algebra/matrix/evd.ts

@@ -19,9 +19,9 @@ export namespace EVD {
         return {
             size,
             matrix: Matrix.create(size, size),
-            eigenValues: <any>new Float64Array(size),
-            D: <any>new Float64Array(size),
-            E: <any>new Float64Array(size)
+            eigenValues: <any> new Float64Array(size),
+            D: <any> new Float64Array(size),
+            E: <any> new Float64Array(size)
         };
     }
 

+ 5 - 5
src/mol-math/misc.ts

@@ -7,15 +7,15 @@
 export const halfPI = Math.PI / 2;
 export const PiDiv180 = Math.PI / 180;
 
-export function degToRad (deg: number) {
-    return deg * PiDiv180;  // deg * Math.PI / 180
+export function degToRad(deg: number) {
+    return deg * PiDiv180; // deg * Math.PI / 180
 }
 
-export function radToDeg (rad: number) {
-    return rad / PiDiv180;  // rad * 180 / Math.PI
+export function radToDeg(rad: number) {
+    return rad / PiDiv180; // rad * 180 / Math.PI
 }
 
-export function isPowerOfTwo (x: number) {
+export function isPowerOfTwo(x: number) {
     return (x !== 0) && (x & (x - 1)) === 0;
 }
 

+ 1 - 1
src/mol-model-formats/shape/ply.ts

@@ -186,7 +186,7 @@ function getGrouping(vertex: PlyTable, props: PD.Values<PlyShapeParams>): Groupi
     const maxId = column ? arrayMax(ids) : rowCount - 1; // assumes uint ids
     const map = new Uint32Array(maxId + 1);
     for (let i = 0, il = ids.length; i < il; ++i) map[ids[i]] = i;
-    return { ids, map, label  };
+    return { ids, map, label };
 }
 
 type Coloring = { kind: 'vertex' | 'material' | 'uniform', red: Column<number>, green: Column<number>, blue: Column<number> }

+ 1 - 1
src/mol-model-formats/structure/basic/properties.ts

@@ -77,7 +77,7 @@ function getSaccharideComponentMap(data: BasicData): SaccharideComponentMap {
     }
 
     if (data.chem_comp._rowCount > 0) {
-        const { id, type  } = data.chem_comp;
+        const { id, type } = data.chem_comp;
         for (let i = 0, il = id.rowCount; i < il; ++i) {
             const _id = id.value(i);
             if (map.has(_id)) continue;

+ 1 - 1
src/mol-model-formats/structure/cif-core.ts

@@ -160,7 +160,7 @@ async function getModels(db: CifCore_Database, format: CifCoreFormat, ctx: Runti
         ModelSymmetry.Provider.set(first, symmetry);
 
         const bondCount = db.geom_bond._rowCount;
-        if(bondCount > 0) {
+        if (bondCount > 0) {
             const labelIndexMap: { [label: string]: number } = {};
             const { label } = db.atom_site;
             for (let i = 0, il = label.rowCount; i < il; ++i) {

+ 3 - 3
src/mol-model-formats/structure/common/component.ts

@@ -33,7 +33,7 @@ const NonPolymerNames = new Set([
     'FMN', 'NCN', 'FNS', 'FMA' // Mononucleotides
 ]);
 
-const StandardComponents = (function() {
+const StandardComponents = (function () {
     const map = new Map<string, Component>();
     const components: Component[] = [
         { id: 'HIS', name: 'HISTIDINE', type: 'L-peptide linking' },
@@ -83,7 +83,7 @@ const StandardComponents = (function() {
     return map;
 })();
 
-const CharmmIonComponents = (function() {
+const CharmmIonComponents = (function () {
     const map = new Map<string, Component>();
     const components: Component[] = [
         { id: 'ZN2', name: 'ZINC ION', type: 'Ion' },
@@ -126,7 +126,7 @@ export class ComponentBuilder {
         return atomIds;
     }
 
-    private hasAtomIds (atomIds: Set<string>, atomIdsList: Set<string>[]) {
+    private hasAtomIds(atomIds: Set<string>, atomIdsList: Set<string>[]) {
         for (let i = 0, il = atomIdsList.length; i < il; ++i) {
             if (!SetUtils.areIntersecting(atomIds, atomIdsList[i])) {
                 return false;

+ 1 - 1
src/mol-model-formats/structure/common/util.ts

@@ -8,7 +8,7 @@ import { memoize1 } from '../../../mol-util/memoize';
 
 const ChainIdAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
 
-function _getChainId (index: number) {
+function _getChainId(index: number) {
     const n = ChainIdAlphabet.length;
     let j = index;
     let k = 0;

+ 6 - 6
src/mol-model-formats/structure/util.ts

@@ -25,22 +25,22 @@ export function guessElementSymbolTokens(tokens: Tokens, str: string, start: num
     if (s + 2 === e) { // two chars
         const c2 = str.charCodeAt(s + 1);
         if (
-            ((c === 78 || c === 110) && (c2 === 65 || c2 ===  97)) || // NA na Na nA
-            ((c === 67 || c ===  99) && (c2 === 76 || c2 === 108)) || // CL
+            ((c === 78 || c === 110) && (c2 === 65 || c2 === 97)) || // NA na Na nA
+            ((c === 67 || c === 99) && (c2 === 76 || c2 === 108)) || // CL
             ((c === 70 || c === 102) && (c2 === 69 || c2 === 101)) || // FE
             ((c === 83 || c === 115) && (c2 === 73 || c2 === 105)) || // SI
-            ((c === 66 || c === 98) && (c2 === 82 || c2 === 114)) ||  // BR
-            ((c === 65 || c === 97) && (c2 === 83 || c2 === 115))     // AS
+            ((c === 66 || c === 98) && (c2 === 82 || c2 === 114)) || // BR
+            ((c === 65 || c === 97) && (c2 === 83 || c2 === 115)) // AS
         ) return TokenBuilder.add(tokens, s, s + 2);
     }
 
     if (
-        c === 67 || c ===  99 || // C c
+        c === 67 || c === 99 || // C c
         c === 72 || c === 104 || // H h
         c === 78 || c === 110 || // N n
         c === 79 || c === 111 || // O o
         c === 80 || c === 112 || // P p
-        c === 83 || c === 115    // S s
+        c === 83 || c === 115 // S s
     ) return TokenBuilder.add(tokens, s, s + 1);
 
     TokenBuilder.add(tokens, s, s); // no reasonable guess, add empty token

+ 1 - 1
src/mol-model-props/computed/accessible-surface-area/shrake-rupley/common.ts

@@ -32,7 +32,7 @@ export const VdWLookup = [
     1.85, // 6: S
     1.80, // 7: C (nucleic)
     1.60, // 8: N (nucleic)
-    1.40  // 9: P (nucleic)
+    1.40 // 9: P (nucleic)
 ]; // can still be appended on-the-fly for rare elements like selenium
 
 /** Maximum accessible surface area observed for amino acids. Taken from: http://dx.doi.org/10.1371/journal.pone.0080635 */

+ 1 - 1
src/mol-model-props/computed/accessible-surface-area/shrake-rupley/radii.ts

@@ -94,7 +94,7 @@ function determineRadiusAmino(atomId: string, element: ElementSymbol, compId: st
             return atomId === 'NZ' ? 4 : 3;
         case 'C':
             switch (atomId) {
-                case 'C': case 'CE1': case'CE2': case 'CE3': case 'CH2': case 'CZ': case 'CZ2': case 'CZ3':
+                case 'C': case 'CE1': case 'CE2': case 'CE3': case 'CH2': case 'CZ': case 'CZ2': case 'CZ3':
                     return 1;
                 case 'CA': case 'CB': case 'CE': case 'CG1': case 'CG2':
                     return 2;

+ 7 - 7
src/mol-model-props/computed/chemistry/functional-group.ts

@@ -111,7 +111,7 @@ export function isSulfate(structure: Structure, unit: Unit.Atomic, index: Struct
 /**
  * Phosphor in a phosphate group
  */
-export function isPhosphate (structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex) {
+export function isPhosphate(structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex) {
     return (
         typeSymbol(unit, index) === Elements.P &&
         bondToElementCount(structure, unit, index, Elements.O) === bondCount(structure, unit, index)
@@ -121,7 +121,7 @@ export function isPhosphate (structure: Structure, unit: Unit.Atomic, index: Str
 /**
  * Halogen with one bond to a carbon
  */
-export function isHalocarbon (structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex) {
+export function isHalocarbon(structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex) {
     return (
         isHalogen(typeSymbol(unit, index)) &&
         bondCount(structure, unit, index) === 1 &&
@@ -151,7 +151,7 @@ export function isCarbonyl(structure: Structure, unit: Unit.Atomic, index: Struc
 /**
  * Carbon in a carboxylate group
  */
-export function isCarboxylate (structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex) {
+export function isCarboxylate(structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex) {
     let terminalOxygenCount = 0;
     if (
         typeSymbol(unit, index) === Elements.C &&
@@ -173,7 +173,7 @@ export function isCarboxylate (structure: Structure, unit: Unit.Atomic, index: S
 /**
  * Carbon in a guanidine group
  */
-export function isGuanidine (structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex) {
+export function isGuanidine(structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex) {
     let terminalNitrogenCount = 0;
     if (
         typeSymbol(unit, index) === Elements.C &&
@@ -194,7 +194,7 @@ export function isGuanidine (structure: Structure, unit: Unit.Atomic, index: Str
 /**
  * Carbon in a acetamidine group
  */
-export function isAcetamidine (structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex) {
+export function isAcetamidine(structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex) {
     let terminalNitrogenCount = 0;
     if (
         typeSymbol(unit, index) === Elements.C &&
@@ -216,7 +216,7 @@ export function isAcetamidine (structure: Structure, unit: Unit.Atomic, index: S
 const PolarElements = new Set<ElementSymbol>(['N', 'O', 'S', 'F', 'CL', 'BR', 'I'] as ElementSymbol[]);
 export function isPolar(element: ElementSymbol) { return PolarElements.has(element); }
 
-export function hasPolarNeighbour (structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex) {
+export function hasPolarNeighbour(structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex) {
     let flag = false;
     eachBondedAtom(structure, unit, index, (unit: Unit.Atomic, index: StructureElement.UnitIndex) => {
         if (isPolar(typeSymbol(unit, index))) flag = true;
@@ -224,7 +224,7 @@ export function hasPolarNeighbour (structure: Structure, unit: Unit.Atomic, inde
     return flag;
 }
 
-export function hasAromaticNeighbour (structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex) {
+export function hasAromaticNeighbour(structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex) {
     let flag = false;
     eachBondedAtom(structure, unit, index, (unit: Unit.Atomic, index: StructureElement.UnitIndex) => {
         if (isAromatic(unit, index)) flag = true;

+ 3 - 3
src/mol-model-props/computed/chemistry/geometry.ts

@@ -50,7 +50,7 @@ export function geometryLabel(geometry: AtomGeometry): string {
     }
 }
 
-export function assignGeometry (totalCoordination: number): AtomGeometry {
+export function assignGeometry(totalCoordination: number): AtomGeometry {
     switch (totalCoordination) {
         case 0: return AtomGeometry.Spherical;
         case 1: return AtomGeometry.Terminal;
@@ -79,7 +79,7 @@ const tmpPosX = Vec3();
 /**
  * Calculate the angles x-a1-a2 for all x where x is a heavy atom (not H) bonded to ap1.
  */
-export function calcAngles (structure: Structure, unitA: Unit.Atomic, indexA: StructureElement.UnitIndex, unitB: Unit.Atomic, indexB: StructureElement.UnitIndex): number[] {
+export function calcAngles(structure: Structure, unitA: Unit.Atomic, indexA: StructureElement.UnitIndex, unitB: Unit.Atomic, indexB: StructureElement.UnitIndex): number[] {
     const angles: number[] = [];
     unitA.conformation.position(unitA.elements[indexA], tmpPosA);
     unitB.conformation.position(unitB.elements[indexB], tmpPosB);
@@ -102,7 +102,7 @@ export function calcAngles (structure: Structure, unitA: Unit.Atomic, indexA: St
  * @param  {AtomProxy} ap2 Second atom (out-of-plane)
  * @return {number}        Angle from plane to second atom
  */
-export function calcPlaneAngle (structure: Structure, unitA: Unit.Atomic, indexA: StructureElement.UnitIndex, unitB: Unit.Atomic, indexB: StructureElement.UnitIndex): number | undefined {
+export function calcPlaneAngle(structure: Structure, unitA: Unit.Atomic, indexA: StructureElement.UnitIndex, unitB: Unit.Atomic, indexB: StructureElement.UnitIndex): number | undefined {
     unitA.conformation.position(unitA.elements[indexA], tmpPosA);
     unitB.conformation.position(unitB.elements[indexB], tmpPosB);
     Vec3.sub(tmpDir1, tmpPosB, tmpPosA);

+ 3 - 3
src/mol-model-props/computed/chemistry/valence-model.ts

@@ -36,7 +36,7 @@ const tmpConjBondItB = new Bond.ElementBondIterator();
  *   N,O with degree 4 cannot be conjugated.
  *   N,O adjacent to P=O or S=O do not qualify (keeps sulfonamide N sp3 geom)
  */
-function isConjugated (structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex) {
+function isConjugated(structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex) {
     const element = typeSymbol(unit, index);
     const hetero = element === Elements.O || element === Elements.N;
 
@@ -65,7 +65,7 @@ function isConjugated (structure: Structure, unit: Unit.Atomic, index: Structure
     return false;
 }
 
-export function explicitValence (structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex) {
+export function explicitValence(structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex) {
     let v = 0;
     // intra-unit bonds
     const { offset, edgeProps: { flags, order } } = unit.bonds;
@@ -94,7 +94,7 @@ const tmpChargeBondItB = new Bond.ElementBondIterator();
  * If only charge or hydrogens are to be assigned it takes
  * a much simpler view and deduces one from the other
  */
-export function calculateHydrogensCharge (structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex, props: ValenceModelProps) {
+export function calculateHydrogensCharge(structure: Structure, unit: Unit.Atomic, index: StructureElement.UnitIndex, props: ValenceModelProps) {
     const hydrogenCount = bondToElementCount(structure, unit, index, Elements.H);
     const element = typeSymbol(unit, index);
     let charge = formalCharge(unit, index);

+ 2 - 2
src/mol-model-props/computed/interactions/charged.ts

@@ -311,9 +311,9 @@ function testPiStacking(structure: Structure, infoA: Features.Info, infoB: Featu
         const offset = Math.min(getOffset(infoA, infoB, tmpNormalB), getOffset(infoB, infoA, tmpNormalA));
         if (offset <= opts.offsetMax) {
             if (angle <= opts.angleDevMax || angle >= deg180InRad - opts.angleDevMax) {
-                return InteractionType.PiStacking;  // parallel
+                return InteractionType.PiStacking; // parallel
             } else if (angle <= opts.angleDevMax + deg90InRad && angle >= deg90InRad - opts.angleDevMax) {
-                return InteractionType.PiStacking;  // t-shaped
+                return InteractionType.PiStacking; // t-shaped
             }
         }
     }

+ 1 - 1
src/mol-model-props/computed/interactions/halogen-bonds.ts

@@ -76,7 +76,7 @@ function isHalogenBond(ti: FeatureType, tj: FeatureType) {
 }
 
 // http://www.pnas.org/content/101/48/16789.full
-const OptimalHalogenAngle = degToRad(180);  // adjusted from 165 to account for spherical statistics
+const OptimalHalogenAngle = degToRad(180); // adjusted from 165 to account for spherical statistics
 const OptimalAcceptorAngle = degToRad(120);
 
 function getOptions(props: HalogenBondsProps) {

+ 2 - 2
src/mol-model-props/computed/interactions/hydrogen-bonds.ts

@@ -227,8 +227,8 @@ function getHydrogenBondsOptions(props: HydrogenBondsProps) {
     return {
         ...getGeometryOptions(props),
         includeWater: props.water,
-        maxSulfurDistSq: props.sulfurDistanceMax *  props.sulfurDistanceMax,
-        maxDistSq: props.distanceMax *  props.distanceMax
+        maxSulfurDistSq: props.sulfurDistanceMax * props.sulfurDistanceMax,
+        maxDistSq: props.distanceMax * props.distanceMax
     };
 }
 type HydrogenBondsOptions = ReturnType<typeof getHydrogenBondsOptions>

+ 2 - 2
src/mol-model/loci.ts

@@ -262,9 +262,9 @@ namespace Loci {
     export type Granularity = keyof typeof Granularity
     export const GranularityOptions = ParamDefinition.objectToOptions(Granularity, k => {
         switch (k) {
-            case 'element': return'Atom/Coarse Element';
+            case 'element': return 'Atom/Coarse Element';
             case 'elementInstances': return ['Atom/Coarse Element Instances', 'With Symmetry'];
-            case 'structure': return'Structure/Shape';
+            case 'structure': return 'Structure/Shape';
             default: return k.indexOf('Instances')
                 ? [stringToWords(k), 'With Symmetry'] : stringToWords(k);
         }

+ 8 - 8
src/mol-model/sequence/alignment/alignment.ts

@@ -27,7 +27,7 @@ class Alignment {
     readonly n: number; readonly m: number
     readonly S: number[][] = []; readonly V: number[][] = []; readonly H: number[][] = []
 
-    constructor (readonly seqA: ArrayLike<string>, readonly seqB: ArrayLike<string>, options: AlignmentOptions) {
+    constructor(readonly seqA: ArrayLike<string>, readonly seqB: ArrayLike<string>, options: AlignmentOptions) {
         this.gapPenalty = options.gapPenalty;
         this.gapExtensionPenalty = options.gapExtensionPenalty;
         this.substMatrix = options.substMatrix === 'default' ? undefined : SubstitutionMatrices[options.substMatrix];
@@ -36,7 +36,7 @@ class Alignment {
         this.m = this.seqB.length;
     }
 
-    private initMatrices () {
+    private initMatrices() {
         const { n, m, gapPenalty, S, V, H } = this;
 
         for (let i = 0; i <= n; ++i) {
@@ -60,17 +60,17 @@ class Alignment {
         S[0][0] = 0;
     }
 
-    private makeScoreFn () {
+    private makeScoreFn() {
         const { seqA, seqB, substMatrix } = this;
 
         if (substMatrix) {
-            return function score (i: number, j: number) {
+            return function score(i: number, j: number) {
                 const cA = seqA[i];
                 const cB = seqB[j];
                 return substMatrix[cA]?.[cB] ?? -4;
             };
         } else {
-            return function scoreNoSubstMat (i: number, j: number) {
+            return function scoreNoSubstMat(i: number, j: number) {
                 const cA = seqA[i];
                 const cB = seqB[j];
                 return cA === cB ? 5 : -3;
@@ -78,7 +78,7 @@ class Alignment {
         }
     }
 
-    calculate () {
+    calculate() {
         this.initMatrices();
 
         const scoreFn = this.makeScoreFn();
@@ -103,13 +103,13 @@ class Alignment {
                 Si[j] = Math.max(
                     Si1[j - 1] + scoreFn(i - 1, j - 1), // match
                     Vi[j], // del
-                    Hi[j]  // ins
+                    Hi[j] // ins
                 );
             }
         }
     }
 
-    trace (): { aliA: ArrayLike<string>, aliB: ArrayLike<string>, score: number } {
+    trace(): { aliA: ArrayLike<string>, aliB: ArrayLike<string>, score: number } {
         const scoreFn = this.makeScoreFn();
         const { V, H, S, seqA, seqB, gapExtensionPenalty, gapPenalty } = this;
 

+ 22 - 22
src/mol-model/sequence/alignment/substitution-matrix.ts

@@ -10,26 +10,26 @@ const aminoacidsX = 'ACDEFGHIKLMNPQRSTVWY';
 const aminoacids = 'ARNDCQEGHILKMFPSTWYVBZX';
 
 const blosum62x = [
-    [4, 0, -2, -1, -2, 0, -2, -1, -1, -1, -1, -2, -1, -1, -1, 1, 0, 0, -3, -2],        // A
-    [0, 9, -3, -4, -2, -3, -3, -1, -3, -1, -1, -3, -3, -3, -3, -1, -1, -1, -2, -2],    // C
-    [-2, -3, 6, 2, -3, -1, -1, -3, -1, -4, -3, 1, -1, 0, -2, 0, -1, -3, -4, -3],       // D
-    [-1, -4, 2, 5, -3, -2, 0, -3, 1, -3, -2, 0, -1, 2, 0, 0, -1, -2, -3, -2],          // E
-    [-2, -2, -3, -3, 6, -3, -1, 0, -3, 0, 0, -3, -4, -3, -3, -2, -2, -1, 1, 3],        // F
-    [0, -3, -1, -2, -3, 6, -2, -4, -2, -4, -3, 0, -2, -2, -2, 0, -2, -3, -2, -3],      // G
-    [-2, -3, -1, 0, -1, -2, 8, -3, -1, -3, -2, 1, -2, 0, 0, -1, -2, -3, -2, 2],        // H
-    [-1, -1, -3, -3, 0, -4, -3, 4, -3, 2, 1, -3, -3, -3, -3, -2, -1, 3, -3, -1],       // I
-    [-1, -3, -1, 1, -3, -2, -1, -3, 5, -2, -1, 0, -1, 1, 2, 0, -1, -2, -3, -2],        // K
-    [-1, -1, -4, -3, 0, -4, -3, 2, -2, 4, 2, -3, -3, -2, -2, -2, -1, 1, -2, -1],       // L
-    [-1, -1, -3, -2, 0, -3, -2, 1, -1, 2, 5, -2, -2, 0, -1, -1, -1, 1, -1, -1],        // M
-    [-2, -3, 1, 0, -3, 0, 1, -3, 0, -3, -2, 6, -2, 0, 0, 1, 0, -3, -4, -2],            // N
-    [-1, -3, -1, -1, -4, -2, -2, -3, -1, -3, -2, -2, 7, -1, -2, -1, -1, -2, -4, -3],   // P
-    [-1, -3, 0, 2, -3, -2, 0, -3, 1, -2, 0, 0, -1, 5, 1, 0, -1, -2, -2, -1],           // Q
-    [-1, -3, -2, 0, -3, -2, 0, -3, 2, -2, -1, 0, -2, 1, 5, -1, -1, -3, -3, -2],        // R
-    [1, -1, 0, 0, -2, 0, -1, -2, 0, -2, -1, 1, -1, 0, -1, 4, 1, -2, -3, -2],           // S
-    [0, -1, -1, -1, -2, -2, -2, -1, -1, -1, -1, 0, -1, -1, -1, 1, 5, 0, -2, -2],       // T
-    [0, -1, -3, -2, -1, -3, -3, 3, -2, 1, 1, -3, -2, -2, -3, -2, 0, 4, -3, -1],        // V
-    [-3, -2, -4, -3, 1, -2, -2, -3, -3, -2, -1, -4, -4, -2, -3, -3, -2, -3, 11, 2],    // W
-    [-2, -2, -3, -2, 3, -3, 2, -1, -2, -1, -1, -2, -3, -1, -2, -2, -2, -1, 2, 7]       // Y
+    [4, 0, -2, -1, -2, 0, -2, -1, -1, -1, -1, -2, -1, -1, -1, 1, 0, 0, -3, -2], // A
+    [0, 9, -3, -4, -2, -3, -3, -1, -3, -1, -1, -3, -3, -3, -3, -1, -1, -1, -2, -2], // C
+    [-2, -3, 6, 2, -3, -1, -1, -3, -1, -4, -3, 1, -1, 0, -2, 0, -1, -3, -4, -3], // D
+    [-1, -4, 2, 5, -3, -2, 0, -3, 1, -3, -2, 0, -1, 2, 0, 0, -1, -2, -3, -2], // E
+    [-2, -2, -3, -3, 6, -3, -1, 0, -3, 0, 0, -3, -4, -3, -3, -2, -2, -1, 1, 3], // F
+    [0, -3, -1, -2, -3, 6, -2, -4, -2, -4, -3, 0, -2, -2, -2, 0, -2, -3, -2, -3], // G
+    [-2, -3, -1, 0, -1, -2, 8, -3, -1, -3, -2, 1, -2, 0, 0, -1, -2, -3, -2, 2], // H
+    [-1, -1, -3, -3, 0, -4, -3, 4, -3, 2, 1, -3, -3, -3, -3, -2, -1, 3, -3, -1], // I
+    [-1, -3, -1, 1, -3, -2, -1, -3, 5, -2, -1, 0, -1, 1, 2, 0, -1, -2, -3, -2], // K
+    [-1, -1, -4, -3, 0, -4, -3, 2, -2, 4, 2, -3, -3, -2, -2, -2, -1, 1, -2, -1], // L
+    [-1, -1, -3, -2, 0, -3, -2, 1, -1, 2, 5, -2, -2, 0, -1, -1, -1, 1, -1, -1], // M
+    [-2, -3, 1, 0, -3, 0, 1, -3, 0, -3, -2, 6, -2, 0, 0, 1, 0, -3, -4, -2], // N
+    [-1, -3, -1, -1, -4, -2, -2, -3, -1, -3, -2, -2, 7, -1, -2, -1, -1, -2, -4, -3], // P
+    [-1, -3, 0, 2, -3, -2, 0, -3, 1, -2, 0, 0, -1, 5, 1, 0, -1, -2, -2, -1], // Q
+    [-1, -3, -2, 0, -3, -2, 0, -3, 2, -2, -1, 0, -2, 1, 5, -1, -1, -3, -3, -2], // R
+    [1, -1, 0, 0, -2, 0, -1, -2, 0, -2, -1, 1, -1, 0, -1, 4, 1, -2, -3, -2], // S
+    [0, -1, -1, -1, -2, -2, -2, -1, -1, -1, -1, 0, -1, -1, -1, 1, 5, 0, -2, -2], // T
+    [0, -1, -3, -2, -1, -3, -3, 3, -2, 1, 1, -3, -2, -2, -3, -2, 0, 4, -3, -1], // V
+    [-3, -2, -4, -3, 1, -2, -2, -3, -3, -2, -1, -4, -4, -2, -3, -3, -2, -3, 11, 2], // W
+    [-2, -2, -3, -2, 3, -3, 2, -1, -2, -1, -1, -2, -3, -1, -2, -2, -2, -1, 2, 7] // Y
 ];
 
 const blosum62 = [
@@ -56,12 +56,12 @@ const blosum62 = [
     [0, -3, -3, -3, -1, -2, -2, -3, -3, 3, 1, -2, 1, -1, -2, -2, 0, -3, -1, 4, -3, -2, -1], // V
     [-2, -1, 3, 4, -3, 0, 1, -1, 0, -3, -4, 0, -3, -3, -2, 0, -1, -4, -3, -3, 4, 1, -1], // B
     [-1, 0, 0, 1, -3, 3, 4, -2, 0, -3, -3, 1, -1, -3, -1, 0, -1, -3, -2, -2, 1, 4, -1], // Z
-    [0, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, 0, 0, -2, -1, -1, -1, -1, -1]  // X
+    [0, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, 0, 0, -2, -1, -1, -1, -1, -1] // X
 ];
 
 export type SubstitutionMatrixData = Readonly<{ [k: string]: Readonly<{ [k: string]: number }> }>;
 
-function prepareMatrix (cellNames: string, mat: number[][]): SubstitutionMatrixData {
+function prepareMatrix(cellNames: string, mat: number[][]): SubstitutionMatrixData {
     let j: number;
     let i = 0;
     const matDict: Mutable<SubstitutionMatrixData> = {};

+ 3 - 3
src/mol-model/sequence/constants.ts

@@ -15,7 +15,7 @@ export type NuclecicAlphabet =
     | '-' /** = Gap */
 
 // from NGL
-const ProteinOneLetterCodes: { [name: string]: AminoAlphabet }  = {
+const ProteinOneLetterCodes: { [name: string]: AminoAlphabet } = {
     'HIS': 'H',
     'ARG': 'R',
     'LYS': 'K',
@@ -37,8 +37,8 @@ const ProteinOneLetterCodes: { [name: string]: AminoAlphabet }  = {
     'GLU': 'E',
     'THR': 'T',
 
-    'SEC': 'U',  // as per IUPAC definition
-    'PYL': 'O',  // as per IUPAC definition
+    'SEC': 'U', // as per IUPAC definition
+    'PYL': 'O', // as per IUPAC definition
 
     // charmm ff
     'HSD': 'H', 'HSE': 'H', 'HSP': 'H',

Some files were not shown because too many files changed in this diff