diff --git a/.eslintrc.json b/.eslintrc.json index dde918ed0226c3a2429bdb240ed923a367819a23..61b024262d1acc3c4f46d61e99fcaa8952d80f84 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -50,7 +50,8 @@ "ignoreReadBeforeAssign": false }], "space-before-function-paren": "off", - "func-call-spacing": "off" + "func-call-spacing": "off", + "no-multi-spaces": "error" }, "overrides": [ { diff --git a/src/cli/chem-comp-dict/create-table.ts b/src/cli/chem-comp-dict/create-table.ts index 03da1a3ee772f5e1a890329456f77bea9ca4c76b..7cf2aeade71d069980e6d809bdb903ed74fa48ac 100644 --- a/src/cli/chem-comp-dict/create-table.ts +++ b/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 } diff --git a/src/cli/cifschema/util/cif-dic.ts b/src/cli/cifschema/util/cif-dic.ts index a4ad9ee2820c57ab99ae7c77ca85bcc3cfecd044..b9ef007414f31d1c9b6989b6ca0344a531f93167 100644 --- a/src/cli/cifschema/util/cif-dic.ts +++ b/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; diff --git a/src/examples/domain-annotation-server/mapping.ts b/src/examples/domain-annotation-server/mapping.ts index df5945dd94c6139ee0bdfe55377ca37a68567106..df7107b9431c2fd8730902f9d5cde0d4789035d0 100644 --- a/src/examples/domain-annotation-server/mapping.ts +++ b/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) }); } diff --git a/src/examples/proteopedia-wrapper/index.ts b/src/examples/proteopedia-wrapper/index.ts index a322fc8aa1699dd94aa51c337ed0a5b8b1bef79a..26f6d852643fb9c220539b4bb2a38ffe6bf3f526 100644 --- a/src/examples/proteopedia-wrapper/index.ts +++ b/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() { diff --git a/src/extensions/anvil/algorithm.ts b/src/extensions/anvil/algorithm.ts index 5a7fa55a6942bcb94246cc551281b6bec75e526e..08bdcadd519ddb0b6ebb80edb985f16f6a1f63f1 100644 --- a/src/extensions/anvil/algorithm.ts +++ b/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++; } diff --git a/src/extensions/anvil/behavior.ts b/src/extensions/anvil/behavior.ts index 3e20f6338429e2e03447721773a314e6e6cd6369..8339b34ac6f21c143717c1c626d9e18b90a90c87 100644 --- a/src/extensions/anvil/behavior.ts +++ b/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) { diff --git a/src/extensions/cellpack/curve.ts b/src/extensions/cellpack/curve.ts index 7ede3c3f71884b69f2ef72bf02e6f057b57423bd..5b5c4fe64072a391ff56de71a730ffa9816af612 100644 --- a/src/extensions/cellpack/curve.ts +++ b/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)); diff --git a/src/extensions/cellpack/data.ts b/src/extensions/cellpack/data.ts index 98fd3475607a74254e7778c902abc8476eddb9ee..f7d8e469c9ed2c76d9003774aba7ee57addaff9b 100644 --- a/src/extensions/cellpack/data.ts +++ b/src/extensions/cellpack/data.ts @@ -73,9 +73,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; diff --git a/src/extensions/dnatco/confal-pyramids/behavior.ts b/src/extensions/dnatco/confal-pyramids/behavior.ts index a8e03566a3701cc54b096fadd87f6732e6921ac0..ae89a8e2524fe7df39cc4e2b9635a18dd9fcba78 100644 --- a/src/extensions/dnatco/confal-pyramids/behavior.ts +++ b/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 } }; } }); diff --git a/src/extensions/dnatco/confal-pyramids/color.ts b/src/extensions/dnatco/confal-pyramids/color.ts index 26d2b3f68959c72e8da16f769822a67f863cf28f..be76d6619798ad93d3c51f76130c46c91444fd34 100644 --- a/src/extensions/dnatco/confal-pyramids/color.ts +++ b/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)], diff --git a/src/extensions/dnatco/confal-pyramids/util.ts b/src/extensions/dnatco/confal-pyramids/util.ts index 3f4c627a643f6ed9df090ce7a24c01b240e5117d..9a6e88ba79dec9a2ac0644aba6ce8cf261174d10 100644 --- a/src/extensions/dnatco/confal-pyramids/util.ts +++ b/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}` : ''; diff --git a/src/extensions/g3d/model.ts b/src/extensions/g3d/model.ts index cb4ed9478183c2fc29e71d9ddac9ff3c4b379fc7..892d14abd9cb3a5f708aef53f0be0bfd0bb00dd4 100644 --- a/src/extensions/g3d/model.ts +++ b/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]; diff --git a/src/extensions/pdbe/preferred-assembly.ts b/src/extensions/pdbe/preferred-assembly.ts index f4a11f08bdd103c1d969d8f5403653cc85b5198c..ef928692d1b225db83cbc9ae62b448016a45f59e 100644 --- a/src/extensions/pdbe/preferred-assembly.ts +++ b/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); diff --git a/src/extensions/pdbe/structure-quality-report/color.ts b/src/extensions/pdbe/structure-quality-report/color.ts index 2ee57e131af487e02977dda52282156cb239d8c6..49f69d79e54a17162faa727a1f78d82393d1b6f2 100644 --- a/src/extensions/pdbe/structure-quality-report/color.ts +++ b/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, diff --git a/src/extensions/rcsb/assembly-symmetry/ui.tsx b/src/extensions/rcsb/assembly-symmetry/ui.tsx index bcb4a1b9a1ed1a02f1aeb6e6880aae52da21ed1d..bafaa1575ed018d7ea2b842a08f0ade1dbea881f 100644 --- a/src/extensions/rcsb/assembly-symmetry/ui.tsx +++ b/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'; diff --git a/src/extensions/rcsb/validation-report/representation.ts b/src/extensions/rcsb/validation-report/representation.ts index 208aa6bfbfaaf107b3d78bf7c712005eb1f30821..c9a6eba02c8136e7e95cdc04b3ee5fd552fa72a5 100644 --- a/src/extensions/rcsb/validation-report/representation.ts +++ b/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)); } diff --git a/src/mol-canvas3d/passes/draw.ts b/src/mol-canvas3d/passes/draw.ts index 90373c0dfb3e0589544eec4b8d777f632a895f98..63db5db451b33d91c3d9c299763a0f424acc7743 100644 --- a/src/mol-canvas3d/passes/draw.ts +++ b/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> = { diff --git a/src/mol-data/int/impl/sorted-array.ts b/src/mol-data/int/impl/sorted-array.ts index 1e857f27bddfd75d354fe5c7874901e1c889fd8b..6127961d77f47af3b72cac945658be801024e62f 100644 --- a/src/mol-data/int/impl/sorted-array.ts +++ b/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; } diff --git a/src/mol-data/util/_spec/chunked-array.spec.ts b/src/mol-data/util/_spec/chunked-array.spec.ts index d3c065271484f8bf087b8fdf63b4fbf2f9e03931..eb8df5e06da0c63f7dbcf9f1aa0fab09ead02f1d 100644 --- a/src/mol-data/util/_spec/chunked-array.spec.ts +++ b/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); diff --git a/src/mol-geo/geometry/mesh/mesh-builder.ts b/src/mol-geo/geometry/mesh/mesh-builder.ts index 145aa1fd5a8e6875e40bd37f3224bd13d6bbeb3b..f373fe93fc4e80d78b12d5dc96f58527752accda 100644 --- a/src/mol-geo/geometry/mesh/mesh-builder.ts +++ b/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); } diff --git a/src/mol-geo/geometry/text/text-builder.ts b/src/mol-geo/geometry/text/text-builder.ts index 6ff71cf3bae101cadb80b5b39121e97c1849a86f..83e0ba64792bfaaf70bff753ae20c2c70441be6a 100644 --- a/src/mol-geo/geometry/text/text-builder.ts +++ b/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) { diff --git a/src/mol-geo/primitive/box.ts b/src/mol-geo/primitive/box.ts index a0b20b245e424f45d92631646adcbe5732152b40..3fa2be2e9d296addc420ee7ae785746aecdcf0e5 100644 --- a/src/mol-geo/primitive/box.ts +++ b/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; diff --git a/src/mol-geo/primitive/dodecahedron.ts b/src/mol-geo/primitive/dodecahedron.ts index 7b826ffc4a8bfc1cdb24433133947fff4e2a8fc6..51314feeab74bf23996f49c2cfeec5e392bc489e 100644 --- a/src/mol-geo/primitive/dodecahedron.ts +++ b/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; diff --git a/src/mol-geo/primitive/icosahedron.ts b/src/mol-geo/primitive/icosahedron.ts index 14742232e79d32f6dba61c251a6f716d958f9fe3..225f73660b0d570fb43bd401d7a071fa0e512e44 100644 --- a/src/mol-geo/primitive/icosahedron.ts +++ b/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; diff --git a/src/mol-geo/primitive/octahedron.ts b/src/mol-geo/primitive/octahedron.ts index e01bb778e52277198ec284602128f4c436d1a008..37045d5452d02e38dc280361213e71190a422904 100644 --- a/src/mol-geo/primitive/octahedron.ts +++ b/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; diff --git a/src/mol-geo/primitive/plane.ts b/src/mol-geo/primitive/plane.ts index 3216aca11fe179fe23e8cf013b771390a00e941f..f1fa9370f92df4e9c8ab8a560681b3057d3d7266 100644 --- a/src/mol-geo/primitive/plane.ts +++ b/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 { diff --git a/src/mol-geo/primitive/pyramid.ts b/src/mol-geo/primitive/pyramid.ts index 07f6f1d344e7bb6986e42dbb66a910ac351b9666..6ec531968d9b98d06268f98f496a124b22b0fc04 100644 --- a/src/mol-geo/primitive/pyramid.ts +++ b/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); } diff --git a/src/mol-geo/primitive/sphere.ts b/src/mol-geo/primitive/sphere.ts index 392802a49bbaf8a62683d94df5e9dd5f3b18e102..775308b8599751556a19ad8c754a46e6f552be8d 100644 --- a/src/mol-geo/primitive/sphere.ts +++ b/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(); diff --git a/src/mol-geo/primitive/tetrahedron.ts b/src/mol-geo/primitive/tetrahedron.ts index 940fe624f90afd1136ce9bcc8305cff97f5176e1..1d96451f45eb4e5920cb93c75e69f9a475267bc4 100644 --- a/src/mol-geo/primitive/tetrahedron.ts +++ b/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; diff --git a/src/mol-gl/compute/marching-cubes/tables.ts b/src/mol-gl/compute/marching-cubes/tables.ts index 0383e6a06fa7064d99139e8c9587cbf4c7290f4d..ad354fe6a7c3f0a5144cb732acb47096babe4b14 100644 --- a/src/mol-gl/compute/marching-cubes/tables.ts +++ b/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; diff --git a/src/mol-gl/compute/util.ts b/src/mol-gl/compute/util.ts index b641a03889cafc0e90f283c5fa8035cd97aed44c..3dfa9e2673611766d243ce024f4624f01dd9dee6 100644 --- a/src/mol-gl/compute/util.ts +++ b/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 = { diff --git a/src/mol-gl/webgl/compat.ts b/src/mol-gl/webgl/compat.ts index 95b1ef04ab2bb17113b61fa86b29ce69b448641d..242fe0e40abd661e60e0641159e3bf885bdac741 100644 --- a/src/mol-gl/webgl/compat.ts +++ b/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/ diff --git a/src/mol-io/common/binary-cif/decoder.ts b/src/mol-io/common/binary-cif/decoder.ts index 1c32c2a8b9c3031b07d4591dad2b3c3137ee17b4..fe6ca9ebf8b679d1fb73becbc421774bb6a21232 100644 --- a/src/mol-io/common/binary-cif/decoder.ts +++ b/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; } diff --git a/src/mol-io/reader/_spec/mol.spec.ts b/src/mol-io/reader/_spec/mol.spec.ts index 64015df72de92c43698ee86b3aab9013545e1174..923db651eebcd8e5725ab9cf69f4c278bb55f5af 100644 --- a/src/mol-io/reader/_spec/mol.spec.ts +++ b/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); } diff --git a/src/mol-io/reader/_spec/mol2.spec.ts b/src/mol-io/reader/_spec/mol2.spec.ts index d9ded86cf42f06a2f7b556428aa13d0ab20652cf..aa3a9503957b3f98c37db1d1d6b1205a8d52f710 100644 --- a/src/mol-io/reader/_spec/mol2.spec.ts +++ b/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); } diff --git a/src/mol-io/reader/_spec/sdf.spec.ts b/src/mol-io/reader/_spec/sdf.spec.ts index d7e47781990de7b517baa9c2c8c9d402d2499a53..c125d6edd2b532f4f4ef34e9aef7e84339b914ad 100644 --- a/src/mol-io/reader/_spec/sdf.spec.ts +++ b/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); } diff --git a/src/mol-io/reader/cif/schema.ts b/src/mol-io/reader/cif/schema.ts index 8a0aaaf2f7dabb730acb2fa79b1509277806661e..e9e6f1f251188d088376c6ddc1f8e24c4b355275 100644 --- a/src/mol-io/reader/cif/schema.ts +++ b/src/mol-io/reader/cif/schema.ts @@ -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); } } diff --git a/src/mol-io/reader/cif/text/parser.ts b/src/mol-io/reader/cif/text/parser.ts index 9142c9075d944b10dac2e7439c36b87f265e4e8e..5c56d1c7518c7aaf2d6d1620b30036f37c12a47f 100644 --- a/src/mol-io/reader/cif/text/parser.ts +++ b/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; diff --git a/src/mol-io/reader/common/text/column/token.ts b/src/mol-io/reader/common/text/column/token.ts index 8f13c8a1ee92a0f4ea511ff5b370d24c4b0a3722..b07d20a881152e2566a3e3c7469cb0f50b5dd660 100644 --- a/src/mol-io/reader/common/text/column/token.ts +++ b/src/mol-io/reader/common/text/column/token.ts @@ -42,7 +42,7 @@ export function areValuesEqualProvider(tokens: Tokens) { 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; diff --git a/src/mol-io/reader/common/text/tokenizer.ts b/src/mol-io/reader/common/text/tokenizer.ts index b64e8138d70a8124763d4c63f941fc5e78efbaca..251cced322c6d3b2c2c189173b96da68c7d5661d 100644 --- a/src/mol-io/reader/common/text/tokenizer.ts +++ b/src/mol-io/reader/common/text/tokenizer.ts @@ -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: // ' ' diff --git a/src/mol-io/reader/csv/parser.ts b/src/mol-io/reader/csv/parser.ts index 3e6dd115abb8bfe4b0ad6c1fdc2648ae28be47be..ff98fedbbec7e9ed07224ff94f51a2931e1dbd12 100644 --- a/src/mol-io/reader/csv/parser.ts +++ b/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; } } diff --git a/src/mol-io/reader/psf/parser.ts b/src/mol-io/reader/psf/parser.ts index 7884184e9fd5fb17cd09eb5878c7d34757f3eea8..7acca9aaff5f8bb112c1a40bc528a5ba077074da 100644 --- a/src/mol-io/reader/psf/parser.ts +++ b/src/mol-io/reader/psf/parser.ts @@ -169,8 +169,8 @@ 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(); diff --git a/src/mol-io/writer/cif/encoder.ts b/src/mol-io/writer/cif/encoder.ts index d606cc1d3ac0d1c36e3afa4010b458a074bd5158..819ad351bcfd6ca8cdc50ad989e4d0b456de02fa 100644 --- a/src/mol-io/writer/cif/encoder.ts +++ b/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>(); } } diff --git a/src/mol-io/writer/cif/encoder/text.ts b/src/mol-io/writer/cif/encoder/text.ts index 404b7857e0d8de5c8c518b2a1c4599258b161fa4..8603bb10afdf1db777443df58ddf163468ea1698 100644 --- a/src/mol-io/writer/cif/encoder/text.ts +++ b/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; diff --git a/src/mol-io/writer/ligand-encoder.ts b/src/mol-io/writer/ligand-encoder.ts index 2e1dbe7344d23dffa4eca27da38ea72731818812..8386e15aeecfc2f830199dc9ac176534aeb5aa4e 100644 --- a/src/mol-io/writer/ligand-encoder.ts +++ b/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; diff --git a/src/mol-math/geometry/gaussian-density.ts b/src/mol-math/geometry/gaussian-density.ts index 7914af1530324368134ce93fc9ba68bb285b978a..44d36fa44b966396e708eb7a50feef74faa42f96 100644 --- a/src/mol-math/geometry/gaussian-density.ts +++ b/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); }); diff --git a/src/mol-math/geometry/gaussian-density/cpu.ts b/src/mol-math/geometry/gaussian-density/cpu.ts index eb42d99a1f8eb1d27cdc0fa0d9fd8d0210f18230..50a33fbeb4ac7ad26f71a868fdfbf7f6e7ea6cae 100644 --- a/src/mol-math/geometry/gaussian-density/cpu.ts +++ b/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; diff --git a/src/mol-math/geometry/gaussian-density/gpu.ts b/src/mol-math/geometry/gaussian-density/gpu.ts index 264c3fed054061a46c473e93149304e680b7a962..8aee512e1779177b38db90196a84ce633556dada 100644 --- a/src/mol-math/geometry/gaussian-density/gpu.ts +++ b/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++; } diff --git a/src/mol-math/geometry/spacegroup/construction.ts b/src/mol-math/geometry/spacegroup/construction.ts index fa3a23665a12fca070b42f50e58d4050b94ea760..26b83a3b223110273fd14a4b2d79edd19f8c99b6 100644 --- a/src/mol-math/geometry/spacegroup/construction.ts +++ b/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); diff --git a/src/mol-math/geometry/spacegroup/tables.ts b/src/mol-math/geometry/spacegroup/tables.ts index 925249a87d31bb1a9000b52d2b6cbff2f1be34f3..af006653792d4016ce24b1e4757427f7b6a13ea1 100644 --- a/src/mol-math/geometry/spacegroup/tables.ts +++ b/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; diff --git a/src/mol-math/linear-algebra/3d/quat.ts b/src/mol-math/linear-algebra/3d/quat.ts index a3d754d540863df4d8d6f0d0a6de0983fc91c057..f56b76dacd93c30091fbfe8714bc5dc3a79c6705 100644 --- a/src/mol-math/linear-algebra/3d/quat.ts +++ b/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; diff --git a/src/mol-math/misc.ts b/src/mol-math/misc.ts index c275e02b65370cc3a5dc7fd576f16e62d2c7f788..235baa8a53d672a2136e76df813193000b64c1e0 100644 --- a/src/mol-math/misc.ts +++ b/src/mol-math/misc.ts @@ -8,11 +8,11 @@ export const halfPI = Math.PI / 2; export const PiDiv180 = Math.PI / 180; export function degToRad(deg: number) { - return deg * PiDiv180; // deg * Math.PI / 180 + return deg * PiDiv180; // deg * Math.PI / 180 } export function radToDeg(rad: number) { - return rad / PiDiv180; // rad * 180 / Math.PI + return rad / PiDiv180; // rad * 180 / Math.PI } export function isPowerOfTwo(x: number) { diff --git a/src/mol-model-formats/shape/ply.ts b/src/mol-model-formats/shape/ply.ts index 7eabead7f08a6b43cc07b3e5e88733993c295adb..d94a8047f4b8777bcbca1fadb303206cd0da0863 100644 --- a/src/mol-model-formats/shape/ply.ts +++ b/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> } diff --git a/src/mol-model-formats/structure/basic/properties.ts b/src/mol-model-formats/structure/basic/properties.ts index 8515a6722cde23cd835daeb5a5498ab43a30f651..dd6fdaf92b66639bfce5dab64cf97ad5cb936dd1 100644 --- a/src/mol-model-formats/structure/basic/properties.ts +++ b/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; diff --git a/src/mol-model-formats/structure/util.ts b/src/mol-model-formats/structure/util.ts index faec9eaf0bc4982d1e8c89776803276c798bad14..f75908b0599dd7487d8f75df84d62476a6fe5bfc 100644 --- a/src/mol-model-formats/structure/util.ts +++ b/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 diff --git a/src/mol-model-props/computed/accessible-surface-area/shrake-rupley/common.ts b/src/mol-model-props/computed/accessible-surface-area/shrake-rupley/common.ts index 6c8c53661706cad50c71c26bf79ea2bdce579b6e..72936c707bf431ac34f69db4d6d87fc6ce94d948 100644 --- a/src/mol-model-props/computed/accessible-surface-area/shrake-rupley/common.ts +++ b/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 */ diff --git a/src/mol-model-props/computed/interactions/charged.ts b/src/mol-model-props/computed/interactions/charged.ts index e4c0359b994392e4d6aade1e318ae94ce23cb4c0..4dfc61b76c7121e180b8193210632d963c66a7e1 100644 --- a/src/mol-model-props/computed/interactions/charged.ts +++ b/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 } } } diff --git a/src/mol-model-props/computed/interactions/halogen-bonds.ts b/src/mol-model-props/computed/interactions/halogen-bonds.ts index 52f5b494176e6fe2d80e3f02ca5319d45b0091a9..210067f126bbcf19852cb112a0955a9381d2452b 100644 --- a/src/mol-model-props/computed/interactions/halogen-bonds.ts +++ b/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) { diff --git a/src/mol-model-props/computed/interactions/hydrogen-bonds.ts b/src/mol-model-props/computed/interactions/hydrogen-bonds.ts index 1f0ef8c037c5a2a38405ea7bf5d46ccf54d64ff7..f88dcd2b7e06e4e26a3d3ad9a26011c16816e965 100644 --- a/src/mol-model-props/computed/interactions/hydrogen-bonds.ts +++ b/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> diff --git a/src/mol-model/sequence/alignment/alignment.ts b/src/mol-model/sequence/alignment/alignment.ts index a0fb519ab095a0e3789722d2dd09e5c059d30c7e..1f319a95a8e2baa761adc71e32974c967e28cbe8 100644 --- a/src/mol-model/sequence/alignment/alignment.ts +++ b/src/mol-model/sequence/alignment/alignment.ts @@ -103,7 +103,7 @@ class Alignment { Si[j] = Math.max( Si1[j - 1] + scoreFn(i - 1, j - 1), // match Vi[j], // del - Hi[j] // ins + Hi[j] // ins ); } } diff --git a/src/mol-model/sequence/alignment/substitution-matrix.ts b/src/mol-model/sequence/alignment/substitution-matrix.ts index b81612ca95a5d886c2461bbf24f1dd7229dad049..f1badec24f66ee0daf2e8aa362ed6334587c7eef 100644 --- a/src/mol-model/sequence/alignment/substitution-matrix.ts +++ b/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,7 +56,7 @@ 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 }> }>; diff --git a/src/mol-model/sequence/constants.ts b/src/mol-model/sequence/constants.ts index 3a6584d33174077ca54e3c7cb7214feb527d913d..7f1f9b13426d689975562f6822191798189bd34e 100644 --- a/src/mol-model/sequence/constants.ts +++ b/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', diff --git a/src/mol-model/structure/export/categories/atom_site.ts b/src/mol-model/structure/export/categories/atom_site.ts index 404783aef18831e7d0de8d01bd18a5152b256824..daf85b13cc02f0699bc5e8d895b6cbee7fc08a82 100644 --- a/src/mol-model/structure/export/categories/atom_site.ts +++ b/src/mol-model/structure/export/categories/atom_site.ts @@ -53,7 +53,7 @@ const atom_site_fields = () => CifWriter.fields<StructureElement.Location, Struc .float('B_iso_or_equiv', P.atom.B_iso_or_equiv, { digitCount: 2, encoder: E.fixedPoint2 }) .int('pdbx_formal_charge', P.atom.pdbx_formal_charge, { encoder: E.deltaRLE, - valueKind: (k, d) => k.unit.model.atomicHierarchy.atoms.pdbx_formal_charge.valueKind(k.element) + valueKind: (k, d) => k.unit.model.atomicHierarchy.atoms.pdbx_formal_charge.valueKind(k.element) }) .str('auth_atom_id', P.atom.auth_atom_id) diff --git a/src/mol-model/structure/model/properties/atomic/measures.ts b/src/mol-model/structure/model/properties/atomic/measures.ts index 39120c2a6c2e4401b340bf48f06c9b8f2bd42f00..bfc9117cc965b8e502d3d8151d7d69f283259eac 100644 --- a/src/mol-model/structure/model/properties/atomic/measures.ts +++ b/src/mol-model/structure/model/properties/atomic/measures.ts @@ -19,8 +19,8 @@ export const ElementAtomWeights: { [e: number]: number | undefined } = { 1: 1.008, 2: 4.0026, 3: 6.94, 4: 9.0122, 5: 10.81, 6: 10.81, 7: 14.007, 8: 15.999, 9: 18.998, 10: 20.180, 11: 22.990, 12: 24.305, 13: 26.982, 14: 28.085, 15: 30.974, 16: 32.06, 17: 35.45, 18: 39.948, 19: 39.098, 20: 40.078, 21: 44.956, 22: 47.867, 23: 50.942, 24: 51.996, 25: 54.938, 26: 55.845, 27: 58.933, 28: 58.693, 29: 63.546, 30: 65.38, 31: 69.723, 32: 72.630, 33: 74.922, 34: 78.971, 35: 79.904, 36: 83.798, 37: 85.468, 38: 87.62, 39: 88.906, 40: 91.224, 41: 92.906, 42: 95.95, 43: 96.906, 44: 101.07, 45: 102.91, 46: 106.42, 47: 107.87, 48: 112.41, 49: 114.82, 50: 118.71, 51: 121.76, 52: 127.60, 53: 127.60, 54: 131.29, 55: 132.91, 56: 137.33, 57: 138.91, 58: 140.12, 59: 140.91, 60: 144.24, 61: 144.912, 62: 150.36, 63: 151.96, 64: 157.25, 65: 158.93, 66: 162.50, 67: 164.93, 68: 167.26, 69: 168.93, 70: 173.05, 71: 174.97, 72: 178.49, 73: 180.95, 74: 183.84, 75: 186.21, 76: 190.23, 77: 192.22, 78: 195.08, 79: 196.97, 80: 200.59, 81: 204.38, 82: 207.2, 83: 208.98, 84: 1.97, 85: 2.02, 86: 2.2, 87: 3.48, 88: 2.83, 89: 2.0, 90: 232.04, 91: 231.04, 92: 238.03, 93: 237.048, 94: 244.064, 95: 243.061, 96: 247.070, 97: 247.070, 98: 251.079, 99: 252.083, 100: 257.095, 101: 258.098, 102: 259.101, 103: 262.110, 104: 267.122, 105: 270.131, 106: 271.134, 107: 270.133, 108: 270.134, 109: 278.156 }; -export const DefaultVdwRadius = 1.7; // C -export const DefaultAtomWeight = 10.81; // C +export const DefaultVdwRadius = 1.7; // C +export const DefaultAtomWeight = 10.81; // C export const DefaultAtomNumber = 0; export function VdwRadius(element: ElementSymbol): number { diff --git a/src/mol-model/structure/model/properties/utils/coarse-keys.ts b/src/mol-model/structure/model/properties/utils/coarse-keys.ts index 3857a3519baa9cf9fc1f2283a5174dfaec82a6a5..d02b63c362ed640a4036cf037eacbdad71936788 100644 --- a/src/mol-model/structure/model/properties/utils/coarse-keys.ts +++ b/src/mol-model/structure/model/properties/utils/coarse-keys.ts @@ -44,7 +44,7 @@ function createLookUp(entities: Entities, chain: Map<number, Map<string, number> const sm = seq.get(cKey)!; const { elementIndices, seqRanges } = sm; const idx = SortedRanges.firstIntersectionIndex(seqRanges, OrderedSet.ofSingleton(s)); - return (idx !== -1 ? elementIndices[idx] : -1) as ElementIndex; + return (idx !== -1 ? elementIndices[idx] : -1) as ElementIndex; }; return { findChainKey, findSequenceKey }; } diff --git a/src/mol-model/structure/model/types.ts b/src/mol-model/structure/model/types.ts index 7ce35fbb9fdc60b8deca62a23f27c07a1d0920e4..da3f5333c7d0b284d6be524ed8fdff0270a682bf 100644 --- a/src/mol-model/structure/model/types.ts +++ b/src/mol-model/structure/model/types.ts @@ -458,14 +458,14 @@ export namespace SecondaryStructureType { Turn = 0x10, // category variant - LeftHanded = 0x20, // helix + LeftHanded = 0x20, // helix RightHanded = 0x40, - ClassicTurn = 0x80, // turn + ClassicTurn = 0x80, // turn InverseTurn = 0x100, // sub-category - HelixOther = 0x200, // protein + HelixOther = 0x200, // protein Helix27 = 0x400, Helix3Ten = 0x800, HelixAlpha = 0x1000, @@ -474,99 +474,99 @@ export namespace SecondaryStructureType { HelixPi = 0x8000, HelixPolyproline = 0x10000, - DoubleHelixOther = 0x20000, // nucleic + DoubleHelixOther = 0x20000, // nucleic DoubleHelixZ = 0x40000, DoubleHelixA = 0x80000, DoubleHelixB = 0x100000, - BetaOther = 0x200000, // protein - BetaStrand = 0x400000, // single strand - BetaSheet = 0x800000, // multiple hydrogen bonded strands - BetaBarell = 0x1000000, // closed series of sheets + BetaOther = 0x200000, // protein + BetaStrand = 0x400000, // single strand + BetaSheet = 0x800000, // multiple hydrogen bonded strands + BetaBarell = 0x1000000, // closed series of sheets - TurnOther = 0x2000000, // protein + TurnOther = 0x2000000, // protein Turn1 = 0x4000000, Turn2 = 0x8000000, Turn3 = 0x10000000, - NA = 0x20000000, // not applicable/available + NA = 0x20000000, // not applicable/available } export const SecondaryStructureMmcif: { [value: string]: number } = { - HELX_LH_27_P: Flag.Helix | Flag.LeftHanded | Flag.Helix27, // left-handed 2-7 helix (protein) - HELX_LH_3T_P: Flag.Helix | Flag.LeftHanded | Flag.Helix3Ten, // left-handed 3-10 helix (protein) - HELX_LH_AL_P: Flag.Helix | Flag.LeftHanded | Flag.HelixAlpha, // left-handed alpha helix (protein) - HELX_LH_A_N: Flag.DoubleHelix | Flag.LeftHanded | Flag.DoubleHelixA, // left-handed A helix (nucleic acid) - HELX_LH_B_N: Flag.DoubleHelix | Flag.LeftHanded | Flag.DoubleHelixB, // left-handed B helix (nucleic acid) - HELX_LH_GA_P: Flag.Helix | Flag.LeftHanded | Flag.HelixGamma, // left-handed gamma helix (protein) - HELX_LH_N: Flag.DoubleHelix | Flag.LeftHanded, // left-handed helix with type not specified (nucleic acid) - HELX_LH_OM_P: Flag.Helix | Flag.LeftHanded | Flag.HelixOmega, // left-handed omega helix (protein) - HELX_LH_OT_N: Flag.DoubleHelix | Flag.LeftHanded | Flag.DoubleHelixOther, // left-handed helix with type that does not conform to an accepted category (nucleic acid) - HELX_LH_OT_P: Flag.Helix | Flag.LeftHanded | Flag.HelixOther, // left-handed helix with type that does not conform to an accepted category (protein) - HELX_LH_P: Flag.Helix | Flag.LeftHanded, // left-handed helix with type not specified (protein) - HELX_LH_PI_P: Flag.Helix | Flag.LeftHanded | Flag.HelixPi, // left-handed pi helix (protein) - HELX_LH_PP_P: Flag.Helix | Flag.LeftHanded | Flag.HelixPolyproline, // left-handed polyproline helix (protein) - HELX_LH_Z_N: Flag.DoubleHelix | Flag.LeftHanded | Flag.DoubleHelixZ, // left-handed Z helix (nucleic acid) - HELX_N: Flag.DoubleHelix, // helix with handedness and type not specified (nucleic acid) - HELX_OT_N: Flag.DoubleHelix, // helix with handedness and type that do not conform to an accepted category (nucleic acid) - HELX_OT_P: Flag.Helix, // helix with handedness and type that do not conform to an accepted category (protein) - HELX_P: Flag.Helix, // helix with handedness and type not specified (protein) - HELX_RH_27_P: Flag.Helix | Flag.RightHanded | Flag.Helix27, // right-handed 2-7 helix (protein) - HELX_RH_3T_P: Flag.Helix | Flag.RightHanded | Flag.Helix3Ten, // right-handed 3-10 helix (protein) - HELX_RH_AL_P: Flag.Helix | Flag.RightHanded | Flag.HelixAlpha, // right-handed alpha helix (protein) - HELX_RH_A_N: Flag.DoubleHelix | Flag.RightHanded | Flag.DoubleHelixA, // right-handed A helix (nucleic acid) - HELX_RH_B_N: Flag.DoubleHelix | Flag.RightHanded | Flag.DoubleHelixB, // right-handed B helix (nucleic acid) - HELX_RH_GA_P: Flag.Helix | Flag.RightHanded | Flag.HelixGamma, // right-handed gamma helix (protein) - HELX_RH_N: Flag.DoubleHelix | Flag.RightHanded, // right-handed helix with type not specified (nucleic acid) - HELX_RH_OM_P: Flag.Helix | Flag.RightHanded | Flag.HelixOmega, // right-handed omega helix (protein) - HELX_RH_OT_N: Flag.DoubleHelix | Flag.RightHanded | Flag.DoubleHelixOther, // right-handed helix with type that does not conform to an accepted category (nucleic acid) - HELX_RH_OT_P: Flag.Helix | Flag.RightHanded | Flag.HelixOther, // right-handed helix with type that does not conform to an accepted category (protein) - HELX_RH_P: Flag.Helix | Flag.RightHanded, // right-handed helix with type not specified (protein) - HELX_RH_PI_P: Flag.Helix | Flag.RightHanded | Flag.HelixPi, // right-handed pi helix (protein) - HELX_RH_PP_P: Flag.Helix | Flag.RightHanded | Flag.HelixPolyproline, // right-handed polyproline helix (protein) - HELX_RH_Z_N: Flag.DoubleHelix | Flag.RightHanded | Flag.DoubleHelixZ, // right-handed Z helix (nucleic acid) - STRN: Flag.Beta | Flag.BetaStrand, // beta strand (protein) - TURN_OT_P: Flag.Turn | Flag.TurnOther, // turn with type that does not conform to an accepted category (protein) - TURN_P: Flag.Turn, // turn with type not specified (protein) - TURN_TY1P_P: Flag.Turn | Flag.InverseTurn | Flag.Turn1, // type I prime turn (protein) - TURN_TY1_P: Flag.Turn | Flag.ClassicTurn | Flag.Turn1, // type I turn (protein) - TURN_TY2P_P: Flag.Turn | Flag.InverseTurn | Flag.Turn2, // type II prime turn (protein) - TURN_TY2_P: Flag.Turn | Flag.ClassicTurn | Flag.Turn2, // type II turn (protein) - TURN_TY3P_P: Flag.Turn | Flag.InverseTurn | Flag.Turn3, // type III prime turn (protein) - TURN_TY3_P: Flag.Turn | Flag.ClassicTurn | Flag.Turn3, // type III turn (protein) + HELX_LH_27_P: Flag.Helix | Flag.LeftHanded | Flag.Helix27, // left-handed 2-7 helix (protein) + HELX_LH_3T_P: Flag.Helix | Flag.LeftHanded | Flag.Helix3Ten, // left-handed 3-10 helix (protein) + HELX_LH_AL_P: Flag.Helix | Flag.LeftHanded | Flag.HelixAlpha, // left-handed alpha helix (protein) + HELX_LH_A_N: Flag.DoubleHelix | Flag.LeftHanded | Flag.DoubleHelixA, // left-handed A helix (nucleic acid) + HELX_LH_B_N: Flag.DoubleHelix | Flag.LeftHanded | Flag.DoubleHelixB, // left-handed B helix (nucleic acid) + HELX_LH_GA_P: Flag.Helix | Flag.LeftHanded | Flag.HelixGamma, // left-handed gamma helix (protein) + HELX_LH_N: Flag.DoubleHelix | Flag.LeftHanded, // left-handed helix with type not specified (nucleic acid) + HELX_LH_OM_P: Flag.Helix | Flag.LeftHanded | Flag.HelixOmega, // left-handed omega helix (protein) + HELX_LH_OT_N: Flag.DoubleHelix | Flag.LeftHanded | Flag.DoubleHelixOther, // left-handed helix with type that does not conform to an accepted category (nucleic acid) + HELX_LH_OT_P: Flag.Helix | Flag.LeftHanded | Flag.HelixOther, // left-handed helix with type that does not conform to an accepted category (protein) + HELX_LH_P: Flag.Helix | Flag.LeftHanded, // left-handed helix with type not specified (protein) + HELX_LH_PI_P: Flag.Helix | Flag.LeftHanded | Flag.HelixPi, // left-handed pi helix (protein) + HELX_LH_PP_P: Flag.Helix | Flag.LeftHanded | Flag.HelixPolyproline, // left-handed polyproline helix (protein) + HELX_LH_Z_N: Flag.DoubleHelix | Flag.LeftHanded | Flag.DoubleHelixZ, // left-handed Z helix (nucleic acid) + HELX_N: Flag.DoubleHelix, // helix with handedness and type not specified (nucleic acid) + HELX_OT_N: Flag.DoubleHelix, // helix with handedness and type that do not conform to an accepted category (nucleic acid) + HELX_OT_P: Flag.Helix, // helix with handedness and type that do not conform to an accepted category (protein) + HELX_P: Flag.Helix, // helix with handedness and type not specified (protein) + HELX_RH_27_P: Flag.Helix | Flag.RightHanded | Flag.Helix27, // right-handed 2-7 helix (protein) + HELX_RH_3T_P: Flag.Helix | Flag.RightHanded | Flag.Helix3Ten, // right-handed 3-10 helix (protein) + HELX_RH_AL_P: Flag.Helix | Flag.RightHanded | Flag.HelixAlpha, // right-handed alpha helix (protein) + HELX_RH_A_N: Flag.DoubleHelix | Flag.RightHanded | Flag.DoubleHelixA, // right-handed A helix (nucleic acid) + HELX_RH_B_N: Flag.DoubleHelix | Flag.RightHanded | Flag.DoubleHelixB, // right-handed B helix (nucleic acid) + HELX_RH_GA_P: Flag.Helix | Flag.RightHanded | Flag.HelixGamma, // right-handed gamma helix (protein) + HELX_RH_N: Flag.DoubleHelix | Flag.RightHanded, // right-handed helix with type not specified (nucleic acid) + HELX_RH_OM_P: Flag.Helix | Flag.RightHanded | Flag.HelixOmega, // right-handed omega helix (protein) + HELX_RH_OT_N: Flag.DoubleHelix | Flag.RightHanded | Flag.DoubleHelixOther, // right-handed helix with type that does not conform to an accepted category (nucleic acid) + HELX_RH_OT_P: Flag.Helix | Flag.RightHanded | Flag.HelixOther, // right-handed helix with type that does not conform to an accepted category (protein) + HELX_RH_P: Flag.Helix | Flag.RightHanded, // right-handed helix with type not specified (protein) + HELX_RH_PI_P: Flag.Helix | Flag.RightHanded | Flag.HelixPi, // right-handed pi helix (protein) + HELX_RH_PP_P: Flag.Helix | Flag.RightHanded | Flag.HelixPolyproline, // right-handed polyproline helix (protein) + HELX_RH_Z_N: Flag.DoubleHelix | Flag.RightHanded | Flag.DoubleHelixZ, // right-handed Z helix (nucleic acid) + STRN: Flag.Beta | Flag.BetaStrand, // beta strand (protein) + TURN_OT_P: Flag.Turn | Flag.TurnOther, // turn with type that does not conform to an accepted category (protein) + TURN_P: Flag.Turn, // turn with type not specified (protein) + TURN_TY1P_P: Flag.Turn | Flag.InverseTurn | Flag.Turn1, // type I prime turn (protein) + TURN_TY1_P: Flag.Turn | Flag.ClassicTurn | Flag.Turn1, // type I turn (protein) + TURN_TY2P_P: Flag.Turn | Flag.InverseTurn | Flag.Turn2, // type II prime turn (protein) + TURN_TY2_P: Flag.Turn | Flag.ClassicTurn | Flag.Turn2, // type II turn (protein) + TURN_TY3P_P: Flag.Turn | Flag.InverseTurn | Flag.Turn3, // type III prime turn (protein) + TURN_TY3_P: Flag.Turn | Flag.ClassicTurn | Flag.Turn3, // type III turn (protein) }; export const SecondaryStructurePdb: { [value: string]: number } = { - 1: Flag.Helix | Flag.RightHanded | Flag.HelixAlpha, // Right-handed alpha (default) - 2: Flag.Helix | Flag.RightHanded | Flag.HelixOmega, // Right-handed omega - 3: Flag.Helix | Flag.RightHanded | Flag.HelixPi, // Right-handed pi - 4: Flag.Helix | Flag.RightHanded | Flag.HelixGamma, // Right-handed gamma - 5: Flag.Helix | Flag.RightHanded | Flag.Helix3Ten, // Right-handed 310 - 6: Flag.Helix | Flag.LeftHanded | Flag.HelixAlpha, // Left-handed alpha - 7: Flag.Helix | Flag.LeftHanded | Flag.HelixOmega, // Left-handed omega - 8: Flag.Helix | Flag.LeftHanded | Flag.HelixGamma, // Left-handed gamma - 9: Flag.Helix | Flag.Helix27, // 27 ribbon/helix - 10: Flag.Helix | Flag.HelixPolyproline, // Polyproline + 1: Flag.Helix | Flag.RightHanded | Flag.HelixAlpha, // Right-handed alpha (default) + 2: Flag.Helix | Flag.RightHanded | Flag.HelixOmega, // Right-handed omega + 3: Flag.Helix | Flag.RightHanded | Flag.HelixPi, // Right-handed pi + 4: Flag.Helix | Flag.RightHanded | Flag.HelixGamma, // Right-handed gamma + 5: Flag.Helix | Flag.RightHanded | Flag.Helix3Ten, // Right-handed 310 + 6: Flag.Helix | Flag.LeftHanded | Flag.HelixAlpha, // Left-handed alpha + 7: Flag.Helix | Flag.LeftHanded | Flag.HelixOmega, // Left-handed omega + 8: Flag.Helix | Flag.LeftHanded | Flag.HelixGamma, // Left-handed gamma + 9: Flag.Helix | Flag.Helix27, // 27 ribbon/helix + 10: Flag.Helix | Flag.HelixPolyproline, // Polyproline }; export const SecondaryStructureStride: { [value: string]: number } = { - H: Flag.Helix | Flag.HelixAlpha, // Alpha helix - G: Flag.Helix | Flag.Helix3Ten, // 3-10 helix - I: Flag.Helix | Flag.HelixPi, // PI-helix - E: Flag.Beta | Flag.BetaSheet, // Extended conformation - B: Flag.Beta | Flag.BetaStrand, // Isolated bridge - T: Flag.Turn, // Turn - C: Flag.NA, // Coil (none of the above) + H: Flag.Helix | Flag.HelixAlpha, // Alpha helix + G: Flag.Helix | Flag.Helix3Ten, // 3-10 helix + I: Flag.Helix | Flag.HelixPi, // PI-helix + E: Flag.Beta | Flag.BetaSheet, // Extended conformation + B: Flag.Beta | Flag.BetaStrand, // Isolated bridge + T: Flag.Turn, // Turn + C: Flag.NA, // Coil (none of the above) }; export const SecondaryStructureDssp: { [value: string]: number } = { - H: Flag.Helix | Flag.HelixAlpha, // alpha-helix - B: Flag.Beta | Flag.BetaStrand, // residue in isolated beta-bridge - E: Flag.Beta | Flag.BetaSheet, // extended strand, participates in beta ladder - G: Flag.Helix | Flag.Helix3Ten, // 3-helix (310 helix) - I: Flag.Helix | Flag.HelixPi, // 5 helix (pi-helix) - T: Flag.Turn, // hydrogen bonded turn - S: Flag.Bend, // bend + H: Flag.Helix | Flag.HelixAlpha, // alpha-helix + B: Flag.Beta | Flag.BetaStrand, // residue in isolated beta-bridge + E: Flag.Beta | Flag.BetaSheet, // extended strand, participates in beta ladder + G: Flag.Helix | Flag.Helix3Ten, // 3-helix (310 helix) + I: Flag.Helix | Flag.HelixPi, // 5 helix (pi-helix) + T: Flag.Turn, // hydrogen bonded turn + S: Flag.Bend, // bend }; } diff --git a/src/mol-model/structure/structure/properties.ts b/src/mol-model/structure/structure/properties.ts index f526e642fb5e55cf63039280c12b41ea95b691df..bc0e622e5b2defc62d1dae95a27c53df363b237f 100644 --- a/src/mol-model/structure/structure/properties.ts +++ b/src/mol-model/structure/structure/properties.ts @@ -39,8 +39,8 @@ const atom = { y: p(l => l.unit.conformation.y(l.element)), z: p(l => l.unit.conformation.z(l.element)), id: p(l => !Unit.isAtomic(l.unit) ? notAtomic() : l.unit.model.atomicConformation.atomId.value(l.element)), - occupancy: p(l => !Unit.isAtomic(l.unit) ? notAtomic() : l.unit.model.atomicConformation.occupancy.value(l.element)), - B_iso_or_equiv: p(l => !Unit.isAtomic(l.unit) ? notAtomic() : l.unit.model.atomicConformation.B_iso_or_equiv.value(l.element)), + occupancy: p(l => !Unit.isAtomic(l.unit) ? notAtomic() : l.unit.model.atomicConformation.occupancy.value(l.element)), + B_iso_or_equiv: p(l => !Unit.isAtomic(l.unit) ? notAtomic() : l.unit.model.atomicConformation.B_iso_or_equiv.value(l.element)), sourceIndex: p(l => Unit.isAtomic(l.unit) ? l.unit.model.atomicHierarchy.atomSourceIndex.value(l.element) // TODO: when implemented, this should map to the source index. diff --git a/src/mol-model/structure/structure/unit/bonds/inter-compute.ts b/src/mol-model/structure/structure/unit/bonds/inter-compute.ts index 945b253f350a68a2f8d37b81c627b7ea53cbb42e..ebb81e46a92c5fff863679de485388bf24bd17a3 100644 --- a/src/mol-model/structure/structure/unit/bonds/inter-compute.ts +++ b/src/mol-model/structure/structure/unit/bonds/inter-compute.ts @@ -139,7 +139,7 @@ function findPairBonds(unitA: Unit.Atomic, unitB: Unit.Atomic, props: BondComput // TODO: is this condition good enough? // - It works for cases like 3WQJ (label_asym_id: I) which have partial occupancy. // - Does NOT work for cases like 1RB8 (DC 7) with full occupancy. - if (hasOccupancy && occupancyB.value(bI) < 1 && occA < 1) { + if (hasOccupancy && occupancyB.value(bI) < 1 && occA < 1) { if (auth_seq_idA.value(aI) === auth_seq_idB.value(bI)) { continue; } diff --git a/src/mol-model/structure/structure/unit/bonds/intra-compute.ts b/src/mol-model/structure/structure/unit/bonds/intra-compute.ts index c12bce1ca5d9b0ee0631ae23b68d6a7d6d596042..427bf7378901e3e50d3b2d9aa1b05cb271263959 100644 --- a/src/mol-model/structure/structure/unit/bonds/intra-compute.ts +++ b/src/mol-model/structure/structure/unit/bonds/intra-compute.ts @@ -61,7 +61,7 @@ function findIndexPairBonds(unit: Unit.Atomic) { const orders: number[] = []; for (let _aI = 0 as StructureElement.UnitIndex; _aI < atomCount; _aI++) { - const aI = atoms[_aI]; + const aI = atoms[_aI]; const isHa = type_symbol.value(aI) === 'H'; const srcA = sourceIndex.value(aI); @@ -118,7 +118,7 @@ function findBonds(unit: Unit.Atomic, props: BondComputationProps): IntraUnitBon const structConnAdded = __structConnAdded; for (let _aI = 0 as StructureElement.UnitIndex; _aI < atomCount; _aI++) { - const aI = atoms[_aI]; + const aI = atoms[_aI]; const elemA = type_symbol.value(aI); if (isWatery && (elemA !== 'H' || elemA !== 'O')) isWatery = false; diff --git a/src/mol-model/volume/volume.ts b/src/mol-model/volume/volume.ts index db901d7fb6e8ab41f3994249ae20316647ddc251..280a32d7e26e9f2a3f455b3c77e84677b488ebf5 100644 --- a/src/mol-model/volume/volume.ts +++ b/src/mol-model/volume/volume.ts @@ -84,7 +84,7 @@ export namespace Volume { } } - const defaultStats: Grid['stats'] = { min: -1, max: 1, mean: 0, sigma: 0.1 }; + const defaultStats: Grid['stats'] = { min: -1, max: 1, mean: 0, sigma: 0.1 }; export function createIsoValueParam(defaultValue: Volume.IsoValue, stats?: Grid['stats']) { const sts = stats || defaultStats; const { min, max, mean, sigma } = sts; diff --git a/src/mol-plugin-state/animation/built-in/model-index.ts b/src/mol-plugin-state/animation/built-in/model-index.ts index 4c447db65910b3bf161b559fe863b5f359696cc1..bc969c86f6e870eb4344b8a5f77689e77d92dc71 100644 --- a/src/mol-plugin-state/animation/built-in/model-index.ts +++ b/src/mol-plugin-state/animation/built-in/model-index.ts @@ -120,7 +120,7 @@ export const AnimateModelIndex = PluginStateAnimation.create({ return { modelIndex }; } else { - const durationInMs = params.duration.name === 'fixed' + const durationInMs = params.duration.name === 'fixed' ? params.duration.params.durationInS * 1000 : Math.ceil(1000 * traj.data.frameCount / params.duration.params.targetFps); @@ -131,7 +131,7 @@ export const AnimateModelIndex = PluginStateAnimation.create({ } } if (params.mode.name === 'palindrome') { phase = 2 * phase; - if (phase > 1) phase = 2 - phase; + if (phase > 1) phase = 2 - phase; } const modelIndex = Math.min(Math.floor(traj.data.frameCount * phase), traj.data.frameCount - 1); diff --git a/src/mol-plugin-state/animation/model.ts b/src/mol-plugin-state/animation/model.ts index d72b7114a2170a4f55ab27f32b65bf366b7fa737..5f46f7e94d56df437dc9fdb44813fe0c564a47bb 100644 --- a/src/mol-plugin-state/animation/model.ts +++ b/src/mol-plugin-state/animation/model.ts @@ -41,7 +41,7 @@ interface PluginStateAnimation<P = any, S = any> { namespace PluginStateAnimation { export type CanApply = { canApply: true } | { canApply: false, reason?: string } - export type Duration = { kind: 'unknown' } | { kind: 'infinite' } | { kind: 'fixed', durationMs: number } + export type Duration = { kind: 'unknown' } | { kind: 'infinite' } | { kind: 'fixed', durationMs: number } export interface Instance<A extends PluginStateAnimation> { definition: PluginStateAnimation, diff --git a/src/mol-plugin-state/builder/structure.ts b/src/mol-plugin-state/builder/structure.ts index 5280a551f8fde4323034008d43419bfebfff536a..1c0d9db00b47815798d7386c60992b5b7aa9953f 100644 --- a/src/mol-plugin-state/builder/structure.ts +++ b/src/mol-plugin-state/builder/structure.ts @@ -147,7 +147,7 @@ export class StructureBuilder { type: { name: 'static', params: type }, nullIfEmpty: true, label: (params?.label || '').trim() - }, `static-${type}`, params?.tags); + }, `static-${type}`, params?.tags); } tryCreateComponentFromSelection(structure: StateObjectRef<SO.Molecule.Structure>, selection: StructureSelectionQuery, key: string, params?: { label?: string, tags?: string[] }): Promise<StateObjectSelector<SO.Molecule.Structure> | undefined> { diff --git a/src/mol-plugin-state/builder/structure/hierarchy-preset.ts b/src/mol-plugin-state/builder/structure/hierarchy-preset.ts index a8bcad352138520828fa074692dca2b96276c7a6..c5c68c60aeb668f8d93fb8ebacd1a54710d7a756 100644 --- a/src/mol-plugin-state/builder/structure/hierarchy-preset.ts +++ b/src/mol-plugin-state/builder/structure/hierarchy-preset.ts @@ -33,7 +33,7 @@ export namespace TrajectoryHierarchyPresetProvider { const CommonParams = TrajectoryHierarchyPresetProvider.CommonParams; -const DefaultParams = (a: PluginStateObject.Molecule.Trajectory | undefined, plugin: PluginContext) => ({ +const DefaultParams = (a: PluginStateObject.Molecule.Trajectory | undefined, plugin: PluginContext) => ({ model: PD.Optional(PD.Group(StateTransformer.getParamDefinition(StateTransforms.Model.ModelFromTrajectory, a, plugin))), showUnitcell: PD.Optional(PD.Boolean(false)), structure: PD.Optional(RootStructureDefinition.getParams(void 0, 'assembly').type), @@ -137,7 +137,7 @@ async function applyCrystalSymmetry(props: { ijkMin: Vec3, ijkMax: Vec3, theme?: const structureProperties = await builder.insertStructureProperties(structure, params.structureProperties); const unitcell = await builder.tryCreateUnitcell(modelProperties, undefined, { isHidden: false }); - const representation = await plugin.builders.structure.representation.applyPreset(structureProperties, params.representationPreset || 'auto', { theme: { globalName: props.theme } }); + const representation = await plugin.builders.structure.representation.applyPreset(structureProperties, params.representationPreset || 'auto', { theme: { globalName: props.theme } }); return { model, @@ -207,7 +207,7 @@ const crystalContacts = TrajectoryHierarchyPresetProvider({ const structureProperties = await builder.insertStructureProperties(structure, params.structureProperties); const unitcell = await builder.tryCreateUnitcell(modelProperties, undefined, { isHidden: true }); - const representation = await plugin.builders.structure.representation.applyPreset(structureProperties, params.representationPreset || 'auto', { theme: { globalName: 'operator-name', carbonColor: 'operator-name', focus: { name: 'element-symbol', params: { carbonColor: { name: 'operator-name', params: OperatorNameColorThemeProvider.defaultValues } } } } }); + const representation = await plugin.builders.structure.representation.applyPreset(structureProperties, params.representationPreset || 'auto', { theme: { globalName: 'operator-name', carbonColor: 'operator-name', focus: { name: 'element-symbol', params: { carbonColor: { name: 'operator-name', params: OperatorNameColorThemeProvider.defaultValues } } } } }); return { model, diff --git a/src/mol-plugin-state/builder/structure/representation-preset.ts b/src/mol-plugin-state/builder/structure/representation-preset.ts index 4f25df844bf8b3cac6cf965f6fe469fab7dd2c5f..119dd0f1564cbea0cd0333e0f4901016d5c0398c 100644 --- a/src/mol-plugin-state/builder/structure/representation-preset.ts +++ b/src/mol-plugin-state/builder/structure/representation-preset.ts @@ -137,7 +137,7 @@ const empty = StructureRepresentationPresetProvider({ id: 'preset-structure-representation-empty', display: { name: 'Empty', description: 'Removes all existing representations.' }, async apply(ref, params, plugin) { - return { }; + return { }; } }); diff --git a/src/mol-plugin-state/helpers/structure-representation-params.ts b/src/mol-plugin-state/helpers/structure-representation-params.ts index 621dea1713899d9ddd7cf3be2cfd91854a6447e9..07fb8c0191c59a808b0e090f8a0aa8734284271b 100644 --- a/src/mol-plugin-state/helpers/structure-representation-params.ts +++ b/src/mol-plugin-state/helpers/structure-representation-params.ts @@ -43,7 +43,7 @@ export interface StructureRepresentationProps< export function createStructureRepresentationParams<R extends StructureRepresentationRegistry.BuiltIn, C extends ColorTheme.BuiltIn, S extends SizeTheme.BuiltIn>(ctx: PluginContext, structure?: Structure, props?: StructureRepresentationBuiltInProps<R, C, S>): StateTransformer.Params<StructureRepresentation3D> export function createStructureRepresentationParams<R extends RepresentationProvider<Structure>, C extends ColorTheme.Provider, S extends SizeTheme.Provider>(ctx: PluginContext, structure?: Structure, props?: StructureRepresentationProps<R, C, S>): StateTransformer.Params<StructureRepresentation3D> -export function createStructureRepresentationParams(ctx: PluginContext, structure?: Structure, props: any = {}): StateTransformer.Params<StructureRepresentation3D> { +export function createStructureRepresentationParams(ctx: PluginContext, structure?: Structure, props: any = {}): StateTransformer.Params<StructureRepresentation3D> { const p = props as StructureRepresentationBuiltInProps; if (typeof p.type === 'string' || typeof p.color === 'string' || typeof p.size === 'string') return createParamsByName(ctx, structure || Structure.Empty, props); return createParamsProvider(ctx, structure || Structure.Empty, props); diff --git a/src/mol-plugin-state/helpers/volume-representation-params.ts b/src/mol-plugin-state/helpers/volume-representation-params.ts index 55d9ab3bd2ffe0f71b03a101e8809825337c8f1b..11189e19ef553a93de611bb0dfbb9c5c6f9b7122 100644 --- a/src/mol-plugin-state/helpers/volume-representation-params.ts +++ b/src/mol-plugin-state/helpers/volume-representation-params.ts @@ -43,7 +43,7 @@ export interface VolumeRepresentationProps< export function createVolumeRepresentationParams<R extends VolumeRepresentationRegistry.BuiltIn, C extends ColorTheme.BuiltIn, S extends SizeTheme.BuiltIn>(ctx: PluginContext, volume?: Volume, props?: VolumeRepresentationBuiltInProps<R, C, S>): StateTransformer.Params<VolumeRepresentation3D> export function createVolumeRepresentationParams<R extends RepresentationProvider<Volume>, C extends ColorTheme.Provider, S extends SizeTheme.Provider>(ctx: PluginContext, volume?: Volume, props?: VolumeRepresentationProps<R, C, S>): StateTransformer.Params<VolumeRepresentation3D> -export function createVolumeRepresentationParams(ctx: PluginContext, volume?: Volume, props: any = {}): StateTransformer.Params<VolumeRepresentation3D> { +export function createVolumeRepresentationParams(ctx: PluginContext, volume?: Volume, props: any = {}): StateTransformer.Params<VolumeRepresentation3D> { const p = props as VolumeRepresentationBuiltInProps; if (typeof p.type === 'string' || typeof p.color === 'string' || typeof p.size === 'string') return createParamsByName(ctx, volume || Volume.One, props); return createParamsProvider(ctx, volume || Volume.One, props); diff --git a/src/mol-plugin-state/manager/interactivity.ts b/src/mol-plugin-state/manager/interactivity.ts index 8aae69c4b811345d56c268ec9dac8bd36f501c40..947014640573c2f8f97bec9775256822592167c3 100644 --- a/src/mol-plugin-state/manager/interactivity.ts +++ b/src/mol-plugin-state/manager/interactivity.ts @@ -103,7 +103,7 @@ namespace InteractivityManager { protected normalizedLoci(reprLoci: Representation.Loci, applyGranularity = true) { const { loci, repr } = reprLoci; - const granularity = applyGranularity ? this.props.granularity : undefined; + const granularity = applyGranularity ? this.props.granularity : undefined; return { loci: Loci.normalize(loci, granularity), repr }; } diff --git a/src/mol-plugin-state/manager/structure/component.ts b/src/mol-plugin-state/manager/structure/component.ts index cfc61d3d95d089de7bd2f76b590b263fcbcc1a77..5f82bb9a1a30c16928ab67013a23149b39939cf5 100644 --- a/src/mol-plugin-state/manager/structure/component.ts +++ b/src/mol-plugin-state/manager/structure/component.ts @@ -111,7 +111,7 @@ class StructureComponentManager extends StatefulPluginComponent<StructureCompone } } - applyPreset<P extends StructureRepresentationPresetProvider>(structures: ReadonlyArray<StructureRef>, provider: P, params?: StructureRepresentationPresetProvider.Params<P>): Promise<any> { + applyPreset<P extends StructureRepresentationPresetProvider>(structures: ReadonlyArray<StructureRef>, provider: P, params?: StructureRepresentationPresetProvider.Params<P>): Promise<any> { return this.plugin.dataTransaction(async () => { for (const s of structures) { const preset = await this.plugin.builders.structure.representation.applyPreset(s.cell, provider, params); @@ -171,7 +171,7 @@ class StructureComponentManager extends StatefulPluginComponent<StructureCompone const mng = this.plugin.managers.structure.selection; mng.clear(); for (const c of components) { - const loci = Structure.toSubStructureElementLoci(c.structure.cell.obj!.data, c.cell.obj?.data!); + const loci = Structure.toSubStructureElementLoci(c.structure.cell.obj!.data, c.cell.obj?.data!); mng.fromLoci('set', loci); } } diff --git a/src/mol-plugin-state/manager/structure/measurement.ts b/src/mol-plugin-state/manager/structure/measurement.ts index 3ec049507315e44da92d2a72e947764e78519560..4907eb3e7edf84d536604126b5811b722e8265ec 100644 --- a/src/mol-plugin-state/manager/structure/measurement.ts +++ b/src/mol-plugin-state/manager/structure/measurement.ts @@ -46,7 +46,7 @@ type StructureMeasurementManagerAddOptions = { labelParams?: Partial<PD.Values<LociLabelTextParams>> } -class StructureMeasurementManager extends StatefulPluginComponent<StructureMeasurementManagerState> { +class StructureMeasurementManager extends StatefulPluginComponent<StructureMeasurementManagerState> { readonly behaviors = { state: this.ev.behavior(this.state) }; diff --git a/src/mol-plugin-state/transforms/volume.ts b/src/mol-plugin-state/transforms/volume.ts index 16ff08e5205a3c34c55b0aff3d149a38ad4578bf..b15d79071b303e94282f3cfeb87daa9c166e37ba 100644 --- a/src/mol-plugin-state/transforms/volume.ts +++ b/src/mol-plugin-state/transforms/volume.ts @@ -15,7 +15,7 @@ import { ParamDefinition as PD } from '../../mol-util/param-definition'; import { PluginStateObject as SO, PluginStateTransform } from '../objects'; import { volumeFromCube } from '../../mol-model-formats/volume/cube'; import { volumeFromDx } from '../../mol-model-formats/volume/dx'; -import { Volume } from '../../mol-model/volume'; +import { Volume } from '../../mol-model/volume'; import { PluginContext } from '../../mol-plugin/context'; import { StateSelection } from '../../mol-state'; diff --git a/src/mol-plugin-ui/controls/action-menu.tsx b/src/mol-plugin-ui/controls/action-menu.tsx index b06987a49fea732911a9b3e91a5fabad5ca54f9e..5ce7e61c0fdaad308edeceba1e8ca3c7d648805e 100644 --- a/src/mol-plugin-ui/controls/action-menu.tsx +++ b/src/mol-plugin-ui/controls/action-menu.tsx @@ -40,7 +40,7 @@ export namespace ActionMenu { export type OnSelect = (item: Item | undefined, e?: React.MouseEvent<HTMLButtonElement>) => void export type OnSelectMany = (itemOrItems: Item[] | undefined, e?: React.MouseEvent<HTMLButtonElement>) => void - export type Items = Header | Item | Items[] + export type Items = Header | Item | Items[] export type Header = { kind: 'header', label: string, isIndependent?: boolean, initiallyExpanded?: boolean, description?: string } export type Item = { kind: 'item', label: string, icon?: React.FC, disabled?: boolean, selected?: boolean, value: unknown, addOn?: JSX.Element, description?: string } diff --git a/src/mol-plugin-ui/controls/color.tsx b/src/mol-plugin-ui/controls/color.tsx index 76d871353f087094a3b5c44b799411406e59e3d0..cbb04476f626a7549ac63b1150081c63ad8e3275 100644 --- a/src/mol-plugin-ui/controls/color.tsx +++ b/src/mol-plugin-ui/controls/color.tsx @@ -84,7 +84,7 @@ export class CombinedColorControl extends React.PureComponent<ParamProps<PD.Colo <TextInput onChange={this.onB} numeric value={b} delayMs={250} style={{ order: 3, flex: '1 1 auto', minWidth: 0 }} className='msp-form-control' onEnter={this.props.onEnter} blurOnEnter={true} blurOnEscape={true} /> </div>}/> <div style={{ display: 'flex', textAlignLast: 'center' }}> - <Button onClick={this.onLighten} style={{ order: 1, flex: '1 1 auto', minWidth: 0 }} className='msp-form-control'>Lighten</Button> + <Button onClick={this.onLighten} style={{ order: 1, flex: '1 1 auto', minWidth: 0 }} className='msp-form-control'>Lighten</Button> <Button onClick={this.onDarken} style={{ order: 1, flex: '1 1 auto', minWidth: 0 }} className='msp-form-control'>Darken</Button> </div> </div>} diff --git a/src/mol-plugin-ui/controls/legend.tsx b/src/mol-plugin-ui/controls/legend.tsx index 539435bb7f5fb3969903ee7591752420a89e7745..99702dc66b8b6db1485662e4842f0dc9cb2eb2e9 100644 --- a/src/mol-plugin-ui/controls/legend.tsx +++ b/src/mol-plugin-ui/controls/legend.tsx @@ -27,7 +27,7 @@ export class ScaleLegend extends React.PureComponent<LegendProps<ScaleLegendData render() { const { legend } = this.props; const colors = legend.colors.map(c => Array.isArray(c) ? `${Color.toStyle(c[0])} ${100 * c[1]}%` : Color.toStyle(c)).join(', '); - return <div className='msp-scale-legend'> + return <div className='msp-scale-legend'> <div style={{ background: `linear-gradient(to right, ${colors})` }}> <span style={{ float: 'left' }}>{legend.minLabel}</span> <span style={{ float: 'right' }}>{legend.maxLabel}</span> diff --git a/src/mol-plugin-ui/sequence/polymer.ts b/src/mol-plugin-ui/sequence/polymer.ts index 331f88171fbc7c89a0ff235ceeff34d01c44720f..051c49659c56ec03da0286e6dbace662c893dace 100644 --- a/src/mol-plugin-ui/sequence/polymer.ts +++ b/src/mol-plugin-ui/sequence/polymer.ts @@ -92,7 +92,7 @@ export class PolymerSequenceWrapper extends SequenceWrapper<StructureUnit> { for (let i = 0; i < length; ++i) { if (this.missing.has(this.modelNum, this.asymId, this.seqId(i))) missing.push(i); } - this.observed = OrderedSet.subtract(Interval.ofBounds(0, length), SortedArray.ofSortedArray(missing)); + this.observed = OrderedSet.subtract(Interval.ofBounds(0, length), SortedArray.ofSortedArray(missing)); } } diff --git a/src/mol-plugin-ui/structure/measurements.tsx b/src/mol-plugin-ui/structure/measurements.tsx index 44fab5df3a870da7f4f21ad4ebec6c86bdf4a618..b1cdfb2a33ae1bfa5b289a29e7f79959bd4b36cd 100644 --- a/src/mol-plugin-ui/structure/measurements.tsx +++ b/src/mol-plugin-ui/structure/measurements.tsx @@ -126,7 +126,7 @@ export class MeasurementControls extends PurePluginUIComponent<{}, { isBusy: boo } toggleAdd = () => this.setState({ action: this.state.action === 'add' ? void 0 : 'add' }); - toggleOptions = () => this.setState({ action: this.state.action === 'options' ? void 0 : 'options' }); + toggleOptions = () => this.setState({ action: this.state.action === 'options' ? void 0 : 'options' }); highlight(loci: StructureElement.Loci) { this.plugin.managers.interactivity.lociHighlights.highlightOnly({ loci }, false); diff --git a/src/mol-plugin/behavior/dynamic/selection/structure-focus-representation.ts b/src/mol-plugin/behavior/dynamic/selection/structure-focus-representation.ts index ad7452f0dd1719ade6ec5077436d4870054eb720..43ad81abd070d9b3d51ec70d004b6bc6ce6ff664 100644 --- a/src/mol-plugin/behavior/dynamic/selection/structure-focus-representation.ts +++ b/src/mol-plugin/behavior/dynamic/selection/structure-focus-representation.ts @@ -157,7 +157,7 @@ class StructureFocusRepresentationBehavior extends PluginBehavior.WithSubscriber }); if (this.params.excludeTargetFromSurroundings) { - surroundings = MS.struct.modifier.exceptBy({ + surroundings = MS.struct.modifier.exceptBy({ 0: surroundings, by: target }); diff --git a/src/mol-plugin/behavior/dynamic/volume-streaming/model.ts b/src/mol-plugin/behavior/dynamic/volume-streaming/model.ts index 13138d154e3fbac6335004781e055d723260f434..c7f9661007b991e76cd012b7b1ea9023dc72efec 100644 --- a/src/mol-plugin/behavior/dynamic/volume-streaming/model.ts +++ b/src/mol-plugin/behavior/dynamic/volume-streaming/model.ts @@ -13,7 +13,7 @@ export class VolumeServerInfo extends PluginStateObject.Create<VolumeServerInfo. export namespace VolumeServerInfo { export type Kind = 'x-ray' | 'em' - export interface EntryData { + export interface EntryData { kind: Kind, // for em, the EMDB access code, for x-ray, the PDB id dataId: string, diff --git a/src/mol-repr/shape/loci/dihedral.ts b/src/mol-repr/shape/loci/dihedral.ts index fd6bac07d804b710e6f2c131343fd24f4294a02f..6a59a9ddfbc2b9a1ff0a612fc7b9d0da1588e7c0 100644 --- a/src/mol-repr/shape/loci/dihedral.ts +++ b/src/mol-repr/shape/loci/dihedral.ts @@ -326,7 +326,7 @@ function buildText(data: DihedralData, props: DihedralProps, text?: Text): Text let angle = radToDeg(tmpState.angle).toFixed(2); if (angle === '-0.00') angle = '0.00'; - const label = props.customText || `${angle}\u00B0`; + const label = props.customText || `${angle}\u00B0`; const radius = Math.max(2, tmpState.sphereA.radius, tmpState.sphereB.radius, tmpState.sphereC.radius, tmpState.sphereD.radius); const scale = radius / 2; builder.add(label, tmpVec[0], tmpVec[1], tmpVec[2], 0.1, scale, i); diff --git a/src/mol-repr/structure/complex-visual.ts b/src/mol-repr/structure/complex-visual.ts index f6cdff35be3ab6b06f7d9260706259501b5e94df..37e43b8631cf4508c3fb5fa4579fc426bf87e071 100644 --- a/src/mol-repr/structure/complex-visual.ts +++ b/src/mol-repr/structure/complex-visual.ts @@ -37,7 +37,7 @@ import { TextureMesh } from '../../mol-geo/geometry/texture-mesh/texture-mesh'; import { WebGLContext } from '../../mol-gl/webgl/context'; import { isPromiseLike } from '../../mol-util/type-helpers'; -export interface ComplexVisual<P extends StructureParams> extends Visual<Structure, P> { } +export interface ComplexVisual<P extends StructureParams> extends Visual<Structure, P> { } function createComplexRenderObject<G extends Geometry>(structure: Structure, geometry: G, locationIt: LocationIterator, theme: Theme, props: PD.Values<Geometry.Params<G>>, materialId: number) { const { createValues, createRenderableState } = Geometry.getUtils(geometry); diff --git a/src/mol-repr/structure/representation/putty.ts b/src/mol-repr/structure/representation/putty.ts index 3a0aa7dd7fafb887c8d72018366f649711c52329..826c4d78ef103aacde3d0ecedff3f9c466eed9b2 100644 --- a/src/mol-repr/structure/representation/putty.ts +++ b/src/mol-repr/structure/representation/putty.ts @@ -4,7 +4,7 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import { PolymerTubeVisual, PolymerTubeParams } from '../visual/polymer-tube-mesh'; +import { PolymerTubeVisual, PolymerTubeParams } from '../visual/polymer-tube-mesh'; import { PolymerGapVisual, PolymerGapParams } from '../visual/polymer-gap-cylinder'; import { ParamDefinition as PD } from '../../../mol-util/param-definition'; import { UnitsRepresentation } from '../units-representation'; diff --git a/src/mol-repr/structure/visual/util/link.ts b/src/mol-repr/structure/visual/util/link.ts index 5d6f7d2a44ded649d6e88c702eaf52fedb3bbf0c..34752801b2bd219933552315cf5b03fedcf16933 100644 --- a/src/mol-repr/structure/visual/util/link.ts +++ b/src/mol-repr/structure/visual/util/link.ts @@ -49,7 +49,7 @@ export function calculateShiftDir(out: Vec3, v1: Vec3, v2: Vec3, v3: Vec3 | null if (v3 !== null) { Vec3.sub(tmpShiftV13, v1, v3); } else { - Vec3.copy(tmpShiftV13, v1); // no reference point, use v1 + Vec3.copy(tmpShiftV13, v1); // no reference point, use v1 } Vec3.normalize(tmpShiftV13, tmpShiftV13); diff --git a/src/mol-repr/volume/slice.ts b/src/mol-repr/volume/slice.ts index 49688fe58aa025588c7b8f707dce4be64a594fb8..2aa30d19756849b05bf0a3f585d90a09cafed431 100644 --- a/src/mol-repr/volume/slice.ts +++ b/src/mol-repr/volume/slice.ts @@ -43,9 +43,9 @@ export async function createImage(ctx: VisualContext, volume: Volume, theme: The } = getSliceInfo(volume.grid, props); const corners = new Float32Array( - dim === 'x' ? [x, 0, 0, x, y, 0, x, 0, z, x, y, z] : - dim === 'y' ? [0, y, 0, x, y, 0, 0, y, z, x, y, z] : - [0, 0, z, 0, y, z, x, 0, z, x, y, z] + dim === 'x' ? [x, 0, 0, x, y, 0, x, 0, z, x, y, z] : + dim === 'y' ? [0, y, 0, x, y, 0, 0, y, z, x, y, z] : + [0, 0, z, 0, y, z, x, 0, z, x, y, z] ); const imageArray = new Uint8Array(width * height * 4); diff --git a/src/mol-repr/volume/util.ts b/src/mol-repr/volume/util.ts index fb10ce7c773cdb8fe6daec1520a1843993fd3e5d..9e8977ce4b2631bb34a4511568f40a907a7be108 100644 --- a/src/mol-repr/volume/util.ts +++ b/src/mol-repr/volume/util.ts @@ -65,7 +65,7 @@ export function getVolumeTexture2dLayout(dim: Vec3, padding = 0) { let rows = 1; let columns = width; if (powerOfTwoSize < width * dim[2]) { - columns = Math.floor(powerOfTwoSize / width); + columns = Math.floor(powerOfTwoSize / width); rows = Math.ceil(dim[2] / columns); width *= columns; height *= rows; diff --git a/src/mol-script/language/symbol-table/structure-query.ts b/src/mol-script/language/symbol-table/structure-query.ts index 19a157494d7a937cccfc2758f5912ce53bb37b7f..9e765f41649288a054b01a69b4a6a7d06b1c2bf6 100644 --- a/src/mol-script/language/symbol-table/structure-query.ts +++ b/src/mol-script/language/symbol-table/structure-query.ts @@ -87,8 +87,8 @@ const generator = { atomGroups: symbol(Arguments.Dictionary({ 'entity-test': Argument(Type.Bool, { isOptional: true, defaultValue: true, description: 'Test for the 1st atom of every entity' }), - 'chain-test': Argument(Type.Bool, { isOptional: true, defaultValue: true, description: 'Test for the 1st atom of every chain' }), - 'residue-test': Argument(Type.Bool, { isOptional: true, defaultValue: true, description: 'Test for the 1st atom every residue' }), + 'chain-test': Argument(Type.Bool, { isOptional: true, defaultValue: true, description: 'Test for the 1st atom of every chain' }), + 'residue-test': Argument(Type.Bool, { isOptional: true, defaultValue: true, description: 'Test for the 1st atom every residue' }), 'atom-test': Argument(Type.Bool, { isOptional: true, defaultValue: true }), 'group-by': Argument(Type.Any, { isOptional: true, defaultValue: `atom-key`, description: 'Group atoms to sets based on this property. Default: each atom has its own set' }), }), Types.ElementSelectionQuery, 'Return all atoms for which the tests are satisfied, grouped into sets.'), diff --git a/src/mol-script/language/symbol.ts b/src/mol-script/language/symbol.ts index 3694880c9cf1419c5b6f7cfe9272a9f82dba90b0..ac8973749da27c6fe2c73acf1ebf71e9b1a3f955 100644 --- a/src/mol-script/language/symbol.ts +++ b/src/mol-script/language/symbol.ts @@ -7,7 +7,7 @@ import { Type } from './type'; import { Expression } from './expression'; -export type Argument<T extends Type = Type> = { +export type Argument<T extends Type = Type> = { type: T, isOptional: boolean, isRest: boolean, @@ -31,7 +31,7 @@ export namespace Arguments { map: { [P in keyof T]: Argument<T[P]> }, '@type': T } - export type PropTypes<Map extends { [key: string]: Argument<any> }> = { [P in keyof Map]: Map[P]['type']['@type'] } + export type PropTypes<Map extends { [key: string]: Argument<any> }> = { [P in keyof Map]: Map[P]['type']['@type'] } export function Dictionary<Map extends { [key: string]: Argument<any> }>(map: Map): Arguments<PropTypes<Map>> { return { kind: 'dictionary', map, '@type': 0 as any }; } diff --git a/src/mol-script/runtime/query/base.ts b/src/mol-script/runtime/query/base.ts index 314d07e84749c07de54d901e620d32297bad197b..ca5fc17151e049efbf9919d4820a7071f436d6e4 100644 --- a/src/mol-script/runtime/query/base.ts +++ b/src/mol-script/runtime/query/base.ts @@ -63,7 +63,7 @@ export type QueryCompiledSymbolRuntime = { kind: 'const', value: any } | { kind: export type CompiledQueryFn<T = any> = { isConst: boolean, fn: QueryFn } export namespace QueryCompiledSymbol { - export function Const(value: any): QueryCompiledSymbolRuntime { + export function Const(value: any): QueryCompiledSymbolRuntime { return { kind: 'const', value }; } @@ -73,7 +73,7 @@ export namespace QueryCompiledSymbol { } export namespace CompiledQueryFn { - export function Const(value: any): CompiledQueryFn { + export function Const(value: any): CompiledQueryFn { return { isConst: true, fn: function CompiledQueryFn_Const(ctx) { return value; } }; } diff --git a/src/mol-state/state.ts b/src/mol-state/state.ts index 57ddc8d9abfc2812771f2758f6819eb9f0ec0d56..ff3772b4304bb94ad183121ed956699594e43fbf 100644 --- a/src/mol-state/state.ts +++ b/src/mol-state/state.ts @@ -966,7 +966,7 @@ function createObject(ctx: UpdateContext, cell: StateObjectCell, transformer: St return runTask(transformer.definition.apply({ a, params, cache: cell.cache, spine: ctx.spine, dependencies: resolveDependencies(cell) }, ctx.parent.globalContext), ctx.taskCtx); } -async function updateObject(ctx: UpdateContext, cell: StateObjectCell, transformer: StateTransformer, a: StateObject, b: StateObject, oldParams: any, newParams: any) { +async function updateObject(ctx: UpdateContext, cell: StateObjectCell, transformer: StateTransformer, a: StateObject, b: StateObject, oldParams: any, newParams: any) { if (!transformer.definition.update) { return StateTransformer.UpdateResult.Recreate; } diff --git a/src/mol-state/state/builder.ts b/src/mol-state/state/builder.ts index 345c05f655a8712366323ba99552545ccf7d80c9..e1601fbf5cefede65bfb6adb4200b7c4732375a8 100644 --- a/src/mol-state/state/builder.ts +++ b/src/mol-state/state/builder.ts @@ -253,7 +253,7 @@ namespace StateBuilder { to<A extends StateObject, T extends StateTransformer>(ref: StateTransform.Ref): To<A, T> to<C extends StateObjectCell>(cell: C): To<StateObjectCell.Obj<C>, StateObjectCell.Transformer<C>> to<S extends StateObjectSelector>(selector: S): To<StateObjectSelector.Obj<S>, StateObjectSelector.Transformer<S>> - to(ref: StateTransform.Ref | StateObjectCell | StateObjectSelector) { return this.root.to(ref as any); } + to(ref: StateTransform.Ref | StateObjectCell | StateObjectSelector) { return this.root.to(ref as any); } toRoot<A extends StateObject>() { return this.root.toRoot<A>(); } delete(ref: StateObjectRef) { return this.root.delete(ref); } diff --git a/src/mol-theme/color/residue-name.ts b/src/mol-theme/color/residue-name.ts index 727df16a5ee9fe3e499af9312bc162d087a15e47..59412412ab864c445ca2b2e2301810bec068e3ab 100644 --- a/src/mol-theme/color/residue-name.ts +++ b/src/mol-theme/color/residue-name.ts @@ -38,12 +38,12 @@ export const ResidueNameColors = ColorMap({ 'VAL': 0xFF8CFF, // rna bases - 'A': 0xDC143C, // Crimson Red - 'G': 0x32CD32, // Lime Green - 'I': 0x9ACD32, // Yellow Green - 'C': 0xFFD700, // Gold Yellow - 'T': 0x4169E1, // Royal Blue - 'U': 0x40E0D0, // Turquoise Cyan + 'A': 0xDC143C, // Crimson Red + 'G': 0x32CD32, // Lime Green + 'I': 0x9ACD32, // Yellow Green + 'C': 0xFFD700, // Gold Yellow + 'T': 0x4169E1, // Royal Blue + 'U': 0x40E0D0, // Turquoise Cyan // dna bases 'DA': 0xDC143C, diff --git a/src/mol-util/color/spaces/lab.ts b/src/mol-util/color/spaces/lab.ts index 1b97c8987aca4abc820af2d24d449101149789b5..a307b2e7c2f365b6196f88487e29ecf8f18d40e1 100644 --- a/src/mol-util/color/spaces/lab.ts +++ b/src/mol-util/color/spaces/lab.ts @@ -67,7 +67,7 @@ namespace Lab { x = Xn * lab_xyz(x); z = Zn * lab_xyz(z); - const r = xyz_rgb(3.2404542 * x - 1.5371385 * y - 0.4985314 * z); // D65 -> sRGB + const r = xyz_rgb(3.2404542 * x - 1.5371385 * y - 0.4985314 * z); // D65 -> sRGB const g = xyz_rgb(-0.9692660 * x + 1.8760108 * y + 0.0415560 * z); const b = xyz_rgb(0.0556434 * x - 0.2040259 * y + 1.0572252 * z); @@ -127,7 +127,7 @@ namespace Lab { const T0 = 0.137931034; // 4 / 29 const T1 = 0.206896552; // 6 / 29 - const T2 = 0.12841855; // 3 * t1 * t1 + const T2 = 0.12841855; // 3 * t1 * t1 const T3 = 0.008856452; // t1 * t1 * t1 /** convert component from xyz to rgb */ diff --git a/src/mol-util/float-packing.ts b/src/mol-util/float-packing.ts index 6503bac3e2b986a7cbb3a40589e7e1559dfac431..9629cd22deca8478a41a455f541723577d24f67f 100644 --- a/src/mol-util/float-packing.ts +++ b/src/mol-util/float-packing.ts @@ -35,7 +35,7 @@ export function decodeFloatRGB(r: number, g: number, b: number) { } const UnpackDownscale = 255 / 256; // 0..1 -> fraction (excluding 1) -const PackFactors = Vec3.create(256 * 256 * 256, 256 * 256, 256); +const PackFactors = Vec3.create(256 * 256 * 256, 256 * 256, 256); const UnpackFactors = Vec4.create( UnpackDownscale / PackFactors[0], UnpackDownscale / PackFactors[1], diff --git a/src/mol-util/input/input-observer.ts b/src/mol-util/input/input-observer.ts index 8579c7240ad05d16a1711776ee8a3ea6bbf5f52a..9326d9f077e07a94f2444f0e90aebdb92f73dc0a 100644 --- a/src/mol-util/input/input-observer.ts +++ b/src/mol-util/input/input-observer.ts @@ -16,7 +16,7 @@ export function getButtons(event: MouseEvent | Touch) { if ('buttons' in event) { return event.buttons; } else if ('which' in event) { - const b = (event as any).which; // 'any' to support older browsers + const b = (event as any).which; // 'any' to support older browsers if (b === 2) { return 4; } else if (b === 3) { @@ -721,7 +721,7 @@ function normalizeWheel(event: any) { const LINE_HEIGHT = 40; const PAGE_HEIGHT = 800; let spinX = 0, spinY = 0, - dx = 0, dy = 0, dz = 0; // pixelX, pixelY, pixelZ + dx = 0, dy = 0, dz = 0; // pixelX, pixelY, pixelZ // Legacy if ('detail' in event) { spinY = event.detail; } @@ -743,11 +743,11 @@ function normalizeWheel(event: any) { if ('deltaZ' in event) { dz = event.deltaZ; } if ((dx || dy || dz) && event.deltaMode) { - if (event.deltaMode === 1) { // delta in LINE units + if (event.deltaMode === 1) { // delta in LINE units dx *= LINE_HEIGHT; dy *= LINE_HEIGHT; dz *= LINE_HEIGHT; - } else { // delta in PAGE units + } else { // delta in PAGE units dx *= PAGE_HEIGHT; dy *= PAGE_HEIGHT; dz *= PAGE_HEIGHT; diff --git a/src/mol-util/marker-action.ts b/src/mol-util/marker-action.ts index 25b5b1671501bfeee821009f907aa79235f0ea2b..53bcd5e4fadca982ce45040684d6c0847e0d680f 100644 --- a/src/mol-util/marker-action.ts +++ b/src/mol-util/marker-action.ts @@ -74,7 +74,7 @@ export function applyMarkerAction(array: Uint8Array, set: OrderedSet, action: Ma const viewEnd = viewStart + ((end - 4 * viewStart) >> 2); const frontStart = start; - const frontEnd = Math.min(4 * viewStart, end); + const frontEnd = Math.min(4 * viewStart, end); const backStart = Math.max(start, 4 * viewEnd); const backEnd = end; diff --git a/src/mol-util/mask.ts b/src/mol-util/mask.ts index 72f98724f727738a72f828d06a50c9e4662569f1..e35b68d86577b31da7b750722723f74a15a16eeb 100644 --- a/src/mol-util/mask.ts +++ b/src/mol-util/mask.ts @@ -55,7 +55,7 @@ namespace Mask { this._forEach(f, ctx); return ctx; } - constructor(private mask: boolean[], public size: number) { this.length = mask.length; } + constructor(private mask: boolean[], public size: number) { this.length = mask.length; } } class AllMask implements Mask { diff --git a/src/mol-util/type-helpers.ts b/src/mol-util/type-helpers.ts index d597aa4d29b9d4c76d5036e1dadce697328b744d..d775c4bad7d10efe3ea0435ec1683498d7ccacfe 100644 --- a/src/mol-util/type-helpers.ts +++ b/src/mol-util/type-helpers.ts @@ -18,7 +18,7 @@ export type UintArray = Uint8Array | Uint16Array | Uint32Array | number[] export type ValueOf<T> = T[keyof T] export type ArrayCtor<T> = { new(size: number): { [i: number]: T, length: number } } /** assignable ArrayLike version */ -export type AssignableArrayLike<T> = { [i: number]: T, length: number } +export type AssignableArrayLike<T> = { [i: number]: T, length: number } export type NonNullableArray<T extends any[] | ReadonlyArray<any>> = T extends any[] ? NonNullable<T[0]>[] : ReadonlyArray<NonNullable<T[0]>> diff --git a/src/mol-util/zip/bin.ts b/src/mol-util/zip/bin.ts index 8ef3f163411dd398fe1f5e9367468087abc59745..a1a1753890c64dd2e1d9e7876b21dccdb47e8820 100644 --- a/src/mol-util/zip/bin.ts +++ b/src/mol-util/zip/bin.ts @@ -19,7 +19,7 @@ export function readUshort(buff: Uint8Array, p: number) { } export function writeUshort(buff: Uint8Array, p: number, n: number) { - buff[p] = (n) & 255; buff[p + 1] = (n >> 8) & 255; + buff[p] = (n) & 255; buff[p + 1] = (n >> 8) & 255; } export function readUint(buff: Uint8Array, p: number) { diff --git a/src/mol-util/zip/checksum.ts b/src/mol-util/zip/checksum.ts index cd4d93fbd3105718632be7149ec1626e537d5bb5..2ea3851a4be187c35caaed686f31a8bcbe90ada1 100644 --- a/src/mol-util/zip/checksum.ts +++ b/src/mol-util/zip/checksum.ts @@ -12,8 +12,8 @@ const CrcTable = (function () { for (let n = 0; n < 256; n++) { let c = n; for (let k = 0; k < 8; k++) { - if (c & 1) c = 0xedb88320 ^ (c >>> 1); - else c = c >>> 1; + if (c & 1) c = 0xedb88320 ^ (c >>> 1); + else c = c >>> 1; } tab[n] = c; } @@ -21,13 +21,13 @@ const CrcTable = (function () { })(); function _crc(c: number, buf: Uint8Array, off: number, len: number) { - for (let i = 0; i < len; i++) { + for (let i = 0; i < len; i++) { c = CrcTable[(c ^ buf[off + i]) & 0xff] ^ (c >>> 8); } return c; } -export function crc(b: Uint8Array, o: number, l: number) { +export function crc(b: Uint8Array, o: number, l: number) { return _crc(0xffffffff, b, o, l) ^ 0xffffffff; } diff --git a/src/mol-util/zip/deflate.ts b/src/mol-util/zip/deflate.ts index e514ef84259c30cdb6d72cfde799a7e012894513..498f6e463265ca16f3e94348dc691e34d21f3c50 100644 --- a/src/mol-util/zip/deflate.ts +++ b/src/mol-util/zip/deflate.ts @@ -45,7 +45,7 @@ function deflateChunk(ctx: DeflateContext, count: number) { const end = Math.min(i + count, dlen); - for(; i < end; i++) { + for(; i < end; i++) { c = nc; if(i + 1 < dlen - 2) { @@ -74,9 +74,9 @@ function deflateChunk(ctx: DeflateContext, count: number) { if(mch !== 0) { const len = mch >>> 16, dst = mch & 0xffff; - const lgi = _goodIndex(len, U.of0); U.lhst[257 + lgi]++; - const dgi = _goodIndex(dst, U.df0); U.dhst[dgi]++; ebits += U.exb[lgi] + U.dxb[dgi]; - lits[li] = (len << 23) | (i - cvrd); lits[li + 1] = (dst << 16) | (lgi << 8) | dgi; li += 2; + const lgi = _goodIndex(len, U.of0); U.lhst[257 + lgi]++; + const dgi = _goodIndex(dst, U.df0); U.dhst[dgi]++; ebits += U.exb[lgi] + U.dxb[dgi]; + lits[li] = (len << 23) | (i - cvrd); lits[li + 1] = (dst << 16) | (lgi << 8) | dgi; li += 2; cvrd = i + len; } else { U.lhst[data[i]]++; @@ -103,15 +103,15 @@ function deflateChunk(ctx: DeflateContext, count: number) { */ const Opts = [ /* good lazy nice chain */ - /* 0 */ [0, 0, 0, 0, 0], /* store only */ - /* 1 */ [4, 4, 8, 4, 0], /* max speed, no lazy matches */ - /* 2 */ [4, 5, 16, 8, 0], - /* 3 */ [4, 6, 16, 16, 0], - - /* 4 */ [4, 10, 16, 32, 0], /* lazy matches */ - /* 5 */ [8, 16, 32, 32, 0], - /* 6 */ [8, 16, 128, 128, 0], - /* 7 */ [8, 32, 128, 256, 0], + /* 0 */ [0, 0, 0, 0, 0], /* store only */ + /* 1 */ [4, 4, 8, 4, 0], /* max speed, no lazy matches */ + /* 2 */ [4, 5, 16, 8, 0], + /* 3 */ [4, 6, 16, 16, 0], + + /* 4 */ [4, 10, 16, 32, 0], /* lazy matches */ + /* 5 */ [8, 16, 32, 32, 0], + /* 6 */ [8, 16, 128, 128, 0], + /* 7 */ [8, 32, 128, 256, 0], /* 8 */ [32, 128, 258, 1024, 1], /* 9 */ [32, 258, 258, 4096, 1] /* max compression */ ] as const; @@ -164,25 +164,25 @@ function _bestMatch(data: Uint8Array, i: number, prev: Uint16Array, c: number, n // console.log("----", i); let dif = ((ci - pi + (1 << 15)) & 0x7fff); if(pi === ci || c !== _hash(data, i - dif)) return 0; - let tl = 0, td = 0; // top length, top distance + let tl = 0, td = 0; // top length, top distance const dlim = Math.min(0x7fff, i); while(dif <= dlim && --chain !== 0 && pi !== ci /* && c==UZIP.F._hash(data,i-dif)*/) { if(tl === 0 || (data[i + tl] === data[i + tl - dif])) { let cl = _howLong(data, i, dif); if(cl > tl) { - tl = cl; td = dif; if(tl >= nice) break; //* + tl = cl; td = dif; if(tl >= nice) break; //* if(dif + 2 < cl) cl = dif + 2; let maxd = 0; // pi does not point to the start of the word for(let j = 0; j < cl - 2; j++) { - const ei = (i - dif + j + (1 << 15)) & 0x7fff; + const ei = (i - dif + j + (1 << 15)) & 0x7fff; const li = prev[ei]; const curd = (ei - li + (1 << 15)) & 0x7fff; - if(curd > maxd) { maxd = curd; pi = ei; } + if(curd > maxd) { maxd = curd; pi = ei; } } } } - ci = pi; pi = prev[ci]; + ci = pi; pi = prev[ci]; dif += ((ci - pi + (1 << 15)) & 0x7fff); } return (tl << 16) | td; @@ -233,17 +233,17 @@ function _writeBlock(BFINAL: number, lits: Uint32Array, li: number, ebits: numbe } else { let ltree: number[], dtree: number[]; if(BTYPE === 1) { - ltree = U.fltree; dtree = U.fdtree; + ltree = U.fltree; dtree = U.fdtree; } else if(BTYPE === 2) { - makeCodes(U.ltree, ML); revCodes(U.ltree, ML); - makeCodes(U.dtree, MD); revCodes(U.dtree, MD); - makeCodes(U.itree, MH); revCodes(U.itree, MH); + makeCodes(U.ltree, ML); revCodes(U.ltree, ML); + makeCodes(U.dtree, MD); revCodes(U.dtree, MD); + makeCodes(U.itree, MH); revCodes(U.itree, MH); - ltree = U.ltree; dtree = U.dtree; + ltree = U.ltree; dtree = U.dtree; - _putsE(out, pos, numl - 257); pos += 5; // 286 - _putsE(out, pos, numd - 1); pos += 5; // 30 - _putsE(out, pos, numh - 4); pos += 4; // 19 + _putsE(out, pos, numl - 257); pos += 5; // 286 + _putsE(out, pos, numd - 1); pos += 5; // 30 + _putsE(out, pos, numh - 4); pos += 4; // 19 for(let i = 0; i < numh; i++) _putsE(out, pos + i * 3, U.itree[(U.ordr[i] << 1) + 1]); pos += 3 * numh; @@ -261,10 +261,10 @@ function _writeBlock(BFINAL: number, lits: Uint32Array, li: number, ebits: numbe if(len !== 0) { const qc = lits[si + 1], dst = (qc >> 16), lgi = (qc >> 8) & 255, dgi = (qc & 255); pos = _writeLit(257 + lgi, ltree, out, pos); - _putsE(out, pos, len - U.of0[lgi]); pos += U.exb[lgi]; + _putsE(out, pos, len - U.of0[lgi]); pos += U.exb[lgi]; pos = _writeLit(dgi, dtree, out, pos); - _putsF(out, pos, dst - U.df0[dgi]); pos += U.dxb[dgi]; off += len; + _putsF(out, pos, dst - U.df0[dgi]); pos += U.dxb[dgi]; off += len; } } pos = _writeLit(256, ltree, out, pos); @@ -300,7 +300,7 @@ function getTrees() { const numd = _lenCodes(U.dtree, dset); for(let i = 0; i < lset.length; i += 2) U.ihst[lset[i]]++; for(let i = 0; i < dset.length; i += 2) U.ihst[dset[i]]++; - const MH = _hufTree(U.ihst, U.itree, 7); + const MH = _hufTree(U.ihst, U.itree, 7); let numh = 19; while(numh > 4 && U.itree[(U.ordr[numh - 1] << 1) + 1] === 0) numh--; return [ML, MD, MH, numl, numd, numh, lset, dset] as const; @@ -314,7 +314,7 @@ function contSize(tree: number[], hst: NumberArray) { function _codeTiny(set: number[], tree: number[], out: Uint8Array, pos: number) { for(let i = 0; i < set.length; i += 2) { - const l = set[i], rst = set[i + 1]; // console.log(l, pos, tree[(l<<1)+1]); + const l = set[i], rst = set[i + 1]; // console.log(l, pos, tree[(l<<1)+1]); pos = _writeLit(l, tree, out, pos); const rsl = l === 16 ? 2 : (l === 17 ? 3 : 7); if(l > 15) { @@ -328,9 +328,9 @@ function _codeTiny(set: number[], tree: number[], out: Uint8Array, pos: number) function _lenCodes(tree: number[], set: number[]) { let len = tree.length; - while(len !== 2 && tree[len - 1] === 0) len -= 2; // when no distances, keep one code with length 0 + while(len !== 2 && tree[len - 1] === 0) len -= 2; // when no distances, keep one code with length 0 for(let i = 0; i < len; i += 2) { - const l = tree[i + 1], nxt = (i + 3 < len ? tree[i + 3] : -1), nnxt = (i + 5 < len ? tree[i + 5] : -1), prv = (i === 0 ? -1 : tree[i - 1]); + const l = tree[i + 1], nxt = (i + 3 < len ? tree[i + 3] : -1), nnxt = (i + 5 < len ? tree[i + 5] : -1), prv = (i === 0 ? -1 : tree[i - 1]); if(l === 0 && nxt === l && nnxt === l) { let lz = i + 5; while(lz + 2 < len && tree[lz + 2] === l) lz += 2; diff --git a/src/mol-util/zip/huffman.ts b/src/mol-util/zip/huffman.ts index 0ee6964e623173f81a35e004e7c43955d4cae2b0..e3ce56cf80aa33e8c0b6e81b30d087d0ce63c160 100644 --- a/src/mol-util/zip/huffman.ts +++ b/src/mol-util/zip/huffman.ts @@ -25,7 +25,7 @@ export function _hufTree(hst: NumberArray, tree: number[], MAXL: number) { } for(let i = 0; i < hl; i++) if(hst[i] !== 0) list.push({ lit: i, f: hst[i], d: undefined as any }); const end = list.length, l2 = list.slice(0); - if(end === 0) return 0; // empty histogram (usually for dist) + if(end === 0) return 0; // empty histogram (usually for dist) if(end === 1) { const lit = list[0].lit, l2 = lit === 0 ? 1 : 0; tree[(lit << 1) + 1] = 1; diff --git a/src/mol-util/zip/inflate.ts b/src/mol-util/zip/inflate.ts index d4159eebf6d6a5fe812f57d271d763ecd4cb26f9..0428a24f6905e7a12de29960372b9b273d63ee0f 100644 --- a/src/mol-util/zip/inflate.ts +++ b/src/mol-util/zip/inflate.ts @@ -82,10 +82,10 @@ function inflateBlocks(ctx: InflateContext, count: number) { makeCodes(U.itree, tl); codes2map(U.itree, tl, U.imap); - lmap = U.lmap; dmap = U.dmap; + lmap = U.lmap; dmap = U.dmap; pos = _decodeTiny(U.imap, (1 << tl) - 1, HLIT + HDIST, data, pos, U.ttree); - const mx0 = _copyOut(U.ttree, 0, HLIT, U.ltree); + const mx0 = _copyOut(U.ttree, 0, HLIT, U.ltree); ML = (1 << mx0) - 1; const mx1 = _copyOut(U.ttree, HLIT, HDIST, U.dtree); MD = (1 << mx1) - 1; @@ -174,11 +174,11 @@ function _decodeTiny(lmap: NumberArray, LL: number, len: number, data: Uint8Arra } else { let ll = 0, n = 0; if(lit === 16) { - n = (3 + _bitsE(data, pos, 2)); + n = (3 + _bitsE(data, pos, 2)); pos += 2; ll = tree[i - 1]; } else if(lit === 17) { - n = (3 + _bitsE(data, pos, 3)); + n = (3 + _bitsE(data, pos, 3)); pos += 3; } else if(lit === 18) { n = (11 + _bitsE(data, pos, 7)); diff --git a/src/mol-util/zip/util.ts b/src/mol-util/zip/util.ts index 0cb19cc589403ae2a1bdb790f283e774e957367c..f9b4eb7329548199cd39bd5c4424c4bc7fd854d7 100644 --- a/src/mol-util/zip/util.ts +++ b/src/mol-util/zip/util.ts @@ -14,16 +14,16 @@ export const U = (function (){ bl_count: new u16(16), ordr: [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], of0: [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 999, 999, 999], - exb: [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0], + exb: [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0], ldef: new u16(32), df0: [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 65535, 65535], - dxb: [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0], + dxb: [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0], ddef: new u32(32), - flmap: new u16(512), fltree: [] as number[], - fdmap: new u16(32), fdtree: [] as number[], - lmap: new u16(32768), ltree: [] as number[], ttree: [] as number[], - dmap: new u16(32768), dtree: [] as number[], - imap: new u16(512), itree: [] as number[], + flmap: new u16(512), fltree: [] as number[], + fdmap: new u16(32), fdtree: [] as number[], + lmap: new u16(32768), ltree: [] as number[], ttree: [] as number[], + dmap: new u16(32768), dtree: [] as number[], + imap: new u16(512), itree: [] as number[], // rev9 : new u16( 512) rev15: new u16(1 << 15), lhst: new u32(286), dhst: new u32(30), ihst: new u32(19), @@ -74,7 +74,7 @@ export const U = (function (){ codes2map(U.fdtree, 5, U.fdmap); revCodes(U.fdtree, 5); - pushV(U.itree, 19, 0); pushV(U.ltree, 286, 0); pushV(U.dtree, 30, 0); pushV(U.ttree, 320, 0); + pushV(U.itree, 19, 0); pushV(U.ltree, 286, 0); pushV(U.dtree, 30, 0); pushV(U.ttree, 320, 0); /* for(var i=0; i< 19; i++) U.itree.push(0,0); for(var i=0; i<286; i++) U.ltree.push(0,0); @@ -87,7 +87,7 @@ export function codes2map(tree: number[], MAX_BITS: number, map: Uint16Array) { const max_code = tree.length; const r15 = U.rev15; for(let i = 0; i < max_code; i += 2) { - if(tree[i + 1] !== 0) { + if(tree[i + 1] !== 0) { const lit = i >> 1; const cl = tree[i + 1], val = (lit << 4) | cl; // : (0x8000 | (U.of0[lit-257]<<7) | (U.exb[lit-257]<<4) | cl); const rest = (MAX_BITS - cl); @@ -96,13 +96,13 @@ export function codes2map(tree: number[], MAX_BITS: number, map: Uint16Array) { // tree[i]=r15[i0]>>>(15-MAX_BITS); while(i0 !== i1) { const p0 = r15[i0] >>> (15 - MAX_BITS); - map[p0] = val; i0++; + map[p0] = val; i0++; } } } } -export function makeCodes(tree: number[], MAX_BITS: number) { // code, length +export function makeCodes(tree: number[], MAX_BITS: number) { // code, length const max_code = tree.length; const bl_count = U.bl_count; diff --git a/src/mol-util/zip/zip.ts b/src/mol-util/zip/zip.ts index 2380ceb00d93d664adb2d37631635aabe73e6082..173cd9f90cbf97f1535236650dcf3d0b9aa97c2e 100644 --- a/src/mol-util/zip/zip.ts +++ b/src/mol-util/zip/zip.ts @@ -32,15 +32,15 @@ export async function unzip(runtime: RuntimeContext, buf: ArrayBuffer, onlyNames // const csize = readUint(data, o); o += 4; - const coffs = readUint(data, o); o += 4; + const coffs = readUint(data, o); o += 4; o = coffs; for(let i = 0; i < cnu; i++) { // const sign = readUint(data, o); o += 4; - o += 4; // versions; - o += 4; // flag + compr - o += 4; // time + o += 4; // versions; + o += 4; // flag + compr + o += 4; // time // const crc32 = readUint(data, o); o += 4; @@ -52,10 +52,10 @@ export async function unzip(runtime: RuntimeContext, buf: ArrayBuffer, onlyNames const nl = readUshort(data, o); const el = readUshort(data, o + 2); const cl = readUshort(data, o + 4); - o += 6; // name, extra, comment - o += 8; // disk, attribs + o += 6; // name, extra, comment + o += 8; // disk, attribs - const roff = readUint(data, o); o += 4; + const roff = readUint(data, o); o += 4; o += nl + el + cl; await _readLocal(runtime, data, roff, out, csize, usize, onlyNames); @@ -72,7 +72,7 @@ async function _readLocal(runtime: RuntimeContext, data: Uint8Array, o: number, // const gpflg = readUshort(data, o); o += 2; // if((gpflg&8)!=0) throw "unknown sizes"; - const cmpr = readUshort(data, o); + const cmpr = readUshort(data, o); o += 2; // const time = readUint(data, o); @@ -90,7 +90,7 @@ async function _readLocal(runtime: RuntimeContext, data: Uint8Array, o: number, o += 2; const name = readUTF8(data, o, nlen); - o += nlen; // console.log(name); + o += nlen; // console.log(name); o += elen; if(onlyNames) { @@ -178,7 +178,7 @@ export async function deflate(runtime: RuntimeContext, data: Uint8Array, opts?: if(opts === undefined) opts = { level: 6 }; let off = 0; const buf = new Uint8Array(50 + Math.floor(data.length * 1.1)); - buf[off] = 120; buf[off + 1] = 156; off += 2; + buf[off] = 120; buf[off + 1] = 156; off += 2; off = await _deflateRaw(runtime, data, buf, off, opts.level); const crcValue = adler(data, 0, data.length); buf[off + 0] = ((crcValue >>> 24) & 255); @@ -214,14 +214,14 @@ export async function zip(runtime: RuntimeContext, obj: { [k: string]: Uint8Arra } for(const p in zpd) tot += zpd[p].file.length + 30 + 46 + 2 * sizeUTF8(p); - tot += 22; + tot += 22; const data = new Uint8Array(tot); let o = 0; const fof = []; for(const p in zpd) { - const file = zpd[p]; fof.push(o); + const file = zpd[p]; fof.push(o); o = _writeHeader(data, o, p, file, 0); } let i = 0; @@ -233,12 +233,12 @@ export async function zip(runtime: RuntimeContext, obj: { [k: string]: Uint8Arra } const csize = o - ioff; - writeUint(data, o, 0x06054b50); o += 4; - o += 4; // disks - writeUshort(data, o, i); o += 2; - writeUshort(data, o, i); o += 2; // number of c d records - writeUint(data, o, csize); o += 4; - writeUint(data, o, ioff); o += 4; + writeUint(data, o, 0x06054b50); o += 4; + o += 4; // disks + writeUshort(data, o, i); o += 2; + writeUshort(data, o, i); o += 2; // number of c d records + writeUint(data, o, csize); o += 4; + writeUint(data, o, ioff); o += 4; o += 2; return data.buffer; } @@ -253,26 +253,26 @@ function _writeHeader(data: Uint8Array, o: number, p: string, obj: { cpr: boolea const file = obj.file; writeUint(data, o, t === 0 ? 0x04034b50 : 0x02014b50); o += 4; // sign - if(t === 1) o += 2; // ver made by - writeUshort(data, o, 20); o += 2; // ver - writeUshort(data, o, 0); o += 2; // gflip - writeUshort(data, o, obj.cpr ? 8 : 0); o += 2; // cmpr + if(t === 1) o += 2; // ver made by + writeUshort(data, o, 20); o += 2; // ver + writeUshort(data, o, 0); o += 2; // gflip + writeUshort(data, o, obj.cpr ? 8 : 0); o += 2; // cmpr - writeUint(data, o, 0); o += 4; // time - writeUint(data, o, obj.crc); o += 4; // crc32 - writeUint(data, o, file.length); o += 4; // csize - writeUint(data, o, obj.usize); o += 4; // usize + writeUint(data, o, 0); o += 4; // time + writeUint(data, o, obj.crc); o += 4; // crc32 + writeUint(data, o, file.length); o += 4; // csize + writeUint(data, o, obj.usize); o += 4; // usize - writeUshort(data, o, sizeUTF8(p)); o += 2; // nlen - writeUshort(data, o, 0); o += 2; // elen + writeUshort(data, o, sizeUTF8(p)); o += 2; // nlen + writeUshort(data, o, 0); o += 2; // elen if(t === 1) { - o += 2; // comment length - o += 2; // disk number - o += 6; // attributes - writeUint(data, o, roff); o += 4; // usize + o += 2; // comment length + o += 2; // disk number + o += 6; // attributes + writeUint(data, o, roff); o += 4; // usize } - const nlen = writeUTF8(data, o, p); o += nlen; + const nlen = writeUTF8(data, o, p); o += nlen; if(t === 0) { data.set(file, o); o += file.length; diff --git a/webpack.config.common.js b/webpack.config.common.js index c2032c79d6873b17463fd4f23799f1b7704aaedc..d403e707fbf7905510aba8ee0b38f277d86da2de 100644 --- a/webpack.config.common.js +++ b/webpack.config.common.js @@ -35,7 +35,7 @@ const sharedConfig = { 'process.env.DEBUG': JSON.stringify(process.env.DEBUG), '__MOLSTAR_DEBUG_TIMESTAMP__': webpack.DefinePlugin.runtimeValue(() => `${new Date().valueOf()}`, true) }), - new MiniCssExtractPlugin({ filename: 'molstar.css', }), + new MiniCssExtractPlugin({ filename: 'molstar.css' }), new VersionFile({ extras: { timestamp: `${new Date().valueOf()}` }, packageFile: path.resolve(__dirname, 'package.json'),