Web-component implementation of LiteMol 3D structure viewer. LiteMol is a streamlined structure viewer which enables a PDB structure to be explored within a browser rather than requiring pre-installed molecular graphics software. It is a PDB Component dev
npm install pdb-lite-mol
This is an AngularJs Web-Component for LiteMol 3D structure viewer. LiteMol is a streamlined structure viewer which enables a PDB structure to be explored within a browser rather than requiring pre-installed molecular graphics software. There is also the option to view electron density of the structure where structure factors have been deposited to the PDB. Litemol also displays validation and domain information for the structure.
It is a PDB Component Library component.
If you are interested in using core LiteMol library or if you want to customize / extend the functionality, you can refer to LiteMol repository for more information.
* Include module files and required dependencies
* Install the component
* Use component as custom element anywhere in the page
>If you have installed the PDB Component Library in your application then you can directly start using the component as custom element (refer step 3).
#### 1. Include module files and dependencies
Download the module javascript file (pdb.litemol.min.js and pdb.litemol.min.css) stored in the 'build' folder. Include the files in your page <head> section.
You'll also need to include the AngularJS library file (please refer 'bower.json' file for complete dependency details).
``html
`
#### 2. Installation
As soon as you've got the dependencies and library files included in your application page you just need to include following installation script :
I) If you are developing an AngularJs Application
`html`
II) For other Applications
`html`
#### 3. Using component as custom element anywhere in the page
The component can be used as custom element, attribute or class anywhere in the page.
`html
``
| Sr. No. | Function | Description |
|:-------------:|:-------------|:-----|
| 1 | hideControls()| Use : hide control panel.
Parameter : none |
| 2 | showControls()| Use : show control panel.
Parameter : none |
| 3 | expand()| Use : switch to full-screen mode.
Parameter : none |
| 4 | setBackground()| Use : set background colour to white.
Parameter : none |
| 5 | loadDensity(isWireframe)| Use : programatically load density.
Parameter : 1. isWireframe (type : boolean) (value : true / false)
if set to..
true : shows density as wire-frame.
false: shows density as surface. |
| 6 | toggleDensity()| Use : programatically toggle density.
Parameter : none |
| 7 | colorChains( chainId, colorArr )| Use : set chain colour and greys out remaining residues colour.
Parameter :
1. chainId (type : string)
2. colorArr (type : array) (value : RGB value - example : [255,0,0] for red) |
| 8 | SelectExtractFocus(selectionDetails, colorCode, showSideChains)| Use : Colour and focus desired range of residues in the structure.
Parameter :
1. selectionDetails (type : object)
Example :
{
entity_id : '1',
struct_asym_id : 'A',
start_residue_number : 10,
end_residue_number : 15
}
2. colorCode (type : object) (value : RGB value - example : {r:255, g:0, b:0} for red)
3. showSideChains (type : boolean) (value : true / false) (optional)
if set to..
true : shows sidechain residues for the selected range. |
| 9 | highlightOn(selectionDetails)| Use : highlight desired range of residues in the structure.
Similar to SelectExtractFocus() except it do not allow colour setting and focus.
Parameter :
1. selectionDetails (type : object)
Example :
{
entity_id : '1',
struct_asym_id : 'A',
start_residue_number : 10,
end_residue_number : 15
} |
| 10 | highlightOff()| Use :Removes highlight set using highlightOn()
Parameter : none |
| 11 | resetThemeSelHighlight()| Use : Reset any selection and highlight to default.
Parameter : none |
| Sr. No. | Event | Description |
|:-------------:|:-------------|:-----|
| 1 | PDB.litemol.click | Use this to bind to the click event of this component elements. Event data (available in key = 'eventData') contains information structure residue clicked
Example:
document.addEventListener('PDB.litemol.click', function(e){ /\/do something on event }) |
| 2 | PDB.litemol.mouseover | Use this to bind to the mouseover event of this component elements.
Example:
document.addEventListener('PDB.seqViewer.mouseover', function(e){ /\/do something on event }) |
| 3 | PDB.litemol.mouseout | Use this to bind to the mouseout event of this component elements.
Example:
document.addEventListener('PDB.seqViewer.mouseout', function(e){ /\/do something on event }) |
Please refer this link for more documentation, demo and parameters details.