icn3d 3.18.1 → 3.19.1

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 CHANGED
@@ -3938,6 +3938,16 @@ class ParasCls {
3938
3938
  'Au': this.thr(0xDAA520), 'AU': this.thr(0xDAA520)
3939
3939
  };
3940
3940
 
3941
+ this.atomnames = {
3942
+ 'H': 'Hydrogen', 'HE': 'Helium', 'LI': 'Lithium', 'B': 'Boron',
3943
+ 'C': 'Carbon', 'N': 'Nitrogen', 'O': 'Oxygen', 'F': 'Fluorine',
3944
+ 'NA': 'Sodium', 'MG': 'Magnesium', 'AL': 'Aluminum', 'SI': 'Silicon',
3945
+ 'P': 'Phosphorus', 'S': 'Sulfur', 'CL': 'Chlorine', 'CA': 'Calcium',
3946
+ 'TI': 'Titanium', 'CR': 'Chromium', 'MN': 'Manganese', 'FE': 'Iron',
3947
+ 'NI': 'Nickel', 'CU': 'Copper', 'ZN': 'Zinc', 'BR': 'Bromine',
3948
+ 'AG': 'Silver', 'I': 'Iodine', 'BA': 'Barium', 'AU': 'Gold'
3949
+ };
3950
+
3941
3951
  this.defaultAtomColor = this.thr(0xCCCCCC);
3942
3952
 
3943
3953
  this.stdChainColors = [
@@ -6820,21 +6830,23 @@ class Box {
6820
6830
  this.createBox_base(atom.coord, radius, color, bHighlight);
6821
6831
  }
6822
6832
 
6823
- createBox_base(coord, radius, color, bHighlight, bOther, bGlycan) { let ic = this.icn3d, me = ic.icn3dui;
6833
+ createBox_base(coord, radius, color, bHighlight, bOther, bGlycan, opacity) { let ic = this.icn3d, me = ic.icn3dui;
6824
6834
  if(me.bNode) return;
6825
6835
 
6826
6836
  let mesh;
6827
6837
 
6838
+ if(opacity === undefined) opacity = (bGlycan) ? 0.5 : 1.0;
6839
+
6828
6840
  new THREE.BoxGeometry(1, 1, 1);
6829
6841
 
6830
- if(bHighlight || bGlycan) {
6831
- mesh = new THREE.Mesh(ic.boxGeometry, new THREE.MeshPhongMaterial({ transparent: true, opacity: 0.5,
6832
- specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
6833
- }
6834
- else {
6835
- mesh = new THREE.Mesh(ic.boxGeometry, new THREE.MeshPhongMaterial({
6842
+ //if(bHighlight || bGlycan) {
6843
+ mesh = new THREE.Mesh(ic.boxGeometry, new THREE.MeshPhongMaterial({ transparent: true, opacity: opacity,
6836
6844
  specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
6837
- }
6845
+ // }
6846
+ // else {
6847
+ // mesh = new THREE.Mesh(ic.boxGeometry, new THREE.MeshPhongMaterial({
6848
+ // specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
6849
+ // }
6838
6850
 
6839
6851
  mesh.scale.x = mesh.scale.y = mesh.scale.z = radius;
6840
6852
 
@@ -8075,7 +8087,8 @@ class Line$1 {
8075
8087
  let dashed = (line.dashed) ? line.dashed : false;
8076
8088
  let dashSize = 0.3;
8077
8089
 
8078
- let radius = ic.lineRadius;
8090
+ let radius = (line.radius) ? line.radius : ic.lineRadius;
8091
+ let opacity = (line.opacity) ? line.opacity : 1.0;
8079
8092
 
8080
8093
  let colorStr = '#' + line.color.replace(/\#/g, '');
8081
8094
 
@@ -8086,7 +8099,7 @@ class Line$1 {
8086
8099
  ic.brickCls.createBrick(p1, p2, radius, color);
8087
8100
  }
8088
8101
  else {
8089
- ic.cylinderCls.createCylinder(p1, p2, radius, color);
8102
+ ic.cylinderCls.createCylinder(p1, p2, radius, color, undefined, undefined, undefined, undefined, opacity);
8090
8103
  }
8091
8104
  }
8092
8105
  else {
@@ -8105,7 +8118,7 @@ class Line$1 {
8105
8118
  ic.brickCls.createBrick(start, end, radius, color);
8106
8119
  }
8107
8120
  else {
8108
- ic.cylinderCls.createCylinder(start, end, radius, color);
8121
+ ic.cylinderCls.createCylinder(start, end, radius, color, undefined, undefined, undefined, undefined, opacity);
8109
8122
  }
8110
8123
  }
8111
8124
  }
@@ -8144,19 +8157,22 @@ class Sphere$1 {
8144
8157
  this.createSphereBase(atom.coord, atom.color, radius, scale, bHighlight);
8145
8158
  }
8146
8159
 
8147
- createSphereBase(pos, color, radius, scale, bHighlight, bGlycan) { let ic = this.icn3d, me = ic.icn3dui;
8160
+ createSphereBase(pos, color, radius, scale, bHighlight, bGlycan, opacity) { let ic = this.icn3d, me = ic.icn3dui;
8148
8161
  if(me.bNode) return;
8149
8162
 
8150
8163
  let mesh;
8151
8164
 
8152
8165
  if(scale === undefined) scale = 1.0;
8153
8166
 
8167
+ let opacity_ori = opacity;
8168
+ if(opacity === undefined) opacity = (bGlycan) ? 0.5 : 1.0;
8169
+
8154
8170
  if(bHighlight === 2) {
8155
8171
  scale *= 1.5;
8156
8172
 
8157
8173
  color = ic.hColor;
8158
8174
 
8159
- mesh = new THREE.Mesh(ic.sphereGeometry, new THREE.MeshPhongMaterial({ transparent: true, opacity: 0.5, specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
8175
+ mesh = new THREE.Mesh(ic.sphereGeometry, new THREE.MeshPhongMaterial({ transparent: true, opacity: opacity, specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
8160
8176
 
8161
8177
  mesh.scale.x = mesh.scale.y = mesh.scale.z = radius * (scale ? scale : 1);
8162
8178
  mesh.position.copy(pos);
@@ -8174,19 +8190,18 @@ class Sphere$1 {
8174
8190
  if(color === undefined) {
8175
8191
  color = me.parasCls.defaultAtomColor;
8176
8192
  }
8177
-
8178
- //var color = atom.color;
8179
- if(bGlycan) {
8180
- mesh = new THREE.Mesh(ic.sphereGeometry, new THREE.MeshPhongMaterial({ transparent: true, opacity: 0.5, specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
8181
- }
8182
- else {
8183
- mesh = new THREE.Mesh(ic.sphereGeometry, new THREE.MeshPhongMaterial({ specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
8184
- }
8193
+
8194
+ //if(bGlycan) {
8195
+ mesh = new THREE.Mesh(ic.sphereGeometry, new THREE.MeshPhongMaterial({ transparent: true, opacity: opacity, specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
8196
+ // }
8197
+ // else {
8198
+ // mesh = new THREE.Mesh(ic.sphereGeometry, new THREE.MeshPhongMaterial({ specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
8199
+ // }
8185
8200
 
8186
8201
  mesh.scale.x = mesh.scale.y = mesh.scale.z = radius * (scale ? scale : 1);
8187
8202
  mesh.position.copy(pos);
8188
8203
 
8189
- if(ic.bImpo && !bGlycan) {
8204
+ if(ic.bImpo && !opacity_ori && !bGlycan) {
8190
8205
  ic.posArraySphere.push(pos.x);
8191
8206
  ic.posArraySphere.push(pos.y);
8192
8207
  ic.posArraySphere.push(pos.z);
@@ -8214,7 +8229,7 @@ class Sphere$1 {
8214
8229
  }
8215
8230
  }
8216
8231
  else {
8217
- if(ic.bImpo) {
8232
+ if(ic.bImpo && !opacity_ori) { // imposter didn't work with transparency yet in iCn3D
8218
8233
  if(ic.cnt <= ic.maxatomcnt) ic.objects_ghost.push(mesh);
8219
8234
  }
8220
8235
  else {
@@ -8248,9 +8263,12 @@ class Cylinder {
8248
8263
  }
8249
8264
 
8250
8265
  // modified from iview (http://istar.cse.cuhk.edu.hk/iview/)
8251
- createCylinder(p0, p1, radius, color, bHighlight, color2, bPicking, bGlycan) { let ic = this.icn3d, me = ic.icn3dui;
8266
+ createCylinder(p0, p1, radius, color, bHighlight, color2, bPicking, bGlycan, opacity) { let ic = this.icn3d, me = ic.icn3dui;
8252
8267
  if(me.bNode) return;
8253
8268
 
8269
+ let opacity_ori = opacity;
8270
+ if(opacity === undefined) opacity = (bGlycan) ? 0.5 : 1.0;
8271
+
8254
8272
  let mesh;
8255
8273
  if(bHighlight === 1) {
8256
8274
  mesh = new THREE.Mesh(ic.cylinderGeometryOutline, ic.matShader);
@@ -8271,18 +8289,19 @@ class Cylinder {
8271
8289
  else {
8272
8290
  if(bHighlight === 2) {
8273
8291
  mesh = new THREE.Mesh(ic.cylinderGeometry, new THREE.MeshPhongMaterial(
8274
- { transparent: true, opacity: 0.5, specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
8292
+ { transparent: true, opacity: opacity, specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
8275
8293
 
8276
8294
  radius *= 1.5;
8277
8295
  }
8278
- else if(bGlycan) {
8279
- mesh = new THREE.Mesh(ic.cylinderGeometry, new THREE.MeshPhongMaterial(
8280
- { transparent: true, opacity: 0.5, specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
8281
- }
8296
+ //else if(bGlycan) {
8282
8297
  else {
8283
8298
  mesh = new THREE.Mesh(ic.cylinderGeometry, new THREE.MeshPhongMaterial(
8284
- { specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
8299
+ { transparent: true, opacity: opacity, specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
8285
8300
  }
8301
+ // else {
8302
+ // mesh = new THREE.Mesh(ic.cylinderGeometry, new THREE.MeshPhongMaterial(
8303
+ // { specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
8304
+ // }
8286
8305
 
8287
8306
  mesh.position.copy(p0).add(p1).multiplyScalar(0.5);
8288
8307
  mesh.matrixAutoUpdate = false;
@@ -8292,7 +8311,7 @@ class Cylinder {
8292
8311
  mesh.matrix.multiply(new THREE.Matrix4().makeScale(radius, radius, p0.distanceTo(p1))).multiply(
8293
8312
  new THREE.Matrix4().makeRotationX(Math.PI * 0.5));
8294
8313
 
8295
- if(ic.bImpo && !bGlycan) {
8314
+ if(ic.bImpo && !opacity_ori && !bGlycan) {
8296
8315
  ic.posArray.push(p0.x);
8297
8316
  ic.posArray.push(p0.y);
8298
8317
  ic.posArray.push(p0.z);
@@ -8326,7 +8345,7 @@ class Cylinder {
8326
8345
  }
8327
8346
 
8328
8347
  if(bHighlight === 2) {
8329
- if(ic.bImpo) {
8348
+ if(ic.bImpo && !opacity_ori) {
8330
8349
  if(ic.cnt <= ic.maxatomcnt) ic.prevHighlightObjects_ghost.push(mesh);
8331
8350
  }
8332
8351
  else {
@@ -8334,7 +8353,7 @@ class Cylinder {
8334
8353
  }
8335
8354
  }
8336
8355
  else {
8337
- if(ic.bImpo) {
8356
+ if(ic.bImpo && !opacity_ori) {
8338
8357
  if(ic.cnt <= ic.maxatomcnt) ic.objects_ghost.push(mesh);
8339
8358
  }
8340
8359
  else {
@@ -12009,19 +12028,16 @@ class ShareLink {
12009
12028
  else if(prevCommandStr.indexOf(toggleStr) !== -1) {
12010
12029
  ++cntToggle;
12011
12030
  }
12012
- else if(i === start + 1) {
12013
- //tmpUrl += prevCommandStr;
12014
-
12015
- if(!(inparaWithoutCommand !== undefined && ic.inputid)) {
12016
- //if(!(inparaWithoutCommand !== undefined &&
12017
- // (inparaWithoutCommand.indexOf('id=') != -1 || inparaWithoutCommand.indexOf('url=') != -1
12018
- // || inparaWithoutCommand.indexOf('gi=') != -1 || inparaWithoutCommand.indexOf('align=') != -1)
12019
- // ) ) {
12020
- tmpUrl += prevCommandStr;
12021
- }
12031
+ // adding this section will remove the first command!!!
12032
+ // else if(i === start + 1) {
12033
+ // //tmpUrl += prevCommandStr;
12022
12034
 
12023
- //statefile += prevCommandStr + "\n";
12024
- }
12035
+ // if(!(inparaWithoutCommand !== undefined && ic.inputid)) {
12036
+ // tmpUrl += prevCommandStr;
12037
+ // }
12038
+
12039
+ // //statefile += prevCommandStr + "\n";
12040
+ // }
12025
12041
  else {
12026
12042
  tmpUrl += (tmpUrl) ? '; ' + prevCommandStr : prevCommandStr;
12027
12043
  //statefile += prevCommandStr + "\n";
@@ -27543,11 +27559,12 @@ class LoadScript {
27543
27559
  let commandFirst = commandArray[0].substr(0, pos - 1);
27544
27560
  ic.commands.splice(0, 1, commandFirst);
27545
27561
  }
27546
-
27562
+
27547
27563
  //ic.commands = dataStr.trim().split('\n');
27548
27564
  ic.STATENUMBER = ic.commands.length;
27549
27565
 
27550
27566
  ic.commands = preCommands.concat(ic.commands);
27567
+
27551
27568
  ic.STATENUMBER = ic.commands.length;
27552
27569
 
27553
27570
  /*
@@ -30684,6 +30701,12 @@ class ShowSeq {
30684
30701
  html += result.html;
30685
30702
  html3 += result.html3;
30686
30703
  }
30704
+ else if(ic.bShowCustomRefnum && ic.chainsMapping.hasOwnProperty(chnid)) {
30705
+ let bCustom = true;
30706
+ let result = this.showRefNum(giSeq, chnid, undefined, bCustom);
30707
+ html += result.html;
30708
+ html3 += result.html3;
30709
+ }
30687
30710
  }
30688
30711
 
30689
30712
  // highlight reference numbers
@@ -30701,12 +30724,15 @@ class ShowSeq {
30701
30724
  $("#" + ic.pre + 'tt_giseq_' + chnid).html(html3); // fixed title for scrolling
30702
30725
  }
30703
30726
 
30704
- showRefNum(giSeq, chnid, bKabat) { let ic = this.icn3d, me = ic.icn3dui;
30727
+ showRefNum(giSeq, chnid, bKabat, bCustom) { let ic = this.icn3d, me = ic.icn3dui;
30705
30728
  let html = '', html3 = '';
30706
30729
 
30707
30730
  let htmlTmp = '<div class="icn3d-dl_sequence">';
30708
30731
  htmlTmp += '<div class="icn3d-residueLine" style="white-space:nowrap;">';
30709
- if(bKabat) {
30732
+ if(bCustom) {
30733
+ htmlTmp += '<div class="icn3d-annoTitle" anno="0" title="Custom Reference Numbers">Custom Ref. No.</div>';
30734
+ }
30735
+ else if(bKabat) {
30710
30736
  htmlTmp += '<div class="icn3d-annoTitle" anno="0" title="Kabat Reference Numbers">Kabat Ref. No.</div>';
30711
30737
  }
30712
30738
  else {
@@ -30720,7 +30746,7 @@ class ShowSeq {
30720
30746
  if(i >= ic.matchedPos[chnid] && i - ic.matchedPos[chnid] < ic.chainsSeq[chnid].length) {
30721
30747
  let currResi = ic.chainsSeq[chnid][i - ic.matchedPos[chnid]].resi;
30722
30748
  let residueid = chnid + '_' + currResi;
30723
- let domainid = ic.resid2domainid[residueid];
30749
+ let domainid = (bCustom) ? 0 : ic.resid2domainid[residueid];
30724
30750
  if(!ic.residues.hasOwnProperty(residueid)) {
30725
30751
  html += '<span></span>';
30726
30752
  }
@@ -30733,14 +30759,32 @@ class ShowSeq {
30733
30759
  if(refnumLabel) {
30734
30760
  let refnumStr_ori = refnumLabel.replace(/'/g, '').substr(1);
30735
30761
  let refnumStr;
30736
- if(bKabat) {
30762
+ if(bCustom) {
30763
+ refnumStr = refnumLabel;
30764
+ }
30765
+ else if(bKabat) {
30737
30766
  refnumStr = (ic.domainid2ig2kabat[domainid]) ? ic.domainid2ig2kabat[domainid][refnumStr_ori] : undefined;
30738
30767
  }
30739
30768
  else {
30740
30769
  refnumStr = refnumStr_ori;
30741
30770
  }
30742
30771
 
30743
- if(bKabat) {
30772
+ if(bCustom) {
30773
+ if(!refnumStr) {
30774
+ html += '<span></span>';
30775
+ }
30776
+ else {
30777
+ let refnum = parseInt(refnumStr);
30778
+
30779
+ if(refnum % 2 == 0) {
30780
+ html += '<span title="' + refnumStr + '">' + refnumStr + '</span>';
30781
+ }
30782
+ else {
30783
+ html += '<span title="' + refnumStr + '">&nbsp;</span>';
30784
+ }
30785
+ }
30786
+ }
30787
+ else if(bKabat) {
30744
30788
  if(!refnumStr) {
30745
30789
  html += '<span></span>';
30746
30790
  }
@@ -32090,12 +32134,14 @@ class Analysis {
32090
32134
 
32091
32135
  //Add a line between the position (x1, y1, z1) and the position (x2, y2, z2) with the input "color".
32092
32136
  //The line can be dashed if "dashed" is set true.
32093
- addLine(x1, y1, z1, x2, y2, z2, color, dashed, type) {var ic = this.icn3d; ic.icn3dui;
32137
+ addLine(x1, y1, z1, x2, y2, z2, color, dashed, type, radius, opacity) {var ic = this.icn3d; ic.icn3dui;
32094
32138
  let line = {}; // Each line contains 'position1', 'position2', 'color', and a boolean of 'dashed'
32095
32139
  line.position1 = new THREE.Vector3(x1, y1, z1);
32096
32140
  line.position2 = new THREE.Vector3(x2, y2, z2);
32097
32141
  line.color = color;
32098
32142
  line.dashed = dashed;
32143
+ line.radius = radius;
32144
+ line.opacity = opacity;
32099
32145
  if(ic.lines[type] === undefined) ic.lines[type] = [];
32100
32146
  if(type !== undefined) {
32101
32147
  ic.lines[type].push(line);
@@ -33856,10 +33902,28 @@ class ApplyCommand {
33856
33902
  let color = paraArray[3].substr(paraArray[3].lastIndexOf(' ') + 1);
33857
33903
  let dashed = paraArray[4].substr(paraArray[4].lastIndexOf(' ') + 1) === 'true' ? true : false;
33858
33904
  let type = paraArray[5].substr(paraArray[5].lastIndexOf(' ') + 1);
33905
+ let radius = (paraArray.length > 6) ? paraArray[6].substr(paraArray[6].lastIndexOf(' ') + 1) : 0;
33906
+ let opacity = (paraArray.length > 7) ? paraArray[7].substr(paraArray[7].lastIndexOf(' ') + 1) : 1.0;
33859
33907
 
33860
- ic.analysisCls.addLine(parseFloat(p1Array[1]), parseFloat(p1Array[3]), parseFloat(p1Array[5]), parseFloat(p2Array[1]), parseFloat(p2Array[3]), parseFloat(p2Array[5]), color, dashed, type);
33908
+ ic.analysisCls.addLine(parseFloat(p1Array[1]), parseFloat(p1Array[3]), parseFloat(p1Array[5]), parseFloat(p2Array[1]), parseFloat(p2Array[3]), parseFloat(p2Array[5]), color, dashed, type, parseFloat(radius), parseFloat(opacity));
33861
33909
  ic.drawCls.draw();
33862
33910
  }
33911
+ else if(command.indexOf('add sphere') == 0) {
33912
+ this.addShape(command, 'sphere');
33913
+ //ic.drawCls.draw();
33914
+ }
33915
+ else if(command.indexOf('add cube') == 0) {
33916
+ this.addShape(command, 'cube');
33917
+ //ic.drawCls.draw();
33918
+ }
33919
+ else if(command.indexOf('clear shape') == 0) {
33920
+ ic.shapeCmdHash = {};
33921
+ //ic.drawCls.draw();
33922
+ }
33923
+ else if(command.indexOf('clear line between sets') == 0) {
33924
+ ic.lines['cylinder'] = []; // reset
33925
+ //ic.drawCls.draw();
33926
+ }
33863
33927
  else if(commandOri.indexOf('add label') == 0) {
33864
33928
  let paraArray = commandOri.split(' | ');
33865
33929
  let text = paraArray[0].substr(('add label').length + 1);
@@ -34383,6 +34447,11 @@ class ApplyCommand {
34383
34447
  else if(command.indexOf('ig refnum off') == 0) {
34384
34448
  ic.refnumCls.hideIgRefNum();
34385
34449
  }
34450
+ else if(command.indexOf('custom refnum') == 0) {
34451
+ let paraArray = commandOri.split(' | ');
34452
+ let dataStr = paraArray[1].replace(/\\n/g, '\n');
34453
+ ic.refnumCls.parseCustomRefFile(dataStr);
34454
+ }
34386
34455
 
34387
34456
  // special, select ==========
34388
34457
 
@@ -34428,7 +34497,8 @@ class ApplyCommand {
34428
34497
 
34429
34498
  ic.selByCommCls.selectByCommand(select, commandname, commanddesc);
34430
34499
  }
34431
- else if(command.indexOf('select $') !== -1 || command.indexOf('select .') !== -1 || command.indexOf('select :') !== -1 || command.indexOf('select @') !== -1) {
34500
+ else if(command.indexOf('select $') !== -1 || command.indexOf('select .') !== -1 || command.indexOf('select :') !== -1
34501
+ || command.indexOf('select %') !== -1 || command.indexOf('select @') !== -1) {
34432
34502
  let paraArray = commandOri.split(' | '); // atom names might be case-sensitive
34433
34503
 
34434
34504
  let select = paraArray[0].substr(paraArray[0].indexOf(' ') + 1);
@@ -34553,6 +34623,28 @@ class ApplyCommand {
34553
34623
  }
34554
34624
  }
34555
34625
 
34626
+ addShape(command, shape) { let ic = this.icn3d, me = ic.icn3dui;
34627
+ ic.shapeCmdHash[command] = 1;
34628
+
34629
+ let paraArray = command.split(' | ');
34630
+ let p1Array = paraArray[1].split(' ');
34631
+ let colorStr = paraArray[2].substr(paraArray[2].lastIndexOf(' ') + 1);
34632
+ let opacity = paraArray[3].substr(paraArray[3].lastIndexOf(' ') + 1);
34633
+ let radius = paraArray[4].substr(paraArray[4].lastIndexOf(' ') + 1);
34634
+
34635
+ colorStr = '#' + colorStr.replace(/\#/g, '');
34636
+ let color = me.parasCls.thr(colorStr);
34637
+
34638
+ let pos1 = new THREE.Vector3(parseFloat(p1Array[1]), parseFloat(p1Array[3]), parseFloat(p1Array[5]));
34639
+
34640
+ if(shape == 'sphere') {
34641
+ ic.sphereCls.createSphereBase(pos1, color, parseFloat(radius), undefined, undefined, undefined, parseFloat(opacity));
34642
+ }
34643
+ else { // 'cube'
34644
+ ic.boxCls.createBox_base(pos1, parseFloat(radius), color, undefined, undefined, undefined, parseFloat(opacity));
34645
+ }
34646
+ }
34647
+
34556
34648
  getMenuFromCmd(cmd) { let ic = this.icn3d; ic.icn3dui;
34557
34649
  cmd = cmd.trim();
34558
34650
 
@@ -34779,7 +34871,6 @@ class SelectByCommand {
34779
34871
  }
34780
34872
  else { // union
34781
34873
  ic.applyCommandCls.applyCommand('select ' + command);
34782
-
34783
34874
  allHighlightAtoms = me.hashUtilsCls.unionHash(allHighlightAtoms, ic.hAtoms);
34784
34875
  }
34785
34876
  }
@@ -34807,7 +34898,6 @@ class SelectByCommand {
34807
34898
  // There will be no ' or ' in the spec. It's already separated in selectByCommand()
34808
34899
  // There could be ' and ' in the spec.
34809
34900
  let commandArray = select.replace(/\s+/g, ' ').replace(/ AND /g, ' and ').split(' and ');
34810
-
34811
34901
  let residueHash = {};
34812
34902
  let atomHash = {};
34813
34903
 
@@ -34824,9 +34914,10 @@ class SelectByCommand {
34824
34914
  let dollarPos = commandArray[i].indexOf('$');
34825
34915
  let periodPos = commandArray[i].indexOf('.');
34826
34916
  let colonPos = commandArray[i].indexOf(':');
34917
+ let colonPos2 = commandArray[i].indexOf('%'); // for reference numbers
34827
34918
  let atPos = commandArray[i].indexOf('@');
34828
34919
 
34829
- let moleculeStr, chainStr, residueStr, atomStrArray;
34920
+ let moleculeStr, chainStr, residueStr, refResStr, atomStrArray;
34830
34921
  let testStr = commandArray[i];
34831
34922
 
34832
34923
  if(atPos === -1) {
@@ -34837,13 +34928,17 @@ class SelectByCommand {
34837
34928
  testStr = testStr.substr(0, atPos);
34838
34929
  }
34839
34930
 
34840
- if(colonPos === -1) {
34931
+ if(colonPos === -1 && colonPos2 === -1 ) {
34841
34932
  residueStr = "*";
34842
34933
  }
34843
- else {
34934
+ else if(colonPos != -1) {
34844
34935
  residueStr = testStr.substr(colonPos + 1);
34845
34936
  testStr = testStr.substr(0, colonPos);
34846
34937
  }
34938
+ else if(colonPos2 != -1) {
34939
+ refResStr = testStr.substr(colonPos2 + 1);
34940
+ testStr = testStr.substr(0, colonPos2);
34941
+ }
34847
34942
 
34848
34943
  if(periodPos === -1) {
34849
34944
  chainStr = "*";
@@ -34900,7 +34995,9 @@ class SelectByCommand {
34900
34995
  }
34901
34996
  }
34902
34997
 
34903
- let residueStrArray = residueStr.split(',');
34998
+ let bRefnum = (refResStr) ? true : false;
34999
+ let residueStrArray = (bRefnum) ? refResStr.split(',') : residueStr.split(',');
35000
+
34904
35001
  for(let j = 0, jl = residueStrArray.length; j < jl; ++j) {
34905
35002
  let bResidueId = false;
34906
35003
 
@@ -34919,7 +35016,7 @@ class SelectByCommand {
34919
35016
  }
34920
35017
  else {
34921
35018
  //if(residueStrArray[j].length > 1 && residueStrArray[j][0] === '3' && (residueStrArray[j].length - 1) % 3 === 0) { // three letter residue string, such as :3LysArg
34922
- if(residueStrArray[j].length > 1 && residueStrArray[j][0] === '3'
35019
+ if(!bRefnum && residueStrArray[j].length > 1 && residueStrArray[j][0] === '3'
34923
35020
  && isNaN(residueStrArray[j][1]) && residueStrArray[j][0] !== '-') { // three letter residue string, such as :3LysArg or :3ZN, but not :30 neither :3-10
34924
35021
  let tmpStr = residueStrArray[j].toUpperCase();
34925
35022
  threeLetterResidueStr = tmpStr.substr(1);
@@ -34952,35 +35049,52 @@ class SelectByCommand {
34952
35049
  start = !isNaN(start) ? parseInt(start) : start;
34953
35050
  end = !isNaN(end) ? parseInt(end) : end;
34954
35051
  for(let k = start; k <= end; ++k) {
34955
- let residueId = molecule_chain + '_' + k;
34956
- if(i === 0) {
34957
- residueHash[residueId] = 1;
35052
+ let residArray = [];
35053
+
35054
+ if(bRefnum) {
35055
+ let residArrayTmp = ic.refnum2residArray[k];
35056
+ for(let m = 0, ml = residArrayTmp.length; m < ml; ++m) {
35057
+ let residueId = residArrayTmp[m];
35058
+ if(residueId.substr(0, residueId.lastIndexOf('_')) == molecule_chain) {
35059
+ residArray.push(residueId);
35060
+ }
35061
+ }
34958
35062
  }
34959
35063
  else {
34960
- // if not exit previously, "and" operation will remove this one
34961
- //if(!residueHash.hasOwnProperty(residueId)) residueHash[residueId] = undefined;
34962
- if(!residueHash.hasOwnProperty(residueId)) delete residueHash[residueId];
35064
+ let residueId = molecule_chain + '_' + k;
35065
+ residArray = [residueId];
34963
35066
  }
34964
35067
 
34965
- for(let m in ic.residues[residueId]) {
34966
- for(let n = 0, nl = atomStrArray.length; n < nl; ++n) {
34967
- let atomStr = atomStrArray[n];
34968
- if(atomStr === '*' || atomStr === ic.atoms[m].name) {
34969
- if(i === 0) {
34970
- //currHighlightAtoms[m] = 1;
34971
- atomHash[m] = 1;
34972
- }
34973
- else {
34974
- //if(!currHighlightAtoms.hasOwnProperty(m)) currHighlightAtoms[m] = undefined;
34975
- //if(!atomHash.hasOwnProperty(m)) atomHash[m] = undefined;
34976
- if(!atomHash.hasOwnProperty(m)) delete atomHash[m];
34977
- }
34978
- }
34979
- }
34980
- }
34981
- } // end for
35068
+ for(let l = 0, ll = residArray.length; l < ll; ++l) {
35069
+ let residueId = residArray[l];
34982
35070
 
35071
+ if(i === 0) {
35072
+ residueHash[residueId] = 1;
35073
+ }
35074
+ else {
35075
+ // if not exit previously, "and" operation will remove this one
35076
+ //if(!residueHash.hasOwnProperty(residueId)) residueHash[residueId] = undefined;
35077
+ if(!residueHash.hasOwnProperty(residueId)) delete residueHash[residueId];
35078
+ }
34983
35079
 
35080
+ for(let m in ic.residues[residueId]) {
35081
+ for(let n = 0, nl = atomStrArray.length; n < nl; ++n) {
35082
+ let atomStr = atomStrArray[n];
35083
+ if(atomStr === '*' || atomStr === ic.atoms[m].name) {
35084
+ if(i === 0) {
35085
+ //currHighlightAtoms[m] = 1;
35086
+ atomHash[m] = 1;
35087
+ }
35088
+ else {
35089
+ //if(!currHighlightAtoms.hasOwnProperty(m)) currHighlightAtoms[m] = undefined;
35090
+ //if(!atomHash.hasOwnProperty(m)) atomHash[m] = undefined;
35091
+ if(!atomHash.hasOwnProperty(m)) delete atomHash[m];
35092
+ }
35093
+ }
35094
+ }
35095
+ }
35096
+ } // end for(let l = 0,
35097
+ } // end for
34984
35098
  }
34985
35099
  else {
34986
35100
  if(molecule_chain in ic.chains) {
@@ -36860,7 +36974,7 @@ class ParserUtils {
36860
36974
  me.htmlCls.clickMenuCls.setLogCmd("realignment RMSD: " + rmsd.toPrecision(4), false);
36861
36975
  let html = "<br><b>Realignment RMSD</b>: " + rmsd.toPrecision(4) + " &#8491;<br><br>";
36862
36976
  if(ic.bAfMem) {
36863
- if(window.dialog) window.dialog.dialog( "close" );
36977
+ //if(window.dialog) window.dialog.dialog( "close" );
36864
36978
  html += "<span style='color:red'>Red</span> and <span style='color:blue'>blue</span> membranes indicate <span style='color:red'>extracellular</span> and <span style='color:blue'>intracellular</span> membranes, respectively.<br><br>";
36865
36979
  }
36866
36980
  $("#" + ic.pre + "dl_rmsd").html(html);
@@ -44512,7 +44626,8 @@ class ApplyDisplay {
44512
44626
  let lineRadius = parseFloat(me.htmlCls.setHtmlCls.getCookie('lineRadius'));
44513
44627
  let coilWidth = parseFloat(me.htmlCls.setHtmlCls.getCookie('coilWidth'));
44514
44628
  let cylinderRadius = parseFloat(me.htmlCls.setHtmlCls.getCookie('cylinderRadius'));
44515
- let crosslinkRadius = parseFloat(me.htmlCls.setHtmlCls.getCookie('crosslinkRadius'));
44629
+ let clRad = me.htmlCls.setHtmlCls.getCookie('crosslinkRadius');
44630
+ let crosslinkRadius = (!isNaN(clRad)) ? parseFloat(clRad) : ic.crosslinkRadius;
44516
44631
  let traceRadius = parseFloat(me.htmlCls.setHtmlCls.getCookie('traceRadius'));
44517
44632
  let dotSphereScale = parseFloat(me.htmlCls.setHtmlCls.getCookie('dotSphereScale'));
44518
44633
  let ribbonthickness = parseFloat(me.htmlCls.setHtmlCls.getCookie('ribbonthickness'));
@@ -45313,6 +45428,16 @@ class ApplyOther {
45313
45428
  ic.glycanCls.showGlycans();
45314
45429
  }
45315
45430
 
45431
+ // add extra spheres or cubes
45432
+ for(let command in ic.shapeCmdHash) {
45433
+ if(command.substr(0, 8) == 'add cube') {
45434
+ ic.applyCommandCls.addShape(command, 'cube');
45435
+ }
45436
+ else { // 'add sphere'
45437
+ ic.applyCommandCls.addShape(command, 'sphere');
45438
+ }
45439
+ }
45440
+
45316
45441
  ic.applyCenterCls.applyCenterOptions(options);
45317
45442
 
45318
45443
  ic.axesCls.buildAllAxes(undefined, true);
@@ -53005,7 +53130,7 @@ class Draw {
53005
53130
 
53006
53131
  // show membranes
53007
53132
  if(ic.bOpm) {
53008
- if(window.dialog) window.dialog.dialog( "close" );
53133
+ //if(window.dialog) window.dialog.dialog( "close" );
53009
53134
 
53010
53135
  let html = "<br><span style='color:red'>Red</span> and <span style='color:blue'>blue</span> membranes indicate <span style='color:red'>extracellular</span> and <span style='color:blue'>intracellular</span> membranes, respectively.<br><br>";
53011
53136
  $("#" + ic.pre + "dl_rmsd").html(html);
@@ -54355,22 +54480,22 @@ class ClickMenu {
54355
54480
  }
54356
54481
  }
54357
54482
 
54358
- setSetsMenus(bTable) { let me = this.icn3dui, ic = me.icn3d;
54483
+ setSetsMenus(id, bOneset) { let me = this.icn3dui, ic = me.icn3d;
54359
54484
  this.SetChainsAdvancedMenu();
54360
54485
 
54361
- let id1 = (bTable) ? 'atomsCustomDistTable' : 'atomsCustomDist';
54362
- let id2 = (bTable) ? 'atomsCustomDistTable2' : 'atomsCustomDist2';
54486
+ let id1 = id;
54487
+ let id2 = id + '2';
54363
54488
 
54364
54489
  let definedAtomsHtml = ic.definedSetsCls.setAtomMenu(['protein']);
54365
54490
  if($("#" + me.pre + id1).length) {
54366
54491
  $("#" + me.pre + id1).html(" <option value='selected'>selected</option>" + definedAtomsHtml);
54367
54492
  }
54368
- if($("#" + me.pre + id2).length) {
54493
+ if(!bOneset && $("#" + me.pre + id2).length) {
54369
54494
  $("#" + me.pre + id2).html(" <option value='selected' selected>selected</option>" + definedAtomsHtml);
54370
54495
  }
54371
54496
 
54372
54497
  $("#" + me.pre + id1).resizable();
54373
- $("#" + me.pre + id2).resizable();
54498
+ if(!bOneset) $("#" + me.pre + id2).resizable();
54374
54499
  }
54375
54500
 
54376
54501
  applyShownMenus() { let me = this.icn3dui; me.icn3d;
@@ -55740,6 +55865,35 @@ class ClickMenu {
55740
55865
 
55741
55866
  ic.addTrackCls.setCustomFile('color', ic.startColor, ic.midColor, ic.endColor);
55742
55867
  });
55868
+
55869
+ me.myEventCls.onIds("#" + me.pre + "mn6_customref", "click", function(e) { me.icn3d; e.preventDefault();
55870
+ //e.preventDefault();
55871
+ me.htmlCls.dialogCls.openDlg('dl_customref', 'Set custom reference numbers');
55872
+ });
55873
+
55874
+ me.myEventCls.onIds("#" + me.pre + "reload_customreffile", "click", function(e) { let ic = me.icn3d; e.preventDefault();
55875
+ //e.preventDefault();
55876
+ if(!me.cfg.notebook) dialog.dialog( "close" );
55877
+
55878
+ let file = $("#" + ic.pre + "cstreffile")[0].files[0];
55879
+ if(!file) {
55880
+ var aaa = 1; //alert("Please select a file before clicking 'Apply'");
55881
+ }
55882
+ else {
55883
+ me.utilsCls.checkFileAPI();
55884
+ let reader = new FileReader();
55885
+ reader.onload = function(e) {
55886
+ let dataStr = e.target.result; // or = reader.result;
55887
+ ic.refnumCls.parseCustomRefFile(dataStr);
55888
+
55889
+ dataStr = dataStr.replace(/\r/g, '').replace(/\n/g, '\\n');
55890
+
55891
+ thisClass.setLogCmd('custom refnum | ' + dataStr, true);
55892
+ };
55893
+ reader.readAsText(file);
55894
+ }
55895
+ });
55896
+
55743
55897
  me.myEventCls.onIds("#" + me.pre + "remove_legend", "click", function(e) { me.icn3d; e.preventDefault();
55744
55898
  //e.preventDefault();
55745
55899
  $("#" + me.pre + "legend").hide();
@@ -56225,7 +56379,7 @@ class ClickMenu {
56225
56379
  me.myEventCls.onIds("#" + me.pre + "mn6_distTwoSets", "click", function(e) { let ic = me.icn3d; e.preventDefault();
56226
56380
  me.htmlCls.dialogCls.openDlg('dl_disttwosets', 'Measure the distance between two sets');
56227
56381
 
56228
- thisClass.setSetsMenus();
56382
+ thisClass.setSetsMenus('atomsCustomDist');
56229
56383
 
56230
56384
  ic.bMeasureDistance = true;
56231
56385
  });
@@ -56233,7 +56387,7 @@ class ClickMenu {
56233
56387
  me.myEventCls.onIds("#" + me.pre + "mn6_distManySets", "click", function(e) { let ic = me.icn3d; e.preventDefault();
56234
56388
  me.htmlCls.dialogCls.openDlg('dl_distmanysets', 'Measure the pairwise distance among many sets');
56235
56389
 
56236
- thisClass.setSetsMenus(true);
56390
+ thisClass.setSetsMenus('atomsCustomDistTable');
56237
56391
 
56238
56392
  ic.bMeasureDistance = true;
56239
56393
  });
@@ -56249,6 +56403,24 @@ class ClickMenu {
56249
56403
  ic.pk = 2;
56250
56404
  ic.drawCls.draw();
56251
56405
  });
56406
+
56407
+ me.myEventCls.onIds("#" + me.pre + "mn5_cartoonshape", "click", function(e) { let ic = me.icn3d; e.preventDefault();
56408
+ me.htmlCls.dialogCls.openDlg('dl_cartoonshape', 'Draw cartoon for a set');
56409
+
56410
+ let bOneset = true;
56411
+ thisClass.setSetsMenus('cartoonshape', bOneset);
56412
+
56413
+ ic.bCartoonshape = true;
56414
+ });
56415
+
56416
+ me.myEventCls.onIds("#" + me.pre + "mn5_linebtwsets", "click", function(e) { let ic = me.icn3d; e.preventDefault();
56417
+ me.htmlCls.dialogCls.openDlg('dl_linebtwsets', 'Draw a line between two sets');
56418
+
56419
+ thisClass.setSetsMenus('linebtwsets');
56420
+
56421
+ ic.bLinebtwsets = true;
56422
+ });
56423
+
56252
56424
  // },
56253
56425
  // clkMn2_selectedcenter: function() {
56254
56426
  me.myEventCls.onIds(["#" + me.pre + "mn2_selectedcenter", "#" + me.pre + "zoomin_selection", "#" + me.pre + "tool_selectedcenter"], "click", function(e) { let ic = me.icn3d; e.preventDefault();
@@ -57912,6 +58084,11 @@ class SetMenu {
57912
58084
  html += "</ul>";
57913
58085
  html += "</li>";
57914
58086
 
58087
+ html += me.htmlCls.setHtmlCls.getMenuSep();
58088
+
58089
+ html += me.htmlCls.setHtmlCls.getLink('mn5_cartoonshape', 'Cartoon for a Set', undefined, 1);
58090
+ html += me.htmlCls.setHtmlCls.getLink('mn5_linebtwsets', 'Line btw. Two Sets', undefined, 1);
58091
+
57915
58092
  if(me.cfg.cid === undefined && me.cfg.align === undefined && me.cfg.chainalign === undefined && me.cfg.mmdbaf === undefined) {
57916
58093
  html += me.htmlCls.setHtmlCls.getMenuSep();
57917
58094
 
@@ -57920,13 +58097,13 @@ class SetMenu {
57920
58097
  html += me.htmlCls.setHtmlCls.getLinkWrapper2('mn5_map', 'Electron Density', 'mapWrapper1', undefined, 1);
57921
58098
 
57922
58099
  html += "<ul>";
57923
- html += me.htmlCls.setHtmlCls.getRadio('mn5_elecmap', 'mn5_elecmap2fofc', '2Fo-Fc Map', undefined, undefined, 2);
57924
- html += me.htmlCls.setHtmlCls.getRadio('mn5_elecmap', 'mn5_elecmapfofc', 'Fo-Fc Map', undefined, undefined, 2);
58100
+ html += me.htmlCls.setHtmlCls.getLink('mn5_elecmap2fofc', '2Fo-Fc Map', undefined, 2);
58101
+ html += me.htmlCls.setHtmlCls.getLink('mn5_elecmapfofc', 'Fo-Fc Map', undefined, 2);
58102
+ html += me.htmlCls.setHtmlCls.getLinkWrapper('mn5_elecmapNo', 'Remove Map', 'mapWrapper2', undefined, undefined, 2);
58103
+
57925
58104
  html += "</ul>";
57926
58105
  html += "</li>";
57927
58106
 
57928
- html += me.htmlCls.setHtmlCls.getLinkWrapper('mn5_elecmapNo', 'Remove Map', 'mapWrapper2', undefined, 1);
57929
-
57930
58107
  //html += "<li id='" + me.pre + "mapWrapper3'><span>Map Wireframe</span>";
57931
58108
  //html += me.htmlCls.setHtmlCls.getMenuText('mapWrapper3', 'Map Wireframe', undefined, undefined, 1);
57932
58109
  html += me.htmlCls.setHtmlCls.getLinkWrapper2('mn5_map3', 'Map Wireframe', 'mapWrapper3', undefined, 1);
@@ -57966,7 +58143,7 @@ class SetMenu {
57966
58143
  html += "</ul>";
57967
58144
  html += "</li>";
57968
58145
 
57969
- html += "<li><span>Dialog Color</span>";
58146
+ //html += "<li><span>Dialog Color</span>";
57970
58147
  html += me.htmlCls.setHtmlCls.getMenuText('mn6_themewrap', 'Dialog Color', undefined, undefined, 1);
57971
58148
  html += "<ul>";
57972
58149
  html += me.htmlCls.setHtmlCls.getRadio('mn6_theme', 'mn6_themeBlue', 'Blue', true, undefined, 2);
@@ -58519,15 +58696,20 @@ class SetMenu {
58519
58696
 
58520
58697
  html += "</ul>";
58521
58698
  html += "</li>";
58522
- /*
58523
- html += me.htmlCls.setHtmlCls.getMenuText('mn6_igrefwrap', 'Ig Ref. Number', undefined, undefined, 1);
58699
+
58700
+ html += me.htmlCls.setHtmlCls.getMenuText('mn6_igrefwrap', 'Ref. Number', undefined, undefined, 1);
58524
58701
 
58525
58702
  html += "<ul>";
58526
- html += me.htmlCls.setHtmlCls.getRadio('mn6_igref', 'mn6_igrefYes', 'Show', undefined, undefined, 2);
58527
- html += me.htmlCls.setHtmlCls.getRadio('mn6_igref', 'mn6_igrefNo', 'Hide', true, undefined, 2);
58703
+ /*
58704
+ html += me.htmlCls.setHtmlCls.getLink('mn6_igrefYes', 'Show Ig Ref. Number', undefined, 2);
58705
+ html += me.htmlCls.setHtmlCls.getLink('mn6_igrefNo', 'Hide Ig Ref. Number', undefined, 2);
58706
+
58707
+ html += me.htmlCls.setHtmlCls.getMenuSep();
58708
+ */
58709
+ html += me.htmlCls.setHtmlCls.getLink('mn6_customref', 'Custom Ref. Number', undefined, 2);
58528
58710
  html += "</ul>";
58529
58711
  html += "</li>";
58530
- */
58712
+
58531
58713
  html += me.htmlCls.setHtmlCls.getMenuSep();
58532
58714
  }
58533
58715
 
@@ -59531,6 +59713,18 @@ class SetDialog {
59531
59713
 
59532
59714
  html += "</div>";
59533
59715
 
59716
+ html += me.htmlCls.divStr + "dl_customref' class='" + dialogClass + "'>";
59717
+ html += '<div style="width:550px;">You can define your own reference numbers in a custom file using Excel, and then export it as a CSV file. An example file is shown below with cells separated by commas.<br>';
59718
+ html += '<pre>refnum,11,12,,21,22<br>';
59719
+ html += '1TUP_A,100,101,,,132<br>';
59720
+ html += '1TUP_B,110,111,,141,142</pre>';
59721
+ html += 'The first row defines the reference residue numbers. The 1st cell could be anything. The rest cells are reference residue numbers (e.g., 11, 12, 21, 22) or empty cells. Each chain has a separate row. The first cell of the second row is the chain ID "1TUP_A". The rest cells are the corresponding real residue numbers for reference residue numbers in the first row. For example, the reference numbers for residues 100, 101, and 132 in the chain 1TUP_A are 11, 12, and 22, respectively. The thrid row shows the real residue numbers for the chain "1TUP_B".<br><br>';
59722
+ html += 'To select all residues corresponding to the reference numbers, you can simplay replace ":" with "%" in the <a href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#selectb" target="_blank">Specification</a>. For example, "%12" selects the residue 101 in 1TUP_A and the residue 111 in 1TUP_B. ".A%12" has the chain "A" filter and selects the residue 101 in 1TUP_A.<br>';
59723
+ html += '</div><br>';
59724
+ html += "Custom File: " + me.htmlCls.inputFileStr + "id='" + me.pre + "cstreffile' size=8> <br><br>";
59725
+ html += me.htmlCls.buttonStr + "reload_customreffile'>Apply Custom Reference Numbers</button>";
59726
+ html += "</div>";
59727
+
59534
59728
  html += me.htmlCls.divStr + "dl_align' class='" + dialogClass + "'>";
59535
59729
  html += "Enter the PDB IDs or MMDB IDs of the structures: <br/><br/>ID1: " + me.htmlCls.inputTextStr + "id='" + me.pre + "alignid1' value='1HHO' size=8>" + me.htmlCls.space3 + me.htmlCls.space3 + "ID2: " + me.htmlCls.inputTextStr + "id='" + me.pre + "alignid2' value='4N7N' size=8><br/><br/>";
59536
59730
  html += "<b>VAST+ based on VAST</b>: " + me.htmlCls.buttonStr + "reload_align_ori'>All Matching Molecules Superposed</button>" + me.htmlCls.space3 + me.htmlCls.buttonStr + "reload_align_refined'>Invariant Substructure Superposed</button><br><br>";
@@ -59654,8 +59848,8 @@ class SetDialog {
59654
59848
  html += "</div>";
59655
59849
 
59656
59850
  html += me.htmlCls.divStr + "dl_mmdbafid' class='" + dialogClass + "' style='max-width:500px'>";
59657
- html += "List of PDB, MMDB, or AlphaFold UniProt IDs: " + me.htmlCls.inputTextStr + "id='" + me.pre + "mmdbafid' value='1HHO,4N7N,P69905,P01942' size=30> <br><br>";
59658
- html += me.htmlCls.buttonStr + "reload_mmdbaf_asym'>Load Asymmetric Unit (All Chains)</button>" + me.htmlCls.buttonStr + "reload_mmdbaf' style='margin-left:30px'>Load Biological Unit</button><br/><br/><br>";
59851
+ html += "List of PDB, MMDB, or AlphaFold UniProt IDs: " + me.htmlCls.inputTextStr + "id='" + me.pre + "mmdbafid' placeholder='e.g., 1HHO,4N7N,P69905,P01942' size=30> <br><br>";
59852
+ html += me.htmlCls.buttonStr + "reload_mmdbaf'>Load Biological Unit</button>" + me.htmlCls.buttonStr + "reload_mmdbaf_asym' style='margin-left:30px'>Load Asymmetric Unit (All Chains)</button>" + "<br/><br/><br>";
59659
59853
  html += '<b>Note</b>: The "<b>biological unit</b>" is the <b>biochemically active form of a biomolecule</b>, <div style="width:20px; margin:6px 0 0 20px; display:inline-block;"><span id="'
59660
59854
  + me.pre + 'asu_bu2_expand" class="ui-icon ui-icon-plus icn3d-expand icn3d-link" style="width:15px;" title="Expand"></span><span id="'
59661
59855
  + me.pre + 'asu_bu2_shrink" class="ui-icon ui-icon-minus icn3d-shrink icn3d-link" style="display:none; width:15px;" title="Shrink"></span></div>';
@@ -60198,6 +60392,62 @@ class SetDialog {
60198
60392
  html += me.htmlCls.spanNowrapStr + "3. " + me.htmlCls.buttonStr + "applydist2'>Display</button></span>";
60199
60393
  html += "</div>";
60200
60394
 
60395
+
60396
+ html += me.htmlCls.divStr + "dl_linebtwsets' class='" + dialogClass + "'>";
60397
+ html += me.htmlCls.spanNowrapStr + "1. Select two sets</span><br/>";
60398
+ html += "<table border=0 width=400 cellspacing=10><tr><td>";
60399
+
60400
+ html += me.htmlCls.divNowrapStr + "First set:</div>";
60401
+ html += "<div style='text-indent:1.1em'><select style='max-width:200px' id='" + me.pre + "linebtwsets2' multiple size='5' style='min-width:130px;'>";
60402
+ html += "</select></div>";
60403
+
60404
+ html += "</td><td>";
60405
+
60406
+ html += me.htmlCls.divNowrapStr + "Second set:</div>";
60407
+ html += "<div style='text-indent:1.1em'><select style='max-width:200px' id='" + me.pre + "linebtwsets' multiple size='5' style='min-width:130px;'>";
60408
+ html += "</select></div>";
60409
+
60410
+ html += "</td></tr></table>";
60411
+
60412
+ html += me.htmlCls.divNowrapStr + "2. Line style: <select id='" + me.pre + "linebtwsets_style'>";
60413
+ html += me.htmlCls.setHtmlCls.getOptionHtml(['Solid', 'Dashed'], 0);
60414
+ html += "</select></div><br>";
60415
+
60416
+ html += "3. Line radius: " + me.htmlCls.inputTextStr + "id='" + me.pre + "linebtwsets_radius' value='0.4' size=4><br/><br/>";
60417
+
60418
+ html += "4. Color: " + me.htmlCls.inputTextStr + "id='" + me.pre + "linebtwsets_customcolor' value='" + defaultColor + "' size=4><br/><br/>";
60419
+
60420
+ html += me.htmlCls.divNowrapStr + "5. Opacity: <select id='" + me.pre + "linebtwsets_opacity'>";
60421
+ html += me.htmlCls.setHtmlCls.getOptionHtml(['1.0', '0.9', '0.8', '0.7', '0.6', '0.5', '0.4', '0.3', '0.2', '0.1'], 7);
60422
+ html += "</select></div><br>";
60423
+
60424
+ html += me.htmlCls.spanNowrapStr + "6. " + me.htmlCls.buttonStr + "applylinebtwsets'>Display</button></span>";
60425
+ html += me.htmlCls.space3 + me.htmlCls.spanNowrapStr + me.htmlCls.buttonStr + "clearlinebtwsets'>Clear</button></span>";
60426
+ html += "</div>";
60427
+
60428
+
60429
+ html += me.htmlCls.divStr + "dl_cartoonshape' class='" + dialogClass + "'>";
60430
+ html += me.htmlCls.spanNowrapStr + "1. Select a set:</span><br/>";
60431
+ html += "<div style='text-indent:1.1em'><select style='max-width:200px' id='" + me.pre + "cartoonshape' multiple size='5' style='min-width:130px;'>";
60432
+ html += "</select></div><br>";
60433
+
60434
+ html += me.htmlCls.divNowrapStr + "2. Shape: <select id='" + me.pre + "cartoonshape_shape'>";
60435
+ html += me.htmlCls.setHtmlCls.getOptionHtml(['Sphere', 'Cube'], 0);
60436
+ html += "</select></div><br>";
60437
+
60438
+ html += "3. Radius: " + me.htmlCls.inputTextStr + "id='" + me.pre + "cartoonshape_radius' value='1.5' size=4><br/><br/>";
60439
+
60440
+ html += "4. Color: " + me.htmlCls.inputTextStr + "id='" + me.pre + "cartoonshape_customcolor' value='" + defaultColor + "' size=4><br/><br/>";
60441
+
60442
+ html += me.htmlCls.divNowrapStr + "5. Opacity: <select id='" + me.pre + "cartoonshape_opacity'>";
60443
+ html += me.htmlCls.setHtmlCls.getOptionHtml(['1.0', '0.9', '0.8', '0.7', '0.6', '0.5', '0.4', '0.3', '0.2', '0.1'], 7);
60444
+ html += "</select></div><br>";
60445
+
60446
+ html += me.htmlCls.spanNowrapStr + "6. " + me.htmlCls.buttonStr + "applycartoonshape'>Display</button></span>";
60447
+ html += me.htmlCls.space3 + me.htmlCls.spanNowrapStr + me.htmlCls.buttonStr + "clearcartoonshape'>Clear</button></span>";
60448
+ html += "</div>";
60449
+
60450
+
60201
60451
  html += me.htmlCls.divStr + "dl_distmanysets' class='" + dialogClass + "'>";
60202
60452
  html += me.htmlCls.spanNowrapStr + "1. Select sets for pairwise distances</span><br/>";
60203
60453
  html += "<table border=0 width=400 cellspacing=10><tr><td>";
@@ -60520,7 +60770,8 @@ class Events {
60520
60770
 
60521
60771
  searchSeq() { let me = this.icn3dui, ic = me.icn3d;
60522
60772
  let select = $("#" + me.pre + "search_seq").val();
60523
- if(isNaN(select) && select.indexOf('$') == -1 && select.indexOf('.') == -1 && select.indexOf(':') == -1 && select.indexOf('@') == -1) {
60773
+ if(isNaN(select) && select.indexOf('$') == -1 && select.indexOf('.') == -1 && select.indexOf(':') == -1
60774
+ && select.indexOf('%') == -1 && select.indexOf('@') == -1) {
60524
60775
  select = ':' + select;
60525
60776
  }
60526
60777
  let commandname = select.replace(/\s+/g, '_');
@@ -60647,7 +60898,14 @@ class Events {
60647
60898
  launchMmdb(ids, bBiounit, hostUrl) { let me = this.icn3dui; me.icn3d;
60648
60899
  let flag = bBiounit ? '1' : '0';
60649
60900
 
60650
- let idArray = ids.split(',');
60901
+ ids = ids.replace(/,/g, ' ').replace(/\s+/g, ' ').trim();
60902
+
60903
+ if(!ids) {
60904
+ var aaa = 1; //alert("Please enter a list of PDB IDs or AlphaFold UniProt IDs...");
60905
+ return;
60906
+ }
60907
+
60908
+ let idArray = ids.split(' ');
60651
60909
  if(idArray.length == 1 && (idArray[0].length == 4 || !isNaN(idArray[0])) ) {
60652
60910
  me.htmlCls.clickMenuCls.setLogCmd("load mmdb" + flag + " " + ids, false);
60653
60911
  window.open(hostUrl + '?mmdbid=' + ids + '&bu=' + flag, '_blank');
@@ -61429,7 +61687,7 @@ class Events {
61429
61687
  //if(!me.cfg.notebook) dialog.dialog( "close" );
61430
61688
 
61431
61689
  // remove space
61432
- let ids = $("#" + me.pre + "mmdbafid").val().replace(/\s+/g, '');
61690
+ let ids = $("#" + me.pre + "mmdbafid").val();
61433
61691
 
61434
61692
  thisClass.launchMmdb(ids, 1, hostUrl);
61435
61693
  });
@@ -61439,7 +61697,7 @@ class Events {
61439
61697
  //if(!me.cfg.notebook) dialog.dialog( "close" );
61440
61698
 
61441
61699
  // remove space
61442
- let ids = $("#" + me.pre + "mmdbafid").val().replace(/\s+/g, '');
61700
+ let ids = $("#" + me.pre + "mmdbafid").val();
61443
61701
  thisClass.launchMmdb(ids, 0, hostUrl);
61444
61702
  });
61445
61703
 
@@ -61447,8 +61705,8 @@ class Events {
61447
61705
  if (e.keyCode === 13) {
61448
61706
  e.preventDefault();
61449
61707
  //if(!me.cfg.notebook) dialog.dialog( "close" );
61450
- me.htmlCls.clickMenuCls.setLogCmd("load mmdb0 " + $("#" + me.pre + "mmdbid").val(), false);
61451
- window.open(hostUrl + '?mmdbid=' + $("#" + me.pre + "mmdbid").val() + '&bu=0', '_blank');
61708
+ me.htmlCls.clickMenuCls.setLogCmd("load mmdb1 " + $("#" + me.pre + "mmdbid").val(), false);
61709
+ window.open(hostUrl + '?mmdbid=' + $("#" + me.pre + "mmdbid").val() + '&bu=1', '_blank');
61452
61710
  }
61453
61711
  });
61454
61712
 
@@ -61456,8 +61714,8 @@ class Events {
61456
61714
  if (e.keyCode === 13) {
61457
61715
  e.preventDefault();
61458
61716
 
61459
- let ids = $("#" + me.pre + "mmdbafid").val().replace(/\s+/g, '');
61460
- thisClass.launchMmdb(ids, 0, hostUrl);
61717
+ let ids = $("#" + me.pre + "mmdbafid").val();
61718
+ thisClass.launchMmdb(ids, 1, hostUrl);
61461
61719
  }
61462
61720
  });
61463
61721
 
@@ -62296,19 +62554,25 @@ class Events {
62296
62554
  me.myEventCls.onIds("#" + me.alignerrormapid + "_svg", "click", function(e) { let ic = me.icn3d;
62297
62555
  e.preventDefault();
62298
62556
  //if(!me.cfg.notebook) dialog.dialog( "close" );
62557
+ let scale = 1;
62558
+ $("#" + me.alignerrormapid + "_scale").val(scale);
62559
+ $("#" + me.alignerrormapid).attr("width",(ic.alignerrormapWidth * parseFloat(scale)).toString() + "px");
62560
+
62299
62561
  ic.saveFileCls.saveSvg(me.alignerrormapid, ic.inputid + "_alignerrormap.svg", true);
62300
62562
  });
62301
62563
  me.myEventCls.onIds("#" + me.alignerrormapid + "_png", "click", function(e) { let ic = me.icn3d;
62302
62564
  e.preventDefault();
62303
62565
  //if(!me.cfg.notebook) dialog.dialog( "close" );
62566
+ let scale = 1;
62567
+ $("#" + me.alignerrormapid + "_scale").val(scale);
62568
+ $("#" + me.alignerrormapid).attr("width",(ic.alignerrormapWidth * parseFloat(scale)).toString() + "px");
62569
+
62304
62570
  ic.saveFileCls.savePng(me.alignerrormapid, ic.inputid + "_alignerrormap.png", true);
62305
62571
  });
62306
62572
  me.myEventCls.onIds("#" + me.alignerrormapid + "_full", "click", function(e) { let ic = me.icn3d;
62307
62573
  e.preventDefault();
62308
62574
  //if(!me.cfg.notebook) dialog.dialog( "close" );
62309
62575
  ic.contactMapCls.afErrorMap(afid, true);
62310
-
62311
-
62312
62576
  });
62313
62577
  me.myEventCls.onIds("#" + me.alignerrormapid + "_json", "click", function(e) { let ic = me.icn3d;
62314
62578
  e.preventDefault();
@@ -62589,6 +62853,92 @@ class Events {
62589
62853
  me.htmlCls.clickMenuCls.setLogCmd("disttable | " + nameArray2 + " " + nameArray, true);
62590
62854
  });
62591
62855
 
62856
+ me.myEventCls.onIds("#" + me.pre + "applylinebtwsets", "click", function(e) { let ic = me.icn3d;
62857
+ e.preventDefault();
62858
+ //if(!me.cfg.notebook) dialog.dialog( "close" );
62859
+ ic.bLinebtwsets = false;
62860
+
62861
+ let nameArray = $("#" + me.pre + "linebtwsets").val();
62862
+ let nameArray2 = $("#" + me.pre + "linebtwsets2").val();
62863
+
62864
+ let atomSet1 = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
62865
+ let atomSet2 = ic.definedSetsCls.getAtomsFromNameArray(nameArray2);
62866
+
62867
+ let posArray1 = ic.contactCls.getExtent(atomSet1);
62868
+ let posArray2 = ic.contactCls.getExtent(atomSet2);
62869
+
62870
+ let pos1 = new THREE.Vector3(posArray1[2][0], posArray1[2][1], posArray1[2][2]);
62871
+ let pos2 = new THREE.Vector3(posArray2[2][0], posArray2[2][1], posArray2[2][2]);
62872
+
62873
+ let radius = $("#" + me.pre + "linebtwsets_radius").val();
62874
+ let color = $("#" + me.pre + "linebtwsets_customcolor").val();
62875
+ let opacity = $("#" + me.pre + "linebtwsets_opacity").val();
62876
+ let dashed = ($("#" + me.pre + "linebtwsets_style").val() == 'Solid') ? false : true;
62877
+ let type = 'cylinder';
62878
+
62879
+ let command = 'add line | x1 ' + pos1.x.toPrecision(4) + ' y1 ' + pos1.y.toPrecision(4) + ' z1 ' + pos1.z.toPrecision(4) + ' | x2 ' + pos2.x.toPrecision(4) + ' y2 ' + pos2.y.toPrecision(4) + ' z2 ' + pos2.z.toPrecision(4) + ' | color ' + color + ' | dashed ' + dashed + ' | type ' + type + ' | radius ' + radius + ' | opacity ' + opacity;
62880
+
62881
+ me.htmlCls.clickMenuCls.setLogCmd(command, true);
62882
+
62883
+ ic.analysisCls.addLine(pos1.x, pos1.y, pos1.z, pos2.x, pos2.y, pos2.z, color, dashed, type, radius, opacity);
62884
+ ic.drawCls.draw();
62885
+ });
62886
+
62887
+ me.myEventCls.onIds("#" + me.pre + "applycartoonshape", "click", function(e) { let ic = me.icn3d;
62888
+ e.preventDefault();
62889
+ //if(!me.cfg.notebook) dialog.dialog( "close" );
62890
+ ic.bCartoonshape = false;
62891
+
62892
+ let nameArray = $("#" + me.pre + "cartoonshape").val();
62893
+ let atomSet1 = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
62894
+ let posArray1 = ic.contactCls.getExtent(atomSet1);
62895
+ let pos1 = new THREE.Vector3(posArray1[2][0], posArray1[2][1], posArray1[2][2]);
62896
+
62897
+ let shape = $("#" + me.pre + "cartoonshape_shape").val(); // Sphere or Cube
62898
+ let radius = $("#" + me.pre + "cartoonshape_radius").val();
62899
+ let colorStr = $("#" + me.pre + "cartoonshape_customcolor").val();
62900
+ let opacity = $("#" + me.pre + "cartoonshape_opacity").val();
62901
+
62902
+ colorStr = '#' + colorStr.replace(/\#/g, '');
62903
+ let color = me.parasCls.thr(colorStr);
62904
+
62905
+ // draw the shape
62906
+ let command;
62907
+ if(shape == 'Sphere') {
62908
+ ic.sphereCls.createSphereBase(pos1, color, radius, undefined, undefined, undefined, opacity);
62909
+ command = 'add sphere | x1 ' + pos1.x.toPrecision(4) + ' y1 ' + pos1.y.toPrecision(4) + ' z1 ' + pos1.z.toPrecision(4) + ' | color ' + colorStr + ' | opacity ' + opacity + ' | radius ' + radius;
62910
+ }
62911
+ else {
62912
+ ic.boxCls.createBox_base(pos1, radius, color, undefined, undefined, undefined, opacity);
62913
+ command = 'add cube | x1 ' + pos1.x.toPrecision(4) + ' y1 ' + pos1.y.toPrecision(4) + ' z1 ' + pos1.z.toPrecision(4) + ' | color ' + colorStr + ' | opacity ' + opacity + ' | radius ' + radius;
62914
+ }
62915
+
62916
+ me.htmlCls.clickMenuCls.setLogCmd(command, true);
62917
+ ic.shapeCmdHash[command] = 1;
62918
+
62919
+ ic.drawCls.draw();
62920
+ });
62921
+
62922
+ me.myEventCls.onIds("#" + me.pre + "clearlinebtwsets", "click", function(e) { let ic = me.icn3d;
62923
+ e.preventDefault();
62924
+ //if(!me.cfg.notebook) dialog.dialog( "close" );
62925
+
62926
+ ic.lines['cylinder'] = [];
62927
+ me.htmlCls.clickMenuCls.setLogCmd('clear line between sets', true);
62928
+
62929
+ ic.drawCls.draw();
62930
+ });
62931
+
62932
+ me.myEventCls.onIds("#" + me.pre + "clearcartoonshape", "click", function(e) { let ic = me.icn3d;
62933
+ e.preventDefault();
62934
+ //if(!me.cfg.notebook) dialog.dialog( "close" );
62935
+
62936
+ ic.shapeCmdHash = {};
62937
+ me.htmlCls.clickMenuCls.setLogCmd('clear shape', true);
62938
+
62939
+ ic.drawCls.draw();
62940
+ });
62941
+
62592
62942
  // clickApply_thickness: function() {
62593
62943
  me.myEventCls.onIds("#" + me.pre + "apply_thickness_3dprint", "click", function(e) { me.icn3d;
62594
62944
  e.preventDefault();
@@ -63403,7 +63753,7 @@ class SetHtml {
63403
63753
  return html;
63404
63754
  }
63405
63755
 
63406
- setThicknessHtml(type) { let me = this.icn3dui; me.icn3d;
63756
+ setThicknessHtml(type) { let me = this.icn3dui, ic = me.icn3d;
63407
63757
  let html = '';
63408
63758
 
63409
63759
  // type == '3dprint' or 'style'
@@ -63441,7 +63791,8 @@ class SetHtml {
63441
63791
  linerad = parseFloat(this.getCookie('lineRadius'));
63442
63792
  coilrad = parseFloat(this.getCookie('coilWidth'));
63443
63793
  stickrad = parseFloat(this.getCookie('cylinderRadius'));
63444
- crosslinkrad = parseFloat(this.getCookie('crosslinkRadius'));
63794
+ let clrad = this.getCookie('crosslinkRadius');
63795
+ crosslinkrad = (!isNaN(clrad)) ? parseFloat(clrad) : ic.crosslinkRadius;
63445
63796
  tracerad = parseFloat(this.getCookie('traceRadius'));
63446
63797
  ballscale = parseFloat(this.getCookie('dotSphereScale'));
63447
63798
  ribbonthick = parseFloat(this.getCookie('ribbonthickness'));
@@ -64539,6 +64890,10 @@ class Alternate {
64539
64890
  });
64540
64891
 
64541
64892
  html += "<div>";
64893
+
64894
+ html += "Dark green (W, F, Y, L, I, C, M): Hydrophobic<br>";
64895
+ html += "Light green (G, V, S, T, A, N, P, Q): Polar<br>";
64896
+ html += "Grey: Charged, not hydrophobic<br><br>";
64542
64897
 
64543
64898
  let cnt = 0;
64544
64899
  for (let key of keys) {
@@ -64554,6 +64909,7 @@ class Alternate {
64554
64909
  }
64555
64910
  //else if (ic.legendClick == 5){
64556
64911
  else if (colorType == 'b factor') {
64912
+ html += "<div style='width:450px'>B factor quantitates the uncertainty for each atom. A high B factor reflects that the position is less certain.</div><br>";
64557
64913
  html += me.htmlCls.clickMenuCls.setLegendHtml();
64558
64914
  }
64559
64915
  //else if (ic.legendClick == 6){
@@ -64573,7 +64929,7 @@ class Alternate {
64573
64929
  }
64574
64930
  }
64575
64931
 
64576
- getColorLegendForElem(category, atomHash) { let ic = this.icn3d; ic.icn3dui;
64932
+ getColorLegendForElem(category, atomHash) { let ic = this.icn3d, me = ic.icn3dui;
64577
64933
  let html = '';
64578
64934
  let elemSet = {};
64579
64935
 
@@ -64599,7 +64955,7 @@ class Alternate {
64599
64955
  for (let v in elemSet[k]) {
64600
64956
  html += "<div style='width: 10px; height: 10px; background-color:#" + v + "; border: 0px;display:inline-block;' ></div> ";
64601
64957
  }
64602
- html += k + "</span><br>";
64958
+ html += me.parasCls.atomnames[k.toUpperCase()] + "</span><br>";
64603
64959
  }
64604
64960
  html += "<br>";
64605
64961
  }
@@ -64617,11 +64973,13 @@ class Alternate {
64617
64973
  ILE: "I (Ile)", LEU: "L (Leu)", LYS: "K (Lys)",
64618
64974
  MET: "M (Met)", PHE: "F (Phe)", PRO: "P (Pro)",
64619
64975
  SER: "S (Ser)", THR: "T (Thr)", TRP: "W (Trp)",
64620
- TYR: "Y (Tyr)", VAL: "V (Val)", ASX: "B (Asx)",
64621
- GLX: "Z (Glx)", 'G': "Guanine", 'A': "Adenine",
64622
- 'T': "Thymine", 'C': "Cytosine", 'U': "Uracile",
64623
- 'DG': "dG", 'DA': "dA", 'DT': "dT",
64624
- 'DC': "dC", 'DU': 'dU'
64976
+ TYR: "Y (Tyr)", VAL: "V (Val)",
64977
+ //ASX: "B (Asx)", GLX: "Z (Glx)",
64978
+ ASX: "X (Asx)", GLX: "X (Glx)",
64979
+ 'G': "Guanine", 'A': "Adenine",
64980
+ 'T': "Thymine", 'C': "Cytosine", 'U': "Uracil",
64981
+ 'DG': "deoxy-Guanine", 'DA': "deoxy-Adenine", 'DT': "deoxy-Thymine",
64982
+ 'DC': "deoxy-Cytosine", 'DU': 'deoxy-Uracil'
64625
64983
  };
64626
64984
 
64627
64985
  let residueHash = ic.firstAtomObjCls.getResiduesFromAtoms(atomHash);
@@ -64694,7 +65052,7 @@ class Alternate {
64694
65052
 
64695
65053
  let atom = ic.firstAtomObjCls.getFirstAtomObj(atomHash);
64696
65054
  if(atom.resn == 'ARG' || atom.resn == 'LYS') {
64697
- chargeHash['Postive'] = 1;
65055
+ chargeHash['Positive'] = 1;
64698
65056
  }
64699
65057
  else if(atom.resn == 'HIS') {
64700
65058
  chargeHash['Partial-Positive'] = 1;
@@ -64708,13 +65066,13 @@ class Alternate {
64708
65066
  }
64709
65067
 
64710
65068
  const charge2color = {
64711
- "Postive": "0000ff",
65069
+ "Positive": "0000ff",
64712
65070
  "Partial-Positive": "8080ff",
64713
65071
  "Negative": "ff0000",
64714
65072
  "Neutral": "888888"
64715
65073
  };
64716
65074
 
64717
- let chargeOrder = ["Postive", "Partial-Positive", "Negative", "Neutral"];
65075
+ let chargeOrder = ["Positive", "Partial-Positive", "Negative", "Neutral"];
64718
65076
 
64719
65077
  html += "<div>";
64720
65078
  for (let i = 0, il = chargeOrder.length; i < il; ++i) {
@@ -67468,9 +67826,9 @@ console.log(domainid + ' TM-score: ' + domainid2score[domainid] + ' matched ' +
67468
67826
  }
67469
67827
 
67470
67828
  // assign ic.resid2refnum, ic.refnum2residArray, ic.chainsMapping
67471
- ic.resid2refnum = {};
67472
- ic.refnum2residArray = {};
67473
- ic.chainsMapping = {};
67829
+ if(!ic.resid2refnum) ic.resid2refnum = {};
67830
+ if(!ic.refnum2residArray) ic.refnum2residArray = {};
67831
+ if(!ic.chainsMapping) ic.chainsMapping = {};
67474
67832
  for(let chainid in chainid2segs) {
67475
67833
  let segArray = chainid2segs[chainid];
67476
67834
  console.log("One of the reference PDBs for chain chainid: " + ic.refpdbArray[ic.chainid2index[chainid]]);
@@ -67533,6 +67891,72 @@ console.log("One of the reference PDBs for chain chainid: " + ic.refpdbArray[ic.
67533
67891
  else if(refnum >= 7000 && refnum < 7200) return "G" + oriRefnum;
67534
67892
  else if(refnum >= 7200 && refnum < 8000) return "G'" + oriRefnum;
67535
67893
  }
67894
+
67895
+ parseCustomRefFile(data) { let ic = this.icn3d; ic.icn3dui;
67896
+ ic.bShowCustomRefnum = true;
67897
+
67898
+ //refnum,11,12,,21,22
67899
+ //1TUP_A,100,101,,,132
67900
+ //1TUP_B,110,111,,141,142
67901
+
67902
+ let lineArray = data.split('\n');
67903
+
67904
+ if(!ic.resid2refnum) ic.resid2refnum = {};
67905
+ if(!ic.refnum2residArray) ic.refnum2residArray = {};
67906
+ if(!ic.chainsMapping) ic.chainsMapping = {};
67907
+
67908
+ let refAA = [];
67909
+ for(let i = 0, il = lineArray.length; i < il; ++i) {
67910
+ let numArray = lineArray[i].split(',');
67911
+ refAA.push(numArray);
67912
+ }
67913
+
67914
+ // assign ic.refnum2residArray
67915
+ let refI = 0;
67916
+ for(let j = 1, jl = refAA[refI].length; j < jl; ++j) {
67917
+ if(!refAA[refI][j]) continue;
67918
+
67919
+ let refnum = refAA[refI][j].trim();
67920
+ if(refnum) {
67921
+ for(let i = 1, il = refAA.length; i < il; ++i) {
67922
+ if(!refAA[i][j]) continue;
67923
+ let chainid = refAA[i][0].trim();
67924
+ let resid = chainid + '_' + refAA[i][j].trim();
67925
+ if(!ic.refnum2residArray[refnum]) {
67926
+ ic.refnum2residArray[refnum] = [resid];
67927
+ }
67928
+ else {
67929
+ ic.refnum2residArray[refnum].push(resid);
67930
+ }
67931
+ }
67932
+ }
67933
+ }
67934
+
67935
+ // assign ic.resid2refnum and ic.chainsMapping
67936
+ for(let i = 1, il = refAA.length; i < il; ++i) {
67937
+ let chainid = refAA[i][0].trim();
67938
+
67939
+ for(let j = 1, jl = refAA[i].length; j < jl; ++j) {
67940
+ if(!refAA[i][j] || !refAA[refI][j]) continue;
67941
+
67942
+ let resi = refAA[i][j].trim();
67943
+ let refnum = refAA[refI][j].trim();
67944
+ if(resi && refnum) {
67945
+ let resid = chainid + '_' + resi;
67946
+ ic.resid2refnum[resid] = refnum;
67947
+
67948
+ if(!ic.chainsMapping.hasOwnProperty(chainid)) {
67949
+ ic.chainsMapping[chainid] = {};
67950
+ }
67951
+ ic.chainsMapping[chainid][resid] = refnum;
67952
+ }
67953
+ }
67954
+ }
67955
+
67956
+ // open sequence view
67957
+ ic.showAnnoCls.showAnnotations();
67958
+ ic.annotationCls.setAnnoViewAndDisplay('detailed view');
67959
+ }
67536
67960
  }
67537
67961
 
67538
67962
  /**
@@ -68783,6 +69207,8 @@ class iCn3D {
68783
69207
 
68784
69208
  this.residNCBI2resid = {}; // convert from NCBI residue ID (structure_chain_resi) to PDB residue ID (structure_chain_resi)
68785
69209
 
69210
+ this.shapeCmdHash = {}; // remember the spheres/cubes for sets
69211
+
68786
69212
  this.bHideSelection = true;
68787
69213
  this.bSelectResidue = false;
68788
69214
  this.bSelectAlignResidue = false;
@@ -69102,6 +69528,8 @@ iCn3D.prototype.reinitAfterLoad = function () { let ic = this, me = ic.icn3dui;
69102
69528
  ic.lines = {}; // hash of name -> a list of solid or dashed lines. Each line contains 'position1', 'position2', 'color', and a boolean of 'dashed'
69103
69529
  // line name could be custom, hbond, ssbond, distance
69104
69530
 
69531
+ ic.shapeCmdHash = {};
69532
+
69105
69533
  ic.bAssembly = true; //false;
69106
69534
  };
69107
69535
 
@@ -69157,7 +69585,7 @@ class iCn3DUI {
69157
69585
  //even when multiple iCn3D viewers are shown together.
69158
69586
  this.pre = this.cfg.divid + "_";
69159
69587
 
69160
- this.REVISION = '3.18.1';
69588
+ this.REVISION = '3.19.0';
69161
69589
 
69162
69590
  // In nodejs, iCn3D defines "window = {navigator: {}}"
69163
69591
  this.bNode = (Object.keys(window).length < 2) ? true : false;