MolStart molecule viewer for transmembrane proteins http://molstar.org
![]() |
3 роки тому | |
---|---|---|
.github | 3 роки тому | |
cdn-examples | 3 роки тому | |
docs | 3 роки тому | |
src | 3 роки тому | |
.babelrc | 4 роки тому | |
CHANGELOG.md | 3 роки тому | |
LICENSE.md | 3 роки тому | |
README.md | 3 роки тому | |
package-lock.json | 3 роки тому | |
package.json | 3 роки тому | |
tsconfig.examples.json | 3 роки тому | |
tsconfig.json | 3 роки тому | |
webpack.config.js | 3 роки тому | |
webpack.examples.config.js | 3 роки тому |
RCSB Saguaro Web 3D is an open-source library built on the top of the RCSB Saguaro 1D Feature Viewer and RCSB Molstar designed to display protein features at the RCSB Web Site. The package collects protein annotations from the 1D Coordinate Server and the main RCSB Data API and generates Protein Feature Summaries. The package allows access to RCSB Saguaro and Molstar methods to add or change the displayed data. <!---
---><script src="https://cdn.jsdelivr.net/npm/@rcsb/rcsb-saguaro-3d@1.0.0/build/dist/app.js" type="text/javascript"></script>
npm install @rcsb/rcsb-saguaro-3d
npm install
npm run buildApp
npm run buildExamples
From the root of the project:
http-server -p PORT-NUMBER
and navigate to localhost:PORT-NUMBER/build/examples/
TypeScript full classes documentation can be found here.
Class RcsbFv3DAssembly
(src/RcsbFv3D/RcsbFv3DAssembly.tsx
) builds a predefined 1D/3D view for PDB entries. This method is used in the RCSB PDB web portal
to display 1D features on PDB entries (ex: 4hhb). Its configuration requires a single PDB ID.
In addition, additionalConfig
allows to configure the feature viewer as describe in rcsb-saguaro-app [API]("https://rcsb.github.io/rcsb-saguaro-app/interfaces/rcsbfvadditionalconfig.html").
This parameter exposes the board configuration through the attribute boardConfig
([ref]("https://rcsb.github.io/rcsb-saguaro/interfaces/rcsbfvboardconfiginterface.html")).
interface RcsbFv3DAssemblyInterface extends RcsbFv3DAbstractInterface {
config: {
entryId: string;
title?: string;
subtitle?: string;
};
additionalConfig?: RcsbFvAdditionalConfig;
}
Source code example can be found in src/examples/assembly/index.ts
.
Class RcsbFv3DCustom
file src/RcsbFv3D/RcsbFv3DCustom.tsx
builds a customized view between one or more feature viewers and a single Molstar plugin.
The configuration interface encodes the parameters needed for the feature viewers (sequencePanelConfig
) and the molstar plugin (structurePanelConfig
).
interface RcsbFv3DCustomInterface extends RcsbFv3DAbstractInterface {
structurePanelConfig: RcsbFvStructureInterface;
sequencePanelConfig: {
config: CustomViewInterface;
title?: string;
subtitle?: string;
};
}
Information in the sequence panels is organized in blocks where each block contains the parameter
(blockConfig
) to display one or more feature viewers. The optional parameter blockSelectorElement
defines a React component
that renders the html element used to change the displayed block. The class BlockSelectorManager
is used to select which block is
displayed. For example, blockSelectorManager.setActiveBlock("myBlock")
will display the feature viewers defined in the block
with blockId
"myBlock"
(see FeatureBlockInterface
). Additionally, blockChangeCallback
defines a function that will be executed
when the displayed block changes.
interface CustomViewInterface {
blockConfig: FeatureBlockInterface | Array<FeatureBlockInterface>;
blockSelectorElement?: (blockSelector: BlockSelectorManager) => JSX.Element;
blockChangeCallback?: (plugin: SaguaroPluginPublicInterface, pfvList: Array<RcsbFv>, selection: RcsbFvSelectorManager) => void;
}
Source code example can be found in src/examples/multiple-chain/index.ts
.
Each block must contain a unique block identifier (blockId
) and the configuration for all the feature viewers that will be rendered
when the block is activated (featureViewConfig
).
interface FeatureBlockInterface {
blockId:string;
featureViewConfig: Array<FeatureViewInterface> | FeatureViewInterface;
}
The interface fo each feature viewer defines its dynamic interaction with the molstar plugin through different event callbacks
sequenceSelectionChangeCallback
defines how the molstar plugin reacts when the feature viewer selection changessequenceElementClickCallback
defines how the molstar plugin reacts when a feature viewer element (positional annotation) is clickedsequenceHoverCallback
defines how the molstar plugin reacts when the mouse hovers the feature viewer or any elementstructureSelectionCallback
defines how the protein feature viewer reacts when the molstar plugin selection changesstructureHoverCallback
defines how the protein feature viewer reacts when displayed models on the molstar plugin are hoveredexport interface FeatureViewInterface {
boardId?:string;
boardConfig: RcsbFvBoardConfigInterface;
rowConfig: Array<RcsbFvRowConfigInterface>;
sequenceSelectionChangeCallback: (plugin: SaguaroPluginPublicInterface, selectorManager: RcsbFvSelectorManager, sequenceRegion: Array<RcsbFvTrackDataElementInterface>) => void;
sequenceElementClickCallback: (plugin: SaguaroPluginPublicInterface, selectorManager: RcsbFvSelectorManager, d: RcsbFvTrackDataElementInterface) => void;
sequenceHoverCallback: (plugin: SaguaroPluginPublicInterface, selectorManager: RcsbFvSelectorManager, hoverRegion: Array<RcsbFvTrackDataElementInterface>) => void;
structureSelectionCallback: (plugin: SaguaroPluginPublicInterface, pfv: RcsbFv, selectorManager: RcsbFvSelectorManager) => void;
structureHoverCallback: (plugin: SaguaroPluginPublicInterface, pfv: RcsbFv, selectorManager: RcsbFvSelectorManager) => void;
}
plugin: SaguaroPluginPublicInterface
exposes the interface to interact with the molstar plugin
and change model representations ([ref]("https://rcsb.github.io/rcsb-saguaro-3d/interfaces/saguaropluginpublicinterface.html")).
It provides multiple methods such as hide, display or select to modify how structural data is displayed. The parameter pfv: RcsbFv
allows to access the feature viewer API ([ref]("https://rcsb.github.io/rcsb-saguaro/classes/rcsbfv.html")). It exposes methods to modify
selections, change board configuration, zoom or adding new tracks.
Source code example can be found in src/examples/single-chain/index.tsx
All contributions are welcome. Please, make a pull request or open an issue.
The MIT License
Copyright (c) 2021 - now, RCSB PDB and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.