diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d991f9b830eeed6270d42d457f630172c2d72ed..0a33a8c1bb30296fec7944242733da51663d1e40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,11 @@ Note that since we don't clearly distinguish between a public and private interf ## [Unreleased] + +## [v3.5.0] - 2022-03-25 + - Fix issues with bounding-sphere & color-smoothing (mostly for small geometries) +- Support BCIF => CIF conversion in ``cif2bcif`` CLI tool ## [v3.4.0] - 2022-03-13 diff --git a/README.md b/README.md index 8a5f27cc8aee0fba874e09e5b0262b183b375df8..10e926c509f71742f239fe3ccf7e064b7130e470 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ and navigate to `build/viewer` export NODE_PATH="lib"; node build/state-docs -**Convert any CIF to BinaryCIF** +**Convert any CIF to BinaryCIF (or vice versa)** node lib/commonjs/servers/model/preprocess -i file.cif -ob file.bcif @@ -151,6 +151,11 @@ Or node lib/commonjs/cli/cif2bcif +E.g. + + node lib/commonjs/cli/cif2bcif src.cif out.bcif.gz + node lib/commonjs/cli/cif2bcif src.bcif.gz out.cif + ## Development ### Installation diff --git a/src/cli/cif2bcif/converter.ts b/src/cli/cif2bcif/converter.ts index bb931ea6de0d3c8956ba6dce1eeee495a8d861d2..e740bb4aa27e3b67e3becf716c14bf41dd6d3ba0 100644 --- a/src/cli/cif2bcif/converter.ts +++ b/src/cli/cif2bcif/converter.ts @@ -71,7 +71,7 @@ function classify(name: string, field: CifField): CifWriter.Field { } export function convert(path: string, asText = false, hints?: EncodingStrategyHint[], filter?: string) { - return Task.create<Uint8Array>('BinaryCIF', async ctx => { + return Task.create<Uint8Array>('Convert CIF', async ctx => { const encodingProvider: BinaryEncodingProvider = hints ? CifWriter.createEncodingProviderFromJsonConfig(hints) : { get: (c, f) => void 0 }; diff --git a/src/cli/cif2bcif/index.ts b/src/cli/cif2bcif/index.ts index 5dcd39af50cfa70dd78abb516e8e1c9c86e7ccc1..0c35072606346374820145c138e4271939121d06 100644 --- a/src/cli/cif2bcif/index.ts +++ b/src/cli/cif2bcif/index.ts @@ -18,7 +18,7 @@ async function process(srcPath: string, outPath: string, configPath?: string, fi const config = configPath ? JSON.parse(fs.readFileSync(configPath, 'utf8')) : void 0; const filter = filterPath ? fs.readFileSync(filterPath, 'utf8') : void 0; - const res = await convert(srcPath, false, config, filter); + const res = await convert(srcPath, srcPath.toLowerCase().indexOf('.bcif') > 0, config, filter); await write(outPath, res); } @@ -38,13 +38,13 @@ function run(args: Args) { const parser = new argparse.ArgumentParser({ add_help: true, - description: 'Convert any CIF file to a BCIF file' + description: 'Convert any BCIF file to a CIF file or vice versa' }); parser.add_argument('src', { - help: 'Source CIF path' + help: 'Source file path' }); parser.add_argument('out', { - help: 'Output BCIF path' + help: 'Output file path' }); parser.add_argument('-c', '--config', { help: 'Optional encoding strategy/precision config path',