Skip to content

Commit

Permalink
Enabled to show interactions using force-directed graph in the menu '…
Browse files Browse the repository at this point in the history
…View > H-Bonds & Interactions > Force-Directed Graph'. Enabled to calculate Solvent Accessible Surface Area (SASA) in the menu 'View > Surface Area', or color by SASA in the menu 'Color > Solvent Accessibility'. Fixed ClinVar and SNP annotations.
  • Loading branch information
jiywang3 committed May 21, 2020
1 parent 2604ad5 commit df5f8e6
Show file tree
Hide file tree
Showing 28 changed files with 3,371 additions and 493 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## Change Log
[icn3d-2.16.0](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.16.0.zip) was release on May 21, 2020. Enabled to show interactions using force-directed graph in the menu "View > H-Bonds & Interactions > Force-Directed Graph". Enabled to calculate Solvent Accessible Surface Area (SASA) in the menu "View > Surface Area", or color by SASA in the menu "Color > Solvent Accessibility". Fixed ClinVar and SNP annotations.

[icn3d-2.15.3](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.15.3.zip) was release on May 8, 2020. Enabled to update the short "Share Link" URL; enabled to save in a sharable URL the "Side by Side" view, which is useful to view two aligned structures.

[icn3d-2.15.2](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.15.2.zip) was release on May 5, 2020. Fixed the display of electron density map and EM map.
Expand Down
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## About iCn3D

"I see in 3D" (iCn3D) Structure Viewer is a WebGL-based 3D viewer using Three.js and jQuery. iCn3D synchronizes the display of 3D structure, 2D interaction, and 1D sequences and annotations. Users' custom display can be saved in a short URL or a PNG image. <b>Complete package</b> of iCn3D including Three.js and jQuery can be downloaded from [https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.15.3.zip](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.15.3.zip). The "Download ZIP" link in this page does not include third-party libraries.
"I see in 3D" (iCn3D) Structure Viewer is a WebGL-based 3D viewer using Three.js and jQuery. iCn3D synchronizes the display of 3D structure, 2D interaction, and 1D sequences and annotations. Users' custom display can be saved in a short URL or a PNG image. <b>Complete package</b> of iCn3D including Three.js and jQuery can be downloaded from [https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.16.0.zip](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.16.0.zip). The "Download ZIP" link in this page does not include third-party libraries.
* <b>View a 3D structure in iCn3D</b>:
Open the link https://www.ncbi.nlm.nih.gov/Structure/icn3d/full.html, input a PDB ID, and click "Load". You can also click "File" menu to "Open File" or input other IDs.

Expand All @@ -20,16 +20,16 @@
* <b>Save your work</b>:
You can save "iCn3D PNG Image" in the menu "File > Save Files". Both the PNG file and an HTML file are saved. Click the HTML file to see the PNG image, which is linked to the custom display via a shorten URL. The downloaded "iCn3D PNG Image" itself can also be used as an input in the menu "File > Open File" to reproduce the custom display. You can combine these HTML files to generate your own galleries.

* <b>[Show binding site](https://icn3d.page.link/JR5B)</b>:
* <b>[Show binding site](https://structure.ncbi.nlm.nih.gov/icn3d/share.html?JR5B)</b>:
You can click "Chem. Binding" in "View" menu to show all hydrogen bonds around chemicals. You can also click "H-Bonds & Interactions" in "View" menu to list or highlight each hydrogen bond or contact.

* <b>[Export models for 3D printing](https://www.ncbi.nlm.nih.gov/Structure/icn3d/full.html?mmdbid=1tup&command=export+stl+stabilizer+file)</b>:
You can click "3D Printing" in "File" menu to export models for 3D printing. Both STL and VRML files are supported.

* <b>[Show transmembrane proteins](https://icn3d.page.link/TuSd)</b>:
* <b>[Show transmembrane proteins](https://structure.ncbi.nlm.nih.gov/icn3d/share.html?TuSd)</b>:
If the protein is a transmembrane protein, you can click "File > Retrieve by ID > OPM PDB ID" to input a PDB ID to view the membranes.

* <b>Show [surface](https://icn3d.page.link/aYAjP4S3NbrBJX3x6), [EM map](https://icn3d.page.link/L4C4WYE85tYRiFeK7), or [electron density map](https://icn3d.page.link/QpqNZ3k65ToYFvUB6)</b>:
* <b>Show [surface](https://structure.ncbi.nlm.nih.gov/icn3d/share.html?aYAjP4S3NbrBJX3x6), [EM map](https://structure.ncbi.nlm.nih.gov/icn3d/share.html?L4C4WYE85tYRiFeK7), or [electron density map](https://structure.ncbi.nlm.nih.gov/icn3d/share.html?QpqNZ3k65ToYFvUB6)</b>:
You can click "Style > Surface Type", "Style > EM Density Map", or "Style > Electron Density".

* <b>View 1D sequences and 2D interactions</b>:
Expand All @@ -42,12 +42,19 @@

To select on 2D interaction diagram: click on the nodes or lines. The nodes are chains and can be united with the Ctrl key. The lines are interactions and can NOT be united. Each click on the lines selects half of the lines, i.e., select the interacting residues in one of the two chains.

* <b>[Align two structures](https://icn3d.page.link/wPoW56e8QnzVfuZw6), [align two chains](https://icn3d.page.link/ijnf), or [align a protein sequence to a structure](https://icn3d.page.link/Mmm82craCwGMAxru9)</b>:
You can click "File > Align" to see all three alignment options.
* <b>[Align two structures](https://structure.ncbi.nlm.nih.gov/icn3d/share.html?wPoW56e8QnzVfuZw6), [align two chains](https://structure.ncbi.nlm.nih.gov/icn3d/share.html?ijnf), or [align a protein sequence to a structure](https://structure.ncbi.nlm.nih.gov/icn3d/share.html?Mmm82craCwGMAxru9)</b>:
You can click "File > Align" to see all three alignment options. You can also [realign](https://structure.ncbi.nlm.nih.gov/icn3d/share.html?gXW2CKcEDdJzk6uL6) a subset of the structures.

* <b>[Add custom tracks](https://icn3d.page.link/pUzP)</b>:
* <b>[Add custom tracks](https://structure.ncbi.nlm.nih.gov/icn3d/share.html?pUzP)</b>:
You can add custom tracks in various formats (FASTA, bed file, etc.) in the annotation window by clicking the menu "Windows > View Sequences & Annotations".

* <b>[Force-directed graph](https://structure.ncbi.nlm.nih.gov/icn3d/share.html?6UiwgaoLAte8vpom8)</b>:
You can show the interactions using 2D force-directed graph in the menu "View > H-Bonds & Interactions > Force-Directed Graph".

* <b>[Solvent accessible surface area (SASA)](https://structure.ncbi.nlm.nih.gov/icn3d/share.html?Hn3SVz5iUHLLZaPU7)</b>:
You can color structures with SASA, or show the SASA for each residue.


## Embed iCn3D with iframe or JavaScript libraries

iCn3D can be embedded in a web page by including the URL in HTML iframe, e.g. <iframe src="https://www.ncbi.nlm.nih.gov/Structure/icn3d/full.html?mmdbid=1tup&width=300&height=300&showcommand=0&mobilemenu=1&showtitle=0" width="320" height="320" style="border:none"></iframe>. This method always shows the most recent version of iCn3D.
Expand Down
9 changes: 9 additions & 0 deletions css/icn3d_full_ui.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ button, select, input { font-size: 10px; }
.icn3d-node {cursor:pointer!important; }
.icn3d-interaction {cursor:pointer!important; }

/* force-directed graph node text */
.icn3d-node-text0 {font-size: 0px; font-weight: bold}
.icn3d-node-text4 {font-size: 4px; font-weight: bold}
.icn3d-node-text8 {font-size: 8px; font-weight: bold}
.icn3d-node-text12 {font-size: 12px; font-weight: bold}
.icn3d-node-text16 {font-size: 16px; font-weight: bold}
.icn3d-node-text24 {font-size: 24px; font-weight: bold}
.icn3d-node-text32 {font-size: 32px; font-weight: bold}

.ui-dialog .ui-resizable-se {
width: 14px;
height: 14px;
Expand Down
307 changes: 307 additions & 0 deletions full2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,307 @@
<!DOCTYPE html><html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="description" content="iCn3D Structure Viewer">
<meta name="ncbi_db" content="structure"><meta name="ncbi_app" content="iCn3D"><meta name="ncbi_pdid" content="advanced">
<meta name="keywords" content="NCBI, Structure, JavaScript, iCn3D, 3D, Viewer, WebGL, three.js, sequence, chemical">
<meta name="robots" content="index,follow,noarchive">
<title>iCn3D: Web-based 3D Structure Viewer</title>
</head>
<body>
<div id="div0" style="float:left; padding-right:5px;"></div>
<div id="div1" style="float:left;"></div>

<link rel="stylesheet" href="lib/jquery-ui-1.12.1.min.css">
<link rel="stylesheet" href="icn3d_full_ui.css">
<script src="lib/jquery-3.5.0.min.js"></script>
<script src="lib/jquery-ui-1.12.1.min.js"></script>
<script src="lib/three_0.103.0.min.js"></script>
<script src="icn3d_full_ui.min.js"></script>

<script type="text/javascript">
// separating the GET parameters from the current URL
// repalce "color #" with "color " in the url
var url = document.URL.replace(/\#/g, '');

var bNopara = false;
var ampPos = url.indexOf("?");
if(ampPos === -1) {
// alert("Please include '?pdbid=1GPK,2POR,...' in your url");
bNopara = true;
}

var getParams = url.split("?");
// transforming the GET parameters into a dictionnary
var search = getParams[getParams.length - 1];
var params = {};
var inpara = "";

if(!bNopara) {
//params = JSON.parse('{"' + decodeURIComponent(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}');

var decodeSearch = decodeURIComponent(search);

var hashes = decodeSearch.split('&');
for (var i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
params[hash[0].trim()] = (hash[1] !== undefined) ? hash[1].trim() : undefined;
}

// for mmdb structures, pass the parameters after the first "&" sign
inpara = "&" + url.substr(ampPos + 1);
}

var gi = params.gi;
var blast_rep_id = params.blast_rep_id;
var query_id = params.query_id;

var mmdbid = params.mmdbid;
var mmtfid = params.mmtfid;
var pdbid = params.pdbid;
var opmid = params.opmid;
var cid = params.cid;
var mmcifid = params.mmcifid;
var urlname = params.url;
var urltype = (params.type === undefined) ? 'pdb' : params.type;

var align = params.align;
var chainalign = params.chainalign;

var width = params.width;
var height = params.height;

var command = params.command; // ";" separated commands

var from = params.from;

function getValue(input) {
if(input == 'true' || input == '1') {
input = true;
}
else if(input == 'false' || input == '0') {
input = false;
}

return input;
}

var resize = getValue(params.resize);

var showmenu = getValue(params.showmenu);

var showtitle = getValue(params.showtitle);

var showcommand = getValue(params.showcommand);

var simplemenu = getValue(params.simplemenu);

var mobilemenu = getValue(params.mobilemenu);

var closepopup = getValue(params.closepopup);

var showanno = getValue(params.showanno);

var showseq = getValue(params.showseq);

// backward compatible with showseq
showanno = showanno || showseq;

// for alignment
var showalignseq = getValue(params.showalignseq);

var show2d = getValue(params.show2d);

var showsets = getValue(params.showsets);

var rotate = params.rotate;

var options = (params.options !== undefined) ? JSON.parse(params.options) : undefined;

$( document ).ready(function() {
// use the FIXED name "icn3duiHash", which is used in iCn3DUI
window.icn3duiHash = {};

function setupViewer(idName, idValue) {
var maxStructure = 5; // show max 5 structures

var idArray = idValue.replace(/\s/g, '').split(',');

if(idArray.length > 1) {
resize = false;

if(width.indexOf('%') != -1) {
width = 400;
height = 400;
}
}

if(options === undefined || options === 'undefined') options = {};

//Options are available at: https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#DisplayOptions
//options['chemicalbinding'] = 'show';

//for(var i = 0, il = idArray.length; i < il && i < maxStructure; ++i) {
var i = 0;
var cfg = {
divid: 'div' + i,
inpara: inpara,
width: '49%', //width,
height: height,
resize: resize,
rotate: rotate,
showmenu: showmenu,
showtitle: showtitle,
showcommand: showcommand,
showanno: showanno,
show2d: show2d,
showsets: showsets,
simplemenu: simplemenu,
mobilemenu: true, //mobilemenu,
closepopup: true, //closepopup,
blast_rep_id: blast_rep_id,
query_id: query_id,
options: options,
controlGl: true,
command: command,
bSidebyside: true
};
if(idName !== '') cfg[idName] = idArray[i];

var icn3dui = new iCn3DUI(cfg);
icn3dui.show3DStructure();
window.icn3duiHash['div0'] = icn3dui;
if(idName === '') $("#div" + i + "_wait").hide();


i = 1;
var cfg2 = cfg;
cfg2.divid = 'div' + i;
var icn3dui2 = new iCn3DUI(cfg2);
icn3dui2.show3DStructure();
window.icn3duiHash['div1'] = icn3dui2;
if(idName === '') $("#div" + i + "_wait").hide();
//}
}

if(mmtfid !== undefined) {
setupViewer('mmtfid', mmtfid);
}
else if(pdbid !== undefined) {
setupViewer('pdbid', pdbid);
}
else if(opmid !== undefined) {
setupViewer('opmid', opmid);
}
else if(cid !== undefined) {
setupViewer('cid', cid);
}
else if(mmcifid !== undefined) {
setupViewer('mmcifid', mmcifid);
}
else if(mmdbid !== undefined) {
setupViewer('mmdbid', mmdbid);
}
else if(gi !== undefined) {
setupViewer('gi', gi);
}
else if(blast_rep_id !== undefined) {
if( (from === 'blast' || from === 'icn3d') && command == '') {
command = 'view+annotations;+set+annotation+cdd;+set+annotation+site;+set+view+detailed+view;+select+chain+'
+ blast_rep_id + ';+show+selection';
}

setupViewer('blast_rep_id', blast_rep_id);
}
else if(urlname !== undefined) {
urlname = decodeURIComponent(urlname);
setupViewer('url', urltype + '|' + urlname);
}
// e.g., align=103701,1,4,68563,1,167 [mmdbid1,biounit,molecule,mmdbid2,biounit,molecule]
else if(align !== undefined) {
var cfg = {
divid: 'div0',
inpara: inpara,
width: '49%', //width,
height: height,
resize: resize,
rotate: rotate,
showmenu: showmenu,
showtitle: showtitle,
showcommand: showcommand,
showanno: showanno,
showalignseq: showalignseq,
show2d: show2d,
showsets: showsets,
simplemenu: simplemenu,
mobilemenu: true, //mobilemenu,
closepopup: true, //closepopup,
align: align,
controlGl: true,
command: command,
bSidebyside: true
};

var icn3dui = new iCn3DUI(cfg);
icn3dui.show3DStructure();
window.icn3duiHash['div0'] = icn3dui;

var cfg2 = cfg;
cfg2.divid = 'div1';
var icn3dui2 = new iCn3DUI(cfg2);
icn3dui2.show3DStructure();
window.icn3duiHash['div1'] = icn3dui2;
}
else if(chainalign !== undefined) {
var cfg = {
divid: 'div0',
inpara: inpara,
width: '49%', //width,
height: height,
resize: resize,
rotate: rotate,
showmenu: showmenu,
showtitle: showtitle,
showcommand: showcommand,
showanno: showanno,
showalignseq: showalignseq,
show2d: show2d,
showsets: showsets,
simplemenu: simplemenu,
mobilemenu: true, //mobilemenu,
closepopup: true, //closepopup,
chainalign: chainalign,
controlGl: true,
command: command,
bSidebyside: true
};

var icn3dui = new iCn3DUI(cfg);
icn3dui.show3DStructure();
window.icn3duiHash['div0'] = icn3dui;

var cfg2 = cfg;
cfg2.divid = 'div1';
var icn3dui2 = new iCn3DUI(cfg2);
icn3dui2.show3DStructure();
window.icn3duiHash['div1'] = icn3dui2;
}
else {
setupViewer('', '');
}

}); // document ready

</script>

<!-- Google Analytics -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-68648221-3']);
_gaq.push(['_setDomainName', '.ncbi.nlm.nih.gov']);
_gaq.push(['_trackPageview']);
setTimeout("_gaq.push(['_trackEvent', '10_seconds', 'read'])",10000);
(function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();
</script>
</body></html>

2 changes: 2 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ var full_uijs = [
//"src/icn3dui/parsers/density_cif_parser.js",
"src/icn3dui/annotations/annotations.js",
"src/icn3dui/annotations/addtrack.js",
"src/icn3dui/d3/d3v4-brush-lite.js",
"src/icn3dui/d3/graph.js",
"src/icn3dui/selection/selection.js",
"src/icn3dui/selection/advanced.js",
"src/icn3dui/selection/sets.js",
Expand Down
Loading

0 comments on commit df5f8e6

Please sign in to comment.