icn3d 3.25.2 → 3.25.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/icn3d.js +45 -9
- package/icn3d.min.js +2 -2
- package/icn3d.module.js +45 -9
- package/package.json +1 -1
package/icn3d.module.js
CHANGED
|
@@ -16192,7 +16192,7 @@ class SetHtml {
|
|
|
16192
16192
|
let matchedStrState = "Start of state file======\n";
|
|
16193
16193
|
let posState = imageStr.indexOf(matchedStrState);
|
|
16194
16194
|
if(pos == -1 && posState == -1) {
|
|
16195
|
-
alert('Please load a PNG image saved by clicking "Save
|
|
16195
|
+
alert('Please load a PNG image saved by clicking the menu "File > Save File > iCn3D PNG Image"...');
|
|
16196
16196
|
}
|
|
16197
16197
|
else if(pos != -1) {
|
|
16198
16198
|
let url = imageStr.substr(pos + matchedStr.length);
|
|
@@ -42823,10 +42823,10 @@ class ShowSeq {
|
|
|
42823
42823
|
// sometimes one chain may have several Ig domains,set an index for each IgDomain
|
|
42824
42824
|
let index = 1, bStart = false;
|
|
42825
42825
|
|
|
42826
|
-
// get the range of each strand excluding loops
|
|
42827
|
-
let strandArray = [], strandHash = {}, strandCnt = 0, resCnt = 0;
|
|
42826
|
+
// 1. get the range of each strand excluding loops
|
|
42827
|
+
let strandArray = [], strandHash = {}, strandCnt = 0, resCnt = 0, resCntBfAnchor = 0;
|
|
42828
42828
|
if(!bCustom && !kabat_or_imgt) {
|
|
42829
|
-
for(let i = 0, il = giSeq.length; i < il; ++i, ++resCnt) {
|
|
42829
|
+
for(let i = 0, il = giSeq.length; i < il; ++i, ++resCnt, ++resCntBfAnchor) {
|
|
42830
42830
|
let currResi = ic.ParserUtilsCls.getResi(chnid, i);
|
|
42831
42831
|
let residueid = chnid + '_' + currResi;
|
|
42832
42832
|
refnumLabel = ic.resid2refnum[residueid];
|
|
@@ -42855,6 +42855,8 @@ class ShowSeq {
|
|
|
42855
42855
|
|
|
42856
42856
|
if(currStrand && currStrand != ' ') {
|
|
42857
42857
|
if(refnum3c.substr(0,1) != '9') {
|
|
42858
|
+
let lastTwo = parseInt(refnum.toString().substr(refnum.toString().length - 2, 2));
|
|
42859
|
+
|
|
42858
42860
|
if(currStrand != prevStrand) { // reset currCnt
|
|
42859
42861
|
if(strandHash[currStrand + postfix]) {
|
|
42860
42862
|
++index;
|
|
@@ -42866,10 +42868,17 @@ class ShowSeq {
|
|
|
42866
42868
|
strandArray[strandCnt] = {};
|
|
42867
42869
|
strandArray[strandCnt].startResi = currResi;
|
|
42868
42870
|
strandArray[strandCnt].startRefnum = refnum; // 1250 in A1250a
|
|
42871
|
+
|
|
42872
|
+
resCntBfAnchor = 0;
|
|
42869
42873
|
|
|
42870
42874
|
strandArray[strandCnt].endResi = currResi;
|
|
42871
42875
|
strandArray[strandCnt].endRefnum = refnum; // 1250a
|
|
42872
42876
|
|
|
42877
|
+
if(lastTwo == 50) {
|
|
42878
|
+
strandArray[strandCnt].anchorRefnum = refnum;
|
|
42879
|
+
strandArray[strandCnt].resCntBfAnchor = resCntBfAnchor;
|
|
42880
|
+
}
|
|
42881
|
+
|
|
42873
42882
|
strandArray[strandCnt].strandPostfix = strandPostfix; // a in A1250a
|
|
42874
42883
|
strandArray[strandCnt].strand = currStrand; // A in A1250a
|
|
42875
42884
|
|
|
@@ -42885,6 +42894,11 @@ class ShowSeq {
|
|
|
42885
42894
|
strandArray[strandCnt - 1].endResi = currResi;
|
|
42886
42895
|
strandArray[strandCnt - 1].endRefnum = refnum; // 1250a
|
|
42887
42896
|
|
|
42897
|
+
if(lastTwo == 50) {
|
|
42898
|
+
strandArray[strandCnt - 1].anchorRefnum = refnum;
|
|
42899
|
+
strandArray[strandCnt - 1].resCntBfAnchor = resCntBfAnchor;
|
|
42900
|
+
}
|
|
42901
|
+
|
|
42888
42902
|
resCnt = 0;
|
|
42889
42903
|
}
|
|
42890
42904
|
}
|
|
@@ -42895,13 +42909,22 @@ class ShowSeq {
|
|
|
42895
42909
|
prevStrand = currStrand;
|
|
42896
42910
|
}
|
|
42897
42911
|
|
|
42912
|
+
// 2. remove strands with less than 3 residues
|
|
42913
|
+
for(let il = strandArray.length, i = il - 1; i >= 0; --i) {
|
|
42914
|
+
if(strandArray[i].endRefnum - strandArray[i].startRefnum < 3 - 1) { // remove the strand
|
|
42915
|
+
strandArray.splice(i, 1);
|
|
42916
|
+
}
|
|
42917
|
+
}
|
|
42918
|
+
|
|
42919
|
+
// 3. assign refnumLabel for each resid
|
|
42898
42920
|
strandCnt = 0;
|
|
42899
42921
|
let loopCnt = 0;
|
|
42900
42922
|
|
|
42901
42923
|
let bNterminal = true, refnumLabelNoPostfix, prevStrandCnt = 0, currRefnum;
|
|
42902
42924
|
bStart = false;
|
|
42925
|
+
let refnumInStrand = 0;
|
|
42903
42926
|
if(strandArray.length > 0) {
|
|
42904
|
-
for(let i = 0, il = giSeq.length; i < il; ++i, ++loopCnt) {
|
|
42927
|
+
for(let i = 0, il = giSeq.length; i < il; ++i, ++loopCnt, ++refnumInStrand) {
|
|
42905
42928
|
let currResi = ic.ParserUtilsCls.getResi(chnid, i);
|
|
42906
42929
|
let residueid = chnid + '_' + currResi;
|
|
42907
42930
|
refnumLabel = ic.resid2refnum[residueid];
|
|
@@ -42973,6 +42996,15 @@ class ShowSeq {
|
|
|
42973
42996
|
else if(parseInt(currResi) >= parseInt(strandArray[strandCnt].startResi) && parseInt(currResi) <= parseInt(strandArray[strandCnt].endResi)) {
|
|
42974
42997
|
bNterminal = false;
|
|
42975
42998
|
|
|
42999
|
+
if(strandArray[strandCnt].anchorRefnum) { // use anchor to name refnum
|
|
43000
|
+
if(currResi == strandArray[strandCnt].startResi) {
|
|
43001
|
+
refnumInStrand = strandArray[strandCnt].anchorRefnum - strandArray[strandCnt].resCntBfAnchor;
|
|
43002
|
+
}
|
|
43003
|
+
|
|
43004
|
+
refnumLabelNoPostfix = strandArray[strandCnt].strand + refnumInStrand;
|
|
43005
|
+
refnumLabel = refnumLabelNoPostfix + strandArray[strandCnt].strandPostfix;
|
|
43006
|
+
}
|
|
43007
|
+
|
|
42976
43008
|
if(currResi == strandArray[strandCnt].endResi) {
|
|
42977
43009
|
++strandCnt; // next strand
|
|
42978
43010
|
loopCnt = 0;
|
|
@@ -44997,7 +45029,11 @@ class GetGraph {
|
|
|
44997
45029
|
let fontsize = '6px'; // '6';
|
|
44998
45030
|
//let html = (bAfMap) ? "<g>" : "<g class='icn3d-node' resid='" + resid + "' >";
|
|
44999
45031
|
let html = "<g class='icn3d-node' resid='" + resid + "' >";
|
|
45000
|
-
|
|
45032
|
+
let title = node.id;
|
|
45033
|
+
if(ic.resid2refnum[resid]) {
|
|
45034
|
+
title += '=>' + ic.resid2refnum[resid];
|
|
45035
|
+
}
|
|
45036
|
+
html += "<title>" + title + "</title>";
|
|
45001
45037
|
if(bVertical) {
|
|
45002
45038
|
html += "<circle cx='" + y + "' cy='" + x + "' r='" + r + "' fill='" + color + "' stroke-width='" + strokewidth + "' stroke='" + strokecolor + "' resid='" + resid + "' />";
|
|
45003
45039
|
html += "<text x='" +(y - 20).toString() + "' y='" +(x + 2).toString() + "' fill='" + textcolor + "' stroke='none' style='font-size:" + fontsize + "; text-anchor:middle' >" + nodeName + "</text>";
|
|
@@ -51177,7 +51213,7 @@ class RealignParser {
|
|
|
51177
51213
|
|
|
51178
51214
|
async realignOnStructAlign() { let ic = this.icn3d, me = ic.icn3dui;
|
|
51179
51215
|
// each 3D domain should have at least 3 secondary structures
|
|
51180
|
-
let minSseCnt = 3;
|
|
51216
|
+
let minSseCnt = (me.cfg.aligntool != 'tmalign') ? 3 : 0;
|
|
51181
51217
|
let struct2domain = {};
|
|
51182
51218
|
for(let struct in ic.structures) {
|
|
51183
51219
|
struct2domain[struct] = {};
|
|
@@ -67216,7 +67252,7 @@ class SaveFile {
|
|
|
67216
67252
|
if(me.utilsCls.isIE()) {
|
|
67217
67253
|
blob = ic.renderer.domElement.msToBlob();
|
|
67218
67254
|
|
|
67219
|
-
if(bAddURL
|
|
67255
|
+
if(bAddURL) {
|
|
67220
67256
|
let reader = new FileReader();
|
|
67221
67257
|
reader.onload = function(e) {
|
|
67222
67258
|
let arrayBuffer = e.target.result; // or = reader.result;
|
|
@@ -67242,7 +67278,7 @@ class SaveFile {
|
|
|
67242
67278
|
}
|
|
67243
67279
|
else {
|
|
67244
67280
|
ic.renderer.domElement.toBlob(function(data) {
|
|
67245
|
-
if(bAddURL
|
|
67281
|
+
if(bAddURL) {
|
|
67246
67282
|
let reader = new FileReader();
|
|
67247
67283
|
reader.onload = function(e) {
|
|
67248
67284
|
let arrayBuffer = e.target.result; // or = reader.result;
|