A comprehensive macromolecular library
The goal of Mol* (/'mol-star/) is to provide a technology stack that will serve as a basis for the next-generation data delivery and analysis tools for macromolecular structure data. This is a collaboration between PDBe and RCSB PDB teams and the development will be open-source and available to anyone who wants to use it for developing visualization tools for macromolecular structure data available from PDB and other institutions.
This particular project is the implementation of this technology (still under development).
If you are looking for the "MOLeculAR structure annoTator", that package is now available on NPM as MolArt.
The core of Mol* currently consists of these modules (see under
src/):
mol-taskComputation abstraction with progress tracking and cancellation support.
mol-dataCollections (integer-based sets, interface to columns/tables, etc.)
mol-mathMath related (loosely) algorithms and data structures.
mol-ioParsing library. Each format is parsed into an interface that corresponds to the data stored by it. Support for common coordinate, experimental/map, and annotation data formats.
mol-modelData structures and algorithms (such as querying) for representing molecular data (including coordinate, experimental/map, and annotation data).
mol-model-formatsData format parsers for
mol-model.
mol-model-propsCommon "custom properties".
mol-scriptA scripting language for creating representations/scenes and querying (includes the MolQL query language).
mol-geoCreating (molecular) geometries.
mol-themeTheming for structure, volume and shape representations.
mol-reprMolecular representations for structures, volumes and shapes.
mol-glA wrapper around WebGL.
mol-canvas3dA low-level 3d view component. Uses
mol-geoto generate geometries.
mol-stateState representation tree with state saving and automatic updates.
mol-appComponents for building UIs.
mol-pluginAllow to define modular Mol* plugin instances utilizing
mol-stateand
mol-canvas3d.
mol-plugin-stateState transformations, builders, and managers.
mol-plugin-uiReact-based user interface for the Mol* plugin. Some components of the UI are usable outside the main plugin and can be integrated into 3rd party solutions.
mol-utilUseful things that do not fit elsewhere.
Moreover, the project contains the implementation of
servers, including
servers/modelA tool for accessing coordinate and annotation data of molecular structures.
servers/volumeA tool for accessing volumetric experimental data related to molecular structures.
servers/plugin-stateA basic server to store Mol* Plugin states.
The project also contains performance tests (
perf-tests),
examples, and basic proof of concept
cliapps (CIF to BinaryCIF converter and JSON domain annotation to CIF converter).
This project builds on experience from previous solutions: - LiteMol Suite - WebChemistry - NGL Viewer - MMTF - MolQL - PDB Component Library - And many others (list will be continuously expanded).
npm install npm run build
npm run watch
If working on just the viewer,
npm run watch-viewerwill provide shorter compile times.
DEBUG=molstar npm run watch
Debug/production mode in browsers can be turned on/off during runtime by calling
setMolStarDebugMode(true/false, true/false)from the dev console.
NODE_ENV=production npm run build
Run
If not installed previously:
npm install -g http-server
...or a similar solution.
From the root of the project:
http-server -p PORT-NUMBER
and navigate to
build/viewer
CIF schemas
node ./lib/commonjs/cli/cifschema -mip ../../../../mol-data -o src/mol-io/reader/cif/schema/mmcif.ts -p mmCIF node ./lib/commonjs/cli/cifschema -mip ../../../../mol-data -o src/mol-io/reader/cif/schema/ccd.ts -p CCD node ./lib/commonjs/cli/cifschema -mip ../../../../mol-data -o src/mol-io/reader/cif/schema/bird.ts -p BIRD node ./lib/commonjs/cli/cifschema -mip ../../../../mol-data -o src/mol-io/reader/cif/schema/cif-core.ts -p CifCore -aa
Lipid names
node lib/commonjs/cli/lipid-params -o src/mol-model/structure/model/types/lipids.ts
Ion names
node --max-old-space-size=4096 lib/commonjs/cli/chem-comp-dict/create-ions.js src/mol-model/structure/model/types/ions.ts
GraphQL schemas
node node_modules//@graphql-codegen/cli/bin -c src/extensions/rcsb/graphql/codegen.yml
Create chem comp bond table
node --max-old-space-size=4096 lib/commonjs/cli/chem-comp-dict/create-table.js build/data/ccb.bcif -b
Test model server
export NODE_PATH="lib"; node build/src/servers/model/test.js
State Transformer Docs
export NODE_PATH="lib"; node build/state-docs
Convert any CIF to BinaryCIF
node lib/servers/model/preprocess -i file.cif -ob file.bcif
To see all available commands, use
node lib/servers/model/preprocess -h.
Or
node lib/commonjs/cli/cif2bcif
If node complains about a missing acorn peer dependency, run the following commands
npm update acorn --depth 20 npm dedupe
To get syntax highlighting for shader and graphql files add the following to Visual Code's settings files and make sure relevant extensions are installed in the editor.
"files.associations": { "*.glsl.ts": "glsl", "*.frag.ts": "glsl", "*.vert.ts": "glsl", "*.gql.ts": "graphql" },
npm version prerelease # assumes the current version ends with '-dev.X' npm publish --tag next
npm version 0.X.0 # provide valid semver string npm publish
npm run test npm run build node ./scripts/deploy.js # currently updates the viewer on molstar.org/viewer
Just open an issue or make a pull request. All contributions are welcome.
Continually develop this prototype project. As individual modules become stable, make them into standalone libraries.
Funding sources include but are not limited to: * RCSB PDB funding by a grant [DBI-1338415; PI: SK Burley] from the NSF, the NIH, and the US DoE * PDBe, EMBL-EBI * CEITEC * EntosAI