Skip to content

Commit

Permalink
Merge pull request #225 in STRUC/icn3d from release2131 to master
Browse files Browse the repository at this point in the history
* commit '0f41f196de69850ec4b20b469c7f205e970b459a':
  Showed membranes for transmembrane proteins in VAST+ alignment
  • Loading branch information
jiywang3 committed Mar 26, 2020
2 parents 421923c + 0f41f19 commit b55f65e
Show file tree
Hide file tree
Showing 11 changed files with 447 additions and 182 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Change Log
[icn3d-2.13.0](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.13.0.zip) was release on March 23, 2020. Added protein symmetry view.
[icn3d-2.13.1](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.13.1.zip) was release on March 26, 2020. Showed membranes for transmembrane proteins in VAST+ alignment.

[icn3d-2.13.0](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.13.0.zip) was release on March 23, 2020. Added the "Symmetry" feature in the View menu.

[icn3d-2.12.1](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.12.1.zip) was release on March 12, 2020. Fixed a bug on hydrogen bonds between residues with the same residue number but different chain names. Removed duplicated names in the menu of "Defined Sets".

Expand Down
2 changes: 1 addition & 1 deletion 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.13.0.zip](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.13.0.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.13.1.zip](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.13.1.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 Down
11 changes: 10 additions & 1 deletion icn3d.html
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,12 @@ <h2>iCn3D gallery with live examples<span style="font-size:0.7em"> ("iCn3D PNG I
</a>
</div>

<div class="gallery">
<a href="https://icn3d.page.link/bGH1BfLsiGFhhTDn8" target="_blank">
<img style="height:300px" src ="https://www.ncbi.nlm.nih.gov/Structure/icn3d/gallery/1KQ2-bGH1BfLsiGFhhTDn8.png"><br>Protein Symmetry Display (PDB 1KQ2)
</a>
</div>

<div class="gallery">
<a href="https://icn3d.page.link/1yydeU3ktdkPyptAA" target="_blank">
<img style="height:300px" src ="https://www.ncbi.nlm.nih.gov/Structure/icn3d/gallery/1TUP-1yydeU3ktdkPyptAA.png"><br>3D Printing (PDB 1TUP)
Expand Down Expand Up @@ -2096,7 +2102,10 @@ <h3>Methods <a href="#Top"><span class="top">&nbsp;&nbsp;&nbsp;</span></a></h3>

<a name="log"></a>
<h2>Change Log:<img src="https://www.ncbi.nlm.nih.gov/Structure/IMG/spacer.gif" width="25" height="1" border="0"><a href="#Top"><img src="https://www.ncbi.nlm.nih.gov/Structure/IMG/arrowup_blue.gif" width="12" height="12" border="0" alt="back to top"></a></h2>
<a href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.13.0.zip">icn3d-2.13.0</a> was release on March 23, 2020. Added protein symmetry view.
<a href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.13.1.zip">icn3d-2.13.1</a> was release on March 26, 2020. Showed membranes for transmembrane proteins in VAST+ alignment.
<br><br>

<a href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.13.0.zip">icn3d-2.13.0</a> was release on March 23, 2020. Added the "Symmetry" feature in the View menu.
<br><br>

<a href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.12.1.zip">icn3d-2.12.1</a> was release on March 12, 2020. Fixed a bug on hydrogen bonds between residues with the same residue number but different chain names. Removed duplicated names in the menu of "Defined Sets".
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "icn3d",
"version": "2.13.0",
"version": "2.13.1",
"description": "iCn3D Structure Viewer",
"main": "index.html",
"scripts": {
Expand Down
23 changes: 16 additions & 7 deletions src/icn3d/draw/drawing_full.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,17 +432,26 @@ iCn3D.prototype.applySymmetry = function (title) { var me = this; //"use strict"
var colorAxis = dataArray[i][2];
var colorPolygon = dataArray[i][3];
var order = dataArray[i][4];
var chain = dataArray[i][5];

me.createCylinder(start, end, axisRadius, colorAxis, 0);

if(symmetryType == 'C' || (symmetryType == 'D' && order == nSide) ) {
// find the center and size of the first protein chain
var selectedChain = Object.keys(this.chains)[0];
for(var chainid in this.chains) {
var firstSerial = Object.keys(this.chains[chainid])[0];
if(this.proteins.hasOwnProperty(firstSerial)) {
selectedChain = chainid;
break;
// find the center and size of the selected protein chain
var selectedChain = Object.keys(this.structures)[0] + '_' + chain;

if(!this.chains.hasOwnProperty(selectedChain)) {
selectedChain = Object.keys(this.structures)[0] + '_' + chain.toLowerCase();
}

if(!this.chains.hasOwnProperty(selectedChain)) {
selectedChain = Object.keys(this.chains)[0];
for(var chainid in this.chains) {
var firstSerial = Object.keys(this.chains[chainid])[0];
if(this.proteins.hasOwnProperty(firstSerial)) {
selectedChain = chainid;
break;
}
}
}

Expand Down
19 changes: 16 additions & 3 deletions src/icn3dui/full_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if (!$.ui.dialog.prototype._makeDraggableBase) {
}

var iCn3DUI = function(cfg) { var me = this; //"use strict";
this.REVISION = '2.13.0';
this.REVISION = '2.13.1';

me.bFullUi = true;

Expand Down Expand Up @@ -956,14 +956,27 @@ iCn3DUI.prototype = {

renderStructure: function () { var me = this; //"use strict";
if(me.bInitial) {
jQuery.extend(me.icn3d.opts, me.opts);

if(me.icn3d.bOpm && me.cfg.align !== undefined) { // show membrane
var resid = me.selectedPdbid + '_MEM_1';
for(var i in me.icn3d.residues[resid]) {
var atom = me.icn3d.atoms[i];
atom.style = 'stick';
atom.color = me.icn3d.atomColors[atom.name];
me.icn3d.atomPrevColors[i] = atom.color;

me.icn3d.dAtoms[i] = 1;
}
}

if(me.cfg.command !== undefined && me.cfg.command !== '') {
me.icn3d.bRender = false;

jQuery.extend(me.icn3d.opts, me.opts);
me.icn3d.draw();
}
else {
jQuery.extend(me.icn3d.opts, me.opts);

me.icn3d.draw();
}

Expand Down
16 changes: 8 additions & 8 deletions src/icn3dui/parsers/mmcif_mmdb_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ iCn3DUI.prototype.loadMmcifData = function(data, mmcifid) { var me = this; //"us

//me.loadAtomDataIn(data, data.mmcif, 'mmcifid');
me.deferredOpm = $.Deferred(function() {
me.loadMmcifOpmData(data, mmcifid);
//me.loadMmcifOpmData(data, mmcifid);
me.loadOpmData(data, mmcifid, undefined, 'mmcif');
});

return me.deferredOpm.promise();
Expand Down Expand Up @@ -331,13 +332,13 @@ iCn3DUI.prototype.parseMmdbDataPart1 = function (data, type) { var me = this; //

iCn3DUI.prototype.parseMmdbData = function (data, type) { var me = this; //"use strict";
if(type === undefined) {
me.deferredOpm = $.Deferred(function() {
//me.deferredOpm = $.Deferred(function() {
var id = (data.pdbId !== undefined) ? data.pdbId : data.mmdbId;

me.loadMmdbOpmData(data, id, type);
});
//});

return me.deferredOpm.promise();
//return me.deferredOpm.promise();
}
else {
me.parseMmdbDataPart1(data, type);
Expand Down Expand Up @@ -597,7 +598,7 @@ iCn3DUI.prototype.getMissingResidues = function (seqArray, type, chainid) { var

//type: "mmdbid", "mmcifid", "align"
//alignType: "query", "target" for chain to chain 3D alignment
iCn3DUI.prototype.loadAtomDataIn = function (data, id, type, seqalign, alignType, chainCalphaHash2) { var me = this; //"use strict";
iCn3DUI.prototype.loadAtomDataIn = function (data, id, type, seqalign, alignType) { var me = this; //"use strict";
//me.icn3d.init();
me.icn3d.pmin = new THREE.Vector3( 9999, 9999, 9999);
me.icn3d.pmax = new THREE.Vector3(-9999,-9999,-9999);
Expand Down Expand Up @@ -1254,11 +1255,10 @@ iCn3DUI.prototype.loadAtomDataIn = function (data, id, type, seqalign, alignType
}

if(type === 'mmcifid') {
me.transformToOpmOri(id, chainCalphaHash2);
me.transformToOpmOri(id);
}
else if(type === 'mmdbid') {
var bResi_ori = false; // true
me.transformToOpmOri(id, chainCalphaHash2, bResi_ori);
me.transformToOpmOri(id);
}

// set up sequence alignment
Expand Down
94 changes: 52 additions & 42 deletions src/icn3dui/parsers/mmcif_mmdb_parser_align.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,61 +124,71 @@ iCn3DUI.prototype.downloadAlignment = function (align) { var me = this; //"use s

chained.done(function( data ) { // url
if (data.atoms !== undefined) {
me.icn3d.init();
me.deferredOpm = $.Deferred(function() {
//var mmdbidArray = me.inputid.split('_');
me.mmdbidArray = [];
for(var i = 0, il = data.alignedStructures[0].length; i < il; ++i) {
me.mmdbidArray.push(data.alignedStructures[0][i].pdbId);
}

me.loadAtomDataIn(data, undefined, 'align', seqalign);
me.loadOpmDataForAlign(data, seqalign, me.mmdbidArray);
});

if(me.cfg.align === undefined && Object.keys(me.icn3d.structures).length == 1) {
$("#" + me.pre + "alternateWrapper").hide();
}
return me.deferredOpm.promise();
}
else {
alert('invalid atoms data.');
return false;
}
});
};

// show all
var allAtoms = {};
for(var i in me.icn3d.atoms) {
allAtoms[i] = 1;
}
me.icn3d.dAtoms = allAtoms;
me.icn3d.hAtoms = allAtoms;
iCn3DUI.prototype.downloadAlignmentPart2 = function (data, seqalign, chainresiCalphaHash2) { var me = this; //"use strict";
//me.icn3d.init();
me.loadAtomDataIn(data, undefined, 'align', seqalign);

me.icn3d.setAtomStyleByOptions(me.opts);
// change the default color to "Identity"
me.icn3d.setColorByOptions(me.opts, me.icn3d.atoms);
if(me.cfg.align === undefined && Object.keys(me.icn3d.structures).length == 1) {
$("#" + me.pre + "alternateWrapper").hide();
}

//var mmdbidArray = me.inputid.split('_');
me.mmdbidArray = [];
for(var i = 0, il = data.alignedStructures[0].length; i < il; ++i) {
me.mmdbidArray.push(data.alignedStructures[0][i].pdbId);
}
// show all
var allAtoms = {};
for(var i in me.icn3d.atoms) {
allAtoms[i] = 1;
}
me.icn3d.dAtoms = allAtoms;
me.icn3d.hAtoms = allAtoms;

me.renderStructure();
me.icn3d.setAtomStyleByOptions(me.opts);
// change the default color to "Identity"
me.icn3d.setColorByOptions(me.opts, me.icn3d.atoms);

if(me.cfg.rotate !== undefined) me.rotStruc(me.cfg.rotate, true);
// memebrane is determined by one structure. But transform both structures
if(chainresiCalphaHash2 !== undefined) me.transformToOpmOriForAlign(me.selectedPdbid, chainresiCalphaHash2, true);

me.html2ddgm = '';
me.renderStructure();

//setTimeout(function(){
// me.set2DDiagramsForAlign(me.mmdbidArray[0].toUpperCase(), me.mmdbidArray[1].toUpperCase());
//}, 0);
if(me.cfg.rotate !== undefined) me.rotStruc(me.cfg.rotate, true);

// by default, open the seq alignment window
//if(me.cfg.show2d !== undefined && me.cfg.show2d) me.openDialog(me.pre + 'dl_2ddgm', 'Interactions');
if(me.cfg.showalignseq !== undefined && me.cfg.showalignseq) {
me.openDialog(me.pre + 'dl_alignment', 'Select residues in aligned sequences');
}
me.html2ddgm = '';

if(me.cfg.show2d !== undefined && me.cfg.show2d && me.bFullUi) {
me.set2DDiagramsForAlign(me.mmdbidArray[0].toUpperCase(), me.mmdbidArray[1].toUpperCase());
}
//setTimeout(function(){
// me.set2DDiagramsForAlign(me.mmdbidArray[0].toUpperCase(), me.mmdbidArray[1].toUpperCase());
//}, 0);

//if(me.cfg.showseq !== undefined && me.cfg.showseq) me.openDialog(me.pre + 'dl_selectresidues', 'Select residues in sequences');
// by default, open the seq alignment window
//if(me.cfg.show2d !== undefined && me.cfg.show2d) me.openDialog(me.pre + 'dl_2ddgm', 'Interactions');
if(me.cfg.showalignseq !== undefined && me.cfg.showalignseq) {
me.openDialog(me.pre + 'dl_alignment', 'Select residues in aligned sequences');
}

if(me.deferred !== undefined) me.deferred.resolve(); if(me.deferred2 !== undefined) me.deferred2.resolve();
}
else {
alert('invalid atoms data.');
return false;
}
});
if(me.cfg.show2d !== undefined && me.cfg.show2d && me.bFullUi) {
me.set2DDiagramsForAlign(me.mmdbidArray[0].toUpperCase(), me.mmdbidArray[1].toUpperCase());
}

//if(me.cfg.showseq !== undefined && me.cfg.showseq) me.openDialog(me.pre + 'dl_selectresidues', 'Select residues in sequences');

if(me.deferred !== undefined) me.deferred.resolve(); if(me.deferred2 !== undefined) me.deferred2.resolve();
};

iCn3DUI.prototype.downloadChainAlignment = function (chainalign) { var me = this; //"use strict";
Expand Down
10 changes: 6 additions & 4 deletions src/icn3dui/parsers/mmtf_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ iCn3DUI.prototype.downloadMmtf = function (mmtfid) { var me = this; //"use stric
var bFull = false;
//me.parseMmtfData(mmtfData, bFull);
me.deferredOpm = $.Deferred(function() {
me.loadMmtfOpmData(mmtfData, mmtfid, bFull);
//me.loadMmtfOpmData(mmtfData, mmtfid, bFull);
me.loadOpmData(mmtfData, mmtfid, bFull, 'mmtf');
});

return me.deferredOpm.promise();
Expand All @@ -29,7 +30,8 @@ iCn3DUI.prototype.downloadMmtf = function (mmtfid) { var me = this; //"use stric
var bFull = true;
//me.parseMmtfData(mmtfData2, bFull);
me.deferredOpm = $.Deferred(function() {
me.loadMmtfOpmData(mmtfData2, mmtfid, bFull);
//me.loadMmtfOpmData(mmtfData2, mmtfid, bFull);
me.loadOpmData(mmtfData2, mmtfid, bFull, 'mmtf');
});

return me.deferredOpm.promise();
Expand All @@ -48,7 +50,7 @@ iCn3DUI.prototype.downloadMmtf = function (mmtfid) { var me = this; //"use stric
);
};

iCn3DUI.prototype.parseMmtfData = function (mmtfData, mmtfid, bFull, chainCalphaHash2) { var me = this; //"use strict";
iCn3DUI.prototype.parseMmtfData = function (mmtfData, mmtfid, bFull) { var me = this; //"use strict";
var cnt = mmtfData.numAtoms;

me.icn3d.init();
Expand Down Expand Up @@ -435,7 +437,7 @@ iCn3DUI.prototype.parseMmtfData = function (mmtfData, mmtfid, bFull, chainCalpha
me.icn3d.oriMaxD = me.icn3d.maxD;
me.icn3d.oriCenter = me.icn3d.center.clone();

me.transformToOpmOri(mmtfid, chainCalphaHash2);
me.transformToOpmOri(mmtfid);

if(me.cfg.align === undefined && Object.keys(me.icn3d.structures).length == 1) {
$("#" + me.pre + "alternateWrapper").hide();
Expand Down
Loading

0 comments on commit b55f65e

Please sign in to comment.