Skip to content

Commit

Permalink
Merge pull request #60 in STRUC/icn3d from release214 to master
Browse files Browse the repository at this point in the history
* commit '6a9c55fd9d9ebc352976893f666710c78b8300be':
  The retrieval of transformation matrix from mmCIF was fixed for Mac
  • Loading branch information
jiywang3 committed Jun 7, 2018
2 parents 392a9d1 + 6a9c55f commit bcead2d
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 42 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ We provided two types of iCn3D widgets: [basic interface](https://www.ncbi.nlm.n

Either of these widgets could be easily added to your own web pages. Please see the [help page](https://www.ncbi.nlm.nih.gov/Structure/icn3d/docs/icn3d_help.html#HowToUse) for more details.

<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.1.3.zip](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.1.3.zip). The "Download ZIP" link in this page does not include third-party libraries.
<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.1.4.zip](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.1.4.zip). The "Download ZIP" link in this page does not include third-party libraries.

## Usage

Expand Down Expand Up @@ -77,6 +77,8 @@ gulp
```

## Change log
The production version [icn3d-2.1.4](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.1.4.zip) was release on June 7, 2018. The retrieval of transformation matrix from mmCIF was fixed for Mac.

The production version [icn3d-2.1.3](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.1.3.zip) was release on May 30, 2018. "Sequences and Annotations" is now able to be highlighted even if some annotations didn't show up.

The production version [icn3d-2.1.2](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.1.2.zip) was release on May 23, 2018. The surface display was improved by adding light reflection. Light was added to the display of instanced biological assemblies.
Expand Down
3 changes: 3 additions & 0 deletions icn3d.html
Original file line number Diff line number Diff line change
Expand Up @@ -1700,6 +1700,9 @@ <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>
The production version <a href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.1.4.zip">icn3d-2.1.4</a> was release on June 7, 2018. The retrieval of transformation matrix from mmCIF was fixed for Mac.
<br><br>

The production version <a href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-2.1.3.zip">icn3d-2.1.3</a> was release on May 30, 2018. "Sequences and Annotations" is now able to be highlighted even if some annotations didn't show up.
<br><br>

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.1.3",
"version": "2.1.4",
"description": "iCn3D Structure Viewer",
"main": "index.html",
"scripts": {
Expand Down
22 changes: 17 additions & 5 deletions src/icn3dui/full_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -614,11 +614,6 @@ iCn3DUI.prototype = {
// display the structure right away. load the mns and sequences later
setTimeout(function(){
if(me.bInitial) {
if(me.cfg.showanno !== undefined && me.cfg.showanno) {
me.showAnnotations();
me.setLogCmd("view annotations", true);
}

if(me.cfg.showsets !== undefined && me.cfg.showsets) {
me.showSets();
}
Expand All @@ -632,6 +627,23 @@ iCn3DUI.prototype = {
}

//me.setProtNuclLigInMenu();

if(me.cfg.showanno !== undefined && me.cfg.showanno) {
var cmd = "view annotations";
me.setLogCmd(cmd, true);

me.showAnnotations();
/*
if(Object.keys(me.icn3d.proteins).length > 0) {
$.when(me.applyCommandAnnotationsAndCddSite(cmd)).then(function() {
// do something afterward
});
}
else {
me.applyCommandAnnotationsAndCddSiteBase(cmd);
}
*/
}
}
else {
me.updateHlAll();
Expand Down
48 changes: 13 additions & 35 deletions src/icn3dui/parsers/mmcif_mmdb_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ iCn3DUI.prototype.downloadMmcifSymmetry = function (mmcifid) { var me = this;
iCn3DUI.prototype.downloadMmcifSymmetryBase = function (mmcifid) { var me = this;
var url, dataType;

url = "https://files.rcsb.org/header/" + mmcifid + ".cif";
if(me.isMac()) { // safari has a problem in getting data from https://files.rcsb.org/header/
url = "https://files.rcsb.org/view/" + mmcifid + ".cif";
}
else {
url = "https://files.rcsb.org/header/" + mmcifid + ".cif";
}

dataType = "text";

Expand Down Expand Up @@ -193,46 +198,16 @@ iCn3DUI.prototype.loadMmcifData = function(data) { var me = this;
};

iCn3DUI.prototype.loadMmcifSymmetry = function(data) { var me = this;
//if(me.cfg.align === undefined && Object.keys(me.icn3d.structures).length == 1) {
// $("#" + me.pre + "alternateWrapper").hide();
//}

// load assembly info
var assembly = data.assembly;
var pmatrix = data.pmatrix;

// var pmatrixMat4 = new THREE.Matrix4();
// pmatrixMat4.fromArray(pmatrix);

//console.log("pmatrix: " + JSON.stringify(pmatrix));

for(var i = 0, il = assembly.length; i < il; ++i) {
//console.log("i: " + i + " matrix1: " + JSON.stringify(assembly[i]));

//var pmatrixInverseMat4 = new THREE.Matrix4();
//pmatrixInverseMat4.getInverse(pmatrixMat4);

var mat4 = new THREE.Matrix4();
mat4.fromArray(assembly[i]);

//pmatrixInverseMat4.multiply(mat4).multiply(pmatrixMat4);
// mat4.multiplyMatrices(pmatrixMat4, mat4);

//console.log("mat4.elements: " + JSON.stringify(mat4.elements));

/*
if (me.icn3d.biomtMatrices[i] == undefined) me.icn3d.biomtMatrices[i] = new THREE.Matrix4().identity();
for(var j = 0, jl = assembly[i].length; j < jl; ++j) {
//me.icn3d.biomtMatrices[i].elements[j] = assembly[i][j];
//me.icn3d.biomtMatrices[i].elements[j] = pmatrixInverseMat4.elements[j];
me.icn3d.biomtMatrices[i].elements[j] = mat4.elements[j];
}
*/

me.icn3d.biomtMatrices[i] = mat4;
}
//console.log("me.icn3d.biomtMatrices: " + JSON.stringify(me.icn3d.biomtMatrices));

me.icn3d.asuCnt = me.icn3d.biomtMatrices.length;
};
Expand Down Expand Up @@ -435,6 +410,11 @@ iCn3DUI.prototype.getMissingResidues = function (seqArray, type, chainid) { var
resiPos = 1;
}

// fixe some missing residue names such as residue 6 in 5C1M_A
if(seqName === '') {
seqName = 'x';
}

var resObject = {};
resObject.resi = i + 1;
var resi = parseInt(seqArray[i][resiPos]);
Expand Down Expand Up @@ -597,7 +577,6 @@ iCn3DUI.prototype.loadAtomDataIn = function (data, id, type, seqalign) { var me
}
}


var atomid2serial = {};
var prevStructureNum = '', prevChainNum = '', prevResidueNum = '';
var structureNum = '', chainNum = '', residueNum = '';
Expand Down Expand Up @@ -881,14 +860,13 @@ iCn3DUI.prototype.loadAtomDataIn = function (data, id, type, seqalign) { var me
}

// me.icn3d.chainsSeq[chainid][atm.resi - 1] should have been defined for major chains
if( (type === 'mmdbid' || type === 'mmcifid') && bChainSeqSet && me.icn3d.chainsSeq[chainid][atm.resi - 1] !== undefined) {
if( bChainSeqSet && me.icn3d.chainsSeq[chainid][atm.resi - 1] !== undefined) {
me.icn3d.chainsSeq[chainid][atm.resi - 1].name = oneLetterRes;
}
else {
else if(!bChainSeqSet) {
var resObject = {};
resObject.resi = atm.resi;
resObject.name = oneLetterRes;

var numberStr = '';
if(atm.resi % 10 === 0) numberStr = atm.resi.toString();

Expand Down

0 comments on commit bcead2d

Please sign in to comment.