mirror of
https://github.com/molstar/molstar.git
synced 2026-06-04 13:30:24 +08:00
Merge pull request #1798 from papillot/remove-promisify
remove utils.promisify dependency
This commit is contained in:
@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file, following t
|
|||||||
Note that since we don't clearly distinguish between a public and private interfaces there will be changes in non-major versions that are potentially breaking. If we make breaking changes to less used interfaces we will highlight it in here.
|
Note that since we don't clearly distinguish between a public and private interfaces there will be changes in non-major versions that are potentially breaking. If we make breaking changes to less used interfaces we will highlight it in here.
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
- Dependencies: remove `utils.promisify` (#1797)
|
||||||
- Fix circular dependency which causes crash in bundlers (#1791)
|
- Fix circular dependency which causes crash in bundlers (#1791)
|
||||||
- Add `putty` as a mol-view-spec representation.
|
- Add `putty` as a mol-view-spec representation.
|
||||||
- Fix detecting sidechain-only structures as coarse-grained (#1420)
|
- Fix detecting sidechain-only structures as coarse-grained (#1420)
|
||||||
|
|||||||
1280
package-lock.json
generated
1280
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -179,8 +179,7 @@
|
|||||||
"remark-gfm": "^4.0.1",
|
"remark-gfm": "^4.0.1",
|
||||||
"rxjs": "^7.8.2",
|
"rxjs": "^7.8.2",
|
||||||
"swagger-ui-dist": "^5.32.0",
|
"swagger-ui-dist": "^5.32.0",
|
||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1"
|
||||||
"util.promisify": "^1.1.3"
|
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@google-cloud/storage": "^7.14.0",
|
"@google-cloud/storage": "^7.14.0",
|
||||||
|
|||||||
@@ -1,17 +1,16 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2020-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
* Copyright (c) 2020-2026 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
||||||
*
|
*
|
||||||
* @author Josh McMenemy <josh.mcmenemy@gmail.com>
|
* @author Josh McMenemy <josh.mcmenemy@gmail.com>
|
||||||
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
||||||
|
* @author Paul Pillot <paul.pillot@tandemai.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as argparse from 'argparse';
|
import * as argparse from 'argparse';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import util from 'util';
|
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
require('util.promisify').shim();
|
const writeFileAsync = fs.promises.writeFile;
|
||||||
const writeFile = util.promisify(fs.writeFile);
|
|
||||||
|
|
||||||
import { DatabaseCollection } from '../../mol-data/db';
|
import { DatabaseCollection } from '../../mol-data/db';
|
||||||
import { CCD_Schema } from '../../mol-io/reader/cif/schema/ccd';
|
import { CCD_Schema } from '../../mol-io/reader/cif/schema/ccd';
|
||||||
@@ -32,7 +31,7 @@ function extractIonNames(ccd: DatabaseCollection<CCD_Schema>) {
|
|||||||
|
|
||||||
function writeIonNamesFile(filePath: string, ionNames: string[]) {
|
function writeIonNamesFile(filePath: string, ionNames: string[]) {
|
||||||
const output = `/**
|
const output = `/**
|
||||||
* Copyright (c) 2020-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
* Copyright (c) 2020-2026 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
||||||
*
|
*
|
||||||
* Code-generated ion names params file. Names extracted from CCD components.
|
* Code-generated ion names params file. Names extracted from CCD components.
|
||||||
*
|
*
|
||||||
@@ -41,7 +40,7 @@ function writeIonNamesFile(filePath: string, ionNames: string[]) {
|
|||||||
|
|
||||||
export const IonNames = new Set(${JSON.stringify(ionNames).replace(/"/g, "'").replace(/,/g, ', ')});
|
export const IonNames = new Set(${JSON.stringify(ionNames).replace(/"/g, "'").replace(/,/g, ', ')});
|
||||||
`;
|
`;
|
||||||
writeFile(filePath, output);
|
writeFileAsync(filePath, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function run(out: string, options = DefaultDataOptions) {
|
async function run(out: string, options = DefaultDataOptions) {
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
* Copyright (c) 2022-2026 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
||||||
*
|
*
|
||||||
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
||||||
|
* @author Paul Pillot <paul.pillot@tandemai.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as argparse from 'argparse';
|
import * as argparse from 'argparse';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import util from 'util';
|
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
require('util.promisify').shim();
|
const writeFileAsync = fs.promises.writeFile;
|
||||||
const writeFile = util.promisify(fs.writeFile);
|
|
||||||
|
|
||||||
import { DatabaseCollection } from '../../mol-data/db';
|
import { DatabaseCollection } from '../../mol-data/db';
|
||||||
import { CCD_Schema } from '../../mol-io/reader/cif/schema/ccd';
|
import { CCD_Schema } from '../../mol-io/reader/cif/schema/ccd';
|
||||||
@@ -44,7 +43,7 @@ function writeSaccharideNamesFile(filePath: string, ionNames: string[]) {
|
|||||||
|
|
||||||
export const SaccharideNames = new Set(${JSON.stringify(ionNames).replace(/"/g, "'").replace(/,/g, ', ')});
|
export const SaccharideNames = new Set(${JSON.stringify(ionNames).replace(/"/g, "'").replace(/,/g, ', ')});
|
||||||
`;
|
`;
|
||||||
writeFile(filePath, output);
|
writeFileAsync(filePath, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function run(out: string, options = DefaultDataOptions) {
|
async function run(out: string, options = DefaultDataOptions) {
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2018-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
* Copyright (c) 2018-2026 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
||||||
*
|
*
|
||||||
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
||||||
|
* @author Paul Pillot <paul.pillot@tandemai.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as argparse from 'argparse';
|
import * as argparse from 'argparse';
|
||||||
import * as util from 'util';
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
require('util.promisify').shim();
|
const writeFileAsync = fs.promises.writeFile;
|
||||||
const writeFile = util.promisify(fs.writeFile);
|
|
||||||
|
|
||||||
import { Database, Table, DatabaseCollection } from '../../mol-data/db';
|
import { Database, Table, DatabaseCollection } from '../../mol-data/db';
|
||||||
import { CCD_Schema } from '../../mol-io/reader/cif/schema/ccd';
|
import { CCD_Schema } from '../../mol-io/reader/cif/schema/ccd';
|
||||||
@@ -250,14 +249,14 @@ async function run(out: string, binary = false, options = DefaultDataOptions, cc
|
|||||||
if (!fs.existsSync(path.dirname(out))) {
|
if (!fs.existsSync(path.dirname(out))) {
|
||||||
fs.mkdirSync(path.dirname(out));
|
fs.mkdirSync(path.dirname(out));
|
||||||
}
|
}
|
||||||
writeFile(out, ccbCif);
|
writeFileAsync(out, ccbCif);
|
||||||
|
|
||||||
if (!!ccaOut) {
|
if (!!ccaOut) {
|
||||||
const ccaCif = getEncodedCif(CCA_TABLE_NAME, atoms, binary);
|
const ccaCif = getEncodedCif(CCA_TABLE_NAME, atoms, binary);
|
||||||
if (!fs.existsSync(path.dirname(ccaOut))) {
|
if (!fs.existsSync(path.dirname(ccaOut))) {
|
||||||
fs.mkdirSync(path.dirname(ccaOut));
|
fs.mkdirSync(path.dirname(ccaOut));
|
||||||
}
|
}
|
||||||
writeFile(ccaOut, ccaCif);
|
writeFileAsync(ccaOut, ccaCif);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,16 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2018-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
* Copyright (c) 2018-2026 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
||||||
*
|
*
|
||||||
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
||||||
|
* @author Paul Pillot <paul.pillot@tandemai.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as util from 'util';
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as zlib from 'zlib';
|
import * as zlib from 'zlib';
|
||||||
import fetch from 'node-fetch';
|
import fetch from 'node-fetch';
|
||||||
require('util.promisify').shim();
|
const readFileAsync = fs.promises.readFile;
|
||||||
const readFile = util.promisify(fs.readFile);
|
const writeFileAsync = fs.promises.writeFile;
|
||||||
const writeFile = util.promisify(fs.writeFile);
|
|
||||||
|
|
||||||
import { Progress } from '../../mol-task';
|
import { Progress } from '../../mol-task';
|
||||||
import { Database } from '../../mol-data/db';
|
import { Database } from '../../mol-data/db';
|
||||||
@@ -27,9 +26,9 @@ export async function ensureAvailable(path: string, url: string, forceDownload =
|
|||||||
fs.mkdirSync(DATA_DIR);
|
fs.mkdirSync(DATA_DIR);
|
||||||
}
|
}
|
||||||
if (url.endsWith('.gz')) {
|
if (url.endsWith('.gz')) {
|
||||||
await writeFile(path, zlib.gunzipSync(await data.buffer()));
|
await writeFileAsync(path, zlib.gunzipSync(await data.buffer()));
|
||||||
} else {
|
} else {
|
||||||
await writeFile(path, await data.text());
|
await writeFileAsync(path, await data.text());
|
||||||
}
|
}
|
||||||
console.log(`done downloading ${url}`);
|
console.log(`done downloading ${url}`);
|
||||||
}
|
}
|
||||||
@@ -41,7 +40,7 @@ export async function ensureDataAvailable(options: DataOptions) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function readFileAsCollection<S extends Database.Schema>(path: string, schema: S) {
|
export async function readFileAsCollection<S extends Database.Schema>(path: string, schema: S) {
|
||||||
const parsed = await parseCif(await readFile(path, 'utf8'));
|
const parsed = await parseCif(await readFileAsync(path, 'utf8'));
|
||||||
return CIF.toDatabaseCollection(schema, parsed.result);
|
return CIF.toDatabaseCollection(schema, parsed.result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2017 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
* Copyright (c) 2017-2026 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
||||||
*
|
*
|
||||||
* @author David Sehnal <david.sehnal@gmail.com>
|
* @author David Sehnal <david.sehnal@gmail.com>
|
||||||
* @author Sebastian Bittrich <sebastian.bittrich@rcsb.org>
|
* @author Sebastian Bittrich <sebastian.bittrich@rcsb.org>
|
||||||
|
* @author Paul Pillot <paul.pillot@tandemai.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { CIF, CifCategory, getCifFieldType, CifField, CifFile } from '../../mol-io/reader/cif';
|
import { CIF, CifCategory, getCifFieldType, CifField, CifFile } from '../../mol-io/reader/cif';
|
||||||
@@ -22,7 +23,7 @@ function showProgress(p: Progress) {
|
|||||||
process.stdout.write(`\r${Progress.format(p)}`);
|
process.stdout.write(`\r${Progress.format(p)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const readFileAsync = util.promisify(fs.readFile);
|
const readFileAsync = fs.promises.readFile;
|
||||||
const unzipAsync = util.promisify<zlib.InputType, Buffer>(zlib.unzip);
|
const unzipAsync = util.promisify<zlib.InputType, Buffer>(zlib.unzip);
|
||||||
|
|
||||||
async function readFile(ctx: RuntimeContext, filename: string): Promise<ReaderResult<CifFile>> {
|
async function readFile(ctx: RuntimeContext, filename: string): Promise<ReaderResult<CifFile>> {
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import * as fs from 'fs';
|
|||||||
import * as zlib from 'zlib';
|
import * as zlib from 'zlib';
|
||||||
import { convert } from './converter';
|
import { convert } from './converter';
|
||||||
|
|
||||||
require('util.promisify').shim();
|
|
||||||
|
|
||||||
async function process(srcPath: string, outPath: string, configPath?: string, filterPath?: string) {
|
async function process(srcPath: string, outPath: string, configPath?: string, filterPath?: string) {
|
||||||
const config = configPath ? JSON.parse(fs.readFileSync(configPath, 'utf8')) : void 0;
|
const config = configPath ? JSON.parse(fs.readFileSync(configPath, 'utf8')) : void 0;
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
* Copyright (c) 2018-2026 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
||||||
*
|
*
|
||||||
* @author David Sehnal <david.sehnal@gmail.com>
|
* @author David Sehnal <david.sehnal@gmail.com>
|
||||||
|
* @author Paul Pillot <paul.pillot@tandemai.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as util from 'util';
|
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import fetch from 'node-fetch';
|
import fetch from 'node-fetch';
|
||||||
require('util.promisify').shim();
|
|
||||||
|
|
||||||
import { CIF } from '../../mol-io/reader/cif';
|
import { CIF } from '../../mol-io/reader/cif';
|
||||||
import { Progress } from '../../mol-task';
|
import { Progress } from '../../mol-task';
|
||||||
|
|
||||||
const readFileAsync = util.promisify(fs.readFile);
|
const readFileAsync = fs.promises.readFile;
|
||||||
|
|
||||||
async function readFile(path: string) {
|
async function readFile(path: string) {
|
||||||
if (path.match(/\.bcif$/)) {
|
if (path.match(/\.bcif$/)) {
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import * as argparse from 'argparse';
|
import * as argparse from 'argparse';
|
||||||
require('util.promisify').shim();
|
|
||||||
|
|
||||||
import { CifFrame } from '../../mol-io/reader/cif';
|
import { CifFrame } from '../../mol-io/reader/cif';
|
||||||
import { Model, Structure, StructureElement, Unit, StructureProperties, UnitRing, Trajectory } from '../../mol-model/structure';
|
import { Model, Structure, StructureElement, Unit, StructureProperties, UnitRing, Trajectory } from '../../mol-model/structure';
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2018-2025 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
* Copyright (c) 2018-2026 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
||||||
*
|
*
|
||||||
* @author David Sehnal <david.sehnal@gmail.com>
|
* @author David Sehnal <david.sehnal@gmail.com>
|
||||||
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
||||||
|
* @author Paul Pillot <paul.pillot@tandemai.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as argparse from 'argparse';
|
import * as argparse from 'argparse';
|
||||||
import * as util from 'util';
|
|
||||||
|
|
||||||
import { Volume } from '../../mol-model/volume';
|
import { Volume } from '../../mol-model/volume';
|
||||||
import { downloadCif } from './helpers';
|
import { downloadCif } from './helpers';
|
||||||
@@ -20,8 +20,7 @@ import { createVolumeIsosurfaceMesh } from '../../mol-repr/volume/isosurface';
|
|||||||
import { Theme } from '../../mol-theme/theme';
|
import { Theme } from '../../mol-theme/theme';
|
||||||
import { volumeFromDensityServerData, DscifFormat } from '../../mol-model-formats/volume/density-server';
|
import { volumeFromDensityServerData, DscifFormat } from '../../mol-model-formats/volume/density-server';
|
||||||
|
|
||||||
require('util.promisify').shim();
|
const writeFileAsync = fs.promises.writeFile;
|
||||||
const writeFileAsync = util.promisify(fs.writeFile);
|
|
||||||
|
|
||||||
async function getVolume(url: string): Promise<Volume> {
|
async function getVolume(url: string): Promise<Volume> {
|
||||||
const cif = await downloadCif(url, true);
|
const cif = await downloadCif(url, true);
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import * as util from 'util';
|
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import { CIF } from '../mol-io/reader/cif';
|
import { CIF } from '../mol-io/reader/cif';
|
||||||
|
|
||||||
@@ -10,8 +9,7 @@ import { OrderedSet } from '../mol-data/int';
|
|||||||
import { trajectoryFromMmCIF, MmcifFormat } from '../mol-model-formats/structure/mmcif';
|
import { trajectoryFromMmCIF, MmcifFormat } from '../mol-model-formats/structure/mmcif';
|
||||||
import { getBoundary } from '../mol-math/geometry/boundary';
|
import { getBoundary } from '../mol-math/geometry/boundary';
|
||||||
|
|
||||||
require('util.promisify').shim();
|
const readFileAsync = fs.promises.readFile;
|
||||||
const readFileAsync = util.promisify(fs.readFile);
|
|
||||||
|
|
||||||
async function readData(path: string) {
|
async function readData(path: string) {
|
||||||
if (path.match(/\.bcif$/)) {
|
if (path.match(/\.bcif$/)) {
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2017 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
* Copyright (c) 2017-2026 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
||||||
*
|
*
|
||||||
* @author David Sehnal <david.sehnal@gmail.com>
|
* @author David Sehnal <david.sehnal@gmail.com>
|
||||||
|
* @author Paul Pillot <paul.pillot@tandemai.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as B from 'benchmark';
|
import * as B from 'benchmark';
|
||||||
|
|
||||||
import * as util from 'util';
|
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import fetch from 'node-fetch';
|
import fetch from 'node-fetch';
|
||||||
import { CIF } from '../mol-io/reader/cif';
|
import { CIF } from '../mol-io/reader/cif';
|
||||||
@@ -20,9 +20,8 @@ import { trajectoryFromMmCIF, MmcifFormat } from '../mol-model-formats/structure
|
|||||||
// import { printUnits } from '../apps/structure-info/model';
|
// import { printUnits } from '../apps/structure-info/model';
|
||||||
// import { EquivalenceClasses } from '../mol-data/util';
|
// import { EquivalenceClasses } from '../mol-data/util';
|
||||||
|
|
||||||
require('util.promisify').shim();
|
const readFileAsync = fs.promises.readFile;
|
||||||
const readFileAsync = util.promisify(fs.readFile);
|
const writeFileAsync = fs.promises.writeFile;
|
||||||
const writeFileAsync = util.promisify(fs.writeFile);
|
|
||||||
|
|
||||||
async function readData(path: string) {
|
async function readData(path: string) {
|
||||||
if (path.match(/\.bcif$/)) {
|
if (path.match(/\.bcif$/)) {
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2019-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
* Copyright (c) 2019-2026 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
||||||
*
|
*
|
||||||
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
||||||
|
* @author Paul Pillot <paul.pillot@tandemai.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as util from 'util';
|
|
||||||
import { AttachModelProperty } from '../../property-provider';
|
import { AttachModelProperty } from '../../property-provider';
|
||||||
import { CIF } from '../../../../mol-io/reader/cif';
|
import { CIF } from '../../../../mol-io/reader/cif';
|
||||||
import { getParam } from '../../../common/util';
|
import { getParam } from '../../../common/util';
|
||||||
@@ -14,8 +14,7 @@ import { ComponentBond } from '../../../../mol-model-formats/structure/property/
|
|||||||
import { ComponentAtom } from '../../../../mol-model-formats/structure/property/atoms/chem_comp';
|
import { ComponentAtom } from '../../../../mol-model-formats/structure/property/atoms/chem_comp';
|
||||||
import { CCD_Database, CCD_Schema } from '../../../../mol-io/reader/cif/schema/ccd';
|
import { CCD_Database, CCD_Schema } from '../../../../mol-io/reader/cif/schema/ccd';
|
||||||
|
|
||||||
require('util.promisify').shim();
|
const readFileAsync = fs.promises.readFile;
|
||||||
const readFile = util.promisify(fs.readFile);
|
|
||||||
|
|
||||||
export const wwPDB_chemCompBond: AttachModelProperty = async ({ model, params }) => {
|
export const wwPDB_chemCompBond: AttachModelProperty = async ({ model, params }) => {
|
||||||
const table = await getChemCompBondTable(getBondTablePath(params));
|
const table = await getChemCompBondTable(getBondTablePath(params));
|
||||||
@@ -25,7 +24,7 @@ export const wwPDB_chemCompBond: AttachModelProperty = async ({ model, params })
|
|||||||
};
|
};
|
||||||
|
|
||||||
async function read(path: string) {
|
async function read(path: string) {
|
||||||
return path.endsWith('.bcif') ? new Uint8Array(await readFile(path)) : readFile(path, 'utf8');
|
return path.endsWith('.bcif') ? new Uint8Array(await readFileAsync(path)) : readFileAsync(path, 'utf8');
|
||||||
}
|
}
|
||||||
|
|
||||||
let chemCompBondTable: mmCIF_Database['chem_comp_bond'];
|
let chemCompBondTable: mmCIF_Database['chem_comp_bond'];
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import { trajectoryFromMmCIF } from '../../../mol-model-formats/structure/mmcif'
|
|||||||
import { fetchRetry } from '../utils/fetch-retry';
|
import { fetchRetry } from '../utils/fetch-retry';
|
||||||
import { Task } from '../../../mol-task';
|
import { Task } from '../../../mol-task';
|
||||||
|
|
||||||
require('util.promisify').shim();
|
|
||||||
|
|
||||||
export enum StructureSourceType {
|
export enum StructureSourceType {
|
||||||
File,
|
File,
|
||||||
@@ -65,7 +64,7 @@ export async function createStructureWrapperFromJobEntry(entry: JobEntry, proper
|
|||||||
export const StructureCache = new Cache<StructureWrapper>(s => s.key, s => s.approximateSize);
|
export const StructureCache = new Cache<StructureWrapper>(s => s.key, s => s.approximateSize);
|
||||||
const perf = new PerformanceMonitor();
|
const perf = new PerformanceMonitor();
|
||||||
|
|
||||||
const readFileAsync = util.promisify(fs.readFile);
|
const readFileAsync = fs.promises.readFile;
|
||||||
const unzipAsync = util.promisify<zlib.InputType, Buffer>(zlib.unzip);
|
const unzipAsync = util.promisify<zlib.InputType, Buffer>(zlib.unzip);
|
||||||
|
|
||||||
async function readFile(filename: string) {
|
async function readFile(filename: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user