From 1cee84d9afe87a58503ce0e2d63fa16093655305 Mon Sep 17 00:00:00 2001 From: Alexander Rose <alexander.rose@weirdbyte.de> Date: Thu, 23 Jan 2020 10:14:03 -0800 Subject: [PATCH] fix formating --- src/apps/basic-wrapper/superposition.ts | 20 ++-- src/apps/chem-comp-bond/create-table.ts | 4 +- src/apps/structure-info/volume.ts | 4 +- src/examples/proteopedia-wrapper/index.ts | 6 +- src/mol-data/db/column.ts | 16 ++-- src/mol-data/generic/linked-list.ts | 4 +- .../util/_spec/interval-iterator.spec.ts | 4 +- src/mol-geo/geometry/text/font-atlas.ts | 10 +- src/mol-geo/primitive/box.ts | 31 +++---- src/mol-geo/primitive/dodecahedron.ts | 32 +++---- src/mol-geo/util/marching-cubes/builder.ts | 2 +- src/mol-io/reader/common/text/column/token.ts | 10 +- src/mol-math/linear-algebra/3d.ts | 6 +- src/mol-math/linear-algebra/3d/quat.ts | 14 +-- .../structure/pdb/assembly.ts | 22 ++--- .../computed/interactions/hydrogen-bonds.ts | 15 ++- src/mol-model-props/rcsb/graphql/types.ts | 92 +++++++++---------- .../representations/assembly-symmetry-axes.ts | 2 +- .../structure/model/properties/common.ts | 5 +- .../structure/carbohydrates/compute.ts | 8 +- .../structure/structure/element/stats.ts | 16 ++-- .../state/representation/structure/preset.ts | 2 +- src/mol-plugin/state/snapshots.ts | 4 +- .../state/transforms/representation.ts | 2 +- src/mol-repr/structure/units-visual.ts | 4 +- src/mol-script/language/expression.ts | 2 +- src/mol-script/runtime/query/table.ts | 3 - src/mol-state/state/builder.ts | 4 +- src/mol-state/tree/transient.ts | 4 +- src/mol-task/execution/observable.ts | 2 +- src/mol-task/util/scheduler.ts | 50 +++++----- src/mol-theme/label.ts | 1 - src/servers/model/local.ts | 39 ++++---- src/servers/model/server.ts | 12 +-- src/servers/model/utils/fetch-props-pdbe.ts | 8 +- src/servers/volume/common/binary-schema.ts | 9 +- src/servers/volume/server/algebra/box.ts | 4 - .../volume/server/algebra/coordinate.ts | 6 -- src/servers/volume/server/query/data-model.ts | 4 - src/servers/volume/server/query/identify.ts | 6 +- src/servers/volume/server/web-api.ts | 8 +- src/servers/volume/server/web-schema.ts | 2 +- 42 files changed, 236 insertions(+), 263 deletions(-) diff --git a/src/apps/basic-wrapper/superposition.ts b/src/apps/basic-wrapper/superposition.ts index 6197fbc42..13e487af0 100644 --- a/src/apps/basic-wrapper/superposition.ts +++ b/src/apps/basic-wrapper/superposition.ts @@ -50,16 +50,16 @@ export function buildStaticSuperposition(ctx: PluginContext, src: SuperpositionT export const StaticSuperpositionTestData: SuperpositionTestInput = [ { pdbId: '1aj5', auth_asym_id: 'A', matrix: Mat4.identity() }, - { pdbId: '1df0', auth_asym_id: 'B', matrix: Mat4.ofRows( - [[0.406, 0.879, 0.248, -200.633], - [0.693, -0.473, 0.544, 73.403], - [0.596, -0.049, -0.802, -14.209], - [0, 0, 0, 1]] )}, - { pdbId: '1dvi', auth_asym_id: 'A', matrix: Mat4.ofRows( - [[-0.053, -0.077, 0.996, -45.633], - [-0.312, 0.949, 0.057, -12.255], - [-0.949, -0.307, -0.074, 53.562], - [0, 0, 0, 1]] )} + { pdbId: '1df0', auth_asym_id: 'B', matrix: Mat4.ofRows([ + [0.406, 0.879, 0.248, -200.633], + [0.693, -0.473, 0.544, 73.403], + [0.596, -0.049, -0.802, -14.209], + [0, 0, 0, 1]] )}, + { pdbId: '1dvi', auth_asym_id: 'A', matrix: Mat4.ofRows([ + [-0.053, -0.077, 0.996, -45.633], + [-0.312, 0.949, 0.057, -12.255], + [-0.949, -0.307, -0.074, 53.562], + [0, 0, 0, 1]] )} ]; export async function dynamicSuperpositionTest(ctx: PluginContext, src: string[], comp_id: string) { diff --git a/src/apps/chem-comp-bond/create-table.ts b/src/apps/chem-comp-bond/create-table.ts index ba5410086..84091a6d6 100644 --- a/src/apps/chem-comp-bond/create-table.ts +++ b/src/apps/chem-comp-bond/create-table.ts @@ -226,8 +226,8 @@ const CCD_URL = 'http://ftp.wwpdb.org/pub/pdb/data/monomers/components.cif' const PVCD_URL = 'http://ftp.wwpdb.org/pub/pdb/data/monomers/aa-variants-v1.cif' const parser = new argparse.ArgumentParser({ - addHelp: true, - description: 'Create a cif file with one big table of all chem_comp_bond entries from the CCD and PVCD.' + addHelp: true, + description: 'Create a cif file with one big table of all chem_comp_bond entries from the CCD and PVCD.' }); parser.addArgument('out', { help: 'Generated file output path.' diff --git a/src/apps/structure-info/volume.ts b/src/apps/structure-info/volume.ts index bb337fb80..c3780e97c 100644 --- a/src/apps/structure-info/volume.ts +++ b/src/apps/structure-info/volume.ts @@ -77,8 +77,8 @@ async function run(url: string, meshFilename: string) { } const parser = new argparse.ArgumentParser({ -addHelp: true, -description: 'Info about VolumeData from mol-model module' + addHelp: true, + description: 'Info about VolumeData from mol-model module' }); parser.addArgument([ '--emdb', '-e' ], { help: 'EMDB id, for example 8116', diff --git a/src/examples/proteopedia-wrapper/index.ts b/src/examples/proteopedia-wrapper/index.ts index 6ff75c437..640739eda 100644 --- a/src/examples/proteopedia-wrapper/index.ts +++ b/src/examples/proteopedia-wrapper/index.ts @@ -160,9 +160,9 @@ class MolStarProteopediaWrapper { root.delete(StateElements.WaterVisual); } else { root.applyOrUpdate(StateElements.WaterVisual, StateTransforms.Representation.StructureRepresentation3D, - StructureRepresentation3DHelpers.getDefaultParamsWithTheme(this.plugin, - (style.water && style.water.kind) || 'ball-and-stick', - (style.water && style.water.coloring), structure, { alpha: 0.51 })); + StructureRepresentation3DHelpers.getDefaultParamsWithTheme(this.plugin, + (style.water && style.water.kind) || 'ball-and-stick', + (style.water && style.water.coloring), structure, { alpha: 0.51 })); } } diff --git a/src/mol-data/db/column.ts b/src/mol-data/db/column.ts index 997f26e4e..3bb3fe1f3 100644 --- a/src/mol-data/db/column.ts +++ b/src/mol-data/db/column.ts @@ -290,14 +290,14 @@ function arrayColumn<T extends Column.Schema>({ array, schema, valueKind }: Colu return ret; } : isTyped - ? params => ColumnHelpers.typedArrayWindow(array, params) as any as ReadonlyArray<T> - : params => { - const { start, end } = ColumnHelpers.getArrayBounds(rowCount, params); - if (start === 0 && end === array.length) return array as ReadonlyArray<T['T']>; - const ret = new (params && typeof params.array !== 'undefined' ? params.array : (array as any).constructor)(end - start) as any; - for (let i = 0, _i = end - start; i < _i; i++) ret[i] = array[start + i]; - return ret; - }, + ? params => ColumnHelpers.typedArrayWindow(array, params) as any as ReadonlyArray<T> + : params => { + const { start, end } = ColumnHelpers.getArrayBounds(rowCount, params); + if (start === 0 && end === array.length) return array as ReadonlyArray<T['T']>; + const ret = new (params && typeof params.array !== 'undefined' ? params.array : (array as any).constructor)(end - start) as any; + for (let i = 0, _i = end - start; i < _i; i++) ret[i] = array[start + i]; + return ret; + }, areValuesEqual: (rowA, rowB) => array[rowA] === array[rowB] } } diff --git a/src/mol-data/generic/linked-list.ts b/src/mol-data/generic/linked-list.ts index 3f5422699..fbea58bd8 100644 --- a/src/mol-data/generic/linked-list.ts +++ b/src/mol-data/generic/linked-list.ts @@ -90,14 +90,14 @@ class LinkedListImpl<T> implements LinkedList<T> { if (node.previous !== null) { node.previous.next = node.next; } - else if (/*first == item*/ node.previous === null) { + else if (/* first == item*/ node.previous === null) { this.first = node.next; } if (node.next !== null) { node.next.previous = node.previous; } - else if (/*last == item*/ node.next === null) { + else if (/* last == item*/ node.next === null) { this.last = node.previous; } diff --git a/src/mol-data/util/_spec/interval-iterator.spec.ts b/src/mol-data/util/_spec/interval-iterator.spec.ts index 078d63a3c..c2dabf885 100644 --- a/src/mol-data/util/_spec/interval-iterator.spec.ts +++ b/src/mol-data/util/_spec/interval-iterator.spec.ts @@ -7,12 +7,12 @@ import { Interval, OrderedSet, SortedArray } from '../../int'; import { IntervalIterator } from '../interval-iterator'; - describe('interval', () => { +describe('interval', () => { function testIterator(name: string, interval: Interval, set: OrderedSet, expectedValues: { index: number[], start: number[], end: number[]}) { it(`iterator, ${name}`, () => { const intervalIt = new IntervalIterator(interval, set) const { index, start, end } = expectedValues - + let i = 0 while (intervalIt.hasNext) { const segment = intervalIt.move() diff --git a/src/mol-geo/geometry/text/font-atlas.ts b/src/mol-geo/geometry/text/font-atlas.ts index 7ad994593..44e2b0547 100644 --- a/src/mol-geo/geometry/text/font-atlas.ts +++ b/src/mol-geo/geometry/text/font-atlas.ts @@ -24,11 +24,11 @@ export type FontVariant = 'normal' | 'small-caps' export type FontWeight = 'normal' | 'bold' export const FontAtlasParams = { - fontFamily: PD.Select('sans-serif', [['sans-serif', 'Sans Serif'], ['monospace', 'Monospace'], ['serif', 'Serif'], ['cursive', 'Cursive']] as [FontFamily, string][]), - fontQuality: PD.Select(3, [[0, 'lower'], [1, 'low'], [2, 'medium'], [3, 'high'], [4, 'higher']]), - fontStyle: PD.Select('normal', [['normal', 'Normal'], ['italic', 'Italic'], ['oblique', 'Oblique']] as [FontStyle, string][]), - fontVariant: PD.Select('normal', [['normal', 'Normal'], ['small-caps', 'Small Caps']] as [FontVariant, string][]), - fontWeight: PD.Select('normal', [['normal', 'Normal'], ['bold', 'Bold']] as [FontWeight, string][]), + fontFamily: PD.Select('sans-serif', [['sans-serif', 'Sans Serif'], ['monospace', 'Monospace'], ['serif', 'Serif'], ['cursive', 'Cursive']] as [FontFamily, string][]), + fontQuality: PD.Select(3, [[0, 'lower'], [1, 'low'], [2, 'medium'], [3, 'high'], [4, 'higher']]), + fontStyle: PD.Select('normal', [['normal', 'Normal'], ['italic', 'Italic'], ['oblique', 'Oblique']] as [FontStyle, string][]), + fontVariant: PD.Select('normal', [['normal', 'Normal'], ['small-caps', 'Small Caps']] as [FontVariant, string][]), + fontWeight: PD.Select('normal', [['normal', 'Normal'], ['bold', 'Bold']] as [FontWeight, string][]), } export type FontAtlasParams = typeof FontAtlasParams export type FontAtlasProps = PD.Values<FontAtlasParams> diff --git a/src/mol-geo/primitive/box.ts b/src/mol-geo/primitive/box.ts index a677d94a1..da8c23981 100644 --- a/src/mol-geo/primitive/box.ts +++ b/src/mol-geo/primitive/box.ts @@ -61,23 +61,20 @@ export function PerforatedBox() { 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, - 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 - ] - ) + boxCage = createCage([ + 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, + 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 + ]) } return boxCage } \ No newline at end of file diff --git a/src/mol-geo/primitive/dodecahedron.ts b/src/mol-geo/primitive/dodecahedron.ts index d54ada78f..e88f34bc1 100644 --- a/src/mol-geo/primitive/dodecahedron.ts +++ b/src/mol-geo/primitive/dodecahedron.ts @@ -14,46 +14,46 @@ 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, + 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 */ export const dodecahedronFaces: ReadonlyArray<number> = [ - 4, 3, 2, 1, 0, - 7, 6, 5, 0, 1, + 4, 3, 2, 1, 0, + 7, 6, 5, 0, 1, 12, 11, 10, 9, 8, 15, 14, 13, 8, 9, 14, 3, 4, 16, 13, - 3, 14, 15, 17, 2, + 3, 14, 15, 17, 2, 11, 6, 7, 18, 10, - 6, 11, 12, 19, 5, - 4, 0, 5, 19, 16, + 6, 11, 12, 19, 5, + 4, 0, 5, 19, 16, 12, 8, 13, 16, 19, 15, 9, 10, 18, 17, - 7, 1, 2, 17, 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 + 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 + 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 + 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 + 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, + 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, ] diff --git a/src/mol-geo/util/marching-cubes/builder.ts b/src/mol-geo/util/marching-cubes/builder.ts index 4b728d8b2..fde7aea04 100644 --- a/src/mol-geo/util/marching-cubes/builder.ts +++ b/src/mol-geo/util/marching-cubes/builder.ts @@ -13,7 +13,7 @@ import { AllowedContours } from './tables'; import { LinesBuilder } from '../../geometry/lines/lines-builder'; import { Lines } from '../../geometry/lines/lines'; - export interface MarchinCubesBuilder<T> { +export interface MarchinCubesBuilder<T> { addVertex(x: number, y: number, z: number): number addNormal(x: number, y: number, z: number): void addGroup(group: number): void diff --git a/src/mol-io/reader/common/text/column/token.ts b/src/mol-io/reader/common/text/column/token.ts index 8a6a22d2d..df8ea949c 100644 --- a/src/mol-io/reader/common/text/column/token.ts +++ b/src/mol-io/reader/common/text/column/token.ts @@ -19,11 +19,11 @@ export function TokenColumn<T extends Column.Schema>(tokens: Tokens, schema: T): const { valueType: type } = schema; const value: Column<T['T']>['value'] = - type === 'str' - ? row => data.substring(indices[2 * row], indices[2 * row + 1]) - : type === 'int' - ? row => fastParseInt(data, indices[2 * row], indices[2 * row + 1]) || 0 - : row => fastParseFloat(data, indices[2 * row], indices[2 * row + 1]) || 0; + type === 'str' + ? row => data.substring(indices[2 * row], indices[2 * row + 1]) + : type === 'int' + ? row => fastParseInt(data, indices[2 * row], indices[2 * row + 1]) || 0 + : row => fastParseFloat(data, indices[2 * row], indices[2 * row + 1]) || 0; return { schema: schema, diff --git a/src/mol-math/linear-algebra/3d.ts b/src/mol-math/linear-algebra/3d.ts index d6e70b131..8a4b938b0 100644 --- a/src/mol-math/linear-algebra/3d.ts +++ b/src/mol-math/linear-algebra/3d.ts @@ -29,6 +29,6 @@ export { Mat4, Mat3, Vec2, Vec3, Vec4, Quat, EPSILON } export type Vec<T> = T extends 4 ? Vec4 : - T extends 3 ? Vec3 : - T extends 2 ? Vec2 : - number[] \ No newline at end of file + T extends 3 ? Vec3 : + T extends 2 ? Vec2 : + number[] \ No newline at end of file diff --git a/src/mol-math/linear-algebra/3d/quat.ts b/src/mol-math/linear-algebra/3d/quat.ts index 574f88abe..eaab0f5a6 100644 --- a/src/mol-math/linear-algebra/3d/quat.ts +++ b/src/mol-math/linear-algebra/3d/quat.ts @@ -184,11 +184,11 @@ namespace Quat { cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary) if ( cosom < 0.0 ) { - cosom = -cosom; - bx = - bx; - by = - by; - bz = - bz; - bw = - bw; + cosom = -cosom; + bx = - bx; + by = - by; + bz = - bz; + bw = - bw; } // calculate coefficients if ( (1.0 - cosom) > 0.000001 ) { @@ -258,7 +258,7 @@ namespace Quat { out[0] = (m[5]-m[7])*fRoot; out[1] = (m[6]-m[2])*fRoot; out[2] = (m[1]-m[3])*fRoot; - } else { + } else { // |w| <= 1/2 let i = 0; if ( m[4] > m[0] ) i = 1; @@ -384,7 +384,7 @@ namespace Quat { if (dot < -0.999999) { Vec3.cross(rotTmpVec3, rotTmpVec3UnitX, a); if (Vec3.magnitude(rotTmpVec3) < 0.000001) - Vec3.cross(rotTmpVec3, rotTmpVec3UnitY, a); + Vec3.cross(rotTmpVec3, rotTmpVec3UnitY, a); Vec3.normalize(rotTmpVec3, rotTmpVec3); setAxisAngle(out, rotTmpVec3, Math.PI); return out; diff --git a/src/mol-model-formats/structure/pdb/assembly.ts b/src/mol-model-formats/structure/pdb/assembly.ts index 02f6a989e..23931f271 100644 --- a/src/mol-model-formats/structure/pdb/assembly.ts +++ b/src/mol-model-formats/structure/pdb/assembly.ts @@ -202,18 +202,18 @@ export function parseMtrix(lines: Tokens, lineStart: number, lineEnd: number): C const struct_ncs_oper_rows: { [P in keyof CifCategory.Fields<mmCIF_Schema['struct_ncs_oper']>]?: string }[] = []; let id = 1; for (const oper of matrices) { - const row = { - id: 'ncsop' + (id++), - code: '.', - details: '.' - } as (typeof struct_ncs_oper_rows)[0] as any; - for (let i = 0; i < 3; i++) { - for (let j = 0; j < 3; j++) { - row[`matrix[${i + 1}][${j + 1}]`] = '' + Mat4.getValue(oper, i, j); - } - row[`vector[${i + 1}]`] = '' + Mat4.getValue(oper, i, 3); + const row = { + id: 'ncsop' + (id++), + code: '.', + details: '.' + } as (typeof struct_ncs_oper_rows)[0] as any; + for (let i = 0; i < 3; i++) { + for (let j = 0; j < 3; j++) { + row[`matrix[${i + 1}][${j + 1}]`] = '' + Mat4.getValue(oper, i, j); } - struct_ncs_oper_rows.push(row); + row[`vector[${i + 1}]`] = '' + Mat4.getValue(oper, i, 3); + } + struct_ncs_oper_rows.push(row); } const struct_ncs_oper: CifCategory.SomeFields<mmCIF_Schema['struct_ncs_oper']> = { diff --git a/src/mol-model-props/computed/interactions/hydrogen-bonds.ts b/src/mol-model-props/computed/interactions/hydrogen-bonds.ts index 697b187e3..f6021978c 100644 --- a/src/mol-model-props/computed/interactions/hydrogen-bonds.ts +++ b/src/mol-model-props/computed/interactions/hydrogen-bonds.ts @@ -72,14 +72,13 @@ function addUnitHydrogenDonors(structure: Structure, unit: Unit.Atomic, builder: for (let i = 0 as StructureElement.UnitIndex, il = elements.length; i < il; ++i) { const element = typeSymbol(unit, i) if (( - // include both nitrogen atoms in histidine due to - // their often ambiguous protonation assignment - isHistidineNitrogen(unit, i) - ) || ( - totalH[i] > 0 && - (element === Elements.N || element === Elements.O || element === Elements.S) - ) - ) { + // include both nitrogen atoms in histidine due to + // their often ambiguous protonation assignment + isHistidineNitrogen(unit, i) + ) || ( + totalH[i] > 0 && + (element === Elements.N || element === Elements.O || element === Elements.S) + )) { builder.add(FeatureType.HydrogenDonor, FeatureGroup.None, x[elements[i]], y[elements[i]], z[elements[i]], i) } } diff --git a/src/mol-model-props/rcsb/graphql/types.ts b/src/mol-model-props/rcsb/graphql/types.ts index e21766370..dc12d2cf5 100644 --- a/src/mol-model-props/rcsb/graphql/types.ts +++ b/src/mol-model-props/rcsb/graphql/types.ts @@ -12,77 +12,77 @@ export type Unrepresentable = any; // ==================================================== export namespace AssemblySymmetry { - export type Variables = { - pdbId: string; - }; + export type Variables = { + pdbId: string; + }; - export type Query = { - __typename?: "Query"; + export type Query = { + __typename?: 'Query'; - entry: Maybe<Entry>; - }; + entry: Maybe<Entry>; + }; - export type Entry = { - __typename?: "CoreEntry"; + export type Entry = { + __typename?: 'CoreEntry'; - assemblies: Maybe<(Maybe<Assemblies>)[]>; - }; + assemblies: Maybe<(Maybe<Assemblies>)[]>; + }; - export type Assemblies = { - __typename?: "CoreAssembly"; + export type Assemblies = { + __typename?: 'CoreAssembly'; - pdbx_struct_assembly: Maybe<PdbxStructAssembly>; + pdbx_struct_assembly: Maybe<PdbxStructAssembly>; - rcsb_struct_symmetry: Maybe<(Maybe<RcsbStructSymmetry>)[]>; - }; + rcsb_struct_symmetry: Maybe<(Maybe<RcsbStructSymmetry>)[]>; + }; - export type PdbxStructAssembly = { - __typename?: "PdbxStructAssembly"; + export type PdbxStructAssembly = { + __typename?: 'PdbxStructAssembly'; - id: string; - }; + id: string; + }; - export type RcsbStructSymmetry = { - __typename?: "RcsbStructSymmetry"; + export type RcsbStructSymmetry = { + __typename?: 'RcsbStructSymmetry'; - clusters: (Maybe<Clusters>)[]; + clusters: (Maybe<Clusters>)[]; - kind: string; + kind: string; - oligomeric_state: string; + oligomeric_state: string; - rotation_axes: Maybe<(Maybe<RotationAxes>)[]>; + rotation_axes: Maybe<(Maybe<RotationAxes>)[]>; - stoichiometry: (Maybe<string>)[]; + stoichiometry: (Maybe<string>)[]; - symbol: string; + symbol: string; - type: string; - }; + type: string; + }; - export type Clusters = { - __typename?: "RcsbStructSymmetryClusters"; + export type Clusters = { + __typename?: 'RcsbStructSymmetryClusters'; - avg_rmsd: Maybe<number>; + avg_rmsd: Maybe<number>; - members: (Maybe<Members>)[]; - }; + members: (Maybe<Members>)[]; + }; - export type Members = { - __typename?: "ClustersMembers"; + export type Members = { + __typename?: 'ClustersMembers'; - asym_id: string; + asym_id: string; - pdbx_struct_oper_list_ids: Maybe<(Maybe<string>)[]>; - }; + pdbx_struct_oper_list_ids: Maybe<(Maybe<string>)[]>; + }; - export type RotationAxes = { - __typename?: "RcsbStructSymmetryRotationAxes"; + export type RotationAxes = { + __typename?: 'RcsbStructSymmetryRotationAxes'; - start: (Maybe<number>)[]; + start: (Maybe<number>)[]; - end: (Maybe<number>)[]; + end: (Maybe<number>)[]; - order: Maybe<number>; - }; + order: Maybe<number>; + }; } diff --git a/src/mol-model-props/rcsb/representations/assembly-symmetry-axes.ts b/src/mol-model-props/rcsb/representations/assembly-symmetry-axes.ts index 1f6428c02..9f716ffd8 100644 --- a/src/mol-model-props/rcsb/representations/assembly-symmetry-axes.ts +++ b/src/mol-model-props/rcsb/representations/assembly-symmetry-axes.ts @@ -124,7 +124,7 @@ export function createAssemblySymmetryAxesMesh(ctx: VisualContext, structure: St const cylinderProps = { radiusTop: radius, radiusBottom: radius } const builderState = MeshBuilder.createState(256, 128, mesh) - for (let i = 0, il = axes._rowCount; i < il; ++i) { + for (let i = 0, il = axes._rowCount; i < il; ++i) { if (axes.symmetry_id.value(i) !== symmetryId) continue const start = Tensor.toVec3(Vec3(), vectorSpace, axes.start.value(i)) diff --git a/src/mol-model/structure/model/properties/common.ts b/src/mol-model/structure/model/properties/common.ts index 342018386..84809978a 100644 --- a/src/mol-model/structure/model/properties/common.ts +++ b/src/mol-model/structure/model/properties/common.ts @@ -24,10 +24,7 @@ export interface Entities { export type ChemicalComponent = Table.Row<mmCIF_Schema['chem_comp']> export type ChemicalComponentMap = ReadonlyMap<string, ChemicalComponent> -export type MissingResidue = Table.Row<Pick< - mmCIF_Schema['pdbx_unobs_or_zero_occ_residues'], - 'polymer_flag' | 'occupancy_flag' ->> +export type MissingResidue = Table.Row<Pick<mmCIF_Schema['pdbx_unobs_or_zero_occ_residues'], 'polymer_flag' | 'occupancy_flag'>> export interface MissingResidues { has(model_num: number, asym_id: string, seq_id: number): boolean get(model_num: number, asym_id: string, seq_id: number): MissingResidue | undefined diff --git a/src/mol-model/structure/structure/carbohydrates/compute.ts b/src/mol-model/structure/structure/carbohydrates/compute.ts index 604497c22..e96051db5 100644 --- a/src/mol-model/structure/structure/carbohydrates/compute.ts +++ b/src/mol-model/structure/structure/carbohydrates/compute.ts @@ -61,10 +61,10 @@ function getAnomericCarbon(unit: Unit.Atomic, ringAtoms: ArrayLike<StructureElem } } return (indexHasTwoOxygen !== -1 ? indexHasTwoOxygen - : indexHasOxygenAndCarbon !== -1 ? indexHasOxygenAndCarbon - : indexHasC1Name !== -1 ? indexHasC1Name - : indexIsCarbon !== -1 ? indexIsCarbon - : elements[ringAtoms[0]]) as ElementIndex + : indexHasOxygenAndCarbon !== -1 ? indexHasOxygenAndCarbon + : indexHasC1Name !== -1 ? indexHasC1Name + : indexIsCarbon !== -1 ? indexIsCarbon + : elements[ringAtoms[0]]) as ElementIndex } /** Return first non-empty label_alt_id or an empty string */ diff --git a/src/mol-model/structure/structure/element/stats.ts b/src/mol-model/structure/structure/element/stats.ts index afd53a33a..fea5bc419 100644 --- a/src/mol-model/structure/structure/element/stats.ts +++ b/src/mol-model/structure/structure/element/stats.ts @@ -156,11 +156,11 @@ export namespace Stats { const segments = Unit.isAtomic(unit) ? unit.model.atomicHierarchy.chainAtomSegments - : Unit.isSpheres(unit) - ? unit.model.coarseHierarchy.spheres.chainElementSegments + : Unit.isSpheres(unit) + ? unit.model.coarseHierarchy.spheres.chainElementSegments : Unit.isGaussians(unit) - ? unit.model.coarseHierarchy.gaussians.chainElementSegments - : void 0; + ? unit.model.coarseHierarchy.gaussians.chainElementSegments + : void 0; if (!segments) { console.warn('StructureElement loci stats: unknown unit type'); @@ -198,11 +198,11 @@ export namespace Stats { // all the elements have the same model since they are part of the same group so this is ok. const segments = Unit.isAtomic(element.unit) ? element.unit.model.atomicHierarchy.chainAtomSegments - : Unit.isSpheres(element.unit) - ? element.unit.model.coarseHierarchy.spheres.chainElementSegments + : Unit.isSpheres(element.unit) + ? element.unit.model.coarseHierarchy.spheres.chainElementSegments : Unit.isGaussians(element.unit) - ? element.unit.model.coarseHierarchy.gaussians.chainElementSegments - : void 0; + ? element.unit.model.coarseHierarchy.gaussians.chainElementSegments + : void 0; if (!segments) { console.warn('StructureElement loci stats: unknown unit type'); diff --git a/src/mol-plugin/state/representation/structure/preset.ts b/src/mol-plugin/state/representation/structure/preset.ts index aad0c4d73..418cbb640 100644 --- a/src/mol-plugin/state/representation/structure/preset.ts +++ b/src/mol-plugin/state/representation/structure/preset.ts @@ -134,7 +134,7 @@ const coarseCapsid = StructureRepresentationProvider({ const params = StructureRepresentation3DHelpers.createParams(plugin, structure, { repr: [ BuiltInStructureRepresentations['gaussian-surface'], - () => ({ smoothness: 0.5, radiusOffset: 1, /*visuals: ['gaussian-surface-mesh']*/ }) + () => ({ smoothness: 0.5, radiusOffset: 1, /* visuals: ['gaussian-surface-mesh']*/ }) ] }); diff --git a/src/mol-plugin/state/snapshots.ts b/src/mol-plugin/state/snapshots.ts index a37ecf699..cf3ed0ec8 100644 --- a/src/mol-plugin/state/snapshots.ts +++ b/src/mol-plugin/state/snapshots.ts @@ -134,8 +134,8 @@ class PluginStateSnapshotManager extends PluginComponent<{ const current = snapshot.current ? snapshot.current : snapshot.entries.length > 0 - ? snapshot.entries[0].snapshot.id - : void 0; + ? snapshot.entries[0].snapshot.id + : void 0; this.updateState({ current, entries: entries.asImmutable(), diff --git a/src/mol-plugin/state/transforms/representation.ts b/src/mol-plugin/state/transforms/representation.ts index 448c7326d..bc8cb3058 100644 --- a/src/mol-plugin/state/transforms/representation.ts +++ b/src/mol-plugin/state/transforms/representation.ts @@ -63,7 +63,7 @@ namespace StructureRepresentation3DHelpers { } export function createParams<R extends RepresentationProvider<Structure, any, any>, C extends ColorTheme.Provider<any>, S extends SizeTheme.Provider<any>>( - ctx: PluginContext, structure: Structure, params: { + ctx: PluginContext, structure: Structure, params: { repr?: R | [R, (r: R, ctx: ThemeRegistryContext, s: Structure) => Partial<RepresentationProvider.ParamValues<R>>], color?: C | [C, (c: C, ctx: ThemeRegistryContext) => Partial<ColorTheme.ParamValues<C>>], size?: S | [S, (c: S, ctx: ThemeRegistryContext) => Partial<SizeTheme.ParamValues<S>>] diff --git a/src/mol-repr/structure/units-visual.ts b/src/mol-repr/structure/units-visual.ts index 0ebbde252..290088ede 100644 --- a/src/mol-repr/structure/units-visual.ts +++ b/src/mol-repr/structure/units-visual.ts @@ -211,8 +211,8 @@ export function UnitsVisual<G extends Geometry, P extends UnitsParams & Geometry function _createGeometry(ctx: VisualContext, unit: Unit, structure: Structure, theme: Theme, props: PD.Values<P>, geometry?: G) { return includesUnitKind(props.unitKinds, unit) - ? createGeometry(ctx, unit, structure, theme, props, geometry) - : createEmptyGeometry(geometry) + ? createGeometry(ctx, unit, structure, theme, props, geometry) + : createEmptyGeometry(geometry) } function lociIsSuperset(loci: Loci) { diff --git a/src/mol-script/language/expression.ts b/src/mol-script/language/expression.ts index 8fe5ac9b1..ba6f77367 100644 --- a/src/mol-script/language/expression.ts +++ b/src/mol-script/language/expression.ts @@ -15,7 +15,7 @@ namespace Expression { export type Arguments = Expression[] | { [name: string]: Expression } export interface Apply { readonly head: Expression, readonly args?: Arguments } - export function Symbol(name: string): Symbol { return { name }; } + export function Symbol(name: string): Expression.Symbol { return { name }; } export function Apply(head: Expression, args?: Arguments): Apply { return args ? { head, args } : { head }; } export function isArgumentsArray(e?: Arguments): e is Expression[] { return !!e && Array.isArray(e); } diff --git a/src/mol-script/runtime/query/table.ts b/src/mol-script/runtime/query/table.ts index 75a9104a8..390e0c57a 100644 --- a/src/mol-script/runtime/query/table.ts +++ b/src/mol-script/runtime/query/table.ts @@ -169,7 +169,6 @@ const symbols = [ return (tested & test) === test; }), - //////////////////////////////////// // Structure // ============= TYPES ================ @@ -340,8 +339,6 @@ const symbols = [ D(MolScript.structureQuery.bondProperty.atomB, (ctx, xs) => ctx.atomicBond.b), D(MolScript.structureQuery.bondProperty.length, (ctx, xs) => ctx.atomicBond.length), - - //////////////////////////////////// // Internal D(MolScript.internal.generator.bundleElement, function internal_generator_bundleElement(ctx, xs) { return bundleElementImpl(xs.groupedUnits(ctx), xs.ranges(ctx), xs.set(ctx)) }), D(MolScript.internal.generator.bundle, function internal_generator_bundle(ctx, xs) { return bundleGenerator(xs.elements(ctx))(ctx) }), diff --git a/src/mol-state/state/builder.ts b/src/mol-state/state/builder.ts index 269322bce..4f88fdf9e 100644 --- a/src/mol-state/state/builder.ts +++ b/src/mol-state/state/builder.ts @@ -86,8 +86,8 @@ namespace StateBuilder { const ref = typeof refOrCellOrSelector === 'string' ? refOrCellOrSelector : StateObjectCell.is(refOrCellOrSelector) - ? refOrCellOrSelector.transform.ref - : refOrCellOrSelector.ref; + ? refOrCellOrSelector.transform.ref + : refOrCellOrSelector.ref; return new To<StateObject, StateTransformer>(this.state, ref, this); } toRoot<A extends StateObject>() { return new To<A>(this.state, this.state.tree.root.ref, this); } diff --git a/src/mol-state/tree/transient.ts b/src/mol-state/tree/transient.ts index 6f99d5ad3..a401fa41a 100644 --- a/src/mol-state/tree/transient.ts +++ b/src/mol-state/tree/transient.ts @@ -182,8 +182,8 @@ class TransientTree implements StateTree { return true; } - /** Calls Transform.definition.params.areEqual if available, otherwise uses shallowEqual to check if the params changed */ - setTags(ref: StateTransform.Ref, tags: string | string[] | undefined) { + /** Calls Transform.definition.params.areEqual if available, otherwise uses shallowEqual to check if the params changed */ + setTags(ref: StateTransform.Ref, tags: string | string[] | undefined) { ensurePresent(this.transforms, ref); const transform = this.transforms.get(ref)!; diff --git a/src/mol-task/execution/observable.ts b/src/mol-task/execution/observable.ts index c4bed0acf..5ead08799 100644 --- a/src/mol-task/execution/observable.ts +++ b/src/mol-task/execution/observable.ts @@ -198,7 +198,7 @@ class ObservableRuntimeContext implements RuntimeContext { this.updateProgress(progress); // TODO: do the shouldNotify check here? - if (!!dontNotify /*|| !shouldNotify(this.info, this.lastUpdatedTime)*/) return; + if (!!dontNotify /* || !shouldNotify(this.info, this.lastUpdatedTime)*/) return; notifyObserver(this.info, this.lastUpdatedTime); diff --git a/src/mol-task/util/scheduler.ts b/src/mol-task/util/scheduler.ts index b06021425..94cbb531e 100644 --- a/src/mol-task/util/scheduler.ts +++ b/src/mol-task/util/scheduler.ts @@ -10,7 +10,7 @@ * MIT license. */ -declare var WorkerGlobalScope: any; +declare const WorkerGlobalScope: any; function createImmediateActions() { const global: any = (function () { const _window = typeof window !== 'undefined' && window; @@ -29,15 +29,15 @@ function createImmediateActions() { let registerImmediate: ((handle: number) => void); function setImmediate(callback: Callback, ...args: any[]) { - // Callback can either be a function or a string - if (typeof callback !== 'function') { - callback = new Function('' + callback) as Callback; - } - // Store and register the task - const task = { callback: callback, args: args }; - tasksByHandle[nextHandle] = task; - registerImmediate(nextHandle); - return nextHandle++; + // Callback can either be a function or a string + if (typeof callback !== 'function') { + callback = new Function('' + callback) as Callback; + } + // Store and register the task + const task = { callback: callback, args: args }; + tasksByHandle[nextHandle] = task; + registerImmediate(nextHandle); + return nextHandle++; } function clearImmediate(handle: number) { @@ -48,21 +48,21 @@ function createImmediateActions() { const callback = task.callback; const args = task.args; switch (args.length) { - case 0: - callback(); - break; - case 1: - callback(args[0]); - break; - case 2: - callback(args[0], args[1]); - break; - case 3: - callback(args[0], args[1], args[2]); - break; - default: - callback.apply(undefined, args); - break; + case 0: + callback(); + break; + case 1: + callback(args[0]); + break; + case 2: + callback(args[0], args[1]); + break; + case 3: + callback(args[0], args[1], args[2]); + break; + default: + callback.apply(undefined, args); + break; } } diff --git a/src/mol-theme/label.ts b/src/mol-theme/label.ts index 63d4afdf7..bf7c30451 100644 --- a/src/mol-theme/label.ts +++ b/src/mol-theme/label.ts @@ -183,7 +183,6 @@ function _atomicElementLabel(location: StructureElement.Location<Unit.Atomic>, g const compId = granularity === 'residue' && microHetCompIds.length > 1 ? `(${microHetCompIds.join('|')})` : comp_id - const label: string[] = [] switch (granularity) { diff --git a/src/servers/model/local.ts b/src/servers/model/local.ts index 9661d90c6..772c9dafd 100644 --- a/src/servers/model/local.ts +++ b/src/servers/model/local.ts @@ -12,26 +12,25 @@ console.log(`Mol* ModelServer (${Version}), (c) 2018 Mol* authors`); console.log(``); let exampleWorkload: LocalInput = [{ - input: 'c:/test/quick/1tqn.cif', - output: 'c:/test/quick/localapi/1tqn_full.cif', - query: 'full', // same as defined in Api/Queries - }, { - input: 'c:/test/quick/1tqn.cif', - output: 'c:/test/quick/localapi/1tqn_full.bcif', - query: 'full', - params: {} - }, { - input: 'c:/test/quick/1cbs_updated.cif', - output: 'c:/test/quick/localapi/1cbs_ligint.cif', - query: 'residueInteraction', // action is case sensitive - params: { atom_site: { label_comp_id: 'REA' }, radius: 5 } - }, { - input: 'c:/test/quick/1cbs_updated.cif', // multiple files that are repeated will only be parsed once - output: 'c:/test/quick/localapi/1cbs_ligint.bcif', - query: 'residueInteraction', - params: { atom_site: { label_comp_id: 'REA' } } // parameters are just a JSON version of the query string - } -]; + input: 'c:/test/quick/1tqn.cif', + output: 'c:/test/quick/localapi/1tqn_full.cif', + query: 'full', // same as defined in Api/Queries +}, { + input: 'c:/test/quick/1tqn.cif', + output: 'c:/test/quick/localapi/1tqn_full.bcif', + query: 'full', + params: {} +}, { + input: 'c:/test/quick/1cbs_updated.cif', + output: 'c:/test/quick/localapi/1cbs_ligint.cif', + query: 'residueInteraction', // action is case sensitive + params: { atom_site: { label_comp_id: 'REA' }, radius: 5 } +}, { + input: 'c:/test/quick/1cbs_updated.cif', // multiple files that are repeated will only be parsed once + output: 'c:/test/quick/localapi/1cbs_ligint.bcif', + query: 'residueInteraction', + params: { atom_site: { label_comp_id: 'REA' } } // parameters are just a JSON version of the query string +}]; if (process.argv.length !== 3) { diff --git a/src/servers/model/server.ts b/src/servers/model/server.ts index aed74869c..4dde6c496 100644 --- a/src/servers/model/server.ts +++ b/src/servers/model/server.ts @@ -31,12 +31,12 @@ function setupShutdown() { console.log(); setTimeout(() => { - /*if (WebApi.ApiState.pendingQueries > 0) { - WebApi.ApiState.shutdownOnZeroPending = true; - } else*/ { - ConsoleLogger.log('Server', `Shut down due to timeout.`); - process.exit(0); - } + // if (WebApi.ApiState.pendingQueries > 0) { + // WebApi.ApiState.shutdownOnZeroPending = true; + // } else { + ConsoleLogger.log('Server', `Shut down due to timeout.`); + process.exit(0); + // } }, tMs); } } diff --git a/src/servers/model/utils/fetch-props-pdbe.ts b/src/servers/model/utils/fetch-props-pdbe.ts index da6a1d326..047a95531 100644 --- a/src/servers/model/utils/fetch-props-pdbe.ts +++ b/src/servers/model/utils/fetch-props-pdbe.ts @@ -71,13 +71,13 @@ async function process() { const data = Object.create(null); for (let ee of e.entries) { - const query = await fetch(`https://www.ebi.ac.uk/pdbe/api/validation/residuewise_outlier_summary/entry/${ee}`); - try { + const query = await fetch(`https://www.ebi.ac.uk/pdbe/api/validation/residuewise_outlier_summary/entry/${ee}`); + try { if (query.status === 200) data[ee] = (await query.json())[ee] || { }; else console.error(ee, query.status); - } catch (e) { + } catch (e) { console.error(ee, '' + e); - } + } } // const query = await fetch(`https://www.ebi.ac.uk/pdbe/api/validation/residuewise_outlier_summary/entry`, { method: 'POST', body }); // console.log(query.status); diff --git a/src/servers/volume/common/binary-schema.ts b/src/servers/volume/common/binary-schema.ts index 96c35c681..8fb875e57 100644 --- a/src/servers/volume/common/binary-schema.ts +++ b/src/servers/volume/common/binary-schema.ts @@ -12,18 +12,17 @@ import { SimpleBuffer } from '../../../mol-io/common/simple-buffer'; export type Bool = { kind: 'bool' } export type Int = { kind: 'int' } export type Float = { kind: 'float' } -export type String = { kind: 'string' } +export type Str = { kind: 'string' } export type Array = { kind: 'array', element: Element } export type Prop = { element: Element, prop: string } export type Obj = { kind: 'object', props: Prop[] } -// tslint:disable-next-line:array-type -export type Element = Bool | Int | Float | String | Array | Obj +export type Element = Bool | Int | Float | Str | Array | Obj export const bool: Bool = { kind: 'bool' }; export const int: Int = { kind: 'int' }; export const float: Float = { kind: 'float' }; -export const str: String = { kind: 'string' }; -// tslint:disable-next-line:array-type +export const str: Str = { kind: 'string' }; + export function array(element: Element): Array { return { kind: 'array', element }; } export function obj<T>(schema: ((keyof T) | Element)[][]): Obj { return { diff --git a/src/servers/volume/server/algebra/box.ts b/src/servers/volume/server/algebra/box.ts index d604156ff..8f0e5e252 100644 --- a/src/servers/volume/server/algebra/box.ts +++ b/src/servers/volume/server/algebra/box.ts @@ -11,9 +11,7 @@ export interface Cartesian extends Box<Coords.Cartesian> { } export interface Fractional extends Box<Coords.Fractional> { } export interface Grid<K> extends Box<Coords.Grid<K>> { } -/////////////////////////////////////////// // CONVERSIONS -/////////////////////////////////////////// export function cartesianToFractional(box: Cartesian, spacegroup: SpacegroupCell): Fractional { const { a: l, b: r } = box; @@ -54,9 +52,7 @@ export function expandGridBox<K>(box: Grid<K>, by: number) { } } -/////////////////////////////////////////// // MISC -/////////////////////////////////////////// export function shift<C extends Coords.Coord<S>, S extends Coords.Space>(box: Box<C>, offset: C): Box<C> { return { a: Coords.add(box.a, offset), b: Coords.add(box.b, offset) } as Box<C>; diff --git a/src/servers/volume/server/algebra/coordinate.ts b/src/servers/volume/server/algebra/coordinate.ts index 01ac3e5ba..4c8bc5703 100644 --- a/src/servers/volume/server/algebra/coordinate.ts +++ b/src/servers/volume/server/algebra/coordinate.ts @@ -31,9 +31,7 @@ export interface Cartesian extends Coord<Space.Cartesian> { } export interface Fractional extends Coord<Space.Fractional> { } export interface Grid<K> extends Coord<Space.Grid> { domain: GridDomain<K> } -/////////////////////////////////////////// // CONSTRUCTORS -/////////////////////////////////////////// export function domain<K>(kind: K, info: GridInfo): GridDomain<K> { const sc = info.sampleCount; @@ -71,9 +69,7 @@ export function clone<C extends (Coord<Space> | Grid<any>)>(a: C): C { return withCoord(a, a[0], a[1], a[2]); } -/////////////////////////////////////////// // CONVERSIONS -/////////////////////////////////////////// export function cartesianToFractional(a: Cartesian, spacegroup: SpacegroupCell): Fractional { const coord = Helpers.transform(a, spacegroup.toFractional); @@ -98,9 +94,7 @@ export function gridToFractional<K>(a: Grid<K>): Fractional { return coord; } -/////////////////////////////////////////// // MISC -/////////////////////////////////////////// export function clampGridToSamples<K>(a: Grid<K>): Grid<K> { const { sampleCount } = a.domain; diff --git a/src/servers/volume/server/query/data-model.ts b/src/servers/volume/server/query/data-model.ts index a5552a3d1..95d77403c 100644 --- a/src/servers/volume/server/query/data-model.ts +++ b/src/servers/volume/server/query/data-model.ts @@ -14,9 +14,7 @@ import { SpacegroupCell } from '../../../../mol-math/geometry'; import { FileHandle } from '../../../../mol-io/common/file-handle'; import { TypedArrayValueArray } from '../../../../mol-io/common/typed-array'; -////////////////////////////////////// // DATA -////////////////////////////////////// export interface Sampling { index: number, @@ -39,9 +37,7 @@ export interface BlockData { values: TypedArrayValueArray } -////////////////////////////////////// // QUERY -////////////////////////////////////// export type QueryOutputStream = Writer & { end: () => void } diff --git a/src/servers/volume/server/query/identify.ts b/src/servers/volume/server/query/identify.ts index a0189a95b..85b276c30 100644 --- a/src/servers/volume/server/query/identify.ts +++ b/src/servers/volume/server/query/identify.ts @@ -9,7 +9,7 @@ import * as Coords from '../algebra/coordinate' import * as Box from '../algebra/box' import * as Data from './data-model' -//import { FastMap } from '../utils/collections' +// import { FastMap } from '../utils/collections' /** Find a list of unique blocks+offsets that overlap with the query region. */ export default function findUniqueBlocks(data: Data.DataContext, sampling: Data.Sampling, queryBox: Box.Fractional) { @@ -56,7 +56,7 @@ function overlapMultiplierRange(a: number, b: number, u: number, v: number): num /** * Finds that list of "unit" offsets (in fractional space) so that - * shift(box, offset) has non-empty interaction with the region + * shift(box, offset) has non-empty interaction with the region * described in the give domain. */ function findDataOverlapTranslationList(box: Box.Fractional, domain: Coords.GridDomain<'Data'>): Translations { @@ -106,7 +106,7 @@ function findUniqueBlocksOffset(data: Data.DataContext, sampling: Data.Sampling, const blockDomain = sampling.blockDomain; - // this gets the "3d range" of block indices that contain data that overlaps + // this gets the "3d range" of block indices that contain data that overlaps // with the query region. // // Clamping the data makes sure we avoid silly rounding errors (hopefully :)) diff --git a/src/servers/volume/server/web-api.ts b/src/servers/volume/server/web-api.ts index 6aab235be..8b8d1a165 100644 --- a/src/servers/volume/server/web-api.ts +++ b/src/servers/volume/server/web-api.ts @@ -54,10 +54,10 @@ function getMapFileFn() { const map = new Function('type', 'id', 'interpolate', [ 'id = id.toLowerCase()', 'switch (type.toLowerCase()) {', - ...ServerConfig.idMap.map(mapping => { - const [type, path] = mapping - return ` case '${type}': return interpolate('${path}', { id });` - }), + ...ServerConfig.idMap.map(mapping => { + const [type, path] = mapping + return ` case '${type}': return interpolate('${path}', { id });` + }), ' default: return void 0;', '}' ].join('\n')) diff --git a/src/servers/volume/server/web-schema.ts b/src/servers/volume/server/web-schema.ts index 05c743af2..fe7bc7db8 100644 --- a/src/servers/volume/server/web-schema.ts +++ b/src/servers/volume/server/web-schema.ts @@ -10,7 +10,7 @@ import { LimitsConfig, ServerConfig } from '../config'; export function getSchema() { function detail(i: number) { - return `${i} (${Math.round(100 * LimitsConfig.maxOutputSizeInVoxelCountByPrecisionLevel[i] / 1000 / 1000) / 100 }M voxels)`; + return `${i} (${Math.round(100 * LimitsConfig.maxOutputSizeInVoxelCountByPrecisionLevel[i] / 1000 / 1000) / 100 }M voxels)`; } const detailMax = LimitsConfig.maxOutputSizeInVoxelCountByPrecisionLevel.length - 1; const sources = ServerConfig.idMap.map(m => m[0]) -- GitLab