icn3d 3.31.8 → 3.31.9

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
@@ -44425,7 +44425,7 @@ class AddTrack {
44425
44425
 
44426
44426
  getExonHtml(exonIndex, colorGradient, from, to, genomeRange, chainid, simpTitle) { let ic = this.icn3d; ic.icn3dui;
44427
44427
  // return '<div style="display:inline-block; color:white!important; width:' + Math.round(ic.seqAnnWidth *(to - from + 1) /(ic.maxAnnoLength + ic.nTotalGap)) + 'px;" class="icn3d-seqTitle icn3d-link icn3d-blue" domain="' + (exonIndex + 1) + '" from="' + from + '" to="' + to + '" setname="' + simpTitle + ', Exon ' + (exonIndex + 1) + '" title="Exon ' + (exonIndex + 1) + ': ' + genomeRange + ' genomic interval" anno="sequence" chain="' + chainid + '"><div style="height: 12px; border: 1px solid #000; background: linear-gradient(to right, ' + colorGradient + ');"></div></div>';
44428
- return '<div style="display:inline-block; color:white!important; width:' + Math.round(ic.seqAnnWidth *(to - from + 1) /(ic.maxAnnoLength + ic.nTotalGap)) + 'px;" class="icn3d-seqTitle icn3d-link icn3d-blue" domain="' + (exonIndex + 1) + '" from="' + from + '" to="' + to + '" setname="' + simpTitle + ', #' + (exonIndex + 1) + '" title="Exon: ' + genomeRange + ' genomic interval" anno="sequence" chain="' + chainid + '"><div style="height: 12px; border: 1px solid #000; background: linear-gradient(to right, ' + colorGradient + ');"></div></div>';
44428
+ return '<div style="display:inline-block; color:white!important; width:' + Math.round(ic.seqAnnWidth *(to - from + 1) /(ic.maxAnnoLength + ic.nTotalGap)) + 'px;" class="icn3d-seqTitle icn3d-link icn3d-blue" domain="' + (exonIndex + 1) + '" from="' + from + '" to="' + to + '" setname="' + simpTitle + ', ' + (exonIndex + 1) + '" title="Exon: ' + genomeRange + ' genomic interval" anno="sequence" chain="' + chainid + '"><div style="height: 12px; border: 1px solid #000; background: linear-gradient(to right, ' + colorGradient + ');"></div></div>';
44429
44429
  }
44430
44430
 
44431
44431
  getExonColor(start, end, pos) { let ic = this.icn3d; ic.icn3dui;
@@ -70491,7 +70491,7 @@ class Dssp {
70491
70491
  ic.ref2igtype['LaminAC_1ifrA_human'] = 'Lamin';
70492
70492
  ic.ref2igtype['MHCIa_7phrH_human_C1'] = 'IgC1';
70493
70493
  ic.ref2igtype['MPT63_1lmiA_bacteria'] = 'IgE';
70494
- ic.ref2igtype['NaCaExchanger_2fwuA_dog_n2'] = 'IgE';
70494
+ ic.ref2igtype['NaCaExchanger_2fwuA_dog_n2'] = 'IgFN3-like';
70495
70495
  ic.ref2igtype['NaKATPaseTransporterBeta_2zxeB_spurdogshark'] = 'IgE';
70496
70496
  ic.ref2igtype['ORF7a_1xakA_virus'] = 'ORF';
70497
70497
  ic.ref2igtype['PD1_4zqkB_human_V'] = 'IgV';
@@ -71218,14 +71218,16 @@ class Dssp {
71218
71218
  let resiDistToC = (bCpstrand) ? parseInt(CpAtom.resi) - parseInt(CAtom.resi) : parseInt(DAtom.resi) - parseInt(CAtom.resi);
71219
71219
  let resiDistToE = (bCpstrand) ? parseInt(EAtom.resi) - parseInt(CpAtom.resi) : parseInt(EAtom.resi) - parseInt(DAtom.resi);
71220
71220
 
71221
+ let adjust = 1;
71222
+
71221
71223
  if(bCpstrand) {
71222
- if(distToC > distToE || (distToC == distToE && resiDistToC > resiDistToE)) { // rename C' to D
71224
+ if(distToC > distToE + adjust || (distToC == distToE + adjust && resiDistToC > resiDistToE + adjust)) { // rename C' to D
71223
71225
  CpToDResi.push(CpAtom.resi);
71224
71226
  if(!me.bNode) console.log("Rename strand C' to D: distToC " + distToC + " distToE " + distToE + " resiDistToC " + resiDistToC + " resiDistToE " + resiDistToE);
71225
71227
  }
71226
71228
  }
71227
71229
  else if(bDstrand) {
71228
- if(distToC < distToE || (distToC == distToE && resiDistToC < resiDistToE)) { // rename D to C'
71230
+ if(distToC + adjust < distToE || (distToC + adjust == distToE && resiDistToC + adjust < resiDistToE)) { // rename D to C'
71229
71231
  DToCpResi.push(DAtom.resi);
71230
71232
  if(!me.bNode) console.log("Rename strand D to C': distToC " + distToC + " distToE " + distToE + " resiDistToC " + resiDistToC + " resiDistToE " + resiDistToE);
71231
71233
  }
@@ -71245,7 +71247,8 @@ class Dssp {
71245
71247
 
71246
71248
  seg.q_start;
71247
71249
  let qStartInt = parseInt(seg.q_start);
71248
- if(isNaN(seg.q_start)) seg.q_start.substr(seg.q_start.length - 1, 1);
71250
+ let postfix = '';
71251
+ if(isNaN(seg.q_start)) postfix = seg.q_start.substr(seg.q_start.length - 1, 1);
71249
71252
 
71250
71253
  // one item in "seq"
71251
71254
  // q_start and q_end are numbers, but saved in string
@@ -71260,7 +71263,7 @@ class Dssp {
71260
71263
  //let refnum = qStart;
71261
71264
  let refnum = qStartInt;
71262
71265
 
71263
- let refnumLabel = this.getLabelFromRefnum(refnum);
71266
+ let refnumLabel = this.getLabelFromRefnum(refnum, postfix);
71264
71267
  currStrand = (refnumLabel) ? refnumLabel.replace(new RegExp(refnum,'g'), '') : undefined;
71265
71268
 
71266
71269
  let currStrandFinal = currStrand;
@@ -71282,7 +71285,7 @@ class Dssp {
71282
71285
  }
71283
71286
 
71284
71287
  if(currStrand != currStrandFinal) {
71285
- refnumLabel = this.getLabelFromRefnum(refnum, currStrandFinal);
71288
+ refnumLabel = this.getLabelFromRefnum(refnum, postfix, currStrandFinal);
71286
71289
  }
71287
71290
 
71288
71291
  let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
@@ -71318,7 +71321,7 @@ class Dssp {
71318
71321
  }
71319
71322
  }
71320
71323
 
71321
- getStrandFromRefnum(oriRefnum, prevStrand) { let ic = this.icn3d; ic.icn3dui;
71324
+ getStrandFromRefnum(oriRefnum, finalStrand) { let ic = this.icn3d; ic.icn3dui;
71322
71325
  let refnum = parseInt(oriRefnum);
71323
71326
 
71324
71327
  //N-terminus = 0999-0001
@@ -71397,16 +71400,25 @@ class Dssp {
71397
71400
  else if(refnum > 9900) strand = undefined;
71398
71401
  else strand = " ";
71399
71402
 
71400
- if(prevStrand) strand = prevStrand;
71403
+ if(finalStrand) strand = finalStrand;
71401
71404
 
71402
71405
  return strand
71403
71406
  }
71404
71407
 
71405
- getLabelFromRefnum(oriRefnum, prevStrand) { let ic = this.icn3d; ic.icn3dui;
71406
- let strand = this.getStrandFromRefnum(oriRefnum, prevStrand);
71408
+ getLabelFromRefnum(oriRefnum, postfix, finalStrand) { let ic = this.icn3d; ic.icn3dui;
71409
+ let strand = this.getStrandFromRefnum(oriRefnum, finalStrand);
71410
+
71411
+ // rename C' to D or D to C'
71412
+ let refnum = oriRefnum.toString();
71413
+ if(finalStrand == "C'" && refnum.substr(0, 1) == '6') { // previous D
71414
+ refnum = '4' + refnum.substr(1);
71415
+ }
71416
+ else if(finalStrand == "D" && refnum.substr(0, 1) == '4') { // previous C'
71417
+ refnum = '6' + refnum.substr(1);
71418
+ }
71407
71419
 
71408
71420
  if(strand) {
71409
- return strand + oriRefnum;
71421
+ return strand + refnum + postfix;
71410
71422
  }
71411
71423
  else {
71412
71424
  return undefined;