diff --git a/build/icn3d.js b/build/icn3d.js index fd2d382e..91f1142d 100644 --- a/build/icn3d.js +++ b/build/icn3d.js @@ -6863,7 +6863,7 @@ var icn3d = (function (exports) { }); me.myEventCls.onIds("#" + me.pre + "mn1_dsn6", "click", function(e) { me.icn3d; //e.preventDefault(); - me.htmlCls.dialogCls.openDlg('dl_dsn6', 'Please input the DSN6 file to display electron density map'); + me.htmlCls.dialogCls.openDlg('dl_dsn6', 'Please input the map file to display electron density map'); }); @@ -6890,7 +6890,7 @@ var icn3d = (function (exports) { me.myEventCls.onIds("#" + me.pre + "mn1_dsn6url", "click", function(e) { me.icn3d; //e.preventDefault(); - me.htmlCls.dialogCls.openDlg('dl_dsn6url', 'Please input the DSN6 file to display electron density map'); + me.htmlCls.dialogCls.openDlg('dl_dsn6url', 'Please input the map file to display electron density map'); }); me.myEventCls.onIds("#" + me.pre + "mn1_exportState", "click", function(e) { let ic = me.icn3d; //e.preventDefault(); @@ -9451,7 +9451,7 @@ var icn3d = (function (exports) { html += this.getMenuSep(); - html += this.getMenuText('mn1_dsn6wrap', 'Electron Density(DSN6)', undefined, undefined, 2); + html += this.getMenuText('mn1_dsn6wrap', 'Electron Density', undefined, undefined, 2); html += "
refnum,11,12,,21,22,,10C,11C,20C",s+="1TUP_C,,,,,,,200,201,230",s+='The first row defines the reference residue numbers, which could be any strings. The 1st cell could be anything. The rest cells are reference residue numbers (e.g., 11, 21, 10C, etc.) 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 fourth row shows another set of reference numners for the chain "1TUP_C". It could be a chain from a different structure.
",s+="1TUP_A,100,101,,,132,,,,
",s+="1TUP_B,110,111,,141,142,,,,
"+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_hbond' checked>Hydrogen Bonds "+e.htmlCls.space3+" | ",s+="",s+=e.htmlCls.divNowrapStr+" Å"+e.htmlCls.space3+" | ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_saltbridge' checked>Salt Bridge/Ionic "+e.htmlCls.space3+" | ",s+="",s+=e.htmlCls.divNowrapStr+" Å"+e.htmlCls.space3+" | ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_contact' checked>Contacts/Interactions "+e.htmlCls.space3+" | ",s+="",s+=e.htmlCls.divNowrapStr+" Å"+e.htmlCls.space3+" | ",s+="
"+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_halogen' checked>Halogen Bonds "+e.htmlCls.space3+" | ",s+="",s+=e.htmlCls.divNowrapStr+" Å"+e.htmlCls.space3+" | ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_pication' checked>π-Cation "+e.htmlCls.space3+" | ",s+="",s+=e.htmlCls.divNowrapStr+" Å"+e.htmlCls.space3+" | ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_pistacking' checked>π-Stacking "+e.htmlCls.space3+" | ",s+="",s+=e.htmlCls.divNowrapStr+" Å"+e.htmlCls.space3+" | ",s+="
",s+=e.htmlCls.divNowrapStr+"2. Select the first set:",s+="",s+=" | ",s+=e.htmlCls.divNowrapStr+"3. Select the second set:",s+="",s+=" |
Helix or Sheet'+r+e.pre+'dist_ss" size="4" value="100"> | ',s+="Coil or Nucleotide"+r+e.pre+'dist_coil" size="4" value="50"> | ',s+="Disulfide Bonds"+r+e.pre+'dist_ssbond" size="4" value="50"> |
Hydrogen Bonds"+r+e.pre+'dist_hbond" size="4" value="50"> | ',s+="Salt Bridge/Ionic"+r+e.pre+'dist_ionic" size="4" value="50"> | ',s+="Contacts"+r+e.pre+'dist_inter" size="4" value="25"> |
Halogen Bonds"+r+e.pre+'dist_halogen" size="4" value="50"> | ',s+="π-Cation"+r+e.pre+'dist_pication" size="4" value="50"> | ',s+="π-Stacking"+r+e.pre+'dist_pistacking" size="4" value="50"> |
0 | 5 | 10 | 15 | 20 | 25 | 30 |
Expected position error (Angstroms) |
",s+=e.htmlCls.divNowrapStr+"First set:",s+="",s+=" | ",s+=e.htmlCls.divNowrapStr+"Second set:",s+="",s+=" |
",s+=e.htmlCls.divNowrapStr+"First set:",s+="",s+=" | ",s+=e.htmlCls.divNowrapStr+"Second set:",s+="",s+=" |
",s+=e.htmlCls.divNowrapStr+"First sets:",s+="",s+=" | ",s+=e.htmlCls.divNowrapStr+"Second sets:",s+="",s+=" |
",i=" | ";return t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_all'>All"+e.htmlCls.space2+" | ",t+=i+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_cdd' checked>Conserved Domains"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_clinvar'>ClinVar"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_binding'>Functional Sites"+e.htmlCls.space2+"",t+="
",t+=" | |
",t+=" |
| ",n+="||||||
",n+='Specification Tips: ',n+=t.htmlCls.divStr+"specguide"+s+"' style='display:none; width:500px' class='icn3d-box'>",n+='Specification: In the selection "$1HHO,4N7N.A,B,C:5-10,LV,3AlaVal,chemicals@CA,C,C*":',n+='
|
m&&(v=v.substr(0,m)+"...");let _=b+": "+C;s&&(o[p]=C);let w=e[g].locs;if(w)for(let e=0,r=w.length;e ";let u=1==t.n?"Interaction":t.n+" interactions";t.n>1&&(h+=" =4&&(n.rmsd_suprTmp=l.rmsdSuprCls.getRmsdSuprCls(c,a,p),void 0!==n.rmsd_suprTmp.rot))){let e=n.rmsd_suprTmp.rot;if(null===e[0])continue;let i=n.rmsd_suprTmp.trans1,r=n.rmsd_suprTmp.trans2,a=n.rmsd_suprTmp.rmsd;if(aRealignment RMSD: "+a.toPrecision(4)+" Å m&&(v=v.substr(0,m)+"...");let _=b+": "+C;s&&(o[p]=C);let w=e[g].locs;if(w)for(let e=0,r=w.length;e ";let u=1==t.n?"Interaction":t.n+" interactions";t.n>1&&(h+=" =4&&(n.rmsd_suprTmp=l.rmsdSuprCls.getRmsdSuprCls(c,a,p),void 0!==n.rmsd_suprTmp.rot))){let e=n.rmsd_suprTmp.rot;if(null===e[0])continue;let i=n.rmsd_suprTmp.trans1,r=n.rmsd_suprTmp.trans2,a=n.rmsd_suprTmp.rmsd;if(aRealignment RMSD: "+a.toPrecision(4)+" Å m&&(v=v.substr(0,m)+"...");let _=b+": "+C;s&&(o[p]=C);let w=e[g].locs;if(w)for(let e=0,r=w.length;e ";let u=1==t.n?"Interaction":t.n+" interactions";t.n>1&&(h+=" =4&&(n.rmsd_suprTmp=l.rmsdSuprCls.getRmsdSuprCls(c,a,p),void 0!==n.rmsd_suprTmp.rot))){let e=n.rmsd_suprTmp.rot;if(null===e[0])continue;let i=n.rmsd_suprTmp.trans1,r=n.rmsd_suprTmp.trans2,a=n.rmsd_suprTmp.rmsd;if(aRealignment RMSD: "+a.toPrecision(4)+" Å m&&(v=v.substr(0,m)+"...");let _=b+": "+C;s&&(o[p]=C);let w=e[g].locs;if(w)for(let e=0,r=w.length;e ";let u=1==t.n?"Interaction":t.n+" interactions";t.n>1&&(h+=" =4&&(n.rmsd_suprTmp=l.rmsdSuprCls.getRmsdSuprCls(c,a,p),void 0!==n.rmsd_suprTmp.rot))){let e=n.rmsd_suprTmp.rot;if(null===e[0])continue;let i=n.rmsd_suprTmp.trans1,r=n.rmsd_suprTmp.trans2,a=n.rmsd_suprTmp.rmsd;if(aRealignment RMSD: "+a.toPrecision(4)+" Å m&&(v=v.substr(0,m)+"...");let _=b+": "+C;s&&(o[p]=C);let w=e[g].locs;if(w)for(let e=0,r=w.length;e ";let u=1==t.n?"Interaction":t.n+" interactions";t.n>1&&(h+=" =4&&(n.rmsd_suprTmp=l.rmsdSuprCls.getRmsdSuprCls(c,a,p),void 0!==n.rmsd_suprTmp.rot))){let e=n.rmsd_suprTmp.rot;if(null===e[0])continue;let i=n.rmsd_suprTmp.trans1,r=n.rmsd_suprTmp.trans2,a=n.rmsd_suprTmp.rmsd;if(aRealignment RMSD: "+a.toPrecision(4)+" Å m&&(v=v.substr(0,m)+"...");let _=b+": "+C;s&&(o[p]=C);let w=e[g].locs;if(w)for(let e=0,r=w.length;e ";let u=1==t.n?"Interaction":t.n+" interactions";t.n>1&&(h+=" =4&&(n.rmsd_suprTmp=l.rmsdSuprCls.getRmsdSuprCls(c,a,p),void 0!==n.rmsd_suprTmp.rot))){let e=n.rmsd_suprTmp.rot;if(null===e[0])continue;let i=n.rmsd_suprTmp.trans1,r=n.rmsd_suprTmp.trans2,a=n.rmsd_suprTmp.rmsd;if(aRealignment RMSD: "+a.toPrecision(4)+" Å
";let T='';i+=R+I+T,s&&(n+='
",i+=T,n+=T,s&&(n+=' ')}}return{html:i,html2:n,html3:l,acc2domain:r,pssmid2name:o,pssmid2fromArray:a,pssmid2toArray:d}}showAnnoType(e,t,s,i,n,l){let r=this.icn3d,o=r.icn3dui,a='
";let b='';a+=g+f+b,d+=g+f+b;let C=s,y=0,v=0;r.seqStartLen&&r.seqStartLen[e]&&(d+=r.showSeqCls.insertMulGapOverview(e,r.seqStartLen[e])),r.seqStartLen&&r.seqStartLen[e]&&(a+=r.showSeqCls.insertMulGap(r.seqStartLen[e],"-"));for(let t=0,i=r.giSeq[e].length;t1&&(c=n[0]+"..");let h=i,p=e+"_"+i,m=n+i;if("ssbond"==s){m="Residue "+p+" has disulfide bond with";let t="";if(void 0!==l[p])for(let e=0,s=l[p].length;e'+c+"",d+=r.showSeqCls.insertGapOverview(e,t);let u=o.cfg.blast_rep_id==e?Math.round(r.seqAnnWidth*t/(r.maxAnnoLength+r.nTotalGap)-y-v):Math.round(r.seqAnnWidth*t/r.maxAnnoLength-y-v);u>=0&&(d+='
",a+=b,d+=b,a+="",d+="",c+="",$("#"+r.pre+"dt_"+s+"_"+e).html(a),$("#"+r.pre+"ov_"+s+"_"+e).html(d),$("#"+r.pre+"tt_"+s+"_"+e).html(c)}setToolTip(){let e=this.icn3d;e.icn3dui,$("[id^="+e.pre+"snp]").add("[id^="+e.pre+"clinvar]").add("[id^="+e.pre+"ssbond]").add("[id^="+e.pre+"crosslink]").tooltip({content:function(){return $(this).prop("title")},show:null,close:function(e,t){t.tooltip.hover((function(){$(this).stop(!0).fadeTo(400,1)}),(function(){$(this).fadeOut("400",(function(){$(this).remove()}))}))}})}}class _t{constructor(e){this.icn3d=e}showInteraction(e,t){this.icn3d.icn3dui,this.showInteraction_base(e,t)}showInteraction_base(e,t){let s=this.icn3d,i=s.icn3dui;i.bNode&&(s.resid2contact||(s.resid2contact={}),s.resid2contact[e]||(s.resid2contact[e]=[])),void 0===s.chainname2residues&&(s.chainname2residues={});let n=Object.keys(s.chains),l=e,r=Math.round(l.indexOf("_"));if(s.firstAtomObjCls.getFirstCalphaAtomObj(s.chains[l]),void 0===s.chainname2residues[l]){s.chainname2residues[l]={};let t=n.length;if(t>100&&void 0===i.cfg.mmdbid&&void 0===i.cfg.gi&&void 0===i.cfg.blast_rep_id&&void 0===i.cfg.align&&void 0===i.cfg.chainalign)return $("#"+s.pre+"dt_interaction_"+e).html(""),void $("#"+s.pre+"ov_interaction_"+e).html("");for(let e=0;e
";let f='';o+=u+g+f,a+=u+g+f;let b="inter"+c.toString(),C=0,y=0,v=1;s.seqStartLen&&s.seqStartLen[e]&&(a+=s.showSeqCls.insertMulGapOverview(e,s.seqStartLen[e])),s.seqStartLen&&s.seqStartLen[e]&&(o+=s.showSeqCls.insertMulGap(s.seqStartLen[e],"-"));for(let t=0,n=s.giSeq[e].length;t
",o+=f,a+=f,++c}o+="",a+="",d+="",$("#"+s.pre+"dt_interaction_"+e).html(o),$("#"+s.pre+"ov_interaction_"+e).html(a),$("#"+s.pre+"tt_interaction_"+e).html(d),i.utilsCls.isMobile()?(s.hlSeqCls.selectSequenceMobile(),s.hlSeqCls.selectChainMobile()):s.hlSeqCls.selectSequenceNonMobile()}}class wt{constructor(e){this.icn3d=e}async showPTM(e,t,s,i,n){let l=this.icn3d,r=l.icn3dui,o=this,a=e.substr(0,e.indexOf("_")),d=e.substr(e.indexOf("_")+1);if("afmem"==s){let t={Transmembrane:[{begin:i,end:n}]};this.setAnnoPtmTransmem("transmem",t,e)}else if(a.length>5){let t,i="https://www.ebi.ac.uk/proteins/api/features/"+a;try{t=await r.getAjaxPromise(i,"json"),o.parsePTM(t,e,s)}catch{return void o.getNoPTM(e,s)}}else{let t,i=a.substr(0,4).toLowerCase(),n="https://www.ebi.ac.uk/pdbe/api/mappings/uniprot/"+i;try{t=await r.getAjaxPromise(n,"json");let a="";l.UPResi2ResiPosPerChain||(l.UPResi2ResiPosPerChain={}),l.UPResi2ResiPosPerChain[e]={};let c=t[i].UniProt,h=!1;for(let t in c){let s=c[t].mappings;for(let i=0,n=s.length;i
",r+=b+C+y,o+=b+C+y;let v=e+l.toString(),_=0,w=0,S=1;i.seqStartLen&&i.seqStartLen[s]&&(o+=i.showSeqCls.insertMulGapOverview(s,i.seqStartLen[s])),i.seqStartLen&&i.seqStartLen[s]&&(r+=i.showSeqCls.insertMulGap(i.seqStartLen[s],"-"));for(let e=0,t=i.giSeq[s].length;e
",r+=y,o+=y,++l}r+="",o+="",a+="",$("#"+i.pre+"dt_"+e+"_"+s).html(r),$("#"+i.pre+"ov_"+e+"_"+s).html(o),$("#"+i.pre+"tt_"+e+"_"+s).html(a)}getNoPTM(e,t){let s=this.icn3d;s.icn3dui,console.log("No PTM data were found for the chain "+e+"...");let i="ptm"==t?"ptm":"transmem";$("#"+s.pre+"dt_"+i+"_"+e).html(""),$("#"+s.pre+"ov_"+i+"_"+e).html(""),$("#"+s.pre+"tt_"+i+"_"+e).html(""),s.showAnnoCls.enableHlSeq(),s.bAjaxPTM=!0}}class St{constructor(e){this.icn3d=e}showCrosslink(e,t){let s=this.icn3d;s.icn3dui;let i=this;void 0===s.clbondpnts?setTimeout((function(){i.showCrosslink_base(e,t)}),1e3):this.showCrosslink_base(e,t)}showCrosslink_base(e,t){let s=this.icn3d;s.icn3dui.bNode&&(s.resid2crosslink||(s.resid2crosslink={}),s.resid2crosslink[e]||(s.resid2crosslink[e]=[]));let i=t,n={},l=i.substr(0,i.indexOf("_")),r=s.clbondpnts[l];if(void 0===r)return $("#"+s.pre+"dt_crosslink_"+e).html(""),$("#"+s.pre+"ov_crosslink_"+e).html(""),void $("#"+s.pre+"tt_crosslink_"+e).html("");for(let e=0,t=r.length;e17?s.substr(0,17)+"...":s,h=i[t].intervals,p={},m={},u=[],g=[],f={},b=0;for(let e=0,t=h.length;e
";let v='';o+=C+y+v,a+=C+y+v;let _="domain3d"+t.toString();l.seqStartLen&&l.seqStartLen[e]&&(o+=l.showSeqCls.insertMulGap(l.seqStartLen[e],"-"));for(let t=0,s=l.giSeq[e].length;t1&&(n=i[0]+"..");let r=s;o+=''+i+""}else o+="-"}l.seqStartLen&&l.seqStartLen[e]&&(o+=l.showSeqCls.insertMulGap(l.seqEndLen[e],"-"));let w=l.firstAtomObjCls.getFirstCalphaAtomObj(l.chains[e]),S=void 0===w.color||"FFFFFF"===w.color.getHexString()?"DDDDDD":w.color.getHexString(),A=void 0!==w.color?S:"CCCCCC";if(l.seqStartLen&&l.seqStartLen[e]&&(a+=l.showSeqCls.insertMulGapOverview(e,l.seqStartLen[e])),r.cfg.blast_rep_id!=e)for(let i=0,n=u.length;i",v+="
",o+=v,a+=v}o+="",a+="",d+="",$("#"+l.pre+"dt_domain_"+e).html(o),$("#"+l.pre+"ov_domain_"+e).html(a),$("#"+l.pre+"tt_domain_"+e).html(d)}}class xt{constructor(e){this.icn3d=e}async showSnp(e,t){this.icn3d.icn3dui,await this.showSnpClinvar(e,t,!0)}async showClinvar(e,t){this.icn3d.icn3dui,await this.showSnpClinvar(e,t,!1)}async showSnpClinvar(e,t,s){let i=this.icn3d.icn3dui,n=this,l=i.htmlCls.baseUrl+"vastdyn/vastdyn.cgi?chainid="+t;try{let r=await i.getAjaxPromise(l,"jsonp"),o=r.snpgi,a=r.gi;if(s)await n.showSnpPart2(e,t,o);else{let s=o;[6137708,1942289,224510717,2624886,253723219,2554905,75765331,3660278,312207882,319443632,342350956,1827805,109157826,1065265,40889086,6730307,163931185,494469,163931091,60594093,55669745,18655489,17942684,6980537,166235465,6435586,4139398,4389047,364506122,78101667,262118402,20664221,2624640,158430173,494395,28948777,34810587,13399647,3660342,261278854,342350965,384482350,378792570,15988303,213424334,4558333,2098365,10835631,3318817,374074330,332639529,122919696,4389286,319443573,2781341,67464020,194709238,210061039,364506106,28949044,40889076,161172338,17943181,4557976,62738484,365813173,6137343,350610552,17942703,576308,223674070,15826518,1310997,93279697,4139395,255311799,157837067,361132363,357380836,146387678,383280379,1127268,299856826,13786789,1311054,46015217,3402130,381353319,30750059,218766885,340707375,27065817,355333104,2624634,62738384,241913553,304446010].includes(a)&&(s=a),await n.showClinvarPart2(e,t,s)}}catch(t){return void(s?n.processNoSnp(e):n.processNoClinvar(e))}}navClinVar(e){let t=this.icn3d;t.icn3dui;let s=this;t.currClin[e]=-1,$(document).on("click","#"+t.pre+e+"_prevclin",(function(t){let i=s.icn3d;t.stopImmediatePropagation();let n=void 0!==i.resi2disease_nonempty[e]?Object.keys(i.resi2disease_nonempty[e]).length:0;--i.currClin[e],i.currClin[e]<0&&(i.currClin[e]=n-1),s.showClinVarLabelOn3D(e)})),$(document).on("click","#"+t.pre+e+"_nextclin",(function(t){let i=s.icn3d;t.stopImmediatePropagation();let n=void 0!==i.resi2disease_nonempty[e]?Object.keys(i.resi2disease_nonempty[e]).length:0;++i.currClin[e],i.currClin[e]>n-1&&(i.currClin[e]=0),s.showClinVarLabelOn3D(e)}))}showClinVarLabelOn3D(e){let t,s,i=this.icn3d,n=i.icn3dui,l=Object.keys(i.resi2disease_nonempty[e]);t=e,s=t+"_"+(parseInt(l[i.currClin[e]])+i.baseResi[e]).toString();let r="",o=i.resi2disease_nonempty[e][l[i.currClin[e]]];for(let e=0,t=o.length;e(from human)",i=" (based on human sequences and mapped to this structure by sequence similarity)"),C+=m?'
";C+='';let O="",R=0,I=0;p?f.seqStartLen&&f.seqStartLen[h]&&(C+=f.showSeqCls.insertMulGapOverview(h,f.seqStartLen[h])):f.seqStartLen&&f.seqStartLen[h]&&(C+=f.showSeqCls.insertMulGap(f.seqStartLen[h],"-"));for(let t=1,a=f.giSeq[h].length;t<=a;++t)if(p){if(void 0!==r[t]){let e=f.giSeq[h][t-1],i=e;e.length>1&&(i=e[0]+"..");let n=f.ParserUtilsCls.getResi(h,t-1)+i+">";for(let e=0,i=s[t].length;e=0&&(C+='
"+f.showAnnoCls.addSnpButton(m,"snpin3d","3D with scap","SNP in 3D with scap",70,g)+" ",u+=f.showAnnoCls.addSnpButton(m,"snpinter","Interactions","SNP Interactions in 3D",70,g)+" ",u+=f.showAnnoCls.addSnpButton(m,"snppdb","PDB","Download SNP PDB",35,g)),u+="
Links: ClinVar, dbSNP(rs"+i[t][e]+")",e
"),++r)}r>d&&2==e&&(p+="..")}else{d=1;for(let e=v;e
"+f.showAnnoCls.addSnpButton(r,"snpin3d","3D with scap","SNP in 3D with scap",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snpinter","Interactions","SNP Interactions in 3D",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snppdb","PDB","Download SNP PDB",35,m)),0!=i[t][e]&&(u+="
Link: dbSNP(rs"+i[t][e]+")"),e
");else{let s=l[t][e].split("; "),a=o[t][e].split("; "),d="",c=0;for(let t=0,i=s.length;t0?d+="; ":0!==e&&1!==e||(O='disease="'+s[t]+'"'),d+=s[t]+"("+a[t]+")",++c;""!=d?(u+=": "+d,C&&!b.cfg.hidelicense&&(u+="
"+f.showAnnoCls.addSnpButton(r,"snpin3d","3D with scap","SNP in 3D with scap",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snpinter","Interactions","SNP Interactions in 3D",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snppdb","PDB","Download SNP PDB",35,m)),u+="
Links: ClinVar, dbSNP(rs"+i[t][e]+")"):(C&&!b.cfg.hidelicense&&(u+="
"+f.showAnnoCls.addSnpButton(r,"snpin3d","3D with scap","SNP in 3D with scap",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snpinter","Interactions","SNP Interactions in 3D",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snppdb","PDB","Download SNP PDB",35,m)),u+="
Link: dbSNP(rs"+i[t][e]+")"),e
")}}y>d&&2==e&&(p+="..")}u+="
",C}processSnpClinvar(e,t,s,i,n){let l=this.icn3d,r=l.icn3dui,o='")+1),h=s[4],p=i?"":s[5],S=i?"":s[6],A=i?"":s[7],x=l.ParserUtilsCls.getResi(t,d-1);v[x]=1,""!=S&&(_[x]=1),g[d]=e+1,void 0===u[d]&&(u[d]=[]),u[d].push(c),void 0===C[d]&&(C[d]=[]),C[d].push(h),void 0===y[d]&&(y[d]=[]),y[d].push(p),void 0===f[d]&&(f[d]=[]),f[d].push(S),""!=S&&(void 0===l.resi2disease_nonempty[t][d]&&(l.resi2disease_nonempty[t][d]=[]),l.resi2disease_nonempty[t][d].push(S)),void 0===b[d]&&(b[d]=[]),b[d].push(A)}let S=Object.keys(v),A=Object.keys(_);if(i){let e=!1;o+=this.getSnpLine(1,2,u,C,y,f,g,b,S,A,1,t,!1,e,void 0,i),o+=this.getSnpLine(2,2,u,C,y,f,g,b,S,A,0,t,!1,e,void 0,i),d+=this.getSnpLine(1,2,u,C,y,f,g,b,S,A,1,t,!1,e,!0,i),d+=this.getSnpLine(2,2,u,C,y,f,g,b,S,A,0,t,!1,e,!0,i),a+=this.getSnpLine(1,2,u,C,y,f,g,b,S,A,1,t,!0,e,void 0,i),o+="0&&this.elt_size[s.sse-1]>=6&&0!=s.adj_strand2&&e++}for(let e=0;e
",w+=x+k+"
";let O='';C+=A+k+O,y+=x+k+O,v+=A+k+O;let R=e.indexOf("_"),I="cst"+e.substr(R+1),T=0,E=0,P=(void 0===l||"seq"===l||"custom"===l)&&-1==s.indexOf("cannot-be-aligned")&&-1==s.indexOf("cannot be aligned"),M="identity"===l&&-1==s.indexOf("cannot-be-aligned")&&-1==s.indexOf("cannot be aligned"),D={},H=0;A="";let F={},L={},N={},q=0;if(h)for(let e=0,t=h.length;e
",O+="",C+=O,v+=A+O,y+=O,_+="",w+="",h?($("#"+p.pre+"dt_custom_"+e+"_"+f).html(y+C),$("#"+p.pre+"ov_custom_"+e+"_"+f).html(v),$("#"+p.pre+"tt_custom_"+e+"_"+f).html(w+_)):($("#"+p.pre+"dt_custom_"+e+"_"+f).html(C),$("#"+p.pre+"ov_custom_"+e+"_"+f).html(v),$("#"+p.pre+"tt_custom_"+e+"_"+f).html(_))}getExonHtml(e,t,s,i,n,l,r){let o=this.icn3d;return o.icn3dui,'20)return!1;if(void 0!==o.giSeq&&void 0!==o.giSeq[e]){let r=this.getFullText(s);return s=r.text,this.showNewTrack(e,t,s,void 0,void 0,i,n,l),!1}setTimeout((function(){a.checkGiSeq(e,t,s,i,n,l,r+1)}),100)}getFullText(e){this.icn3d.icn3dui;let t="",s=[],i=[],n=e.split(","),l=-1;for(let e=0,r=n.length;eA&&(A=e)}let x=S,k=w.length-(A+1),O=[],R=[];for(let e=0,t=p.length;e"),d=a[1].indexOf("\n");n=a[1].substr(d+1).replace(/\n/g,"");for(let e=2,t=a.length;e
Click \"Assembly\" in the menu \"View\" to switch between asymmetric unit and biological assembly("+e.asuCnt+" asymmetric unit).e.maxAnnoLengthOri&&(e.protein_chainid.hasOwnProperty(t)||s.hasOwnProperty(t))&&(e.maxAnnoLengthOri=e.chainsSeq[t].length);e.maxAnnoLength=e.maxAnnoLengthOri}return{nucleotide_chainid:s,chemical_chainid:i,chemical_set:n}}async showAnnotations(){let e=this.icn3d,t=e.icn3dui,s=this,i=this.showAnnotations_part1(),n=i.nucleotide_chainid,l=i.chemical_chainid,r=i.chemical_set;if(!e.bAnnoShown||e.bResetAnno)if(e.bAnnoShown=!0,void 0===t.cfg.blast_rep_id){if(e.bFullUi){if(void 0!==t.cfg.mmtfid){let t=Object.keys(e.structures)[0];await e.mmcifParserCls.downloadMmcifSymmetry(t,"mmtfid")}await this.showAnnoSeqData(n,l,r)}}else if(void 0===t.cfg.blast_rep_id||e.bSmithwm||e.bLocalSmithwm){if(void 0!==t.cfg.blast_rep_id&&(e.bSmithwm||e.bLocalSmithwm)){let i,o,a=[t.cfg.blast_rep_id];if(-1!=t.cfg.query_id.indexOf(">")?o=t.cfg.query_id.substr(t.cfg.query_id.indexOf("\n")+1):!/\d/.test(t.cfg.query_id)||t.cfg.query_id.length>50?o=t.cfg.query_id:a.push(t.cfg.query_id),e.blastAcxn){let s=t.cfg.afid+"_A",n="";for(let t=0,i=e.chainsSeq[s].length;t5){let n;e.uniprot2acc&&e.uniprot2acc[i]?e.uniprot2acc[i]:e.uniprot2acc={},n="https://rest.uniprot.org/uniprotkb/search?format=json&fields=xref_geneid,gene_names&query="+i;let l=await t.getAjaxPromise(n,"json"),r=l.results[0]&&l.results[0].uniProtKBCrossReferences&&l.results[0].uniProtKBCrossReferences[0]?l.results[0].uniProtKBCrossReferences[0].id:void 0,o=l.results[0]&&l.results[0].genes&&l.results[0].genes[0]&&l.results[0].genes[0].geneName?l.results[0].genes[0].geneName.value:"ID "+r;e.chainsGene[s]={geneId:r,geneSymbol:o}}}for(let s in e.protein_chainid){let i=t.utilsCls.isMobile()?"none":"button",l=e.showSeqCls.getProteinName(s),r=l,o=0==n?"Proteins:
":"",a=e.chainsGene[s]&&e.chainsGene[s].geneId&&e.chainsGene[s].geneDesc?"(Gene: "+e.chainsGene[s].geneSymbol+")":"",d=s.substr(0,s.indexOf("_")),c=d.length>5?''+s+"":s,h="
"),++n}if(t.bNode||e.annoCddSiteCls.setToolTip(),void 0!==e.chainid_seq)await this.processSeqData(e.chainid_seq);else try{let n=[],l=[];for(let e=0,t=i.length;e40&&(r=r.substr(0,40)+"...");let o="";0==i&&("protein"==s?o="Proteins:
":"nucleotide"==s?o="Nucleotides:
":"chemical"==s&&(o="Chemicals/Ions/Water:
")),$("#"+n.pre+"dl_annotations").append("
"),n.giSeq[e]=[];for(let t=0;t
":"",o=t[0].lastIndexOf("_"),a=t[0].substr(0,o),d=void 0!==l.cfg.mmdbid&&void 0!==n.chainid2sid?n.chainid2sid[a]:void 0;i=void 0!==d?""+e+" ":""+e+"",$("#"+n.pre+"dl_annotations").append("
");let c='
",c+="
",g+=u+'';let s=0,i=0,n="";a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e]," "));for(let t=0,l=o.length;t
",g+="
",g+=u+'',a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e],"-"));for(let t=0,s=o.length;t':'',g+=" ";else if("E"==a.secondaries[s]){a.firstAtomObjCls.getFirstCalphaAtomObj(a.residues[s]).ssend?"green"==a.sheetcolor?g+='':"yellow"==a.sheetcolor&&(g+=''):"green"==a.sheetcolor?g+='':"yellow"==a.sheetcolor&&(g+=''),g+=" "}else"c"==a.secondaries[s]?g+=' ':"o"==a.secondaries[s]&&(g+=' ');else g+="-"}a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqEndLen[e],"-")),g+='',g+="",g+="
",g+="
";let v='';g+=u+v,f+=u+v;let _,w=0;a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e],"-"));for(let t=0,s=o.length;t1&&(i=s[0]+".."),_=a.ParserUtilsCls.getResi(e,t),a.residues.hasOwnProperty(e+"_"+_)){let n="333333";if(d.cfg.blast_rep_id==e&&void 0!==a.fullpos2ConsTargetpos&&void 0!==a.fullpos2ConsTargetpos[t+w])n=a.fullpos2ConsTargetpos[t+w].color;else{let t=a.firstAtomObjCls.getFirstCalphaAtomObj(a.residues[e+"_"+_]),s=void 0===t.color||"FFFFFF"===t.color.getHexString().toUpperCase()||"FFF"===t.color.getHexString().toUpperCase()?"DDDDDD":t.color.getHexString();n=void 0!==t.color?s:"CCCCCC"}g+=''+i+""}else i=i.toLowerCase(),g+=''+i+""}a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqEndLen[e],"-")),d.cfg.blast_rep_id==e&&(a.opts.color=a.blastAcxn?"confidence":"conservation",a.setColorCls.setColorByOptions(a.opts,a.atoms));let S=a.firstAtomObjCls.getFirstCalphaAtomObj(a.chains[e]),A=S.color?S.color.getHexString():"CCCCCC",x=Math.round(a.seqAnnWidth*o.length/(a.maxAnnoLength+a.nTotalGap));if(x<1&&(x=1),a.seqStartLen&&a.seqStartLen[e]&&(f+=this.insertMulGapOverview(e,a.seqStartLen[e])),d.cfg.blast_rep_id!=e)f+='
",g+=u,f+=u,d.cfg.blast_rep_id==e){if(void 0!==r&&""!==r){u='
";let t='';g+=u+t,f+=u+t;let s=0,i=0,l=1;a.queryStart;for(let t=0,n=r.length;t
",g+=u,f+=u}u='
";let t='';g+=u+t,f+=u+t;let s=a.queryStart;for(let t=0,i=l.length;t-":(void 0===a.fullpos2ConsTargetpos||void 0===a.fullpos2ConsTargetpos[t]||a.residues.hasOwnProperty(e+"_"+a.fullpos2ConsTargetpos[t].pos)||(i=i.toLowerCase()),g+=''+i+"",++s)}let o=a.firstAtomObjCls.getFirstCalphaAtomObj(a.chains[e]),d=void 0===o.color||"FFFFFF"===o.color.getHexString()?"DDDDDD":o.color.getHexString(),c=void 0!==o.color?d:"CCCCCC",h=[],p=[],m="-";for(let e=0,t=l.length;e
",g+=u,f+=u}if(g+="",f+="",b+="",a.giSeq[e].length>10){let t=a.firstAtomObjCls.getFirstCalphaAtomObj(a.chains[e]);if((void 0!==d.cfg.mmdbid||void 0!==d.cfg.gi||void 0!==d.cfg.blast_rep_id||void 0!==d.cfg.align||void 0!==d.cfg.chainalign||void 0!==d.cfg.mmdbafid)&&void 0!==t.resi_ori&&t.resi_ori!=t.resi&&-1==e.indexOf("Misc")){u='
",g+=u+'',a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e],"-"));for(let t=0,s=o.length;t",e%10==0&&(g+=e+" "),g+=""}else g+=""}a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqEndLen[e],"-")),g+='',g+="",g+="
",g+="
",r+=c+'';let h=!1;for(let s=0,l=e.length;s
",r+="",A="-",x="--";for(let t=0,s=r.length;t0&&(T=1,t=i.getGraphCls.getNodeTopBottom(c[e],d,void 0,T,g[e]),h[e]=t.nodeArray1,m[e]=t.nodeArray2,d=n.hashUtilsCls.unionHash(d,t.name2node),T=2,t=i.getGraphCls.getNodeTopBottom(c[e],d,void 0,T,y[e]),f[e]=t.nodeArray1,b[e]=t.nodeArray2,d=n.hashUtilsCls.unionHash(d,t.name2node)),k[e]=l[e].length,O[e]=o[e].length,R=Math.max(R,O[e]),I.push(p[e])}let E,P,M,D,H,F=1,L=3*F,N=7*F,q=10,U=10,$=30,j=20;t?(M=(n.utilsCls.sumArray(k)+2*I.length)*(L+N)+4*U+2*$+j*I.length,P=(R+2)*(L+N)+2*q+$):(E=110+j,M=E*I.length,P=(R+2)*(L+N)+2*q,P+=20),Object.keys(i.chainsMapping).length>0&&(M*=3),t?(i.scatterplotWidth=2*P,H=i.scatterplotWidth,D=n.scatterplotid):(i.linegraphWidth=2*P,H=i.linegraphWidth,D=n.linegraphid),s=0==I.length?"No interactions found for each structure
":"2D integration graph for "+I.length+" structure(s) "+I+'. There are three sections: "Interactions", "Common interactions", and "Different interactions". Each section has '+I.length+" graphs.
",s+=""}else if(t){let e,t,l,c,h=p[0],m=o.length,u=a.length,g=1,f=3*g,b=7*g,C=30;t=(m+2)*(f+b)+2*10+C,e=(u+2)*(f+b)+2*10+C,i.scatterplotWidth=2*e,c=i.scatterplotWidth,l=n.scatterplotid,s=r.length>0?"":"No interactions found for these two sets
",s+=""}else{let e=p[0],t=o.length,l=a.length,c=1,h=3*c,m=7*c,u=110,g=10,f=t>l?t*(h+m)+2*g:l*(h+m)+2*g;i.linegraphWidth=2*f,s=r.length>0?"":"No interactions found for these two sets
",s+=""}return i.lineGraphStr+="}\n",i.scatterplotStr=i.lineGraphStr,t?$("#"+i.pre+"scatterplotDiv").html(s):$("#"+i.pre+"linegraphDiv").html(s),s}drawGraphPerType(e,t,s,i,n,l,r,o,a,d,c,h,p,m){let u=this.icn3d;u.icn3dui;let g,f,b="",C=2==t.length&&"2"==t[1].replace(t[0],"");0==e?(g="Interactions in ",f=""):1==e?(g="Common interactions in ",f="_common"):2==e&&(g="Different interactions in ",f="_diff");for(let y=0,v=t.length;y
",E=p.resid2specCls.atoms2residues(Object.keys(C)),P=p.resid2specCls.atoms2residues(Object.keys(y)),M="select "+p.resid2specCls.residueids2spec(E),D="select "+p.resid2specCls.residueids2spec(P);T+="Set 1: "+e+'
',T+="Set 2: "+t+'
',T+='
';let H=p.resid2specCls.atoms2residues(Object.keys(R)),F=p.resid2specCls.atoms2residues(Object.keys(I)),L="select "+p.resid2specCls.residueids2spec(H),N="select "+p.resid2specCls.residueids2spec(F);T+='interface_1
',T+='interface_2
';let q=T;if(("graph"==i||"linegraph"==i||"scatterplot"==i||b)&&(T=""),T+=O,"save1"==i||"save2"==i){T=q;let e="";"save1"==i?e="Set 1":"save2"==i&&(e="Set 2"),T+='
Interactions Sorted on '+e+': 0&&l!=a&&(i.push({res1:a,res2:w,cntHbond:f,cntIonic:b,cntContact:C,cntHalegen:y,cntPication:v,cntPistacking:_}),o+=this.getInteractionPerResidue(d,c,h,p,m,u,g,f,b,C,y,v,_),c="",h="",p="",m="",u="",g="",f=0,b=0,C=0,y=0,v=0,_=0,w=""),x=t.resids2inter[S].hbond,k=this.getInteractionPairDetails(x,e,"hbond"),c+=k.html,f+=k.cnt,k.cnt>0&&(w+=r+":hbond_"+k.cnt+" "),x=t.resids2inter[S].ionic,k=this.getInteractionPairDetails(x,e,"ionic"),h+=k.html,b+=k.cnt,k.cnt>0&&(w+=r+":ionic_"+k.cnt+" "),x=t.resids2inter[S].contact,k=this.getContactPairDetails(x,e,"contact"),p+=k.html,C+=k.cnt,k.cnt>0&&(w+=r+":contact_"+k.cnt+" "),x=t.resids2inter[S].halogen,k=this.getInteractionPairDetails(x,e,"halogen"),m+=k.html,y+=k.cnt,k.cnt>0&&(w+=r+":halogen_"+k.cnt+" "),x=t.resids2inter[S]["pi-cation"],k=this.getInteractionPairDetails(x,e,"pi-cation"),u+=k.html,v+=k.cnt,k.cnt>0&&(w+=r+":pi-cation_"+k.cnt+" "),x=t.resids2inter[S]["pi-stacking"],k=this.getInteractionPairDetails(x,e,"pi-stacking"),g+=k.html,_+=k.cnt,k.cnt>0&&(w+=r+":pi-stacking_"+k.cnt+" "),a=l,d=O}i.push({res1:a,res2:w,cntHbond:f,cntIonic:b,cntContact:C,cntHalegen:y,cntPication:v,cntPistacking:_}),o+=this.getInteractionPerResidue(d,c,h,p,m,u,g,f,b,C,y,v,_);let S="";if(n.length>0){S+='',S+="
",S+="Residue # Hydrogen
Bond# Salt Bridge
/Ionic Interaction# Contact ",S+="# Halogen
Bond# π-Cation # π-Stacking ",S+="Hydrogen Bond (backbone atoms: @CA, @N, @C, @O) Salt Bridge/Ionic Interaction Contact ",S+="Halogen Bond π-Cation π-Stacking ";let e=' ",S+="",S+=o,S+=" ';S+=e,S+=e,S+='Atom1 Atom2 Distance(Å) Highlight in 3D ',S+=e,S+=e,S+=e,S+="Atom1 Atom2 # Contacts Min Distance(Å) C-alpha Distance(Å) Highlight in 3D
"}return{html:S,bondCnt:i}}getInteractionPerResidue(e,t,s,i,n,l,r,o,a,d,c,h,p){this.icn3d.icn3dui;let m="";m+=' ",m}getInteractionPairDetails(e,t,s){let i=this.icn3d;i.icn3dui;let n="",l=0,r=' ';if(void 0!==e)for(let a in e){let d=a.split(","),c="save1"==t?d[0]:d[1],h="save1"==t?d[1]:d[0],p=i.getGraphCls.convertLabel2Resid(c),m=i.firstAtomObjCls.getFirstAtomObj(i.residues[p]),u=m.color?m.color.getHexString():"",g=i.getGraphCls.convertLabel2Resid(h),f=i.firstAtomObjCls.getFirstAtomObj(i.residues[g]),b=f.color?f.color.getHexString():"",C=Math.sqrt(e[a]).toFixed(1);n+=''+e[3]+e[2]+" "+o+" "+a+" "+d+" "+c+" "+h+" "+p+" ";let u=[t,s,i,n,l,r];for(let e in u){m+=' "}return m+="'+u[e]+"
",++l}return{html:n,cnt:l}}getContactPairDetails(e,t){let s=this.icn3d;s.icn3dui;let i="",n=0,l=' ';if(void 0!==e)for(let o in e){let a=o.split(","),d="save1"==t?a[0]:a[1],c="save1"==t?a[1]:a[0],h=s.getGraphCls.convertLabel2Resid(d),p=s.firstAtomObjCls.getFirstAtomObj(s.residues[h]),m=p.color?p.color.getHexString():"",u=s.getGraphCls.convertLabel2Resid(c),g=s.firstAtomObjCls.getFirstAtomObj(s.residues[u]),f=g.color?g.color.getHexString():"",b=e[o].split("_"),C=b[0],y=b[1],v=b[2],_=b[3],w=b[4];i+=' '+c+r+u+o+' '+h+r+b+o+' '+C+" ",n+='',n+=" ",n+=parseInt(w)}return{html:i,cnt:n}}exportInteractions(){var e=this.icn3d,t=e.icn3dui;let s=' '+d+"@"+v+l+m+r+' '+c+"@"+_+l+f+r+' '+w+' '+C+' '+y+" ",i+='',i+="
Interacting residues: ';for(let t in e.chainname2residues)for(let i in e.chainname2residues[t]){let n=t.substr(0,t.indexOf("_"))+"_"+i.substr(0,i.indexOf(" "));s+="Base Chain: Residues Interacting Chain "}s+=""+t+": ",s+=e.resid2specCls.residueids2spec(e.chainname2residues[t][i]),s+=" "+n+" "+n[e]+" Cys "+n[e+1]+" Cys ",++i}}let n='
'+i+" disulfide pairs: ";n+=s,n+="Residue ID 1 Residue ID 2 "+r+" "+t.resn+" "+o+" "+n.resn+" ",++i}n[r+"_"+o]=1,n[o+"_"+r]=1}}let l='
'+i+" cross-linkage pairs: ";l+=s,l+="Residue ID 1 Residue ID 2 ",++l}}let a=' '+t+r+d+o+' '+i+r+h+o+' '+p+" ","view"==e&&(n+=''),n+="
'+l+" hydrogen bond pairs (backbone atoms: @CA, @N, @C, @O):
";if(l>0&&(a+=" ",a+=n,a+="Atom 1 Atom 2 Distance(Å) ","view"==e&&(a+='Highlight in 3D '),a+="
"),"graph"==e||"linegraph"==e||"scatterplot"==e){return s.getGraphCls.getGraphLinks(s.resid2ResidhashHbond,s.resid2ResidhashHbond,i.htmlCls.hbondColor,t,i.htmlCls.hbondValue)}return a}exportSaltbridgePairs(e,t){var s=this.icn3d,i=s.icn3dui;let n="",l=0,r=' ';for(let t in s.resid2ResidhashSaltbridge){let i=s.getGraphCls.convertLabel2Resid(t),a=s.firstAtomObjCls.getFirstAtomObj(s.residues[i]),d=a.color?a.color.getHexString():"";for(let i in s.resid2ResidhashSaltbridge[t]){let a=s.getGraphCls.convertLabel2Resid(i),c=s.firstAtomObjCls.getFirstAtomObj(s.residues[a]),h=c.color?c.color.getHexString():"",p=Math.sqrt(s.resid2ResidhashSaltbridge[t][i]).toFixed(1);n+=' ",++l}}let a=' '+t+r+d+o+' '+i+r+h+o+' '+p+" ","view"==e&&(n+=''),n+="
'+l+" salt bridge/ionic interaction pairs:
";if(l>0&&(a+=" ",a+=n,a+="Atom 1 Atom 2 Distance(Å) ","view"==e&&(a+='Highlight in 3D '),a+="
"),"graph"==e||"linegraph"==e||"scatterplot"==e){return s.getGraphCls.getGraphLinks(s.resid2ResidhashSaltbridge,s.resid2ResidhashSaltbridge,i.htmlCls.ionicColor,t,i.htmlCls.ionicValue)}return a}exportHalogenPiPairs(e,t,s){var i=this.icn3d,n=i.icn3dui;let l,r,o,a="",d=0,c=' ';"halogen"==s?(l=i.resid2ResidhashHalogen,r=n.htmlCls.halogenColor,o=n.htmlCls.halogenValue):"pi-cation"==s?(l=i.resid2ResidhashPication,r=n.htmlCls.picationColor,o=n.htmlCls.picationValue):"pi-stacking"==s&&(l=i.resid2ResidhashPistacking,r=n.htmlCls.pistackingColor,o=n.htmlCls.pistackingValue);for(let t in l){let n=i.getGraphCls.convertLabel2Resid(t),r=i.firstAtomObjCls.getFirstAtomObj(i.residues[n]),o=r.color?r.color.getHexString():"";for(let n in l[t]){let r=i.getGraphCls.convertLabel2Resid(n),p=i.firstAtomObjCls.getFirstAtomObj(i.residues[r]),m=p.color?p.color.getHexString():"",u=Math.sqrt(l[t][n]).toFixed(1);a+=' ",++d}}let p=' '+t+c+o+h+' '+n+c+m+h+' '+u+" ","view"==e&&(a+=''),a+="
'+d+" "+s+" pairs:
";if(d>0&&(p+=" ",p+=a,p+="Atom 1 Atom 2 Distance(Å) ","view"==e&&(p+='Highlight in 3D '),p+="
"),"graph"==e||"linegraph"==e||"scatterplot"==e){return i.getGraphCls.getGraphLinks(l,l,r,t,o)}return p}exportSpherePairs(e,t,s){var i=this.icn3d,n=i.icn3dui;let l="",r=0,o=e?i.resid2ResidhashInteractions:i.resid2ResidhashSphere,a=' ';for(let s in o){let n=i.getGraphCls.convertLabel2Resid(s),c=i.firstAtomObjCls.getFirstAtomObj(i.residues[n]),h=c.color?c.color.getHexString():"";for(let n in o[s]){let p=i.getGraphCls.convertLabel2Resid(n),m=i.firstAtomObjCls.getFirstAtomObj(i.residues[p]),u=m.color?m.color.getHexString():"",g=o[s][n].split("_"),f=g[0],b=g[1];c=g[2],m=g[3];let C=g[4];e?(l+=' "):l+=" '+s+"@"+c+a+h+d+' '+n+"@"+m+a+u+d+' '+C+' '+f+' '+b+" ","view"==t&&(l+=''),l+=" ",++r}}let c='"+s+" "+n+' '+C+' '+f+' '+b+"
'+r+" residue pairs in "+(e?"the contacts":"sphere")+":
";if(r>0&&(e?(c+=' "):c+='Residue 1 Residue 2 Num Contacts Min Distance(Å) C-alpha Distance(Å) ',"view"==t&&(c+='Highlight in 3D '),c+=" ',c+=l,c+="Residue 1 Residue 2 Num Contacts Min Distance(Å) C-alpha Distance(Å)
"),"graph"==t||"linegraph"==t||"scatterplot"==t||"calpha"==t||"cbeta"==t||"heavyatoms"==t){return i.getGraphCls.getGraphLinks(o,o,n.htmlCls.contactColor,s,n.htmlCls.contactValue)}return c}}class $t{constructor(e){this.icn3d=e}drawGraph(e,t){var s=this.icn3d,i=s.icn3dui;if(void 0===n)var n=d3;var l=JSON.parse(e),r=$("#"+t).width(),o=$("#"+t).height(),a=isNaN(r)?300:1*r,d=isNaN(o)?300:1*o,c=r,h=o,p=d3.select("#"+i.svgid).attr("width",r).attr("height",o).attr("viewBox","0,0,"+a+","+d);p.selectAll(".g-main").remove();var m=p.append("g").classed("g-main",!0),u=m.append("rect").attr("width",c).attr("height",h).style("fill","#FFF"),g=m.append("g"),f=n.zoom().on("zoom",(function(){g.attr("transform",n.event.transform)}));if(m.call(f),l.links){for(var b=[],C={},y=0,v=l.nodes.length;y
",i+="",g+="}\n",t){n.alignerrormapStr=g,$("#"+n.pre+"alignerrormapDiv").html(i);let e=$("#"+l.alignerrormapid+"_scale").val();$("#"+l.alignerrormapid).attr("width",(n.alignerrormapWidth*parseFloat(e)).toString()+"px")}else n.contactmapStr=g,$("#"+n.pre+"contactmapDiv").html(i);return i}}class Bt{constructor(e){this.icn3d=e}async downloadAlignment(e,t){let s=this.icn3d,i=s.icn3dui,n=this;s.opts.proteins="c alpha trace";let l=e.split(","),r="ids="+e,o=i.htmlCls.baseUrl+"vastplus/vastplus.cgi?v=3&cmd=c&b=1&s=1&w3d&"+r;void 0!==i.cfg.inpara&&(o+=i.cfg.inpara),s.pdbid_chain2title={},void 0===s.chainids2resids&&(s.chainids2resids={});let a={},d="These two MMDB IDs "+l+' do not have 3D alignment data in the VAST+ database. You can try the VAST alignment by visiting the VAST+ page https://www.ncbi.nlm.nih.gov/Structure/vastplus/vastplus.cgi?uid=[PDB ID] (e.g., uid=1KQ2), and clicking "Original VAST"',c=await i.getAjaxPromise(o,"jsonp",!0,d);if(a=c.seqalign,void 0===a)return alert(d),!1;s.pdbid_molid2chain={},s.chainsColor={};for(let e=0,t=2;e5){let s=!0,i=!0;c=await r.pdbParserCls.loadPdbData(t[e],l,!1,s,"query",h,i)}else{let s=!0;c=await r.mmdbParserCls.parseMmdbData(t[e],"query",i[e+1],e,h,s)}d=o.hashUtilsCls.unionHash(d,c)}if(o.cfg.resnum)await r.realignParserCls.realignChainOnSeqAlign(s,i);else if(o.cfg.resdef)await r.realignParserCls.realignChainOnSeqAlign(s,i,void 0,!0);else{await r.pdbParserCls.applyCommandDssp(!0);for(let e in r.pdbChainIndexHash){let t=r.pdbChainIndexHash[e].split("_");l=t[0],t[1],n=t[2],t[3],a.transformStructure(l,e-1,"query")}let e=[],t=[],c=[],h=o.htmlCls.baseUrl+"vastdyn/vastdyn.cgi",p=o.htmlCls.baseUrl+"tmalign/tmalign.cgi";for(let s in r.afChainIndexHash){let i=r.afChainIndexHash[s].split("_");l=i[0];let a=i[1];n=i[2];let d,m=i[3];if("tmalign"!=o.cfg.aligntool){let e={domains1:r.domain3dCls.getDomainJsonForAlign(r.chains[l+"_"+a]),domains2:r.domain3dCls.getDomainJsonForAlign(r.chains[n+"_"+m])};d=o.getAjaxPostPromise(h,e)}else{let e={pdb_query:r.saveFileCls.getAtomPDB(r.chains[l+"_"+a]),pdb_target:r.saveFileCls.getAtomPDB(r.chains[n+"_"+m])};d=o.getAjaxPostPromise(p,e)}e.push(d),t.push(s-1),c.push(l)}let m=Promise.allSettled(e),u=await m;await a.downloadChainalignmentPart2b(s,i,d,u,t,n,c)}}async downloadChainalignmentPart2b(e,t,s,i,n,l,r){let o=this.icn3d,a=o.icn3dui;for(let e=0,t=i.length;e
",r.tmscore=e[0].score.toPrecision(4)),$("#"+r.pre+"dl_rmsd_html").html(n),o.cfg.bSidebyside||o.htmlCls.dialogCls.openDlg("dl_rmsd","RMSD of alignment"),a=!0}return a}async loadOpmDataForChainalign(e,t,s,i){let n=this.icn3d,l=n.icn3dui,r=this;if(l.cfg.resnum||l.cfg.resdef)n.bCommandLoad||n.init(),await this.downloadChainalignmentPart2(e,t,void 0,s);else{let o=l.htmlCls.baseUrl+"vastdyn/vastdyn.cgi?mmdbids2opm="+i.join("','"),a=await l.getAjaxPromise(o,"jsonp");if(a&&a.mmdbid){let i=a.mmdbid;n.selectedPdbid=i;let o="https://opm-assets.storage.googleapis.com/pdb/"+i.toLowerCase()+".pdb",d=await l.getAjaxPromise(o,"text");n.bOpm=!0;let c=!0,h=n.loadPDBCls.loadPDB(d,i,n.bOpm,c);$("#"+n.pre+"selectplane_z1").val(n.halfBilayerSize),$("#"+n.pre+"selectplane_z2").val(-n.halfBilayerSize),$("#"+n.pre+"extra_mem_z").val(n.halfBilayerSize),$("#"+n.pre+"intra_mem_z").val(-n.halfBilayerSize),n.bCommandLoad||n.init(),await r.downloadChainalignmentPart2(e,t,h,s)}else n.bCommandLoad||n.init(),await r.downloadChainalignmentPart2(e,t,void 0,s)}}async downloadMmdbAf(e,t,s){let i=this.icn3d,n=i.icn3dui;i.structArray=i.structures?Object.keys(i.structures):[],0==i.structArray.length?i.init():(i.resetConfig(),i.bResetAnno=!0,i.bResetSets=!0);let l=e.split(","),r=[];for(let e=0,t=l.length;e1&&($("#"+i.pre+"assemblyWrapper").show(),i.asuCnt=i.biomtMatrices.length);let d,c,h,p,m,u,g,f,b,C,y,v,_,w,S,A,x,k,O,R={},I=[],T="coil",E="",P=0,M=0,D={onModel:function(e){d=0===e.modelIndex?a:a+(e.modelIndex+1).toString()},onChain:function(e){c=e.chainName;let t=d+"_"+c;void 0===i.structures[d]&&(i.structures[d]=[]),i.structures[d].push(t)},onGroup:function(e){h=e.groupName,p=e.groupId;let t=d+"_"+c+"_"+p;m=0===e.secStruct||2===e.secStruct||4===e.secStruct?"helix":3===e.secStruct?"sheet":-1===e.secStruct?"other":"coil";let s=!1;if(c!==E){if(x=void 0,O=void 0,"coil"!==m&&"other"!==m?(u=!0,g=!1):(u=!1,g=!1),"coil"!==T&&"other"!==T){let e=d+"_"+E+"_"+P.toString();for(let t in i.residues[e])i.atoms[t].ssbegin=!1,i.atoms[t].ssend=!0}}else x=A,O=k,m!==T?"coil"===T||"other"===T?(u=!0,g=!1):"coil"===m||"other"===m?(s=!0,u=!1,g=!1):("sheet"===T&&"helix"===m||"helix"===T&&"sheet"===m)&&(s=!0,u=!0,g=!1):(u=!1,g=!1);if(s&&!isNaN(p)){let e=d+"_"+c+"_"+(p-1).toString();for(let t in i.residues[e])i.atoms[t].ssbegin=!1,i.atoms[t].ssend=!0}T=m,E=c,P=p,f=!1,b=!1,C=!1,"non-polymer"===e.chemCompType.toLowerCase()||"other"===e.chemCompType.toLowerCase()||-1!==e.chemCompType.toLowerCase().indexOf("saccharide")?f=!0:-1!==e.chemCompType.toLowerCase().indexOf("peptide")?b=!0:-1!==e.chemCompType.toLowerCase().indexOf("dna")||-1!==e.chemCompType.toLowerCase().indexOf("rna")?C=!0:b=!0;let l=d+"_"+c,r={};r.resi=p,r.name=n.utilsCls.residueName2Abbr(h),i.residueId2Name[t]=r.name,r.resi%10==0&&r.resi.toString();let o="-";"helix"===m?o="H":"sheet"===m?o="E":"coil"===m?o="c":"other"===m&&(o="o"),void 0===i.chainsSeq[l]&&(i.chainsSeq[l]=[]),i.bFullUi&&i.chainsSeq[l].push(r),i.secondaries[t]=o},onAtom:function(e){if(y=e.element,v=e.atomName,_=new THREE.Vector3(e.xCoord,e.yCoord,e.zCoord),w=e.bFactor,S=e.altLoc,"\0"===e.altLoc&&(S=""),""===S||"A"===S){++M,"SG"===v&&I.push(M),R[e.atomIndex]=M;let t={het:f,serial:M,name:v,alt:S,resn:h,structure:d,chain:c,resi:p,coord:_,b:w,elem:y,bonds:[],bondOrder:[],ss:m,ssbegin:u,ssend:g};if(t.het||"C"!==t.name||(A=M),t.het||"O"!==t.name||(k=M),!t.het&&"N"===t.name&&void 0!==x&&void 0!==O){let e=i.atoms[x].coord.distanceTo(i.atoms[O].coord),s=t.coord.x+(i.atoms[x].coord.x-i.atoms[O].coord.x)/e,n=t.coord.y+(i.atoms[x].coord.y-i.atoms[O].coord.y)/e,l=t.coord.z+(i.atoms[x].coord.z-i.atoms[O].coord.z)/e;t.hcoord=new THREE.Vector3(s,n,l)}i.atoms[M]=t,l.min(_),r.max(_),o.add(_);let a=d+"_"+c,T=a+"_"+p;void 0===i.chains[a]&&(i.chains[a]={}),i.chains[a][M]=1,void 0===i.residues[T]&&(i.residues[T]={}),i.residues[T][M]=1,b?(i.proteins[M]=1,"CA"===v&&(i.calphas[M]=1),"N"!==v&&"H"!==v&&"CA"!==v&&"HA"!==v&&"C"!==v&&"O"!==v&&(i.sidec[M]=1)):C?(i.nucleotides[M]=1,(!s||"O3'"!=v&&"O3*"!=v)&&(s||"P"!=v)||(i.nucleotidesO3[M]=1),-1===n.parasCls.nuclMainArray.indexOf(v)&&(i.ntbase[M]=1)):y.toLowerCase()===h.toLowerCase()?i.ions[M]=1:"HOH"===h||"WAT"===h||"SQL"===h||"H2O"===h||"W"===h||"DOD"===h||"D3O"===h?i.water[M]=1:i.chemicals[M]=1,i.dAtoms[M]=1,i.hAtoms[M]=1}},onBond:function(e){let t=R[e.atomIndex1],s=R[e.atomIndex2];if(R.hasOwnProperty(e.atomIndex1)&&R.hasOwnProperty(e.atomIndex2)&&(i.atoms[t].bonds.push(s),i.atoms[s].bonds.push(t),f)){let n=e.bondOrder;i.atoms[t].bondOrder.push(n),i.atoms[s].bondOrder.push(n),2===n?(i.doublebonds[t+"_"+s]=1,i.doublebonds[s+"_"+t]=1):3===n&&(i.triplebonds[t+"_"+s]=1,i.triplebonds[s+"_"+t]=1)}}};MMTF.traverse(e,D),i.loadPDBCls.setResidMapping();for(let e=0,t=I.length;e5){let e=r.cfg.chainalign.split(",");e.length>0&&(l.hAtoms=l.definedSetsCls.getAtomsFromNameArray(e)),r.cfg.aligntool="tmalign",await l.realignParserCls.realignOnStructAlign()}else l.hAtoms=l.chainalignParserCls.setMsa(e),l.transformCls.zoominSelection(),await l.chainalignParserCls.downloadChainalignmentPart3(void 0,e,l.hAtoms)}async parseChainRealignData(e,t,s,i,n,l,r){let o=this.icn3d,a=o.icn3dui,d=s[0].substr(0,s[0].indexOf("_"));r||(d=d.toUpperCase());let c={};o.realignResid={},o.opts.color="grey",o.setColorCls.setColorByOptions(o.opts,o.dAtoms),o.qt_start_end=[];for(let t=0,h=e.length;t9||s<0)return n*i|0;i=10*i+s|0}return n*i}function u(e,t,s){let i=1,n=0,l=0,r=1;for(45===e.charCodeAt(t)&&(i=-1,++t);t=0&&o<10)){if(-2===o){for(++t;t=0&&o<10))return 53===o||21===o?parseScientific(i*(n+l/r),e,t+1,s):i*(n+l/r);l=10*l+o,r*=10,++t}return i*(n+l/r)}if(53===o||21===o)return parseScientific(i*n,e,t+1,s);break}n=10*n+o,++t}return i*n}let g=function(){function e(e){this.data=e,this.isDefined=!0}return e.prototype.getString=function(e){return""+this.data[e]},e.prototype.getInteger=function(e){return 0|this.data[e]},e.prototype.getFloat=function(e){return 1*this.data[e]},e.prototype.stringEquals=function(e,t){return this.data[e]===u(t,0,t.length)},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return 0},e}(),f=function(){function e(e,t){this.data=e,this.mask=t,this.isDefined=!0}return e.prototype.getString=function(e){return 0===this.mask[e]?""+this.data[e]:null},e.prototype.getInteger=function(e){return 0===this.mask[e]?this.data[e]:0},e.prototype.getFloat=function(e){return 0===this.mask[e]?this.data[e]:0},e.prototype.stringEquals=function(e,t){return 0===this.mask[e]?this.data[e]===u(t,0,t.length):null==t},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return this.mask[e]},e}(),b=function(){function e(e){this.data=e,this.isDefined=!0}return e.prototype.getString=function(e){return this.data[e]},e.prototype.getInteger=function(e){let t=this.data[e];return m(t,0,t.length)},e.prototype.getFloat=function(e){let t=this.data[e];return u(t,0,t.length)},e.prototype.stringEquals=function(e,t){return this.data[e]===t},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return 0},e}(),C=function(){function e(e,t){this.data=e,this.mask=t,this.isDefined=!0}return e.prototype.getString=function(e){return 0===this.mask[e]?this.data[e]:null},e.prototype.getInteger=function(e){if(0!==this.mask[e])return 0;let t=this.data[e];return m(t||"",0,(t||"").length)},e.prototype.getFloat=function(e){if(0!==this.mask[e])return 0;let t=this.data[e];return u(t||"",0,(t||"").length)},e.prototype.stringEquals=function(e,t){return this.data[e]===t},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return this.mask[e]},e}(),y=function(){function e(e){this.dataBlocks=e.dataBlocks.map((function(e){return new i(e)}))}return e.prototype.toJSON=function(){return this.dataBlocks.map((function(e){return e.toJSON()}))},e}();return new y(s)}MessagePackParse(e){this.icn3d.icn3dui;let t=this;function s(e,s){let i={};for(let n=0;n0&&(i[i.length]=l.slice(0,a).join(""));return i.join("")}(e.buffer,e.offset,t);return e.offset+=t,s}let r=function(){let e=[];for(let t=0;t<1024;t++)e[t]=String.fromCharCode(t);return e}();let o,a,d=e.buffer[e.offset];if(0==(128&d))return e.offset++,d;if(128==(240&d))return a=15&d,e.offset++,s(e,a);if(144==(240&d))return a=15&d,e.offset++,n(e,a);if(160==(224&d))return a=31&d,e.offset++,l(e,a);if(224==(224&d))return o=e.dataView.getInt8(e.offset),e.offset++,o;switch(d){case 192:return e.offset++,null;case 194:return e.offset++,!1;case 195:return e.offset++,!0;case 196:return a=e.dataView.getUint8(e.offset+1),e.offset+=2,i(e,a);case 197:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,i(e,a);case 198:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,i(e,a);case 202:return o=e.dataView.getFloat32(e.offset+1),e.offset+=5,o;case 203:return o=e.dataView.getFloat64(e.offset+1),e.offset+=9,o;case 204:return o=e.buffer[e.offset+1],e.offset+=2,o;case 205:return o=e.dataView.getUint16(e.offset+1),e.offset+=3,o;case 206:return o=e.dataView.getUint32(e.offset+1),e.offset+=5,o;case 208:return o=e.dataView.getInt8(e.offset+1),e.offset+=2,o;case 209:return o=e.dataView.getInt16(e.offset+1),e.offset+=3,o;case 210:return o=e.dataView.getInt32(e.offset+1),e.offset+=5,o;case 217:return a=e.dataView.getUint8(e.offset+1),e.offset+=2,l(e,a);case 218:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,l(e,a);case 219:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,l(e,a);case 220:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,n(e,a);case 221:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,n(e,a);case 222:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,s(e,a);case 223:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,s(e,a)}}}class ss{constructor(e){this.icn3d=e}alignCoords(e,t,s,i,n,l,r,o){let a,d=this.icn3d,c=d.icn3dui,h=e.length
Realignment RMSD: "+a.toPrecision(4)+" Å
";d.bAfMem&&!c.cfg.chainalign&&(e+=c.utilsCls.getMemDesc()),$("#"+d.pre+"dl_rmsd_html").html(e),c.cfg.bSidebyside||c.htmlCls.dialogCls.openDlg("dl_rmsd","Realignment RMSD")}let r={};for(let n=0,l=d.structures[s].length;n
"+t.diagram2dCls.set2DdgmNote(),$("#"+t.pre+"dl_2ddgm_html").html(t.html2ddgm)),t.b2DShown=!0}showLoading(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"wait")&&$("#"+e.pre+"wait").show(),$("#"+e.pre+"canvas")&&$("#"+e.pre+"canvas").hide(),$("#"+e.pre+"cmdlog")&&$("#"+e.pre+"cmdlog").hide()}hideLoading(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"wait")&&$("#"+e.pre+"wait").hide(),$("#"+e.pre+"canvas")&&$("#"+e.pre+"canvas").show(),$("#"+e.pre+"cmdlog")&&$("#"+e.pre+"cmdlog").show()}setYourNote(e){let t=this.icn3d,s=t.icn3dui;t.yournote=e,$("#"+t.pre+"yournote").val(t.yournote),s.cfg.shownote&&(document.title=t.yournote)}transformToOpmOri(e){let t=this.icn3d;if(t.icn3dui,void 0!==t.rmsd_supr&&void 0!==t.rmsd_supr.rot){let s=t.rmsd_supr.rot,i=t.rmsd_supr.trans1,n=t.rmsd_supr.trans2;t.rmsd_supr.rmsd;let l=0;for(let e in t.atoms){let r=t.atoms[e];r.coord=t.surfaceCls.transformMemPro(r.coord,s,i,n);let o=r.coord.x*r.coord.x+r.coord.y*r.coord.y;Math.abs(r.coord.z)<=25&&o>l&&(l=o)}this.addMemAtoms(t.halfBilayerSize,e,Math.sqrt(l)),t.bStopRotate=!0,t.bOpm=!0,$("#"+t.pre+"togglememli").show(),$("#"+t.pre+"adjustmemli").show(),$("#"+t.pre+"selectplaneli").show()}else t.bOpm=!1}transformToOpmOriForAlign(e,t,s){let i=this.icn3d,n=i.icn3dui;if(void 0!==t){let l=i.loadPDBCls.getChainCalpha(i.chains,i.atoms,s,e),r=1==Object.keys(l.chainresiCalphaHash).length||1==Object.keys(t.chainresiCalphaHash).length,o=[],a=[];for(let e in l.chainresiCalphaHash)if(t.chainresiCalphaHash.hasOwnProperty(e)){let s=l.chainresiCalphaHash[e],i=t.chainresiCalphaHash[e];if((s.length==i.length||r)&&(o=o.concat(s),a=a.concat(i)),o.length>500)break}let d=o.length=2?$("#"+e.pre+"mn2_alternateWrap").show():$("#"+e.pre+"mn2_alternateWrap").hide(),setTimeout((async function(){if(e.bInitial){if(void 0!==t.cfg.align||void 0!==t.cfg.chainalign){let s=e.pre+"selection";if($("#"+s).show(),$("#"+s+"_expand").hide(),$("#"+s+"_shrink").show(),void 0!==t.cfg.align&&2!=t.cfg.atype){let s=!1,i=t.htmlCls.alignSeqCls.getAlignSequencesAnnotations(Object.keys(e.alnChains),void 0,void 0,s);$("#"+e.pre+"dl_sequence2").html(i.sequencesHtml),$("#"+e.pre+"dl_sequence2").width(t.htmlCls.RESIDUE_WIDTH*i.maxSeqCnt+200)}}if(t.cfg.showanno){let s="view annotations";t.htmlCls.clickMenuCls.setLogCmd(s,!0),await e.showAnnoCls.showAnnotations()}(t.cfg.closepopup||t.cfg.imageonly)&&e.resizeCanvasCls.closeDialogs()}else e.hlUpdateCls.updateHlAll();$("#"+e.pre+"atomsCustom").length>0&&$("#"+e.pre+"atomsCustom")[0].blur(),e.bInitial=!1,t.cfg.imageonly&&e.saveFileCls.saveFile(void 0,"png",void 0,!0)}),0)}processCommand(){let e=this.icn3d,t=e.icn3dui;if(1==Object.keys(e.structures).length){let s=Object.keys(e.structures)[0];t.cfg.command=t.cfg.command.replace(new RegExp("!","g"),s+"_")}}getMassCenter(e,t){return this.icn3d.icn3dui,e.multiplyScalar(1/t)}getGeoCenter(e,t){return this.icn3d.icn3dui,e.clone().add(t).multiplyScalar(.5)}getStructureSize(e,t,s,i){let n=this.icn3d;n.icn3dui;let l=0;for(let r in e){let e=n.atoms[r].coord;if(Math.round(t.x)==Math.round(e.x)||Math.round(t.y)==Math.round(e.y)||Math.round(t.z)==Math.round(e.z)||Math.round(s.x)==Math.round(e.x)||Math.round(s.y)==Math.round(e.y)||Math.round(s.z)==Math.round(e.z)){let t=2*e.distanceTo(i);t>l&&(l=t)}}return l}async checkMemProteinAndRotate(){let e=this.icn3d,t=e.icn3dui;if(!e.bCheckMemProtein){e.bCheckMemProtein=!0;let s=t.cfg.afid?t.cfg.afid:t.cfg.mmdbafid;if(await e.ParserUtilsCls.checkMemProtein(s),t.cfg.url&&-1!=t.cfg.url.indexOf("membranome")){let t=new THREE.Vector3(1,0,0),s=-.5*Math.PI;e.transformCls.setRotation(t,s)}}}async checkMemProtein(e){let t=this.icn3d,s=t.icn3dui;try{let i=s.htmlCls.baseUrl+"vastdyn/vastdyn.cgi?afid2mem="+e,n=await s.getAjaxPromise(i,"jsonp");if(n&&n.pdbid){let e='This is a single-spanning (bitopic) transmembrane protein according to the Membranome database. Do you want to align the protein with the model from Membranome? If you click "OK", you can press the letter "a" to alternate the structures.';if("off"==s.cfg.afmem);else if("on"==s.cfg.afmem||confirm(e))try{let e="https://storage.googleapis.com/membranome-assets/pdb_files/proteins/"+n.pdbid+".pdb",i=await s.getAjaxPromise(e,"text");t.bAfMem=!0,s.bNode||$("#"+s.pre+"togglememli").show();let l=n.pdbid.substr(0,n.pdbid.indexOf("_")),r=!0,o=!0;await t.pdbParserCls.loadPdbData(i,l,r,o),o&&(t.bSetChainsAdvancedMenu&&t.definedSetsCls.showSets(),t.bAnnoShown&&await t.showAnnoCls.showAnnotations());let a=n.segment.replace(/ /gi,"").split("(")[0];t.afmem_start_end=a.split("-"),t.hAtoms={},t.dAtoms={};for(let e in t.atoms)t.atoms[e].structure!=l&&(t.hAtoms[e]=1),t.dAtoms[e]=1;for(let e=parseInt(t.afmem_start_end[0]);e<=parseInt(t.afmem_start_end[1]);++e)t.hAtoms=s.hashUtilsCls.unionHash(t.hAtoms,t.residues[l+"_A_"+e]);await t.realignParserCls.realignOnSeqAlign(l)}catch(e){return void console.log("Error in retrieving matched PDB from Membranome...")}}}catch(e){return void console.log("Error in finding matched PDB in Membranome...")}}getResi(e,t){let s=this.icn3d;s.icn3dui;let i=s.ncbi2resid[e+"_"+(t+1).toString()];return i?i.substr(i.lastIndexOf("_")+1):""}getResiNCBI(e,t){let s=this.icn3d;s.icn3dui;let i=s.resid2ncbi[e+"_"+t];return i?parseInt(i.substr(i.lastIndexOf("_")+1)):0}}class is{constructor(e){this.icn3d=e}loadAtomDataIn(e,t,s,i,n,l,r,o,a){let d=this.icn3d,c=d.icn3dui;d.pmin=new THREE.Vector3(9999,9999,9999),d.pmax=new THREE.Vector3(-9999,-9999,-9999),d.psum=new THREE.Vector3;let h=e.atoms,p=d.atoms?Object.keys(d.atoms).length:0,m={},u={};d.pmid=e.pubmedId,void 0===d.chainid2title&&(d.chainid2title={}),void 0===d.chainid2sid&&(d.chainid2sid={});let g={},f={};if("align"===s){d.pmid="",d.molTitle="",c.cfg.inpara&&-1!==c.cfg.inpara.indexOf("atype=1")?d.molTitle="Invariant Core Structure Alignment (VAST) of ":c.cfg.inpara&&-1!==c.cfg.inpara.indexOf("atype=2")?d.molTitle="Structure Alignment (TM-align) of ":d.molTitle="Structure Alignment (VAST) of ";let t=!1;for(let s=0,i=e.alignedStructures[0].length;s'+i.pdbId.toUpperCase()+"",void 0!==i.descr&&(d.pmid+=i.descr.pubmedid),0===s&&(d.molTitle+=" and ",void 0!==i.descr&&(d.pmid+="_")),t=!0}d.molTitle+=" from VAST+",t||(d.molTitle="")}else if(void 0!==e.descr&&(d.molTitle+=e.descr.name),"mmdbid"===s){let s=isNaN(t)?t:e.pdbId,i={};void 0===d.alignmolid2color&&(d.alignmolid2color=[]);let n=1;for(let t in e.moleculeInfor){if(0===Object.keys(e.moleculeInfor[t]).length)continue;let l=e.moleculeInfor[t].chain.trim();(parseInt(c.cfg.date)>=20231001||!c.cfg.date&&parseInt(c.utilsCls.getDateDigitStr())>=20231001)&&(l=l.replace(/_/g,""));let r=s+"_"+l;i.hasOwnProperty(l)?(++i[l],r+=i[l]):i[l]=1,void 0!==d.mmdbid_q&&(d.mmdbid_q,d.mmdbid_t);let o=e.moleculeInfor[t].kind,a=e.moleculeInfor[t].color,h=e.moleculeInfor[t].sid;if(g[r]=o,f[r]=a,"protein"==o&&(d.organism=e.moleculeInfor[t].taxonomyName.toLowerCase()),void 0!==h&&(d.chainid2sid[r]=h),void 0===d.pdbid_chain2title&&(d.pdbid_chain2title={}),d.pdbid_chain2title[r]=e.moleculeInfor[t].name,l==r.substr(r.lastIndexOf("_"))){let e={};e[t]=n.toString(),d.alignmolid2color.push(e)}++n}}"mmdbid"===s&&(d.molTitleHash||(d.molTitleHash={}),d.molTitleHash[t]=d.molTitle);let b,C,y,v,_,w={},S="",A="",x="",k="",O="",R="",I=0,T=0,E="",P=!0,M=!1,D="",H=c.utilsCls.isCalphaPhosOnly(h),F=0,L={};for(let e in h){++p,w[e]=p;let i,n=h[e];n.serial=p,"mmdbid"===s||"mmcifid"===s?i=t:"align"===s&&(i=m[p]);let l=!1;if(void 0!==n.chain||"mmdbid"!==s&&"align"!==s)n.chain=""===n.chain?"Misc":n.chain;else if("mmdbid"===s)if(b=n.ids.m,void 0!==d.molid2chain[b]){let e=d.molid2chain[b].indexOf("_");n.chain=d.molid2chain[b].substr(e+1)}else{let e="Misc";("protein"===g[O]&&"nucleotide"===g[O]&&n.resi!=T||"protein"!==g[O]&&"nucleotide"!==g[O]&&(n.resn.substr(0,3)!=E.substr(0,3)||n.resi!=T||"solvent"===g[O]||"HOH"===n.resn))&&++F,n.resi_ori=n.resi,n.resi=F,l=!0,n.chain=e}else if("align"===s)if(b=n.ids.m,void 0!==d.pdbid_molid2chain[i+"_"+b])n.chain=d.pdbid_molid2chain[i+"_"+b];else{let e="Misc";("protein"===g[O]&&"nucleotide"===g[O]&&n.resi!=T||"protein"!==g[O]&&"nucleotide"!==g[O]&&(n.resn.substr(0,3)!=E.substr(0,3)||n.resi!=T||"solvent"===g[O]||"HOH"===n.resn))&&(++F,n.resi_ori=n.resi,n.resi=F,l=!0),n.chain=e}if(n.chain=n.chain.trim(),(parseInt(c.cfg.date)>=20231001||!c.cfg.date&&parseInt(c.utilsCls.getDateDigitStr())>=20231001)&&(n.chain=n.chain.replace(/_/g,"")),"mmdbid"!==s&&"align"!==s||(n.structure=i,"mmdbid"===s&&void 0!==d.mmdbid_q&&(d.mmdbid_q,d.mmdbid_t)),k=n.structure,O=k+"_"+n.chain,"mmdbid"===s||"align"===s){l||(n.resi_ori=n.resi,d.bUsePdbNum?n.resi=n.resi_ori:n.resi=n.ids.r);let e=n.resn.indexOf(" ");-1!==e&&0!=e&&(n.resn=n.resn.substr(0,e))}O!==A&&(I=0),n.resi!==I&&(O!==A?(y=void 0,_=void 0):(y=C,_=v)),n.coord="mmdbid"===s?new THREE.Vector3(n.coord[0],n.coord[1],n.coord[2]):new THREE.Vector3(n.coord.x,n.coord.y,n.coord.z);let r=c.utilsCls.residueName2Abbr(n.resn.substr(0,3));"mmdbid"!==s&&"align"!==s||!d.bFullUi||(void 0===d.mmdbMolidResid2mmdbChainResi&&(d.mmdbMolidResid2mmdbChainResi={}),d.mmdbMolidResid2mmdbChainResi[i+"_"+n.ids.m+"_"+n.ids.r]=i+"_"+n.chain+"_"+n.resi),d.pmin.min(n.coord),d.pmax.max(n.coord),d.psum.add(n.coord);let o=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"protein"===g[O]:"p"===n.mt,a=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"nucleotide"===g[O]:"n"===n.mt,u=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"solvent"===g[O]:"s"===n.mt,N=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"ligand"===g[O]||void 0!==g[O]&&-1!==g[O].indexOf("other")||void 0===g[O]:"l"===n.mt;if("Misc"!==n.chain&&"other"!==g[O]||"protein"===L[O]||"nucleotide"===L[O]||("CA"===n.name&&"C"===n.elem?L[O]="protein":"P"===n.name&&"P"===n.elem?L[O]="nucleotide":L[O]="chemical"),o||a?(o?(d.proteins[p]=1,"CA"===n.name&&(d.calphas[p]=1),"N"!==n.name&&"H"!==n.name&&"CA"!==n.name&&"HA"!==n.name&&"C"!==n.name&&"O"!==n.name&&(d.sidec[p]=1)):a&&(d.nucleotides[p]=1,("O3'"==n.name||"O3*"==n.name||H&&"P"==n.name)&&(d.nucleotidesO3[p]=1),-1===c.parasCls.nuclMainArray.indexOf(n.name)&&(d.ntbase[p]=1)),n.het=!1):u?(d.water[p]=1,n.het=!0):N&&("HOH"===n.resn||"O"===n.resn?d.water[p]=1:n.elem===n.resn?d.ions[p]=1:d.chemicals[p]=1,n.het=!0),"mmdbid"===s?n.het?n.color=c.parasCls.atomColors[n.elem]||c.parasCls.defaultAtomColor:n.color=void 0!==f[O]?c.parasCls.thr(f[O]):c.parasCls.chargeColors[n.resn]:void 0!==n.color&&(n.color=c.parasCls.thr(n.color))," "!==n.resn.charAt(0)&&" "===n.resn.charAt(1)&&(n.resn=n.resn.charAt(0)),n.het||"C"!==n.name||(C=p),n.het||"O"!==n.name||(v=p),!n.het&&"N"===n.name&&void 0!==y&&void 0!==_){let e=d.atoms[y].coord.distanceTo(d.atoms[_].coord),t=n.coord.x+(d.atoms[y].coord.x-d.atoms[_].coord.x)/e,s=n.coord.y+(d.atoms[y].coord.y-d.atoms[_].coord.y)/e,i=n.coord.z+(d.atoms[y].coord.z-d.atoms[_].coord.z)/e;n.hcoord=new THREE.Vector3(t,s,i)}"HOH"==n.resn&&(d.water[p]=1),d.atoms[p]=n,d.dAtoms[p]=1,d.hAtoms[p]=1;let q=n.structure+"_"+n.chain;void 0===d.chains[q]&&(d.chains[q]={}),d.chains[q][p]=1;let U=q+"_"+n.resi;void 0===d.residues[U]&&(d.residues[U]={}),d.residues[U][p]=1,R=O+"_"+n.resi,R!==x&&O!==A&&(P=!0,""!==S&&(void 0===d.structures[S]&&(d.structures[S]=[]),d.structures[S].push(A))),d.residueId2Name[U]=r;let $="-";if("helix"===n.ss?$="H":"sheet"===n.ss?$="E":n.het||a?$="o":(!n.het&&c.parasCls.residueColors.hasOwnProperty(n.resn.toUpperCase())||"coil"===n.ss)&&($="c"),d.secondaries[n.structure+"_"+n.chain+"_"+n.resi]=$,(n.resi!=I||b!=D)&&d.bFullUi&&(void 0===d.chainsSeq[q]&&(d.chainsSeq[q]=[],P=!1),!isNaN(n.resi)))if(P&&!M&&void 0!==d.chainsSeq[q][n.resi-1])d.chainsSeq[q][n.resi-1].name=r;else if(!P||!d.chainsSeq[q].hasOwnProperty(n.resi-1)){let e={};e.resi=n.resi,e.name=r,n.resi%10==0&&n.resi.toString(),d.chainsSeq[q].push(e),M=!0}I=n.resi,T=n.resi_ori,E=n.resn,S=k,A=O,x=R,D=b}for(let e in d.chemicals){let t=d.atoms[e];if("P"==t.elem&&t.bonds.length>=4)for(let e=t.bonds.length-1;e>=0;--e){"P"==d.atoms[t.bonds[e]].elem&&t.bonds.splice(e,1)}}for(let e in L)if(!(Object.keys(d.chains[e]).length<10)&&"chemical"!==L[e])for(let t in d.chains[e]){let s=d.atoms[t];delete d.chemicals[t],s.het=!1,"protein"===L[e]?(d.proteins[t]=1,"CA"===s.name&&(d.calphas[t]=1),"N"!==s.name&&"H"!==s.name&&"CA"!==s.name&&"HA"!==s.name&&"C"!==s.name&&"O"!==s.name&&(d.sidec[t]=1)):"nucleotide"===L[e]&&(d.nucleotides[t]=1,("O3'"==s.name||"O3*"==s.name||H&&"P"==s.name)&&(d.nucleotidesO3[t]=1),-1===c.parasCls.nuclMainArray.indexOf(s.name)&&(d.ntbase[t]=1))}if(void 0===d.structures[k]&&(d.structures[k]=[]),d.structures[k].push(O),d.bFullUi)if("mmdbid"===s||"mmcifid"===s)for(let i in e.sequences){let n=e.sequences[i],l=t+"_"+i;void 0!==d.mmdbid_q&&(d.mmdbid_q,d.mmdbid_t),d.ParserUtilsCls.getMissingResidues(n,s,l)}else if("align"===s)for(let e in d.chainid2seq){let t=d.chainid2seq[e];d.ParserUtilsCls.getMissingResidues(t,s,e)}if(d.loadPDBCls.setResidMapping(),"mmcifid"!==s)for(let e in h){let t=w[e],s=void 0===d.atoms[t].bonds?0:d.atoms[t].bonds.length;for(let e=0;ed.maxatomcnt||void 0!==d.biomtMatrices&&d.biomtMatrices.length*d.cnt>10*d.maxatomcnt)&&(d.opts.proteins="c alpha trace",d.opts.nucleotides="o3 trace"),d.center=d.ParserUtilsCls.getGeoCenter(d.pmin,d.pmax),d.maxD=d.ParserUtilsCls.getStructureSize(d.atoms,d.pmin,d.pmax,d.center),d.maxD<5&&(d.maxD=5),d.oriMaxD=d.maxD,("align"===s||o)&&(d.ssbondpnts={},d.loadPDBCls.setSsbond()),"mmdbid"===s&&1==Object.keys(d.structures).length){let t=e.disulfides;if(void 0!==t)for(let e=0,s=t.length;ep&&(p=e)),c[e]={resi:t,resn:i,aligned:n}}r=e[t][1];let u=r.moleculeId,g=s.pdbid_molid2chain[l+"_"+u],f=l+"_"+g;void 0===s.alnChainsAnTtl[d]&&(s.alnChainsAnTtl[d]=[]),void 0===s.alnChainsAnTtl[d][0]&&(s.alnChainsAnTtl[d][0]=[]),void 0===s.alnChainsAnTtl[d][1]&&(s.alnChainsAnTtl[d][1]=[]),void 0===s.alnChainsAnTtl[d][2]&&(s.alnChainsAnTtl[d][2]=[]),void 0===s.alnChainsAnTtl[d][3]&&(s.alnChainsAnTtl[d][3]=[]),void 0===s.alnChainsAnTtl[d][4]&&(s.alnChainsAnTtl[d][4]=[]),void 0===s.alnChainsAnTtl[d][5]&&(s.alnChainsAnTtl[d][5]=[]),void 0===s.alnChainsAnTtl[d][6]&&(s.alnChainsAnTtl[d][6]=[]),s.alnChainsAnTtl[d][0].push(f),s.alnChainsAnTtl[d][1].push(d),s.alnChainsAnTtl[d][2].push(""),s.alnChainsAnTtl[d][3].push(""),s.alnChainsAnTtl[d][4].push(f),s.alnChainsAnTtl[d][5].push(d),s.alnChainsAnTtl[d][6].push("");let b=1;s.chainsMapping[d]||(s.chainsMapping[d]={}),s.chainsMapping[f]||(s.chainsMapping[f]={});for(let e=h;e<=p;++e){let t,o,p,m=s.bUsePdbNum?s.ParserUtilsCls.getResi(f,r.sequence[e][0]-1):r.sequence[e][0],u="~"===r.sequence[e][2]?"-":r.sequence[e][2],C=r.sequence[e][3]?1:0,y=c[e].aligned+C;2===y?(c[e].resn===u?(t="#FF0000",p="icn3d-cons",s.consHash1[d+"_"+c[e].resi]=1,s.consHash2[f+"_"+m]=1):(t="#0000FF",p="icn3d-ncons",s.nconsHash1[d+"_"+c[e].resi]=1,s.nconsHash2[f+"_"+m]=1),s.chainsMapping[d][d+"_"+c[e].resi]=c[e].resn+c[e].resi,s.chainsMapping[f][f+"_"+m]=c[e].resn+c[e].resi,o="#"+s.showAnnoCls.getColorhexFromBlosum62(c[e].resn,u)):(t=i.htmlCls.GREY8,p="icn3d-nalign",s.nalignHash1[d+"_"+c[e].resi]=1,s.nalignHash2[f+"_"+m]=1),void 0===s.alnChainsSeq[d]&&(s.alnChainsSeq[d]=[]);let v={};v.mmdbid=n,v.chain=a,v.resi=c[e].resi,v.resn=""===v.resi||"icn3d-nalign"===p?c[e].resn.toLowerCase():c[e].resn,v.aligned=y,v.color=""===v.resi?i.htmlCls.GREYC:t,v.color2=""===v.resi?i.htmlCls.GREYC:o,v.class=p,s.alnChainsSeq[d].push(v),""!==c[e].resi&&(void 0===s.alnChains[d]&&(s.alnChains[d]={}),$.extend(s.alnChains[d],s.residues[d+"_"+c[e].resi])),void 0===s.alnChainsSeq[f]&&(s.alnChainsSeq[f]=[]),v={},v.mmdbid=l,v.chain=g,v.resi=m,v.resn=""===v.resi||"icn3d-nalign"===p?u.toLowerCase():u,v.aligned=y,v.color=""===v.resi?i.htmlCls.GREYC:t,v.color2=""===v.resi?i.htmlCls.GREYC:o,v.class=p,s.alnChainsSeq[f].push(v),""!==v.resi&&(void 0===s.alnChains[f]&&(s.alnChains[f]={}),$.extend(s.alnChains[f],s.residues[f+"_"+m])),void 0===s.alnChainsAnno[d]&&(s.alnChainsAnno[d]=[]),void 0===s.alnChainsAnno[d][0]&&(s.alnChainsAnno[d][0]=[]),void 0===s.alnChainsAnno[d][1]&&(s.alnChainsAnno[d][1]=[]),void 0===s.alnChainsAnno[d][2]&&(s.alnChainsAnno[d][2]=[]),void 0===s.alnChainsAnno[d][3]&&(s.alnChainsAnno[d][3]=[]),e===h&&(void 0===s.alnChainsAnno[d][4]&&(s.alnChainsAnno[d][4]=[]),void 0===s.alnChainsAnno[d][5]&&(s.alnChainsAnno[d][5]=[]),void 0===s.alnChainsAnno[d][6]&&(s.alnChainsAnno[d][6]=[]),s.alnChainsAnno[d][4].push(s.pdbid_chain2title[f]),s.alnChainsAnno[d][5].push(s.pdbid_chain2title[d]),s.alnChainsAnno[d][6].push(""));let _=d+"_"+c[e].resi,w=f+"_"+m,S=s.secondaries[_],A=s.secondaries[w];A?s.alnChainsAnno[d][0].push(A):s.alnChainsAnno[d][0].push("-"),S?s.alnChainsAnno[d][1].push(S):s.alnChainsAnno[d][1].push("-");let x=".";b%5==0&&(x="*"),b%10==0&&(x="|"),s.alnChainsAnno[d][2].push(x);let k="";b%10==0&&(k=b.toString()),s.alnChainsAnno[d][3].push(k),++b}}e={}}getPosFromResi(e,t){let s=this.icn3d;s.icn3dui;let i,n=s.resid2ncbi[e+"_"+t];if(n){i=n.substr(n.lastIndexOf("_")+1)-1}return i}getResnFromResi(e,t){let s=this.icn3d;s.icn3dui;let i=e+"_"+t,n=s.residueId2Name[i];return n||(n="?"),n}getResiAferAlign(e,t,s){let i,n=this.icn3d,l=n.icn3dui;if(t&&"tmalign"==l.cfg.aligntool)i=s;else if(n.posid2resid){let t=n.posid2resid[e+"_"+s];i=t.substr(t.lastIndexOf("_")+1)}else i=n.chainsSeq[e][s].resi;return i}setSeqAlignChain(e,t,s){let i,n,l,r,o,a,d,c,h,p,m,u=this.icn3d,g=u.icn3dui,f={},b=!!s;if(b){if(o=s[1],a=s[0],t=s[2],d=o.indexOf("_"),c=a.indexOf("_"),i=o.substr(0,d).toUpperCase(),n=a.substr(0,c).toUpperCase(),l=o.substr(d+1),r=a.substr(d+1),i==n&&l==r){let e=u.chainsSeq[n+"_"+r].length;u.qt_start_end[t]={q_start:1,q_end:e,t_start:1,t_end:e}}}else{let d=s[0].indexOf("_"),c=e.indexOf("_");if(i=u.mmdbid_t,n=e.substr(0,c).toUpperCase(),l=s[0].substr(d+1),r=e.substr(c+1),i==n&&l==r){let e=u.chainsSeq[u.mmdbid_q+"_"+u.chain_q].length;u.qt_start_end[t]={q_start:1,q_end:e,t_start:1,t_end:e}}o=i+"_"+l,a=n+"_"+r,void 0!==n&&u.mmdbid_t}u.conservedName1=o+"_cons",u.nonConservedName1=o+"_ncons",u.notAlignedName1=o+"_nalign",u.conservedName2=a+"_cons",u.nonConservedName2=a+"_ncons",u.notAlignedName2=a+"_nalign",u.consHash1={},u.nconsHash1={},u.nalignHash1={},u.consHash2={},u.nconsHash2={},u.nalignHash2={},u.alnChains={},u.alnChainsSeq[o]=[],u.alnChains[o]={},u.alnChainsSeq[a]=[],u.alnChains[a]={},u.alnChainsAnno[o]=[],u.alnChainsAnTtl[o]=[],void 0===u.alnChainsAnTtl[o]&&(u.alnChainsAnTtl[o]=[]);for(let e=0;e<7;++e)void 0===u.alnChainsAnTtl[o][e]&&(u.alnChainsAnTtl[o][e]=[]);u.alnChainsAnTtl[o][0].push(a),u.alnChainsAnTtl[o][1].push(o),u.alnChainsAnTtl[o][2].push(""),u.alnChainsAnTtl[o][3].push(""),u.alnChainsAnTtl[o][4].push(a),u.alnChainsAnTtl[o][5].push(o),u.alnChainsAnTtl[o][6].push("");let C=0,y=0;if(void 0===u.qt_start_end[t])return;let v=1;u.chainsMapping[o]||(u.chainsMapping[o]={}),u.chainsMapping[a]||(u.chainsMapping[a]={});let _={},w={};for(let e=0,s=u.qt_start_end[t].length;e0){let e=v;for(let t=C+1,i=s;tc&&(c=t)}}}"tmalign"==n.cfg.aligntool&&(s=!0);let p=Object.keys(a);p.sort((function(e,t){return parseInt(e)-parseInt(t)}));let m=-999,u=0,g=0,f=[],b=0;for(let e=0,t=p.length;en)for(let e=0,t=d-a;e0?void 0!==n?p.alnChainsAnno[t][0].push(n):p.alnChainsAnno[t][0].push("-"):console.log("Error: ic.alnChainsAnno[chainid1] is undefined")}}}class ls{constructor(e){this.icn3d=e}getStructureId(e,t,s){let i=this.icn3d;i.icn3dui;let n=e;return(e==i.defaultPdbId||s||i.structures.hasOwnProperty(e))&&(n=1===t?e:e+t.toString()),n}loadPDB(e,t,s,i,n,l,r,o){let a,d,c=this.icn3d,h=c.icn3dui,p={},m=!1,u=e.split("\n"),g={},f={};c.atoms||(l=!1),n||l?(c.oriNStru=c.structures?Object.keys(c.structures).length:0,d=c.oriNStru+1,a=c.atoms?Object.keys(c.atoms).length:0):(c.init(),d=1,a=0);let b,C,y,v,_,w,S,A=[],x=[],k=[],O=[],R=[],I=[],T="",E="",P="",M={},D=t||c.defaultPdbId,H=D,F="",L=!1,N=!0;for(let e in u){let r=u[e],q=r.substr(0,6);if("HEADER"!==q||L||t)if("TITLE "===q){let e=r.substr(10).replace(/ALPHAFOLD MONOMER V2.0 PREDICTION FOR /gi,"");c.molTitle+=e.trim()+" ",o&&c.esmTitle&&(c.molTitle=c.esmTitle),c.molTitleHash||(c.molTitleHash={}),c.molTitleHash[H]=c.molTitle}else if("HELIX "===q){c.bSecondaryStructure=!0;let e=""==r.substr(18,2).trim()?"A":r.substr(18,2).trim(),t=parseInt(r.substr(21,4)),s=parseInt(r.substr(33,4));for(let i=t;i<=s;++i){let n=H+"_"+e+"_"+i;O.push(n),i===t&&R.push(n),i===s&&I.push(n)}}else if("SHEET "===q){void 0!==s&&s||(c.bSecondaryStructure=!0);let e=""==r.substr(20,2).trim()?"A":r.substr(20,2).trim(),t=parseInt(r.substr(22,4)),i=parseInt(r.substr(33,4));for(let s=t;s<=i;++s){let n=H+"_"+e+"_"+s;A.push(n),s===t&&x.push(n),s===i&&k.push(n)}}else if("HBOND "===q)void 0!==s&&s||(c.bSecondaryStructure=!0);else if("SSBOND"===q){c.bSsbondProvided=!0;let e=D+"_"+(" "==r.substr(15,1)?"A":r.substr(15,1))+"_"+r.substr(17,4).trim(),t=D+"_"+(" "==r.substr(29,1)?"A":r.substr(29,1))+"_"+r.substr(31,4).trim();void 0===c.ssbondpnts[D]&&(c.ssbondpnts[D]=[]),c.ssbondpnts[D].push(e),c.ssbondpnts[D].push(t)}else if("REMARK"===q){let e=parseInt(r.substr(7,3));if(-1!==r.indexOf("1/2 of bilayer thickness:"))c.halfBilayerSize=parseFloat(r.substr(r.indexOf(":")+1).trim());else if(210==e)"EXPERIMENT TYPE"==r.substr(11,32).trim()&&"NMR"==r.substr(45).trim()&&(m=!0);else if(350==e&&"BIOMT"==r.substr(13,5)){let e=parseInt(r[18])-1,t=parseInt(r.substr(21,2))-1;null==c.biomtMatrices[t]&&(c.biomtMatrices[t]=(new THREE.Matrix4).identity()),c.biomtMatrices[t].elements[e]=parseFloat(r.substr(24,9)),c.biomtMatrices[t].elements[e+4]=parseFloat(r.substr(34,9)),c.biomtMatrices[t].elements[e+8]=parseFloat(r.substr(44,9)),c.biomtMatrices[t].elements[e+12]=parseFloat(r.substr(54,14))}else if(465==e&&" "==r.substr(18,1)&&" "==r.substr(20,1)&&"S"!=r.substr(21,1)){let e=r.substr(15,3),t=r.substr(18,2).trim(),s=r.substr(21,5).trim(),i=D+"_"+t;void 0===c.chainMissingResidueArray[i]&&(c.chainMissingResidueArray[i]=[]);let n={};n.resi=s,n.name=h.utilsCls.residueName2Abbr(e).toLowerCase(),""!=F&&t==F&&t!=F||(c.chainMissingResidueArray[i].push(n),F=t)}else 900==e&&void 0===c.emd&&"RELATED DB: EMDB"==r.substr(34).trim()&&(c.emd=r.substr(23,11).trim())}else if("SOURCE"===q&&void 0===c.organism&&"ORGANISM_COMMON"==r.substr(11,15).trim())c.organism=r.substr(28).toLowerCase().trim(),c.organism=c.organism.substr(0,c.organism.length-1);else if("ENDMDL"===q)++d,D=c.defaultPdbId,H=this.getStructureId(D,d,n),m||(A=[],x=[],k=[],O=[],R=[],I=[]),L=!1;else if("JRNL "===q)"PMID"===r.substr(12,4)&&(c.pmid=r.substr(19).trim());else if("ATOM "===q||"HETATM"===q){N&&(H=this.getStructureId(D,d,n),N=!1);let e=r.substr(16,1);++a,M[parseInt(r.substr(6,5))]=a;let t=r.substr(76,2).trim();""===t&&(t=r.substr(12,2).trim());let l=r.substr(12,4).trim(),u=r.substr(17,3),F=r.substr(20,2).trim();""===F&&(F="A");let L=r.substr(22,5).trim(),U=L;if(s&&"DUM"===u&&(t=l,F="MEM",U=1,L=1),i&&"DUM"===u)break;b=H+"_"+F,y=b+"_"+L,C=b+"_"+U;let $=parseFloat(r.substr(30,8)),j=parseFloat(r.substr(38,8)),B=parseFloat(r.substr(46,8)),z=new THREE.Vector3($,j,B),G=parseFloat(r.substr(60,8));o&&(G*=100);let V={het:"H"===q[0],serial:a,name:l,alt:e,resn:u,structure:H,chain:F,resi:U,coord:z,b:G,elem:t,bonds:[],ss:"coil",ssbegin:!1,ssend:!1};if(V.het||"C"!==V.name||(v=a),V.het||"O"!==V.name||(w=a),!V.het&&"N"===V.name&&void 0!==_&&void 0!==S){let e=c.atoms[_].coord.distanceTo(c.atoms[S].coord),t=V.coord.x+(c.atoms[_].coord.x-c.atoms[S].coord.x)/e,s=V.coord.y+(c.atoms[_].coord.y-c.atoms[S].coord.y)/e,i=V.coord.z+(c.atoms[_].coord.z-c.atoms[S].coord.z)/e;V.hcoord=new THREE.Vector3(t,s,i)}c.atoms[a]=V,c.dAtoms[a]=1,c.hAtoms[a]=1,p[a]=1,this.isSecondary(C,A,m)?(c.atoms[a].ss="sheet",this.isSecondary(C,x,m)&&(c.atoms[a].ssbegin=!0),this.isSecondary(C,k,m)&&(c.atoms[a].ssend=!0)):this.isSecondary(C,O,m)&&(c.atoms[a].ss="helix",this.isSecondary(C,R,m)&&(c.atoms[a].ssbegin=!0),this.isSecondary(C,I,m)&&(c.atoms[a].ssend=!0));let W="-";if(W="helix"===c.atoms[a].ss?"H":"sheet"===c.atoms[a].ss?"E":!c.atoms[a].het&&h.parasCls.residueColors.hasOwnProperty(c.atoms[a].resn.toUpperCase())?"c":"o",c.secondaries[C]=W,y!==P){let e=h.utilsCls.residueName2Abbr(u);if(c.residueId2Name[C]=e,1!==a&&""!==E&&(c.residues[E]=f),C!==E&&(f={}),b!==T){_=void 0,S=void 0,1!==a&&""!==T&&(void 0===c.chains[T]&&(c.chains[T]={}),c.chains[T]=h.hashUtilsCls.unionHash(c.chains[T],g)),g={},void 0===c.structures[H.toString()]&&(c.structures[H.toString()]=[]),c.structures[H.toString()].includes(b)||c.structures[H.toString()].push(b),void 0===c.chainsSeq[b]&&(c.chainsSeq[b]=[]);let t={};t.resi=U,t.name=e,c.chainsSeq[b].push(t)}else{_=v,S=w;let t={};t.resi=U,t.name=e,c.chainsSeq[b].push(t)}}g[a]=1,f[a]=1,T=b,E=C,P=y}else if("CONECT"===q){let e=parseInt(r.substr(6,5));for(let t=0;t<4;++t){let s=parseInt(r.substr([11,16,21,26][t],5));isNaN(s)||void 0!==c.atoms[M[e]]&&c.atoms[M[e]].bonds.push(M[s])}}else q.substr(0,3);else D=r.substr(62).trim(),""==D&&(D=l?c.defaultPdbId:c.inputid&&-1==c.inputid.indexOf("/")?c.inputid.substr(0,10):c.defaultPdbId),H=this.getStructureId(D,d,n),c.molTitle="",c.molTitleHash={},L=!0}c.residues[C]=f,void 0===c.chains[b]&&(c.chains[b]={}),c.chains[b]=h.hashUtilsCls.unionHash2Atoms(c.chains[b],g,c.atoms),this.adjustSeq(c.chainMissingResidueArray);let q=Object.keys(c.structures);for(let e=0,t=q.length;er&&i>r&&(h=!0),s<=r&&i>r?s>i||h?(o[c]=t[d],d++):(o[c]=e[a],a++):s>r&&i<=r?s<=i||h?(o[c]=e[a],a++):(o[c]=t[d],d++):s<=i?(o[c]=e[a],a++):(o[c]=t[d],d++),c++}if(a4||Math.abs(l.y-r.y)>4||Math.abs(l.z-r.z)>4||(l.x-r.x)*(l.x-r.x)+(l.y-r.y)*(l.y-r.y)+(l.z-r.z)*(l.z-r.z)<16&&(void 0===t.ssbondpnts[e]&&(t.ssbondpnts[e]=[]),t.ssbondpnts[e].push(o),t.ssbondpnts[e].push(a)))}}}getChainCalpha(e,t,s,i){let n=this.icn3d,l=n.icn3dui,r={};for(let o in e){if(void 0!==i){if(o.split("_")[0]!==i)continue}let a=Object.keys(e[o]),d=[],c=0,h=0;for(let e=0,i=a.length;e3?i.resn.trim().substr(0,3):i.resn.trim();if(!l.parasCls.chargeColors.hasOwnProperty(e))continue;s?i.resi_ori:i.resi,d.push(i.coord.clone()),++c,h=i.resi}}if(c>0){r[t[a[0]].chain]=d}}return{chainresiCalphaHash:r,center:n.center.clone()}}isSecondary(e,t,s){if(this.icn3d.icn3dui,s){let s=e.substr(e.indexOf("_")+1),i=!1;for(let e=0,n=t.length;ep[e]
"),l.cfg.bSidebyside||l.htmlCls.dialogCls.openDlg("dl_rmsd","Realignment RMSD"),n.q_rotation=[],n.q_trans_sub=[],n.t_trans_add=[],n.q_rotation.push({x1:e[0],y1:e[1],z1:e[2],x2:e[3],y2:e[4],z2:e[5],x3:e[6],y3:e[7],z3:e[8]}),n.q_trans_sub.push(i),n.t_trans_add.push({x:-r.x,y:-r.y,z:-r.z}),l.cfg.aligntool="vast";//!= 'tmalign';
-let c=0,h="query",p=o.substr(0,o.indexOf("_")),m=!0;n.chainalignParserCls.transformStructure(p,c,h,m);let u="";for(let e=0,i=s.length;e8)return s;let g=[];g[0]=n[0]*r[0]+n[1]*r[1]+n[2]*r[2],g[1]=n[3]*r[0]+n[4]*r[1]+n[5]*r[2],g[2]=n[6]*r[0]+n[7]*r[1]+n[8]*r[2],g[0]-=n[0]*a[0]+n[1]*a[1]+n[2]*a[2],g[1]-=n[3]*a[0]+n[4]*a[1]+n[5]*a[2],g[2]-=n[6]*a[0]+n[7]*a[1]+n[8]*a[2];let f=0;return f=c[0]*g[0],f+=c[1]*g[1],f+=c[2]*g[2],f/=p*m,f<.866?s:(g[0]=l[0]*r[0]+l[1]*r[1]+l[2]*r[2],g[1]=l[3]*r[0]+l[4]*r[1]+l[5]*r[2],g[2]=l[6]*r[0]+l[7]*r[1]+l[8]*r[2],g[0]-=l[0]*a[0]+l[1]*a[1]+l[2]*a[2],g[1]-=l[3]*a[0]+l[4]*a[1]+l[5]*a[2],g[2]-=l[6]*a[0]+l[7]*a[1]+l[8]*a[2],f=c[0]*g[0],f+=c[1]*g[1],f+=c[2]*g[2],f/=p*m,f<.866?s:(u=0,u+=Math.pow(e.q_rotation.x1-t.q_rotation.x1,2),u+=Math.pow(e.q_rotation.y1-t.q_rotation.y1,2),u+=Math.pow(e.q_rotation.z1-t.q_rotation.z1,2),u+=Math.pow(e.q_rotation.x2-t.q_rotation.x2,2),u+=Math.pow(e.q_rotation.y2-t.q_rotation.y2,2),u+=Math.pow(e.q_rotation.z2-t.q_rotation.z2,2),u+=Math.pow(e.q_rotation.x3-t.q_rotation.x3,2),u+=Math.pow(e.q_rotation.y3-t.q_rotation.y3,2),u+=Math.pow(e.q_rotation.z3-t.q_rotation.z3,2),Math.sqrt(u)))}GetRotMatrix(e,t,s){this.icn3d.icn3dui;let i=[];return i&&(i[0]=e.q_rotation.x1/t,i[1]=e.q_rotation.y1/t,i[2]=e.q_rotation.z1/t,i[3]=e.q_rotation.x2/t,i[4]=e.q_rotation.y2/t,i[5]=e.q_rotation.z2/t,i[6]=e.q_rotation.x3/t,i[7]=e.q_rotation.y3/t,i[8]=e.q_rotation.z3/t,2!=s?(i[9]=e.t_trans_add.x/t,i[10]=e.t_trans_add.y/t,i[11]=e.t_trans_add.z/t,i[12]=-e.q_trans_sub.x/t,i[13]=-e.q_trans_sub.y/t,i[14]=-e.q_trans_sub.z/t):(i[9]=-e.q_trans_add.x/t,i[10]=-e.q_trans_add.y/t,i[11]=-e.q_trans_add.z/t,i[12]=0,i[13]=0,i[14]=0)),i}cbu_dist(e,t,s){return e=5&&(e=l[4].substr(5)),l.length>=6&&(s=l[5].substr(6)),l.length>=7&&(n=l[6].substr(4)),$("#"+t.pre+"anno_custom")[0]&&($("#"+t.pre+"anno_custom")[0].checked=!0),$("[id^="+t.pre+"custom]").show(),"0"==s&&(s=void 0),t.addTrackCls.checkGiSeq(r,o,a,e,s,n,0)}else if(0==n.indexOf("remove one stabilizer")){let e=n.split(" | ")[1].split(" "),s=[];s.push(parseInt(e[0])),s.push(parseInt(e[1])),t.threeDPrintCls.removeOneStabilizer(s),t.drawCls.draw()}else if(0==n.indexOf("add one stabilizer")){let e=n.split(" | ")[1].split(" ");void 0===t.pairArray&&(t.pairArray=[]),t.pairArray.push(parseInt(e[0])),t.pairArray.push(parseInt(e[1])),t.drawCls.draw()}else if(0==n.indexOf("select planes z-axis")){let e=n.split(" ");if(5==e.length){let s=parseFloat(e[3]),i=parseFloat(e[4]);t.selectionCls.selectBtwPlanes(s,i)}}else if(0==n.indexOf("adjust membrane z-axis")){let e=n.split(" ");if(5==e.length){let s=parseFloat(e[3]),i=parseFloat(e[4]);t.selectionCls.adjustMembrane(s,i)}}else if(0==n.indexOf("toggle membrane"))t.selectionCls.toggleMembrane();else if(0==i.indexOf("calc buried surface")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(" ");if(2==s.length){let e=s[0].split(","),i=s[1].split(",");t.analysisCls.calcBuriedSurface(e,i)}}}else if(0==i.indexOf("dist ")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(" ");if(2==s.length){let e=s[0].split(","),i=s[1].split(",");t.analysisCls.measureDistTwoSets(e,i)}}}else if(0==i.indexOf("disttable")){let e=i.split(" | ");if(2==e.length){let i=e[1].split(" ");if(2==i.length){let e=i[0].split(","),n=i[1].split(",");t.analysisCls.measureDistManySets(e,n),s.htmlCls.dialogCls.openDlg("dl_disttable","Distance among the sets")}}}else if(0==i.indexOf("display interaction 3d")||0==i.indexOf("view interaction pairs")||0==i.indexOf("save1 interaction pairs")||0==i.indexOf("save2 interaction pairs")||0==i.indexOf("line graph interaction pairs")||0==i.indexOf("scatterplot interaction pairs")){let e=i.split(" | ");if(e.length>=3){let s=e[1].split(" ");if(2==s.length){let n,l,r=s[0].split(","),o=s[1].split(","),a=-1!==e[2].indexOf("hbonds"),d=-1!==e[2].indexOf("salt bridge"),c=-1!==e[2].indexOf("interactions"),h=-1!==e[2].indexOf("halogen"),p=-1!==e[2].indexOf("pi-cation"),m=-1!==e[2].indexOf("pi-stacking");if(e.length>=4&&(n="true"==e[3]),e.length>=5){let s=e[4].split(" ");s.length>=4&&($("#"+t.pre+"hbondthreshold").val(s[1]),$("#"+t.pre+"saltbridgethreshold").val(s[2]),$("#"+t.pre+"contactthreshold").val(s[3]),7==s.length&&($("#"+t.pre+"halogenthreshold").val(s[4]),$("#"+t.pre+"picationthreshold").val(s[5]),$("#"+t.pre+"pistackingthreshold").val(s[6])))}0==i.indexOf("display interaction 3d")?l="3d":0==i.indexOf("view interaction pairs")?l="view":0==i.indexOf("save1 interaction pairs")?l="save1":0==i.indexOf("save2 interaction pairs")?l="save2":0==i.indexOf("line graph interaction pairs")?l="linegraph":0==i.indexOf("scatterplot interaction pairs")&&(l="scatterplot"),await t.viewInterPairsCls.viewInteractionPairs(r,o,n,l,a,d,c,h,p,m)}}}else if(0==i.indexOf("export pairs")){let e=i.split(" | ");if(3==e.length){let i=e[1].split(" ");if(2==i.length){let n=i[0].split(","),l=i[1].split(","),r=e[2].split(" ")[1];t.showInterCls.pickCustomSphere(r,n,l,t.bSphereCalc),t.bSphereCalc=!0;let o=t.viewInterPairsCls.exportSpherePairs(),a=Object.keys(s.utilsCls.getHlStructures()).join(",");t.saveFileCls.saveFile(a+"_sphere_pairs.html","html",o)}}}else if(0==n.indexOf("graph label")){let e=n.lastIndexOf(" "),t=n.substr(e+1);$("#"+s.svgid+"_label").val(t),$("#"+s.svgid+" text").removeClass(),$("#"+s.svgid+" text").addClass(t)}else if(0==n.indexOf("cartoon label")){let e=n.lastIndexOf(" "),t=n.substr(e+1);$("#"+s.svgid_ct+"_label").val(t),$("#"+s.svgid_ct+" text").removeClass(),$("#"+s.svgid_ct+" text").addClass(t)}else if(0==n.indexOf("line graph scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.linegraphid+"_scale").val(i),$("#"+s.linegraphid).attr("width",(t.linegraphWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("scatterplot scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.scatterplotid+"_scale").val(i),$("#"+s.scatterplotid).attr("width",(t.scatterplotWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("contactmap scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.contactmapid+"_scale").val(i),$("#"+s.contactmapid).attr("width",(t.contactmapWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("alignerrormap scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.alignerrormapid+"_scale").val(i),$("#"+s.alignerrormapid).attr("width",(t.alignerrormapWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("graph force")){let e=n.lastIndexOf(" ");s.htmlCls.force=parseInt(n.substr(e+1)),$("#"+s.svgid+"_force").val(s.htmlCls.force),t.getGraphCls.handleForce()}else if(0==n.indexOf("hide edges")){let e=n.lastIndexOf(" ");s.htmlCls.hideedges=parseInt(n.substr(e+1)),$("#"+s.svgid+"_hideedges").val(s.htmlCls.hideedges),s.htmlCls.hideedges?(s.htmlCls.contactInsideColor="FFF",s.htmlCls.hbondInsideColor="FFF",s.htmlCls.ionicInsideColor="FFF"):(s.htmlCls.contactInsideColor="DDD",s.htmlCls.hbondInsideColor="AFA",s.htmlCls.ionicInsideColor="8FF"),void 0!==t.graphStr&&t.bRender&&s.htmlCls.force&&t.drawGraphCls.drawGraph(t.graphStr,t.pre+"dl_graph")}else if(0==n.indexOf("reset interaction pairs"))t.viewInterPairsCls.resetInteractionPairs();else if(0==n.indexOf("side by side")){let e=n.split(" | ")[1],t="_blank";window.open(e,t)}else if(0==i.indexOf("your note")){let e=i.split(" | ");t.yournote=e[1],$("#"+t.pre+"yournote").val(t.yournote),s.cfg.shownote&&(document.title=t.yournote)}else if(0==n.indexOf("cross structure interaction"))t.crossstrucinter=parseInt(n.substr(n.lastIndexOf(" ")+1)),$("#"+t.pre+"crossstrucinter").val(t.crossstrucinter);else if("replay on"==n)await t.resizeCanvasCls.replayon();else if("replay off"==n)await t.resizeCanvasCls.replayoff();else if(0==n.indexOf("contact map")){let e=n.split(" | ");if(3===e.length){let s=parseFloat(e[1].split(" ")[1]),i=e[2].split(" ")[1];await t.contactMapCls.contactMap(s,i)}}else if(0==n.indexOf("pickatom")){let e=parseInt(n.substr(n.lastIndexOf(" ")+1));t.pAtom=t.atoms[e],t.pickingCls.showPicking(t.pAtom)}else if(0==i.indexOf("set color spectrum")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!0;t.setColorCls.setColorAcrossSets(s,i)}}else if(0==i.indexOf("set residues color spectrum")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!0;t.setColorCls.setColorBySets(s,i)}}else if(0==i.indexOf("set color rainbow")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!1;t.setColorCls.setColorAcrossSets(s,i)}}else if(0==i.indexOf("set residues color rainbow")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!1;t.setColorCls.setColorBySets(s,i)}}else if(0==i.indexOf("color")){let e=i.split(" | "),n=e[0].substr(e[0].indexOf(" ")+1);if(t.opts.color=n,"residue custom"==n&&2==e.length){t.customResidueColors=JSON.parse(e[1]);for(let e in t.customResidueColors)t.customResidueColors[e.toUpperCase()]=s.parasCls.thr("#"+t.customResidueColors[e])}else if("align custom"==n&&3==e.length){let s=e[1],i=e[2].split(", ");t.queryresi2score={},t.queryresi2score[s]={};for(let e=0,n=i.length;e1&&"3"===x[t][0]&&isNaN(x[t][1])&&"-"!==x[t][0]){i=x[t].toUpperCase().substr(1),m=!0}else if(""===x[t]||isNaN(parseInt(x[t]))){if("*"===x[t])h=!0;else if("proteins"!==x[t]&&"nucleotides"!==x[t]&&"chemicals"!==x[t]&&"ions"!==x[t]&&"water"!==x[t]&&"anchors"!==x[t]&&"strands"!==x[t]&&"loops"!==x[t]){s=x[t].toUpperCase(),p=!0}}else v=x[t],_=v,n=!0;for(let a=0,u=S.length;a1?e.substr(0,l-1)===n.atoms[i].name.substr(0,l-1)&&(0===s?t[i]=1:t.hasOwnProperty(i)||delete t[i]):"*"!==e&&e!==n.atoms[i].name||(0===s?t[i]=1:t.hasOwnProperty(i)||delete t[i]),t}}class hs{constructor(e){this.icn3d=e}selectAll(){let e=this.icn3d;e.icn3dui,this.selectAll_base(),e.hlObjectsCls.removeHlObjects(),e.hlUpdateCls.removeHl2D(),e.hlUpdateCls.removeHlMenus(),e.bSelectResidue=!1,e.bSelectAlignResidue=!1,e.hlUpdateCls.removeSeqResidueBkgd(),e.hlUpdateCls.update2DdgmContent(),$("#"+e.pre+"dl_annotations > .icn3d-annotation").show(),e.definedSetsCls.setMode("all"),e.saveFileCls.showTitle()}selectAll_base(){let e=this.icn3d,t=e.icn3dui;e.hAtoms={},e.dAtoms={};for(let s in e.chains)e.hAtoms=t.hashUtilsCls.unionHash(e.hAtoms,e.chains[s]);e.dAtoms=t.hashUtilsCls.cloneHash(e.hAtoms),e.viewSelectionAtoms=t.hashUtilsCls.cloneHash(e.hAtoms),e.ALTERNATE_STRUCTURE=-1}selectAChain(e,t,s,i){let n=this.icn3d,l=n.icn3dui;t=t.replace(/\s/g,"");let r=void 0!==s||s?"select alignChain "+e:"select chain "+e;void 0!==i&&i?(n.hAtoms=l.hashUtilsCls.unionHash(n.hAtoms,n.chains[e]),void 0===n.nameArray&&(n.nameArray=[])):(n.hAtoms={},n.nameArray=[]),n.nameArray.push(e);let o,a=s?n.alnChainsSeq[e]:n.chainsSeq[e];o=void 0===a?0:a.length;let d={};for(let t=0,s=o;t0){if(void 0!==i&&i?void 0===r.nameArray&&(r.nameArray=[]):(r.hAtoms={},r.nameArray=[]),l)for(let t in e)r.hAtoms[t]=1;else for(let t in e)for(let e in r.residues[t])r.hAtoms[e]=1;let o,a;t=t.replace(/\s/g,""),r.nameArray.push(t),l?(o="select "+r.resid2specCls.atoms2spec(r.hAtoms),a=!1):(o="select "+r.resid2specCls.residueids2spec(Object.keys(e)),a=!0);let d=Object.keys(e);this.addCustomSelection(d,t,s,o,a),(void 0===n||n)&&r.hlUpdateCls.updateHlAll(r.nameArray,void 0,i)}}selectMainChains(){let e=this.icn3d,t=e.icn3dui.hashUtilsCls.cloneHash(e.hAtoms);e.hAtoms=e.applyDisplayCls.selectMainChainSubset(t),e.hlUpdateCls.showHighlight()}selectSideChains(){let e=this.icn3d,t=e.icn3dui,s=t.hashUtilsCls.cloneHash(e.hAtoms);e.hAtoms={};for(let i in s)(e.proteins.hasOwnProperty(i)&&"N"!==e.atoms[i].name&&"H"!==e.atoms[i].name&&"C"!==e.atoms[i].name&&"O"!==e.atoms[i].name&&("CA"!==e.atoms[i].name||"C"!==e.atoms[i].elem)&&"HA"!==e.atoms[i].name||e.nucleotides.hasOwnProperty(i)&&-1===t.parasCls.nuclMainArray.indexOf(e.atoms[i].name))&&(e.hAtoms[i]=1);e.hlUpdateCls.showHighlight()}selectMainSideChains(){let e=this.icn3d,t=e.icn3dui,s=e.firstAtomObjCls.getResiduesFromAtoms(e.hAtoms);e.hAtoms={};for(let i in s)e.hAtoms=t.hashUtilsCls.unionHash(e.hAtoms,e.residues[i]),e.dAtoms=t.hashUtilsCls.unionHash(e.dAtoms,e.residues[i]);e.drawCls.draw(),e.hlUpdateCls.showHighlight()}clickShow_selected(){let e=this.icn3d,t=e.icn3dui,s=this;t.myEventCls.onIds(["#"+e.pre+"show_selected","#"+e.pre+"mn2_show_selected"],"click",(function(e){s.icn3d,s.showSelection(),t.htmlCls.clickMenuCls.setLogCmd("show selection",!0)}))}clickHide_selected(){let e=this.icn3d,t=e.icn3dui,s=this;t.myEventCls.onIds("#"+e.pre+"mn2_hide_selected","click",(function(e){s.icn3d,s.hideSelection(),t.htmlCls.clickMenuCls.setLogCmd("hide selection",!0)}))}getGraphDataForDisplayed(){let e=this.icn3d;e.icn3dui;let t=JSON.parse(e.graphStr),s=e.firstAtomObjCls.getResiduesFromAtoms(e.dAtoms),i=[],n=[],l={};for(let e=0,n=t.nodes.length;et&&(t=C[s].length,e=s);let s=Object.keys(p),i=Object.keys(m);for(let t=0,n=C[e].length;t
The following sequence alignment shows the residue mapping of the best aligned sets: "symOri" and "symPerm", which are also available in the menu "Analysis > Defined Sets".
',$("#"+e.pre+"symd_info").html(A),s.setSeqAlignForSymmetry(_,w,S);let x=!1,k=t.htmlCls.alignSeqCls.getAlignSequencesAnnotations(Object.keys(e.alnChains),void 0,void 0,x,S);A=$("#"+e.pre+"dl_sequence2").html()+k.sequencesHtml,$("#"+e.pre+"dl_sequence2").html(A),$("#"+e.pre+"dl_sequence2").width(t.htmlCls.RESIDUE_WIDTH*k.maxSeqCnt+200),t.htmlCls.dialogCls.openDlg("dl_alignment","Select residues in aligned sequences from SymD");let O=Object.keys(e.defNames2Residues).length+Object.keys(e.defNames2Atoms).length,R="symOri"+O;e.selectionCls.selectResidueList(y,R,R),e.selectionCls.updateSelectionNameDesc(),t.htmlCls.clickMenuCls.setLogCmd("select "+e.resid2specCls.residueids2spec(Object.keys(y))+" | name "+R,!1),R="symPerm"+O,e.selectionCls.selectResidueList(v,R,R),e.selectionCls.updateSelectionNameDesc(),t.htmlCls.clickMenuCls.setLogCmd("select "+e.resid2specCls.residueids2spec(Object.keys(v))+" | name "+R,!1),R="symBoth"+O,y=t.hashUtilsCls.unionHash(y,v),e.selectionCls.selectResidueList(y,R,R),e.selectionCls.updateSelectionNameDesc(),t.htmlCls.clickMenuCls.setLogCmd("select "+e.resid2specCls.residueids2spec(Object.keys(y))+" | name "+R,!1)}}else $("#"+e.pre+"dl_symd").html("
The selected residues have no detected symmetry with a Z score of "+a.zscore+" from the program SymD."),t.htmlCls.dialogCls.openDlg("dl_symd","Dynamically Calculated Symmetry Using SymD");e.symdtitle="none"===h?void 0:h,e.drawCls.draw()}catch(s){return $("#"+e.pre+"dl_symd").html("
The web service can not determine the symmetry of the input set."),t.htmlCls.dialogCls.openDlg("dl_symd","Dynamically Calculated Symmetry Using SymD"),void e.ParserUtilsCls.hideLoading()}}getResObj(e){this.icn3d.icn3dui;let t=e.substr(0,e.indexOf(" ")),s=e.indexOf("$"),i=e.indexOf("."),n=e.indexOf(":"),l=e.substr(s+1,i-s-1),r=e.substr(i+1,n-i-1),o=e.substr(n+1);return{resn:t,resid:l+"_"+r+"_"+o,resi:o,aligned:!0}}setSeqAlignForSymmetry(e,t,s){let i=this.icn3d,n=i.icn3dui;i.conservedName1="symOri_cons",i.conservedName2="symPerm_cons",i.consHash1={},i.consHash2={},i.alnChainsAnTtl={},i.alnChainsAnno={},i.alnChainsSeq={},i.alnChains={},i.alnChainsSeq={};let l={};for(let r=0,o=e.length;r
This structure has no symmetry.");i.htmlCls.dialogCls.openDlg("dl_symmetry","Symmetry")}getPolygonColor(e){let t=this.icn3d.icn3dui,s=e.substr(0,1);return"C"==s?t.parasCls.thr(16747520):"D"==s?t.parasCls.thr(65535):"T"==s?t.parasCls.thr(15631086):"O"==s?t.parasCls.thr(16753920):"I"==s?t.parasCls.thr(65280):t.parasCls.thr(11119017)}getAxisColor(e,t){let s=this.icn3d.icn3dui,i=e.substr(0,1);return"C"==i?s.parasCls.thr(16711680):"D"==i?2==t?s.parasCls.thr(65535):s.parasCls.thr(16711680):"T"==i?2==t?s.parasCls.thr(65535):s.parasCls.thr(65280):"O"==i||"I"==i?2==t?s.parasCls.thr(65535):3==t?s.parasCls.thr(65280):s.parasCls.thr(16711680):s.parasCls.thr(16711680)}}class Cs{constructor(e){this.icn3d=e}alignSW(e,t,s,i,n,l,r){this.icn3d.icn3dui;let o=this.bsa_align(r,e,t,[s,i],[n,l]),a="score: "+o[0]+"\n";a+="start: "+o[1]+"\n",a+="cigar: "+this.bsa_cigar2str(o[2])+"\n\n",a+="alignment:\n\n";let d=this.bsa_cigar2gaps(e,t,o[1],o[2]),c={};return c.score=o[0],c.start=o[1],c.cigar=this.bsa_cigar2str(o[2]),c.target=d[0],c.query=d[1],c}bsg_enc_seq(e,t){if(this.icn3d.icn3dui,null==t)return null;let s=[];s.length=e.length;for(let i=0;i
Calculate solvent accessible surface area in the interface:
";C+="Set 1: "+e+", Surface: "+o+" Å2
",C+="Set 2: "+t+", Surface: "+d+" Å2
",C+="Total Surface: "+h+" Å2
",C+="Buried Surface for Set 1: "+u+" Å2
",C+="Buried Surface for Set 2: "+m+" Å2
",$("#"+s.pre+"dl_buriedarea_html").html(C),i.htmlCls.dialogCls.openDlg("dl_buriedarea","Buried solvent accessible surface area in the interface"),i.htmlCls.clickMenuCls.setLogCmd("buried surface "+b,!1)}}measureDistTwoSets(e,t){var s=this.icn3d,i=s.icn3dui;if(0==e.length||0==t.length)alert("Please select two sets");else{let n=i.hashUtilsCls.cloneHash(s.hAtoms),l=s.definedSetsCls.getAtomsFromNameArray(e),r=s.definedSetsCls.getAtomsFromNameArray(t),o=s.contactCls.getExtent(l),a=s.contactCls.getExtent(r),d=new THREE.Vector3(o[2][0],o[2][1],o[2][2]),c=new THREE.Vector3(a[2][0],a[2][1],a[2][2]);s.hAtoms=i.hashUtilsCls.cloneHash(n),void 0===s.distPnts&&(s.distPnts=[]),s.distPnts.push(d),s.distPnts.push(c);let h=$("#"+s.pre+"distancecolor2").val();this.addLine(d.x,d.y,d.z,c.x,c.y,c.z,h,!0,"distance");let p=0,m=0,u=d.clone().add(c).multiplyScalar(.5),g=(parseInt(10*d.distanceTo(c))/10).toString()+" A";this.addLabel(g,u.x,u.y,u.z,p,h,m,"distance"),s.drawCls.draw()}}measureDistManySets(e,t){var s=this.icn3d,i=s.icn3dui;if(0==e.length||0==t.length)alert("Please select sets for distance calculation...");else{let n=i.hashUtilsCls.cloneHash(s.hAtoms),l={};for(let i=0,n=e.length;i ";for(let s=0,i=e.length;s";for(let e=0,s=t.length;e "+t[e]+" (Å)"}r+=""+i+" (Å) ";for(let e=0,s=t.length;e'+l[i][s]+"":r+="0 "}r+=""}r+="
",$("#"+i.pre+"dl_disttable_html").html(r)}}addLine(e,t,s,i,n,l,r,o,a,d,c){var h=this.icn3d;h.icn3dui;let p={};p.position1=new THREE.Vector3(e,t,s),p.position2=new THREE.Vector3(i,n,l),p.color=r,p.dashed=o,p.radius=d,p.opacity=c,void 0===h.lines[a]&&(h.lines[a]=[]),void 0!==a?h.lines[a].push(p):(void 0===h.lines.custom&&(h.lines.custom=[]),h.lines.custom.push(p)),h.hlObjectsCls.removeHlObjects()}addLineFromPicking(e){var t=this.icn3d,s=t.icn3dui;let i=$("#"+t.pre+e+"color").val();t.pAtom.coord.x,t.pAtom2.coord.x,t.pAtom.coord.y,t.pAtom2.coord.y,t.pAtom.coord.z,t.pAtom2.coord.z;let n="stabilizer"!=e;s.htmlCls.clickMenuCls.setLogCmd("add line | x1 "+t.pAtom.coord.x.toPrecision(4)+" y1 "+t.pAtom.coord.y.toPrecision(4)+" z1 "+t.pAtom.coord.z.toPrecision(4)+" | x2 "+t.pAtom2.coord.x.toPrecision(4)+" y2 "+t.pAtom2.coord.y.toPrecision(4)+" z2 "+t.pAtom2.coord.z.toPrecision(4)+" | color "+i+" | dashed "+n+" | type "+e,!0),this.addLine(t.pAtom.coord.x,t.pAtom.coord.y,t.pAtom.coord.z,t.pAtom2.coord.x,t.pAtom2.coord.y,t.pAtom2.coord.z,i,n,e),t.pickpair=!1}addLabel(e,t,s,i,n,l,r,o){var a=this.icn3d;a.icn3dui;let d={};"0"!==n&&""!==n&&"undefined"!==n||(n=void 0),"0"!==l&&""!==l&&"undefined"!==l||(l=void 0),"0"!==r&&""!==r&&"undefined"!==r||(r=void 0);let c=new THREE.Vector3;c.x=t,c.y=s,c.z=i,d.position=c,d.text=e,d.size=n,d.color=l,d.background=r,void 0===a.labels[o]&&(a.labels[o]=[]),void 0!==o?a.labels[o].push(d):(void 0===a.labels.custom&&(a.labels.custom=[]),a.labels.custom.push(d)),a.hlObjectsCls.removeHlObjects()}addChainLabels(e){var t=this.icn3d;let s=t.icn3dui.hashUtilsCls.intHash(t.hAtoms,e);void 0===t.labels.chain&&(t.labels.chain=[]);let i=t.firstAtomObjCls.getChainsFromAtoms(s);for(let e in i){let s={};s.position=t.applyCenterCls.centerAtoms(t.chains[e]).center;let i=e.indexOf("_"),n=e.substr(i+1),l=t.showSeqCls.getProteinName(e);l.length>20&&(l=l.substr(0,20)+"..."),s.text="Chain "+n+": "+l,s.size=18,t.firstAtomObjCls.getFirstCalphaAtomObj(t.chains[e]).color.getHexString().toUpperCase(),s.color="black"!=t.opts.background?t.colorWhitebkgd:t.colorBlackbkgd,s.background="#FFFFFF",t.labels.chain.push(s)}t.hlObjectsCls.removeHlObjects()}addTerminiLabels(e){var t=this.icn3d,s=t.icn3dui;let i,n="#FFFFFF";i=s.hashUtilsCls.unionHash(i,t.proteins),i=s.hashUtilsCls.unionHash(i,t.nucleotides);let l=s.hashUtilsCls.intHash(t.dAtoms,i),r=s.hashUtilsCls.intHash(l,e);void 0===t.labels.chain&&(t.labels.chain=[]);let o=t.firstAtomObjCls.getChainsFromAtoms(r);for(let e in o){let i=s.hashUtilsCls.intHash(l,t.chains[e]),r=Object.keys(i),o=t.atoms[r[0]],a=t.atoms[r[r.length-1]],d={},c={};d.position=o.coord,c.position=a.coord,d.text="N-",c.text="C-",t.nucleotides.hasOwnProperty(o.serial)&&(d.text="5'",c.text="3'"),d.size=18,c.size=18,o.color.getHexString().toUpperCase(),a.color.getHexString().toUpperCase(),d.color="black"!=t.opts.background?t.colorWhitebkgd:t.colorBlackbkgd,c.color="black"!=t.opts.background?t.colorWhitebkgd:t.colorBlackbkgd,d.background=n,c.background=n,t.labels.chain.push(d),t.labels.chain.push(c)}t.hlObjectsCls.removeHlObjects()}}class vs{constructor(e){this.icn3d=e}draw2Ddgm(e,t,s,i){let n=this.icn3d,l=n.icn3dui,r=.667,o={},a={},d={},c={},h={};if(void 0===e)return"";for(let s in e.moleculeInfor){let i="#"+("000000"+e.moleculeInfor[s].color.toString(16)).slice(-6),l=e.moleculeInfor[s].chain.trim();void 0===h[l]?h[l]=1:++h[l];let r=t+"_"+(1===h[l]?l:l+h[l].toString());void 0!==n.mmdbid_q&&(n.mmdbid_q,n.mmdbid_t),o[s]=r,a[s]=i,d[s]=e.moleculeInfor[s].name,c[r]=s}if(void 0===i||!i)for(let s=0,i=e.intracResidues.length;s";p+=""+t.toUpperCase()+"
",p+="",p+="",n.html2ddgm+=p,$("#"+n.pre+"dl_2ddgm_html").html(n.html2ddgm),p}set2DdgmNote(e){let t="
";return this.icn3d.icn3dui.utilsCls.isMac()?(t+="◯Protein
",t+="▢Nucleotide
",t+="♢Chemical
",t+="▢Biopolymer
"):(t+="OProtein
",t+="▢Nucleotide
",t+="◇Chemical
",t+="▢Biopolymer
"),t+="
Lines:
Interactions at 4 Å
",e&&(t+="Numbers in red:
Aligned chains"),t+="
",t}highlightNode(e,t,s,i){let n=this.icn3d.icn3dui;i<.2&&(i=.2);if("rect"===e){$(t).attr("stroke",n.htmlCls.ORANGE),$(t).attr("stroke-width",3);let e=Number($(s).attr("x")),l=Number($(s).attr("y")),r=Number($(s).attr("width")),o=Number($(s).attr("height"));$(t).attr("x",e+r/2*(1-i)),$(t).attr("y",l+o/2*(1-i)),$(t).attr("width",r*i),$(t).attr("height",o*i)}else if("circle"===e)$(t).attr("stroke",n.htmlCls.ORANGE),$(t).attr("stroke-width",3),$(t).attr("r",Number($(s).attr("r"))*i);else if("polygon"===e){$(t).attr("stroke",n.htmlCls.ORANGE),$(t).attr("stroke-width",3);let e=Number($(s).attr("x")),l=Number($(s).attr("y")),r=Number($(s).attr("x0d")),o=Number($(s).attr("y0d")),a=Number($(s).attr("x1d")),d=Number($(s).attr("y1d")),c=Number($(s).attr("x2d")),h=Number($(s).attr("y2d")),p=Number($(s).attr("x3d")),m=Number($(s).attr("y3d"));$(t).attr("points",(e+r*i).toString()+", "+(l+o*i).toString()+", "+(e+a*i).toString()+", "+(l+d*i).toString()+", "+(e+c*i).toString()+", "+(l+h*i).toString()+", "+(e+p*i).toString()+", "+(l+m*i).toString())}}removeLineGraphSelection(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"dl_linegraph circle").attr("stroke","#000000"),$("#"+e.pre+"dl_linegraph circle").attr("stroke-width",1),$("#"+e.pre+"dl_linegraph svg line.icn3d-hlline").attr("stroke","#FFF")}removeScatterplotSelection(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"dl_scatterplot circle").attr("stroke","#000000"),$("#"+e.pre+"dl_scatterplot circle").attr("stroke-width",1),$("#"+e.pre+"dl_scatterplot rect").attr("stroke","#000000"),$("#"+e.pre+"dl_scatterplot rect").attr("stroke-width",1)}click2Ddgm(){let e=this.icn3d,t=e.icn3dui,s=this;$(document).on("click","#"+e.pre+"dl_2ddgm .icn3d-node",(function(e){let i=s.icn3d;e.stopImmediatePropagation(),Object.keys(i.hAtoms).length";return u+="n&&(n=C),ya&&(a=y);let v=.5;m=v*o.htmlCls.width2d*m/(t[1][0]-t[0][0]),u=v*o.htmlCls.width2d*u/(t[1][1]-t[0][1]),m>h&&(h=m),u>h&&(h=u),p.push({id:d,r:l,x:C,y:y,rx:m,ry:u,ang:g,c:b.color.getHexString()})}let m=h+2,u=n-s,g=a-i;for(let e=0,t=p.length;e0&&m==S.chain&&c.push('{"source": "'+u+'", "target": "'+n+'", "v": '+p+', "c": "'+t.color.getHexString().toUpperCase()+'"}'),A.push({id:n,r:l,ss:C,x:s,y:i,x1:d,y1:g,x2:k,y2:O,c:S.color.getHexString()}),m=S.chain,u=n,++h}}}let x=S+2,k=_-y,O=w-v;for(let e=0,t=A.length;e4e3||0!==s.indexOf("http")||l.bInputfile&&!l.bInputUrlfile?$("#"+l.pre+"viewer").html(""):$("#"+l.pre+"viewer").html("
"),$("#"+l.pre+"viewer").width(i),$("#"+l.pre+"viewer").height(n),$("#"+l.pre+"cmdlog").hide(),$("#"+l.pre+"title").hide(),$("#"+l.pre+"mnlist").hide(),$("#"+l.pre+"fullscreen").length>0&&$("#"+l.pre+"fullscreen").hide(),l={}}else saveAs(e,t)}saveSvg(e,t,s){if(this.icn3d.icn3dui.bNode)return"";let i=$("#"+e).width(),n=$("#"+e).height();s&&(n=i);let l=this.getSvgXml(e,i,n,s),r=new Blob([l],{type:"image/svg+xml"});saveAs(r,t)}getSvgXml(e,t,s,i){if(this.icn3d.icn3dui.bNode)return"";return(t&&s?'"}savePng(e,t,s){let i=this.icn3d,n=i.icn3dui;if(n.bNode)return"";let l=$("#"+e).width(),r=$("#"+e).height();s&&(r=l);let o=document.getElementById(e),a=o.getBBox(),d=o.cloneNode(!0);i.lineGraphCls.copyStylesInline(d,o);let c=document.createElement("CANVAS");c.width=l,c.height=r;let h=c.getContext("2d");h.clearRect(0,0,a.width,a.height);let p=this.getSvgXml(e,l,r,s),m=window.URL||window.webkitURL||window,u=new Blob([p],{type:"image/svg+xml;charset=utf-8"}),g=new Image;g.src=m.createObjectURL(u),g.onload=function(){if(h.drawImage(g,0,0),m.revokeObjectURL(this.src),n.utilsCls.isIE()){let e=c.msToBlob();e&&(saveAs(e,t),c.remove())}else c.toBlob((function(e){e&&(saveAs(e,t),c.remove())}))}}exportCustomAtoms(e){var t=this.icn3d;t.icn3dui;let s="",i=void 0!==t.defNames2Residues?Object.keys(t.defNames2Residues).sort():[];for(let n=0,l=i.length;n
20&&(e=e.substr(0,17)+"..."),l="Query: "+e+"; target: "+s,$("#"+i.pre+"title").html(l+", "+t)}else $("#"+i.pre+"title").html(r+" "+l+": "+t);else $("#"+i.pre+"title").html(t)}getLinkToStructureSummary(e){var t=this.icn3d,s=t.icn3dui;let i="https://www.ncbi.nlm.nih.gov/structure/?term=";if(i=void 0!==s.cfg.cid?"https://www.ncbi.nlm.nih.gov/pccompound/?term=":void 0!==s.cfg.refseqid?"https://www.ncbi.nlm.nih.gov/protein/":void 0!==s.cfg.afid?"https://alphafold.ebi.ac.uk/search/text/":Object.keys(t.structures).length>1?"https://www.ncbi.nlm.nih.gov/structure/?term=":s.htmlCls.baseUrl+"pdb/",void 0===t.inputid)i="https://www.ncbi.nlm.nih.gov/pccompound/?term="+t.molTitle;else{let n=t.inputid.split("_");1===n.length?(i+=t.inputid,e&&s.htmlCls.clickMenuCls.setLogCmd("link to "+t.inputid+": "+i,!1)):2===n.length&&(s.cfg.afid?i+=n[0]+" "+n[1]:i+=n[0]+" OR "+n[1],e&&s.htmlCls.clickMenuCls.setLogCmd("link to structures "+n[0]+" and "+n[1]+": "+i,!1))}return i}setEntrezLinks(e){var t=this.icn3d,s=t.icn3dui;let i,n=Object.keys(t.structures);if(1===n.length){i="https://www.ncbi.nlm.nih.gov/"+e+"/?term="+n[0],s.htmlCls.clickMenuCls.setLogCmd("Entrez "+e+" about PDB "+n[0]+": "+i,!1);let l=t.structures&&Object.keys(t.structures).length>0?"_blank":"_self";window.open(i,l)}else if(2===n.length){i="https://www.ncbi.nlm.nih.gov/"+e+"/?term="+n[0]+" OR "+n[1],s.htmlCls.clickMenuCls.setLogCmd("Entrez "+e+" about PDB "+n[0]+" OR "+n[1]+": "+i,!1);let l=t.structures&&Object.keys(t.structures).length>0?"_blank":"_self";window.open(i,l)}}}class xs{constructor(e){this.icn3d=e}async shareLink(e,t){let s=this.icn3d,i=s.icn3dui,n=this.shareLinkUrl(),l=n.length>4e3||0!==n.indexOf("http"),r=Object.keys(s.structures).join("_");if(r==s.defaultPdbId&&(s.filename?r=s.filename:s.inputid&&(r=s.inputid)),e){if(t||s.bInputfile||l)return void s.saveFileCls.saveFile(r+"_icn3d_loadable.png","png")}else{if(s.bInputfile&&!s.bInputUrlfile)return void alert("Share Link does NOT work when the data are from custom files. Please save 'iCn3D PNG Image' in the File menu and open it in iCn3D.");if(l)return void alert("The url is more than 4000 characters and may not work. Please save 'iCn3D PNG Image' or 'State File' and open them in iCn3D.");i.htmlCls.clickMenuCls.setLogCmd("share link: "+n,!1)}let o="Problem in getting shortened URL";if(!i.cfg.notebook){let t=await this.getShareLinkPrms(n,e);if(void 0!==t.shortLink&&(o=t.shortLink,e)){let e=o.split("/"),t=e[e.length-1];s.saveFileCls.saveFile(r+"-"+t+".png","png");let i='\n\n",s.saveFileCls.saveFile(r+"-"+t+".html","html",i)}e&&void 0===t.shortLink&&s.saveFileCls.saveFile(r+"_icn3d_loadable.png","png");let i=o.split("page.link/");2==i.length&&(o="https://structure.ncbi.nlm.nih.gov/icn3d/share.html?"+i[1]),$("#"+s.pre+"short_url").val(o),$("#"+s.pre+"short_url_title").val(o+"&t="+s.yournote)}let a=this.shareLinkUrl(void 0,!0),d="view = icn3dpy.view(q='"+(i.cfg.url?"url="+i.cfg.url:i.cfg.idname+"="+i.cfg.idvalue)+"',command='"+a+"')\nview";(i.cfg.url||i.cfg.idname)&&$("#"+s.pre+"jn_commands").val(d),$("#"+s.pre+"ori_url").val(n),e||i.htmlCls.dialogCls.openDlg("dl_copyurl","Copy a Share Link URL or Jupyter Notebook Commands")}getShareLinkPrms(e,t){let s=this.icn3d,i=s.icn3dui;return new Promise((function(n,l){$.ajax({url:"https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=AIzaSyBxl9CgM0dY5lagHL4UOhEpLWE1fuwdnvc",type:"POST",data:{longDynamicLink:"https://icn3d.page.link/?link="+encodeURIComponent(e)},dataType:"json",success:function(e){n(e)},error:function(n,l,r){let o="Problem in getting shortened URL";$("#"+s.pre+"ori_url").val(e),$("#"+s.pre+"short_url").val(o),$("#"+s.pre+"short_url_title").val(o+"&t="+s.yournote),t||i.htmlCls.dialogCls.openDlg("dl_copyurl","Copy a Share Link URL")}})}))}shareLinkUrl(e,t){let s=this.icn3d,i=s.icn3dui,n=i.htmlCls.baseUrl+"icn3d/?",l="";if(i.cfg.bSidebyside&&(n=i.htmlCls.baseUrl+"icn3d/full2.html?"),s.bInputUrlfile){n=window.location.href.split("?")[0]+"?"+s.inputurl+"&"}let r,o={};for(let e in s.cfg){let t=s.cfg[e];"inpara"!==e&&"command"!==e&&"usepdbnum"!==e&&"date"!==e&&"v"!==e&&void 0!==t&&("width"===e&&"100%"===t||"height"===e&&"100%"===t||"resize"===e&&!0===t||"showmenu"===e&&!0===t||"showtitle"===e&&!0===t||"showcommand"===e&&!0===t||"mobilemenu"===e&&!1===t||"showanno"===e&&!1===t||"showseq"===e&&!1===t||"showalignseq"===e&&!1===t||"show2d"===e&&!1===t||"showsets"===e&&!1===t||"rotate"===e&&"right"===t||"command"!==e&&("options"===e?Object.keys(t).length>0&&(o[e]=JSON.stringify(t)):!0===t?o[e]=1:!1===t?o[e]=0:""!==t&&(o[e]=t)))}s.bAfMem?o.afmem="on":(i.cfg.afid||1==Object.keys(s.structures).length&&Object.keys(s.structures)[0].length>5)&&(o.afmem="off");let a=-1;void 0!==i.cfg.inpara&&(a=i.cfg.inpara.indexOf("&command=")),r=-1!==a?i.cfg.inpara.substr(0,a):i.cfg.inpara;let d=!1;if(!s.bInputUrlfile){let e=r&&r.substr(1)?r.substr(1).split("&"):[];for(let t=0,s=e.length;tc){u=s.commands[c].split("|||")[0].split("&command=")[0].trim(),-1!==u.indexOf(g)&&++f}let b,C=c+1,y="";for(let e=s.commands.length;Ct.substr(0,s))return 1;if(e.substr(0,s)==t.substr(0,s)){if(parseInt(e.substr(s+1))0?-parseInt(C.z):parseInt(C.z),y.onBeforeRender=function(e,t,s,i,n,o){let a,d=new THREE.Vector3(0,0,0),c=i.getAttribute("position").array;for(let e=0,t=c.length;e0&&t.applySymdCls.applySymd(),void 0!==t.prevOtherMesh)for(let e=0,s=t.prevOtherMesh.length;e0&&(e=s.hashUtilsCls.hash2Atoms(t.chemicals,t.atoms));let i=4;if(void 0!==e){let n=t.contactCls.getAtomsWithinAtom(t.atoms,e,i),l=3.5;t.opts.hbonds="yes",Object.keys(n).length>0&&t.hBondCls.calculateChemicalHbonds(e,n,parseFloat(l)),t.bSetFog||t.transformCls.zoominSelection(s.hashUtilsCls.unionHash(e,n))}}else"hide"===e.chemicalbinding&&(t.hBondCls.hideHbonds(),t.showInterCls.hideExtraBonds(),t.bSetFog||t.transformCls.zoominSelection(t.atoms))}updateStabilizer(){let e=this.icn3d;if(e.icn3dui,e.stabilizerpnts=[],void 0!==e.pairArray)for(let t=0,s=e.pairArray.length;t=0;i--){let r=t.ssbondpnts[e][2*i],o=t.ssbondpnts[e][2*i+1],a={};a.color=n,a.dashed=!1;let d=[],c=[],h=[],p=[],m=!1,u=!1;for(let e in t.residues[r])"SG"===t.atoms[e].name&&(h.push(t.atoms[e].coord),d.push(t.atoms[e].serial),m=!0);if(!m)for(let e in t.residues[r])if("CA"===t.atoms[e].name){h.push(t.atoms[e].coord),d.push(t.atoms[e].serial),m=!0,u=!0;break}m=!1;for(let e in t.residues[o])"SG"===t.atoms[e].name&&(p.push(t.atoms[e].coord),c.push(t.atoms[e].serial),m=!0);if(!m)for(let e in t.residues[o])if("CA"===t.atoms[e].name){p.push(t.atoms[e].coord),c.push(t.atoms[e].serial),m=!0,u=!0;break}let g=u?7:3,f=!1;for(let e=0,t=h.length;e0&&(e.mdl.remove(e.prevMaps[e.prevMaps.length-1]),e.prevMaps.slice(e.prevMaps.length-1,1))}removeLastEmmap(){let e=this.icn3d;e.icn3dui,e.prevEmmaps.length>0&&(e.mdl.remove(e.prevEmmaps[e.prevEmmaps.length-1]),e.prevEmmaps.slice(e.prevEmmaps.length-1,1))}removeLastPhimap(){let e=this.icn3d;e.icn3dui,e.prevPhimaps.length>0&&(e.mdl.remove(e.prevPhimaps[e.prevPhimaps.length-1]),e.prevPhimaps.slice(e.prevPhimaps.length-1,1))}}class ot{constructor(e){this.icn3d=e}addResidueLabels(e,t,s,i,n){let l=this.icn3d,r=l.icn3dui;if(r.bNode)return;let o=r.hashUtilsCls.intHash(l.hAtoms,e);t?void 0===l.labels.schematic&&(l.labels.schematic=[]):void 0===l.labels.residue&&(l.labels.residue=[]);let a="";for(let e in o){let s=l.atoms[e],o={},d=s.structure+"_"+s.chain+"_"+s.resi;if(!s.het&&("CA"===s.name||"O3'"===s.name||"O3*"===s.name)||l.water.hasOwnProperty(s.serial)||l.ions.hasOwnProperty(s.serial)||l.chemicals.hasOwnProperty(s.serial)&&d!==a){if(o.position=s.coord,o.bSchematic=0,t&&(o.bSchematic=1),o.text=r.utilsCls.residueName2Abbr(s.resn),i)o.text+=s.resi;else if(n){let e=s.structure+"_"+s.chain+"_"+s.resi,t="";l.resid2refnum[e]&&(t=" "==l.resid2refnum[e].substr(0,1)?"":l.resid2refnum[e]),o.text=t}o.size=18,o.factor=.3;let e=s.color.getHexString().toUpperCase();o.color=i?"black"!=l.opts.background?l.colorWhitebkgd:l.colorBlackbkgd:n?"#00FFFF":"CCCCCC"===e||"C8C8C8"===e?"#888888":"#"+e,o.background="#FFFFFF",t?l.labels.schematic.push(o):l.labels.residue.push(o)}a=d}l.hlObjectsCls.removeHlObjects()}addNonCarbonAtomLabels(e){let t=this.icn3d,s=t.icn3dui;if(s.bNode)return;let i=s.hashUtilsCls.intHash(t.hAtoms,e);void 0===t.labels.schematic&&(t.labels.schematic=[]);for(let e in i){let s=t.atoms[e];if(!t.residues.hasOwnProperty(s.structure+"_"+s.chain+"_"+s.resi))continue;if("C"===s.elem)continue;let i={};i.position=s.coord,i.bSchematic=1,i.text=s.elem,i.size=18,i.color="black"!=t.opts.background?t.colorWhitebkgd:s.color.getHexString(),i.background="#FFFFFF",t.labels.schematic.push(i)}t.hlObjectsCls.removeHlObjects()}addAtomLabels(e,t){let s=this.icn3d,i=s.icn3dui;if(i.bNode)return;let n=i.hashUtilsCls.intHash(s.hAtoms,e);n=i.hashUtilsCls.intHash(s.dAtoms,n),void 0===s.labels.residue&&(s.labels.residue=[]);for(let e in n){let i=s.atoms[e],n={};n.position=i.coord,n.bSchematic=0,n.text=t?i.elem:i.name.padEnd(2," "),n.size=18,t&&(n.bSchematic=!0);let l=i.color.getHexString().toUpperCase();n.color="black"!=s.opts.background?s.colorWhitebkgd:s.colorBlackbkgd,t&&(n.color="CCCCCC"===l||"C8C8C8"===l?"#888888":"#"+l),n.background="#FFFFFF",s.labels.residue.push(n)}s.hlObjectsCls.removeHlObjects()}}class at{constructor(e){this.icn3d=e}onBeforeRender(e,t,s,i,n,l){let r=n.uniforms,o=[];if(r.objectId&&(r.objectId.value=SupportsReadPixelsFloat?this.id:this.id/255,o.push("objectId")),(r.modelViewMatrixInverse||r.modelViewMatrixInverseTranspose||r.modelViewProjectionMatrix||r.modelViewProjectionMatrixInverse)&&this.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,this.matrixWorld),r.modelViewMatrixInverse&&(r.modelViewMatrixInverse.value.copy(this.modelViewMatrix).invert(),o.push("modelViewMatrixInverse")),r.modelViewMatrixInverseTranspose&&(r.modelViewMatrixInverse?r.modelViewMatrixInverseTranspose.value.copy(r.modelViewMatrixInverse.value).transpose():r.modelViewMatrixInverseTranspose.value.copy(this.modelViewMatrix).invert().transpose(),o.push("modelViewMatrixInverseTranspose")),r.modelViewProjectionMatrix&&(s.updateProjectionMatrix(),r.modelViewProjectionMatrix.value.multiplyMatrices(s.projectionMatrix,this.modelViewMatrix),o.push("modelViewProjectionMatrix")),r.modelViewProjectionMatrixInverse){let e=new THREE.Matrix4;r.modelViewProjectionMatrix?(e.copy(r.modelViewProjectionMatrix.value),r.modelViewProjectionMatrixInverse.value.copy(e).invert()):(s.updateProjectionMatrix(),e.multiplyMatrices(s.projectionMatrix,this.modelViewMatrix),r.modelViewProjectionMatrixInverse.value.copy(e).invert()),o.push("modelViewProjectionMatrixInverse")}if(r.projectionMatrix&&(s.updateProjectionMatrix(),r.projectionMatrix.value.copy(s.projectionMatrix),o.push("projectionMatrix")),r.projectionMatrixInverse&&(s.updateProjectionMatrix(),r.projectionMatrixInverse.value.copy(s.projectionMatrix).invert(),o.push("projectionMatrixInverse")),o.length){let t=e.properties.get(n);if(t.program){let s=e.getContext(),i=t.program;s.useProgram(i.program);let n=i.getUniforms();o.forEach((function(e){n.setValue(s,e,r[e].value)}))}}}setParametersForShader(e){let t,s=this.icn3d,i=s.icn3dui.parasCls.backgroundColors[s.opts.background.toLowerCase()],n=2.5*s.maxD,l=4*s.maxD,r=void 0!==s.biomtMatrices&&s.biomtMatrices.length*s.cnt>s.maxatomcnt;"yes"===s.opts.slab?r?t=.1:void 0!==s.camMaxDFactorFog?(t=s.maxD*s.camMaxDFactorFog-10,n=2.5*s.maxD-t<0?0:2.5*s.maxD-t,l=4*s.maxD-t):t=s.maxD*s.camMaxDFactor:t=.1;let o=void 0!==e?e:1,a=s.shininess/100*.5;s.uniforms=THREE.UniformsUtils.merge([THREE.UniformsLib.common,{modelViewMatrix:{value:new THREE.Matrix4},modelViewMatrixInverse:{value:new THREE.Matrix4},modelViewMatrixInverseTranspose:{value:new THREE.Matrix4},modelViewProjectionMatrix:{value:new THREE.Matrix4},modelViewProjectionMatrixInverse:{value:new THREE.Matrix4},projectionMatrix:{value:new THREE.Matrix4},projectionMatrixInverse:{value:new THREE.Matrix4},diffuse:{type:"v3",value:[1,1,1]},emissive:{type:"v3",value:[.06,.06,.06]},roughness:{type:"f",value:.5},metalness:{type:"f",value:a},opacity:{type:"f",value:o},nearClip:{type:"f",value:t},ortho:{type:"f",value:0},shrink:{type:"f",value:.13},fogColor:{type:"v3",value:[i.r,i.g,i.b]},fogNear:{type:"f",value:n},fogFar:{type:"f",value:l},fogDensity:{type:"f",value:2}},THREE.UniformsLib.ambient,THREE.UniformsLib.lights]),s.defines={USE_COLOR:1,NEAR_CLIP:1,CAP:1},"yes"!==s.opts.fog||r||(s.defines.USE_FOG=1,"orthographic"===s.opts.camera&&(s.defines.FOG_EXP2=1)),s.bExtFragDepth&&(s.defines.USE_LOGDEPTHBUF_EXT=1)}drawImpostorShader(){this.icn3d.icn3dui.bNode||(this.setParametersForShader(),this.createImpostorShaderSphere("SphereImpostor"),this.createImpostorShaderCylinder("CylinderImpostor"))}getShader(e){this.icn3d.icn3dui;let t=$NGL_shaderTextHash[e];return t=t.replace(/#include\s+(\S+)/gim,(function(e,t){let s;return THREE.ShaderChunk.hasOwnProperty(t)&&(s=THREE.ShaderChunk[t]),s||""})),t}createImpostorShaderBase(e,t,s,i,n,l,r,o,a){let d=this.icn3d;d.icn3dui;let c=new THREE.ShaderMaterial({defines:d.defines,uniforms:d.uniforms,vertexShader:this.getShader(e+".vert"),fragmentShader:this.getShader(e+".frag"),depthTest:!0,depthWrite:!0,lights:!0});c.extensions.fragDepth=!0,"CylinderImpostor"==e?d.CylinderImpostorMaterial=c:"SphereImpostor"==e&&(d.SphereImpostorMaterial=c);let h,p,m=l*r,u=l*o,g=new(m>65535?Uint32Array:Uint16Array)(u);for(let e=0;eo?r:o,d=Math.sqrt(a),c=(d+s)*(d+s),h={};for(let r in e){let e=n.atoms[r];!i&&t.hasOwnProperty(e.serial)||(this.bOpm&&"DUM"===e.resn||e.coord.x
";if("atom"==e){let e=["proteins","nucleotides","chemicals","ions","water"];for(let i=0,l=e.length;i
",n+="Light green (P, T, S, A, Q, N, G): Polar
",n+="Grey: Charged, not hydrophobic
"):(n+="Green (W, F, L, I, Y, M, V, C): Hydrophobic
",n+="Yellow (P, T, S, A, Q, N, G): Polar
",n+="Red: Negatively Charged
",n+="Blue: Positively Charged
");let a=0;for(let e of r)s.parasCls.residueAbbrev[e[0]]&&(n+="
"),++a);n+="
",n+=s.htmlCls.clickMenuCls.setLegendHtml()):"confidence"==e?n+=s.htmlCls.clickMenuCls.setLegendHtml(!0):"exon"==e?(t.startColor="red",t.midColor="white",t.endColor="blue",t.startValue="Start",t.midValue="Middle",t.endValue="End",n+=s.htmlCls.clickMenuCls.setLegendHtml()):n="";n?($("#"+s.pre+"dl_legend_html").html(n),s.htmlCls.dialogCls.openDlg("dl_legend","Color Legend")):$("#"+s.pre+"dl_legend").hasClass("ui-dialog-content")&&$("#"+s.pre+"dl_legend").dialog("isOpen")&&$("#"+s.pre+"dl_legend").dialog("close")}getColorLegendForElem(e,t){let s=this.icn3d,i=s.icn3dui,n="",l={};for(let e in t){let t=s.atoms[e],i=void 0===t||void 0===t.color||"FFFFFF"===t.color.getHexString().toUpperCase()?"DDDDDD":t.color.getHexString();void 0===l[t.elem]&&(l[t.elem]={}),l[t.elem][i]=1}if(Object.keys(l).length>0){n+=""+e+"
";let t=Object.keys(l).sort();for(let e=0,s=t.length;e";for(let e in l[s])n+=" ";n+=i.parasCls.atomnames[s.toUpperCase()]+"
"}n+="
"}return n}getRes2color(e,t){let s=this.icn3d,i=s.icn3dui,n={},l=s.firstAtomObjCls.getResiduesFromAtoms(e);for(let e in l){let l=s.residues[e],r=s.firstAtomObjCls.getFirstAtomObj(l),o=t?r.resn:i.parasCls.residueAbbrev[r.resn],a=void 0===r||void 0===r.color||"FFFFFF"===r.color.getHexString().toUpperCase()?"DDDDDD":r.color.getHexString();null!=o&&(void 0===n[o]&&(n[o]={}),n[o][a]=1)}return n}getColorLegendForResidue(e){this.icn3d.icn3dui;let t="",s=this.getRes2color(e);if(Object.keys(s).length>0){t+="
"),-1!=o.indexOf("(")?(t+=r,++n):i+=r}i&&(t+="
"+i),t+=""}return t}getColorLegendForCharge(e){let t=this.icn3d;t.icn3dui;let s="",i=t.firstAtomObjCls.getResiduesFromAtoms(e),n={};for(let e in i){let s=t.residues[e],i=t.firstAtomObjCls.getFirstAtomObj(s);"ARG"==i.resn||"LYS"==i.resn?n.Positive=1:"HIS"==i.resn?n["Partial-Positive"]=1:"ASP"==i.resn||"GLU"==i.resn||t.nucleotides[i.serial]?n.Negative=1:n.Neutral=1}const l={Positive:"0000ff","Partial-Positive":"8080ff",Negative:"ff0000",Neutral:"888888"};let r=["Positive","Partial-Positive","Negative","Neutral"];s+="
")}return s+="
(Charges are at pH 7)",s+="
"}return t+="
Linker":"","C'' Strand":"FF0000","
Protodomain 2":"","D Strand":"0000FF","E Strand":"006400","F Strand":"FFD700","G Strand":"FF8C00","":"",Loop:"CCCCCC"};t+="
that by its duplication, symmetry operations
can generate a structural domain.
";for(let e in s){let i=s[e];t+="",i&&(t+=" "),t+=e,t+="
"}return t+="'+s+"
",h+=d+u+g,p+=d+u+g;let f="site"+e.toString(),b=0,y=0,v=1;i.seqStartLen&&i.seqStartLen[c]&&(p+=i.showSeqCls.insertMulGapOverview(c,i.seqStartLen[c])),i.seqStartLen&&i.seqStartLen[c]&&(h+=i.showSeqCls.insertMulGap(i.seqStartLen[c],"-"));for(let t=0,s=i.giSeq[c].length;t1&&(l=s[0]+"..");let r=i.ParserUtilsCls.getResi(c,t);if(h+=''+s+"",n.bNode){let t={};t[c+"_"+r]="site: "+C[e].title,i.resid2site[c].push(t)}p+=i.showSeqCls.insertGapOverview(c,t);let o=n.cfg.blast_rep_id==c?Math.round(i.seqAnnWidth*t/(i.maxAnnoLength+i.nTotalGap)-b-y):Math.round(i.seqAnnWidth*t/i.maxAnnoLength-b-y);o>=0&&(p+='",g+="
",h+=g,p+=g}h+="",p+="",m+="",$("#"+i.pre+"dt_site_"+c).html(h),$("#"+i.pre+"ov_site_"+c).html(p),$("#"+i.pre+"tt_site_"+c).html(m)}}for(let e in i.protein_chainid)r.hasOwnProperty(e)||($("#"+i.pre+"dt_cdd_"+e).html(""),$("#"+i.pre+"ov_cdd_"+e).html(""),$("#"+i.pre+"tt_cdd_"+e).html(""),$("#"+i.pre+"dt_site_"+e).html(""),$("#"+i.pre+"ov_site_"+e).html(""),$("#"+i.pre+"tt_site_"+e).html(""));i.showAnnoCls.enableHlSeq(),i.bAjaxCddSite=!0}getNoCdd(e){let t=this.icn3d;t.icn3dui,console.log("No CDD data were found for the protein "+e+"...");for(let e in t.protein_chainid)$("#"+t.pre+"dt_cdd_"+e).html(""),$("#"+t.pre+"ov_cdd_"+e).html(""),$("#"+t.pre+"tt_cdd_"+e).html(""),$("#"+t.pre+"dt_site_"+e).html(""),$("#"+t.pre+"ov_site_"+e).html(""),$("#"+t.pre+"tt_site_"+e).html("");t.showAnnoCls.enableHlSeq(),t.bAjaxCddSite=!0}setDomainFeature(e,t,s,i,n,l,r){let o,a,d,c=this.icn3d,h=c.icn3dui;s&&(r={},o={},a={},d={});let p=void 0!==e?e.length:0,m=s?14:19,u=s?100:120;for(let g=0;g
";let T='';i+=R+I+T,s&&(n+='
",i+=T,n+=T,s&&(n+=' ')}}return{html:i,html2:n,html3:l,acc2domain:r,pssmid2name:o,pssmid2fromArray:a,pssmid2toArray:d}}showAnnoType(e,t,s,i,n,l){let r=this.icn3d,o=r.icn3dui,a='
";let b='';a+=g+f+b,d+=g+f+b;let C=s,y=0,v=0;r.seqStartLen&&r.seqStartLen[e]&&(d+=r.showSeqCls.insertMulGapOverview(e,r.seqStartLen[e])),r.seqStartLen&&r.seqStartLen[e]&&(a+=r.showSeqCls.insertMulGap(r.seqStartLen[e],"-"));for(let t=0,i=r.giSeq[e].length;t1&&(c=n[0]+"..");let h=i,p=e+"_"+i,m=n+i;if("ssbond"==s){m="Residue "+p+" has disulfide bond with";let t="";if(void 0!==l[p])for(let e=0,s=l[p].length;e'+c+"",d+=r.showSeqCls.insertGapOverview(e,t);let u=o.cfg.blast_rep_id==e?Math.round(r.seqAnnWidth*t/(r.maxAnnoLength+r.nTotalGap)-y-v):Math.round(r.seqAnnWidth*t/r.maxAnnoLength-y-v);u>=0&&(d+='
",a+=b,d+=b,a+="",d+="",c+="",$("#"+r.pre+"dt_"+s+"_"+e).html(a),$("#"+r.pre+"ov_"+s+"_"+e).html(d),$("#"+r.pre+"tt_"+s+"_"+e).html(c)}setToolTip(){let e=this.icn3d;e.icn3dui,$("[id^="+e.pre+"snp]").add("[id^="+e.pre+"clinvar]").add("[id^="+e.pre+"ssbond]").add("[id^="+e.pre+"crosslink]").tooltip({content:function(){return $(this).prop("title")},show:null,close:function(e,t){t.tooltip.hover((function(){$(this).stop(!0).fadeTo(400,1)}),(function(){$(this).fadeOut("400",(function(){$(this).remove()}))}))}})}}class _t{constructor(e){this.icn3d=e}showInteraction(e,t){this.icn3d.icn3dui,this.showInteraction_base(e,t)}showInteraction_base(e,t){let s=this.icn3d,i=s.icn3dui;i.bNode&&(s.resid2contact||(s.resid2contact={}),s.resid2contact[e]||(s.resid2contact[e]=[])),void 0===s.chainname2residues&&(s.chainname2residues={});let n=Object.keys(s.chains),l=e,r=Math.round(l.indexOf("_"));if(s.firstAtomObjCls.getFirstCalphaAtomObj(s.chains[l]),void 0===s.chainname2residues[l]){s.chainname2residues[l]={};let t=n.length;if(t>100&&void 0===i.cfg.mmdbid&&void 0===i.cfg.gi&&void 0===i.cfg.blast_rep_id&&void 0===i.cfg.align&&void 0===i.cfg.chainalign)return $("#"+s.pre+"dt_interaction_"+e).html(""),void $("#"+s.pre+"ov_interaction_"+e).html("");for(let e=0;e
";let f='';o+=u+g+f,a+=u+g+f;let b="inter"+c.toString(),C=0,y=0,v=1;s.seqStartLen&&s.seqStartLen[e]&&(a+=s.showSeqCls.insertMulGapOverview(e,s.seqStartLen[e])),s.seqStartLen&&s.seqStartLen[e]&&(o+=s.showSeqCls.insertMulGap(s.seqStartLen[e],"-"));for(let t=0,n=s.giSeq[e].length;t
",o+=f,a+=f,++c}o+="",a+="",d+="",$("#"+s.pre+"dt_interaction_"+e).html(o),$("#"+s.pre+"ov_interaction_"+e).html(a),$("#"+s.pre+"tt_interaction_"+e).html(d),i.utilsCls.isMobile()?(s.hlSeqCls.selectSequenceMobile(),s.hlSeqCls.selectChainMobile()):s.hlSeqCls.selectSequenceNonMobile()}}class wt{constructor(e){this.icn3d=e}async showPTM(e,t,s,i,n){let l=this.icn3d,r=l.icn3dui,o=this,a=e.substr(0,e.indexOf("_")),d=e.substr(e.indexOf("_")+1);if("afmem"==s){let t={Transmembrane:[{begin:i,end:n}]};this.setAnnoPtmTransmem("transmem",t,e)}else if(a.length>5){let t,i="https://www.ebi.ac.uk/proteins/api/features/"+a;try{t=await r.getAjaxPromise(i,"json"),o.parsePTM(t,e,s)}catch{return void o.getNoPTM(e,s)}}else{let t,i=a.substr(0,4).toLowerCase(),n="https://www.ebi.ac.uk/pdbe/api/mappings/uniprot/"+i;try{t=await r.getAjaxPromise(n,"json");let a="";l.UPResi2ResiPosPerChain||(l.UPResi2ResiPosPerChain={}),l.UPResi2ResiPosPerChain[e]={};let c=t[i].UniProt,h=!1;for(let t in c){let s=c[t].mappings;for(let i=0,n=s.length;i
",r+=b+C+y,o+=b+C+y;let v=e+l.toString(),_=0,w=0,S=1;i.seqStartLen&&i.seqStartLen[s]&&(o+=i.showSeqCls.insertMulGapOverview(s,i.seqStartLen[s])),i.seqStartLen&&i.seqStartLen[s]&&(r+=i.showSeqCls.insertMulGap(i.seqStartLen[s],"-"));for(let e=0,t=i.giSeq[s].length;e
",r+=y,o+=y,++l}r+="",o+="",a+="",$("#"+i.pre+"dt_"+e+"_"+s).html(r),$("#"+i.pre+"ov_"+e+"_"+s).html(o),$("#"+i.pre+"tt_"+e+"_"+s).html(a)}getNoPTM(e,t){let s=this.icn3d;s.icn3dui,console.log("No PTM data were found for the chain "+e+"...");let i="ptm"==t?"ptm":"transmem";$("#"+s.pre+"dt_"+i+"_"+e).html(""),$("#"+s.pre+"ov_"+i+"_"+e).html(""),$("#"+s.pre+"tt_"+i+"_"+e).html(""),s.showAnnoCls.enableHlSeq(),s.bAjaxPTM=!0}}class St{constructor(e){this.icn3d=e}showCrosslink(e,t){let s=this.icn3d;s.icn3dui;let i=this;void 0===s.clbondpnts?setTimeout((function(){i.showCrosslink_base(e,t)}),1e3):this.showCrosslink_base(e,t)}showCrosslink_base(e,t){let s=this.icn3d;s.icn3dui.bNode&&(s.resid2crosslink||(s.resid2crosslink={}),s.resid2crosslink[e]||(s.resid2crosslink[e]=[]));let i=t,n={},l=i.substr(0,i.indexOf("_")),r=s.clbondpnts[l];if(void 0===r)return $("#"+s.pre+"dt_crosslink_"+e).html(""),$("#"+s.pre+"ov_crosslink_"+e).html(""),void $("#"+s.pre+"tt_crosslink_"+e).html("");for(let e=0,t=r.length;e17?s.substr(0,17)+"...":s,h=i[t].intervals,p={},m={},u=[],g=[],f={},b=0;for(let e=0,t=h.length;e
";let v='';o+=C+y+v,a+=C+y+v;let _="domain3d"+t.toString();l.seqStartLen&&l.seqStartLen[e]&&(o+=l.showSeqCls.insertMulGap(l.seqStartLen[e],"-"));for(let t=0,s=l.giSeq[e].length;t1&&(n=i[0]+"..");let r=s;o+=''+i+""}else o+="-"}l.seqStartLen&&l.seqStartLen[e]&&(o+=l.showSeqCls.insertMulGap(l.seqEndLen[e],"-"));let w=l.firstAtomObjCls.getFirstCalphaAtomObj(l.chains[e]),S=void 0===w.color||"FFFFFF"===w.color.getHexString()?"DDDDDD":w.color.getHexString(),A=void 0!==w.color?S:"CCCCCC";if(l.seqStartLen&&l.seqStartLen[e]&&(a+=l.showSeqCls.insertMulGapOverview(e,l.seqStartLen[e])),r.cfg.blast_rep_id!=e)for(let i=0,n=u.length;i",v+="
",o+=v,a+=v}o+="",a+="",d+="",$("#"+l.pre+"dt_domain_"+e).html(o),$("#"+l.pre+"ov_domain_"+e).html(a),$("#"+l.pre+"tt_domain_"+e).html(d)}}class xt{constructor(e){this.icn3d=e}async showSnp(e,t){this.icn3d.icn3dui,await this.showSnpClinvar(e,t,!0)}async showClinvar(e,t){this.icn3d.icn3dui,await this.showSnpClinvar(e,t,!1)}async showSnpClinvar(e,t,s){let i=this.icn3d.icn3dui,n=this,l=i.htmlCls.baseUrl+"vastdyn/vastdyn.cgi?chainid="+t;try{let r=await i.getAjaxPromise(l,"jsonp"),o=r.snpgi,a=r.gi;if(s)await n.showSnpPart2(e,t,o);else{let s=o;[6137708,1942289,224510717,2624886,253723219,2554905,75765331,3660278,312207882,319443632,342350956,1827805,109157826,1065265,40889086,6730307,163931185,494469,163931091,60594093,55669745,18655489,17942684,6980537,166235465,6435586,4139398,4389047,364506122,78101667,262118402,20664221,2624640,158430173,494395,28948777,34810587,13399647,3660342,261278854,342350965,384482350,378792570,15988303,213424334,4558333,2098365,10835631,3318817,374074330,332639529,122919696,4389286,319443573,2781341,67464020,194709238,210061039,364506106,28949044,40889076,161172338,17943181,4557976,62738484,365813173,6137343,350610552,17942703,576308,223674070,15826518,1310997,93279697,4139395,255311799,157837067,361132363,357380836,146387678,383280379,1127268,299856826,13786789,1311054,46015217,3402130,381353319,30750059,218766885,340707375,27065817,355333104,2624634,62738384,241913553,304446010].includes(a)&&(s=a),await n.showClinvarPart2(e,t,s)}}catch(t){return void(s?n.processNoSnp(e):n.processNoClinvar(e))}}navClinVar(e){let t=this.icn3d;t.icn3dui;let s=this;t.currClin[e]=-1,$(document).on("click","#"+t.pre+e+"_prevclin",(function(t){let i=s.icn3d;t.stopImmediatePropagation();let n=void 0!==i.resi2disease_nonempty[e]?Object.keys(i.resi2disease_nonempty[e]).length:0;--i.currClin[e],i.currClin[e]<0&&(i.currClin[e]=n-1),s.showClinVarLabelOn3D(e)})),$(document).on("click","#"+t.pre+e+"_nextclin",(function(t){let i=s.icn3d;t.stopImmediatePropagation();let n=void 0!==i.resi2disease_nonempty[e]?Object.keys(i.resi2disease_nonempty[e]).length:0;++i.currClin[e],i.currClin[e]>n-1&&(i.currClin[e]=0),s.showClinVarLabelOn3D(e)}))}showClinVarLabelOn3D(e){let t,s,i=this.icn3d,n=i.icn3dui,l=Object.keys(i.resi2disease_nonempty[e]);t=e,s=t+"_"+(parseInt(l[i.currClin[e]])+i.baseResi[e]).toString();let r="",o=i.resi2disease_nonempty[e][l[i.currClin[e]]];for(let e=0,t=o.length;e(from human)",i=" (based on human sequences and mapped to this structure by sequence similarity)"),C+=m?'
";C+='';let O="",R=0,I=0;p?f.seqStartLen&&f.seqStartLen[h]&&(C+=f.showSeqCls.insertMulGapOverview(h,f.seqStartLen[h])):f.seqStartLen&&f.seqStartLen[h]&&(C+=f.showSeqCls.insertMulGap(f.seqStartLen[h],"-"));for(let t=1,a=f.giSeq[h].length;t<=a;++t)if(p){if(void 0!==r[t]){let e=f.giSeq[h][t-1],i=e;e.length>1&&(i=e[0]+"..");let n=f.ParserUtilsCls.getResi(h,t-1)+i+">";for(let e=0,i=s[t].length;e=0&&(C+='
"+f.showAnnoCls.addSnpButton(m,"snpin3d","3D with scap","SNP in 3D with scap",70,g)+" ",u+=f.showAnnoCls.addSnpButton(m,"snpinter","Interactions","SNP Interactions in 3D",70,g)+" ",u+=f.showAnnoCls.addSnpButton(m,"snppdb","PDB","Download SNP PDB",35,g)),u+="
Links: ClinVar, dbSNP(rs"+i[t][e]+")",e
"),++r)}r>d&&2==e&&(p+="..")}else{d=1;for(let e=v;e
"+f.showAnnoCls.addSnpButton(r,"snpin3d","3D with scap","SNP in 3D with scap",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snpinter","Interactions","SNP Interactions in 3D",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snppdb","PDB","Download SNP PDB",35,m)),0!=i[t][e]&&(u+="
Link: dbSNP(rs"+i[t][e]+")"),e
");else{let s=l[t][e].split("; "),a=o[t][e].split("; "),d="",c=0;for(let t=0,i=s.length;t0?d+="; ":0!==e&&1!==e||(O='disease="'+s[t]+'"'),d+=s[t]+"("+a[t]+")",++c;""!=d?(u+=": "+d,C&&!b.cfg.hidelicense&&(u+="
"+f.showAnnoCls.addSnpButton(r,"snpin3d","3D with scap","SNP in 3D with scap",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snpinter","Interactions","SNP Interactions in 3D",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snppdb","PDB","Download SNP PDB",35,m)),u+="
Links: ClinVar, dbSNP(rs"+i[t][e]+")"):(C&&!b.cfg.hidelicense&&(u+="
"+f.showAnnoCls.addSnpButton(r,"snpin3d","3D with scap","SNP in 3D with scap",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snpinter","Interactions","SNP Interactions in 3D",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snppdb","PDB","Download SNP PDB",35,m)),u+="
Link: dbSNP(rs"+i[t][e]+")"),e
")}}y>d&&2==e&&(p+="..")}u+="
",C}processSnpClinvar(e,t,s,i,n){let l=this.icn3d,r=l.icn3dui,o='")+1),h=s[4],p=i?"":s[5],S=i?"":s[6],A=i?"":s[7],x=l.ParserUtilsCls.getResi(t,d-1);v[x]=1,""!=S&&(_[x]=1),g[d]=e+1,void 0===u[d]&&(u[d]=[]),u[d].push(c),void 0===C[d]&&(C[d]=[]),C[d].push(h),void 0===y[d]&&(y[d]=[]),y[d].push(p),void 0===f[d]&&(f[d]=[]),f[d].push(S),""!=S&&(void 0===l.resi2disease_nonempty[t][d]&&(l.resi2disease_nonempty[t][d]=[]),l.resi2disease_nonempty[t][d].push(S)),void 0===b[d]&&(b[d]=[]),b[d].push(A)}let S=Object.keys(v),A=Object.keys(_);if(i){let e=!1;o+=this.getSnpLine(1,2,u,C,y,f,g,b,S,A,1,t,!1,e,void 0,i),o+=this.getSnpLine(2,2,u,C,y,f,g,b,S,A,0,t,!1,e,void 0,i),d+=this.getSnpLine(1,2,u,C,y,f,g,b,S,A,1,t,!1,e,!0,i),d+=this.getSnpLine(2,2,u,C,y,f,g,b,S,A,0,t,!1,e,!0,i),a+=this.getSnpLine(1,2,u,C,y,f,g,b,S,A,1,t,!0,e,void 0,i),o+="0&&this.elt_size[s.sse-1]>=6&&0!=s.adj_strand2&&e++}for(let e=0;e
",w+=x+k+"
";let O='';C+=A+k+O,y+=x+k+O,v+=A+k+O;let R=e.indexOf("_"),I="cst"+e.substr(R+1),T=0,E=0,P=(void 0===l||"seq"===l||"custom"===l)&&-1==s.indexOf("cannot-be-aligned")&&-1==s.indexOf("cannot be aligned"),M="identity"===l&&-1==s.indexOf("cannot-be-aligned")&&-1==s.indexOf("cannot be aligned"),D={},H=0;A="";let F={},L={},N={},q=0;if(h)for(let e=0,t=h.length;e
",O+="",C+=O,v+=A+O,y+=O,_+="",w+="",h?($("#"+p.pre+"dt_custom_"+e+"_"+f).html(y+C),$("#"+p.pre+"ov_custom_"+e+"_"+f).html(v),$("#"+p.pre+"tt_custom_"+e+"_"+f).html(w+_)):($("#"+p.pre+"dt_custom_"+e+"_"+f).html(C),$("#"+p.pre+"ov_custom_"+e+"_"+f).html(v),$("#"+p.pre+"tt_custom_"+e+"_"+f).html(_))}getExonHtml(e,t,s,i,n,l,r){let o=this.icn3d;return o.icn3dui,'20)return!1;if(void 0!==o.giSeq&&void 0!==o.giSeq[e]){let r=this.getFullText(s);return s=r.text,this.showNewTrack(e,t,s,void 0,void 0,i,n,l),!1}setTimeout((function(){a.checkGiSeq(e,t,s,i,n,l,r+1)}),100)}getFullText(e){this.icn3d.icn3dui;let t="",s=[],i=[],n=e.split(","),l=-1;for(let e=0,r=n.length;eA&&(A=e)}let x=S,k=w.length-(A+1),O=[],R=[];for(let e=0,t=p.length;e"),d=a[1].indexOf("\n");n=a[1].substr(d+1).replace(/\n/g,"");for(let e=2,t=a.length;e
Click \"Assembly\" in the menu \"View\" to switch between asymmetric unit and biological assembly("+e.asuCnt+" asymmetric unit).e.maxAnnoLengthOri&&(e.protein_chainid.hasOwnProperty(t)||s.hasOwnProperty(t))&&(e.maxAnnoLengthOri=e.chainsSeq[t].length);e.maxAnnoLength=e.maxAnnoLengthOri}return{nucleotide_chainid:s,chemical_chainid:i,chemical_set:n}}async showAnnotations(){let e=this.icn3d,t=e.icn3dui,s=this,i=this.showAnnotations_part1(),n=i.nucleotide_chainid,l=i.chemical_chainid,r=i.chemical_set;if(!e.bAnnoShown||e.bResetAnno)if(e.bAnnoShown=!0,void 0===t.cfg.blast_rep_id){if(e.bFullUi){if(void 0!==t.cfg.mmtfid){let t=Object.keys(e.structures)[0];await e.mmcifParserCls.downloadMmcifSymmetry(t,"mmtfid")}await this.showAnnoSeqData(n,l,r)}}else if(void 0===t.cfg.blast_rep_id||e.bSmithwm||e.bLocalSmithwm){if(void 0!==t.cfg.blast_rep_id&&(e.bSmithwm||e.bLocalSmithwm)){let i,o,a=[t.cfg.blast_rep_id];if(-1!=t.cfg.query_id.indexOf(">")?o=t.cfg.query_id.substr(t.cfg.query_id.indexOf("\n")+1):!/\d/.test(t.cfg.query_id)||t.cfg.query_id.length>50?o=t.cfg.query_id:a.push(t.cfg.query_id),e.blastAcxn){let s=t.cfg.afid+"_A",n="";for(let t=0,i=e.chainsSeq[s].length;t5){let n;e.uniprot2acc&&e.uniprot2acc[i]?e.uniprot2acc[i]:e.uniprot2acc={},n="https://rest.uniprot.org/uniprotkb/search?format=json&fields=xref_geneid,gene_names&query="+i;let l=await t.getAjaxPromise(n,"json"),r=l.results[0]&&l.results[0].uniProtKBCrossReferences&&l.results[0].uniProtKBCrossReferences[0]?l.results[0].uniProtKBCrossReferences[0].id:void 0,o=l.results[0]&&l.results[0].genes&&l.results[0].genes[0]&&l.results[0].genes[0].geneName?l.results[0].genes[0].geneName.value:"ID "+r;e.chainsGene[s]={geneId:r,geneSymbol:o}}}for(let s in e.protein_chainid){let i=t.utilsCls.isMobile()?"none":"button",l=e.showSeqCls.getProteinName(s),r=l,o=0==n?"Proteins:
":"",a=e.chainsGene[s]&&e.chainsGene[s].geneId&&e.chainsGene[s].geneDesc?"(Gene: "+e.chainsGene[s].geneSymbol+")":"",d=s.substr(0,s.indexOf("_")),c=d.length>5?''+s+"":s,h="
"),++n}if(t.bNode||e.annoCddSiteCls.setToolTip(),void 0!==e.chainid_seq)await this.processSeqData(e.chainid_seq);else try{let n=[],l=[];for(let e=0,t=i.length;e40&&(r=r.substr(0,40)+"...");let o="";0==i&&("protein"==s?o="Proteins:
":"nucleotide"==s?o="Nucleotides:
":"chemical"==s&&(o="Chemicals/Ions/Water:
")),$("#"+n.pre+"dl_annotations").append("
"),n.giSeq[e]=[];for(let t=0;t
":"",o=t[0].lastIndexOf("_"),a=t[0].substr(0,o),d=void 0!==l.cfg.mmdbid&&void 0!==n.chainid2sid?n.chainid2sid[a]:void 0;i=void 0!==d?""+e+" ":""+e+"",$("#"+n.pre+"dl_annotations").append("
");let c='
",c+="
",g+=u+'';let s=0,i=0,n="";a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e]," "));for(let t=0,l=o.length;t
",g+="
",g+=u+'',a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e],"-"));for(let t=0,s=o.length;t':'',g+=" ";else if("E"==a.secondaries[s]){a.firstAtomObjCls.getFirstCalphaAtomObj(a.residues[s]).ssend?"green"==a.sheetcolor?g+='':"yellow"==a.sheetcolor&&(g+=''):"green"==a.sheetcolor?g+='':"yellow"==a.sheetcolor&&(g+=''),g+=" "}else"c"==a.secondaries[s]?g+=' ':"o"==a.secondaries[s]&&(g+=' ');else g+="-"}a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqEndLen[e],"-")),g+='',g+="",g+="
",g+="
";let v='';g+=u+v,f+=u+v;let _,w=0;a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e],"-"));for(let t=0,s=o.length;t1&&(i=s[0]+".."),_=a.ParserUtilsCls.getResi(e,t),a.residues.hasOwnProperty(e+"_"+_)){let n="333333";if(d.cfg.blast_rep_id==e&&void 0!==a.fullpos2ConsTargetpos&&void 0!==a.fullpos2ConsTargetpos[t+w])n=a.fullpos2ConsTargetpos[t+w].color;else{let t=a.firstAtomObjCls.getFirstCalphaAtomObj(a.residues[e+"_"+_]),s=void 0===t.color||"FFFFFF"===t.color.getHexString().toUpperCase()||"FFF"===t.color.getHexString().toUpperCase()?"DDDDDD":t.color.getHexString();n=void 0!==t.color?s:"CCCCCC"}g+=''+i+""}else i=i.toLowerCase(),g+=''+i+""}a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqEndLen[e],"-")),d.cfg.blast_rep_id==e&&(a.opts.color=a.blastAcxn?"confidence":"conservation",a.setColorCls.setColorByOptions(a.opts,a.atoms));let S=a.firstAtomObjCls.getFirstCalphaAtomObj(a.chains[e]),A=S.color?S.color.getHexString():"CCCCCC",x=Math.round(a.seqAnnWidth*o.length/(a.maxAnnoLength+a.nTotalGap));if(x<1&&(x=1),a.seqStartLen&&a.seqStartLen[e]&&(f+=this.insertMulGapOverview(e,a.seqStartLen[e])),d.cfg.blast_rep_id!=e)f+='
",g+=u,f+=u,d.cfg.blast_rep_id==e){if(void 0!==r&&""!==r){u='
";let t='';g+=u+t,f+=u+t;let s=0,i=0,l=1;a.queryStart;for(let t=0,n=r.length;t
",g+=u,f+=u}u='
";let t='';g+=u+t,f+=u+t;let s=a.queryStart;for(let t=0,i=l.length;t-":(void 0===a.fullpos2ConsTargetpos||void 0===a.fullpos2ConsTargetpos[t]||a.residues.hasOwnProperty(e+"_"+a.fullpos2ConsTargetpos[t].pos)||(i=i.toLowerCase()),g+=''+i+"",++s)}let o=a.firstAtomObjCls.getFirstCalphaAtomObj(a.chains[e]),d=void 0===o.color||"FFFFFF"===o.color.getHexString()?"DDDDDD":o.color.getHexString(),c=void 0!==o.color?d:"CCCCCC",h=[],p=[],m="-";for(let e=0,t=l.length;e
",g+=u,f+=u}if(g+="",f+="",b+="",a.giSeq[e].length>10){let t=a.firstAtomObjCls.getFirstCalphaAtomObj(a.chains[e]);if((void 0!==d.cfg.mmdbid||void 0!==d.cfg.gi||void 0!==d.cfg.blast_rep_id||void 0!==d.cfg.align||void 0!==d.cfg.chainalign||void 0!==d.cfg.mmdbafid)&&void 0!==t.resi_ori&&t.resi_ori!=t.resi&&-1==e.indexOf("Misc")){u='
",g+=u+'',a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e],"-"));for(let t=0,s=o.length;t",e%10==0&&(g+=e+" "),g+=""}else g+=""}a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqEndLen[e],"-")),g+='',g+="",g+="
",g+="
",r+=p+'';let m=!1;for(let s=0,l=e.length;s
",r+="",A="-",x="--";for(let t=0,s=r.length;t0&&(T=1,t=i.getGraphCls.getNodeTopBottom(c[e],d,void 0,T,g[e]),h[e]=t.nodeArray1,m[e]=t.nodeArray2,d=n.hashUtilsCls.unionHash(d,t.name2node),T=2,t=i.getGraphCls.getNodeTopBottom(c[e],d,void 0,T,y[e]),f[e]=t.nodeArray1,b[e]=t.nodeArray2,d=n.hashUtilsCls.unionHash(d,t.name2node)),k[e]=l[e].length,O[e]=o[e].length,R=Math.max(R,O[e]),I.push(p[e])}let E,P,M,D,H,F=1,L=3*F,N=7*F,q=10,U=10,$=30,j=20;t?(M=(n.utilsCls.sumArray(k)+2*I.length)*(L+N)+4*U+2*$+j*I.length,P=(R+2)*(L+N)+2*q+$):(E=110+j,M=E*I.length,P=(R+2)*(L+N)+2*q,P+=20),Object.keys(i.chainsMapping).length>0&&(M*=3),t?(i.scatterplotWidth=2*P,H=i.scatterplotWidth,D=n.scatterplotid):(i.linegraphWidth=2*P,H=i.linegraphWidth,D=n.linegraphid),s=0==I.length?"No interactions found for each structure
":"2D integration graph for "+I.length+" structure(s) "+I+'. There are three sections: "Interactions", "Common interactions", and "Different interactions". Each section has '+I.length+" graphs.
",s+=""}else if(t){let e,t,l,c,h=p[0],m=o.length,u=a.length,g=1,f=3*g,b=7*g,C=30;t=(m+2)*(f+b)+2*10+C,e=(u+2)*(f+b)+2*10+C,i.scatterplotWidth=2*e,c=i.scatterplotWidth,l=n.scatterplotid,s=r.length>0?"":"No interactions found for these two sets
",s+=""}else{let e=p[0],t=o.length,l=a.length,c=1,h=3*c,m=7*c,u=110,g=10,f=t>l?t*(h+m)+2*g:l*(h+m)+2*g;i.linegraphWidth=2*f,s=r.length>0?"":"No interactions found for these two sets
",s+=""}return i.lineGraphStr+="}\n",i.scatterplotStr=i.lineGraphStr,t?$("#"+i.pre+"scatterplotDiv").html(s):$("#"+i.pre+"linegraphDiv").html(s),s}drawGraphPerType(e,t,s,i,n,l,r,o,a,d,c,h,p,m){let u=this.icn3d;u.icn3dui;let g,f,b="",C=2==t.length&&"2"==t[1].replace(t[0],"");0==e?(g="Interactions in ",f=""):1==e?(g="Common interactions in ",f="_common"):2==e&&(g="Different interactions in ",f="_diff");for(let y=0,v=t.length;y
",E=p.resid2specCls.atoms2residues(Object.keys(C)),P=p.resid2specCls.atoms2residues(Object.keys(y)),M="select "+p.resid2specCls.residueids2spec(E),D="select "+p.resid2specCls.residueids2spec(P);T+="Set 1: "+e+'
',T+="Set 2: "+t+'
',T+='
';let H=p.resid2specCls.atoms2residues(Object.keys(R)),F=p.resid2specCls.atoms2residues(Object.keys(I)),L="select "+p.resid2specCls.residueids2spec(H),N="select "+p.resid2specCls.residueids2spec(F);T+='interface_1
',T+='interface_2
';let q=T;if(("graph"==i||"linegraph"==i||"scatterplot"==i||b)&&(T=""),T+=O,"save1"==i||"save2"==i){T=q;let e="";"save1"==i?e="Set 1":"save2"==i&&(e="Set 2"),T+='
Interactions Sorted on '+e+': 0&&l!=a&&(i.push({res1:a,res2:w,cntHbond:f,cntIonic:b,cntContact:C,cntHalegen:y,cntPication:v,cntPistacking:_}),o+=this.getInteractionPerResidue(d,c,h,p,m,u,g,f,b,C,y,v,_),c="",h="",p="",m="",u="",g="",f=0,b=0,C=0,y=0,v=0,_=0,w=""),x=t.resids2inter[S].hbond,k=this.getInteractionPairDetails(x,e,"hbond"),c+=k.html,f+=k.cnt,k.cnt>0&&(w+=r+":hbond_"+k.cnt+" "),x=t.resids2inter[S].ionic,k=this.getInteractionPairDetails(x,e,"ionic"),h+=k.html,b+=k.cnt,k.cnt>0&&(w+=r+":ionic_"+k.cnt+" "),x=t.resids2inter[S].contact,k=this.getContactPairDetails(x,e,"contact"),p+=k.html,C+=k.cnt,k.cnt>0&&(w+=r+":contact_"+k.cnt+" "),x=t.resids2inter[S].halogen,k=this.getInteractionPairDetails(x,e,"halogen"),m+=k.html,y+=k.cnt,k.cnt>0&&(w+=r+":halogen_"+k.cnt+" "),x=t.resids2inter[S]["pi-cation"],k=this.getInteractionPairDetails(x,e,"pi-cation"),u+=k.html,v+=k.cnt,k.cnt>0&&(w+=r+":pi-cation_"+k.cnt+" "),x=t.resids2inter[S]["pi-stacking"],k=this.getInteractionPairDetails(x,e,"pi-stacking"),g+=k.html,_+=k.cnt,k.cnt>0&&(w+=r+":pi-stacking_"+k.cnt+" "),a=l,d=O}i.push({res1:a,res2:w,cntHbond:f,cntIonic:b,cntContact:C,cntHalegen:y,cntPication:v,cntPistacking:_}),o+=this.getInteractionPerResidue(d,c,h,p,m,u,g,f,b,C,y,v,_);let S="";if(n.length>0){S+='',S+="
",S+="Residue # Hydrogen
Bond# Salt Bridge
/Ionic Interaction# Contact ",S+="# Halogen
Bond# π-Cation # π-Stacking ",S+="Hydrogen Bond (backbone atoms: @CA, @N, @C, @O) Salt Bridge/Ionic Interaction Contact ",S+="Halogen Bond π-Cation π-Stacking ";let e=' ",S+="",S+=o,S+=" ';S+=e,S+=e,S+='Atom1 Atom2 Distance(Å) Highlight in 3D ',S+=e,S+=e,S+=e,S+="Atom1 Atom2 # Contacts Min Distance(Å) C-alpha Distance(Å) Highlight in 3D
"}return{html:S,bondCnt:i}}getInteractionPerResidue(e,t,s,i,n,l,r,o,a,d,c,h,p){this.icn3d.icn3dui;let m="";m+=' ",m}getInteractionPairDetails(e,t,s){let i=this.icn3d;i.icn3dui;let n="",l=0,r=' ';if(void 0!==e)for(let a in e){let d=a.split(","),c="save1"==t?d[0]:d[1],h="save1"==t?d[1]:d[0],p=i.getGraphCls.convertLabel2Resid(c),m=i.firstAtomObjCls.getFirstAtomObj(i.residues[p]),u=m.color?m.color.getHexString():"",g=i.getGraphCls.convertLabel2Resid(h),f=i.firstAtomObjCls.getFirstAtomObj(i.residues[g]),b=f.color?f.color.getHexString():"",C=Math.sqrt(e[a]).toFixed(1);n+=''+e[3]+e[2]+" "+o+" "+a+" "+d+" "+c+" "+h+" "+p+" ";let u=[t,s,i,n,l,r];for(let e in u){m+=' "}return m+="'+u[e]+"
",++l}return{html:n,cnt:l}}getContactPairDetails(e,t){let s=this.icn3d;s.icn3dui;let i="",n=0,l=' ';if(void 0!==e)for(let o in e){let a=o.split(","),d="save1"==t?a[0]:a[1],c="save1"==t?a[1]:a[0],h=s.getGraphCls.convertLabel2Resid(d),p=s.firstAtomObjCls.getFirstAtomObj(s.residues[h]),m=p.color?p.color.getHexString():"",u=s.getGraphCls.convertLabel2Resid(c),g=s.firstAtomObjCls.getFirstAtomObj(s.residues[u]),f=g.color?g.color.getHexString():"",b=e[o].split("_"),C=b[0],y=b[1],v=b[2],_=b[3],w=b[4];i+=' '+c+r+u+o+' '+h+r+b+o+' '+C+" ",n+='',n+=" ",n+=parseInt(w)}return{html:i,cnt:n}}exportInteractions(){var e=this.icn3d,t=e.icn3dui;let s=' '+d+"@"+v+l+m+r+' '+c+"@"+_+l+f+r+' '+w+' '+C+' '+y+" ",i+='',i+="
Interacting residues: ';for(let t in e.chainname2residues)for(let i in e.chainname2residues[t]){let n=t.substr(0,t.indexOf("_"))+"_"+i.substr(0,i.indexOf(" "));s+="Base Chain: Residues Interacting Chain "}s+=""+t+": ",s+=e.resid2specCls.residueids2spec(e.chainname2residues[t][i]),s+=" "+n+" "+n[e]+" Cys "+n[e+1]+" Cys ",++i}}let n='
'+i+" disulfide pairs: ";n+=s,n+="Residue ID 1 Residue ID 2 "+r+" "+t.resn+" "+o+" "+n.resn+" ",++i}n[r+"_"+o]=1,n[o+"_"+r]=1}}let l='
'+i+" cross-linkage pairs: ";l+=s,l+="Residue ID 1 Residue ID 2 ",++l}}let a=' '+t+r+d+o+' '+i+r+h+o+' '+p+" ","view"==e&&(n+=''),n+="
'+l+" hydrogen bond pairs (backbone atoms: @CA, @N, @C, @O):
";if(l>0&&(a+=" ",a+=n,a+="Atom 1 Atom 2 Distance(Å) ","view"==e&&(a+='Highlight in 3D '),a+="
"),"graph"==e||"linegraph"==e||"scatterplot"==e){return s.getGraphCls.getGraphLinks(s.resid2ResidhashHbond,s.resid2ResidhashHbond,i.htmlCls.hbondColor,t,i.htmlCls.hbondValue)}return a}exportSaltbridgePairs(e,t){var s=this.icn3d,i=s.icn3dui;let n="",l=0,r=' ';for(let t in s.resid2ResidhashSaltbridge){let i=s.getGraphCls.convertLabel2Resid(t),a=s.firstAtomObjCls.getFirstAtomObj(s.residues[i]),d=a.color?a.color.getHexString():"";for(let i in s.resid2ResidhashSaltbridge[t]){let a=s.getGraphCls.convertLabel2Resid(i),c=s.firstAtomObjCls.getFirstAtomObj(s.residues[a]),h=c.color?c.color.getHexString():"",p=Math.sqrt(s.resid2ResidhashSaltbridge[t][i]).toFixed(1);n+=' ",++l}}let a=' '+t+r+d+o+' '+i+r+h+o+' '+p+" ","view"==e&&(n+=''),n+="
'+l+" salt bridge/ionic interaction pairs:
";if(l>0&&(a+=" ",a+=n,a+="Atom 1 Atom 2 Distance(Å) ","view"==e&&(a+='Highlight in 3D '),a+="
"),"graph"==e||"linegraph"==e||"scatterplot"==e){return s.getGraphCls.getGraphLinks(s.resid2ResidhashSaltbridge,s.resid2ResidhashSaltbridge,i.htmlCls.ionicColor,t,i.htmlCls.ionicValue)}return a}exportHalogenPiPairs(e,t,s){var i=this.icn3d,n=i.icn3dui;let l,r,o,a="",d=0,c=' ';"halogen"==s?(l=i.resid2ResidhashHalogen,r=n.htmlCls.halogenColor,o=n.htmlCls.halogenValue):"pi-cation"==s?(l=i.resid2ResidhashPication,r=n.htmlCls.picationColor,o=n.htmlCls.picationValue):"pi-stacking"==s&&(l=i.resid2ResidhashPistacking,r=n.htmlCls.pistackingColor,o=n.htmlCls.pistackingValue);for(let t in l){let n=i.getGraphCls.convertLabel2Resid(t),r=i.firstAtomObjCls.getFirstAtomObj(i.residues[n]),o=r.color?r.color.getHexString():"";for(let n in l[t]){let r=i.getGraphCls.convertLabel2Resid(n),p=i.firstAtomObjCls.getFirstAtomObj(i.residues[r]),m=p.color?p.color.getHexString():"",u=Math.sqrt(l[t][n]).toFixed(1);a+=' ",++d}}let p=' '+t+c+o+h+' '+n+c+m+h+' '+u+" ","view"==e&&(a+=''),a+="
'+d+" "+s+" pairs:
";if(d>0&&(p+=" ",p+=a,p+="Atom 1 Atom 2 Distance(Å) ","view"==e&&(p+='Highlight in 3D '),p+="
"),"graph"==e||"linegraph"==e||"scatterplot"==e){return i.getGraphCls.getGraphLinks(l,l,r,t,o)}return p}exportSpherePairs(e,t,s){var i=this.icn3d,n=i.icn3dui;let l="",r=0,o=e?i.resid2ResidhashInteractions:i.resid2ResidhashSphere,a=' ';for(let s in o){let n=i.getGraphCls.convertLabel2Resid(s),c=i.firstAtomObjCls.getFirstAtomObj(i.residues[n]),h=c.color?c.color.getHexString():"";for(let n in o[s]){let p=i.getGraphCls.convertLabel2Resid(n),m=i.firstAtomObjCls.getFirstAtomObj(i.residues[p]),u=m.color?m.color.getHexString():"",g=o[s][n].split("_"),f=g[0],b=g[1];c=g[2],m=g[3];let C=g[4];e?(l+=' "):l+=" '+s+"@"+c+a+h+d+' '+n+"@"+m+a+u+d+' '+C+' '+f+' '+b+" ","view"==t&&(l+=''),l+=" ",++r}}let c='"+s+" "+n+' '+C+' '+f+' '+b+"
'+r+" residue pairs in "+(e?"the contacts":"sphere")+":
";if(r>0&&(e?(c+=' "):c+='Residue 1 Residue 2 Num Contacts Min Distance(Å) C-alpha Distance(Å) ',"view"==t&&(c+='Highlight in 3D '),c+=" ',c+=l,c+="Residue 1 Residue 2 Num Contacts Min Distance(Å) C-alpha Distance(Å)
"),"graph"==t||"linegraph"==t||"scatterplot"==t||"calpha"==t||"cbeta"==t||"heavyatoms"==t){return i.getGraphCls.getGraphLinks(o,o,n.htmlCls.contactColor,s,n.htmlCls.contactValue)}return c}}class $t{constructor(e){this.icn3d=e}drawGraph(e,t){var s=this.icn3d,i=s.icn3dui;if(void 0===n)var n=d3;var l=JSON.parse(e),r=$("#"+t).width(),o=$("#"+t).height(),a=isNaN(r)?300:1*r,d=isNaN(o)?300:1*o,c=r,h=o,p=d3.select("#"+i.svgid).attr("width",r).attr("height",o).attr("viewBox","0,0,"+a+","+d);p.selectAll(".g-main").remove();var m=p.append("g").classed("g-main",!0),u=m.append("rect").attr("width",c).attr("height",h).style("fill","#FFF"),g=m.append("g"),f=n.zoom().on("zoom",(function(){g.attr("transform",n.event.transform)}));if(m.call(f),l.links){for(var b=[],C={},y=0,v=l.nodes.length;y
",i+="",g+="}\n",t){n.alignerrormapStr=g,$("#"+n.pre+"alignerrormapDiv").html(i);let e=$("#"+l.alignerrormapid+"_scale").val();$("#"+l.alignerrormapid).attr("width",(n.alignerrormapWidth*parseFloat(e)).toString()+"px")}else n.contactmapStr=g,$("#"+n.pre+"contactmapDiv").html(i);return i}}class Bt{constructor(e){this.icn3d=e}async downloadAlignment(e,t){let s=this.icn3d,i=s.icn3dui,n=this;s.opts.proteins="c alpha trace";let l=e.split(","),r="ids="+e,o=i.htmlCls.baseUrl+"vastplus/vastplus.cgi?v=3&cmd=c&b=1&s=1&w3d&"+r;void 0!==i.cfg.inpara&&(o+=i.cfg.inpara),s.pdbid_chain2title={},void 0===s.chainids2resids&&(s.chainids2resids={});let a={},d="These two MMDB IDs "+l+' do not have 3D alignment data in the VAST+ database. You can try the VAST alignment by visiting the VAST+ page https://www.ncbi.nlm.nih.gov/Structure/vastplus/vastplus.cgi?uid=[PDB ID] (e.g., uid=1KQ2), and clicking "Original VAST"',c=await i.getAjaxPromise(o,"jsonp",!0,d);if(a=c.seqalign,void 0===a)return alert(d),!1;s.pdbid_molid2chain={},s.chainsColor={};for(let e=0,t=2;e5){let s=!0,i=!0;c=await r.pdbParserCls.loadPdbData(t[e],l,!1,s,"query",h,i)}else{let s=!0;c=await r.mmdbParserCls.parseMmdbData(t[e],"query",i[e+1],e,h,s)}d=o.hashUtilsCls.unionHash(d,c)}if(o.cfg.resnum)await r.realignParserCls.realignChainOnSeqAlign(s,i);else if(o.cfg.resdef)await r.realignParserCls.realignChainOnSeqAlign(s,i,void 0,!0);else{await r.pdbParserCls.applyCommandDssp(!0);for(let e in r.pdbChainIndexHash){let t=r.pdbChainIndexHash[e].split("_");l=t[0],t[1],n=t[2],t[3],a.transformStructure(l,e-1,"query")}let e=[],t=[],c=[],h=o.htmlCls.baseUrl+"vastdyn/vastdyn.cgi",p=o.htmlCls.baseUrl+"tmalign/tmalign.cgi";for(let s in r.afChainIndexHash){let i=r.afChainIndexHash[s].split("_");l=i[0];let a=i[1];n=i[2];let d,m=i[3];if("tmalign"!=o.cfg.aligntool){let e={domains1:r.domain3dCls.getDomainJsonForAlign(r.chains[l+"_"+a]),domains2:r.domain3dCls.getDomainJsonForAlign(r.chains[n+"_"+m])};d=o.getAjaxPostPromise(h,e)}else{let e={pdb_query:r.saveFileCls.getAtomPDB(r.chains[l+"_"+a]),pdb_target:r.saveFileCls.getAtomPDB(r.chains[n+"_"+m])};d=o.getAjaxPostPromise(p,e)}e.push(d),t.push(s-1),c.push(l)}let m=Promise.allSettled(e),u=await m;await a.downloadChainalignmentPart2b(s,i,d,u,t,n,c)}}async downloadChainalignmentPart2b(e,t,s,i,n,l,r){let o=this.icn3d,a=o.icn3dui;for(let e=0,t=i.length;e
",r.tmscore=e[0].score.toPrecision(4)),$("#"+r.pre+"dl_rmsd_html").html(n),o.cfg.bSidebyside||o.htmlCls.dialogCls.openDlg("dl_rmsd","RMSD of alignment"),a=!0}return a}async loadOpmDataForChainalign(e,t,s,i){let n=this.icn3d,l=n.icn3dui,r=this;if(l.cfg.resnum||l.cfg.resdef)n.bCommandLoad||n.init(),await this.downloadChainalignmentPart2(e,t,void 0,s);else{let o=l.htmlCls.baseUrl+"vastdyn/vastdyn.cgi?mmdbids2opm="+i.join("','"),a=await l.getAjaxPromise(o,"jsonp");if(a&&a.mmdbid){let i=a.mmdbid;n.selectedPdbid=i;let o="https://opm-assets.storage.googleapis.com/pdb/"+i.toLowerCase()+".pdb",d=await l.getAjaxPromise(o,"text");n.bOpm=!0;let c=!0,h=n.loadPDBCls.loadPDB(d,i,n.bOpm,c);$("#"+n.pre+"selectplane_z1").val(n.halfBilayerSize),$("#"+n.pre+"selectplane_z2").val(-n.halfBilayerSize),$("#"+n.pre+"extra_mem_z").val(n.halfBilayerSize),$("#"+n.pre+"intra_mem_z").val(-n.halfBilayerSize),n.bCommandLoad||n.init(),await r.downloadChainalignmentPart2(e,t,h,s)}else n.bCommandLoad||n.init(),await r.downloadChainalignmentPart2(e,t,void 0,s)}}async downloadMmdbAf(e,t,s){let i=this.icn3d,n=i.icn3dui;i.structArray=i.structures?Object.keys(i.structures):[],0==i.structArray.length?i.init():(i.resetConfig(),i.bResetAnno=!0,i.bResetSets=!0);let l=e.split(","),r=[];for(let e=0,t=l.length;e1&&($("#"+i.pre+"assemblyWrapper").show(),i.asuCnt=i.biomtMatrices.length);let d,c,h,p,m,u,g,f,b,C,y,v,_,w,S,A,x,k,O,R={},I=[],T="coil",E="",P=0,M=0,D={onModel:function(e){d=0===e.modelIndex?a:a+(e.modelIndex+1).toString()},onChain:function(e){c=e.chainName;let t=d+"_"+c;void 0===i.structures[d]&&(i.structures[d]=[]),i.structures[d].push(t)},onGroup:function(e){h=e.groupName,p=e.groupId;let t=d+"_"+c+"_"+p;m=0===e.secStruct||2===e.secStruct||4===e.secStruct?"helix":3===e.secStruct?"sheet":-1===e.secStruct?"other":"coil";let s=!1;if(c!==E){if(x=void 0,O=void 0,"coil"!==m&&"other"!==m?(u=!0,g=!1):(u=!1,g=!1),"coil"!==T&&"other"!==T){let e=d+"_"+E+"_"+P.toString();for(let t in i.residues[e])i.atoms[t].ssbegin=!1,i.atoms[t].ssend=!0}}else x=A,O=k,m!==T?"coil"===T||"other"===T?(u=!0,g=!1):"coil"===m||"other"===m?(s=!0,u=!1,g=!1):("sheet"===T&&"helix"===m||"helix"===T&&"sheet"===m)&&(s=!0,u=!0,g=!1):(u=!1,g=!1);if(s&&!isNaN(p)){let e=d+"_"+c+"_"+(p-1).toString();for(let t in i.residues[e])i.atoms[t].ssbegin=!1,i.atoms[t].ssend=!0}T=m,E=c,P=p,f=!1,b=!1,C=!1,"non-polymer"===e.chemCompType.toLowerCase()||"other"===e.chemCompType.toLowerCase()||-1!==e.chemCompType.toLowerCase().indexOf("saccharide")?f=!0:-1!==e.chemCompType.toLowerCase().indexOf("peptide")?b=!0:-1!==e.chemCompType.toLowerCase().indexOf("dna")||-1!==e.chemCompType.toLowerCase().indexOf("rna")?C=!0:b=!0;let l=d+"_"+c,r={};r.resi=p,r.name=n.utilsCls.residueName2Abbr(h),i.residueId2Name[t]=r.name,r.resi%10==0&&r.resi.toString();let o="-";"helix"===m?o="H":"sheet"===m?o="E":"coil"===m?o="c":"other"===m&&(o="o"),void 0===i.chainsSeq[l]&&(i.chainsSeq[l]=[]),i.bFullUi&&i.chainsSeq[l].push(r),i.secondaries[t]=o},onAtom:function(e){if(y=e.element,v=e.atomName,_=new THREE.Vector3(e.xCoord,e.yCoord,e.zCoord),w=e.bFactor,S=e.altLoc,"\0"===e.altLoc&&(S=""),""===S||"A"===S){++M,"SG"===v&&I.push(M),R[e.atomIndex]=M;let t={het:f,serial:M,name:v,alt:S,resn:h,structure:d,chain:c,resi:p,coord:_,b:w,elem:y,bonds:[],bondOrder:[],ss:m,ssbegin:u,ssend:g};if(t.het||"C"!==t.name||(A=M),t.het||"O"!==t.name||(k=M),!t.het&&"N"===t.name&&void 0!==x&&void 0!==O){let e=i.atoms[x].coord.distanceTo(i.atoms[O].coord),s=t.coord.x+(i.atoms[x].coord.x-i.atoms[O].coord.x)/e,n=t.coord.y+(i.atoms[x].coord.y-i.atoms[O].coord.y)/e,l=t.coord.z+(i.atoms[x].coord.z-i.atoms[O].coord.z)/e;t.hcoord=new THREE.Vector3(s,n,l)}i.atoms[M]=t,l.min(_),r.max(_),o.add(_);let a=d+"_"+c,T=a+"_"+p;void 0===i.chains[a]&&(i.chains[a]={}),i.chains[a][M]=1,void 0===i.residues[T]&&(i.residues[T]={}),i.residues[T][M]=1,b?(i.proteins[M]=1,"CA"===v&&(i.calphas[M]=1),"N"!==v&&"H"!==v&&"CA"!==v&&"HA"!==v&&"C"!==v&&"O"!==v&&(i.sidec[M]=1)):C?(i.nucleotides[M]=1,(!s||"O3'"!=v&&"O3*"!=v)&&(s||"P"!=v)||(i.nucleotidesO3[M]=1),-1===n.parasCls.nuclMainArray.indexOf(v)&&(i.ntbase[M]=1)):y.toLowerCase()===h.toLowerCase()?i.ions[M]=1:"HOH"===h||"WAT"===h||"SQL"===h||"H2O"===h||"W"===h||"DOD"===h||"D3O"===h?i.water[M]=1:i.chemicals[M]=1,i.dAtoms[M]=1,i.hAtoms[M]=1}},onBond:function(e){let t=R[e.atomIndex1],s=R[e.atomIndex2];if(R.hasOwnProperty(e.atomIndex1)&&R.hasOwnProperty(e.atomIndex2)&&(i.atoms[t].bonds.push(s),i.atoms[s].bonds.push(t),f)){let n=e.bondOrder;i.atoms[t].bondOrder.push(n),i.atoms[s].bondOrder.push(n),2===n?(i.doublebonds[t+"_"+s]=1,i.doublebonds[s+"_"+t]=1):3===n&&(i.triplebonds[t+"_"+s]=1,i.triplebonds[s+"_"+t]=1)}}};MMTF.traverse(e,D),i.loadPDBCls.setResidMapping();for(let e=0,t=I.length;e5){let e=r.cfg.chainalign.split(",");e.length>0&&(l.hAtoms=l.definedSetsCls.getAtomsFromNameArray(e)),r.cfg.aligntool="tmalign",await l.realignParserCls.realignOnStructAlign()}else l.hAtoms=l.chainalignParserCls.setMsa(e),l.transformCls.zoominSelection(),await l.chainalignParserCls.downloadChainalignmentPart3(void 0,e,l.hAtoms)}async parseChainRealignData(e,t,s,i,n,l,r){let o=this.icn3d,a=o.icn3dui,d=s[0].substr(0,s[0].indexOf("_"));r||(d=d.toUpperCase());let c={};o.realignResid={},o.opts.color="grey",o.setColorCls.setColorByOptions(o.opts,o.dAtoms),o.qt_start_end=[];for(let t=0,h=e.length;t9||s<0)return n*i|0;i=10*i+s|0}return n*i}function u(e,t,s){let i=1,n=0,l=0,r=1;for(45===e.charCodeAt(t)&&(i=-1,++t);t=0&&o<10)){if(-2===o){for(++t;t=0&&o<10))return 53===o||21===o?parseScientific(i*(n+l/r),e,t+1,s):i*(n+l/r);l=10*l+o,r*=10,++t}return i*(n+l/r)}if(53===o||21===o)return parseScientific(i*n,e,t+1,s);break}n=10*n+o,++t}return i*n}let g=function(){function e(e){this.data=e,this.isDefined=!0}return e.prototype.getString=function(e){return""+this.data[e]},e.prototype.getInteger=function(e){return 0|this.data[e]},e.prototype.getFloat=function(e){return 1*this.data[e]},e.prototype.stringEquals=function(e,t){return this.data[e]===u(t,0,t.length)},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return 0},e}(),f=function(){function e(e,t){this.data=e,this.mask=t,this.isDefined=!0}return e.prototype.getString=function(e){return 0===this.mask[e]?""+this.data[e]:null},e.prototype.getInteger=function(e){return 0===this.mask[e]?this.data[e]:0},e.prototype.getFloat=function(e){return 0===this.mask[e]?this.data[e]:0},e.prototype.stringEquals=function(e,t){return 0===this.mask[e]?this.data[e]===u(t,0,t.length):null==t},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return this.mask[e]},e}(),b=function(){function e(e){this.data=e,this.isDefined=!0}return e.prototype.getString=function(e){return this.data[e]},e.prototype.getInteger=function(e){let t=this.data[e];return m(t,0,t.length)},e.prototype.getFloat=function(e){let t=this.data[e];return u(t,0,t.length)},e.prototype.stringEquals=function(e,t){return this.data[e]===t},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return 0},e}(),C=function(){function e(e,t){this.data=e,this.mask=t,this.isDefined=!0}return e.prototype.getString=function(e){return 0===this.mask[e]?this.data[e]:null},e.prototype.getInteger=function(e){if(0!==this.mask[e])return 0;let t=this.data[e];return m(t||"",0,(t||"").length)},e.prototype.getFloat=function(e){if(0!==this.mask[e])return 0;let t=this.data[e];return u(t||"",0,(t||"").length)},e.prototype.stringEquals=function(e,t){return this.data[e]===t},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return this.mask[e]},e}(),y=function(){function e(e){this.dataBlocks=e.dataBlocks.map((function(e){return new i(e)}))}return e.prototype.toJSON=function(){return this.dataBlocks.map((function(e){return e.toJSON()}))},e}();return new y(s)}MessagePackParse(e){this.icn3d.icn3dui;let t=this;function s(e,s){let i={};for(let n=0;n0&&(i[i.length]=l.slice(0,a).join(""));return i.join("")}(e.buffer,e.offset,t);return e.offset+=t,s}let r=function(){let e=[];for(let t=0;t<1024;t++)e[t]=String.fromCharCode(t);return e}();let o,a,d=e.buffer[e.offset];if(0==(128&d))return e.offset++,d;if(128==(240&d))return a=15&d,e.offset++,s(e,a);if(144==(240&d))return a=15&d,e.offset++,n(e,a);if(160==(224&d))return a=31&d,e.offset++,l(e,a);if(224==(224&d))return o=e.dataView.getInt8(e.offset),e.offset++,o;switch(d){case 192:return e.offset++,null;case 194:return e.offset++,!1;case 195:return e.offset++,!0;case 196:return a=e.dataView.getUint8(e.offset+1),e.offset+=2,i(e,a);case 197:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,i(e,a);case 198:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,i(e,a);case 202:return o=e.dataView.getFloat32(e.offset+1),e.offset+=5,o;case 203:return o=e.dataView.getFloat64(e.offset+1),e.offset+=9,o;case 204:return o=e.buffer[e.offset+1],e.offset+=2,o;case 205:return o=e.dataView.getUint16(e.offset+1),e.offset+=3,o;case 206:return o=e.dataView.getUint32(e.offset+1),e.offset+=5,o;case 208:return o=e.dataView.getInt8(e.offset+1),e.offset+=2,o;case 209:return o=e.dataView.getInt16(e.offset+1),e.offset+=3,o;case 210:return o=e.dataView.getInt32(e.offset+1),e.offset+=5,o;case 217:return a=e.dataView.getUint8(e.offset+1),e.offset+=2,l(e,a);case 218:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,l(e,a);case 219:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,l(e,a);case 220:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,n(e,a);case 221:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,n(e,a);case 222:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,s(e,a);case 223:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,s(e,a)}}}class ss{constructor(e){this.icn3d=e}alignCoords(e,t,s,i,n,l,r,o){let a,d=this.icn3d,c=d.icn3dui,h=e.length
Realignment RMSD: "+a.toPrecision(4)+" Å
";d.bAfMem&&!c.cfg.chainalign&&(e+=c.utilsCls.getMemDesc()),$("#"+d.pre+"dl_rmsd_html").html(e),c.cfg.bSidebyside||c.htmlCls.dialogCls.openDlg("dl_rmsd","Realignment RMSD")}let r={};for(let n=0,l=d.structures[s].length;n
"+t.diagram2dCls.set2DdgmNote(),$("#"+t.pre+"dl_2ddgm_html").html(t.html2ddgm)),t.b2DShown=!0}showLoading(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"wait")&&$("#"+e.pre+"wait").show(),$("#"+e.pre+"canvas")&&$("#"+e.pre+"canvas").hide(),$("#"+e.pre+"cmdlog")&&$("#"+e.pre+"cmdlog").hide()}hideLoading(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"wait")&&$("#"+e.pre+"wait").hide(),$("#"+e.pre+"canvas")&&$("#"+e.pre+"canvas").show(),$("#"+e.pre+"cmdlog")&&$("#"+e.pre+"cmdlog").show()}setYourNote(e){let t=this.icn3d,s=t.icn3dui;t.yournote=e,$("#"+t.pre+"yournote").val(t.yournote),s.cfg.shownote&&(document.title=t.yournote)}transformToOpmOri(e){let t=this.icn3d;if(t.icn3dui,void 0!==t.rmsd_supr&&void 0!==t.rmsd_supr.rot){let s=t.rmsd_supr.rot,i=t.rmsd_supr.trans1,n=t.rmsd_supr.trans2;t.rmsd_supr.rmsd;let l=0;for(let e in t.atoms){let r=t.atoms[e];r.coord=t.surfaceCls.transformMemPro(r.coord,s,i,n);let o=r.coord.x*r.coord.x+r.coord.y*r.coord.y;Math.abs(r.coord.z)<=25&&o>l&&(l=o)}this.addMemAtoms(t.halfBilayerSize,e,Math.sqrt(l)),t.bStopRotate=!0,t.bOpm=!0,$("#"+t.pre+"togglememli").show(),$("#"+t.pre+"adjustmemli").show(),$("#"+t.pre+"selectplaneli").show()}else t.bOpm=!1}transformToOpmOriForAlign(e,t,s){let i=this.icn3d,n=i.icn3dui;if(void 0!==t){let l=i.loadPDBCls.getChainCalpha(i.chains,i.atoms,s,e),r=1==Object.keys(l.chainresiCalphaHash).length||1==Object.keys(t.chainresiCalphaHash).length,o=[],a=[];for(let e in l.chainresiCalphaHash)if(t.chainresiCalphaHash.hasOwnProperty(e)){let s=l.chainresiCalphaHash[e],i=t.chainresiCalphaHash[e];if((s.length==i.length||r)&&(o=o.concat(s),a=a.concat(i)),o.length>500)break}let d=o.length=2?$("#"+e.pre+"mn2_alternateWrap").show():$("#"+e.pre+"mn2_alternateWrap").hide(),setTimeout((async function(){if(e.bInitial){if(void 0!==t.cfg.align||void 0!==t.cfg.chainalign){let s=e.pre+"selection";if($("#"+s).show(),$("#"+s+"_expand").hide(),$("#"+s+"_shrink").show(),void 0!==t.cfg.align&&2!=t.cfg.atype){let s=!1,i=t.htmlCls.alignSeqCls.getAlignSequencesAnnotations(Object.keys(e.alnChains),void 0,void 0,s);$("#"+e.pre+"dl_sequence2").html(i.sequencesHtml),$("#"+e.pre+"dl_sequence2").width(t.htmlCls.RESIDUE_WIDTH*i.maxSeqCnt+200)}}if(t.cfg.showanno){let s="view annotations";t.htmlCls.clickMenuCls.setLogCmd(s,!0),await e.showAnnoCls.showAnnotations()}(t.cfg.closepopup||t.cfg.imageonly)&&e.resizeCanvasCls.closeDialogs()}else e.hlUpdateCls.updateHlAll();$("#"+e.pre+"atomsCustom").length>0&&$("#"+e.pre+"atomsCustom")[0].blur(),e.bInitial=!1,t.cfg.imageonly&&e.saveFileCls.saveFile(void 0,"png",void 0,!0)}),0)}processCommand(){let e=this.icn3d,t=e.icn3dui;if(1==Object.keys(e.structures).length){let s=Object.keys(e.structures)[0];t.cfg.command=t.cfg.command.replace(new RegExp("!","g"),s+"_")}}getMassCenter(e,t){return this.icn3d.icn3dui,e.multiplyScalar(1/t)}getGeoCenter(e,t){return this.icn3d.icn3dui,e.clone().add(t).multiplyScalar(.5)}getStructureSize(e,t,s,i){let n=this.icn3d;n.icn3dui;let l=0;for(let r in e){let e=n.atoms[r].coord;if(Math.round(t.x)==Math.round(e.x)||Math.round(t.y)==Math.round(e.y)||Math.round(t.z)==Math.round(e.z)||Math.round(s.x)==Math.round(e.x)||Math.round(s.y)==Math.round(e.y)||Math.round(s.z)==Math.round(e.z)){let t=2*e.distanceTo(i);t>l&&(l=t)}}return l}async checkMemProteinAndRotate(){let e=this.icn3d,t=e.icn3dui;if(!e.bCheckMemProtein){e.bCheckMemProtein=!0;let s=t.cfg.afid?t.cfg.afid:t.cfg.mmdbafid;if(await e.ParserUtilsCls.checkMemProtein(s),t.cfg.url&&-1!=t.cfg.url.indexOf("membranome")){let t=new THREE.Vector3(1,0,0),s=-.5*Math.PI;e.transformCls.setRotation(t,s)}}}async checkMemProtein(e){let t=this.icn3d,s=t.icn3dui;try{let i=s.htmlCls.baseUrl+"vastdyn/vastdyn.cgi?afid2mem="+e,n=await s.getAjaxPromise(i,"jsonp");if(n&&n.pdbid){let e='This is a single-spanning (bitopic) transmembrane protein according to the Membranome database. Do you want to align the protein with the model from Membranome? If you click "OK", you can press the letter "a" to alternate the structures.';if("off"==s.cfg.afmem);else if("on"==s.cfg.afmem||confirm(e))try{let e="https://storage.googleapis.com/membranome-assets/pdb_files/proteins/"+n.pdbid+".pdb",i=await s.getAjaxPromise(e,"text");t.bAfMem=!0,s.bNode||$("#"+s.pre+"togglememli").show();let l=n.pdbid.substr(0,n.pdbid.indexOf("_")),r=!0,o=!0;await t.pdbParserCls.loadPdbData(i,l,r,o),o&&(t.bSetChainsAdvancedMenu&&t.definedSetsCls.showSets(),t.bAnnoShown&&await t.showAnnoCls.showAnnotations());let a=n.segment.replace(/ /gi,"").split("(")[0];t.afmem_start_end=a.split("-"),t.hAtoms={},t.dAtoms={};for(let e in t.atoms)t.atoms[e].structure!=l&&(t.hAtoms[e]=1),t.dAtoms[e]=1;for(let e=parseInt(t.afmem_start_end[0]);e<=parseInt(t.afmem_start_end[1]);++e)t.hAtoms=s.hashUtilsCls.unionHash(t.hAtoms,t.residues[l+"_A_"+e]);await t.realignParserCls.realignOnSeqAlign(l)}catch(e){return void console.log("Error in retrieving matched PDB from Membranome...")}}}catch(e){return void console.log("Error in finding matched PDB in Membranome...")}}getResi(e,t){let s=this.icn3d;s.icn3dui;let i=s.ncbi2resid[e+"_"+(t+1).toString()];return i?i.substr(i.lastIndexOf("_")+1):""}getResiNCBI(e,t){let s=this.icn3d;s.icn3dui;let i=s.resid2ncbi[e+"_"+t];return i?parseInt(i.substr(i.lastIndexOf("_")+1)):0}}class is{constructor(e){this.icn3d=e}loadAtomDataIn(e,t,s,i,n,l,r,o,a){let d=this.icn3d,c=d.icn3dui;d.pmin=new THREE.Vector3(9999,9999,9999),d.pmax=new THREE.Vector3(-9999,-9999,-9999),d.psum=new THREE.Vector3;let h=e.atoms,p=d.atoms?Object.keys(d.atoms).length:0,m={},u={};d.pmid=e.pubmedId,void 0===d.chainid2title&&(d.chainid2title={}),void 0===d.chainid2sid&&(d.chainid2sid={});let g={},f={};if("align"===s){d.pmid="",d.molTitle="",c.cfg.inpara&&-1!==c.cfg.inpara.indexOf("atype=1")?d.molTitle="Invariant Core Structure Alignment (VAST) of ":c.cfg.inpara&&-1!==c.cfg.inpara.indexOf("atype=2")?d.molTitle="Structure Alignment (TM-align) of ":d.molTitle="Structure Alignment (VAST) of ";let t=!1;for(let s=0,i=e.alignedStructures[0].length;s'+i.pdbId.toUpperCase()+"",void 0!==i.descr&&(d.pmid+=i.descr.pubmedid),0===s&&(d.molTitle+=" and ",void 0!==i.descr&&(d.pmid+="_")),t=!0}d.molTitle+=" from VAST+",t||(d.molTitle="")}else if(void 0!==e.descr&&(d.molTitle+=e.descr.name),"mmdbid"===s){let s=isNaN(t)?t:e.pdbId,i={};void 0===d.alignmolid2color&&(d.alignmolid2color=[]);let n=1;for(let t in e.moleculeInfor){if(0===Object.keys(e.moleculeInfor[t]).length)continue;let l=e.moleculeInfor[t].chain.trim();(parseInt(c.cfg.date)>=20231001||!c.cfg.date&&parseInt(c.utilsCls.getDateDigitStr())>=20231001)&&(l=l.replace(/_/g,""));let r=s+"_"+l;i.hasOwnProperty(l)?(++i[l],r+=i[l]):i[l]=1,void 0!==d.mmdbid_q&&(d.mmdbid_q,d.mmdbid_t);let o=e.moleculeInfor[t].kind,a=e.moleculeInfor[t].color,h=e.moleculeInfor[t].sid;if(g[r]=o,f[r]=a,"protein"==o&&(d.organism=e.moleculeInfor[t].taxonomyName.toLowerCase()),void 0!==h&&(d.chainid2sid[r]=h),void 0===d.pdbid_chain2title&&(d.pdbid_chain2title={}),d.pdbid_chain2title[r]=e.moleculeInfor[t].name,l==r.substr(r.lastIndexOf("_"))){let e={};e[t]=n.toString(),d.alignmolid2color.push(e)}++n}}"mmdbid"===s&&(d.molTitleHash||(d.molTitleHash={}),d.molTitleHash[t]=d.molTitle);let b,C,y,v,_,w={},S="",A="",x="",k="",O="",R="",I=0,T=0,E="",P=!0,M=!1,D="",H=c.utilsCls.isCalphaPhosOnly(h),F=0,L={};for(let e in h){++p,w[e]=p;let i,n=h[e];n.serial=p,"mmdbid"===s||"mmcifid"===s?i=t:"align"===s&&(i=m[p]);let l=!1;if(void 0!==n.chain||"mmdbid"!==s&&"align"!==s)n.chain=""===n.chain?"Misc":n.chain;else if("mmdbid"===s)if(b=n.ids.m,void 0!==d.molid2chain[b]){let e=d.molid2chain[b].indexOf("_");n.chain=d.molid2chain[b].substr(e+1)}else{let e="Misc";("protein"===g[O]&&"nucleotide"===g[O]&&n.resi!=T||"protein"!==g[O]&&"nucleotide"!==g[O]&&(n.resn.substr(0,3)!=E.substr(0,3)||n.resi!=T||"solvent"===g[O]||"HOH"===n.resn))&&++F,n.resi_ori=n.resi,n.resi=F,l=!0,n.chain=e}else if("align"===s)if(b=n.ids.m,void 0!==d.pdbid_molid2chain[i+"_"+b])n.chain=d.pdbid_molid2chain[i+"_"+b];else{let e="Misc";("protein"===g[O]&&"nucleotide"===g[O]&&n.resi!=T||"protein"!==g[O]&&"nucleotide"!==g[O]&&(n.resn.substr(0,3)!=E.substr(0,3)||n.resi!=T||"solvent"===g[O]||"HOH"===n.resn))&&(++F,n.resi_ori=n.resi,n.resi=F,l=!0),n.chain=e}if(n.chain=n.chain.trim(),(parseInt(c.cfg.date)>=20231001||!c.cfg.date&&parseInt(c.utilsCls.getDateDigitStr())>=20231001)&&(n.chain=n.chain.replace(/_/g,"")),"mmdbid"!==s&&"align"!==s||(n.structure=i,"mmdbid"===s&&void 0!==d.mmdbid_q&&(d.mmdbid_q,d.mmdbid_t)),k=n.structure,O=k+"_"+n.chain,"mmdbid"===s||"align"===s){l||(n.resi_ori=n.resi,d.bUsePdbNum?n.resi=n.resi_ori:n.resi=n.ids.r);let e=n.resn.indexOf(" ");-1!==e&&0!=e&&(n.resn=n.resn.substr(0,e))}O!==A&&(I=0),n.resi!==I&&(O!==A?(y=void 0,_=void 0):(y=C,_=v)),n.coord="mmdbid"===s?new THREE.Vector3(n.coord[0],n.coord[1],n.coord[2]):new THREE.Vector3(n.coord.x,n.coord.y,n.coord.z);let r=c.utilsCls.residueName2Abbr(n.resn.substr(0,3));"mmdbid"!==s&&"align"!==s||!d.bFullUi||(void 0===d.mmdbMolidResid2mmdbChainResi&&(d.mmdbMolidResid2mmdbChainResi={}),d.mmdbMolidResid2mmdbChainResi[i+"_"+n.ids.m+"_"+n.ids.r]=i+"_"+n.chain+"_"+n.resi),d.pmin.min(n.coord),d.pmax.max(n.coord),d.psum.add(n.coord);let o=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"protein"===g[O]:"p"===n.mt,a=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"nucleotide"===g[O]:"n"===n.mt,u=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"solvent"===g[O]:"s"===n.mt,N=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"ligand"===g[O]||void 0!==g[O]&&-1!==g[O].indexOf("other")||void 0===g[O]:"l"===n.mt;if("Misc"!==n.chain&&"other"!==g[O]||"protein"===L[O]||"nucleotide"===L[O]||("CA"===n.name&&"C"===n.elem?L[O]="protein":"P"===n.name&&"P"===n.elem?L[O]="nucleotide":L[O]="chemical"),o||a?(o?(d.proteins[p]=1,"CA"===n.name&&(d.calphas[p]=1),"N"!==n.name&&"H"!==n.name&&"CA"!==n.name&&"HA"!==n.name&&"C"!==n.name&&"O"!==n.name&&(d.sidec[p]=1)):a&&(d.nucleotides[p]=1,("O3'"==n.name||"O3*"==n.name||H&&"P"==n.name)&&(d.nucleotidesO3[p]=1),-1===c.parasCls.nuclMainArray.indexOf(n.name)&&(d.ntbase[p]=1)),n.het=!1):u?(d.water[p]=1,n.het=!0):N&&("HOH"===n.resn||"O"===n.resn?d.water[p]=1:n.elem===n.resn?d.ions[p]=1:d.chemicals[p]=1,n.het=!0),"mmdbid"===s?n.het?n.color=c.parasCls.atomColors[n.elem]||c.parasCls.defaultAtomColor:n.color=void 0!==f[O]?c.parasCls.thr(f[O]):c.parasCls.chargeColors[n.resn]:void 0!==n.color&&(n.color=c.parasCls.thr(n.color))," "!==n.resn.charAt(0)&&" "===n.resn.charAt(1)&&(n.resn=n.resn.charAt(0)),n.het||"C"!==n.name||(C=p),n.het||"O"!==n.name||(v=p),!n.het&&"N"===n.name&&void 0!==y&&void 0!==_){let e=d.atoms[y].coord.distanceTo(d.atoms[_].coord),t=n.coord.x+(d.atoms[y].coord.x-d.atoms[_].coord.x)/e,s=n.coord.y+(d.atoms[y].coord.y-d.atoms[_].coord.y)/e,i=n.coord.z+(d.atoms[y].coord.z-d.atoms[_].coord.z)/e;n.hcoord=new THREE.Vector3(t,s,i)}"HOH"==n.resn&&(d.water[p]=1),d.atoms[p]=n,d.dAtoms[p]=1,d.hAtoms[p]=1;let q=n.structure+"_"+n.chain;void 0===d.chains[q]&&(d.chains[q]={}),d.chains[q][p]=1;let U=q+"_"+n.resi;void 0===d.residues[U]&&(d.residues[U]={}),d.residues[U][p]=1,R=O+"_"+n.resi,R!==x&&O!==A&&(P=!0,""!==S&&(void 0===d.structures[S]&&(d.structures[S]=[]),d.structures[S].push(A))),d.residueId2Name[U]=r;let $="-";if("helix"===n.ss?$="H":"sheet"===n.ss?$="E":n.het||a?$="o":(!n.het&&c.parasCls.residueColors.hasOwnProperty(n.resn.toUpperCase())||"coil"===n.ss)&&($="c"),d.secondaries[n.structure+"_"+n.chain+"_"+n.resi]=$,(n.resi!=I||b!=D)&&d.bFullUi&&(void 0===d.chainsSeq[q]&&(d.chainsSeq[q]=[],P=!1),!isNaN(n.resi)))if(P&&!M&&void 0!==d.chainsSeq[q][n.resi-1])d.chainsSeq[q][n.resi-1].name=r;else if(!P||!d.chainsSeq[q].hasOwnProperty(n.resi-1)){let e={};e.resi=n.resi,e.name=r,n.resi%10==0&&n.resi.toString(),d.chainsSeq[q].push(e),M=!0}I=n.resi,T=n.resi_ori,E=n.resn,S=k,A=O,x=R,D=b}for(let e in d.chemicals){let t=d.atoms[e];if("P"==t.elem&&t.bonds.length>=4)for(let e=t.bonds.length-1;e>=0;--e){"P"==d.atoms[t.bonds[e]].elem&&t.bonds.splice(e,1)}}for(let e in L)if(!(Object.keys(d.chains[e]).length<10)&&"chemical"!==L[e])for(let t in d.chains[e]){let s=d.atoms[t];delete d.chemicals[t],s.het=!1,"protein"===L[e]?(d.proteins[t]=1,"CA"===s.name&&(d.calphas[t]=1),"N"!==s.name&&"H"!==s.name&&"CA"!==s.name&&"HA"!==s.name&&"C"!==s.name&&"O"!==s.name&&(d.sidec[t]=1)):"nucleotide"===L[e]&&(d.nucleotides[t]=1,("O3'"==s.name||"O3*"==s.name||H&&"P"==s.name)&&(d.nucleotidesO3[t]=1),-1===c.parasCls.nuclMainArray.indexOf(s.name)&&(d.ntbase[t]=1))}if(void 0===d.structures[k]&&(d.structures[k]=[]),d.structures[k].push(O),d.bFullUi)if("mmdbid"===s||"mmcifid"===s)for(let i in e.sequences){let n=e.sequences[i],l=t+"_"+i;void 0!==d.mmdbid_q&&(d.mmdbid_q,d.mmdbid_t),d.ParserUtilsCls.getMissingResidues(n,s,l)}else if("align"===s)for(let e in d.chainid2seq){let t=d.chainid2seq[e];d.ParserUtilsCls.getMissingResidues(t,s,e)}if(d.loadPDBCls.setResidMapping(),"mmcifid"!==s)for(let e in h){let t=w[e],s=void 0===d.atoms[t].bonds?0:d.atoms[t].bonds.length;for(let e=0;ed.maxatomcnt||void 0!==d.biomtMatrices&&d.biomtMatrices.length*d.cnt>10*d.maxatomcnt)&&(d.opts.proteins="c alpha trace",d.opts.nucleotides="o3 trace"),d.center=d.ParserUtilsCls.getGeoCenter(d.pmin,d.pmax),d.maxD=d.ParserUtilsCls.getStructureSize(d.atoms,d.pmin,d.pmax,d.center),d.maxD<5&&(d.maxD=5),d.oriMaxD=d.maxD,("align"===s||o)&&(d.ssbondpnts={},d.loadPDBCls.setSsbond()),"mmdbid"===s&&1==Object.keys(d.structures).length){let t=e.disulfides;if(void 0!==t)for(let e=0,s=t.length;ep&&(p=e)),c[e]={resi:t,resn:i,aligned:n}}r=e[t][1];let u=r.moleculeId,g=s.pdbid_molid2chain[l+"_"+u],f=l+"_"+g;void 0===s.alnChainsAnTtl[d]&&(s.alnChainsAnTtl[d]=[]),void 0===s.alnChainsAnTtl[d][0]&&(s.alnChainsAnTtl[d][0]=[]),void 0===s.alnChainsAnTtl[d][1]&&(s.alnChainsAnTtl[d][1]=[]),void 0===s.alnChainsAnTtl[d][2]&&(s.alnChainsAnTtl[d][2]=[]),void 0===s.alnChainsAnTtl[d][3]&&(s.alnChainsAnTtl[d][3]=[]),void 0===s.alnChainsAnTtl[d][4]&&(s.alnChainsAnTtl[d][4]=[]),void 0===s.alnChainsAnTtl[d][5]&&(s.alnChainsAnTtl[d][5]=[]),void 0===s.alnChainsAnTtl[d][6]&&(s.alnChainsAnTtl[d][6]=[]),s.alnChainsAnTtl[d][0].push(f),s.alnChainsAnTtl[d][1].push(d),s.alnChainsAnTtl[d][2].push(""),s.alnChainsAnTtl[d][3].push(""),s.alnChainsAnTtl[d][4].push(f),s.alnChainsAnTtl[d][5].push(d),s.alnChainsAnTtl[d][6].push("");let b=1;s.chainsMapping[d]||(s.chainsMapping[d]={}),s.chainsMapping[f]||(s.chainsMapping[f]={});for(let e=h;e<=p;++e){let t,o,p,m=s.bUsePdbNum?s.ParserUtilsCls.getResi(f,r.sequence[e][0]-1):r.sequence[e][0],u="~"===r.sequence[e][2]?"-":r.sequence[e][2],C=r.sequence[e][3]?1:0,y=c[e].aligned+C;2===y?(c[e].resn===u?(t="#FF0000",p="icn3d-cons",s.consHash1[d+"_"+c[e].resi]=1,s.consHash2[f+"_"+m]=1):(t="#0000FF",p="icn3d-ncons",s.nconsHash1[d+"_"+c[e].resi]=1,s.nconsHash2[f+"_"+m]=1),s.chainsMapping[d][d+"_"+c[e].resi]=c[e].resn+c[e].resi,s.chainsMapping[f][f+"_"+m]=c[e].resn+c[e].resi,o="#"+s.showAnnoCls.getColorhexFromBlosum62(c[e].resn,u)):(t=i.htmlCls.GREY8,p="icn3d-nalign",s.nalignHash1[d+"_"+c[e].resi]=1,s.nalignHash2[f+"_"+m]=1),void 0===s.alnChainsSeq[d]&&(s.alnChainsSeq[d]=[]);let v={};v.mmdbid=n,v.chain=a,v.resi=c[e].resi,v.resn=""===v.resi||"icn3d-nalign"===p?c[e].resn.toLowerCase():c[e].resn,v.aligned=y,v.color=""===v.resi?i.htmlCls.GREYC:t,v.color2=""===v.resi?i.htmlCls.GREYC:o,v.class=p,s.alnChainsSeq[d].push(v),""!==c[e].resi&&(void 0===s.alnChains[d]&&(s.alnChains[d]={}),$.extend(s.alnChains[d],s.residues[d+"_"+c[e].resi])),void 0===s.alnChainsSeq[f]&&(s.alnChainsSeq[f]=[]),v={},v.mmdbid=l,v.chain=g,v.resi=m,v.resn=""===v.resi||"icn3d-nalign"===p?u.toLowerCase():u,v.aligned=y,v.color=""===v.resi?i.htmlCls.GREYC:t,v.color2=""===v.resi?i.htmlCls.GREYC:o,v.class=p,s.alnChainsSeq[f].push(v),""!==v.resi&&(void 0===s.alnChains[f]&&(s.alnChains[f]={}),$.extend(s.alnChains[f],s.residues[f+"_"+m])),void 0===s.alnChainsAnno[d]&&(s.alnChainsAnno[d]=[]),void 0===s.alnChainsAnno[d][0]&&(s.alnChainsAnno[d][0]=[]),void 0===s.alnChainsAnno[d][1]&&(s.alnChainsAnno[d][1]=[]),void 0===s.alnChainsAnno[d][2]&&(s.alnChainsAnno[d][2]=[]),void 0===s.alnChainsAnno[d][3]&&(s.alnChainsAnno[d][3]=[]),e===h&&(void 0===s.alnChainsAnno[d][4]&&(s.alnChainsAnno[d][4]=[]),void 0===s.alnChainsAnno[d][5]&&(s.alnChainsAnno[d][5]=[]),void 0===s.alnChainsAnno[d][6]&&(s.alnChainsAnno[d][6]=[]),s.alnChainsAnno[d][4].push(s.pdbid_chain2title[f]),s.alnChainsAnno[d][5].push(s.pdbid_chain2title[d]),s.alnChainsAnno[d][6].push(""));let _=d+"_"+c[e].resi,w=f+"_"+m,S=s.secondaries[_],A=s.secondaries[w];A?s.alnChainsAnno[d][0].push(A):s.alnChainsAnno[d][0].push("-"),S?s.alnChainsAnno[d][1].push(S):s.alnChainsAnno[d][1].push("-");let x=".";b%5==0&&(x="*"),b%10==0&&(x="|"),s.alnChainsAnno[d][2].push(x);let k="";b%10==0&&(k=b.toString()),s.alnChainsAnno[d][3].push(k),++b}}e={}}getPosFromResi(e,t){let s=this.icn3d;s.icn3dui;let i,n=s.resid2ncbi[e+"_"+t];if(n){i=n.substr(n.lastIndexOf("_")+1)-1}return i}getResnFromResi(e,t){let s=this.icn3d;s.icn3dui;let i=e+"_"+t,n=s.residueId2Name[i];return n||(n="?"),n}getResiAferAlign(e,t,s){let i,n=this.icn3d,l=n.icn3dui;if(t&&"tmalign"==l.cfg.aligntool)i=s;else if(n.posid2resid){let t=n.posid2resid[e+"_"+s];i=t.substr(t.lastIndexOf("_")+1)}else i=n.chainsSeq[e][s].resi;return i}setSeqAlignChain(e,t,s){let i,n,l,r,o,a,d,c,h,p,m,u=this.icn3d,g=u.icn3dui,f={},b=!!s;if(b){if(o=s[1],a=s[0],t=s[2],d=o.indexOf("_"),c=a.indexOf("_"),i=o.substr(0,d).toUpperCase(),n=a.substr(0,c).toUpperCase(),l=o.substr(d+1),r=a.substr(d+1),i==n&&l==r){let e=u.chainsSeq[n+"_"+r].length;u.qt_start_end[t]={q_start:1,q_end:e,t_start:1,t_end:e}}}else{let d=s[0].indexOf("_"),c=e.indexOf("_");if(i=u.mmdbid_t,n=e.substr(0,c).toUpperCase(),l=s[0].substr(d+1),r=e.substr(c+1),i==n&&l==r){let e=u.chainsSeq[u.mmdbid_q+"_"+u.chain_q].length;u.qt_start_end[t]={q_start:1,q_end:e,t_start:1,t_end:e}}o=i+"_"+l,a=n+"_"+r,void 0!==n&&u.mmdbid_t}u.conservedName1=o+"_cons",u.nonConservedName1=o+"_ncons",u.notAlignedName1=o+"_nalign",u.conservedName2=a+"_cons",u.nonConservedName2=a+"_ncons",u.notAlignedName2=a+"_nalign",u.consHash1={},u.nconsHash1={},u.nalignHash1={},u.consHash2={},u.nconsHash2={},u.nalignHash2={},u.alnChains={},u.alnChainsSeq[o]=[],u.alnChains[o]={},u.alnChainsSeq[a]=[],u.alnChains[a]={},u.alnChainsAnno[o]=[],u.alnChainsAnTtl[o]=[],void 0===u.alnChainsAnTtl[o]&&(u.alnChainsAnTtl[o]=[]);for(let e=0;e<7;++e)void 0===u.alnChainsAnTtl[o][e]&&(u.alnChainsAnTtl[o][e]=[]);u.alnChainsAnTtl[o][0].push(a),u.alnChainsAnTtl[o][1].push(o),u.alnChainsAnTtl[o][2].push(""),u.alnChainsAnTtl[o][3].push(""),u.alnChainsAnTtl[o][4].push(a),u.alnChainsAnTtl[o][5].push(o),u.alnChainsAnTtl[o][6].push("");let C=0,y=0;if(void 0===u.qt_start_end[t])return;let v=1;u.chainsMapping[o]||(u.chainsMapping[o]={}),u.chainsMapping[a]||(u.chainsMapping[a]={});let _={},w={};for(let e=0,s=u.qt_start_end[t].length;e0){let e=v;for(let t=C+1,i=s;tc&&(c=t)}}}"tmalign"==n.cfg.aligntool&&(s=!0);let p=Object.keys(a);p.sort((function(e,t){return parseInt(e)-parseInt(t)}));let m=-999,u=0,g=0,f=[],b=0;for(let e=0,t=p.length;en)for(let e=0,t=d-a;e0?void 0!==n?p.alnChainsAnno[t][0].push(n):p.alnChainsAnno[t][0].push("-"):console.log("Error: ic.alnChainsAnno[chainid1] is undefined")}}}class ls{constructor(e){this.icn3d=e}getStructureId(e,t,s){let i=this.icn3d;i.icn3dui;let n=e;return(e==i.defaultPdbId||s||i.structures.hasOwnProperty(e))&&(n=1===t?e:e+t.toString()),n}loadPDB(e,t,s,i,n,l,r,o){let a,d,c=this.icn3d,h=c.icn3dui,p={},m=!1,u=e.split("\n"),g={},f={};c.atoms||(l=!1),n||l?(c.oriNStru=c.structures?Object.keys(c.structures).length:0,d=c.oriNStru+1,a=c.atoms?Object.keys(c.atoms).length:0):(c.init(),d=1,a=0);let b,C,y,v,_,w,S,A=[],x=[],k=[],O=[],R=[],I=[],T="",E="",P="",M={},D=t||c.defaultPdbId,H=D,F="",L=!1,N=!0;for(let e in u){let r=u[e],q=r.substr(0,6);if("HEADER"!==q||L||t)if("TITLE "===q){let e=r.substr(10).replace(/ALPHAFOLD MONOMER V2.0 PREDICTION FOR /gi,"");c.molTitle+=e.trim()+" ",o&&c.esmTitle&&(c.molTitle=c.esmTitle),c.molTitleHash||(c.molTitleHash={}),c.molTitleHash[H]=c.molTitle}else if("HELIX "===q){c.bSecondaryStructure=!0;let e=""==r.substr(18,2).trim()?"A":r.substr(18,2).trim(),t=parseInt(r.substr(21,4)),s=parseInt(r.substr(33,4));for(let i=t;i<=s;++i){let n=H+"_"+e+"_"+i;O.push(n),i===t&&R.push(n),i===s&&I.push(n)}}else if("SHEET "===q){void 0!==s&&s||(c.bSecondaryStructure=!0);let e=""==r.substr(20,2).trim()?"A":r.substr(20,2).trim(),t=parseInt(r.substr(22,4)),i=parseInt(r.substr(33,4));for(let s=t;s<=i;++s){let n=H+"_"+e+"_"+s;A.push(n),s===t&&x.push(n),s===i&&k.push(n)}}else if("HBOND "===q)void 0!==s&&s||(c.bSecondaryStructure=!0);else if("SSBOND"===q){c.bSsbondProvided=!0;let e=D+"_"+(" "==r.substr(15,1)?"A":r.substr(15,1))+"_"+r.substr(17,4).trim(),t=D+"_"+(" "==r.substr(29,1)?"A":r.substr(29,1))+"_"+r.substr(31,4).trim();void 0===c.ssbondpnts[D]&&(c.ssbondpnts[D]=[]),c.ssbondpnts[D].push(e),c.ssbondpnts[D].push(t)}else if("REMARK"===q){let e=parseInt(r.substr(7,3));if(-1!==r.indexOf("1/2 of bilayer thickness:"))c.halfBilayerSize=parseFloat(r.substr(r.indexOf(":")+1).trim());else if(210==e)"EXPERIMENT TYPE"==r.substr(11,32).trim()&&"NMR"==r.substr(45).trim()&&(m=!0);else if(350==e&&"BIOMT"==r.substr(13,5)){let e=parseInt(r[18])-1,t=parseInt(r.substr(21,2))-1;null==c.biomtMatrices[t]&&(c.biomtMatrices[t]=(new THREE.Matrix4).identity()),c.biomtMatrices[t].elements[e]=parseFloat(r.substr(24,9)),c.biomtMatrices[t].elements[e+4]=parseFloat(r.substr(34,9)),c.biomtMatrices[t].elements[e+8]=parseFloat(r.substr(44,9)),c.biomtMatrices[t].elements[e+12]=parseFloat(r.substr(54,14))}else if(465==e&&" "==r.substr(18,1)&&" "==r.substr(20,1)&&"S"!=r.substr(21,1)){let e=r.substr(15,3),t=r.substr(18,2).trim(),s=r.substr(21,5).trim(),i=D+"_"+t;void 0===c.chainMissingResidueArray[i]&&(c.chainMissingResidueArray[i]=[]);let n={};n.resi=s,n.name=h.utilsCls.residueName2Abbr(e).toLowerCase(),""!=F&&t==F&&t!=F||(c.chainMissingResidueArray[i].push(n),F=t)}else 900==e&&void 0===c.emd&&"RELATED DB: EMDB"==r.substr(34).trim()&&(c.emd=r.substr(23,11).trim())}else if("SOURCE"===q&&void 0===c.organism&&"ORGANISM_COMMON"==r.substr(11,15).trim())c.organism=r.substr(28).toLowerCase().trim(),c.organism=c.organism.substr(0,c.organism.length-1);else if("ENDMDL"===q)++d,D=c.defaultPdbId,H=this.getStructureId(D,d,n),m||(A=[],x=[],k=[],O=[],R=[],I=[]),L=!1;else if("JRNL "===q)"PMID"===r.substr(12,4)&&(c.pmid=r.substr(19).trim());else if("ATOM "===q||"HETATM"===q){N&&(H=this.getStructureId(D,d,n),N=!1);let e=r.substr(16,1);++a,M[parseInt(r.substr(6,5))]=a;let t=r.substr(76,2).trim();""===t&&(t=r.substr(12,2).trim());let l=r.substr(12,4).trim(),u=r.substr(17,3),F=r.substr(20,2).trim();""===F&&(F="A");let L=r.substr(22,5).trim(),U=L;if(s&&"DUM"===u&&(t=l,F="MEM",U=1,L=1),i&&"DUM"===u)break;b=H+"_"+F,y=b+"_"+L,C=b+"_"+U;let $=parseFloat(r.substr(30,8)),j=parseFloat(r.substr(38,8)),B=parseFloat(r.substr(46,8)),z=new THREE.Vector3($,j,B),G=parseFloat(r.substr(60,8));o&&(G*=100);let V={het:"H"===q[0],serial:a,name:l,alt:e,resn:u,structure:H,chain:F,resi:U,coord:z,b:G,elem:t,bonds:[],ss:"coil",ssbegin:!1,ssend:!1};if(V.het||"C"!==V.name||(v=a),V.het||"O"!==V.name||(w=a),!V.het&&"N"===V.name&&void 0!==_&&void 0!==S){let e=c.atoms[_].coord.distanceTo(c.atoms[S].coord),t=V.coord.x+(c.atoms[_].coord.x-c.atoms[S].coord.x)/e,s=V.coord.y+(c.atoms[_].coord.y-c.atoms[S].coord.y)/e,i=V.coord.z+(c.atoms[_].coord.z-c.atoms[S].coord.z)/e;V.hcoord=new THREE.Vector3(t,s,i)}c.atoms[a]=V,c.dAtoms[a]=1,c.hAtoms[a]=1,p[a]=1,this.isSecondary(C,A,m)?(c.atoms[a].ss="sheet",this.isSecondary(C,x,m)&&(c.atoms[a].ssbegin=!0),this.isSecondary(C,k,m)&&(c.atoms[a].ssend=!0)):this.isSecondary(C,O,m)&&(c.atoms[a].ss="helix",this.isSecondary(C,R,m)&&(c.atoms[a].ssbegin=!0),this.isSecondary(C,I,m)&&(c.atoms[a].ssend=!0));let W="-";if(W="helix"===c.atoms[a].ss?"H":"sheet"===c.atoms[a].ss?"E":!c.atoms[a].het&&h.parasCls.residueColors.hasOwnProperty(c.atoms[a].resn.toUpperCase())?"c":"o",c.secondaries[C]=W,y!==P){let e=h.utilsCls.residueName2Abbr(u);if(c.residueId2Name[C]=e,1!==a&&""!==E&&(c.residues[E]=f),C!==E&&(f={}),b!==T){_=void 0,S=void 0,1!==a&&""!==T&&(void 0===c.chains[T]&&(c.chains[T]={}),c.chains[T]=h.hashUtilsCls.unionHash(c.chains[T],g)),g={},void 0===c.structures[H.toString()]&&(c.structures[H.toString()]=[]),c.structures[H.toString()].includes(b)||c.structures[H.toString()].push(b),void 0===c.chainsSeq[b]&&(c.chainsSeq[b]=[]);let t={};t.resi=U,t.name=e,c.chainsSeq[b].push(t)}else{_=v,S=w;let t={};t.resi=U,t.name=e,c.chainsSeq[b].push(t)}}g[a]=1,f[a]=1,T=b,E=C,P=y}else if("CONECT"===q){let e=parseInt(r.substr(6,5));for(let t=0;t<4;++t){let s=parseInt(r.substr([11,16,21,26][t],5));isNaN(s)||void 0!==c.atoms[M[e]]&&c.atoms[M[e]].bonds.push(M[s])}}else q.substr(0,3);else D=r.substr(62).trim(),""==D&&(D=l?c.defaultPdbId:c.inputid&&-1==c.inputid.indexOf("/")?c.inputid.substr(0,10):c.defaultPdbId),H=this.getStructureId(D,d,n),c.molTitle="",c.molTitleHash={},L=!0}c.residues[C]=f,void 0===c.chains[b]&&(c.chains[b]={}),c.chains[b]=h.hashUtilsCls.unionHash2Atoms(c.chains[b],g,c.atoms),this.adjustSeq(c.chainMissingResidueArray);let q=Object.keys(c.structures);for(let e=0,t=q.length;er&&i>r&&(h=!0),s<=r&&i>r?s>i||h?(o[c]=t[d],d++):(o[c]=e[a],a++):s>r&&i<=r?s<=i||h?(o[c]=e[a],a++):(o[c]=t[d],d++):s<=i?(o[c]=e[a],a++):(o[c]=t[d],d++),c++}if(a4||Math.abs(l.y-r.y)>4||Math.abs(l.z-r.z)>4||(l.x-r.x)*(l.x-r.x)+(l.y-r.y)*(l.y-r.y)+(l.z-r.z)*(l.z-r.z)<16&&(void 0===t.ssbondpnts[e]&&(t.ssbondpnts[e]=[]),t.ssbondpnts[e].push(o),t.ssbondpnts[e].push(a)))}}}getChainCalpha(e,t,s,i){let n=this.icn3d,l=n.icn3dui,r={};for(let o in e){if(void 0!==i){if(o.split("_")[0]!==i)continue}let a=Object.keys(e[o]),d=[],c=0,h=0;for(let e=0,i=a.length;e3?i.resn.trim().substr(0,3):i.resn.trim();if(!l.parasCls.chargeColors.hasOwnProperty(e))continue;s?i.resi_ori:i.resi,d.push(i.coord.clone()),++c,h=i.resi}}if(c>0){r[t[a[0]].chain]=d}}return{chainresiCalphaHash:r,center:n.center.clone()}}isSecondary(e,t,s){if(this.icn3d.icn3dui,s){let s=e.substr(e.indexOf("_")+1),i=!1;for(let e=0,n=t.length;ep[e]
"),l.cfg.bSidebyside||l.htmlCls.dialogCls.openDlg("dl_rmsd","Realignment RMSD"),n.q_rotation=[],n.q_trans_sub=[],n.t_trans_add=[],n.q_rotation.push({x1:e[0],y1:e[1],z1:e[2],x2:e[3],y2:e[4],z2:e[5],x3:e[6],y3:e[7],z3:e[8]}),n.q_trans_sub.push(i),n.t_trans_add.push({x:-r.x,y:-r.y,z:-r.z}),l.cfg.aligntool="vast";//!= 'tmalign';
+let c=0,h="query",p=o.substr(0,o.indexOf("_")),m=!0;n.chainalignParserCls.transformStructure(p,c,h,m);let u="";for(let e=0,i=s.length;e8)return s;let g=[];g[0]=n[0]*r[0]+n[1]*r[1]+n[2]*r[2],g[1]=n[3]*r[0]+n[4]*r[1]+n[5]*r[2],g[2]=n[6]*r[0]+n[7]*r[1]+n[8]*r[2],g[0]-=n[0]*a[0]+n[1]*a[1]+n[2]*a[2],g[1]-=n[3]*a[0]+n[4]*a[1]+n[5]*a[2],g[2]-=n[6]*a[0]+n[7]*a[1]+n[8]*a[2];let f=0;return f=c[0]*g[0],f+=c[1]*g[1],f+=c[2]*g[2],f/=p*m,f<.866?s:(g[0]=l[0]*r[0]+l[1]*r[1]+l[2]*r[2],g[1]=l[3]*r[0]+l[4]*r[1]+l[5]*r[2],g[2]=l[6]*r[0]+l[7]*r[1]+l[8]*r[2],g[0]-=l[0]*a[0]+l[1]*a[1]+l[2]*a[2],g[1]-=l[3]*a[0]+l[4]*a[1]+l[5]*a[2],g[2]-=l[6]*a[0]+l[7]*a[1]+l[8]*a[2],f=c[0]*g[0],f+=c[1]*g[1],f+=c[2]*g[2],f/=p*m,f<.866?s:(u=0,u+=Math.pow(e.q_rotation.x1-t.q_rotation.x1,2),u+=Math.pow(e.q_rotation.y1-t.q_rotation.y1,2),u+=Math.pow(e.q_rotation.z1-t.q_rotation.z1,2),u+=Math.pow(e.q_rotation.x2-t.q_rotation.x2,2),u+=Math.pow(e.q_rotation.y2-t.q_rotation.y2,2),u+=Math.pow(e.q_rotation.z2-t.q_rotation.z2,2),u+=Math.pow(e.q_rotation.x3-t.q_rotation.x3,2),u+=Math.pow(e.q_rotation.y3-t.q_rotation.y3,2),u+=Math.pow(e.q_rotation.z3-t.q_rotation.z3,2),Math.sqrt(u)))}GetRotMatrix(e,t,s){this.icn3d.icn3dui;let i=[];return i&&(i[0]=e.q_rotation.x1/t,i[1]=e.q_rotation.y1/t,i[2]=e.q_rotation.z1/t,i[3]=e.q_rotation.x2/t,i[4]=e.q_rotation.y2/t,i[5]=e.q_rotation.z2/t,i[6]=e.q_rotation.x3/t,i[7]=e.q_rotation.y3/t,i[8]=e.q_rotation.z3/t,2!=s?(i[9]=e.t_trans_add.x/t,i[10]=e.t_trans_add.y/t,i[11]=e.t_trans_add.z/t,i[12]=-e.q_trans_sub.x/t,i[13]=-e.q_trans_sub.y/t,i[14]=-e.q_trans_sub.z/t):(i[9]=-e.q_trans_add.x/t,i[10]=-e.q_trans_add.y/t,i[11]=-e.q_trans_add.z/t,i[12]=0,i[13]=0,i[14]=0)),i}cbu_dist(e,t,s){return e=5&&(e=l[4].substr(5)),l.length>=6&&(s=l[5].substr(6)),l.length>=7&&(n=l[6].substr(4)),$("#"+t.pre+"anno_custom")[0]&&($("#"+t.pre+"anno_custom")[0].checked=!0),$("[id^="+t.pre+"custom]").show(),"0"==s&&(s=void 0),t.addTrackCls.checkGiSeq(r,o,a,e,s,n,0)}else if(0==n.indexOf("remove one stabilizer")){let e=n.split(" | ")[1].split(" "),s=[];s.push(parseInt(e[0])),s.push(parseInt(e[1])),t.threeDPrintCls.removeOneStabilizer(s),t.drawCls.draw()}else if(0==n.indexOf("add one stabilizer")){let e=n.split(" | ")[1].split(" ");void 0===t.pairArray&&(t.pairArray=[]),t.pairArray.push(parseInt(e[0])),t.pairArray.push(parseInt(e[1])),t.drawCls.draw()}else if(0==n.indexOf("select planes z-axis")){let e=n.split(" ");if(5==e.length){let s=parseFloat(e[3]),i=parseFloat(e[4]);t.selectionCls.selectBtwPlanes(s,i)}}else if(0==n.indexOf("adjust membrane z-axis")){let e=n.split(" ");if(5==e.length){let s=parseFloat(e[3]),i=parseFloat(e[4]);t.selectionCls.adjustMembrane(s,i)}}else if(0==n.indexOf("toggle membrane"))t.selectionCls.toggleMembrane();else if(0==i.indexOf("calc buried surface")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(" ");if(2==s.length){let e=s[0].split(","),i=s[1].split(",");t.analysisCls.calcBuriedSurface(e,i)}}}else if(0==i.indexOf("dist ")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(" ");if(2==s.length){let e=s[0].split(","),i=s[1].split(",");t.analysisCls.measureDistTwoSets(e,i)}}}else if(0==i.indexOf("disttable")){let e=i.split(" | ");if(2==e.length){let i=e[1].split(" ");if(2==i.length){let e=i[0].split(","),n=i[1].split(",");t.analysisCls.measureDistManySets(e,n),s.htmlCls.dialogCls.openDlg("dl_disttable","Distance among the sets")}}}else if(0==i.indexOf("display interaction 3d")||0==i.indexOf("view interaction pairs")||0==i.indexOf("save1 interaction pairs")||0==i.indexOf("save2 interaction pairs")||0==i.indexOf("line graph interaction pairs")||0==i.indexOf("scatterplot interaction pairs")){let e=i.split(" | ");if(e.length>=3){let s=e[1].split(" ");if(2==s.length){let n,l,r=s[0].split(","),o=s[1].split(","),a=-1!==e[2].indexOf("hbonds"),d=-1!==e[2].indexOf("salt bridge"),c=-1!==e[2].indexOf("interactions"),h=-1!==e[2].indexOf("halogen"),p=-1!==e[2].indexOf("pi-cation"),m=-1!==e[2].indexOf("pi-stacking");if(e.length>=4&&(n="true"==e[3]),e.length>=5){let s=e[4].split(" ");s.length>=4&&($("#"+t.pre+"hbondthreshold").val(s[1]),$("#"+t.pre+"saltbridgethreshold").val(s[2]),$("#"+t.pre+"contactthreshold").val(s[3]),7==s.length&&($("#"+t.pre+"halogenthreshold").val(s[4]),$("#"+t.pre+"picationthreshold").val(s[5]),$("#"+t.pre+"pistackingthreshold").val(s[6])))}0==i.indexOf("display interaction 3d")?l="3d":0==i.indexOf("view interaction pairs")?l="view":0==i.indexOf("save1 interaction pairs")?l="save1":0==i.indexOf("save2 interaction pairs")?l="save2":0==i.indexOf("line graph interaction pairs")?l="linegraph":0==i.indexOf("scatterplot interaction pairs")&&(l="scatterplot"),await t.viewInterPairsCls.viewInteractionPairs(r,o,n,l,a,d,c,h,p,m)}}}else if(0==i.indexOf("export pairs")){let e=i.split(" | ");if(3==e.length){let i=e[1].split(" ");if(2==i.length){let n=i[0].split(","),l=i[1].split(","),r=e[2].split(" ")[1];t.showInterCls.pickCustomSphere(r,n,l,t.bSphereCalc),t.bSphereCalc=!0;let o=t.viewInterPairsCls.exportSpherePairs(),a=Object.keys(s.utilsCls.getHlStructures()).join(",");t.saveFileCls.saveFile(a+"_sphere_pairs.html","html",o)}}}else if(0==n.indexOf("graph label")){let e=n.lastIndexOf(" "),t=n.substr(e+1);$("#"+s.svgid+"_label").val(t),$("#"+s.svgid+" text").removeClass(),$("#"+s.svgid+" text").addClass(t)}else if(0==n.indexOf("cartoon label")){let e=n.lastIndexOf(" "),t=n.substr(e+1);$("#"+s.svgid_ct+"_label").val(t),$("#"+s.svgid_ct+" text").removeClass(),$("#"+s.svgid_ct+" text").addClass(t)}else if(0==n.indexOf("line graph scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.linegraphid+"_scale").val(i),$("#"+s.linegraphid).attr("width",(t.linegraphWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("scatterplot scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.scatterplotid+"_scale").val(i),$("#"+s.scatterplotid).attr("width",(t.scatterplotWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("contactmap scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.contactmapid+"_scale").val(i),$("#"+s.contactmapid).attr("width",(t.contactmapWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("alignerrormap scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.alignerrormapid+"_scale").val(i),$("#"+s.alignerrormapid).attr("width",(t.alignerrormapWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("graph force")){let e=n.lastIndexOf(" ");s.htmlCls.force=parseInt(n.substr(e+1)),$("#"+s.svgid+"_force").val(s.htmlCls.force),t.getGraphCls.handleForce()}else if(0==n.indexOf("hide edges")){let e=n.lastIndexOf(" ");s.htmlCls.hideedges=parseInt(n.substr(e+1)),$("#"+s.svgid+"_hideedges").val(s.htmlCls.hideedges),s.htmlCls.hideedges?(s.htmlCls.contactInsideColor="FFF",s.htmlCls.hbondInsideColor="FFF",s.htmlCls.ionicInsideColor="FFF"):(s.htmlCls.contactInsideColor="DDD",s.htmlCls.hbondInsideColor="AFA",s.htmlCls.ionicInsideColor="8FF"),void 0!==t.graphStr&&t.bRender&&s.htmlCls.force&&t.drawGraphCls.drawGraph(t.graphStr,t.pre+"dl_graph")}else if(0==n.indexOf("reset interaction pairs"))t.viewInterPairsCls.resetInteractionPairs();else if(0==n.indexOf("side by side")){let e=n.split(" | ")[1],t="_blank";window.open(e,t)}else if(0==i.indexOf("your note")){let e=i.split(" | ");t.yournote=e[1],$("#"+t.pre+"yournote").val(t.yournote),s.cfg.shownote&&(document.title=t.yournote)}else if(0==n.indexOf("cross structure interaction"))t.crossstrucinter=parseInt(n.substr(n.lastIndexOf(" ")+1)),$("#"+t.pre+"crossstrucinter").val(t.crossstrucinter);else if("replay on"==n)await t.resizeCanvasCls.replayon();else if("replay off"==n)await t.resizeCanvasCls.replayoff();else if(0==n.indexOf("contact map")){let e=n.split(" | ");if(3===e.length){let s=parseFloat(e[1].split(" ")[1]),i=e[2].split(" ")[1];await t.contactMapCls.contactMap(s,i)}}else if(0==n.indexOf("pickatom")){let e=parseInt(n.substr(n.lastIndexOf(" ")+1));t.pAtom=t.atoms[e],t.pickingCls.showPicking(t.pAtom)}else if(0==i.indexOf("set color spectrum")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!0;t.setColorCls.setColorAcrossSets(s,i)}}else if(0==i.indexOf("set residues color spectrum")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!0;t.setColorCls.setColorBySets(s,i)}}else if(0==i.indexOf("set color rainbow")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!1;t.setColorCls.setColorAcrossSets(s,i)}}else if(0==i.indexOf("set residues color rainbow")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!1;t.setColorCls.setColorBySets(s,i)}}else if(0==i.indexOf("color")){let e=i.split(" | "),n=e[0].substr(e[0].indexOf(" ")+1);if(t.opts.color=n,"residue custom"==n&&2==e.length){t.customResidueColors=JSON.parse(e[1]);for(let e in t.customResidueColors)t.customResidueColors[e.toUpperCase()]=s.parasCls.thr("#"+t.customResidueColors[e])}else if("align custom"==n&&3==e.length){let s=e[1],i=e[2].split(", ");t.queryresi2score={},t.queryresi2score[s]={};for(let e=0,n=i.length;e1&&"3"===x[t][0]&&isNaN(x[t][1])&&"-"!==x[t][0]){i=x[t].toUpperCase().substr(1),m=!0}else if(""===x[t]||isNaN(parseInt(x[t]))){if("*"===x[t])h=!0;else if("proteins"!==x[t]&&"nucleotides"!==x[t]&&"chemicals"!==x[t]&&"ions"!==x[t]&&"water"!==x[t]&&"anchors"!==x[t]&&"strands"!==x[t]&&"loops"!==x[t]){s=x[t].toUpperCase(),p=!0}}else v=x[t],_=v,n=!0;for(let a=0,u=S.length;a1?e.substr(0,l-1)===n.atoms[i].name.substr(0,l-1)&&(0===s?t[i]=1:t.hasOwnProperty(i)||delete t[i]):"*"!==e&&e!==n.atoms[i].name||(0===s?t[i]=1:t.hasOwnProperty(i)||delete t[i]),t}}class hs{constructor(e){this.icn3d=e}selectAll(){let e=this.icn3d;e.icn3dui,this.selectAll_base(),e.hlObjectsCls.removeHlObjects(),e.hlUpdateCls.removeHl2D(),e.hlUpdateCls.removeHlMenus(),e.bSelectResidue=!1,e.bSelectAlignResidue=!1,e.hlUpdateCls.removeSeqResidueBkgd(),e.hlUpdateCls.update2DdgmContent(),$("#"+e.pre+"dl_annotations > .icn3d-annotation").show(),e.definedSetsCls.setMode("all"),e.saveFileCls.showTitle()}selectAll_base(){let e=this.icn3d,t=e.icn3dui;e.hAtoms={},e.dAtoms={};for(let s in e.chains)e.hAtoms=t.hashUtilsCls.unionHash(e.hAtoms,e.chains[s]);e.dAtoms=t.hashUtilsCls.cloneHash(e.hAtoms),e.viewSelectionAtoms=t.hashUtilsCls.cloneHash(e.hAtoms),e.ALTERNATE_STRUCTURE=-1}selectAChain(e,t,s,i){let n=this.icn3d,l=n.icn3dui;t=t.replace(/\s/g,"");let r=void 0!==s||s?"select alignChain "+e:"select chain "+e;void 0!==i&&i?(n.hAtoms=l.hashUtilsCls.unionHash(n.hAtoms,n.chains[e]),void 0===n.nameArray&&(n.nameArray=[])):(n.hAtoms={},n.nameArray=[]),n.nameArray.push(e);let o,a=s?n.alnChainsSeq[e]:n.chainsSeq[e];o=void 0===a?0:a.length;let d={};for(let t=0,s=o;t0){if(void 0!==i&&i?void 0===r.nameArray&&(r.nameArray=[]):(r.hAtoms={},r.nameArray=[]),l)for(let t in e)r.hAtoms[t]=1;else for(let t in e)for(let e in r.residues[t])r.hAtoms[e]=1;let o,a;t=t.replace(/\s/g,""),r.nameArray.push(t),l?(o="select "+r.resid2specCls.atoms2spec(r.hAtoms),a=!1):(o="select "+r.resid2specCls.residueids2spec(Object.keys(e)),a=!0);let d=Object.keys(e);this.addCustomSelection(d,t,s,o,a),(void 0===n||n)&&r.hlUpdateCls.updateHlAll(r.nameArray,void 0,i)}}selectMainChains(){let e=this.icn3d,t=e.icn3dui.hashUtilsCls.cloneHash(e.hAtoms);e.hAtoms=e.applyDisplayCls.selectMainChainSubset(t),e.hlUpdateCls.showHighlight()}selectSideChains(){let e=this.icn3d,t=e.icn3dui,s=t.hashUtilsCls.cloneHash(e.hAtoms);e.hAtoms={};for(let i in s)(e.proteins.hasOwnProperty(i)&&"N"!==e.atoms[i].name&&"H"!==e.atoms[i].name&&"C"!==e.atoms[i].name&&"O"!==e.atoms[i].name&&("CA"!==e.atoms[i].name||"C"!==e.atoms[i].elem)&&"HA"!==e.atoms[i].name||e.nucleotides.hasOwnProperty(i)&&-1===t.parasCls.nuclMainArray.indexOf(e.atoms[i].name))&&(e.hAtoms[i]=1);e.hlUpdateCls.showHighlight()}selectMainSideChains(){let e=this.icn3d,t=e.icn3dui,s=e.firstAtomObjCls.getResiduesFromAtoms(e.hAtoms);e.hAtoms={};for(let i in s)e.hAtoms=t.hashUtilsCls.unionHash(e.hAtoms,e.residues[i]),e.dAtoms=t.hashUtilsCls.unionHash(e.dAtoms,e.residues[i]);e.drawCls.draw(),e.hlUpdateCls.showHighlight()}clickShow_selected(){let e=this.icn3d,t=e.icn3dui,s=this;t.myEventCls.onIds(["#"+e.pre+"show_selected","#"+e.pre+"mn2_show_selected"],"click",(function(e){s.icn3d,s.showSelection(),t.htmlCls.clickMenuCls.setLogCmd("show selection",!0)}))}clickHide_selected(){let e=this.icn3d,t=e.icn3dui,s=this;t.myEventCls.onIds("#"+e.pre+"mn2_hide_selected","click",(function(e){s.icn3d,s.hideSelection(),t.htmlCls.clickMenuCls.setLogCmd("hide selection",!0)}))}getGraphDataForDisplayed(){let e=this.icn3d;e.icn3dui;let t=JSON.parse(e.graphStr),s=e.firstAtomObjCls.getResiduesFromAtoms(e.dAtoms),i=[],n=[],l={};for(let e=0,n=t.nodes.length;et&&(t=C[s].length,e=s);let s=Object.keys(p),i=Object.keys(m);for(let t=0,n=C[e].length;t
The following sequence alignment shows the residue mapping of the best aligned sets: "symOri" and "symPerm", which are also available in the menu "Analysis > Defined Sets".
',$("#"+e.pre+"symd_info").html(A),s.setSeqAlignForSymmetry(_,w,S);let x=!1,k=t.htmlCls.alignSeqCls.getAlignSequencesAnnotations(Object.keys(e.alnChains),void 0,void 0,x,S);A=$("#"+e.pre+"dl_sequence2").html()+k.sequencesHtml,$("#"+e.pre+"dl_sequence2").html(A),$("#"+e.pre+"dl_sequence2").width(t.htmlCls.RESIDUE_WIDTH*k.maxSeqCnt+200),t.htmlCls.dialogCls.openDlg("dl_alignment","Select residues in aligned sequences from SymD");let O=Object.keys(e.defNames2Residues).length+Object.keys(e.defNames2Atoms).length,R="symOri"+O;e.selectionCls.selectResidueList(y,R,R),e.selectionCls.updateSelectionNameDesc(),t.htmlCls.clickMenuCls.setLogCmd("select "+e.resid2specCls.residueids2spec(Object.keys(y))+" | name "+R,!1),R="symPerm"+O,e.selectionCls.selectResidueList(v,R,R),e.selectionCls.updateSelectionNameDesc(),t.htmlCls.clickMenuCls.setLogCmd("select "+e.resid2specCls.residueids2spec(Object.keys(v))+" | name "+R,!1),R="symBoth"+O,y=t.hashUtilsCls.unionHash(y,v),e.selectionCls.selectResidueList(y,R,R),e.selectionCls.updateSelectionNameDesc(),t.htmlCls.clickMenuCls.setLogCmd("select "+e.resid2specCls.residueids2spec(Object.keys(y))+" | name "+R,!1)}}else $("#"+e.pre+"dl_symd").html("
The selected residues have no detected symmetry with a Z score of "+a.zscore+" from the program SymD."),t.htmlCls.dialogCls.openDlg("dl_symd","Dynamically Calculated Symmetry Using SymD");e.symdtitle="none"===h?void 0:h,e.drawCls.draw()}catch(s){return $("#"+e.pre+"dl_symd").html("
The web service can not determine the symmetry of the input set."),t.htmlCls.dialogCls.openDlg("dl_symd","Dynamically Calculated Symmetry Using SymD"),void e.ParserUtilsCls.hideLoading()}}getResObj(e){this.icn3d.icn3dui;let t=e.substr(0,e.indexOf(" ")),s=e.indexOf("$"),i=e.indexOf("."),n=e.indexOf(":"),l=e.substr(s+1,i-s-1),r=e.substr(i+1,n-i-1),o=e.substr(n+1);return{resn:t,resid:l+"_"+r+"_"+o,resi:o,aligned:!0}}setSeqAlignForSymmetry(e,t,s){let i=this.icn3d,n=i.icn3dui;i.conservedName1="symOri_cons",i.conservedName2="symPerm_cons",i.consHash1={},i.consHash2={},i.alnChainsAnTtl={},i.alnChainsAnno={},i.alnChainsSeq={},i.alnChains={},i.alnChainsSeq={};let l={};for(let r=0,o=e.length;r
This structure has no symmetry.");i.htmlCls.dialogCls.openDlg("dl_symmetry","Symmetry")}getPolygonColor(e){let t=this.icn3d.icn3dui,s=e.substr(0,1);return"C"==s?t.parasCls.thr(16747520):"D"==s?t.parasCls.thr(65535):"T"==s?t.parasCls.thr(15631086):"O"==s?t.parasCls.thr(16753920):"I"==s?t.parasCls.thr(65280):t.parasCls.thr(11119017)}getAxisColor(e,t){let s=this.icn3d.icn3dui,i=e.substr(0,1);return"C"==i?s.parasCls.thr(16711680):"D"==i?2==t?s.parasCls.thr(65535):s.parasCls.thr(16711680):"T"==i?2==t?s.parasCls.thr(65535):s.parasCls.thr(65280):"O"==i||"I"==i?2==t?s.parasCls.thr(65535):3==t?s.parasCls.thr(65280):s.parasCls.thr(16711680):s.parasCls.thr(16711680)}}class Cs{constructor(e){this.icn3d=e}alignSW(e,t,s,i,n,l,r){this.icn3d.icn3dui;let o=this.bsa_align(r,e,t,[s,i],[n,l]),a="score: "+o[0]+"\n";a+="start: "+o[1]+"\n",a+="cigar: "+this.bsa_cigar2str(o[2])+"\n\n",a+="alignment:\n\n";let d=this.bsa_cigar2gaps(e,t,o[1],o[2]),c={};return c.score=o[0],c.start=o[1],c.cigar=this.bsa_cigar2str(o[2]),c.target=d[0],c.query=d[1],c}bsg_enc_seq(e,t){if(this.icn3d.icn3dui,null==t)return null;let s=[];s.length=e.length;for(let i=0;i
Calculate solvent accessible surface area in the interface:
";C+="Set 1: "+e+", Surface: "+o+" Å2
",C+="Set 2: "+t+", Surface: "+d+" Å2
",C+="Total Surface: "+h+" Å2
",C+="Buried Surface for Set 1: "+u+" Å2
",C+="Buried Surface for Set 2: "+m+" Å2
",$("#"+s.pre+"dl_buriedarea_html").html(C),i.htmlCls.dialogCls.openDlg("dl_buriedarea","Buried solvent accessible surface area in the interface"),i.htmlCls.clickMenuCls.setLogCmd("buried surface "+b,!1)}}measureDistTwoSets(e,t){var s=this.icn3d,i=s.icn3dui;if(0==e.length||0==t.length)alert("Please select two sets");else{let n=i.hashUtilsCls.cloneHash(s.hAtoms),l=s.definedSetsCls.getAtomsFromNameArray(e),r=s.definedSetsCls.getAtomsFromNameArray(t),o=s.contactCls.getExtent(l),a=s.contactCls.getExtent(r),d=new THREE.Vector3(o[2][0],o[2][1],o[2][2]),c=new THREE.Vector3(a[2][0],a[2][1],a[2][2]);s.hAtoms=i.hashUtilsCls.cloneHash(n),void 0===s.distPnts&&(s.distPnts=[]),s.distPnts.push(d),s.distPnts.push(c);let h=$("#"+s.pre+"distancecolor2").val();this.addLine(d.x,d.y,d.z,c.x,c.y,c.z,h,!0,"distance");let p=0,m=0,u=d.clone().add(c).multiplyScalar(.5),g=(parseInt(10*d.distanceTo(c))/10).toString()+" A";this.addLabel(g,u.x,u.y,u.z,p,h,m,"distance"),s.drawCls.draw()}}measureDistManySets(e,t){var s=this.icn3d,i=s.icn3dui;if(0==e.length||0==t.length)alert("Please select sets for distance calculation...");else{let n=i.hashUtilsCls.cloneHash(s.hAtoms),l={};for(let i=0,n=e.length;i ";for(let s=0,i=e.length;s";for(let e=0,s=t.length;e "+t[e]+" (Å)"}r+=""+i+" (Å) ";for(let e=0,s=t.length;e'+l[i][s]+"":r+="0 "}r+=""}r+="
",$("#"+i.pre+"dl_disttable_html").html(r)}}addLine(e,t,s,i,n,l,r,o,a,d,c){var h=this.icn3d;h.icn3dui;let p={};p.position1=new THREE.Vector3(e,t,s),p.position2=new THREE.Vector3(i,n,l),p.color=r,p.dashed=o,p.radius=d,p.opacity=c,void 0===h.lines[a]&&(h.lines[a]=[]),void 0!==a?h.lines[a].push(p):(void 0===h.lines.custom&&(h.lines.custom=[]),h.lines.custom.push(p)),h.hlObjectsCls.removeHlObjects()}addLineFromPicking(e){var t=this.icn3d,s=t.icn3dui;let i=$("#"+t.pre+e+"color").val();t.pAtom.coord.x,t.pAtom2.coord.x,t.pAtom.coord.y,t.pAtom2.coord.y,t.pAtom.coord.z,t.pAtom2.coord.z;let n="stabilizer"!=e;s.htmlCls.clickMenuCls.setLogCmd("add line | x1 "+t.pAtom.coord.x.toPrecision(4)+" y1 "+t.pAtom.coord.y.toPrecision(4)+" z1 "+t.pAtom.coord.z.toPrecision(4)+" | x2 "+t.pAtom2.coord.x.toPrecision(4)+" y2 "+t.pAtom2.coord.y.toPrecision(4)+" z2 "+t.pAtom2.coord.z.toPrecision(4)+" | color "+i+" | dashed "+n+" | type "+e,!0),this.addLine(t.pAtom.coord.x,t.pAtom.coord.y,t.pAtom.coord.z,t.pAtom2.coord.x,t.pAtom2.coord.y,t.pAtom2.coord.z,i,n,e),t.pickpair=!1}addLabel(e,t,s,i,n,l,r,o){var a=this.icn3d;a.icn3dui;let d={};"0"!==n&&""!==n&&"undefined"!==n||(n=void 0),"0"!==l&&""!==l&&"undefined"!==l||(l=void 0),"0"!==r&&""!==r&&"undefined"!==r||(r=void 0);let c=new THREE.Vector3;c.x=t,c.y=s,c.z=i,d.position=c,d.text=e,d.size=n,d.color=l,d.background=r,void 0===a.labels[o]&&(a.labels[o]=[]),void 0!==o?a.labels[o].push(d):(void 0===a.labels.custom&&(a.labels.custom=[]),a.labels.custom.push(d)),a.hlObjectsCls.removeHlObjects()}addChainLabels(e){var t=this.icn3d;let s=t.icn3dui.hashUtilsCls.intHash(t.hAtoms,e);void 0===t.labels.chain&&(t.labels.chain=[]);let i=t.firstAtomObjCls.getChainsFromAtoms(s);for(let e in i){let s={};s.position=t.applyCenterCls.centerAtoms(t.chains[e]).center;let i=e.indexOf("_"),n=e.substr(i+1),l=t.showSeqCls.getProteinName(e);l.length>20&&(l=l.substr(0,20)+"..."),s.text="Chain "+n+": "+l,s.size=18,t.firstAtomObjCls.getFirstCalphaAtomObj(t.chains[e]).color.getHexString().toUpperCase(),s.color="black"!=t.opts.background?t.colorWhitebkgd:t.colorBlackbkgd,s.background="#FFFFFF",t.labels.chain.push(s)}t.hlObjectsCls.removeHlObjects()}addTerminiLabels(e){var t=this.icn3d,s=t.icn3dui;let i,n="#FFFFFF";i=s.hashUtilsCls.unionHash(i,t.proteins),i=s.hashUtilsCls.unionHash(i,t.nucleotides);let l=s.hashUtilsCls.intHash(t.dAtoms,i),r=s.hashUtilsCls.intHash(l,e);void 0===t.labels.chain&&(t.labels.chain=[]);let o=t.firstAtomObjCls.getChainsFromAtoms(r);for(let e in o){let i=s.hashUtilsCls.intHash(l,t.chains[e]),r=Object.keys(i),o=t.atoms[r[0]],a=t.atoms[r[r.length-1]],d={},c={};d.position=o.coord,c.position=a.coord,d.text="N-",c.text="C-",t.nucleotides.hasOwnProperty(o.serial)&&(d.text="5'",c.text="3'"),d.size=18,c.size=18,o.color.getHexString().toUpperCase(),a.color.getHexString().toUpperCase(),d.color="black"!=t.opts.background?t.colorWhitebkgd:t.colorBlackbkgd,c.color="black"!=t.opts.background?t.colorWhitebkgd:t.colorBlackbkgd,d.background=n,c.background=n,t.labels.chain.push(d),t.labels.chain.push(c)}t.hlObjectsCls.removeHlObjects()}}class vs{constructor(e){this.icn3d=e}draw2Ddgm(e,t,s,i){let n=this.icn3d,l=n.icn3dui,r=.667,o={},a={},d={},c={},h={};if(void 0===e)return"";for(let s in e.moleculeInfor){let i="#"+("000000"+e.moleculeInfor[s].color.toString(16)).slice(-6),l=e.moleculeInfor[s].chain.trim();void 0===h[l]?h[l]=1:++h[l];let r=t+"_"+(1===h[l]?l:l+h[l].toString());void 0!==n.mmdbid_q&&(n.mmdbid_q,n.mmdbid_t),o[s]=r,a[s]=i,d[s]=e.moleculeInfor[s].name,c[r]=s}if(void 0===i||!i)for(let s=0,i=e.intracResidues.length;s";p+=""+t.toUpperCase()+"
",p+="",p+="",n.html2ddgm+=p,$("#"+n.pre+"dl_2ddgm_html").html(n.html2ddgm),p}set2DdgmNote(e){let t="
";return this.icn3d.icn3dui.utilsCls.isMac()?(t+="◯Protein
",t+="▢Nucleotide
",t+="♢Chemical
",t+="▢Biopolymer
"):(t+="OProtein
",t+="▢Nucleotide
",t+="◇Chemical
",t+="▢Biopolymer
"),t+="
Lines:
Interactions at 4 Å
",e&&(t+="Numbers in red:
Aligned chains"),t+="
",t}highlightNode(e,t,s,i){let n=this.icn3d.icn3dui;i<.2&&(i=.2);if("rect"===e){$(t).attr("stroke",n.htmlCls.ORANGE),$(t).attr("stroke-width",3);let e=Number($(s).attr("x")),l=Number($(s).attr("y")),r=Number($(s).attr("width")),o=Number($(s).attr("height"));$(t).attr("x",e+r/2*(1-i)),$(t).attr("y",l+o/2*(1-i)),$(t).attr("width",r*i),$(t).attr("height",o*i)}else if("circle"===e)$(t).attr("stroke",n.htmlCls.ORANGE),$(t).attr("stroke-width",3),$(t).attr("r",Number($(s).attr("r"))*i);else if("polygon"===e){$(t).attr("stroke",n.htmlCls.ORANGE),$(t).attr("stroke-width",3);let e=Number($(s).attr("x")),l=Number($(s).attr("y")),r=Number($(s).attr("x0d")),o=Number($(s).attr("y0d")),a=Number($(s).attr("x1d")),d=Number($(s).attr("y1d")),c=Number($(s).attr("x2d")),h=Number($(s).attr("y2d")),p=Number($(s).attr("x3d")),m=Number($(s).attr("y3d"));$(t).attr("points",(e+r*i).toString()+", "+(l+o*i).toString()+", "+(e+a*i).toString()+", "+(l+d*i).toString()+", "+(e+c*i).toString()+", "+(l+h*i).toString()+", "+(e+p*i).toString()+", "+(l+m*i).toString())}}removeLineGraphSelection(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"dl_linegraph circle").attr("stroke","#000000"),$("#"+e.pre+"dl_linegraph circle").attr("stroke-width",1),$("#"+e.pre+"dl_linegraph svg line.icn3d-hlline").attr("stroke","#FFF")}removeScatterplotSelection(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"dl_scatterplot circle").attr("stroke","#000000"),$("#"+e.pre+"dl_scatterplot circle").attr("stroke-width",1),$("#"+e.pre+"dl_scatterplot rect").attr("stroke","#000000"),$("#"+e.pre+"dl_scatterplot rect").attr("stroke-width",1)}click2Ddgm(){let e=this.icn3d,t=e.icn3dui,s=this;$(document).on("click","#"+e.pre+"dl_2ddgm .icn3d-node",(function(e){let i=s.icn3d;e.stopImmediatePropagation(),Object.keys(i.hAtoms).length";return u+="n&&(n=C),ya&&(a=y);let v=.5;m=v*o.htmlCls.width2d*m/(t[1][0]-t[0][0]),u=v*o.htmlCls.width2d*u/(t[1][1]-t[0][1]),m>h&&(h=m),u>h&&(h=u),p.push({id:d,r:l,x:C,y:y,rx:m,ry:u,ang:g,c:b.color.getHexString()})}let m=h+2,u=n-s,g=a-i;for(let e=0,t=p.length;e0&&m==S.chain&&c.push('{"source": "'+u+'", "target": "'+n+'", "v": '+p+', "c": "'+t.color.getHexString().toUpperCase()+'"}'),A.push({id:n,r:l,ss:C,x:s,y:i,x1:d,y1:g,x2:k,y2:O,c:S.color.getHexString()}),m=S.chain,u=n,++h}}}let x=S+2,k=_-y,O=w-v;for(let e=0,t=A.length;e4e3||0!==s.indexOf("http")||l.bInputfile&&!l.bInputUrlfile?$("#"+l.pre+"viewer").html(""):$("#"+l.pre+"viewer").html("
"),$("#"+l.pre+"viewer").width(i),$("#"+l.pre+"viewer").height(n),$("#"+l.pre+"cmdlog").hide(),$("#"+l.pre+"title").hide(),$("#"+l.pre+"mnlist").hide(),$("#"+l.pre+"fullscreen").length>0&&$("#"+l.pre+"fullscreen").hide(),l={}}else saveAs(e,t)}saveSvg(e,t,s){if(this.icn3d.icn3dui.bNode)return"";let i=$("#"+e).width(),n=$("#"+e).height();s&&(n=i);let l=this.getSvgXml(e,i,n,s),r=new Blob([l],{type:"image/svg+xml"});saveAs(r,t)}getSvgXml(e,t,s,i){if(this.icn3d.icn3dui.bNode)return"";return(t&&s?'"}savePng(e,t,s){let i=this.icn3d,n=i.icn3dui;if(n.bNode)return"";let l=$("#"+e).width(),r=$("#"+e).height();s&&(r=l);let o=document.getElementById(e),a=o.getBBox(),d=o.cloneNode(!0);i.lineGraphCls.copyStylesInline(d,o);let c=document.createElement("CANVAS");c.width=l,c.height=r;let h=c.getContext("2d");h.clearRect(0,0,a.width,a.height);let p=this.getSvgXml(e,l,r,s),m=window.URL||window.webkitURL||window,u=new Blob([p],{type:"image/svg+xml;charset=utf-8"}),g=new Image;g.src=m.createObjectURL(u),g.onload=function(){if(h.drawImage(g,0,0),m.revokeObjectURL(this.src),n.utilsCls.isIE()){let e=c.msToBlob();e&&(saveAs(e,t),c.remove())}else c.toBlob((function(e){e&&(saveAs(e,t),c.remove())}))}}exportCustomAtoms(e){var t=this.icn3d;t.icn3dui;let s="",i=void 0!==t.defNames2Residues?Object.keys(t.defNames2Residues).sort():[];for(let n=0,l=i.length;n
20&&(e=e.substr(0,17)+"..."),l="Query: "+e+"; target: "+s,$("#"+i.pre+"title").html(l+", "+t)}else $("#"+i.pre+"title").html(r+" "+l+": "+t);else $("#"+i.pre+"title").html(t)}getLinkToStructureSummary(e){var t=this.icn3d,s=t.icn3dui;let i="https://www.ncbi.nlm.nih.gov/structure/?term=";if(i=void 0!==s.cfg.cid?"https://www.ncbi.nlm.nih.gov/pccompound/?term=":void 0!==s.cfg.refseqid?"https://www.ncbi.nlm.nih.gov/protein/":void 0!==s.cfg.afid?"https://alphafold.ebi.ac.uk/search/text/":Object.keys(t.structures).length>1?"https://www.ncbi.nlm.nih.gov/structure/?term=":s.htmlCls.baseUrl+"pdb/",void 0===t.inputid)i="https://www.ncbi.nlm.nih.gov/pccompound/?term="+t.molTitle;else{let n=t.inputid.split("_");1===n.length?(i+=t.inputid,e&&s.htmlCls.clickMenuCls.setLogCmd("link to "+t.inputid+": "+i,!1)):2===n.length&&(s.cfg.afid?i+=n[0]+" "+n[1]:i+=n[0]+" OR "+n[1],e&&s.htmlCls.clickMenuCls.setLogCmd("link to structures "+n[0]+" and "+n[1]+": "+i,!1))}return i}setEntrezLinks(e){var t=this.icn3d,s=t.icn3dui;let i,n=Object.keys(t.structures);if(1===n.length){i="https://www.ncbi.nlm.nih.gov/"+e+"/?term="+n[0],s.htmlCls.clickMenuCls.setLogCmd("Entrez "+e+" about PDB "+n[0]+": "+i,!1);let l=t.structures&&Object.keys(t.structures).length>0?"_blank":"_self";window.open(i,l)}else if(2===n.length){i="https://www.ncbi.nlm.nih.gov/"+e+"/?term="+n[0]+" OR "+n[1],s.htmlCls.clickMenuCls.setLogCmd("Entrez "+e+" about PDB "+n[0]+" OR "+n[1]+": "+i,!1);let l=t.structures&&Object.keys(t.structures).length>0?"_blank":"_self";window.open(i,l)}}}class xs{constructor(e){this.icn3d=e}async shareLink(e,t){let s=this.icn3d,i=s.icn3dui,n=this.shareLinkUrl(),l=n.length>4e3||0!==n.indexOf("http"),r=Object.keys(s.structures).join("_");if(r==s.defaultPdbId&&(s.filename?r=s.filename:s.inputid&&(r=s.inputid)),e){if(t||s.bInputfile||l)return void s.saveFileCls.saveFile(r+"_icn3d_loadable.png","png")}else{if(s.bInputfile&&!s.bInputUrlfile)return void alert("Share Link does NOT work when the data are from custom files. Please save 'iCn3D PNG Image' in the File menu and open it in iCn3D.");if(l)return void alert("The url is more than 4000 characters and may not work. Please save 'iCn3D PNG Image' or 'State File' and open them in iCn3D.");i.htmlCls.clickMenuCls.setLogCmd("share link: "+n,!1)}let o="Problem in getting shortened URL";if(!i.cfg.notebook){let t=await this.getShareLinkPrms(n,e);if(void 0!==t.shortLink&&(o=t.shortLink,e)){let e=o.split("/"),t=e[e.length-1];s.saveFileCls.saveFile(r+"-"+t+".png","png");let i='\n\n",s.saveFileCls.saveFile(r+"-"+t+".html","html",i)}e&&void 0===t.shortLink&&s.saveFileCls.saveFile(r+"_icn3d_loadable.png","png");let i=o.split("page.link/");2==i.length&&(o="https://structure.ncbi.nlm.nih.gov/icn3d/share.html?"+i[1]),$("#"+s.pre+"short_url").val(o),$("#"+s.pre+"short_url_title").val(o+"&t="+s.yournote)}let a=this.shareLinkUrl(void 0,!0),d="view = icn3dpy.view(q='"+(i.cfg.url?"url="+i.cfg.url:i.cfg.idname+"="+i.cfg.idvalue)+"',command='"+a+"')\nview";(i.cfg.url||i.cfg.idname)&&$("#"+s.pre+"jn_commands").val(d),$("#"+s.pre+"ori_url").val(n),e||i.htmlCls.dialogCls.openDlg("dl_copyurl","Copy a Share Link URL or Jupyter Notebook Commands")}getShareLinkPrms(e,t){let s=this.icn3d,i=s.icn3dui;return new Promise((function(n,l){$.ajax({url:"https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=AIzaSyBxl9CgM0dY5lagHL4UOhEpLWE1fuwdnvc",type:"POST",data:{longDynamicLink:"https://icn3d.page.link/?link="+encodeURIComponent(e)},dataType:"json",success:function(e){n(e)},error:function(n,l,r){let o="Problem in getting shortened URL";$("#"+s.pre+"ori_url").val(e),$("#"+s.pre+"short_url").val(o),$("#"+s.pre+"short_url_title").val(o+"&t="+s.yournote),t||i.htmlCls.dialogCls.openDlg("dl_copyurl","Copy a Share Link URL")}})}))}shareLinkUrl(e,t){let s=this.icn3d,i=s.icn3dui,n=i.htmlCls.baseUrl+"icn3d/?",l="";if(i.cfg.bSidebyside&&(n=i.htmlCls.baseUrl+"icn3d/full2.html?"),s.bInputUrlfile){n=window.location.href.split("?")[0]+"?"+s.inputurl+"&"}let r,o={};for(let e in s.cfg){let t=s.cfg[e];"inpara"!==e&&"command"!==e&&"usepdbnum"!==e&&"date"!==e&&"v"!==e&&void 0!==t&&("width"===e&&"100%"===t||"height"===e&&"100%"===t||"resize"===e&&!0===t||"showmenu"===e&&!0===t||"showtitle"===e&&!0===t||"showcommand"===e&&!0===t||"mobilemenu"===e&&!1===t||"showanno"===e&&!1===t||"showseq"===e&&!1===t||"showalignseq"===e&&!1===t||"show2d"===e&&!1===t||"showsets"===e&&!1===t||"rotate"===e&&"right"===t||"command"!==e&&("options"===e?Object.keys(t).length>0&&(o[e]=JSON.stringify(t)):!0===t?o[e]=1:!1===t?o[e]=0:""!==t&&(o[e]=t)))}s.bAfMem?o.afmem="on":(i.cfg.afid||1==Object.keys(s.structures).length&&Object.keys(s.structures)[0].length>5)&&(o.afmem="off");let a=-1;void 0!==i.cfg.inpara&&(a=i.cfg.inpara.indexOf("&command=")),r=-1!==a?i.cfg.inpara.substr(0,a):i.cfg.inpara;let d=!1;if(!s.bInputUrlfile){let e=r&&r.substr(1)?r.substr(1).split("&"):[];for(let t=0,s=e.length;tc){u=s.commands[c].split("|||")[0].split("&command=")[0].trim(),-1!==u.indexOf(g)&&++f}let b,C=c+1,y="";for(let e=s.commands.length;Ct.substr(0,s))return 1;if(e.substr(0,s)==t.substr(0,s)){if(parseInt(e.substr(s+1))
",void(l.areahtml=n)}let p,m,u,g=c.vertices,f=c.faces,b=r.parasCls.thr("#00FFFF"),C=r.parasCls.thr("#00FF00"),y=r.parasCls.thr("#ff0000"),v=r.parasCls.thr("#00FFFF"),_=r.parasCls.thr("#0000FF"),w=r.parasCls.thr("#FF0000");11!=t&&12!=t&&13!=t&&14!=t||void 0===l.rmsd_supr||void 0===l.rmsd_supr.rot||(p=l.rmsd_supr.rot,m=l.rmsd_supr.trans1,u=l.rmsd_supr.trans2);let S=(11==t||12==t||13==t||14==t&&"delphi"!=l.loadPhiFrom)&&void 0!==l.rmsd_supr&&void 0!==l.rmsd_supr.rot;n=new THREE.BufferGeometry;let A,x=[],k=[],O=[],R=0;for(let e=0,s=g.length;e ";for(let e=0,t=i.length;eStructure Chain Residue Number "+i[e].substr(0,t)+" "+i[e].substr(t+1,s-t-1)+" "+i[e].substr(s+1)+" "}let l=Object.keys(t.utilsCls.getHlStructures()).join(",");e.saveFileCls.saveFile(l+"_residues.txt","html",n)}addStabilizer(){let e=this.icn3d,t=e.icn3dui,s=3.5;if(Object.keys(e.dAtoms).length>0){let i,n={},l=12.25,r=3.2*3.2;for(let t in e.dAtoms){let s=e.atoms[t];!e.nucleotides.hasOwnProperty(s.serial)||"N1"!==s.name&&"N2"!==s.name&&"N3"!==s.name&&"N4"!==s.name&&"N6"!==s.name&&"O2"!==s.name&&"O6"!==s.name||(i=s.structure+"_"+s.chain+"_"+s.resi+"_"+s.name,n[i]=s)}let o=Object.keys(n),a=o.length;void 0===e.pairArray&&(e.pairArray=[]);for(let t=0;ts)continue;let h=Math.abs(n[a].coord.y-n[d].coord.y);if(h>s)continue;let p=Math.abs(n[a].coord.z-n[d].coord.z);if(p>s)continue;let m=c*c+h*h+p*p;m>l||m0&&(l+=","),l+=n[e].substr(0,n[e].indexOf("_"));s.chainidArray=[e].concat(n),s.chainidArray=s.chainalignParserCls.addPostfixForChainids(s.chainidArray),t.htmlCls.clickMenuCls.setLogCmd("resdef "+t.cfg.resdef,!0),s.loadCmd="vast_search_chainid "+s.chainidArray,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),s.bMmdbafid=!0;let r=!0;await s.chainalignParserCls.downloadMmdbAf(l,r)}}else if(void 0!==t.cfg.url){s.bInputUrlfile=!0;let e=t.cfg.url.split("|"),i=e[0],n=e[1];s.molTitle="",s.inputid=n,s.inputurl="type="+i+"&url="+encodeURIComponent(n),s.loadCmd="load url "+n+" | type "+i,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.pdbParserCls.downloadUrl(n,i,t.cfg.command)}else if(void 0!==t.cfg.mmtfid)s.inputid=t.cfg.mmtfid,s.loadCmd="load mmtf "+t.cfg.mmtfid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmtfParserCls.downloadMmtf(t.cfg.mmtfid);else if(void 0!==t.cfg.pdbid)s.inputid=t.cfg.pdbid,s.loadCmd="load pdb "+t.cfg.pdbid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.pdbParserCls.downloadPdb(t.cfg.pdbid);else if(void 0!==t.cfg.afid){s.inputid=t.cfg.afid,s.loadCmd="load af "+t.cfg.afid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0);let e=!0;await s.pdbParserCls.downloadPdb(t.cfg.afid,e)}else if(void 0!==t.cfg.opmid)s.inputid=t.cfg.opmid,s.loadCmd="load opm "+t.cfg.opmid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.opmParserCls.downloadOpm(t.cfg.opmid);else if(void 0!==t.cfg.mmdbid)s.inputid=t.cfg.mmdbid,s.loadCmd="load mmdb "+t.cfg.mmdbid+" | parameters "+t.cfg.inpara,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadMmdb(t.cfg.mmdbid);else if(void 0!==t.cfg.gi)s.loadCmd="load gi "+t.cfg.gi,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadGi(t.cfg.gi);else if(void 0!==t.cfg.refseqid)s.inputid=t.cfg.refseqid,s.loadCmd="load refseq "+t.cfg.refseqid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadRefseq(t.cfg.refseqid);else if(void 0!==t.cfg.protein)s.inputid=t.cfg.protein,s.loadCmd="load protein "+t.cfg.protein,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadProteinname(t.cfg.protein);else if(void 0!==t.cfg.blast_rep_id)if(s.inputid=t.cfg.query_id+","+t.cfg.blast_rep_id,t.cfg.oriQuery_id=t.cfg.query_id,t.cfg.oriBlast_rep_id=t.cfg.blast_rep_id,"Query"!==t.cfg.query_id.substr(0,5)&&void 0===t.cfg.rid)"icn3d"==t.cfg.from&&"1TSR_A"==t.cfg.blast_rep_id&&"NP_001108451.1"==t.cfg.query_id&&(t.cfg.command="view annotations; set annotation cdd; set annotation site; set view detailed view; select chain 1TSR_A; show selection"),"smithwm"==t.cfg.alg?(s.loadCmd="load seq_struct_ids_smithwm "+t.cfg.query_id+","+t.cfg.blast_rep_id,s.bSmithwm=!0):"local_smithwm"==t.cfg.alg?(s.loadCmd="load seq_struct_ids_local_smithwm "+t.cfg.query_id+","+t.cfg.blast_rep_id,s.bLocalSmithwm=!0):(s.loadCmd="load seq_struct_ids "+t.cfg.query_id+","+t.cfg.blast_rep_id,s.bSmithwm=!1,s.bLocalSmithwm=!1),t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadBlast_rep_id(t.cfg.query_id+","+t.cfg.blast_rep_id);else if(void 0!==t.cfg.rid){let e="https://blast.ncbi.nlm.nih.gov/Blast.cgi?RESULTS_FILE=on&FORMAT_TYPE=JSON2_S&FORMAT_OBJECT=Alignment&CMD=Get&RID="+t.cfg.rid,i=await t.getAjaxPromise(e,"json",!1,"The RID "+t.cfg.rid+" may have expired...");for(let e=0,n=i.BlastOutput2.length;e";
html += this.getLink('mn1_dsn6', 'Local File', undefined, 3);
html += this.getLink('mn1_dsn6url', 'URL(CORS) ' + me.htmlCls.wifiStr, undefined, 3);
@@ -9559,14 +9559,14 @@ class SetMenu {
}
//!!!
-/*
+
html += this.getMenuText('m1_exportrefnum', 'Reference Numbers', undefined, undefined, 2);
html += "
";
html += this.getLink('mn1_exportIgstrand', 'Ig Strand', undefined, 3);
html += this.getLink('mn1_exportKabat', 'Kabat', undefined, 3);
html += this.getLink('mn1_exportImgt', 'IMGT', undefined, 3);
html += "
";
-*/
+
html += "
Potential ' + me.htmlCls.licenseStr + '');
@@ -10539,7 +10539,7 @@ class SetMenu {
html += this.getRadio('mn6_addlabel', 'mn6_addlabelResidues', 'per Residue', undefined, 1, 2);
html += this.getRadio('mn6_addlabel', 'mn6_addlabelResnum', 'per Residue & Number', undefined, 1, 2);
//!!!
- //html += this.getRadio('mn6_addlabel', 'mn6_addlabelRefnum', 'per Reference Number', undefined, 1, 2);
+ html += this.getRadio('mn6_addlabel', 'mn6_addlabelRefnum', 'per Reference Number', undefined, 1, 2);
html += this.getRadio('mn6_addlabel', 'mn6_addlabelChains', 'per Chain', undefined, undefined, 2);
html += this.getRadio('mn6_addlabel', 'mn6_addlabelTermini', 'N- & C-Termini', undefined, 1, 2);
}
@@ -10631,11 +10631,11 @@ class SetMenu {
html += "";
//!!!
-/*
+
html += this.getLink('mn6_igrefYes', 'Show Ig Ref. Number', undefined, 2);
html += this.getLink('mn6_igrefTpl', 'Ig w/ Specified Template', undefined, 2);
html += this.getLink('mn6_igrefNo', 'Hide Ig Ref. Number', undefined, 2);
-*/
+
html += this.getMenuSep();
html += this.getLink('mn6_customref', 'Custom Ref. Number', undefined, 2);
@@ -11875,8 +11875,8 @@ class SetDialog {
html += "";
html += me.htmlCls.divStr + "dl_dsn6' class='" + dialogClass + "'>";
- html += this.addNotebookTitle('dl_dsn6', 'Load a DSN6 file');
- html += "Note: Always load a PDB file before loading DSN6 files.
",t}setMenu3(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu3_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";t+="
";
+ html += this.addNotebookTitle('dl_dsn6', 'Load a map file');
+ html += "Note: Always load a PDB file before loading map files.
";
html += "2fofc contour at: σ
";
- html += me.htmlCls.inputFileStr + "id='" + me.pre + "dsn6file2fofc'> " + me.htmlCls.buttonStr + "reload_dsn6file2fofc' style='margin-top: 6px;'>Load
";
+ html += me.htmlCls.inputFileStr + "id='" + me.pre + "dsn6file2fofc'> " + me.htmlCls.buttonStr + "reload_dsn6file2fofc' style='margin: 6px 20px 0 0;'>Load DSN6
";
+ //html += me.htmlCls.inputFileStr + "id='" + me.pre + "dsn6file2fofc'> " + me.htmlCls.buttonStr + "reload_dsn6file2fofc' style='margin: 6px 20px 0 0;'>Load DSN6" + me.htmlCls.buttonStr + "reload_ccp4file2fofc' style='margin-top: 6px;'>Load CCP4
";
html += "fofc contour at: σ
";
- html += me.htmlCls.inputFileStr + "id='" + me.pre + "dsn6filefofc'> " + me.htmlCls.buttonStr + "reload_dsn6filefofc' style='margin-top: 6px;'>Load
";
+ html += me.htmlCls.inputFileStr + "id='" + me.pre + "dsn6filefofc'> " + me.htmlCls.buttonStr + "reload_dsn6filefofc' style='margin: 6px 20px 0 0;'>Load DSN6
";
+ //html += me.htmlCls.inputFileStr + "id='" + me.pre + "dsn6filefofc'> " + me.htmlCls.buttonStr + "reload_dsn6filefofc' style='margin: 6px 20px 0 0;'>Load DSN6" + me.htmlCls.buttonStr + "reload_ccp4filefofc' style='margin-top: 6px;'>Load CCP4
";
html += me.htmlCls.buttonStr + "elecmapNo4'>Remove Map
";
@@ -11899,7 +11901,7 @@ class SetDialog {
html += me.htmlCls.divStr + "dl_dsn6url' class='" + dialogClass + "'>";
html += this.addNotebookTitle('dl_dsn6url', 'Load a selection file via a URL');
- html += "Note: Always load a PDB file before loading DSN6 files.
";
+ html += "Note: Always load a PDB file before loading map files.
";
html += "2fofc contour at: ","selectplaneli",void 0,1)),t+=this.getMenuSep(),t+=this.getMenuText("mn2_vrarhints","VR & AR Hints",void 0,1,1),t+="",t+=this.getMenuUrl("vrhint",e.htmlCls.baseUrl+"icn3d/icn3d.html#vr","VR: VR Headsets",1,2),t+=this.getMenuUrl("arhint",e.htmlCls.baseUrl+"icn3d/icn3d.html#ar","AR: Chrome in Android",1,2),t+="
",t+="",t+=this.getLink("mn6_sidebyside","Side by Side",1,1),t+=this.getMenuText("mn2_rotate","Rotate",void 0,1,1),t+="",t+=this.getMenuText("mn2_rotate90","Rotate 90°",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_camera","Camera",void 0,void 0,1),t+="",t+=this.getRadio("mn6_rotate90","mn6_rotatex","rotate x",void 0,void 0,2),t+=this.getRadio("mn6_rotate90","mn6_rotatey","rotate y",void 0,void 0,2),t+=this.getRadio("mn6_rotate90","mn6_rotatez","rotate z",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_rotateauto","Auto Rotation",void 0,1,2),t+="",t+=this.getRadio("mn6_rotate","mn6_rotateleft","Rotate Left",void 0,1,3),t+=this.getRadio("mn6_rotate","mn6_rotateright","Rotate Right",void 0,1,3),t+=this.getRadio("mn6_rotate","mn6_rotateup","Rotate Up",void 0,1,3),t+=this.getRadio("mn6_rotate","mn6_rotatedown","Rotate Down",void 0,1,3),t+="
",t+="",t+="",t+=this.getRadio("mn6_camera","mn6_cameraPers","Perspective",!0,void 0,2),t+=this.getRadio("mn6_camera","mn6_cameraOrth","Orthographic",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_fog","Fog for Selection",void 0,void 0,1),t+="",t+=this.getRadio("mn6_showfog","mn6_showfogYes","On",void 0,void 0,2),t+=this.getRadio("mn6_showfog","mn6_showfogNo","Off",!0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_slab","Slab for Selection",void 0,void 0,1),t+="",t+=this.getRadio("mn6_showslab","mn6_showslabYes","On",void 0,void 0,2),t+=this.getRadio("mn6_showslab","mn6_showslabNo","Off",!0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_axes","XYZ-axes",void 0,void 0,1),t+="",t+=this.getRadio("mn6_showaxis","mn6_showaxisYes","Original",void 0,void 0,2),t+=this.getRadio("mn6_showaxis","mn6_showaxisSel","Prin. Axes on Sel.",void 0,void 0,2),t+=this.getRadio("mn6_showaxis","mn6_showaxisNo","Hide",!0,void 0,2),t+="
",t+="",t+=this.getMenuSep(),t+=this.getMenuText("mn2_resetwrap","Reset",void 0,1,1),t+="",t+=this.getRadio("mn6_reset","reset","All",void 0,1,2),t+=this.getRadio("mn6_reset","mn6_resetOrientation","Orientation",void 0,1,2),t+="
",t+="",t+=this.getLink("mn6_back","Undo",void 0,1),t+=this.getLink("mn6_forward","Redo",void 0,1),t+=this.getLink("mn6_fullscreen","Full Screen",void 0,1),t+="",void 0===e.cfg.cid&&(t+=this.getMenuText("mn3_proteinwrap","Proteins",void 0,1,1),t+="
",t}setMenu4(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu4_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+="",void 0!==e.cfg.align||void 0!==e.cfg.chainalign?t+=this.getRadio("mn3_proteins","mn3_proteinsRibbon","Ribbon",void 0,1,2):t+=this.getRadio("mn3_proteins","mn3_proteinsRibbon","Ribbon",!0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsStrand","Strand",void 0,void 0,2),t+=this.getRadio("mn3_proteins","mn3_proteinsCylinder","Cylinder and Plate",void 0,void 0,2),t+=this.getRadio("mn3_proteins","mn3_proteinsSchematic","Schematic",void 0,1,2),void 0!==e.cfg.align||void 0!==e.cfg.chainalign?t+=this.getRadio("mn3_proteins","mn3_proteinsCalpha","C Alpha Trace",!0,1,2):t+=this.getRadio("mn3_proteins","mn3_proteinsCalpha","C Alpha Trace",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsBackbone","Backbone",void 0,void 0,2),t+=this.getRadio("mn3_proteins","mn3_proteinsBfactor","B-factor Tube",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsLines","Lines",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsStick","Stick",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsBallstick","Ball and Stick",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_sidecwrap","Side Chains",void 0,1,1),t+="",t+=this.getRadio("mn3_sidec","mn3_sidecLines","Lines",void 0,1,2),t+=this.getRadio("mn3_sidec","mn3_sidecStick","Stick",void 0,1,2),t+=this.getRadio("mn3_sidec","mn3_sidecBallstick","Ball and Stick",void 0,1,2),t+=this.getRadio("mn3_sidec","mn3_sidecSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_sidec","mn3_sidecNo","Hide",!0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_nuclwrap","Nucleotides",void 0,1,1),t+="",t+=this.getRadio("mn3_nucl","mn3_nuclCartoon","Cartoon",!0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclPhos","O3' Trace",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclBackbone","Backbone",void 0,void 0,2),t+=this.getRadio("mn3_nucl","mn3_nuclSchematic","Schematic",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclLines","Lines",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclStick","Stick",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclBallstick","Ball and Stick",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_ntbasewrap","Nucl. Bases",void 0,1,1),t+="",t+=this.getRadio("mn3_ntbase","mn3_ntbaseLines","Lines",void 0,1,2),t+=this.getRadio("mn3_ntbase","mn3_ntbaseStick","Stick",void 0,1,2),t+=this.getRadio("mn3_ntbase","mn3_ntbaseBallstick","Ball and Stick",void 0,1,2),t+=this.getRadio("mn3_ntbase","mn3_ntbaseSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_ntbase","mn3_ntbaseNo","Hide",!0,1,2),t+="
",t+=""),t+=this.getMenuText("mn3_ligwrap","Chemicals",void 0,1,1),t+="",t+=this.getRadio("mn3_lig","mn3_ligLines","Lines",void 0,1,2),void 0===e.cfg.cid?(t+=this.getRadio("mn3_lig","mn3_ligStick","Stick",!0,1,2),t+=this.getRadio("mn3_lig","mn3_ligBallstick","Ball and Stick",void 0,1,2)):(t+=this.getRadio("mn3_lig","mn3_ligStick","Stick",void 0,1,2),t+=this.getRadio("mn3_lig","mn3_ligBallstick","BalHydrogensl and Stick",!0,1,2)),t+=this.getRadio("mn3_lig","mn3_ligSchematic","Schematic",void 0,1,2),t+=this.getRadio("mn3_lig","mn3_ligSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_lig","mn3_ligNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_hydrogenswrap","Hydrogens",void 0,1,1),t+="",t+=this.getRadio("mn3_hydrogens","mn3_hydrogensYes","Show",!0,1,2),t+=this.getRadio("mn3_hydrogens","mn3_hydrogensNo","Hide",void 0,1,2),t+="
",t+="",void 0===e.cfg.cid&&(t+=this.getMenuText("mn3_glycanwrap","Glycans",void 0,void 0,1),t+="",t+=this.getRadio("mn3_glycansCart","mn3_glycansCartYes","Show Cartoon",void 0,void 0,2),t+=this.getRadio("mn3_glycansCart","mn3_glycansCartNo","Hide Cartoon",!0,void 0,2),t+="
",t+=""),t+=this.getMenuText("mn3_ionswrap","Ions",void 0,1,1),t+="",t+=this.getRadio("mn3_ions","mn3_ionsSphere","Sphere",!0,1,2),t+=this.getRadio("mn3_ions","mn3_ionsDot","Dot",void 0,1,2),t+=this.getRadio("mn3_ions","mn3_ionsNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_waterwrap","Water",void 0,1,1),t+="",t+=this.getRadio("mn3_water","mn3_waterSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_water","mn3_waterDot","Dot",void 0,1,2),t+=this.getRadio("mn3_water","mn3_waterNo","Hide",!0,1,2),t+="
",t+="",t+=this.getLink("mn3_setThickness","Preferences",void 0,1),t+=this.getMenuSep(),t+=this.getLink("mn3_styleSave","Save Style",void 0,2),t+=this.getLink("mn3_styleApplySave","Apply Saved Style",void 0,2),t+=this.getMenuSep(),t+=this.getMenuText("mn5_surfacewrap","Surface Type",void 0,1,1),t+="",t+=this.getRadio("mn5_surface","mn5_surfaceVDW","Van der Waals",void 0,1,2),t+=this.getRadio("mn5_surface","mn5_surfaceVDWContext","VDW with Context",void 0,void 0,2),t+=this.getRadio("mn5_surface","mn5_surfaceMolecular","Molecular Surface",void 0,1,2),t+=this.getRadio("mn5_surface","mn5_surfaceMolecularContext","MS with Context",void 0,void 0,2),t+=this.getRadio("mn5_surface","mn5_surfaceSAS","Solvent Accessible",void 0,1,2),t+=this.getRadio("mn5_surface","mn5_surfaceSASContext","SA with Context",void 0,void 0,2),t+="
",t+="",t+=this.getLink("mn5_surfaceNo","Remove Surface",1,1),t+=this.getMenuText("mn5_surfaceop","Surface Opacity",void 0,1,1),t+="",t+=this.getMenuText("mn5_surfaceopfast","Fast Transparency",void 0,1,2),t+="
",t+=this.getMenuText("mn5_wireframewrap","Surface Wireframe",void 0,1,1),t+="",t+=this.getRadio("mn5_opacity","mn5_opacity10","1.0",!0,1,3);for(let e=9;e>0;--e)t+=this.getRadio("mn5_opacity","mn5_opacity0"+e,"0."+e,1,3);t+="
",t+="",t+=this.getMenuText("mn5_surfaceopslow","Slow Transparency",void 0,void 0,2),t+="",t+=this.getRadio("mn5_opacityslow","mn5_opacityslow10","1.0",!0,void 0,3);for(let e=9;e>0;--e)t+=this.getRadio("mn5_opacityslow","mn5_opacityslow0"+e,"0."+e,void 0,void 0,3);return t+="
",t+="",t+="",t+=this.getRadio("mn5_wireframe","mn5_wireframeYes","Yes",void 0,1,2),t+=this.getRadio("mn5_wireframe","mn5_wireframeNo","No",!0,1,2),t+="
",t+="",t+=this.getMenuSep(),t+=this.getLink("mn5_cartoonshape","Cartoon for a Set",void 0,1),t+=this.getLink("mn5_linebtwsets","Line btw. Two Sets",void 0,1),void 0===e.cfg.cid&&void 0===e.cfg.align&&void 0===e.cfg.chainalign&&void 0===e.cfg.mmdbaf&&(t+=this.getMenuSep(),t+=this.getLinkWrapper2("mn5_map","Electron Density","mapWrapper1",void 0,1),t+="",t+=this.getLink("mn5_elecmap2fofc","2Fo-Fc Map",void 0,2),t+=this.getLink("mn5_elecmapfofc","Fo-Fc Map",void 0,2),t+=this.getLinkWrapper("mn5_elecmapNo","Remove Map","mapWrapper2",void 0,2),t+="
",t+="",t+=this.getLinkWrapper2("mn5_map3","Map Wireframe","mapWrapper3",void 0,1),t+="",t+=this.getRadio("mn5_mapwireframe","mn5_mapwireframeYes","Yes",!0,void 0,2),t+=this.getRadio("mn5_mapwireframe","mn5_mapwireframeNo","No",void 0,void 0,2),t+="
",t+="",void 0===e.cfg.mmtfid&&(t+=this.getLinkWrapper("mn5_emmap","EM Density Map","emmapWrapper1",void 0,1),t+=this.getLinkWrapper("mn5_emmapNo","Remove EM Map","emmapWrapper2",void 0,1),t+=this.getLinkWrapper2("mn5_emmap3","EM Map Wireframe","emmapWrapper3",void 0,1),t+="",t+=this.getRadio("mn5_emmapwireframe","mn5_emmapwireframeYes","Yes",!0,void 0,2),t+=this.getRadio("mn5_emmapwireframe","mn5_emmapwireframeNo","No",void 0,void 0,2),t+="
",t+="")),t+=this.getMenuSep(),t+=this.getMenuText("mn6_bkgdwrap","Background",void 0,1,1),t+="",t+=this.getRadio("mn6_bkgd","mn6_bkgdTransparent","Transparent",void 0,1,2),t+=this.getRadio("mn6_bkgd","mn6_bkgdBlack","Black",!0,1,2),t+=this.getRadio("mn6_bkgd","mn6_bkgdGrey","Gray",void 0,1,2),t+=this.getRadio("mn6_bkgd","mn6_bkgdWhite","White",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn6_themewrap","Dialog Color",void 0,void 0,1),t+="",t+=this.getRadio("mn6_theme","mn6_themeBlue","Blue",!0,void 0,2),t+=this.getRadio("mn6_theme","mn6_themeOrange","Orange",void 0,void 0,2),t+=this.getRadio("mn6_theme","mn6_themeBlack","Black",void 0,void 0,2),t+="
",t+="",t+="",t+=this.getMenuText("mn4_clrwrap","Unicolor","icn3d-menupd",1,1),t+="
",t}setMenu5(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu5_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";t+="",t+=this.getMenuText("uniclrRedwrap","Red",void 0,1,2),t+="
",t+=this.getRadio("mn4_clr","mn4_clrCustom","Color Picker",void 0,void 0,1),t+=this.getMenuSep(),void 0===e.cfg.cid?(t+=this.getMenuText("mn4_clrRainbowwrap","Rainbow (R-V)","icn3d-menupd",1,1),t+="",t+=this.getRadClr("mn4_clr","uniclrRed1","Red","F00",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed2","Indian Red","CD5C5C",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed3","Light Coral","F08080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed4","Salmon","FA8072",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed5","Dark Salmon","E9967A",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed6","Light Salmon","FFA07A",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed7","Crimson","DC143C",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed8","Fire Brick","B22222",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed9","Dark Red","8B0000",void 0,1,3),t+="
",t+=this.getMenuText("uniclrPinkwrap","Pink",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrPink1","Pink","FFC0CB",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink2","Light Pink","FFB6C1",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink3","Hot Pink","FF69B4",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink4","Deep Pink","FF1493",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink5","Medium Violet Red","C71585",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink6","Pale Violet Red","DB7093",void 0,1,3),t+="
",t+=this.getMenuText("uniclrOrangewrap","Orange",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrOran1","Orange","FFA500",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran2","Dark Orange","FF8C00",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran3","Orange Red","FF4500",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran4","Tomato","FF6347",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran5","Coral","FF7F50",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran6","Light Salmon","FFA07A",void 0,1,3),t+="
",t+=this.getMenuText("uniclrYellowwrap","Yellow",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrYllw1","Yellow","FF0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw2","Gold","FFD700",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw3","Light Yellow","FFFFE0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw4","Lemon Chiffon","FFFACD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw5","Light Golden Rod","FAFAD2",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw6","Papaya Whip","FFEFD5",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw7","Moccasin","FFE4B5",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw8","Peach Puff","FFDAB9",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw9","Pale Golden Rod","EEE8AA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw10","Khaki","F0E68C",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw11","Dark Khaki","BDB76B",void 0,1,3),t+="
",t+=this.getMenuText("uniclrMagentawrap","Magenta",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrMgnt1","Magenta","F0F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt2","Orchid","DA70D6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt3","Violet","EE82EE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt4","Plum","DDA0DD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt5","Thistle","D8BFD8",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt6","Lavender","E6E6FA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt7","Medium Orchid","BA55D3",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt8","Medium Purple","9370DB",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt9","Rebecca Purple","663399",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt10","Blue Violet","8A2BE2",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt11","Dark Violet","9400D3",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt12","Dark Orchid","9932CC",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt13","Dark Magenta","8B008B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt14","Purple","800080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt15","Indigo","4B0082",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt16","Slat Blue","6A5ACD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt17","Dark Slate Blue","483D8B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt18","Medium Slat Blue","6A5ACD",void 0,1,3),t+="
",t+=this.getMenuText("uniclrGreenwrap","Green",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrGrn1","Green","0F0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn2","Dark Green","006400",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn3","Yellow Green","9ACD32",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn4","Olive Drab","6B8E23",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn5","Olive","808000",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn6","Dark Olive Green","556B2F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn7","Medium Aquamarine","66CDAA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn8","Dark Sea Green","8FBC8B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn9","Lignt Sea Green","20B2AA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn10","Dark Cyan","008B8B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn11","Teal","008080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn12","Forest Green","228B22",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn13","Sea Green","2E8B57",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn14","Medium Sea Green","3CB371",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn15","Spring Green","00FF7F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn16","Medium Spring","00FA9A",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn17","Light Green","90EE90",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn18","Pale Green","98FB98",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn19","Lime Green","32CD32",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn20","Lawn Green","7CFC00",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn21","Chartreuse","7FFF00",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn22","Green Yellow","ADFF2F",void 0,1,3),t+="
",t+=this.getMenuText("uniclrCyanwrap","Cyan",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrCyan1","Cyan","0FF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan2","Light Cyan","E0FFFF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan3","Pale Turquoise","AFEEEE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan4","Aquamarine","7FFFD4",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan5","Turquoise","40E0D0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan6","Medium Turquoise","48D1CC",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan7","Dark Turquoise","00CED1",void 0,1,3),t+="
",t+=this.getMenuText("uniclrBluewrap","Blue",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrBlue1","Blue","00F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue2","Medium Blue","0000CD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue3","Dark Blue","00008B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue4","Navy","000080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue5","Midnight Blue","191970",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue6","Royal Blue","4169E1",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue7","Medium Slate Blue","7B68EE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue8","Corn Flower Blue","6495ED",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue9","Dodger Blue","1E90FF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue10","Deep Sky Blue","00BFFF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue11","Light Sky Blue","87CEFA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue12","Sky Blue","87CEEB",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue13","Light Blue","ADD8E6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue14","Powder Blue","B0E0E6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue15","Light Steel Blue","B0C4DE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue16","Steel Blue","4682B4",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue17","Cadet Blue","5F9EA0",void 0,1,3),t+="
",t+=this.getMenuText("uniclrBrownwrap","Brown",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrBrown1","Brown","A52A2A",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown2","Maroon","800000",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown3","Sienna","A0522D",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown4","Saddle Brown","8B4513",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown5","Chocolate","D2691E",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown6","Peru","CD853F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown7","Dark Golden Rod","B8860B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown8","Golden Rod","DAA520",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown9","Sandy Brown","F4A460",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown10","Rosy Brown","BC8F8F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown11","Tan","D2B48C",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown12","Burlywood","DEB887",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown13","Wheat","F5DEB3",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown14","Navajo White","FFDEAD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown15","Bisque","FFE4C4",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown16","Blanched Almond","FFEBCD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown17","Corn Silk","FFF8DC",void 0,1,3),t+="
",t+=this.getMenuText("uniclrWhitewrap","White",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrWhite1","White","FFF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite2","Snow","FFFAFA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite3","Honey Dew","F0FFF0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite4","Mint Cream","F5FFFA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite5","Azure","F0FFFF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite6","Alice Blue","F0F8FF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite7","Ghost White","F8F8FF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite8","White Smoke","F5F5F5",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite9","Sea Shell","FFF5EE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite10","Beige","F5F5DC",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite11","Old Lace","FDF5E6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite12","Floral White","FFFAF0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite13","Ivory","FFFFF0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite14","Antique White","FAEBD7",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite15","Linen","FAF0E6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite16","Lavenderblush","FFF0F5",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite17","Misty Rose","FFE4E1",void 0,1,3),t+="
",t+=this.getMenuText("uniclrGraywrap","Gray",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrGray1","Gray","808080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray2","Dim Gray","696969",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray3","Light Slate Gray","778899",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray4","Slate Gray","708090",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray5","Dark Slate Gray","2F4F4F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray6","Black","000000",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray7","Dark Gray","A9A9A9",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray8","Silver","C0C0C0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray9","Light Gray","D3D3D3",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray10","Gainsboro","DCDCDC",void 0,1,3),t+="
",t+="",t+=this.getRadio("mn4_clr","mn4_clrRainbow","for Selection",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrRainbowChain","for Chains",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrRainbowSets","for Sets",void 0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrRainbowAcrossSets","across Sets",void 0,void 0,2),t+="
",t+=this.getMenuText("mn4_clrSpectrumwrap","Spectrum (V-R)","icn3d-menupd",1,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrSpectrum","for Selection",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrSpectrumChain","for Chains",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrSpectrumSets","for Sets",void 0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrSpectrumAcrossSets","across Sets",void 0,void 0,2),t+="
",t+=this.getMenuText("mn4_clrSSwrap","Secondary","icn3d-menupd",1,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrSSGreen","Sheet in Green",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrSSYellow","Sheet in Yellow",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrSSSpectrum","Spectrum",void 0,void 0,2),t+="
",t+=this.getRadio("mn4_clr","mn4_clrCharge","Charge",void 0,1,1),t+=this.getMenuText("mn4_hydrophobicwrap","Hydrophobicity","icn3d-menupd",1,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrNormalizedHP","Normalized",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrHydrophobic","Wimley-White",void 0,void 0,2),t+="
",t+=this.getMenuText("mn4_clrBfactorwrap","B-factor","icn3d-menupd",1,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrBfactor","Original",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrBfactorNorm","Percentile",void 0,1,2),t+="
",t+=this.getRadio("mn4_clr","mn4_clrArea",'Solvent
Accessibility',void 0,void 0,1),t+=this.getRadio("mn4_clr","mn4_clrStructure","Structure",void 0,1,1),void 0!==e.cfg.align||void 0!==e.cfg.chainalign||void 0!==e.cfg.blast_rep_id?t+=this.getRadio("mn4_clr","mn4_clrChain","Chain",void 0,1,1):t+=this.getRadio("mn4_clr","mn4_clrChain","Chain",!0,1,1),t+=this.getRadio("mn4_clr","mn4_clrdomain","3D Domain",void 0,void 0,1),void 0===e.cfg.cid&&(t+=this.getMenuText("mn4_clrsetswrap","Defined Sets","icn3d-menupd",void 0,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrsets",'Rainbow for Selected Sets
",t+=""),t+=this.getMenuText("mn4_clrResiduewrap","Residue","icn3d-menupd",1,1),t+="
in "Analysis > Defined Sets"',void 0,void 0,2),t+="",t+=this.getRadio("mn4_clr","mn4_clrResidue","Default",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrResidueCustom","Custom",void 0,void 0,2),t+="
",t+=this.getRadio("mn4_clr","mn4_clrAtom","Atom",void 0,1,1),void 0!==e.cfg.align||void 0!==e.cfg.chainalign?(t+=this.getRadio("mn4_clr","mn4_clrIdentity","Identity",!0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrConserved","Conservation",void 0,void 0,2)):void 0!==e.cfg.blast_rep_id?(t+=this.getRadio("mn4_clr","mn4_clrIdentity","Identity",void 0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrConserved","Conservation",!0,void 0,2)):(t+=this.getRadio("mn4_clr","mn4_clrIdentity","Identity",void 0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrConserved","Conservation",void 0,void 0,2)),t+=this.getRadio("mn4_clr","mn4_clrConfidence","pLDDT",void 0,1,1)):t+=this.getRadio("mn4_clr","mn4_clrAtom","Atom",!0,1,1),t+=this.getMenuSep(),t+=this.getLink("mn4_clrSave","Save Color",void 0,1),t+=this.getLink("mn4_clrApplySave","Apply Saved Color",void 0,1),t+="",void 0===e.cfg.cid&&(t+=this.getLink("mn6_selectannotations","Seq. & Annotations "+e.htmlCls.wifiStr,1,1),t+=this.getLink("mn2_alignment","Aligned Seq. "+e.htmlCls.wifiStr,void 0,1),void 0===e.cfg.mmdbid&&void 0===e.cfg.gi&&void 0===e.cfg.blast_rep_id&&void 0===e.cfg.align&&void 0===e.cfg.chainalign||(t+=this.getLink("mn2_2ddgm","2D Diagram "+e.htmlCls.wifiStr,1,1)),t+=this.getMenuText("2dctnwrap","2D Cartoon",void 0,void 0,1),t+="
",t}setMenu2(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu2_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+="",t+=this.getLink("2dctn_chain","Chain Level",void 0,2),t+=this.getLink("2dctn_domain","Domain Level",void 0,2),t+=this.getLink("2dctn_secondary","Helix/Sheet Level",void 0,2),t+="
",t+="",t+=this.getLink("definedsets2","Defined Sets",1,1),t+=this.getMenuSep(),t+=this.getLink("mn6_hbondsYes","Interactions",1,1),t+=this.getMenuText("mn1_window","Bring to Front",void 0,void 0,1),t+="",t+=this.getLink("mn1_window_table","Interaction Table",void 0,2),t+=this.getLink("mn1_window_linegraph","2D Interaction Network",void 0,2),t+=this.getLink("mn1_window_scatterplot","2D Interaction Map",void 0,2),t+=this.getLink("mn1_window_graph","2D Graph(Force-Directed)",void 0,2),t+="
",t+="",t+=this.getLink("mn6_contactmap","Contact Map",void 0,1),t+=this.getLink("mn1_mutation","Mutation "+e.htmlCls.wifiStr,1,1)),e.cfg.hidelicense||(t+=this.getMenuText("mn1_delphiwrap","DelPhi Potential",void 0,1,1),t+="",t+=this.getLink("mn1_delphi","DelPhi Potential "+e.htmlCls.licenseStr,1,2),t+=this.getMenuText("mn1_phiwrap","Load PQR/Phi",void 0,void 0,2),t+="
",t+=""),t+=this.getMenuSep(),t+=this.getMenuText("mn6_distancewrap","Distance",void 0,1,1),t+="",t+=this.getLink("mn1_phi","Local PQR/Phi/Cube File",void 0,3),t+=this.getLink("mn1_phiurl","URL PQR/Phi/Cube File",void 0,3),t+="
",t+="",t+=this.getLink("delphipqr","Download PQR",void 0,2),t+="",t+=this.getRadio("mn6_distance","mn6_distanceYes","between Two Atoms",void 0,1,2),t+=this.getRadio("mn6_distance","mn6_distTwoSets","between Two Sets",void 0,void 0,2),t+=this.getRadio("mn6_distance","mn6_distManySets","Among Many Sets",void 0,void 0,2),t+=this.getRadio("mn6_distance","mn6_distanceNo","Hide",!0,1,2),t+="
",t+="",t+=this.getLink("mn6_area","Surface Area",1,1),t+=this.getMenuText("mn6_addlabelwrap","Label",void 0,1,1),t+="",t+=this.getRadio("mn6_addlabel","mn6_addlabelYes","by Picking Atoms",void 0,void 0,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelSelection","per Selection",void 0,void 0,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelAtoms","per Atom",void 0,void 0,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelElements","per Atom Element",void 0,1,2),void 0===e.cfg.cid&&(t+=this.getRadio("mn6_addlabel","mn6_addlabelResidues","per Residue",void 0,1,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelResnum","per Residue & Number",void 0,1,2),
+t+=this.getMenuText("m1_exportrefnum","Reference Numbers",void 0,void 0,2),t+="
",t+="",t+=this.getLink("mn1_sharelink","Share Link "+e.htmlCls.wifiStr,1,1),t+=this.getLink("mn1_replayon","Replay Each Step",void 0,1),t+=this.getMenuSep(),t+=this.getMenuText("mn1_menuwrap","Customize Menus",void 0,1,1),t+="",t+=this.getLink("mn1_exportIgstrand","Ig Strand",void 0,3),t+=this.getLink("mn1_exportKabat","Kabat",void 0,3),t+=this.getLink("mn1_exportImgt","IMGT",void 0,3),t+="
",t+="",t+=this.getLink("mn1_menuall","All Menus",1,2),t+=this.getLink("mn1_menusimple","Simple Menus",1,2),t+=this.getMenuSep(),t+=this.getLink("mn1_menupref","Preferences",1,2),t+=this.getLink("mn1_menuloadpref","Load Preferences",1,2),t+="
",t+="",t+="",t+=this.getLink("mn2_definedsets","Defined Sets",1,1),t+=this.getLink("mn2_selectall","All",void 0,1),t+=this.getLink("mn2_selectdisplayed","Displayed Set",void 0,1),t+=this.getLink("mn2_aroundsphere","by Distance",1,1),t+=this.getMenuText("mn2_selbyprop","by Property",void 0,void 0,1),t+="
",t}setMenu2b(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu2b_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+="",t+=this.getLink("mn2_propPos","Positive",void 0,2),t+=this.getLink("mn2_propNeg","Negative",void 0,2),t+=this.getLink("mn2_propHydro","Hydrophobic",void 0,2),t+=this.getLink("mn2_propPolar","Polar",void 0,2),t+=this.getLink("mn2_propBfactor","B-factor/pLDDT",void 0,2),t+=this.getLink("mn2_propSolAcc","Solvent Accessibility",void 0,2),t+="
",t+="",t+=this.getLink("mn2_selectcomplement","Inverse",void 0,1),t+=this.getLink("mn2_selectmainchains","Main Chains",void 0,1),t+=this.getLink("mn2_selectsidechains","Side Chains",void 0,1),t+=this.getLink("mn2_selectmainsidechains","Main & Side Chains",void 0,1),t+=this.getLink("mn2_command","Advanced",void 0,1),void 0===e.cfg.cid?(t+=this.getMenuText("mn2_selon3d","Select on 3D",void 0,1,1),t+="",t+='
",t+=""):e.utilsCls.isMobile()?t+="
"Alt" + Click",t+=this.getRadio("mn2_hl_clr","mn2_hl_clrYellow","Yellow",!0,void 0,2),t+=this.getRadio("mn2_hl_clr","mn2_hl_clrGreen","Green",void 0,void 0,2),t+=this.getRadio("mn2_hl_clr","mn2_hl_clrRed","Red",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_hlstyle","Highlight Style",void 0,void 0,1),t+="",t+=this.getRadio("mn2_hl_style","mn2_hl_styleOutline","Outline",!0,void 0,2),t+=this.getRadio("mn2_hl_style","mn2_hl_styleObject","3D Objects",void 0,void 0,2),t+="
",t+="",t+=this.getLink("toggleHighlight2","Toggle Highlight",1,1),t+="",t+=this.getLink("mn2_show_selected","View Selection",1,1),t+=this.getLink("mn2_hide_selected","Hide Selection",1,1),t+=this.getLink("mn2_selectedcenter","Zoom in Selection",1,1),t+=this.getLink("mn6_center","Center Selection",1,1),t+=this.getLink("mn2_fullstru","View Full Structure"),t+=this.getLinkWrapper("mn2_alternate",'Alternate(Key "a")',"mn2_alternateWrap",void 0,1),void 0!==e.cfg.opmid?t+=this.getLinkWrapper("togglemem","Toggle Membrane","togglememli",void 0,1):void 0===e.cfg.cid&&(t+=this.getLinkWrapper("togglemem","Toggle Membrane","togglememli",void 0,1,!0)),void 0!==e.cfg.opmid&&(t+=this.getLinkWrapper("adjustmem","Adjust Membrane","adjustmemli",void 0,1),t+=this.getLinkWrapper("selectplane","Select between
",t}setMenu3(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu3_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";t+="
Two X-Y Planes","selectplaneli",void 0,1)),t+=this.getMenuSep(),t+=this.getMenuText("mn2_vrarhints","VR & AR Hints",void 0,1,1),t+="",t+=this.getMenuUrl("vrhint",e.htmlCls.baseUrl+"icn3d/icn3d.html#vr","VR: VR Headsets",1,2),t+=this.getMenuUrl("arhint",e.htmlCls.baseUrl+"icn3d/icn3d.html#ar","AR: Chrome in Android",1,2),t+="
",t+="",t+=this.getLink("mn6_sidebyside","Side by Side",1,1),t+=this.getMenuText("mn2_rotate","Rotate",void 0,1,1),t+="",t+=this.getMenuText("mn2_rotate90","Rotate 90°",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_camera","Camera",void 0,void 0,1),t+="",t+=this.getRadio("mn6_rotate90","mn6_rotatex","rotate x",void 0,void 0,2),t+=this.getRadio("mn6_rotate90","mn6_rotatey","rotate y",void 0,void 0,2),t+=this.getRadio("mn6_rotate90","mn6_rotatez","rotate z",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_rotateauto","Auto Rotation",void 0,1,2),t+="",t+=this.getRadio("mn6_rotate","mn6_rotateleft","Rotate Left",void 0,1,3),t+=this.getRadio("mn6_rotate","mn6_rotateright","Rotate Right",void 0,1,3),t+=this.getRadio("mn6_rotate","mn6_rotateup","Rotate Up",void 0,1,3),t+=this.getRadio("mn6_rotate","mn6_rotatedown","Rotate Down",void 0,1,3),t+="
",t+="",t+="",t+=this.getRadio("mn6_camera","mn6_cameraPers","Perspective",!0,void 0,2),t+=this.getRadio("mn6_camera","mn6_cameraOrth","Orthographic",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_fog","Fog for Selection",void 0,void 0,1),t+="",t+=this.getRadio("mn6_showfog","mn6_showfogYes","On",void 0,void 0,2),t+=this.getRadio("mn6_showfog","mn6_showfogNo","Off",!0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_slab","Slab for Selection",void 0,void 0,1),t+="",t+=this.getRadio("mn6_showslab","mn6_showslabYes","On",void 0,void 0,2),t+=this.getRadio("mn6_showslab","mn6_showslabNo","Off",!0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_axes","XYZ-axes",void 0,void 0,1),t+="",t+=this.getRadio("mn6_showaxis","mn6_showaxisYes","Original",void 0,void 0,2),t+=this.getRadio("mn6_showaxis","mn6_showaxisSel","Prin. Axes on Sel.",void 0,void 0,2),t+=this.getRadio("mn6_showaxis","mn6_showaxisNo","Hide",!0,void 0,2),t+="
",t+="",t+=this.getMenuSep(),t+=this.getMenuText("mn2_resetwrap","Reset",void 0,1,1),t+="",t+=this.getRadio("mn6_reset","reset","All",void 0,1,2),t+=this.getRadio("mn6_reset","mn6_resetOrientation","Orientation",void 0,1,2),t+="
",t+="",t+=this.getLink("mn6_back","Undo",void 0,1),t+=this.getLink("mn6_forward","Redo",void 0,1),t+=this.getLink("mn6_fullscreen","Full Screen",void 0,1),t+="",void 0===e.cfg.cid&&(t+=this.getMenuText("mn3_proteinwrap","Proteins",void 0,1,1),t+="
",t}setMenu4(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu4_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+="",void 0!==e.cfg.align||void 0!==e.cfg.chainalign?t+=this.getRadio("mn3_proteins","mn3_proteinsRibbon","Ribbon",void 0,1,2):t+=this.getRadio("mn3_proteins","mn3_proteinsRibbon","Ribbon",!0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsStrand","Strand",void 0,void 0,2),t+=this.getRadio("mn3_proteins","mn3_proteinsCylinder","Cylinder and Plate",void 0,void 0,2),t+=this.getRadio("mn3_proteins","mn3_proteinsSchematic","Schematic",void 0,1,2),void 0!==e.cfg.align||void 0!==e.cfg.chainalign?t+=this.getRadio("mn3_proteins","mn3_proteinsCalpha","C Alpha Trace",!0,1,2):t+=this.getRadio("mn3_proteins","mn3_proteinsCalpha","C Alpha Trace",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsBackbone","Backbone",void 0,void 0,2),t+=this.getRadio("mn3_proteins","mn3_proteinsBfactor","B-factor Tube",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsLines","Lines",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsStick","Stick",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsBallstick","Ball and Stick",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_sidecwrap","Side Chains",void 0,1,1),t+="",t+=this.getRadio("mn3_sidec","mn3_sidecLines","Lines",void 0,1,2),t+=this.getRadio("mn3_sidec","mn3_sidecStick","Stick",void 0,1,2),t+=this.getRadio("mn3_sidec","mn3_sidecBallstick","Ball and Stick",void 0,1,2),t+=this.getRadio("mn3_sidec","mn3_sidecSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_sidec","mn3_sidecNo","Hide",!0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_nuclwrap","Nucleotides",void 0,1,1),t+="",t+=this.getRadio("mn3_nucl","mn3_nuclCartoon","Cartoon",!0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclPhos","O3' Trace",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclBackbone","Backbone",void 0,void 0,2),t+=this.getRadio("mn3_nucl","mn3_nuclSchematic","Schematic",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclLines","Lines",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclStick","Stick",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclBallstick","Ball and Stick",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_ntbasewrap","Nucl. Bases",void 0,1,1),t+="",t+=this.getRadio("mn3_ntbase","mn3_ntbaseLines","Lines",void 0,1,2),t+=this.getRadio("mn3_ntbase","mn3_ntbaseStick","Stick",void 0,1,2),t+=this.getRadio("mn3_ntbase","mn3_ntbaseBallstick","Ball and Stick",void 0,1,2),t+=this.getRadio("mn3_ntbase","mn3_ntbaseSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_ntbase","mn3_ntbaseNo","Hide",!0,1,2),t+="
",t+=""),t+=this.getMenuText("mn3_ligwrap","Chemicals",void 0,1,1),t+="",t+=this.getRadio("mn3_lig","mn3_ligLines","Lines",void 0,1,2),void 0===e.cfg.cid?(t+=this.getRadio("mn3_lig","mn3_ligStick","Stick",!0,1,2),t+=this.getRadio("mn3_lig","mn3_ligBallstick","Ball and Stick",void 0,1,2)):(t+=this.getRadio("mn3_lig","mn3_ligStick","Stick",void 0,1,2),t+=this.getRadio("mn3_lig","mn3_ligBallstick","BalHydrogensl and Stick",!0,1,2)),t+=this.getRadio("mn3_lig","mn3_ligSchematic","Schematic",void 0,1,2),t+=this.getRadio("mn3_lig","mn3_ligSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_lig","mn3_ligNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_hydrogenswrap","Hydrogens",void 0,1,1),t+="",t+=this.getRadio("mn3_hydrogens","mn3_hydrogensYes","Show",!0,1,2),t+=this.getRadio("mn3_hydrogens","mn3_hydrogensNo","Hide",void 0,1,2),t+="
",t+="",void 0===e.cfg.cid&&(t+=this.getMenuText("mn3_glycanwrap","Glycans",void 0,void 0,1),t+="",t+=this.getRadio("mn3_glycansCart","mn3_glycansCartYes","Show Cartoon",void 0,void 0,2),t+=this.getRadio("mn3_glycansCart","mn3_glycansCartNo","Hide Cartoon",!0,void 0,2),t+="
",t+=""),t+=this.getMenuText("mn3_ionswrap","Ions",void 0,1,1),t+="",t+=this.getRadio("mn3_ions","mn3_ionsSphere","Sphere",!0,1,2),t+=this.getRadio("mn3_ions","mn3_ionsDot","Dot",void 0,1,2),t+=this.getRadio("mn3_ions","mn3_ionsNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_waterwrap","Water",void 0,1,1),t+="",t+=this.getRadio("mn3_water","mn3_waterSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_water","mn3_waterDot","Dot",void 0,1,2),t+=this.getRadio("mn3_water","mn3_waterNo","Hide",!0,1,2),t+="
",t+="",t+=this.getLink("mn3_setThickness","Preferences",void 0,1),t+=this.getMenuSep(),t+=this.getLink("mn3_styleSave","Save Style",void 0,2),t+=this.getLink("mn3_styleApplySave","Apply Saved Style",void 0,2),t+=this.getMenuSep(),t+=this.getMenuText("mn5_surfacewrap","Surface Type",void 0,1,1),t+="",t+=this.getRadio("mn5_surface","mn5_surfaceVDW","Van der Waals",void 0,1,2),t+=this.getRadio("mn5_surface","mn5_surfaceVDWContext","VDW with Context",void 0,void 0,2),t+=this.getRadio("mn5_surface","mn5_surfaceMolecular","Molecular Surface",void 0,1,2),t+=this.getRadio("mn5_surface","mn5_surfaceMolecularContext","MS with Context",void 0,void 0,2),t+=this.getRadio("mn5_surface","mn5_surfaceSAS","Solvent Accessible",void 0,1,2),t+=this.getRadio("mn5_surface","mn5_surfaceSASContext","SA with Context",void 0,void 0,2),t+="
",t+="",t+=this.getLink("mn5_surfaceNo","Remove Surface",1,1),t+=this.getMenuText("mn5_surfaceop","Surface Opacity",void 0,1,1),t+="",t+=this.getMenuText("mn5_surfaceopfast","Fast Transparency",void 0,1,2),t+="
",t+=this.getMenuText("mn5_wireframewrap","Surface Wireframe",void 0,1,1),t+="",t+=this.getRadio("mn5_opacity","mn5_opacity10","1.0",!0,1,3);for(let e=9;e>0;--e)t+=this.getRadio("mn5_opacity","mn5_opacity0"+e,"0."+e,1,3);t+="
",t+="",t+=this.getMenuText("mn5_surfaceopslow","Slow Transparency",void 0,void 0,2),t+="",t+=this.getRadio("mn5_opacityslow","mn5_opacityslow10","1.0",!0,void 0,3);for(let e=9;e>0;--e)t+=this.getRadio("mn5_opacityslow","mn5_opacityslow0"+e,"0."+e,void 0,void 0,3);return t+="
",t+="",t+="",t+=this.getRadio("mn5_wireframe","mn5_wireframeYes","Yes",void 0,1,2),t+=this.getRadio("mn5_wireframe","mn5_wireframeNo","No",!0,1,2),t+="
",t+="",t+=this.getMenuSep(),t+=this.getLink("mn5_cartoonshape","Cartoon for a Set",void 0,1),t+=this.getLink("mn5_linebtwsets","Line btw. Two Sets",void 0,1),void 0===e.cfg.cid&&void 0===e.cfg.align&&void 0===e.cfg.chainalign&&void 0===e.cfg.mmdbaf&&(t+=this.getMenuSep(),t+=this.getLinkWrapper2("mn5_map","Electron Density","mapWrapper1",void 0,1),t+="",t+=this.getLink("mn5_elecmap2fofc","2Fo-Fc Map",void 0,2),t+=this.getLink("mn5_elecmapfofc","Fo-Fc Map",void 0,2),t+=this.getLinkWrapper("mn5_elecmapNo","Remove Map","mapWrapper2",void 0,2),t+="
",t+="",t+=this.getLinkWrapper2("mn5_map3","Map Wireframe","mapWrapper3",void 0,1),t+="",t+=this.getRadio("mn5_mapwireframe","mn5_mapwireframeYes","Yes",!0,void 0,2),t+=this.getRadio("mn5_mapwireframe","mn5_mapwireframeNo","No",void 0,void 0,2),t+="
",t+="",void 0===e.cfg.mmtfid&&(t+=this.getLinkWrapper("mn5_emmap","EM Density Map","emmapWrapper1",void 0,1),t+=this.getLinkWrapper("mn5_emmapNo","Remove EM Map","emmapWrapper2",void 0,1),t+=this.getLinkWrapper2("mn5_emmap3","EM Map Wireframe","emmapWrapper3",void 0,1),t+="",t+=this.getRadio("mn5_emmapwireframe","mn5_emmapwireframeYes","Yes",!0,void 0,2),t+=this.getRadio("mn5_emmapwireframe","mn5_emmapwireframeNo","No",void 0,void 0,2),t+="
",t+="")),t+=this.getMenuSep(),t+=this.getMenuText("mn6_bkgdwrap","Background",void 0,1,1),t+="",t+=this.getRadio("mn6_bkgd","mn6_bkgdTransparent","Transparent",void 0,1,2),t+=this.getRadio("mn6_bkgd","mn6_bkgdBlack","Black",!0,1,2),t+=this.getRadio("mn6_bkgd","mn6_bkgdGrey","Gray",void 0,1,2),t+=this.getRadio("mn6_bkgd","mn6_bkgdWhite","White",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn6_themewrap","Dialog Color",void 0,void 0,1),t+="",t+=this.getRadio("mn6_theme","mn6_themeBlue","Blue",!0,void 0,2),t+=this.getRadio("mn6_theme","mn6_themeOrange","Orange",void 0,void 0,2),t+=this.getRadio("mn6_theme","mn6_themeBlack","Black",void 0,void 0,2),t+="
",t+="",t+="",t+=this.getMenuText("mn4_clrwrap","Unicolor","icn3d-menupd",1,1),t+="
",t+="",t+=this.getMenuText("labelscalewrap","Label Scale",void 0,1,1),t+="",t+=this.getMenuText("uniclrRedwrap","Red",void 0,1,2),t+="
",t+=this.getRadio("mn4_clr","mn4_clrCustom","Color Picker",void 0,void 0,1),t+=this.getMenuSep(),void 0===e.cfg.cid?(t+=this.getMenuText("mn4_clrRainbowwrap","Rainbow (R-V)","icn3d-menupd",1,1),t+="",t+=this.getRadClr("mn4_clr","uniclrRed1","Red","F00",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed2","Indian Red","CD5C5C",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed3","Light Coral","F08080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed4","Salmon","FA8072",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed5","Dark Salmon","E9967A",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed6","Light Salmon","FFA07A",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed7","Crimson","DC143C",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed8","Fire Brick","B22222",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed9","Dark Red","8B0000",void 0,1,3),t+="
",t+=this.getMenuText("uniclrPinkwrap","Pink",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrPink1","Pink","FFC0CB",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink2","Light Pink","FFB6C1",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink3","Hot Pink","FF69B4",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink4","Deep Pink","FF1493",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink5","Medium Violet Red","C71585",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink6","Pale Violet Red","DB7093",void 0,1,3),t+="
",t+=this.getMenuText("uniclrOrangewrap","Orange",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrOran1","Orange","FFA500",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran2","Dark Orange","FF8C00",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran3","Orange Red","FF4500",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran4","Tomato","FF6347",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran5","Coral","FF7F50",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran6","Light Salmon","FFA07A",void 0,1,3),t+="
",t+=this.getMenuText("uniclrYellowwrap","Yellow",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrYllw1","Yellow","FF0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw2","Gold","FFD700",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw3","Light Yellow","FFFFE0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw4","Lemon Chiffon","FFFACD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw5","Light Golden Rod","FAFAD2",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw6","Papaya Whip","FFEFD5",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw7","Moccasin","FFE4B5",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw8","Peach Puff","FFDAB9",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw9","Pale Golden Rod","EEE8AA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw10","Khaki","F0E68C",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw11","Dark Khaki","BDB76B",void 0,1,3),t+="
",t+=this.getMenuText("uniclrMagentawrap","Magenta",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrMgnt1","Magenta","F0F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt2","Orchid","DA70D6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt3","Violet","EE82EE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt4","Plum","DDA0DD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt5","Thistle","D8BFD8",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt6","Lavender","E6E6FA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt7","Medium Orchid","BA55D3",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt8","Medium Purple","9370DB",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt9","Rebecca Purple","663399",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt10","Blue Violet","8A2BE2",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt11","Dark Violet","9400D3",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt12","Dark Orchid","9932CC",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt13","Dark Magenta","8B008B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt14","Purple","800080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt15","Indigo","4B0082",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt16","Slat Blue","6A5ACD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt17","Dark Slate Blue","483D8B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt18","Medium Slat Blue","6A5ACD",void 0,1,3),t+="
",t+=this.getMenuText("uniclrGreenwrap","Green",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrGrn1","Green","0F0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn2","Dark Green","006400",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn3","Yellow Green","9ACD32",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn4","Olive Drab","6B8E23",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn5","Olive","808000",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn6","Dark Olive Green","556B2F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn7","Medium Aquamarine","66CDAA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn8","Dark Sea Green","8FBC8B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn9","Lignt Sea Green","20B2AA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn10","Dark Cyan","008B8B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn11","Teal","008080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn12","Forest Green","228B22",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn13","Sea Green","2E8B57",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn14","Medium Sea Green","3CB371",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn15","Spring Green","00FF7F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn16","Medium Spring","00FA9A",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn17","Light Green","90EE90",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn18","Pale Green","98FB98",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn19","Lime Green","32CD32",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn20","Lawn Green","7CFC00",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn21","Chartreuse","7FFF00",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn22","Green Yellow","ADFF2F",void 0,1,3),t+="
",t+=this.getMenuText("uniclrCyanwrap","Cyan",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrCyan1","Cyan","0FF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan2","Light Cyan","E0FFFF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan3","Pale Turquoise","AFEEEE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan4","Aquamarine","7FFFD4",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan5","Turquoise","40E0D0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan6","Medium Turquoise","48D1CC",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan7","Dark Turquoise","00CED1",void 0,1,3),t+="
",t+=this.getMenuText("uniclrBluewrap","Blue",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrBlue1","Blue","00F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue2","Medium Blue","0000CD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue3","Dark Blue","00008B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue4","Navy","000080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue5","Midnight Blue","191970",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue6","Royal Blue","4169E1",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue7","Medium Slate Blue","7B68EE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue8","Corn Flower Blue","6495ED",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue9","Dodger Blue","1E90FF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue10","Deep Sky Blue","00BFFF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue11","Light Sky Blue","87CEFA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue12","Sky Blue","87CEEB",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue13","Light Blue","ADD8E6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue14","Powder Blue","B0E0E6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue15","Light Steel Blue","B0C4DE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue16","Steel Blue","4682B4",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue17","Cadet Blue","5F9EA0",void 0,1,3),t+="
",t+=this.getMenuText("uniclrBrownwrap","Brown",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrBrown1","Brown","A52A2A",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown2","Maroon","800000",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown3","Sienna","A0522D",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown4","Saddle Brown","8B4513",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown5","Chocolate","D2691E",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown6","Peru","CD853F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown7","Dark Golden Rod","B8860B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown8","Golden Rod","DAA520",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown9","Sandy Brown","F4A460",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown10","Rosy Brown","BC8F8F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown11","Tan","D2B48C",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown12","Burlywood","DEB887",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown13","Wheat","F5DEB3",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown14","Navajo White","FFDEAD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown15","Bisque","FFE4C4",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown16","Blanched Almond","FFEBCD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown17","Corn Silk","FFF8DC",void 0,1,3),t+="
",t+=this.getMenuText("uniclrWhitewrap","White",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrWhite1","White","FFF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite2","Snow","FFFAFA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite3","Honey Dew","F0FFF0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite4","Mint Cream","F5FFFA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite5","Azure","F0FFFF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite6","Alice Blue","F0F8FF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite7","Ghost White","F8F8FF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite8","White Smoke","F5F5F5",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite9","Sea Shell","FFF5EE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite10","Beige","F5F5DC",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite11","Old Lace","FDF5E6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite12","Floral White","FFFAF0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite13","Ivory","FFFFF0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite14","Antique White","FAEBD7",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite15","Linen","FAF0E6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite16","Lavenderblush","FFF0F5",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite17","Misty Rose","FFE4E1",void 0,1,3),t+="
",t+=this.getMenuText("uniclrGraywrap","Gray",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrGray1","Gray","808080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray2","Dim Gray","696969",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray3","Light Slate Gray","778899",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray4","Slate Gray","708090",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray5","Dark Slate Gray","2F4F4F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray6","Black","000000",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray7","Dark Gray","A9A9A9",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray8","Silver","C0C0C0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray9","Light Gray","D3D3D3",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray10","Gainsboro","DCDCDC",void 0,1,3),t+="
",t+="",t+=this.getRadio("mn4_clr","mn4_clrRainbow","for Selection",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrRainbowChain","for Chains",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrRainbowSets","for Sets",void 0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrRainbowAcrossSets","across Sets",void 0,void 0,2),t+="
",t+=this.getMenuText("mn4_clrSpectrumwrap","Spectrum (V-R)","icn3d-menupd",1,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrSpectrum","for Selection",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrSpectrumChain","for Chains",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrSpectrumSets","for Sets",void 0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrSpectrumAcrossSets","across Sets",void 0,void 0,2),t+="
",t+=this.getMenuText("mn4_clrSSwrap","Secondary","icn3d-menupd",1,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrSSGreen","Sheet in Green",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrSSYellow","Sheet in Yellow",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrSSSpectrum","Spectrum",void 0,void 0,2),t+="
",t+=this.getRadio("mn4_clr","mn4_clrCharge","Charge",void 0,1,1),t+=this.getMenuText("mn4_hydrophobicwrap","Hydrophobicity","icn3d-menupd",1,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrNormalizedHP","Normalized",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrHydrophobic","Wimley-White",void 0,void 0,2),t+="
",t+=this.getMenuText("mn4_clrBfactorwrap","B-factor","icn3d-menupd",1,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrBfactor","Original",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrBfactorNorm","Percentile",void 0,1,2),t+="
",t+=this.getRadio("mn4_clr","mn4_clrArea",'Solvent
Accessibility',void 0,void 0,1),t+=this.getRadio("mn4_clr","mn4_clrStructure","Structure",void 0,1,1),void 0!==e.cfg.align||void 0!==e.cfg.chainalign||void 0!==e.cfg.blast_rep_id?t+=this.getRadio("mn4_clr","mn4_clrChain","Chain",void 0,1,1):t+=this.getRadio("mn4_clr","mn4_clrChain","Chain",!0,1,1),t+=this.getRadio("mn4_clr","mn4_clrdomain","3D Domain",void 0,void 0,1),void 0===e.cfg.cid&&(t+=this.getMenuText("mn4_clrsetswrap","Defined Sets","icn3d-menupd",void 0,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrsets",'Rainbow for Selected Sets
",t+=""),t+=this.getMenuText("mn4_clrResiduewrap","Residue","icn3d-menupd",1,1),t+="
in "Analysis > Defined Sets"',void 0,void 0,2),t+="",t+=this.getRadio("mn4_clr","mn4_clrResidue","Default",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrResidueCustom","Custom",void 0,void 0,2),t+="
",t+=this.getRadio("mn4_clr","mn4_clrAtom","Atom",void 0,1,1),void 0!==e.cfg.align||void 0!==e.cfg.chainalign?(t+=this.getRadio("mn4_clr","mn4_clrIdentity","Identity",!0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrConserved","Conservation",void 0,void 0,2)):void 0!==e.cfg.blast_rep_id?(t+=this.getRadio("mn4_clr","mn4_clrIdentity","Identity",void 0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrConserved","Conservation",!0,void 0,2)):(t+=this.getRadio("mn4_clr","mn4_clrIdentity","Identity",void 0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrConserved","Conservation",void 0,void 0,2)),t+=this.getRadio("mn4_clr","mn4_clrConfidence","pLDDT",void 0,1,1),
//!!!
-t+=this.getRadio("mn6_addlabel","mn6_addlabelChains","per Chain",void 0,void 0,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelTermini","N- & C-Termini",void 0,1,2)),t+=this.getMenuSep(),t+=this.getRadio("mn6_addlabel","mn6_labelColor","Change Label Color",void 0,1,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelNo","Remove",!0,1,2),t+="";for(let e=1;e<=4;++e){let s=2*e;t+=this.getRadio("mn6_labelscale","mn6_labelscale0"+s,"0."+s,void 0,1,2)}for(let e=1;e<=5;++e)t+=1==e?this.getRadio("mn6_labelscale","mn6_labelscale"+e+"0",e+".0",!0,1,2):this.getRadio("mn6_labelscale","mn6_labelscale"+e+"0",e+".0",void 0,1,2);if(t+="
",t+="",t+=this.getMenuSep(),void 0===e.cfg.cid){t+=this.getMenuText("mn6_chemicalbindingwrap","Chem. Binding",void 0,void 0,1),t+="",t+=this.getRadio("mn6_chemicalbinding","mn6_chemicalbindingshow","Show",void 0,void 0,2),t+=this.getRadio("mn6_chemicalbinding","mn6_chemicalbindinghide","Hide",!0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn6_ssbondswrap","Disulfide Bonds",void 0,1,1),t+="",t+=this.getRadio("mn6_ssbonds","mn6_ssbondsYes","Show",!0,1,2),t+=this.getRadio("mn6_ssbonds","mn6_ssbondsExport","Export Pairs",void 0,void 0,2),t+=this.getRadio("mn6_ssbonds","mn6_ssbondsNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn6_clbondswrap","Cross-Linkages",void 0,void 0,1),t+="",t+=this.getRadio("mn6_clbonds","mn6_clbondsYes","Show",!0,void 0,2),t+=this.getRadio("mn6_clbonds","mn6_clbondsExport","Export Pairs",void 0,void 0,2),t+=this.getRadio("mn6_clbonds","mn6_clbondsNo","Hide",void 0,void 0,2),t+="
",t+="";let s=void 0!==e.cfg.mmtfid||void 0!==e.cfg.pdbid||void 0!==e.cfg.opmid||void 0!==e.cfg.mmcifid||void 0!==e.cfg.mmdbid||void 0!==e.cfg.mmdbafid||void 0!==e.cfg.gi||void 0!==e.cfg.blast_rep_id;s&&(t+=this.getMenuText("assemblyWrapper","Assembly",void 0,1,1),t+="",e.cfg.bu?(t+=this.getRadio("mn6_assembly","mn6_assemblyYes","Biological Assembly",!0,1,2),t+=this.getRadio("mn6_assembly","mn6_assemblyNo","Asymmetric Unit",void 0,1,2)):(t+=this.getRadio("mn6_assembly","mn6_assemblyYes","Biological Assembly",void 0,1,2),t+=this.getRadio("mn6_assembly","mn6_assemblyNo","Asymmetric Unit",!0,1,2)),t+="
",t+=""),t+=this.getMenuText("mn6_symmetrywrap","Symmetry",void 0,void 0,1),t+="",s&&(t+=this.getLink("mn6_symmetry","from PDB(precalculated) "+e.htmlCls.wifiStr,void 0,2)),t+=this.getLink("mn6_symd","from SymD(Dynamic) "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn6_clear_sym","Clear SymD Symmetry",void 0,2),t+=this.getLink("mn6_axes_only","Show Axes Only",void 0,2),t+="
",t+="",t+=this.getMenuText("mn6_igrefwrap","Ref. Number",void 0,void 0,1),t+="",
+t+=this.getRadio("mn4_clr","mn4_clrIgstrand","Ig Strand",void 0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrIgproto","Ig Protodomain",void 0,void 0,2)):t+=this.getRadio("mn4_clr","mn4_clrAtom","Atom",!0,1,1),t+=this.getMenuSep(),t+=this.getLink("mn4_clrSave","Save Color",void 0,1),t+=this.getLink("mn4_clrApplySave","Apply Saved Color",void 0,1),t+="
",t}setMenu5(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu5_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";t+="",void 0===e.cfg.cid&&(t+=this.getLink("mn6_selectannotations","Seq. & Annotations "+e.htmlCls.wifiStr,1,1),t+=this.getLink("mn2_alignment","Aligned Seq. "+e.htmlCls.wifiStr,void 0,1),void 0===e.cfg.mmdbid&&void 0===e.cfg.gi&&void 0===e.cfg.blast_rep_id&&void 0===e.cfg.align&&void 0===e.cfg.chainalign||(t+=this.getLink("mn2_2ddgm","2D Diagram "+e.htmlCls.wifiStr,1,1)),t+=this.getMenuText("2dctnwrap","2D Cartoon",void 0,void 0,1),t+="
",t}setMenu6(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu6_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+="",t+=this.getLink("2dctn_chain","Chain Level",void 0,2),t+=this.getLink("2dctn_domain","Domain Level",void 0,2),t+=this.getLink("2dctn_secondary","Helix/Sheet Level",void 0,2),t+="
",t+="",t+=this.getLink("definedsets2","Defined Sets",1,1),t+=this.getMenuSep(),t+=this.getLink("mn6_hbondsYes","Interactions",1,1),t+=this.getMenuText("mn1_window","Bring to Front",void 0,void 0,1),t+="",t+=this.getLink("mn1_window_table","Interaction Table",void 0,2),t+=this.getLink("mn1_window_linegraph","2D Interaction Network",void 0,2),t+=this.getLink("mn1_window_scatterplot","2D Interaction Map",void 0,2),t+=this.getLink("mn1_window_graph","2D Graph(Force-Directed)",void 0,2),t+="
",t+="",t+=this.getLink("mn6_contactmap","Contact Map",void 0,1),t+=this.getLink("mn1_mutation","Mutation "+e.htmlCls.wifiStr,1,1)),e.cfg.hidelicense||(t+=this.getMenuText("mn1_delphiwrap","DelPhi Potential",void 0,1,1),t+="",t+=this.getLink("mn1_delphi","DelPhi Potential "+e.htmlCls.licenseStr,1,2),t+=this.getMenuText("mn1_phiwrap","Load PQR/Phi",void 0,void 0,2),t+="
",t+=""),t+=this.getMenuSep(),t+=this.getMenuText("mn6_distancewrap","Distance",void 0,1,1),t+="",t+=this.getLink("mn1_phi","Local PQR/Phi/Cube File",void 0,3),t+=this.getLink("mn1_phiurl","URL PQR/Phi/Cube File",void 0,3),t+="
",t+="",t+=this.getLink("delphipqr","Download PQR",void 0,2),t+="",t+=this.getRadio("mn6_distance","mn6_distanceYes","between Two Atoms",void 0,1,2),t+=this.getRadio("mn6_distance","mn6_distTwoSets","between Two Sets",void 0,void 0,2),t+=this.getRadio("mn6_distance","mn6_distManySets","Among Many Sets",void 0,void 0,2),t+=this.getRadio("mn6_distance","mn6_distanceNo","Hide",!0,1,2),t+="
",t+="",t+=this.getLink("mn6_area","Surface Area",1,1),t+=this.getMenuText("mn6_addlabelwrap","Label",void 0,1,1),t+="",t+=this.getRadio("mn6_addlabel","mn6_addlabelYes","by Picking Atoms",void 0,void 0,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelSelection","per Selection",void 0,void 0,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelAtoms","per Atom",void 0,void 0,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelElements","per Atom Element",void 0,1,2),void 0===e.cfg.cid&&(t+=this.getRadio("mn6_addlabel","mn6_addlabelResidues","per Residue",void 0,1,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelResnum","per Residue & Number",void 0,1,2),
//!!!
-t+=this.getMenuSep(),t+=this.getLink("mn6_customref","Custom Ref. Number",void 0,2),t+="
",t+="",t+=this.getMenuSep()}return t+=this.getLink("mn6_yournote","Window Title",void 0,1),void 0!==e.cfg.cid?(t+=this.getMenuText("mn1_linkwrap","Links",void 0,void 0,1),t+="",t+=this.getLink("mn1_link_structure","Compound Summary "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_vast","Similar Compounds "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_bind","Structures Bound "+e.htmlCls.wifiStr,void 0,2),t+="
",t+=""):(t+=this.getMenuText("mn1_linkwrap","Links",void 0,void 0,1),t+="",t+=this.getLink("mn1_link_structure","Structure Summary "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_vast","Similar Structures "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_pubmed","Literature "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_protein","Protein "+e.htmlCls.wifiStr,void 0,2),t+="
",t+=""),t+="",t+=this.getMenuUrl("abouticn3d",e.htmlCls.baseUrl+"icn3d/icn3d.html#about","About iCn3D "+e.REVISION+"",1,1),t+=this.getMenuUrl("gallery",e.htmlCls.baseUrl+"icn3d/icn3d.html#gallery","Live Gallery "+e.htmlCls.wifiStr,1,1),t+=this.getMenuUrl("video",e.htmlCls.baseUrl+"icn3d/icn3d.html#videos","Videos & Tutorials",1,1),t+=this.getMenuText("mn6_faq","FAQ",void 0,1,1),t+="
",t}hideMenu(){let e=this.icn3dui;e.bNode||(void 0!==$("#"+e.pre+"mnlist")[0]&&($("#"+e.pre+"mnlist")[0].style.display="none"),void 0!==$("#"+e.pre+"mnLogSection")[0]&&($("#"+e.pre+"mnLogSection")[0].style.display="none"),void 0!==$("#"+e.pre+"cmdlog")[0]&&($("#"+e.pre+"cmdlog")[0].style.display="none"),$("#"+e.pre+"title")[0].style.margin="10px 0 0 10px")}showMenu(){let e=this.icn3dui;e.bNode||(void 0!==$("#"+e.pre+"mnlist")[0]&&($("#"+e.pre+"mnlist")[0].style.display="block"),void 0!==$("#"+e.pre+"mnLogSection")[0]&&($("#"+e.pre+"mnLogSection")[0].style.display="block"),void 0!==$("#"+e.pre+"cmdlog")[0]&&($("#"+e.pre+"cmdlog")[0].style.display="block"))}}class c{constructor(e){this.icn3dui=e}openDlg(e,t){let s=this.icn3dui;s.icn3d,s.bNode||(e=s.pre+e,s.cfg.notebook?this.openDlgNotebook(e,t):this.openDlgRegular(e,t),s.htmlCls.themecolor||(s.htmlCls.themecolor="blue"),s.htmlCls.setMenuCls.setTheme(s.htmlCls.themecolor))}addSaveButton(e){let t=this.icn3dui;t.icn3d,t.bNode||void 0!==this.dialogHashSave&&this.dialogHashSave.hasOwnProperty(e)||($("#"+e).parent().children(".ui-dialog-titlebar").append(""),void 0===this.dialogHashSave&&(this.dialogHashSave={}),this.dialogHashSave[e]=1)}addHideButton(e){let t=this.icn3dui;t.icn3d,t.bNode||void 0!==this.dialogHashHide&&this.dialogHashHide.hasOwnProperty(e)||($("#"+e).parent().children(".ui-dialog-titlebar").append(""),void 0===this.dialogHashHide&&(this.dialogHashHide={}),this.dialogHashHide[e]=1)}getDialogStatus(){let e=this.icn3dui;if(e.icn3d,e.bNode)return;let t={},s={},i=$("#"+e.pre+"dl_selectannotations").hasClass("ui-dialog-content"),n=$("#"+e.pre+"dl_graph").hasClass("ui-dialog-content"),l=$("#"+e.pre+"dl_linegraph").hasClass("ui-dialog-content"),r=$("#"+e.pre+"dl_scatterplot").hasClass("ui-dialog-content"),o=$("#"+e.pre+"dl_contactmap").hasClass("ui-dialog-content"),a=$("#"+e.pre+"dl_alignerrormap").hasClass("ui-dialog-content"),d=$("#"+e.pre+"dl_interactionsorted").hasClass("ui-dialog-content"),c=$("#"+e.pre+"dl_alignment").hasClass("ui-dialog-content"),h=$("#"+e.pre+"dl_2ddgm").hasClass("ui-dialog-content"),p=$("#"+e.pre+"dl_2dctn").hasClass("ui-dialog-content"),m=$("#"+e.pre+"dl_definedsets").hasClass("ui-dialog-content");return t.bSelectannotationsInit2=!1,t.bGraph2=!1,t.bLineGraph2=!1,t.bScatterplot2=!1,t.bTable2=!1,t.bAlignmentInit2=!1,t.bTwoddgmInit2=!1,t.bTwodctnInit2=!1,t.bSetsInit2=!1,s.dl_selectannotations="bSelectannotationsInit2",s.dl_graph="bGraph2",s.dl_linegraph="bLineGraph2",s.dl_scatterplot="bScatterplot2",s.dl_contactmap="bContactmap2",s.dl_alignerrormap="bAlignerrormap2",s.dl_interactionsorted="bTable2",s.dl_alignment="bAlignmentInit2",s.dl_2ddgm="bTwoddgmInit2",s.dl_2dctn="bTwodctnInit2",s.dl_definedsets="bSetsInit2",i&&(t.bSelectannotationsInit2=$("#"+e.pre+"dl_selectannotations").dialog("isOpen")),n&&(t.bGraph2=$("#"+e.pre+"dl_graph").dialog("isOpen")),l&&(t.bLineGraph2=$("#"+e.pre+"dl_linegraph").dialog("isOpen")),r&&(t.bScatterplot2=$("#"+e.pre+"dl_scatterplot").dialog("isOpen")),o&&(t.bContactmap2=$("#"+e.pre+"dl_contactmap").dialog("isOpen")),a&&(t.bAlignerror2=$("#"+e.pre+"dl_alignerrormap").dialog("isOpen")),d&&(t.bTable2=$("#"+e.pre+"dl_interactionsorted").dialog("isOpen")),c&&(t.bAlignmentInit2=$("#"+e.pre+"dl_alignment").dialog("isOpen")),h&&(t.bTwoddgmInit2=$("#"+e.pre+"dl_2ddgm").dialog("isOpen")),p&&(t.bTwodctnInit2=$("#"+e.pre+"dl_2dctn").dialog("isOpen")),m&&(t.bSetsInit2=$("#"+e.pre+"dl_definedsets").dialog("isOpen")),{status:t,id2flag:s}}openDlgHalfWindow(e,t,s,i){let n=this.icn3dui,l=n.icn3d;if(n.bNode)return;let r=this,o=n.htmlCls.width2d+20;l.resizeCanvasCls.resizeCanvas(n.htmlCls.WIDTH-s,n.htmlCls.HEIGHT,i);let a,d=n.htmlCls.HEIGHT,c=s;a=!n.cfg.showmenu||n.utilsCls.isMobile()||n.cfg.mobilemenu?{my:"left top",at:"right top",of:"#"+n.pre+"viewer",collision:"none"}:{my:"left top",at:"right top+40",of:"#"+n.pre+"viewer",collision:"none"},n.cfg.resize=!1,window.dialog=$("#"+e).dialog({autoOpen:!0,title:t,height:d,width:c,modal:!1,position:a,close:function(t){let s=r.getDialogStatus(),i=s.status,a=s.id2flag,d=!1;for(let t in a){let s=e===n.pre+t;for(let e in i)i.hasOwnProperty(e)||(s=s&&!i[e]);d=d||s}if(d)if(i.bTwoddgmInit2||i.bTwodctnInit2||i.bSetsInit2){let e=n.utilsCls.isMobile()?n.htmlCls.WIDTH:n.htmlCls.WIDTH-o;l.resizeCanvasCls.resizeCanvas(e,n.htmlCls.HEIGHT,!0),i.bTwoddgmInit2&&r.openDlg2Ddgm(n.pre+"dl_2ddgm",void 0,i.bSetsInit2),i.bTwodctnInit2&&r.openDlg2Ddgm(n.pre+"dl_2dctn",void 0,i.bSetsInit2),i.bSetsInit2&&r.openDlg2Ddgm(n.pre+"dl_definedsets")}else l.resizeCanvasCls.resizeCanvas(n.htmlCls.WIDTH,n.htmlCls.HEIGHT,!0)},resize:function(t){if(e==n.pre+"dl_selectannotations")l.annotationCls.hideFixedTitle();else if(e==n.pre+"dl_graph"){let t=$("#"+e).width(),s=$("#"+e).height();d3.select("#"+n.svgid).attr("width",t).attr("height",s)}else if(e==n.pre+"dl_linegraph"||e==n.pre+"dl_scatterplot"||e==n.pre+"dl_contactmap"||e==n.pre+"dl_alignerrormap"){let t=status.bTwoddgmInit2||status.bSetsInit2?(n.htmlCls.WIDTH-o)/2:n.htmlCls.WIDTH/2,s=$("#"+e).width()/t;if(e==n.pre+"dl_linegraph"){let e=l.linegraphWidth*s;$("#"+n.linegraphid).attr("width",e)}else if(e==n.pre+"dl_scatterplot"){let e=l.scatterplotWidth*s;$("#"+n.scatterplotid).attr("width",e)}else if(e==n.pre+"dl_contactmap"){let e=l.contactmapWidth*s;$("#"+n.contactmapid).attr("width",e)}else if(e==n.pre+"dl_alignerrormap"){let e=l.alignerrormapWidth*s;$("#"+n.alignerrormapid).attr("width",e)}}}}),this.addSaveButton(e),this.addHideButton(e)}openDlg2Ddgm(e,t,s){let i=this.icn3dui,n=i.icn3d;if(i.bNode)return;let l,r,o=this,a=i.htmlCls.width2d+20;e===i.pre+"dl_definedsets"?(l="right top",r="Select sets"):e!==i.pre+"dl_2ddgm"&&e!==i.pre+"dl_2dctn"||(l=s?"right top+240":"right top",r=e===i.pre+"dl_2ddgm"?"2D Diagram":"2D Cartoon");let d={my:"left top+"+i.htmlCls.MENU_HEIGHT,at:l,of:"#"+i.pre+"viewer",collision:"none"};window.dialog=$("#"+e).dialog({autoOpen:!0,title:r,height:"auto",width:a,modal:!1,position:d,close:function(e){let t=o.getDialogStatus().status;t.bSelectannotationsInit2||t.bGraph2||t.bLineGraph2||t.bScatterplot2||t.bTable2||t.bAlignmentInit2||n.resizeCanvasCls.resizeCanvas(i.htmlCls.WIDTH,i.htmlCls.HEIGHT,!0)},resize:function(t,s){e==i.pre+"dl_2dctn"&&(n.resizeRatioX=s.size.width/i.htmlCls.width2d,n.resizeRatioY=s.size.height/(i.htmlCls.width2d+70))},resizeStop:function(e,t){n.resizeRatioX=t.size.width/i.htmlCls.width2d,n.resizeRatioY=t.size.height/(i.htmlCls.width2d+70)}}),this.addSaveButton(e),this.addHideButton(e)}openDlgRegular(e,t){let s=this.icn3dui,i=s.icn3d;if(s.bNode)return;let n=400,l=150,r=s.htmlCls.width2d+20,o=this.getDialogStatus().status;if(e===s.pre+"dl_selectannotations"||e===s.pre+"dl_graph"||e===s.pre+"dl_linegraph"||e===s.pre+"dl_scatterplot"||e===s.pre+"dl_contactmap"||e===s.pre+"dl_alignerrormap"||e===s.pre+"dl_interactionsorted"||e===s.pre+"dl_alignment"){let a=.5*s.htmlCls.WIDTH-.5*r;if(s.htmlCls.WIDTH>=s.htmlCls.HEIGHT)this.openDlgHalfWindow(e,t,a,!0),(o.bTwoddgmInit2||o.bTwodctnInit2||o.bSetsInit2)&&(i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH-a-r,s.htmlCls.HEIGHT,!0),o.bTwoddgmInit2&&this.openDlg2Ddgm(s.pre+"dl_2ddgm",void 0,o.bSetsInit2),o.bTwodctnInit2&&this.openDlg2Ddgm(s.pre+"dl_2dctn",void 0,o.bSetsInit2),o.bSetsInit2&&this.openDlg2Ddgm(s.pre+"dl_definedsets"));else{i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH,.5*s.htmlCls.HEIGHT,!0),l=.5*s.htmlCls.HEIGHT,n=s.htmlCls.WIDTH;let a={my:"left top",at:"left bottom+32",of:"#"+s.pre+"canvas",collision:"none"};window.dialog=$("#"+e).dialog({autoOpen:!0,title:t,height:l,width:n,modal:!1,position:a,close:function(t){if(!((e!==s.pre+"dl_selectannotations"||o.bAlignmentInit2||o.bGraph2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_graph"||o.bSelectannotationsInit2||o.bAlignmentInit2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_alignment"||o.bSelectannotationsInit2||o.bGraph2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_interactionsorted"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_linegraph"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bTable2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_scatterplot"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bTable2||o.bLineGraph2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_contactmap"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bAlignerrormap2)&&(e!==s.pre+"dl_alignerrormap"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2)))if(o.bTwoddgmInit2||o.bTwodctnInit2||o.bSetsInit2){let e=s.utilsCls.isMobile()?s.htmlCls.WIDTH:s.htmlCls.WIDTH-r;i.resizeCanvasCls.resizeCanvas(e,s.htmlCls.HEIGHT,!0),o.bTwoddgmInit2&&thisClass.openDlg2Ddgm(s.pre+"dl_2ddgm",void 0,o.bSetsInit2),o.bTwodctnInit2&&thisClass.openDlg2Ddgm(s.pre+"dl_2dctn",void 0,o.bSetsInit2),o.bSetsInit2&&thisClass.openDlg2Ddgm(s.pre+"dl_definedsets")}else i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH,s.htmlCls.HEIGHT,!0)},resize:function(t){if(e==s.pre+"dl_selectannotations")i.annotationCls.hideFixedTitle();else if(e==s.pre+"dl_graph"){let t=$("#"+e).width(),i=$("#"+e).height();d3.select("#"+s.svgid).attr("width",t).attr("height",i)}else if(e==s.pre+"dl_linegraph"||e==s.pre+"dl_scatterplot"||e==s.pre+"dl_contactmap"||e==s.pre+"dl_alignerrormap"){let t=o.bTwoddgmInit2||o.bSetsInit2?(s.htmlCls.WIDTH-r)/2:s.htmlCls.WIDTH/2,n=$("#"+e).width()/t;if(e==s.pre+"dl_linegraph"){let e=i.linegraphWidth*n;$("#"+s.linegraphid).attr("width",e)}else if(e==s.pre+"dl_scatterplot"){let e=i.scatterplotWidth*n;$("#"+s.scatterplotid).attr("width",e)}else if(e==s.pre+"dl_contactmap"){let e=i.contactmapWidth*n;$("#"+s.contactmapid).attr("width",e)}else if(e==s.pre+"dl_alignerrormap"){let e=i.alignerrormapWidth*n;$("#"+s.alignerrormapid).attr("width",e)}}}}),this.addSaveButton(e),this.addHideButton(e)}}else if(e===s.pre+"dl_2ddgm"||e===s.pre+"dl_2dctn"){let t=0;if(s.htmlCls.WIDTH>=s.htmlCls.HEIGHT)(o.bSelectannotationsInit2||o.bGraph2||o.bLineGraph2||o.bScatterplot2||o.bTable2||o.bAlignmentInit2)&&(t=.5*s.htmlCls.WIDTH-.5*r),i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH-t-r,s.htmlCls.HEIGHT,!0),this.openDlg2Ddgm(e,void 0,o.bSetsInit2);else{let t=s.utilsCls.isMobile()?s.htmlCls.WIDTH:s.htmlCls.WIDTH-r;i.resizeCanvasCls.resizeCanvas(t,.5*s.htmlCls.HEIGHT,!0),this.openDlg2Ddgm(e,.5*s.htmlCls.HEIGHT),this.openDlg2Ddgm(e,.5*s.htmlCls.HEIGHT,o.bSetsInit2)}}else{let a;if(l="auto",n="auto",e===s.pre+"dl_addtrack"?n="50%":e===s.pre+"dl_menupref"&&(n=600,l=500),e===s.pre+"dl_definedsets"){let t=0;if(s.htmlCls.WIDTH>=s.htmlCls.HEIGHT)(o.bSelectannotationsInit2||o.bGraph2||o.bLineGraph2||o.bScatterplot2||o.bTable2||o.bAlignmentInit2)&&(t=.5*s.htmlCls.WIDTH-.5*r),i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH-t-r,s.htmlCls.HEIGHT,!0),this.openDlg2Ddgm(e),o.bTwoddgmInit2&&this.openDlg2Ddgm(s.pre+"dl_2ddgm",void 0,!0),o.bTwodctnInit2&&this.openDlg2Ddgm(s.pre+"dl_2dctn",void 0,!0);else{let t=s.utilsCls.isMobile()?s.htmlCls.WIDTH:s.htmlCls.WIDTH-r;i.resizeCanvasCls.resizeCanvas(t,.5*s.htmlCls.HEIGHT,!0),this.openDlg2Ddgm(e,.5*s.htmlCls.HEIGHT),o.bTwoddgmInit2&&this.openDlg2Ddgm(s.pre+"dl_2ddgm",.5*s.htmlCls.HEIGHT,!0),o.bTwodctnInit2&&this.openDlg2Ddgm(s.pre+"dl_2dctn",.5*s.htmlCls.HEIGHT,!0)}}else s.utilsCls.isMobile()?a={my:"left top",at:"left bottom-50",of:"#"+s.pre+"canvas",collision:"none"}:e===s.pre+"dl_allinteraction"||e===s.pre+"dl_buriedarea"?(a={my:"right top",at:"right top+50",of:"#"+i.divid,collision:"none"},n=700,l=500):a=e===s.pre+"dl_rmsd"||e===s.pre+"dl_legend"?{my:"left bottom",at:"left+20 bottom-20",of:"#"+s.pre+"canvas",collision:"none"}:e===s.pre+"dl_symd"?{my:"left top",at:"right-200 bottom-200",of:"#"+s.pre+"canvas",collision:"none"}:s.cfg.align?{my:"left top",at:"left top+90",of:"#"+s.pre+"canvas",collision:"none"}:e===s.pre+"dl_mmdbafid"?{my:"left top",at:"left top+130",of:"#"+s.pre+"canvas",collision:"none"}:{my:"left top",at:"left top+50",of:"#"+s.pre+"canvas",collision:"none"},window.dialog=$("#"+e).dialog({autoOpen:!0,title:t,height:l,width:n,modal:!1,position:a}),this.addSaveButton(e),this.addHideButton(e)}$(".ui-dialog .ui-button span").removeClass("ui-icon-closethick").addClass("ui-icon-close")}openDlgNotebook(e,t){let s=this.icn3dui,i=s.icn3d;if(s.bNode)return;let n=400,l=150,r=s.htmlCls.width2d+20;e===s.pre+"dl_selectannotations"||e===s.pre+"dl_graph"||e===s.pre+"dl_linegraph"||e===s.pre+"dl_scatterplot"||e===s.pre+"dl_contactmap"||e===s.pre+"dl_alignerrormap"||e===s.pre+"dl_interactionsorted"||e===s.pre+"dl_alignment"?($("#"+e).show(),$("#"+e+"_nb").show(),$("#"+e+"_title").html(t),l=.5*s.htmlCls.HEIGHT,n=s.htmlCls.WIDTH,$("#"+e).width(n),$("#"+e).height(l),$("#"+e).resize((function(t){let n=s.htmlCls.WIDTH/2,l=$("#"+e).width()/n;if(e==s.pre+"dl_selectannotations")i.annotationCls.hideFixedTitle();else if(e==s.pre+"dl_graph"){let t=$("#"+e).width(),i=$("#"+e).height();d3.select("#"+s.svgid).attr("width",t).attr("height",i)}else if(e==s.pre+"dl_linegraph"){let e=i.linegraphWidth*l;$("#"+s.linegraphid).attr("width",e)}else if(e==s.pre+"dl_scatterplot"){let e=i.scatterplotWidth*l;$("#"+s.scatterplotid).attr("width",e)}else if(e==s.pre+"dl_contactmap"){let e=i.contactmapWidth*l;$("#"+s.contactmapid).attr("width",e)}else if(e==s.pre+"dl_alignerrormap"){let e=i.alignerrormapWidth*l;$("#"+s.alignerrormapid).attr("width",e)}}))):(i.bRender&&($("#"+e).show(),$("#"+e+"_nb").show(),$("#"+e+"_title").html(t)),l="auto",n="auto",e===s.pre+"dl_addtrack"?n="50%":e===s.pre+"dl_2ddgm"||e===s.pre+"dl_2dctn"||e===s.pre+"dl_definedsets"?n=r:e!==s.pre+"dl_allinteraction"&&e!==s.pre+"dl_buriedarea"||(n=700,l=500),$("#"+e).width(n),$("#"+e).height(l))}}class h{constructor(e){this.icn3dui=e}setCustomDialogs(){let e=this.icn3dui;if(e.icn3d,e.bNode)return"";return""}getHtmlAlignResidueByResidue(e,t,s){let i=this.icn3dui;i.icn3d;let n="";return n+="All chains will be aligned to the first chain in the comma-separated chain IDs. Each chain ID has the form of PDBID_chain (e.g., 1HHO_A, case sensitive) or UniprotID (e.g., P69905 for AlphaFold structures).",t+=this.getMenuUrl("faq_viewstru",e.htmlCls.baseUrl+"icn3d/icn3d.html#viewstru","View structure",1,2),t+=this.getMenuUrl("faq_tfstru",e.htmlCls.baseUrl+"icn3d/icn3d.html#tfstru","Transform Structure",1,2),t+=this.getMenuUrl("faq_selsubset",e.htmlCls.baseUrl+"icn3d/icn3d.html#selsubset","Select Subsets",1,2),t+=this.getMenuUrl("faq_stylecolor",e.htmlCls.baseUrl+"icn3d/icn3d.html#changestylecolor","Change Style/Color",1,2),t+=this.getMenuUrl("faq_savework",e.htmlCls.baseUrl+"icn3d/icn3d.html#saveview","Save Work",1,2),t+=this.getMenuUrl("faq_showanno",e.htmlCls.baseUrl+"icn3d/icn3d.html#showanno","Show Annotations",1,2),t+=this.getMenuUrl("faq_exportanno",e.htmlCls.baseUrl+"icn3d/icn3d.html#exportanno","Export Annotations",1,2),t+=this.getMenuUrl("faq_interanal",e.htmlCls.baseUrl+"icn3d/icn3d.html#interanalysis","Interaction Analysis",1,2),t+=this.getMenuUrl("faq_mutanal",e.htmlCls.baseUrl+"icn3d/icn3d.html#mutationanalysis","Mutation Analysis",1,2),t+=this.getMenuUrl("faq_elecpot",e.htmlCls.baseUrl+"icn3d/icn3d.html#elecpot","Electrostatic Pot.",1,2),t+=this.getMenuUrl("faq_simipdb",e.htmlCls.baseUrl+"icn3d/icn3d.html#simivast","Similar PDB",1,2),t+=this.getMenuUrl("faq_simialphapdb",e.htmlCls.baseUrl+"icn3d/icn3d.html#simifoldseek","Similar AlphaFold/PDB",1,2),t+=this.getMenuUrl("faq_alnstru",e.htmlCls.baseUrl+"icn3d/icn3d.html#alignmul","Align Multiple Structures",1,2),t+=this.getMenuUrl("faq_batchanal",e.htmlCls.baseUrl+"icn3d/icn3d.html#batchanalysis","Batch Analysis",1,2),t+=this.getMenuUrl("faq_embedicn3d",e.htmlCls.baseUrl+"icn3d/icn3d.html#embedicn3d","Embed iCn3D",1,2),t+="
",t+="",t+=this.getMenuUrl("citing",e.htmlCls.baseUrl+"icn3d/icn3d.html#citing","Citing iCn3D",void 0,1),t+=this.getMenuText("mn6_source","Source Code",void 0,1,1),t+="",t+=this.getMenuUrl("github","https://github.com/ncbi/icn3d","GitHub (browser) "+e.htmlCls.wifiStr,1,2),t+=this.getMenuUrl("npm","https://www.npmjs.com/package/icn3d","npm (Node.js) "+e.htmlCls.wifiStr,1,2),t+=this.getMenuUrl("notebook","https://pypi.org/project/icn3dpy","Jupyter Notebook "+e.htmlCls.wifiStr,1,2),t+="
",t+="",t+=this.getMenuText("mn6_develop","Develop",void 0,void 0,1),t+="",t+=this.getMenuUrl("dev_embedicn3d2",e.htmlCls.baseUrl+"icn3d/icn3d.html#HowToUse","Embed iCn3D",void 0,2),t+=this.getMenuUrl("dev_urlpara",e.htmlCls.baseUrl+"icn3d/icn3d.html#parameters","URL Parameters",void 0,2),t+=this.getMenuUrl("dev_command",e.htmlCls.baseUrl+"icn3d/icn3d.html#commands","Commands",void 0,2),t+=this.getMenuUrl("dev_datastru",e.htmlCls.baseUrl+"icn3d/icn3d.html#datastructure","Data Structure",void 0,2),t+=this.getMenuUrl("dev_classstru",e.htmlCls.baseUrl+"icn3d/icn3d.html#classstructure","Class Structure",void 0,2),t+=this.getMenuUrl("dev_addclass",e.htmlCls.baseUrl+"icn3d/icn3d.html#addclass","Add New Classes",void 0,2),t+=this.getMenuUrl("dev_modfunc",e.htmlCls.baseUrl+"icn3d/icn3d.html#modifyfunction","Modify Functions",void 0,2),t+=this.getMenuUrl("dev_restful",e.htmlCls.baseUrl+"icn3d/icn3d.html#restfulapi","RESTful APIs",void 0,2),t+=this.getMenuUrl("dev_contributor",e.htmlCls.baseUrl+"icn3d/icn3d.html#contributors","iCn3D Contributors",void 0,2),t+="
",t+="",t+=this.getMenuUrl("helpdoc",e.htmlCls.baseUrl+"icn3d/docs/icn3d_help.html","Help Doc "+e.htmlCls.wifiStr,1,1),t+=this.getMenuSep(),t+=this.getMenuText("mn6_tfhint","Transform Hints",void 0,1,1),t+="",t+=this.getMenuText("mn6_rotate","Rotate",void 0,1,2),t+="
",t+="",t+=this.getMenuUrl("selhints",e.htmlCls.baseUrl+"icn3d/icn3d.html#selsubset","Selection Hints",void 0,1),t+=this.getMenuUrl("helpdesk","https://support.nlm.nih.gov/support/create-case/","Write to Help Desk",1,1),t+="",t+="
",t+="",t+=this.getMenuText("mn6_zoom","Zoom",void 0,1,2),t+="",t+="
",t+="",t+=this.getMenuText("mn6_translate","Translate",void 0,1,2),t+="
(Pinch & Spread)",t+="
",t+="",t+="
(Two Finger Click & Drag)
",n+="Chain IDs: "+i.htmlCls.inputTextStr+"id='"+i.pre+e+"' value='P69905,P01942,1HHO_A' size=50>
",n+='Each alignment is defined as " | "-separated residue lists in one line. "10-50" means a range of residues from 10 to 50.
",n+=i.htmlCls.buttonStr+s+"'>Align Residue by Residue
",n}addNotebookTitle(e,t,s){let i=this.icn3dui;i.icn3d;let n=' ';return s&&(n+=''),n}setDialogs(){let e=this.icn3dui,t=e.icn3d;if(e.bNode)return"";let s="";e.htmlCls.optionStr="",s+=e.htmlCls.optionStr+"'"+r+"4'>4px",s+=e.htmlCls.optionStr+"'"+r+"8' selected>8px",s+=e.htmlCls.optionStr+"'"+r+"12'>12px",s+=e.htmlCls.optionStr+"'"+r+"16'>16px",s+=e.htmlCls.optionStr+"'"+r+"24'>24px",s+=e.htmlCls.optionStr+"'"+r+"32'>32px",s+="",s+="",s+="",s+="",s+=e.htmlCls.divStr+"dl_alignment' class='"+n+"' style='background-color:white;'>",s+=this.addNotebookTitle("dl_alignment","Dynamically Calculated Symmetry using SymD"),s+=e.htmlCls.divStr+"symd_info'>",s+=e.htmlCls.divStr+"alignseqguide_wrapper'>
"+e.htmlCls.setHtmlCls.setAlignSequenceGuide()+"",s+=e.htmlCls.divStr+"dl_sequence2' class='icn3d-dl_sequence'>",s+=this.addNotebookTitle("dl_sequence2","Select Residues in Aligned Sequences"),s+="",s+="",s+=e.htmlCls.divStr+"dl_definedsets' class='"+n+"'>",s+=this.addNotebookTitle("dl_definedsets","Defined Sets"),s+=e.htmlCls.divStr+"dl_setsmenu'>",s+="Defined Sets:
",s+="
',s+="",s+=e.htmlCls.divStr+"dl_command' style='display:none;'>",s+=e.htmlCls.divStr+"dl_setoperations'>",s+="
",s+="
",s+="",s+="
",s+=e.htmlCls.setHtmlCls.setAdvanced(),s+="",s+="",s+=e.htmlCls.setHtmlCls.setAdvanced(2),s+=e.htmlCls.divStr+"dl_vastplus' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_vastplus","Please input PDB ID for VAST+"),s+="Note: VAST+ finds other macromolecular structures that have a similar biological unit. To do this, VAST+ takes into consideration the complete set of 3D domains that VAST identified within a query structure, throughout all of its component protein molecules, and finds other macromolecular structures that have a similar set of proteins/3D domains.
",s+="PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"vastpluspdbid' value='6VXX' size=8>
",s+=e.htmlCls.buttonStr+"reload_vastplus'>VAST+",s+="",s+=e.htmlCls.divStr+"dl_vast' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_vast","Pleaes input chain or PDB file for VAST"),s+="Note: VAST identifies 3D domains (substructures) within each protein structure in the Molecular Modeling Database (MMDB), and then finds other protein structures that have one or more similar 3D domains, using purely geometric criteria. You have two ways to do a VAST search.
",s+="Option 1, search with your selection (all residues are selected by default) in the loaded structures:
",s+='
",s+="Option 2, search with PDB ID and chain name:
",s+="PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"vastpdbid' value='4N7N' size=8> ",s+="Chain Name: "+e.htmlCls.inputTextStr+"id='"+e.pre+"vastchainid' value='A' size=8>
",s+=e.htmlCls.buttonStr+"reload_vast'>VAST
",s+="Option 3, search with a PDB file:
",s+='
",s+="",s+=e.htmlCls.divStr+"dl_foldseek' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_foldseek","Submit your selection to Foldseek"),s+='1. your selection (all residues are selected by default) in the loaded structures to Foldseek web server.
',s+='2 (Optional). Once you see the structure neighbors, you can view the alignment in iCn3D by inputing a list of PDB chain IDs or AlphaFold UniProt IDs below.
The PDB chain IDs are the same as the record names such as "1HHO_A". The UniProt ID is the text between "AF-" and "-F1". For example, the UniProt ID for the record name "AF-P69905-F1-model_v4" is "P69905".
',s+="Chain ID List: "+e.htmlCls.inputTextStr+"id='"+e.pre+"foldseekchainids' value='P69905,P01942,1HHO_A' size=30> ",s+=e.htmlCls.buttonStr+"reload_foldseek'>Align",s+="",s+=e.htmlCls.divStr+"dl_mmtfid' class='"+n+"'>",s+=this.addNotebookTitle("dl_mmtfid","Please input an MMTF ID"),s+="MMTF ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"mmtfid' value='1TUP' size=8> ",s+=e.htmlCls.buttonStr+"reload_mmtf'>Load",s+="",s+=e.htmlCls.divStr+"dl_pdbid' class='"+n+"'>",s+=this.addNotebookTitle("dl_pdbid","Please input a PDB ID"),s+="PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"pdbid' value='1TUP' size=8> ",s+=e.htmlCls.buttonStr+"reload_pdb'>Load",s+="",s+=e.htmlCls.divStr+"dl_afid' class='"+n+"'>",s+=this.addNotebookTitle("dl_afid","Please input an AlphaFold UniProt ID"),s+="Note: AlphaFold produces a per-residue confidence score (pLDDT) between 0 and 100:
",s+=e.htmlCls.clickMenuCls.setAlphaFoldLegend()+"
";let o=e.cfg.afid?e.cfg.afid:"A4D1S0";s+="AlphaFold Uniprot ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"afid' value='"+o+"' size=10>
",s+=e.htmlCls.buttonStr+"reload_af'>Load Structure
",s+="PAE Map: "+e.htmlCls.buttonStr+"reload_afmap'>Load Half"+e.htmlCls.buttonStr+"reload_afmapfull' style='margin-left:30px'>Load Full (slow)",s+="",s+=e.htmlCls.divStr+"dl_refseqid' class='"+n+"'>",s+=this.addNotebookTitle("dl_refseqid","Please input an NCBI protein accession"),s+="NCBI Protein Accession: "+e.htmlCls.inputTextStr+"id='"+e.pre+"refseqid' value='NP_001743.1' size=8> ",s+=e.htmlCls.buttonStr+"reload_refseq'>Load",s+="",s+=e.htmlCls.divStr+"dl_opmid' class='"+n+"'>",s+=this.addNotebookTitle("dl_opmid","Please input an OPM PDB ID"),s+="Orientations of Proteins in Membranes(OPM) PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"opmid' value='6JXR' size=8> ",s+=e.htmlCls.buttonStr+"reload_opm'>Load",s+="",s+=e.htmlCls.divStr+"dl_pdbfile' class='"+n+"'>",s+=this.addNotebookTitle("dl_pdbfile","Please input a PDB file"),s+='Note: Several PDB files could be concatenated into a single PDB file. Use the line "ENDMDL" to separate PDB files.
',s+="PDB File: "+e.htmlCls.inputFileStr+" id='"+e.pre+"pdbfile' size=8> ",s+=e.htmlCls.buttonStr+"reload_pdbfile'>Load",s+="",s+=e.htmlCls.divStr+"dl_pdbfile_app' class='"+n+"'>",s+=this.addNotebookTitle("dl_pdbfile_app","Please append PDB files"),s+="Multiple PDB Files: ",s+=e.htmlCls.buttonStr+"reload_pdbfile_app'>Append",s+="",s+=e.htmlCls.divStr+"dl_rescolorfile' class='"+n+"'>",s+=this.addNotebookTitle("dl_rescolorfile","Please input a residue color file"),s+='
',s+='{"ALA":"#C8C8C8", "ARG":"#145AFF", ..., "G":"#008000", "A":"#6080FF", ...}
',s+="Residue Color File: "+e.htmlCls.inputFileStr+"id='"+e.pre+"rescolorfile' size=8> ",s+=e.htmlCls.buttonStr+"reload_rescolorfile'>Load",s+="",s+=e.htmlCls.divStr+"dl_customcolor' class='"+n+"'>",s+=this.addNotebookTitle("dl_customcolor","Please input a custom color file"),s+=" ",s+='
',s+="Custom File: "+e.htmlCls.inputFileStr+"id='"+e.pre+"cstcolorfile' size=8>
",s+="1. "+e.htmlCls.buttonStr+"reload_customcolorfile'>Apply Custom Color"+e.htmlCls.buttonStr+"remove_legend' style='margin-left:30px;'>Remove Legend
",s+="Score to Color: 0:
",s+="or
",s+="2. "+e.htmlCls.buttonStr+"reload_customtubefile'>Apply Custom Tube",s+="",s+=e.htmlCls.divStr+"dl_customref' class='"+n+"'>",s+=this.addNotebookTitle("dl_customref","Please input a reference number file"),s+='
',s+="refnum,11,12,,21,22,,10C,11C,20C
",s+="1TUP_C,,,,,,,200,201,230",s+='The first row defines the reference residue numbers, which could be any strings. The 1st cell could be anything. The rest cells are reference residue numbers (e.g., 11, 21, 10C, etc.) 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 fourth row shows another set of reference numners for the chain "1TUP_C". It could be a chain from a different structure.
",s+="1TUP_A,100,101,,,132,,,,
",s+="1TUP_B,110,111,,141,142,,,,
',s+='To select all residues corresponding to the reference numbers, you can simplay replace ":" with "%" in the Specification. 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.
',s+="
",s+="Custom File: "+e.htmlCls.inputFileStr+"id='"+e.pre+"cstreffile' size=8>
",s+=e.htmlCls.buttonStr+"reload_customreffile'>Apply Custom Reference Numbers",s+="",s+=e.htmlCls.divStr+"dl_align' class='"+n+"'>",s+=this.addNotebookTitle("dl_align","Please select residues in aligned sequences"),s+="Enter the PDB IDs or MMDB IDs of the structures:
ID1: "+e.htmlCls.inputTextStr+"id='"+e.pre+"alignid1' value='2DN3' size=8>"+e.htmlCls.space3+e.htmlCls.space3+"ID2: "+e.htmlCls.inputTextStr+"id='"+e.pre+"alignid2' value='4N7N' size=8>
",s+="VAST+ based on VAST: "+e.htmlCls.buttonStr+"reload_align_ori'>All Matching Molecules Superposed"+e.htmlCls.space3+e.htmlCls.buttonStr+"reload_align_refined'>Invariant Substructure Superposed
",s+="VAST+ based on TM-align: "+e.htmlCls.buttonStr+"reload_align_tmalign'>All Matching Molecules Superposed
",s+="",s+=e.htmlCls.divStr+"dl_alignaf' class='"+n+"'>",s+=this.addNotebookTitle("dl_alignaf","Align AlphaFold structures"),s+="Enter two AlphaFold Uniprot IDs:
ID1: "+e.htmlCls.inputTextStr+"id='"+e.pre+"alignafid1' value='P41327' size=8>"+e.htmlCls.space3+e.htmlCls.space3+"ID2: "+e.htmlCls.inputTextStr+"id='"+e.pre+"alignafid2' value='P41331' size=8>
",s+=e.htmlCls.buttonStr+"reload_alignaf_tmalign'>Align with TM-align"+e.htmlCls.buttonStr+"reload_alignaf' style='margin-left:30px'>Align with VAST",s+="",s+=e.htmlCls.divStr+"dl_chainalign' class='"+n+"'>",s+=this.addNotebookTitle("dl_chainalign","Align chains"),s+="
",s+="Chain IDs: "+e.htmlCls.inputTextStr+"id='"+e.pre+"chainalignids' value='P69905,P01942,1HHO_A' size=50>
",s+=e.htmlCls.buttonStr+"reload_chainalign_tmalign'>Align with TM-align"+e.htmlCls.buttonStr+"reload_chainalign_asym' style='margin-left:30px'>Align with VAST
",s+='(Note: To align chains in custom PDB files, you could load them in "File > Open File > PDB Files (appendable)" and click "Analysis > Defined Sets". Finally select multiple chains in Defined Sets and click "File > Realign Selection".)
',s+="
",s+="Chain IDs: "+e.htmlCls.inputTextStr+"id='"+e.pre+"chainalignids2' value='P69905,P01942,1HHO_A' size=50>
",s+="The sequence alignment (followed by structure alignemnt) is based on residue numbers in the First/Master chain:
"+e.htmlCls.inputTextStr+"id='"+e.pre+"resalignids' value='1,5,10-50' size=50>
",s+=e.htmlCls.buttonStr+"reload_chainalign_asym2' style='margin-top:3px;'>Align by Sequence Alignment
",s+='(Note: To align chains in custom PDB files, you could load them in "File > Open File > PDB Files (appendable)" and click "Analysis > Defined Sets". Finally select multiple chains in Defined Sets and click "File > Realign Selection".)
',s+="
",s+="Option 2:
",s+="
If you load a custom structure without PDB or UniProt ID, you can open "Seq. & Annotations" window and find the chain ID such as "stru_A". The part before the underscore is the structure ID, which can be used to specify the mutation such as "stru_A_...". Remember to choose "Show Mutation in: Current Page".
',s+="
",s+="ID Type: ",s+='PDB ID',s+='AlphaFold UniProt ID
',s+="Show Mutation in: ",s+='Current Page',s+='New Page
',s+=e.htmlCls.buttonStr+"reload_mutation_3d' title='Show the mutations in 3D using the scap program'>3D with scap",s+=e.htmlCls.buttonStr+"reload_mutation_inter' style='margin-left:20px' title='Show the mutations in 3D and the change of interactions'>Interactions",s+=e.htmlCls.buttonStr+"reload_mutation_pdb' style='margin-left:20px' title='Show the mutations in 3D and export the PDB of the mutant within 10 angstrom'>PDB",s+="
",s+=e.htmlCls.buttonStr+"reload_afmapfile'>Load Half PAE Map"+e.htmlCls.buttonStr+"reload_afmapfilefull' style='margin-left:30px'>Load Full PAE Map (slow)",s+="",s+=e.htmlCls.divStr+"dl_urlfile' class='"+n+"'>",s+=this.addNotebookTitle("dl_urlfile","Please input a file via URL"),s+="File type: ",s+="
",s+="URL in the same host: "+e.htmlCls.inputTextStr+"id='"+e.pre+"urlfile' size=20>
",s+=e.htmlCls.buttonStr+"reload_urlfile'>Load",s+="",s+=e.htmlCls.divStr+"dl_mmciffile' class='"+n+"'>",s+=this.addNotebookTitle("dl_mmciffile","Please input an mmCIF file"),s+="mmCIF File: "+e.htmlCls.inputFileStr+"id='"+e.pre+"mmciffile' value='1TUP' size=8> ",s+=e.htmlCls.buttonStr+"reload_mmciffile'>Load",s+="",s+=e.htmlCls.divStr+"dl_mmcifid' class='"+n+"'>",s+=this.addNotebookTitle("dl_mmcifid","Please input an mmCIF ID"),s+="mmCIF ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"mmcifid' value='1TUP' size=8> ",s+=e.htmlCls.buttonStr+"reload_mmcif'>Load",s+="",s+=e.htmlCls.divStr+"dl_mmdbid' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_mmdbid","Please input an MMDB ID"),s+="MMDB or PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"mmdbid' value='1TUP' size=8>
",s+=e.htmlCls.buttonStr+"reload_mmdb'>Load Biological Unit"+e.htmlCls.buttonStr+"reload_mmdb_asym' style='margin-left:30px'>Load Asymmetric Unit (All Chains)
",s+='Note: The "biological unit" is the biochemically active form of a biomolecule,
The "asymmetric unit" is the raw 3D structure data resolved by X-ray crystallography, NMR, or Cryo-electron microscopy. The asymmetric unit is equivalent to the biological unit in approximately 60% of structure records. In the remaining 40% of the records, the asymmetric unit represents a portion of the biological unit that can be reconstructed using crystallographic symmetry, or it represents multiple copies of the biological unit.',s+="",s+=e.htmlCls.divStr+"dl_mmdbafid' class='"+n+"' style='max-width:600px'>",s+=this.addNotebookTitle("dl_mmdbafid","Please input a list of PDB/AlphaFold IDs"),s+="List of PDB, MMDB, or AlphaFold UniProt structures: "+e.htmlCls.inputTextStr+"id='"+e.pre+"mmdbafid' placeholder='e.g., 1HHO,4N7N,P69905,P01942' size=30>
",s+=""+e.htmlCls.buttonStr+"reload_mmdbaf' style='width:150px'>Load Biological Unit"+e.htmlCls.buttonStr+"reload_mmdbaf_asym' style='margin-left:30px; width:250px'>Load Asymmetric Unit (All Chains)
",s+="
",s+='Note: The "biological unit" is the biochemically active form of a biomolecule,
The "asymmetric unit" is the raw 3D structure data resolved by X-ray crystallography, NMR, or Cryo-electron microscopy. The asymmetric unit is equivalent to the biological unit in approximately 60% of structure records. In the remaining 40% of the records, the asymmetric unit represents a portion of the biological unit that can be reconstructed using crystallographic symmetry, or it represents multiple copies of the biological unit.',s+="",s+=e.htmlCls.divStr+"dl_blast_rep_id' style='max-width:600px;' class='"+n+"'>",s+=this.addNotebookTitle("dl_blast_rep_id","Align sequence to structure"),s+="Enter a Sequence ID (or FASTA sequence) and the aligned protein accession, which can be found using the BLAST search with the Sequence ID or FASTA sequence as input. If the protein accession is not a PDB chain, the corresponding AlphaFold UniProt structure is used.
",s+="Sequence ID(NCBI protein accession of a sequence): "+e.htmlCls.inputTextStr+"id='"+e.pre+"query_id' value='NP_001108451.1' size=8>
",s+="or FASTA sequence:
",s+="NCBI protein accession (or a chain of a PDB): "+e.htmlCls.inputTextStr+"id='"+e.pre+"blast_rep_id' value='1TSR_A' size=8>
",s+=e.htmlCls.buttonStr+"reload_blast_rep_id'>Align with BLAST "+e.htmlCls.wifiStr+e.htmlCls.buttonStr+"reload_alignsw' style='margin-left:30px'>Align with Global Smith-Waterman"+e.htmlCls.buttonStr+"reload_alignswlocal' style='margin-left:30px'>Align with Local Smith-Waterman",s+="",s+=e.htmlCls.divStr+"dl_esmfold' style='max-width:600px;' class='"+n+"'>",s+=this.addNotebookTitle("dl_esmfold","Sequence to structure prediction with ESMFold"),s+="The sequence to structure prediction is done via ESM Metagenomic Atlas. The sequence should be less than 400 characters. For any sequence longer than 400, please see the discussion here.
",s+="FASTA sequence:
",s+=e.htmlCls.buttonStr+"run_esmfold'>ESMFold ",s+="",s+=e.htmlCls.divStr+"dl_yournote' class='"+n+"'>",s+=this.addNotebookTitle("dl_yournote","Your Note"),s+='Your note will be saved in the HTML file when you click "File > Save File > iCn3D PNG Image".
',s+="
",s+=e.htmlCls.buttonStr+"applyyournote'>Save",s+="",s+=e.htmlCls.divStr+"dl_proteinname' class='"+n+"'>",s+=this.addNotebookTitle("dl_proteinname","Please input a protein/gene name"),s+="Protein/Gene name: "+e.htmlCls.inputTextStr+"id='"+e.pre+"proteinname' value='TP53' size=8> ",s+=e.htmlCls.buttonStr+"reload_proteinname'>Search",s+="",s+=e.htmlCls.divStr+"dl_cid' class='"+n+"'>",s+=this.addNotebookTitle("dl_cid","Please input a PubChem CID"),s+="PubChem CID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"cid' value='2244' size=8> ",s+=e.htmlCls.buttonStr+"reload_cid'>Load",s+="",s+=e.htmlCls.divStr+"dl_pngimage' class='"+n+"'>",s+=this.addNotebookTitle("dl_pngimage","Please input an iCn3D PNG Image file"),s+="iCn3D PNG image: "+e.htmlCls.inputFileStr+"id='"+e.pre+"pngimage'>
",s+=e.htmlCls.buttonStr+"reload_pngimage' style='margin-top: 6px;'>Load",s+="",s+=e.htmlCls.divStr+"dl_state' class='"+n+"'>",s+=this.addNotebookTitle("dl_state","Please input a state file"),s+="State file: "+e.htmlCls.inputFileStr+"id='"+e.pre+"state'>
",s+=e.htmlCls.buttonStr+"reload_state' style='margin-top: 6px;'>Load",s+="",s+=e.htmlCls.divStr+"dl_fixedversion' style='max-width:500px' class='"+n+"'>",s+=this.addNotebookTitle("dl_fixedversion","Use fixed version of iCn3D"),s+='Since January 6, 2021, you can show the original view with the archived version of iCn3D by pasting your URL below and click "Show Originial View". Note the version in the parameter "v" was used to replace "full.html" with "full_[v].html" in the URL.
',s+="Share Link URL: "+e.htmlCls.inputTextStr+"id='"+e.pre+"sharelinkurl' size=60>
",s+=e.htmlCls.buttonStr+"reload_fixedversion'>Show Original View
",s+="",s+=e.htmlCls.divStr+"dl_selection' class='"+n+"'>",s+=this.addNotebookTitle("dl_selection","Load a selection file"),s+="Selection file: "+e.htmlCls.inputFileStr+"id='"+e.pre+"selectionfile'>
",s+=e.htmlCls.buttonStr+"reload_selectionfile' style='margin-top: 6px;'>Load",s+="",s+=e.htmlCls.divStr+"dl_menuloadpref' class='"+n+"'>",s+=this.addNotebookTitle("dl_menuloadpref","Load a preference file"),s+="Preference file: "+e.htmlCls.inputFileStr+"id='"+e.pre+"menupreffile'>
",s+=e.htmlCls.buttonStr+"reload_menupreffile' style='margin-top: 6px;'>Load",s+="",s+=e.htmlCls.divStr+"dl_dsn6' class='"+n+"'>",s+=this.addNotebookTitle("dl_dsn6","Load a DSN6 file"),s+="Note: Always load a PDB file before loading DSN6 files.
",s+="2fofc contour at:
",s+=e.htmlCls.inputFileStr+"id='"+e.pre+"dsn6file2fofc'> "+e.htmlCls.buttonStr+"reload_dsn6file2fofc' style='margin-top: 6px;'>Load
",s+="fofc contour at:
",s+=e.htmlCls.inputFileStr+"id='"+e.pre+"dsn6filefofc'> "+e.htmlCls.buttonStr+"reload_dsn6filefofc' style='margin-top: 6px;'>Load
",s+=e.htmlCls.buttonStr+"elecmapNo4'>Remove Map
",s+="",s+=e.htmlCls.divStr+"dl_dsn6url' class='"+n+"'>",s+=this.addNotebookTitle("dl_dsn6url","Load a selection file via a URL"),s+="Note: Always load a PDB file before loading DSN6 files.
",s+="2fofc contour at:
",s+="URL in the same host: "+e.htmlCls.inputTextStr+"id='"+e.pre+"dsn6fileurl2fofc' size=20>"+e.htmlCls.space3+e.htmlCls.buttonStr+"reload_dsn6fileurl2fofc' style='margin-top: 6px;'>Load
",s+="fofc contour at:
",s+="URL in the same host: "+e.htmlCls.inputTextStr+"id='"+e.pre+"dsn6fileurlfofc' size=20>"+e.htmlCls.space3+e.htmlCls.buttonStr+"reload_dsn6fileurlfofc' style='margin-top: 6px;'>Load
",s+=e.htmlCls.buttonStr+"elecmapNo5'>Remove Map
",s+="",s+=e.htmlCls.divStr+"dl_clr' class='"+n+"'>",s+=this.addNotebookTitle("dl_clr","Pick a color"),s+="Click in the input box to use the color picker:
",s+="Custom Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"colorcustom' value='FF0000' size=8> ",s+=e.htmlCls.buttonStr+"applycustomcolor'>Apply",s+="",s+=e.htmlCls.setHtmlCls.getPotentialHtml("delphi",n),s+=e.htmlCls.setHtmlCls.getPotentialHtml("local",n),s+=e.htmlCls.setHtmlCls.getPotentialHtml("url",n),s+=e.htmlCls.divStr+"dl_symmetry' class='"+n+"'>
",s+=this.addNotebookTitle("dl_symmetry","Symmetry"),s+=e.htmlCls.divNowrapStr+"Symmetry:
",s+=this.addNotebookTitle("dl_symd","Dynamically symmetry calculation using SymD"),s+="",s+=e.htmlCls.divStr+"dl_contact' class='"+n+"'>",s+=this.addNotebookTitle("dl_contact","Contact Map"),s+="Distance:
",s+=""+e.htmlCls.buttonStr+"applycontactmap'>Display
",s+="",s+=e.htmlCls.divStr+"dl_hbonds' class='"+n+"'>",s+=this.addNotebookTitle("dl_hbonds","Interaction Analysis"),s+="1. Choose interaction types and their thresholds:
",s+="",s+=" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_hbond' checked>Hydrogen Bonds "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_saltbridge' checked>Salt Bridge/Ionic "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_contact' checked>Contacts/Interactions "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+="",s+=" "+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_halogen' checked>Halogen Bonds "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_pication' checked>π-Cation "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_pistacking' checked>π-Stacking "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+="
",s+="",s+=e.htmlCls.divNowrapStr+"2. Select the first set:",s+=" ",s+=e.htmlCls.divNowrapStr+"3. Select the second set:",s+="
",s+="
",s+="
",s+="
",r=': "+e.htmlCls.buttonStr+"hbondGraph'>2D Graph(Force-Directed) to show interactions with strength parameters in 0-200:",s+=' ',s+="Helix or Sheet'+r+e.pre+'dist_ss" size="4" value="100"> ',s+="Coil or Nucleotide"+r+e.pre+'dist_coil" size="4" value="50"> ',s+="Disulfide Bonds"+r+e.pre+'dist_ssbond" size="4" value="50"> ',s+="Hydrogen Bonds"+r+e.pre+'dist_hbond" size="4" value="50"> ',s+="Salt Bridge/Ionic"+r+e.pre+'dist_ionic" size="4" value="50"> ',s+="Contacts"+r+e.pre+'dist_inter" size="4" value="25"> Halogen Bonds"+r+e.pre+'dist_halogen" size="4" value="50"> ',s+="π-Cation"+r+e.pre+'dist_pication" size="4" value="50"> ',s+="π-Stacking"+r+e.pre+'dist_pistacking" size="4" value="50">
',s+="
",s+="
or use your current selection:
",s+="
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_realignbystruct' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_realignbystruct","Realign by structure"),s+="
",s+="
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_realigntwostru' class='"+n+"'>",s+=this.addNotebookTitle("dl_realigntwostru","Realign two structure complexes"),s+=e.htmlCls.divNowrapStr+"1. Select sets below or use your current selection:
",s+="
",s+="2. Overall maximum RMSD: "+e.htmlCls.inputTextStr+"id='"+e.pre+"maxrmsd' value='30' size='2'> Å
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_colorspectrumacrosssets' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorspectrumacrosssets","Set color spectrum across sets"),s+=e.htmlCls.divNowrapStr+"1. Select sets below:
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_colorspectrumbysets' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorspectrumbysets","Set color spectrum for residues in sets"),s+=e.htmlCls.divNowrapStr+"1. Select sets below:
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_colorrainbowacrosssets' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorrainbowacrosssets","Set color rainbow across sets"),s+=e.htmlCls.divNowrapStr+"1. Select sets below:
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_colorrainbowbysets' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorrainbowbysets","Set color rainbow for residues in sets"),s+=e.htmlCls.divNowrapStr+"1. Select sets below:
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_allinteraction' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_allinteraction","All interactions",!0),s+="",s+=e.htmlCls.divStr+"dl_interactionsorted' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_interactionsorted","Sorted interactions",!0),s+="",s+=e.htmlCls.divStr+"dl_linegraph' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_linegraph","2D Interaction Network"),s+=e.htmlCls.divNowrapStr+'
",e.linegraphid=e.pre+"linegraph",s+=e.htmlCls.divNowrapStr+l+e.linegraphid+'_svg">SVG'+e.htmlCls.space2,s+=l+e.linegraphid+'_png">PNG'+e.htmlCls.space2,s+=l+e.linegraphid+'_json">JSON'+e.htmlCls.space4,s+="Scale:
",s+='',s+="",s+=e.htmlCls.divStr+"dl_scatterplot' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_scatterplot","2D Interaction Map"),s+=e.htmlCls.divNowrapStr+"Hold Ctrl key to select multiple nodes."+e.htmlCls.space3,s+='
",s+='',s+="",s+=e.htmlCls.divStr+"dl_contactmap' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_contactmap","Contact Map"),s+=e.htmlCls.divNowrapStr+"Hold Ctrl key to select multiple nodes."+e.htmlCls.space3+"",e.contactmapid=e.pre+"contactmap",s+=e.htmlCls.divNowrapStr+l+e.contactmapid+'_svg">SVG'+e.htmlCls.space2,s+=l+e.contactmapid+'_png">PNG'+e.htmlCls.space2,s+=l+e.contactmapid+'_json">JSON'+e.htmlCls.space4,s+="Scale:
",s+='',s+="",s+=e.htmlCls.divStr+"dl_alignerrormap' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_alignerrormap","PAE Map"),s+=e.htmlCls.divNowrapStr+"Hold Ctrl key to select multiple nodes."+e.htmlCls.space3+"",e.alignerrormapid=e.pre+"alignerrormap",s+=e.htmlCls.divNowrapStr+l+e.alignerrormapid+'_svg">SVG'+e.htmlCls.space2,s+=l+e.alignerrormapid+'_png">PNG (slow)'+e.htmlCls.space2,s+=l+e.alignerrormapid+'_json">JSON'+e.htmlCls.space4,s+='Scale:
";s+="0 5 10 15 20 25 30 Expected position error (Angstroms)
",s+='',s+="",s+=e.htmlCls.divStr+"dl_elecmap2fofc' class='"+n+"'>",s+=this.addNotebookTitle("dl_elecmap2fofc","Electron Density 2F0-Fc Map"),s+="Contour at:
"+e.htmlCls.buttonStr+"applyemmap'>Display "+e.htmlCls.buttonStr+"emmapNo2'>Remove EM Map",s+="",s+=e.htmlCls.divStr+"dl_aroundsphere' class='"+n+"'>",s+=this.addNotebookTitle("dl_aroundsphere","Select a sphere around a set of residues"),s+=e.htmlCls.divNowrapStr+"1. Select the first set:",s+="
",s+=e.htmlCls.divNowrapStr+"2. Sphere with a radius: "+e.htmlCls.inputTextStr+"id='"+e.pre+"radius_aroundsphere' value='4' size='2'> Å
",s+=e.htmlCls.divNowrapStr+"3. Select the second set to apply the sphere:",s+="
",s+=e.htmlCls.divNowrapStr+"4. "+e.htmlCls.buttonStr+"applypick_aroundsphere'>Display the sphere around the first set of atoms
",s+="
",s+=e.htmlCls.divNowrapStr+"1. Extracellular membrane Z-axis position: "+e.htmlCls.inputTextStr+"id='"+e.pre+"extra_mem_z' value='' size='3'> Å
",s+=e.htmlCls.divNowrapStr+"2. intracellular membrane Z-axis position: "+e.htmlCls.inputTextStr+"id='"+e.pre+"intra_mem_z' value='' size='3'> Å
",s+=e.htmlCls.divNowrapStr+"3. "+e.htmlCls.buttonStr+"apply_adjustmem'>Display the adjusted membranes
",s+="",s+=e.htmlCls.divStr+"dl_selectplane' class='"+n+"'>",s+=this.addNotebookTitle("dl_selectplane","Select a plane"),s+="Note: The membranes are parallel to the X-Y plane. The center of the membranes is at Z = 0.
",s+=e.htmlCls.divNowrapStr+"1. Z-axis position of the first X-Y plane: "+e.htmlCls.inputTextStr+"id='"+e.pre+"selectplane_z1' value='15' size='3'> Å
",s+=e.htmlCls.divNowrapStr+"2. Z-axis position of the second X-Y plane: "+e.htmlCls.inputTextStr+"id='"+e.pre+"selectplane_z2' value='-15' size='3'> Å
",s+=e.htmlCls.divNowrapStr+"3. "+e.htmlCls.buttonStr+"apply_selectplane'>Save the region between the planes to Defined Sets
",s+="",s+=e.htmlCls.divStr+"dl_addlabel' class='"+n+"'>",s+=this.addNotebookTitle("dl_addlabel","Add labels between two atoms"),s+="1. Text: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labeltext' value='Text' size=4>
",s+="2. Size: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelsize' value='18' size=4 maxlength=2>
",s+="3. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelcolor' value='"+"#ffff00' size=4>
",e.utilsCls.isMobile()?s+=e.htmlCls.spanNowrapStr+"4. Touch TWO atoms
":s+=e.htmlCls.spanNowrapStr+'4. Pick TWO atoms while holding "Alt" key
',s+=e.htmlCls.spanNowrapStr+"5. "+e.htmlCls.buttonStr+"applypick_labels'>Display",s+="",s+=e.htmlCls.divStr+"dl_addlabelselection' class='"+n+"'>",s+=this.addNotebookTitle("dl_addlabelselection","Add labels for your selection"),s+="1. Text: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labeltext2' value='Text' size=4>
",s+="2. Size: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelsize2' value='18' size=4 maxlength=2>
",s+="3. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelcolor2' value='"+"#ffff00' size=4>
",s+=e.htmlCls.spanNowrapStr+"4. "+e.htmlCls.buttonStr+"applyselection_labels'>Display",s+="",s+=e.htmlCls.divStr+"dl_labelColor' class='"+n+"'>",s+=this.addNotebookTitle("dl_labelColor","Change label color"),s+="Color for all labels: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelcolorall' value='"+"#ffff00' size=4>
",s+=e.htmlCls.spanNowrapStr+e.htmlCls.buttonStr+"applylabelcolor'>Display",s+="",s+=e.htmlCls.divStr+"dl_distance' class='"+n+"'>",s+=this.addNotebookTitle("dl_distance","Measure distance"),e.utilsCls.isMobile()?s+=e.htmlCls.spanNowrapStr+"1. Touch TWO atoms
":s+=e.htmlCls.spanNowrapStr+'1. Pick TWO atoms while holding "Alt" key
',s+=e.htmlCls.spanNowrapStr+"2. Line Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"distancecolor' value='"+"#ffff00' size=4>
",s+=e.htmlCls.spanNowrapStr+"3. "+e.htmlCls.buttonStr+"applypick_measuredistance'>Display",s+="",s+=e.htmlCls.divStr+"dl_stabilizer' class='"+n+"'>",s+=this.addNotebookTitle("dl_stabilizer","Add a stabilizer"),e.utilsCls.isMobile()?s+=e.htmlCls.spanNowrapStr+"1. Touch TWO atoms
":s+=e.htmlCls.spanNowrapStr+'1. Pick TWO atoms while holding "Alt" key
',s+=e.htmlCls.spanNowrapStr+"2. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"stabilizercolor' value='ffffff' size=4>
",s+=e.htmlCls.spanNowrapStr+"3. "+e.htmlCls.buttonStr+"applypick_stabilizer'>Add",s+="",s+=e.htmlCls.divStr+"dl_disttwosets' class='"+n+"'>",s+=this.addNotebookTitle("dl_disttwosets","Measure the distance between two sets"),s+=e.htmlCls.spanNowrapStr+"1. Select two sets
",s+="
",s+=e.htmlCls.spanNowrapStr+"2. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"distancecolor2' value='"+"#ffff00' size=4>",s+=e.htmlCls.divNowrapStr+"First set:",s+=" ",s+=e.htmlCls.divNowrapStr+"Second set:",s+="
",s+=e.htmlCls.spanNowrapStr+"3. "+e.htmlCls.buttonStr+"applydist2'>Display",s+="",s+=e.htmlCls.divStr+"dl_linebtwsets' class='"+n+"'>",s+=this.addNotebookTitle("dl_linebtwsets","Add a line between two sets"),s+=e.htmlCls.spanNowrapStr+"1. Select two sets
",s+="
",s+=e.htmlCls.divNowrapStr+"2. Line style: ",s+=e.htmlCls.divNowrapStr+"First set:",s+=" ",s+=e.htmlCls.divNowrapStr+"Second set:",s+="
",s+="3. Line radius: "+e.htmlCls.inputTextStr+"id='"+e.pre+"linebtwsets_radius' value='0.4' size=4>
",s+="4. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"linebtwsets_customcolor' value='"+"#ffff00' size=4>
",s+=e.htmlCls.divNowrapStr+"5. Opacity:
",s+=e.htmlCls.spanNowrapStr+"6. "+e.htmlCls.buttonStr+"applylinebtwsets'>Display",s+=e.htmlCls.space3+e.htmlCls.spanNowrapStr+e.htmlCls.buttonStr+"clearlinebtwsets'>Clear",s+="",s+=e.htmlCls.divStr+"dl_cartoonshape' class='"+n+"'>",s+=this.addNotebookTitle("dl_cartoonshape","Cartoon Shape"),s+=e.htmlCls.spanNowrapStr+"1. Select a set:
",s+="
",s+=e.htmlCls.divNowrapStr+"2. Shape:
",s+="3. Radius: "+e.htmlCls.inputTextStr+"id='"+e.pre+"cartoonshape_radius' value='1.5' size=4>
",s+="4. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"cartoonshape_customcolor' value='"+"#ffff00' size=4>
",s+=e.htmlCls.divNowrapStr+"5. Opacity:
",s+=e.htmlCls.spanNowrapStr+"6. "+e.htmlCls.buttonStr+"applycartoonshape'>Display",s+=e.htmlCls.space3+e.htmlCls.spanNowrapStr+e.htmlCls.buttonStr+"clearcartoonshape'>Clear",s+="",s+=e.htmlCls.divStr+"dl_distmanysets' class='"+n+"'>",s+=this.addNotebookTitle("dl_distmanysets","Measure distances among many sets"),s+=e.htmlCls.spanNowrapStr+"1. Select sets for pairwise distances
",s+="
",s+=e.htmlCls.spanNowrapStr+"2. "+e.htmlCls.buttonStr+"applydisttable'>Distances in Table",s+="",s+=e.htmlCls.divStr+"dl_stabilizer_rm' class='"+n+"'>",s+=this.addNotebookTitle("dl_stabilizer_rm","Remove a stabilizer"),e.utilsCls.isMobile()?s+=e.htmlCls.spanNowrapStr+"1. Touch TWO atoms",s+=e.htmlCls.divNowrapStr+"First sets:",s+=" ",s+=e.htmlCls.divNowrapStr+"Second sets:",s+="
":s+=e.htmlCls.spanNowrapStr+'1. Pick TWO atoms while holding "Alt" key
',s+=e.htmlCls.spanNowrapStr+"2. "+e.htmlCls.buttonStr+"applypick_stabilizer_rm'>Remove",s+="",s+=e.htmlCls.divStr+"dl_thickness' class='"+n+"'>",s+=this.addNotebookTitle("dl_thickness","Set thickness"),s+=e.htmlCls.setHtmlCls.setThicknessHtml("3dprint"),s+="",s+=e.htmlCls.divStr+"dl_thickness2' class='"+n+"'>",s+=this.addNotebookTitle("dl_thickness2","Set thickness"),s+=e.htmlCls.setHtmlCls.setThicknessHtml("style"),s+="",s+=e.htmlCls.divStr+"dl_menupref' class='"+n+"'>",s+=this.addNotebookTitle("dl_menupref","Preferences for menus"),s+="Note: The following parameters will be saved in cache. You just need to set them once.
",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"apply_menupref'>Apply",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"reset_menupref' style='margin-left:30px'>Reset to Simple Menus",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"reset_menupref_all' style='margin-left:30px'>Reset to All Menus",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"savepref' style='margin-left:30px'>Save Preferences
",s+="
",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"apply_menupref2'>Apply",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"reset_menupref2' style='margin-left:30px'>Reset to Simple Menus",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"reset_menupref_all2' style='margin-left:30px'>Reset to All Menus",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"savepref2' style='margin-left:30px'>Save Preferences",s+="",s+=e.htmlCls.divStr+"dl_addtrack' class='"+n+"'>",s+=this.addNotebookTitle("dl_addtrack","Add a track"),s+=" ",s+=e.htmlCls.divStr+"dl_addtrack_tabs' style='border:0px;'>",s+="",s+="
",s+=e.htmlCls.divStr+"tracktab1'>",s+="NCBI gi/Accession: "+e.htmlCls.inputTextStr+"id='"+e.pre+"track_gi' placeholder='gi' size=16>
",s+=e.htmlCls.buttonStr+"addtrack_button1'>Add Track",s+="",s+=e.htmlCls.divStr+"tracktab2'>",s+="FASTA Title: "+e.htmlCls.inputTextStr+"id='"+e.pre+"fasta_title' placeholder='track title' size=16>
",s+="FASTA sequence:
",s+=e.htmlCls.buttonStr+"addtrack_button2'>Add Track",s+="",s+=e.htmlCls.divStr+"tracktab2b'>",s+="
",s+="Precalculated Multiple Sequence Alignment (MSA):
",s+="
",s+="Position of the first residue in Sequences & Annotations window: "+e.htmlCls.inputTextStr+"id='"+e.pre+"fasta_startpos' value='1' size=2>
",s+="Color Sequence by:
",s+=e.htmlCls.buttonStr+"addtrack_button2b'>Add Track(s)",s+="",s+=e.htmlCls.divStr+"tracktab2c'>",s+="
",s+="NCBI Gene ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"track_geneid' size=20>"+e.htmlCls.space3+e.htmlCls.buttonStr+"exons_table'>Exons & Introns in Gene Table
",s+="Position of the first residue in Sequences & Annotations window: "+e.htmlCls.inputTextStr+"id='"+e.pre+"fasta_startpos2' value='1' size=2>
",s+=e.htmlCls.buttonStr+"addtrack_button2c'>Show Isoforms & Exons",s+="",s+=e.htmlCls.divStr+"tracktab3'>",s+="BED file: "+e.htmlCls.inputFileStr+"id='"+e.pre+"track_bed' size=16>
",s+=e.htmlCls.buttonStr+"addtrack_button3'>Add Track",s+="",s+=e.htmlCls.divStr+"tracktab4'>",s+="Track Title: "+e.htmlCls.inputTextStr+"id='"+e.pre+"track_title' placeholder='track title' size=16>
",s+='Track Text (e.g., "2 G, 5-6 RR" defines a character "G" at the position 2 and two continuous characters "RR" at positions from 5 to 6. The starting position is 1):
',s+="
",s+=e.htmlCls.buttonStr+"addtrack_button4'>Add Track",s+="",s+=e.htmlCls.divStr+"tracktab5'>",s+="Track Title: "+e.htmlCls.inputTextStr+"id='"+e.pre+"track_selection' placeholder='track title' size=16>
",s+=e.htmlCls.buttonStr+"addtrack_button5'>Add Track",s+="",s+="",s+="",s+=e.htmlCls.divStr+"dl_saveselection' class='"+n+"'>",s+=this.addNotebookTitle("dl_saveselection","Save Selection");let m=t&&t.defNames2Atoms?Object.keys(t.defNames2Atoms).length:1;s+="Name: "+e.htmlCls.inputTextStr+"id='"+e.pre+"seq_command_name' value='seq_"+m+"' size='5'>
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_copyurl' style='width:520px;' class='"+n+"'>",s+=this.addNotebookTitle("dl_copyurl","Share Link"),s+="
",s+="1. URLs Used in Browsers
",s+='Please copy one of the URLs below. They show the same result.
(To add a title to share link, click "Windows > Your Note" and click "File > Share Link" again.)
',s+="Original URL with commands:
",e.cfg.notebook||(s+="Lifelong Short URL:(To replace this URL, send a pull request to update share.html at iCn3D GitHub)
"+e.htmlCls.inputTextStr+"id='"+e.pre+"short_url' value='' style='width:100%'>
",s+='Lifelong Short URL + Window Title:(To update the window title, click "Analysis > Your Note/Window Title".)
'+e.htmlCls.inputTextStr+"id='"+e.pre+"short_url_title' value='' style='width:100%'>
"),s+="2. Commands Used in Jupyter Noteboook
",s+="Please copy the following commands into a cell in Jupyter Notebook to show the same result.
More details are at https://github.com/ncbi/icn3d/tree/master/jupyternotebook.
",s+='
',s+=l+e.pre+'jn_copy">Copy Commands
',s+="",s+=e.htmlCls.divStr+"dl_selectannotations' class='"+n+" icn3d-annotation' style='background-color:white;'>",s+=this.addNotebookTitle("dl_selectannotations","Sequences & Annotations"),s+=e.htmlCls.divStr+"dl_annotations_tabs'>",s+=e.htmlCls.divStr+"dl_anno_view_tabs' style='border:0px; height:33px;'>",s+="",s+=e.htmlCls.divStr+"anno_tmp1'>",s+="",s+=e.htmlCls.divStr+"anno_tmp2'>",s+="",s+="",s+=this.getAnnoHeader(),s+="
",s+=e.htmlCls.divStr+"seqguide_wrapper' style='display:none'>
"+e.htmlCls.setHtmlCls.setSequenceGuide("2")+"",s+="
",s+=e.htmlCls.divStr+"dl_annotations'>",s+="",s+="",s+=e.htmlCls.divStr+"dl_graph' style='background-color:white;' class='"+n+"'>",s+=this.addNotebookTitle("dl_graph","Interactions"),e.svgid=e.pre+"icn3d_viz",s+="",s+=e.htmlCls.divNowrapStr+"Zoom: mouse wheel; "+e.htmlCls.space3+" Move: left button; "+e.htmlCls.space3+" Select Multiple Nodes: Ctrl Key and drag an Area"+e.htmlCls.space3,s+='
",s+='(0-20% out is considered "in". 50-100% out is considered "out".)
',s+="Toal: "+e.htmlCls.inputTextStr+"id='"+e.pre+"areavalue' value='' size='10'> Å2
",s+="",s+="",s+=e.htmlCls.divStr+"dl_colorbyarea' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorbyarea","Color by surface area"),s+="
",s+="Middle Percentage(White): "+e.htmlCls.inputTextStr+"id='"+e.pre+"midpercent' value='35' size='10'>%
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_rmsd' class='"+n+"' style='max-width:300px'>",s+=this.addNotebookTitle("dl_rmsd","RMSD",!0),s+="",s+=e.htmlCls.divStr+"dl_buriedarea' class='"+n+"'>",s+=this.addNotebookTitle("dl_buriedarea","Buried surface area",!0),s+="",s+=e.htmlCls.divStr+"dl_propbypercentout' class='"+n+"'>",s+=this.addNotebookTitle("dl_propbypercentout","Select residues basen on solvent accessilbe surface area"),s+="
",s+="Min Percentage: "+e.htmlCls.inputTextStr+"id='"+e.pre+"minpercentout' value='0' size='10'>%
",s+="Max Percentage: "+e.htmlCls.inputTextStr+"id='"+e.pre+"maxpercentout' value='100' size='10'>%
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_propbybfactor' class='"+n+"'>",s+=this.addNotebookTitle("dl_propbybfactor","Select residues basen on B-factor/pLDDT"),s+="
",s+="Min B-factor/pLDDT: "+e.htmlCls.inputTextStr+"id='"+e.pre+"minbfactor' value='0' size='10'>%
",s+="Max B-factor/pLDDT: "+e.htmlCls.inputTextStr+"id='"+e.pre+"maxbfactor' value='100' size='10'>%
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_legend' class='"+n+"' style='max-width:500px; background-color:white'>",s+=this.addNotebookTitle("dl_legend","Legend",!0),s+="",s+=e.htmlCls.divStr+"dl_disttable' class='"+n+"'>",s+=this.addNotebookTitle("dl_disttable","Distance Table",!0),s+="",s+=e.htmlCls.divStr+"dl_igrefTpl' class='"+n+"'>",s+=this.addNotebookTitle("dl_igrefTpl","Choose an Ig template"),s+="Choose an Ig template for selected residues:
"+e.htmlCls.buttonStr+"mn6_igrefTpl_apply'>Show Ig Ref. Number",s+="",s+="",s+="\x3c!--/form--\x3e",s}getAnnoHeader(){let e=this.icn3dui;e.icn3d;let t="";t+="
",t+="";let s=" ",i=" ";return t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_all'>All"+e.htmlCls.space2+" ",t+=i+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_cdd' checked>Conserved Domains"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_clinvar'>ClinVar"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_binding'>Functional Sites"+e.htmlCls.space2+"",t+="",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_custom'>Custom"+e.htmlCls.space2+"",t+=i+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_3dd'>3D Domains"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_snp'>SNPs"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_ptm'>PTM (UniProt)"+e.htmlCls.space2+"",t+=" ",t+=" ",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_ssbond'>Disulfide Bonds"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_interact'>Interactions"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_crosslink'>Cross-Linkages"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_transmem'>Transmembrane"+e.htmlCls.space2+"",t+=" ",t+=" ";for(let e=0,i=o.alnChainsAnno[l][t].length;e ':' ';else if("E"==i)if(void 0!==o.alnChainsSeq[s][e]){let i=s+"_"+o.alnChainsSeq[s][e].resi;if(o.residues.hasOwnProperty(i)){o.firstAtomObjCls.getFirstCalphaAtomObj(o.residues[i]).ssend?b[t]+=' ':b[t]+=' '}else b[t]+=' '}else b[t]+=' ';else b[t]+="c"==i?' ':"o"==i?' ':"";else b[t]+=""+i+""}b[t]+=""}let O=l,R=void 0!==o.pdbid_chain2title?o.pdbid_chain2title[u]:"";for(let e=k-1;e>=0;--e){let t=o.alnChainsAnTtl[l][e][0];"SS"==t&&(t=""),a+="
",g>0&&(f+=y),++g}return{sequencesHtml:a,maxSeqCnt:d}}}class u{constructor(e){this.icn3dui=e}getLink(e,t,s,i){let n=this.icn3dui;return n.icn3d,n.htmlCls.allMenus[e]=t,i&&(n.htmlCls.allMenusSel[e]=i),s&&(n.htmlCls.simpleMenus[e]=1),"
",n+="",n}getOptionHtml(e,t){let s=this.icn3dui;s.icn3d;let i="";for(let n=0,l=e.length;n ",n+=" ",n+="",n+="
",n+="Select: "+t.htmlCls.inputTextStr+"id='"+t.pre+"command"+s+"' placeholder='$[structures].[chains]:[residues]@[atoms]' size='60'> ",n+="Name: "+t.htmlCls.inputTextStr+"id='"+t.pre+"command_name"+s+"' placeholder='my_selection' size='60'> ",n+=""+t.htmlCls.space3+t.htmlCls.buttonStr+"command_apply"+s+"'>Save Selection to Defined Sets ",n+='Specification Tips:
',n+=t.htmlCls.divStr+"specguide"+s+"' style='display:none; width:500px' class='icn3d-box'>",n+='Specification: In the selection "$1HHO,4N7N.A,B,C:5-10,LV,3AlaVal,chemicals@CA,C,C*":',n+='
",n+="Set Operation:",n+='
',n+='
',n+='
',n+='
',n+='
',n+='
',n+='
',n+="Full commands in url or command window:",n+="
',n+='
",n+="",n+="
",n+="
",i+="1. Shininess: "+t.htmlCls.inputTextStr+"id='"+t.pre+"shininess' value='"+m+"' size=4>"+t.htmlCls.space3+"(for the shininess of the 3D objects, default 40)
",i+="2. Three directional lights:
",i+="Key Light: "+t.htmlCls.inputTextStr+"id='"+t.pre+"light1' value='"+u+"' size=4>"+t.htmlCls.space3+"(for the light strength of the key light, default 0.8)
",i+="Fill Light: "+t.htmlCls.inputTextStr+"id='"+t.pre+"light2' value='"+g+"' size=4>"+t.htmlCls.space3+"(for the light strength of the fill light, default 0.4)
",i+="Back Light: "+t.htmlCls.inputTextStr+"id='"+t.pre+"light3' value='"+f+"' size=4>"+t.htmlCls.space3+"(for the light strength of the back light, default 0.2)
",i+="3. Thickness:
"}return i+="Line Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"linerad_"+e+"' value='"+n+"' size=4>"+t.htmlCls.space3+"(for stabilizers, hydrogen bonds, distance lines, default 0.1)
",i+="Coil Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"coilrad_"+e+"' value='"+l+"' size=4>"+t.htmlCls.space3+"(for coils, default 0.3)
",i+="Stick Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"stickrad_"+e+"' value='"+r+"' size=4>"+t.htmlCls.space3+"(for sticks, default 0.4)
",i+="Cross-Linkage Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"crosslinkrad_"+e+"' value='"+o+"' size=4>"+t.htmlCls.space3+"(for cross-linkages, default 0.4)
",i+="Trace Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"tracerad_"+e+"' value='"+a+"' size=4>"+t.htmlCls.space3+"(for C alpha trace, O3' trace, default 0.4)
",i+="Ribbon Thickness: "+t.htmlCls.inputTextStr+"id='"+t.pre+"ribbonthick_"+e+"' value='"+c+"' size=4>"+t.htmlCls.space3+"(for helix and sheet ribbons, nucleotide ribbons, default 0.2)
",i+="Protein Ribbon Width: "+t.htmlCls.inputTextStr+"id='"+t.pre+"prtribbonwidth_"+e+"' value='"+h+"' size=4>"+t.htmlCls.space3+"(for helix and sheet ribbons, default 1.3)
",i+="Nucleotide Ribbon Width: "+t.htmlCls.inputTextStr+"id='"+t.pre+"nucleotideribbonwidth_"+e+"' value='"+p+"' size=4>"+t.htmlCls.space3+"(for nucleotide ribbons, default 0.8)
",i+="Ball Scale: "+t.htmlCls.inputTextStr+"id='"+t.pre+"ballscale_"+e+"' value='"+d+"' size=4>"+t.htmlCls.space3+"(for styles 'Ball and Stick' and 'Dot', default 0.3)
","style"==e&&(i+="
4. Show Glycan Cartoon: "+t.htmlCls.inputTextStr+"id='"+t.pre+"glycan' value='"+b+"' size=4>"+t.htmlCls.space3+"(0: hide, 1: show, default 0)
",i+="
5. Show Membrane: "+t.htmlCls.inputTextStr+"id='"+t.pre+"membrane' value='"+C+"' size=4>"+t.htmlCls.space3+"(0: hide, 1: show, default 1)
",i+="
6. Enlarge Command Window: "+t.htmlCls.inputTextStr+"id='"+t.pre+"cmdwindow' value='"+y+"' size=4>"+t.htmlCls.space3+"(0: Regular, 1: Large, default 0)
"),i+=t.htmlCls.spanNowrapStr+""+t.htmlCls.buttonStr+"apply_thickness_"+e+"'>Apply ",i+=t.htmlCls.spanNowrapStr+""+t.htmlCls.buttonStr+"reset_thickness_"+e+"'>Reset",i}getCookie(e){let t=e+"=",s=decodeURIComponent(document.cookie).split(";");for(let e=0;e
",n+=s.htmlCls.divStr+"seqguide"+e+"' style='display:none; white-space:normal;' class='icn3d-box'>"),n+=this.getSelectionHints();return n+="Residue labeling: standard residue with coordinates: UPPER case letter; nonstandard residue with coordinates: the first UPPER case letter plus a period except that water residue uses the letter 'O'; residue missing coordinates: lower case letter."+(s.utilsCls.isMac()&&!s.utilsCls.isMobile()?"
Turn on scroll bar: System preferences -> General -> show scroll bars -> check Always":"")+"
",n}setAlignSequenceGuide(e,t){let s=this.icn3dui,i=s.icn3d,n="";let l=i&&i.defNames2Atoms?Object.keys(i.defNames2Atoms).length:1;n+='
",n+=s.htmlCls.divStr+"alignseqguide' style='display:none; white-space:normal;' class='icn3d-box'>",n+=this.getSelectionHints();return n+="Residue labeling: aligned residue with coordinates: UPPER case letter; non-aligned residue with coordinates: lower case letter which can be highlighted; residue missing coordinates: lower case letter which can NOT be highlighted."+(s.utilsCls.isMac()&&!s.utilsCls.isMobile()?"
Turn on scroll bar: System preferences -> General -> show scroll bars -> check Always":"")+"
",n}getSelectionHints(){let e=this.icn3dui;e.icn3d;let t="";if(e.utilsCls.isMobile())t+='Select Aligned Sequences: touch to select, touch again to deselect, multiple selection is allowed without Ctrl key, click "Save Selection" to save the current selection.
';else{t+='Select on 1D sequences: drag to select, drag again to deselect, multiple selection is allowed without Ctrl key, click "Save Selection" to save the current selection.
',t+="Select on 2D interaction diagram: click on the nodes or lines. The nodes are chains and can be united with the Ctrl key. The lines are interactions and can NOT be united. Each click on the lines selects half of the lines, i.e., select the interacting residues in one of the two chains.
",t+="Select on 3D structures: "+(e.utilsCls.isMobile()?"use finger to pick":'hold "Alt" and use mouse to pick')+', click the second time to deselect, hold "Ctrl" to union selection, hold "Shift" to select a range, press the up/down arrow to switch among atom/residue/strand/chain/structure, click "Save Selection" to save the current selection.
',t+='Save the current selection(either on 3D structure, 2D interactions, or 1D sequence): open the menu "Select -> Save Selection", specify the name and description for the selection, and click "Save".
'}return t}addGsizeSalt(e){let t=this.icn3dui;t.icn3d;let s="";s+="Grid Size:
",s}getFootHtml(e,t){let s=this.icn3dui;s.icn3d;let i="
":(i+="Note: Only the selected residues are used for DelPhi potential calculation by solving linear Poisson-Boltzmann equation.",i+='
',i+=s.htmlCls.divStr+t+"' style='display:none;'>",i+="
The hydrogens and partial charges of proteins and nucleotides are added using DelPhiPKa with the Amber charge and size files. The hydrogens of ligands are added using Open Babel. The partial charges of ligands are calculated using Antechamber with the Gasteiger charge method. All partial charges are calculated at pH 7.
",i+='Lipids are treated as ligands. Please use "HETATM" instead of "ATOM " for each lipid atom in your PDB file. Each phosphate in lipids is assigned with a charge of -1. You can download PQR and modify it, or prepare your PQR file using other tools. Then load the PQR file at the menu "Analysis > Load PQR/Potential".
',i+="
',i+=s.htmlCls.divStr+t+"' style='display:none;'>",i+='The PDB file can be loaded in the URL with "pdbid=" or at "File > Open File". The PQR file can be prepared at the menu "Analysis > Download PQR" with your modification or using other tools. The DelPhi potential file can be calculated at DelPhi Web Server and be exported as a Cube file. ',"url"==e&&(i+="The PQR or potential file can be accessed in a URL if it is located in the same host as iCn3D."),i+="
",i+=""),i+="",i}getPotentialHtml(e,t){let s=this.icn3dui;s.icn3d;let i,n,l,r,o,a="";r="Equipotential Map",o="Surface with Potential","delphi"==e?n="delphi":"local"==e?(i="pqr",n="phi",l="cube"):"url"==e&&(i="pqrurl",n="phiurl",l="cubeurl"),a+=s.htmlCls.divStr+"dl_"+n+"' class='"+t+"'>",a+=s.htmlCls.setDialogCls.addNotebookTitle("dl_"+n,"DelPhi Potential"),a+=s.htmlCls.divStr+"dl_"+n+"_tabs' style='border:0px;'>",a+="",a+="
",a+=s.htmlCls.divStr+n+"tab1'>","delphi"==e&&(a+=this.addGsizeSalt(n+"1")+"
"),a+="Potential contour at:
","delphi"==e?(a+=s.htmlCls.buttonStr+"reload_"+n+"file' style='margin-top: 6px;'>Equipotential Map",a+=s.htmlCls.buttonStr+n+"mapNo' style='margin-left:30px;'>Remove Map
"):"local"==e?(a+=s.htmlCls.divStr+n+"tab1_tabs' style='border:0px;'>",a+="",d=""+s.htmlCls.buttonStr+n+"mapNo'>Remove Map",a+=s.htmlCls.divStr+n+"tab1_"+i+"'>",a+=this.addGsizeSalt(i)+"
",a+="PQR File: "+s.htmlCls.inputFileStr+"id='"+s.pre+i+"file'>
"+s.htmlCls.buttonStr+"reload_"+i+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=s.htmlCls.divStr+n+"tab1_"+n+"'>",a+="Phi File: "+s.htmlCls.inputFileStr+"id='"+s.pre+n+"file'>
"+s.htmlCls.buttonStr+"reload_"+n+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=s.htmlCls.divStr+n+"tab1_"+l+"'>",a+="Cube File: "+s.htmlCls.inputFileStr+"id='"+s.pre+l+"file'>
"+s.htmlCls.buttonStr+"reload_"+l+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=""):"url"==e&&(a+=s.htmlCls.divStr+n+"tab1_tabs' style='border:0px;'>",a+="",d=""+s.htmlCls.buttonStr+n+"mapNo'>Remove Map",a+=s.htmlCls.divStr+n+"tab1_"+i+"2'>",a+=this.addGsizeSalt(i)+"
",a+="PQR URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+i+"file'>
"+s.htmlCls.buttonStr+"reload_"+i+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=s.htmlCls.divStr+n+"tab1_"+n+"2'>",a+="Phi URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+n+"file'>
"+s.htmlCls.buttonStr+"reload_"+n+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=s.htmlCls.divStr+n+"tab1_"+l+"2'>",a+="Cube URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+l+"file'>
"+s.htmlCls.buttonStr+"reload_"+l+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=""),a+="
"+this.getFootHtml(e,n+"tab1_foot"),a+="",a+=s.htmlCls.divStr+n+"tab2'>","delphi"==e&&(a+=this.addGsizeSalt(n+"2")+"
"),a+="Surface with max potential at:
",a+="Surface:
",a+="
","delphi"==e?(a+=s.htmlCls.buttonStr+"reload_"+n+"file2' style='margin-top: 6px;'>Surface with Potential",a+=s.htmlCls.buttonStr+n+"mapNo2' style='margin-left:30px;'>Remove Surface
"):"local"==e?(a+=s.htmlCls.divStr+n+"tab2_tabs' style='border:0px;'>",a+="",d=""+s.htmlCls.buttonStr+n+"mapNo2'>Remove Surface",a+=s.htmlCls.divStr+n+"tab2_"+i+"'>",a+=this.addGsizeSalt(i+"2")+"
",a+="PQR File: "+s.htmlCls.inputFileStr+"id='"+s.pre+i+"file2'>
"+s.htmlCls.buttonStr+"reload_"+i+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=s.htmlCls.divStr+n+"tab2_"+n+"'>",a+="Phi File: "+s.htmlCls.inputFileStr+"id='"+s.pre+n+"file2'>
"+s.htmlCls.buttonStr+"reload_"+n+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=s.htmlCls.divStr+n+"tab2_"+l+"'>",a+="Cube File: "+s.htmlCls.inputFileStr+"id='"+s.pre+l+"file2'>
"+s.htmlCls.buttonStr+"reload_"+l+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=""):"url"==e&&(a+=s.htmlCls.divStr+n+"tab2_tabs' style='border:0px;'>",a+="",d=""+s.htmlCls.buttonStr+n+"mapNo2'>Remove Surface",a+=s.htmlCls.divStr+n+"tab2_"+i+"2'>",a+=this.addGsizeSalt(i+"2")+"
",a+="PQR URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+i+"file2'>
"+s.htmlCls.buttonStr+"reload_"+i+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=s.htmlCls.divStr+n+"tab2_"+n+"2'>",a+="Phi URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+n+"file2'>
"+s.htmlCls.buttonStr+"reload_"+n+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=s.htmlCls.divStr+n+"tab2_"+l+"2'>",a+="Cube URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+l+"file2'>
"+s.htmlCls.buttonStr+"reload_"+l+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=""),a+="
"+this.getFootHtml(e,n+"tab2_foot"),a+="",a+="",a+="",a}async exportPqr(e){let t=this.icn3dui,s=t.icn3d,i={},n={},l=t.hashUtilsCls.intHash(s.dAtoms,s.hAtoms);for(let e in l)s.atoms[e],s.ions.hasOwnProperty(e)?i[e]=1:n[e]=1;let r=e?"pdb":"pqr";if(t.cfg.cid){let l="",o=!e;l+=s.saveFileCls.getAtomPDB(n,o)+s.saveFileCls.getAtomPDB(i,o);let a=Object.keys(t.utilsCls.getHlStructures()).join(",");s.saveFileCls.saveFile(a+"_icn3d."+r,"text",[l])}else{if(t.utilsCls.isCalphaPhosOnly(t.hashUtilsCls.hash2Atoms(n,s.atoms)))return void alert("The potential will not be shown because the side chains are missing in the structure...");let l="",o=!0;l+=s.saveFileCls.getAtomPDB(n,void 0,void 0,void 0,void 0,void 0,o),l+=s.saveFileCls.getAtomPDB(i,!0,void 0,!0);let a=t.htmlCls.baseUrl+"delphi/delphi.cgi",d={pdb2pqr:l,pdbid:t.cfg.cid?t.cfg.cid:Object.keys(s.structures).toString()},c=await t.getAjaxPostPromise(a,d,!0,void 0,void 0,!0,"text");if(e){let e=c.split("\n"),s="";for(let i=0,n=e.length;i",t).replace("#include {const t=new Map;for(const[e,s]of n.associations)(e instanceof Material||e instanceof Texture)&&t.set(e,s);return e.traverse((e=>{const s=n.associations.get(e);null!=s&&t.set(e,s)})),t})(l),l}))}}function me(e,t,s,i){const n=s.nodes[e];return i.getDependency("node",e).then((function(e){if(void 0===n.skin)return e;let t;return i.getDependency("skin",n.skin).then((function(e){t=e;const s=[];for(let e=0,n=t.joints.length;e1)if(void 0!==d){let i,n,l=[];for(let r=0,o=p.length;rStructure ":"",a=Object.keys(i).length>1?"Chain ":"";n+=""+o+a+" ";for(let e in l.resid2area){let d=e.lastIndexOf("_"),c=e.substr(d+1),h=r.utilsCls.getIdArray(e.substr(0,d));o=Object.keys(s).length>1?"Residue Number SASA (Å2) Percent Out In/Out "+h[0]+" ":"",a=Object.keys(i).length>1?""+h[1]+" ":"";let p="",m="";l.resid2area[e]=(l.resid2area[e]/t).toFixed(2),r.parasCls.residueArea.hasOwnProperty(c)&&(m=parseInt(l.resid2area[e]/r.parasCls.residueArea[c]*100),m>100&&(m=100),m>=50&&(p="out"),m<20&&(p="in")),n+=''+o+a+" "}return n+=""+c+' '+h[2]+' '+l.resid2area[e]+' '+m+"% "+p+" 0?-parseInt(C.z):parseInt(C.z),y.onBeforeRender=function(e,t,s,i,n,o){let a,d=new THREE.Vector3(0,0,0),c=i.getAttribute("position").array;for(let e=0,t=c.length;e0&&t.applySymdCls.applySymd(),void 0!==t.prevOtherMesh)for(let e=0,s=t.prevOtherMesh.length;e0&&(e=s.hashUtilsCls.hash2Atoms(t.chemicals,t.atoms));let i=4;if(void 0!==e){let n=t.contactCls.getAtomsWithinAtom(t.atoms,e,i),l=3.5;t.opts.hbonds="yes",Object.keys(n).length>0&&t.hBondCls.calculateChemicalHbonds(e,n,parseFloat(l)),t.bSetFog||t.transformCls.zoominSelection(s.hashUtilsCls.unionHash(e,n))}}else"hide"===e.chemicalbinding&&(t.hBondCls.hideHbonds(),t.showInterCls.hideExtraBonds(),t.bSetFog||t.transformCls.zoominSelection(t.atoms))}updateStabilizer(){let e=this.icn3d;if(e.icn3dui,e.stabilizerpnts=[],void 0!==e.pairArray)for(let t=0,s=e.pairArray.length;t=0;i--){let r=t.ssbondpnts[e][2*i],o=t.ssbondpnts[e][2*i+1],a={};a.color=n,a.dashed=!1;let d=[],c=[],h=[],p=[],m=!1,u=!1;for(let e in t.residues[r])"SG"===t.atoms[e].name&&(h.push(t.atoms[e].coord),d.push(t.atoms[e].serial),m=!0);if(!m)for(let e in t.residues[r])if("CA"===t.atoms[e].name){h.push(t.atoms[e].coord),d.push(t.atoms[e].serial),m=!0,u=!0;break}m=!1;for(let e in t.residues[o])"SG"===t.atoms[e].name&&(p.push(t.atoms[e].coord),c.push(t.atoms[e].serial),m=!0);if(!m)for(let e in t.residues[o])if("CA"===t.atoms[e].name){p.push(t.atoms[e].coord),c.push(t.atoms[e].serial),m=!0,u=!0;break}let g=u?7:3,f=!1;for(let e=0,t=h.length;e0&&(e.mdl.remove(e.prevMaps[e.prevMaps.length-1]),e.prevMaps.slice(e.prevMaps.length-1,1))}removeLastEmmap(){let e=this.icn3d;e.icn3dui,e.prevEmmaps.length>0&&(e.mdl.remove(e.prevEmmaps[e.prevEmmaps.length-1]),e.prevEmmaps.slice(e.prevEmmaps.length-1,1))}removeLastPhimap(){let e=this.icn3d;e.icn3dui,e.prevPhimaps.length>0&&(e.mdl.remove(e.prevPhimaps[e.prevPhimaps.length-1]),e.prevPhimaps.slice(e.prevPhimaps.length-1,1))}}class ot{constructor(e){this.icn3d=e}addResidueLabels(e,t,s,i,n){let l=this.icn3d,r=l.icn3dui;if(r.bNode)return;let o=r.hashUtilsCls.intHash(l.hAtoms,e);t?void 0===l.labels.schematic&&(l.labels.schematic=[]):void 0===l.labels.residue&&(l.labels.residue=[]);let a="";for(let e in o){let s=l.atoms[e],o={},d=s.structure+"_"+s.chain+"_"+s.resi;if(!s.het&&("CA"===s.name||"O3'"===s.name||"O3*"===s.name)||l.water.hasOwnProperty(s.serial)||l.ions.hasOwnProperty(s.serial)||l.chemicals.hasOwnProperty(s.serial)&&d!==a){if(o.position=s.coord,o.bSchematic=0,t&&(o.bSchematic=1),o.text=r.utilsCls.residueName2Abbr(s.resn),i)o.text+=s.resi;else if(n){let e=s.structure+"_"+s.chain+"_"+s.resi,t="";l.resid2refnum[e]&&(t=" "==l.resid2refnum[e].substr(0,1)?"":l.resid2refnum[e]),o.text=t}o.size=18,o.factor=.3;let e=s.color.getHexString().toUpperCase();o.color=i?"black"!=l.opts.background?l.colorWhitebkgd:l.colorBlackbkgd:n?"#00FFFF":"CCCCCC"===e||"C8C8C8"===e?"#888888":"#"+e,o.background="#FFFFFF",t?l.labels.schematic.push(o):l.labels.residue.push(o)}a=d}l.hlObjectsCls.removeHlObjects()}addNonCarbonAtomLabels(e){let t=this.icn3d,s=t.icn3dui;if(s.bNode)return;let i=s.hashUtilsCls.intHash(t.hAtoms,e);void 0===t.labels.schematic&&(t.labels.schematic=[]);for(let e in i){let s=t.atoms[e];if(!t.residues.hasOwnProperty(s.structure+"_"+s.chain+"_"+s.resi))continue;if("C"===s.elem)continue;let i={};i.position=s.coord,i.bSchematic=1,i.text=s.elem,i.size=18,i.color="black"!=t.opts.background?t.colorWhitebkgd:s.color.getHexString(),i.background="#FFFFFF",t.labels.schematic.push(i)}t.hlObjectsCls.removeHlObjects()}addAtomLabels(e,t){let s=this.icn3d,i=s.icn3dui;if(i.bNode)return;let n=i.hashUtilsCls.intHash(s.hAtoms,e);n=i.hashUtilsCls.intHash(s.dAtoms,n),void 0===s.labels.residue&&(s.labels.residue=[]);for(let e in n){let i=s.atoms[e],n={};n.position=i.coord,n.bSchematic=0,n.text=t?i.elem:i.name.padEnd(2," "),n.size=18,t&&(n.bSchematic=!0);let l=i.color.getHexString().toUpperCase();n.color="black"!=s.opts.background?s.colorWhitebkgd:s.colorBlackbkgd,t&&(n.color="CCCCCC"===l||"C8C8C8"===l?"#888888":"#"+l),n.background="#FFFFFF",s.labels.residue.push(n)}s.hlObjectsCls.removeHlObjects()}}class at{constructor(e){this.icn3d=e}onBeforeRender(e,t,s,i,n,l){let r=n.uniforms,o=[];if(r.objectId&&(r.objectId.value=SupportsReadPixelsFloat?this.id:this.id/255,o.push("objectId")),(r.modelViewMatrixInverse||r.modelViewMatrixInverseTranspose||r.modelViewProjectionMatrix||r.modelViewProjectionMatrixInverse)&&this.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,this.matrixWorld),r.modelViewMatrixInverse&&(r.modelViewMatrixInverse.value.copy(this.modelViewMatrix).invert(),o.push("modelViewMatrixInverse")),r.modelViewMatrixInverseTranspose&&(r.modelViewMatrixInverse?r.modelViewMatrixInverseTranspose.value.copy(r.modelViewMatrixInverse.value).transpose():r.modelViewMatrixInverseTranspose.value.copy(this.modelViewMatrix).invert().transpose(),o.push("modelViewMatrixInverseTranspose")),r.modelViewProjectionMatrix&&(s.updateProjectionMatrix(),r.modelViewProjectionMatrix.value.multiplyMatrices(s.projectionMatrix,this.modelViewMatrix),o.push("modelViewProjectionMatrix")),r.modelViewProjectionMatrixInverse){let e=new THREE.Matrix4;r.modelViewProjectionMatrix?(e.copy(r.modelViewProjectionMatrix.value),r.modelViewProjectionMatrixInverse.value.copy(e).invert()):(s.updateProjectionMatrix(),e.multiplyMatrices(s.projectionMatrix,this.modelViewMatrix),r.modelViewProjectionMatrixInverse.value.copy(e).invert()),o.push("modelViewProjectionMatrixInverse")}if(r.projectionMatrix&&(s.updateProjectionMatrix(),r.projectionMatrix.value.copy(s.projectionMatrix),o.push("projectionMatrix")),r.projectionMatrixInverse&&(s.updateProjectionMatrix(),r.projectionMatrixInverse.value.copy(s.projectionMatrix).invert(),o.push("projectionMatrixInverse")),o.length){let t=e.properties.get(n);if(t.program){let s=e.getContext(),i=t.program;s.useProgram(i.program);let n=i.getUniforms();o.forEach((function(e){n.setValue(s,e,r[e].value)}))}}}setParametersForShader(e){let t,s=this.icn3d,i=s.icn3dui.parasCls.backgroundColors[s.opts.background.toLowerCase()],n=2.5*s.maxD,l=4*s.maxD,r=void 0!==s.biomtMatrices&&s.biomtMatrices.length*s.cnt>s.maxatomcnt;"yes"===s.opts.slab?r?t=.1:void 0!==s.camMaxDFactorFog?(t=s.maxD*s.camMaxDFactorFog-10,n=2.5*s.maxD-t<0?0:2.5*s.maxD-t,l=4*s.maxD-t):t=s.maxD*s.camMaxDFactor:t=.1;let o=void 0!==e?e:1,a=s.shininess/100*.5;s.uniforms=THREE.UniformsUtils.merge([THREE.UniformsLib.common,{modelViewMatrix:{value:new THREE.Matrix4},modelViewMatrixInverse:{value:new THREE.Matrix4},modelViewMatrixInverseTranspose:{value:new THREE.Matrix4},modelViewProjectionMatrix:{value:new THREE.Matrix4},modelViewProjectionMatrixInverse:{value:new THREE.Matrix4},projectionMatrix:{value:new THREE.Matrix4},projectionMatrixInverse:{value:new THREE.Matrix4},diffuse:{type:"v3",value:[1,1,1]},emissive:{type:"v3",value:[.06,.06,.06]},roughness:{type:"f",value:.5},metalness:{type:"f",value:a},opacity:{type:"f",value:o},nearClip:{type:"f",value:t},ortho:{type:"f",value:0},shrink:{type:"f",value:.13},fogColor:{type:"v3",value:[i.r,i.g,i.b]},fogNear:{type:"f",value:n},fogFar:{type:"f",value:l},fogDensity:{type:"f",value:2}},THREE.UniformsLib.ambient,THREE.UniformsLib.lights]),s.defines={USE_COLOR:1,NEAR_CLIP:1,CAP:1},"yes"!==s.opts.fog||r||(s.defines.USE_FOG=1,"orthographic"===s.opts.camera&&(s.defines.FOG_EXP2=1)),s.bExtFragDepth&&(s.defines.USE_LOGDEPTHBUF_EXT=1)}drawImpostorShader(){this.icn3d.icn3dui.bNode||(this.setParametersForShader(),this.createImpostorShaderSphere("SphereImpostor"),this.createImpostorShaderCylinder("CylinderImpostor"))}getShader(e){this.icn3d.icn3dui;let t=$NGL_shaderTextHash[e];return t=t.replace(/#include\s+(\S+)/gim,(function(e,t){let s;return THREE.ShaderChunk.hasOwnProperty(t)&&(s=THREE.ShaderChunk[t]),s||""})),t}createImpostorShaderBase(e,t,s,i,n,l,r,o,a){let d=this.icn3d;d.icn3dui;let c=new THREE.ShaderMaterial({defines:d.defines,uniforms:d.uniforms,vertexShader:this.getShader(e+".vert"),fragmentShader:this.getShader(e+".frag"),depthTest:!0,depthWrite:!0,lights:!0});c.extensions.fragDepth=!0,"CylinderImpostor"==e?d.CylinderImpostorMaterial=c:"SphereImpostor"==e&&(d.SphereImpostorMaterial=c);let h,p,m=l*r,u=l*o,g=new(m>65535?Uint32Array:Uint16Array)(u);for(let e=0;eo?r:o,d=Math.sqrt(a),c=(d+s)*(d+s),h={};for(let r in e){let e=n.atoms[r];!i&&t.hasOwnProperty(e.serial)||(this.bOpm&&"DUM"===e.resn||e.coord.x
";if("atom"==e){let e=["proteins","nucleotides","chemicals","ions","water"];for(let i=0,l=e.length;i
",n+="Light green (P, T, S, A, Q, N, G): Polar
",n+="Grey: Charged, not hydrophobic
"):(n+="Green (W, F, L, I, Y, M, V, C): Hydrophobic
",n+="Yellow (P, T, S, A, Q, N, G): Polar
",n+="Red: Negatively Charged
",n+="Blue: Positively Charged
");let a=0;for(let e of r)s.parasCls.residueAbbrev[e[0]]&&(n+="
"),++a);n+="
",n+=s.htmlCls.clickMenuCls.setLegendHtml()):"confidence"==e?n+=s.htmlCls.clickMenuCls.setLegendHtml(!0):"exon"==e?(t.startColor="red",t.midColor="white",t.endColor="blue",t.startValue="Start",t.midValue="Middle",t.endValue="End",n+=s.htmlCls.clickMenuCls.setLegendHtml()):n="";n?($("#"+s.pre+"dl_legend_html").html(n),s.htmlCls.dialogCls.openDlg("dl_legend","Color Legend")):$("#"+s.pre+"dl_legend").hasClass("ui-dialog-content")&&$("#"+s.pre+"dl_legend").dialog("isOpen")&&$("#"+s.pre+"dl_legend").dialog("close")}getColorLegendForElem(e,t){let s=this.icn3d,i=s.icn3dui,n="",l={};for(let e in t){let t=s.atoms[e],i=void 0===t||void 0===t.color||"FFFFFF"===t.color.getHexString().toUpperCase()?"DDDDDD":t.color.getHexString();void 0===l[t.elem]&&(l[t.elem]={}),l[t.elem][i]=1}if(Object.keys(l).length>0){n+=""+e+"
";let t=Object.keys(l).sort();for(let e=0,s=t.length;e";for(let e in l[s])n+=" ";n+=i.parasCls.atomnames[s.toUpperCase()]+"
"}n+="
"}return n}getRes2color(e,t){let s=this.icn3d,i=s.icn3dui,n={},l=s.firstAtomObjCls.getResiduesFromAtoms(e);for(let e in l){let l=s.residues[e],r=s.firstAtomObjCls.getFirstAtomObj(l),o=t?r.resn:i.parasCls.residueAbbrev[r.resn],a=void 0===r||void 0===r.color||"FFFFFF"===r.color.getHexString().toUpperCase()?"DDDDDD":r.color.getHexString();null!=o&&(void 0===n[o]&&(n[o]={}),n[o][a]=1)}return n}getColorLegendForResidue(e){this.icn3d.icn3dui;let t="",s=this.getRes2color(e);if(Object.keys(s).length>0){t+="
"),-1!=o.indexOf("(")?(t+=r,++n):i+=r}i&&(t+="
"+i),t+=""}return t}getColorLegendForCharge(e){let t=this.icn3d;t.icn3dui;let s="",i=t.firstAtomObjCls.getResiduesFromAtoms(e),n={};for(let e in i){let s=t.residues[e],i=t.firstAtomObjCls.getFirstAtomObj(s);"ARG"==i.resn||"LYS"==i.resn?n.Positive=1:"HIS"==i.resn?n["Partial-Positive"]=1:"ASP"==i.resn||"GLU"==i.resn||t.nucleotides[i.serial]?n.Negative=1:n.Neutral=1}const l={Positive:"0000ff","Partial-Positive":"8080ff",Negative:"ff0000",Neutral:"888888"};let r=["Positive","Partial-Positive","Negative","Neutral"];s+="
")}return s+="
(Charges are at pH 7)",s+="
"}return t+="
Linker":"","C'' Strand":"FF0000","
Protodomain 2":"","D Strand":"0000FF","E Strand":"006400","F Strand":"F7DC6F","G Strand":"FFA500","":"",Loop:"CCCCCC"};t+="
that by its duplication, symmetry operations
can generate a structural domain.
";for(let e in s){let i=s[e];t+="",i&&(t+=" "),t+=e,t+="
"}return t+="'+s+"
",h+=d+u+g,p+=d+u+g;let f="site"+e.toString(),b=0,y=0,v=1;i.seqStartLen&&i.seqStartLen[c]&&(p+=i.showSeqCls.insertMulGapOverview(c,i.seqStartLen[c])),i.seqStartLen&&i.seqStartLen[c]&&(h+=i.showSeqCls.insertMulGap(i.seqStartLen[c],"-"));for(let t=0,s=i.giSeq[c].length;t1&&(l=s[0]+"..");let r=i.ParserUtilsCls.getResi(c,t);if(h+=''+s+"",n.bNode){let t={};t[c+"_"+r]="site: "+C[e].title,i.resid2site[c].push(t)}p+=i.showSeqCls.insertGapOverview(c,t);let o=n.cfg.blast_rep_id==c?Math.round(i.seqAnnWidth*t/(i.maxAnnoLength+i.nTotalGap)-b-y):Math.round(i.seqAnnWidth*t/i.maxAnnoLength-b-y);o>=0&&(p+='",g+="
",h+=g,p+=g}h+="",p+="",m+="",$("#"+i.pre+"dt_site_"+c).html(h),$("#"+i.pre+"ov_site_"+c).html(p),$("#"+i.pre+"tt_site_"+c).html(m)}}for(let e in i.protein_chainid)r.hasOwnProperty(e)||($("#"+i.pre+"dt_cdd_"+e).html(""),$("#"+i.pre+"ov_cdd_"+e).html(""),$("#"+i.pre+"tt_cdd_"+e).html(""),$("#"+i.pre+"dt_site_"+e).html(""),$("#"+i.pre+"ov_site_"+e).html(""),$("#"+i.pre+"tt_site_"+e).html(""));i.showAnnoCls.enableHlSeq(),i.bAjaxCddSite=!0}getNoCdd(e){let t=this.icn3d;t.icn3dui,console.log("No CDD data were found for the protein "+e+"...");for(let e in t.protein_chainid)$("#"+t.pre+"dt_cdd_"+e).html(""),$("#"+t.pre+"ov_cdd_"+e).html(""),$("#"+t.pre+"tt_cdd_"+e).html(""),$("#"+t.pre+"dt_site_"+e).html(""),$("#"+t.pre+"ov_site_"+e).html(""),$("#"+t.pre+"tt_site_"+e).html("");t.showAnnoCls.enableHlSeq(),t.bAjaxCddSite=!0}setDomainFeature(e,t,s,i,n,l,r){let o,a,d,c=this.icn3d,h=c.icn3dui;s&&(r={},o={},a={},d={});let p=void 0!==e?e.length:0,m=s?14:19,u=s?100:120;for(let g=0;g
";let T='';i+=R+I+T,s&&(n+='
",i+=T,n+=T,s&&(n+=' ')}}return{html:i,html2:n,html3:l,acc2domain:r,pssmid2name:o,pssmid2fromArray:a,pssmid2toArray:d}}showAnnoType(e,t,s,i,n,l){let r=this.icn3d,o=r.icn3dui,a='
";let b='';a+=g+f+b,d+=g+f+b;let C=s,y=0,v=0;r.seqStartLen&&r.seqStartLen[e]&&(d+=r.showSeqCls.insertMulGapOverview(e,r.seqStartLen[e])),r.seqStartLen&&r.seqStartLen[e]&&(a+=r.showSeqCls.insertMulGap(r.seqStartLen[e],"-"));for(let t=0,i=r.giSeq[e].length;t1&&(c=n[0]+"..");let h=i,p=e+"_"+i,m=n+i;if("ssbond"==s){m="Residue "+p+" has disulfide bond with";let t="";if(void 0!==l[p])for(let e=0,s=l[p].length;e'+c+"",d+=r.showSeqCls.insertGapOverview(e,t);let u=o.cfg.blast_rep_id==e?Math.round(r.seqAnnWidth*t/(r.maxAnnoLength+r.nTotalGap)-y-v):Math.round(r.seqAnnWidth*t/r.maxAnnoLength-y-v);u>=0&&(d+='
",a+=b,d+=b,a+="",d+="",c+="",$("#"+r.pre+"dt_"+s+"_"+e).html(a),$("#"+r.pre+"ov_"+s+"_"+e).html(d),$("#"+r.pre+"tt_"+s+"_"+e).html(c)}setToolTip(){let e=this.icn3d;e.icn3dui,$("[id^="+e.pre+"snp]").add("[id^="+e.pre+"clinvar]").add("[id^="+e.pre+"ssbond]").add("[id^="+e.pre+"crosslink]").tooltip({content:function(){return $(this).prop("title")},show:null,close:function(e,t){t.tooltip.hover((function(){$(this).stop(!0).fadeTo(400,1)}),(function(){$(this).fadeOut("400",(function(){$(this).remove()}))}))}})}}class _t{constructor(e){this.icn3d=e}showInteraction(e,t){this.icn3d.icn3dui,this.showInteraction_base(e,t)}showInteraction_base(e,t){let s=this.icn3d,i=s.icn3dui;i.bNode&&(s.resid2contact||(s.resid2contact={}),s.resid2contact[e]||(s.resid2contact[e]=[])),void 0===s.chainname2residues&&(s.chainname2residues={});let n=Object.keys(s.chains),l=e,r=Math.round(l.indexOf("_"));if(s.firstAtomObjCls.getFirstCalphaAtomObj(s.chains[l]),void 0===s.chainname2residues[l]){s.chainname2residues[l]={};let t=n.length;if(t>100&&void 0===i.cfg.mmdbid&&void 0===i.cfg.gi&&void 0===i.cfg.blast_rep_id&&void 0===i.cfg.align&&void 0===i.cfg.chainalign)return $("#"+s.pre+"dt_interaction_"+e).html(""),void $("#"+s.pre+"ov_interaction_"+e).html("");for(let e=0;e
";let f='';o+=u+g+f,a+=u+g+f;let b="inter"+c.toString(),C=0,y=0,v=1;s.seqStartLen&&s.seqStartLen[e]&&(a+=s.showSeqCls.insertMulGapOverview(e,s.seqStartLen[e])),s.seqStartLen&&s.seqStartLen[e]&&(o+=s.showSeqCls.insertMulGap(s.seqStartLen[e],"-"));for(let t=0,n=s.giSeq[e].length;t
",o+=f,a+=f,++c}o+="",a+="",d+="",$("#"+s.pre+"dt_interaction_"+e).html(o),$("#"+s.pre+"ov_interaction_"+e).html(a),$("#"+s.pre+"tt_interaction_"+e).html(d),i.utilsCls.isMobile()?(s.hlSeqCls.selectSequenceMobile(),s.hlSeqCls.selectChainMobile()):s.hlSeqCls.selectSequenceNonMobile()}}class wt{constructor(e){this.icn3d=e}async showPTM(e,t,s,i,n){let l=this.icn3d,r=l.icn3dui,o=this,a=e.substr(0,e.indexOf("_")),d=e.substr(e.indexOf("_")+1);if("afmem"==s){let t={Transmembrane:[{begin:i,end:n}]};this.setAnnoPtmTransmem("transmem",t,e)}else if(a.length>5){let t,i="https://www.ebi.ac.uk/proteins/api/features/"+a;try{t=await r.getAjaxPromise(i,"json"),o.parsePTM(t,e,s)}catch{return void o.getNoPTM(e,s)}}else{let t,i=a.substr(0,4).toLowerCase(),n="https://www.ebi.ac.uk/pdbe/api/mappings/uniprot/"+i;try{t=await r.getAjaxPromise(n,"json");let a="";l.UPResi2ResiPosPerChain||(l.UPResi2ResiPosPerChain={}),l.UPResi2ResiPosPerChain[e]={};let c=t[i].UniProt,h=!1;for(let t in c){let s=c[t].mappings;for(let i=0,n=s.length;i
",r+=b+C+y,o+=b+C+y;let v=e+l.toString(),_=0,w=0,S=1;i.seqStartLen&&i.seqStartLen[s]&&(o+=i.showSeqCls.insertMulGapOverview(s,i.seqStartLen[s])),i.seqStartLen&&i.seqStartLen[s]&&(r+=i.showSeqCls.insertMulGap(i.seqStartLen[s],"-"));for(let e=0,t=i.giSeq[s].length;e
",r+=y,o+=y,++l}r+="",o+="",a+="",$("#"+i.pre+"dt_"+e+"_"+s).html(r),$("#"+i.pre+"ov_"+e+"_"+s).html(o),$("#"+i.pre+"tt_"+e+"_"+s).html(a)}getNoPTM(e,t){let s=this.icn3d;s.icn3dui,console.log("No PTM data were found for the chain "+e+"...");let i="ptm"==t?"ptm":"transmem";$("#"+s.pre+"dt_"+i+"_"+e).html(""),$("#"+s.pre+"ov_"+i+"_"+e).html(""),$("#"+s.pre+"tt_"+i+"_"+e).html(""),s.showAnnoCls.enableHlSeq(),s.bAjaxPTM=!0}}class St{constructor(e){this.icn3d=e}showCrosslink(e,t){let s=this.icn3d;s.icn3dui;let i=this;void 0===s.clbondpnts?setTimeout((function(){i.showCrosslink_base(e,t)}),1e3):this.showCrosslink_base(e,t)}showCrosslink_base(e,t){let s=this.icn3d;s.icn3dui.bNode&&(s.resid2crosslink||(s.resid2crosslink={}),s.resid2crosslink[e]||(s.resid2crosslink[e]=[]));let i=t,n={},l=i.substr(0,i.indexOf("_")),r=s.clbondpnts[l];if(void 0===r)return $("#"+s.pre+"dt_crosslink_"+e).html(""),$("#"+s.pre+"ov_crosslink_"+e).html(""),void $("#"+s.pre+"tt_crosslink_"+e).html("");for(let e=0,t=r.length;e17?s.substr(0,17)+"...":s,h=i[t].intervals,p={},m={},u=[],g=[],f={},b=0;for(let e=0,t=h.length;e
";let v='';o+=C+y+v,a+=C+y+v;let _="domain3d"+t.toString();l.seqStartLen&&l.seqStartLen[e]&&(o+=l.showSeqCls.insertMulGap(l.seqStartLen[e],"-"));for(let t=0,s=l.giSeq[e].length;t1&&(n=i[0]+"..");let r=s;o+=''+i+""}else o+="-"}l.seqStartLen&&l.seqStartLen[e]&&(o+=l.showSeqCls.insertMulGap(l.seqEndLen[e],"-"));let w=l.firstAtomObjCls.getFirstCalphaAtomObj(l.chains[e]),S=void 0===w.color||"FFFFFF"===w.color.getHexString()?"DDDDDD":w.color.getHexString(),A=void 0!==w.color?S:"CCCCCC";if(l.seqStartLen&&l.seqStartLen[e]&&(a+=l.showSeqCls.insertMulGapOverview(e,l.seqStartLen[e])),r.cfg.blast_rep_id!=e)for(let i=0,n=u.length;i",v+="
",o+=v,a+=v}o+="",a+="",d+="",$("#"+l.pre+"dt_domain_"+e).html(o),$("#"+l.pre+"ov_domain_"+e).html(a),$("#"+l.pre+"tt_domain_"+e).html(d)}}class xt{constructor(e){this.icn3d=e}async showSnp(e,t){this.icn3d.icn3dui,await this.showSnpClinvar(e,t,!0)}async showClinvar(e,t){this.icn3d.icn3dui,await this.showSnpClinvar(e,t,!1)}async showSnpClinvar(e,t,s){let i=this.icn3d.icn3dui,n=this,l=i.htmlCls.baseUrl+"vastdyn/vastdyn.cgi?chainid="+t;try{let r=await i.getAjaxPromise(l,"jsonp"),o=r.snpgi,a=r.gi;if(s)await n.showSnpPart2(e,t,o);else{let s=o;[6137708,1942289,224510717,2624886,253723219,2554905,75765331,3660278,312207882,319443632,342350956,1827805,109157826,1065265,40889086,6730307,163931185,494469,163931091,60594093,55669745,18655489,17942684,6980537,166235465,6435586,4139398,4389047,364506122,78101667,262118402,20664221,2624640,158430173,494395,28948777,34810587,13399647,3660342,261278854,342350965,384482350,378792570,15988303,213424334,4558333,2098365,10835631,3318817,374074330,332639529,122919696,4389286,319443573,2781341,67464020,194709238,210061039,364506106,28949044,40889076,161172338,17943181,4557976,62738484,365813173,6137343,350610552,17942703,576308,223674070,15826518,1310997,93279697,4139395,255311799,157837067,361132363,357380836,146387678,383280379,1127268,299856826,13786789,1311054,46015217,3402130,381353319,30750059,218766885,340707375,27065817,355333104,2624634,62738384,241913553,304446010].includes(a)&&(s=a),await n.showClinvarPart2(e,t,s)}}catch(t){return void(s?n.processNoSnp(e):n.processNoClinvar(e))}}navClinVar(e){let t=this.icn3d;t.icn3dui;let s=this;t.currClin[e]=-1,$(document).on("click","#"+t.pre+e+"_prevclin",(function(t){let i=s.icn3d;t.stopImmediatePropagation();let n=void 0!==i.resi2disease_nonempty[e]?Object.keys(i.resi2disease_nonempty[e]).length:0;--i.currClin[e],i.currClin[e]<0&&(i.currClin[e]=n-1),s.showClinVarLabelOn3D(e)})),$(document).on("click","#"+t.pre+e+"_nextclin",(function(t){let i=s.icn3d;t.stopImmediatePropagation();let n=void 0!==i.resi2disease_nonempty[e]?Object.keys(i.resi2disease_nonempty[e]).length:0;++i.currClin[e],i.currClin[e]>n-1&&(i.currClin[e]=0),s.showClinVarLabelOn3D(e)}))}showClinVarLabelOn3D(e){let t,s,i=this.icn3d,n=i.icn3dui,l=Object.keys(i.resi2disease_nonempty[e]);t=e,s=t+"_"+(parseInt(l[i.currClin[e]])+i.baseResi[e]).toString();let r="",o=i.resi2disease_nonempty[e][l[i.currClin[e]]];for(let e=0,t=o.length;e(from human)",i=" (based on human sequences and mapped to this structure by sequence similarity)"),C+=m?'
";C+='';let O="",R=0,I=0;p?f.seqStartLen&&f.seqStartLen[h]&&(C+=f.showSeqCls.insertMulGapOverview(h,f.seqStartLen[h])):f.seqStartLen&&f.seqStartLen[h]&&(C+=f.showSeqCls.insertMulGap(f.seqStartLen[h],"-"));for(let t=1,a=f.giSeq[h].length;t<=a;++t)if(p){if(void 0!==r[t]){let e=f.giSeq[h][t-1],i=e;e.length>1&&(i=e[0]+"..");let n=f.ParserUtilsCls.getResi(h,t-1)+i+">";for(let e=0,i=s[t].length;e=0&&(C+='
"+f.showAnnoCls.addSnpButton(m,"snpin3d","3D with scap","SNP in 3D with scap",70,g)+" ",u+=f.showAnnoCls.addSnpButton(m,"snpinter","Interactions","SNP Interactions in 3D",70,g)+" ",u+=f.showAnnoCls.addSnpButton(m,"snppdb","PDB","Download SNP PDB",35,g)),u+="
Links: ClinVar, dbSNP(rs"+i[t][e]+")",e
"),++r)}r>d&&2==e&&(p+="..")}else{d=1;for(let e=v;e
"+f.showAnnoCls.addSnpButton(r,"snpin3d","3D with scap","SNP in 3D with scap",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snpinter","Interactions","SNP Interactions in 3D",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snppdb","PDB","Download SNP PDB",35,m)),0!=i[t][e]&&(u+="
Link: dbSNP(rs"+i[t][e]+")"),e
");else{let s=l[t][e].split("; "),a=o[t][e].split("; "),d="",c=0;for(let t=0,i=s.length;t0?d+="; ":0!==e&&1!==e||(O='disease="'+s[t]+'"'),d+=s[t]+"("+a[t]+")",++c;""!=d?(u+=": "+d,C&&!b.cfg.hidelicense&&(u+="
"+f.showAnnoCls.addSnpButton(r,"snpin3d","3D with scap","SNP in 3D with scap",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snpinter","Interactions","SNP Interactions in 3D",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snppdb","PDB","Download SNP PDB",35,m)),u+="
Links: ClinVar, dbSNP(rs"+i[t][e]+")"):(C&&!b.cfg.hidelicense&&(u+="
"+f.showAnnoCls.addSnpButton(r,"snpin3d","3D with scap","SNP in 3D with scap",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snpinter","Interactions","SNP Interactions in 3D",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snppdb","PDB","Download SNP PDB",35,m)),u+="
Link: dbSNP(rs"+i[t][e]+")"),e
")}}y>d&&2==e&&(p+="..")}u+="
",C}processSnpClinvar(e,t,s,i,n){let l=this.icn3d,r=l.icn3dui,o='")+1),h=s[4],p=i?"":s[5],S=i?"":s[6],A=i?"":s[7],x=l.ParserUtilsCls.getResi(t,d-1);v[x]=1,""!=S&&(_[x]=1),g[d]=e+1,void 0===u[d]&&(u[d]=[]),u[d].push(c),void 0===C[d]&&(C[d]=[]),C[d].push(h),void 0===y[d]&&(y[d]=[]),y[d].push(p),void 0===f[d]&&(f[d]=[]),f[d].push(S),""!=S&&(void 0===l.resi2disease_nonempty[t][d]&&(l.resi2disease_nonempty[t][d]=[]),l.resi2disease_nonempty[t][d].push(S)),void 0===b[d]&&(b[d]=[]),b[d].push(A)}let S=Object.keys(v),A=Object.keys(_);if(i){let e=!1;o+=this.getSnpLine(1,2,u,C,y,f,g,b,S,A,1,t,!1,e,void 0,i),o+=this.getSnpLine(2,2,u,C,y,f,g,b,S,A,0,t,!1,e,void 0,i),d+=this.getSnpLine(1,2,u,C,y,f,g,b,S,A,1,t,!1,e,!0,i),d+=this.getSnpLine(2,2,u,C,y,f,g,b,S,A,0,t,!1,e,!0,i),a+=this.getSnpLine(1,2,u,C,y,f,g,b,S,A,1,t,!0,e,void 0,i),o+="0&&this.elt_size[s.sse-1]>=6&&0!=s.adj_strand2&&e++}for(let e=0;e
",w+=x+k+"
";let O='';C+=A+k+O,y+=x+k+O,v+=A+k+O;let R=e.indexOf("_"),I="cst"+e.substr(R+1),T=0,E=0,P=(void 0===l||"seq"===l||"custom"===l)&&-1==s.indexOf("cannot-be-aligned")&&-1==s.indexOf("cannot be aligned"),M="identity"===l&&-1==s.indexOf("cannot-be-aligned")&&-1==s.indexOf("cannot be aligned"),D={},H=0;A="";let F={},L={},N={},q=0;if(h)for(let e=0,t=h.length;e
",O+="",C+=O,v+=A+O,y+=O,_+="",w+="",h?($("#"+p.pre+"dt_custom_"+e+"_"+f).html(y+C),$("#"+p.pre+"ov_custom_"+e+"_"+f).html(v),$("#"+p.pre+"tt_custom_"+e+"_"+f).html(w+_)):($("#"+p.pre+"dt_custom_"+e+"_"+f).html(C),$("#"+p.pre+"ov_custom_"+e+"_"+f).html(v),$("#"+p.pre+"tt_custom_"+e+"_"+f).html(_))}getExonHtml(e,t,s,i,n,l,r){let o=this.icn3d;return o.icn3dui,'20)return!1;if(void 0!==o.giSeq&&void 0!==o.giSeq[e]){let r=this.getFullText(s);return s=r.text,this.showNewTrack(e,t,s,void 0,void 0,i,n,l),!1}setTimeout((function(){a.checkGiSeq(e,t,s,i,n,l,r+1)}),100)}getFullText(e){this.icn3d.icn3dui;let t="",s=[],i=[],n=e.split(","),l=-1;for(let e=0,r=n.length;eA&&(A=e)}let x=S,k=w.length-(A+1),O=[],R=[];for(let e=0,t=p.length;e"),d=a[1].indexOf("\n");n=a[1].substr(d+1).replace(/\n/g,"");for(let e=2,t=a.length;e
Click \"Assembly\" in the menu \"View\" to switch between asymmetric unit and biological assembly("+e.asuCnt+" asymmetric unit).e.maxAnnoLengthOri&&(e.protein_chainid.hasOwnProperty(t)||s.hasOwnProperty(t))&&(e.maxAnnoLengthOri=e.chainsSeq[t].length);e.maxAnnoLength=e.maxAnnoLengthOri}return{nucleotide_chainid:s,chemical_chainid:i,chemical_set:n}}async showAnnotations(){let e=this.icn3d,t=e.icn3dui,s=this,i=this.showAnnotations_part1(),n=i.nucleotide_chainid,l=i.chemical_chainid,r=i.chemical_set;if(!e.bAnnoShown||e.bResetAnno)if(e.bAnnoShown=!0,void 0===t.cfg.blast_rep_id){if(e.bFullUi){if(void 0!==t.cfg.mmtfid){let t=Object.keys(e.structures)[0];await e.mmcifParserCls.downloadMmcifSymmetry(t,"mmtfid")}await this.showAnnoSeqData(n,l,r)}}else if(void 0===t.cfg.blast_rep_id||e.bSmithwm||e.bLocalSmithwm){if(void 0!==t.cfg.blast_rep_id&&(e.bSmithwm||e.bLocalSmithwm)){let i,o,a=[t.cfg.blast_rep_id];if(-1!=t.cfg.query_id.indexOf(">")?o=t.cfg.query_id.substr(t.cfg.query_id.indexOf("\n")+1):!/\d/.test(t.cfg.query_id)||t.cfg.query_id.length>50?o=t.cfg.query_id:a.push(t.cfg.query_id),e.blastAcxn){let s=t.cfg.afid+"_A",n="";for(let t=0,i=e.chainsSeq[s].length;t5){let n;e.uniprot2acc&&e.uniprot2acc[i]?e.uniprot2acc[i]:e.uniprot2acc={},n="https://rest.uniprot.org/uniprotkb/search?format=json&fields=xref_geneid,gene_names&query="+i;let l=await t.getAjaxPromise(n,"json"),r=l.results[0]&&l.results[0].uniProtKBCrossReferences&&l.results[0].uniProtKBCrossReferences[0]?l.results[0].uniProtKBCrossReferences[0].id:void 0,o=l.results[0]&&l.results[0].genes&&l.results[0].genes[0]&&l.results[0].genes[0].geneName?l.results[0].genes[0].geneName.value:"ID "+r;e.chainsGene[s]={geneId:r,geneSymbol:o}}}for(let s in e.protein_chainid){let i=t.utilsCls.isMobile()?"none":"button",l=e.showSeqCls.getProteinName(s),r=l,o=0==n?"Proteins:
":"",a=e.chainsGene[s]&&e.chainsGene[s].geneId&&e.chainsGene[s].geneDesc?"(Gene: "+e.chainsGene[s].geneSymbol+")":"",d=s.substr(0,s.indexOf("_")),c=d.length>5?''+s+"":s,h="
"),++n}if(t.bNode||e.annoCddSiteCls.setToolTip(),void 0!==e.chainid_seq)await this.processSeqData(e.chainid_seq);else try{let n=[],l=[];for(let e=0,t=i.length;e40&&(r=r.substr(0,40)+"...");let o="";0==i&&("protein"==s?o="Proteins:
":"nucleotide"==s?o="Nucleotides:
":"chemical"==s&&(o="Chemicals/Ions/Water:
")),$("#"+n.pre+"dl_annotations").append("
"),n.giSeq[e]=[];for(let t=0;t
":"",o=t[0].lastIndexOf("_"),a=t[0].substr(0,o),d=void 0!==l.cfg.mmdbid&&void 0!==n.chainid2sid?n.chainid2sid[a]:void 0;i=void 0!==d?""+e+" ":""+e+"",$("#"+n.pre+"dl_annotations").append("
");let c='
",c+="
",g+=u+'';let s=0,i=0,n="";a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e]," "));for(let t=0,l=o.length;t
",g+="
",g+=u+'',a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e],"-"));for(let t=0,s=o.length;t':'',g+=" ";else if("E"==a.secondaries[s]){a.firstAtomObjCls.getFirstCalphaAtomObj(a.residues[s]).ssend?"green"==a.sheetcolor?g+='':"yellow"==a.sheetcolor&&(g+=''):"green"==a.sheetcolor?g+='':"yellow"==a.sheetcolor&&(g+=''),g+=" "}else"c"==a.secondaries[s]?g+=' ':"o"==a.secondaries[s]&&(g+=' ');else g+="-"}a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqEndLen[e],"-")),g+='',g+="",g+="
",g+="
";let v='';g+=u+v,f+=u+v;let _,w=0;a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e],"-"));for(let t=0,s=o.length;t1&&(i=s[0]+".."),_=a.ParserUtilsCls.getResi(e,t),a.residues.hasOwnProperty(e+"_"+_)){let n="333333";if(d.cfg.blast_rep_id==e&&void 0!==a.fullpos2ConsTargetpos&&void 0!==a.fullpos2ConsTargetpos[t+w])n=a.fullpos2ConsTargetpos[t+w].color;else{let t=a.firstAtomObjCls.getFirstCalphaAtomObj(a.residues[e+"_"+_]),s=void 0===t.color||"FFFFFF"===t.color.getHexString().toUpperCase()||"FFF"===t.color.getHexString().toUpperCase()?"DDDDDD":t.color.getHexString();n=void 0!==t.color?s:"CCCCCC"}g+=''+i+""}else i=i.toLowerCase(),g+=''+i+""}a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqEndLen[e],"-")),d.cfg.blast_rep_id==e&&(a.opts.color=a.blastAcxn?"confidence":"conservation",a.setColorCls.setColorByOptions(a.opts,a.atoms));let S=a.firstAtomObjCls.getFirstCalphaAtomObj(a.chains[e]),A=S.color?S.color.getHexString():"CCCCCC",x=Math.round(a.seqAnnWidth*o.length/(a.maxAnnoLength+a.nTotalGap));if(x<1&&(x=1),a.seqStartLen&&a.seqStartLen[e]&&(f+=this.insertMulGapOverview(e,a.seqStartLen[e])),d.cfg.blast_rep_id!=e)f+='
",g+=u,f+=u,d.cfg.blast_rep_id==e){if(void 0!==r&&""!==r){u='
";let t='';g+=u+t,f+=u+t;let s=0,i=0,l=1;a.queryStart;for(let t=0,n=r.length;t
",g+=u,f+=u}u='
";let t='';g+=u+t,f+=u+t;let s=a.queryStart;for(let t=0,i=l.length;t-":(void 0===a.fullpos2ConsTargetpos||void 0===a.fullpos2ConsTargetpos[t]||a.residues.hasOwnProperty(e+"_"+a.fullpos2ConsTargetpos[t].pos)||(i=i.toLowerCase()),g+=''+i+"",++s)}let o=a.firstAtomObjCls.getFirstCalphaAtomObj(a.chains[e]),d=void 0===o.color||"FFFFFF"===o.color.getHexString()?"DDDDDD":o.color.getHexString(),c=void 0!==o.color?d:"CCCCCC",h=[],p=[],m="-";for(let e=0,t=l.length;e
",g+=u,f+=u}if(g+="",f+="",b+="",a.giSeq[e].length>10){let t=a.firstAtomObjCls.getFirstCalphaAtomObj(a.chains[e]);if((void 0!==d.cfg.mmdbid||void 0!==d.cfg.gi||void 0!==d.cfg.blast_rep_id||void 0!==d.cfg.align||void 0!==d.cfg.chainalign||void 0!==d.cfg.mmdbafid)&&void 0!==t.resi_ori&&t.resi_ori!=t.resi&&-1==e.indexOf("Misc")){u='
",g+=u+'',a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e],"-"));for(let t=0,s=o.length;t",e%10==0&&(g+=e+" "),g+=""}else g+=""}a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqEndLen[e],"-")),g+='',g+="",g+="
",g+="
",r+=c+'';let h=!1;for(let s=0,l=e.length;s
",r+="",A="-",x="--";for(let t=0,s=r.length;t0&&(T=1,t=i.getGraphCls.getNodeTopBottom(c[e],d,void 0,T,g[e]),h[e]=t.nodeArray1,m[e]=t.nodeArray2,d=n.hashUtilsCls.unionHash(d,t.name2node),T=2,t=i.getGraphCls.getNodeTopBottom(c[e],d,void 0,T,y[e]),f[e]=t.nodeArray1,b[e]=t.nodeArray2,d=n.hashUtilsCls.unionHash(d,t.name2node)),k[e]=l[e].length,O[e]=o[e].length,R=Math.max(R,O[e]),I.push(p[e])}let E,P,M,D,H,F=1,L=3*F,N=7*F,q=10,U=10,$=30,j=20;t?(M=(n.utilsCls.sumArray(k)+2*I.length)*(L+N)+4*U+2*$+j*I.length,P=(R+2)*(L+N)+2*q+$):(E=110+j,M=E*I.length,P=(R+2)*(L+N)+2*q,P+=20),Object.keys(i.chainsMapping).length>0&&(M*=3),t?(i.scatterplotWidth=2*P,H=i.scatterplotWidth,D=n.scatterplotid):(i.linegraphWidth=2*P,H=i.linegraphWidth,D=n.linegraphid),s=0==I.length?"No interactions found for each structure
":"2D integration graph for "+I.length+" structure(s) "+I+'. There are three sections: "Interactions", "Common interactions", and "Different interactions". Each section has '+I.length+" graphs.
",s+=""}else if(t){let e,t,l,c,h=p[0],m=o.length,u=a.length,g=1,f=3*g,b=7*g,C=30;t=(m+2)*(f+b)+2*10+C,e=(u+2)*(f+b)+2*10+C,i.scatterplotWidth=2*e,c=i.scatterplotWidth,l=n.scatterplotid,s=r.length>0?"":"No interactions found for these two sets
",s+=""}else{let e=p[0],t=o.length,l=a.length,c=1,h=3*c,m=7*c,u=110,g=10,f=t>l?t*(h+m)+2*g:l*(h+m)+2*g;i.linegraphWidth=2*f,s=r.length>0?"":"No interactions found for these two sets
",s+=""}return i.lineGraphStr+="}\n",i.scatterplotStr=i.lineGraphStr,t?$("#"+i.pre+"scatterplotDiv").html(s):$("#"+i.pre+"linegraphDiv").html(s),s}drawGraphPerType(e,t,s,i,n,l,r,o,a,d,c,h,p,m){let u=this.icn3d;u.icn3dui;let g,f,b="",C=2==t.length&&"2"==t[1].replace(t[0],"");0==e?(g="Interactions in ",f=""):1==e?(g="Common interactions in ",f="_common"):2==e&&(g="Different interactions in ",f="_diff");for(let y=0,v=t.length;y
",E=p.resid2specCls.atoms2residues(Object.keys(C)),P=p.resid2specCls.atoms2residues(Object.keys(y)),M="select "+p.resid2specCls.residueids2spec(E),D="select "+p.resid2specCls.residueids2spec(P);T+="Set 1: "+e+'
',T+="Set 2: "+t+'
',T+='
';let H=p.resid2specCls.atoms2residues(Object.keys(R)),F=p.resid2specCls.atoms2residues(Object.keys(I)),L="select "+p.resid2specCls.residueids2spec(H),N="select "+p.resid2specCls.residueids2spec(F);T+='interface_1
',T+='interface_2
';let q=T;if(("graph"==i||"linegraph"==i||"scatterplot"==i||b)&&(T=""),T+=O,"save1"==i||"save2"==i){T=q;let e="";"save1"==i?e="Set 1":"save2"==i&&(e="Set 2"),T+='
Interactions Sorted on '+e+': 0&&l!=a&&(i.push({res1:a,res2:w,cntHbond:f,cntIonic:b,cntContact:C,cntHalegen:y,cntPication:v,cntPistacking:_}),o+=this.getInteractionPerResidue(d,c,h,p,m,u,g,f,b,C,y,v,_),c="",h="",p="",m="",u="",g="",f=0,b=0,C=0,y=0,v=0,_=0,w=""),x=t.resids2inter[S].hbond,k=this.getInteractionPairDetails(x,e,"hbond"),c+=k.html,f+=k.cnt,k.cnt>0&&(w+=r+":hbond_"+k.cnt+" "),x=t.resids2inter[S].ionic,k=this.getInteractionPairDetails(x,e,"ionic"),h+=k.html,b+=k.cnt,k.cnt>0&&(w+=r+":ionic_"+k.cnt+" "),x=t.resids2inter[S].contact,k=this.getContactPairDetails(x,e,"contact"),p+=k.html,C+=k.cnt,k.cnt>0&&(w+=r+":contact_"+k.cnt+" "),x=t.resids2inter[S].halogen,k=this.getInteractionPairDetails(x,e,"halogen"),m+=k.html,y+=k.cnt,k.cnt>0&&(w+=r+":halogen_"+k.cnt+" "),x=t.resids2inter[S]["pi-cation"],k=this.getInteractionPairDetails(x,e,"pi-cation"),u+=k.html,v+=k.cnt,k.cnt>0&&(w+=r+":pi-cation_"+k.cnt+" "),x=t.resids2inter[S]["pi-stacking"],k=this.getInteractionPairDetails(x,e,"pi-stacking"),g+=k.html,_+=k.cnt,k.cnt>0&&(w+=r+":pi-stacking_"+k.cnt+" "),a=l,d=O}i.push({res1:a,res2:w,cntHbond:f,cntIonic:b,cntContact:C,cntHalegen:y,cntPication:v,cntPistacking:_}),o+=this.getInteractionPerResidue(d,c,h,p,m,u,g,f,b,C,y,v,_);let S="";if(n.length>0){S+='',S+="
",S+="Residue # Hydrogen
Bond# Salt Bridge
/Ionic Interaction# Contact ",S+="# Halogen
Bond# π-Cation # π-Stacking ",S+="Hydrogen Bond (backbone atoms: @CA, @N, @C, @O) Salt Bridge/Ionic Interaction Contact ",S+="Halogen Bond π-Cation π-Stacking ";let e=' ",S+="",S+=o,S+=" ';S+=e,S+=e,S+='Atom1 Atom2 Distance(Å) Highlight in 3D ',S+=e,S+=e,S+=e,S+="Atom1 Atom2 # Contacts Min Distance(Å) C-alpha Distance(Å) Highlight in 3D
"}return{html:S,bondCnt:i}}getInteractionPerResidue(e,t,s,i,n,l,r,o,a,d,c,h,p){this.icn3d.icn3dui;let m="";m+=' ",m}getInteractionPairDetails(e,t,s){let i=this.icn3d;i.icn3dui;let n="",l=0,r=' ';if(void 0!==e)for(let a in e){let d=a.split(","),c="save1"==t?d[0]:d[1],h="save1"==t?d[1]:d[0],p=i.getGraphCls.convertLabel2Resid(c),m=i.firstAtomObjCls.getFirstAtomObj(i.residues[p]),u=m.color?m.color.getHexString():"",g=i.getGraphCls.convertLabel2Resid(h),f=i.firstAtomObjCls.getFirstAtomObj(i.residues[g]),b=f.color?f.color.getHexString():"",C=Math.sqrt(e[a]).toFixed(1);n+=''+e[3]+e[2]+" "+o+" "+a+" "+d+" "+c+" "+h+" "+p+" ";let u=[t,s,i,n,l,r];for(let e in u){m+=' "}return m+="'+u[e]+"
",++l}return{html:n,cnt:l}}getContactPairDetails(e,t){let s=this.icn3d;s.icn3dui;let i="",n=0,l=' ';if(void 0!==e)for(let o in e){let a=o.split(","),d="save1"==t?a[0]:a[1],c="save1"==t?a[1]:a[0],h=s.getGraphCls.convertLabel2Resid(d),p=s.firstAtomObjCls.getFirstAtomObj(s.residues[h]),m=p.color?p.color.getHexString():"",u=s.getGraphCls.convertLabel2Resid(c),g=s.firstAtomObjCls.getFirstAtomObj(s.residues[u]),f=g.color?g.color.getHexString():"",b=e[o].split("_"),C=b[0],y=b[1],v=b[2],_=b[3],w=b[4];i+=' '+c+r+u+o+' '+h+r+b+o+' '+C+" ",n+='',n+=" ",n+=parseInt(w)}return{html:i,cnt:n}}exportInteractions(){var e=this.icn3d,t=e.icn3dui;let s=' '+d+"@"+v+l+m+r+' '+c+"@"+_+l+f+r+' '+w+' '+C+' '+y+" ",i+='',i+="
Interacting residues: ';for(let t in e.chainname2residues)for(let i in e.chainname2residues[t]){let n=t.substr(0,t.indexOf("_"))+"_"+i.substr(0,i.indexOf(" "));s+="Base Chain: Residues Interacting Chain "}s+=""+t+": ",s+=e.resid2specCls.residueids2spec(e.chainname2residues[t][i]),s+=" "+n+" "+n[e]+" Cys "+n[e+1]+" Cys ",++i}}let n='
'+i+" disulfide pairs: ";n+=s,n+="Residue ID 1 Residue ID 2 "+r+" "+t.resn+" "+o+" "+n.resn+" ",++i}n[r+"_"+o]=1,n[o+"_"+r]=1}}let l='
'+i+" cross-linkage pairs: ";l+=s,l+="Residue ID 1 Residue ID 2 ",++l}}let a=' '+t+r+d+o+' '+i+r+h+o+' '+p+" ","view"==e&&(n+=''),n+="
'+l+" hydrogen bond pairs (backbone atoms: @CA, @N, @C, @O):
";if(l>0&&(a+=" ",a+=n,a+="Atom 1 Atom 2 Distance(Å) ","view"==e&&(a+='Highlight in 3D '),a+="
"),"graph"==e||"linegraph"==e||"scatterplot"==e){return s.getGraphCls.getGraphLinks(s.resid2ResidhashHbond,s.resid2ResidhashHbond,i.htmlCls.hbondColor,t,i.htmlCls.hbondValue)}return a}exportSaltbridgePairs(e,t){var s=this.icn3d,i=s.icn3dui;let n="",l=0,r=' ';for(let t in s.resid2ResidhashSaltbridge){let i=s.getGraphCls.convertLabel2Resid(t),a=s.firstAtomObjCls.getFirstAtomObj(s.residues[i]),d=a.color?a.color.getHexString():"";for(let i in s.resid2ResidhashSaltbridge[t]){let a=s.getGraphCls.convertLabel2Resid(i),c=s.firstAtomObjCls.getFirstAtomObj(s.residues[a]),h=c.color?c.color.getHexString():"",p=Math.sqrt(s.resid2ResidhashSaltbridge[t][i]).toFixed(1);n+=' ",++l}}let a=' '+t+r+d+o+' '+i+r+h+o+' '+p+" ","view"==e&&(n+=''),n+="
'+l+" salt bridge/ionic interaction pairs:
";if(l>0&&(a+=" ",a+=n,a+="Atom 1 Atom 2 Distance(Å) ","view"==e&&(a+='Highlight in 3D '),a+="
"),"graph"==e||"linegraph"==e||"scatterplot"==e){return s.getGraphCls.getGraphLinks(s.resid2ResidhashSaltbridge,s.resid2ResidhashSaltbridge,i.htmlCls.ionicColor,t,i.htmlCls.ionicValue)}return a}exportHalogenPiPairs(e,t,s){var i=this.icn3d,n=i.icn3dui;let l,r,o,a="",d=0,c=' ';"halogen"==s?(l=i.resid2ResidhashHalogen,r=n.htmlCls.halogenColor,o=n.htmlCls.halogenValue):"pi-cation"==s?(l=i.resid2ResidhashPication,r=n.htmlCls.picationColor,o=n.htmlCls.picationValue):"pi-stacking"==s&&(l=i.resid2ResidhashPistacking,r=n.htmlCls.pistackingColor,o=n.htmlCls.pistackingValue);for(let t in l){let n=i.getGraphCls.convertLabel2Resid(t),r=i.firstAtomObjCls.getFirstAtomObj(i.residues[n]),o=r.color?r.color.getHexString():"";for(let n in l[t]){let r=i.getGraphCls.convertLabel2Resid(n),p=i.firstAtomObjCls.getFirstAtomObj(i.residues[r]),m=p.color?p.color.getHexString():"",u=Math.sqrt(l[t][n]).toFixed(1);a+=' ",++d}}let p=' '+t+c+o+h+' '+n+c+m+h+' '+u+" ","view"==e&&(a+=''),a+="
'+d+" "+s+" pairs:
";if(d>0&&(p+=" ",p+=a,p+="Atom 1 Atom 2 Distance(Å) ","view"==e&&(p+='Highlight in 3D '),p+="
"),"graph"==e||"linegraph"==e||"scatterplot"==e){return i.getGraphCls.getGraphLinks(l,l,r,t,o)}return p}exportSpherePairs(e,t,s){var i=this.icn3d,n=i.icn3dui;let l="",r=0,o=e?i.resid2ResidhashInteractions:i.resid2ResidhashSphere,a=' ';for(let s in o){let n=i.getGraphCls.convertLabel2Resid(s),c=i.firstAtomObjCls.getFirstAtomObj(i.residues[n]),h=c.color?c.color.getHexString():"";for(let n in o[s]){let p=i.getGraphCls.convertLabel2Resid(n),m=i.firstAtomObjCls.getFirstAtomObj(i.residues[p]),u=m.color?m.color.getHexString():"",g=o[s][n].split("_"),f=g[0],b=g[1];c=g[2],m=g[3];let C=g[4];e?(l+=' "):l+=" '+s+"@"+c+a+h+d+' '+n+"@"+m+a+u+d+' '+C+' '+f+' '+b+" ","view"==t&&(l+=''),l+=" ",++r}}let c='"+s+" "+n+' '+C+' '+f+' '+b+"
'+r+" residue pairs in "+(e?"the contacts":"sphere")+":
";if(r>0&&(e?(c+=' "):c+='Residue 1 Residue 2 Num Contacts Min Distance(Å) C-alpha Distance(Å) ',"view"==t&&(c+='Highlight in 3D '),c+=" ',c+=l,c+="Residue 1 Residue 2 Num Contacts Min Distance(Å) C-alpha Distance(Å)
"),"graph"==t||"linegraph"==t||"scatterplot"==t||"calpha"==t||"cbeta"==t||"heavyatoms"==t){return i.getGraphCls.getGraphLinks(o,o,n.htmlCls.contactColor,s,n.htmlCls.contactValue)}return c}}class $t{constructor(e){this.icn3d=e}drawGraph(e,t){var s=this.icn3d,i=s.icn3dui;if(void 0===n)var n=d3;var l=JSON.parse(e),r=$("#"+t).width(),o=$("#"+t).height(),a=isNaN(r)?300:1*r,d=isNaN(o)?300:1*o,c=r,h=o,p=d3.select("#"+i.svgid).attr("width",r).attr("height",o).attr("viewBox","0,0,"+a+","+d);p.selectAll(".g-main").remove();var m=p.append("g").classed("g-main",!0),u=m.append("rect").attr("width",c).attr("height",h).style("fill","#FFF"),g=m.append("g"),f=n.zoom().on("zoom",(function(){g.attr("transform",n.event.transform)}));if(m.call(f),l.links){for(var b=[],C={},y=0,v=l.nodes.length;y
",i+="",g+="}\n",t){n.alignerrormapStr=g,$("#"+n.pre+"alignerrormapDiv").html(i);let e=$("#"+l.alignerrormapid+"_scale").val();$("#"+l.alignerrormapid).attr("width",(n.alignerrormapWidth*parseFloat(e)).toString()+"px")}else n.contactmapStr=g,$("#"+n.pre+"contactmapDiv").html(i);return i}}class Bt{constructor(e){this.icn3d=e}async downloadAlignment(e,t){let s=this.icn3d,i=s.icn3dui,n=this;s.opts.proteins="c alpha trace";let l=e.split(","),r="ids="+e,o=i.htmlCls.baseUrl+"vastplus/vastplus.cgi?v=3&cmd=c&b=1&s=1&w3d&"+r;void 0!==i.cfg.inpara&&(o+=i.cfg.inpara),s.pdbid_chain2title={},void 0===s.chainids2resids&&(s.chainids2resids={});let a={},d="These two MMDB IDs "+l+' do not have 3D alignment data in the VAST+ database. You can try the VAST alignment by visiting the VAST+ page https://www.ncbi.nlm.nih.gov/Structure/vastplus/vastplus.cgi?uid=[PDB ID] (e.g., uid=1KQ2), and clicking "Original VAST"',c=await i.getAjaxPromise(o,"jsonp",!0,d);if(a=c.seqalign,void 0===a)return alert(d),!1;s.pdbid_molid2chain={},s.chainsColor={};for(let e=0,t=2;e5){let s=!0,i=!0;c=await r.pdbParserCls.loadPdbData(t[e],l,!1,s,"query",h,i)}else{let s=!0;c=await r.mmdbParserCls.parseMmdbData(t[e],"query",i[e+1],e,h,s)}d=o.hashUtilsCls.unionHash(d,c)}if(o.cfg.resnum)await r.realignParserCls.realignChainOnSeqAlign(s,i);else if(o.cfg.resdef)await r.realignParserCls.realignChainOnSeqAlign(s,i,void 0,!0);else{await r.pdbParserCls.applyCommandDssp(!0);for(let e in r.pdbChainIndexHash){let t=r.pdbChainIndexHash[e].split("_");l=t[0],t[1],n=t[2],t[3],a.transformStructure(l,e-1,"query")}let e=[],t=[],c=[],h=o.htmlCls.baseUrl+"vastdyn/vastdyn.cgi",p=o.htmlCls.baseUrl+"tmalign/tmalign.cgi";for(let s in r.afChainIndexHash){let i=r.afChainIndexHash[s].split("_");l=i[0];let a=i[1];n=i[2];let d,m=i[3];if("tmalign"!=o.cfg.aligntool){let e={domains1:r.domain3dCls.getDomainJsonForAlign(r.chains[l+"_"+a]),domains2:r.domain3dCls.getDomainJsonForAlign(r.chains[n+"_"+m])};d=o.getAjaxPostPromise(h,e)}else{let e={pdb_query:r.saveFileCls.getAtomPDB(r.chains[l+"_"+a]),pdb_target:r.saveFileCls.getAtomPDB(r.chains[n+"_"+m])};d=o.getAjaxPostPromise(p,e)}e.push(d),t.push(s-1),c.push(l)}let m=Promise.allSettled(e),u=await m;await a.downloadChainalignmentPart2b(s,i,d,u,t,n,c)}}async downloadChainalignmentPart2b(e,t,s,i,n,l,r){let o=this.icn3d,a=o.icn3dui;for(let e=0,t=i.length;e
",r.tmscore=e[0].score.toPrecision(4)),$("#"+r.pre+"dl_rmsd_html").html(n),o.cfg.bSidebyside||o.htmlCls.dialogCls.openDlg("dl_rmsd","RMSD of alignment"),a=!0}return a}async loadOpmDataForChainalign(e,t,s,i){let n=this.icn3d,l=n.icn3dui,r=this;if(l.cfg.resnum||l.cfg.resdef)n.bCommandLoad||n.init(),await this.downloadChainalignmentPart2(e,t,void 0,s);else{let o=l.htmlCls.baseUrl+"vastdyn/vastdyn.cgi?mmdbids2opm="+i.join("','"),a=await l.getAjaxPromise(o,"jsonp");if(a&&a.mmdbid){let i=a.mmdbid;n.selectedPdbid=i;let o="https://opm-assets.storage.googleapis.com/pdb/"+i.toLowerCase()+".pdb",d=await l.getAjaxPromise(o,"text");n.bOpm=!0;let c=!0,h=n.loadPDBCls.loadPDB(d,i,n.bOpm,c);$("#"+n.pre+"selectplane_z1").val(n.halfBilayerSize),$("#"+n.pre+"selectplane_z2").val(-n.halfBilayerSize),$("#"+n.pre+"extra_mem_z").val(n.halfBilayerSize),$("#"+n.pre+"intra_mem_z").val(-n.halfBilayerSize),n.bCommandLoad||n.init(),await r.downloadChainalignmentPart2(e,t,h,s)}else n.bCommandLoad||n.init(),await r.downloadChainalignmentPart2(e,t,void 0,s)}}async downloadMmdbAf(e,t,s){let i=this.icn3d,n=i.icn3dui;i.structArray=i.structures?Object.keys(i.structures):[],0==i.structArray.length?i.init():(i.resetConfig(),i.bResetAnno=!0,i.bResetSets=!0);let l=e.split(","),r=[];for(let e=0,t=l.length;e1&&($("#"+i.pre+"assemblyWrapper").show(),i.asuCnt=i.biomtMatrices.length);let d,c,h,p,m,u,g,f,b,C,y,v,_,w,S,A,x,k,O,R={},I=[],T="coil",E="",P=0,M=0,D={onModel:function(e){d=0===e.modelIndex?a:a+(e.modelIndex+1).toString()},onChain:function(e){c=e.chainName;let t=d+"_"+c;void 0===i.structures[d]&&(i.structures[d]=[]),i.structures[d].push(t)},onGroup:function(e){h=e.groupName,p=e.groupId;let t=d+"_"+c+"_"+p;m=0===e.secStruct||2===e.secStruct||4===e.secStruct?"helix":3===e.secStruct?"sheet":-1===e.secStruct?"other":"coil";let s=!1;if(c!==E){if(x=void 0,O=void 0,"coil"!==m&&"other"!==m?(u=!0,g=!1):(u=!1,g=!1),"coil"!==T&&"other"!==T){let e=d+"_"+E+"_"+P.toString();for(let t in i.residues[e])i.atoms[t].ssbegin=!1,i.atoms[t].ssend=!0}}else x=A,O=k,m!==T?"coil"===T||"other"===T?(u=!0,g=!1):"coil"===m||"other"===m?(s=!0,u=!1,g=!1):("sheet"===T&&"helix"===m||"helix"===T&&"sheet"===m)&&(s=!0,u=!0,g=!1):(u=!1,g=!1);if(s&&!isNaN(p)){let e=d+"_"+c+"_"+(p-1).toString();for(let t in i.residues[e])i.atoms[t].ssbegin=!1,i.atoms[t].ssend=!0}T=m,E=c,P=p,f=!1,b=!1,C=!1,"non-polymer"===e.chemCompType.toLowerCase()||"other"===e.chemCompType.toLowerCase()||-1!==e.chemCompType.toLowerCase().indexOf("saccharide")?f=!0:-1!==e.chemCompType.toLowerCase().indexOf("peptide")?b=!0:-1!==e.chemCompType.toLowerCase().indexOf("dna")||-1!==e.chemCompType.toLowerCase().indexOf("rna")?C=!0:b=!0;let l=d+"_"+c,r={};r.resi=p,r.name=n.utilsCls.residueName2Abbr(h),i.residueId2Name[t]=r.name,r.resi%10==0&&r.resi.toString();let o="-";"helix"===m?o="H":"sheet"===m?o="E":"coil"===m?o="c":"other"===m&&(o="o"),void 0===i.chainsSeq[l]&&(i.chainsSeq[l]=[]),i.bFullUi&&i.chainsSeq[l].push(r),i.secondaries[t]=o},onAtom:function(e){if(y=e.element,v=e.atomName,_=new THREE.Vector3(e.xCoord,e.yCoord,e.zCoord),w=e.bFactor,S=e.altLoc,"\0"===e.altLoc&&(S=""),""===S||"A"===S){++M,"SG"===v&&I.push(M),R[e.atomIndex]=M;let t={het:f,serial:M,name:v,alt:S,resn:h,structure:d,chain:c,resi:p,coord:_,b:w,elem:y,bonds:[],bondOrder:[],ss:m,ssbegin:u,ssend:g};if(t.het||"C"!==t.name||(A=M),t.het||"O"!==t.name||(k=M),!t.het&&"N"===t.name&&void 0!==x&&void 0!==O){let e=i.atoms[x].coord.distanceTo(i.atoms[O].coord),s=t.coord.x+(i.atoms[x].coord.x-i.atoms[O].coord.x)/e,n=t.coord.y+(i.atoms[x].coord.y-i.atoms[O].coord.y)/e,l=t.coord.z+(i.atoms[x].coord.z-i.atoms[O].coord.z)/e;t.hcoord=new THREE.Vector3(s,n,l)}i.atoms[M]=t,l.min(_),r.max(_),o.add(_);let a=d+"_"+c,T=a+"_"+p;void 0===i.chains[a]&&(i.chains[a]={}),i.chains[a][M]=1,void 0===i.residues[T]&&(i.residues[T]={}),i.residues[T][M]=1,b?(i.proteins[M]=1,"CA"===v&&(i.calphas[M]=1),"N"!==v&&"H"!==v&&"CA"!==v&&"HA"!==v&&"C"!==v&&"O"!==v&&(i.sidec[M]=1)):C?(i.nucleotides[M]=1,(!s||"O3'"!=v&&"O3*"!=v)&&(s||"P"!=v)||(i.nucleotidesO3[M]=1),-1===n.parasCls.nuclMainArray.indexOf(v)&&(i.ntbase[M]=1)):y.toLowerCase()===h.toLowerCase()?i.ions[M]=1:"HOH"===h||"WAT"===h||"SQL"===h||"H2O"===h||"W"===h||"DOD"===h||"D3O"===h?i.water[M]=1:i.chemicals[M]=1,i.dAtoms[M]=1,i.hAtoms[M]=1}},onBond:function(e){let t=R[e.atomIndex1],s=R[e.atomIndex2];if(R.hasOwnProperty(e.atomIndex1)&&R.hasOwnProperty(e.atomIndex2)&&(i.atoms[t].bonds.push(s),i.atoms[s].bonds.push(t),f)){let n=e.bondOrder;i.atoms[t].bondOrder.push(n),i.atoms[s].bondOrder.push(n),2===n?(i.doublebonds[t+"_"+s]=1,i.doublebonds[s+"_"+t]=1):3===n&&(i.triplebonds[t+"_"+s]=1,i.triplebonds[s+"_"+t]=1)}}};MMTF.traverse(e,D),i.loadPDBCls.setResidMapping();for(let e=0,t=I.length;e5){let e=r.cfg.chainalign.split(",");e.length>0&&(l.hAtoms=l.definedSetsCls.getAtomsFromNameArray(e)),r.cfg.aligntool="tmalign",await l.realignParserCls.realignOnStructAlign()}else l.hAtoms=l.chainalignParserCls.setMsa(e),l.transformCls.zoominSelection(),await l.chainalignParserCls.downloadChainalignmentPart3(void 0,e,l.hAtoms)}async parseChainRealignData(e,t,s,i,n,l,r){let o=this.icn3d,a=o.icn3dui,d=s[0].substr(0,s[0].indexOf("_"));r||(d=d.toUpperCase());let c={};o.realignResid={},o.opts.color="grey",o.setColorCls.setColorByOptions(o.opts,o.dAtoms),o.qt_start_end=[];for(let t=0,h=e.length;t9||s<0)return n*i|0;i=10*i+s|0}return n*i}function u(e,t,s){let i=1,n=0,l=0,r=1;for(45===e.charCodeAt(t)&&(i=-1,++t);t=0&&o<10)){if(-2===o){for(++t;t=0&&o<10))return 53===o||21===o?parseScientific(i*(n+l/r),e,t+1,s):i*(n+l/r);l=10*l+o,r*=10,++t}return i*(n+l/r)}if(53===o||21===o)return parseScientific(i*n,e,t+1,s);break}n=10*n+o,++t}return i*n}let g=function(){function e(e){this.data=e,this.isDefined=!0}return e.prototype.getString=function(e){return""+this.data[e]},e.prototype.getInteger=function(e){return 0|this.data[e]},e.prototype.getFloat=function(e){return 1*this.data[e]},e.prototype.stringEquals=function(e,t){return this.data[e]===u(t,0,t.length)},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return 0},e}(),f=function(){function e(e,t){this.data=e,this.mask=t,this.isDefined=!0}return e.prototype.getString=function(e){return 0===this.mask[e]?""+this.data[e]:null},e.prototype.getInteger=function(e){return 0===this.mask[e]?this.data[e]:0},e.prototype.getFloat=function(e){return 0===this.mask[e]?this.data[e]:0},e.prototype.stringEquals=function(e,t){return 0===this.mask[e]?this.data[e]===u(t,0,t.length):null==t},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return this.mask[e]},e}(),b=function(){function e(e){this.data=e,this.isDefined=!0}return e.prototype.getString=function(e){return this.data[e]},e.prototype.getInteger=function(e){let t=this.data[e];return m(t,0,t.length)},e.prototype.getFloat=function(e){let t=this.data[e];return u(t,0,t.length)},e.prototype.stringEquals=function(e,t){return this.data[e]===t},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return 0},e}(),C=function(){function e(e,t){this.data=e,this.mask=t,this.isDefined=!0}return e.prototype.getString=function(e){return 0===this.mask[e]?this.data[e]:null},e.prototype.getInteger=function(e){if(0!==this.mask[e])return 0;let t=this.data[e];return m(t||"",0,(t||"").length)},e.prototype.getFloat=function(e){if(0!==this.mask[e])return 0;let t=this.data[e];return u(t||"",0,(t||"").length)},e.prototype.stringEquals=function(e,t){return this.data[e]===t},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return this.mask[e]},e}(),y=function(){function e(e){this.dataBlocks=e.dataBlocks.map((function(e){return new i(e)}))}return e.prototype.toJSON=function(){return this.dataBlocks.map((function(e){return e.toJSON()}))},e}();return new y(s)}MessagePackParse(e){this.icn3d.icn3dui;let t=this;function s(e,s){let i={};for(let n=0;n0&&(i[i.length]=l.slice(0,a).join(""));return i.join("")}(e.buffer,e.offset,t);return e.offset+=t,s}let r=function(){let e=[];for(let t=0;t<1024;t++)e[t]=String.fromCharCode(t);return e}();let o,a,d=e.buffer[e.offset];if(0==(128&d))return e.offset++,d;if(128==(240&d))return a=15&d,e.offset++,s(e,a);if(144==(240&d))return a=15&d,e.offset++,n(e,a);if(160==(224&d))return a=31&d,e.offset++,l(e,a);if(224==(224&d))return o=e.dataView.getInt8(e.offset),e.offset++,o;switch(d){case 192:return e.offset++,null;case 194:return e.offset++,!1;case 195:return e.offset++,!0;case 196:return a=e.dataView.getUint8(e.offset+1),e.offset+=2,i(e,a);case 197:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,i(e,a);case 198:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,i(e,a);case 202:return o=e.dataView.getFloat32(e.offset+1),e.offset+=5,o;case 203:return o=e.dataView.getFloat64(e.offset+1),e.offset+=9,o;case 204:return o=e.buffer[e.offset+1],e.offset+=2,o;case 205:return o=e.dataView.getUint16(e.offset+1),e.offset+=3,o;case 206:return o=e.dataView.getUint32(e.offset+1),e.offset+=5,o;case 208:return o=e.dataView.getInt8(e.offset+1),e.offset+=2,o;case 209:return o=e.dataView.getInt16(e.offset+1),e.offset+=3,o;case 210:return o=e.dataView.getInt32(e.offset+1),e.offset+=5,o;case 217:return a=e.dataView.getUint8(e.offset+1),e.offset+=2,l(e,a);case 218:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,l(e,a);case 219:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,l(e,a);case 220:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,n(e,a);case 221:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,n(e,a);case 222:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,s(e,a);case 223:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,s(e,a)}}}class ss{constructor(e){this.icn3d=e}alignCoords(e,t,s,i,n,l,r,o){let a,d=this.icn3d,c=d.icn3dui,h=e.length
Realignment RMSD: "+a.toPrecision(4)+" Å
";d.bAfMem&&!c.cfg.chainalign&&(e+=c.utilsCls.getMemDesc()),$("#"+d.pre+"dl_rmsd_html").html(e),c.cfg.bSidebyside||c.htmlCls.dialogCls.openDlg("dl_rmsd","Realignment RMSD")}let r={};for(let n=0,l=d.structures[s].length;n
"+t.diagram2dCls.set2DdgmNote(),$("#"+t.pre+"dl_2ddgm_html").html(t.html2ddgm)),t.b2DShown=!0}showLoading(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"wait")&&$("#"+e.pre+"wait").show(),$("#"+e.pre+"canvas")&&$("#"+e.pre+"canvas").hide(),$("#"+e.pre+"cmdlog")&&$("#"+e.pre+"cmdlog").hide()}hideLoading(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"wait")&&$("#"+e.pre+"wait").hide(),$("#"+e.pre+"canvas")&&$("#"+e.pre+"canvas").show(),$("#"+e.pre+"cmdlog")&&$("#"+e.pre+"cmdlog").show()}setYourNote(e){let t=this.icn3d,s=t.icn3dui;t.yournote=e,$("#"+t.pre+"yournote").val(t.yournote),s.cfg.shownote&&(document.title=t.yournote)}transformToOpmOri(e){let t=this.icn3d;if(t.icn3dui,void 0!==t.rmsd_supr&&void 0!==t.rmsd_supr.rot){let s=t.rmsd_supr.rot,i=t.rmsd_supr.trans1,n=t.rmsd_supr.trans2;t.rmsd_supr.rmsd;let l=0;for(let e in t.atoms){let r=t.atoms[e];r.coord=t.surfaceCls.transformMemPro(r.coord,s,i,n);let o=r.coord.x*r.coord.x+r.coord.y*r.coord.y;Math.abs(r.coord.z)<=25&&o>l&&(l=o)}this.addMemAtoms(t.halfBilayerSize,e,Math.sqrt(l)),t.bStopRotate=!0,t.bOpm=!0,$("#"+t.pre+"togglememli").show(),$("#"+t.pre+"adjustmemli").show(),$("#"+t.pre+"selectplaneli").show()}else t.bOpm=!1}transformToOpmOriForAlign(e,t,s){let i=this.icn3d,n=i.icn3dui;if(void 0!==t){let l=i.loadPDBCls.getChainCalpha(i.chains,i.atoms,s,e),r=1==Object.keys(l.chainresiCalphaHash).length||1==Object.keys(t.chainresiCalphaHash).length,o=[],a=[];for(let e in l.chainresiCalphaHash)if(t.chainresiCalphaHash.hasOwnProperty(e)){let s=l.chainresiCalphaHash[e],i=t.chainresiCalphaHash[e];if((s.length==i.length||r)&&(o=o.concat(s),a=a.concat(i)),o.length>500)break}let d=o.length=2?$("#"+e.pre+"mn2_alternateWrap").show():$("#"+e.pre+"mn2_alternateWrap").hide(),setTimeout((async function(){if(e.bInitial){if(void 0!==t.cfg.align||void 0!==t.cfg.chainalign){let s=e.pre+"selection";if($("#"+s).show(),$("#"+s+"_expand").hide(),$("#"+s+"_shrink").show(),void 0!==t.cfg.align&&2!=t.cfg.atype){let s=!1,i=t.htmlCls.alignSeqCls.getAlignSequencesAnnotations(Object.keys(e.alnChains),void 0,void 0,s);$("#"+e.pre+"dl_sequence2").html(i.sequencesHtml),$("#"+e.pre+"dl_sequence2").width(t.htmlCls.RESIDUE_WIDTH*i.maxSeqCnt+200)}}if(t.cfg.showanno){let s="view annotations";t.htmlCls.clickMenuCls.setLogCmd(s,!0),await e.showAnnoCls.showAnnotations()}(t.cfg.closepopup||t.cfg.imageonly)&&e.resizeCanvasCls.closeDialogs()}else e.hlUpdateCls.updateHlAll();$("#"+e.pre+"atomsCustom").length>0&&$("#"+e.pre+"atomsCustom")[0].blur(),e.bInitial=!1,t.cfg.imageonly&&e.saveFileCls.saveFile(void 0,"png",void 0,!0)}),0)}processCommand(){let e=this.icn3d,t=e.icn3dui;if(1==Object.keys(e.structures).length){let s=Object.keys(e.structures)[0];t.cfg.command=t.cfg.command.replace(new RegExp("!","g"),s+"_")}}getMassCenter(e,t){return this.icn3d.icn3dui,e.multiplyScalar(1/t)}getGeoCenter(e,t){return this.icn3d.icn3dui,e.clone().add(t).multiplyScalar(.5)}getStructureSize(e,t,s,i){let n=this.icn3d;n.icn3dui;let l=0;for(let r in e){let e=n.atoms[r].coord;if(Math.round(t.x)==Math.round(e.x)||Math.round(t.y)==Math.round(e.y)||Math.round(t.z)==Math.round(e.z)||Math.round(s.x)==Math.round(e.x)||Math.round(s.y)==Math.round(e.y)||Math.round(s.z)==Math.round(e.z)){let t=2*e.distanceTo(i);t>l&&(l=t)}}return l}async checkMemProteinAndRotate(){let e=this.icn3d,t=e.icn3dui;if(!e.bCheckMemProtein){e.bCheckMemProtein=!0;let s=t.cfg.afid?t.cfg.afid:t.cfg.mmdbafid;if(await e.ParserUtilsCls.checkMemProtein(s),t.cfg.url&&-1!=t.cfg.url.indexOf("membranome")){let t=new THREE.Vector3(1,0,0),s=-.5*Math.PI;e.transformCls.setRotation(t,s)}}}async checkMemProtein(e){let t=this.icn3d,s=t.icn3dui;try{let i=s.htmlCls.baseUrl+"vastdyn/vastdyn.cgi?afid2mem="+e,n=await s.getAjaxPromise(i,"jsonp");if(n&&n.pdbid){let e='This is a single-spanning (bitopic) transmembrane protein according to the Membranome database. Do you want to align the protein with the model from Membranome? If you click "OK", you can press the letter "a" to alternate the structures.';if("off"==s.cfg.afmem);else if("on"==s.cfg.afmem||confirm(e))try{let e="https://storage.googleapis.com/membranome-assets/pdb_files/proteins/"+n.pdbid+".pdb",i=await s.getAjaxPromise(e,"text");t.bAfMem=!0,s.bNode||$("#"+s.pre+"togglememli").show();let l=n.pdbid.substr(0,n.pdbid.indexOf("_")),r=!0,o=!0;await t.pdbParserCls.loadPdbData(i,l,r,o),o&&(t.bSetChainsAdvancedMenu&&t.definedSetsCls.showSets(),t.bAnnoShown&&await t.showAnnoCls.showAnnotations());let a=n.segment.replace(/ /gi,"").split("(")[0];t.afmem_start_end=a.split("-"),t.hAtoms={},t.dAtoms={};for(let e in t.atoms)t.atoms[e].structure!=l&&(t.hAtoms[e]=1),t.dAtoms[e]=1;for(let e=parseInt(t.afmem_start_end[0]);e<=parseInt(t.afmem_start_end[1]);++e)t.hAtoms=s.hashUtilsCls.unionHash(t.hAtoms,t.residues[l+"_A_"+e]);await t.realignParserCls.realignOnSeqAlign(l)}catch(e){return void console.log("Error in retrieving matched PDB from Membranome...")}}}catch(e){return void console.log("Error in finding matched PDB in Membranome...")}}getResi(e,t){let s=this.icn3d;s.icn3dui;let i=s.ncbi2resid[e+"_"+(t+1).toString()];return i?i.substr(i.lastIndexOf("_")+1):""}getResiNCBI(e,t){let s=this.icn3d;s.icn3dui;let i=s.resid2ncbi[e+"_"+t];return i?parseInt(i.substr(i.lastIndexOf("_")+1)):0}}class is{constructor(e){this.icn3d=e}loadAtomDataIn(e,t,s,i,n,l,r,o,a){let d=this.icn3d,c=d.icn3dui;d.pmin=new THREE.Vector3(9999,9999,9999),d.pmax=new THREE.Vector3(-9999,-9999,-9999),d.psum=new THREE.Vector3;let h=e.atoms,p=d.atoms?Object.keys(d.atoms).length:0,m={},u={};d.pmid=e.pubmedId,void 0===d.chainid2title&&(d.chainid2title={}),void 0===d.chainid2sid&&(d.chainid2sid={});let g={},f={};if("align"===s){d.pmid="",d.molTitle="",c.cfg.inpara&&-1!==c.cfg.inpara.indexOf("atype=1")?d.molTitle="Invariant Core Structure Alignment (VAST) of ":c.cfg.inpara&&-1!==c.cfg.inpara.indexOf("atype=2")?d.molTitle="Structure Alignment (TM-align) of ":d.molTitle="Structure Alignment (VAST) of ";let t=!1;for(let s=0,i=e.alignedStructures[0].length;s'+i.pdbId.toUpperCase()+"",void 0!==i.descr&&(d.pmid+=i.descr.pubmedid),0===s&&(d.molTitle+=" and ",void 0!==i.descr&&(d.pmid+="_")),t=!0}d.molTitle+=" from VAST+",t||(d.molTitle="")}else if(void 0!==e.descr&&(d.molTitle+=e.descr.name),"mmdbid"===s){let s=isNaN(t)?t:e.pdbId,i={};void 0===d.alignmolid2color&&(d.alignmolid2color=[]);let n=1;for(let t in e.moleculeInfor){if(0===Object.keys(e.moleculeInfor[t]).length)continue;let l=e.moleculeInfor[t].chain.trim();(parseInt(c.cfg.date)>=20231001||!c.cfg.date&&parseInt(c.utilsCls.getDateDigitStr())>=20231001)&&(l=l.replace(/_/g,""));let r=s+"_"+l;i.hasOwnProperty(l)?(++i[l],r+=i[l]):i[l]=1,void 0!==d.mmdbid_q&&(d.mmdbid_q,d.mmdbid_t);let o=e.moleculeInfor[t].kind,a=e.moleculeInfor[t].color,h=e.moleculeInfor[t].sid;if(g[r]=o,f[r]=a,"protein"==o&&(d.organism=e.moleculeInfor[t].taxonomyName.toLowerCase()),void 0!==h&&(d.chainid2sid[r]=h),void 0===d.pdbid_chain2title&&(d.pdbid_chain2title={}),d.pdbid_chain2title[r]=e.moleculeInfor[t].name,l==r.substr(r.lastIndexOf("_"))){let e={};e[t]=n.toString(),d.alignmolid2color.push(e)}++n}}"mmdbid"===s&&(d.molTitleHash||(d.molTitleHash={}),d.molTitleHash[t]=d.molTitle);let b,C,y,v,_,w={},S="",A="",x="",k="",O="",R="",I=0,T=0,E="",P=!0,M=!1,D="",H=c.utilsCls.isCalphaPhosOnly(h),F=0,L={};for(let e in h){++p,w[e]=p;let i,n=h[e];n.serial=p,"mmdbid"===s||"mmcifid"===s?i=t:"align"===s&&(i=m[p]);let l=!1;if(void 0!==n.chain||"mmdbid"!==s&&"align"!==s)n.chain=""===n.chain?"Misc":n.chain;else if("mmdbid"===s)if(b=n.ids.m,void 0!==d.molid2chain[b]){let e=d.molid2chain[b].indexOf("_");n.chain=d.molid2chain[b].substr(e+1)}else{let e="Misc";("protein"===g[O]&&"nucleotide"===g[O]&&n.resi!=T||"protein"!==g[O]&&"nucleotide"!==g[O]&&(n.resn.substr(0,3)!=E.substr(0,3)||n.resi!=T||"solvent"===g[O]||"HOH"===n.resn))&&++F,n.resi_ori=n.resi,n.resi=F,l=!0,n.chain=e}else if("align"===s)if(b=n.ids.m,void 0!==d.pdbid_molid2chain[i+"_"+b])n.chain=d.pdbid_molid2chain[i+"_"+b];else{let e="Misc";("protein"===g[O]&&"nucleotide"===g[O]&&n.resi!=T||"protein"!==g[O]&&"nucleotide"!==g[O]&&(n.resn.substr(0,3)!=E.substr(0,3)||n.resi!=T||"solvent"===g[O]||"HOH"===n.resn))&&(++F,n.resi_ori=n.resi,n.resi=F,l=!0),n.chain=e}if(n.chain=n.chain.trim(),(parseInt(c.cfg.date)>=20231001||!c.cfg.date&&parseInt(c.utilsCls.getDateDigitStr())>=20231001)&&(n.chain=n.chain.replace(/_/g,"")),"mmdbid"!==s&&"align"!==s||(n.structure=i,"mmdbid"===s&&void 0!==d.mmdbid_q&&(d.mmdbid_q,d.mmdbid_t)),k=n.structure,O=k+"_"+n.chain,"mmdbid"===s||"align"===s){l||(n.resi_ori=n.resi,d.bUsePdbNum?n.resi=n.resi_ori:n.resi=n.ids.r);let e=n.resn.indexOf(" ");-1!==e&&0!=e&&(n.resn=n.resn.substr(0,e))}O!==A&&(I=0),n.resi!==I&&(O!==A?(y=void 0,_=void 0):(y=C,_=v)),n.coord="mmdbid"===s?new THREE.Vector3(n.coord[0],n.coord[1],n.coord[2]):new THREE.Vector3(n.coord.x,n.coord.y,n.coord.z);let r=c.utilsCls.residueName2Abbr(n.resn.substr(0,3));"mmdbid"!==s&&"align"!==s||!d.bFullUi||(void 0===d.mmdbMolidResid2mmdbChainResi&&(d.mmdbMolidResid2mmdbChainResi={}),d.mmdbMolidResid2mmdbChainResi[i+"_"+n.ids.m+"_"+n.ids.r]=i+"_"+n.chain+"_"+n.resi),d.pmin.min(n.coord),d.pmax.max(n.coord),d.psum.add(n.coord);let o=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"protein"===g[O]:"p"===n.mt,a=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"nucleotide"===g[O]:"n"===n.mt,u=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"solvent"===g[O]:"s"===n.mt,N=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"ligand"===g[O]||void 0!==g[O]&&-1!==g[O].indexOf("other")||void 0===g[O]:"l"===n.mt;if("Misc"!==n.chain&&"other"!==g[O]||"protein"===L[O]||"nucleotide"===L[O]||("CA"===n.name&&"C"===n.elem?L[O]="protein":"P"===n.name&&"P"===n.elem?L[O]="nucleotide":L[O]="chemical"),o||a?(o?(d.proteins[p]=1,"CA"===n.name&&(d.calphas[p]=1),"N"!==n.name&&"H"!==n.name&&"CA"!==n.name&&"HA"!==n.name&&"C"!==n.name&&"O"!==n.name&&(d.sidec[p]=1)):a&&(d.nucleotides[p]=1,("O3'"==n.name||"O3*"==n.name||H&&"P"==n.name)&&(d.nucleotidesO3[p]=1),-1===c.parasCls.nuclMainArray.indexOf(n.name)&&(d.ntbase[p]=1)),n.het=!1):u?(d.water[p]=1,n.het=!0):N&&("HOH"===n.resn||"O"===n.resn?d.water[p]=1:n.elem===n.resn?d.ions[p]=1:d.chemicals[p]=1,n.het=!0),"mmdbid"===s?n.het?n.color=c.parasCls.atomColors[n.elem]||c.parasCls.defaultAtomColor:n.color=void 0!==f[O]?c.parasCls.thr(f[O]):c.parasCls.chargeColors[n.resn]:void 0!==n.color&&(n.color=c.parasCls.thr(n.color))," "!==n.resn.charAt(0)&&" "===n.resn.charAt(1)&&(n.resn=n.resn.charAt(0)),n.het||"C"!==n.name||(C=p),n.het||"O"!==n.name||(v=p),!n.het&&"N"===n.name&&void 0!==y&&void 0!==_){let e=d.atoms[y].coord.distanceTo(d.atoms[_].coord),t=n.coord.x+(d.atoms[y].coord.x-d.atoms[_].coord.x)/e,s=n.coord.y+(d.atoms[y].coord.y-d.atoms[_].coord.y)/e,i=n.coord.z+(d.atoms[y].coord.z-d.atoms[_].coord.z)/e;n.hcoord=new THREE.Vector3(t,s,i)}"HOH"==n.resn&&(d.water[p]=1),d.atoms[p]=n,d.dAtoms[p]=1,d.hAtoms[p]=1;let q=n.structure+"_"+n.chain;void 0===d.chains[q]&&(d.chains[q]={}),d.chains[q][p]=1;let U=q+"_"+n.resi;void 0===d.residues[U]&&(d.residues[U]={}),d.residues[U][p]=1,R=O+"_"+n.resi,R!==x&&O!==A&&(P=!0,""!==S&&(void 0===d.structures[S]&&(d.structures[S]=[]),d.structures[S].push(A))),d.residueId2Name[U]=r;let $="-";if("helix"===n.ss?$="H":"sheet"===n.ss?$="E":n.het||a?$="o":(!n.het&&c.parasCls.residueColors.hasOwnProperty(n.resn.toUpperCase())||"coil"===n.ss)&&($="c"),d.secondaries[n.structure+"_"+n.chain+"_"+n.resi]=$,(n.resi!=I||b!=D)&&d.bFullUi&&(void 0===d.chainsSeq[q]&&(d.chainsSeq[q]=[],P=!1),!isNaN(n.resi)))if(P&&!M&&void 0!==d.chainsSeq[q][n.resi-1])d.chainsSeq[q][n.resi-1].name=r;else if(!P||!d.chainsSeq[q].hasOwnProperty(n.resi-1)){let e={};e.resi=n.resi,e.name=r,n.resi%10==0&&n.resi.toString(),d.chainsSeq[q].push(e),M=!0}I=n.resi,T=n.resi_ori,E=n.resn,S=k,A=O,x=R,D=b}for(let e in d.chemicals){let t=d.atoms[e];if("P"==t.elem&&t.bonds.length>=4)for(let e=t.bonds.length-1;e>=0;--e){"P"==d.atoms[t.bonds[e]].elem&&t.bonds.splice(e,1)}}for(let e in L)if(!(Object.keys(d.chains[e]).length<10)&&"chemical"!==L[e])for(let t in d.chains[e]){let s=d.atoms[t];delete d.chemicals[t],s.het=!1,"protein"===L[e]?(d.proteins[t]=1,"CA"===s.name&&(d.calphas[t]=1),"N"!==s.name&&"H"!==s.name&&"CA"!==s.name&&"HA"!==s.name&&"C"!==s.name&&"O"!==s.name&&(d.sidec[t]=1)):"nucleotide"===L[e]&&(d.nucleotides[t]=1,("O3'"==s.name||"O3*"==s.name||H&&"P"==s.name)&&(d.nucleotidesO3[t]=1),-1===c.parasCls.nuclMainArray.indexOf(s.name)&&(d.ntbase[t]=1))}if(void 0===d.structures[k]&&(d.structures[k]=[]),d.structures[k].push(O),d.bFullUi)if("mmdbid"===s||"mmcifid"===s)for(let i in e.sequences){let n=e.sequences[i],l=t+"_"+i;void 0!==d.mmdbid_q&&(d.mmdbid_q,d.mmdbid_t),d.ParserUtilsCls.getMissingResidues(n,s,l)}else if("align"===s)for(let e in d.chainid2seq){let t=d.chainid2seq[e];d.ParserUtilsCls.getMissingResidues(t,s,e)}if(d.loadPDBCls.setResidMapping(),"mmcifid"!==s)for(let e in h){let t=w[e],s=void 0===d.atoms[t].bonds?0:d.atoms[t].bonds.length;for(let e=0;ed.maxatomcnt||void 0!==d.biomtMatrices&&d.biomtMatrices.length*d.cnt>10*d.maxatomcnt)&&(d.opts.proteins="c alpha trace",d.opts.nucleotides="o3 trace"),d.center=d.ParserUtilsCls.getGeoCenter(d.pmin,d.pmax),d.maxD=d.ParserUtilsCls.getStructureSize(d.atoms,d.pmin,d.pmax,d.center),d.maxD<5&&(d.maxD=5),d.oriMaxD=d.maxD,("align"===s||o)&&(d.ssbondpnts={},d.loadPDBCls.setSsbond()),"mmdbid"===s&&1==Object.keys(d.structures).length){let t=e.disulfides;if(void 0!==t)for(let e=0,s=t.length;ep&&(p=e)),c[e]={resi:t,resn:i,aligned:n}}r=e[t][1];let u=r.moleculeId,g=s.pdbid_molid2chain[l+"_"+u],f=l+"_"+g;void 0===s.alnChainsAnTtl[d]&&(s.alnChainsAnTtl[d]=[]),void 0===s.alnChainsAnTtl[d][0]&&(s.alnChainsAnTtl[d][0]=[]),void 0===s.alnChainsAnTtl[d][1]&&(s.alnChainsAnTtl[d][1]=[]),void 0===s.alnChainsAnTtl[d][2]&&(s.alnChainsAnTtl[d][2]=[]),void 0===s.alnChainsAnTtl[d][3]&&(s.alnChainsAnTtl[d][3]=[]),void 0===s.alnChainsAnTtl[d][4]&&(s.alnChainsAnTtl[d][4]=[]),void 0===s.alnChainsAnTtl[d][5]&&(s.alnChainsAnTtl[d][5]=[]),void 0===s.alnChainsAnTtl[d][6]&&(s.alnChainsAnTtl[d][6]=[]),s.alnChainsAnTtl[d][0].push(f),s.alnChainsAnTtl[d][1].push(d),s.alnChainsAnTtl[d][2].push(""),s.alnChainsAnTtl[d][3].push(""),s.alnChainsAnTtl[d][4].push(f),s.alnChainsAnTtl[d][5].push(d),s.alnChainsAnTtl[d][6].push("");let b=1;s.chainsMapping[d]||(s.chainsMapping[d]={}),s.chainsMapping[f]||(s.chainsMapping[f]={});for(let e=h;e<=p;++e){let t,o,p,m=s.bUsePdbNum?s.ParserUtilsCls.getResi(f,r.sequence[e][0]-1):r.sequence[e][0],u="~"===r.sequence[e][2]?"-":r.sequence[e][2],C=r.sequence[e][3]?1:0,y=c[e].aligned+C;2===y?(c[e].resn===u?(t="#FF0000",p="icn3d-cons",s.consHash1[d+"_"+c[e].resi]=1,s.consHash2[f+"_"+m]=1):(t="#0000FF",p="icn3d-ncons",s.nconsHash1[d+"_"+c[e].resi]=1,s.nconsHash2[f+"_"+m]=1),s.chainsMapping[d][d+"_"+c[e].resi]=c[e].resn+c[e].resi,s.chainsMapping[f][f+"_"+m]=c[e].resn+c[e].resi,o="#"+s.showAnnoCls.getColorhexFromBlosum62(c[e].resn,u)):(t=i.htmlCls.GREY8,p="icn3d-nalign",s.nalignHash1[d+"_"+c[e].resi]=1,s.nalignHash2[f+"_"+m]=1),void 0===s.alnChainsSeq[d]&&(s.alnChainsSeq[d]=[]);let v={};v.mmdbid=n,v.chain=a,v.resi=c[e].resi,v.resn=""===v.resi||"icn3d-nalign"===p?c[e].resn.toLowerCase():c[e].resn,v.aligned=y,v.color=""===v.resi?i.htmlCls.GREYC:t,v.color2=""===v.resi?i.htmlCls.GREYC:o,v.class=p,s.alnChainsSeq[d].push(v),""!==c[e].resi&&(void 0===s.alnChains[d]&&(s.alnChains[d]={}),$.extend(s.alnChains[d],s.residues[d+"_"+c[e].resi])),void 0===s.alnChainsSeq[f]&&(s.alnChainsSeq[f]=[]),v={},v.mmdbid=l,v.chain=g,v.resi=m,v.resn=""===v.resi||"icn3d-nalign"===p?u.toLowerCase():u,v.aligned=y,v.color=""===v.resi?i.htmlCls.GREYC:t,v.color2=""===v.resi?i.htmlCls.GREYC:o,v.class=p,s.alnChainsSeq[f].push(v),""!==v.resi&&(void 0===s.alnChains[f]&&(s.alnChains[f]={}),$.extend(s.alnChains[f],s.residues[f+"_"+m])),void 0===s.alnChainsAnno[d]&&(s.alnChainsAnno[d]=[]),void 0===s.alnChainsAnno[d][0]&&(s.alnChainsAnno[d][0]=[]),void 0===s.alnChainsAnno[d][1]&&(s.alnChainsAnno[d][1]=[]),void 0===s.alnChainsAnno[d][2]&&(s.alnChainsAnno[d][2]=[]),void 0===s.alnChainsAnno[d][3]&&(s.alnChainsAnno[d][3]=[]),e===h&&(void 0===s.alnChainsAnno[d][4]&&(s.alnChainsAnno[d][4]=[]),void 0===s.alnChainsAnno[d][5]&&(s.alnChainsAnno[d][5]=[]),void 0===s.alnChainsAnno[d][6]&&(s.alnChainsAnno[d][6]=[]),s.alnChainsAnno[d][4].push(s.pdbid_chain2title[f]),s.alnChainsAnno[d][5].push(s.pdbid_chain2title[d]),s.alnChainsAnno[d][6].push(""));let _=d+"_"+c[e].resi,w=f+"_"+m,S=s.secondaries[_],A=s.secondaries[w];A?s.alnChainsAnno[d][0].push(A):s.alnChainsAnno[d][0].push("-"),S?s.alnChainsAnno[d][1].push(S):s.alnChainsAnno[d][1].push("-");let x=".";b%5==0&&(x="*"),b%10==0&&(x="|"),s.alnChainsAnno[d][2].push(x);let k="";b%10==0&&(k=b.toString()),s.alnChainsAnno[d][3].push(k),++b}}e={}}getPosFromResi(e,t){let s=this.icn3d;s.icn3dui;let i,n=s.resid2ncbi[e+"_"+t];if(n){i=n.substr(n.lastIndexOf("_")+1)-1}return i}getResnFromResi(e,t){let s=this.icn3d;s.icn3dui;let i=e+"_"+t,n=s.residueId2Name[i];return n||(n="?"),n}getResiAferAlign(e,t,s){let i,n=this.icn3d,l=n.icn3dui;if(t&&"tmalign"==l.cfg.aligntool)i=s;else if(n.posid2resid){let t=n.posid2resid[e+"_"+s];i=t.substr(t.lastIndexOf("_")+1)}else i=n.chainsSeq[e][s].resi;return i}setSeqAlignChain(e,t,s){let i,n,l,r,o,a,d,c,h,p,m,u=this.icn3d,g=u.icn3dui,f={},b=!!s;if(b){if(o=s[1],a=s[0],t=s[2],d=o.indexOf("_"),c=a.indexOf("_"),i=o.substr(0,d).toUpperCase(),n=a.substr(0,c).toUpperCase(),l=o.substr(d+1),r=a.substr(d+1),i==n&&l==r){let e=u.chainsSeq[n+"_"+r].length;u.qt_start_end[t]={q_start:1,q_end:e,t_start:1,t_end:e}}}else{let d=s[0].indexOf("_"),c=e.indexOf("_");if(i=u.mmdbid_t,n=e.substr(0,c).toUpperCase(),l=s[0].substr(d+1),r=e.substr(c+1),i==n&&l==r){let e=u.chainsSeq[u.mmdbid_q+"_"+u.chain_q].length;u.qt_start_end[t]={q_start:1,q_end:e,t_start:1,t_end:e}}o=i+"_"+l,a=n+"_"+r,void 0!==n&&u.mmdbid_t}u.conservedName1=o+"_cons",u.nonConservedName1=o+"_ncons",u.notAlignedName1=o+"_nalign",u.conservedName2=a+"_cons",u.nonConservedName2=a+"_ncons",u.notAlignedName2=a+"_nalign",u.consHash1={},u.nconsHash1={},u.nalignHash1={},u.consHash2={},u.nconsHash2={},u.nalignHash2={},u.alnChains={},u.alnChainsSeq[o]=[],u.alnChains[o]={},u.alnChainsSeq[a]=[],u.alnChains[a]={},u.alnChainsAnno[o]=[],u.alnChainsAnTtl[o]=[],void 0===u.alnChainsAnTtl[o]&&(u.alnChainsAnTtl[o]=[]);for(let e=0;e<7;++e)void 0===u.alnChainsAnTtl[o][e]&&(u.alnChainsAnTtl[o][e]=[]);u.alnChainsAnTtl[o][0].push(a),u.alnChainsAnTtl[o][1].push(o),u.alnChainsAnTtl[o][2].push(""),u.alnChainsAnTtl[o][3].push(""),u.alnChainsAnTtl[o][4].push(a),u.alnChainsAnTtl[o][5].push(o),u.alnChainsAnTtl[o][6].push("");let C=0,y=0;if(void 0===u.qt_start_end[t])return;let v=1;u.chainsMapping[o]||(u.chainsMapping[o]={}),u.chainsMapping[a]||(u.chainsMapping[a]={});let _={},w={};for(let e=0,s=u.qt_start_end[t].length;e0){let e=v;for(let t=C+1,i=s;tc&&(c=t)}}}"tmalign"==n.cfg.aligntool&&(s=!0);let p=Object.keys(a);p.sort((function(e,t){return parseInt(e)-parseInt(t)}));let m=-999,u=0,g=0,f=[],b=0;for(let e=0,t=p.length;en)for(let e=0,t=d-a;e0?void 0!==n?p.alnChainsAnno[t][0].push(n):p.alnChainsAnno[t][0].push("-"):console.log("Error: ic.alnChainsAnno[chainid1] is undefined")}}}class ls{constructor(e){this.icn3d=e}getStructureId(e,t,s){let i=this.icn3d;i.icn3dui;let n=e;return(e==i.defaultPdbId||s||i.structures.hasOwnProperty(e))&&(n=1===t?e:e+t.toString()),n}loadPDB(e,t,s,i,n,l,r,o){let a,d,c=this.icn3d,h=c.icn3dui,p={},m=!1,u=e.split("\n"),g={},f={};c.atoms||(l=!1),n||l?(c.oriNStru=c.structures?Object.keys(c.structures).length:0,d=c.oriNStru+1,a=c.atoms?Object.keys(c.atoms).length:0):(c.init(),d=1,a=0);let b,C,y,v,_,w,S,A=[],x=[],k=[],O=[],R=[],I=[],T="",E="",P="",M={},D=t||c.defaultPdbId,H=D,F="",L=!1,N=!0;for(let e in u){let r=u[e],q=r.substr(0,6);if("HEADER"!==q||L||t)if("TITLE "===q){let e=r.substr(10).replace(/ALPHAFOLD MONOMER V2.0 PREDICTION FOR /gi,"");c.molTitle+=e.trim()+" ",o&&c.esmTitle&&(c.molTitle=c.esmTitle),c.molTitleHash||(c.molTitleHash={}),c.molTitleHash[H]=c.molTitle}else if("HELIX "===q){c.bSecondaryStructure=!0;let e=""==r.substr(18,2).trim()?"A":r.substr(18,2).trim(),t=parseInt(r.substr(21,4)),s=parseInt(r.substr(33,4));for(let i=t;i<=s;++i){let n=H+"_"+e+"_"+i;O.push(n),i===t&&R.push(n),i===s&&I.push(n)}}else if("SHEET "===q){void 0!==s&&s||(c.bSecondaryStructure=!0);let e=""==r.substr(20,2).trim()?"A":r.substr(20,2).trim(),t=parseInt(r.substr(22,4)),i=parseInt(r.substr(33,4));for(let s=t;s<=i;++s){let n=H+"_"+e+"_"+s;A.push(n),s===t&&x.push(n),s===i&&k.push(n)}}else if("HBOND "===q)void 0!==s&&s||(c.bSecondaryStructure=!0);else if("SSBOND"===q){c.bSsbondProvided=!0;let e=D+"_"+(" "==r.substr(15,1)?"A":r.substr(15,1))+"_"+r.substr(17,4).trim(),t=D+"_"+(" "==r.substr(29,1)?"A":r.substr(29,1))+"_"+r.substr(31,4).trim();void 0===c.ssbondpnts[D]&&(c.ssbondpnts[D]=[]),c.ssbondpnts[D].push(e),c.ssbondpnts[D].push(t)}else if("REMARK"===q){let e=parseInt(r.substr(7,3));if(-1!==r.indexOf("1/2 of bilayer thickness:"))c.halfBilayerSize=parseFloat(r.substr(r.indexOf(":")+1).trim());else if(210==e)"EXPERIMENT TYPE"==r.substr(11,32).trim()&&"NMR"==r.substr(45).trim()&&(m=!0);else if(350==e&&"BIOMT"==r.substr(13,5)){let e=parseInt(r[18])-1,t=parseInt(r.substr(21,2))-1;null==c.biomtMatrices[t]&&(c.biomtMatrices[t]=(new THREE.Matrix4).identity()),c.biomtMatrices[t].elements[e]=parseFloat(r.substr(24,9)),c.biomtMatrices[t].elements[e+4]=parseFloat(r.substr(34,9)),c.biomtMatrices[t].elements[e+8]=parseFloat(r.substr(44,9)),c.biomtMatrices[t].elements[e+12]=parseFloat(r.substr(54,14))}else if(465==e&&" "==r.substr(18,1)&&" "==r.substr(20,1)&&"S"!=r.substr(21,1)){let e=r.substr(15,3),t=r.substr(18,2).trim(),s=r.substr(21,5).trim(),i=D+"_"+t;void 0===c.chainMissingResidueArray[i]&&(c.chainMissingResidueArray[i]=[]);let n={};n.resi=s,n.name=h.utilsCls.residueName2Abbr(e).toLowerCase(),""!=F&&t==F&&t!=F||(c.chainMissingResidueArray[i].push(n),F=t)}else 900==e&&void 0===c.emd&&"RELATED DB: EMDB"==r.substr(34).trim()&&(c.emd=r.substr(23,11).trim())}else if("SOURCE"===q&&void 0===c.organism&&"ORGANISM_COMMON"==r.substr(11,15).trim())c.organism=r.substr(28).toLowerCase().trim(),c.organism=c.organism.substr(0,c.organism.length-1);else if("ENDMDL"===q)++d,D=c.defaultPdbId,H=this.getStructureId(D,d,n),m||(A=[],x=[],k=[],O=[],R=[],I=[]),L=!1;else if("JRNL "===q)"PMID"===r.substr(12,4)&&(c.pmid=r.substr(19).trim());else if("ATOM "===q||"HETATM"===q){N&&(H=this.getStructureId(D,d,n),N=!1);let e=r.substr(16,1);++a,M[parseInt(r.substr(6,5))]=a;let t=r.substr(76,2).trim();""===t&&(t=r.substr(12,2).trim());let l=r.substr(12,4).trim(),u=r.substr(17,3),F=r.substr(20,2).trim();""===F&&(F="A");let L=r.substr(22,5).trim(),U=L;if(s&&"DUM"===u&&(t=l,F="MEM",U=1,L=1),i&&"DUM"===u)break;b=H+"_"+F,y=b+"_"+L,C=b+"_"+U;let $=parseFloat(r.substr(30,8)),j=parseFloat(r.substr(38,8)),B=parseFloat(r.substr(46,8)),z=new THREE.Vector3($,j,B),G=parseFloat(r.substr(60,8));o&&(G*=100);let V={het:"H"===q[0],serial:a,name:l,alt:e,resn:u,structure:H,chain:F,resi:U,coord:z,b:G,elem:t,bonds:[],ss:"coil",ssbegin:!1,ssend:!1};if(V.het||"C"!==V.name||(v=a),V.het||"O"!==V.name||(w=a),!V.het&&"N"===V.name&&void 0!==_&&void 0!==S){let e=c.atoms[_].coord.distanceTo(c.atoms[S].coord),t=V.coord.x+(c.atoms[_].coord.x-c.atoms[S].coord.x)/e,s=V.coord.y+(c.atoms[_].coord.y-c.atoms[S].coord.y)/e,i=V.coord.z+(c.atoms[_].coord.z-c.atoms[S].coord.z)/e;V.hcoord=new THREE.Vector3(t,s,i)}c.atoms[a]=V,c.dAtoms[a]=1,c.hAtoms[a]=1,p[a]=1,this.isSecondary(C,A,m)?(c.atoms[a].ss="sheet",this.isSecondary(C,x,m)&&(c.atoms[a].ssbegin=!0),this.isSecondary(C,k,m)&&(c.atoms[a].ssend=!0)):this.isSecondary(C,O,m)&&(c.atoms[a].ss="helix",this.isSecondary(C,R,m)&&(c.atoms[a].ssbegin=!0),this.isSecondary(C,I,m)&&(c.atoms[a].ssend=!0));let W="-";if(W="helix"===c.atoms[a].ss?"H":"sheet"===c.atoms[a].ss?"E":!c.atoms[a].het&&h.parasCls.residueColors.hasOwnProperty(c.atoms[a].resn.toUpperCase())?"c":"o",c.secondaries[C]=W,y!==P){let e=h.utilsCls.residueName2Abbr(u);if(c.residueId2Name[C]=e,1!==a&&""!==E&&(c.residues[E]=f),C!==E&&(f={}),b!==T){_=void 0,S=void 0,1!==a&&""!==T&&(void 0===c.chains[T]&&(c.chains[T]={}),c.chains[T]=h.hashUtilsCls.unionHash(c.chains[T],g)),g={},void 0===c.structures[H.toString()]&&(c.structures[H.toString()]=[]),c.structures[H.toString()].includes(b)||c.structures[H.toString()].push(b),void 0===c.chainsSeq[b]&&(c.chainsSeq[b]=[]);let t={};t.resi=U,t.name=e,c.chainsSeq[b].push(t)}else{_=v,S=w;let t={};t.resi=U,t.name=e,c.chainsSeq[b].push(t)}}g[a]=1,f[a]=1,T=b,E=C,P=y}else if("CONECT"===q){let e=parseInt(r.substr(6,5));for(let t=0;t<4;++t){let s=parseInt(r.substr([11,16,21,26][t],5));isNaN(s)||void 0!==c.atoms[M[e]]&&c.atoms[M[e]].bonds.push(M[s])}}else q.substr(0,3);else D=r.substr(62).trim(),""==D&&(D=l?c.defaultPdbId:c.inputid&&-1==c.inputid.indexOf("/")?c.inputid.substr(0,10):c.defaultPdbId),H=this.getStructureId(D,d,n),c.molTitle="",c.molTitleHash={},L=!0}c.residues[C]=f,void 0===c.chains[b]&&(c.chains[b]={}),c.chains[b]=h.hashUtilsCls.unionHash2Atoms(c.chains[b],g,c.atoms),this.adjustSeq(c.chainMissingResidueArray);let q=Object.keys(c.structures);for(let e=0,t=q.length;er&&i>r&&(h=!0),s<=r&&i>r?s>i||h?(o[c]=t[d],d++):(o[c]=e[a],a++):s>r&&i<=r?s<=i||h?(o[c]=e[a],a++):(o[c]=t[d],d++):s<=i?(o[c]=e[a],a++):(o[c]=t[d],d++),c++}if(a4||Math.abs(l.y-r.y)>4||Math.abs(l.z-r.z)>4||(l.x-r.x)*(l.x-r.x)+(l.y-r.y)*(l.y-r.y)+(l.z-r.z)*(l.z-r.z)<16&&(void 0===t.ssbondpnts[e]&&(t.ssbondpnts[e]=[]),t.ssbondpnts[e].push(o),t.ssbondpnts[e].push(a)))}}}getChainCalpha(e,t,s,i){let n=this.icn3d,l=n.icn3dui,r={};for(let o in e){if(void 0!==i){if(o.split("_")[0]!==i)continue}let a=Object.keys(e[o]),d=[],c=0,h=0;for(let e=0,i=a.length;e3?i.resn.trim().substr(0,3):i.resn.trim();if(!l.parasCls.chargeColors.hasOwnProperty(e))continue;s?i.resi_ori:i.resi,d.push(i.coord.clone()),++c,h=i.resi}}if(c>0){r[t[a[0]].chain]=d}}return{chainresiCalphaHash:r,center:n.center.clone()}}isSecondary(e,t,s){if(this.icn3d.icn3dui,s){let s=e.substr(e.indexOf("_")+1),i=!1;for(let e=0,n=t.length;ep[e]
"),l.cfg.bSidebyside||l.htmlCls.dialogCls.openDlg("dl_rmsd","Realignment RMSD"),n.q_rotation=[],n.q_trans_sub=[],n.t_trans_add=[],n.q_rotation.push({x1:e[0],y1:e[1],z1:e[2],x2:e[3],y2:e[4],z2:e[5],x3:e[6],y3:e[7],z3:e[8]}),n.q_trans_sub.push(i),n.t_trans_add.push({x:-r.x,y:-r.y,z:-r.z}),l.cfg.aligntool="vast";//!= 'tmalign';
-let c=0,h="query",p=o.substr(0,o.indexOf("_")),m=!0;n.chainalignParserCls.transformStructure(p,c,h,m);let u="";for(let e=0,i=s.length;e8)return s;let g=[];g[0]=n[0]*r[0]+n[1]*r[1]+n[2]*r[2],g[1]=n[3]*r[0]+n[4]*r[1]+n[5]*r[2],g[2]=n[6]*r[0]+n[7]*r[1]+n[8]*r[2],g[0]-=n[0]*a[0]+n[1]*a[1]+n[2]*a[2],g[1]-=n[3]*a[0]+n[4]*a[1]+n[5]*a[2],g[2]-=n[6]*a[0]+n[7]*a[1]+n[8]*a[2];let f=0;return f=c[0]*g[0],f+=c[1]*g[1],f+=c[2]*g[2],f/=p*m,f<.866?s:(g[0]=l[0]*r[0]+l[1]*r[1]+l[2]*r[2],g[1]=l[3]*r[0]+l[4]*r[1]+l[5]*r[2],g[2]=l[6]*r[0]+l[7]*r[1]+l[8]*r[2],g[0]-=l[0]*a[0]+l[1]*a[1]+l[2]*a[2],g[1]-=l[3]*a[0]+l[4]*a[1]+l[5]*a[2],g[2]-=l[6]*a[0]+l[7]*a[1]+l[8]*a[2],f=c[0]*g[0],f+=c[1]*g[1],f+=c[2]*g[2],f/=p*m,f<.866?s:(u=0,u+=Math.pow(e.q_rotation.x1-t.q_rotation.x1,2),u+=Math.pow(e.q_rotation.y1-t.q_rotation.y1,2),u+=Math.pow(e.q_rotation.z1-t.q_rotation.z1,2),u+=Math.pow(e.q_rotation.x2-t.q_rotation.x2,2),u+=Math.pow(e.q_rotation.y2-t.q_rotation.y2,2),u+=Math.pow(e.q_rotation.z2-t.q_rotation.z2,2),u+=Math.pow(e.q_rotation.x3-t.q_rotation.x3,2),u+=Math.pow(e.q_rotation.y3-t.q_rotation.y3,2),u+=Math.pow(e.q_rotation.z3-t.q_rotation.z3,2),Math.sqrt(u)))}GetRotMatrix(e,t,s){this.icn3d.icn3dui;let i=[];return i&&(i[0]=e.q_rotation.x1/t,i[1]=e.q_rotation.y1/t,i[2]=e.q_rotation.z1/t,i[3]=e.q_rotation.x2/t,i[4]=e.q_rotation.y2/t,i[5]=e.q_rotation.z2/t,i[6]=e.q_rotation.x3/t,i[7]=e.q_rotation.y3/t,i[8]=e.q_rotation.z3/t,2!=s?(i[9]=e.t_trans_add.x/t,i[10]=e.t_trans_add.y/t,i[11]=e.t_trans_add.z/t,i[12]=-e.q_trans_sub.x/t,i[13]=-e.q_trans_sub.y/t,i[14]=-e.q_trans_sub.z/t):(i[9]=-e.q_trans_add.x/t,i[10]=-e.q_trans_add.y/t,i[11]=-e.q_trans_add.z/t,i[12]=0,i[13]=0,i[14]=0)),i}cbu_dist(e,t,s){return e=5&&(e=l[4].substr(5)),l.length>=6&&(s=l[5].substr(6)),l.length>=7&&(n=l[6].substr(4)),$("#"+t.pre+"anno_custom")[0]&&($("#"+t.pre+"anno_custom")[0].checked=!0),$("[id^="+t.pre+"custom]").show(),"0"==s&&(s=void 0),t.addTrackCls.checkGiSeq(r,o,a,e,s,n,0)}else if(0==n.indexOf("remove one stabilizer")){let e=n.split(" | ")[1].split(" "),s=[];s.push(parseInt(e[0])),s.push(parseInt(e[1])),t.threeDPrintCls.removeOneStabilizer(s),t.drawCls.draw()}else if(0==n.indexOf("add one stabilizer")){let e=n.split(" | ")[1].split(" ");void 0===t.pairArray&&(t.pairArray=[]),t.pairArray.push(parseInt(e[0])),t.pairArray.push(parseInt(e[1])),t.drawCls.draw()}else if(0==n.indexOf("select planes z-axis")){let e=n.split(" ");if(5==e.length){let s=parseFloat(e[3]),i=parseFloat(e[4]);t.selectionCls.selectBtwPlanes(s,i)}}else if(0==n.indexOf("adjust membrane z-axis")){let e=n.split(" ");if(5==e.length){let s=parseFloat(e[3]),i=parseFloat(e[4]);t.selectionCls.adjustMembrane(s,i)}}else if(0==n.indexOf("toggle membrane"))t.selectionCls.toggleMembrane();else if(0==i.indexOf("calc buried surface")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(" ");if(2==s.length){let e=s[0].split(","),i=s[1].split(",");t.analysisCls.calcBuriedSurface(e,i)}}}else if(0==i.indexOf("dist ")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(" ");if(2==s.length){let e=s[0].split(","),i=s[1].split(",");t.analysisCls.measureDistTwoSets(e,i)}}}else if(0==i.indexOf("disttable")){let e=i.split(" | ");if(2==e.length){let i=e[1].split(" ");if(2==i.length){let e=i[0].split(","),n=i[1].split(",");t.analysisCls.measureDistManySets(e,n),s.htmlCls.dialogCls.openDlg("dl_disttable","Distance among the sets")}}}else if(0==i.indexOf("display interaction 3d")||0==i.indexOf("view interaction pairs")||0==i.indexOf("save1 interaction pairs")||0==i.indexOf("save2 interaction pairs")||0==i.indexOf("line graph interaction pairs")||0==i.indexOf("scatterplot interaction pairs")){let e=i.split(" | ");if(e.length>=3){let s=e[1].split(" ");if(2==s.length){let n,l,r=s[0].split(","),o=s[1].split(","),a=-1!==e[2].indexOf("hbonds"),d=-1!==e[2].indexOf("salt bridge"),c=-1!==e[2].indexOf("interactions"),h=-1!==e[2].indexOf("halogen"),p=-1!==e[2].indexOf("pi-cation"),m=-1!==e[2].indexOf("pi-stacking");if(e.length>=4&&(n="true"==e[3]),e.length>=5){let s=e[4].split(" ");s.length>=4&&($("#"+t.pre+"hbondthreshold").val(s[1]),$("#"+t.pre+"saltbridgethreshold").val(s[2]),$("#"+t.pre+"contactthreshold").val(s[3]),7==s.length&&($("#"+t.pre+"halogenthreshold").val(s[4]),$("#"+t.pre+"picationthreshold").val(s[5]),$("#"+t.pre+"pistackingthreshold").val(s[6])))}0==i.indexOf("display interaction 3d")?l="3d":0==i.indexOf("view interaction pairs")?l="view":0==i.indexOf("save1 interaction pairs")?l="save1":0==i.indexOf("save2 interaction pairs")?l="save2":0==i.indexOf("line graph interaction pairs")?l="linegraph":0==i.indexOf("scatterplot interaction pairs")&&(l="scatterplot"),await t.viewInterPairsCls.viewInteractionPairs(r,o,n,l,a,d,c,h,p,m)}}}else if(0==i.indexOf("export pairs")){let e=i.split(" | ");if(3==e.length){let i=e[1].split(" ");if(2==i.length){let n=i[0].split(","),l=i[1].split(","),r=e[2].split(" ")[1];t.showInterCls.pickCustomSphere(r,n,l,t.bSphereCalc),t.bSphereCalc=!0;let o=t.viewInterPairsCls.exportSpherePairs(),a=Object.keys(s.utilsCls.getHlStructures()).join(",");t.saveFileCls.saveFile(a+"_sphere_pairs.html","html",o)}}}else if(0==n.indexOf("graph label")){let e=n.lastIndexOf(" "),t=n.substr(e+1);$("#"+s.svgid+"_label").val(t),$("#"+s.svgid+" text").removeClass(),$("#"+s.svgid+" text").addClass(t)}else if(0==n.indexOf("cartoon label")){let e=n.lastIndexOf(" "),t=n.substr(e+1);$("#"+s.svgid_ct+"_label").val(t),$("#"+s.svgid_ct+" text").removeClass(),$("#"+s.svgid_ct+" text").addClass(t)}else if(0==n.indexOf("line graph scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.linegraphid+"_scale").val(i),$("#"+s.linegraphid).attr("width",(t.linegraphWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("scatterplot scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.scatterplotid+"_scale").val(i),$("#"+s.scatterplotid).attr("width",(t.scatterplotWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("contactmap scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.contactmapid+"_scale").val(i),$("#"+s.contactmapid).attr("width",(t.contactmapWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("alignerrormap scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.alignerrormapid+"_scale").val(i),$("#"+s.alignerrormapid).attr("width",(t.alignerrormapWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("graph force")){let e=n.lastIndexOf(" ");s.htmlCls.force=parseInt(n.substr(e+1)),$("#"+s.svgid+"_force").val(s.htmlCls.force),t.getGraphCls.handleForce()}else if(0==n.indexOf("hide edges")){let e=n.lastIndexOf(" ");s.htmlCls.hideedges=parseInt(n.substr(e+1)),$("#"+s.svgid+"_hideedges").val(s.htmlCls.hideedges),s.htmlCls.hideedges?(s.htmlCls.contactInsideColor="FFF",s.htmlCls.hbondInsideColor="FFF",s.htmlCls.ionicInsideColor="FFF"):(s.htmlCls.contactInsideColor="DDD",s.htmlCls.hbondInsideColor="AFA",s.htmlCls.ionicInsideColor="8FF"),void 0!==t.graphStr&&t.bRender&&s.htmlCls.force&&t.drawGraphCls.drawGraph(t.graphStr,t.pre+"dl_graph")}else if(0==n.indexOf("reset interaction pairs"))t.viewInterPairsCls.resetInteractionPairs();else if(0==n.indexOf("side by side")){let e=n.split(" | ")[1],t="_blank";window.open(e,t)}else if(0==i.indexOf("your note")){let e=i.split(" | ");t.yournote=e[1],$("#"+t.pre+"yournote").val(t.yournote),s.cfg.shownote&&(document.title=t.yournote)}else if(0==n.indexOf("cross structure interaction"))t.crossstrucinter=parseInt(n.substr(n.lastIndexOf(" ")+1)),$("#"+t.pre+"crossstrucinter").val(t.crossstrucinter);else if("replay on"==n)await t.resizeCanvasCls.replayon();else if("replay off"==n)await t.resizeCanvasCls.replayoff();else if(0==n.indexOf("contact map")){let e=n.split(" | ");if(3===e.length){let s=parseFloat(e[1].split(" ")[1]),i=e[2].split(" ")[1];await t.contactMapCls.contactMap(s,i)}}else if(0==n.indexOf("pickatom")){let e=parseInt(n.substr(n.lastIndexOf(" ")+1));t.pAtom=t.atoms[e],t.pickingCls.showPicking(t.pAtom)}else if(0==i.indexOf("set color spectrum")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!0;t.setColorCls.setColorAcrossSets(s,i)}}else if(0==i.indexOf("set residues color spectrum")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!0;t.setColorCls.setColorBySets(s,i)}}else if(0==i.indexOf("set color rainbow")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!1;t.setColorCls.setColorAcrossSets(s,i)}}else if(0==i.indexOf("set residues color rainbow")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!1;t.setColorCls.setColorBySets(s,i)}}else if(0==i.indexOf("color")){let e=i.split(" | "),n=e[0].substr(e[0].indexOf(" ")+1);if(t.opts.color=n,"residue custom"==n&&2==e.length){t.customResidueColors=JSON.parse(e[1]);for(let e in t.customResidueColors)t.customResidueColors[e.toUpperCase()]=s.parasCls.thr("#"+t.customResidueColors[e])}else if("align custom"==n&&3==e.length){let s=e[1],i=e[2].split(", ");t.queryresi2score={},t.queryresi2score[s]={};for(let e=0,n=i.length;e1&&"3"===x[t][0]&&isNaN(x[t][1])&&"-"!==x[t][0]){i=x[t].toUpperCase().substr(1),m=!0}else if(""===x[t]||isNaN(parseInt(x[t]))){if("*"===x[t])h=!0;else if("proteins"!==x[t]&&"nucleotides"!==x[t]&&"chemicals"!==x[t]&&"ions"!==x[t]&&"water"!==x[t]&&"anchors"!==x[t]&&"strands"!==x[t]&&"loops"!==x[t]){s=x[t].toUpperCase(),p=!0}}else v=x[t],_=v,n=!0;for(let a=0,u=S.length;a1?e.substr(0,l-1)===n.atoms[i].name.substr(0,l-1)&&(0===s?t[i]=1:t.hasOwnProperty(i)||delete t[i]):"*"!==e&&e!==n.atoms[i].name||(0===s?t[i]=1:t.hasOwnProperty(i)||delete t[i]),t}}class hs{constructor(e){this.icn3d=e}selectAll(){let e=this.icn3d;e.icn3dui,this.selectAll_base(),e.hlObjectsCls.removeHlObjects(),e.hlUpdateCls.removeHl2D(),e.hlUpdateCls.removeHlMenus(),e.bSelectResidue=!1,e.bSelectAlignResidue=!1,e.hlUpdateCls.removeSeqResidueBkgd(),e.hlUpdateCls.update2DdgmContent(),$("#"+e.pre+"dl_annotations > .icn3d-annotation").show(),e.definedSetsCls.setMode("all"),e.saveFileCls.showTitle()}selectAll_base(){let e=this.icn3d,t=e.icn3dui;e.hAtoms={},e.dAtoms={};for(let s in e.chains)e.hAtoms=t.hashUtilsCls.unionHash(e.hAtoms,e.chains[s]);e.dAtoms=t.hashUtilsCls.cloneHash(e.hAtoms),e.viewSelectionAtoms=t.hashUtilsCls.cloneHash(e.hAtoms),e.ALTERNATE_STRUCTURE=-1}selectAChain(e,t,s,i){let n=this.icn3d,l=n.icn3dui;t=t.replace(/\s/g,"");let r=void 0!==s||s?"select alignChain "+e:"select chain "+e;void 0!==i&&i?(n.hAtoms=l.hashUtilsCls.unionHash(n.hAtoms,n.chains[e]),void 0===n.nameArray&&(n.nameArray=[])):(n.hAtoms={},n.nameArray=[]),n.nameArray.push(e);let o,a=s?n.alnChainsSeq[e]:n.chainsSeq[e];o=void 0===a?0:a.length;let d={};for(let t=0,s=o;t0){if(void 0!==i&&i?void 0===r.nameArray&&(r.nameArray=[]):(r.hAtoms={},r.nameArray=[]),l)for(let t in e)r.hAtoms[t]=1;else for(let t in e)for(let e in r.residues[t])r.hAtoms[e]=1;let o,a;t=t.replace(/\s/g,""),r.nameArray.push(t),l?(o="select "+r.resid2specCls.atoms2spec(r.hAtoms),a=!1):(o="select "+r.resid2specCls.residueids2spec(Object.keys(e)),a=!0);let d=Object.keys(e);this.addCustomSelection(d,t,s,o,a),(void 0===n||n)&&r.hlUpdateCls.updateHlAll(r.nameArray,void 0,i)}}selectMainChains(){let e=this.icn3d,t=e.icn3dui.hashUtilsCls.cloneHash(e.hAtoms);e.hAtoms=e.applyDisplayCls.selectMainChainSubset(t),e.hlUpdateCls.showHighlight()}selectSideChains(){let e=this.icn3d,t=e.icn3dui,s=t.hashUtilsCls.cloneHash(e.hAtoms);e.hAtoms={};for(let i in s)(e.proteins.hasOwnProperty(i)&&"N"!==e.atoms[i].name&&"H"!==e.atoms[i].name&&"C"!==e.atoms[i].name&&"O"!==e.atoms[i].name&&("CA"!==e.atoms[i].name||"C"!==e.atoms[i].elem)&&"HA"!==e.atoms[i].name||e.nucleotides.hasOwnProperty(i)&&-1===t.parasCls.nuclMainArray.indexOf(e.atoms[i].name))&&(e.hAtoms[i]=1);e.hlUpdateCls.showHighlight()}selectMainSideChains(){let e=this.icn3d,t=e.icn3dui,s=e.firstAtomObjCls.getResiduesFromAtoms(e.hAtoms);e.hAtoms={};for(let i in s)e.hAtoms=t.hashUtilsCls.unionHash(e.hAtoms,e.residues[i]),e.dAtoms=t.hashUtilsCls.unionHash(e.dAtoms,e.residues[i]);e.drawCls.draw(),e.hlUpdateCls.showHighlight()}clickShow_selected(){let e=this.icn3d,t=e.icn3dui,s=this;t.myEventCls.onIds(["#"+e.pre+"show_selected","#"+e.pre+"mn2_show_selected"],"click",(function(e){s.icn3d,s.showSelection(),t.htmlCls.clickMenuCls.setLogCmd("show selection",!0)}))}clickHide_selected(){let e=this.icn3d,t=e.icn3dui,s=this;t.myEventCls.onIds("#"+e.pre+"mn2_hide_selected","click",(function(e){s.icn3d,s.hideSelection(),t.htmlCls.clickMenuCls.setLogCmd("hide selection",!0)}))}getGraphDataForDisplayed(){let e=this.icn3d;e.icn3dui;let t=JSON.parse(e.graphStr),s=e.firstAtomObjCls.getResiduesFromAtoms(e.dAtoms),i=[],n=[],l={};for(let e=0,n=t.nodes.length;et&&(t=C[s].length,e=s);let s=Object.keys(p),i=Object.keys(m);for(let t=0,n=C[e].length;t
The following sequence alignment shows the residue mapping of the best aligned sets: "symOri" and "symPerm", which are also available in the menu "Analysis > Defined Sets".
',$("#"+e.pre+"symd_info").html(A),s.setSeqAlignForSymmetry(_,w,S);let x=!1,k=t.htmlCls.alignSeqCls.getAlignSequencesAnnotations(Object.keys(e.alnChains),void 0,void 0,x,S);A=$("#"+e.pre+"dl_sequence2").html()+k.sequencesHtml,$("#"+e.pre+"dl_sequence2").html(A),$("#"+e.pre+"dl_sequence2").width(t.htmlCls.RESIDUE_WIDTH*k.maxSeqCnt+200),t.htmlCls.dialogCls.openDlg("dl_alignment","Select residues in aligned sequences from SymD");let O=Object.keys(e.defNames2Residues).length+Object.keys(e.defNames2Atoms).length,R="symOri"+O;e.selectionCls.selectResidueList(y,R,R),e.selectionCls.updateSelectionNameDesc(),t.htmlCls.clickMenuCls.setLogCmd("select "+e.resid2specCls.residueids2spec(Object.keys(y))+" | name "+R,!1),R="symPerm"+O,e.selectionCls.selectResidueList(v,R,R),e.selectionCls.updateSelectionNameDesc(),t.htmlCls.clickMenuCls.setLogCmd("select "+e.resid2specCls.residueids2spec(Object.keys(v))+" | name "+R,!1),R="symBoth"+O,y=t.hashUtilsCls.unionHash(y,v),e.selectionCls.selectResidueList(y,R,R),e.selectionCls.updateSelectionNameDesc(),t.htmlCls.clickMenuCls.setLogCmd("select "+e.resid2specCls.residueids2spec(Object.keys(y))+" | name "+R,!1)}}else $("#"+e.pre+"dl_symd").html("
The selected residues have no detected symmetry with a Z score of "+a.zscore+" from the program SymD."),t.htmlCls.dialogCls.openDlg("dl_symd","Dynamically Calculated Symmetry Using SymD");e.symdtitle="none"===h?void 0:h,e.drawCls.draw()}catch(s){return $("#"+e.pre+"dl_symd").html("
The web service can not determine the symmetry of the input set."),t.htmlCls.dialogCls.openDlg("dl_symd","Dynamically Calculated Symmetry Using SymD"),void e.ParserUtilsCls.hideLoading()}}getResObj(e){this.icn3d.icn3dui;let t=e.substr(0,e.indexOf(" ")),s=e.indexOf("$"),i=e.indexOf("."),n=e.indexOf(":"),l=e.substr(s+1,i-s-1),r=e.substr(i+1,n-i-1),o=e.substr(n+1);return{resn:t,resid:l+"_"+r+"_"+o,resi:o,aligned:!0}}setSeqAlignForSymmetry(e,t,s){let i=this.icn3d,n=i.icn3dui;i.conservedName1="symOri_cons",i.conservedName2="symPerm_cons",i.consHash1={},i.consHash2={},i.alnChainsAnTtl={},i.alnChainsAnno={},i.alnChainsSeq={},i.alnChains={},i.alnChainsSeq={};let l={};for(let r=0,o=e.length;r
This structure has no symmetry.");i.htmlCls.dialogCls.openDlg("dl_symmetry","Symmetry")}getPolygonColor(e){let t=this.icn3d.icn3dui,s=e.substr(0,1);return"C"==s?t.parasCls.thr(16747520):"D"==s?t.parasCls.thr(65535):"T"==s?t.parasCls.thr(15631086):"O"==s?t.parasCls.thr(16753920):"I"==s?t.parasCls.thr(65280):t.parasCls.thr(11119017)}getAxisColor(e,t){let s=this.icn3d.icn3dui,i=e.substr(0,1);return"C"==i?s.parasCls.thr(16711680):"D"==i?2==t?s.parasCls.thr(65535):s.parasCls.thr(16711680):"T"==i?2==t?s.parasCls.thr(65535):s.parasCls.thr(65280):"O"==i||"I"==i?2==t?s.parasCls.thr(65535):3==t?s.parasCls.thr(65280):s.parasCls.thr(16711680):s.parasCls.thr(16711680)}}class Cs{constructor(e){this.icn3d=e}alignSW(e,t,s,i,n,l,r){this.icn3d.icn3dui;let o=this.bsa_align(r,e,t,[s,i],[n,l]),a="score: "+o[0]+"\n";a+="start: "+o[1]+"\n",a+="cigar: "+this.bsa_cigar2str(o[2])+"\n\n",a+="alignment:\n\n";let d=this.bsa_cigar2gaps(e,t,o[1],o[2]),c={};return c.score=o[0],c.start=o[1],c.cigar=this.bsa_cigar2str(o[2]),c.target=d[0],c.query=d[1],c}bsg_enc_seq(e,t){if(this.icn3d.icn3dui,null==t)return null;let s=[];s.length=e.length;for(let i=0;i
Calculate solvent accessible surface area in the interface:
";C+="Set 1: "+e+", Surface: "+o+" Å2
",C+="Set 2: "+t+", Surface: "+d+" Å2
",C+="Total Surface: "+h+" Å2
",C+="Buried Surface for Set 1: "+u+" Å2
",C+="Buried Surface for Set 2: "+m+" Å2
",$("#"+s.pre+"dl_buriedarea_html").html(C),i.htmlCls.dialogCls.openDlg("dl_buriedarea","Buried solvent accessible surface area in the interface"),i.htmlCls.clickMenuCls.setLogCmd("buried surface "+b,!1)}}measureDistTwoSets(e,t){var s=this.icn3d,i=s.icn3dui;if(0==e.length||0==t.length)alert("Please select two sets");else{let n=i.hashUtilsCls.cloneHash(s.hAtoms),l=s.definedSetsCls.getAtomsFromNameArray(e),r=s.definedSetsCls.getAtomsFromNameArray(t),o=s.contactCls.getExtent(l),a=s.contactCls.getExtent(r),d=new THREE.Vector3(o[2][0],o[2][1],o[2][2]),c=new THREE.Vector3(a[2][0],a[2][1],a[2][2]);s.hAtoms=i.hashUtilsCls.cloneHash(n),void 0===s.distPnts&&(s.distPnts=[]),s.distPnts.push(d),s.distPnts.push(c);let h=$("#"+s.pre+"distancecolor2").val();this.addLine(d.x,d.y,d.z,c.x,c.y,c.z,h,!0,"distance");let p=0,m=0,u=d.clone().add(c).multiplyScalar(.5),g=(parseInt(10*d.distanceTo(c))/10).toString()+" A";this.addLabel(g,u.x,u.y,u.z,p,h,m,"distance"),s.drawCls.draw()}}measureDistManySets(e,t){var s=this.icn3d,i=s.icn3dui;if(0==e.length||0==t.length)alert("Please select sets for distance calculation...");else{let n=i.hashUtilsCls.cloneHash(s.hAtoms),l={};for(let i=0,n=e.length;i ";for(let s=0,i=e.length;s";for(let e=0,s=t.length;e "+t[e]+" (Å)"}r+=""+i+" (Å) ";for(let e=0,s=t.length;e'+l[i][s]+"":r+="0 "}r+=""}r+="
",$("#"+i.pre+"dl_disttable_html").html(r)}}addLine(e,t,s,i,n,l,r,o,a,d,c){var h=this.icn3d;h.icn3dui;let p={};p.position1=new THREE.Vector3(e,t,s),p.position2=new THREE.Vector3(i,n,l),p.color=r,p.dashed=o,p.radius=d,p.opacity=c,void 0===h.lines[a]&&(h.lines[a]=[]),void 0!==a?h.lines[a].push(p):(void 0===h.lines.custom&&(h.lines.custom=[]),h.lines.custom.push(p)),h.hlObjectsCls.removeHlObjects()}addLineFromPicking(e){var t=this.icn3d,s=t.icn3dui;let i=$("#"+t.pre+e+"color").val();t.pAtom.coord.x,t.pAtom2.coord.x,t.pAtom.coord.y,t.pAtom2.coord.y,t.pAtom.coord.z,t.pAtom2.coord.z;let n="stabilizer"!=e;s.htmlCls.clickMenuCls.setLogCmd("add line | x1 "+t.pAtom.coord.x.toPrecision(4)+" y1 "+t.pAtom.coord.y.toPrecision(4)+" z1 "+t.pAtom.coord.z.toPrecision(4)+" | x2 "+t.pAtom2.coord.x.toPrecision(4)+" y2 "+t.pAtom2.coord.y.toPrecision(4)+" z2 "+t.pAtom2.coord.z.toPrecision(4)+" | color "+i+" | dashed "+n+" | type "+e,!0),this.addLine(t.pAtom.coord.x,t.pAtom.coord.y,t.pAtom.coord.z,t.pAtom2.coord.x,t.pAtom2.coord.y,t.pAtom2.coord.z,i,n,e),t.pickpair=!1}addLabel(e,t,s,i,n,l,r,o){var a=this.icn3d;a.icn3dui;let d={};"0"!==n&&""!==n&&"undefined"!==n||(n=void 0),"0"!==l&&""!==l&&"undefined"!==l||(l=void 0),"0"!==r&&""!==r&&"undefined"!==r||(r=void 0);let c=new THREE.Vector3;c.x=t,c.y=s,c.z=i,d.position=c,d.text=e,d.size=n,d.color=l,d.background=r,void 0===a.labels[o]&&(a.labels[o]=[]),void 0!==o?a.labels[o].push(d):(void 0===a.labels.custom&&(a.labels.custom=[]),a.labels.custom.push(d)),a.hlObjectsCls.removeHlObjects()}addChainLabels(e){var t=this.icn3d;let s=t.icn3dui.hashUtilsCls.intHash(t.hAtoms,e);void 0===t.labels.chain&&(t.labels.chain=[]);let i=t.firstAtomObjCls.getChainsFromAtoms(s);for(let e in i){let s={};s.position=t.applyCenterCls.centerAtoms(t.chains[e]).center;let i=e.indexOf("_"),n=e.substr(i+1),l=t.showSeqCls.getProteinName(e);l.length>20&&(l=l.substr(0,20)+"..."),s.text="Chain "+n+": "+l,s.size=18,t.firstAtomObjCls.getFirstCalphaAtomObj(t.chains[e]).color.getHexString().toUpperCase(),s.color="black"!=t.opts.background?t.colorWhitebkgd:t.colorBlackbkgd,s.background="#FFFFFF",t.labels.chain.push(s)}t.hlObjectsCls.removeHlObjects()}addTerminiLabels(e){var t=this.icn3d,s=t.icn3dui;let i,n="#FFFFFF";i=s.hashUtilsCls.unionHash(i,t.proteins),i=s.hashUtilsCls.unionHash(i,t.nucleotides);let l=s.hashUtilsCls.intHash(t.dAtoms,i),r=s.hashUtilsCls.intHash(l,e);void 0===t.labels.chain&&(t.labels.chain=[]);let o=t.firstAtomObjCls.getChainsFromAtoms(r);for(let e in o){let i=s.hashUtilsCls.intHash(l,t.chains[e]),r=Object.keys(i),o=t.atoms[r[0]],a=t.atoms[r[r.length-1]],d={},c={};d.position=o.coord,c.position=a.coord,d.text="N-",c.text="C-",t.nucleotides.hasOwnProperty(o.serial)&&(d.text="5'",c.text="3'"),d.size=18,c.size=18,o.color.getHexString().toUpperCase(),a.color.getHexString().toUpperCase(),d.color="black"!=t.opts.background?t.colorWhitebkgd:t.colorBlackbkgd,c.color="black"!=t.opts.background?t.colorWhitebkgd:t.colorBlackbkgd,d.background=n,c.background=n,t.labels.chain.push(d),t.labels.chain.push(c)}t.hlObjectsCls.removeHlObjects()}}class vs{constructor(e){this.icn3d=e}draw2Ddgm(e,t,s,i){let n=this.icn3d,l=n.icn3dui,r=.667,o={},a={},d={},c={},h={};if(void 0===e)return"";for(let s in e.moleculeInfor){let i="#"+("000000"+e.moleculeInfor[s].color.toString(16)).slice(-6),l=e.moleculeInfor[s].chain.trim();void 0===h[l]?h[l]=1:++h[l];let r=t+"_"+(1===h[l]?l:l+h[l].toString());void 0!==n.mmdbid_q&&(n.mmdbid_q,n.mmdbid_t),o[s]=r,a[s]=i,d[s]=e.moleculeInfor[s].name,c[r]=s}if(void 0===i||!i)for(let s=0,i=e.intracResidues.length;s";p+=""+t.toUpperCase()+"
",p+="",p+="",n.html2ddgm+=p,$("#"+n.pre+"dl_2ddgm_html").html(n.html2ddgm),p}set2DdgmNote(e){let t="
";return this.icn3d.icn3dui.utilsCls.isMac()?(t+="◯Protein
",t+="▢Nucleotide
",t+="♢Chemical
",t+="▢Biopolymer
"):(t+="OProtein
",t+="▢Nucleotide
",t+="◇Chemical
",t+="▢Biopolymer
"),t+="
Lines:
Interactions at 4 Å
",e&&(t+="Numbers in red:
Aligned chains"),t+="
",t}highlightNode(e,t,s,i){let n=this.icn3d.icn3dui;i<.2&&(i=.2);if("rect"===e){$(t).attr("stroke",n.htmlCls.ORANGE),$(t).attr("stroke-width",3);let e=Number($(s).attr("x")),l=Number($(s).attr("y")),r=Number($(s).attr("width")),o=Number($(s).attr("height"));$(t).attr("x",e+r/2*(1-i)),$(t).attr("y",l+o/2*(1-i)),$(t).attr("width",r*i),$(t).attr("height",o*i)}else if("circle"===e)$(t).attr("stroke",n.htmlCls.ORANGE),$(t).attr("stroke-width",3),$(t).attr("r",Number($(s).attr("r"))*i);else if("polygon"===e){$(t).attr("stroke",n.htmlCls.ORANGE),$(t).attr("stroke-width",3);let e=Number($(s).attr("x")),l=Number($(s).attr("y")),r=Number($(s).attr("x0d")),o=Number($(s).attr("y0d")),a=Number($(s).attr("x1d")),d=Number($(s).attr("y1d")),c=Number($(s).attr("x2d")),h=Number($(s).attr("y2d")),p=Number($(s).attr("x3d")),m=Number($(s).attr("y3d"));$(t).attr("points",(e+r*i).toString()+", "+(l+o*i).toString()+", "+(e+a*i).toString()+", "+(l+d*i).toString()+", "+(e+c*i).toString()+", "+(l+h*i).toString()+", "+(e+p*i).toString()+", "+(l+m*i).toString())}}removeLineGraphSelection(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"dl_linegraph circle").attr("stroke","#000000"),$("#"+e.pre+"dl_linegraph circle").attr("stroke-width",1),$("#"+e.pre+"dl_linegraph svg line.icn3d-hlline").attr("stroke","#FFF")}removeScatterplotSelection(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"dl_scatterplot circle").attr("stroke","#000000"),$("#"+e.pre+"dl_scatterplot circle").attr("stroke-width",1),$("#"+e.pre+"dl_scatterplot rect").attr("stroke","#000000"),$("#"+e.pre+"dl_scatterplot rect").attr("stroke-width",1)}click2Ddgm(){let e=this.icn3d,t=e.icn3dui,s=this;$(document).on("click","#"+e.pre+"dl_2ddgm .icn3d-node",(function(e){let i=s.icn3d;e.stopImmediatePropagation(),Object.keys(i.hAtoms).length";return u+="n&&(n=C),ya&&(a=y);let v=.5;m=v*o.htmlCls.width2d*m/(t[1][0]-t[0][0]),u=v*o.htmlCls.width2d*u/(t[1][1]-t[0][1]),m>h&&(h=m),u>h&&(h=u),p.push({id:d,r:l,x:C,y:y,rx:m,ry:u,ang:g,c:b.color.getHexString()})}let m=h+2,u=n-s,g=a-i;for(let e=0,t=p.length;e0&&m==S.chain&&c.push('{"source": "'+u+'", "target": "'+n+'", "v": '+p+', "c": "'+t.color.getHexString().toUpperCase()+'"}'),A.push({id:n,r:l,ss:C,x:s,y:i,x1:d,y1:g,x2:k,y2:O,c:S.color.getHexString()}),m=S.chain,u=n,++h}}}let x=S+2,k=_-y,O=w-v;for(let e=0,t=A.length;e4e3||0!==s.indexOf("http")||l.bInputfile&&!l.bInputUrlfile?$("#"+l.pre+"viewer").html(""):$("#"+l.pre+"viewer").html("
"),$("#"+l.pre+"viewer").width(i),$("#"+l.pre+"viewer").height(n),$("#"+l.pre+"cmdlog").hide(),$("#"+l.pre+"title").hide(),$("#"+l.pre+"mnlist").hide(),$("#"+l.pre+"fullscreen").length>0&&$("#"+l.pre+"fullscreen").hide(),l={}}else saveAs(e,t)}saveSvg(e,t,s){if(this.icn3d.icn3dui.bNode)return"";let i=$("#"+e).width(),n=$("#"+e).height();s&&(n=i);let l=this.getSvgXml(e,i,n,s),r=new Blob([l],{type:"image/svg+xml"});saveAs(r,t)}getSvgXml(e,t,s,i){if(this.icn3d.icn3dui.bNode)return"";return(t&&s?'"}savePng(e,t,s){let i=this.icn3d,n=i.icn3dui;if(n.bNode)return"";let l=$("#"+e).width(),r=$("#"+e).height();s&&(r=l);let o=document.getElementById(e),a=o.getBBox(),d=o.cloneNode(!0);i.lineGraphCls.copyStylesInline(d,o);let c=document.createElement("CANVAS");c.width=l,c.height=r;let h=c.getContext("2d");h.clearRect(0,0,a.width,a.height);let p=this.getSvgXml(e,l,r,s),m=window.URL||window.webkitURL||window,u=new Blob([p],{type:"image/svg+xml;charset=utf-8"}),g=new Image;g.src=m.createObjectURL(u),g.onload=function(){if(h.drawImage(g,0,0),m.revokeObjectURL(this.src),n.utilsCls.isIE()){let e=c.msToBlob();e&&(saveAs(e,t),c.remove())}else c.toBlob((function(e){e&&(saveAs(e,t),c.remove())}))}}exportCustomAtoms(e){var t=this.icn3d;t.icn3dui;let s="",i=void 0!==t.defNames2Residues?Object.keys(t.defNames2Residues).sort():[];for(let n=0,l=i.length;n
20&&(e=e.substr(0,17)+"..."),l="Query: "+e+"; target: "+s,$("#"+i.pre+"title").html(l+", "+t)}else $("#"+i.pre+"title").html(r+" "+l+": "+t);else $("#"+i.pre+"title").html(t)}getLinkToStructureSummary(e){var t=this.icn3d,s=t.icn3dui;let i="https://www.ncbi.nlm.nih.gov/structure/?term=";if(i=void 0!==s.cfg.cid?"https://www.ncbi.nlm.nih.gov/pccompound/?term=":void 0!==s.cfg.refseqid?"https://www.ncbi.nlm.nih.gov/protein/":void 0!==s.cfg.afid?"https://alphafold.ebi.ac.uk/search/text/":Object.keys(t.structures).length>1?"https://www.ncbi.nlm.nih.gov/structure/?term=":s.htmlCls.baseUrl+"pdb/",void 0===t.inputid)i="https://www.ncbi.nlm.nih.gov/pccompound/?term="+t.molTitle;else{let n=t.inputid.split("_");1===n.length?(i+=t.inputid,e&&s.htmlCls.clickMenuCls.setLogCmd("link to "+t.inputid+": "+i,!1)):2===n.length&&(s.cfg.afid?i+=n[0]+" "+n[1]:i+=n[0]+" OR "+n[1],e&&s.htmlCls.clickMenuCls.setLogCmd("link to structures "+n[0]+" and "+n[1]+": "+i,!1))}return i}setEntrezLinks(e){var t=this.icn3d,s=t.icn3dui;let i,n=Object.keys(t.structures);if(1===n.length){i="https://www.ncbi.nlm.nih.gov/"+e+"/?term="+n[0],s.htmlCls.clickMenuCls.setLogCmd("Entrez "+e+" about PDB "+n[0]+": "+i,!1);let l=t.structures&&Object.keys(t.structures).length>0?"_blank":"_self";window.open(i,l)}else if(2===n.length){i="https://www.ncbi.nlm.nih.gov/"+e+"/?term="+n[0]+" OR "+n[1],s.htmlCls.clickMenuCls.setLogCmd("Entrez "+e+" about PDB "+n[0]+" OR "+n[1]+": "+i,!1);let l=t.structures&&Object.keys(t.structures).length>0?"_blank":"_self";window.open(i,l)}}}class xs{constructor(e){this.icn3d=e}async shareLink(e,t){let s=this.icn3d,i=s.icn3dui,n=this.shareLinkUrl(),l=n.length>4e3||0!==n.indexOf("http"),r=Object.keys(s.structures).join("_");if(r==s.defaultPdbId&&(s.filename?r=s.filename:s.inputid&&(r=s.inputid)),e){if(t||s.bInputfile||l)return void s.saveFileCls.saveFile(r+"_icn3d_loadable.png","png")}else{if(s.bInputfile&&!s.bInputUrlfile)return void alert("Share Link does NOT work when the data are from custom files. Please save 'iCn3D PNG Image' in the File menu and open it in iCn3D.");if(l)return void alert("The url is more than 4000 characters and may not work. Please save 'iCn3D PNG Image' or 'State File' and open them in iCn3D.");i.htmlCls.clickMenuCls.setLogCmd("share link: "+n,!1)}let o="Problem in getting shortened URL";if(!i.cfg.notebook){let t=await this.getShareLinkPrms(n,e);if(void 0!==t.shortLink&&(o=t.shortLink,e)){let e=o.split("/"),t=e[e.length-1];s.saveFileCls.saveFile(r+"-"+t+".png","png");let i='\n\n",s.saveFileCls.saveFile(r+"-"+t+".html","html",i)}e&&void 0===t.shortLink&&s.saveFileCls.saveFile(r+"_icn3d_loadable.png","png");let i=o.split("page.link/");2==i.length&&(o="https://structure.ncbi.nlm.nih.gov/icn3d/share.html?"+i[1]),$("#"+s.pre+"short_url").val(o),$("#"+s.pre+"short_url_title").val(o+"&t="+s.yournote)}let a=this.shareLinkUrl(void 0,!0),d="view = icn3dpy.view(q='"+(i.cfg.url?"url="+i.cfg.url:i.cfg.idname+"="+i.cfg.idvalue)+"',command='"+a+"')\nview";(i.cfg.url||i.cfg.idname)&&$("#"+s.pre+"jn_commands").val(d),$("#"+s.pre+"ori_url").val(n),e||i.htmlCls.dialogCls.openDlg("dl_copyurl","Copy a Share Link URL or Jupyter Notebook Commands")}getShareLinkPrms(e,t){let s=this.icn3d,i=s.icn3dui;return new Promise((function(n,l){$.ajax({url:"https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=AIzaSyBxl9CgM0dY5lagHL4UOhEpLWE1fuwdnvc",type:"POST",data:{longDynamicLink:"https://icn3d.page.link/?link="+encodeURIComponent(e)},dataType:"json",success:function(e){n(e)},error:function(n,l,r){let o="Problem in getting shortened URL";$("#"+s.pre+"ori_url").val(e),$("#"+s.pre+"short_url").val(o),$("#"+s.pre+"short_url_title").val(o+"&t="+s.yournote),t||i.htmlCls.dialogCls.openDlg("dl_copyurl","Copy a Share Link URL")}})}))}shareLinkUrl(e,t){let s=this.icn3d,i=s.icn3dui,n=i.htmlCls.baseUrl+"icn3d/?",l="";if(i.cfg.bSidebyside&&(n=i.htmlCls.baseUrl+"icn3d/full2.html?"),s.bInputUrlfile){n=window.location.href.split("?")[0]+"?"+s.inputurl+"&"}let r,o={};for(let e in s.cfg){let t=s.cfg[e];"inpara"!==e&&"command"!==e&&"usepdbnum"!==e&&"date"!==e&&"v"!==e&&void 0!==t&&("width"===e&&"100%"===t||"height"===e&&"100%"===t||"resize"===e&&!0===t||"showmenu"===e&&!0===t||"showtitle"===e&&!0===t||"showcommand"===e&&!0===t||"mobilemenu"===e&&!1===t||"showanno"===e&&!1===t||"showseq"===e&&!1===t||"showalignseq"===e&&!1===t||"show2d"===e&&!1===t||"showsets"===e&&!1===t||"rotate"===e&&"right"===t||"command"!==e&&("options"===e?Object.keys(t).length>0&&(o[e]=JSON.stringify(t)):!0===t?o[e]=1:!1===t?o[e]=0:""!==t&&(o[e]=t)))}s.bAfMem?o.afmem="on":(i.cfg.afid||1==Object.keys(s.structures).length&&Object.keys(s.structures)[0].length>5)&&(o.afmem="off");let a=-1;void 0!==i.cfg.inpara&&(a=i.cfg.inpara.indexOf("&command=")),r=-1!==a?i.cfg.inpara.substr(0,a):i.cfg.inpara;let d=!1;if(!s.bInputUrlfile){let e=r&&r.substr(1)?r.substr(1).split("&"):[];for(let t=0,s=e.length;tc){u=s.commands[c].split("|||")[0].split("&command=")[0].trim(),-1!==u.indexOf(g)&&++f}let b,C=c+1,y="";for(let e=s.commands.length;Ct.substr(0,s))return 1;if(e.substr(0,s)==t.substr(0,s)){if(parseInt(e.substr(s+1))
",void(l.areahtml=n)}let p,m,u,g=c.vertices,f=c.faces,b=r.parasCls.thr("#00FFFF"),C=r.parasCls.thr("#00FF00"),y=r.parasCls.thr("#ff0000"),v=r.parasCls.thr("#00FFFF"),_=r.parasCls.thr("#0000FF"),w=r.parasCls.thr("#FF0000");11!=t&&12!=t&&13!=t&&14!=t||void 0===l.rmsd_supr||void 0===l.rmsd_supr.rot||(p=l.rmsd_supr.rot,m=l.rmsd_supr.trans1,u=l.rmsd_supr.trans2);let S=(11==t||12==t||13==t||14==t&&"delphi"!=l.loadPhiFrom)&&void 0!==l.rmsd_supr&&void 0!==l.rmsd_supr.rot;n=new THREE.BufferGeometry;let A,x=[],k=[],O=[],R=0;for(let e=0,s=g.length;e ";for(let e=0,t=i.length;eStructure Chain Residue Number "+i[e].substr(0,t)+" "+i[e].substr(t+1,s-t-1)+" "+i[e].substr(s+1)+" "}let l=Object.keys(t.utilsCls.getHlStructures()).join(",");e.saveFileCls.saveFile(l+"_residues.txt","html",n)}addStabilizer(){let e=this.icn3d,t=e.icn3dui,s=3.5;if(Object.keys(e.dAtoms).length>0){let i,n={},l=12.25,r=3.2*3.2;for(let t in e.dAtoms){let s=e.atoms[t];!e.nucleotides.hasOwnProperty(s.serial)||"N1"!==s.name&&"N2"!==s.name&&"N3"!==s.name&&"N4"!==s.name&&"N6"!==s.name&&"O2"!==s.name&&"O6"!==s.name||(i=s.structure+"_"+s.chain+"_"+s.resi+"_"+s.name,n[i]=s)}let o=Object.keys(n),a=o.length;void 0===e.pairArray&&(e.pairArray=[]);for(let t=0;ts)continue;let h=Math.abs(n[a].coord.y-n[d].coord.y);if(h>s)continue;let p=Math.abs(n[a].coord.z-n[d].coord.z);if(p>s)continue;let m=c*c+h*h+p*p;m>l||m0&&(l+=","),l+=n[e].substr(0,n[e].indexOf("_"));s.chainidArray=[e].concat(n),s.chainidArray=s.chainalignParserCls.addPostfixForChainids(s.chainidArray),t.htmlCls.clickMenuCls.setLogCmd("resdef "+t.cfg.resdef,!0),s.loadCmd="vast_search_chainid "+s.chainidArray,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),s.bMmdbafid=!0;let r=!0;await s.chainalignParserCls.downloadMmdbAf(l,r)}}else if(void 0!==t.cfg.url){s.bInputUrlfile=!0;let e=t.cfg.url.split("|"),i=e[0],n=e[1];s.molTitle="",s.inputid=n,s.inputurl="type="+i+"&url="+encodeURIComponent(n),s.loadCmd="load url "+n+" | type "+i,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.pdbParserCls.downloadUrl(n,i,t.cfg.command)}else if(void 0!==t.cfg.mmtfid)s.inputid=t.cfg.mmtfid,s.loadCmd="load mmtf "+t.cfg.mmtfid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmtfParserCls.downloadMmtf(t.cfg.mmtfid);else if(void 0!==t.cfg.pdbid)s.inputid=t.cfg.pdbid,s.loadCmd="load pdb "+t.cfg.pdbid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.pdbParserCls.downloadPdb(t.cfg.pdbid);else if(void 0!==t.cfg.afid){s.inputid=t.cfg.afid,s.loadCmd="load af "+t.cfg.afid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0);let e=!0;await s.pdbParserCls.downloadPdb(t.cfg.afid,e)}else if(void 0!==t.cfg.opmid)s.inputid=t.cfg.opmid,s.loadCmd="load opm "+t.cfg.opmid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.opmParserCls.downloadOpm(t.cfg.opmid);else if(void 0!==t.cfg.mmdbid)s.inputid=t.cfg.mmdbid,s.loadCmd="load mmdb "+t.cfg.mmdbid+" | parameters "+t.cfg.inpara,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadMmdb(t.cfg.mmdbid);else if(void 0!==t.cfg.gi)s.loadCmd="load gi "+t.cfg.gi,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadGi(t.cfg.gi);else if(void 0!==t.cfg.refseqid)s.inputid=t.cfg.refseqid,s.loadCmd="load refseq "+t.cfg.refseqid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadRefseq(t.cfg.refseqid);else if(void 0!==t.cfg.protein)s.inputid=t.cfg.protein,s.loadCmd="load protein "+t.cfg.protein,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadProteinname(t.cfg.protein);else if(void 0!==t.cfg.blast_rep_id)if(s.inputid=t.cfg.query_id+","+t.cfg.blast_rep_id,t.cfg.oriQuery_id=t.cfg.query_id,t.cfg.oriBlast_rep_id=t.cfg.blast_rep_id,"Query"!==t.cfg.query_id.substr(0,5)&&void 0===t.cfg.rid)"icn3d"==t.cfg.from&&"1TSR_A"==t.cfg.blast_rep_id&&"NP_001108451.1"==t.cfg.query_id&&(t.cfg.command="view annotations; set annotation cdd; set annotation site; set view detailed view; select chain 1TSR_A; show selection"),"smithwm"==t.cfg.alg?(s.loadCmd="load seq_struct_ids_smithwm "+t.cfg.query_id+","+t.cfg.blast_rep_id,s.bSmithwm=!0):"local_smithwm"==t.cfg.alg?(s.loadCmd="load seq_struct_ids_local_smithwm "+t.cfg.query_id+","+t.cfg.blast_rep_id,s.bLocalSmithwm=!0):(s.loadCmd="load seq_struct_ids "+t.cfg.query_id+","+t.cfg.blast_rep_id,s.bSmithwm=!1,s.bLocalSmithwm=!1),t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadBlast_rep_id(t.cfg.query_id+","+t.cfg.blast_rep_id);else if(void 0!==t.cfg.rid){let e="https://blast.ncbi.nlm.nih.gov/Blast.cgi?RESULTS_FILE=on&FORMAT_TYPE=JSON2_S&FORMAT_OBJECT=Alignment&CMD=Get&RID="+t.cfg.rid,i=await t.getAjaxPromise(e,"json",!1,"The RID "+t.cfg.rid+" may have expired...");for(let e=0,n=i.BlastOutput2.length;e";for(let e=1;e<=4;++e){let s=2*e;t+=this.getRadio("mn6_labelscale","mn6_labelscale0"+s,"0."+s,void 0,1,2)}for(let e=1;e<=5;++e)t+=1==e?this.getRadio("mn6_labelscale","mn6_labelscale"+e+"0",e+".0",!0,1,2):this.getRadio("mn6_labelscale","mn6_labelscale"+e+"0",e+".0",void 0,1,2);if(t+="
",t+="",t+=this.getMenuSep(),void 0===e.cfg.cid){t+=this.getMenuText("mn6_chemicalbindingwrap","Chem. Binding",void 0,void 0,1),t+="",t+=this.getRadio("mn6_chemicalbinding","mn6_chemicalbindingshow","Show",void 0,void 0,2),t+=this.getRadio("mn6_chemicalbinding","mn6_chemicalbindinghide","Hide",!0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn6_ssbondswrap","Disulfide Bonds",void 0,1,1),t+="",t+=this.getRadio("mn6_ssbonds","mn6_ssbondsYes","Show",!0,1,2),t+=this.getRadio("mn6_ssbonds","mn6_ssbondsExport","Export Pairs",void 0,void 0,2),t+=this.getRadio("mn6_ssbonds","mn6_ssbondsNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn6_clbondswrap","Cross-Linkages",void 0,void 0,1),t+="",t+=this.getRadio("mn6_clbonds","mn6_clbondsYes","Show",!0,void 0,2),t+=this.getRadio("mn6_clbonds","mn6_clbondsExport","Export Pairs",void 0,void 0,2),t+=this.getRadio("mn6_clbonds","mn6_clbondsNo","Hide",void 0,void 0,2),t+="
",t+="";let s=void 0!==e.cfg.mmtfid||void 0!==e.cfg.pdbid||void 0!==e.cfg.opmid||void 0!==e.cfg.mmcifid||void 0!==e.cfg.mmdbid||void 0!==e.cfg.mmdbafid||void 0!==e.cfg.gi||void 0!==e.cfg.blast_rep_id;s&&(t+=this.getMenuText("assemblyWrapper","Assembly",void 0,1,1),t+="",e.cfg.bu?(t+=this.getRadio("mn6_assembly","mn6_assemblyYes","Biological Assembly",!0,1,2),t+=this.getRadio("mn6_assembly","mn6_assemblyNo","Asymmetric Unit",void 0,1,2)):(t+=this.getRadio("mn6_assembly","mn6_assemblyYes","Biological Assembly",void 0,1,2),t+=this.getRadio("mn6_assembly","mn6_assemblyNo","Asymmetric Unit",!0,1,2)),t+="
",t+=""),t+=this.getMenuText("mn6_symmetrywrap","Symmetry",void 0,void 0,1),t+="",s&&(t+=this.getLink("mn6_symmetry","from PDB(precalculated) "+e.htmlCls.wifiStr,void 0,2)),t+=this.getLink("mn6_symd","from SymD(Dynamic) "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn6_clear_sym","Clear SymD Symmetry",void 0,2),t+=this.getLink("mn6_axes_only","Show Axes Only",void 0,2),t+="
",t+="",t+=this.getMenuText("mn6_igrefwrap","Ref. Number",void 0,void 0,1),t+="",
+//!!!
+t+=this.getLink("mn6_igrefYes","Show Ig Ref. Number",void 0,2),t+=this.getLink("mn6_igrefTpl","Ig w/ Specified Template",void 0,2),t+=this.getLink("mn6_igrefNo","Hide Ig Ref. Number",void 0,2),t+=this.getMenuSep(),t+=this.getLink("mn6_customref","Custom Ref. Number",void 0,2),t+="
",t+="",t+=this.getMenuSep()}return t+=this.getLink("mn6_yournote","Window Title",void 0,1),void 0!==e.cfg.cid?(t+=this.getMenuText("mn1_linkwrap","Links",void 0,void 0,1),t+="",t+=this.getLink("mn1_link_structure","Compound Summary "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_vast","Similar Compounds "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_bind","Structures Bound "+e.htmlCls.wifiStr,void 0,2),t+="
",t+=""):(t+=this.getMenuText("mn1_linkwrap","Links",void 0,void 0,1),t+="",t+=this.getLink("mn1_link_structure","Structure Summary "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_vast","Similar Structures "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_pubmed","Literature "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_protein","Protein "+e.htmlCls.wifiStr,void 0,2),t+="
",t+=""),t+="",t+=this.getMenuUrl("abouticn3d",e.htmlCls.baseUrl+"icn3d/icn3d.html#about","About iCn3D "+e.REVISION+"",1,1),t+=this.getMenuUrl("gallery",e.htmlCls.baseUrl+"icn3d/icn3d.html#gallery","Live Gallery "+e.htmlCls.wifiStr,1,1),t+=this.getMenuUrl("video",e.htmlCls.baseUrl+"icn3d/icn3d.html#videos","Videos & Tutorials",1,1),t+=this.getMenuText("mn6_faq","FAQ",void 0,1,1),t+="
",t}hideMenu(){let e=this.icn3dui;e.bNode||(void 0!==$("#"+e.pre+"mnlist")[0]&&($("#"+e.pre+"mnlist")[0].style.display="none"),void 0!==$("#"+e.pre+"mnLogSection")[0]&&($("#"+e.pre+"mnLogSection")[0].style.display="none"),void 0!==$("#"+e.pre+"cmdlog")[0]&&($("#"+e.pre+"cmdlog")[0].style.display="none"),$("#"+e.pre+"title")[0].style.margin="10px 0 0 10px")}showMenu(){let e=this.icn3dui;e.bNode||(void 0!==$("#"+e.pre+"mnlist")[0]&&($("#"+e.pre+"mnlist")[0].style.display="block"),void 0!==$("#"+e.pre+"mnLogSection")[0]&&($("#"+e.pre+"mnLogSection")[0].style.display="block"),void 0!==$("#"+e.pre+"cmdlog")[0]&&($("#"+e.pre+"cmdlog")[0].style.display="block"))}}class c{constructor(e){this.icn3dui=e}openDlg(e,t){let s=this.icn3dui;s.icn3d,s.bNode||(e=s.pre+e,s.cfg.notebook?this.openDlgNotebook(e,t):this.openDlgRegular(e,t),s.htmlCls.themecolor||(s.htmlCls.themecolor="blue"),s.htmlCls.setMenuCls.setTheme(s.htmlCls.themecolor))}addSaveButton(e){let t=this.icn3dui;t.icn3d,t.bNode||void 0!==this.dialogHashSave&&this.dialogHashSave.hasOwnProperty(e)||($("#"+e).parent().children(".ui-dialog-titlebar").append(""),void 0===this.dialogHashSave&&(this.dialogHashSave={}),this.dialogHashSave[e]=1)}addHideButton(e){let t=this.icn3dui;t.icn3d,t.bNode||void 0!==this.dialogHashHide&&this.dialogHashHide.hasOwnProperty(e)||($("#"+e).parent().children(".ui-dialog-titlebar").append(""),void 0===this.dialogHashHide&&(this.dialogHashHide={}),this.dialogHashHide[e]=1)}getDialogStatus(){let e=this.icn3dui;if(e.icn3d,e.bNode)return;let t={},s={},i=$("#"+e.pre+"dl_selectannotations").hasClass("ui-dialog-content"),n=$("#"+e.pre+"dl_graph").hasClass("ui-dialog-content"),l=$("#"+e.pre+"dl_linegraph").hasClass("ui-dialog-content"),r=$("#"+e.pre+"dl_scatterplot").hasClass("ui-dialog-content"),o=$("#"+e.pre+"dl_contactmap").hasClass("ui-dialog-content"),a=$("#"+e.pre+"dl_alignerrormap").hasClass("ui-dialog-content"),d=$("#"+e.pre+"dl_interactionsorted").hasClass("ui-dialog-content"),c=$("#"+e.pre+"dl_alignment").hasClass("ui-dialog-content"),h=$("#"+e.pre+"dl_2ddgm").hasClass("ui-dialog-content"),p=$("#"+e.pre+"dl_2dctn").hasClass("ui-dialog-content"),m=$("#"+e.pre+"dl_definedsets").hasClass("ui-dialog-content");return t.bSelectannotationsInit2=!1,t.bGraph2=!1,t.bLineGraph2=!1,t.bScatterplot2=!1,t.bTable2=!1,t.bAlignmentInit2=!1,t.bTwoddgmInit2=!1,t.bTwodctnInit2=!1,t.bSetsInit2=!1,s.dl_selectannotations="bSelectannotationsInit2",s.dl_graph="bGraph2",s.dl_linegraph="bLineGraph2",s.dl_scatterplot="bScatterplot2",s.dl_contactmap="bContactmap2",s.dl_alignerrormap="bAlignerrormap2",s.dl_interactionsorted="bTable2",s.dl_alignment="bAlignmentInit2",s.dl_2ddgm="bTwoddgmInit2",s.dl_2dctn="bTwodctnInit2",s.dl_definedsets="bSetsInit2",i&&(t.bSelectannotationsInit2=$("#"+e.pre+"dl_selectannotations").dialog("isOpen")),n&&(t.bGraph2=$("#"+e.pre+"dl_graph").dialog("isOpen")),l&&(t.bLineGraph2=$("#"+e.pre+"dl_linegraph").dialog("isOpen")),r&&(t.bScatterplot2=$("#"+e.pre+"dl_scatterplot").dialog("isOpen")),o&&(t.bContactmap2=$("#"+e.pre+"dl_contactmap").dialog("isOpen")),a&&(t.bAlignerror2=$("#"+e.pre+"dl_alignerrormap").dialog("isOpen")),d&&(t.bTable2=$("#"+e.pre+"dl_interactionsorted").dialog("isOpen")),c&&(t.bAlignmentInit2=$("#"+e.pre+"dl_alignment").dialog("isOpen")),h&&(t.bTwoddgmInit2=$("#"+e.pre+"dl_2ddgm").dialog("isOpen")),p&&(t.bTwodctnInit2=$("#"+e.pre+"dl_2dctn").dialog("isOpen")),m&&(t.bSetsInit2=$("#"+e.pre+"dl_definedsets").dialog("isOpen")),{status:t,id2flag:s}}openDlgHalfWindow(e,t,s,i){let n=this.icn3dui,l=n.icn3d;if(n.bNode)return;let r=this,o=n.htmlCls.width2d+20;l.resizeCanvasCls.resizeCanvas(n.htmlCls.WIDTH-s,n.htmlCls.HEIGHT,i);let a,d=n.htmlCls.HEIGHT,c=s;a=!n.cfg.showmenu||n.utilsCls.isMobile()||n.cfg.mobilemenu?{my:"left top",at:"right top",of:"#"+n.pre+"viewer",collision:"none"}:{my:"left top",at:"right top+40",of:"#"+n.pre+"viewer",collision:"none"},n.cfg.resize=!1,window.dialog=$("#"+e).dialog({autoOpen:!0,title:t,height:d,width:c,modal:!1,position:a,close:function(t){let s=r.getDialogStatus(),i=s.status,a=s.id2flag,d=!1;for(let t in a){let s=e===n.pre+t;for(let e in i)i.hasOwnProperty(e)||(s=s&&!i[e]);d=d||s}if(d)if(i.bTwoddgmInit2||i.bTwodctnInit2||i.bSetsInit2){let e=n.utilsCls.isMobile()?n.htmlCls.WIDTH:n.htmlCls.WIDTH-o;l.resizeCanvasCls.resizeCanvas(e,n.htmlCls.HEIGHT,!0),i.bTwoddgmInit2&&r.openDlg2Ddgm(n.pre+"dl_2ddgm",void 0,i.bSetsInit2),i.bTwodctnInit2&&r.openDlg2Ddgm(n.pre+"dl_2dctn",void 0,i.bSetsInit2),i.bSetsInit2&&r.openDlg2Ddgm(n.pre+"dl_definedsets")}else l.resizeCanvasCls.resizeCanvas(n.htmlCls.WIDTH,n.htmlCls.HEIGHT,!0)},resize:function(t){if(e==n.pre+"dl_selectannotations")l.annotationCls.hideFixedTitle();else if(e==n.pre+"dl_graph"){let t=$("#"+e).width(),s=$("#"+e).height();d3.select("#"+n.svgid).attr("width",t).attr("height",s)}else if(e==n.pre+"dl_linegraph"||e==n.pre+"dl_scatterplot"||e==n.pre+"dl_contactmap"||e==n.pre+"dl_alignerrormap"){let t=status.bTwoddgmInit2||status.bSetsInit2?(n.htmlCls.WIDTH-o)/2:n.htmlCls.WIDTH/2,s=$("#"+e).width()/t;if(e==n.pre+"dl_linegraph"){let e=l.linegraphWidth*s;$("#"+n.linegraphid).attr("width",e)}else if(e==n.pre+"dl_scatterplot"){let e=l.scatterplotWidth*s;$("#"+n.scatterplotid).attr("width",e)}else if(e==n.pre+"dl_contactmap"){let e=l.contactmapWidth*s;$("#"+n.contactmapid).attr("width",e)}else if(e==n.pre+"dl_alignerrormap"){let e=l.alignerrormapWidth*s;$("#"+n.alignerrormapid).attr("width",e)}}}}),this.addSaveButton(e),this.addHideButton(e)}openDlg2Ddgm(e,t,s){let i=this.icn3dui,n=i.icn3d;if(i.bNode)return;let l,r,o=this,a=i.htmlCls.width2d+20;e===i.pre+"dl_definedsets"?(l="right top",r="Select sets"):e!==i.pre+"dl_2ddgm"&&e!==i.pre+"dl_2dctn"||(l=s?"right top+240":"right top",r=e===i.pre+"dl_2ddgm"?"2D Diagram":"2D Cartoon");let d={my:"left top+"+i.htmlCls.MENU_HEIGHT,at:l,of:"#"+i.pre+"viewer",collision:"none"};window.dialog=$("#"+e).dialog({autoOpen:!0,title:r,height:"auto",width:a,modal:!1,position:d,close:function(e){let t=o.getDialogStatus().status;t.bSelectannotationsInit2||t.bGraph2||t.bLineGraph2||t.bScatterplot2||t.bTable2||t.bAlignmentInit2||n.resizeCanvasCls.resizeCanvas(i.htmlCls.WIDTH,i.htmlCls.HEIGHT,!0)},resize:function(t,s){e==i.pre+"dl_2dctn"&&(n.resizeRatioX=s.size.width/i.htmlCls.width2d,n.resizeRatioY=s.size.height/(i.htmlCls.width2d+70))},resizeStop:function(e,t){n.resizeRatioX=t.size.width/i.htmlCls.width2d,n.resizeRatioY=t.size.height/(i.htmlCls.width2d+70)}}),this.addSaveButton(e),this.addHideButton(e)}openDlgRegular(e,t){let s=this.icn3dui,i=s.icn3d;if(s.bNode)return;let n=400,l=150,r=s.htmlCls.width2d+20,o=this.getDialogStatus().status;if(e===s.pre+"dl_selectannotations"||e===s.pre+"dl_graph"||e===s.pre+"dl_linegraph"||e===s.pre+"dl_scatterplot"||e===s.pre+"dl_contactmap"||e===s.pre+"dl_alignerrormap"||e===s.pre+"dl_interactionsorted"||e===s.pre+"dl_alignment"){let a=.5*s.htmlCls.WIDTH-.5*r;if(s.htmlCls.WIDTH>=s.htmlCls.HEIGHT)this.openDlgHalfWindow(e,t,a,!0),(o.bTwoddgmInit2||o.bTwodctnInit2||o.bSetsInit2)&&(i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH-a-r,s.htmlCls.HEIGHT,!0),o.bTwoddgmInit2&&this.openDlg2Ddgm(s.pre+"dl_2ddgm",void 0,o.bSetsInit2),o.bTwodctnInit2&&this.openDlg2Ddgm(s.pre+"dl_2dctn",void 0,o.bSetsInit2),o.bSetsInit2&&this.openDlg2Ddgm(s.pre+"dl_definedsets"));else{i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH,.5*s.htmlCls.HEIGHT,!0),l=.5*s.htmlCls.HEIGHT,n=s.htmlCls.WIDTH;let a={my:"left top",at:"left bottom+32",of:"#"+s.pre+"canvas",collision:"none"};window.dialog=$("#"+e).dialog({autoOpen:!0,title:t,height:l,width:n,modal:!1,position:a,close:function(t){if(!((e!==s.pre+"dl_selectannotations"||o.bAlignmentInit2||o.bGraph2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_graph"||o.bSelectannotationsInit2||o.bAlignmentInit2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_alignment"||o.bSelectannotationsInit2||o.bGraph2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_interactionsorted"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_linegraph"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bTable2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_scatterplot"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bTable2||o.bLineGraph2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_contactmap"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bAlignerrormap2)&&(e!==s.pre+"dl_alignerrormap"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2)))if(o.bTwoddgmInit2||o.bTwodctnInit2||o.bSetsInit2){let e=s.utilsCls.isMobile()?s.htmlCls.WIDTH:s.htmlCls.WIDTH-r;i.resizeCanvasCls.resizeCanvas(e,s.htmlCls.HEIGHT,!0),o.bTwoddgmInit2&&thisClass.openDlg2Ddgm(s.pre+"dl_2ddgm",void 0,o.bSetsInit2),o.bTwodctnInit2&&thisClass.openDlg2Ddgm(s.pre+"dl_2dctn",void 0,o.bSetsInit2),o.bSetsInit2&&thisClass.openDlg2Ddgm(s.pre+"dl_definedsets")}else i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH,s.htmlCls.HEIGHT,!0)},resize:function(t){if(e==s.pre+"dl_selectannotations")i.annotationCls.hideFixedTitle();else if(e==s.pre+"dl_graph"){let t=$("#"+e).width(),i=$("#"+e).height();d3.select("#"+s.svgid).attr("width",t).attr("height",i)}else if(e==s.pre+"dl_linegraph"||e==s.pre+"dl_scatterplot"||e==s.pre+"dl_contactmap"||e==s.pre+"dl_alignerrormap"){let t=o.bTwoddgmInit2||o.bSetsInit2?(s.htmlCls.WIDTH-r)/2:s.htmlCls.WIDTH/2,n=$("#"+e).width()/t;if(e==s.pre+"dl_linegraph"){let e=i.linegraphWidth*n;$("#"+s.linegraphid).attr("width",e)}else if(e==s.pre+"dl_scatterplot"){let e=i.scatterplotWidth*n;$("#"+s.scatterplotid).attr("width",e)}else if(e==s.pre+"dl_contactmap"){let e=i.contactmapWidth*n;$("#"+s.contactmapid).attr("width",e)}else if(e==s.pre+"dl_alignerrormap"){let e=i.alignerrormapWidth*n;$("#"+s.alignerrormapid).attr("width",e)}}}}),this.addSaveButton(e),this.addHideButton(e)}}else if(e===s.pre+"dl_2ddgm"||e===s.pre+"dl_2dctn"){let t=0;if(s.htmlCls.WIDTH>=s.htmlCls.HEIGHT)(o.bSelectannotationsInit2||o.bGraph2||o.bLineGraph2||o.bScatterplot2||o.bTable2||o.bAlignmentInit2)&&(t=.5*s.htmlCls.WIDTH-.5*r),i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH-t-r,s.htmlCls.HEIGHT,!0),this.openDlg2Ddgm(e,void 0,o.bSetsInit2);else{let t=s.utilsCls.isMobile()?s.htmlCls.WIDTH:s.htmlCls.WIDTH-r;i.resizeCanvasCls.resizeCanvas(t,.5*s.htmlCls.HEIGHT,!0),this.openDlg2Ddgm(e,.5*s.htmlCls.HEIGHT),this.openDlg2Ddgm(e,.5*s.htmlCls.HEIGHT,o.bSetsInit2)}}else{let a;if(l="auto",n="auto",e===s.pre+"dl_addtrack"?n="50%":e===s.pre+"dl_menupref"&&(n=600,l=500),e===s.pre+"dl_definedsets"){let t=0;if(s.htmlCls.WIDTH>=s.htmlCls.HEIGHT)(o.bSelectannotationsInit2||o.bGraph2||o.bLineGraph2||o.bScatterplot2||o.bTable2||o.bAlignmentInit2)&&(t=.5*s.htmlCls.WIDTH-.5*r),i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH-t-r,s.htmlCls.HEIGHT,!0),this.openDlg2Ddgm(e),o.bTwoddgmInit2&&this.openDlg2Ddgm(s.pre+"dl_2ddgm",void 0,!0),o.bTwodctnInit2&&this.openDlg2Ddgm(s.pre+"dl_2dctn",void 0,!0);else{let t=s.utilsCls.isMobile()?s.htmlCls.WIDTH:s.htmlCls.WIDTH-r;i.resizeCanvasCls.resizeCanvas(t,.5*s.htmlCls.HEIGHT,!0),this.openDlg2Ddgm(e,.5*s.htmlCls.HEIGHT),o.bTwoddgmInit2&&this.openDlg2Ddgm(s.pre+"dl_2ddgm",.5*s.htmlCls.HEIGHT,!0),o.bTwodctnInit2&&this.openDlg2Ddgm(s.pre+"dl_2dctn",.5*s.htmlCls.HEIGHT,!0)}}else s.utilsCls.isMobile()?a={my:"left top",at:"left bottom-50",of:"#"+s.pre+"canvas",collision:"none"}:e===s.pre+"dl_allinteraction"||e===s.pre+"dl_buriedarea"?(a={my:"right top",at:"right top+50",of:"#"+i.divid,collision:"none"},n=700,l=500):a=e===s.pre+"dl_rmsd"||e===s.pre+"dl_legend"?{my:"left bottom",at:"left+20 bottom-20",of:"#"+s.pre+"canvas",collision:"none"}:e===s.pre+"dl_symd"?{my:"left top",at:"right-200 bottom-200",of:"#"+s.pre+"canvas",collision:"none"}:s.cfg.align?{my:"left top",at:"left top+90",of:"#"+s.pre+"canvas",collision:"none"}:e===s.pre+"dl_mmdbafid"?{my:"left top",at:"left top+130",of:"#"+s.pre+"canvas",collision:"none"}:{my:"left top",at:"left top+50",of:"#"+s.pre+"canvas",collision:"none"},window.dialog=$("#"+e).dialog({autoOpen:!0,title:t,height:l,width:n,modal:!1,position:a}),this.addSaveButton(e),this.addHideButton(e)}$(".ui-dialog .ui-button span").removeClass("ui-icon-closethick").addClass("ui-icon-close")}openDlgNotebook(e,t){let s=this.icn3dui,i=s.icn3d;if(s.bNode)return;let n=400,l=150,r=s.htmlCls.width2d+20;e===s.pre+"dl_selectannotations"||e===s.pre+"dl_graph"||e===s.pre+"dl_linegraph"||e===s.pre+"dl_scatterplot"||e===s.pre+"dl_contactmap"||e===s.pre+"dl_alignerrormap"||e===s.pre+"dl_interactionsorted"||e===s.pre+"dl_alignment"?($("#"+e).show(),$("#"+e+"_nb").show(),$("#"+e+"_title").html(t),l=.5*s.htmlCls.HEIGHT,n=s.htmlCls.WIDTH,$("#"+e).width(n),$("#"+e).height(l),$("#"+e).resize((function(t){let n=s.htmlCls.WIDTH/2,l=$("#"+e).width()/n;if(e==s.pre+"dl_selectannotations")i.annotationCls.hideFixedTitle();else if(e==s.pre+"dl_graph"){let t=$("#"+e).width(),i=$("#"+e).height();d3.select("#"+s.svgid).attr("width",t).attr("height",i)}else if(e==s.pre+"dl_linegraph"){let e=i.linegraphWidth*l;$("#"+s.linegraphid).attr("width",e)}else if(e==s.pre+"dl_scatterplot"){let e=i.scatterplotWidth*l;$("#"+s.scatterplotid).attr("width",e)}else if(e==s.pre+"dl_contactmap"){let e=i.contactmapWidth*l;$("#"+s.contactmapid).attr("width",e)}else if(e==s.pre+"dl_alignerrormap"){let e=i.alignerrormapWidth*l;$("#"+s.alignerrormapid).attr("width",e)}}))):(i.bRender&&($("#"+e).show(),$("#"+e+"_nb").show(),$("#"+e+"_title").html(t)),l="auto",n="auto",e===s.pre+"dl_addtrack"?n="50%":e===s.pre+"dl_2ddgm"||e===s.pre+"dl_2dctn"||e===s.pre+"dl_definedsets"?n=r:e!==s.pre+"dl_allinteraction"&&e!==s.pre+"dl_buriedarea"||(n=700,l=500),$("#"+e).width(n),$("#"+e).height(l))}}class h{constructor(e){this.icn3dui=e}setCustomDialogs(){let e=this.icn3dui;if(e.icn3d,e.bNode)return"";return""}getHtmlAlignResidueByResidue(e,t,s){let i=this.icn3dui;i.icn3d;let n="";return n+="All chains will be aligned to the first chain in the comma-separated chain IDs. Each chain ID has the form of PDBID_chain (e.g., 1HHO_A, case sensitive) or UniprotID (e.g., P69905 for AlphaFold structures).",t+=this.getMenuUrl("faq_viewstru",e.htmlCls.baseUrl+"icn3d/icn3d.html#viewstru","View structure",1,2),t+=this.getMenuUrl("faq_tfstru",e.htmlCls.baseUrl+"icn3d/icn3d.html#tfstru","Transform Structure",1,2),t+=this.getMenuUrl("faq_selsubset",e.htmlCls.baseUrl+"icn3d/icn3d.html#selsubset","Select Subsets",1,2),t+=this.getMenuUrl("faq_stylecolor",e.htmlCls.baseUrl+"icn3d/icn3d.html#changestylecolor","Change Style/Color",1,2),t+=this.getMenuUrl("faq_savework",e.htmlCls.baseUrl+"icn3d/icn3d.html#saveview","Save Work",1,2),t+=this.getMenuUrl("faq_showanno",e.htmlCls.baseUrl+"icn3d/icn3d.html#showanno","Show Annotations",1,2),t+=this.getMenuUrl("faq_exportanno",e.htmlCls.baseUrl+"icn3d/icn3d.html#exportanno","Export Annotations",1,2),t+=this.getMenuUrl("faq_interanal",e.htmlCls.baseUrl+"icn3d/icn3d.html#interanalysis","Interaction Analysis",1,2),t+=this.getMenuUrl("faq_mutanal",e.htmlCls.baseUrl+"icn3d/icn3d.html#mutationanalysis","Mutation Analysis",1,2),t+=this.getMenuUrl("faq_elecpot",e.htmlCls.baseUrl+"icn3d/icn3d.html#elecpot","Electrostatic Pot.",1,2),t+=this.getMenuUrl("faq_simipdb",e.htmlCls.baseUrl+"icn3d/icn3d.html#simivast","Similar PDB",1,2),t+=this.getMenuUrl("faq_simialphapdb",e.htmlCls.baseUrl+"icn3d/icn3d.html#simifoldseek","Similar AlphaFold/PDB",1,2),t+=this.getMenuUrl("faq_alnstru",e.htmlCls.baseUrl+"icn3d/icn3d.html#alignmul","Align Multiple Structures",1,2),t+=this.getMenuUrl("faq_batchanal",e.htmlCls.baseUrl+"icn3d/icn3d.html#batchanalysis","Batch Analysis",1,2),t+=this.getMenuUrl("faq_embedicn3d",e.htmlCls.baseUrl+"icn3d/icn3d.html#embedicn3d","Embed iCn3D",1,2),t+="
",t+="",t+=this.getMenuUrl("citing",e.htmlCls.baseUrl+"icn3d/icn3d.html#citing","Citing iCn3D",void 0,1),t+=this.getMenuText("mn6_source","Source Code",void 0,1,1),t+="",t+=this.getMenuUrl("github","https://github.com/ncbi/icn3d","GitHub (browser) "+e.htmlCls.wifiStr,1,2),t+=this.getMenuUrl("npm","https://www.npmjs.com/package/icn3d","npm (Node.js) "+e.htmlCls.wifiStr,1,2),t+=this.getMenuUrl("notebook","https://pypi.org/project/icn3dpy","Jupyter Notebook "+e.htmlCls.wifiStr,1,2),t+="
",t+="",t+=this.getMenuText("mn6_develop","Develop",void 0,void 0,1),t+="",t+=this.getMenuUrl("dev_embedicn3d2",e.htmlCls.baseUrl+"icn3d/icn3d.html#HowToUse","Embed iCn3D",void 0,2),t+=this.getMenuUrl("dev_urlpara",e.htmlCls.baseUrl+"icn3d/icn3d.html#parameters","URL Parameters",void 0,2),t+=this.getMenuUrl("dev_command",e.htmlCls.baseUrl+"icn3d/icn3d.html#commands","Commands",void 0,2),t+=this.getMenuUrl("dev_datastru",e.htmlCls.baseUrl+"icn3d/icn3d.html#datastructure","Data Structure",void 0,2),t+=this.getMenuUrl("dev_classstru",e.htmlCls.baseUrl+"icn3d/icn3d.html#classstructure","Class Structure",void 0,2),t+=this.getMenuUrl("dev_addclass",e.htmlCls.baseUrl+"icn3d/icn3d.html#addclass","Add New Classes",void 0,2),t+=this.getMenuUrl("dev_modfunc",e.htmlCls.baseUrl+"icn3d/icn3d.html#modifyfunction","Modify Functions",void 0,2),t+=this.getMenuUrl("dev_restful",e.htmlCls.baseUrl+"icn3d/icn3d.html#restfulapi","RESTful APIs",void 0,2),t+=this.getMenuUrl("dev_contributor",e.htmlCls.baseUrl+"icn3d/icn3d.html#contributors","iCn3D Contributors",void 0,2),t+="
",t+="",t+=this.getMenuUrl("helpdoc",e.htmlCls.baseUrl+"icn3d/docs/icn3d_help.html","Help Doc "+e.htmlCls.wifiStr,1,1),t+=this.getMenuSep(),t+=this.getMenuText("mn6_tfhint","Transform Hints",void 0,1,1),t+="",t+=this.getMenuText("mn6_rotate","Rotate",void 0,1,2),t+="
",t+="",t+=this.getMenuUrl("selhints",e.htmlCls.baseUrl+"icn3d/icn3d.html#selsubset","Selection Hints",void 0,1),t+=this.getMenuUrl("helpdesk","https://support.nlm.nih.gov/support/create-case/","Write to Help Desk",1,1),t+="",t+="
",t+="",t+=this.getMenuText("mn6_zoom","Zoom",void 0,1,2),t+="",t+="
",t+="",t+=this.getMenuText("mn6_translate","Translate",void 0,1,2),t+="
(Pinch & Spread)",t+="
",t+="",t+="
(Two Finger Click & Drag)
",n+="Chain IDs: "+i.htmlCls.inputTextStr+"id='"+i.pre+e+"' value='P69905,P01942,1HHO_A' size=50>
",n+='Each alignment is defined as " | "-separated residue lists in one line. "10-50" means a range of residues from 10 to 50.
",n+=i.htmlCls.buttonStr+s+"'>Align Residue by Residue
",n}addNotebookTitle(e,t,s){let i=this.icn3dui;i.icn3d;let n=' ';return s&&(n+=''),n}setDialogs(){let e=this.icn3dui,t=e.icn3d;if(e.bNode)return"";let s="";e.htmlCls.optionStr="",s+=e.htmlCls.optionStr+"'"+r+"4'>4px",s+=e.htmlCls.optionStr+"'"+r+"8' selected>8px",s+=e.htmlCls.optionStr+"'"+r+"12'>12px",s+=e.htmlCls.optionStr+"'"+r+"16'>16px",s+=e.htmlCls.optionStr+"'"+r+"24'>24px",s+=e.htmlCls.optionStr+"'"+r+"32'>32px",s+="",s+="",s+="",s+="",s+=e.htmlCls.divStr+"dl_alignment' class='"+n+"' style='background-color:white;'>",s+=this.addNotebookTitle("dl_alignment","Dynamically Calculated Symmetry using SymD"),s+=e.htmlCls.divStr+"symd_info'>",s+=e.htmlCls.divStr+"alignseqguide_wrapper'>
"+e.htmlCls.setHtmlCls.setAlignSequenceGuide()+"",s+=e.htmlCls.divStr+"dl_sequence2' class='icn3d-dl_sequence'>",s+=this.addNotebookTitle("dl_sequence2","Select Residues in Aligned Sequences"),s+="",s+="",s+=e.htmlCls.divStr+"dl_definedsets' class='"+n+"'>",s+=this.addNotebookTitle("dl_definedsets","Defined Sets"),s+=e.htmlCls.divStr+"dl_setsmenu'>",s+="Defined Sets:
",s+="
',s+="",s+=e.htmlCls.divStr+"dl_command' style='display:none;'>",s+=e.htmlCls.divStr+"dl_setoperations'>",s+="
",s+="
",s+="",s+="
",s+=e.htmlCls.setHtmlCls.setAdvanced(),s+="",s+="",s+=e.htmlCls.setHtmlCls.setAdvanced(2),s+=e.htmlCls.divStr+"dl_vastplus' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_vastplus","Please input PDB ID for VAST+"),s+="Note: VAST+ finds other macromolecular structures that have a similar biological unit. To do this, VAST+ takes into consideration the complete set of 3D domains that VAST identified within a query structure, throughout all of its component protein molecules, and finds other macromolecular structures that have a similar set of proteins/3D domains.
",s+="PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"vastpluspdbid' value='6VXX' size=8>
",s+=e.htmlCls.buttonStr+"reload_vastplus'>VAST+",s+="",s+=e.htmlCls.divStr+"dl_vast' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_vast","Pleaes input chain or PDB file for VAST"),s+="Note: VAST identifies 3D domains (substructures) within each protein structure in the Molecular Modeling Database (MMDB), and then finds other protein structures that have one or more similar 3D domains, using purely geometric criteria. You have two ways to do a VAST search.
",s+="Option 1, search with your selection (all residues are selected by default) in the loaded structures:
",s+='
",s+="Option 2, search with PDB ID and chain name:
",s+="PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"vastpdbid' value='4N7N' size=8> ",s+="Chain Name: "+e.htmlCls.inputTextStr+"id='"+e.pre+"vastchainid' value='A' size=8>
",s+=e.htmlCls.buttonStr+"reload_vast'>VAST
",s+="Option 3, search with a PDB file:
",s+='
",s+="",s+=e.htmlCls.divStr+"dl_foldseek' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_foldseek","Submit your selection to Foldseek"),s+='1. your selection (all residues are selected by default) in the loaded structures to Foldseek web server.
',s+='2 (Optional). Once you see the structure neighbors, you can view the alignment in iCn3D by inputing a list of PDB chain IDs or AlphaFold UniProt IDs below.
The PDB chain IDs are the same as the record names such as "1HHO_A". The UniProt ID is the text between "AF-" and "-F1". For example, the UniProt ID for the record name "AF-P69905-F1-model_v4" is "P69905".
',s+="Chain ID List: "+e.htmlCls.inputTextStr+"id='"+e.pre+"foldseekchainids' value='P69905,P01942,1HHO_A' size=30> ",s+=e.htmlCls.buttonStr+"reload_foldseek'>Align",s+="",s+=e.htmlCls.divStr+"dl_mmtfid' class='"+n+"'>",s+=this.addNotebookTitle("dl_mmtfid","Please input an MMTF ID"),s+="MMTF ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"mmtfid' value='1TUP' size=8> ",s+=e.htmlCls.buttonStr+"reload_mmtf'>Load",s+="",s+=e.htmlCls.divStr+"dl_pdbid' class='"+n+"'>",s+=this.addNotebookTitle("dl_pdbid","Please input a PDB ID"),s+="PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"pdbid' value='1TUP' size=8> ",s+=e.htmlCls.buttonStr+"reload_pdb'>Load",s+="",s+=e.htmlCls.divStr+"dl_afid' class='"+n+"'>",s+=this.addNotebookTitle("dl_afid","Please input an AlphaFold UniProt ID"),s+="Note: AlphaFold produces a per-residue confidence score (pLDDT) between 0 and 100:
",s+=e.htmlCls.clickMenuCls.setAlphaFoldLegend()+"
";let o=e.cfg.afid?e.cfg.afid:"A4D1S0";s+="AlphaFold Uniprot ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"afid' value='"+o+"' size=10>
",s+=e.htmlCls.buttonStr+"reload_af'>Load Structure
",s+="PAE Map: "+e.htmlCls.buttonStr+"reload_afmap'>Load Half"+e.htmlCls.buttonStr+"reload_afmapfull' style='margin-left:30px'>Load Full (slow)",s+="",s+=e.htmlCls.divStr+"dl_refseqid' class='"+n+"'>",s+=this.addNotebookTitle("dl_refseqid","Please input an NCBI protein accession"),s+="NCBI Protein Accession: "+e.htmlCls.inputTextStr+"id='"+e.pre+"refseqid' value='NP_001743.1' size=8> ",s+=e.htmlCls.buttonStr+"reload_refseq'>Load",s+="",s+=e.htmlCls.divStr+"dl_opmid' class='"+n+"'>",s+=this.addNotebookTitle("dl_opmid","Please input an OPM PDB ID"),s+="Orientations of Proteins in Membranes(OPM) PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"opmid' value='6JXR' size=8> ",s+=e.htmlCls.buttonStr+"reload_opm'>Load",s+="",s+=e.htmlCls.divStr+"dl_pdbfile' class='"+n+"'>",s+=this.addNotebookTitle("dl_pdbfile","Please input a PDB file"),s+='Note: Several PDB files could be concatenated into a single PDB file. Use the line "ENDMDL" to separate PDB files.
',s+="PDB File: "+e.htmlCls.inputFileStr+" id='"+e.pre+"pdbfile' size=8> ",s+=e.htmlCls.buttonStr+"reload_pdbfile'>Load",s+="",s+=e.htmlCls.divStr+"dl_pdbfile_app' class='"+n+"'>",s+=this.addNotebookTitle("dl_pdbfile_app","Please append PDB files"),s+="Multiple PDB Files: ",s+=e.htmlCls.buttonStr+"reload_pdbfile_app'>Append",s+="",s+=e.htmlCls.divStr+"dl_rescolorfile' class='"+n+"'>",s+=this.addNotebookTitle("dl_rescolorfile","Please input a residue color file"),s+='
',s+='{"ALA":"#C8C8C8", "ARG":"#145AFF", ..., "G":"#008000", "A":"#6080FF", ...}
',s+="Residue Color File: "+e.htmlCls.inputFileStr+"id='"+e.pre+"rescolorfile' size=8> ",s+=e.htmlCls.buttonStr+"reload_rescolorfile'>Load",s+="",s+=e.htmlCls.divStr+"dl_customcolor' class='"+n+"'>",s+=this.addNotebookTitle("dl_customcolor","Please input a custom color file"),s+=" ",s+='
',s+="Custom File: "+e.htmlCls.inputFileStr+"id='"+e.pre+"cstcolorfile' size=8>
",s+="1. "+e.htmlCls.buttonStr+"reload_customcolorfile'>Apply Custom Color"+e.htmlCls.buttonStr+"remove_legend' style='margin-left:30px;'>Remove Legend
",s+="Score to Color: 0:
",s+="or
",s+="2. "+e.htmlCls.buttonStr+"reload_customtubefile'>Apply Custom Tube",s+="",s+=e.htmlCls.divStr+"dl_customref' class='"+n+"'>",s+=this.addNotebookTitle("dl_customref","Please input a reference number file"),s+='
',s+="refnum,11,12,,21,22,,10C,11C,20C
",s+="1TUP_C,,,,,,,200,201,230",s+='The first row defines the reference residue numbers, which could be any strings. The 1st cell could be anything. The rest cells are reference residue numbers (e.g., 11, 21, 10C, etc.) 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 fourth row shows another set of reference numners for the chain "1TUP_C". It could be a chain from a different structure.
",s+="1TUP_A,100,101,,,132,,,,
",s+="1TUP_B,110,111,,141,142,,,,
',s+='To select all residues corresponding to the reference numbers, you can simplay replace ":" with "%" in the Specification. 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.
',s+="
",s+="Custom File: "+e.htmlCls.inputFileStr+"id='"+e.pre+"cstreffile' size=8>
",s+=e.htmlCls.buttonStr+"reload_customreffile'>Apply Custom Reference Numbers",s+="",s+=e.htmlCls.divStr+"dl_align' class='"+n+"'>",s+=this.addNotebookTitle("dl_align","Please select residues in aligned sequences"),s+="Enter the PDB IDs or MMDB IDs of the structures:
ID1: "+e.htmlCls.inputTextStr+"id='"+e.pre+"alignid1' value='2DN3' size=8>"+e.htmlCls.space3+e.htmlCls.space3+"ID2: "+e.htmlCls.inputTextStr+"id='"+e.pre+"alignid2' value='4N7N' size=8>
",s+="VAST+ based on VAST: "+e.htmlCls.buttonStr+"reload_align_ori'>All Matching Molecules Superposed"+e.htmlCls.space3+e.htmlCls.buttonStr+"reload_align_refined'>Invariant Substructure Superposed
",s+="VAST+ based on TM-align: "+e.htmlCls.buttonStr+"reload_align_tmalign'>All Matching Molecules Superposed
",s+="",s+=e.htmlCls.divStr+"dl_alignaf' class='"+n+"'>",s+=this.addNotebookTitle("dl_alignaf","Align AlphaFold structures"),s+="Enter two AlphaFold Uniprot IDs:
ID1: "+e.htmlCls.inputTextStr+"id='"+e.pre+"alignafid1' value='P41327' size=8>"+e.htmlCls.space3+e.htmlCls.space3+"ID2: "+e.htmlCls.inputTextStr+"id='"+e.pre+"alignafid2' value='P41331' size=8>
",s+=e.htmlCls.buttonStr+"reload_alignaf_tmalign'>Align with TM-align"+e.htmlCls.buttonStr+"reload_alignaf' style='margin-left:30px'>Align with VAST",s+="",s+=e.htmlCls.divStr+"dl_chainalign' class='"+n+"'>",s+=this.addNotebookTitle("dl_chainalign","Align chains"),s+="
",s+="Chain IDs: "+e.htmlCls.inputTextStr+"id='"+e.pre+"chainalignids' value='P69905,P01942,1HHO_A' size=50>
",s+=e.htmlCls.buttonStr+"reload_chainalign_tmalign'>Align with TM-align"+e.htmlCls.buttonStr+"reload_chainalign_asym' style='margin-left:30px'>Align with VAST
",s+='(Note: To align chains in custom PDB files, you could load them in "File > Open File > PDB Files (appendable)" and click "Analysis > Defined Sets". Finally select multiple chains in Defined Sets and click "File > Realign Selection".)
',s+="
",s+="Chain IDs: "+e.htmlCls.inputTextStr+"id='"+e.pre+"chainalignids2' value='P69905,P01942,1HHO_A' size=50>
",s+="The sequence alignment (followed by structure alignemnt) is based on residue numbers in the First/Master chain:
"+e.htmlCls.inputTextStr+"id='"+e.pre+"resalignids' value='1,5,10-50' size=50>
",s+=e.htmlCls.buttonStr+"reload_chainalign_asym2' style='margin-top:3px;'>Align by Sequence Alignment
",s+='(Note: To align chains in custom PDB files, you could load them in "File > Open File > PDB Files (appendable)" and click "Analysis > Defined Sets". Finally select multiple chains in Defined Sets and click "File > Realign Selection".)
',s+="
",s+="Option 2:
",s+="
If you load a custom structure without PDB or UniProt ID, you can open "Seq. & Annotations" window and find the chain ID such as "stru_A". The part before the underscore is the structure ID, which can be used to specify the mutation such as "stru_A_...". Remember to choose "Show Mutation in: Current Page".
',s+="
",s+="ID Type: ",s+='PDB ID',s+='AlphaFold UniProt ID
',s+="Show Mutation in: ",s+='Current Page',s+='New Page
',s+=e.htmlCls.buttonStr+"reload_mutation_3d' title='Show the mutations in 3D using the scap program'>3D with scap",s+=e.htmlCls.buttonStr+"reload_mutation_inter' style='margin-left:20px' title='Show the mutations in 3D and the change of interactions'>Interactions",s+=e.htmlCls.buttonStr+"reload_mutation_pdb' style='margin-left:20px' title='Show the mutations in 3D and export the PDB of the mutant within 10 angstrom'>PDB",s+="
",s+=e.htmlCls.buttonStr+"reload_afmapfile'>Load Half PAE Map"+e.htmlCls.buttonStr+"reload_afmapfilefull' style='margin-left:30px'>Load Full PAE Map (slow)",s+="",s+=e.htmlCls.divStr+"dl_urlfile' class='"+n+"'>",s+=this.addNotebookTitle("dl_urlfile","Please input a file via URL"),s+="File type: ",s+="
",s+="URL in the same host: "+e.htmlCls.inputTextStr+"id='"+e.pre+"urlfile' size=20>
",s+=e.htmlCls.buttonStr+"reload_urlfile'>Load",s+="",s+=e.htmlCls.divStr+"dl_mmciffile' class='"+n+"'>",s+=this.addNotebookTitle("dl_mmciffile","Please input an mmCIF file"),s+="mmCIF File: "+e.htmlCls.inputFileStr+"id='"+e.pre+"mmciffile' value='1TUP' size=8> ",s+=e.htmlCls.buttonStr+"reload_mmciffile'>Load",s+="",s+=e.htmlCls.divStr+"dl_mmcifid' class='"+n+"'>",s+=this.addNotebookTitle("dl_mmcifid","Please input an mmCIF ID"),s+="mmCIF ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"mmcifid' value='1TUP' size=8> ",s+=e.htmlCls.buttonStr+"reload_mmcif'>Load",s+="",s+=e.htmlCls.divStr+"dl_mmdbid' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_mmdbid","Please input an MMDB ID"),s+="MMDB or PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"mmdbid' value='1TUP' size=8>
",s+=e.htmlCls.buttonStr+"reload_mmdb'>Load Biological Unit"+e.htmlCls.buttonStr+"reload_mmdb_asym' style='margin-left:30px'>Load Asymmetric Unit (All Chains)
",s+='Note: The "biological unit" is the biochemically active form of a biomolecule,
The "asymmetric unit" is the raw 3D structure data resolved by X-ray crystallography, NMR, or Cryo-electron microscopy. The asymmetric unit is equivalent to the biological unit in approximately 60% of structure records. In the remaining 40% of the records, the asymmetric unit represents a portion of the biological unit that can be reconstructed using crystallographic symmetry, or it represents multiple copies of the biological unit.',s+="",s+=e.htmlCls.divStr+"dl_mmdbafid' class='"+n+"' style='max-width:600px'>",s+=this.addNotebookTitle("dl_mmdbafid","Please input a list of PDB/AlphaFold IDs"),s+="List of PDB, MMDB, or AlphaFold UniProt structures: "+e.htmlCls.inputTextStr+"id='"+e.pre+"mmdbafid' placeholder='e.g., 1HHO,4N7N,P69905,P01942' size=30>
",s+=""+e.htmlCls.buttonStr+"reload_mmdbaf' style='width:150px'>Load Biological Unit"+e.htmlCls.buttonStr+"reload_mmdbaf_asym' style='margin-left:30px; width:250px'>Load Asymmetric Unit (All Chains)
",s+="
",s+='Note: The "biological unit" is the biochemically active form of a biomolecule,
The "asymmetric unit" is the raw 3D structure data resolved by X-ray crystallography, NMR, or Cryo-electron microscopy. The asymmetric unit is equivalent to the biological unit in approximately 60% of structure records. In the remaining 40% of the records, the asymmetric unit represents a portion of the biological unit that can be reconstructed using crystallographic symmetry, or it represents multiple copies of the biological unit.',s+="",s+=e.htmlCls.divStr+"dl_blast_rep_id' style='max-width:600px;' class='"+n+"'>",s+=this.addNotebookTitle("dl_blast_rep_id","Align sequence to structure"),s+="Enter a Sequence ID (or FASTA sequence) and the aligned protein accession, which can be found using the BLAST search with the Sequence ID or FASTA sequence as input. If the protein accession is not a PDB chain, the corresponding AlphaFold UniProt structure is used.
",s+="Sequence ID(NCBI protein accession of a sequence): "+e.htmlCls.inputTextStr+"id='"+e.pre+"query_id' value='NP_001108451.1' size=8>
",s+="or FASTA sequence:
",s+="NCBI protein accession (or a chain of a PDB): "+e.htmlCls.inputTextStr+"id='"+e.pre+"blast_rep_id' value='1TSR_A' size=8>
",s+=e.htmlCls.buttonStr+"reload_blast_rep_id'>Align with BLAST "+e.htmlCls.wifiStr+e.htmlCls.buttonStr+"reload_alignsw' style='margin-left:30px'>Align with Global Smith-Waterman"+e.htmlCls.buttonStr+"reload_alignswlocal' style='margin-left:30px'>Align with Local Smith-Waterman",s+="",s+=e.htmlCls.divStr+"dl_esmfold' style='max-width:600px;' class='"+n+"'>",s+=this.addNotebookTitle("dl_esmfold","Sequence to structure prediction with ESMFold"),s+="The sequence to structure prediction is done via ESM Metagenomic Atlas. The sequence should be less than 400 characters. For any sequence longer than 400, please see the discussion here.
",s+="FASTA sequence:
",s+=e.htmlCls.buttonStr+"run_esmfold'>ESMFold ",s+="",s+=e.htmlCls.divStr+"dl_yournote' class='"+n+"'>",s+=this.addNotebookTitle("dl_yournote","Your Note"),s+='Your note will be saved in the HTML file when you click "File > Save File > iCn3D PNG Image".
',s+="
",s+=e.htmlCls.buttonStr+"applyyournote'>Save",s+="",s+=e.htmlCls.divStr+"dl_proteinname' class='"+n+"'>",s+=this.addNotebookTitle("dl_proteinname","Please input a protein/gene name"),s+="Protein/Gene name: "+e.htmlCls.inputTextStr+"id='"+e.pre+"proteinname' value='TP53' size=8> ",s+=e.htmlCls.buttonStr+"reload_proteinname'>Search",s+="",s+=e.htmlCls.divStr+"dl_cid' class='"+n+"'>",s+=this.addNotebookTitle("dl_cid","Please input a PubChem CID"),s+="PubChem CID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"cid' value='2244' size=8> ",s+=e.htmlCls.buttonStr+"reload_cid'>Load",s+="",s+=e.htmlCls.divStr+"dl_pngimage' class='"+n+"'>",s+=this.addNotebookTitle("dl_pngimage","Please input an iCn3D PNG Image file"),s+="iCn3D PNG image: "+e.htmlCls.inputFileStr+"id='"+e.pre+"pngimage'>
",s+=e.htmlCls.buttonStr+"reload_pngimage' style='margin-top: 6px;'>Load",s+="",s+=e.htmlCls.divStr+"dl_state' class='"+n+"'>",s+=this.addNotebookTitle("dl_state","Please input a state file"),s+="State file: "+e.htmlCls.inputFileStr+"id='"+e.pre+"state'>
",s+=e.htmlCls.buttonStr+"reload_state' style='margin-top: 6px;'>Load",s+="",s+=e.htmlCls.divStr+"dl_fixedversion' style='max-width:500px' class='"+n+"'>",s+=this.addNotebookTitle("dl_fixedversion","Use fixed version of iCn3D"),s+='Since January 6, 2021, you can show the original view with the archived version of iCn3D by pasting your URL below and click "Show Originial View". Note the version in the parameter "v" was used to replace "full.html" with "full_[v].html" in the URL.
',s+="Share Link URL: "+e.htmlCls.inputTextStr+"id='"+e.pre+"sharelinkurl' size=60>
",s+=e.htmlCls.buttonStr+"reload_fixedversion'>Show Original View
",s+="",s+=e.htmlCls.divStr+"dl_selection' class='"+n+"'>",s+=this.addNotebookTitle("dl_selection","Load a selection file"),s+="Selection file: "+e.htmlCls.inputFileStr+"id='"+e.pre+"selectionfile'>
",s+=e.htmlCls.buttonStr+"reload_selectionfile' style='margin-top: 6px;'>Load",s+="",s+=e.htmlCls.divStr+"dl_menuloadpref' class='"+n+"'>",s+=this.addNotebookTitle("dl_menuloadpref","Load a preference file"),s+="Preference file: "+e.htmlCls.inputFileStr+"id='"+e.pre+"menupreffile'>
",s+=e.htmlCls.buttonStr+"reload_menupreffile' style='margin-top: 6px;'>Load",s+="",s+=e.htmlCls.divStr+"dl_dsn6' class='"+n+"'>",s+=this.addNotebookTitle("dl_dsn6","Load a map file"),s+="Note: Always load a PDB file before loading map files.
",s+="2fofc contour at:
",s+=e.htmlCls.inputFileStr+"id='"+e.pre+"dsn6file2fofc'> "+e.htmlCls.buttonStr+"reload_dsn6file2fofc' style='margin: 6px 20px 0 0;'>Load DSN6
",s+="fofc contour at:
",s+=e.htmlCls.inputFileStr+"id='"+e.pre+"dsn6filefofc'> "+e.htmlCls.buttonStr+"reload_dsn6filefofc' style='margin: 6px 20px 0 0;'>Load DSN6
",s+=e.htmlCls.buttonStr+"elecmapNo4'>Remove Map
",s+="",s+=e.htmlCls.divStr+"dl_dsn6url' class='"+n+"'>",s+=this.addNotebookTitle("dl_dsn6url","Load a selection file via a URL"),s+="Note: Always load a PDB file before loading map files.
",s+="2fofc contour at:
",s+="URL in the same host: "+e.htmlCls.inputTextStr+"id='"+e.pre+"dsn6fileurl2fofc' size=20>"+e.htmlCls.space3+e.htmlCls.buttonStr+"reload_dsn6fileurl2fofc' style='margin-top: 6px;'>Load
",s+="fofc contour at:
",s+="URL in the same host: "+e.htmlCls.inputTextStr+"id='"+e.pre+"dsn6fileurlfofc' size=20>"+e.htmlCls.space3+e.htmlCls.buttonStr+"reload_dsn6fileurlfofc' style='margin-top: 6px;'>Load
",s+=e.htmlCls.buttonStr+"elecmapNo5'>Remove Map
",s+="",s+=e.htmlCls.divStr+"dl_clr' class='"+n+"'>",s+=this.addNotebookTitle("dl_clr","Pick a color"),s+="Click in the input box to use the color picker:
",s+="Custom Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"colorcustom' value='FF0000' size=8> ",s+=e.htmlCls.buttonStr+"applycustomcolor'>Apply",s+="",s+=e.htmlCls.setHtmlCls.getPotentialHtml("delphi",n),s+=e.htmlCls.setHtmlCls.getPotentialHtml("local",n),s+=e.htmlCls.setHtmlCls.getPotentialHtml("url",n),s+=e.htmlCls.divStr+"dl_symmetry' class='"+n+"'>
",s+=this.addNotebookTitle("dl_symmetry","Symmetry"),s+=e.htmlCls.divNowrapStr+"Symmetry:
",s+=this.addNotebookTitle("dl_symd","Dynamically symmetry calculation using SymD"),s+="",s+=e.htmlCls.divStr+"dl_contact' class='"+n+"'>",s+=this.addNotebookTitle("dl_contact","Contact Map"),s+="Distance:
",s+=""+e.htmlCls.buttonStr+"applycontactmap'>Display
",s+="",s+=e.htmlCls.divStr+"dl_hbonds' class='"+n+"'>",s+=this.addNotebookTitle("dl_hbonds","Interaction Analysis"),s+="1. Choose interaction types and their thresholds:
",s+="",s+=" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_hbond' checked>Hydrogen Bonds "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_saltbridge' checked>Salt Bridge/Ionic "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_contact' checked>Contacts/Interactions "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+="",s+=" "+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_halogen' checked>Halogen Bonds "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_pication' checked>π-Cation "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_pistacking' checked>π-Stacking "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+="
",s+="",s+=e.htmlCls.divNowrapStr+"2. Select the first set:",s+=" ",s+=e.htmlCls.divNowrapStr+"3. Select the second set:",s+="
",s+="
",s+="
",s+="
",r=': "+e.htmlCls.buttonStr+"hbondGraph'>2D Graph(Force-Directed) to show interactions with strength parameters in 0-200:",s+=' ',s+="Helix or Sheet'+r+e.pre+'dist_ss" size="4" value="100"> ',s+="Coil or Nucleotide"+r+e.pre+'dist_coil" size="4" value="50"> ',s+="Disulfide Bonds"+r+e.pre+'dist_ssbond" size="4" value="50"> ',s+="Hydrogen Bonds"+r+e.pre+'dist_hbond" size="4" value="50"> ',s+="Salt Bridge/Ionic"+r+e.pre+'dist_ionic" size="4" value="50"> ',s+="Contacts"+r+e.pre+'dist_inter" size="4" value="25"> Halogen Bonds"+r+e.pre+'dist_halogen" size="4" value="50"> ',s+="π-Cation"+r+e.pre+'dist_pication" size="4" value="50"> ',s+="π-Stacking"+r+e.pre+'dist_pistacking" size="4" value="50">
',s+="
",s+="
or use your current selection:
",s+="
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_realignbystruct' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_realignbystruct","Realign by structure"),s+="
",s+="
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_realigntwostru' class='"+n+"'>",s+=this.addNotebookTitle("dl_realigntwostru","Realign two structure complexes"),s+=e.htmlCls.divNowrapStr+"1. Select sets below or use your current selection:
",s+="
",s+="2. Overall maximum RMSD: "+e.htmlCls.inputTextStr+"id='"+e.pre+"maxrmsd' value='30' size='2'> Å
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_colorspectrumacrosssets' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorspectrumacrosssets","Set color spectrum across sets"),s+=e.htmlCls.divNowrapStr+"1. Select sets below:
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_colorspectrumbysets' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorspectrumbysets","Set color spectrum for residues in sets"),s+=e.htmlCls.divNowrapStr+"1. Select sets below:
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_colorrainbowacrosssets' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorrainbowacrosssets","Set color rainbow across sets"),s+=e.htmlCls.divNowrapStr+"1. Select sets below:
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_colorrainbowbysets' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorrainbowbysets","Set color rainbow for residues in sets"),s+=e.htmlCls.divNowrapStr+"1. Select sets below:
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_allinteraction' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_allinteraction","All interactions",!0),s+="",s+=e.htmlCls.divStr+"dl_interactionsorted' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_interactionsorted","Sorted interactions",!0),s+="",s+=e.htmlCls.divStr+"dl_linegraph' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_linegraph","2D Interaction Network"),s+=e.htmlCls.divNowrapStr+'
",e.linegraphid=e.pre+"linegraph",s+=e.htmlCls.divNowrapStr+l+e.linegraphid+'_svg">SVG'+e.htmlCls.space2,s+=l+e.linegraphid+'_png">PNG'+e.htmlCls.space2,s+=l+e.linegraphid+'_json">JSON'+e.htmlCls.space4,s+="Scale:
",s+='',s+="",s+=e.htmlCls.divStr+"dl_scatterplot' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_scatterplot","2D Interaction Map"),s+=e.htmlCls.divNowrapStr+"Hold Ctrl key to select multiple nodes."+e.htmlCls.space3,s+='
",s+='',s+="",s+=e.htmlCls.divStr+"dl_contactmap' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_contactmap","Contact Map"),s+=e.htmlCls.divNowrapStr+"Hold Ctrl key to select multiple nodes."+e.htmlCls.space3+"",e.contactmapid=e.pre+"contactmap",s+=e.htmlCls.divNowrapStr+l+e.contactmapid+'_svg">SVG'+e.htmlCls.space2,s+=l+e.contactmapid+'_png">PNG'+e.htmlCls.space2,s+=l+e.contactmapid+'_json">JSON'+e.htmlCls.space4,s+="Scale:
",s+='',s+="",s+=e.htmlCls.divStr+"dl_alignerrormap' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_alignerrormap","PAE Map"),s+=e.htmlCls.divNowrapStr+"Hold Ctrl key to select multiple nodes."+e.htmlCls.space3+"",e.alignerrormapid=e.pre+"alignerrormap",s+=e.htmlCls.divNowrapStr+l+e.alignerrormapid+'_svg">SVG'+e.htmlCls.space2,s+=l+e.alignerrormapid+'_png">PNG (slow)'+e.htmlCls.space2,s+=l+e.alignerrormapid+'_json">JSON'+e.htmlCls.space4,s+='Scale:
";s+="0 5 10 15 20 25 30 Expected position error (Angstroms)
",s+='',s+="",s+=e.htmlCls.divStr+"dl_elecmap2fofc' class='"+n+"'>",s+=this.addNotebookTitle("dl_elecmap2fofc","Electron Density 2F0-Fc Map"),s+="Contour at:
"+e.htmlCls.buttonStr+"applyemmap'>Display "+e.htmlCls.buttonStr+"emmapNo2'>Remove EM Map",s+="",s+=e.htmlCls.divStr+"dl_aroundsphere' class='"+n+"'>",s+=this.addNotebookTitle("dl_aroundsphere","Select a sphere around a set of residues"),s+=e.htmlCls.divNowrapStr+"1. Select the first set:",s+="
",s+=e.htmlCls.divNowrapStr+"2. Sphere with a radius: "+e.htmlCls.inputTextStr+"id='"+e.pre+"radius_aroundsphere' value='4' size='2'> Å
",s+=e.htmlCls.divNowrapStr+"3. Select the second set to apply the sphere:",s+="
",s+=e.htmlCls.divNowrapStr+"4. "+e.htmlCls.buttonStr+"applypick_aroundsphere'>Display the sphere around the first set of atoms
",s+="
",s+=e.htmlCls.divNowrapStr+"1. Extracellular membrane Z-axis position: "+e.htmlCls.inputTextStr+"id='"+e.pre+"extra_mem_z' value='' size='3'> Å
",s+=e.htmlCls.divNowrapStr+"2. intracellular membrane Z-axis position: "+e.htmlCls.inputTextStr+"id='"+e.pre+"intra_mem_z' value='' size='3'> Å
",s+=e.htmlCls.divNowrapStr+"3. "+e.htmlCls.buttonStr+"apply_adjustmem'>Display the adjusted membranes
",s+="",s+=e.htmlCls.divStr+"dl_selectplane' class='"+n+"'>",s+=this.addNotebookTitle("dl_selectplane","Select a plane"),s+="Note: The membranes are parallel to the X-Y plane. The center of the membranes is at Z = 0.
",s+=e.htmlCls.divNowrapStr+"1. Z-axis position of the first X-Y plane: "+e.htmlCls.inputTextStr+"id='"+e.pre+"selectplane_z1' value='15' size='3'> Å
",s+=e.htmlCls.divNowrapStr+"2. Z-axis position of the second X-Y plane: "+e.htmlCls.inputTextStr+"id='"+e.pre+"selectplane_z2' value='-15' size='3'> Å
",s+=e.htmlCls.divNowrapStr+"3. "+e.htmlCls.buttonStr+"apply_selectplane'>Save the region between the planes to Defined Sets
",s+="",s+=e.htmlCls.divStr+"dl_addlabel' class='"+n+"'>",s+=this.addNotebookTitle("dl_addlabel","Add labels between two atoms"),s+="1. Text: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labeltext' value='Text' size=4>
",s+="2. Size: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelsize' value='18' size=4 maxlength=2>
",s+="3. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelcolor' value='"+"#ffff00' size=4>
",e.utilsCls.isMobile()?s+=e.htmlCls.spanNowrapStr+"4. Touch TWO atoms
":s+=e.htmlCls.spanNowrapStr+'4. Pick TWO atoms while holding "Alt" key
',s+=e.htmlCls.spanNowrapStr+"5. "+e.htmlCls.buttonStr+"applypick_labels'>Display",s+="",s+=e.htmlCls.divStr+"dl_addlabelselection' class='"+n+"'>",s+=this.addNotebookTitle("dl_addlabelselection","Add labels for your selection"),s+="1. Text: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labeltext2' value='Text' size=4>
",s+="2. Size: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelsize2' value='18' size=4 maxlength=2>
",s+="3. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelcolor2' value='"+"#ffff00' size=4>
",s+=e.htmlCls.spanNowrapStr+"4. "+e.htmlCls.buttonStr+"applyselection_labels'>Display",s+="",s+=e.htmlCls.divStr+"dl_labelColor' class='"+n+"'>",s+=this.addNotebookTitle("dl_labelColor","Change label color"),s+="Color for all labels: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelcolorall' value='"+"#ffff00' size=4>
",s+=e.htmlCls.spanNowrapStr+e.htmlCls.buttonStr+"applylabelcolor'>Display",s+="",s+=e.htmlCls.divStr+"dl_distance' class='"+n+"'>",s+=this.addNotebookTitle("dl_distance","Measure distance"),e.utilsCls.isMobile()?s+=e.htmlCls.spanNowrapStr+"1. Touch TWO atoms
":s+=e.htmlCls.spanNowrapStr+'1. Pick TWO atoms while holding "Alt" key
',s+=e.htmlCls.spanNowrapStr+"2. Line Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"distancecolor' value='"+"#ffff00' size=4>
",s+=e.htmlCls.spanNowrapStr+"3. "+e.htmlCls.buttonStr+"applypick_measuredistance'>Display",s+="",s+=e.htmlCls.divStr+"dl_stabilizer' class='"+n+"'>",s+=this.addNotebookTitle("dl_stabilizer","Add a stabilizer"),e.utilsCls.isMobile()?s+=e.htmlCls.spanNowrapStr+"1. Touch TWO atoms
":s+=e.htmlCls.spanNowrapStr+'1. Pick TWO atoms while holding "Alt" key
',s+=e.htmlCls.spanNowrapStr+"2. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"stabilizercolor' value='ffffff' size=4>
",s+=e.htmlCls.spanNowrapStr+"3. "+e.htmlCls.buttonStr+"applypick_stabilizer'>Add",s+="",s+=e.htmlCls.divStr+"dl_disttwosets' class='"+n+"'>",s+=this.addNotebookTitle("dl_disttwosets","Measure the distance between two sets"),s+=e.htmlCls.spanNowrapStr+"1. Select two sets
",s+="
",s+=e.htmlCls.spanNowrapStr+"2. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"distancecolor2' value='"+"#ffff00' size=4>",s+=e.htmlCls.divNowrapStr+"First set:",s+=" ",s+=e.htmlCls.divNowrapStr+"Second set:",s+="
",s+=e.htmlCls.spanNowrapStr+"3. "+e.htmlCls.buttonStr+"applydist2'>Display",s+="",s+=e.htmlCls.divStr+"dl_linebtwsets' class='"+n+"'>",s+=this.addNotebookTitle("dl_linebtwsets","Add a line between two sets"),s+=e.htmlCls.spanNowrapStr+"1. Select two sets
",s+="
",s+=e.htmlCls.divNowrapStr+"2. Line style: ",s+=e.htmlCls.divNowrapStr+"First set:",s+=" ",s+=e.htmlCls.divNowrapStr+"Second set:",s+="
",s+="3. Line radius: "+e.htmlCls.inputTextStr+"id='"+e.pre+"linebtwsets_radius' value='0.4' size=4>
",s+="4. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"linebtwsets_customcolor' value='"+"#ffff00' size=4>
",s+=e.htmlCls.divNowrapStr+"5. Opacity:
",s+=e.htmlCls.spanNowrapStr+"6. "+e.htmlCls.buttonStr+"applylinebtwsets'>Display",s+=e.htmlCls.space3+e.htmlCls.spanNowrapStr+e.htmlCls.buttonStr+"clearlinebtwsets'>Clear",s+="",s+=e.htmlCls.divStr+"dl_cartoonshape' class='"+n+"'>",s+=this.addNotebookTitle("dl_cartoonshape","Cartoon Shape"),s+=e.htmlCls.spanNowrapStr+"1. Select a set:
",s+="
",s+=e.htmlCls.divNowrapStr+"2. Shape:
",s+="3. Radius: "+e.htmlCls.inputTextStr+"id='"+e.pre+"cartoonshape_radius' value='1.5' size=4>
",s+="4. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"cartoonshape_customcolor' value='"+"#ffff00' size=4>
",s+=e.htmlCls.divNowrapStr+"5. Opacity:
",s+=e.htmlCls.spanNowrapStr+"6. "+e.htmlCls.buttonStr+"applycartoonshape'>Display",s+=e.htmlCls.space3+e.htmlCls.spanNowrapStr+e.htmlCls.buttonStr+"clearcartoonshape'>Clear",s+="",s+=e.htmlCls.divStr+"dl_distmanysets' class='"+n+"'>",s+=this.addNotebookTitle("dl_distmanysets","Measure distances among many sets"),s+=e.htmlCls.spanNowrapStr+"1. Select sets for pairwise distances
",s+="
",s+=e.htmlCls.spanNowrapStr+"2. "+e.htmlCls.buttonStr+"applydisttable'>Distances in Table",s+="",s+=e.htmlCls.divStr+"dl_stabilizer_rm' class='"+n+"'>",s+=this.addNotebookTitle("dl_stabilizer_rm","Remove a stabilizer"),e.utilsCls.isMobile()?s+=e.htmlCls.spanNowrapStr+"1. Touch TWO atoms",s+=e.htmlCls.divNowrapStr+"First sets:",s+=" ",s+=e.htmlCls.divNowrapStr+"Second sets:",s+="
":s+=e.htmlCls.spanNowrapStr+'1. Pick TWO atoms while holding "Alt" key
',s+=e.htmlCls.spanNowrapStr+"2. "+e.htmlCls.buttonStr+"applypick_stabilizer_rm'>Remove",s+="",s+=e.htmlCls.divStr+"dl_thickness' class='"+n+"'>",s+=this.addNotebookTitle("dl_thickness","Set thickness"),s+=e.htmlCls.setHtmlCls.setThicknessHtml("3dprint"),s+="",s+=e.htmlCls.divStr+"dl_thickness2' class='"+n+"'>",s+=this.addNotebookTitle("dl_thickness2","Set thickness"),s+=e.htmlCls.setHtmlCls.setThicknessHtml("style"),s+="",s+=e.htmlCls.divStr+"dl_menupref' class='"+n+"'>",s+=this.addNotebookTitle("dl_menupref","Preferences for menus"),s+="Note: The following parameters will be saved in cache. You just need to set them once.
",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"apply_menupref'>Apply",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"reset_menupref' style='margin-left:30px'>Reset to Simple Menus",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"reset_menupref_all' style='margin-left:30px'>Reset to All Menus",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"savepref' style='margin-left:30px'>Save Preferences
",s+="
",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"apply_menupref2'>Apply",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"reset_menupref2' style='margin-left:30px'>Reset to Simple Menus",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"reset_menupref_all2' style='margin-left:30px'>Reset to All Menus",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"savepref2' style='margin-left:30px'>Save Preferences",s+="",s+=e.htmlCls.divStr+"dl_addtrack' class='"+n+"'>",s+=this.addNotebookTitle("dl_addtrack","Add a track"),s+=" ",s+=e.htmlCls.divStr+"dl_addtrack_tabs' style='border:0px;'>",s+="",s+="
",s+=e.htmlCls.divStr+"tracktab1'>",s+="NCBI gi/Accession: "+e.htmlCls.inputTextStr+"id='"+e.pre+"track_gi' placeholder='gi' size=16>
",s+=e.htmlCls.buttonStr+"addtrack_button1'>Add Track",s+="",s+=e.htmlCls.divStr+"tracktab2'>",s+="FASTA Title: "+e.htmlCls.inputTextStr+"id='"+e.pre+"fasta_title' placeholder='track title' size=16>
",s+="FASTA sequence:
",s+=e.htmlCls.buttonStr+"addtrack_button2'>Add Track",s+="",s+=e.htmlCls.divStr+"tracktab2b'>",s+="
",s+="Precalculated Multiple Sequence Alignment (MSA):
",s+="
",s+="Position of the first residue in Sequences & Annotations window: "+e.htmlCls.inputTextStr+"id='"+e.pre+"fasta_startpos' value='1' size=2>
",s+="Color Sequence by:
",s+=e.htmlCls.buttonStr+"addtrack_button2b'>Add Track(s)",s+="",s+=e.htmlCls.divStr+"tracktab2c'>",s+="
",s+="NCBI Gene ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"track_geneid' size=20>"+e.htmlCls.space3+e.htmlCls.buttonStr+"exons_table'>Exons & Introns in Gene Table
",s+="Position of the first residue in Sequences & Annotations window: "+e.htmlCls.inputTextStr+"id='"+e.pre+"fasta_startpos2' value='1' size=2>
",s+=e.htmlCls.buttonStr+"addtrack_button2c'>Show Isoforms & Exons",s+="",s+=e.htmlCls.divStr+"tracktab3'>",s+="BED file: "+e.htmlCls.inputFileStr+"id='"+e.pre+"track_bed' size=16>
",s+=e.htmlCls.buttonStr+"addtrack_button3'>Add Track",s+="",s+=e.htmlCls.divStr+"tracktab4'>",s+="Track Title: "+e.htmlCls.inputTextStr+"id='"+e.pre+"track_title' placeholder='track title' size=16>
",s+='Track Text (e.g., "2 G, 5-6 RR" defines a character "G" at the position 2 and two continuous characters "RR" at positions from 5 to 6. The starting position is 1):
',s+="
",s+=e.htmlCls.buttonStr+"addtrack_button4'>Add Track",s+="",s+=e.htmlCls.divStr+"tracktab5'>",s+="Track Title: "+e.htmlCls.inputTextStr+"id='"+e.pre+"track_selection' placeholder='track title' size=16>
",s+=e.htmlCls.buttonStr+"addtrack_button5'>Add Track",s+="",s+="",s+="",s+=e.htmlCls.divStr+"dl_saveselection' class='"+n+"'>",s+=this.addNotebookTitle("dl_saveselection","Save Selection");let m=t&&t.defNames2Atoms?Object.keys(t.defNames2Atoms).length:1;s+="Name: "+e.htmlCls.inputTextStr+"id='"+e.pre+"seq_command_name' value='seq_"+m+"' size='5'>
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_copyurl' style='width:520px;' class='"+n+"'>",s+=this.addNotebookTitle("dl_copyurl","Share Link"),s+="
",s+="1. URLs Used in Browsers
",s+='Please copy one of the URLs below. They show the same result.
(To add a title to share link, click "Windows > Your Note" and click "File > Share Link" again.)
',s+="Original URL with commands:
",e.cfg.notebook||(s+="Lifelong Short URL:(To replace this URL, send a pull request to update share.html at iCn3D GitHub)
"+e.htmlCls.inputTextStr+"id='"+e.pre+"short_url' value='' style='width:100%'>
",s+='Lifelong Short URL + Window Title:(To update the window title, click "Analysis > Your Note/Window Title".)
'+e.htmlCls.inputTextStr+"id='"+e.pre+"short_url_title' value='' style='width:100%'>
"),s+="2. Commands Used in Jupyter Noteboook
",s+="Please copy the following commands into a cell in Jupyter Notebook to show the same result.
More details are at https://github.com/ncbi/icn3d/tree/master/jupyternotebook.
",s+='
',s+=l+e.pre+'jn_copy">Copy Commands
',s+="",s+=e.htmlCls.divStr+"dl_selectannotations' class='"+n+" icn3d-annotation' style='background-color:white;'>",s+=this.addNotebookTitle("dl_selectannotations","Sequences & Annotations"),s+=e.htmlCls.divStr+"dl_annotations_tabs'>",s+=e.htmlCls.divStr+"dl_anno_view_tabs' style='border:0px; height:33px;'>",s+="",s+=e.htmlCls.divStr+"anno_tmp1'>",s+="",s+=e.htmlCls.divStr+"anno_tmp2'>",s+="",s+="",s+=this.getAnnoHeader(),s+="
",s+=e.htmlCls.divStr+"seqguide_wrapper' style='display:none'>
"+e.htmlCls.setHtmlCls.setSequenceGuide("2")+"",s+="
",s+=e.htmlCls.divStr+"dl_annotations'>",s+="",s+="",s+=e.htmlCls.divStr+"dl_graph' style='background-color:white;' class='"+n+"'>",s+=this.addNotebookTitle("dl_graph","Interactions"),e.svgid=e.pre+"icn3d_viz",s+="",s+=e.htmlCls.divNowrapStr+"Zoom: mouse wheel; "+e.htmlCls.space3+" Move: left button; "+e.htmlCls.space3+" Select Multiple Nodes: Ctrl Key and drag an Area"+e.htmlCls.space3,s+='
",s+='(0-20% out is considered "in". 50-100% out is considered "out".)
',s+="Toal: "+e.htmlCls.inputTextStr+"id='"+e.pre+"areavalue' value='' size='10'> Å2
",s+="",s+="",s+=e.htmlCls.divStr+"dl_colorbyarea' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorbyarea","Color by surface area"),s+="
",s+="Middle Percentage(White): "+e.htmlCls.inputTextStr+"id='"+e.pre+"midpercent' value='35' size='10'>%
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_rmsd' class='"+n+"' style='max-width:300px'>",s+=this.addNotebookTitle("dl_rmsd","RMSD",!0),s+="",s+=e.htmlCls.divStr+"dl_buriedarea' class='"+n+"'>",s+=this.addNotebookTitle("dl_buriedarea","Buried surface area",!0),s+="",s+=e.htmlCls.divStr+"dl_propbypercentout' class='"+n+"'>",s+=this.addNotebookTitle("dl_propbypercentout","Select residues basen on solvent accessilbe surface area"),s+="
",s+="Min Percentage: "+e.htmlCls.inputTextStr+"id='"+e.pre+"minpercentout' value='0' size='10'>%
",s+="Max Percentage: "+e.htmlCls.inputTextStr+"id='"+e.pre+"maxpercentout' value='100' size='10'>%
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_propbybfactor' class='"+n+"'>",s+=this.addNotebookTitle("dl_propbybfactor","Select residues basen on B-factor/pLDDT"),s+="
",s+="Min B-factor/pLDDT: "+e.htmlCls.inputTextStr+"id='"+e.pre+"minbfactor' value='0' size='10'>%
",s+="Max B-factor/pLDDT: "+e.htmlCls.inputTextStr+"id='"+e.pre+"maxbfactor' value='100' size='10'>%
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_legend' class='"+n+"' style='max-width:500px; background-color:white'>",s+=this.addNotebookTitle("dl_legend","Legend",!0),s+="",s+=e.htmlCls.divStr+"dl_disttable' class='"+n+"'>",s+=this.addNotebookTitle("dl_disttable","Distance Table",!0),s+="",s+=e.htmlCls.divStr+"dl_igrefTpl' class='"+n+"'>",s+=this.addNotebookTitle("dl_igrefTpl","Choose an Ig template"),s+="Choose an Ig template for selected residues:
"+e.htmlCls.buttonStr+"mn6_igrefTpl_apply'>Show Ig Ref. Number",s+="",s+="",s+="\x3c!--/form--\x3e",s}getAnnoHeader(){let e=this.icn3dui;e.icn3d;let t="";t+="
",t+="";let s=" ",i=" ";return t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_all'>All"+e.htmlCls.space2+" ",t+=i+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_cdd' checked>Conserved Domains"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_clinvar'>ClinVar"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_binding'>Functional Sites"+e.htmlCls.space2+"",t+="",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_custom'>Custom"+e.htmlCls.space2+"",t+=i+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_3dd'>3D Domains"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_snp'>SNPs"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_ptm'>PTM (UniProt)"+e.htmlCls.space2+"",t+=" ",t+=" ",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_ssbond'>Disulfide Bonds"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_interact'>Interactions"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_crosslink'>Cross-Linkages"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_transmem'>Transmembrane"+e.htmlCls.space2+"",t+=" ",t+=" ";for(let e=0,i=o.alnChainsAnno[l][t].length;e ':' ';else if("E"==i)if(void 0!==o.alnChainsSeq[s][e]){let i=s+"_"+o.alnChainsSeq[s][e].resi;if(o.residues.hasOwnProperty(i)){o.firstAtomObjCls.getFirstCalphaAtomObj(o.residues[i]).ssend?b[t]+=' ':b[t]+=' '}else b[t]+=' '}else b[t]+=' ';else b[t]+="c"==i?' ':"o"==i?' ':"";else b[t]+=""+i+""}b[t]+=""}let O=l,R=void 0!==o.pdbid_chain2title?o.pdbid_chain2title[u]:"";for(let e=k-1;e>=0;--e){let t=o.alnChainsAnTtl[l][e][0];"SS"==t&&(t=""),a+="
",g>0&&(f+=y),++g}return{sequencesHtml:a,maxSeqCnt:d}}}class u{constructor(e){this.icn3dui=e}getLink(e,t,s,i){let n=this.icn3dui;return n.icn3d,n.htmlCls.allMenus[e]=t,i&&(n.htmlCls.allMenusSel[e]=i),s&&(n.htmlCls.simpleMenus[e]=1),"
",n+="",n}getOptionHtml(e,t){let s=this.icn3dui;s.icn3d;let i="";for(let n=0,l=e.length;n ",n+=" ",n+="",n+="
",n+="Select: "+t.htmlCls.inputTextStr+"id='"+t.pre+"command"+s+"' placeholder='$[structures].[chains]:[residues]@[atoms]' size='60'> ",n+="Name: "+t.htmlCls.inputTextStr+"id='"+t.pre+"command_name"+s+"' placeholder='my_selection' size='60'> ",n+=""+t.htmlCls.space3+t.htmlCls.buttonStr+"command_apply"+s+"'>Save Selection to Defined Sets ",n+='Specification Tips:
',n+=t.htmlCls.divStr+"specguide"+s+"' style='display:none; width:500px' class='icn3d-box'>",n+='Specification: In the selection "$1HHO,4N7N.A,B,C:5-10,LV,3AlaVal,chemicals@CA,C,C*":',n+='
",n+="Set Operation:",n+='
',n+='
',n+='
',n+='
',n+='
',n+='
',n+='
',n+="Full commands in url or command window:",n+="
',n+='
",n+="",n+="
",n+="
",i+="1. Shininess: "+t.htmlCls.inputTextStr+"id='"+t.pre+"shininess' value='"+m+"' size=4>"+t.htmlCls.space3+"(for the shininess of the 3D objects, default 40)
",i+="2. Three directional lights:
",i+="Key Light: "+t.htmlCls.inputTextStr+"id='"+t.pre+"light1' value='"+u+"' size=4>"+t.htmlCls.space3+"(for the light strength of the key light, default 0.8)
",i+="Fill Light: "+t.htmlCls.inputTextStr+"id='"+t.pre+"light2' value='"+g+"' size=4>"+t.htmlCls.space3+"(for the light strength of the fill light, default 0.4)
",i+="Back Light: "+t.htmlCls.inputTextStr+"id='"+t.pre+"light3' value='"+f+"' size=4>"+t.htmlCls.space3+"(for the light strength of the back light, default 0.2)
",i+="3. Thickness:
"}return i+="Line Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"linerad_"+e+"' value='"+n+"' size=4>"+t.htmlCls.space3+"(for stabilizers, hydrogen bonds, distance lines, default 0.1)
",i+="Coil Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"coilrad_"+e+"' value='"+l+"' size=4>"+t.htmlCls.space3+"(for coils, default 0.3)
",i+="Stick Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"stickrad_"+e+"' value='"+r+"' size=4>"+t.htmlCls.space3+"(for sticks, default 0.4)
",i+="Cross-Linkage Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"crosslinkrad_"+e+"' value='"+o+"' size=4>"+t.htmlCls.space3+"(for cross-linkages, default 0.4)
",i+="Trace Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"tracerad_"+e+"' value='"+a+"' size=4>"+t.htmlCls.space3+"(for C alpha trace, O3' trace, default 0.4)
",i+="Ribbon Thickness: "+t.htmlCls.inputTextStr+"id='"+t.pre+"ribbonthick_"+e+"' value='"+c+"' size=4>"+t.htmlCls.space3+"(for helix and sheet ribbons, nucleotide ribbons, default 0.2)
",i+="Protein Ribbon Width: "+t.htmlCls.inputTextStr+"id='"+t.pre+"prtribbonwidth_"+e+"' value='"+h+"' size=4>"+t.htmlCls.space3+"(for helix and sheet ribbons, default 1.3)
",i+="Nucleotide Ribbon Width: "+t.htmlCls.inputTextStr+"id='"+t.pre+"nucleotideribbonwidth_"+e+"' value='"+p+"' size=4>"+t.htmlCls.space3+"(for nucleotide ribbons, default 0.8)
",i+="Ball Scale: "+t.htmlCls.inputTextStr+"id='"+t.pre+"ballscale_"+e+"' value='"+d+"' size=4>"+t.htmlCls.space3+"(for styles 'Ball and Stick' and 'Dot', default 0.3)
","style"==e&&(i+="
4. Show Glycan Cartoon: "+t.htmlCls.inputTextStr+"id='"+t.pre+"glycan' value='"+b+"' size=4>"+t.htmlCls.space3+"(0: hide, 1: show, default 0)
",i+="
5. Show Membrane: "+t.htmlCls.inputTextStr+"id='"+t.pre+"membrane' value='"+C+"' size=4>"+t.htmlCls.space3+"(0: hide, 1: show, default 1)
",i+="
6. Enlarge Command Window: "+t.htmlCls.inputTextStr+"id='"+t.pre+"cmdwindow' value='"+y+"' size=4>"+t.htmlCls.space3+"(0: Regular, 1: Large, default 0)
"),i+=t.htmlCls.spanNowrapStr+""+t.htmlCls.buttonStr+"apply_thickness_"+e+"'>Apply ",i+=t.htmlCls.spanNowrapStr+""+t.htmlCls.buttonStr+"reset_thickness_"+e+"'>Reset",i}getCookie(e){let t=e+"=",s=decodeURIComponent(document.cookie).split(";");for(let e=0;e
",n+=s.htmlCls.divStr+"seqguide"+e+"' style='display:none; white-space:normal;' class='icn3d-box'>"),n+=this.getSelectionHints();return n+="Residue labeling: standard residue with coordinates: UPPER case letter; nonstandard residue with coordinates: the first UPPER case letter plus a period except that water residue uses the letter 'O'; residue missing coordinates: lower case letter."+(s.utilsCls.isMac()&&!s.utilsCls.isMobile()?"
Turn on scroll bar: System preferences -> General -> show scroll bars -> check Always":"")+"
",n}setAlignSequenceGuide(e,t){let s=this.icn3dui,i=s.icn3d,n="";let l=i&&i.defNames2Atoms?Object.keys(i.defNames2Atoms).length:1;n+='
",n+=s.htmlCls.divStr+"alignseqguide' style='display:none; white-space:normal;' class='icn3d-box'>",n+=this.getSelectionHints();return n+="Residue labeling: aligned residue with coordinates: UPPER case letter; non-aligned residue with coordinates: lower case letter which can be highlighted; residue missing coordinates: lower case letter which can NOT be highlighted."+(s.utilsCls.isMac()&&!s.utilsCls.isMobile()?"
Turn on scroll bar: System preferences -> General -> show scroll bars -> check Always":"")+"
",n}getSelectionHints(){let e=this.icn3dui;e.icn3d;let t="";if(e.utilsCls.isMobile())t+='Select Aligned Sequences: touch to select, touch again to deselect, multiple selection is allowed without Ctrl key, click "Save Selection" to save the current selection.
';else{t+='Select on 1D sequences: drag to select, drag again to deselect, multiple selection is allowed without Ctrl key, click "Save Selection" to save the current selection.
',t+="Select on 2D interaction diagram: click on the nodes or lines. The nodes are chains and can be united with the Ctrl key. The lines are interactions and can NOT be united. Each click on the lines selects half of the lines, i.e., select the interacting residues in one of the two chains.
",t+="Select on 3D structures: "+(e.utilsCls.isMobile()?"use finger to pick":'hold "Alt" and use mouse to pick')+', click the second time to deselect, hold "Ctrl" to union selection, hold "Shift" to select a range, press the up/down arrow to switch among atom/residue/strand/chain/structure, click "Save Selection" to save the current selection.
',t+='Save the current selection(either on 3D structure, 2D interactions, or 1D sequence): open the menu "Select -> Save Selection", specify the name and description for the selection, and click "Save".
'}return t}addGsizeSalt(e){let t=this.icn3dui;t.icn3d;let s="";s+="Grid Size:
",s}getFootHtml(e,t){let s=this.icn3dui;s.icn3d;let i="
":(i+="Note: Only the selected residues are used for DelPhi potential calculation by solving linear Poisson-Boltzmann equation.",i+='
',i+=s.htmlCls.divStr+t+"' style='display:none;'>",i+="
The hydrogens and partial charges of proteins and nucleotides are added using DelPhiPKa with the Amber charge and size files. The hydrogens of ligands are added using Open Babel. The partial charges of ligands are calculated using Antechamber with the Gasteiger charge method. All partial charges are calculated at pH 7.
",i+='Lipids are treated as ligands. Please use "HETATM" instead of "ATOM " for each lipid atom in your PDB file. Each phosphate in lipids is assigned with a charge of -1. You can download PQR and modify it, or prepare your PQR file using other tools. Then load the PQR file at the menu "Analysis > Load PQR/Potential".
',i+="
',i+=s.htmlCls.divStr+t+"' style='display:none;'>",i+='The PDB file can be loaded in the URL with "pdbid=" or at "File > Open File". The PQR file can be prepared at the menu "Analysis > Download PQR" with your modification or using other tools. The DelPhi potential file can be calculated at DelPhi Web Server and be exported as a Cube file. ',"url"==e&&(i+="The PQR or potential file can be accessed in a URL if it is located in the same host as iCn3D."),i+="
",i+=""),i+="",i}getPotentialHtml(e,t){let s=this.icn3dui;s.icn3d;let i,n,l,r,o,a="";r="Equipotential Map",o="Surface with Potential","delphi"==e?n="delphi":"local"==e?(i="pqr",n="phi",l="cube"):"url"==e&&(i="pqrurl",n="phiurl",l="cubeurl"),a+=s.htmlCls.divStr+"dl_"+n+"' class='"+t+"'>",a+=s.htmlCls.setDialogCls.addNotebookTitle("dl_"+n,"DelPhi Potential"),a+=s.htmlCls.divStr+"dl_"+n+"_tabs' style='border:0px;'>",a+="",a+="
",a+=s.htmlCls.divStr+n+"tab1'>","delphi"==e&&(a+=this.addGsizeSalt(n+"1")+"
"),a+="Potential contour at:
","delphi"==e?(a+=s.htmlCls.buttonStr+"reload_"+n+"file' style='margin-top: 6px;'>Equipotential Map",a+=s.htmlCls.buttonStr+n+"mapNo' style='margin-left:30px;'>Remove Map
"):"local"==e?(a+=s.htmlCls.divStr+n+"tab1_tabs' style='border:0px;'>",a+="",d=""+s.htmlCls.buttonStr+n+"mapNo'>Remove Map",a+=s.htmlCls.divStr+n+"tab1_"+i+"'>",a+=this.addGsizeSalt(i)+"
",a+="PQR File: "+s.htmlCls.inputFileStr+"id='"+s.pre+i+"file'>
"+s.htmlCls.buttonStr+"reload_"+i+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=s.htmlCls.divStr+n+"tab1_"+n+"'>",a+="Phi File: "+s.htmlCls.inputFileStr+"id='"+s.pre+n+"file'>
"+s.htmlCls.buttonStr+"reload_"+n+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=s.htmlCls.divStr+n+"tab1_"+l+"'>",a+="Cube File: "+s.htmlCls.inputFileStr+"id='"+s.pre+l+"file'>
"+s.htmlCls.buttonStr+"reload_"+l+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=""):"url"==e&&(a+=s.htmlCls.divStr+n+"tab1_tabs' style='border:0px;'>",a+="",d=""+s.htmlCls.buttonStr+n+"mapNo'>Remove Map",a+=s.htmlCls.divStr+n+"tab1_"+i+"2'>",a+=this.addGsizeSalt(i)+"
",a+="PQR URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+i+"file'>
"+s.htmlCls.buttonStr+"reload_"+i+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=s.htmlCls.divStr+n+"tab1_"+n+"2'>",a+="Phi URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+n+"file'>
"+s.htmlCls.buttonStr+"reload_"+n+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=s.htmlCls.divStr+n+"tab1_"+l+"2'>",a+="Cube URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+l+"file'>
"+s.htmlCls.buttonStr+"reload_"+l+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=""),a+="
"+this.getFootHtml(e,n+"tab1_foot"),a+="",a+=s.htmlCls.divStr+n+"tab2'>","delphi"==e&&(a+=this.addGsizeSalt(n+"2")+"
"),a+="Surface with max potential at:
",a+="Surface:
",a+="
","delphi"==e?(a+=s.htmlCls.buttonStr+"reload_"+n+"file2' style='margin-top: 6px;'>Surface with Potential",a+=s.htmlCls.buttonStr+n+"mapNo2' style='margin-left:30px;'>Remove Surface
"):"local"==e?(a+=s.htmlCls.divStr+n+"tab2_tabs' style='border:0px;'>",a+="",d=""+s.htmlCls.buttonStr+n+"mapNo2'>Remove Surface",a+=s.htmlCls.divStr+n+"tab2_"+i+"'>",a+=this.addGsizeSalt(i+"2")+"
",a+="PQR File: "+s.htmlCls.inputFileStr+"id='"+s.pre+i+"file2'>
"+s.htmlCls.buttonStr+"reload_"+i+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=s.htmlCls.divStr+n+"tab2_"+n+"'>",a+="Phi File: "+s.htmlCls.inputFileStr+"id='"+s.pre+n+"file2'>
"+s.htmlCls.buttonStr+"reload_"+n+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=s.htmlCls.divStr+n+"tab2_"+l+"'>",a+="Cube File: "+s.htmlCls.inputFileStr+"id='"+s.pre+l+"file2'>
"+s.htmlCls.buttonStr+"reload_"+l+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=""):"url"==e&&(a+=s.htmlCls.divStr+n+"tab2_tabs' style='border:0px;'>",a+="",d=""+s.htmlCls.buttonStr+n+"mapNo2'>Remove Surface",a+=s.htmlCls.divStr+n+"tab2_"+i+"2'>",a+=this.addGsizeSalt(i+"2")+"
",a+="PQR URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+i+"file2'>
"+s.htmlCls.buttonStr+"reload_"+i+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=s.htmlCls.divStr+n+"tab2_"+n+"2'>",a+="Phi URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+n+"file2'>
"+s.htmlCls.buttonStr+"reload_"+n+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=s.htmlCls.divStr+n+"tab2_"+l+"2'>",a+="Cube URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+l+"file2'>
"+s.htmlCls.buttonStr+"reload_"+l+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=""),a+="
"+this.getFootHtml(e,n+"tab2_foot"),a+="",a+="",a+="",a}async exportPqr(e){let t=this.icn3dui,s=t.icn3d,i={},n={},l=t.hashUtilsCls.intHash(s.dAtoms,s.hAtoms);for(let e in l)s.atoms[e],s.ions.hasOwnProperty(e)?i[e]=1:n[e]=1;let r=e?"pdb":"pqr";if(t.cfg.cid){let l="",o=!e;l+=s.saveFileCls.getAtomPDB(n,o)+s.saveFileCls.getAtomPDB(i,o);let a=Object.keys(t.utilsCls.getHlStructures()).join(",");s.saveFileCls.saveFile(a+"_icn3d."+r,"text",[l])}else{if(t.utilsCls.isCalphaPhosOnly(t.hashUtilsCls.hash2Atoms(n,s.atoms)))return void alert("The potential will not be shown because the side chains are missing in the structure...");let l="",o=!0;l+=s.saveFileCls.getAtomPDB(n,void 0,void 0,void 0,void 0,void 0,o),l+=s.saveFileCls.getAtomPDB(i,!0,void 0,!0);let a=t.htmlCls.baseUrl+"delphi/delphi.cgi",d={pdb2pqr:l,pdbid:t.cfg.cid?t.cfg.cid:Object.keys(s.structures).toString()},c=await t.getAjaxPostPromise(a,d,!0,void 0,void 0,!0,"text");if(e){let e=c.split("\n"),s="";for(let i=0,n=e.length;i",t).replace("#include {const t=new Map;for(const[e,s]of n.associations)(e instanceof Material||e instanceof Texture)&&t.set(e,s);return e.traverse((e=>{const s=n.associations.get(e);null!=s&&t.set(e,s)})),t})(l),l}))}}function me(e,t,s,i){const n=s.nodes[e];return i.getDependency("node",e).then((function(e){if(void 0===n.skin)return e;let t;return i.getDependency("skin",n.skin).then((function(e){t=e;const s=[];for(let e=0,n=t.joints.length;e1)if(void 0!==d){let i,n,l=[];for(let r=0,o=p.length;rStructure ":"",a=Object.keys(i).length>1?"Chain ":"";n+=""+o+a+" ";for(let e in l.resid2area){let d=e.lastIndexOf("_"),c=e.substr(d+1),h=r.utilsCls.getIdArray(e.substr(0,d));o=Object.keys(s).length>1?"Residue Number SASA (Å2) Percent Out In/Out "+h[0]+" ":"",a=Object.keys(i).length>1?""+h[1]+" ":"";let p="",m="";l.resid2area[e]=(l.resid2area[e]/t).toFixed(2),r.parasCls.residueArea.hasOwnProperty(c)&&(m=parseInt(l.resid2area[e]/r.parasCls.residueArea[c]*100),m>100&&(m=100),m>=50&&(p="out"),m<20&&(p="in")),n+=''+o+a+" "}return n+=""+c+' '+h[2]+' '+l.resid2area[e]+' '+m+"% "+p+" 0?-parseInt(C.z):parseInt(C.z),y.onBeforeRender=function(e,t,s,i,n,o){let a,d=new THREE.Vector3(0,0,0),c=i.getAttribute("position").array;for(let e=0,t=c.length;e0&&t.applySymdCls.applySymd(),void 0!==t.prevOtherMesh)for(let e=0,s=t.prevOtherMesh.length;e0&&(e=s.hashUtilsCls.hash2Atoms(t.chemicals,t.atoms));let i=4;if(void 0!==e){let n=t.contactCls.getAtomsWithinAtom(t.atoms,e,i),l=3.5;t.opts.hbonds="yes",Object.keys(n).length>0&&t.hBondCls.calculateChemicalHbonds(e,n,parseFloat(l)),t.bSetFog||t.transformCls.zoominSelection(s.hashUtilsCls.unionHash(e,n))}}else"hide"===e.chemicalbinding&&(t.hBondCls.hideHbonds(),t.showInterCls.hideExtraBonds(),t.bSetFog||t.transformCls.zoominSelection(t.atoms))}updateStabilizer(){let e=this.icn3d;if(e.icn3dui,e.stabilizerpnts=[],void 0!==e.pairArray)for(let t=0,s=e.pairArray.length;t=0;i--){let r=t.ssbondpnts[e][2*i],o=t.ssbondpnts[e][2*i+1],a={};a.color=n,a.dashed=!1;let d=[],c=[],h=[],p=[],m=!1,u=!1;for(let e in t.residues[r])"SG"===t.atoms[e].name&&(h.push(t.atoms[e].coord),d.push(t.atoms[e].serial),m=!0);if(!m)for(let e in t.residues[r])if("CA"===t.atoms[e].name){h.push(t.atoms[e].coord),d.push(t.atoms[e].serial),m=!0,u=!0;break}m=!1;for(let e in t.residues[o])"SG"===t.atoms[e].name&&(p.push(t.atoms[e].coord),c.push(t.atoms[e].serial),m=!0);if(!m)for(let e in t.residues[o])if("CA"===t.atoms[e].name){p.push(t.atoms[e].coord),c.push(t.atoms[e].serial),m=!0,u=!0;break}let g=u?7:3,f=!1;for(let e=0,t=h.length;e0&&(e.mdl.remove(e.prevMaps[e.prevMaps.length-1]),e.prevMaps.slice(e.prevMaps.length-1,1))}removeLastEmmap(){let e=this.icn3d;e.icn3dui,e.prevEmmaps.length>0&&(e.mdl.remove(e.prevEmmaps[e.prevEmmaps.length-1]),e.prevEmmaps.slice(e.prevEmmaps.length-1,1))}removeLastPhimap(){let e=this.icn3d;e.icn3dui,e.prevPhimaps.length>0&&(e.mdl.remove(e.prevPhimaps[e.prevPhimaps.length-1]),e.prevPhimaps.slice(e.prevPhimaps.length-1,1))}}class ot{constructor(e){this.icn3d=e}addResidueLabels(e,t,s,i,n){let l=this.icn3d,r=l.icn3dui;if(r.bNode)return;let o=r.hashUtilsCls.intHash(l.hAtoms,e);t?void 0===l.labels.schematic&&(l.labels.schematic=[]):void 0===l.labels.residue&&(l.labels.residue=[]);let a="";for(let e in o){let s=l.atoms[e],o={},d=s.structure+"_"+s.chain+"_"+s.resi;if(!s.het&&("CA"===s.name||"O3'"===s.name||"O3*"===s.name)||l.water.hasOwnProperty(s.serial)||l.ions.hasOwnProperty(s.serial)||l.chemicals.hasOwnProperty(s.serial)&&d!==a){if(o.position=s.coord,o.bSchematic=0,t&&(o.bSchematic=1),o.text=r.utilsCls.residueName2Abbr(s.resn),i)o.text+=s.resi;else if(n){let e=s.structure+"_"+s.chain+"_"+s.resi,t="";l.resid2refnum[e]&&(t=" "==l.resid2refnum[e].substr(0,1)?"":l.resid2refnum[e]),o.text=t}o.size=18,o.factor=.3;let e=s.color.getHexString().toUpperCase();o.color=i?"black"!=l.opts.background?l.colorWhitebkgd:l.colorBlackbkgd:n?"#00FFFF":"CCCCCC"===e||"C8C8C8"===e?"#888888":"#"+e,o.background="#FFFFFF",t?l.labels.schematic.push(o):l.labels.residue.push(o)}a=d}l.hlObjectsCls.removeHlObjects()}addNonCarbonAtomLabels(e){let t=this.icn3d,s=t.icn3dui;if(s.bNode)return;let i=s.hashUtilsCls.intHash(t.hAtoms,e);void 0===t.labels.schematic&&(t.labels.schematic=[]);for(let e in i){let s=t.atoms[e];if(!t.residues.hasOwnProperty(s.structure+"_"+s.chain+"_"+s.resi))continue;if("C"===s.elem)continue;let i={};i.position=s.coord,i.bSchematic=1,i.text=s.elem,i.size=18,i.color="black"!=t.opts.background?t.colorWhitebkgd:s.color.getHexString(),i.background="#FFFFFF",t.labels.schematic.push(i)}t.hlObjectsCls.removeHlObjects()}addAtomLabels(e,t){let s=this.icn3d,i=s.icn3dui;if(i.bNode)return;let n=i.hashUtilsCls.intHash(s.hAtoms,e);n=i.hashUtilsCls.intHash(s.dAtoms,n),void 0===s.labels.residue&&(s.labels.residue=[]);for(let e in n){let i=s.atoms[e],n={};n.position=i.coord,n.bSchematic=0,n.text=t?i.elem:i.name.padEnd(2," "),n.size=18,t&&(n.bSchematic=!0);let l=i.color.getHexString().toUpperCase();n.color="black"!=s.opts.background?s.colorWhitebkgd:s.colorBlackbkgd,t&&(n.color="CCCCCC"===l||"C8C8C8"===l?"#888888":"#"+l),n.background="#FFFFFF",s.labels.residue.push(n)}s.hlObjectsCls.removeHlObjects()}}class at{constructor(e){this.icn3d=e}onBeforeRender(e,t,s,i,n,l){let r=n.uniforms,o=[];if(r.objectId&&(r.objectId.value=SupportsReadPixelsFloat?this.id:this.id/255,o.push("objectId")),(r.modelViewMatrixInverse||r.modelViewMatrixInverseTranspose||r.modelViewProjectionMatrix||r.modelViewProjectionMatrixInverse)&&this.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,this.matrixWorld),r.modelViewMatrixInverse&&(r.modelViewMatrixInverse.value.copy(this.modelViewMatrix).invert(),o.push("modelViewMatrixInverse")),r.modelViewMatrixInverseTranspose&&(r.modelViewMatrixInverse?r.modelViewMatrixInverseTranspose.value.copy(r.modelViewMatrixInverse.value).transpose():r.modelViewMatrixInverseTranspose.value.copy(this.modelViewMatrix).invert().transpose(),o.push("modelViewMatrixInverseTranspose")),r.modelViewProjectionMatrix&&(s.updateProjectionMatrix(),r.modelViewProjectionMatrix.value.multiplyMatrices(s.projectionMatrix,this.modelViewMatrix),o.push("modelViewProjectionMatrix")),r.modelViewProjectionMatrixInverse){let e=new THREE.Matrix4;r.modelViewProjectionMatrix?(e.copy(r.modelViewProjectionMatrix.value),r.modelViewProjectionMatrixInverse.value.copy(e).invert()):(s.updateProjectionMatrix(),e.multiplyMatrices(s.projectionMatrix,this.modelViewMatrix),r.modelViewProjectionMatrixInverse.value.copy(e).invert()),o.push("modelViewProjectionMatrixInverse")}if(r.projectionMatrix&&(s.updateProjectionMatrix(),r.projectionMatrix.value.copy(s.projectionMatrix),o.push("projectionMatrix")),r.projectionMatrixInverse&&(s.updateProjectionMatrix(),r.projectionMatrixInverse.value.copy(s.projectionMatrix).invert(),o.push("projectionMatrixInverse")),o.length){let t=e.properties.get(n);if(t.program){let s=e.getContext(),i=t.program;s.useProgram(i.program);let n=i.getUniforms();o.forEach((function(e){n.setValue(s,e,r[e].value)}))}}}setParametersForShader(e){let t,s=this.icn3d,i=s.icn3dui.parasCls.backgroundColors[s.opts.background.toLowerCase()],n=2.5*s.maxD,l=4*s.maxD,r=void 0!==s.biomtMatrices&&s.biomtMatrices.length*s.cnt>s.maxatomcnt;"yes"===s.opts.slab?r?t=.1:void 0!==s.camMaxDFactorFog?(t=s.maxD*s.camMaxDFactorFog-10,n=2.5*s.maxD-t<0?0:2.5*s.maxD-t,l=4*s.maxD-t):t=s.maxD*s.camMaxDFactor:t=.1;let o=void 0!==e?e:1,a=s.shininess/100*.5;s.uniforms=THREE.UniformsUtils.merge([THREE.UniformsLib.common,{modelViewMatrix:{value:new THREE.Matrix4},modelViewMatrixInverse:{value:new THREE.Matrix4},modelViewMatrixInverseTranspose:{value:new THREE.Matrix4},modelViewProjectionMatrix:{value:new THREE.Matrix4},modelViewProjectionMatrixInverse:{value:new THREE.Matrix4},projectionMatrix:{value:new THREE.Matrix4},projectionMatrixInverse:{value:new THREE.Matrix4},diffuse:{type:"v3",value:[1,1,1]},emissive:{type:"v3",value:[.06,.06,.06]},roughness:{type:"f",value:.5},metalness:{type:"f",value:a},opacity:{type:"f",value:o},nearClip:{type:"f",value:t},ortho:{type:"f",value:0},shrink:{type:"f",value:.13},fogColor:{type:"v3",value:[i.r,i.g,i.b]},fogNear:{type:"f",value:n},fogFar:{type:"f",value:l},fogDensity:{type:"f",value:2}},THREE.UniformsLib.ambient,THREE.UniformsLib.lights]),s.defines={USE_COLOR:1,NEAR_CLIP:1,CAP:1},"yes"!==s.opts.fog||r||(s.defines.USE_FOG=1,"orthographic"===s.opts.camera&&(s.defines.FOG_EXP2=1)),s.bExtFragDepth&&(s.defines.USE_LOGDEPTHBUF_EXT=1)}drawImpostorShader(){this.icn3d.icn3dui.bNode||(this.setParametersForShader(),this.createImpostorShaderSphere("SphereImpostor"),this.createImpostorShaderCylinder("CylinderImpostor"))}getShader(e){this.icn3d.icn3dui;let t=$NGL_shaderTextHash[e];return t=t.replace(/#include\s+(\S+)/gim,(function(e,t){let s;return THREE.ShaderChunk.hasOwnProperty(t)&&(s=THREE.ShaderChunk[t]),s||""})),t}createImpostorShaderBase(e,t,s,i,n,l,r,o,a){let d=this.icn3d;d.icn3dui;let c=new THREE.ShaderMaterial({defines:d.defines,uniforms:d.uniforms,vertexShader:this.getShader(e+".vert"),fragmentShader:this.getShader(e+".frag"),depthTest:!0,depthWrite:!0,lights:!0});c.extensions.fragDepth=!0,"CylinderImpostor"==e?d.CylinderImpostorMaterial=c:"SphereImpostor"==e&&(d.SphereImpostorMaterial=c);let h,p,m=l*r,u=l*o,g=new(m>65535?Uint32Array:Uint16Array)(u);for(let e=0;eo?r:o,d=Math.sqrt(a),c=(d+s)*(d+s),h={};for(let r in e){let e=n.atoms[r];!i&&t.hasOwnProperty(e.serial)||(this.bOpm&&"DUM"===e.resn||e.coord.x
";if("atom"==e){let e=["proteins","nucleotides","chemicals","ions","water"];for(let i=0,l=e.length;i
",n+="Light green (P, T, S, A, Q, N, G): Polar
",n+="Grey: Charged, not hydrophobic
"):(n+="Green (W, F, L, I, Y, M, V, C): Hydrophobic
",n+="Yellow (P, T, S, A, Q, N, G): Polar
",n+="Red: Negatively Charged
",n+="Blue: Positively Charged
");let a=0;for(let e of r)s.parasCls.residueAbbrev[e[0]]&&(n+="
"),++a);n+="
",n+=s.htmlCls.clickMenuCls.setLegendHtml()):"confidence"==e?n+=s.htmlCls.clickMenuCls.setLegendHtml(!0):"exon"==e?(t.startColor="red",t.midColor="white",t.endColor="blue",t.startValue="Start",t.midValue="Middle",t.endValue="End",n+=s.htmlCls.clickMenuCls.setLegendHtml()):n="";n?($("#"+s.pre+"dl_legend_html").html(n),s.htmlCls.dialogCls.openDlg("dl_legend","Color Legend")):$("#"+s.pre+"dl_legend").hasClass("ui-dialog-content")&&$("#"+s.pre+"dl_legend").dialog("isOpen")&&$("#"+s.pre+"dl_legend").dialog("close")}getColorLegendForElem(e,t){let s=this.icn3d,i=s.icn3dui,n="",l={};for(let e in t){let t=s.atoms[e],i=void 0===t||void 0===t.color||"FFFFFF"===t.color.getHexString().toUpperCase()?"DDDDDD":t.color.getHexString();void 0===l[t.elem]&&(l[t.elem]={}),l[t.elem][i]=1}if(Object.keys(l).length>0){n+=""+e+"
";let t=Object.keys(l).sort();for(let e=0,s=t.length;e";for(let e in l[s])n+=" ";n+=i.parasCls.atomnames[s.toUpperCase()]+"
"}n+="
"}return n}getRes2color(e,t){let s=this.icn3d,i=s.icn3dui,n={},l=s.firstAtomObjCls.getResiduesFromAtoms(e);for(let e in l){let l=s.residues[e],r=s.firstAtomObjCls.getFirstAtomObj(l),o=t?r.resn:i.parasCls.residueAbbrev[r.resn],a=void 0===r||void 0===r.color||"FFFFFF"===r.color.getHexString().toUpperCase()?"DDDDDD":r.color.getHexString();null!=o&&(void 0===n[o]&&(n[o]={}),n[o][a]=1)}return n}getColorLegendForResidue(e){this.icn3d.icn3dui;let t="",s=this.getRes2color(e);if(Object.keys(s).length>0){t+="
"),-1!=o.indexOf("(")?(t+=r,++n):i+=r}i&&(t+="
"+i),t+=""}return t}getColorLegendForCharge(e){let t=this.icn3d;t.icn3dui;let s="",i=t.firstAtomObjCls.getResiduesFromAtoms(e),n={};for(let e in i){let s=t.residues[e],i=t.firstAtomObjCls.getFirstAtomObj(s);"ARG"==i.resn||"LYS"==i.resn?n.Positive=1:"HIS"==i.resn?n["Partial-Positive"]=1:"ASP"==i.resn||"GLU"==i.resn||t.nucleotides[i.serial]?n.Negative=1:n.Neutral=1}const l={Positive:"0000ff","Partial-Positive":"8080ff",Negative:"ff0000",Neutral:"888888"};let r=["Positive","Partial-Positive","Negative","Neutral"];s+="
")}return s+="
(Charges are at pH 7)",s+="
"}return t+="
Linker":"","C'' Strand":"FF0000","
Protodomain 2":"","D Strand":"0000FF","E Strand":"006400","F Strand":"FFD700","G Strand":"FF8C00","":"",Loop:"CCCCCC"};t+="
that by its duplication, symmetry operations
can generate a structural domain.
";for(let e in s){let i=s[e];t+="",i&&(t+=" "),t+=e,t+="
"}return t+="'+s+"
",h+=d+u+g,p+=d+u+g;let f="site"+e.toString(),b=0,y=0,v=1;i.seqStartLen&&i.seqStartLen[c]&&(p+=i.showSeqCls.insertMulGapOverview(c,i.seqStartLen[c])),i.seqStartLen&&i.seqStartLen[c]&&(h+=i.showSeqCls.insertMulGap(i.seqStartLen[c],"-"));for(let t=0,s=i.giSeq[c].length;t1&&(l=s[0]+"..");let r=i.ParserUtilsCls.getResi(c,t);if(h+=''+s+"",n.bNode){let t={};t[c+"_"+r]="site: "+C[e].title,i.resid2site[c].push(t)}p+=i.showSeqCls.insertGapOverview(c,t);let o=n.cfg.blast_rep_id==c?Math.round(i.seqAnnWidth*t/(i.maxAnnoLength+i.nTotalGap)-b-y):Math.round(i.seqAnnWidth*t/i.maxAnnoLength-b-y);o>=0&&(p+='",g+="
",h+=g,p+=g}h+="",p+="",m+="",$("#"+i.pre+"dt_site_"+c).html(h),$("#"+i.pre+"ov_site_"+c).html(p),$("#"+i.pre+"tt_site_"+c).html(m)}}for(let e in i.protein_chainid)r.hasOwnProperty(e)||($("#"+i.pre+"dt_cdd_"+e).html(""),$("#"+i.pre+"ov_cdd_"+e).html(""),$("#"+i.pre+"tt_cdd_"+e).html(""),$("#"+i.pre+"dt_site_"+e).html(""),$("#"+i.pre+"ov_site_"+e).html(""),$("#"+i.pre+"tt_site_"+e).html(""));i.showAnnoCls.enableHlSeq(),i.bAjaxCddSite=!0}getNoCdd(e){let t=this.icn3d;t.icn3dui,console.log("No CDD data were found for the protein "+e+"...");for(let e in t.protein_chainid)$("#"+t.pre+"dt_cdd_"+e).html(""),$("#"+t.pre+"ov_cdd_"+e).html(""),$("#"+t.pre+"tt_cdd_"+e).html(""),$("#"+t.pre+"dt_site_"+e).html(""),$("#"+t.pre+"ov_site_"+e).html(""),$("#"+t.pre+"tt_site_"+e).html("");t.showAnnoCls.enableHlSeq(),t.bAjaxCddSite=!0}setDomainFeature(e,t,s,i,n,l,r){let o,a,d,c=this.icn3d,h=c.icn3dui;s&&(r={},o={},a={},d={});let p=void 0!==e?e.length:0,m=s?14:19,u=s?100:120;for(let g=0;g
";let T='';i+=R+I+T,s&&(n+='
",i+=T,n+=T,s&&(n+=' ')}}return{html:i,html2:n,html3:l,acc2domain:r,pssmid2name:o,pssmid2fromArray:a,pssmid2toArray:d}}showAnnoType(e,t,s,i,n,l){let r=this.icn3d,o=r.icn3dui,a='
";let b='';a+=g+f+b,d+=g+f+b;let C=s,y=0,v=0;r.seqStartLen&&r.seqStartLen[e]&&(d+=r.showSeqCls.insertMulGapOverview(e,r.seqStartLen[e])),r.seqStartLen&&r.seqStartLen[e]&&(a+=r.showSeqCls.insertMulGap(r.seqStartLen[e],"-"));for(let t=0,i=r.giSeq[e].length;t1&&(c=n[0]+"..");let h=i,p=e+"_"+i,m=n+i;if("ssbond"==s){m="Residue "+p+" has disulfide bond with";let t="";if(void 0!==l[p])for(let e=0,s=l[p].length;e'+c+"",d+=r.showSeqCls.insertGapOverview(e,t);let u=o.cfg.blast_rep_id==e?Math.round(r.seqAnnWidth*t/(r.maxAnnoLength+r.nTotalGap)-y-v):Math.round(r.seqAnnWidth*t/r.maxAnnoLength-y-v);u>=0&&(d+='
",a+=b,d+=b,a+="",d+="",c+="",$("#"+r.pre+"dt_"+s+"_"+e).html(a),$("#"+r.pre+"ov_"+s+"_"+e).html(d),$("#"+r.pre+"tt_"+s+"_"+e).html(c)}setToolTip(){let e=this.icn3d;e.icn3dui,$("[id^="+e.pre+"snp]").add("[id^="+e.pre+"clinvar]").add("[id^="+e.pre+"ssbond]").add("[id^="+e.pre+"crosslink]").tooltip({content:function(){return $(this).prop("title")},show:null,close:function(e,t){t.tooltip.hover((function(){$(this).stop(!0).fadeTo(400,1)}),(function(){$(this).fadeOut("400",(function(){$(this).remove()}))}))}})}}class _t{constructor(e){this.icn3d=e}showInteraction(e,t){this.icn3d.icn3dui,this.showInteraction_base(e,t)}showInteraction_base(e,t){let s=this.icn3d,i=s.icn3dui;i.bNode&&(s.resid2contact||(s.resid2contact={}),s.resid2contact[e]||(s.resid2contact[e]=[])),void 0===s.chainname2residues&&(s.chainname2residues={});let n=Object.keys(s.chains),l=e,r=Math.round(l.indexOf("_"));if(s.firstAtomObjCls.getFirstCalphaAtomObj(s.chains[l]),void 0===s.chainname2residues[l]){s.chainname2residues[l]={};let t=n.length;if(t>100&&void 0===i.cfg.mmdbid&&void 0===i.cfg.gi&&void 0===i.cfg.blast_rep_id&&void 0===i.cfg.align&&void 0===i.cfg.chainalign)return $("#"+s.pre+"dt_interaction_"+e).html(""),void $("#"+s.pre+"ov_interaction_"+e).html("");for(let e=0;e
";let f='';o+=u+g+f,a+=u+g+f;let b="inter"+c.toString(),C=0,y=0,v=1;s.seqStartLen&&s.seqStartLen[e]&&(a+=s.showSeqCls.insertMulGapOverview(e,s.seqStartLen[e])),s.seqStartLen&&s.seqStartLen[e]&&(o+=s.showSeqCls.insertMulGap(s.seqStartLen[e],"-"));for(let t=0,n=s.giSeq[e].length;t
",o+=f,a+=f,++c}o+="",a+="",d+="",$("#"+s.pre+"dt_interaction_"+e).html(o),$("#"+s.pre+"ov_interaction_"+e).html(a),$("#"+s.pre+"tt_interaction_"+e).html(d),i.utilsCls.isMobile()?(s.hlSeqCls.selectSequenceMobile(),s.hlSeqCls.selectChainMobile()):s.hlSeqCls.selectSequenceNonMobile()}}class wt{constructor(e){this.icn3d=e}async showPTM(e,t,s,i,n){let l=this.icn3d,r=l.icn3dui,o=this,a=e.substr(0,e.indexOf("_")),d=e.substr(e.indexOf("_")+1);if("afmem"==s){let t={Transmembrane:[{begin:i,end:n}]};this.setAnnoPtmTransmem("transmem",t,e)}else if(a.length>5){let t,i="https://www.ebi.ac.uk/proteins/api/features/"+a;try{t=await r.getAjaxPromise(i,"json"),o.parsePTM(t,e,s)}catch{return void o.getNoPTM(e,s)}}else{let t,i=a.substr(0,4).toLowerCase(),n="https://www.ebi.ac.uk/pdbe/api/mappings/uniprot/"+i;try{t=await r.getAjaxPromise(n,"json");let a="";l.UPResi2ResiPosPerChain||(l.UPResi2ResiPosPerChain={}),l.UPResi2ResiPosPerChain[e]={};let c=t[i].UniProt,h=!1;for(let t in c){let s=c[t].mappings;for(let i=0,n=s.length;i
",r+=b+C+y,o+=b+C+y;let v=e+l.toString(),_=0,w=0,S=1;i.seqStartLen&&i.seqStartLen[s]&&(o+=i.showSeqCls.insertMulGapOverview(s,i.seqStartLen[s])),i.seqStartLen&&i.seqStartLen[s]&&(r+=i.showSeqCls.insertMulGap(i.seqStartLen[s],"-"));for(let e=0,t=i.giSeq[s].length;e
",r+=y,o+=y,++l}r+="",o+="",a+="",$("#"+i.pre+"dt_"+e+"_"+s).html(r),$("#"+i.pre+"ov_"+e+"_"+s).html(o),$("#"+i.pre+"tt_"+e+"_"+s).html(a)}getNoPTM(e,t){let s=this.icn3d;s.icn3dui,console.log("No PTM data were found for the chain "+e+"...");let i="ptm"==t?"ptm":"transmem";$("#"+s.pre+"dt_"+i+"_"+e).html(""),$("#"+s.pre+"ov_"+i+"_"+e).html(""),$("#"+s.pre+"tt_"+i+"_"+e).html(""),s.showAnnoCls.enableHlSeq(),s.bAjaxPTM=!0}}class St{constructor(e){this.icn3d=e}showCrosslink(e,t){let s=this.icn3d;s.icn3dui;let i=this;void 0===s.clbondpnts?setTimeout((function(){i.showCrosslink_base(e,t)}),1e3):this.showCrosslink_base(e,t)}showCrosslink_base(e,t){let s=this.icn3d;s.icn3dui.bNode&&(s.resid2crosslink||(s.resid2crosslink={}),s.resid2crosslink[e]||(s.resid2crosslink[e]=[]));let i=t,n={},l=i.substr(0,i.indexOf("_")),r=s.clbondpnts[l];if(void 0===r)return $("#"+s.pre+"dt_crosslink_"+e).html(""),$("#"+s.pre+"ov_crosslink_"+e).html(""),void $("#"+s.pre+"tt_crosslink_"+e).html("");for(let e=0,t=r.length;e17?s.substr(0,17)+"...":s,h=i[t].intervals,p={},m={},u=[],g=[],f={},b=0;for(let e=0,t=h.length;e
";let v='';o+=C+y+v,a+=C+y+v;let _="domain3d"+t.toString();l.seqStartLen&&l.seqStartLen[e]&&(o+=l.showSeqCls.insertMulGap(l.seqStartLen[e],"-"));for(let t=0,s=l.giSeq[e].length;t1&&(n=i[0]+"..");let r=s;o+=''+i+""}else o+="-"}l.seqStartLen&&l.seqStartLen[e]&&(o+=l.showSeqCls.insertMulGap(l.seqEndLen[e],"-"));let w=l.firstAtomObjCls.getFirstCalphaAtomObj(l.chains[e]),S=void 0===w.color||"FFFFFF"===w.color.getHexString()?"DDDDDD":w.color.getHexString(),A=void 0!==w.color?S:"CCCCCC";if(l.seqStartLen&&l.seqStartLen[e]&&(a+=l.showSeqCls.insertMulGapOverview(e,l.seqStartLen[e])),r.cfg.blast_rep_id!=e)for(let i=0,n=u.length;i",v+="
",o+=v,a+=v}o+="",a+="",d+="",$("#"+l.pre+"dt_domain_"+e).html(o),$("#"+l.pre+"ov_domain_"+e).html(a),$("#"+l.pre+"tt_domain_"+e).html(d)}}class xt{constructor(e){this.icn3d=e}async showSnp(e,t){this.icn3d.icn3dui,await this.showSnpClinvar(e,t,!0)}async showClinvar(e,t){this.icn3d.icn3dui,await this.showSnpClinvar(e,t,!1)}async showSnpClinvar(e,t,s){let i=this.icn3d.icn3dui,n=this,l=i.htmlCls.baseUrl+"vastdyn/vastdyn.cgi?chainid="+t;try{let r=await i.getAjaxPromise(l,"jsonp"),o=r.snpgi,a=r.gi;if(s)await n.showSnpPart2(e,t,o);else{let s=o;[6137708,1942289,224510717,2624886,253723219,2554905,75765331,3660278,312207882,319443632,342350956,1827805,109157826,1065265,40889086,6730307,163931185,494469,163931091,60594093,55669745,18655489,17942684,6980537,166235465,6435586,4139398,4389047,364506122,78101667,262118402,20664221,2624640,158430173,494395,28948777,34810587,13399647,3660342,261278854,342350965,384482350,378792570,15988303,213424334,4558333,2098365,10835631,3318817,374074330,332639529,122919696,4389286,319443573,2781341,67464020,194709238,210061039,364506106,28949044,40889076,161172338,17943181,4557976,62738484,365813173,6137343,350610552,17942703,576308,223674070,15826518,1310997,93279697,4139395,255311799,157837067,361132363,357380836,146387678,383280379,1127268,299856826,13786789,1311054,46015217,3402130,381353319,30750059,218766885,340707375,27065817,355333104,2624634,62738384,241913553,304446010].includes(a)&&(s=a),await n.showClinvarPart2(e,t,s)}}catch(t){return void(s?n.processNoSnp(e):n.processNoClinvar(e))}}navClinVar(e){let t=this.icn3d;t.icn3dui;let s=this;t.currClin[e]=-1,$(document).on("click","#"+t.pre+e+"_prevclin",(function(t){let i=s.icn3d;t.stopImmediatePropagation();let n=void 0!==i.resi2disease_nonempty[e]?Object.keys(i.resi2disease_nonempty[e]).length:0;--i.currClin[e],i.currClin[e]<0&&(i.currClin[e]=n-1),s.showClinVarLabelOn3D(e)})),$(document).on("click","#"+t.pre+e+"_nextclin",(function(t){let i=s.icn3d;t.stopImmediatePropagation();let n=void 0!==i.resi2disease_nonempty[e]?Object.keys(i.resi2disease_nonempty[e]).length:0;++i.currClin[e],i.currClin[e]>n-1&&(i.currClin[e]=0),s.showClinVarLabelOn3D(e)}))}showClinVarLabelOn3D(e){let t,s,i=this.icn3d,n=i.icn3dui,l=Object.keys(i.resi2disease_nonempty[e]);t=e,s=t+"_"+(parseInt(l[i.currClin[e]])+i.baseResi[e]).toString();let r="",o=i.resi2disease_nonempty[e][l[i.currClin[e]]];for(let e=0,t=o.length;e(from human)",i=" (based on human sequences and mapped to this structure by sequence similarity)"),C+=m?'
";C+='';let O="",R=0,I=0;p?f.seqStartLen&&f.seqStartLen[h]&&(C+=f.showSeqCls.insertMulGapOverview(h,f.seqStartLen[h])):f.seqStartLen&&f.seqStartLen[h]&&(C+=f.showSeqCls.insertMulGap(f.seqStartLen[h],"-"));for(let t=1,a=f.giSeq[h].length;t<=a;++t)if(p){if(void 0!==r[t]){let e=f.giSeq[h][t-1],i=e;e.length>1&&(i=e[0]+"..");let n=f.ParserUtilsCls.getResi(h,t-1)+i+">";for(let e=0,i=s[t].length;e=0&&(C+='
"+f.showAnnoCls.addSnpButton(m,"snpin3d","3D with scap","SNP in 3D with scap",70,g)+" ",u+=f.showAnnoCls.addSnpButton(m,"snpinter","Interactions","SNP Interactions in 3D",70,g)+" ",u+=f.showAnnoCls.addSnpButton(m,"snppdb","PDB","Download SNP PDB",35,g)),u+="
Links: ClinVar, dbSNP(rs"+i[t][e]+")",e
"),++r)}r>d&&2==e&&(p+="..")}else{d=1;for(let e=v;e
"+f.showAnnoCls.addSnpButton(r,"snpin3d","3D with scap","SNP in 3D with scap",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snpinter","Interactions","SNP Interactions in 3D",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snppdb","PDB","Download SNP PDB",35,m)),0!=i[t][e]&&(u+="
Link: dbSNP(rs"+i[t][e]+")"),e
");else{let s=l[t][e].split("; "),a=o[t][e].split("; "),d="",c=0;for(let t=0,i=s.length;t0?d+="; ":0!==e&&1!==e||(O='disease="'+s[t]+'"'),d+=s[t]+"("+a[t]+")",++c;""!=d?(u+=": "+d,C&&!b.cfg.hidelicense&&(u+="
"+f.showAnnoCls.addSnpButton(r,"snpin3d","3D with scap","SNP in 3D with scap",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snpinter","Interactions","SNP Interactions in 3D",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snppdb","PDB","Download SNP PDB",35,m)),u+="
Links: ClinVar, dbSNP(rs"+i[t][e]+")"):(C&&!b.cfg.hidelicense&&(u+="
"+f.showAnnoCls.addSnpButton(r,"snpin3d","3D with scap","SNP in 3D with scap",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snpinter","Interactions","SNP Interactions in 3D",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snppdb","PDB","Download SNP PDB",35,m)),u+="
Link: dbSNP(rs"+i[t][e]+")"),e
")}}y>d&&2==e&&(p+="..")}u+="
",C}processSnpClinvar(e,t,s,i,n){let l=this.icn3d,r=l.icn3dui,o='")+1),h=s[4],p=i?"":s[5],S=i?"":s[6],A=i?"":s[7],x=l.ParserUtilsCls.getResi(t,d-1);v[x]=1,""!=S&&(_[x]=1),g[d]=e+1,void 0===u[d]&&(u[d]=[]),u[d].push(c),void 0===C[d]&&(C[d]=[]),C[d].push(h),void 0===y[d]&&(y[d]=[]),y[d].push(p),void 0===f[d]&&(f[d]=[]),f[d].push(S),""!=S&&(void 0===l.resi2disease_nonempty[t][d]&&(l.resi2disease_nonempty[t][d]=[]),l.resi2disease_nonempty[t][d].push(S)),void 0===b[d]&&(b[d]=[]),b[d].push(A)}let S=Object.keys(v),A=Object.keys(_);if(i){let e=!1;o+=this.getSnpLine(1,2,u,C,y,f,g,b,S,A,1,t,!1,e,void 0,i),o+=this.getSnpLine(2,2,u,C,y,f,g,b,S,A,0,t,!1,e,void 0,i),d+=this.getSnpLine(1,2,u,C,y,f,g,b,S,A,1,t,!1,e,!0,i),d+=this.getSnpLine(2,2,u,C,y,f,g,b,S,A,0,t,!1,e,!0,i),a+=this.getSnpLine(1,2,u,C,y,f,g,b,S,A,1,t,!0,e,void 0,i),o+="0&&this.elt_size[s.sse-1]>=6&&0!=s.adj_strand2&&e++}for(let e=0;e
",w+=x+k+"
";let O='';C+=A+k+O,y+=x+k+O,v+=A+k+O;let R=e.indexOf("_"),I="cst"+e.substr(R+1),T=0,E=0,P=(void 0===l||"seq"===l||"custom"===l)&&-1==s.indexOf("cannot-be-aligned")&&-1==s.indexOf("cannot be aligned"),M="identity"===l&&-1==s.indexOf("cannot-be-aligned")&&-1==s.indexOf("cannot be aligned"),D={},H=0;A="";let F={},L={},N={},q=0;if(h)for(let e=0,t=h.length;e
",O+="",C+=O,v+=A+O,y+=O,_+="",w+="",h?($("#"+p.pre+"dt_custom_"+e+"_"+f).html(y+C),$("#"+p.pre+"ov_custom_"+e+"_"+f).html(v),$("#"+p.pre+"tt_custom_"+e+"_"+f).html(w+_)):($("#"+p.pre+"dt_custom_"+e+"_"+f).html(C),$("#"+p.pre+"ov_custom_"+e+"_"+f).html(v),$("#"+p.pre+"tt_custom_"+e+"_"+f).html(_))}getExonHtml(e,t,s,i,n,l,r){let o=this.icn3d;return o.icn3dui,'20)return!1;if(void 0!==o.giSeq&&void 0!==o.giSeq[e]){let r=this.getFullText(s);return s=r.text,this.showNewTrack(e,t,s,void 0,void 0,i,n,l),!1}setTimeout((function(){a.checkGiSeq(e,t,s,i,n,l,r+1)}),100)}getFullText(e){this.icn3d.icn3dui;let t="",s=[],i=[],n=e.split(","),l=-1;for(let e=0,r=n.length;eA&&(A=e)}let x=S,k=w.length-(A+1),O=[],R=[];for(let e=0,t=p.length;e"),d=a[1].indexOf("\n");n=a[1].substr(d+1).replace(/\n/g,"");for(let e=2,t=a.length;e
Click \"Assembly\" in the menu \"View\" to switch between asymmetric unit and biological assembly("+e.asuCnt+" asymmetric unit).e.maxAnnoLengthOri&&(e.protein_chainid.hasOwnProperty(t)||s.hasOwnProperty(t))&&(e.maxAnnoLengthOri=e.chainsSeq[t].length);e.maxAnnoLength=e.maxAnnoLengthOri}return{nucleotide_chainid:s,chemical_chainid:i,chemical_set:n}}async showAnnotations(){let e=this.icn3d,t=e.icn3dui,s=this,i=this.showAnnotations_part1(),n=i.nucleotide_chainid,l=i.chemical_chainid,r=i.chemical_set;if(!e.bAnnoShown||e.bResetAnno)if(e.bAnnoShown=!0,void 0===t.cfg.blast_rep_id){if(e.bFullUi){if(void 0!==t.cfg.mmtfid){let t=Object.keys(e.structures)[0];await e.mmcifParserCls.downloadMmcifSymmetry(t,"mmtfid")}await this.showAnnoSeqData(n,l,r)}}else if(void 0===t.cfg.blast_rep_id||e.bSmithwm||e.bLocalSmithwm){if(void 0!==t.cfg.blast_rep_id&&(e.bSmithwm||e.bLocalSmithwm)){let i,o,a=[t.cfg.blast_rep_id];if(-1!=t.cfg.query_id.indexOf(">")?o=t.cfg.query_id.substr(t.cfg.query_id.indexOf("\n")+1):!/\d/.test(t.cfg.query_id)||t.cfg.query_id.length>50?o=t.cfg.query_id:a.push(t.cfg.query_id),e.blastAcxn){let s=t.cfg.afid+"_A",n="";for(let t=0,i=e.chainsSeq[s].length;t5){let n;e.uniprot2acc&&e.uniprot2acc[i]?e.uniprot2acc[i]:e.uniprot2acc={},n="https://rest.uniprot.org/uniprotkb/search?format=json&fields=xref_geneid,gene_names&query="+i;let l=await t.getAjaxPromise(n,"json"),r=l.results[0]&&l.results[0].uniProtKBCrossReferences&&l.results[0].uniProtKBCrossReferences[0]?l.results[0].uniProtKBCrossReferences[0].id:void 0,o=l.results[0]&&l.results[0].genes&&l.results[0].genes[0]&&l.results[0].genes[0].geneName?l.results[0].genes[0].geneName.value:"ID "+r;e.chainsGene[s]={geneId:r,geneSymbol:o}}}for(let s in e.protein_chainid){let i=t.utilsCls.isMobile()?"none":"button",l=e.showSeqCls.getProteinName(s),r=l,o=0==n?"Proteins:
":"",a=e.chainsGene[s]&&e.chainsGene[s].geneId&&e.chainsGene[s].geneDesc?"(Gene: "+e.chainsGene[s].geneSymbol+")":"",d=s.substr(0,s.indexOf("_")),c=d.length>5?''+s+"":s,h="
"),++n}if(t.bNode||e.annoCddSiteCls.setToolTip(),void 0!==e.chainid_seq)await this.processSeqData(e.chainid_seq);else try{let n=[],l=[];for(let e=0,t=i.length;e40&&(r=r.substr(0,40)+"...");let o="";0==i&&("protein"==s?o="Proteins:
":"nucleotide"==s?o="Nucleotides:
":"chemical"==s&&(o="Chemicals/Ions/Water:
")),$("#"+n.pre+"dl_annotations").append("
"),n.giSeq[e]=[];for(let t=0;t
":"",o=t[0].lastIndexOf("_"),a=t[0].substr(0,o),d=void 0!==l.cfg.mmdbid&&void 0!==n.chainid2sid?n.chainid2sid[a]:void 0;i=void 0!==d?""+e+" ":""+e+"",$("#"+n.pre+"dl_annotations").append("
");let c='
",c+="
",g+=u+'';let s=0,i=0,n="";a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e]," "));for(let t=0,l=o.length;t
",g+="
",g+=u+'',a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e],"-"));for(let t=0,s=o.length;t':'',g+=" ";else if("E"==a.secondaries[s]){a.firstAtomObjCls.getFirstCalphaAtomObj(a.residues[s]).ssend?"green"==a.sheetcolor?g+='':"yellow"==a.sheetcolor&&(g+=''):"green"==a.sheetcolor?g+='':"yellow"==a.sheetcolor&&(g+=''),g+=" "}else"c"==a.secondaries[s]?g+=' ':"o"==a.secondaries[s]&&(g+=' ');else g+="-"}a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqEndLen[e],"-")),g+='',g+="",g+="
",g+="
";let v='';g+=u+v,f+=u+v;let _,w=0;a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e],"-"));for(let t=0,s=o.length;t1&&(i=s[0]+".."),_=a.ParserUtilsCls.getResi(e,t),a.residues.hasOwnProperty(e+"_"+_)){let n="333333";if(d.cfg.blast_rep_id==e&&void 0!==a.fullpos2ConsTargetpos&&void 0!==a.fullpos2ConsTargetpos[t+w])n=a.fullpos2ConsTargetpos[t+w].color;else{let t=a.firstAtomObjCls.getFirstCalphaAtomObj(a.residues[e+"_"+_]),s=void 0===t.color||"FFFFFF"===t.color.getHexString().toUpperCase()||"FFF"===t.color.getHexString().toUpperCase()?"DDDDDD":t.color.getHexString();n=void 0!==t.color?s:"CCCCCC"}g+=''+i+""}else i=i.toLowerCase(),g+=''+i+""}a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqEndLen[e],"-")),d.cfg.blast_rep_id==e&&(a.opts.color=a.blastAcxn?"confidence":"conservation",a.setColorCls.setColorByOptions(a.opts,a.atoms));let S=a.firstAtomObjCls.getFirstCalphaAtomObj(a.chains[e]),A=S.color?S.color.getHexString():"CCCCCC",x=Math.round(a.seqAnnWidth*o.length/(a.maxAnnoLength+a.nTotalGap));if(x<1&&(x=1),a.seqStartLen&&a.seqStartLen[e]&&(f+=this.insertMulGapOverview(e,a.seqStartLen[e])),d.cfg.blast_rep_id!=e)f+='
",g+=u,f+=u,d.cfg.blast_rep_id==e){if(void 0!==r&&""!==r){u='
";let t='';g+=u+t,f+=u+t;let s=0,i=0,l=1;a.queryStart;for(let t=0,n=r.length;t
",g+=u,f+=u}u='
";let t='';g+=u+t,f+=u+t;let s=a.queryStart;for(let t=0,i=l.length;t-":(void 0===a.fullpos2ConsTargetpos||void 0===a.fullpos2ConsTargetpos[t]||a.residues.hasOwnProperty(e+"_"+a.fullpos2ConsTargetpos[t].pos)||(i=i.toLowerCase()),g+=''+i+"",++s)}let o=a.firstAtomObjCls.getFirstCalphaAtomObj(a.chains[e]),d=void 0===o.color||"FFFFFF"===o.color.getHexString()?"DDDDDD":o.color.getHexString(),c=void 0!==o.color?d:"CCCCCC",h=[],p=[],m="-";for(let e=0,t=l.length;e
",g+=u,f+=u}if(g+="",f+="",b+="",a.giSeq[e].length>10){let t=a.firstAtomObjCls.getFirstCalphaAtomObj(a.chains[e]);if((void 0!==d.cfg.mmdbid||void 0!==d.cfg.gi||void 0!==d.cfg.blast_rep_id||void 0!==d.cfg.align||void 0!==d.cfg.chainalign||void 0!==d.cfg.mmdbafid)&&void 0!==t.resi_ori&&t.resi_ori!=t.resi&&-1==e.indexOf("Misc")){u='
",g+=u+'',a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e],"-"));for(let t=0,s=o.length;t",e%10==0&&(g+=e+" "),g+=""}else g+=""}a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqEndLen[e],"-")),g+='',g+="",g+="
",g+="
",r+=p+'';let m=!1;for(let s=0,l=e.length;s
",r+="",A="-",x="--";for(let t=0,s=r.length;t0&&(T=1,t=i.getGraphCls.getNodeTopBottom(c[e],d,void 0,T,g[e]),h[e]=t.nodeArray1,m[e]=t.nodeArray2,d=n.hashUtilsCls.unionHash(d,t.name2node),T=2,t=i.getGraphCls.getNodeTopBottom(c[e],d,void 0,T,y[e]),f[e]=t.nodeArray1,b[e]=t.nodeArray2,d=n.hashUtilsCls.unionHash(d,t.name2node)),k[e]=l[e].length,O[e]=o[e].length,R=Math.max(R,O[e]),I.push(p[e])}let E,P,M,D,H,F=1,L=3*F,N=7*F,q=10,U=10,$=30,j=20;t?(M=(n.utilsCls.sumArray(k)+2*I.length)*(L+N)+4*U+2*$+j*I.length,P=(R+2)*(L+N)+2*q+$):(E=110+j,M=E*I.length,P=(R+2)*(L+N)+2*q,P+=20),Object.keys(i.chainsMapping).length>0&&(M*=3),t?(i.scatterplotWidth=2*P,H=i.scatterplotWidth,D=n.scatterplotid):(i.linegraphWidth=2*P,H=i.linegraphWidth,D=n.linegraphid),s=0==I.length?"No interactions found for each structure
":"2D integration graph for "+I.length+" structure(s) "+I+'. There are three sections: "Interactions", "Common interactions", and "Different interactions". Each section has '+I.length+" graphs.
",s+=""}else if(t){let e,t,l,c,h=p[0],m=o.length,u=a.length,g=1,f=3*g,b=7*g,C=30;t=(m+2)*(f+b)+2*10+C,e=(u+2)*(f+b)+2*10+C,i.scatterplotWidth=2*e,c=i.scatterplotWidth,l=n.scatterplotid,s=r.length>0?"":"No interactions found for these two sets
",s+=""}else{let e=p[0],t=o.length,l=a.length,c=1,h=3*c,m=7*c,u=110,g=10,f=t>l?t*(h+m)+2*g:l*(h+m)+2*g;i.linegraphWidth=2*f,s=r.length>0?"":"No interactions found for these two sets
",s+=""}return i.lineGraphStr+="}\n",i.scatterplotStr=i.lineGraphStr,t?$("#"+i.pre+"scatterplotDiv").html(s):$("#"+i.pre+"linegraphDiv").html(s),s}drawGraphPerType(e,t,s,i,n,l,r,o,a,d,c,h,p,m){let u=this.icn3d;u.icn3dui;let g,f,b="",C=2==t.length&&"2"==t[1].replace(t[0],"");0==e?(g="Interactions in ",f=""):1==e?(g="Common interactions in ",f="_common"):2==e&&(g="Different interactions in ",f="_diff");for(let y=0,v=t.length;y
",E=p.resid2specCls.atoms2residues(Object.keys(C)),P=p.resid2specCls.atoms2residues(Object.keys(y)),M="select "+p.resid2specCls.residueids2spec(E),D="select "+p.resid2specCls.residueids2spec(P);T+="Set 1: "+e+'
',T+="Set 2: "+t+'
',T+='
';let H=p.resid2specCls.atoms2residues(Object.keys(R)),F=p.resid2specCls.atoms2residues(Object.keys(I)),L="select "+p.resid2specCls.residueids2spec(H),N="select "+p.resid2specCls.residueids2spec(F);T+='interface_1
',T+='interface_2
';let q=T;if(("graph"==i||"linegraph"==i||"scatterplot"==i||b)&&(T=""),T+=O,"save1"==i||"save2"==i){T=q;let e="";"save1"==i?e="Set 1":"save2"==i&&(e="Set 2"),T+='
Interactions Sorted on '+e+': 0&&l!=a&&(i.push({res1:a,res2:w,cntHbond:f,cntIonic:b,cntContact:C,cntHalegen:y,cntPication:v,cntPistacking:_}),o+=this.getInteractionPerResidue(d,c,h,p,m,u,g,f,b,C,y,v,_),c="",h="",p="",m="",u="",g="",f=0,b=0,C=0,y=0,v=0,_=0,w=""),x=t.resids2inter[S].hbond,k=this.getInteractionPairDetails(x,e,"hbond"),c+=k.html,f+=k.cnt,k.cnt>0&&(w+=r+":hbond_"+k.cnt+" "),x=t.resids2inter[S].ionic,k=this.getInteractionPairDetails(x,e,"ionic"),h+=k.html,b+=k.cnt,k.cnt>0&&(w+=r+":ionic_"+k.cnt+" "),x=t.resids2inter[S].contact,k=this.getContactPairDetails(x,e,"contact"),p+=k.html,C+=k.cnt,k.cnt>0&&(w+=r+":contact_"+k.cnt+" "),x=t.resids2inter[S].halogen,k=this.getInteractionPairDetails(x,e,"halogen"),m+=k.html,y+=k.cnt,k.cnt>0&&(w+=r+":halogen_"+k.cnt+" "),x=t.resids2inter[S]["pi-cation"],k=this.getInteractionPairDetails(x,e,"pi-cation"),u+=k.html,v+=k.cnt,k.cnt>0&&(w+=r+":pi-cation_"+k.cnt+" "),x=t.resids2inter[S]["pi-stacking"],k=this.getInteractionPairDetails(x,e,"pi-stacking"),g+=k.html,_+=k.cnt,k.cnt>0&&(w+=r+":pi-stacking_"+k.cnt+" "),a=l,d=O}i.push({res1:a,res2:w,cntHbond:f,cntIonic:b,cntContact:C,cntHalegen:y,cntPication:v,cntPistacking:_}),o+=this.getInteractionPerResidue(d,c,h,p,m,u,g,f,b,C,y,v,_);let S="";if(n.length>0){S+='',S+="
",S+="Residue # Hydrogen
Bond# Salt Bridge
/Ionic Interaction# Contact ",S+="# Halogen
Bond# π-Cation # π-Stacking ",S+="Hydrogen Bond (backbone atoms: @CA, @N, @C, @O) Salt Bridge/Ionic Interaction Contact ",S+="Halogen Bond π-Cation π-Stacking ";let e=' ",S+="",S+=o,S+=" ';S+=e,S+=e,S+='Atom1 Atom2 Distance(Å) Highlight in 3D ',S+=e,S+=e,S+=e,S+="Atom1 Atom2 # Contacts Min Distance(Å) C-alpha Distance(Å) Highlight in 3D
"}return{html:S,bondCnt:i}}getInteractionPerResidue(e,t,s,i,n,l,r,o,a,d,c,h,p){this.icn3d.icn3dui;let m="";m+=' ",m}getInteractionPairDetails(e,t,s){let i=this.icn3d;i.icn3dui;let n="",l=0,r=' ';if(void 0!==e)for(let a in e){let d=a.split(","),c="save1"==t?d[0]:d[1],h="save1"==t?d[1]:d[0],p=i.getGraphCls.convertLabel2Resid(c),m=i.firstAtomObjCls.getFirstAtomObj(i.residues[p]),u=m.color?m.color.getHexString():"",g=i.getGraphCls.convertLabel2Resid(h),f=i.firstAtomObjCls.getFirstAtomObj(i.residues[g]),b=f.color?f.color.getHexString():"",C=Math.sqrt(e[a]).toFixed(1);n+=''+e[3]+e[2]+" "+o+" "+a+" "+d+" "+c+" "+h+" "+p+" ";let u=[t,s,i,n,l,r];for(let e in u){m+=' "}return m+="'+u[e]+"
",++l}return{html:n,cnt:l}}getContactPairDetails(e,t){let s=this.icn3d;s.icn3dui;let i="",n=0,l=' ';if(void 0!==e)for(let o in e){let a=o.split(","),d="save1"==t?a[0]:a[1],c="save1"==t?a[1]:a[0],h=s.getGraphCls.convertLabel2Resid(d),p=s.firstAtomObjCls.getFirstAtomObj(s.residues[h]),m=p.color?p.color.getHexString():"",u=s.getGraphCls.convertLabel2Resid(c),g=s.firstAtomObjCls.getFirstAtomObj(s.residues[u]),f=g.color?g.color.getHexString():"",b=e[o].split("_"),C=b[0],y=b[1],v=b[2],_=b[3],w=b[4];i+=' '+c+r+u+o+' '+h+r+b+o+' '+C+" ",n+='',n+=" ",n+=parseInt(w)}return{html:i,cnt:n}}exportInteractions(){var e=this.icn3d,t=e.icn3dui;let s=' '+d+"@"+v+l+m+r+' '+c+"@"+_+l+f+r+' '+w+' '+C+' '+y+" ",i+='',i+="
Interacting residues: ';for(let t in e.chainname2residues)for(let i in e.chainname2residues[t]){let n=t.substr(0,t.indexOf("_"))+"_"+i.substr(0,i.indexOf(" "));s+="Base Chain: Residues Interacting Chain "}s+=""+t+": ",s+=e.resid2specCls.residueids2spec(e.chainname2residues[t][i]),s+=" "+n+" "+n[e]+" Cys "+n[e+1]+" Cys ",++i}}let n='
'+i+" disulfide pairs: ";n+=s,n+="Residue ID 1 Residue ID 2 "+r+" "+t.resn+" "+o+" "+n.resn+" ",++i}n[r+"_"+o]=1,n[o+"_"+r]=1}}let l='
'+i+" cross-linkage pairs: ";l+=s,l+="Residue ID 1 Residue ID 2 ",++l}}let a=' '+t+r+d+o+' '+i+r+h+o+' '+p+" ","view"==e&&(n+=''),n+="
'+l+" hydrogen bond pairs (backbone atoms: @CA, @N, @C, @O):
";if(l>0&&(a+=" ",a+=n,a+="Atom 1 Atom 2 Distance(Å) ","view"==e&&(a+='Highlight in 3D '),a+="
"),"graph"==e||"linegraph"==e||"scatterplot"==e){return s.getGraphCls.getGraphLinks(s.resid2ResidhashHbond,s.resid2ResidhashHbond,i.htmlCls.hbondColor,t,i.htmlCls.hbondValue)}return a}exportSaltbridgePairs(e,t){var s=this.icn3d,i=s.icn3dui;let n="",l=0,r=' ';for(let t in s.resid2ResidhashSaltbridge){let i=s.getGraphCls.convertLabel2Resid(t),a=s.firstAtomObjCls.getFirstAtomObj(s.residues[i]),d=a.color?a.color.getHexString():"";for(let i in s.resid2ResidhashSaltbridge[t]){let a=s.getGraphCls.convertLabel2Resid(i),c=s.firstAtomObjCls.getFirstAtomObj(s.residues[a]),h=c.color?c.color.getHexString():"",p=Math.sqrt(s.resid2ResidhashSaltbridge[t][i]).toFixed(1);n+=' ",++l}}let a=' '+t+r+d+o+' '+i+r+h+o+' '+p+" ","view"==e&&(n+=''),n+="
'+l+" salt bridge/ionic interaction pairs:
";if(l>0&&(a+=" ",a+=n,a+="Atom 1 Atom 2 Distance(Å) ","view"==e&&(a+='Highlight in 3D '),a+="
"),"graph"==e||"linegraph"==e||"scatterplot"==e){return s.getGraphCls.getGraphLinks(s.resid2ResidhashSaltbridge,s.resid2ResidhashSaltbridge,i.htmlCls.ionicColor,t,i.htmlCls.ionicValue)}return a}exportHalogenPiPairs(e,t,s){var i=this.icn3d,n=i.icn3dui;let l,r,o,a="",d=0,c=' ';"halogen"==s?(l=i.resid2ResidhashHalogen,r=n.htmlCls.halogenColor,o=n.htmlCls.halogenValue):"pi-cation"==s?(l=i.resid2ResidhashPication,r=n.htmlCls.picationColor,o=n.htmlCls.picationValue):"pi-stacking"==s&&(l=i.resid2ResidhashPistacking,r=n.htmlCls.pistackingColor,o=n.htmlCls.pistackingValue);for(let t in l){let n=i.getGraphCls.convertLabel2Resid(t),r=i.firstAtomObjCls.getFirstAtomObj(i.residues[n]),o=r.color?r.color.getHexString():"";for(let n in l[t]){let r=i.getGraphCls.convertLabel2Resid(n),p=i.firstAtomObjCls.getFirstAtomObj(i.residues[r]),m=p.color?p.color.getHexString():"",u=Math.sqrt(l[t][n]).toFixed(1);a+=' ",++d}}let p=' '+t+c+o+h+' '+n+c+m+h+' '+u+" ","view"==e&&(a+=''),a+="
'+d+" "+s+" pairs:
";if(d>0&&(p+=" ",p+=a,p+="Atom 1 Atom 2 Distance(Å) ","view"==e&&(p+='Highlight in 3D '),p+="
"),"graph"==e||"linegraph"==e||"scatterplot"==e){return i.getGraphCls.getGraphLinks(l,l,r,t,o)}return p}exportSpherePairs(e,t,s){var i=this.icn3d,n=i.icn3dui;let l="",r=0,o=e?i.resid2ResidhashInteractions:i.resid2ResidhashSphere,a=' ';for(let s in o){let n=i.getGraphCls.convertLabel2Resid(s),c=i.firstAtomObjCls.getFirstAtomObj(i.residues[n]),h=c.color?c.color.getHexString():"";for(let n in o[s]){let p=i.getGraphCls.convertLabel2Resid(n),m=i.firstAtomObjCls.getFirstAtomObj(i.residues[p]),u=m.color?m.color.getHexString():"",g=o[s][n].split("_"),f=g[0],b=g[1];c=g[2],m=g[3];let C=g[4];e?(l+=' "):l+=" '+s+"@"+c+a+h+d+' '+n+"@"+m+a+u+d+' '+C+' '+f+' '+b+" ","view"==t&&(l+=''),l+=" ",++r}}let c='"+s+" "+n+' '+C+' '+f+' '+b+"
'+r+" residue pairs in "+(e?"the contacts":"sphere")+":
";if(r>0&&(e?(c+=' "):c+='Residue 1 Residue 2 Num Contacts Min Distance(Å) C-alpha Distance(Å) ',"view"==t&&(c+='Highlight in 3D '),c+=" ',c+=l,c+="Residue 1 Residue 2 Num Contacts Min Distance(Å) C-alpha Distance(Å)
"),"graph"==t||"linegraph"==t||"scatterplot"==t||"calpha"==t||"cbeta"==t||"heavyatoms"==t){return i.getGraphCls.getGraphLinks(o,o,n.htmlCls.contactColor,s,n.htmlCls.contactValue)}return c}}class $t{constructor(e){this.icn3d=e}drawGraph(e,t){var s=this.icn3d,i=s.icn3dui;if(void 0===n)var n=d3;var l=JSON.parse(e),r=$("#"+t).width(),o=$("#"+t).height(),a=isNaN(r)?300:1*r,d=isNaN(o)?300:1*o,c=r,h=o,p=d3.select("#"+i.svgid).attr("width",r).attr("height",o).attr("viewBox","0,0,"+a+","+d);p.selectAll(".g-main").remove();var m=p.append("g").classed("g-main",!0),u=m.append("rect").attr("width",c).attr("height",h).style("fill","#FFF"),g=m.append("g"),f=n.zoom().on("zoom",(function(){g.attr("transform",n.event.transform)}));if(m.call(f),l.links){for(var b=[],C={},y=0,v=l.nodes.length;y
",i+="",g+="}\n",t){n.alignerrormapStr=g,$("#"+n.pre+"alignerrormapDiv").html(i);let e=$("#"+l.alignerrormapid+"_scale").val();$("#"+l.alignerrormapid).attr("width",(n.alignerrormapWidth*parseFloat(e)).toString()+"px")}else n.contactmapStr=g,$("#"+n.pre+"contactmapDiv").html(i);return i}}class Bt{constructor(e){this.icn3d=e}async downloadAlignment(e,t){let s=this.icn3d,i=s.icn3dui,n=this;s.opts.proteins="c alpha trace";let l=e.split(","),r="ids="+e,o=i.htmlCls.baseUrl+"vastplus/vastplus.cgi?v=3&cmd=c&b=1&s=1&w3d&"+r;void 0!==i.cfg.inpara&&(o+=i.cfg.inpara),s.pdbid_chain2title={},void 0===s.chainids2resids&&(s.chainids2resids={});let a={},d="These two MMDB IDs "+l+' do not have 3D alignment data in the VAST+ database. You can try the VAST alignment by visiting the VAST+ page https://www.ncbi.nlm.nih.gov/Structure/vastplus/vastplus.cgi?uid=[PDB ID] (e.g., uid=1KQ2), and clicking "Original VAST"',c=await i.getAjaxPromise(o,"jsonp",!0,d);if(a=c.seqalign,void 0===a)return alert(d),!1;s.pdbid_molid2chain={},s.chainsColor={};for(let e=0,t=2;e5){let s=!0,i=!0;c=await r.pdbParserCls.loadPdbData(t[e],l,!1,s,"query",h,i)}else{let s=!0;c=await r.mmdbParserCls.parseMmdbData(t[e],"query",i[e+1],e,h,s)}d=o.hashUtilsCls.unionHash(d,c)}if(o.cfg.resnum)await r.realignParserCls.realignChainOnSeqAlign(s,i);else if(o.cfg.resdef)await r.realignParserCls.realignChainOnSeqAlign(s,i,void 0,!0);else{await r.pdbParserCls.applyCommandDssp(!0);for(let e in r.pdbChainIndexHash){let t=r.pdbChainIndexHash[e].split("_");l=t[0],t[1],n=t[2],t[3],a.transformStructure(l,e-1,"query")}let e=[],t=[],c=[],h=o.htmlCls.baseUrl+"vastdyn/vastdyn.cgi",p=o.htmlCls.baseUrl+"tmalign/tmalign.cgi";for(let s in r.afChainIndexHash){let i=r.afChainIndexHash[s].split("_");l=i[0];let a=i[1];n=i[2];let d,m=i[3];if("tmalign"!=o.cfg.aligntool){let e={domains1:r.domain3dCls.getDomainJsonForAlign(r.chains[l+"_"+a]),domains2:r.domain3dCls.getDomainJsonForAlign(r.chains[n+"_"+m])};d=o.getAjaxPostPromise(h,e)}else{let e={pdb_query:r.saveFileCls.getAtomPDB(r.chains[l+"_"+a]),pdb_target:r.saveFileCls.getAtomPDB(r.chains[n+"_"+m])};d=o.getAjaxPostPromise(p,e)}e.push(d),t.push(s-1),c.push(l)}let m=Promise.allSettled(e),u=await m;await a.downloadChainalignmentPart2b(s,i,d,u,t,n,c)}}async downloadChainalignmentPart2b(e,t,s,i,n,l,r){let o=this.icn3d,a=o.icn3dui;for(let e=0,t=i.length;e
",r.tmscore=e[0].score.toPrecision(4)),$("#"+r.pre+"dl_rmsd_html").html(n),o.cfg.bSidebyside||o.htmlCls.dialogCls.openDlg("dl_rmsd","RMSD of alignment"),a=!0}return a}async loadOpmDataForChainalign(e,t,s,i){let n=this.icn3d,l=n.icn3dui,r=this;if(l.cfg.resnum||l.cfg.resdef)n.bCommandLoad||n.init(),await this.downloadChainalignmentPart2(e,t,void 0,s);else{let o=l.htmlCls.baseUrl+"vastdyn/vastdyn.cgi?mmdbids2opm="+i.join("','"),a=await l.getAjaxPromise(o,"jsonp");if(a&&a.mmdbid){let i=a.mmdbid;n.selectedPdbid=i;let o="https://opm-assets.storage.googleapis.com/pdb/"+i.toLowerCase()+".pdb",d=await l.getAjaxPromise(o,"text");n.bOpm=!0;let c=!0,h=n.loadPDBCls.loadPDB(d,i,n.bOpm,c);$("#"+n.pre+"selectplane_z1").val(n.halfBilayerSize),$("#"+n.pre+"selectplane_z2").val(-n.halfBilayerSize),$("#"+n.pre+"extra_mem_z").val(n.halfBilayerSize),$("#"+n.pre+"intra_mem_z").val(-n.halfBilayerSize),n.bCommandLoad||n.init(),await r.downloadChainalignmentPart2(e,t,h,s)}else n.bCommandLoad||n.init(),await r.downloadChainalignmentPart2(e,t,void 0,s)}}async downloadMmdbAf(e,t,s){let i=this.icn3d,n=i.icn3dui;i.structArray=i.structures?Object.keys(i.structures):[],0==i.structArray.length?i.init():(i.resetConfig(),i.bResetAnno=!0,i.bResetSets=!0);let l=e.split(","),r=[];for(let e=0,t=l.length;e1&&($("#"+i.pre+"assemblyWrapper").show(),i.asuCnt=i.biomtMatrices.length);let d,c,h,p,m,u,g,f,b,C,y,v,_,w,S,A,x,k,O,R={},I=[],T="coil",E="",P=0,M=0,D={onModel:function(e){d=0===e.modelIndex?a:a+(e.modelIndex+1).toString()},onChain:function(e){c=e.chainName;let t=d+"_"+c;void 0===i.structures[d]&&(i.structures[d]=[]),i.structures[d].push(t)},onGroup:function(e){h=e.groupName,p=e.groupId;let t=d+"_"+c+"_"+p;m=0===e.secStruct||2===e.secStruct||4===e.secStruct?"helix":3===e.secStruct?"sheet":-1===e.secStruct?"other":"coil";let s=!1;if(c!==E){if(x=void 0,O=void 0,"coil"!==m&&"other"!==m?(u=!0,g=!1):(u=!1,g=!1),"coil"!==T&&"other"!==T){let e=d+"_"+E+"_"+P.toString();for(let t in i.residues[e])i.atoms[t].ssbegin=!1,i.atoms[t].ssend=!0}}else x=A,O=k,m!==T?"coil"===T||"other"===T?(u=!0,g=!1):"coil"===m||"other"===m?(s=!0,u=!1,g=!1):("sheet"===T&&"helix"===m||"helix"===T&&"sheet"===m)&&(s=!0,u=!0,g=!1):(u=!1,g=!1);if(s&&!isNaN(p)){let e=d+"_"+c+"_"+(p-1).toString();for(let t in i.residues[e])i.atoms[t].ssbegin=!1,i.atoms[t].ssend=!0}T=m,E=c,P=p,f=!1,b=!1,C=!1,"non-polymer"===e.chemCompType.toLowerCase()||"other"===e.chemCompType.toLowerCase()||-1!==e.chemCompType.toLowerCase().indexOf("saccharide")?f=!0:-1!==e.chemCompType.toLowerCase().indexOf("peptide")?b=!0:-1!==e.chemCompType.toLowerCase().indexOf("dna")||-1!==e.chemCompType.toLowerCase().indexOf("rna")?C=!0:b=!0;let l=d+"_"+c,r={};r.resi=p,r.name=n.utilsCls.residueName2Abbr(h),i.residueId2Name[t]=r.name,r.resi%10==0&&r.resi.toString();let o="-";"helix"===m?o="H":"sheet"===m?o="E":"coil"===m?o="c":"other"===m&&(o="o"),void 0===i.chainsSeq[l]&&(i.chainsSeq[l]=[]),i.bFullUi&&i.chainsSeq[l].push(r),i.secondaries[t]=o},onAtom:function(e){if(y=e.element,v=e.atomName,_=new THREE.Vector3(e.xCoord,e.yCoord,e.zCoord),w=e.bFactor,S=e.altLoc,"\0"===e.altLoc&&(S=""),""===S||"A"===S){++M,"SG"===v&&I.push(M),R[e.atomIndex]=M;let t={het:f,serial:M,name:v,alt:S,resn:h,structure:d,chain:c,resi:p,coord:_,b:w,elem:y,bonds:[],bondOrder:[],ss:m,ssbegin:u,ssend:g};if(t.het||"C"!==t.name||(A=M),t.het||"O"!==t.name||(k=M),!t.het&&"N"===t.name&&void 0!==x&&void 0!==O){let e=i.atoms[x].coord.distanceTo(i.atoms[O].coord),s=t.coord.x+(i.atoms[x].coord.x-i.atoms[O].coord.x)/e,n=t.coord.y+(i.atoms[x].coord.y-i.atoms[O].coord.y)/e,l=t.coord.z+(i.atoms[x].coord.z-i.atoms[O].coord.z)/e;t.hcoord=new THREE.Vector3(s,n,l)}i.atoms[M]=t,l.min(_),r.max(_),o.add(_);let a=d+"_"+c,T=a+"_"+p;void 0===i.chains[a]&&(i.chains[a]={}),i.chains[a][M]=1,void 0===i.residues[T]&&(i.residues[T]={}),i.residues[T][M]=1,b?(i.proteins[M]=1,"CA"===v&&(i.calphas[M]=1),"N"!==v&&"H"!==v&&"CA"!==v&&"HA"!==v&&"C"!==v&&"O"!==v&&(i.sidec[M]=1)):C?(i.nucleotides[M]=1,(!s||"O3'"!=v&&"O3*"!=v)&&(s||"P"!=v)||(i.nucleotidesO3[M]=1),-1===n.parasCls.nuclMainArray.indexOf(v)&&(i.ntbase[M]=1)):y.toLowerCase()===h.toLowerCase()?i.ions[M]=1:"HOH"===h||"WAT"===h||"SQL"===h||"H2O"===h||"W"===h||"DOD"===h||"D3O"===h?i.water[M]=1:i.chemicals[M]=1,i.dAtoms[M]=1,i.hAtoms[M]=1}},onBond:function(e){let t=R[e.atomIndex1],s=R[e.atomIndex2];if(R.hasOwnProperty(e.atomIndex1)&&R.hasOwnProperty(e.atomIndex2)&&(i.atoms[t].bonds.push(s),i.atoms[s].bonds.push(t),f)){let n=e.bondOrder;i.atoms[t].bondOrder.push(n),i.atoms[s].bondOrder.push(n),2===n?(i.doublebonds[t+"_"+s]=1,i.doublebonds[s+"_"+t]=1):3===n&&(i.triplebonds[t+"_"+s]=1,i.triplebonds[s+"_"+t]=1)}}};MMTF.traverse(e,D),i.loadPDBCls.setResidMapping();for(let e=0,t=I.length;e5){let e=r.cfg.chainalign.split(",");e.length>0&&(l.hAtoms=l.definedSetsCls.getAtomsFromNameArray(e)),r.cfg.aligntool="tmalign",await l.realignParserCls.realignOnStructAlign()}else l.hAtoms=l.chainalignParserCls.setMsa(e),l.transformCls.zoominSelection(),await l.chainalignParserCls.downloadChainalignmentPart3(void 0,e,l.hAtoms)}async parseChainRealignData(e,t,s,i,n,l,r){let o=this.icn3d,a=o.icn3dui,d=s[0].substr(0,s[0].indexOf("_"));r||(d=d.toUpperCase());let c={};o.realignResid={},o.opts.color="grey",o.setColorCls.setColorByOptions(o.opts,o.dAtoms),o.qt_start_end=[];for(let t=0,h=e.length;t9||s<0)return n*i|0;i=10*i+s|0}return n*i}function u(e,t,s){let i=1,n=0,l=0,r=1;for(45===e.charCodeAt(t)&&(i=-1,++t);t=0&&o<10)){if(-2===o){for(++t;t=0&&o<10))return 53===o||21===o?parseScientific(i*(n+l/r),e,t+1,s):i*(n+l/r);l=10*l+o,r*=10,++t}return i*(n+l/r)}if(53===o||21===o)return parseScientific(i*n,e,t+1,s);break}n=10*n+o,++t}return i*n}let g=function(){function e(e){this.data=e,this.isDefined=!0}return e.prototype.getString=function(e){return""+this.data[e]},e.prototype.getInteger=function(e){return 0|this.data[e]},e.prototype.getFloat=function(e){return 1*this.data[e]},e.prototype.stringEquals=function(e,t){return this.data[e]===u(t,0,t.length)},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return 0},e}(),f=function(){function e(e,t){this.data=e,this.mask=t,this.isDefined=!0}return e.prototype.getString=function(e){return 0===this.mask[e]?""+this.data[e]:null},e.prototype.getInteger=function(e){return 0===this.mask[e]?this.data[e]:0},e.prototype.getFloat=function(e){return 0===this.mask[e]?this.data[e]:0},e.prototype.stringEquals=function(e,t){return 0===this.mask[e]?this.data[e]===u(t,0,t.length):null==t},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return this.mask[e]},e}(),b=function(){function e(e){this.data=e,this.isDefined=!0}return e.prototype.getString=function(e){return this.data[e]},e.prototype.getInteger=function(e){let t=this.data[e];return m(t,0,t.length)},e.prototype.getFloat=function(e){let t=this.data[e];return u(t,0,t.length)},e.prototype.stringEquals=function(e,t){return this.data[e]===t},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return 0},e}(),C=function(){function e(e,t){this.data=e,this.mask=t,this.isDefined=!0}return e.prototype.getString=function(e){return 0===this.mask[e]?this.data[e]:null},e.prototype.getInteger=function(e){if(0!==this.mask[e])return 0;let t=this.data[e];return m(t||"",0,(t||"").length)},e.prototype.getFloat=function(e){if(0!==this.mask[e])return 0;let t=this.data[e];return u(t||"",0,(t||"").length)},e.prototype.stringEquals=function(e,t){return this.data[e]===t},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return this.mask[e]},e}(),y=function(){function e(e){this.dataBlocks=e.dataBlocks.map((function(e){return new i(e)}))}return e.prototype.toJSON=function(){return this.dataBlocks.map((function(e){return e.toJSON()}))},e}();return new y(s)}MessagePackParse(e){this.icn3d.icn3dui;let t=this;function s(e,s){let i={};for(let n=0;n0&&(i[i.length]=l.slice(0,a).join(""));return i.join("")}(e.buffer,e.offset,t);return e.offset+=t,s}let r=function(){let e=[];for(let t=0;t<1024;t++)e[t]=String.fromCharCode(t);return e}();let o,a,d=e.buffer[e.offset];if(0==(128&d))return e.offset++,d;if(128==(240&d))return a=15&d,e.offset++,s(e,a);if(144==(240&d))return a=15&d,e.offset++,n(e,a);if(160==(224&d))return a=31&d,e.offset++,l(e,a);if(224==(224&d))return o=e.dataView.getInt8(e.offset),e.offset++,o;switch(d){case 192:return e.offset++,null;case 194:return e.offset++,!1;case 195:return e.offset++,!0;case 196:return a=e.dataView.getUint8(e.offset+1),e.offset+=2,i(e,a);case 197:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,i(e,a);case 198:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,i(e,a);case 202:return o=e.dataView.getFloat32(e.offset+1),e.offset+=5,o;case 203:return o=e.dataView.getFloat64(e.offset+1),e.offset+=9,o;case 204:return o=e.buffer[e.offset+1],e.offset+=2,o;case 205:return o=e.dataView.getUint16(e.offset+1),e.offset+=3,o;case 206:return o=e.dataView.getUint32(e.offset+1),e.offset+=5,o;case 208:return o=e.dataView.getInt8(e.offset+1),e.offset+=2,o;case 209:return o=e.dataView.getInt16(e.offset+1),e.offset+=3,o;case 210:return o=e.dataView.getInt32(e.offset+1),e.offset+=5,o;case 217:return a=e.dataView.getUint8(e.offset+1),e.offset+=2,l(e,a);case 218:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,l(e,a);case 219:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,l(e,a);case 220:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,n(e,a);case 221:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,n(e,a);case 222:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,s(e,a);case 223:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,s(e,a)}}}class ss{constructor(e){this.icn3d=e}alignCoords(e,t,s,i,n,l,r,o){let a,d=this.icn3d,c=d.icn3dui,h=e.length
Realignment RMSD: "+a.toPrecision(4)+" Å
";d.bAfMem&&!c.cfg.chainalign&&(e+=c.utilsCls.getMemDesc()),$("#"+d.pre+"dl_rmsd_html").html(e),c.cfg.bSidebyside||c.htmlCls.dialogCls.openDlg("dl_rmsd","Realignment RMSD")}let r={};for(let n=0,l=d.structures[s].length;n
"+t.diagram2dCls.set2DdgmNote(),$("#"+t.pre+"dl_2ddgm_html").html(t.html2ddgm)),t.b2DShown=!0}showLoading(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"wait")&&$("#"+e.pre+"wait").show(),$("#"+e.pre+"canvas")&&$("#"+e.pre+"canvas").hide(),$("#"+e.pre+"cmdlog")&&$("#"+e.pre+"cmdlog").hide()}hideLoading(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"wait")&&$("#"+e.pre+"wait").hide(),$("#"+e.pre+"canvas")&&$("#"+e.pre+"canvas").show(),$("#"+e.pre+"cmdlog")&&$("#"+e.pre+"cmdlog").show()}setYourNote(e){let t=this.icn3d,s=t.icn3dui;t.yournote=e,$("#"+t.pre+"yournote").val(t.yournote),s.cfg.shownote&&(document.title=t.yournote)}transformToOpmOri(e){let t=this.icn3d;if(t.icn3dui,void 0!==t.rmsd_supr&&void 0!==t.rmsd_supr.rot){let s=t.rmsd_supr.rot,i=t.rmsd_supr.trans1,n=t.rmsd_supr.trans2;t.rmsd_supr.rmsd;let l=0;for(let e in t.atoms){let r=t.atoms[e];r.coord=t.surfaceCls.transformMemPro(r.coord,s,i,n);let o=r.coord.x*r.coord.x+r.coord.y*r.coord.y;Math.abs(r.coord.z)<=25&&o>l&&(l=o)}this.addMemAtoms(t.halfBilayerSize,e,Math.sqrt(l)),t.bStopRotate=!0,t.bOpm=!0,$("#"+t.pre+"togglememli").show(),$("#"+t.pre+"adjustmemli").show(),$("#"+t.pre+"selectplaneli").show()}else t.bOpm=!1}transformToOpmOriForAlign(e,t,s){let i=this.icn3d,n=i.icn3dui;if(void 0!==t){let l=i.loadPDBCls.getChainCalpha(i.chains,i.atoms,s,e),r=1==Object.keys(l.chainresiCalphaHash).length||1==Object.keys(t.chainresiCalphaHash).length,o=[],a=[];for(let e in l.chainresiCalphaHash)if(t.chainresiCalphaHash.hasOwnProperty(e)){let s=l.chainresiCalphaHash[e],i=t.chainresiCalphaHash[e];if((s.length==i.length||r)&&(o=o.concat(s),a=a.concat(i)),o.length>500)break}let d=o.length=2?$("#"+e.pre+"mn2_alternateWrap").show():$("#"+e.pre+"mn2_alternateWrap").hide(),setTimeout((async function(){if(e.bInitial){if(void 0!==t.cfg.align||void 0!==t.cfg.chainalign){let s=e.pre+"selection";if($("#"+s).show(),$("#"+s+"_expand").hide(),$("#"+s+"_shrink").show(),void 0!==t.cfg.align&&2!=t.cfg.atype){let s=!1,i=t.htmlCls.alignSeqCls.getAlignSequencesAnnotations(Object.keys(e.alnChains),void 0,void 0,s);$("#"+e.pre+"dl_sequence2").html(i.sequencesHtml),$("#"+e.pre+"dl_sequence2").width(t.htmlCls.RESIDUE_WIDTH*i.maxSeqCnt+200)}}if(t.cfg.showanno){let s="view annotations";t.htmlCls.clickMenuCls.setLogCmd(s,!0),await e.showAnnoCls.showAnnotations()}(t.cfg.closepopup||t.cfg.imageonly)&&e.resizeCanvasCls.closeDialogs()}else e.hlUpdateCls.updateHlAll();$("#"+e.pre+"atomsCustom").length>0&&$("#"+e.pre+"atomsCustom")[0].blur(),e.bInitial=!1,t.cfg.imageonly&&e.saveFileCls.saveFile(void 0,"png",void 0,!0)}),0)}processCommand(){let e=this.icn3d,t=e.icn3dui;if(1==Object.keys(e.structures).length){let s=Object.keys(e.structures)[0];t.cfg.command=t.cfg.command.replace(new RegExp("!","g"),s+"_")}}getMassCenter(e,t){return this.icn3d.icn3dui,e.multiplyScalar(1/t)}getGeoCenter(e,t){return this.icn3d.icn3dui,e.clone().add(t).multiplyScalar(.5)}getStructureSize(e,t,s,i){let n=this.icn3d;n.icn3dui;let l=0;for(let r in e){let e=n.atoms[r].coord;if(Math.round(t.x)==Math.round(e.x)||Math.round(t.y)==Math.round(e.y)||Math.round(t.z)==Math.round(e.z)||Math.round(s.x)==Math.round(e.x)||Math.round(s.y)==Math.round(e.y)||Math.round(s.z)==Math.round(e.z)){let t=2*e.distanceTo(i);t>l&&(l=t)}}return l}async checkMemProteinAndRotate(){let e=this.icn3d,t=e.icn3dui;if(!e.bCheckMemProtein){e.bCheckMemProtein=!0;let s=t.cfg.afid?t.cfg.afid:t.cfg.mmdbafid;if(await e.ParserUtilsCls.checkMemProtein(s),t.cfg.url&&-1!=t.cfg.url.indexOf("membranome")){let t=new THREE.Vector3(1,0,0),s=-.5*Math.PI;e.transformCls.setRotation(t,s)}}}async checkMemProtein(e){let t=this.icn3d,s=t.icn3dui;try{let i=s.htmlCls.baseUrl+"vastdyn/vastdyn.cgi?afid2mem="+e,n=await s.getAjaxPromise(i,"jsonp");if(n&&n.pdbid){let e='This is a single-spanning (bitopic) transmembrane protein according to the Membranome database. Do you want to align the protein with the model from Membranome? If you click "OK", you can press the letter "a" to alternate the structures.';if("off"==s.cfg.afmem);else if("on"==s.cfg.afmem||confirm(e))try{let e="https://storage.googleapis.com/membranome-assets/pdb_files/proteins/"+n.pdbid+".pdb",i=await s.getAjaxPromise(e,"text");t.bAfMem=!0,s.bNode||$("#"+s.pre+"togglememli").show();let l=n.pdbid.substr(0,n.pdbid.indexOf("_")),r=!0,o=!0;await t.pdbParserCls.loadPdbData(i,l,r,o),o&&(t.bSetChainsAdvancedMenu&&t.definedSetsCls.showSets(),t.bAnnoShown&&await t.showAnnoCls.showAnnotations());let a=n.segment.replace(/ /gi,"").split("(")[0];t.afmem_start_end=a.split("-"),t.hAtoms={},t.dAtoms={};for(let e in t.atoms)t.atoms[e].structure!=l&&(t.hAtoms[e]=1),t.dAtoms[e]=1;for(let e=parseInt(t.afmem_start_end[0]);e<=parseInt(t.afmem_start_end[1]);++e)t.hAtoms=s.hashUtilsCls.unionHash(t.hAtoms,t.residues[l+"_A_"+e]);await t.realignParserCls.realignOnSeqAlign(l)}catch(e){return void console.log("Error in retrieving matched PDB from Membranome...")}}}catch(e){return void console.log("Error in finding matched PDB in Membranome...")}}getResi(e,t){let s=this.icn3d;s.icn3dui;let i=s.ncbi2resid[e+"_"+(t+1).toString()];return i?i.substr(i.lastIndexOf("_")+1):""}getResiNCBI(e,t){let s=this.icn3d;s.icn3dui;let i=s.resid2ncbi[e+"_"+t];return i?parseInt(i.substr(i.lastIndexOf("_")+1)):0}}class is{constructor(e){this.icn3d=e}loadAtomDataIn(e,t,s,i,n,l,r,o,a){let d=this.icn3d,c=d.icn3dui;d.pmin=new THREE.Vector3(9999,9999,9999),d.pmax=new THREE.Vector3(-9999,-9999,-9999),d.psum=new THREE.Vector3;let h=e.atoms,p=d.atoms?Object.keys(d.atoms).length:0,m={},u={};d.pmid=e.pubmedId,void 0===d.chainid2title&&(d.chainid2title={}),void 0===d.chainid2sid&&(d.chainid2sid={});let g={},f={};if("align"===s){d.pmid="",d.molTitle="",c.cfg.inpara&&-1!==c.cfg.inpara.indexOf("atype=1")?d.molTitle="Invariant Core Structure Alignment (VAST) of ":c.cfg.inpara&&-1!==c.cfg.inpara.indexOf("atype=2")?d.molTitle="Structure Alignment (TM-align) of ":d.molTitle="Structure Alignment (VAST) of ";let t=!1;for(let s=0,i=e.alignedStructures[0].length;s'+i.pdbId.toUpperCase()+"",void 0!==i.descr&&(d.pmid+=i.descr.pubmedid),0===s&&(d.molTitle+=" and ",void 0!==i.descr&&(d.pmid+="_")),t=!0}d.molTitle+=" from VAST+",t||(d.molTitle="")}else if(void 0!==e.descr&&(d.molTitle+=e.descr.name),"mmdbid"===s){let s=isNaN(t)?t:e.pdbId,i={};void 0===d.alignmolid2color&&(d.alignmolid2color=[]);let n=1;for(let t in e.moleculeInfor){if(0===Object.keys(e.moleculeInfor[t]).length)continue;let l=e.moleculeInfor[t].chain.trim();(parseInt(c.cfg.date)>=20231001||!c.cfg.date&&parseInt(c.utilsCls.getDateDigitStr())>=20231001)&&(l=l.replace(/_/g,""));let r=s+"_"+l;i.hasOwnProperty(l)?(++i[l],r+=i[l]):i[l]=1,void 0!==d.mmdbid_q&&(d.mmdbid_q,d.mmdbid_t);let o=e.moleculeInfor[t].kind,a=e.moleculeInfor[t].color,h=e.moleculeInfor[t].sid;if(g[r]=o,f[r]=a,"protein"==o&&(d.organism=e.moleculeInfor[t].taxonomyName.toLowerCase()),void 0!==h&&(d.chainid2sid[r]=h),void 0===d.pdbid_chain2title&&(d.pdbid_chain2title={}),d.pdbid_chain2title[r]=e.moleculeInfor[t].name,l==r.substr(r.lastIndexOf("_"))){let e={};e[t]=n.toString(),d.alignmolid2color.push(e)}++n}}"mmdbid"===s&&(d.molTitleHash||(d.molTitleHash={}),d.molTitleHash[t]=d.molTitle);let b,C,y,v,_,w={},S="",A="",x="",k="",O="",R="",I=0,T=0,E="",P=!0,M=!1,D="",H=c.utilsCls.isCalphaPhosOnly(h),F=0,L={};for(let e in h){++p,w[e]=p;let i,n=h[e];n.serial=p,"mmdbid"===s||"mmcifid"===s?i=t:"align"===s&&(i=m[p]);let l=!1;if(void 0!==n.chain||"mmdbid"!==s&&"align"!==s)n.chain=""===n.chain?"Misc":n.chain;else if("mmdbid"===s)if(b=n.ids.m,void 0!==d.molid2chain[b]){let e=d.molid2chain[b].indexOf("_");n.chain=d.molid2chain[b].substr(e+1)}else{let e="Misc";("protein"===g[O]&&"nucleotide"===g[O]&&n.resi!=T||"protein"!==g[O]&&"nucleotide"!==g[O]&&(n.resn.substr(0,3)!=E.substr(0,3)||n.resi!=T||"solvent"===g[O]||"HOH"===n.resn))&&++F,n.resi_ori=n.resi,n.resi=F,l=!0,n.chain=e}else if("align"===s)if(b=n.ids.m,void 0!==d.pdbid_molid2chain[i+"_"+b])n.chain=d.pdbid_molid2chain[i+"_"+b];else{let e="Misc";("protein"===g[O]&&"nucleotide"===g[O]&&n.resi!=T||"protein"!==g[O]&&"nucleotide"!==g[O]&&(n.resn.substr(0,3)!=E.substr(0,3)||n.resi!=T||"solvent"===g[O]||"HOH"===n.resn))&&(++F,n.resi_ori=n.resi,n.resi=F,l=!0),n.chain=e}if(n.chain=n.chain.trim(),(parseInt(c.cfg.date)>=20231001||!c.cfg.date&&parseInt(c.utilsCls.getDateDigitStr())>=20231001)&&(n.chain=n.chain.replace(/_/g,"")),"mmdbid"!==s&&"align"!==s||(n.structure=i,"mmdbid"===s&&void 0!==d.mmdbid_q&&(d.mmdbid_q,d.mmdbid_t)),k=n.structure,O=k+"_"+n.chain,"mmdbid"===s||"align"===s){l||(n.resi_ori=n.resi,d.bUsePdbNum?n.resi=n.resi_ori:n.resi=n.ids.r);let e=n.resn.indexOf(" ");-1!==e&&0!=e&&(n.resn=n.resn.substr(0,e))}O!==A&&(I=0),n.resi!==I&&(O!==A?(y=void 0,_=void 0):(y=C,_=v)),n.coord="mmdbid"===s?new THREE.Vector3(n.coord[0],n.coord[1],n.coord[2]):new THREE.Vector3(n.coord.x,n.coord.y,n.coord.z);let r=c.utilsCls.residueName2Abbr(n.resn.substr(0,3));"mmdbid"!==s&&"align"!==s||!d.bFullUi||(void 0===d.mmdbMolidResid2mmdbChainResi&&(d.mmdbMolidResid2mmdbChainResi={}),d.mmdbMolidResid2mmdbChainResi[i+"_"+n.ids.m+"_"+n.ids.r]=i+"_"+n.chain+"_"+n.resi),d.pmin.min(n.coord),d.pmax.max(n.coord),d.psum.add(n.coord);let o=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"protein"===g[O]:"p"===n.mt,a=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"nucleotide"===g[O]:"n"===n.mt,u=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"solvent"===g[O]:"s"===n.mt,N=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"ligand"===g[O]||void 0!==g[O]&&-1!==g[O].indexOf("other")||void 0===g[O]:"l"===n.mt;if("Misc"!==n.chain&&"other"!==g[O]||"protein"===L[O]||"nucleotide"===L[O]||("CA"===n.name&&"C"===n.elem?L[O]="protein":"P"===n.name&&"P"===n.elem?L[O]="nucleotide":L[O]="chemical"),o||a?(o?(d.proteins[p]=1,"CA"===n.name&&(d.calphas[p]=1),"N"!==n.name&&"H"!==n.name&&"CA"!==n.name&&"HA"!==n.name&&"C"!==n.name&&"O"!==n.name&&(d.sidec[p]=1)):a&&(d.nucleotides[p]=1,("O3'"==n.name||"O3*"==n.name||H&&"P"==n.name)&&(d.nucleotidesO3[p]=1),-1===c.parasCls.nuclMainArray.indexOf(n.name)&&(d.ntbase[p]=1)),n.het=!1):u?(d.water[p]=1,n.het=!0):N&&("HOH"===n.resn||"O"===n.resn?d.water[p]=1:n.elem===n.resn?d.ions[p]=1:d.chemicals[p]=1,n.het=!0),"mmdbid"===s?n.het?n.color=c.parasCls.atomColors[n.elem]||c.parasCls.defaultAtomColor:n.color=void 0!==f[O]?c.parasCls.thr(f[O]):c.parasCls.chargeColors[n.resn]:void 0!==n.color&&(n.color=c.parasCls.thr(n.color))," "!==n.resn.charAt(0)&&" "===n.resn.charAt(1)&&(n.resn=n.resn.charAt(0)),n.het||"C"!==n.name||(C=p),n.het||"O"!==n.name||(v=p),!n.het&&"N"===n.name&&void 0!==y&&void 0!==_){let e=d.atoms[y].coord.distanceTo(d.atoms[_].coord),t=n.coord.x+(d.atoms[y].coord.x-d.atoms[_].coord.x)/e,s=n.coord.y+(d.atoms[y].coord.y-d.atoms[_].coord.y)/e,i=n.coord.z+(d.atoms[y].coord.z-d.atoms[_].coord.z)/e;n.hcoord=new THREE.Vector3(t,s,i)}"HOH"==n.resn&&(d.water[p]=1),d.atoms[p]=n,d.dAtoms[p]=1,d.hAtoms[p]=1;let q=n.structure+"_"+n.chain;void 0===d.chains[q]&&(d.chains[q]={}),d.chains[q][p]=1;let U=q+"_"+n.resi;void 0===d.residues[U]&&(d.residues[U]={}),d.residues[U][p]=1,R=O+"_"+n.resi,R!==x&&O!==A&&(P=!0,""!==S&&(void 0===d.structures[S]&&(d.structures[S]=[]),d.structures[S].push(A))),d.residueId2Name[U]=r;let $="-";if("helix"===n.ss?$="H":"sheet"===n.ss?$="E":n.het||a?$="o":(!n.het&&c.parasCls.residueColors.hasOwnProperty(n.resn.toUpperCase())||"coil"===n.ss)&&($="c"),d.secondaries[n.structure+"_"+n.chain+"_"+n.resi]=$,(n.resi!=I||b!=D)&&d.bFullUi&&(void 0===d.chainsSeq[q]&&(d.chainsSeq[q]=[],P=!1),!isNaN(n.resi)))if(P&&!M&&void 0!==d.chainsSeq[q][n.resi-1])d.chainsSeq[q][n.resi-1].name=r;else if(!P||!d.chainsSeq[q].hasOwnProperty(n.resi-1)){let e={};e.resi=n.resi,e.name=r,n.resi%10==0&&n.resi.toString(),d.chainsSeq[q].push(e),M=!0}I=n.resi,T=n.resi_ori,E=n.resn,S=k,A=O,x=R,D=b}for(let e in d.chemicals){let t=d.atoms[e];if("P"==t.elem&&t.bonds.length>=4)for(let e=t.bonds.length-1;e>=0;--e){"P"==d.atoms[t.bonds[e]].elem&&t.bonds.splice(e,1)}}for(let e in L)if(!(Object.keys(d.chains[e]).length<10)&&"chemical"!==L[e])for(let t in d.chains[e]){let s=d.atoms[t];delete d.chemicals[t],s.het=!1,"protein"===L[e]?(d.proteins[t]=1,"CA"===s.name&&(d.calphas[t]=1),"N"!==s.name&&"H"!==s.name&&"CA"!==s.name&&"HA"!==s.name&&"C"!==s.name&&"O"!==s.name&&(d.sidec[t]=1)):"nucleotide"===L[e]&&(d.nucleotides[t]=1,("O3'"==s.name||"O3*"==s.name||H&&"P"==s.name)&&(d.nucleotidesO3[t]=1),-1===c.parasCls.nuclMainArray.indexOf(s.name)&&(d.ntbase[t]=1))}if(void 0===d.structures[k]&&(d.structures[k]=[]),d.structures[k].push(O),d.bFullUi)if("mmdbid"===s||"mmcifid"===s)for(let i in e.sequences){let n=e.sequences[i],l=t+"_"+i;void 0!==d.mmdbid_q&&(d.mmdbid_q,d.mmdbid_t),d.ParserUtilsCls.getMissingResidues(n,s,l)}else if("align"===s)for(let e in d.chainid2seq){let t=d.chainid2seq[e];d.ParserUtilsCls.getMissingResidues(t,s,e)}if(d.loadPDBCls.setResidMapping(),"mmcifid"!==s)for(let e in h){let t=w[e],s=void 0===d.atoms[t].bonds?0:d.atoms[t].bonds.length;for(let e=0;ed.maxatomcnt||void 0!==d.biomtMatrices&&d.biomtMatrices.length*d.cnt>10*d.maxatomcnt)&&(d.opts.proteins="c alpha trace",d.opts.nucleotides="o3 trace"),d.center=d.ParserUtilsCls.getGeoCenter(d.pmin,d.pmax),d.maxD=d.ParserUtilsCls.getStructureSize(d.atoms,d.pmin,d.pmax,d.center),d.maxD<5&&(d.maxD=5),d.oriMaxD=d.maxD,("align"===s||o)&&(d.ssbondpnts={},d.loadPDBCls.setSsbond()),"mmdbid"===s&&1==Object.keys(d.structures).length){let t=e.disulfides;if(void 0!==t)for(let e=0,s=t.length;ep&&(p=e)),c[e]={resi:t,resn:i,aligned:n}}r=e[t][1];let u=r.moleculeId,g=s.pdbid_molid2chain[l+"_"+u],f=l+"_"+g;void 0===s.alnChainsAnTtl[d]&&(s.alnChainsAnTtl[d]=[]),void 0===s.alnChainsAnTtl[d][0]&&(s.alnChainsAnTtl[d][0]=[]),void 0===s.alnChainsAnTtl[d][1]&&(s.alnChainsAnTtl[d][1]=[]),void 0===s.alnChainsAnTtl[d][2]&&(s.alnChainsAnTtl[d][2]=[]),void 0===s.alnChainsAnTtl[d][3]&&(s.alnChainsAnTtl[d][3]=[]),void 0===s.alnChainsAnTtl[d][4]&&(s.alnChainsAnTtl[d][4]=[]),void 0===s.alnChainsAnTtl[d][5]&&(s.alnChainsAnTtl[d][5]=[]),void 0===s.alnChainsAnTtl[d][6]&&(s.alnChainsAnTtl[d][6]=[]),s.alnChainsAnTtl[d][0].push(f),s.alnChainsAnTtl[d][1].push(d),s.alnChainsAnTtl[d][2].push(""),s.alnChainsAnTtl[d][3].push(""),s.alnChainsAnTtl[d][4].push(f),s.alnChainsAnTtl[d][5].push(d),s.alnChainsAnTtl[d][6].push("");let b=1;s.chainsMapping[d]||(s.chainsMapping[d]={}),s.chainsMapping[f]||(s.chainsMapping[f]={});for(let e=h;e<=p;++e){let t,o,p,m=s.bUsePdbNum?s.ParserUtilsCls.getResi(f,r.sequence[e][0]-1):r.sequence[e][0],u="~"===r.sequence[e][2]?"-":r.sequence[e][2],C=r.sequence[e][3]?1:0,y=c[e].aligned+C;2===y?(c[e].resn===u?(t="#FF0000",p="icn3d-cons",s.consHash1[d+"_"+c[e].resi]=1,s.consHash2[f+"_"+m]=1):(t="#0000FF",p="icn3d-ncons",s.nconsHash1[d+"_"+c[e].resi]=1,s.nconsHash2[f+"_"+m]=1),s.chainsMapping[d][d+"_"+c[e].resi]=c[e].resn+c[e].resi,s.chainsMapping[f][f+"_"+m]=c[e].resn+c[e].resi,o="#"+s.showAnnoCls.getColorhexFromBlosum62(c[e].resn,u)):(t=i.htmlCls.GREY8,p="icn3d-nalign",s.nalignHash1[d+"_"+c[e].resi]=1,s.nalignHash2[f+"_"+m]=1),void 0===s.alnChainsSeq[d]&&(s.alnChainsSeq[d]=[]);let v={};v.mmdbid=n,v.chain=a,v.resi=c[e].resi,v.resn=""===v.resi||"icn3d-nalign"===p?c[e].resn.toLowerCase():c[e].resn,v.aligned=y,v.color=""===v.resi?i.htmlCls.GREYC:t,v.color2=""===v.resi?i.htmlCls.GREYC:o,v.class=p,s.alnChainsSeq[d].push(v),""!==c[e].resi&&(void 0===s.alnChains[d]&&(s.alnChains[d]={}),$.extend(s.alnChains[d],s.residues[d+"_"+c[e].resi])),void 0===s.alnChainsSeq[f]&&(s.alnChainsSeq[f]=[]),v={},v.mmdbid=l,v.chain=g,v.resi=m,v.resn=""===v.resi||"icn3d-nalign"===p?u.toLowerCase():u,v.aligned=y,v.color=""===v.resi?i.htmlCls.GREYC:t,v.color2=""===v.resi?i.htmlCls.GREYC:o,v.class=p,s.alnChainsSeq[f].push(v),""!==v.resi&&(void 0===s.alnChains[f]&&(s.alnChains[f]={}),$.extend(s.alnChains[f],s.residues[f+"_"+m])),void 0===s.alnChainsAnno[d]&&(s.alnChainsAnno[d]=[]),void 0===s.alnChainsAnno[d][0]&&(s.alnChainsAnno[d][0]=[]),void 0===s.alnChainsAnno[d][1]&&(s.alnChainsAnno[d][1]=[]),void 0===s.alnChainsAnno[d][2]&&(s.alnChainsAnno[d][2]=[]),void 0===s.alnChainsAnno[d][3]&&(s.alnChainsAnno[d][3]=[]),e===h&&(void 0===s.alnChainsAnno[d][4]&&(s.alnChainsAnno[d][4]=[]),void 0===s.alnChainsAnno[d][5]&&(s.alnChainsAnno[d][5]=[]),void 0===s.alnChainsAnno[d][6]&&(s.alnChainsAnno[d][6]=[]),s.alnChainsAnno[d][4].push(s.pdbid_chain2title[f]),s.alnChainsAnno[d][5].push(s.pdbid_chain2title[d]),s.alnChainsAnno[d][6].push(""));let _=d+"_"+c[e].resi,w=f+"_"+m,S=s.secondaries[_],A=s.secondaries[w];A?s.alnChainsAnno[d][0].push(A):s.alnChainsAnno[d][0].push("-"),S?s.alnChainsAnno[d][1].push(S):s.alnChainsAnno[d][1].push("-");let x=".";b%5==0&&(x="*"),b%10==0&&(x="|"),s.alnChainsAnno[d][2].push(x);let k="";b%10==0&&(k=b.toString()),s.alnChainsAnno[d][3].push(k),++b}}e={}}getPosFromResi(e,t){let s=this.icn3d;s.icn3dui;let i,n=s.resid2ncbi[e+"_"+t];if(n){i=n.substr(n.lastIndexOf("_")+1)-1}return i}getResnFromResi(e,t){let s=this.icn3d;s.icn3dui;let i=e+"_"+t,n=s.residueId2Name[i];return n||(n="?"),n}getResiAferAlign(e,t,s){let i,n=this.icn3d,l=n.icn3dui;if(t&&"tmalign"==l.cfg.aligntool)i=s;else if(n.posid2resid){let t=n.posid2resid[e+"_"+s];i=t.substr(t.lastIndexOf("_")+1)}else i=n.chainsSeq[e][s].resi;return i}setSeqAlignChain(e,t,s){let i,n,l,r,o,a,d,c,h,p,m,u=this.icn3d,g=u.icn3dui,f={},b=!!s;if(b){if(o=s[1],a=s[0],t=s[2],d=o.indexOf("_"),c=a.indexOf("_"),i=o.substr(0,d).toUpperCase(),n=a.substr(0,c).toUpperCase(),l=o.substr(d+1),r=a.substr(d+1),i==n&&l==r){let e=u.chainsSeq[n+"_"+r].length;u.qt_start_end[t]={q_start:1,q_end:e,t_start:1,t_end:e}}}else{let d=s[0].indexOf("_"),c=e.indexOf("_");if(i=u.mmdbid_t,n=e.substr(0,c).toUpperCase(),l=s[0].substr(d+1),r=e.substr(c+1),i==n&&l==r){let e=u.chainsSeq[u.mmdbid_q+"_"+u.chain_q].length;u.qt_start_end[t]={q_start:1,q_end:e,t_start:1,t_end:e}}o=i+"_"+l,a=n+"_"+r,void 0!==n&&u.mmdbid_t}u.conservedName1=o+"_cons",u.nonConservedName1=o+"_ncons",u.notAlignedName1=o+"_nalign",u.conservedName2=a+"_cons",u.nonConservedName2=a+"_ncons",u.notAlignedName2=a+"_nalign",u.consHash1={},u.nconsHash1={},u.nalignHash1={},u.consHash2={},u.nconsHash2={},u.nalignHash2={},u.alnChains={},u.alnChainsSeq[o]=[],u.alnChains[o]={},u.alnChainsSeq[a]=[],u.alnChains[a]={},u.alnChainsAnno[o]=[],u.alnChainsAnTtl[o]=[],void 0===u.alnChainsAnTtl[o]&&(u.alnChainsAnTtl[o]=[]);for(let e=0;e<7;++e)void 0===u.alnChainsAnTtl[o][e]&&(u.alnChainsAnTtl[o][e]=[]);u.alnChainsAnTtl[o][0].push(a),u.alnChainsAnTtl[o][1].push(o),u.alnChainsAnTtl[o][2].push(""),u.alnChainsAnTtl[o][3].push(""),u.alnChainsAnTtl[o][4].push(a),u.alnChainsAnTtl[o][5].push(o),u.alnChainsAnTtl[o][6].push("");let C=0,y=0;if(void 0===u.qt_start_end[t])return;let v=1;u.chainsMapping[o]||(u.chainsMapping[o]={}),u.chainsMapping[a]||(u.chainsMapping[a]={});let _={},w={};for(let e=0,s=u.qt_start_end[t].length;e0){let e=v;for(let t=C+1,i=s;tc&&(c=t)}}}"tmalign"==n.cfg.aligntool&&(s=!0);let p=Object.keys(a);p.sort((function(e,t){return parseInt(e)-parseInt(t)}));let m=-999,u=0,g=0,f=[],b=0;for(let e=0,t=p.length;en)for(let e=0,t=d-a;e0?void 0!==n?p.alnChainsAnno[t][0].push(n):p.alnChainsAnno[t][0].push("-"):console.log("Error: ic.alnChainsAnno[chainid1] is undefined")}}}class ls{constructor(e){this.icn3d=e}getStructureId(e,t,s){let i=this.icn3d;i.icn3dui;let n=e;return(e==i.defaultPdbId||s||i.structures.hasOwnProperty(e))&&(n=1===t?e:e+t.toString()),n}loadPDB(e,t,s,i,n,l,r,o){let a,d,c=this.icn3d,h=c.icn3dui,p={},m=!1,u=e.split("\n"),g={},f={};c.atoms||(l=!1),n||l?(c.oriNStru=c.structures?Object.keys(c.structures).length:0,d=c.oriNStru+1,a=c.atoms?Object.keys(c.atoms).length:0):(c.init(),d=1,a=0);let b,C,y,v,_,w,S,A=[],x=[],k=[],O=[],R=[],I=[],T="",E="",P="",M={},D=t||c.defaultPdbId,H=D,F="",L=!1,N=!0;for(let e in u){let r=u[e],q=r.substr(0,6);if("HEADER"!==q||L||t)if("TITLE "===q){let e=r.substr(10).replace(/ALPHAFOLD MONOMER V2.0 PREDICTION FOR /gi,"");c.molTitle+=e.trim()+" ",o&&c.esmTitle&&(c.molTitle=c.esmTitle),c.molTitleHash||(c.molTitleHash={}),c.molTitleHash[H]=c.molTitle}else if("HELIX "===q){c.bSecondaryStructure=!0;let e=""==r.substr(18,2).trim()?"A":r.substr(18,2).trim(),t=parseInt(r.substr(21,4)),s=parseInt(r.substr(33,4));for(let i=t;i<=s;++i){let n=H+"_"+e+"_"+i;O.push(n),i===t&&R.push(n),i===s&&I.push(n)}}else if("SHEET "===q){void 0!==s&&s||(c.bSecondaryStructure=!0);let e=""==r.substr(20,2).trim()?"A":r.substr(20,2).trim(),t=parseInt(r.substr(22,4)),i=parseInt(r.substr(33,4));for(let s=t;s<=i;++s){let n=H+"_"+e+"_"+s;A.push(n),s===t&&x.push(n),s===i&&k.push(n)}}else if("HBOND "===q)void 0!==s&&s||(c.bSecondaryStructure=!0);else if("SSBOND"===q){c.bSsbondProvided=!0;let e=D+"_"+(" "==r.substr(15,1)?"A":r.substr(15,1))+"_"+r.substr(17,4).trim(),t=D+"_"+(" "==r.substr(29,1)?"A":r.substr(29,1))+"_"+r.substr(31,4).trim();void 0===c.ssbondpnts[D]&&(c.ssbondpnts[D]=[]),c.ssbondpnts[D].push(e),c.ssbondpnts[D].push(t)}else if("REMARK"===q){let e=parseInt(r.substr(7,3));if(-1!==r.indexOf("1/2 of bilayer thickness:"))c.halfBilayerSize=parseFloat(r.substr(r.indexOf(":")+1).trim());else if(210==e)"EXPERIMENT TYPE"==r.substr(11,32).trim()&&"NMR"==r.substr(45).trim()&&(m=!0);else if(350==e&&"BIOMT"==r.substr(13,5)){let e=parseInt(r[18])-1,t=parseInt(r.substr(21,2))-1;null==c.biomtMatrices[t]&&(c.biomtMatrices[t]=(new THREE.Matrix4).identity()),c.biomtMatrices[t].elements[e]=parseFloat(r.substr(24,9)),c.biomtMatrices[t].elements[e+4]=parseFloat(r.substr(34,9)),c.biomtMatrices[t].elements[e+8]=parseFloat(r.substr(44,9)),c.biomtMatrices[t].elements[e+12]=parseFloat(r.substr(54,14))}else if(465==e&&" "==r.substr(18,1)&&" "==r.substr(20,1)&&"S"!=r.substr(21,1)){let e=r.substr(15,3),t=r.substr(18,2).trim(),s=r.substr(21,5).trim(),i=D+"_"+t;void 0===c.chainMissingResidueArray[i]&&(c.chainMissingResidueArray[i]=[]);let n={};n.resi=s,n.name=h.utilsCls.residueName2Abbr(e).toLowerCase(),""!=F&&t==F&&t!=F||(c.chainMissingResidueArray[i].push(n),F=t)}else 900==e&&void 0===c.emd&&"RELATED DB: EMDB"==r.substr(34).trim()&&(c.emd=r.substr(23,11).trim())}else if("SOURCE"===q&&void 0===c.organism&&"ORGANISM_COMMON"==r.substr(11,15).trim())c.organism=r.substr(28).toLowerCase().trim(),c.organism=c.organism.substr(0,c.organism.length-1);else if("ENDMDL"===q)++d,D=c.defaultPdbId,H=this.getStructureId(D,d,n),m||(A=[],x=[],k=[],O=[],R=[],I=[]),L=!1;else if("JRNL "===q)"PMID"===r.substr(12,4)&&(c.pmid=r.substr(19).trim());else if("ATOM "===q||"HETATM"===q){N&&(H=this.getStructureId(D,d,n),N=!1);let e=r.substr(16,1);++a,M[parseInt(r.substr(6,5))]=a;let t=r.substr(76,2).trim();""===t&&(t=r.substr(12,2).trim());let l=r.substr(12,4).trim(),u=r.substr(17,3),F=r.substr(20,2).trim();""===F&&(F="A");let L=r.substr(22,5).trim(),U=L;if(s&&"DUM"===u&&(t=l,F="MEM",U=1,L=1),i&&"DUM"===u)break;b=H+"_"+F,y=b+"_"+L,C=b+"_"+U;let $=parseFloat(r.substr(30,8)),j=parseFloat(r.substr(38,8)),B=parseFloat(r.substr(46,8)),z=new THREE.Vector3($,j,B),G=parseFloat(r.substr(60,8));o&&(G*=100);let V={het:"H"===q[0],serial:a,name:l,alt:e,resn:u,structure:H,chain:F,resi:U,coord:z,b:G,elem:t,bonds:[],ss:"coil",ssbegin:!1,ssend:!1};if(V.het||"C"!==V.name||(v=a),V.het||"O"!==V.name||(w=a),!V.het&&"N"===V.name&&void 0!==_&&void 0!==S){let e=c.atoms[_].coord.distanceTo(c.atoms[S].coord),t=V.coord.x+(c.atoms[_].coord.x-c.atoms[S].coord.x)/e,s=V.coord.y+(c.atoms[_].coord.y-c.atoms[S].coord.y)/e,i=V.coord.z+(c.atoms[_].coord.z-c.atoms[S].coord.z)/e;V.hcoord=new THREE.Vector3(t,s,i)}c.atoms[a]=V,c.dAtoms[a]=1,c.hAtoms[a]=1,p[a]=1,this.isSecondary(C,A,m)?(c.atoms[a].ss="sheet",this.isSecondary(C,x,m)&&(c.atoms[a].ssbegin=!0),this.isSecondary(C,k,m)&&(c.atoms[a].ssend=!0)):this.isSecondary(C,O,m)&&(c.atoms[a].ss="helix",this.isSecondary(C,R,m)&&(c.atoms[a].ssbegin=!0),this.isSecondary(C,I,m)&&(c.atoms[a].ssend=!0));let W="-";if(W="helix"===c.atoms[a].ss?"H":"sheet"===c.atoms[a].ss?"E":!c.atoms[a].het&&h.parasCls.residueColors.hasOwnProperty(c.atoms[a].resn.toUpperCase())?"c":"o",c.secondaries[C]=W,y!==P){let e=h.utilsCls.residueName2Abbr(u);if(c.residueId2Name[C]=e,1!==a&&""!==E&&(c.residues[E]=f),C!==E&&(f={}),b!==T){_=void 0,S=void 0,1!==a&&""!==T&&(void 0===c.chains[T]&&(c.chains[T]={}),c.chains[T]=h.hashUtilsCls.unionHash(c.chains[T],g)),g={},void 0===c.structures[H.toString()]&&(c.structures[H.toString()]=[]),c.structures[H.toString()].includes(b)||c.structures[H.toString()].push(b),void 0===c.chainsSeq[b]&&(c.chainsSeq[b]=[]);let t={};t.resi=U,t.name=e,c.chainsSeq[b].push(t)}else{_=v,S=w;let t={};t.resi=U,t.name=e,c.chainsSeq[b].push(t)}}g[a]=1,f[a]=1,T=b,E=C,P=y}else if("CONECT"===q){let e=parseInt(r.substr(6,5));for(let t=0;t<4;++t){let s=parseInt(r.substr([11,16,21,26][t],5));isNaN(s)||void 0!==c.atoms[M[e]]&&c.atoms[M[e]].bonds.push(M[s])}}else q.substr(0,3);else D=r.substr(62).trim(),""==D&&(D=l?c.defaultPdbId:c.inputid&&-1==c.inputid.indexOf("/")?c.inputid.substr(0,10):c.defaultPdbId),H=this.getStructureId(D,d,n),c.molTitle="",c.molTitleHash={},L=!0}c.residues[C]=f,void 0===c.chains[b]&&(c.chains[b]={}),c.chains[b]=h.hashUtilsCls.unionHash2Atoms(c.chains[b],g,c.atoms),this.adjustSeq(c.chainMissingResidueArray);let q=Object.keys(c.structures);for(let e=0,t=q.length;er&&i>r&&(h=!0),s<=r&&i>r?s>i||h?(o[c]=t[d],d++):(o[c]=e[a],a++):s>r&&i<=r?s<=i||h?(o[c]=e[a],a++):(o[c]=t[d],d++):s<=i?(o[c]=e[a],a++):(o[c]=t[d],d++),c++}if(a4||Math.abs(l.y-r.y)>4||Math.abs(l.z-r.z)>4||(l.x-r.x)*(l.x-r.x)+(l.y-r.y)*(l.y-r.y)+(l.z-r.z)*(l.z-r.z)<16&&(void 0===t.ssbondpnts[e]&&(t.ssbondpnts[e]=[]),t.ssbondpnts[e].push(o),t.ssbondpnts[e].push(a)))}}}getChainCalpha(e,t,s,i){let n=this.icn3d,l=n.icn3dui,r={};for(let o in e){if(void 0!==i){if(o.split("_")[0]!==i)continue}let a=Object.keys(e[o]),d=[],c=0,h=0;for(let e=0,i=a.length;e3?i.resn.trim().substr(0,3):i.resn.trim();if(!l.parasCls.chargeColors.hasOwnProperty(e))continue;s?i.resi_ori:i.resi,d.push(i.coord.clone()),++c,h=i.resi}}if(c>0){r[t[a[0]].chain]=d}}return{chainresiCalphaHash:r,center:n.center.clone()}}isSecondary(e,t,s){if(this.icn3d.icn3dui,s){let s=e.substr(e.indexOf("_")+1),i=!1;for(let e=0,n=t.length;ep[e]
"),l.cfg.bSidebyside||l.htmlCls.dialogCls.openDlg("dl_rmsd","Realignment RMSD"),n.q_rotation=[],n.q_trans_sub=[],n.t_trans_add=[],n.q_rotation.push({x1:e[0],y1:e[1],z1:e[2],x2:e[3],y2:e[4],z2:e[5],x3:e[6],y3:e[7],z3:e[8]}),n.q_trans_sub.push(i),n.t_trans_add.push({x:-r.x,y:-r.y,z:-r.z}),l.cfg.aligntool="vast";//!= 'tmalign';
+let c=0,h="query",p=o.substr(0,o.indexOf("_")),m=!0;n.chainalignParserCls.transformStructure(p,c,h,m);let u="";for(let e=0,i=s.length;e8)return s;let g=[];g[0]=n[0]*r[0]+n[1]*r[1]+n[2]*r[2],g[1]=n[3]*r[0]+n[4]*r[1]+n[5]*r[2],g[2]=n[6]*r[0]+n[7]*r[1]+n[8]*r[2],g[0]-=n[0]*a[0]+n[1]*a[1]+n[2]*a[2],g[1]-=n[3]*a[0]+n[4]*a[1]+n[5]*a[2],g[2]-=n[6]*a[0]+n[7]*a[1]+n[8]*a[2];let f=0;return f=c[0]*g[0],f+=c[1]*g[1],f+=c[2]*g[2],f/=p*m,f<.866?s:(g[0]=l[0]*r[0]+l[1]*r[1]+l[2]*r[2],g[1]=l[3]*r[0]+l[4]*r[1]+l[5]*r[2],g[2]=l[6]*r[0]+l[7]*r[1]+l[8]*r[2],g[0]-=l[0]*a[0]+l[1]*a[1]+l[2]*a[2],g[1]-=l[3]*a[0]+l[4]*a[1]+l[5]*a[2],g[2]-=l[6]*a[0]+l[7]*a[1]+l[8]*a[2],f=c[0]*g[0],f+=c[1]*g[1],f+=c[2]*g[2],f/=p*m,f<.866?s:(u=0,u+=Math.pow(e.q_rotation.x1-t.q_rotation.x1,2),u+=Math.pow(e.q_rotation.y1-t.q_rotation.y1,2),u+=Math.pow(e.q_rotation.z1-t.q_rotation.z1,2),u+=Math.pow(e.q_rotation.x2-t.q_rotation.x2,2),u+=Math.pow(e.q_rotation.y2-t.q_rotation.y2,2),u+=Math.pow(e.q_rotation.z2-t.q_rotation.z2,2),u+=Math.pow(e.q_rotation.x3-t.q_rotation.x3,2),u+=Math.pow(e.q_rotation.y3-t.q_rotation.y3,2),u+=Math.pow(e.q_rotation.z3-t.q_rotation.z3,2),Math.sqrt(u)))}GetRotMatrix(e,t,s){this.icn3d.icn3dui;let i=[];return i&&(i[0]=e.q_rotation.x1/t,i[1]=e.q_rotation.y1/t,i[2]=e.q_rotation.z1/t,i[3]=e.q_rotation.x2/t,i[4]=e.q_rotation.y2/t,i[5]=e.q_rotation.z2/t,i[6]=e.q_rotation.x3/t,i[7]=e.q_rotation.y3/t,i[8]=e.q_rotation.z3/t,2!=s?(i[9]=e.t_trans_add.x/t,i[10]=e.t_trans_add.y/t,i[11]=e.t_trans_add.z/t,i[12]=-e.q_trans_sub.x/t,i[13]=-e.q_trans_sub.y/t,i[14]=-e.q_trans_sub.z/t):(i[9]=-e.q_trans_add.x/t,i[10]=-e.q_trans_add.y/t,i[11]=-e.q_trans_add.z/t,i[12]=0,i[13]=0,i[14]=0)),i}cbu_dist(e,t,s){return e=5&&(e=l[4].substr(5)),l.length>=6&&(s=l[5].substr(6)),l.length>=7&&(n=l[6].substr(4)),$("#"+t.pre+"anno_custom")[0]&&($("#"+t.pre+"anno_custom")[0].checked=!0),$("[id^="+t.pre+"custom]").show(),"0"==s&&(s=void 0),t.addTrackCls.checkGiSeq(r,o,a,e,s,n,0)}else if(0==n.indexOf("remove one stabilizer")){let e=n.split(" | ")[1].split(" "),s=[];s.push(parseInt(e[0])),s.push(parseInt(e[1])),t.threeDPrintCls.removeOneStabilizer(s),t.drawCls.draw()}else if(0==n.indexOf("add one stabilizer")){let e=n.split(" | ")[1].split(" ");void 0===t.pairArray&&(t.pairArray=[]),t.pairArray.push(parseInt(e[0])),t.pairArray.push(parseInt(e[1])),t.drawCls.draw()}else if(0==n.indexOf("select planes z-axis")){let e=n.split(" ");if(5==e.length){let s=parseFloat(e[3]),i=parseFloat(e[4]);t.selectionCls.selectBtwPlanes(s,i)}}else if(0==n.indexOf("adjust membrane z-axis")){let e=n.split(" ");if(5==e.length){let s=parseFloat(e[3]),i=parseFloat(e[4]);t.selectionCls.adjustMembrane(s,i)}}else if(0==n.indexOf("toggle membrane"))t.selectionCls.toggleMembrane();else if(0==i.indexOf("calc buried surface")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(" ");if(2==s.length){let e=s[0].split(","),i=s[1].split(",");t.analysisCls.calcBuriedSurface(e,i)}}}else if(0==i.indexOf("dist ")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(" ");if(2==s.length){let e=s[0].split(","),i=s[1].split(",");t.analysisCls.measureDistTwoSets(e,i)}}}else if(0==i.indexOf("disttable")){let e=i.split(" | ");if(2==e.length){let i=e[1].split(" ");if(2==i.length){let e=i[0].split(","),n=i[1].split(",");t.analysisCls.measureDistManySets(e,n),s.htmlCls.dialogCls.openDlg("dl_disttable","Distance among the sets")}}}else if(0==i.indexOf("display interaction 3d")||0==i.indexOf("view interaction pairs")||0==i.indexOf("save1 interaction pairs")||0==i.indexOf("save2 interaction pairs")||0==i.indexOf("line graph interaction pairs")||0==i.indexOf("scatterplot interaction pairs")){let e=i.split(" | ");if(e.length>=3){let s=e[1].split(" ");if(2==s.length){let n,l,r=s[0].split(","),o=s[1].split(","),a=-1!==e[2].indexOf("hbonds"),d=-1!==e[2].indexOf("salt bridge"),c=-1!==e[2].indexOf("interactions"),h=-1!==e[2].indexOf("halogen"),p=-1!==e[2].indexOf("pi-cation"),m=-1!==e[2].indexOf("pi-stacking");if(e.length>=4&&(n="true"==e[3]),e.length>=5){let s=e[4].split(" ");s.length>=4&&($("#"+t.pre+"hbondthreshold").val(s[1]),$("#"+t.pre+"saltbridgethreshold").val(s[2]),$("#"+t.pre+"contactthreshold").val(s[3]),7==s.length&&($("#"+t.pre+"halogenthreshold").val(s[4]),$("#"+t.pre+"picationthreshold").val(s[5]),$("#"+t.pre+"pistackingthreshold").val(s[6])))}0==i.indexOf("display interaction 3d")?l="3d":0==i.indexOf("view interaction pairs")?l="view":0==i.indexOf("save1 interaction pairs")?l="save1":0==i.indexOf("save2 interaction pairs")?l="save2":0==i.indexOf("line graph interaction pairs")?l="linegraph":0==i.indexOf("scatterplot interaction pairs")&&(l="scatterplot"),await t.viewInterPairsCls.viewInteractionPairs(r,o,n,l,a,d,c,h,p,m)}}}else if(0==i.indexOf("export pairs")){let e=i.split(" | ");if(3==e.length){let i=e[1].split(" ");if(2==i.length){let n=i[0].split(","),l=i[1].split(","),r=e[2].split(" ")[1];t.showInterCls.pickCustomSphere(r,n,l,t.bSphereCalc),t.bSphereCalc=!0;let o=t.viewInterPairsCls.exportSpherePairs(),a=Object.keys(s.utilsCls.getHlStructures()).join(",");t.saveFileCls.saveFile(a+"_sphere_pairs.html","html",o)}}}else if(0==n.indexOf("graph label")){let e=n.lastIndexOf(" "),t=n.substr(e+1);$("#"+s.svgid+"_label").val(t),$("#"+s.svgid+" text").removeClass(),$("#"+s.svgid+" text").addClass(t)}else if(0==n.indexOf("cartoon label")){let e=n.lastIndexOf(" "),t=n.substr(e+1);$("#"+s.svgid_ct+"_label").val(t),$("#"+s.svgid_ct+" text").removeClass(),$("#"+s.svgid_ct+" text").addClass(t)}else if(0==n.indexOf("line graph scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.linegraphid+"_scale").val(i),$("#"+s.linegraphid).attr("width",(t.linegraphWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("scatterplot scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.scatterplotid+"_scale").val(i),$("#"+s.scatterplotid).attr("width",(t.scatterplotWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("contactmap scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.contactmapid+"_scale").val(i),$("#"+s.contactmapid).attr("width",(t.contactmapWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("alignerrormap scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.alignerrormapid+"_scale").val(i),$("#"+s.alignerrormapid).attr("width",(t.alignerrormapWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("graph force")){let e=n.lastIndexOf(" ");s.htmlCls.force=parseInt(n.substr(e+1)),$("#"+s.svgid+"_force").val(s.htmlCls.force),t.getGraphCls.handleForce()}else if(0==n.indexOf("hide edges")){let e=n.lastIndexOf(" ");s.htmlCls.hideedges=parseInt(n.substr(e+1)),$("#"+s.svgid+"_hideedges").val(s.htmlCls.hideedges),s.htmlCls.hideedges?(s.htmlCls.contactInsideColor="FFF",s.htmlCls.hbondInsideColor="FFF",s.htmlCls.ionicInsideColor="FFF"):(s.htmlCls.contactInsideColor="DDD",s.htmlCls.hbondInsideColor="AFA",s.htmlCls.ionicInsideColor="8FF"),void 0!==t.graphStr&&t.bRender&&s.htmlCls.force&&t.drawGraphCls.drawGraph(t.graphStr,t.pre+"dl_graph")}else if(0==n.indexOf("reset interaction pairs"))t.viewInterPairsCls.resetInteractionPairs();else if(0==n.indexOf("side by side")){let e=n.split(" | ")[1],t="_blank";window.open(e,t)}else if(0==i.indexOf("your note")){let e=i.split(" | ");t.yournote=e[1],$("#"+t.pre+"yournote").val(t.yournote),s.cfg.shownote&&(document.title=t.yournote)}else if(0==n.indexOf("cross structure interaction"))t.crossstrucinter=parseInt(n.substr(n.lastIndexOf(" ")+1)),$("#"+t.pre+"crossstrucinter").val(t.crossstrucinter);else if("replay on"==n)await t.resizeCanvasCls.replayon();else if("replay off"==n)await t.resizeCanvasCls.replayoff();else if(0==n.indexOf("contact map")){let e=n.split(" | ");if(3===e.length){let s=parseFloat(e[1].split(" ")[1]),i=e[2].split(" ")[1];await t.contactMapCls.contactMap(s,i)}}else if(0==n.indexOf("pickatom")){let e=parseInt(n.substr(n.lastIndexOf(" ")+1));t.pAtom=t.atoms[e],t.pickingCls.showPicking(t.pAtom)}else if(0==i.indexOf("set color spectrum")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!0;t.setColorCls.setColorAcrossSets(s,i)}}else if(0==i.indexOf("set residues color spectrum")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!0;t.setColorCls.setColorBySets(s,i)}}else if(0==i.indexOf("set color rainbow")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!1;t.setColorCls.setColorAcrossSets(s,i)}}else if(0==i.indexOf("set residues color rainbow")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!1;t.setColorCls.setColorBySets(s,i)}}else if(0==i.indexOf("color")){let e=i.split(" | "),n=e[0].substr(e[0].indexOf(" ")+1);if(t.opts.color=n,"residue custom"==n&&2==e.length){t.customResidueColors=JSON.parse(e[1]);for(let e in t.customResidueColors)t.customResidueColors[e.toUpperCase()]=s.parasCls.thr("#"+t.customResidueColors[e])}else if("align custom"==n&&3==e.length){let s=e[1],i=e[2].split(", ");t.queryresi2score={},t.queryresi2score[s]={};for(let e=0,n=i.length;e1&&"3"===x[t][0]&&isNaN(x[t][1])&&"-"!==x[t][0]){i=x[t].toUpperCase().substr(1),m=!0}else if(""===x[t]||isNaN(parseInt(x[t]))){if("*"===x[t])h=!0;else if("proteins"!==x[t]&&"nucleotides"!==x[t]&&"chemicals"!==x[t]&&"ions"!==x[t]&&"water"!==x[t]&&"anchors"!==x[t]&&"strands"!==x[t]&&"loops"!==x[t]){s=x[t].toUpperCase(),p=!0}}else v=x[t],_=v,n=!0;for(let a=0,u=S.length;a1?e.substr(0,l-1)===n.atoms[i].name.substr(0,l-1)&&(0===s?t[i]=1:t.hasOwnProperty(i)||delete t[i]):"*"!==e&&e!==n.atoms[i].name||(0===s?t[i]=1:t.hasOwnProperty(i)||delete t[i]),t}}class hs{constructor(e){this.icn3d=e}selectAll(){let e=this.icn3d;e.icn3dui,this.selectAll_base(),e.hlObjectsCls.removeHlObjects(),e.hlUpdateCls.removeHl2D(),e.hlUpdateCls.removeHlMenus(),e.bSelectResidue=!1,e.bSelectAlignResidue=!1,e.hlUpdateCls.removeSeqResidueBkgd(),e.hlUpdateCls.update2DdgmContent(),$("#"+e.pre+"dl_annotations > .icn3d-annotation").show(),e.definedSetsCls.setMode("all"),e.saveFileCls.showTitle()}selectAll_base(){let e=this.icn3d,t=e.icn3dui;e.hAtoms={},e.dAtoms={};for(let s in e.chains)e.hAtoms=t.hashUtilsCls.unionHash(e.hAtoms,e.chains[s]);e.dAtoms=t.hashUtilsCls.cloneHash(e.hAtoms),e.viewSelectionAtoms=t.hashUtilsCls.cloneHash(e.hAtoms),e.ALTERNATE_STRUCTURE=-1}selectAChain(e,t,s,i){let n=this.icn3d,l=n.icn3dui;t=t.replace(/\s/g,"");let r=void 0!==s||s?"select alignChain "+e:"select chain "+e;void 0!==i&&i?(n.hAtoms=l.hashUtilsCls.unionHash(n.hAtoms,n.chains[e]),void 0===n.nameArray&&(n.nameArray=[])):(n.hAtoms={},n.nameArray=[]),n.nameArray.push(e);let o,a=s?n.alnChainsSeq[e]:n.chainsSeq[e];o=void 0===a?0:a.length;let d={};for(let t=0,s=o;t0){if(void 0!==i&&i?void 0===r.nameArray&&(r.nameArray=[]):(r.hAtoms={},r.nameArray=[]),l)for(let t in e)r.hAtoms[t]=1;else for(let t in e)for(let e in r.residues[t])r.hAtoms[e]=1;let o,a;t=t.replace(/\s/g,""),r.nameArray.push(t),l?(o="select "+r.resid2specCls.atoms2spec(r.hAtoms),a=!1):(o="select "+r.resid2specCls.residueids2spec(Object.keys(e)),a=!0);let d=Object.keys(e);this.addCustomSelection(d,t,s,o,a),(void 0===n||n)&&r.hlUpdateCls.updateHlAll(r.nameArray,void 0,i)}}selectMainChains(){let e=this.icn3d,t=e.icn3dui.hashUtilsCls.cloneHash(e.hAtoms);e.hAtoms=e.applyDisplayCls.selectMainChainSubset(t),e.hlUpdateCls.showHighlight()}selectSideChains(){let e=this.icn3d,t=e.icn3dui,s=t.hashUtilsCls.cloneHash(e.hAtoms);e.hAtoms={};for(let i in s)(e.proteins.hasOwnProperty(i)&&"N"!==e.atoms[i].name&&"H"!==e.atoms[i].name&&"C"!==e.atoms[i].name&&"O"!==e.atoms[i].name&&("CA"!==e.atoms[i].name||"C"!==e.atoms[i].elem)&&"HA"!==e.atoms[i].name||e.nucleotides.hasOwnProperty(i)&&-1===t.parasCls.nuclMainArray.indexOf(e.atoms[i].name))&&(e.hAtoms[i]=1);e.hlUpdateCls.showHighlight()}selectMainSideChains(){let e=this.icn3d,t=e.icn3dui,s=e.firstAtomObjCls.getResiduesFromAtoms(e.hAtoms);e.hAtoms={};for(let i in s)e.hAtoms=t.hashUtilsCls.unionHash(e.hAtoms,e.residues[i]),e.dAtoms=t.hashUtilsCls.unionHash(e.dAtoms,e.residues[i]);e.drawCls.draw(),e.hlUpdateCls.showHighlight()}clickShow_selected(){let e=this.icn3d,t=e.icn3dui,s=this;t.myEventCls.onIds(["#"+e.pre+"show_selected","#"+e.pre+"mn2_show_selected"],"click",(function(e){s.icn3d,s.showSelection(),t.htmlCls.clickMenuCls.setLogCmd("show selection",!0)}))}clickHide_selected(){let e=this.icn3d,t=e.icn3dui,s=this;t.myEventCls.onIds("#"+e.pre+"mn2_hide_selected","click",(function(e){s.icn3d,s.hideSelection(),t.htmlCls.clickMenuCls.setLogCmd("hide selection",!0)}))}getGraphDataForDisplayed(){let e=this.icn3d;e.icn3dui;let t=JSON.parse(e.graphStr),s=e.firstAtomObjCls.getResiduesFromAtoms(e.dAtoms),i=[],n=[],l={};for(let e=0,n=t.nodes.length;et&&(t=C[s].length,e=s);let s=Object.keys(p),i=Object.keys(m);for(let t=0,n=C[e].length;t
The following sequence alignment shows the residue mapping of the best aligned sets: "symOri" and "symPerm", which are also available in the menu "Analysis > Defined Sets".
',$("#"+e.pre+"symd_info").html(A),s.setSeqAlignForSymmetry(_,w,S);let x=!1,k=t.htmlCls.alignSeqCls.getAlignSequencesAnnotations(Object.keys(e.alnChains),void 0,void 0,x,S);A=$("#"+e.pre+"dl_sequence2").html()+k.sequencesHtml,$("#"+e.pre+"dl_sequence2").html(A),$("#"+e.pre+"dl_sequence2").width(t.htmlCls.RESIDUE_WIDTH*k.maxSeqCnt+200),t.htmlCls.dialogCls.openDlg("dl_alignment","Select residues in aligned sequences from SymD");let O=Object.keys(e.defNames2Residues).length+Object.keys(e.defNames2Atoms).length,R="symOri"+O;e.selectionCls.selectResidueList(y,R,R),e.selectionCls.updateSelectionNameDesc(),t.htmlCls.clickMenuCls.setLogCmd("select "+e.resid2specCls.residueids2spec(Object.keys(y))+" | name "+R,!1),R="symPerm"+O,e.selectionCls.selectResidueList(v,R,R),e.selectionCls.updateSelectionNameDesc(),t.htmlCls.clickMenuCls.setLogCmd("select "+e.resid2specCls.residueids2spec(Object.keys(v))+" | name "+R,!1),R="symBoth"+O,y=t.hashUtilsCls.unionHash(y,v),e.selectionCls.selectResidueList(y,R,R),e.selectionCls.updateSelectionNameDesc(),t.htmlCls.clickMenuCls.setLogCmd("select "+e.resid2specCls.residueids2spec(Object.keys(y))+" | name "+R,!1)}}else $("#"+e.pre+"dl_symd").html("
The selected residues have no detected symmetry with a Z score of "+a.zscore+" from the program SymD."),t.htmlCls.dialogCls.openDlg("dl_symd","Dynamically Calculated Symmetry Using SymD");e.symdtitle="none"===h?void 0:h,e.drawCls.draw()}catch(s){return $("#"+e.pre+"dl_symd").html("
The web service can not determine the symmetry of the input set."),t.htmlCls.dialogCls.openDlg("dl_symd","Dynamically Calculated Symmetry Using SymD"),void e.ParserUtilsCls.hideLoading()}}getResObj(e){this.icn3d.icn3dui;let t=e.substr(0,e.indexOf(" ")),s=e.indexOf("$"),i=e.indexOf("."),n=e.indexOf(":"),l=e.substr(s+1,i-s-1),r=e.substr(i+1,n-i-1),o=e.substr(n+1);return{resn:t,resid:l+"_"+r+"_"+o,resi:o,aligned:!0}}setSeqAlignForSymmetry(e,t,s){let i=this.icn3d,n=i.icn3dui;i.conservedName1="symOri_cons",i.conservedName2="symPerm_cons",i.consHash1={},i.consHash2={},i.alnChainsAnTtl={},i.alnChainsAnno={},i.alnChainsSeq={},i.alnChains={},i.alnChainsSeq={};let l={};for(let r=0,o=e.length;r
This structure has no symmetry.");i.htmlCls.dialogCls.openDlg("dl_symmetry","Symmetry")}getPolygonColor(e){let t=this.icn3d.icn3dui,s=e.substr(0,1);return"C"==s?t.parasCls.thr(16747520):"D"==s?t.parasCls.thr(65535):"T"==s?t.parasCls.thr(15631086):"O"==s?t.parasCls.thr(16753920):"I"==s?t.parasCls.thr(65280):t.parasCls.thr(11119017)}getAxisColor(e,t){let s=this.icn3d.icn3dui,i=e.substr(0,1);return"C"==i?s.parasCls.thr(16711680):"D"==i?2==t?s.parasCls.thr(65535):s.parasCls.thr(16711680):"T"==i?2==t?s.parasCls.thr(65535):s.parasCls.thr(65280):"O"==i||"I"==i?2==t?s.parasCls.thr(65535):3==t?s.parasCls.thr(65280):s.parasCls.thr(16711680):s.parasCls.thr(16711680)}}class Cs{constructor(e){this.icn3d=e}alignSW(e,t,s,i,n,l,r){this.icn3d.icn3dui;let o=this.bsa_align(r,e,t,[s,i],[n,l]),a="score: "+o[0]+"\n";a+="start: "+o[1]+"\n",a+="cigar: "+this.bsa_cigar2str(o[2])+"\n\n",a+="alignment:\n\n";let d=this.bsa_cigar2gaps(e,t,o[1],o[2]),c={};return c.score=o[0],c.start=o[1],c.cigar=this.bsa_cigar2str(o[2]),c.target=d[0],c.query=d[1],c}bsg_enc_seq(e,t){if(this.icn3d.icn3dui,null==t)return null;let s=[];s.length=e.length;for(let i=0;i
Calculate solvent accessible surface area in the interface:
";C+="Set 1: "+e+", Surface: "+o+" Å2
",C+="Set 2: "+t+", Surface: "+d+" Å2
",C+="Total Surface: "+h+" Å2
",C+="Buried Surface for Set 1: "+u+" Å2
",C+="Buried Surface for Set 2: "+m+" Å2
",$("#"+s.pre+"dl_buriedarea_html").html(C),i.htmlCls.dialogCls.openDlg("dl_buriedarea","Buried solvent accessible surface area in the interface"),i.htmlCls.clickMenuCls.setLogCmd("buried surface "+b,!1)}}measureDistTwoSets(e,t){var s=this.icn3d,i=s.icn3dui;if(0==e.length||0==t.length)alert("Please select two sets");else{let n=i.hashUtilsCls.cloneHash(s.hAtoms),l=s.definedSetsCls.getAtomsFromNameArray(e),r=s.definedSetsCls.getAtomsFromNameArray(t),o=s.contactCls.getExtent(l),a=s.contactCls.getExtent(r),d=new THREE.Vector3(o[2][0],o[2][1],o[2][2]),c=new THREE.Vector3(a[2][0],a[2][1],a[2][2]);s.hAtoms=i.hashUtilsCls.cloneHash(n),void 0===s.distPnts&&(s.distPnts=[]),s.distPnts.push(d),s.distPnts.push(c);let h=$("#"+s.pre+"distancecolor2").val();this.addLine(d.x,d.y,d.z,c.x,c.y,c.z,h,!0,"distance");let p=0,m=0,u=d.clone().add(c).multiplyScalar(.5),g=(parseInt(10*d.distanceTo(c))/10).toString()+" A";this.addLabel(g,u.x,u.y,u.z,p,h,m,"distance"),s.drawCls.draw()}}measureDistManySets(e,t){var s=this.icn3d,i=s.icn3dui;if(0==e.length||0==t.length)alert("Please select sets for distance calculation...");else{let n=i.hashUtilsCls.cloneHash(s.hAtoms),l={};for(let i=0,n=e.length;i ";for(let s=0,i=e.length;s";for(let e=0,s=t.length;e "+t[e]+" (Å)"}r+=""+i+" (Å) ";for(let e=0,s=t.length;e'+l[i][s]+"":r+="0 "}r+=""}r+="
",$("#"+i.pre+"dl_disttable_html").html(r)}}addLine(e,t,s,i,n,l,r,o,a,d,c){var h=this.icn3d;h.icn3dui;let p={};p.position1=new THREE.Vector3(e,t,s),p.position2=new THREE.Vector3(i,n,l),p.color=r,p.dashed=o,p.radius=d,p.opacity=c,void 0===h.lines[a]&&(h.lines[a]=[]),void 0!==a?h.lines[a].push(p):(void 0===h.lines.custom&&(h.lines.custom=[]),h.lines.custom.push(p)),h.hlObjectsCls.removeHlObjects()}addLineFromPicking(e){var t=this.icn3d,s=t.icn3dui;let i=$("#"+t.pre+e+"color").val();t.pAtom.coord.x,t.pAtom2.coord.x,t.pAtom.coord.y,t.pAtom2.coord.y,t.pAtom.coord.z,t.pAtom2.coord.z;let n="stabilizer"!=e;s.htmlCls.clickMenuCls.setLogCmd("add line | x1 "+t.pAtom.coord.x.toPrecision(4)+" y1 "+t.pAtom.coord.y.toPrecision(4)+" z1 "+t.pAtom.coord.z.toPrecision(4)+" | x2 "+t.pAtom2.coord.x.toPrecision(4)+" y2 "+t.pAtom2.coord.y.toPrecision(4)+" z2 "+t.pAtom2.coord.z.toPrecision(4)+" | color "+i+" | dashed "+n+" | type "+e,!0),this.addLine(t.pAtom.coord.x,t.pAtom.coord.y,t.pAtom.coord.z,t.pAtom2.coord.x,t.pAtom2.coord.y,t.pAtom2.coord.z,i,n,e),t.pickpair=!1}addLabel(e,t,s,i,n,l,r,o){var a=this.icn3d;a.icn3dui;let d={};"0"!==n&&""!==n&&"undefined"!==n||(n=void 0),"0"!==l&&""!==l&&"undefined"!==l||(l=void 0),"0"!==r&&""!==r&&"undefined"!==r||(r=void 0);let c=new THREE.Vector3;c.x=t,c.y=s,c.z=i,d.position=c,d.text=e,d.size=n,d.color=l,d.background=r,void 0===a.labels[o]&&(a.labels[o]=[]),void 0!==o?a.labels[o].push(d):(void 0===a.labels.custom&&(a.labels.custom=[]),a.labels.custom.push(d)),a.hlObjectsCls.removeHlObjects()}addChainLabels(e){var t=this.icn3d;let s=t.icn3dui.hashUtilsCls.intHash(t.hAtoms,e);void 0===t.labels.chain&&(t.labels.chain=[]);let i=t.firstAtomObjCls.getChainsFromAtoms(s);for(let e in i){let s={};s.position=t.applyCenterCls.centerAtoms(t.chains[e]).center;let i=e.indexOf("_"),n=e.substr(i+1),l=t.showSeqCls.getProteinName(e);l.length>20&&(l=l.substr(0,20)+"..."),s.text="Chain "+n+": "+l,s.size=18,t.firstAtomObjCls.getFirstCalphaAtomObj(t.chains[e]).color.getHexString().toUpperCase(),s.color="black"!=t.opts.background?t.colorWhitebkgd:t.colorBlackbkgd,s.background="#FFFFFF",t.labels.chain.push(s)}t.hlObjectsCls.removeHlObjects()}addTerminiLabels(e){var t=this.icn3d,s=t.icn3dui;let i,n="#FFFFFF";i=s.hashUtilsCls.unionHash(i,t.proteins),i=s.hashUtilsCls.unionHash(i,t.nucleotides);let l=s.hashUtilsCls.intHash(t.dAtoms,i),r=s.hashUtilsCls.intHash(l,e);void 0===t.labels.chain&&(t.labels.chain=[]);let o=t.firstAtomObjCls.getChainsFromAtoms(r);for(let e in o){let i=s.hashUtilsCls.intHash(l,t.chains[e]),r=Object.keys(i),o=t.atoms[r[0]],a=t.atoms[r[r.length-1]],d={},c={};d.position=o.coord,c.position=a.coord,d.text="N-",c.text="C-",t.nucleotides.hasOwnProperty(o.serial)&&(d.text="5'",c.text="3'"),d.size=18,c.size=18,o.color.getHexString().toUpperCase(),a.color.getHexString().toUpperCase(),d.color="black"!=t.opts.background?t.colorWhitebkgd:t.colorBlackbkgd,c.color="black"!=t.opts.background?t.colorWhitebkgd:t.colorBlackbkgd,d.background=n,c.background=n,t.labels.chain.push(d),t.labels.chain.push(c)}t.hlObjectsCls.removeHlObjects()}}class vs{constructor(e){this.icn3d=e}draw2Ddgm(e,t,s,i){let n=this.icn3d,l=n.icn3dui,r=.667,o={},a={},d={},c={},h={};if(void 0===e)return"";for(let s in e.moleculeInfor){let i="#"+("000000"+e.moleculeInfor[s].color.toString(16)).slice(-6),l=e.moleculeInfor[s].chain.trim();void 0===h[l]?h[l]=1:++h[l];let r=t+"_"+(1===h[l]?l:l+h[l].toString());void 0!==n.mmdbid_q&&(n.mmdbid_q,n.mmdbid_t),o[s]=r,a[s]=i,d[s]=e.moleculeInfor[s].name,c[r]=s}if(void 0===i||!i)for(let s=0,i=e.intracResidues.length;s";p+=""+t.toUpperCase()+"
",p+="",p+="",n.html2ddgm+=p,$("#"+n.pre+"dl_2ddgm_html").html(n.html2ddgm),p}set2DdgmNote(e){let t="
";return this.icn3d.icn3dui.utilsCls.isMac()?(t+="◯Protein
",t+="▢Nucleotide
",t+="♢Chemical
",t+="▢Biopolymer
"):(t+="OProtein
",t+="▢Nucleotide
",t+="◇Chemical
",t+="▢Biopolymer
"),t+="
Lines:
Interactions at 4 Å
",e&&(t+="Numbers in red:
Aligned chains"),t+="
",t}highlightNode(e,t,s,i){let n=this.icn3d.icn3dui;i<.2&&(i=.2);if("rect"===e){$(t).attr("stroke",n.htmlCls.ORANGE),$(t).attr("stroke-width",3);let e=Number($(s).attr("x")),l=Number($(s).attr("y")),r=Number($(s).attr("width")),o=Number($(s).attr("height"));$(t).attr("x",e+r/2*(1-i)),$(t).attr("y",l+o/2*(1-i)),$(t).attr("width",r*i),$(t).attr("height",o*i)}else if("circle"===e)$(t).attr("stroke",n.htmlCls.ORANGE),$(t).attr("stroke-width",3),$(t).attr("r",Number($(s).attr("r"))*i);else if("polygon"===e){$(t).attr("stroke",n.htmlCls.ORANGE),$(t).attr("stroke-width",3);let e=Number($(s).attr("x")),l=Number($(s).attr("y")),r=Number($(s).attr("x0d")),o=Number($(s).attr("y0d")),a=Number($(s).attr("x1d")),d=Number($(s).attr("y1d")),c=Number($(s).attr("x2d")),h=Number($(s).attr("y2d")),p=Number($(s).attr("x3d")),m=Number($(s).attr("y3d"));$(t).attr("points",(e+r*i).toString()+", "+(l+o*i).toString()+", "+(e+a*i).toString()+", "+(l+d*i).toString()+", "+(e+c*i).toString()+", "+(l+h*i).toString()+", "+(e+p*i).toString()+", "+(l+m*i).toString())}}removeLineGraphSelection(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"dl_linegraph circle").attr("stroke","#000000"),$("#"+e.pre+"dl_linegraph circle").attr("stroke-width",1),$("#"+e.pre+"dl_linegraph svg line.icn3d-hlline").attr("stroke","#FFF")}removeScatterplotSelection(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"dl_scatterplot circle").attr("stroke","#000000"),$("#"+e.pre+"dl_scatterplot circle").attr("stroke-width",1),$("#"+e.pre+"dl_scatterplot rect").attr("stroke","#000000"),$("#"+e.pre+"dl_scatterplot rect").attr("stroke-width",1)}click2Ddgm(){let e=this.icn3d,t=e.icn3dui,s=this;$(document).on("click","#"+e.pre+"dl_2ddgm .icn3d-node",(function(e){let i=s.icn3d;e.stopImmediatePropagation(),Object.keys(i.hAtoms).length";return u+="n&&(n=C),ya&&(a=y);let v=.5;m=v*o.htmlCls.width2d*m/(t[1][0]-t[0][0]),u=v*o.htmlCls.width2d*u/(t[1][1]-t[0][1]),m>h&&(h=m),u>h&&(h=u),p.push({id:d,r:l,x:C,y:y,rx:m,ry:u,ang:g,c:b.color.getHexString()})}let m=h+2,u=n-s,g=a-i;for(let e=0,t=p.length;e0&&m==S.chain&&c.push('{"source": "'+u+'", "target": "'+n+'", "v": '+p+', "c": "'+t.color.getHexString().toUpperCase()+'"}'),A.push({id:n,r:l,ss:C,x:s,y:i,x1:d,y1:g,x2:k,y2:O,c:S.color.getHexString()}),m=S.chain,u=n,++h}}}let x=S+2,k=_-y,O=w-v;for(let e=0,t=A.length;e4e3||0!==s.indexOf("http")||l.bInputfile&&!l.bInputUrlfile?$("#"+l.pre+"viewer").html(""):$("#"+l.pre+"viewer").html("
"),$("#"+l.pre+"viewer").width(i),$("#"+l.pre+"viewer").height(n),$("#"+l.pre+"cmdlog").hide(),$("#"+l.pre+"title").hide(),$("#"+l.pre+"mnlist").hide(),$("#"+l.pre+"fullscreen").length>0&&$("#"+l.pre+"fullscreen").hide(),l={}}else saveAs(e,t)}saveSvg(e,t,s){if(this.icn3d.icn3dui.bNode)return"";let i=$("#"+e).width(),n=$("#"+e).height();s&&(n=i);let l=this.getSvgXml(e,i,n,s),r=new Blob([l],{type:"image/svg+xml"});saveAs(r,t)}getSvgXml(e,t,s,i){if(this.icn3d.icn3dui.bNode)return"";return(t&&s?'"}savePng(e,t,s){let i=this.icn3d,n=i.icn3dui;if(n.bNode)return"";let l=$("#"+e).width(),r=$("#"+e).height();s&&(r=l);let o=document.getElementById(e),a=o.getBBox(),d=o.cloneNode(!0);i.lineGraphCls.copyStylesInline(d,o);let c=document.createElement("CANVAS");c.width=l,c.height=r;let h=c.getContext("2d");h.clearRect(0,0,a.width,a.height);let p=this.getSvgXml(e,l,r,s),m=window.URL||window.webkitURL||window,u=new Blob([p],{type:"image/svg+xml;charset=utf-8"}),g=new Image;g.src=m.createObjectURL(u),g.onload=function(){if(h.drawImage(g,0,0),m.revokeObjectURL(this.src),n.utilsCls.isIE()){let e=c.msToBlob();e&&(saveAs(e,t),c.remove())}else c.toBlob((function(e){e&&(saveAs(e,t),c.remove())}))}}exportCustomAtoms(e){var t=this.icn3d;t.icn3dui;let s="",i=void 0!==t.defNames2Residues?Object.keys(t.defNames2Residues).sort():[];for(let n=0,l=i.length;n
20&&(e=e.substr(0,17)+"..."),l="Query: "+e+"; target: "+s,$("#"+i.pre+"title").html(l+", "+t)}else $("#"+i.pre+"title").html(r+" "+l+": "+t);else $("#"+i.pre+"title").html(t)}getLinkToStructureSummary(e){var t=this.icn3d,s=t.icn3dui;let i="https://www.ncbi.nlm.nih.gov/structure/?term=";if(i=void 0!==s.cfg.cid?"https://www.ncbi.nlm.nih.gov/pccompound/?term=":void 0!==s.cfg.refseqid?"https://www.ncbi.nlm.nih.gov/protein/":void 0!==s.cfg.afid?"https://alphafold.ebi.ac.uk/search/text/":Object.keys(t.structures).length>1?"https://www.ncbi.nlm.nih.gov/structure/?term=":s.htmlCls.baseUrl+"pdb/",void 0===t.inputid)i="https://www.ncbi.nlm.nih.gov/pccompound/?term="+t.molTitle;else{let n=t.inputid.split("_");1===n.length?(i+=t.inputid,e&&s.htmlCls.clickMenuCls.setLogCmd("link to "+t.inputid+": "+i,!1)):2===n.length&&(s.cfg.afid?i+=n[0]+" "+n[1]:i+=n[0]+" OR "+n[1],e&&s.htmlCls.clickMenuCls.setLogCmd("link to structures "+n[0]+" and "+n[1]+": "+i,!1))}return i}setEntrezLinks(e){var t=this.icn3d,s=t.icn3dui;let i,n=Object.keys(t.structures);if(1===n.length){i="https://www.ncbi.nlm.nih.gov/"+e+"/?term="+n[0],s.htmlCls.clickMenuCls.setLogCmd("Entrez "+e+" about PDB "+n[0]+": "+i,!1);let l=t.structures&&Object.keys(t.structures).length>0?"_blank":"_self";window.open(i,l)}else if(2===n.length){i="https://www.ncbi.nlm.nih.gov/"+e+"/?term="+n[0]+" OR "+n[1],s.htmlCls.clickMenuCls.setLogCmd("Entrez "+e+" about PDB "+n[0]+" OR "+n[1]+": "+i,!1);let l=t.structures&&Object.keys(t.structures).length>0?"_blank":"_self";window.open(i,l)}}}class xs{constructor(e){this.icn3d=e}async shareLink(e,t){let s=this.icn3d,i=s.icn3dui,n=this.shareLinkUrl(),l=n.length>4e3||0!==n.indexOf("http"),r=Object.keys(s.structures).join("_");if(r==s.defaultPdbId&&(s.filename?r=s.filename:s.inputid&&(r=s.inputid)),e){if(t||s.bInputfile||l)return void s.saveFileCls.saveFile(r+"_icn3d_loadable.png","png")}else{if(s.bInputfile&&!s.bInputUrlfile)return void alert("Share Link does NOT work when the data are from custom files. Please save 'iCn3D PNG Image' in the File menu and open it in iCn3D.");if(l)return void alert("The url is more than 4000 characters and may not work. Please save 'iCn3D PNG Image' or 'State File' and open them in iCn3D.");i.htmlCls.clickMenuCls.setLogCmd("share link: "+n,!1)}let o="Problem in getting shortened URL";if(!i.cfg.notebook){let t=await this.getShareLinkPrms(n,e);if(void 0!==t.shortLink&&(o=t.shortLink,e)){let e=o.split("/"),t=e[e.length-1];s.saveFileCls.saveFile(r+"-"+t+".png","png");let i='\n\n",s.saveFileCls.saveFile(r+"-"+t+".html","html",i)}e&&void 0===t.shortLink&&s.saveFileCls.saveFile(r+"_icn3d_loadable.png","png");let i=o.split("page.link/");2==i.length&&(o="https://structure.ncbi.nlm.nih.gov/icn3d/share.html?"+i[1]),$("#"+s.pre+"short_url").val(o),$("#"+s.pre+"short_url_title").val(o+"&t="+s.yournote)}let a=this.shareLinkUrl(void 0,!0),d="view = icn3dpy.view(q='"+(i.cfg.url?"url="+i.cfg.url:i.cfg.idname+"="+i.cfg.idvalue)+"',command='"+a+"')\nview";(i.cfg.url||i.cfg.idname)&&$("#"+s.pre+"jn_commands").val(d),$("#"+s.pre+"ori_url").val(n),e||i.htmlCls.dialogCls.openDlg("dl_copyurl","Copy a Share Link URL or Jupyter Notebook Commands")}getShareLinkPrms(e,t){let s=this.icn3d,i=s.icn3dui;return new Promise((function(n,l){$.ajax({url:"https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=AIzaSyBxl9CgM0dY5lagHL4UOhEpLWE1fuwdnvc",type:"POST",data:{longDynamicLink:"https://icn3d.page.link/?link="+encodeURIComponent(e)},dataType:"json",success:function(e){n(e)},error:function(n,l,r){let o="Problem in getting shortened URL";$("#"+s.pre+"ori_url").val(e),$("#"+s.pre+"short_url").val(o),$("#"+s.pre+"short_url_title").val(o+"&t="+s.yournote),t||i.htmlCls.dialogCls.openDlg("dl_copyurl","Copy a Share Link URL")}})}))}shareLinkUrl(e,t){let s=this.icn3d,i=s.icn3dui,n=i.htmlCls.baseUrl+"icn3d/?",l="";if(i.cfg.bSidebyside&&(n=i.htmlCls.baseUrl+"icn3d/full2.html?"),s.bInputUrlfile){n=window.location.href.split("?")[0]+"?"+s.inputurl+"&"}let r,o={};for(let e in s.cfg){let t=s.cfg[e];"inpara"!==e&&"command"!==e&&"usepdbnum"!==e&&"date"!==e&&"v"!==e&&void 0!==t&&("width"===e&&"100%"===t||"height"===e&&"100%"===t||"resize"===e&&!0===t||"showmenu"===e&&!0===t||"showtitle"===e&&!0===t||"showcommand"===e&&!0===t||"mobilemenu"===e&&!1===t||"showanno"===e&&!1===t||"showseq"===e&&!1===t||"showalignseq"===e&&!1===t||"show2d"===e&&!1===t||"showsets"===e&&!1===t||"rotate"===e&&"right"===t||"command"!==e&&("options"===e?Object.keys(t).length>0&&(o[e]=JSON.stringify(t)):!0===t?o[e]=1:!1===t?o[e]=0:""!==t&&(o[e]=t)))}s.bAfMem?o.afmem="on":(i.cfg.afid||1==Object.keys(s.structures).length&&Object.keys(s.structures)[0].length>5)&&(o.afmem="off");let a=-1;void 0!==i.cfg.inpara&&(a=i.cfg.inpara.indexOf("&command=")),r=-1!==a?i.cfg.inpara.substr(0,a):i.cfg.inpara;let d=!1;if(!s.bInputUrlfile){let e=r&&r.substr(1)?r.substr(1).split("&"):[];for(let t=0,s=e.length;tc){u=s.commands[c].split("|||")[0].split("&command=")[0].trim(),-1!==u.indexOf(g)&&++f}let b,C=c+1,y="";for(let e=s.commands.length;Ct.substr(0,s))return 1;if(e.substr(0,s)==t.substr(0,s)){if(parseInt(e.substr(s+1))
",void(l.areahtml=n)}let p,m,u,g=c.vertices,f=c.faces,b=r.parasCls.thr("#00FFFF"),C=r.parasCls.thr("#00FF00"),y=r.parasCls.thr("#ff0000"),v=r.parasCls.thr("#00FFFF"),_=r.parasCls.thr("#0000FF"),w=r.parasCls.thr("#FF0000");11!=t&&12!=t&&13!=t&&14!=t||void 0===l.rmsd_supr||void 0===l.rmsd_supr.rot||(p=l.rmsd_supr.rot,m=l.rmsd_supr.trans1,u=l.rmsd_supr.trans2);let S=(11==t||12==t||13==t||14==t&&"delphi"!=l.loadPhiFrom)&&void 0!==l.rmsd_supr&&void 0!==l.rmsd_supr.rot;n=new THREE.BufferGeometry;let A,x=[],k=[],O=[],R=0;for(let e=0,s=g.length;e ";for(let e=0,t=i.length;eStructure Chain Residue Number "+i[e].substr(0,t)+" "+i[e].substr(t+1,s-t-1)+" "+i[e].substr(s+1)+" "}let l=Object.keys(t.utilsCls.getHlStructures()).join(",");e.saveFileCls.saveFile(l+"_residues.txt","html",n)}addStabilizer(){let e=this.icn3d,t=e.icn3dui,s=3.5;if(Object.keys(e.dAtoms).length>0){let i,n={},l=12.25,r=3.2*3.2;for(let t in e.dAtoms){let s=e.atoms[t];!e.nucleotides.hasOwnProperty(s.serial)||"N1"!==s.name&&"N2"!==s.name&&"N3"!==s.name&&"N4"!==s.name&&"N6"!==s.name&&"O2"!==s.name&&"O6"!==s.name||(i=s.structure+"_"+s.chain+"_"+s.resi+"_"+s.name,n[i]=s)}let o=Object.keys(n),a=o.length;void 0===e.pairArray&&(e.pairArray=[]);for(let t=0;ts)continue;let h=Math.abs(n[a].coord.y-n[d].coord.y);if(h>s)continue;let p=Math.abs(n[a].coord.z-n[d].coord.z);if(p>s)continue;let m=c*c+h*h+p*p;m>l||m0&&(l+=","),l+=n[e].substr(0,n[e].indexOf("_"));s.chainidArray=[e].concat(n),s.chainidArray=s.chainalignParserCls.addPostfixForChainids(s.chainidArray),t.htmlCls.clickMenuCls.setLogCmd("resdef "+t.cfg.resdef,!0),s.loadCmd="vast_search_chainid "+s.chainidArray,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),s.bMmdbafid=!0;let r=!0;await s.chainalignParserCls.downloadMmdbAf(l,r)}}else if(void 0!==t.cfg.url){s.bInputUrlfile=!0;let e=t.cfg.url.split("|"),i=e[0],n=e[1];s.molTitle="",s.inputid=n,s.inputurl="type="+i+"&url="+encodeURIComponent(n),s.loadCmd="load url "+n+" | type "+i,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.pdbParserCls.downloadUrl(n,i,t.cfg.command)}else if(void 0!==t.cfg.mmtfid)s.inputid=t.cfg.mmtfid,s.loadCmd="load mmtf "+t.cfg.mmtfid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmtfParserCls.downloadMmtf(t.cfg.mmtfid);else if(void 0!==t.cfg.pdbid)s.inputid=t.cfg.pdbid,s.loadCmd="load pdb "+t.cfg.pdbid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.pdbParserCls.downloadPdb(t.cfg.pdbid);else if(void 0!==t.cfg.afid){s.inputid=t.cfg.afid,s.loadCmd="load af "+t.cfg.afid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0);let e=!0;await s.pdbParserCls.downloadPdb(t.cfg.afid,e)}else if(void 0!==t.cfg.opmid)s.inputid=t.cfg.opmid,s.loadCmd="load opm "+t.cfg.opmid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.opmParserCls.downloadOpm(t.cfg.opmid);else if(void 0!==t.cfg.mmdbid)s.inputid=t.cfg.mmdbid,s.loadCmd="load mmdb "+t.cfg.mmdbid+" | parameters "+t.cfg.inpara,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadMmdb(t.cfg.mmdbid);else if(void 0!==t.cfg.gi)s.loadCmd="load gi "+t.cfg.gi,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadGi(t.cfg.gi);else if(void 0!==t.cfg.refseqid)s.inputid=t.cfg.refseqid,s.loadCmd="load refseq "+t.cfg.refseqid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadRefseq(t.cfg.refseqid);else if(void 0!==t.cfg.protein)s.inputid=t.cfg.protein,s.loadCmd="load protein "+t.cfg.protein,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadProteinname(t.cfg.protein);else if(void 0!==t.cfg.blast_rep_id)if(s.inputid=t.cfg.query_id+","+t.cfg.blast_rep_id,t.cfg.oriQuery_id=t.cfg.query_id,t.cfg.oriBlast_rep_id=t.cfg.blast_rep_id,"Query"!==t.cfg.query_id.substr(0,5)&&void 0===t.cfg.rid)"icn3d"==t.cfg.from&&"1TSR_A"==t.cfg.blast_rep_id&&"NP_001108451.1"==t.cfg.query_id&&(t.cfg.command="view annotations; set annotation cdd; set annotation site; set view detailed view; select chain 1TSR_A; show selection"),"smithwm"==t.cfg.alg?(s.loadCmd="load seq_struct_ids_smithwm "+t.cfg.query_id+","+t.cfg.blast_rep_id,s.bSmithwm=!0):"local_smithwm"==t.cfg.alg?(s.loadCmd="load seq_struct_ids_local_smithwm "+t.cfg.query_id+","+t.cfg.blast_rep_id,s.bLocalSmithwm=!0):(s.loadCmd="load seq_struct_ids "+t.cfg.query_id+","+t.cfg.blast_rep_id,s.bSmithwm=!1,s.bLocalSmithwm=!1),t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadBlast_rep_id(t.cfg.query_id+","+t.cfg.blast_rep_id);else if(void 0!==t.cfg.rid){let e="https://blast.ncbi.nlm.nih.gov/Blast.cgi?RESULTS_FILE=on&FORMAT_TYPE=JSON2_S&FORMAT_OBJECT=Alignment&CMD=Get&RID="+t.cfg.rid,i=await t.getAjaxPromise(e,"json",!1,"The RID "+t.cfg.rid+" may have expired...");for(let e=0,n=i.BlastOutput2.length;e";
html += this.getLink('mn1_dsn6', 'Local File', undefined, 3);
html += this.getLink('mn1_dsn6url', 'URL(CORS) ' + me.htmlCls.wifiStr, undefined, 3);
@@ -9559,14 +9559,14 @@ class SetMenu {
}
//!!!
-/*
+
html += this.getMenuText('m1_exportrefnum', 'Reference Numbers', undefined, undefined, 2);
html += "
";
html += this.getLink('mn1_exportIgstrand', 'Ig Strand', undefined, 3);
html += this.getLink('mn1_exportKabat', 'Kabat', undefined, 3);
html += this.getLink('mn1_exportImgt', 'IMGT', undefined, 3);
html += "
";
-*/
+
html += "
Potential ' + me.htmlCls.licenseStr + '');
@@ -10539,7 +10539,7 @@ class SetMenu {
html += this.getRadio('mn6_addlabel', 'mn6_addlabelResidues', 'per Residue', undefined, 1, 2);
html += this.getRadio('mn6_addlabel', 'mn6_addlabelResnum', 'per Residue & Number', undefined, 1, 2);
//!!!
- //html += this.getRadio('mn6_addlabel', 'mn6_addlabelRefnum', 'per Reference Number', undefined, 1, 2);
+ html += this.getRadio('mn6_addlabel', 'mn6_addlabelRefnum', 'per Reference Number', undefined, 1, 2);
html += this.getRadio('mn6_addlabel', 'mn6_addlabelChains', 'per Chain', undefined, undefined, 2);
html += this.getRadio('mn6_addlabel', 'mn6_addlabelTermini', 'N- & C-Termini', undefined, 1, 2);
}
@@ -10631,11 +10631,11 @@ class SetMenu {
html += "";
//!!!
-/*
+
html += this.getLink('mn6_igrefYes', 'Show Ig Ref. Number', undefined, 2);
html += this.getLink('mn6_igrefTpl', 'Ig w/ Specified Template', undefined, 2);
html += this.getLink('mn6_igrefNo', 'Hide Ig Ref. Number', undefined, 2);
-*/
+
html += this.getMenuSep();
html += this.getLink('mn6_customref', 'Custom Ref. Number', undefined, 2);
@@ -11875,8 +11875,8 @@ class SetDialog {
html += "";
html += me.htmlCls.divStr + "dl_dsn6' class='" + dialogClass + "'>";
- html += this.addNotebookTitle('dl_dsn6', 'Load a DSN6 file');
- html += "Note: Always load a PDB file before loading DSN6 files.
",t}setMenu3(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu3_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";t+="
";
+ html += this.addNotebookTitle('dl_dsn6', 'Load a map file');
+ html += "Note: Always load a PDB file before loading map files.
";
html += "2fofc contour at:
";
- html += me.htmlCls.inputFileStr + "id='" + me.pre + "dsn6file2fofc'> " + me.htmlCls.buttonStr + "reload_dsn6file2fofc' style='margin-top: 6px;'>Load
";
+ html += me.htmlCls.inputFileStr + "id='" + me.pre + "dsn6file2fofc'> " + me.htmlCls.buttonStr + "reload_dsn6file2fofc' style='margin: 6px 20px 0 0;'>Load DSN6
";
+ //html += me.htmlCls.inputFileStr + "id='" + me.pre + "dsn6file2fofc'> " + me.htmlCls.buttonStr + "reload_dsn6file2fofc' style='margin: 6px 20px 0 0;'>Load DSN6" + me.htmlCls.buttonStr + "reload_ccp4file2fofc' style='margin-top: 6px;'>Load CCP4
";
html += "fofc contour at:
";
- html += me.htmlCls.inputFileStr + "id='" + me.pre + "dsn6filefofc'> " + me.htmlCls.buttonStr + "reload_dsn6filefofc' style='margin-top: 6px;'>Load
";
+ html += me.htmlCls.inputFileStr + "id='" + me.pre + "dsn6filefofc'> " + me.htmlCls.buttonStr + "reload_dsn6filefofc' style='margin: 6px 20px 0 0;'>Load DSN6
";
+ //html += me.htmlCls.inputFileStr + "id='" + me.pre + "dsn6filefofc'> " + me.htmlCls.buttonStr + "reload_dsn6filefofc' style='margin: 6px 20px 0 0;'>Load DSN6" + me.htmlCls.buttonStr + "reload_ccp4filefofc' style='margin-top: 6px;'>Load CCP4
";
html += me.htmlCls.buttonStr + "elecmapNo4'>Remove Map
";
@@ -11899,7 +11901,7 @@ class SetDialog {
html += me.htmlCls.divStr + "dl_dsn6url' class='" + dialogClass + "'>";
html += this.addNotebookTitle('dl_dsn6url', 'Load a selection file via a URL');
- html += "Note: Always load a PDB file before loading DSN6 files.
";
+ html += "Note: Always load a PDB file before loading map files.
";
html += "2fofc contour at:
Linker": "",
"C'' Strand": "FF0000",
"
Protodomain 2": "",
"D Strand": "0000FF",
"E Strand": "006400",
- "F Strand": "F7DC6F", //"FFFF00", //"F0E68C",
- "G Strand": "FFA500",
+ "F Strand": "FFD700", //"FFFF00", //"F0E68C",
+ "G Strand": "FF8C00",
"": "",
"Loop": "CCCCCC"
};
@@ -38271,6 +38282,10 @@ class AnnoDomain {
let domainArray, proteinname;
let pos = chnid.indexOf('_');
let chain = chnid.substr(pos + 1);
+ // MMDB symmetry chain has the form of 'A1'
+ if(chain.length > 1 && chain.substr(chain.length - 1) == '1') {
+ chain = chain.substr(0, chain.length - 1);
+ }
if(bCalcDirect) {
proteinname = chnid;
@@ -39276,7 +39291,8 @@ class Domain3d {
//this.dcut = 8; // threshold for C-alpha interactions
// It seemed the threshold 7 angstrom works better
- this.dcut = 7; // threshold for C-alpha interactions
+ //this.dcut = 7; // threshold for C-alpha interactions
+ this.dcut = 8; // threshold for C-alpha interactions
this.MAX_SSE = 512;
@@ -42890,6 +42906,10 @@ class ShowAnno {
chainLetter = chainLetter.substr(0, chainLetter.indexOf('_'));
chainidBase = chainArray[i].substr(0, chainArray[i].indexOf('_')) + '_' + chainLetter;
}
+ else if(chainLetter.length > 1 && chainLetter.substr(chainLetter.length - 1) == '1') { // NCBI modified chainid, e.g., A1
+ chainLetter = chainLetter.substr(0, chainLetter.length - 1);
+ chainidBase = chainArray[i].substr(0, chainArray[i].indexOf('_')) + '_' + chainLetter;
+ }
else {
chainidBase = chainArray[i];
}
@@ -44090,7 +44110,7 @@ class ShowSeq {
html += '';
html3 += '';
}
-
+
if(ic.bShowRefnum && ic.chainid2refpdbname.hasOwnProperty(chnid) && ic.chainid2refpdbname[chnid].length > 0) {
let result = this.showAllRefNum(giSeq, chnid);
@@ -44159,9 +44179,11 @@ class ShowSeq {
if(!ic.chainid2refpdbname[chnid]) return {html: html, html3: html3};
- let chainList = ic.refnumCls.getTemplateList(chnid);
+ let result = ic.refnumCls.getTemplateList(chnid);
+ let refpdbnameList = result.refpdbnameList;
+ let scoreList = result.scoreList;
- let refStruTitle = (chainList) ? "based on " + chainList : "";
+ let refStruTitle = (refpdbnameList) ? "based on " + refpdbnameList + ". The TM-scores are " + scoreList + "." : "";
let htmlTmp = '0?(b[0]=x[0]*w[0]+k[0]*S[0]+O[0]*A[0],b[1]=x[0]*w[1]+k[0]*S[1]+O[0]*A[1],b[2]=x[0]*w[2]+k[0]*S[2]+O[0]*A[2],b[3]=x[1]*w[0]+k[1]*S[0]+O[1]*A[0],b[4]=x[1]*w[1]+k[1]*S[1]+O[1]*A[1],b[5]=x[1]*w[2]+k[1]*S[2]+O[1]*A[2],b[6]=x[2]*w[0]+k[2]*S[0]+O[2]*A[0],b[7]=x[2]*w[1]+k[2]*S[1]+O[2]*A[1],b[8]=x[2]*w[2]+k[2]*S[2]+O[2]*A[2]):(b[0]=x[0]*w[0]+k[0]*S[0]-O[0]*A[0],b[1]=x[0]*w[1]+k[0]*S[1]-O[0]*A[1],b[2]=x[0]*w[2]+k[0]*S[2]-O[0]*A[2],b[3]=x[1]*w[0]+k[1]*S[0]-O[1]*A[0],b[4]=x[1]*w[1]+k[1]*S[1]-O[1]*A[1],b[5]=x[1]*w[2]+k[1]*S[2]-O[1]*A[2],b[6]=x[2]*w[0]+k[2]*S[0]-O[2]*A[0],b[7]=x[2]*w[1]+k[2]*S[1]-O[2]*A[1],b[8]=x[2]*w[2]+k[2]*S[2]-O[2]*A[2]),c=Math.sqrt(c),h=Math.sqrt(h),p=Math.sqrt(p),g=c+h+u*p,m=a+d-2*g,i=m>0?Math.sqrt(m):void 0,{rot:b,trans1:I,trans2:T,rmsd:i})}eigen_values(e){let t,s,i,n,l,r,o,a,d,c,h,p,m,u,g,f,b,C,y,v;if(this.icn3dui,t=e[0],s=e[1],i=e[2],n=e[3],l=e[4],r=e[5],o=e[6],a=e[7],d=e[8],c=-(t+l+d),h=t*l+(t+l)*d-r*a-s*n-i*o,p=-t*l*d+t*r*a+s*n*d-s*r*o-i*n*a+i*l*o,m=-c*c/3+h,u=c*c*c/13.5-c*h/3+p,g=.25*u*u+m*m*m/27,g<0){let e,t;e=Math.sqrt(.25*u*u-g),t=Math.acos(-.5*u/e),C=2*Math.cbrt(e)*Math.cos(t/3)}else f=Math.cbrt(-.5*u+Math.sqrt(g)),b=Math.cbrt(-.5*u-Math.sqrt(g)),C=f+b;return C-=c/3,c+=C,p/=-C,y=.5*(-c+Math.sqrt(c*c-4*p)),v=.5*(-c-Math.sqrt(c*c-4*p)),y0&&Math.abs(r[0].x-e[e.length-1].x)<=6&&Math.abs(r[0].y-e[e.length-1].y)<=6&&Math.abs(r[0].z-e[e.length-1].z)<=6&&(p.push(r[0]),++g),u>1&&Math.abs(r[0].x-r[1].x)<=6&&Math.abs(r[0].y-r[1].y)<=6&&Math.abs(r[0].z-r[1].z)<=6&&(p.push(r[1]),++g);let f=[],b=[],C=[];o&&(g=u>0?u-1:0);let y;for(let e=-1,n=p.length,l=1/s;e<=n-3;++e){y=e-m;let r=p[-1===e?0:e],o=p[e+1],u=p[e+2],v=p[e===n-3?n-1:e+3],_=0,w=a.subdivideCls.getKnot(1,_,r,o),S=a.subdivideCls.getKnot(1,w,o,u),A=a.subdivideCls.getKnot(1,S,u,v);w-_<1e-4&&(w=_+1),S-w<1e-4&&(S=w+1),A-S<1e-4&&(A=S+1),e>-1&&(void 0===i||i[y+1])&&e>=-1+m&&e<=n-3-g+1&&(d=d.concat(f),c=c.concat(b),h=h.concat(C)),f=[],b=[],C=[];let x=(S-w)*l;for(let l=0;l=-1+m&&e<=n-3-g&&i[y+1]&&l<=parseInt(s/2)&&(d.push(new THREE.Vector3(k,O,R)),c.push(i[y+1]),h.push(t[y+1])),e>=-1+m&&e<=n-3-g+1&&i[y+2]&&l>parseInt(s/2)&&(f.push(new THREE.Vector3(k,O,R)),b.push(i[y+2]),C.push(t[y+2]))):e>=-1+m&&e<=n-3-g&&(d.push(new THREE.Vector3(k,O,R)),c.push(y+1),h.push(t[y+1]))}}i&&!i[y+1]||(d=d.concat(f),c=c.concat(b),h=h.concat(C),d.push(p[p.length-1-g]),c.push(p.length-1-g),h.push(t[p.length-1-g])),f=[],b=[],C=[],p=[];let v=[];return v.push(d),v.push(c),v.push(h),v}getKnot(e,t,s,i){return this.icn3dui,s.distanceTo(i)+t}getValueFromKnot(e,t,s,i,n,l,r,o,a){this.icn3dui;let d,c,h=(r-l)/(s-t),p=(o-r)/(i-s),m=(a-o)/(n-i),u=(s+i)*(s+i)-4*(t*s+i*n-t*n);return 0==u?(d=9999,c=9999):(d=6*(3*p*s+2*h*n+m*s-2*h*s-2*p*n-p*i-m*s)/u,c=6*(3*p*i+2*m*t+h*s-2*p*t-2*m*i-h*i-p*s)/u),p*(e-s)+r+((2*d+c)/6/(s-i)*(e-s)*(e-i)*(e-i)+(2*c+d)/6/(i-s)*(e-s)*(e-s)*(e-i))}}class o{constructor(e){this.icn3dui=e}passFloat32(e,t){let s=this.icn3dui,i=e.length;t||(t=new Uint8Array(4*i));let n=s.convertTypeCls.getDataView(t);for(let t=0;t",e+=' Very high (pLDDT > 90)
',e+=' Confident (90 > pLDDT > 70)
',e+=' Low (70 > pLDDT > 50)
',e+=' Very low (pLDDT < 50)
',e+="",'
Confident (90 > pLDDT > 70)
Low (70 > pLDDT > 50)
Very low (pLDDT < 50)
";if(e)s+=this.setAlphaFoldLegend();else{s+="
"}return s}SetChainsAdvancedMenu(){let e=this.icn3dui,t=e.icn3d;if(void 0===t.bSetChainsAdvancedMenu||!t.bSetChainsAdvancedMenu){let s=e.hashUtilsCls.cloneHash(t.hAtoms);t.definedSetsCls.setPredefinedInMenu(),t.bSetChainsAdvancedMenu=!0,t.hAtoms=e.hashUtilsCls.cloneHash(s)}}setSetsMenus(e,t){let s=this.icn3dui,i=s.icn3d;this.SetChainsAdvancedMenu();let n=e,l=e+"2",r=i.definedSetsCls.setAtomMenu(["protein"]);$("#"+s.pre+n).length&&$("#"+s.pre+n).html(" "+r),!t&&$("#"+s.pre+l).length&&$("#"+s.pre+l).html(" "+r),$("#"+s.pre+n).resizable(),t||$("#"+s.pre+l).resizable()}applyShownMenus(e){let t=this.icn3dui;t.icn3d;let s=[];for(let e in t.htmlCls.allMenus)t.htmlCls.shownMenus.hasOwnProperty(e)?$("#"+t.pre+e).parent().show():($("#"+t.pre+e).parent().hide(),s.push(e));Object.keys(t.htmlCls.shownMenus).length==Object.keys(t.htmlCls.allMenus).length?$(".icn3d-menusep").show():$(".icn3d-menusep").hide(),localStorage&&!e&&localStorage.setItem("hiddenmenus",JSON.stringify(s))}getHiddenMenusFromCache(){let e=this.icn3dui;e.icn3d,e.htmlCls.shownMenus={};let t=localStorage?localStorage.getItem("hiddenmenus"):"";if(t&&"[]"!=t){let s=JSON.parse(t);for(let t in e.htmlCls.allMenus)-1==s.indexOf(t)&&(e.htmlCls.shownMenus[t]=1)}else e.htmlCls.shownMenus=e.hashUtilsCls.cloneHash(e.htmlCls.allMenus)}displayShownMenus(){let e=this.icn3dui;e.icn3d;let t="",$("#"+e.pre+"menulist").html(t)}clickMenu1(){let e=this.icn3dui;if(e.icn3d,e.bNode)return;let t=this;e.myEventCls.onIds("#"+e.pre+"mn1_vastplus","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_vastplus","Please input PDB ID for VAST+")})),e.myEventCls.onIds("#"+e.pre+"mn1_vast","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_vast","Please input chain or PDB file for VAST")})),e.myEventCls.onIds("#"+e.pre+"mn1_foldseek","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_foldseek","Submit your selection to Foldseek")})),e.myEventCls.onIds("#"+e.pre+"mn1_mmtfid","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_mmtfid","Please input MMTF ID")})),e.myEventCls.onIds("#"+e.pre+"mn1_pdbid","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_pdbid","Please input PDB ID")})),e.myEventCls.onIds("#"+e.pre+"mn1_afid","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_afid","Please input AlphaFold UniProt ID")})),e.myEventCls.onIds("#"+e.pre+"mn1_refseqid","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_refseqid","Please input NCBI Protein Accession")})),e.myEventCls.onIds("#"+e.pre+"mn1_opmid","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_opmid","Please input OPM PDB ID")})),e.myEventCls.onIds("#"+e.pre+"mn1_align","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_align","Align two PDB structures")})),e.myEventCls.onIds("#"+e.pre+"mn1_alignaf","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_alignaf","Align two AlphaFold structures")})),e.myEventCls.onIds("#"+e.pre+"mn1_chainalign","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_chainalign","Align multiple chains by structure alignment")})),e.myEventCls.onIds("#"+e.pre+"mn1_chainalign2","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_chainalign2","Align multiple chains by sequence alignment")})),e.myEventCls.onIds("#"+e.pre+"mn1_chainalign3","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_chainalign3","Align multiple chains residue by residue")})),e.myEventCls.onIds("#"+e.pre+"mn1_mutation","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_mutation","Show the mutations in 3D")})),e.myEventCls.onIds("#"+e.pre+"mn1_pdbfile","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_pdbfile","Please input PDB File")})),e.myEventCls.onIds(["#"+e.pre+"mn1_pdbfile_app","#"+e.pre+"tool_pdbfile"],"click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_pdbfile_app","Please append PDB Files")})),e.myEventCls.onIds("#"+e.pre+"mn1_mol2file","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_mol2file","Please input Mol2 File")})),e.myEventCls.onIds("#"+e.pre+"mn1_sdffile","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_sdffile","Please input SDF File")})),e.myEventCls.onIds("#"+e.pre+"mn1_xyzfile","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_xyzfile","Please input XYZ File")})),e.myEventCls.onIds("#"+e.pre+"mn1_afmapfile","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_afmapfile","Please input AlphaFold PAE File")})),e.myEventCls.onIds("#"+e.pre+"mn1_urlfile","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_urlfile","Load data by URL")})),e.myEventCls.onIds("#"+e.pre+"mn1_fixedversion","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_fixedversion","Open Share Link URL in the archived version of iCn3D")})),e.myEventCls.onIds("#"+e.pre+"reload_fixedversion","click",(function(s){let i=e.icn3d,n=$("#"+e.pre+"sharelinkurl").val();t.setLogCmd("open "+n,!1),localStorage.setItem("fixedversion","1");let l=i.structures&&Object.keys(i.structures).length>0?"_blank":"_self";window.open(n,l)})),e.myEventCls.onIds("#"+e.pre+"mn1_mmciffile","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_mmciffile","Please input mmCIF File")})),e.myEventCls.onIds("#"+e.pre+"mn1_mmcifid","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_mmcifid","Please input mmCIF ID")})),e.myEventCls.onIds("#"+e.pre+"mn1_mmdbid","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_mmdbid","Please input MMDB or PDB ID")})),e.myEventCls.onIds(["#"+e.pre+"mn1_mmdbafid",,"#"+e.pre+"tool_mmdbafid"],"click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_mmdbafid","Please input PDB/MMDB/AlphaFold UniProt IDs")})),e.myEventCls.onIds("#"+e.pre+"mn1_blast_rep_id","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_blast_rep_id","Align sequence to structure")})),e.myEventCls.onIds("#"+e.pre+"mn1_esmfold","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_esmfold","Sequence to structure prediction with ESMFold")})),e.myEventCls.onIds("#"+e.pre+"mn1_proteinname","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_proteinname","Please input protein or gene name")})),e.myEventCls.onIds("#"+e.pre+"mn1_cid","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_cid","Please input PubChem CID")})),e.myEventCls.onIds("#"+e.pre+"mn1_pngimage","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_pngimage","Please input the PNG image")})),e.myEventCls.onIds("#"+e.pre+"mn1_state","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_state","Please input the state file")})),e.myEventCls.onIds("#"+e.pre+"mn1_selection","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_selection","Please input the selection file")})),e.myEventCls.onIds("#"+e.pre+"mn1_dsn6","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_dsn6","Please input the DSN6 file to display electron density map")})),e.myEventCls.onIds(["#"+e.pre+"mn1_delphi","#"+e.pre+"mn1_delphi2","#"+e.pre+"tool_delphi"],"click",(function(t){e.icn3d.loadPhiFrom="delphi",$("#"+e.pre+"dl_delphi_tabs").tabs(),e.htmlCls.dialogCls.openDlg("dl_delphi","Please set parameters to display DelPhi potential map")})),e.myEventCls.onIds("#"+e.pre+"mn1_phi","click",(function(t){e.icn3d.loadPhiFrom="phi",$("#"+e.pre+"dl_phi_tabs").tabs(),$("#"+e.pre+"phitab1_tabs").tabs(),$("#"+e.pre+"phitab2_tabs").tabs(),e.htmlCls.dialogCls.openDlg("dl_phi","Please input local phi or cube file to display DelPhi potential map")})),e.myEventCls.onIds("#"+e.pre+"mn1_phiurl","click",(function(t){e.icn3d.loadPhiFrom="phiurl",$("#"+e.pre+"dl_phiurl_tabs").tabs(),$("#"+e.pre+"phiurltab1_tabs").tabs(),$("#"+e.pre+"phiurltab2_tabs").tabs(),e.htmlCls.dialogCls.openDlg("dl_phiurl","Please input URL phi or cube file to display DelPhi potential map")})),e.myEventCls.onIds("#"+e.pre+"mn1_dsn6url","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_dsn6url","Please input the DSN6 file to display electron density map")})),e.myEventCls.onIds("#"+e.pre+"mn1_exportState","click",(function(s){let i=e.icn3d;t.setLogCmd("export state file",!1);let n=Object.keys(i.structures).join(",");i.saveFileCls.saveFile(n+"_statefile.txt","command")})),e.myEventCls.onIds("#"+e.pre+"mn1_exportPdbRes","click",(function(s){e.icn3d,e.htmlCls.setHtmlCls.exportPdb(),t.setLogCmd("export pdb",!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportSecondary","click",(function(s){e.icn3d,e.htmlCls.setHtmlCls.exportSecondary(),t.setLogCmd("export secondary structure",!0)})),e.myEventCls.onIds(["#"+e.pre+"delphipdb","#"+e.pre+"phipdb"],"click",(function(s){let i=e.icn3d,n=i.saveFileCls.getSelectedResiduePDB();t.setLogCmd("export PDB of selected residues",!1);let l=Object.keys(i.structures).join(",");i.saveFileCls.saveFile(l+"_icn3d_residues.pdb","text",[n])})),e.myEventCls.onIds(["#"+e.pre+"delphipqr","#"+e.pre+"phipqr","#"+e.pre+"phiurlpqr"],"click",(async function(s){e.icn3d,await e.htmlCls.setHtmlCls.exportPqr(),t.setLogCmd("export pqr",!0)})),e.myEventCls.onIds("#"+e.pre+"profixpdb","click",(async function(s){let i=e.icn3d;await i.scapCls.exportPdbProfix(!1),t.setLogCmd("export pdb missing atoms",!0)})),e.myEventCls.onIds("#"+e.pre+"profixpdbh","click",(async function(s){let i=e.icn3d;await i.scapCls.exportPdbProfix(!0),t.setLogCmd("export pdb hydrogen",!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportIgstrand","click",(async function(s){e.icn3d.refnumCls.exportRefnum("igstrand"),t.setLogCmd("export refnum igstrand",!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportKabat","click",(async function(s){e.icn3d.refnumCls.exportRefnum("kabat"),t.setLogCmd("export refnum kabat",!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportImgt","click",(async function(s){e.icn3d.refnumCls.exportRefnum("imgt"),t.setLogCmd("export refnum imgt",!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportStl","click",(function(s){let i=e.icn3d;t.setLogCmd("export stl file",!1),i.export3DCls.exportStlFile("")})),e.myEventCls.onIds("#"+e.pre+"mn1_exportVrml","click",(function(s){let i=e.icn3d;t.setLogCmd("export vrml file",!1),i.export3DCls.exportVrmlFile("")})),e.myEventCls.onIds("#"+e.pre+"mn1_exportStlStab","click",(function(s){let i=e.icn3d;t.setLogCmd("export stl stabilizer file",!1),i.threeDPrintCls.hideStabilizer(),i.threeDPrintCls.resetAfter3Dprint(),i.threeDPrintCls.addStabilizer(),i.export3DCls.exportStlFile("_stab")})),e.myEventCls.onIds("#"+e.pre+"mn1_exportVrmlStab","click",(function(s){let i=e.icn3d;t.setLogCmd("export vrml stabilizer file",!1),i.threeDPrintCls.hideStabilizer(),i.threeDPrintCls.resetAfter3Dprint(),i.threeDPrintCls.addStabilizer(),i.export3DCls.exportVrmlFile("_stab")})),e.myEventCls.onIds("#"+e.pre+"mn6_exportInteraction","click",(async function(s){let i=e.icn3d;t.setLogCmd("export interactions",!1),void 0!==e.cfg.mmdbid&&await i.viewInterPairsCls.retrieveInteractionData(),i.viewInterPairsCls.exportInteractions()})),e.myEventCls.onIds(["#"+e.pre+"mn1_exportCanvas","#"+e.pre+"saveimage"],"click",(async function(s){let i=e.icn3d;t.setLogCmd("export canvas",!1);await i.shareLinkCls.shareLink(!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportCanvas1","click",(async function(s){let i=e.icn3d;t.setLogCmd("export canvas 1",!0),i.scaleFactor=1,await i.shareLinkCls.shareLink(!0,!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportCanvas2","click",(async function(s){let i=e.icn3d;t.setLogCmd("export canvas 2",!0),i.scaleFactor=2,await i.shareLinkCls.shareLink(!0,!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportCanvas4","click",(async function(s){let i=e.icn3d;t.setLogCmd("export canvas 4",!0),i.scaleFactor=4,await i.shareLinkCls.shareLink(!0,!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportCanvas8","click",(async function(s){let i=e.icn3d;t.setLogCmd("export canvas 8",!0),i.scaleFactor=8,await i.shareLinkCls.shareLink(!0,!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportCounts","click",(function(s){let i=e.icn3d;t.setLogCmd("export counts",!1);let n='"+t.startValue+" "+t.midValue+" "+t.endValue+"
Total Count for atoms with coordinates: ';n+="Structure Count Chain Count Residue Count Atom Count ",n+=""+Object.keys(i.structures).length+" "+Object.keys(i.chains).length+" "+Object.keys(i.residues).length+" "+Object.keys(i.atoms).length+"
",n+="Counts by Chain for atoms with coordinates: ";let l=Object.keys(i.chains);for(let e=0,t=l.length;eStructure Chain Residue Count Atom Count "+r+" "+o+" "+Object.keys(a).length+" "+Object.keys(i.chains[t]).length+" "}n+="
",l+="",l+=this.setTools(),l+=i.htmlCls.divStr+"title' class='icn3d-commandTitle' style='font-size:1.2em; font-weight:normal; position:absolute; z-index:1; float:left; display:table-row; margin: 85px 0px 0px 5px; color:"+n+"; width:"+i.htmlCls.WIDTH+"px'>",l+=i.htmlCls.divStr+"viewer' style='position:relative; width:100%; height:100%; background-color: "+i.htmlCls.GREYD+";'>",l+=i.htmlCls.divStr+"mnLogSection'>",l+="",l+=" ",void 0===i.cfg.mmtfid){let e="top:180px; font-size: 1.8em;";l+=i.htmlCls.divStr+"wait' style='position:absolute; left:50px; "+e+" color: #444444;'>Loading data..."}l+="",(void 0===i.cfg.showcommand||i.cfg.showcommand)&&(l+=this.setLogWindow()),l+="",l+="",l+=i.htmlCls.setDialogCls.setDialogs(),l+=i.htmlCls.setDialogCls.setCustomDialogs(),$("#"+e).html(l),$("accordion").accordion({collapsible:!0,active:!1,heightStyle:"content"}),$("accordion div").removeClass("ui-accordion-content ui-corner-all ui-corner-bottom ui-widget-content"),$(".icn3d-mn-item").menu({position:{my:"left top",at:"right top"}}),$(".icn3d-mn-item").hover((function(){}),(function(){$("accordion").accordion("option","active","none")})),$("#"+i.pre+"accordion1").hover((function(){$("#"+i.pre+"accordion1 div").css("display","block")}),(function(){$("#"+i.pre+"accordion1 div").css("display","none")})),$("#"+i.pre+"accordion2").hover((function(){$("#"+i.pre+"accordion2 div").css("display","block")}),(function(){$("#"+i.pre+"accordion2 div").css("display","none")})),$("#"+i.pre+"accordion2b").hover((function(){$("#"+i.pre+"accordion2b div").css("display","block")}),(function(){$("#"+i.pre+"accordion2b div").css("display","none")})),$("#"+i.pre+"accordion3").hover((function(){$("#"+i.pre+"accordion3 div").css("display","block")}),(function(){$("#"+i.pre+"accordion3 div").css("display","none")})),$("#"+i.pre+"accordion4").hover((function(){$("#"+i.pre+"accordion4 div").css("display","block")}),(function(){$("#"+i.pre+"accordion4 div").css("display","none")})),$("#"+i.pre+"accordion5").hover((function(){$("#"+i.pre+"accordion5 div").css("display","block")}),(function(){$("#"+i.pre+"accordion5 div").css("display","none")})),$("#"+i.pre+"accordion6").hover((function(){$("#"+i.pre+"accordion6 div").css("display","block")}),(function(){$("#"+i.pre+"accordion6 div").css("display","none")}))}setTopMenusHtmlMobile(e,t,s){let i=this.icn3dui;if(i.bNode)return"";let n="black"==i.htmlCls.opts.background?i.htmlCls.GREYD:"black",l="";if(l+="";let r=' ",l+="';if(l+=r+this.setMenu1()+" ",l+=r+this.setMenu2()+"",l+=r+this.setMenu2b()+"",l+=r+this.setMenu3()+"",l+=r+this.setMenu4()+"",l+=r+this.setMenu5()+"",l+=r+this.setMenu6()+"",i.htmlCls.shownMenus=i.hashUtilsCls.cloneHash(i.htmlCls.simpleMenus),l+=r+"☰
":l+="☰
",l+="",t+=this.setTools_base(),t+="
",t+="",t="regular",s=" ",e}setTheme(e){let t,s,i,n,l,r=this.icn3dui;if(r.bNode)return"";r.htmlCls.themecolor=e,"orange"==e?(t="#e78f08",s="#f6a828",i="ui-bg_gloss-wave_35_f6a828_500x100.png",n="ui-icons_ef8c08_256x240.png",l="#eb8f00"):"black"==e?(t="#333333",s="#333333",i="ui-bg_gloss-wave_25_333333_500x100.png",n="ui-icons_222222_256x240.png",l="#222222"):"blue"==e&&(t="#4297d7",s="#5c9ccc",i="ui-bg_gloss-wave_55_5c9ccc_500x100.png",n="ui-icons_228ef1_256x240.png",l="#444"),$(".ui-widget-header").css({border:"1px solid "+t,background:s+' url("https://www.ncbi.nlm.nih.gov/Structure/icn3d/lib/images/'+i+'") 50% 50% repeat-x',color:"#fff","font-weight":"bold"}),$(".ui-button .ui-icon").css({"background-image":"url(https://www.ncbi.nlm.nih.gov/Structure/icn3d/lib/images/"+n+")"}),$(".ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited").css({color:l,"text-decoration":"none"})}setLogWindow(e,t){let s=this.icn3dui;if(s.bNode)return"";let i,n="",l=s.htmlCls.setHtmlCls.getCookie("cmdwindow");return""!=l?(i=void 0!==t?t:parseInt(l),1==i?(s.htmlCls.LOG_HEIGHT=180,s.htmlCls.CMD_HEIGHT=.8*s.htmlCls.LOG_HEIGHT,e||(n+=s.htmlCls.divStr+"cmdlog' style='float:left; margin-top: 5px; width: 100%;'>"),n+=""):(s.htmlCls.LOG_HEIGHT=65,s.htmlCls.CMD_HEIGHT=.8*s.htmlCls.LOG_HEIGHT,e||(n+=s.htmlCls.divStr+"cmdlog' style='float:left; margin-top: 5px; width: 100%;'>"),n+="")):(i=0,s.htmlCls.LOG_HEIGHT=65,s.htmlCls.CMD_HEIGHT=.8*s.htmlCls.LOG_HEIGHT,e||(n+=s.htmlCls.divStr+"cmdlog' style='float:left; margin-top: 5px; width: 100%;'>"),n+=""),e||(n+=""),e&&(s.htmlCls.clickMenuCls.setLogCmd("set cmdwindow "+i,!0),$("#"+s.pre+"cmdlog").html(n)),n}setMenu1(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu1_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+="",i=" ";return e+=s+this.setIcon(t,"tool_mmdbafid","Input PDB/MMDB/AlphaFold IDs","id",void 0,!0)+" ",e+=s+this.setIcon(t,"tool_pdbfile","Input PDB Files (appendable)","file-alt")+"",e+=s+this.setIcon(t,"tool_sharelink","Get Share Link","link")+"",e+=s+this.setIcon(t,"saveimage","Save iCn3D PNG Image","camera")+"",e+=i+this.setIcon(t,"tool_definedsets","Defined Sets","object-group")+"",e+=s+this.setIcon(t,"tool_aroundsphere","Select by Distance","dot-circle")+"",e+=s+this.setIcon(t,"tool_saveselection","Save Selection as a Set","save")+"",e+=s+this.setIcon(t,"toggleHighlight","Toggle Highlight","highlighter")+"",e+=i+this.setIcon(t,"show_selected","View Selection","eye")+"",e+=s+this.setIcon(t,"tool_selectedcenter","Zoom in Selection","search-plus")+"",e+=s+this.setIcon(t,"alternate","Alternate the Structures by keying the letter 'a'","a",void 0,!0,!0)+"",e+=s+this.setIcon(t,"tool_resetOrientation","Reset Orientation","undo-alt")+"",e+=i+this.setIcon(t,"tool_proteinsRibbon","Style Ribbon for proteins","dna")+"",e+=s+this.setIcon(t,"tool_proteinsSphere","Style Sphere for proteins","volleyball-ball")+"",e+=s+this.setIcon(t,"tool_surfaceVDW","Show Van der Waals Surface","cloud")+"",e+=s+this.setIcon(t,"tool_bkgd","Toggle Background Color","adjust")+"",e+=i+this.setIcon(t,"tool_clrRainbowChain","Color Rainbow for Chains","rainbow")+"",e+=s+this.setIcon(t,"tool_clrSSGreen","Color by Secondary Structures","ring")+"",e+=s+this.setIcon(t,"tool_clrChain","Color by Chains","layer-group")+"",e+=s+this.setIcon(t,"tool_clrAtom","Color by Atoms","atom")+"",e+=i+this.setIcon(t,"tool_selectannotations","Sequences & Annotations","grip-lines")+"",e+=s+this.setIcon(t,"hbondsYes","Interactions","users")+"",e+=s+this.setIcon(t,"tool_delphi","Delphi Potentials","cloud-meatball")+"",e+=s+this.setIcon(t,"removeLabels","Remove Labels","remove-format")+"",e+=i+this.setIcon("link","tool-gallery","Gallery","image","https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#gallery")+"",e+=s+this.setIcon("link","tool-video","Videos","file-video","https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#videos")+"",e+=s+this.setIcon("link","tool-github","iCn3D GitHub","code","https://github.com/ncbi/icn3d")+"",e+=s+this.setIcon("link","tool-hints","Transform Hints","info-circle","https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#useicn3d")+"",e+="",t+=this.getMenuText("mn1_searchgrooup","Search Structure "+e.htmlCls.wifiStr,void 0,1,1),t+="
",t+=this.getMenuUrl("mn1_searchstru","https://www.ncbi.nlm.nih.gov/structure","PDB Structures "+e.htmlCls.wifiStr,1,2),t+=this.getLink("mn1_proteinname","AlphaFold Structures "+e.htmlCls.wifiStr,1,2),t+=this.getMenuUrl("mn1_afdatabase","https://alphafold.ebi.ac.uk","AlphaFold UniProt Database "+e.htmlCls.wifiStr,void 0,2),t+="
",t+="",t+=this.getMenuText("mn1_searchsimilar","Search Similar"+e.htmlCls.wifiStr,void 0,void 0,1),t+="",t+=this.getLink("mn1_vastplus","NCBI VAST+ (PDB Complex)"+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_vast","NCBI VAST (PDB Chain)"+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_foldseek","Foldseek (PDB & AlphaFold)"+e.htmlCls.wifiStr,void 0,2),t+="
",t+="",t+=this.getMenuText("mn1_retrievebyid","Retrieve by ID",void 0,1,1),t+="",t+=this.getLink("mn1_mmdbafid","PDB/MMDB/AlphaFold IDs"+e.htmlCls.wifiStr,1,2),t+=this.getLink("mn1_mmdbid","NCBI MMDB ID (annotation) "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_mmtfid","RCSB MMTF ID (fast) "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_pdbid","RCSB PDB ID "+e.htmlCls.wifiStr,void 0,2),t+=this.getMenuText("mn1_afwrap","AlphaFold Structures",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn1_openfile","Open File",void 0,1,1),t+="",t+=this.getLink("mn1_afid","UniProt ID "+e.htmlCls.wifiStr,void 0,3),t+=this.getLink("mn1_refseqid","NCBI Protein Accession "+e.htmlCls.wifiStr,void 0,3),t+="
",t+=this.getLink("mn1_opmid","OPM PDB ID "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_mmcifid","RCSB mmCIF ID "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_cid","PubChem CID "+e.htmlCls.wifiStr,1,2),t+="",t+=this.getLink("mn1_pdbfile_app","PDB Files (appendable)",1,2),t+=this.getLink("mn1_mmciffile","mmCIF File",void 0,2),t+=this.getLink("mn1_mol2file","Mol2 File",void 0,2),t+=this.getLink("mn1_sdffile","SDF File",void 0,2),t+=this.getLink("mn1_xyzfile","XYZ File",void 0,2),t+=this.getLink("mn1_afmapfile","AlphaFold PAE File",void 0,2),t+=this.getLink("mn1_urlfile","URL(CORS) "+e.htmlCls.wifiStr,void 0,2),t+=this.getMenuSep(),t+=this.getLink("mn1_pngimage","iCn3D PNG Image",1,2),t+=this.getLink("mn1_state","State/Script File",void 0,2),t+=this.getLink("mn1_fixedversion","Share Link in Archived Ver. "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_selection","Selection File",void 0,2),t+=this.getMenuSep(),t+=this.getMenuText("mn1_dsn6wrap","Electron Density(DSN6)",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn1_fold","Predict by Seq.",void 0,void 0,1),t+="",t+=this.getLink("mn1_dsn6","Local File",void 0,3),t+=this.getLink("mn1_dsn6url","URL(CORS) "+e.htmlCls.wifiStr,void 0,3),t+="
",t+="",t+=this.getLink("mn1_esmfold","ESMFold",void 0,2),t+=this.getLink("mn1_alphafold","AlphaFold2 via ColabFold"+e.htmlCls.wifiStr,void 0,2),t+="
",t+=this.getMenuText("mn1_alignwrap","Align",void 0,1,1),t+="",t+=this.getMenuText("mn1_chainalignwrap","Multiple Chains",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn2_realignWrap","Realign Selection",void 0,void 0,1),t+="",t+=this.getRadio("mn1_chainalignRad","mn1_chainalign","by Structure Alignment "+e.htmlCls.wifiStr,void 0,1,3),t+=this.getRadio("mn1_chainalignRad","mn1_chainalign2","by Sequence Alignment "+e.htmlCls.wifiStr,void 0,1,3),t+=this.getRadio("mn1_chainalignRad","mn1_chainalign3","Residue by Residue",void 0,void 0,3),t+="
",t+="",t+=this.getMenuText("mn1_aligntwostru","Protein Complexes",void 0,void 0,2),t+="",t+=this.getLink("mn1_align","Two PDB Structures "+e.htmlCls.wifiStr,void 0,3),t+=this.getLink("mn1_alignaf","Two AlphaFold Structures "+e.htmlCls.wifiStr,void 0,3),t+="
",t+=this.getLink("mn1_blast_rep_id","Sequence to Structure",void 0,2),t+="",t+=this.getMenuText("mn2_chainrealignwrap","Multiple Chains",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn1_3dpprint","3D Printing",void 0,1,1),t+="",t+=this.getRadio("mn2_realign","mn2_realignonstruct","by Structure Alignment "+e.htmlCls.wifiStr,void 0,void 0,3),t+=this.getRadio("mn2_realign","mn2_realignonseqalign","by Sequence Alignment "+e.htmlCls.wifiStr,void 0,void 0,3),t+=this.getRadio("mn2_realign","mn2_realignresbyres","Residue by Residue",void 0,void 0,3),t+="
",t+=this.getLink("mn2_realigntwostru","Protein Complexes",void 0,2),t+="",void 0===e.cfg.cid?(t+=this.getLink("mn1_exportVrmlStab","WRL/VRML(Color, W/ Stab.)",1,2),t+=this.getLink("mn1_exportStlStab","STL(W/ Stabilizers)",1,2),t+=this.getMenuSep(),t+=this.getLink("mn1_exportVrml","WRL/VRML(Color)",void 0,2),t+=this.getLink("mn1_exportStl","STL",void 0,2),t+=this.getMenuSep(),t+=this.getLink("mn1_stabilizerYes","Add All Stabilizers",void 0,2),t+=this.getLink("mn1_stabilizerNo","Remove All Stabilizers",void 0,2),t+=this.getMenuSep(),t+=this.getLink("mn1_stabilizerOne","Add One Stabilizer",void 0,2),t+=this.getLink("mn1_stabilizerRmOne","Remove One Stabilizer",void 0,2),t+=this.getMenuSep(),t+=this.getLink("mn1_thicknessSet","Set Thickness",void 0,2)):(t+=this.getLink("mn1_exportVrml","VRML(Color)",1,2),t+=this.getLink("mn1_exportStl","STL",1,2)),t+="
",t+="",t+=this.getMenuText("mn1_savefile","Save File",void 0,1,1),t+="",t+=this.getMenuText("mn1_savepngimage","iCn3D PNG Image",void 0,1,2),t+="
",t+=this.getLink("mn1_exportCanvas","Original Size & HTML",1,3),t+=this.getLink("mn1_exportCanvas1","Original Size",void 0,3),t+=this.getLink("mn1_exportCanvas2","2X Large",void 0,3),t+=this.getLink("mn1_exportCanvas4","4X Large",void 0,3),t+=this.getLink("mn1_exportCanvas8","8X Large",void 0,3),t+="
",t+="",t+=this.getLink("mn1_exportState","State File",void 0,2),t+=this.getLink("mn1_exportSelections","Selection File",void 0,2),t+=this.getLink("mn1_exportSelDetails","Selection Details",void 0,2),t+=this.getLink("mn1_exportCounts","Residue Counts",void 0,2),t+=this.getLink("mn1_exportPdbRes","PDB",1,2),t+=this.getLink("profixpdb","PDB with Missing Atoms",void 0,2),void 0===e.cfg.cid&&(t+=this.getLink("mn1_exportSecondary","Secondary Structure",void 0,2)),
+var icn3d=function(e){"use strict";class t{constructor(e){this.icn3dui=e}cloneHash(e){this.icn3dui;let t={};void 0===e&&(e={});for(let s in e)t[s]=e[s];return t}intHash(e,t){this.icn3dui;let s={};if(void 0===e&&(e={}),void 0===t&&(t={}),Object.keys(e).length
"}getStructures(e){let t=this.icn3dui,s={};for(let i in e){s[t.icn3d.atoms[i].structure]=1}return s}getHlStructures(e){let t=this.icn3dui;return e||(e=t.icn3d.hAtoms),this.getStructures(e)}getDisplayedStructures(e){let t=this.icn3dui;return e||(e=t.icn3d.dAtoms),this.getStructures(e)}getDateDigitStr(){this.icn3dui;let e=new Date,t=(e.getMonth()+1).toString();e.getMonth()+1<10&&(t="0"+t);let s=e.getDate().toString();return e.getDate()<10&&(s="0"+s),e.getFullYear().toString()+t+s}}class i{constructor(e){this.icn3dui=e,this.glycanHash={GLC:{c:"1E90FF",s:"sphere"},BGC:{c:"1E90FF",s:"sphere"},NAG:{c:"1E90FF",s:"cube"},NDG:{c:"1E90FF",s:"cube"},GCS:{c:"1E90FF",s:"cube"},PA1:{c:"1E90FF",s:"cube"},GCU:{c:"1E90FF",s:"cone"},BDP:{c:"1E90FF",s:"cone"},G6D:{c:"1E90FF",s:"cone"},DDA:{c:"1E90FF",s:"cylinder"},B6D:{c:"1E90FF",s:"cylinder"},XXM:{c:"1E90FF",s:"cylinder"},MAN:{c:"00FF00",s:"sphere"},BMA:{c:"00FF00",s:"sphere"},BM3:{c:"00FF00",s:"cube"},"95Z":{c:"00FF00",s:"cube"},MAV:{c:"00FF00",s:"cone"},BEM:{c:"00FF00",s:"cone"},RAM:{c:"00FF00",s:"cone"},RM4:{c:"00FF00",s:"cone"},TYV:{c:"00FF00",s:"cylinder"},ARA:{c:"00FF00",s:"cylinder"},ARB:{c:"00FF00",s:"cylinder"},KDN:{c:"00FF00",s:"cylinder"},KDM:{c:"00FF00",s:"cylinder"},"6PZ":{c:"00FF00",s:"cylinder"},GMH:{c:"00FF00",s:"cylinder"},BDF:{c:"00FF00",s:"cylinder"},GAL:{c:"FFFF00",s:"sphere"},GLA:{c:"FFFF00",s:"sphere"},NGA:{c:"FFFF00",s:"cube"},A2G:{c:"FFFF00",s:"cube"},X6X:{c:"FFFF00",s:"cube"},"1GN":{c:"FFFF00",s:"cube"},ADA:{c:"FFFF00",s:"cone"},GTR:{c:"FFFF00",s:"cone"},LDY:{c:"FFFF00",s:"cylinder"},KDO:{c:"FFFF00",s:"cylinder"},T6T:{c:"FFFF00",s:"cylinder"},GUP:{c:"A52A2A",s:"sphere"},GL0:{c:"A52A2A",s:"sphere"},LGU:{c:"A52A2A",s:"cone"},ABE:{c:"A52A2A",s:"cylinder"},XYS:{c:"A52A2A",s:"cylinder"},XYP:{c:"A52A2A",s:"cylinder"},SOE:{c:"A52A2A",s:"cylinder"},PZU:{c:"FF69B4",s:"cylinder"},RIP:{c:"FF69B4",s:"cylinder"},"0MK":{c:"FF69B4",s:"cylinder"},ALL:{c:"8A2BE2",s:"sphere"},AFD:{c:"8A2BE2",s:"sphere"},NAA:{c:"8A2BE2",s:"cube"},SIA:{c:"8A2BE2",s:"cylinder"},SIB:{c:"8A2BE2",s:"cylinder"},AMU:{c:"8A2BE2",s:"cylinder"},X0X:{c:"1E90FF",s:"cone"},X1X:{c:"1E90FF",s:"cone"},NGC:{c:"1E90FF",s:"cylinder"},NGE:{c:"1E90FF",s:"cylinder"},"4N2":{c:"A0522D",s:"sphere"},HSQ:{c:"A0522D",s:"cube"},IDR:{c:"A0522D",s:"cone"},MUR:{c:"A0522D",s:"cylinder"},FUC:{c:"FF0000",s:"cone"},FUL:{c:"FF0000",s:"cone"}},this.nucleotidesArray=[" G"," A"," T"," C"," U"," DG"," DA"," DT"," DC"," DU","G","A","T","C","U","DG","DA","DT","DC","DU"],this.ionsArray=[" K"," NA"," MG"," AL"," CA"," TI"," MN"," FE"," NI"," CU"," ZN"," AG"," BA"," F"," CL"," BR"," I","K","NA","MG","AL","CA","TI","MN","FE","NI","CU","ZN","AG","BA","F","CL","BR","I"],this.cationsTrimArray=["K","NA","MG","AL","CA","TI","MN","FE","NI","CU","ZN","AG","BA"],this.anionsTrimArray=["F","CL","BR","I"],this.ionCharges={K:1,NA:1,MG:2,AL:3,CA:2,TI:3,MN:2,FE:3,NI:2,CU:2,ZN:2,AG:1,BA:2},this.vdwRadii={H:1.08,HE:1.34,LI:1.75,BE:2.05,B:1.47,C:1.49,N:1.41,O:1.4,F:1.39,NE:1.68,NA:1.84,MG:2.05,AL:2.11,SI:2.07,P:1.92,S:1.82,CL:1.83,AR:1.93,K:2.05,CA:2.21,SC:2.16,TI:1.87,V:1.79,CR:1.89,MN:1.97,FE:1.94,CO:1.92,NI:1.84,CU:1.86,ZN:2.1,GA:2.08,GE:2.15,AS:2.06,SE:1.93,BR:1.98,KR:2.12,RB:2.16,SR:2.24,Y:2.19,ZR:1.86,NB:2.07,MO:2.09,TC:2.09,RU:2.07,RH:1.95,PD:2.02,AG:2.03,CD:2.3,IN:2.36,SN:2.33,SB:2.25,TE:2.23,I:2.23,XE:2.21,CS:2.22,BA:2.51,LA:2.4,CE:2.35,PR:2.39,ND:2.29,PM:2.36,SM:2.29,EU:2.33,GD:2.37,TB:2.21,DY:2.29,HO:2.16,ER:2.35,TM:2.27,YB:2.42,LU:2.21,HF:2.12,TA:2.17,W:2.1,RE:2.17,OS:2.16,IR:2.02,PT:2.09,AU:2.17,HG:2.09,TL:2.35,PB:2.32,BI:2.43,PO:2.29,AT:2.36,RN:2.43,FR:2.56,RA:2.43,AC:2.6,TH:2.37,PA:2.43,U:2.4,NP:2.21,PU:2.56,AM:2.56,CM:2.56,BK:2.56,CF:2.56,ES:2.56,FM:2.56},this.covalentRadii={H:.31,HE:.28,LI:1.28,BE:.96,B:.84,C:.76,N:.71,O:.66,F:.57,NE:.58,NA:1.66,MG:1.41,AL:1.21,SI:1.11,P:1.07,S:1.05,CL:1.02,AR:1.06,K:2.03,CA:1.76,SC:1.7,TI:1.6,V:1.53,CR:1.39,MN:1.39,FE:1.32,CO:1.26,NI:1.24,CU:1.32,ZN:1.22,GA:1.22,GE:1.2,AS:1.19,SE:1.2,BR:1.2,KR:1.16,RB:2.2,SR:1.95,Y:1.9,ZR:1.75,NB:1.64,MO:1.54,TC:1.47,RU:1.46,RH:1.42,PD:1.39,AG:1.45,CD:1.44,IN:1.42,SN:1.39,SB:1.39,TE:1.38,I:1.39,XE:1.4,CS:2.44,BA:2.15,LA:2.07,CE:2.04,PR:2.03,ND:2.01,PM:1.99,SM:1.98,EU:1.98,GD:1.96,TB:1.94,DY:1.92,HO:1.92,ER:1.89,TM:1.9,YB:1.87,LU:1.87,HF:1.75,TA:1.7,W:1.62,RE:1.51,OS:1.44,IR:1.41,PT:1.36,AU:1.36,HG:1.32,TL:1.45,PB:1.46,BI:1.48,PO:1.4,AT:1.5,RN:1.5,FR:2.6,RA:2.21,AC:2.15,TH:2.06,PA:2,U:1.96,NP:1.9,PU:1.87,AM:1.8,CM:1.69},this.atomColors={H:this.thr(16777215),He:this.thr(16761035),HE:this.thr(16761035),Li:this.thr(11674146),LI:this.thr(11674146),B:this.thr(65280),C:this.thr(11184810),N:this.thr(255),O:this.thr(15728640),F:this.thr(14329120),Na:this.thr(255),NA:this.thr(255),Mg:this.thr(2263842),MG:this.thr(2263842),Al:this.thr(8421520),AL:this.thr(8421520),Si:this.thr(14329120),SI:this.thr(14329120),P:this.thr(16753920),S:this.thr(16762930),Cl:this.thr(65280),CL:this.thr(65280),Ca:this.thr(8421520),CA:this.thr(8421520),Ti:this.thr(8421520),TI:this.thr(8421520),Cr:this.thr(8421520),CR:this.thr(8421520),Mn:this.thr(8421520),MN:this.thr(8421520),Fe:this.thr(16753920),FE:this.thr(16753920),Ni:this.thr(10824234),NI:this.thr(10824234),Cu:this.thr(10824234),CU:this.thr(10824234),Zn:this.thr(10824234),ZN:this.thr(10824234),Br:this.thr(10824234),BR:this.thr(10824234),Ag:this.thr(8421520),AG:this.thr(8421520),I:this.thr(10494192),Ba:this.thr(16753920),BA:this.thr(16753920),Au:this.thr(14329120),AU:this.thr(14329120)},this.atomnames={H:"Hydrogen",HE:"Helium",LI:"Lithium",B:"Boron",C:"Carbon",N:"Nitrogen",O:"Oxygen",F:"Fluorine",NA:"Sodium",MG:"Magnesium",AL:"Aluminum",SI:"Silicon",P:"Phosphorus",S:"Sulfur",CL:"Chlorine",CA:"Calcium",TI:"Titanium",CR:"Chromium",MN:"Manganese",FE:"Iron",NI:"Nickel",CU:"Copper",ZN:"Zinc",BR:"Bromine",AG:"Silver",I:"Iodine",BA:"Barium",AU:"Gold"},this.defaultAtomColor=this.thr(13421772),this.stdChainColors=[this.thr(16711935),this.thr(255),this.thr(10053171),this.thr(65433),this.thr(16750848),this.thr(16737894),this.thr(3329330),this.thr(2003199),this.thr(16416882),this.thr(16753920),this.thr(52945),this.thr(16738740),this.thr(65280),this.thr(255),this.thr(16711680),this.thr(16776960),this.thr(65535),this.thr(16711935),this.thr(3978097),this.thr(4620980),this.thr(13458524),this.thr(16770229),this.thr(11529966),this.thr(15631086),this.thr(25600),this.thr(139),this.thr(9109504),this.thr(13468991),this.thr(35723),this.thr(9699539)],this.backgroundColors={black:this.thr(0),grey:this.thr(13421772),white:this.thr(16777215),transparent:this.thr(16777215)},this.residueColors={ALA:this.thr(13158600),ARG:this.thr(1334015),ASN:this.thr(56540),ASP:this.thr(15075850),CYS:this.thr(15132160),GLN:this.thr(56540),GLU:this.thr(15075850),GLY:this.thr(15461355),HIS:this.thr(8553170),ILE:this.thr(1016335),LEU:this.thr(1016335),LYS:this.thr(1334015),MET:this.thr(15132160),PHE:this.thr(3289770),PRO:this.thr(14456450),SER:this.thr(16422400),THR:this.thr(16422400),TRP:this.thr(11819700),TYR:this.thr(3289770),VAL:this.thr(1016335),ASX:this.thr(16738740),GLX:this.thr(16738740),G:this.thr(32768),A:this.thr(6324479),T:this.thr(16744448),C:this.thr(16711680),U:this.thr(16744448),DG:this.thr(32768),DA:this.thr(6324479),DT:this.thr(16744448),DC:this.thr(16711680),DU:this.thr(16744448)},this.residueArea={ALA:247,ARG:366,ASN:290,ASP:285,CYS:271,GLN:336,GLU:325,GLY:217,HIS:340,ILE:324,LEU:328,LYS:373,MET:346,PHE:366,PRO:285,SER:265,THR:288,TRP:414,TYR:387,VAL:293,ASX:290,GLX:336,G:520,A:507,T:515,C:467,U:482,DG:520,DA:507,DT:515,DC:467,DU:482},this.defaultResidueColor=this.thr(12492910),this.chargeColors={" G":this.thr(16711680)," A":this.thr(16711680)," T":this.thr(16711680)," C":this.thr(16711680)," U":this.thr(16711680)," DG":this.thr(16711680)," DA":this.thr(16711680)," DT":this.thr(16711680)," DC":this.thr(16711680)," DU":this.thr(16711680),G:this.thr(16711680),A:this.thr(16711680),T:this.thr(16711680),C:this.thr(16711680),U:this.thr(16711680),DG:this.thr(16711680),DA:this.thr(16711680),DT:this.thr(16711680),DC:this.thr(16711680),DU:this.thr(16711680),ARG:this.thr(255),LYS:this.thr(255),ASP:this.thr(16711680),GLU:this.thr(16711680),HIS:this.thr(8421631),GLY:this.thr(8947848),PRO:this.thr(8947848),ALA:this.thr(8947848),VAL:this.thr(8947848),LEU:this.thr(8947848),ILE:this.thr(8947848),PHE:this.thr(8947848),SER:this.thr(8947848),THR:this.thr(8947848),ASN:this.thr(8947848),GLN:this.thr(8947848),TYR:this.thr(8947848),MET:this.thr(8947848),CYS:this.thr(8947848),TRP:this.thr(8947848)},this.hydrophobicColors={" G":this.thr(16711680)," A":this.thr(16711680)," T":this.thr(16711680)," C":this.thr(16711680)," U":this.thr(16711680)," DG":this.thr(16711680)," DA":this.thr(16711680)," DT":this.thr(16711680)," DC":this.thr(16711680)," DU":this.thr(16711680),G:this.thr(16711680),A:this.thr(16711680),T:this.thr(16711680),C:this.thr(16711680),U:this.thr(16711680),DG:this.thr(16711680),DA:this.thr(16711680),DT:this.thr(16711680),DC:this.thr(16711680),DU:this.thr(16711680),ARG:this.thr(255),LYS:this.thr(255),ASP:this.thr(16711680),GLU:this.thr(16711680),HIS:this.thr(8421631),TRP:this.thr().setHSL(1/3,1,.5),PHE:this.thr().setHSL(1/3,1,.5909090909090908),LEU:this.thr().setHSL(1/3,1,.700956937799043),ILE:this.thr().setHSL(1/3,1,.7320574162679425),TYR:this.thr().setHSL(1/3,1,.5+.69/2.09),MET:this.thr().setHSL(1/3,1,.5+.71/2.09),VAL:this.thr().setHSL(1/3,1,.5+.815/2.09),CYS:this.thr().setHSL(1/3,1,.5+1.035/2.09),PRO:this.thr().setHSL(1/6,1,.9391304347826086),THR:this.thr().setHSL(1/6,1,.8913043478260869),SER:this.thr().setHSL(1/6,1,.8),ALA:this.thr().setHSL(1/6,1,.7826086956521738),GLN:this.thr().setHSL(1/6,1,.6652173913043478),ASN:this.thr().setHSL(1/6,1,.6304347826086956),GLY:this.thr().setHSL(1/6,1,.5)},this.normalizedHPColors={" G":this.thr(16777215)," A":this.thr(16777215)," T":this.thr(16777215)," C":this.thr(16777215)," U":this.thr(16777215)," DG":this.thr(16777215)," DA":this.thr(16777215)," DT":this.thr(16777215)," DC":this.thr(16777215)," DU":this.thr(16777215),G:this.thr(16777215),A:this.thr(16777215),T:this.thr(16777215),C:this.thr(16777215),U:this.thr(16777215),DG:this.thr(16777215),DA:this.thr(16777215),DT:this.thr(16777215),DC:this.thr(16777215),DU:this.thr(16777215),ARG:this.thr(16777215),LYS:this.thr(16777215),ASP:this.thr(16777215),GLU:this.thr(16777215),HIS:this.thr(16777215),TRP:this.thr().setHSL(1/3,1,.5),PHE:this.thr().setHSL(1/3,1,.558641975308642),LEU:this.thr().setHSL(1/3,1,.6296296296296295),ILE:this.thr().setHSL(1/3,1,.6496913580246912),TYR:this.thr().setHSL(1/3,1,.5+.69/3.24),MET:this.thr().setHSL(1/3,1,.5+.71/3.24),VAL:this.thr().setHSL(1/3,1,.5+.815/3.24),CYS:this.thr().setHSL(1/3,1,.5+1.035/3.24),PRO:this.thr().setHSL(1/3,1,.5+1.115/3.24),THR:this.thr().setHSL(1/3,1,.5+1.17/3.24),SER:this.thr().setHSL(1/3,1,.5+1.275/3.24),ALA:this.thr().setHSL(1/3,1,.5+1.295/3.24),GLN:this.thr().setHSL(1/3,1,.5+1.43/3.24),ASN:this.thr().setHSL(1/3,1,.5+1.47/3.24),GLY:this.thr().setHSL(1/3,1,1)},this.hydrophobicValues={" G":3," A":3," T":3," C":3," U":3," DG":3," DA":3," DT":3," DC":3," DU":3,G:3,A:3,T:3,C:3,U:3,DG:3,DA:3,DT:3,DC:3,DU:3,ARG:1.5,LYS:1.5,ASP:3,GLU:3,HIS:2,TRP:-2.09,PHE:-1.71,LEU:-1.25,ILE:-1.12,TYR:-.71,MET:-.67,VAL:-.46,CYS:-.02,PRO:.14,THR:.25,SER:.46,ALA:.5,GLN:.77,ASN:.85,GLY:1.15},this.residueAbbrev={ALA:"A (Ala)",ARG:"R (Arg)",ASN:"N (Asn)",ASP:"D (Asp)",CYS:"C (Cys)",GLN:"Q (Gln)",GLU:"E (Glu)",GLY:"G (Gly)",HIS:"H (His)",ILE:"I (Ile)",LEU:"L (Leu)",LYS:"K (Lys)",MET:"M (Met)",PHE:"F (Phe)",PRO:"P (Pro)",SER:"S (Ser)",THR:"T (Thr)",TRP:"W (Trp)",TYR:"Y (Tyr)",VAL:"V (Val)",ASX:"X (Asx)",GLX:"X (Glx)",G:"Guanine",A:"Adenine",T:"Thymine",C:"Cytosine",U:"Uracil",DG:"deoxy-Guanine",DA:"deoxy-Adenine",DT:"deoxy-Thymine",DC:"deoxy-Cytosine",DU:"deoxy-Uracil"},this.ssColors={helix:this.thr(16711680),sheet:this.thr(32768),coil:this.thr(6324479)},this.ssColors2={helix:this.thr(16711680),sheet:this.thr(16762880),coil:this.thr(6324479)},this.resn2restype={ALA:1,ARG:4,ASN:7,ASP:10,CYS:13,GLN:16,GLU:19,GLY:22,HIS:25,ILE:28,LEU:31,LYS:34,MET:37,PHE:40,PRO:43,SER:46,THR:49,TRP:52,TYR:55,VAL:58},this.nuclMainArray=["C1'","C1*","C2'","C2*","C3'","C3*","C4'","C4*","C5'","C5*","O3'","O3*","O4'","O4*","O5'","O5*","P","OP1","O1P","OP2","O2P"],this.b62ResArray=["A","R","N","D","C","Q","E","G","H","I","L","K","M","F","P","S","T","W","Y","V","B","Z","X","*"],this.b62Matrix=[[4,-1,-2,-2,0,-1,-1,0,-2,-1,-1,-1,-1,-2,-1,1,0,-3,-2,0,-2,-1,0,-4],[-1,5,0,-2,-3,1,0,-2,0,-3,-2,2,-1,-3,-2,-1,-1,-3,-2,-3,-1,0,-1,-4],[-2,0,6,1,-3,0,0,0,1,-3,-3,0,-2,-3,-2,1,0,-4,-2,-3,3,0,-1,-4],[-2,-2,1,6,-3,0,2,-1,-1,-3,-4,-1,-3,-3,-1,0,-1,-4,-3,-3,4,1,-1,-4],[0,-3,-3,-3,9,-3,-4,-3,-3,-1,-1,-3,-1,-2,-3,-1,-1,-2,-2,-1,-3,-3,-2,-4],[-1,1,0,0,-3,5,2,-2,0,-3,-2,1,0,-3,-1,0,-1,-2,-1,-2,0,3,-1,-4],[-1,0,0,2,-4,2,5,-2,0,-3,-3,1,-2,-3,-1,0,-1,-3,-2,-2,1,4,-1,-4],[0,-2,0,-1,-3,-2,-2,6,-2,-4,-4,-2,-3,-3,-2,0,-2,-2,-3,-3,-1,-2,-1,-4],[-2,0,1,-1,-3,0,0,-2,8,-3,-3,-1,-2,-1,-2,-1,-2,-2,2,-3,0,0,-1,-4],[-1,-3,-3,-3,-1,-3,-3,-4,-3,4,2,-3,1,0,-3,-2,-1,-3,-1,3,-3,-3,-1,-4],[-1,-2,-3,-4,-1,-2,-3,-4,-3,2,4,-2,2,0,-3,-2,-1,-2,-1,1,-4,-3,-1,-4],[-1,2,0,-1,-3,1,1,-2,-1,-3,-2,5,-1,-3,-1,0,-1,-3,-2,-2,0,1,-1,-4],[-1,-1,-2,-3,-1,0,-2,-3,-2,1,2,-1,5,0,-2,-1,-1,-1,-1,1,-3,-1,-1,-4],[-2,-3,-3,-3,-2,-3,-3,-3,-1,0,0,-3,0,6,-4,-2,-2,1,3,-1,-3,-3,-1,-4],[-1,-2,-2,-1,-3,-1,-1,-2,-2,-3,-3,-1,-2,-4,7,-1,-1,-4,-3,-2,-2,-1,-2,-4],[1,-1,1,0,-1,0,0,0,-1,-2,-2,0,-1,-2,-1,4,1,-3,-2,-2,0,0,0,-4],[0,-1,0,-1,-1,-1,-1,-2,-2,-1,-1,-1,-1,-2,-1,1,5,-2,-2,0,-1,-1,0,-4],[-3,-3,-4,-4,-2,-2,-3,-2,-2,-3,-2,-3,-1,1,-4,-3,-2,11,2,-3,-4,-3,-2,-4],[-2,-2,-2,-3,-2,-1,-2,-3,2,-1,-1,-2,-1,3,-3,-2,-2,2,7,-1,-3,-2,-1,-4],[0,-3,-3,-3,-1,-2,-2,-3,-3,3,1,-2,1,-1,-2,-2,0,-3,-1,4,-3,-2,-1,-4],[-2,-1,3,4,-3,0,1,-1,0,-3,-4,0,-3,-3,-2,0,-1,-4,-3,-3,4,1,-1,-4],[-1,0,0,1,-3,3,4,-2,0,-3,-3,1,-1,-3,-1,0,-1,-3,-2,-2,1,4,-1,-4],[0,-1,-1,-1,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-2,0,0,-2,-1,-1,-1,-1,-1,-4],[-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,1]]}thr(e){return this.icn3dui,"#0"==e&&(e="#000"),new THREE.Color(e)}}class n{constructor(e){this.icn3dui=e}onId(e,t,s){if(this.icn3dui,!(Object.keys(window).length<2)&&("#"==e.substr(0,1)&&(e=e.substr(1)),document.getElementById(e))){t.split(" ").forEach((t=>{document.getElementById(e).addEventListener(t,s)}))}}onIds(e,t,s){let i=this.icn3dui;Array.isArray(e)?e.forEach((e=>{i.myEventCls.onId(e,t,s)})):i.myEventCls.onId(e,t,s)}}class l{constructor(e){this.icn3dui=e}getRmsdSuprCls(e,t,s){let i,n,l,r,o,a,d,c,h,p,m,u,g,f=this.icn3dui,b=new Array(9),C=new THREE.Vector3,y=new THREE.Vector3,v=[],_=[],w=new Array(3),S=new Array(3),A=new Array(3),x=new Array(3),k=new Array(3),O=new Array(3);if(i=0,s<=1)return{rot:void 0,trans1:void 0,trans2:void 0,rmsd:999};let R=s;for(n=0;n0?(b[0]=x[0]*w[0]+k[0]*S[0]+O[0]*A[0],b[1]=x[0]*w[1]+k[0]*S[1]+O[0]*A[1],b[2]=x[0]*w[2]+k[0]*S[2]+O[0]*A[2],b[3]=x[1]*w[0]+k[1]*S[0]+O[1]*A[0],b[4]=x[1]*w[1]+k[1]*S[1]+O[1]*A[1],b[5]=x[1]*w[2]+k[1]*S[2]+O[1]*A[2],b[6]=x[2]*w[0]+k[2]*S[0]+O[2]*A[0],b[7]=x[2]*w[1]+k[2]*S[1]+O[2]*A[1],b[8]=x[2]*w[2]+k[2]*S[2]+O[2]*A[2]):(b[0]=x[0]*w[0]+k[0]*S[0]-O[0]*A[0],b[1]=x[0]*w[1]+k[0]*S[1]-O[0]*A[1],b[2]=x[0]*w[2]+k[0]*S[2]-O[0]*A[2],b[3]=x[1]*w[0]+k[1]*S[0]-O[1]*A[0],b[4]=x[1]*w[1]+k[1]*S[1]-O[1]*A[1],b[5]=x[1]*w[2]+k[1]*S[2]-O[1]*A[2],b[6]=x[2]*w[0]+k[2]*S[0]-O[2]*A[0],b[7]=x[2]*w[1]+k[2]*S[1]-O[2]*A[1],b[8]=x[2]*w[2]+k[2]*S[2]-O[2]*A[2]),c=Math.sqrt(c),h=Math.sqrt(h),p=Math.sqrt(p),g=c+h+u*p,m=a+d-2*g,i=m>0?Math.sqrt(m):void 0,{rot:b,trans1:I,trans2:T,rmsd:i})}eigen_values(e){let t,s,i,n,l,r,o,a,d,c,h,p,m,u,g,f,b,C,y,v;if(this.icn3dui,t=e[0],s=e[1],i=e[2],n=e[3],l=e[4],r=e[5],o=e[6],a=e[7],d=e[8],c=-(t+l+d),h=t*l+(t+l)*d-r*a-s*n-i*o,p=-t*l*d+t*r*a+s*n*d-s*r*o-i*n*a+i*l*o,m=-c*c/3+h,u=c*c*c/13.5-c*h/3+p,g=.25*u*u+m*m*m/27,g<0){let e,t;e=Math.sqrt(.25*u*u-g),t=Math.acos(-.5*u/e),C=2*Math.cbrt(e)*Math.cos(t/3)}else f=Math.cbrt(-.5*u+Math.sqrt(g)),b=Math.cbrt(-.5*u-Math.sqrt(g)),C=f+b;return C-=c/3,c+=C,p/=-C,y=.5*(-c+Math.sqrt(c*c-4*p)),v=.5*(-c-Math.sqrt(c*c-4*p)),y0&&Math.abs(r[0].x-e[e.length-1].x)<=6&&Math.abs(r[0].y-e[e.length-1].y)<=6&&Math.abs(r[0].z-e[e.length-1].z)<=6&&(p.push(r[0]),++g),u>1&&Math.abs(r[0].x-r[1].x)<=6&&Math.abs(r[0].y-r[1].y)<=6&&Math.abs(r[0].z-r[1].z)<=6&&(p.push(r[1]),++g);let f=[],b=[],C=[];o&&(g=u>0?u-1:0);let y;for(let e=-1,n=p.length,l=1/s;e<=n-3;++e){y=e-m;let r=p[-1===e?0:e],o=p[e+1],u=p[e+2],v=p[e===n-3?n-1:e+3],_=0,w=a.subdivideCls.getKnot(1,_,r,o),S=a.subdivideCls.getKnot(1,w,o,u),A=a.subdivideCls.getKnot(1,S,u,v);w-_<1e-4&&(w=_+1),S-w<1e-4&&(S=w+1),A-S<1e-4&&(A=S+1),e>-1&&(void 0===i||i[y+1])&&e>=-1+m&&e<=n-3-g+1&&(d=d.concat(f),c=c.concat(b),h=h.concat(C)),f=[],b=[],C=[];let x=(S-w)*l;for(let l=0;l=-1+m&&e<=n-3-g&&i[y+1]&&l<=parseInt(s/2)&&(d.push(new THREE.Vector3(k,O,R)),c.push(i[y+1]),h.push(t[y+1])),e>=-1+m&&e<=n-3-g+1&&i[y+2]&&l>parseInt(s/2)&&(f.push(new THREE.Vector3(k,O,R)),b.push(i[y+2]),C.push(t[y+2]))):e>=-1+m&&e<=n-3-g&&(d.push(new THREE.Vector3(k,O,R)),c.push(y+1),h.push(t[y+1]))}}i&&!i[y+1]||(d=d.concat(f),c=c.concat(b),h=h.concat(C),d.push(p[p.length-1-g]),c.push(p.length-1-g),h.push(t[p.length-1-g])),f=[],b=[],C=[],p=[];let v=[];return v.push(d),v.push(c),v.push(h),v}getKnot(e,t,s,i){return this.icn3dui,s.distanceTo(i)+t}getValueFromKnot(e,t,s,i,n,l,r,o,a){this.icn3dui;let d,c,h=(r-l)/(s-t),p=(o-r)/(i-s),m=(a-o)/(n-i),u=(s+i)*(s+i)-4*(t*s+i*n-t*n);return 0==u?(d=9999,c=9999):(d=6*(3*p*s+2*h*n+m*s-2*h*s-2*p*n-p*i-m*s)/u,c=6*(3*p*i+2*m*t+h*s-2*p*t-2*m*i-h*i-p*s)/u),p*(e-s)+r+((2*d+c)/6/(s-i)*(e-s)*(e-i)*(e-i)+(2*c+d)/6/(i-s)*(e-s)*(e-s)*(e-i))}}class o{constructor(e){this.icn3dui=e}passFloat32(e,t){let s=this.icn3dui,i=e.length;t||(t=new Uint8Array(4*i));let n=s.convertTypeCls.getDataView(t);for(let t=0;t",e+=' Very high (pLDDT > 90)
',e+=' Confident (90 > pLDDT > 70)
',e+=' Low (70 > pLDDT > 50)
',e+=' Very low (pLDDT < 50)
',e+="",'
Confident (90 > pLDDT > 70)
Low (70 > pLDDT > 50)
Very low (pLDDT < 50)
";if(e)s+=this.setAlphaFoldLegend();else{s+="
"}return s}SetChainsAdvancedMenu(){let e=this.icn3dui,t=e.icn3d;if(void 0===t.bSetChainsAdvancedMenu||!t.bSetChainsAdvancedMenu){let s=e.hashUtilsCls.cloneHash(t.hAtoms);t.definedSetsCls.setPredefinedInMenu(),t.bSetChainsAdvancedMenu=!0,t.hAtoms=e.hashUtilsCls.cloneHash(s)}}setSetsMenus(e,t){let s=this.icn3dui,i=s.icn3d;this.SetChainsAdvancedMenu();let n=e,l=e+"2",r=i.definedSetsCls.setAtomMenu(["protein"]);$("#"+s.pre+n).length&&$("#"+s.pre+n).html(" "+r),!t&&$("#"+s.pre+l).length&&$("#"+s.pre+l).html(" "+r),$("#"+s.pre+n).resizable(),t||$("#"+s.pre+l).resizable()}applyShownMenus(e){let t=this.icn3dui;t.icn3d;let s=[];for(let e in t.htmlCls.allMenus)t.htmlCls.shownMenus.hasOwnProperty(e)?$("#"+t.pre+e).parent().show():($("#"+t.pre+e).parent().hide(),s.push(e));Object.keys(t.htmlCls.shownMenus).length==Object.keys(t.htmlCls.allMenus).length?$(".icn3d-menusep").show():$(".icn3d-menusep").hide(),localStorage&&!e&&localStorage.setItem("hiddenmenus",JSON.stringify(s))}getHiddenMenusFromCache(){let e=this.icn3dui;e.icn3d,e.htmlCls.shownMenus={};let t=localStorage?localStorage.getItem("hiddenmenus"):"";if(t&&"[]"!=t){let s=JSON.parse(t);for(let t in e.htmlCls.allMenus)-1==s.indexOf(t)&&(e.htmlCls.shownMenus[t]=1)}else e.htmlCls.shownMenus=e.hashUtilsCls.cloneHash(e.htmlCls.allMenus)}displayShownMenus(){let e=this.icn3dui;e.icn3d;let t="",$("#"+e.pre+"menulist").html(t)}clickMenu1(){let e=this.icn3dui;if(e.icn3d,e.bNode)return;let t=this;e.myEventCls.onIds("#"+e.pre+"mn1_vastplus","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_vastplus","Please input PDB ID for VAST+")})),e.myEventCls.onIds("#"+e.pre+"mn1_vast","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_vast","Please input chain or PDB file for VAST")})),e.myEventCls.onIds("#"+e.pre+"mn1_foldseek","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_foldseek","Submit your selection to Foldseek")})),e.myEventCls.onIds("#"+e.pre+"mn1_mmtfid","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_mmtfid","Please input MMTF ID")})),e.myEventCls.onIds("#"+e.pre+"mn1_pdbid","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_pdbid","Please input PDB ID")})),e.myEventCls.onIds("#"+e.pre+"mn1_afid","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_afid","Please input AlphaFold UniProt ID")})),e.myEventCls.onIds("#"+e.pre+"mn1_refseqid","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_refseqid","Please input NCBI Protein Accession")})),e.myEventCls.onIds("#"+e.pre+"mn1_opmid","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_opmid","Please input OPM PDB ID")})),e.myEventCls.onIds("#"+e.pre+"mn1_align","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_align","Align two PDB structures")})),e.myEventCls.onIds("#"+e.pre+"mn1_alignaf","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_alignaf","Align two AlphaFold structures")})),e.myEventCls.onIds("#"+e.pre+"mn1_chainalign","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_chainalign","Align multiple chains by structure alignment")})),e.myEventCls.onIds("#"+e.pre+"mn1_chainalign2","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_chainalign2","Align multiple chains by sequence alignment")})),e.myEventCls.onIds("#"+e.pre+"mn1_chainalign3","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_chainalign3","Align multiple chains residue by residue")})),e.myEventCls.onIds("#"+e.pre+"mn1_mutation","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_mutation","Show the mutations in 3D")})),e.myEventCls.onIds("#"+e.pre+"mn1_pdbfile","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_pdbfile","Please input PDB File")})),e.myEventCls.onIds(["#"+e.pre+"mn1_pdbfile_app","#"+e.pre+"tool_pdbfile"],"click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_pdbfile_app","Please append PDB Files")})),e.myEventCls.onIds("#"+e.pre+"mn1_mol2file","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_mol2file","Please input Mol2 File")})),e.myEventCls.onIds("#"+e.pre+"mn1_sdffile","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_sdffile","Please input SDF File")})),e.myEventCls.onIds("#"+e.pre+"mn1_xyzfile","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_xyzfile","Please input XYZ File")})),e.myEventCls.onIds("#"+e.pre+"mn1_afmapfile","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_afmapfile","Please input AlphaFold PAE File")})),e.myEventCls.onIds("#"+e.pre+"mn1_urlfile","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_urlfile","Load data by URL")})),e.myEventCls.onIds("#"+e.pre+"mn1_fixedversion","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_fixedversion","Open Share Link URL in the archived version of iCn3D")})),e.myEventCls.onIds("#"+e.pre+"reload_fixedversion","click",(function(s){let i=e.icn3d,n=$("#"+e.pre+"sharelinkurl").val();t.setLogCmd("open "+n,!1),localStorage.setItem("fixedversion","1");let l=i.structures&&Object.keys(i.structures).length>0?"_blank":"_self";window.open(n,l)})),e.myEventCls.onIds("#"+e.pre+"mn1_mmciffile","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_mmciffile","Please input mmCIF File")})),e.myEventCls.onIds("#"+e.pre+"mn1_mmcifid","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_mmcifid","Please input mmCIF ID")})),e.myEventCls.onIds("#"+e.pre+"mn1_mmdbid","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_mmdbid","Please input MMDB or PDB ID")})),e.myEventCls.onIds(["#"+e.pre+"mn1_mmdbafid",,"#"+e.pre+"tool_mmdbafid"],"click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_mmdbafid","Please input PDB/MMDB/AlphaFold UniProt IDs")})),e.myEventCls.onIds("#"+e.pre+"mn1_blast_rep_id","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_blast_rep_id","Align sequence to structure")})),e.myEventCls.onIds("#"+e.pre+"mn1_esmfold","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_esmfold","Sequence to structure prediction with ESMFold")})),e.myEventCls.onIds("#"+e.pre+"mn1_proteinname","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_proteinname","Please input protein or gene name")})),e.myEventCls.onIds("#"+e.pre+"mn1_cid","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_cid","Please input PubChem CID")})),e.myEventCls.onIds("#"+e.pre+"mn1_pngimage","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_pngimage","Please input the PNG image")})),e.myEventCls.onIds("#"+e.pre+"mn1_state","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_state","Please input the state file")})),e.myEventCls.onIds("#"+e.pre+"mn1_selection","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_selection","Please input the selection file")})),e.myEventCls.onIds("#"+e.pre+"mn1_dsn6","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_dsn6","Please input the map file to display electron density map")})),e.myEventCls.onIds(["#"+e.pre+"mn1_delphi","#"+e.pre+"mn1_delphi2","#"+e.pre+"tool_delphi"],"click",(function(t){e.icn3d.loadPhiFrom="delphi",$("#"+e.pre+"dl_delphi_tabs").tabs(),e.htmlCls.dialogCls.openDlg("dl_delphi","Please set parameters to display DelPhi potential map")})),e.myEventCls.onIds("#"+e.pre+"mn1_phi","click",(function(t){e.icn3d.loadPhiFrom="phi",$("#"+e.pre+"dl_phi_tabs").tabs(),$("#"+e.pre+"phitab1_tabs").tabs(),$("#"+e.pre+"phitab2_tabs").tabs(),e.htmlCls.dialogCls.openDlg("dl_phi","Please input local phi or cube file to display DelPhi potential map")})),e.myEventCls.onIds("#"+e.pre+"mn1_phiurl","click",(function(t){e.icn3d.loadPhiFrom="phiurl",$("#"+e.pre+"dl_phiurl_tabs").tabs(),$("#"+e.pre+"phiurltab1_tabs").tabs(),$("#"+e.pre+"phiurltab2_tabs").tabs(),e.htmlCls.dialogCls.openDlg("dl_phiurl","Please input URL phi or cube file to display DelPhi potential map")})),e.myEventCls.onIds("#"+e.pre+"mn1_dsn6url","click",(function(t){e.icn3d,e.htmlCls.dialogCls.openDlg("dl_dsn6url","Please input the map file to display electron density map")})),e.myEventCls.onIds("#"+e.pre+"mn1_exportState","click",(function(s){let i=e.icn3d;t.setLogCmd("export state file",!1);let n=Object.keys(i.structures).join(",");i.saveFileCls.saveFile(n+"_statefile.txt","command")})),e.myEventCls.onIds("#"+e.pre+"mn1_exportPdbRes","click",(function(s){e.icn3d,e.htmlCls.setHtmlCls.exportPdb(),t.setLogCmd("export pdb",!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportSecondary","click",(function(s){e.icn3d,e.htmlCls.setHtmlCls.exportSecondary(),t.setLogCmd("export secondary structure",!0)})),e.myEventCls.onIds(["#"+e.pre+"delphipdb","#"+e.pre+"phipdb"],"click",(function(s){let i=e.icn3d,n=i.saveFileCls.getSelectedResiduePDB();t.setLogCmd("export PDB of selected residues",!1);let l=Object.keys(i.structures).join(",");i.saveFileCls.saveFile(l+"_icn3d_residues.pdb","text",[n])})),e.myEventCls.onIds(["#"+e.pre+"delphipqr","#"+e.pre+"phipqr","#"+e.pre+"phiurlpqr"],"click",(async function(s){e.icn3d,await e.htmlCls.setHtmlCls.exportPqr(),t.setLogCmd("export pqr",!0)})),e.myEventCls.onIds("#"+e.pre+"profixpdb","click",(async function(s){let i=e.icn3d;await i.scapCls.exportPdbProfix(!1),t.setLogCmd("export pdb missing atoms",!0)})),e.myEventCls.onIds("#"+e.pre+"profixpdbh","click",(async function(s){let i=e.icn3d;await i.scapCls.exportPdbProfix(!0),t.setLogCmd("export pdb hydrogen",!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportIgstrand","click",(async function(s){e.icn3d.refnumCls.exportRefnum("igstrand"),t.setLogCmd("export refnum igstrand",!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportKabat","click",(async function(s){e.icn3d.refnumCls.exportRefnum("kabat"),t.setLogCmd("export refnum kabat",!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportImgt","click",(async function(s){e.icn3d.refnumCls.exportRefnum("imgt"),t.setLogCmd("export refnum imgt",!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportStl","click",(function(s){let i=e.icn3d;t.setLogCmd("export stl file",!1),i.export3DCls.exportStlFile("")})),e.myEventCls.onIds("#"+e.pre+"mn1_exportVrml","click",(function(s){let i=e.icn3d;t.setLogCmd("export vrml file",!1),i.export3DCls.exportVrmlFile("")})),e.myEventCls.onIds("#"+e.pre+"mn1_exportStlStab","click",(function(s){let i=e.icn3d;t.setLogCmd("export stl stabilizer file",!1),i.threeDPrintCls.hideStabilizer(),i.threeDPrintCls.resetAfter3Dprint(),i.threeDPrintCls.addStabilizer(),i.export3DCls.exportStlFile("_stab")})),e.myEventCls.onIds("#"+e.pre+"mn1_exportVrmlStab","click",(function(s){let i=e.icn3d;t.setLogCmd("export vrml stabilizer file",!1),i.threeDPrintCls.hideStabilizer(),i.threeDPrintCls.resetAfter3Dprint(),i.threeDPrintCls.addStabilizer(),i.export3DCls.exportVrmlFile("_stab")})),e.myEventCls.onIds("#"+e.pre+"mn6_exportInteraction","click",(async function(s){let i=e.icn3d;t.setLogCmd("export interactions",!1),void 0!==e.cfg.mmdbid&&await i.viewInterPairsCls.retrieveInteractionData(),i.viewInterPairsCls.exportInteractions()})),e.myEventCls.onIds(["#"+e.pre+"mn1_exportCanvas","#"+e.pre+"saveimage"],"click",(async function(s){let i=e.icn3d;t.setLogCmd("export canvas",!1);await i.shareLinkCls.shareLink(!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportCanvas1","click",(async function(s){let i=e.icn3d;t.setLogCmd("export canvas 1",!0),i.scaleFactor=1,await i.shareLinkCls.shareLink(!0,!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportCanvas2","click",(async function(s){let i=e.icn3d;t.setLogCmd("export canvas 2",!0),i.scaleFactor=2,await i.shareLinkCls.shareLink(!0,!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportCanvas4","click",(async function(s){let i=e.icn3d;t.setLogCmd("export canvas 4",!0),i.scaleFactor=4,await i.shareLinkCls.shareLink(!0,!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportCanvas8","click",(async function(s){let i=e.icn3d;t.setLogCmd("export canvas 8",!0),i.scaleFactor=8,await i.shareLinkCls.shareLink(!0,!0)})),e.myEventCls.onIds("#"+e.pre+"mn1_exportCounts","click",(function(s){let i=e.icn3d;t.setLogCmd("export counts",!1);let n='"+t.startValue+" "+t.midValue+" "+t.endValue+"
Total Count for atoms with coordinates: ';n+="Structure Count Chain Count Residue Count Atom Count ",n+=""+Object.keys(i.structures).length+" "+Object.keys(i.chains).length+" "+Object.keys(i.residues).length+" "+Object.keys(i.atoms).length+"
",n+="Counts by Chain for atoms with coordinates: ";let l=Object.keys(i.chains);for(let e=0,t=l.length;eStructure Chain Residue Count Atom Count "+r+" "+o+" "+Object.keys(a).length+" "+Object.keys(i.chains[t]).length+" "}n+="
",l+="",l+=this.setTools(),l+=i.htmlCls.divStr+"title' class='icn3d-commandTitle' style='font-size:1.2em; font-weight:normal; position:absolute; z-index:1; float:left; display:table-row; margin: 85px 0px 0px 5px; color:"+n+"; width:"+i.htmlCls.WIDTH+"px'>",l+=i.htmlCls.divStr+"viewer' style='position:relative; width:100%; height:100%; background-color: "+i.htmlCls.GREYD+";'>",l+=i.htmlCls.divStr+"mnLogSection'>",l+="",l+=" ",void 0===i.cfg.mmtfid){let e="top:180px; font-size: 1.8em;";l+=i.htmlCls.divStr+"wait' style='position:absolute; left:50px; "+e+" color: #444444;'>Loading data..."}l+="",(void 0===i.cfg.showcommand||i.cfg.showcommand)&&(l+=this.setLogWindow()),l+="",l+="",l+=i.htmlCls.setDialogCls.setDialogs(),l+=i.htmlCls.setDialogCls.setCustomDialogs(),$("#"+e).html(l),$("accordion").accordion({collapsible:!0,active:!1,heightStyle:"content"}),$("accordion div").removeClass("ui-accordion-content ui-corner-all ui-corner-bottom ui-widget-content"),$(".icn3d-mn-item").menu({position:{my:"left top",at:"right top"}}),$(".icn3d-mn-item").hover((function(){}),(function(){$("accordion").accordion("option","active","none")})),$("#"+i.pre+"accordion1").hover((function(){$("#"+i.pre+"accordion1 div").css("display","block")}),(function(){$("#"+i.pre+"accordion1 div").css("display","none")})),$("#"+i.pre+"accordion2").hover((function(){$("#"+i.pre+"accordion2 div").css("display","block")}),(function(){$("#"+i.pre+"accordion2 div").css("display","none")})),$("#"+i.pre+"accordion2b").hover((function(){$("#"+i.pre+"accordion2b div").css("display","block")}),(function(){$("#"+i.pre+"accordion2b div").css("display","none")})),$("#"+i.pre+"accordion3").hover((function(){$("#"+i.pre+"accordion3 div").css("display","block")}),(function(){$("#"+i.pre+"accordion3 div").css("display","none")})),$("#"+i.pre+"accordion4").hover((function(){$("#"+i.pre+"accordion4 div").css("display","block")}),(function(){$("#"+i.pre+"accordion4 div").css("display","none")})),$("#"+i.pre+"accordion5").hover((function(){$("#"+i.pre+"accordion5 div").css("display","block")}),(function(){$("#"+i.pre+"accordion5 div").css("display","none")})),$("#"+i.pre+"accordion6").hover((function(){$("#"+i.pre+"accordion6 div").css("display","block")}),(function(){$("#"+i.pre+"accordion6 div").css("display","none")}))}setTopMenusHtmlMobile(e,t,s){let i=this.icn3dui;if(i.bNode)return"";let n="black"==i.htmlCls.opts.background?i.htmlCls.GREYD:"black",l="";if(l+="";let r=' ",l+="';if(l+=r+this.setMenu1()+" ",l+=r+this.setMenu2()+"",l+=r+this.setMenu2b()+"",l+=r+this.setMenu3()+"",l+=r+this.setMenu4()+"",l+=r+this.setMenu5()+"",l+=r+this.setMenu6()+"",i.htmlCls.shownMenus=i.hashUtilsCls.cloneHash(i.htmlCls.simpleMenus),l+=r+"☰
":l+="☰
",l+="",t+=this.setTools_base(),t+="
",t+="",t="regular",s=" ",e}setTheme(e){let t,s,i,n,l,r=this.icn3dui;if(r.bNode)return"";r.htmlCls.themecolor=e,"orange"==e?(t="#e78f08",s="#f6a828",i="ui-bg_gloss-wave_35_f6a828_500x100.png",n="ui-icons_ef8c08_256x240.png",l="#eb8f00"):"black"==e?(t="#333333",s="#333333",i="ui-bg_gloss-wave_25_333333_500x100.png",n="ui-icons_222222_256x240.png",l="#222222"):"blue"==e&&(t="#4297d7",s="#5c9ccc",i="ui-bg_gloss-wave_55_5c9ccc_500x100.png",n="ui-icons_228ef1_256x240.png",l="#444"),$(".ui-widget-header").css({border:"1px solid "+t,background:s+' url("https://www.ncbi.nlm.nih.gov/Structure/icn3d/lib/images/'+i+'") 50% 50% repeat-x',color:"#fff","font-weight":"bold"}),$(".ui-button .ui-icon").css({"background-image":"url(https://www.ncbi.nlm.nih.gov/Structure/icn3d/lib/images/"+n+")"}),$(".ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited").css({color:l,"text-decoration":"none"})}setLogWindow(e,t){let s=this.icn3dui;if(s.bNode)return"";let i,n="",l=s.htmlCls.setHtmlCls.getCookie("cmdwindow");return""!=l?(i=void 0!==t?t:parseInt(l),1==i?(s.htmlCls.LOG_HEIGHT=180,s.htmlCls.CMD_HEIGHT=.8*s.htmlCls.LOG_HEIGHT,e||(n+=s.htmlCls.divStr+"cmdlog' style='float:left; margin-top: 5px; width: 100%;'>"),n+=""):(s.htmlCls.LOG_HEIGHT=65,s.htmlCls.CMD_HEIGHT=.8*s.htmlCls.LOG_HEIGHT,e||(n+=s.htmlCls.divStr+"cmdlog' style='float:left; margin-top: 5px; width: 100%;'>"),n+="")):(i=0,s.htmlCls.LOG_HEIGHT=65,s.htmlCls.CMD_HEIGHT=.8*s.htmlCls.LOG_HEIGHT,e||(n+=s.htmlCls.divStr+"cmdlog' style='float:left; margin-top: 5px; width: 100%;'>"),n+=""),e||(n+=""),e&&(s.htmlCls.clickMenuCls.setLogCmd("set cmdwindow "+i,!0),$("#"+s.pre+"cmdlog").html(n)),n}setMenu1(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu1_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+="",i=" ";return e+=s+this.setIcon(t,"tool_mmdbafid","Input PDB/MMDB/AlphaFold IDs","id",void 0,!0)+" ",e+=s+this.setIcon(t,"tool_pdbfile","Input PDB Files (appendable)","file-alt")+"",e+=s+this.setIcon(t,"tool_sharelink","Get Share Link","link")+"",e+=s+this.setIcon(t,"saveimage","Save iCn3D PNG Image","camera")+"",e+=i+this.setIcon(t,"tool_definedsets","Defined Sets","object-group")+"",e+=s+this.setIcon(t,"tool_aroundsphere","Select by Distance","dot-circle")+"",e+=s+this.setIcon(t,"tool_saveselection","Save Selection as a Set","save")+"",e+=s+this.setIcon(t,"toggleHighlight","Toggle Highlight","highlighter")+"",e+=i+this.setIcon(t,"show_selected","View Selection","eye")+"",e+=s+this.setIcon(t,"tool_selectedcenter","Zoom in Selection","search-plus")+"",e+=s+this.setIcon(t,"alternate","Alternate the Structures by keying the letter 'a'","a",void 0,!0,!0)+"",e+=s+this.setIcon(t,"tool_resetOrientation","Reset Orientation","undo-alt")+"",e+=i+this.setIcon(t,"tool_proteinsRibbon","Style Ribbon for proteins","dna")+"",e+=s+this.setIcon(t,"tool_proteinsSphere","Style Sphere for proteins","volleyball-ball")+"",e+=s+this.setIcon(t,"tool_surfaceVDW","Show Van der Waals Surface","cloud")+"",e+=s+this.setIcon(t,"tool_bkgd","Toggle Background Color","adjust")+"",e+=i+this.setIcon(t,"tool_clrRainbowChain","Color Rainbow for Chains","rainbow")+"",e+=s+this.setIcon(t,"tool_clrSSGreen","Color by Secondary Structures","ring")+"",e+=s+this.setIcon(t,"tool_clrChain","Color by Chains","layer-group")+"",e+=s+this.setIcon(t,"tool_clrAtom","Color by Atoms","atom")+"",e+=i+this.setIcon(t,"tool_selectannotations","Sequences & Annotations","grip-lines")+"",e+=s+this.setIcon(t,"hbondsYes","Interactions","users")+"",e+=s+this.setIcon(t,"tool_delphi","Delphi Potentials","cloud-meatball")+"",e+=s+this.setIcon(t,"removeLabels","Remove Labels","remove-format")+"",e+=i+this.setIcon("link","tool-gallery","Gallery","image","https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#gallery")+"",e+=s+this.setIcon("link","tool-video","Videos","file-video","https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#videos")+"",e+=s+this.setIcon("link","tool-github","iCn3D GitHub","code","https://github.com/ncbi/icn3d")+"",e+=s+this.setIcon("link","tool-hints","Transform Hints","info-circle","https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#useicn3d")+"",e+="",t+=this.getMenuText("mn1_searchgrooup","Search Structure "+e.htmlCls.wifiStr,void 0,1,1),t+="
",t}setMenu2(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu2_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+="",t+=this.getMenuUrl("mn1_searchstru","https://www.ncbi.nlm.nih.gov/structure","PDB Structures "+e.htmlCls.wifiStr,1,2),t+=this.getLink("mn1_proteinname","AlphaFold Structures "+e.htmlCls.wifiStr,1,2),t+=this.getMenuUrl("mn1_afdatabase","https://alphafold.ebi.ac.uk","AlphaFold UniProt Database "+e.htmlCls.wifiStr,void 0,2),t+="
",t+="",t+=this.getMenuText("mn1_searchsimilar","Search Similar"+e.htmlCls.wifiStr,void 0,void 0,1),t+="",t+=this.getLink("mn1_vastplus","NCBI VAST+ (PDB Complex)"+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_vast","NCBI VAST (PDB Chain)"+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_foldseek","Foldseek (PDB & AlphaFold)"+e.htmlCls.wifiStr,void 0,2),t+="
",t+="",t+=this.getMenuText("mn1_retrievebyid","Retrieve by ID",void 0,1,1),t+="",t+=this.getLink("mn1_mmdbafid","PDB/MMDB/AlphaFold IDs"+e.htmlCls.wifiStr,1,2),t+=this.getLink("mn1_mmdbid","NCBI MMDB ID (annotation) "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_mmtfid","RCSB MMTF ID (fast) "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_pdbid","RCSB PDB ID "+e.htmlCls.wifiStr,void 0,2),t+=this.getMenuText("mn1_afwrap","AlphaFold Structures",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn1_openfile","Open File",void 0,1,1),t+="",t+=this.getLink("mn1_afid","UniProt ID "+e.htmlCls.wifiStr,void 0,3),t+=this.getLink("mn1_refseqid","NCBI Protein Accession "+e.htmlCls.wifiStr,void 0,3),t+="
",t+=this.getLink("mn1_opmid","OPM PDB ID "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_mmcifid","RCSB mmCIF ID "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_cid","PubChem CID "+e.htmlCls.wifiStr,1,2),t+="",t+=this.getLink("mn1_pdbfile_app","PDB Files (appendable)",1,2),t+=this.getLink("mn1_mmciffile","mmCIF File",void 0,2),t+=this.getLink("mn1_mol2file","Mol2 File",void 0,2),t+=this.getLink("mn1_sdffile","SDF File",void 0,2),t+=this.getLink("mn1_xyzfile","XYZ File",void 0,2),t+=this.getLink("mn1_afmapfile","AlphaFold PAE File",void 0,2),t+=this.getLink("mn1_urlfile","URL(CORS) "+e.htmlCls.wifiStr,void 0,2),t+=this.getMenuSep(),t+=this.getLink("mn1_pngimage","iCn3D PNG Image",1,2),t+=this.getLink("mn1_state","State/Script File",void 0,2),t+=this.getLink("mn1_fixedversion","Share Link in Archived Ver. "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_selection","Selection File",void 0,2),t+=this.getMenuSep(),t+=this.getMenuText("mn1_dsn6wrap","Electron Density",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn1_fold","Predict by Seq.",void 0,void 0,1),t+="",t+=this.getLink("mn1_dsn6","Local File",void 0,3),t+=this.getLink("mn1_dsn6url","URL(CORS) "+e.htmlCls.wifiStr,void 0,3),t+="
",t+="",t+=this.getLink("mn1_esmfold","ESMFold",void 0,2),t+=this.getLink("mn1_alphafold","AlphaFold2 via ColabFold"+e.htmlCls.wifiStr,void 0,2),t+="
",t+=this.getMenuText("mn1_alignwrap","Align",void 0,1,1),t+="",t+=this.getMenuText("mn1_chainalignwrap","Multiple Chains",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn2_realignWrap","Realign Selection",void 0,void 0,1),t+="",t+=this.getRadio("mn1_chainalignRad","mn1_chainalign","by Structure Alignment "+e.htmlCls.wifiStr,void 0,1,3),t+=this.getRadio("mn1_chainalignRad","mn1_chainalign2","by Sequence Alignment "+e.htmlCls.wifiStr,void 0,1,3),t+=this.getRadio("mn1_chainalignRad","mn1_chainalign3","Residue by Residue",void 0,void 0,3),t+="
",t+="",t+=this.getMenuText("mn1_aligntwostru","Protein Complexes",void 0,void 0,2),t+="",t+=this.getLink("mn1_align","Two PDB Structures "+e.htmlCls.wifiStr,void 0,3),t+=this.getLink("mn1_alignaf","Two AlphaFold Structures "+e.htmlCls.wifiStr,void 0,3),t+="
",t+=this.getLink("mn1_blast_rep_id","Sequence to Structure",void 0,2),t+="",t+=this.getMenuText("mn2_chainrealignwrap","Multiple Chains",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn1_3dpprint","3D Printing",void 0,1,1),t+="",t+=this.getRadio("mn2_realign","mn2_realignonstruct","by Structure Alignment "+e.htmlCls.wifiStr,void 0,void 0,3),t+=this.getRadio("mn2_realign","mn2_realignonseqalign","by Sequence Alignment "+e.htmlCls.wifiStr,void 0,void 0,3),t+=this.getRadio("mn2_realign","mn2_realignresbyres","Residue by Residue",void 0,void 0,3),t+="
",t+=this.getLink("mn2_realigntwostru","Protein Complexes",void 0,2),t+="",void 0===e.cfg.cid?(t+=this.getLink("mn1_exportVrmlStab","WRL/VRML(Color, W/ Stab.)",1,2),t+=this.getLink("mn1_exportStlStab","STL(W/ Stabilizers)",1,2),t+=this.getMenuSep(),t+=this.getLink("mn1_exportVrml","WRL/VRML(Color)",void 0,2),t+=this.getLink("mn1_exportStl","STL",void 0,2),t+=this.getMenuSep(),t+=this.getLink("mn1_stabilizerYes","Add All Stabilizers",void 0,2),t+=this.getLink("mn1_stabilizerNo","Remove All Stabilizers",void 0,2),t+=this.getMenuSep(),t+=this.getLink("mn1_stabilizerOne","Add One Stabilizer",void 0,2),t+=this.getLink("mn1_stabilizerRmOne","Remove One Stabilizer",void 0,2),t+=this.getMenuSep(),t+=this.getLink("mn1_thicknessSet","Set Thickness",void 0,2)):(t+=this.getLink("mn1_exportVrml","VRML(Color)",1,2),t+=this.getLink("mn1_exportStl","STL",1,2)),t+="
",t+="",t+=this.getMenuText("mn1_savefile","Save File",void 0,1,1),t+="",t+=this.getMenuText("mn1_savepngimage","iCn3D PNG Image",void 0,1,2),t+="
",t+="",t+=this.getLink("mn1_sharelink","Share Link "+e.htmlCls.wifiStr,1,1),t+=this.getLink("mn1_replayon","Replay Each Step",void 0,1),t+=this.getMenuSep(),t+=this.getMenuText("mn1_menuwrap","Customize Menus",void 0,1,1),t+="",t+=this.getLink("mn1_exportCanvas","Original Size & HTML",1,3),t+=this.getLink("mn1_exportCanvas1","Original Size",void 0,3),t+=this.getLink("mn1_exportCanvas2","2X Large",void 0,3),t+=this.getLink("mn1_exportCanvas4","4X Large",void 0,3),t+=this.getLink("mn1_exportCanvas8","8X Large",void 0,3),t+="
",t+="",t+=this.getLink("mn1_exportState","State File",void 0,2),t+=this.getLink("mn1_exportSelections","Selection File",void 0,2),t+=this.getLink("mn1_exportSelDetails","Selection Details",void 0,2),t+=this.getLink("mn1_exportCounts","Residue Counts",void 0,2),t+=this.getLink("mn1_exportPdbRes","PDB",1,2),t+=this.getLink("profixpdb","PDB with Missing Atoms",void 0,2),void 0===e.cfg.cid&&(t+=this.getLink("mn1_exportSecondary","Secondary Structure",void 0,2)),
//!!!
-t+="",t+=this.getLink("mn1_menuall","All Menus",1,2),t+=this.getLink("mn1_menusimple","Simple Menus",1,2),t+=this.getMenuSep(),t+=this.getLink("mn1_menupref","Preferences",1,2),t+=this.getLink("mn1_menuloadpref","Load Preferences",1,2),t+="
",t+="",t+="",t+=this.getLink("mn2_definedsets","Defined Sets",1,1),t+=this.getLink("mn2_selectall","All",void 0,1),t+=this.getLink("mn2_selectdisplayed","Displayed Set",void 0,1),t+=this.getLink("mn2_aroundsphere","by Distance",1,1),t+=this.getMenuText("mn2_selbyprop","by Property",void 0,void 0,1),t+="
",t}setMenu2b(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu2b_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+="",t+=this.getLink("mn2_propPos","Positive",void 0,2),t+=this.getLink("mn2_propNeg","Negative",void 0,2),t+=this.getLink("mn2_propHydro","Hydrophobic",void 0,2),t+=this.getLink("mn2_propPolar","Polar",void 0,2),t+=this.getLink("mn2_propBfactor","B-factor/pLDDT",void 0,2),t+=this.getLink("mn2_propSolAcc","Solvent Accessibility",void 0,2),t+="
",t+="",t+=this.getLink("mn2_selectcomplement","Inverse",void 0,1),t+=this.getLink("mn2_selectmainchains","Main Chains",void 0,1),t+=this.getLink("mn2_selectsidechains","Side Chains",void 0,1),t+=this.getLink("mn2_selectmainsidechains","Main & Side Chains",void 0,1),t+=this.getLink("mn2_command","Advanced",void 0,1),void 0===e.cfg.cid?(t+=this.getMenuText("mn2_selon3d","Select on 3D",void 0,1,1),t+="",t+='
",t+=""):e.utilsCls.isMobile()?t+="
"Alt" + Click",t+=this.getRadio("mn2_hl_clr","mn2_hl_clrYellow","Yellow",!0,void 0,2),t+=this.getRadio("mn2_hl_clr","mn2_hl_clrGreen","Green",void 0,void 0,2),t+=this.getRadio("mn2_hl_clr","mn2_hl_clrRed","Red",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_hlstyle","Highlight Style",void 0,void 0,1),t+="",t+=this.getRadio("mn2_hl_style","mn2_hl_styleOutline","Outline",!0,void 0,2),t+=this.getRadio("mn2_hl_style","mn2_hl_styleObject","3D Objects",void 0,void 0,2),t+="
",t+="",t+=this.getLink("toggleHighlight2","Toggle Highlight",1,1),t+="",t+=this.getLink("mn2_show_selected","View Selection",1,1),t+=this.getLink("mn2_hide_selected","Hide Selection",1,1),t+=this.getLink("mn2_selectedcenter","Zoom in Selection",1,1),t+=this.getLink("mn6_center","Center Selection",1,1),t+=this.getLink("mn2_fullstru","View Full Structure"),t+=this.getLinkWrapper("mn2_alternate",'Alternate(Key "a")',"mn2_alternateWrap",void 0,1),void 0!==e.cfg.opmid?t+=this.getLinkWrapper("togglemem","Toggle Membrane","togglememli",void 0,1):void 0===e.cfg.cid&&(t+=this.getLinkWrapper("togglemem","Toggle Membrane","togglememli",void 0,1,!0)),void 0!==e.cfg.opmid&&(t+=this.getLinkWrapper("adjustmem","Adjust Membrane","adjustmemli",void 0,1),t+=this.getLinkWrapper("selectplane","Select between
Two X-Y Planes",t+=this.getMenuUrl("vrhint",e.htmlCls.baseUrl+"icn3d/icn3d.html#vr","VR: VR Headsets",1,2),t+=this.getMenuUrl("arhint",e.htmlCls.baseUrl+"icn3d/icn3d.html#ar","AR: Chrome in Android",1,2),t+="
",t+="",t+=this.getLink("mn6_sidebyside","Side by Side",1,1),t+=this.getMenuText("mn2_rotate","Rotate",void 0,1,1),t+="",t+=this.getMenuText("mn2_rotate90","Rotate 90°",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_camera","Camera",void 0,void 0,1),t+="",t+=this.getRadio("mn6_rotate90","mn6_rotatex","rotate x",void 0,void 0,2),t+=this.getRadio("mn6_rotate90","mn6_rotatey","rotate y",void 0,void 0,2),t+=this.getRadio("mn6_rotate90","mn6_rotatez","rotate z",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_rotateauto","Auto Rotation",void 0,1,2),t+="",t+=this.getRadio("mn6_rotate","mn6_rotateleft","Rotate Left",void 0,1,3),t+=this.getRadio("mn6_rotate","mn6_rotateright","Rotate Right",void 0,1,3),t+=this.getRadio("mn6_rotate","mn6_rotateup","Rotate Up",void 0,1,3),t+=this.getRadio("mn6_rotate","mn6_rotatedown","Rotate Down",void 0,1,3),t+="
",t+="",t+="",t+=this.getRadio("mn6_camera","mn6_cameraPers","Perspective",!0,void 0,2),t+=this.getRadio("mn6_camera","mn6_cameraOrth","Orthographic",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_fog","Fog for Selection",void 0,void 0,1),t+="",t+=this.getRadio("mn6_showfog","mn6_showfogYes","On",void 0,void 0,2),t+=this.getRadio("mn6_showfog","mn6_showfogNo","Off",!0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_slab","Slab for Selection",void 0,void 0,1),t+="",t+=this.getRadio("mn6_showslab","mn6_showslabYes","On",void 0,void 0,2),t+=this.getRadio("mn6_showslab","mn6_showslabNo","Off",!0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_axes","XYZ-axes",void 0,void 0,1),t+="",t+=this.getRadio("mn6_showaxis","mn6_showaxisYes","Original",void 0,void 0,2),t+=this.getRadio("mn6_showaxis","mn6_showaxisSel","Prin. Axes on Sel.",void 0,void 0,2),t+=this.getRadio("mn6_showaxis","mn6_showaxisNo","Hide",!0,void 0,2),t+="
",t+="",t+=this.getMenuSep(),t+=this.getMenuText("mn2_resetwrap","Reset",void 0,1,1),t+="",t+=this.getRadio("mn6_reset","reset","All",void 0,1,2),t+=this.getRadio("mn6_reset","mn6_resetOrientation","Orientation",void 0,1,2),t+="
",t+="",t+=this.getLink("mn6_back","Undo",void 0,1),t+=this.getLink("mn6_forward","Redo",void 0,1),t+=this.getLink("mn6_fullscreen","Full Screen",void 0,1),t+="",void 0===e.cfg.cid&&(t+=this.getMenuText("mn3_proteinwrap","Proteins",void 0,1,1),t+="
",t}setMenu4(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu4_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+="",void 0!==e.cfg.align||void 0!==e.cfg.chainalign?t+=this.getRadio("mn3_proteins","mn3_proteinsRibbon","Ribbon",void 0,1,2):t+=this.getRadio("mn3_proteins","mn3_proteinsRibbon","Ribbon",!0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsStrand","Strand",void 0,void 0,2),t+=this.getRadio("mn3_proteins","mn3_proteinsCylinder","Cylinder and Plate",void 0,void 0,2),t+=this.getRadio("mn3_proteins","mn3_proteinsSchematic","Schematic",void 0,1,2),void 0!==e.cfg.align||void 0!==e.cfg.chainalign?t+=this.getRadio("mn3_proteins","mn3_proteinsCalpha","C Alpha Trace",!0,1,2):t+=this.getRadio("mn3_proteins","mn3_proteinsCalpha","C Alpha Trace",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsBackbone","Backbone",void 0,void 0,2),t+=this.getRadio("mn3_proteins","mn3_proteinsBfactor","B-factor Tube",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsLines","Lines",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsStick","Stick",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsBallstick","Ball and Stick",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_sidecwrap","Side Chains",void 0,1,1),t+="",t+=this.getRadio("mn3_sidec","mn3_sidecLines","Lines",void 0,1,2),t+=this.getRadio("mn3_sidec","mn3_sidecStick","Stick",void 0,1,2),t+=this.getRadio("mn3_sidec","mn3_sidecBallstick","Ball and Stick",void 0,1,2),t+=this.getRadio("mn3_sidec","mn3_sidecSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_sidec","mn3_sidecNo","Hide",!0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_nuclwrap","Nucleotides",void 0,1,1),t+="",t+=this.getRadio("mn3_nucl","mn3_nuclCartoon","Cartoon",!0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclPhos","O3' Trace",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclBackbone","Backbone",void 0,void 0,2),t+=this.getRadio("mn3_nucl","mn3_nuclSchematic","Schematic",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclLines","Lines",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclStick","Stick",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclBallstick","Ball and Stick",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_ntbasewrap","Nucl. Bases",void 0,1,1),t+="",t+=this.getRadio("mn3_ntbase","mn3_ntbaseLines","Lines",void 0,1,2),t+=this.getRadio("mn3_ntbase","mn3_ntbaseStick","Stick",void 0,1,2),t+=this.getRadio("mn3_ntbase","mn3_ntbaseBallstick","Ball and Stick",void 0,1,2),t+=this.getRadio("mn3_ntbase","mn3_ntbaseSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_ntbase","mn3_ntbaseNo","Hide",!0,1,2),t+="
",t+=""),t+=this.getMenuText("mn3_ligwrap","Chemicals",void 0,1,1),t+="",t+=this.getRadio("mn3_lig","mn3_ligLines","Lines",void 0,1,2),void 0===e.cfg.cid?(t+=this.getRadio("mn3_lig","mn3_ligStick","Stick",!0,1,2),t+=this.getRadio("mn3_lig","mn3_ligBallstick","Ball and Stick",void 0,1,2)):(t+=this.getRadio("mn3_lig","mn3_ligStick","Stick",void 0,1,2),t+=this.getRadio("mn3_lig","mn3_ligBallstick","BalHydrogensl and Stick",!0,1,2)),t+=this.getRadio("mn3_lig","mn3_ligSchematic","Schematic",void 0,1,2),t+=this.getRadio("mn3_lig","mn3_ligSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_lig","mn3_ligNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_hydrogenswrap","Hydrogens",void 0,1,1),t+="",t+=this.getRadio("mn3_hydrogens","mn3_hydrogensYes","Show",!0,1,2),t+=this.getRadio("mn3_hydrogens","mn3_hydrogensNo","Hide",void 0,1,2),t+="
",t+="",void 0===e.cfg.cid&&(t+=this.getMenuText("mn3_glycanwrap","Glycans",void 0,void 0,1),t+="",t+=this.getRadio("mn3_glycansCart","mn3_glycansCartYes","Show Cartoon",void 0,void 0,2),t+=this.getRadio("mn3_glycansCart","mn3_glycansCartNo","Hide Cartoon",!0,void 0,2),t+="
",t+=""),t+=this.getMenuText("mn3_ionswrap","Ions",void 0,1,1),t+="",t+=this.getRadio("mn3_ions","mn3_ionsSphere","Sphere",!0,1,2),t+=this.getRadio("mn3_ions","mn3_ionsDot","Dot",void 0,1,2),t+=this.getRadio("mn3_ions","mn3_ionsNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_waterwrap","Water",void 0,1,1),t+="",t+=this.getRadio("mn3_water","mn3_waterSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_water","mn3_waterDot","Dot",void 0,1,2),t+=this.getRadio("mn3_water","mn3_waterNo","Hide",!0,1,2),t+="
",t+="",t+=this.getLink("mn3_setThickness","Preferences",void 0,1),t+=this.getMenuSep(),t+=this.getLink("mn3_styleSave","Save Style",void 0,2),t+=this.getLink("mn3_styleApplySave","Apply Saved Style",void 0,2),t+=this.getMenuSep(),t+=this.getMenuText("mn5_surfacewrap","Surface Type",void 0,1,1),t+="",t+=this.getRadio("mn5_surface","mn5_surfaceVDW","Van der Waals",void 0,1,2),t+=this.getRadio("mn5_surface","mn5_surfaceVDWContext","VDW with Context",void 0,void 0,2),t+=this.getRadio("mn5_surface","mn5_surfaceMolecular","Molecular Surface",void 0,1,2),t+=this.getRadio("mn5_surface","mn5_surfaceMolecularContext","MS with Context",void 0,void 0,2),t+=this.getRadio("mn5_surface","mn5_surfaceSAS","Solvent Accessible",void 0,1,2),t+=this.getRadio("mn5_surface","mn5_surfaceSASContext","SA with Context",void 0,void 0,2),t+="
",t+="",t+=this.getLink("mn5_surfaceNo","Remove Surface",1,1),t+=this.getMenuText("mn5_surfaceop","Surface Opacity",void 0,1,1),t+="",t+=this.getMenuText("mn5_surfaceopfast","Fast Transparency",void 0,1,2),t+="
",t+=this.getMenuText("mn5_wireframewrap","Surface Wireframe",void 0,1,1),t+="",t+=this.getRadio("mn5_opacity","mn5_opacity10","1.0",!0,1,3);for(let e=9;e>0;--e)t+=this.getRadio("mn5_opacity","mn5_opacity0"+e,"0."+e,1,3);t+="
",t+="",t+=this.getMenuText("mn5_surfaceopslow","Slow Transparency",void 0,void 0,2),t+="",t+=this.getRadio("mn5_opacityslow","mn5_opacityslow10","1.0",!0,void 0,3);for(let e=9;e>0;--e)t+=this.getRadio("mn5_opacityslow","mn5_opacityslow0"+e,"0."+e,void 0,void 0,3);return t+="
",t+="",t+="",t+=this.getRadio("mn5_wireframe","mn5_wireframeYes","Yes",void 0,1,2),t+=this.getRadio("mn5_wireframe","mn5_wireframeNo","No",!0,1,2),t+="
",t+="",t+=this.getMenuSep(),t+=this.getLink("mn5_cartoonshape","Cartoon for a Set",void 0,1),t+=this.getLink("mn5_linebtwsets","Line btw. Two Sets",void 0,1),void 0===e.cfg.cid&&void 0===e.cfg.align&&void 0===e.cfg.chainalign&&void 0===e.cfg.mmdbaf&&(t+=this.getMenuSep(),t+=this.getLinkWrapper2("mn5_map","Electron Density","mapWrapper1",void 0,1),t+="",t+=this.getLink("mn5_elecmap2fofc","2Fo-Fc Map",void 0,2),t+=this.getLink("mn5_elecmapfofc","Fo-Fc Map",void 0,2),t+=this.getLinkWrapper("mn5_elecmapNo","Remove Map","mapWrapper2",void 0,2),t+="
",t+="",t+=this.getLinkWrapper2("mn5_map3","Map Wireframe","mapWrapper3",void 0,1),t+="",t+=this.getRadio("mn5_mapwireframe","mn5_mapwireframeYes","Yes",!0,void 0,2),t+=this.getRadio("mn5_mapwireframe","mn5_mapwireframeNo","No",void 0,void 0,2),t+="
",t+="",void 0===e.cfg.mmtfid&&(t+=this.getLinkWrapper("mn5_emmap","EM Density Map","emmapWrapper1",void 0,1),t+=this.getLinkWrapper("mn5_emmapNo","Remove EM Map","emmapWrapper2",void 0,1),t+=this.getLinkWrapper2("mn5_emmap3","EM Map Wireframe","emmapWrapper3",void 0,1),t+="",t+=this.getRadio("mn5_emmapwireframe","mn5_emmapwireframeYes","Yes",!0,void 0,2),t+=this.getRadio("mn5_emmapwireframe","mn5_emmapwireframeNo","No",void 0,void 0,2),t+="
",t+="")),t+=this.getMenuSep(),t+=this.getMenuText("mn6_bkgdwrap","Background",void 0,1,1),t+="",t+=this.getRadio("mn6_bkgd","mn6_bkgdTransparent","Transparent",void 0,1,2),t+=this.getRadio("mn6_bkgd","mn6_bkgdBlack","Black",!0,1,2),t+=this.getRadio("mn6_bkgd","mn6_bkgdGrey","Gray",void 0,1,2),t+=this.getRadio("mn6_bkgd","mn6_bkgdWhite","White",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn6_themewrap","Dialog Color",void 0,void 0,1),t+="",t+=this.getRadio("mn6_theme","mn6_themeBlue","Blue",!0,void 0,2),t+=this.getRadio("mn6_theme","mn6_themeOrange","Orange",void 0,void 0,2),t+=this.getRadio("mn6_theme","mn6_themeBlack","Black",void 0,void 0,2),t+="
",t+="",t+="",t+=this.getMenuText("mn4_clrwrap","Unicolor","icn3d-menupd",1,1),t+="
",t}setMenu5(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu5_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";t+="",t+=this.getMenuText("uniclrRedwrap","Red",void 0,1,2),t+="
",t+=this.getRadio("mn4_clr","mn4_clrCustom","Color Picker",void 0,void 0,1),t+=this.getMenuSep(),void 0===e.cfg.cid?(t+=this.getMenuText("mn4_clrRainbowwrap","Rainbow (R-V)","icn3d-menupd",1,1),t+="",t+=this.getRadClr("mn4_clr","uniclrRed1","Red","F00",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed2","Indian Red","CD5C5C",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed3","Light Coral","F08080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed4","Salmon","FA8072",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed5","Dark Salmon","E9967A",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed6","Light Salmon","FFA07A",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed7","Crimson","DC143C",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed8","Fire Brick","B22222",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed9","Dark Red","8B0000",void 0,1,3),t+="
",t+=this.getMenuText("uniclrPinkwrap","Pink",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrPink1","Pink","FFC0CB",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink2","Light Pink","FFB6C1",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink3","Hot Pink","FF69B4",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink4","Deep Pink","FF1493",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink5","Medium Violet Red","C71585",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink6","Pale Violet Red","DB7093",void 0,1,3),t+="
",t+=this.getMenuText("uniclrOrangewrap","Orange",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrOran1","Orange","FFA500",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran2","Dark Orange","FF8C00",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran3","Orange Red","FF4500",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran4","Tomato","FF6347",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran5","Coral","FF7F50",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran6","Light Salmon","FFA07A",void 0,1,3),t+="
",t+=this.getMenuText("uniclrYellowwrap","Yellow",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrYllw1","Yellow","FF0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw2","Gold","FFD700",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw3","Light Yellow","FFFFE0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw4","Lemon Chiffon","FFFACD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw5","Light Golden Rod","FAFAD2",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw6","Papaya Whip","FFEFD5",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw7","Moccasin","FFE4B5",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw8","Peach Puff","FFDAB9",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw9","Pale Golden Rod","EEE8AA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw10","Khaki","F0E68C",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw11","Dark Khaki","BDB76B",void 0,1,3),t+="
",t+=this.getMenuText("uniclrMagentawrap","Magenta",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrMgnt1","Magenta","F0F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt2","Orchid","DA70D6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt3","Violet","EE82EE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt4","Plum","DDA0DD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt5","Thistle","D8BFD8",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt6","Lavender","E6E6FA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt7","Medium Orchid","BA55D3",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt8","Medium Purple","9370DB",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt9","Rebecca Purple","663399",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt10","Blue Violet","8A2BE2",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt11","Dark Violet","9400D3",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt12","Dark Orchid","9932CC",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt13","Dark Magenta","8B008B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt14","Purple","800080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt15","Indigo","4B0082",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt16","Slat Blue","6A5ACD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt17","Dark Slate Blue","483D8B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt18","Medium Slat Blue","6A5ACD",void 0,1,3),t+="
",t+=this.getMenuText("uniclrGreenwrap","Green",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrGrn1","Green","0F0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn2","Dark Green","006400",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn3","Yellow Green","9ACD32",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn4","Olive Drab","6B8E23",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn5","Olive","808000",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn6","Dark Olive Green","556B2F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn7","Medium Aquamarine","66CDAA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn8","Dark Sea Green","8FBC8B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn9","Lignt Sea Green","20B2AA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn10","Dark Cyan","008B8B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn11","Teal","008080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn12","Forest Green","228B22",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn13","Sea Green","2E8B57",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn14","Medium Sea Green","3CB371",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn15","Spring Green","00FF7F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn16","Medium Spring","00FA9A",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn17","Light Green","90EE90",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn18","Pale Green","98FB98",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn19","Lime Green","32CD32",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn20","Lawn Green","7CFC00",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn21","Chartreuse","7FFF00",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn22","Green Yellow","ADFF2F",void 0,1,3),t+="
",t+=this.getMenuText("uniclrCyanwrap","Cyan",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrCyan1","Cyan","0FF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan2","Light Cyan","E0FFFF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan3","Pale Turquoise","AFEEEE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan4","Aquamarine","7FFFD4",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan5","Turquoise","40E0D0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan6","Medium Turquoise","48D1CC",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan7","Dark Turquoise","00CED1",void 0,1,3),t+="
",t+=this.getMenuText("uniclrBluewrap","Blue",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrBlue1","Blue","00F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue2","Medium Blue","0000CD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue3","Dark Blue","00008B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue4","Navy","000080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue5","Midnight Blue","191970",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue6","Royal Blue","4169E1",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue7","Medium Slate Blue","7B68EE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue8","Corn Flower Blue","6495ED",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue9","Dodger Blue","1E90FF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue10","Deep Sky Blue","00BFFF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue11","Light Sky Blue","87CEFA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue12","Sky Blue","87CEEB",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue13","Light Blue","ADD8E6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue14","Powder Blue","B0E0E6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue15","Light Steel Blue","B0C4DE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue16","Steel Blue","4682B4",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue17","Cadet Blue","5F9EA0",void 0,1,3),t+="
",t+=this.getMenuText("uniclrBrownwrap","Brown",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrBrown1","Brown","A52A2A",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown2","Maroon","800000",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown3","Sienna","A0522D",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown4","Saddle Brown","8B4513",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown5","Chocolate","D2691E",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown6","Peru","CD853F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown7","Dark Golden Rod","B8860B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown8","Golden Rod","DAA520",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown9","Sandy Brown","F4A460",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown10","Rosy Brown","BC8F8F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown11","Tan","D2B48C",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown12","Burlywood","DEB887",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown13","Wheat","F5DEB3",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown14","Navajo White","FFDEAD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown15","Bisque","FFE4C4",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown16","Blanched Almond","FFEBCD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown17","Corn Silk","FFF8DC",void 0,1,3),t+="
",t+=this.getMenuText("uniclrWhitewrap","White",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrWhite1","White","FFF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite2","Snow","FFFAFA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite3","Honey Dew","F0FFF0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite4","Mint Cream","F5FFFA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite5","Azure","F0FFFF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite6","Alice Blue","F0F8FF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite7","Ghost White","F8F8FF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite8","White Smoke","F5F5F5",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite9","Sea Shell","FFF5EE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite10","Beige","F5F5DC",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite11","Old Lace","FDF5E6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite12","Floral White","FFFAF0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite13","Ivory","FFFFF0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite14","Antique White","FAEBD7",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite15","Linen","FAF0E6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite16","Lavenderblush","FFF0F5",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite17","Misty Rose","FFE4E1",void 0,1,3),t+="
",t+=this.getMenuText("uniclrGraywrap","Gray",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrGray1","Gray","808080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray2","Dim Gray","696969",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray3","Light Slate Gray","778899",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray4","Slate Gray","708090",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray5","Dark Slate Gray","2F4F4F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray6","Black","000000",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray7","Dark Gray","A9A9A9",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray8","Silver","C0C0C0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray9","Light Gray","D3D3D3",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray10","Gainsboro","DCDCDC",void 0,1,3),t+="
",t+="",t+=this.getRadio("mn4_clr","mn4_clrRainbow","for Selection",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrRainbowChain","for Chains",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrRainbowSets","for Sets",void 0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrRainbowAcrossSets","across Sets",void 0,void 0,2),t+="
",t+=this.getMenuText("mn4_clrSpectrumwrap","Spectrum (V-R)","icn3d-menupd",1,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrSpectrum","for Selection",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrSpectrumChain","for Chains",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrSpectrumSets","for Sets",void 0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrSpectrumAcrossSets","across Sets",void 0,void 0,2),t+="
",t+=this.getMenuText("mn4_clrSSwrap","Secondary","icn3d-menupd",1,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrSSGreen","Sheet in Green",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrSSYellow","Sheet in Yellow",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrSSSpectrum","Spectrum",void 0,void 0,2),t+="
",t+=this.getRadio("mn4_clr","mn4_clrCharge","Charge",void 0,1,1),t+=this.getMenuText("mn4_hydrophobicwrap","Hydrophobicity","icn3d-menupd",1,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrNormalizedHP","Normalized",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrHydrophobic","Wimley-White",void 0,void 0,2),t+="
",t+=this.getMenuText("mn4_clrBfactorwrap","B-factor","icn3d-menupd",1,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrBfactor","Original",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrBfactorNorm","Percentile",void 0,1,2),t+="
",t+=this.getRadio("mn4_clr","mn4_clrArea",'Solvent
Accessibility',void 0,void 0,1),t+=this.getRadio("mn4_clr","mn4_clrStructure","Structure",void 0,1,1),void 0!==e.cfg.align||void 0!==e.cfg.chainalign||void 0!==e.cfg.blast_rep_id?t+=this.getRadio("mn4_clr","mn4_clrChain","Chain",void 0,1,1):t+=this.getRadio("mn4_clr","mn4_clrChain","Chain",!0,1,1),t+=this.getRadio("mn4_clr","mn4_clrdomain","3D Domain",void 0,void 0,1),void 0===e.cfg.cid&&(t+=this.getMenuText("mn4_clrsetswrap","Defined Sets","icn3d-menupd",void 0,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrsets",'Rainbow for Selected Sets
",t+=""),t+=this.getMenuText("mn4_clrResiduewrap","Residue","icn3d-menupd",1,1),t+="
in "Analysis > Defined Sets"',void 0,void 0,2),t+="",t+=this.getRadio("mn4_clr","mn4_clrResidue","Default",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrResidueCustom","Custom",void 0,void 0,2),t+="
",t+=this.getRadio("mn4_clr","mn4_clrAtom","Atom",void 0,1,1),void 0!==e.cfg.align||void 0!==e.cfg.chainalign?(t+=this.getRadio("mn4_clr","mn4_clrIdentity","Identity",!0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrConserved","Conservation",void 0,void 0,2)):void 0!==e.cfg.blast_rep_id?(t+=this.getRadio("mn4_clr","mn4_clrIdentity","Identity",void 0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrConserved","Conservation",!0,void 0,2)):(t+=this.getRadio("mn4_clr","mn4_clrIdentity","Identity",void 0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrConserved","Conservation",void 0,void 0,2)),t+=this.getRadio("mn4_clr","mn4_clrConfidence","pLDDT",void 0,1,1)):t+=this.getRadio("mn4_clr","mn4_clrAtom","Atom",!0,1,1),t+=this.getMenuSep(),t+=this.getLink("mn4_clrSave","Save Color",void 0,1),t+=this.getLink("mn4_clrApplySave","Apply Saved Color",void 0,1),t+="",void 0===e.cfg.cid&&(t+=this.getLink("mn6_selectannotations","Seq. & Annotations "+e.htmlCls.wifiStr,1,1),t+=this.getLink("mn2_alignment","Aligned Seq. "+e.htmlCls.wifiStr,void 0,1),void 0===e.cfg.mmdbid&&void 0===e.cfg.gi&&void 0===e.cfg.blast_rep_id&&void 0===e.cfg.align&&void 0===e.cfg.chainalign||(t+=this.getLink("mn2_2ddgm","2D Diagram "+e.htmlCls.wifiStr,1,1)),t+=this.getMenuText("2dctnwrap","2D Cartoon",void 0,void 0,1),t+="
",t}setMenu2(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu2_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+="",t+=this.getLink("2dctn_chain","Chain Level",void 0,2),t+=this.getLink("2dctn_domain","Domain Level",void 0,2),t+=this.getLink("2dctn_secondary","Helix/Sheet Level",void 0,2),t+="
",t+="",t+=this.getLink("definedsets2","Defined Sets",1,1),t+=this.getMenuSep(),t+=this.getLink("mn6_hbondsYes","Interactions",1,1),t+=this.getMenuText("mn1_window","Bring to Front",void 0,void 0,1),t+="",t+=this.getLink("mn1_window_table","Interaction Table",void 0,2),t+=this.getLink("mn1_window_linegraph","2D Interaction Network",void 0,2),t+=this.getLink("mn1_window_scatterplot","2D Interaction Map",void 0,2),t+=this.getLink("mn1_window_graph","2D Graph(Force-Directed)",void 0,2),t+="
",t+="",t+=this.getLink("mn6_contactmap","Contact Map",void 0,1),t+=this.getLink("mn1_mutation","Mutation "+e.htmlCls.wifiStr,1,1)),e.cfg.hidelicense||(t+=this.getMenuText("mn1_delphiwrap","DelPhi Potential",void 0,1,1),t+="",t+=this.getLink("mn1_delphi","DelPhi Potential "+e.htmlCls.licenseStr,1,2),t+=this.getMenuText("mn1_phiwrap","Load PQR/Phi",void 0,void 0,2),t+="
",t+=""),t+=this.getMenuSep(),t+=this.getMenuText("mn6_distancewrap","Distance",void 0,1,1),t+="",t+=this.getLink("mn1_phi","Local PQR/Phi/Cube File",void 0,3),t+=this.getLink("mn1_phiurl","URL PQR/Phi/Cube File",void 0,3),t+="
",t+="",t+=this.getLink("delphipqr","Download PQR",void 0,2),t+="",t+=this.getRadio("mn6_distance","mn6_distanceYes","between Two Atoms",void 0,1,2),t+=this.getRadio("mn6_distance","mn6_distTwoSets","between Two Sets",void 0,void 0,2),t+=this.getRadio("mn6_distance","mn6_distManySets","Among Many Sets",void 0,void 0,2),t+=this.getRadio("mn6_distance","mn6_distanceNo","Hide",!0,1,2),t+="
",t+="",t+=this.getLink("mn6_area","Surface Area",1,1),t+=this.getMenuText("mn6_addlabelwrap","Label",void 0,1,1),t+="",t+=this.getRadio("mn6_addlabel","mn6_addlabelYes","by Picking Atoms",void 0,void 0,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelSelection","per Selection",void 0,void 0,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelAtoms","per Atom",void 0,void 0,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelElements","per Atom Element",void 0,1,2),void 0===e.cfg.cid&&(t+=this.getRadio("mn6_addlabel","mn6_addlabelResidues","per Residue",void 0,1,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelResnum","per Residue & Number",void 0,1,2),
+t+=this.getMenuText("m1_exportrefnum","Reference Numbers",void 0,void 0,2),t+="
",t+="",t+=this.getLink("mn1_sharelink","Share Link "+e.htmlCls.wifiStr,1,1),t+=this.getLink("mn1_replayon","Replay Each Step",void 0,1),t+=this.getMenuSep(),t+=this.getMenuText("mn1_menuwrap","Customize Menus",void 0,1,1),t+="",t+=this.getLink("mn1_exportIgstrand","Ig Strand",void 0,3),t+=this.getLink("mn1_exportKabat","Kabat",void 0,3),t+=this.getLink("mn1_exportImgt","IMGT",void 0,3),t+="
",t+="",t+=this.getLink("mn1_menuall","All Menus",1,2),t+=this.getLink("mn1_menusimple","Simple Menus",1,2),t+=this.getMenuSep(),t+=this.getLink("mn1_menupref","Preferences",1,2),t+=this.getLink("mn1_menuloadpref","Load Preferences",1,2),t+="
",t+="",t+="",t+=this.getLink("mn2_definedsets","Defined Sets",1,1),t+=this.getLink("mn2_selectall","All",void 0,1),t+=this.getLink("mn2_selectdisplayed","Displayed Set",void 0,1),t+=this.getLink("mn2_aroundsphere","by Distance",1,1),t+=this.getMenuText("mn2_selbyprop","by Property",void 0,void 0,1),t+="
",t}setMenu2b(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu2b_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+="",t+=this.getLink("mn2_propPos","Positive",void 0,2),t+=this.getLink("mn2_propNeg","Negative",void 0,2),t+=this.getLink("mn2_propHydro","Hydrophobic",void 0,2),t+=this.getLink("mn2_propPolar","Polar",void 0,2),t+=this.getLink("mn2_propBfactor","B-factor/pLDDT",void 0,2),t+=this.getLink("mn2_propSolAcc","Solvent Accessibility",void 0,2),t+="
",t+="",t+=this.getLink("mn2_selectcomplement","Inverse",void 0,1),t+=this.getLink("mn2_selectmainchains","Main Chains",void 0,1),t+=this.getLink("mn2_selectsidechains","Side Chains",void 0,1),t+=this.getLink("mn2_selectmainsidechains","Main & Side Chains",void 0,1),t+=this.getLink("mn2_command","Advanced",void 0,1),void 0===e.cfg.cid?(t+=this.getMenuText("mn2_selon3d","Select on 3D",void 0,1,1),t+="",t+='
",t+=""):e.utilsCls.isMobile()?t+="
"Alt" + Click",t+=this.getRadio("mn2_hl_clr","mn2_hl_clrYellow","Yellow",!0,void 0,2),t+=this.getRadio("mn2_hl_clr","mn2_hl_clrGreen","Green",void 0,void 0,2),t+=this.getRadio("mn2_hl_clr","mn2_hl_clrRed","Red",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_hlstyle","Highlight Style",void 0,void 0,1),t+="",t+=this.getRadio("mn2_hl_style","mn2_hl_styleOutline","Outline",!0,void 0,2),t+=this.getRadio("mn2_hl_style","mn2_hl_styleObject","3D Objects",void 0,void 0,2),t+="
",t+="",t+=this.getLink("toggleHighlight2","Toggle Highlight",1,1),t+="",t+=this.getLink("mn2_show_selected","View Selection",1,1),t+=this.getLink("mn2_hide_selected","Hide Selection",1,1),t+=this.getLink("mn2_selectedcenter","Zoom in Selection",1,1),t+=this.getLink("mn6_center","Center Selection",1,1),t+=this.getLink("mn2_fullstru","View Full Structure"),t+=this.getLinkWrapper("mn2_alternate",'Alternate(Key "a")',"mn2_alternateWrap",void 0,1),void 0!==e.cfg.opmid?t+=this.getLinkWrapper("togglemem","Toggle Membrane","togglememli",void 0,1):void 0===e.cfg.cid&&(t+=this.getLinkWrapper("togglemem","Toggle Membrane","togglememli",void 0,1,!0)),void 0!==e.cfg.opmid&&(t+=this.getLinkWrapper("adjustmem","Adjust Membrane","adjustmemli",void 0,1),t+=this.getLinkWrapper("selectplane","Select between
",t}setMenu3(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu3_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";t+="
Two X-Y Planes","selectplaneli",void 0,1)),t+=this.getMenuSep(),t+=this.getMenuText("mn2_vrarhints","VR & AR Hints",void 0,1,1),t+="",t+=this.getMenuUrl("vrhint",e.htmlCls.baseUrl+"icn3d/icn3d.html#vr","VR: VR Headsets",1,2),t+=this.getMenuUrl("arhint",e.htmlCls.baseUrl+"icn3d/icn3d.html#ar","AR: Chrome in Android",1,2),t+="
",t+="",t+=this.getLink("mn6_sidebyside","Side by Side",1,1),t+=this.getMenuText("mn2_rotate","Rotate",void 0,1,1),t+="",t+=this.getMenuText("mn2_rotate90","Rotate 90°",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_camera","Camera",void 0,void 0,1),t+="",t+=this.getRadio("mn6_rotate90","mn6_rotatex","rotate x",void 0,void 0,2),t+=this.getRadio("mn6_rotate90","mn6_rotatey","rotate y",void 0,void 0,2),t+=this.getRadio("mn6_rotate90","mn6_rotatez","rotate z",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_rotateauto","Auto Rotation",void 0,1,2),t+="",t+=this.getRadio("mn6_rotate","mn6_rotateleft","Rotate Left",void 0,1,3),t+=this.getRadio("mn6_rotate","mn6_rotateright","Rotate Right",void 0,1,3),t+=this.getRadio("mn6_rotate","mn6_rotateup","Rotate Up",void 0,1,3),t+=this.getRadio("mn6_rotate","mn6_rotatedown","Rotate Down",void 0,1,3),t+="
",t+="",t+="",t+=this.getRadio("mn6_camera","mn6_cameraPers","Perspective",!0,void 0,2),t+=this.getRadio("mn6_camera","mn6_cameraOrth","Orthographic",void 0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_fog","Fog for Selection",void 0,void 0,1),t+="",t+=this.getRadio("mn6_showfog","mn6_showfogYes","On",void 0,void 0,2),t+=this.getRadio("mn6_showfog","mn6_showfogNo","Off",!0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_slab","Slab for Selection",void 0,void 0,1),t+="",t+=this.getRadio("mn6_showslab","mn6_showslabYes","On",void 0,void 0,2),t+=this.getRadio("mn6_showslab","mn6_showslabNo","Off",!0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn2_axes","XYZ-axes",void 0,void 0,1),t+="",t+=this.getRadio("mn6_showaxis","mn6_showaxisYes","Original",void 0,void 0,2),t+=this.getRadio("mn6_showaxis","mn6_showaxisSel","Prin. Axes on Sel.",void 0,void 0,2),t+=this.getRadio("mn6_showaxis","mn6_showaxisNo","Hide",!0,void 0,2),t+="
",t+="",t+=this.getMenuSep(),t+=this.getMenuText("mn2_resetwrap","Reset",void 0,1,1),t+="",t+=this.getRadio("mn6_reset","reset","All",void 0,1,2),t+=this.getRadio("mn6_reset","mn6_resetOrientation","Orientation",void 0,1,2),t+="
",t+="",t+=this.getLink("mn6_back","Undo",void 0,1),t+=this.getLink("mn6_forward","Redo",void 0,1),t+=this.getLink("mn6_fullscreen","Full Screen",void 0,1),t+="",void 0===e.cfg.cid&&(t+=this.getMenuText("mn3_proteinwrap","Proteins",void 0,1,1),t+="
",t}setMenu4(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu4_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+="",void 0!==e.cfg.align||void 0!==e.cfg.chainalign?t+=this.getRadio("mn3_proteins","mn3_proteinsRibbon","Ribbon",void 0,1,2):t+=this.getRadio("mn3_proteins","mn3_proteinsRibbon","Ribbon",!0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsStrand","Strand",void 0,void 0,2),t+=this.getRadio("mn3_proteins","mn3_proteinsCylinder","Cylinder and Plate",void 0,void 0,2),t+=this.getRadio("mn3_proteins","mn3_proteinsSchematic","Schematic",void 0,1,2),void 0!==e.cfg.align||void 0!==e.cfg.chainalign?t+=this.getRadio("mn3_proteins","mn3_proteinsCalpha","C Alpha Trace",!0,1,2):t+=this.getRadio("mn3_proteins","mn3_proteinsCalpha","C Alpha Trace",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsBackbone","Backbone",void 0,void 0,2),t+=this.getRadio("mn3_proteins","mn3_proteinsBfactor","B-factor Tube",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsLines","Lines",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsStick","Stick",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsBallstick","Ball and Stick",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_proteins","mn3_proteinsNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_sidecwrap","Side Chains",void 0,1,1),t+="",t+=this.getRadio("mn3_sidec","mn3_sidecLines","Lines",void 0,1,2),t+=this.getRadio("mn3_sidec","mn3_sidecStick","Stick",void 0,1,2),t+=this.getRadio("mn3_sidec","mn3_sidecBallstick","Ball and Stick",void 0,1,2),t+=this.getRadio("mn3_sidec","mn3_sidecSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_sidec","mn3_sidecNo","Hide",!0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_nuclwrap","Nucleotides",void 0,1,1),t+="",t+=this.getRadio("mn3_nucl","mn3_nuclCartoon","Cartoon",!0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclPhos","O3' Trace",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclBackbone","Backbone",void 0,void 0,2),t+=this.getRadio("mn3_nucl","mn3_nuclSchematic","Schematic",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclLines","Lines",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclStick","Stick",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclBallstick","Ball and Stick",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_nucl","mn3_nuclNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_ntbasewrap","Nucl. Bases",void 0,1,1),t+="",t+=this.getRadio("mn3_ntbase","mn3_ntbaseLines","Lines",void 0,1,2),t+=this.getRadio("mn3_ntbase","mn3_ntbaseStick","Stick",void 0,1,2),t+=this.getRadio("mn3_ntbase","mn3_ntbaseBallstick","Ball and Stick",void 0,1,2),t+=this.getRadio("mn3_ntbase","mn3_ntbaseSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_ntbase","mn3_ntbaseNo","Hide",!0,1,2),t+="
",t+=""),t+=this.getMenuText("mn3_ligwrap","Chemicals",void 0,1,1),t+="",t+=this.getRadio("mn3_lig","mn3_ligLines","Lines",void 0,1,2),void 0===e.cfg.cid?(t+=this.getRadio("mn3_lig","mn3_ligStick","Stick",!0,1,2),t+=this.getRadio("mn3_lig","mn3_ligBallstick","Ball and Stick",void 0,1,2)):(t+=this.getRadio("mn3_lig","mn3_ligStick","Stick",void 0,1,2),t+=this.getRadio("mn3_lig","mn3_ligBallstick","BalHydrogensl and Stick",!0,1,2)),t+=this.getRadio("mn3_lig","mn3_ligSchematic","Schematic",void 0,1,2),t+=this.getRadio("mn3_lig","mn3_ligSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_lig","mn3_ligNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_hydrogenswrap","Hydrogens",void 0,1,1),t+="",t+=this.getRadio("mn3_hydrogens","mn3_hydrogensYes","Show",!0,1,2),t+=this.getRadio("mn3_hydrogens","mn3_hydrogensNo","Hide",void 0,1,2),t+="
",t+="",void 0===e.cfg.cid&&(t+=this.getMenuText("mn3_glycanwrap","Glycans",void 0,void 0,1),t+="",t+=this.getRadio("mn3_glycansCart","mn3_glycansCartYes","Show Cartoon",void 0,void 0,2),t+=this.getRadio("mn3_glycansCart","mn3_glycansCartNo","Hide Cartoon",!0,void 0,2),t+="
",t+=""),t+=this.getMenuText("mn3_ionswrap","Ions",void 0,1,1),t+="",t+=this.getRadio("mn3_ions","mn3_ionsSphere","Sphere",!0,1,2),t+=this.getRadio("mn3_ions","mn3_ionsDot","Dot",void 0,1,2),t+=this.getRadio("mn3_ions","mn3_ionsNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn3_waterwrap","Water",void 0,1,1),t+="",t+=this.getRadio("mn3_water","mn3_waterSphere","Sphere",void 0,1,2),t+=this.getRadio("mn3_water","mn3_waterDot","Dot",void 0,1,2),t+=this.getRadio("mn3_water","mn3_waterNo","Hide",!0,1,2),t+="
",t+="",t+=this.getLink("mn3_setThickness","Preferences",void 0,1),t+=this.getMenuSep(),t+=this.getLink("mn3_styleSave","Save Style",void 0,2),t+=this.getLink("mn3_styleApplySave","Apply Saved Style",void 0,2),t+=this.getMenuSep(),t+=this.getMenuText("mn5_surfacewrap","Surface Type",void 0,1,1),t+="",t+=this.getRadio("mn5_surface","mn5_surfaceVDW","Van der Waals",void 0,1,2),t+=this.getRadio("mn5_surface","mn5_surfaceVDWContext","VDW with Context",void 0,void 0,2),t+=this.getRadio("mn5_surface","mn5_surfaceMolecular","Molecular Surface",void 0,1,2),t+=this.getRadio("mn5_surface","mn5_surfaceMolecularContext","MS with Context",void 0,void 0,2),t+=this.getRadio("mn5_surface","mn5_surfaceSAS","Solvent Accessible",void 0,1,2),t+=this.getRadio("mn5_surface","mn5_surfaceSASContext","SA with Context",void 0,void 0,2),t+="
",t+="",t+=this.getLink("mn5_surfaceNo","Remove Surface",1,1),t+=this.getMenuText("mn5_surfaceop","Surface Opacity",void 0,1,1),t+="",t+=this.getMenuText("mn5_surfaceopfast","Fast Transparency",void 0,1,2),t+="
",t+=this.getMenuText("mn5_wireframewrap","Surface Wireframe",void 0,1,1),t+="",t+=this.getRadio("mn5_opacity","mn5_opacity10","1.0",!0,1,3);for(let e=9;e>0;--e)t+=this.getRadio("mn5_opacity","mn5_opacity0"+e,"0."+e,1,3);t+="
",t+="",t+=this.getMenuText("mn5_surfaceopslow","Slow Transparency",void 0,void 0,2),t+="",t+=this.getRadio("mn5_opacityslow","mn5_opacityslow10","1.0",!0,void 0,3);for(let e=9;e>0;--e)t+=this.getRadio("mn5_opacityslow","mn5_opacityslow0"+e,"0."+e,void 0,void 0,3);return t+="
",t+="",t+="",t+=this.getRadio("mn5_wireframe","mn5_wireframeYes","Yes",void 0,1,2),t+=this.getRadio("mn5_wireframe","mn5_wireframeNo","No",!0,1,2),t+="
",t+="",t+=this.getMenuSep(),t+=this.getLink("mn5_cartoonshape","Cartoon for a Set",void 0,1),t+=this.getLink("mn5_linebtwsets","Line btw. Two Sets",void 0,1),void 0===e.cfg.cid&&void 0===e.cfg.align&&void 0===e.cfg.chainalign&&void 0===e.cfg.mmdbaf&&(t+=this.getMenuSep(),t+=this.getLinkWrapper2("mn5_map","Electron Density","mapWrapper1",void 0,1),t+="",t+=this.getLink("mn5_elecmap2fofc","2Fo-Fc Map",void 0,2),t+=this.getLink("mn5_elecmapfofc","Fo-Fc Map",void 0,2),t+=this.getLinkWrapper("mn5_elecmapNo","Remove Map","mapWrapper2",void 0,2),t+="
",t+="",t+=this.getLinkWrapper2("mn5_map3","Map Wireframe","mapWrapper3",void 0,1),t+="",t+=this.getRadio("mn5_mapwireframe","mn5_mapwireframeYes","Yes",!0,void 0,2),t+=this.getRadio("mn5_mapwireframe","mn5_mapwireframeNo","No",void 0,void 0,2),t+="
",t+="",void 0===e.cfg.mmtfid&&(t+=this.getLinkWrapper("mn5_emmap","EM Density Map","emmapWrapper1",void 0,1),t+=this.getLinkWrapper("mn5_emmapNo","Remove EM Map","emmapWrapper2",void 0,1),t+=this.getLinkWrapper2("mn5_emmap3","EM Map Wireframe","emmapWrapper3",void 0,1),t+="",t+=this.getRadio("mn5_emmapwireframe","mn5_emmapwireframeYes","Yes",!0,void 0,2),t+=this.getRadio("mn5_emmapwireframe","mn5_emmapwireframeNo","No",void 0,void 0,2),t+="
",t+="")),t+=this.getMenuSep(),t+=this.getMenuText("mn6_bkgdwrap","Background",void 0,1,1),t+="",t+=this.getRadio("mn6_bkgd","mn6_bkgdTransparent","Transparent",void 0,1,2),t+=this.getRadio("mn6_bkgd","mn6_bkgdBlack","Black",!0,1,2),t+=this.getRadio("mn6_bkgd","mn6_bkgdGrey","Gray",void 0,1,2),t+=this.getRadio("mn6_bkgd","mn6_bkgdWhite","White",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn6_themewrap","Dialog Color",void 0,void 0,1),t+="",t+=this.getRadio("mn6_theme","mn6_themeBlue","Blue",!0,void 0,2),t+=this.getRadio("mn6_theme","mn6_themeOrange","Orange",void 0,void 0,2),t+=this.getRadio("mn6_theme","mn6_themeBlack","Black",void 0,void 0,2),t+="
",t+="",t+="",t+=this.getMenuText("mn4_clrwrap","Unicolor","icn3d-menupd",1,1),t+="
",t+="",t+=this.getMenuText("labelscalewrap","Label Scale",void 0,1,1),t+="",t+=this.getMenuText("uniclrRedwrap","Red",void 0,1,2),t+="
",t+=this.getRadio("mn4_clr","mn4_clrCustom","Color Picker",void 0,void 0,1),t+=this.getMenuSep(),void 0===e.cfg.cid?(t+=this.getMenuText("mn4_clrRainbowwrap","Rainbow (R-V)","icn3d-menupd",1,1),t+="",t+=this.getRadClr("mn4_clr","uniclrRed1","Red","F00",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed2","Indian Red","CD5C5C",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed3","Light Coral","F08080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed4","Salmon","FA8072",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed5","Dark Salmon","E9967A",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed6","Light Salmon","FFA07A",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed7","Crimson","DC143C",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed8","Fire Brick","B22222",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrRed9","Dark Red","8B0000",void 0,1,3),t+="
",t+=this.getMenuText("uniclrPinkwrap","Pink",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrPink1","Pink","FFC0CB",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink2","Light Pink","FFB6C1",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink3","Hot Pink","FF69B4",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink4","Deep Pink","FF1493",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink5","Medium Violet Red","C71585",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrPink6","Pale Violet Red","DB7093",void 0,1,3),t+="
",t+=this.getMenuText("uniclrOrangewrap","Orange",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrOran1","Orange","FFA500",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran2","Dark Orange","FF8C00",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran3","Orange Red","FF4500",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran4","Tomato","FF6347",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran5","Coral","FF7F50",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrOran6","Light Salmon","FFA07A",void 0,1,3),t+="
",t+=this.getMenuText("uniclrYellowwrap","Yellow",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrYllw1","Yellow","FF0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw2","Gold","FFD700",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw3","Light Yellow","FFFFE0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw4","Lemon Chiffon","FFFACD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw5","Light Golden Rod","FAFAD2",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw6","Papaya Whip","FFEFD5",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw7","Moccasin","FFE4B5",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw8","Peach Puff","FFDAB9",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw9","Pale Golden Rod","EEE8AA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw10","Khaki","F0E68C",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrYllw11","Dark Khaki","BDB76B",void 0,1,3),t+="
",t+=this.getMenuText("uniclrMagentawrap","Magenta",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrMgnt1","Magenta","F0F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt2","Orchid","DA70D6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt3","Violet","EE82EE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt4","Plum","DDA0DD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt5","Thistle","D8BFD8",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt6","Lavender","E6E6FA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt7","Medium Orchid","BA55D3",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt8","Medium Purple","9370DB",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt9","Rebecca Purple","663399",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt10","Blue Violet","8A2BE2",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt11","Dark Violet","9400D3",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt12","Dark Orchid","9932CC",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt13","Dark Magenta","8B008B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt14","Purple","800080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt15","Indigo","4B0082",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt16","Slat Blue","6A5ACD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt17","Dark Slate Blue","483D8B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrMgnt18","Medium Slat Blue","6A5ACD",void 0,1,3),t+="
",t+=this.getMenuText("uniclrGreenwrap","Green",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrGrn1","Green","0F0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn2","Dark Green","006400",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn3","Yellow Green","9ACD32",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn4","Olive Drab","6B8E23",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn5","Olive","808000",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn6","Dark Olive Green","556B2F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn7","Medium Aquamarine","66CDAA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn8","Dark Sea Green","8FBC8B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn9","Lignt Sea Green","20B2AA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn10","Dark Cyan","008B8B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn11","Teal","008080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn12","Forest Green","228B22",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn13","Sea Green","2E8B57",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn14","Medium Sea Green","3CB371",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn15","Spring Green","00FF7F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn16","Medium Spring","00FA9A",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn17","Light Green","90EE90",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn18","Pale Green","98FB98",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn19","Lime Green","32CD32",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn20","Lawn Green","7CFC00",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn21","Chartreuse","7FFF00",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGrn22","Green Yellow","ADFF2F",void 0,1,3),t+="
",t+=this.getMenuText("uniclrCyanwrap","Cyan",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrCyan1","Cyan","0FF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan2","Light Cyan","E0FFFF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan3","Pale Turquoise","AFEEEE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan4","Aquamarine","7FFFD4",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan5","Turquoise","40E0D0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan6","Medium Turquoise","48D1CC",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrCyan7","Dark Turquoise","00CED1",void 0,1,3),t+="
",t+=this.getMenuText("uniclrBluewrap","Blue",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrBlue1","Blue","00F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue2","Medium Blue","0000CD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue3","Dark Blue","00008B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue4","Navy","000080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue5","Midnight Blue","191970",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue6","Royal Blue","4169E1",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue7","Medium Slate Blue","7B68EE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue8","Corn Flower Blue","6495ED",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue9","Dodger Blue","1E90FF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue10","Deep Sky Blue","00BFFF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue11","Light Sky Blue","87CEFA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue12","Sky Blue","87CEEB",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue13","Light Blue","ADD8E6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue14","Powder Blue","B0E0E6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue15","Light Steel Blue","B0C4DE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue16","Steel Blue","4682B4",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBlue17","Cadet Blue","5F9EA0",void 0,1,3),t+="
",t+=this.getMenuText("uniclrBrownwrap","Brown",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrBrown1","Brown","A52A2A",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown2","Maroon","800000",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown3","Sienna","A0522D",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown4","Saddle Brown","8B4513",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown5","Chocolate","D2691E",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown6","Peru","CD853F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown7","Dark Golden Rod","B8860B",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown8","Golden Rod","DAA520",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown9","Sandy Brown","F4A460",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown10","Rosy Brown","BC8F8F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown11","Tan","D2B48C",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown12","Burlywood","DEB887",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown13","Wheat","F5DEB3",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown14","Navajo White","FFDEAD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown15","Bisque","FFE4C4",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown16","Blanched Almond","FFEBCD",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrBrown17","Corn Silk","FFF8DC",void 0,1,3),t+="
",t+=this.getMenuText("uniclrWhitewrap","White",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrWhite1","White","FFF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite2","Snow","FFFAFA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite3","Honey Dew","F0FFF0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite4","Mint Cream","F5FFFA",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite5","Azure","F0FFFF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite6","Alice Blue","F0F8FF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite7","Ghost White","F8F8FF",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite8","White Smoke","F5F5F5",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite9","Sea Shell","FFF5EE",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite10","Beige","F5F5DC",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite11","Old Lace","FDF5E6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite12","Floral White","FFFAF0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite13","Ivory","FFFFF0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite14","Antique White","FAEBD7",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite15","Linen","FAF0E6",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite16","Lavenderblush","FFF0F5",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrWhite17","Misty Rose","FFE4E1",void 0,1,3),t+="
",t+=this.getMenuText("uniclrGraywrap","Gray",void 0,1,2),t+="",t+=this.getRadClr("mn4_clr","uniclrGray1","Gray","808080",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray2","Dim Gray","696969",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray3","Light Slate Gray","778899",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray4","Slate Gray","708090",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray5","Dark Slate Gray","2F4F4F",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray6","Black","000000",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray7","Dark Gray","A9A9A9",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray8","Silver","C0C0C0",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray9","Light Gray","D3D3D3",void 0,1,3),t+=this.getRadClr("mn4_clr","uniclrGray10","Gainsboro","DCDCDC",void 0,1,3),t+="
",t+="",t+=this.getRadio("mn4_clr","mn4_clrRainbow","for Selection",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrRainbowChain","for Chains",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrRainbowSets","for Sets",void 0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrRainbowAcrossSets","across Sets",void 0,void 0,2),t+="
",t+=this.getMenuText("mn4_clrSpectrumwrap","Spectrum (V-R)","icn3d-menupd",1,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrSpectrum","for Selection",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrSpectrumChain","for Chains",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrSpectrumSets","for Sets",void 0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrSpectrumAcrossSets","across Sets",void 0,void 0,2),t+="
",t+=this.getMenuText("mn4_clrSSwrap","Secondary","icn3d-menupd",1,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrSSGreen","Sheet in Green",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrSSYellow","Sheet in Yellow",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrSSSpectrum","Spectrum",void 0,void 0,2),t+="
",t+=this.getRadio("mn4_clr","mn4_clrCharge","Charge",void 0,1,1),t+=this.getMenuText("mn4_hydrophobicwrap","Hydrophobicity","icn3d-menupd",1,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrNormalizedHP","Normalized",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrHydrophobic","Wimley-White",void 0,void 0,2),t+="
",t+=this.getMenuText("mn4_clrBfactorwrap","B-factor","icn3d-menupd",1,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrBfactor","Original",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrBfactorNorm","Percentile",void 0,1,2),t+="
",t+=this.getRadio("mn4_clr","mn4_clrArea",'Solvent
Accessibility',void 0,void 0,1),t+=this.getRadio("mn4_clr","mn4_clrStructure","Structure",void 0,1,1),void 0!==e.cfg.align||void 0!==e.cfg.chainalign||void 0!==e.cfg.blast_rep_id?t+=this.getRadio("mn4_clr","mn4_clrChain","Chain",void 0,1,1):t+=this.getRadio("mn4_clr","mn4_clrChain","Chain",!0,1,1),t+=this.getRadio("mn4_clr","mn4_clrdomain","3D Domain",void 0,void 0,1),void 0===e.cfg.cid&&(t+=this.getMenuText("mn4_clrsetswrap","Defined Sets","icn3d-menupd",void 0,1),t+="",t+=this.getRadio("mn4_clr","mn4_clrsets",'Rainbow for Selected Sets
",t+=""),t+=this.getMenuText("mn4_clrResiduewrap","Residue","icn3d-menupd",1,1),t+="
in "Analysis > Defined Sets"',void 0,void 0,2),t+="",t+=this.getRadio("mn4_clr","mn4_clrResidue","Default",void 0,1,2),t+=this.getRadio("mn4_clr","mn4_clrResidueCustom","Custom",void 0,void 0,2),t+="
",t+=this.getRadio("mn4_clr","mn4_clrAtom","Atom",void 0,1,1),void 0!==e.cfg.align||void 0!==e.cfg.chainalign?(t+=this.getRadio("mn4_clr","mn4_clrIdentity","Identity",!0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrConserved","Conservation",void 0,void 0,2)):void 0!==e.cfg.blast_rep_id?(t+=this.getRadio("mn4_clr","mn4_clrIdentity","Identity",void 0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrConserved","Conservation",!0,void 0,2)):(t+=this.getRadio("mn4_clr","mn4_clrIdentity","Identity",void 0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrConserved","Conservation",void 0,void 0,2)),t+=this.getRadio("mn4_clr","mn4_clrConfidence","pLDDT",void 0,1,1),
//!!!
-t+=this.getRadio("mn6_addlabel","mn6_addlabelChains","per Chain",void 0,void 0,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelTermini","N- & C-Termini",void 0,1,2)),t+=this.getMenuSep(),t+=this.getRadio("mn6_addlabel","mn6_labelColor","Change Label Color",void 0,1,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelNo","Remove",!0,1,2),t+="";for(let e=1;e<=4;++e){let s=2*e;t+=this.getRadio("mn6_labelscale","mn6_labelscale0"+s,"0."+s,void 0,1,2)}for(let e=1;e<=5;++e)t+=1==e?this.getRadio("mn6_labelscale","mn6_labelscale"+e+"0",e+".0",!0,1,2):this.getRadio("mn6_labelscale","mn6_labelscale"+e+"0",e+".0",void 0,1,2);if(t+="
",t+="",t+=this.getMenuSep(),void 0===e.cfg.cid){t+=this.getMenuText("mn6_chemicalbindingwrap","Chem. Binding",void 0,void 0,1),t+="",t+=this.getRadio("mn6_chemicalbinding","mn6_chemicalbindingshow","Show",void 0,void 0,2),t+=this.getRadio("mn6_chemicalbinding","mn6_chemicalbindinghide","Hide",!0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn6_ssbondswrap","Disulfide Bonds",void 0,1,1),t+="",t+=this.getRadio("mn6_ssbonds","mn6_ssbondsYes","Show",!0,1,2),t+=this.getRadio("mn6_ssbonds","mn6_ssbondsExport","Export Pairs",void 0,void 0,2),t+=this.getRadio("mn6_ssbonds","mn6_ssbondsNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn6_clbondswrap","Cross-Linkages",void 0,void 0,1),t+="",t+=this.getRadio("mn6_clbonds","mn6_clbondsYes","Show",!0,void 0,2),t+=this.getRadio("mn6_clbonds","mn6_clbondsExport","Export Pairs",void 0,void 0,2),t+=this.getRadio("mn6_clbonds","mn6_clbondsNo","Hide",void 0,void 0,2),t+="
",t+="";let s=void 0!==e.cfg.mmtfid||void 0!==e.cfg.pdbid||void 0!==e.cfg.opmid||void 0!==e.cfg.mmcifid||void 0!==e.cfg.mmdbid||void 0!==e.cfg.mmdbafid||void 0!==e.cfg.gi||void 0!==e.cfg.blast_rep_id;s&&(t+=this.getMenuText("assemblyWrapper","Assembly",void 0,1,1),t+="",e.cfg.bu?(t+=this.getRadio("mn6_assembly","mn6_assemblyYes","Biological Assembly",!0,1,2),t+=this.getRadio("mn6_assembly","mn6_assemblyNo","Asymmetric Unit",void 0,1,2)):(t+=this.getRadio("mn6_assembly","mn6_assemblyYes","Biological Assembly",void 0,1,2),t+=this.getRadio("mn6_assembly","mn6_assemblyNo","Asymmetric Unit",!0,1,2)),t+="
",t+=""),t+=this.getMenuText("mn6_symmetrywrap","Symmetry",void 0,void 0,1),t+="",s&&(t+=this.getLink("mn6_symmetry","from PDB(precalculated) "+e.htmlCls.wifiStr,void 0,2)),t+=this.getLink("mn6_symd","from SymD(Dynamic) "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn6_clear_sym","Clear SymD Symmetry",void 0,2),t+=this.getLink("mn6_axes_only","Show Axes Only",void 0,2),t+="
",t+="",t+=this.getMenuText("mn6_igrefwrap","Ref. Number",void 0,void 0,1),t+="",
+t+=this.getRadio("mn4_clr","mn4_clrIgstrand","Ig Strand",void 0,void 0,2),t+=this.getRadio("mn4_clr","mn4_clrIgproto","Ig Protodomain",void 0,void 0,2)):t+=this.getRadio("mn4_clr","mn4_clrAtom","Atom",!0,1,1),t+=this.getMenuSep(),t+=this.getLink("mn4_clrSave","Save Color",void 0,1),t+=this.getLink("mn4_clrApplySave","Apply Saved Color",void 0,1),t+="
",t}setMenu5(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu5_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";t+="",void 0===e.cfg.cid&&(t+=this.getLink("mn6_selectannotations","Seq. & Annotations "+e.htmlCls.wifiStr,1,1),t+=this.getLink("mn2_alignment","Aligned Seq. "+e.htmlCls.wifiStr,void 0,1),void 0===e.cfg.mmdbid&&void 0===e.cfg.gi&&void 0===e.cfg.blast_rep_id&&void 0===e.cfg.align&&void 0===e.cfg.chainalign||(t+=this.getLink("mn2_2ddgm","2D Diagram "+e.htmlCls.wifiStr,1,1)),t+=this.getMenuText("2dctnwrap","2D Cartoon",void 0,void 0,1),t+="
",t}setMenu6(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+=" ",t}setMenu6_base(){let e=this.icn3dui;if(e.bNode)return"";let t="";return t+="",t+=this.getLink("2dctn_chain","Chain Level",void 0,2),t+=this.getLink("2dctn_domain","Domain Level",void 0,2),t+=this.getLink("2dctn_secondary","Helix/Sheet Level",void 0,2),t+="
",t+="",t+=this.getLink("definedsets2","Defined Sets",1,1),t+=this.getMenuSep(),t+=this.getLink("mn6_hbondsYes","Interactions",1,1),t+=this.getMenuText("mn1_window","Bring to Front",void 0,void 0,1),t+="",t+=this.getLink("mn1_window_table","Interaction Table",void 0,2),t+=this.getLink("mn1_window_linegraph","2D Interaction Network",void 0,2),t+=this.getLink("mn1_window_scatterplot","2D Interaction Map",void 0,2),t+=this.getLink("mn1_window_graph","2D Graph(Force-Directed)",void 0,2),t+="
",t+="",t+=this.getLink("mn6_contactmap","Contact Map",void 0,1),t+=this.getLink("mn1_mutation","Mutation "+e.htmlCls.wifiStr,1,1)),e.cfg.hidelicense||(t+=this.getMenuText("mn1_delphiwrap","DelPhi Potential",void 0,1,1),t+="",t+=this.getLink("mn1_delphi","DelPhi Potential "+e.htmlCls.licenseStr,1,2),t+=this.getMenuText("mn1_phiwrap","Load PQR/Phi",void 0,void 0,2),t+="
",t+=""),t+=this.getMenuSep(),t+=this.getMenuText("mn6_distancewrap","Distance",void 0,1,1),t+="",t+=this.getLink("mn1_phi","Local PQR/Phi/Cube File",void 0,3),t+=this.getLink("mn1_phiurl","URL PQR/Phi/Cube File",void 0,3),t+="
",t+="",t+=this.getLink("delphipqr","Download PQR",void 0,2),t+="",t+=this.getRadio("mn6_distance","mn6_distanceYes","between Two Atoms",void 0,1,2),t+=this.getRadio("mn6_distance","mn6_distTwoSets","between Two Sets",void 0,void 0,2),t+=this.getRadio("mn6_distance","mn6_distManySets","Among Many Sets",void 0,void 0,2),t+=this.getRadio("mn6_distance","mn6_distanceNo","Hide",!0,1,2),t+="
",t+="",t+=this.getLink("mn6_area","Surface Area",1,1),t+=this.getMenuText("mn6_addlabelwrap","Label",void 0,1,1),t+="",t+=this.getRadio("mn6_addlabel","mn6_addlabelYes","by Picking Atoms",void 0,void 0,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelSelection","per Selection",void 0,void 0,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelAtoms","per Atom",void 0,void 0,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelElements","per Atom Element",void 0,1,2),void 0===e.cfg.cid&&(t+=this.getRadio("mn6_addlabel","mn6_addlabelResidues","per Residue",void 0,1,2),t+=this.getRadio("mn6_addlabel","mn6_addlabelResnum","per Residue & Number",void 0,1,2),
//!!!
-t+=this.getMenuSep(),t+=this.getLink("mn6_customref","Custom Ref. Number",void 0,2),t+="
",t+="",t+=this.getMenuSep()}return t+=this.getLink("mn6_yournote","Window Title",void 0,1),void 0!==e.cfg.cid?(t+=this.getMenuText("mn1_linkwrap","Links",void 0,void 0,1),t+="",t+=this.getLink("mn1_link_structure","Compound Summary "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_vast","Similar Compounds "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_bind","Structures Bound "+e.htmlCls.wifiStr,void 0,2),t+="
",t+=""):(t+=this.getMenuText("mn1_linkwrap","Links",void 0,void 0,1),t+="",t+=this.getLink("mn1_link_structure","Structure Summary "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_vast","Similar Structures "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_pubmed","Literature "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_protein","Protein "+e.htmlCls.wifiStr,void 0,2),t+="
",t+=""),t+="",t+=this.getMenuUrl("abouticn3d",e.htmlCls.baseUrl+"icn3d/icn3d.html#about","About iCn3D "+e.REVISION+"",1,1),t+=this.getMenuUrl("gallery",e.htmlCls.baseUrl+"icn3d/icn3d.html#gallery","Live Gallery "+e.htmlCls.wifiStr,1,1),t+=this.getMenuUrl("video",e.htmlCls.baseUrl+"icn3d/icn3d.html#videos","Videos & Tutorials",1,1),t+=this.getMenuText("mn6_faq","FAQ",void 0,1,1),t+="
",t}hideMenu(){let e=this.icn3dui;e.bNode||(void 0!==$("#"+e.pre+"mnlist")[0]&&($("#"+e.pre+"mnlist")[0].style.display="none"),void 0!==$("#"+e.pre+"mnLogSection")[0]&&($("#"+e.pre+"mnLogSection")[0].style.display="none"),void 0!==$("#"+e.pre+"cmdlog")[0]&&($("#"+e.pre+"cmdlog")[0].style.display="none"),$("#"+e.pre+"title")[0].style.margin="10px 0 0 10px")}showMenu(){let e=this.icn3dui;e.bNode||(void 0!==$("#"+e.pre+"mnlist")[0]&&($("#"+e.pre+"mnlist")[0].style.display="block"),void 0!==$("#"+e.pre+"mnLogSection")[0]&&($("#"+e.pre+"mnLogSection")[0].style.display="block"),void 0!==$("#"+e.pre+"cmdlog")[0]&&($("#"+e.pre+"cmdlog")[0].style.display="block"))}}class c{constructor(e){this.icn3dui=e}openDlg(e,t){let s=this.icn3dui;s.icn3d,s.bNode||(e=s.pre+e,s.cfg.notebook?this.openDlgNotebook(e,t):this.openDlgRegular(e,t),s.htmlCls.themecolor||(s.htmlCls.themecolor="blue"),s.htmlCls.setMenuCls.setTheme(s.htmlCls.themecolor))}addSaveButton(e){let t=this.icn3dui;t.icn3d,t.bNode||void 0!==this.dialogHashSave&&this.dialogHashSave.hasOwnProperty(e)||($("#"+e).parent().children(".ui-dialog-titlebar").append(""),void 0===this.dialogHashSave&&(this.dialogHashSave={}),this.dialogHashSave[e]=1)}addHideButton(e){let t=this.icn3dui;t.icn3d,t.bNode||void 0!==this.dialogHashHide&&this.dialogHashHide.hasOwnProperty(e)||($("#"+e).parent().children(".ui-dialog-titlebar").append(""),void 0===this.dialogHashHide&&(this.dialogHashHide={}),this.dialogHashHide[e]=1)}getDialogStatus(){let e=this.icn3dui;if(e.icn3d,e.bNode)return;let t={},s={},i=$("#"+e.pre+"dl_selectannotations").hasClass("ui-dialog-content"),n=$("#"+e.pre+"dl_graph").hasClass("ui-dialog-content"),l=$("#"+e.pre+"dl_linegraph").hasClass("ui-dialog-content"),r=$("#"+e.pre+"dl_scatterplot").hasClass("ui-dialog-content"),o=$("#"+e.pre+"dl_contactmap").hasClass("ui-dialog-content"),a=$("#"+e.pre+"dl_alignerrormap").hasClass("ui-dialog-content"),d=$("#"+e.pre+"dl_interactionsorted").hasClass("ui-dialog-content"),c=$("#"+e.pre+"dl_alignment").hasClass("ui-dialog-content"),h=$("#"+e.pre+"dl_2ddgm").hasClass("ui-dialog-content"),p=$("#"+e.pre+"dl_2dctn").hasClass("ui-dialog-content"),m=$("#"+e.pre+"dl_definedsets").hasClass("ui-dialog-content");return t.bSelectannotationsInit2=!1,t.bGraph2=!1,t.bLineGraph2=!1,t.bScatterplot2=!1,t.bTable2=!1,t.bAlignmentInit2=!1,t.bTwoddgmInit2=!1,t.bTwodctnInit2=!1,t.bSetsInit2=!1,s.dl_selectannotations="bSelectannotationsInit2",s.dl_graph="bGraph2",s.dl_linegraph="bLineGraph2",s.dl_scatterplot="bScatterplot2",s.dl_contactmap="bContactmap2",s.dl_alignerrormap="bAlignerrormap2",s.dl_interactionsorted="bTable2",s.dl_alignment="bAlignmentInit2",s.dl_2ddgm="bTwoddgmInit2",s.dl_2dctn="bTwodctnInit2",s.dl_definedsets="bSetsInit2",i&&(t.bSelectannotationsInit2=$("#"+e.pre+"dl_selectannotations").dialog("isOpen")),n&&(t.bGraph2=$("#"+e.pre+"dl_graph").dialog("isOpen")),l&&(t.bLineGraph2=$("#"+e.pre+"dl_linegraph").dialog("isOpen")),r&&(t.bScatterplot2=$("#"+e.pre+"dl_scatterplot").dialog("isOpen")),o&&(t.bContactmap2=$("#"+e.pre+"dl_contactmap").dialog("isOpen")),a&&(t.bAlignerror2=$("#"+e.pre+"dl_alignerrormap").dialog("isOpen")),d&&(t.bTable2=$("#"+e.pre+"dl_interactionsorted").dialog("isOpen")),c&&(t.bAlignmentInit2=$("#"+e.pre+"dl_alignment").dialog("isOpen")),h&&(t.bTwoddgmInit2=$("#"+e.pre+"dl_2ddgm").dialog("isOpen")),p&&(t.bTwodctnInit2=$("#"+e.pre+"dl_2dctn").dialog("isOpen")),m&&(t.bSetsInit2=$("#"+e.pre+"dl_definedsets").dialog("isOpen")),{status:t,id2flag:s}}openDlgHalfWindow(e,t,s,i){let n=this.icn3dui,l=n.icn3d;if(n.bNode)return;let r=this,o=n.htmlCls.width2d+20;l.resizeCanvasCls.resizeCanvas(n.htmlCls.WIDTH-s,n.htmlCls.HEIGHT,i);let a,d=n.htmlCls.HEIGHT,c=s;a=!n.cfg.showmenu||n.utilsCls.isMobile()||n.cfg.mobilemenu?{my:"left top",at:"right top",of:"#"+n.pre+"viewer",collision:"none"}:{my:"left top",at:"right top+40",of:"#"+n.pre+"viewer",collision:"none"},n.cfg.resize=!1,window.dialog=$("#"+e).dialog({autoOpen:!0,title:t,height:d,width:c,modal:!1,position:a,close:function(t){let s=r.getDialogStatus(),i=s.status,a=s.id2flag,d=!1;for(let t in a){let s=e===n.pre+t;for(let e in i)i.hasOwnProperty(e)||(s=s&&!i[e]);d=d||s}if(d)if(i.bTwoddgmInit2||i.bTwodctnInit2||i.bSetsInit2){let e=n.utilsCls.isMobile()?n.htmlCls.WIDTH:n.htmlCls.WIDTH-o;l.resizeCanvasCls.resizeCanvas(e,n.htmlCls.HEIGHT,!0),i.bTwoddgmInit2&&r.openDlg2Ddgm(n.pre+"dl_2ddgm",void 0,i.bSetsInit2),i.bTwodctnInit2&&r.openDlg2Ddgm(n.pre+"dl_2dctn",void 0,i.bSetsInit2),i.bSetsInit2&&r.openDlg2Ddgm(n.pre+"dl_definedsets")}else l.resizeCanvasCls.resizeCanvas(n.htmlCls.WIDTH,n.htmlCls.HEIGHT,!0)},resize:function(t){if(e==n.pre+"dl_selectannotations")l.annotationCls.hideFixedTitle();else if(e==n.pre+"dl_graph"){let t=$("#"+e).width(),s=$("#"+e).height();d3.select("#"+n.svgid).attr("width",t).attr("height",s)}else if(e==n.pre+"dl_linegraph"||e==n.pre+"dl_scatterplot"||e==n.pre+"dl_contactmap"||e==n.pre+"dl_alignerrormap"){let t=status.bTwoddgmInit2||status.bSetsInit2?(n.htmlCls.WIDTH-o)/2:n.htmlCls.WIDTH/2,s=$("#"+e).width()/t;if(e==n.pre+"dl_linegraph"){let e=l.linegraphWidth*s;$("#"+n.linegraphid).attr("width",e)}else if(e==n.pre+"dl_scatterplot"){let e=l.scatterplotWidth*s;$("#"+n.scatterplotid).attr("width",e)}else if(e==n.pre+"dl_contactmap"){let e=l.contactmapWidth*s;$("#"+n.contactmapid).attr("width",e)}else if(e==n.pre+"dl_alignerrormap"){let e=l.alignerrormapWidth*s;$("#"+n.alignerrormapid).attr("width",e)}}}}),this.addSaveButton(e),this.addHideButton(e)}openDlg2Ddgm(e,t,s){let i=this.icn3dui,n=i.icn3d;if(i.bNode)return;let l,r,o=this,a=i.htmlCls.width2d+20;e===i.pre+"dl_definedsets"?(l="right top",r="Select sets"):e!==i.pre+"dl_2ddgm"&&e!==i.pre+"dl_2dctn"||(l=s?"right top+240":"right top",r=e===i.pre+"dl_2ddgm"?"2D Diagram":"2D Cartoon");let d={my:"left top+"+i.htmlCls.MENU_HEIGHT,at:l,of:"#"+i.pre+"viewer",collision:"none"};window.dialog=$("#"+e).dialog({autoOpen:!0,title:r,height:"auto",width:a,modal:!1,position:d,close:function(e){let t=o.getDialogStatus().status;t.bSelectannotationsInit2||t.bGraph2||t.bLineGraph2||t.bScatterplot2||t.bTable2||t.bAlignmentInit2||n.resizeCanvasCls.resizeCanvas(i.htmlCls.WIDTH,i.htmlCls.HEIGHT,!0)},resize:function(t,s){e==i.pre+"dl_2dctn"&&(n.resizeRatioX=s.size.width/i.htmlCls.width2d,n.resizeRatioY=s.size.height/(i.htmlCls.width2d+70))},resizeStop:function(e,t){n.resizeRatioX=t.size.width/i.htmlCls.width2d,n.resizeRatioY=t.size.height/(i.htmlCls.width2d+70)}}),this.addSaveButton(e),this.addHideButton(e)}openDlgRegular(e,t){let s=this.icn3dui,i=s.icn3d;if(s.bNode)return;let n=400,l=150,r=s.htmlCls.width2d+20,o=this.getDialogStatus().status;if(e===s.pre+"dl_selectannotations"||e===s.pre+"dl_graph"||e===s.pre+"dl_linegraph"||e===s.pre+"dl_scatterplot"||e===s.pre+"dl_contactmap"||e===s.pre+"dl_alignerrormap"||e===s.pre+"dl_interactionsorted"||e===s.pre+"dl_alignment"){let a=.5*s.htmlCls.WIDTH-.5*r;if(s.htmlCls.WIDTH>=s.htmlCls.HEIGHT)this.openDlgHalfWindow(e,t,a,!0),(o.bTwoddgmInit2||o.bTwodctnInit2||o.bSetsInit2)&&(i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH-a-r,s.htmlCls.HEIGHT,!0),o.bTwoddgmInit2&&this.openDlg2Ddgm(s.pre+"dl_2ddgm",void 0,o.bSetsInit2),o.bTwodctnInit2&&this.openDlg2Ddgm(s.pre+"dl_2dctn",void 0,o.bSetsInit2),o.bSetsInit2&&this.openDlg2Ddgm(s.pre+"dl_definedsets"));else{i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH,.5*s.htmlCls.HEIGHT,!0),l=.5*s.htmlCls.HEIGHT,n=s.htmlCls.WIDTH;let a={my:"left top",at:"left bottom+32",of:"#"+s.pre+"canvas",collision:"none"};window.dialog=$("#"+e).dialog({autoOpen:!0,title:t,height:l,width:n,modal:!1,position:a,close:function(t){if(!((e!==s.pre+"dl_selectannotations"||o.bAlignmentInit2||o.bGraph2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_graph"||o.bSelectannotationsInit2||o.bAlignmentInit2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_alignment"||o.bSelectannotationsInit2||o.bGraph2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_interactionsorted"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_linegraph"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bTable2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_scatterplot"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bTable2||o.bLineGraph2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_contactmap"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bAlignerrormap2)&&(e!==s.pre+"dl_alignerrormap"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2)))if(o.bTwoddgmInit2||o.bTwodctnInit2||o.bSetsInit2){let e=s.utilsCls.isMobile()?s.htmlCls.WIDTH:s.htmlCls.WIDTH-r;i.resizeCanvasCls.resizeCanvas(e,s.htmlCls.HEIGHT,!0),o.bTwoddgmInit2&&thisClass.openDlg2Ddgm(s.pre+"dl_2ddgm",void 0,o.bSetsInit2),o.bTwodctnInit2&&thisClass.openDlg2Ddgm(s.pre+"dl_2dctn",void 0,o.bSetsInit2),o.bSetsInit2&&thisClass.openDlg2Ddgm(s.pre+"dl_definedsets")}else i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH,s.htmlCls.HEIGHT,!0)},resize:function(t){if(e==s.pre+"dl_selectannotations")i.annotationCls.hideFixedTitle();else if(e==s.pre+"dl_graph"){let t=$("#"+e).width(),i=$("#"+e).height();d3.select("#"+s.svgid).attr("width",t).attr("height",i)}else if(e==s.pre+"dl_linegraph"||e==s.pre+"dl_scatterplot"||e==s.pre+"dl_contactmap"||e==s.pre+"dl_alignerrormap"){let t=o.bTwoddgmInit2||o.bSetsInit2?(s.htmlCls.WIDTH-r)/2:s.htmlCls.WIDTH/2,n=$("#"+e).width()/t;if(e==s.pre+"dl_linegraph"){let e=i.linegraphWidth*n;$("#"+s.linegraphid).attr("width",e)}else if(e==s.pre+"dl_scatterplot"){let e=i.scatterplotWidth*n;$("#"+s.scatterplotid).attr("width",e)}else if(e==s.pre+"dl_contactmap"){let e=i.contactmapWidth*n;$("#"+s.contactmapid).attr("width",e)}else if(e==s.pre+"dl_alignerrormap"){let e=i.alignerrormapWidth*n;$("#"+s.alignerrormapid).attr("width",e)}}}}),this.addSaveButton(e),this.addHideButton(e)}}else if(e===s.pre+"dl_2ddgm"||e===s.pre+"dl_2dctn"){let t=0;if(s.htmlCls.WIDTH>=s.htmlCls.HEIGHT)(o.bSelectannotationsInit2||o.bGraph2||o.bLineGraph2||o.bScatterplot2||o.bTable2||o.bAlignmentInit2)&&(t=.5*s.htmlCls.WIDTH-.5*r),i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH-t-r,s.htmlCls.HEIGHT,!0),this.openDlg2Ddgm(e,void 0,o.bSetsInit2);else{let t=s.utilsCls.isMobile()?s.htmlCls.WIDTH:s.htmlCls.WIDTH-r;i.resizeCanvasCls.resizeCanvas(t,.5*s.htmlCls.HEIGHT,!0),this.openDlg2Ddgm(e,.5*s.htmlCls.HEIGHT),this.openDlg2Ddgm(e,.5*s.htmlCls.HEIGHT,o.bSetsInit2)}}else{let a;if(l="auto",n="auto",e===s.pre+"dl_addtrack"?n="50%":e===s.pre+"dl_menupref"&&(n=600,l=500),e===s.pre+"dl_definedsets"){let t=0;if(s.htmlCls.WIDTH>=s.htmlCls.HEIGHT)(o.bSelectannotationsInit2||o.bGraph2||o.bLineGraph2||o.bScatterplot2||o.bTable2||o.bAlignmentInit2)&&(t=.5*s.htmlCls.WIDTH-.5*r),i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH-t-r,s.htmlCls.HEIGHT,!0),this.openDlg2Ddgm(e),o.bTwoddgmInit2&&this.openDlg2Ddgm(s.pre+"dl_2ddgm",void 0,!0),o.bTwodctnInit2&&this.openDlg2Ddgm(s.pre+"dl_2dctn",void 0,!0);else{let t=s.utilsCls.isMobile()?s.htmlCls.WIDTH:s.htmlCls.WIDTH-r;i.resizeCanvasCls.resizeCanvas(t,.5*s.htmlCls.HEIGHT,!0),this.openDlg2Ddgm(e,.5*s.htmlCls.HEIGHT),o.bTwoddgmInit2&&this.openDlg2Ddgm(s.pre+"dl_2ddgm",.5*s.htmlCls.HEIGHT,!0),o.bTwodctnInit2&&this.openDlg2Ddgm(s.pre+"dl_2dctn",.5*s.htmlCls.HEIGHT,!0)}}else s.utilsCls.isMobile()?a={my:"left top",at:"left bottom-50",of:"#"+s.pre+"canvas",collision:"none"}:e===s.pre+"dl_allinteraction"||e===s.pre+"dl_buriedarea"?(a={my:"right top",at:"right top+50",of:"#"+i.divid,collision:"none"},n=700,l=500):a=e===s.pre+"dl_rmsd"||e===s.pre+"dl_legend"?{my:"left bottom",at:"left+20 bottom-20",of:"#"+s.pre+"canvas",collision:"none"}:e===s.pre+"dl_symd"?{my:"left top",at:"right-200 bottom-200",of:"#"+s.pre+"canvas",collision:"none"}:s.cfg.align?{my:"left top",at:"left top+90",of:"#"+s.pre+"canvas",collision:"none"}:e===s.pre+"dl_mmdbafid"?{my:"left top",at:"left top+130",of:"#"+s.pre+"canvas",collision:"none"}:{my:"left top",at:"left top+50",of:"#"+s.pre+"canvas",collision:"none"},window.dialog=$("#"+e).dialog({autoOpen:!0,title:t,height:l,width:n,modal:!1,position:a}),this.addSaveButton(e),this.addHideButton(e)}$(".ui-dialog .ui-button span").removeClass("ui-icon-closethick").addClass("ui-icon-close")}openDlgNotebook(e,t){let s=this.icn3dui,i=s.icn3d;if(s.bNode)return;let n=400,l=150,r=s.htmlCls.width2d+20;e===s.pre+"dl_selectannotations"||e===s.pre+"dl_graph"||e===s.pre+"dl_linegraph"||e===s.pre+"dl_scatterplot"||e===s.pre+"dl_contactmap"||e===s.pre+"dl_alignerrormap"||e===s.pre+"dl_interactionsorted"||e===s.pre+"dl_alignment"?($("#"+e).show(),$("#"+e+"_nb").show(),$("#"+e+"_title").html(t),l=.5*s.htmlCls.HEIGHT,n=s.htmlCls.WIDTH,$("#"+e).width(n),$("#"+e).height(l),$("#"+e).resize((function(t){let n=s.htmlCls.WIDTH/2,l=$("#"+e).width()/n;if(e==s.pre+"dl_selectannotations")i.annotationCls.hideFixedTitle();else if(e==s.pre+"dl_graph"){let t=$("#"+e).width(),i=$("#"+e).height();d3.select("#"+s.svgid).attr("width",t).attr("height",i)}else if(e==s.pre+"dl_linegraph"){let e=i.linegraphWidth*l;$("#"+s.linegraphid).attr("width",e)}else if(e==s.pre+"dl_scatterplot"){let e=i.scatterplotWidth*l;$("#"+s.scatterplotid).attr("width",e)}else if(e==s.pre+"dl_contactmap"){let e=i.contactmapWidth*l;$("#"+s.contactmapid).attr("width",e)}else if(e==s.pre+"dl_alignerrormap"){let e=i.alignerrormapWidth*l;$("#"+s.alignerrormapid).attr("width",e)}}))):(i.bRender&&($("#"+e).show(),$("#"+e+"_nb").show(),$("#"+e+"_title").html(t)),l="auto",n="auto",e===s.pre+"dl_addtrack"?n="50%":e===s.pre+"dl_2ddgm"||e===s.pre+"dl_2dctn"||e===s.pre+"dl_definedsets"?n=r:e!==s.pre+"dl_allinteraction"&&e!==s.pre+"dl_buriedarea"||(n=700,l=500),$("#"+e).width(n),$("#"+e).height(l))}}class h{constructor(e){this.icn3dui=e}setCustomDialogs(){let e=this.icn3dui;if(e.icn3d,e.bNode)return"";return""}getHtmlAlignResidueByResidue(e,t,s){let i=this.icn3dui;i.icn3d;let n="";return n+="All chains will be aligned to the first chain in the comma-separated chain IDs. Each chain ID has the form of PDBID_chain (e.g., 1HHO_A, case sensitive) or UniprotID (e.g., P69905 for AlphaFold structures).",t+=this.getMenuUrl("faq_viewstru",e.htmlCls.baseUrl+"icn3d/icn3d.html#viewstru","View structure",1,2),t+=this.getMenuUrl("faq_tfstru",e.htmlCls.baseUrl+"icn3d/icn3d.html#tfstru","Transform Structure",1,2),t+=this.getMenuUrl("faq_selsubset",e.htmlCls.baseUrl+"icn3d/icn3d.html#selsubset","Select Subsets",1,2),t+=this.getMenuUrl("faq_stylecolor",e.htmlCls.baseUrl+"icn3d/icn3d.html#changestylecolor","Change Style/Color",1,2),t+=this.getMenuUrl("faq_savework",e.htmlCls.baseUrl+"icn3d/icn3d.html#saveview","Save Work",1,2),t+=this.getMenuUrl("faq_showanno",e.htmlCls.baseUrl+"icn3d/icn3d.html#showanno","Show Annotations",1,2),t+=this.getMenuUrl("faq_exportanno",e.htmlCls.baseUrl+"icn3d/icn3d.html#exportanno","Export Annotations",1,2),t+=this.getMenuUrl("faq_interanal",e.htmlCls.baseUrl+"icn3d/icn3d.html#interanalysis","Interaction Analysis",1,2),t+=this.getMenuUrl("faq_mutanal",e.htmlCls.baseUrl+"icn3d/icn3d.html#mutationanalysis","Mutation Analysis",1,2),t+=this.getMenuUrl("faq_elecpot",e.htmlCls.baseUrl+"icn3d/icn3d.html#elecpot","Electrostatic Pot.",1,2),t+=this.getMenuUrl("faq_simipdb",e.htmlCls.baseUrl+"icn3d/icn3d.html#simivast","Similar PDB",1,2),t+=this.getMenuUrl("faq_simialphapdb",e.htmlCls.baseUrl+"icn3d/icn3d.html#simifoldseek","Similar AlphaFold/PDB",1,2),t+=this.getMenuUrl("faq_alnstru",e.htmlCls.baseUrl+"icn3d/icn3d.html#alignmul","Align Multiple Structures",1,2),t+=this.getMenuUrl("faq_batchanal",e.htmlCls.baseUrl+"icn3d/icn3d.html#batchanalysis","Batch Analysis",1,2),t+=this.getMenuUrl("faq_embedicn3d",e.htmlCls.baseUrl+"icn3d/icn3d.html#embedicn3d","Embed iCn3D",1,2),t+="
",t+="",t+=this.getMenuUrl("citing",e.htmlCls.baseUrl+"icn3d/icn3d.html#citing","Citing iCn3D",void 0,1),t+=this.getMenuText("mn6_source","Source Code",void 0,1,1),t+="",t+=this.getMenuUrl("github","https://github.com/ncbi/icn3d","GitHub (browser) "+e.htmlCls.wifiStr,1,2),t+=this.getMenuUrl("npm","https://www.npmjs.com/package/icn3d","npm (Node.js) "+e.htmlCls.wifiStr,1,2),t+=this.getMenuUrl("notebook","https://pypi.org/project/icn3dpy","Jupyter Notebook "+e.htmlCls.wifiStr,1,2),t+="
",t+="",t+=this.getMenuText("mn6_develop","Develop",void 0,void 0,1),t+="",t+=this.getMenuUrl("dev_embedicn3d2",e.htmlCls.baseUrl+"icn3d/icn3d.html#HowToUse","Embed iCn3D",void 0,2),t+=this.getMenuUrl("dev_urlpara",e.htmlCls.baseUrl+"icn3d/icn3d.html#parameters","URL Parameters",void 0,2),t+=this.getMenuUrl("dev_command",e.htmlCls.baseUrl+"icn3d/icn3d.html#commands","Commands",void 0,2),t+=this.getMenuUrl("dev_datastru",e.htmlCls.baseUrl+"icn3d/icn3d.html#datastructure","Data Structure",void 0,2),t+=this.getMenuUrl("dev_classstru",e.htmlCls.baseUrl+"icn3d/icn3d.html#classstructure","Class Structure",void 0,2),t+=this.getMenuUrl("dev_addclass",e.htmlCls.baseUrl+"icn3d/icn3d.html#addclass","Add New Classes",void 0,2),t+=this.getMenuUrl("dev_modfunc",e.htmlCls.baseUrl+"icn3d/icn3d.html#modifyfunction","Modify Functions",void 0,2),t+=this.getMenuUrl("dev_restful",e.htmlCls.baseUrl+"icn3d/icn3d.html#restfulapi","RESTful APIs",void 0,2),t+=this.getMenuUrl("dev_contributor",e.htmlCls.baseUrl+"icn3d/icn3d.html#contributors","iCn3D Contributors",void 0,2),t+="
",t+="",t+=this.getMenuUrl("helpdoc",e.htmlCls.baseUrl+"icn3d/docs/icn3d_help.html","Help Doc "+e.htmlCls.wifiStr,1,1),t+=this.getMenuSep(),t+=this.getMenuText("mn6_tfhint","Transform Hints",void 0,1,1),t+="",t+=this.getMenuText("mn6_rotate","Rotate",void 0,1,2),t+="
",t+="",t+=this.getMenuUrl("selhints",e.htmlCls.baseUrl+"icn3d/icn3d.html#selsubset","Selection Hints",void 0,1),t+=this.getMenuUrl("helpdesk","https://support.nlm.nih.gov/support/create-case/","Write to Help Desk",1,1),t+="",t+="
",t+="",t+=this.getMenuText("mn6_zoom","Zoom",void 0,1,2),t+="",t+="
",t+="",t+=this.getMenuText("mn6_translate","Translate",void 0,1,2),t+="
(Pinch & Spread)",t+="
",t+="",t+="
(Two Finger Click & Drag)
",n+="Chain IDs: "+i.htmlCls.inputTextStr+"id='"+i.pre+e+"' value='P69905,P01942,1HHO_A' size=50>
",n+='Each alignment is defined as " | "-separated residue lists in one line. "10-50" means a range of residues from 10 to 50.
",n+=i.htmlCls.buttonStr+s+"'>Align Residue by Residue
",n}addNotebookTitle(e,t,s){let i=this.icn3dui;i.icn3d;let n=' ';return s&&(n+=''),n}setDialogs(){let e=this.icn3dui,t=e.icn3d;if(e.bNode)return"";let s="";e.htmlCls.optionStr="",s+=e.htmlCls.optionStr+"'"+r+"4'>4px",s+=e.htmlCls.optionStr+"'"+r+"8' selected>8px",s+=e.htmlCls.optionStr+"'"+r+"12'>12px",s+=e.htmlCls.optionStr+"'"+r+"16'>16px",s+=e.htmlCls.optionStr+"'"+r+"24'>24px",s+=e.htmlCls.optionStr+"'"+r+"32'>32px",s+="",s+="",s+="",s+="",s+=e.htmlCls.divStr+"dl_alignment' class='"+n+"' style='background-color:white;'>",s+=this.addNotebookTitle("dl_alignment","Dynamically Calculated Symmetry using SymD"),s+=e.htmlCls.divStr+"symd_info'>",s+=e.htmlCls.divStr+"alignseqguide_wrapper'>
"+e.htmlCls.setHtmlCls.setAlignSequenceGuide()+"",s+=e.htmlCls.divStr+"dl_sequence2' class='icn3d-dl_sequence'>",s+=this.addNotebookTitle("dl_sequence2","Select Residues in Aligned Sequences"),s+="",s+="",s+=e.htmlCls.divStr+"dl_definedsets' class='"+n+"'>",s+=this.addNotebookTitle("dl_definedsets","Defined Sets"),s+=e.htmlCls.divStr+"dl_setsmenu'>",s+="Defined Sets:
",s+="
',s+="",s+=e.htmlCls.divStr+"dl_command' style='display:none;'>",s+=e.htmlCls.divStr+"dl_setoperations'>",s+="
",s+="
",s+="",s+="
",s+=e.htmlCls.setHtmlCls.setAdvanced(),s+="",s+="",s+=e.htmlCls.setHtmlCls.setAdvanced(2),s+=e.htmlCls.divStr+"dl_vastplus' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_vastplus","Please input PDB ID for VAST+"),s+="Note: VAST+ finds other macromolecular structures that have a similar biological unit. To do this, VAST+ takes into consideration the complete set of 3D domains that VAST identified within a query structure, throughout all of its component protein molecules, and finds other macromolecular structures that have a similar set of proteins/3D domains.
",s+="PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"vastpluspdbid' value='6VXX' size=8>
",s+=e.htmlCls.buttonStr+"reload_vastplus'>VAST+",s+="",s+=e.htmlCls.divStr+"dl_vast' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_vast","Pleaes input chain or PDB file for VAST"),s+="Note: VAST identifies 3D domains (substructures) within each protein structure in the Molecular Modeling Database (MMDB), and then finds other protein structures that have one or more similar 3D domains, using purely geometric criteria. You have two ways to do a VAST search.
",s+="Option 1, search with your selection (all residues are selected by default) in the loaded structures:
",s+='
",s+="Option 2, search with PDB ID and chain name:
",s+="PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"vastpdbid' value='4N7N' size=8> ",s+="Chain Name: "+e.htmlCls.inputTextStr+"id='"+e.pre+"vastchainid' value='A' size=8>
",s+=e.htmlCls.buttonStr+"reload_vast'>VAST
",s+="Option 3, search with a PDB file:
",s+='
",s+="",s+=e.htmlCls.divStr+"dl_foldseek' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_foldseek","Submit your selection to Foldseek"),s+='1. your selection (all residues are selected by default) in the loaded structures to Foldseek web server.
',s+='2 (Optional). Once you see the structure neighbors, you can view the alignment in iCn3D by inputing a list of PDB chain IDs or AlphaFold UniProt IDs below.
The PDB chain IDs are the same as the record names such as "1HHO_A". The UniProt ID is the text between "AF-" and "-F1". For example, the UniProt ID for the record name "AF-P69905-F1-model_v4" is "P69905".
',s+="Chain ID List: "+e.htmlCls.inputTextStr+"id='"+e.pre+"foldseekchainids' value='P69905,P01942,1HHO_A' size=30> ",s+=e.htmlCls.buttonStr+"reload_foldseek'>Align",s+="",s+=e.htmlCls.divStr+"dl_mmtfid' class='"+n+"'>",s+=this.addNotebookTitle("dl_mmtfid","Please input an MMTF ID"),s+="MMTF ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"mmtfid' value='1TUP' size=8> ",s+=e.htmlCls.buttonStr+"reload_mmtf'>Load",s+="",s+=e.htmlCls.divStr+"dl_pdbid' class='"+n+"'>",s+=this.addNotebookTitle("dl_pdbid","Please input a PDB ID"),s+="PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"pdbid' value='1TUP' size=8> ",s+=e.htmlCls.buttonStr+"reload_pdb'>Load",s+="",s+=e.htmlCls.divStr+"dl_afid' class='"+n+"'>",s+=this.addNotebookTitle("dl_afid","Please input an AlphaFold UniProt ID"),s+="Note: AlphaFold produces a per-residue confidence score (pLDDT) between 0 and 100:
",s+=e.htmlCls.clickMenuCls.setAlphaFoldLegend()+"
";let o=e.cfg.afid?e.cfg.afid:"A4D1S0";s+="AlphaFold Uniprot ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"afid' value='"+o+"' size=10>
",s+=e.htmlCls.buttonStr+"reload_af'>Load Structure
",s+="PAE Map: "+e.htmlCls.buttonStr+"reload_afmap'>Load Half"+e.htmlCls.buttonStr+"reload_afmapfull' style='margin-left:30px'>Load Full (slow)",s+="",s+=e.htmlCls.divStr+"dl_refseqid' class='"+n+"'>",s+=this.addNotebookTitle("dl_refseqid","Please input an NCBI protein accession"),s+="NCBI Protein Accession: "+e.htmlCls.inputTextStr+"id='"+e.pre+"refseqid' value='NP_001743.1' size=8> ",s+=e.htmlCls.buttonStr+"reload_refseq'>Load",s+="",s+=e.htmlCls.divStr+"dl_opmid' class='"+n+"'>",s+=this.addNotebookTitle("dl_opmid","Please input an OPM PDB ID"),s+="Orientations of Proteins in Membranes(OPM) PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"opmid' value='6JXR' size=8> ",s+=e.htmlCls.buttonStr+"reload_opm'>Load",s+="",s+=e.htmlCls.divStr+"dl_pdbfile' class='"+n+"'>",s+=this.addNotebookTitle("dl_pdbfile","Please input a PDB file"),s+='Note: Several PDB files could be concatenated into a single PDB file. Use the line "ENDMDL" to separate PDB files.
',s+="PDB File: "+e.htmlCls.inputFileStr+" id='"+e.pre+"pdbfile' size=8> ",s+=e.htmlCls.buttonStr+"reload_pdbfile'>Load",s+="",s+=e.htmlCls.divStr+"dl_pdbfile_app' class='"+n+"'>",s+=this.addNotebookTitle("dl_pdbfile_app","Please append PDB files"),s+="Multiple PDB Files: ",s+=e.htmlCls.buttonStr+"reload_pdbfile_app'>Append",s+="",s+=e.htmlCls.divStr+"dl_rescolorfile' class='"+n+"'>",s+=this.addNotebookTitle("dl_rescolorfile","Please input a residue color file"),s+='
',s+='{"ALA":"#C8C8C8", "ARG":"#145AFF", ..., "G":"#008000", "A":"#6080FF", ...}
',s+="Residue Color File: "+e.htmlCls.inputFileStr+"id='"+e.pre+"rescolorfile' size=8> ",s+=e.htmlCls.buttonStr+"reload_rescolorfile'>Load",s+="",s+=e.htmlCls.divStr+"dl_customcolor' class='"+n+"'>",s+=this.addNotebookTitle("dl_customcolor","Please input a custom color file"),s+=" ",s+='
',s+="Custom File: "+e.htmlCls.inputFileStr+"id='"+e.pre+"cstcolorfile' size=8>
",s+="1. "+e.htmlCls.buttonStr+"reload_customcolorfile'>Apply Custom Color"+e.htmlCls.buttonStr+"remove_legend' style='margin-left:30px;'>Remove Legend
",s+="Score to Color: 0:
",s+="or
",s+="2. "+e.htmlCls.buttonStr+"reload_customtubefile'>Apply Custom Tube",s+="",s+=e.htmlCls.divStr+"dl_customref' class='"+n+"'>",s+=this.addNotebookTitle("dl_customref","Please input a reference number file"),s+='
',s+="refnum,11,12,,21,22,,10C,11C,20C
",s+="1TUP_C,,,,,,,200,201,230",s+='The first row defines the reference residue numbers, which could be any strings. The 1st cell could be anything. The rest cells are reference residue numbers (e.g., 11, 21, 10C, etc.) 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 fourth row shows another set of reference numners for the chain "1TUP_C". It could be a chain from a different structure.
",s+="1TUP_A,100,101,,,132,,,,
",s+="1TUP_B,110,111,,141,142,,,,
',s+='To select all residues corresponding to the reference numbers, you can simplay replace ":" with "%" in the Specification. 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.
',s+="
",s+="Custom File: "+e.htmlCls.inputFileStr+"id='"+e.pre+"cstreffile' size=8>
",s+=e.htmlCls.buttonStr+"reload_customreffile'>Apply Custom Reference Numbers",s+="",s+=e.htmlCls.divStr+"dl_align' class='"+n+"'>",s+=this.addNotebookTitle("dl_align","Please select residues in aligned sequences"),s+="Enter the PDB IDs or MMDB IDs of the structures:
ID1: "+e.htmlCls.inputTextStr+"id='"+e.pre+"alignid1' value='2DN3' size=8>"+e.htmlCls.space3+e.htmlCls.space3+"ID2: "+e.htmlCls.inputTextStr+"id='"+e.pre+"alignid2' value='4N7N' size=8>
",s+="VAST+ based on VAST: "+e.htmlCls.buttonStr+"reload_align_ori'>All Matching Molecules Superposed"+e.htmlCls.space3+e.htmlCls.buttonStr+"reload_align_refined'>Invariant Substructure Superposed
",s+="VAST+ based on TM-align: "+e.htmlCls.buttonStr+"reload_align_tmalign'>All Matching Molecules Superposed
",s+="",s+=e.htmlCls.divStr+"dl_alignaf' class='"+n+"'>",s+=this.addNotebookTitle("dl_alignaf","Align AlphaFold structures"),s+="Enter two AlphaFold Uniprot IDs:
ID1: "+e.htmlCls.inputTextStr+"id='"+e.pre+"alignafid1' value='P41327' size=8>"+e.htmlCls.space3+e.htmlCls.space3+"ID2: "+e.htmlCls.inputTextStr+"id='"+e.pre+"alignafid2' value='P41331' size=8>
",s+=e.htmlCls.buttonStr+"reload_alignaf_tmalign'>Align with TM-align"+e.htmlCls.buttonStr+"reload_alignaf' style='margin-left:30px'>Align with VAST",s+="",s+=e.htmlCls.divStr+"dl_chainalign' class='"+n+"'>",s+=this.addNotebookTitle("dl_chainalign","Align chains"),s+="
",s+="Chain IDs: "+e.htmlCls.inputTextStr+"id='"+e.pre+"chainalignids' value='P69905,P01942,1HHO_A' size=50>
",s+=e.htmlCls.buttonStr+"reload_chainalign_tmalign'>Align with TM-align"+e.htmlCls.buttonStr+"reload_chainalign_asym' style='margin-left:30px'>Align with VAST
",s+='(Note: To align chains in custom PDB files, you could load them in "File > Open File > PDB Files (appendable)" and click "Analysis > Defined Sets". Finally select multiple chains in Defined Sets and click "File > Realign Selection".)
',s+="
",s+="Chain IDs: "+e.htmlCls.inputTextStr+"id='"+e.pre+"chainalignids2' value='P69905,P01942,1HHO_A' size=50>
",s+="The sequence alignment (followed by structure alignemnt) is based on residue numbers in the First/Master chain:
"+e.htmlCls.inputTextStr+"id='"+e.pre+"resalignids' value='1,5,10-50' size=50>
",s+=e.htmlCls.buttonStr+"reload_chainalign_asym2' style='margin-top:3px;'>Align by Sequence Alignment
",s+='(Note: To align chains in custom PDB files, you could load them in "File > Open File > PDB Files (appendable)" and click "Analysis > Defined Sets". Finally select multiple chains in Defined Sets and click "File > Realign Selection".)
',s+="
",s+="Option 2:
",s+="
If you load a custom structure without PDB or UniProt ID, you can open "Seq. & Annotations" window and find the chain ID such as "stru_A". The part before the underscore is the structure ID, which can be used to specify the mutation such as "stru_A_...". Remember to choose "Show Mutation in: Current Page".
',s+="
",s+="ID Type: ",s+='PDB ID',s+='AlphaFold UniProt ID
',s+="Show Mutation in: ",s+='Current Page',s+='New Page
',s+=e.htmlCls.buttonStr+"reload_mutation_3d' title='Show the mutations in 3D using the scap program'>3D with scap",s+=e.htmlCls.buttonStr+"reload_mutation_inter' style='margin-left:20px' title='Show the mutations in 3D and the change of interactions'>Interactions",s+=e.htmlCls.buttonStr+"reload_mutation_pdb' style='margin-left:20px' title='Show the mutations in 3D and export the PDB of the mutant within 10 angstrom'>PDB",s+="
",s+=e.htmlCls.buttonStr+"reload_afmapfile'>Load Half PAE Map"+e.htmlCls.buttonStr+"reload_afmapfilefull' style='margin-left:30px'>Load Full PAE Map (slow)",s+="",s+=e.htmlCls.divStr+"dl_urlfile' class='"+n+"'>",s+=this.addNotebookTitle("dl_urlfile","Please input a file via URL"),s+="File type: ",s+="
",s+="URL in the same host: "+e.htmlCls.inputTextStr+"id='"+e.pre+"urlfile' size=20>
",s+=e.htmlCls.buttonStr+"reload_urlfile'>Load",s+="",s+=e.htmlCls.divStr+"dl_mmciffile' class='"+n+"'>",s+=this.addNotebookTitle("dl_mmciffile","Please input an mmCIF file"),s+="mmCIF File: "+e.htmlCls.inputFileStr+"id='"+e.pre+"mmciffile' value='1TUP' size=8> ",s+=e.htmlCls.buttonStr+"reload_mmciffile'>Load",s+="",s+=e.htmlCls.divStr+"dl_mmcifid' class='"+n+"'>",s+=this.addNotebookTitle("dl_mmcifid","Please input an mmCIF ID"),s+="mmCIF ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"mmcifid' value='1TUP' size=8> ",s+=e.htmlCls.buttonStr+"reload_mmcif'>Load",s+="",s+=e.htmlCls.divStr+"dl_mmdbid' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_mmdbid","Please input an MMDB ID"),s+="MMDB or PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"mmdbid' value='1TUP' size=8>
",s+=e.htmlCls.buttonStr+"reload_mmdb'>Load Biological Unit"+e.htmlCls.buttonStr+"reload_mmdb_asym' style='margin-left:30px'>Load Asymmetric Unit (All Chains)
",s+='Note: The "biological unit" is the biochemically active form of a biomolecule,
The "asymmetric unit" is the raw 3D structure data resolved by X-ray crystallography, NMR, or Cryo-electron microscopy. The asymmetric unit is equivalent to the biological unit in approximately 60% of structure records. In the remaining 40% of the records, the asymmetric unit represents a portion of the biological unit that can be reconstructed using crystallographic symmetry, or it represents multiple copies of the biological unit.',s+="",s+=e.htmlCls.divStr+"dl_mmdbafid' class='"+n+"' style='max-width:600px'>",s+=this.addNotebookTitle("dl_mmdbafid","Please input a list of PDB/AlphaFold IDs"),s+="List of PDB, MMDB, or AlphaFold UniProt structures: "+e.htmlCls.inputTextStr+"id='"+e.pre+"mmdbafid' placeholder='e.g., 1HHO,4N7N,P69905,P01942' size=30>
",s+=""+e.htmlCls.buttonStr+"reload_mmdbaf' style='width:150px'>Load Biological Unit"+e.htmlCls.buttonStr+"reload_mmdbaf_asym' style='margin-left:30px; width:250px'>Load Asymmetric Unit (All Chains)
",s+="
",s+='Note: The "biological unit" is the biochemically active form of a biomolecule,
The "asymmetric unit" is the raw 3D structure data resolved by X-ray crystallography, NMR, or Cryo-electron microscopy. The asymmetric unit is equivalent to the biological unit in approximately 60% of structure records. In the remaining 40% of the records, the asymmetric unit represents a portion of the biological unit that can be reconstructed using crystallographic symmetry, or it represents multiple copies of the biological unit.',s+="",s+=e.htmlCls.divStr+"dl_blast_rep_id' style='max-width:600px;' class='"+n+"'>",s+=this.addNotebookTitle("dl_blast_rep_id","Align sequence to structure"),s+="Enter a Sequence ID (or FASTA sequence) and the aligned protein accession, which can be found using the BLAST search with the Sequence ID or FASTA sequence as input. If the protein accession is not a PDB chain, the corresponding AlphaFold UniProt structure is used.
",s+="Sequence ID(NCBI protein accession of a sequence): "+e.htmlCls.inputTextStr+"id='"+e.pre+"query_id' value='NP_001108451.1' size=8>
",s+="or FASTA sequence:
",s+="NCBI protein accession (or a chain of a PDB): "+e.htmlCls.inputTextStr+"id='"+e.pre+"blast_rep_id' value='1TSR_A' size=8>
",s+=e.htmlCls.buttonStr+"reload_blast_rep_id'>Align with BLAST "+e.htmlCls.wifiStr+e.htmlCls.buttonStr+"reload_alignsw' style='margin-left:30px'>Align with Global Smith-Waterman"+e.htmlCls.buttonStr+"reload_alignswlocal' style='margin-left:30px'>Align with Local Smith-Waterman",s+="",s+=e.htmlCls.divStr+"dl_esmfold' style='max-width:600px;' class='"+n+"'>",s+=this.addNotebookTitle("dl_esmfold","Sequence to structure prediction with ESMFold"),s+="The sequence to structure prediction is done via ESM Metagenomic Atlas. The sequence should be less than 400 characters. For any sequence longer than 400, please see the discussion here.
",s+="FASTA sequence:
",s+=e.htmlCls.buttonStr+"run_esmfold'>ESMFold ",s+="",s+=e.htmlCls.divStr+"dl_yournote' class='"+n+"'>",s+=this.addNotebookTitle("dl_yournote","Your Note"),s+='Your note will be saved in the HTML file when you click "File > Save File > iCn3D PNG Image".
',s+="
",s+=e.htmlCls.buttonStr+"applyyournote'>Save",s+="",s+=e.htmlCls.divStr+"dl_proteinname' class='"+n+"'>",s+=this.addNotebookTitle("dl_proteinname","Please input a protein/gene name"),s+="Protein/Gene name: "+e.htmlCls.inputTextStr+"id='"+e.pre+"proteinname' value='TP53' size=8> ",s+=e.htmlCls.buttonStr+"reload_proteinname'>Search",s+="",s+=e.htmlCls.divStr+"dl_cid' class='"+n+"'>",s+=this.addNotebookTitle("dl_cid","Please input a PubChem CID"),s+="PubChem CID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"cid' value='2244' size=8> ",s+=e.htmlCls.buttonStr+"reload_cid'>Load",s+="",s+=e.htmlCls.divStr+"dl_pngimage' class='"+n+"'>",s+=this.addNotebookTitle("dl_pngimage","Please input an iCn3D PNG Image file"),s+="iCn3D PNG image: "+e.htmlCls.inputFileStr+"id='"+e.pre+"pngimage'>
",s+=e.htmlCls.buttonStr+"reload_pngimage' style='margin-top: 6px;'>Load",s+="",s+=e.htmlCls.divStr+"dl_state' class='"+n+"'>",s+=this.addNotebookTitle("dl_state","Please input a state file"),s+="State file: "+e.htmlCls.inputFileStr+"id='"+e.pre+"state'>
",s+=e.htmlCls.buttonStr+"reload_state' style='margin-top: 6px;'>Load",s+="",s+=e.htmlCls.divStr+"dl_fixedversion' style='max-width:500px' class='"+n+"'>",s+=this.addNotebookTitle("dl_fixedversion","Use fixed version of iCn3D"),s+='Since January 6, 2021, you can show the original view with the archived version of iCn3D by pasting your URL below and click "Show Originial View". Note the version in the parameter "v" was used to replace "full.html" with "full_[v].html" in the URL.
',s+="Share Link URL: "+e.htmlCls.inputTextStr+"id='"+e.pre+"sharelinkurl' size=60>
",s+=e.htmlCls.buttonStr+"reload_fixedversion'>Show Original View
",s+="",s+=e.htmlCls.divStr+"dl_selection' class='"+n+"'>",s+=this.addNotebookTitle("dl_selection","Load a selection file"),s+="Selection file: "+e.htmlCls.inputFileStr+"id='"+e.pre+"selectionfile'>
",s+=e.htmlCls.buttonStr+"reload_selectionfile' style='margin-top: 6px;'>Load",s+="",s+=e.htmlCls.divStr+"dl_menuloadpref' class='"+n+"'>",s+=this.addNotebookTitle("dl_menuloadpref","Load a preference file"),s+="Preference file: "+e.htmlCls.inputFileStr+"id='"+e.pre+"menupreffile'>
",s+=e.htmlCls.buttonStr+"reload_menupreffile' style='margin-top: 6px;'>Load",s+="",s+=e.htmlCls.divStr+"dl_dsn6' class='"+n+"'>",s+=this.addNotebookTitle("dl_dsn6","Load a DSN6 file"),s+="Note: Always load a PDB file before loading DSN6 files.
",s+="2fofc contour at:
",s+=e.htmlCls.inputFileStr+"id='"+e.pre+"dsn6file2fofc'> "+e.htmlCls.buttonStr+"reload_dsn6file2fofc' style='margin-top: 6px;'>Load
",s+="fofc contour at:
",s+=e.htmlCls.inputFileStr+"id='"+e.pre+"dsn6filefofc'> "+e.htmlCls.buttonStr+"reload_dsn6filefofc' style='margin-top: 6px;'>Load
",s+=e.htmlCls.buttonStr+"elecmapNo4'>Remove Map
",s+="",s+=e.htmlCls.divStr+"dl_dsn6url' class='"+n+"'>",s+=this.addNotebookTitle("dl_dsn6url","Load a selection file via a URL"),s+="Note: Always load a PDB file before loading DSN6 files.
",s+="2fofc contour at:
",s+="URL in the same host: "+e.htmlCls.inputTextStr+"id='"+e.pre+"dsn6fileurl2fofc' size=20>"+e.htmlCls.space3+e.htmlCls.buttonStr+"reload_dsn6fileurl2fofc' style='margin-top: 6px;'>Load
",s+="fofc contour at:
",s+="URL in the same host: "+e.htmlCls.inputTextStr+"id='"+e.pre+"dsn6fileurlfofc' size=20>"+e.htmlCls.space3+e.htmlCls.buttonStr+"reload_dsn6fileurlfofc' style='margin-top: 6px;'>Load
",s+=e.htmlCls.buttonStr+"elecmapNo5'>Remove Map
",s+="",s+=e.htmlCls.divStr+"dl_clr' class='"+n+"'>",s+=this.addNotebookTitle("dl_clr","Pick a color"),s+="Click in the input box to use the color picker:
",s+="Custom Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"colorcustom' value='FF0000' size=8> ",s+=e.htmlCls.buttonStr+"applycustomcolor'>Apply",s+="",s+=e.htmlCls.setHtmlCls.getPotentialHtml("delphi",n),s+=e.htmlCls.setHtmlCls.getPotentialHtml("local",n),s+=e.htmlCls.setHtmlCls.getPotentialHtml("url",n),s+=e.htmlCls.divStr+"dl_symmetry' class='"+n+"'>
",s+=this.addNotebookTitle("dl_symmetry","Symmetry"),s+=e.htmlCls.divNowrapStr+"Symmetry:
",s+=this.addNotebookTitle("dl_symd","Dynamically symmetry calculation using SymD"),s+="",s+=e.htmlCls.divStr+"dl_contact' class='"+n+"'>",s+=this.addNotebookTitle("dl_contact","Contact Map"),s+="Distance:
",s+=""+e.htmlCls.buttonStr+"applycontactmap'>Display
",s+="",s+=e.htmlCls.divStr+"dl_hbonds' class='"+n+"'>",s+=this.addNotebookTitle("dl_hbonds","Interaction Analysis"),s+="1. Choose interaction types and their thresholds:
",s+="",s+=" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_hbond' checked>Hydrogen Bonds "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_saltbridge' checked>Salt Bridge/Ionic "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_contact' checked>Contacts/Interactions "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+="",s+=" "+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_halogen' checked>Halogen Bonds "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_pication' checked>π-Cation "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_pistacking' checked>π-Stacking "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+="
",s+="",s+=e.htmlCls.divNowrapStr+"2. Select the first set:",s+=" ",s+=e.htmlCls.divNowrapStr+"3. Select the second set:",s+="
",s+="
",s+="
",s+="
",r=': "+e.htmlCls.buttonStr+"hbondGraph'>2D Graph(Force-Directed) to show interactions with strength parameters in 0-200:",s+=' ',s+="Helix or Sheet'+r+e.pre+'dist_ss" size="4" value="100"> ',s+="Coil or Nucleotide"+r+e.pre+'dist_coil" size="4" value="50"> ',s+="Disulfide Bonds"+r+e.pre+'dist_ssbond" size="4" value="50"> ',s+="Hydrogen Bonds"+r+e.pre+'dist_hbond" size="4" value="50"> ',s+="Salt Bridge/Ionic"+r+e.pre+'dist_ionic" size="4" value="50"> ',s+="Contacts"+r+e.pre+'dist_inter" size="4" value="25"> Halogen Bonds"+r+e.pre+'dist_halogen" size="4" value="50"> ',s+="π-Cation"+r+e.pre+'dist_pication" size="4" value="50"> ',s+="π-Stacking"+r+e.pre+'dist_pistacking" size="4" value="50">
',s+="
",s+="
or use your current selection:
",s+="
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_realignbystruct' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_realignbystruct","Realign by structure"),s+="
",s+="
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_realigntwostru' class='"+n+"'>",s+=this.addNotebookTitle("dl_realigntwostru","Realign two structure complexes"),s+=e.htmlCls.divNowrapStr+"1. Select sets below or use your current selection:
",s+="
",s+="2. Overall maximum RMSD: "+e.htmlCls.inputTextStr+"id='"+e.pre+"maxrmsd' value='30' size='2'> Å
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_colorspectrumacrosssets' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorspectrumacrosssets","Set color spectrum across sets"),s+=e.htmlCls.divNowrapStr+"1. Select sets below:
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_colorspectrumbysets' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorspectrumbysets","Set color spectrum for residues in sets"),s+=e.htmlCls.divNowrapStr+"1. Select sets below:
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_colorrainbowacrosssets' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorrainbowacrosssets","Set color rainbow across sets"),s+=e.htmlCls.divNowrapStr+"1. Select sets below:
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_colorrainbowbysets' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorrainbowbysets","Set color rainbow for residues in sets"),s+=e.htmlCls.divNowrapStr+"1. Select sets below:
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_allinteraction' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_allinteraction","All interactions",!0),s+="",s+=e.htmlCls.divStr+"dl_interactionsorted' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_interactionsorted","Sorted interactions",!0),s+="",s+=e.htmlCls.divStr+"dl_linegraph' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_linegraph","2D Interaction Network"),s+=e.htmlCls.divNowrapStr+'
",e.linegraphid=e.pre+"linegraph",s+=e.htmlCls.divNowrapStr+l+e.linegraphid+'_svg">SVG'+e.htmlCls.space2,s+=l+e.linegraphid+'_png">PNG'+e.htmlCls.space2,s+=l+e.linegraphid+'_json">JSON'+e.htmlCls.space4,s+="Scale:
",s+='',s+="",s+=e.htmlCls.divStr+"dl_scatterplot' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_scatterplot","2D Interaction Map"),s+=e.htmlCls.divNowrapStr+"Hold Ctrl key to select multiple nodes."+e.htmlCls.space3,s+='
",s+='',s+="",s+=e.htmlCls.divStr+"dl_contactmap' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_contactmap","Contact Map"),s+=e.htmlCls.divNowrapStr+"Hold Ctrl key to select multiple nodes."+e.htmlCls.space3+"",e.contactmapid=e.pre+"contactmap",s+=e.htmlCls.divNowrapStr+l+e.contactmapid+'_svg">SVG'+e.htmlCls.space2,s+=l+e.contactmapid+'_png">PNG'+e.htmlCls.space2,s+=l+e.contactmapid+'_json">JSON'+e.htmlCls.space4,s+="Scale:
",s+='',s+="",s+=e.htmlCls.divStr+"dl_alignerrormap' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_alignerrormap","PAE Map"),s+=e.htmlCls.divNowrapStr+"Hold Ctrl key to select multiple nodes."+e.htmlCls.space3+"",e.alignerrormapid=e.pre+"alignerrormap",s+=e.htmlCls.divNowrapStr+l+e.alignerrormapid+'_svg">SVG'+e.htmlCls.space2,s+=l+e.alignerrormapid+'_png">PNG (slow)'+e.htmlCls.space2,s+=l+e.alignerrormapid+'_json">JSON'+e.htmlCls.space4,s+='Scale:
";s+="0 5 10 15 20 25 30 Expected position error (Angstroms)
",s+='',s+="",s+=e.htmlCls.divStr+"dl_elecmap2fofc' class='"+n+"'>",s+=this.addNotebookTitle("dl_elecmap2fofc","Electron Density 2F0-Fc Map"),s+="Contour at:
"+e.htmlCls.buttonStr+"applyemmap'>Display "+e.htmlCls.buttonStr+"emmapNo2'>Remove EM Map",s+="",s+=e.htmlCls.divStr+"dl_aroundsphere' class='"+n+"'>",s+=this.addNotebookTitle("dl_aroundsphere","Select a sphere around a set of residues"),s+=e.htmlCls.divNowrapStr+"1. Select the first set:",s+="
",s+=e.htmlCls.divNowrapStr+"2. Sphere with a radius: "+e.htmlCls.inputTextStr+"id='"+e.pre+"radius_aroundsphere' value='4' size='2'> Å
",s+=e.htmlCls.divNowrapStr+"3. Select the second set to apply the sphere:",s+="
",s+=e.htmlCls.divNowrapStr+"4. "+e.htmlCls.buttonStr+"applypick_aroundsphere'>Display the sphere around the first set of atoms
",s+="
",s+=e.htmlCls.divNowrapStr+"1. Extracellular membrane Z-axis position: "+e.htmlCls.inputTextStr+"id='"+e.pre+"extra_mem_z' value='' size='3'> Å
",s+=e.htmlCls.divNowrapStr+"2. intracellular membrane Z-axis position: "+e.htmlCls.inputTextStr+"id='"+e.pre+"intra_mem_z' value='' size='3'> Å
",s+=e.htmlCls.divNowrapStr+"3. "+e.htmlCls.buttonStr+"apply_adjustmem'>Display the adjusted membranes
",s+="",s+=e.htmlCls.divStr+"dl_selectplane' class='"+n+"'>",s+=this.addNotebookTitle("dl_selectplane","Select a plane"),s+="Note: The membranes are parallel to the X-Y plane. The center of the membranes is at Z = 0.
",s+=e.htmlCls.divNowrapStr+"1. Z-axis position of the first X-Y plane: "+e.htmlCls.inputTextStr+"id='"+e.pre+"selectplane_z1' value='15' size='3'> Å
",s+=e.htmlCls.divNowrapStr+"2. Z-axis position of the second X-Y plane: "+e.htmlCls.inputTextStr+"id='"+e.pre+"selectplane_z2' value='-15' size='3'> Å
",s+=e.htmlCls.divNowrapStr+"3. "+e.htmlCls.buttonStr+"apply_selectplane'>Save the region between the planes to Defined Sets
",s+="",s+=e.htmlCls.divStr+"dl_addlabel' class='"+n+"'>",s+=this.addNotebookTitle("dl_addlabel","Add labels between two atoms"),s+="1. Text: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labeltext' value='Text' size=4>
",s+="2. Size: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelsize' value='18' size=4 maxlength=2>
",s+="3. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelcolor' value='"+"#ffff00' size=4>
",e.utilsCls.isMobile()?s+=e.htmlCls.spanNowrapStr+"4. Touch TWO atoms
":s+=e.htmlCls.spanNowrapStr+'4. Pick TWO atoms while holding "Alt" key
',s+=e.htmlCls.spanNowrapStr+"5. "+e.htmlCls.buttonStr+"applypick_labels'>Display",s+="",s+=e.htmlCls.divStr+"dl_addlabelselection' class='"+n+"'>",s+=this.addNotebookTitle("dl_addlabelselection","Add labels for your selection"),s+="1. Text: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labeltext2' value='Text' size=4>
",s+="2. Size: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelsize2' value='18' size=4 maxlength=2>
",s+="3. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelcolor2' value='"+"#ffff00' size=4>
",s+=e.htmlCls.spanNowrapStr+"4. "+e.htmlCls.buttonStr+"applyselection_labels'>Display",s+="",s+=e.htmlCls.divStr+"dl_labelColor' class='"+n+"'>",s+=this.addNotebookTitle("dl_labelColor","Change label color"),s+="Color for all labels: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelcolorall' value='"+"#ffff00' size=4>
",s+=e.htmlCls.spanNowrapStr+e.htmlCls.buttonStr+"applylabelcolor'>Display",s+="",s+=e.htmlCls.divStr+"dl_distance' class='"+n+"'>",s+=this.addNotebookTitle("dl_distance","Measure distance"),e.utilsCls.isMobile()?s+=e.htmlCls.spanNowrapStr+"1. Touch TWO atoms
":s+=e.htmlCls.spanNowrapStr+'1. Pick TWO atoms while holding "Alt" key
',s+=e.htmlCls.spanNowrapStr+"2. Line Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"distancecolor' value='"+"#ffff00' size=4>
",s+=e.htmlCls.spanNowrapStr+"3. "+e.htmlCls.buttonStr+"applypick_measuredistance'>Display",s+="",s+=e.htmlCls.divStr+"dl_stabilizer' class='"+n+"'>",s+=this.addNotebookTitle("dl_stabilizer","Add a stabilizer"),e.utilsCls.isMobile()?s+=e.htmlCls.spanNowrapStr+"1. Touch TWO atoms
":s+=e.htmlCls.spanNowrapStr+'1. Pick TWO atoms while holding "Alt" key
',s+=e.htmlCls.spanNowrapStr+"2. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"stabilizercolor' value='ffffff' size=4>
",s+=e.htmlCls.spanNowrapStr+"3. "+e.htmlCls.buttonStr+"applypick_stabilizer'>Add",s+="",s+=e.htmlCls.divStr+"dl_disttwosets' class='"+n+"'>",s+=this.addNotebookTitle("dl_disttwosets","Measure the distance between two sets"),s+=e.htmlCls.spanNowrapStr+"1. Select two sets
",s+="
",s+=e.htmlCls.spanNowrapStr+"2. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"distancecolor2' value='"+"#ffff00' size=4>",s+=e.htmlCls.divNowrapStr+"First set:",s+=" ",s+=e.htmlCls.divNowrapStr+"Second set:",s+="
",s+=e.htmlCls.spanNowrapStr+"3. "+e.htmlCls.buttonStr+"applydist2'>Display",s+="",s+=e.htmlCls.divStr+"dl_linebtwsets' class='"+n+"'>",s+=this.addNotebookTitle("dl_linebtwsets","Add a line between two sets"),s+=e.htmlCls.spanNowrapStr+"1. Select two sets
",s+="
",s+=e.htmlCls.divNowrapStr+"2. Line style: ",s+=e.htmlCls.divNowrapStr+"First set:",s+=" ",s+=e.htmlCls.divNowrapStr+"Second set:",s+="
",s+="3. Line radius: "+e.htmlCls.inputTextStr+"id='"+e.pre+"linebtwsets_radius' value='0.4' size=4>
",s+="4. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"linebtwsets_customcolor' value='"+"#ffff00' size=4>
",s+=e.htmlCls.divNowrapStr+"5. Opacity:
",s+=e.htmlCls.spanNowrapStr+"6. "+e.htmlCls.buttonStr+"applylinebtwsets'>Display",s+=e.htmlCls.space3+e.htmlCls.spanNowrapStr+e.htmlCls.buttonStr+"clearlinebtwsets'>Clear",s+="",s+=e.htmlCls.divStr+"dl_cartoonshape' class='"+n+"'>",s+=this.addNotebookTitle("dl_cartoonshape","Cartoon Shape"),s+=e.htmlCls.spanNowrapStr+"1. Select a set:
",s+="
",s+=e.htmlCls.divNowrapStr+"2. Shape:
",s+="3. Radius: "+e.htmlCls.inputTextStr+"id='"+e.pre+"cartoonshape_radius' value='1.5' size=4>
",s+="4. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"cartoonshape_customcolor' value='"+"#ffff00' size=4>
",s+=e.htmlCls.divNowrapStr+"5. Opacity:
",s+=e.htmlCls.spanNowrapStr+"6. "+e.htmlCls.buttonStr+"applycartoonshape'>Display",s+=e.htmlCls.space3+e.htmlCls.spanNowrapStr+e.htmlCls.buttonStr+"clearcartoonshape'>Clear",s+="",s+=e.htmlCls.divStr+"dl_distmanysets' class='"+n+"'>",s+=this.addNotebookTitle("dl_distmanysets","Measure distances among many sets"),s+=e.htmlCls.spanNowrapStr+"1. Select sets for pairwise distances
",s+="
",s+=e.htmlCls.spanNowrapStr+"2. "+e.htmlCls.buttonStr+"applydisttable'>Distances in Table",s+="",s+=e.htmlCls.divStr+"dl_stabilizer_rm' class='"+n+"'>",s+=this.addNotebookTitle("dl_stabilizer_rm","Remove a stabilizer"),e.utilsCls.isMobile()?s+=e.htmlCls.spanNowrapStr+"1. Touch TWO atoms",s+=e.htmlCls.divNowrapStr+"First sets:",s+=" ",s+=e.htmlCls.divNowrapStr+"Second sets:",s+="
":s+=e.htmlCls.spanNowrapStr+'1. Pick TWO atoms while holding "Alt" key
',s+=e.htmlCls.spanNowrapStr+"2. "+e.htmlCls.buttonStr+"applypick_stabilizer_rm'>Remove",s+="",s+=e.htmlCls.divStr+"dl_thickness' class='"+n+"'>",s+=this.addNotebookTitle("dl_thickness","Set thickness"),s+=e.htmlCls.setHtmlCls.setThicknessHtml("3dprint"),s+="",s+=e.htmlCls.divStr+"dl_thickness2' class='"+n+"'>",s+=this.addNotebookTitle("dl_thickness2","Set thickness"),s+=e.htmlCls.setHtmlCls.setThicknessHtml("style"),s+="",s+=e.htmlCls.divStr+"dl_menupref' class='"+n+"'>",s+=this.addNotebookTitle("dl_menupref","Preferences for menus"),s+="Note: The following parameters will be saved in cache. You just need to set them once.
",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"apply_menupref'>Apply",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"reset_menupref' style='margin-left:30px'>Reset to Simple Menus",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"reset_menupref_all' style='margin-left:30px'>Reset to All Menus",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"savepref' style='margin-left:30px'>Save Preferences
",s+="
",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"apply_menupref2'>Apply",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"reset_menupref2' style='margin-left:30px'>Reset to Simple Menus",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"reset_menupref_all2' style='margin-left:30px'>Reset to All Menus",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"savepref2' style='margin-left:30px'>Save Preferences",s+="",s+=e.htmlCls.divStr+"dl_addtrack' class='"+n+"'>",s+=this.addNotebookTitle("dl_addtrack","Add a track"),s+=" ",s+=e.htmlCls.divStr+"dl_addtrack_tabs' style='border:0px;'>",s+="",s+="
",s+=e.htmlCls.divStr+"tracktab1'>",s+="NCBI gi/Accession: "+e.htmlCls.inputTextStr+"id='"+e.pre+"track_gi' placeholder='gi' size=16>
",s+=e.htmlCls.buttonStr+"addtrack_button1'>Add Track",s+="",s+=e.htmlCls.divStr+"tracktab2'>",s+="FASTA Title: "+e.htmlCls.inputTextStr+"id='"+e.pre+"fasta_title' placeholder='track title' size=16>
",s+="FASTA sequence:
",s+=e.htmlCls.buttonStr+"addtrack_button2'>Add Track",s+="",s+=e.htmlCls.divStr+"tracktab2b'>",s+="
",s+="Precalculated Multiple Sequence Alignment (MSA):
",s+="
",s+="Position of the first residue in Sequences & Annotations window: "+e.htmlCls.inputTextStr+"id='"+e.pre+"fasta_startpos' value='1' size=2>
",s+="Color Sequence by:
",s+=e.htmlCls.buttonStr+"addtrack_button2b'>Add Track(s)",s+="",s+=e.htmlCls.divStr+"tracktab2c'>",s+="
",s+="NCBI Gene ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"track_geneid' size=20>"+e.htmlCls.space3+e.htmlCls.buttonStr+"exons_table'>Exons & Introns in Gene Table
",s+="Position of the first residue in Sequences & Annotations window: "+e.htmlCls.inputTextStr+"id='"+e.pre+"fasta_startpos2' value='1' size=2>
",s+=e.htmlCls.buttonStr+"addtrack_button2c'>Show Isoforms & Exons",s+="",s+=e.htmlCls.divStr+"tracktab3'>",s+="BED file: "+e.htmlCls.inputFileStr+"id='"+e.pre+"track_bed' size=16>
",s+=e.htmlCls.buttonStr+"addtrack_button3'>Add Track",s+="",s+=e.htmlCls.divStr+"tracktab4'>",s+="Track Title: "+e.htmlCls.inputTextStr+"id='"+e.pre+"track_title' placeholder='track title' size=16>
",s+='Track Text (e.g., "2 G, 5-6 RR" defines a character "G" at the position 2 and two continuous characters "RR" at positions from 5 to 6. The starting position is 1):
',s+="
",s+=e.htmlCls.buttonStr+"addtrack_button4'>Add Track",s+="",s+=e.htmlCls.divStr+"tracktab5'>",s+="Track Title: "+e.htmlCls.inputTextStr+"id='"+e.pre+"track_selection' placeholder='track title' size=16>
",s+=e.htmlCls.buttonStr+"addtrack_button5'>Add Track",s+="",s+="",s+="",s+=e.htmlCls.divStr+"dl_saveselection' class='"+n+"'>",s+=this.addNotebookTitle("dl_saveselection","Save Selection");let m=t&&t.defNames2Atoms?Object.keys(t.defNames2Atoms).length:1;s+="Name: "+e.htmlCls.inputTextStr+"id='"+e.pre+"seq_command_name' value='seq_"+m+"' size='5'>
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_copyurl' style='width:520px;' class='"+n+"'>",s+=this.addNotebookTitle("dl_copyurl","Share Link"),s+="
",s+="1. URLs Used in Browsers
",s+='Please copy one of the URLs below. They show the same result.
(To add a title to share link, click "Windows > Your Note" and click "File > Share Link" again.)
',s+="Original URL with commands:
",e.cfg.notebook||(s+="Lifelong Short URL:(To replace this URL, send a pull request to update share.html at iCn3D GitHub)
"+e.htmlCls.inputTextStr+"id='"+e.pre+"short_url' value='' style='width:100%'>
",s+='Lifelong Short URL + Window Title:(To update the window title, click "Analysis > Your Note/Window Title".)
'+e.htmlCls.inputTextStr+"id='"+e.pre+"short_url_title' value='' style='width:100%'>
"),s+="2. Commands Used in Jupyter Noteboook
",s+="Please copy the following commands into a cell in Jupyter Notebook to show the same result.
More details are at https://github.com/ncbi/icn3d/tree/master/jupyternotebook.
",s+='
',s+=l+e.pre+'jn_copy">Copy Commands
',s+="",s+=e.htmlCls.divStr+"dl_selectannotations' class='"+n+" icn3d-annotation' style='background-color:white;'>",s+=this.addNotebookTitle("dl_selectannotations","Sequences & Annotations"),s+=e.htmlCls.divStr+"dl_annotations_tabs'>",s+=e.htmlCls.divStr+"dl_anno_view_tabs' style='border:0px; height:33px;'>",s+="",s+=e.htmlCls.divStr+"anno_tmp1'>",s+="",s+=e.htmlCls.divStr+"anno_tmp2'>",s+="",s+="",s+=this.getAnnoHeader(),s+="
",s+=e.htmlCls.divStr+"seqguide_wrapper' style='display:none'>
"+e.htmlCls.setHtmlCls.setSequenceGuide("2")+"",s+="
",s+=e.htmlCls.divStr+"dl_annotations'>",s+="",s+="",s+=e.htmlCls.divStr+"dl_graph' style='background-color:white;' class='"+n+"'>",s+=this.addNotebookTitle("dl_graph","Interactions"),e.svgid=e.pre+"icn3d_viz",s+="",s+=e.htmlCls.divNowrapStr+"Zoom: mouse wheel; "+e.htmlCls.space3+" Move: left button; "+e.htmlCls.space3+" Select Multiple Nodes: Ctrl Key and drag an Area"+e.htmlCls.space3,s+='
",s+='(0-20% out is considered "in". 50-100% out is considered "out".)
',s+="Toal: "+e.htmlCls.inputTextStr+"id='"+e.pre+"areavalue' value='' size='10'> Å2
",s+="",s+="",s+=e.htmlCls.divStr+"dl_colorbyarea' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorbyarea","Color by surface area"),s+="
",s+="Middle Percentage(White): "+e.htmlCls.inputTextStr+"id='"+e.pre+"midpercent' value='35' size='10'>%
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_rmsd' class='"+n+"' style='max-width:300px'>",s+=this.addNotebookTitle("dl_rmsd","RMSD",!0),s+="",s+=e.htmlCls.divStr+"dl_buriedarea' class='"+n+"'>",s+=this.addNotebookTitle("dl_buriedarea","Buried surface area",!0),s+="",s+=e.htmlCls.divStr+"dl_propbypercentout' class='"+n+"'>",s+=this.addNotebookTitle("dl_propbypercentout","Select residues basen on solvent accessilbe surface area"),s+="
",s+="Min Percentage: "+e.htmlCls.inputTextStr+"id='"+e.pre+"minpercentout' value='0' size='10'>%
",s+="Max Percentage: "+e.htmlCls.inputTextStr+"id='"+e.pre+"maxpercentout' value='100' size='10'>%
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_propbybfactor' class='"+n+"'>",s+=this.addNotebookTitle("dl_propbybfactor","Select residues basen on B-factor/pLDDT"),s+="
",s+="Min B-factor/pLDDT: "+e.htmlCls.inputTextStr+"id='"+e.pre+"minbfactor' value='0' size='10'>%
",s+="Max B-factor/pLDDT: "+e.htmlCls.inputTextStr+"id='"+e.pre+"maxbfactor' value='100' size='10'>%
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_legend' class='"+n+"' style='max-width:500px; background-color:white'>",s+=this.addNotebookTitle("dl_legend","Legend",!0),s+="",s+=e.htmlCls.divStr+"dl_disttable' class='"+n+"'>",s+=this.addNotebookTitle("dl_disttable","Distance Table",!0),s+="",s+=e.htmlCls.divStr+"dl_igrefTpl' class='"+n+"'>",s+=this.addNotebookTitle("dl_igrefTpl","Choose an Ig template"),s+="Choose an Ig template for selected residues:
"+e.htmlCls.buttonStr+"mn6_igrefTpl_apply'>Show Ig Ref. Number",s+="",s+="",s+="\x3c!--/form--\x3e",s}getAnnoHeader(){let e=this.icn3dui;e.icn3d;let t="";t+="
",t+="";let s=" ",i=" ";return t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_all'>All"+e.htmlCls.space2+" ",t+=i+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_cdd' checked>Conserved Domains"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_clinvar'>ClinVar"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_binding'>Functional Sites"+e.htmlCls.space2+"",t+="",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_custom'>Custom"+e.htmlCls.space2+"",t+=i+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_3dd'>3D Domains"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_snp'>SNPs"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_ptm'>PTM (UniProt)"+e.htmlCls.space2+"",t+=" ",t+=" ",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_ssbond'>Disulfide Bonds"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_interact'>Interactions"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_crosslink'>Cross-Linkages"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_transmem'>Transmembrane"+e.htmlCls.space2+"",t+=" ",t+=" ";for(let e=0,i=o.alnChainsAnno[l][t].length;e ':' ';else if("E"==i)if(void 0!==o.alnChainsSeq[s][e]){let i=s+"_"+o.alnChainsSeq[s][e].resi;if(o.residues.hasOwnProperty(i)){o.firstAtomObjCls.getFirstCalphaAtomObj(o.residues[i]).ssend?b[t]+=' ':b[t]+=' '}else b[t]+=' '}else b[t]+=' ';else b[t]+="c"==i?' ':"o"==i?' ':"";else b[t]+=""+i+""}b[t]+=""}let O=l,R=void 0!==o.pdbid_chain2title?o.pdbid_chain2title[u]:"";for(let e=k-1;e>=0;--e){let t=o.alnChainsAnTtl[l][e][0];"SS"==t&&(t=""),a+="
",g>0&&(f+=y),++g}return{sequencesHtml:a,maxSeqCnt:d}}}class u{constructor(e){this.icn3dui=e}getLink(e,t,s,i){let n=this.icn3dui;return n.icn3d,n.htmlCls.allMenus[e]=t,i&&(n.htmlCls.allMenusSel[e]=i),s&&(n.htmlCls.simpleMenus[e]=1),"
",n+="",n}getOptionHtml(e,t){let s=this.icn3dui;s.icn3d;let i="";for(let n=0,l=e.length;n ",n+=" ",n+="",n+="
",n+="Select: "+t.htmlCls.inputTextStr+"id='"+t.pre+"command"+s+"' placeholder='$[structures].[chains]:[residues]@[atoms]' size='60'> ",n+="Name: "+t.htmlCls.inputTextStr+"id='"+t.pre+"command_name"+s+"' placeholder='my_selection' size='60'> ",n+=""+t.htmlCls.space3+t.htmlCls.buttonStr+"command_apply"+s+"'>Save Selection to Defined Sets ",n+='Specification Tips:
',n+=t.htmlCls.divStr+"specguide"+s+"' style='display:none; width:500px' class='icn3d-box'>",n+='Specification: In the selection "$1HHO,4N7N.A,B,C:5-10,LV,3AlaVal,chemicals@CA,C,C*":',n+='
",n+="Set Operation:",n+='
',n+='
',n+='
',n+='
',n+='
',n+='
',n+='
',n+="Full commands in url or command window:",n+="
',n+='
",n+="",n+="
",n+="
",i+="1. Shininess: "+t.htmlCls.inputTextStr+"id='"+t.pre+"shininess' value='"+m+"' size=4>"+t.htmlCls.space3+"(for the shininess of the 3D objects, default 40)
",i+="2. Three directional lights:
",i+="Key Light: "+t.htmlCls.inputTextStr+"id='"+t.pre+"light1' value='"+u+"' size=4>"+t.htmlCls.space3+"(for the light strength of the key light, default 0.8)
",i+="Fill Light: "+t.htmlCls.inputTextStr+"id='"+t.pre+"light2' value='"+g+"' size=4>"+t.htmlCls.space3+"(for the light strength of the fill light, default 0.4)
",i+="Back Light: "+t.htmlCls.inputTextStr+"id='"+t.pre+"light3' value='"+f+"' size=4>"+t.htmlCls.space3+"(for the light strength of the back light, default 0.2)
",i+="3. Thickness:
"}return i+="Line Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"linerad_"+e+"' value='"+n+"' size=4>"+t.htmlCls.space3+"(for stabilizers, hydrogen bonds, distance lines, default 0.1)
",i+="Coil Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"coilrad_"+e+"' value='"+l+"' size=4>"+t.htmlCls.space3+"(for coils, default 0.3)
",i+="Stick Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"stickrad_"+e+"' value='"+r+"' size=4>"+t.htmlCls.space3+"(for sticks, default 0.4)
",i+="Cross-Linkage Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"crosslinkrad_"+e+"' value='"+o+"' size=4>"+t.htmlCls.space3+"(for cross-linkages, default 0.4)
",i+="Trace Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"tracerad_"+e+"' value='"+a+"' size=4>"+t.htmlCls.space3+"(for C alpha trace, O3' trace, default 0.4)
",i+="Ribbon Thickness: "+t.htmlCls.inputTextStr+"id='"+t.pre+"ribbonthick_"+e+"' value='"+c+"' size=4>"+t.htmlCls.space3+"(for helix and sheet ribbons, nucleotide ribbons, default 0.2)
",i+="Protein Ribbon Width: "+t.htmlCls.inputTextStr+"id='"+t.pre+"prtribbonwidth_"+e+"' value='"+h+"' size=4>"+t.htmlCls.space3+"(for helix and sheet ribbons, default 1.3)
",i+="Nucleotide Ribbon Width: "+t.htmlCls.inputTextStr+"id='"+t.pre+"nucleotideribbonwidth_"+e+"' value='"+p+"' size=4>"+t.htmlCls.space3+"(for nucleotide ribbons, default 0.8)
",i+="Ball Scale: "+t.htmlCls.inputTextStr+"id='"+t.pre+"ballscale_"+e+"' value='"+d+"' size=4>"+t.htmlCls.space3+"(for styles 'Ball and Stick' and 'Dot', default 0.3)
","style"==e&&(i+="
4. Show Glycan Cartoon: "+t.htmlCls.inputTextStr+"id='"+t.pre+"glycan' value='"+b+"' size=4>"+t.htmlCls.space3+"(0: hide, 1: show, default 0)
",i+="
5. Show Membrane: "+t.htmlCls.inputTextStr+"id='"+t.pre+"membrane' value='"+C+"' size=4>"+t.htmlCls.space3+"(0: hide, 1: show, default 1)
",i+="
6. Enlarge Command Window: "+t.htmlCls.inputTextStr+"id='"+t.pre+"cmdwindow' value='"+y+"' size=4>"+t.htmlCls.space3+"(0: Regular, 1: Large, default 0)
"),i+=t.htmlCls.spanNowrapStr+""+t.htmlCls.buttonStr+"apply_thickness_"+e+"'>Apply ",i+=t.htmlCls.spanNowrapStr+""+t.htmlCls.buttonStr+"reset_thickness_"+e+"'>Reset",i}getCookie(e){let t=e+"=",s=decodeURIComponent(document.cookie).split(";");for(let e=0;e
",n+=s.htmlCls.divStr+"seqguide"+e+"' style='display:none; white-space:normal;' class='icn3d-box'>"),n+=this.getSelectionHints();return n+="Residue labeling: standard residue with coordinates: UPPER case letter; nonstandard residue with coordinates: the first UPPER case letter plus a period except that water residue uses the letter 'O'; residue missing coordinates: lower case letter."+(s.utilsCls.isMac()&&!s.utilsCls.isMobile()?"
Turn on scroll bar: System preferences -> General -> show scroll bars -> check Always":"")+"
",n}setAlignSequenceGuide(e,t){let s=this.icn3dui,i=s.icn3d,n="";let l=i&&i.defNames2Atoms?Object.keys(i.defNames2Atoms).length:1;n+='
",n+=s.htmlCls.divStr+"alignseqguide' style='display:none; white-space:normal;' class='icn3d-box'>",n+=this.getSelectionHints();return n+="Residue labeling: aligned residue with coordinates: UPPER case letter; non-aligned residue with coordinates: lower case letter which can be highlighted; residue missing coordinates: lower case letter which can NOT be highlighted."+(s.utilsCls.isMac()&&!s.utilsCls.isMobile()?"
Turn on scroll bar: System preferences -> General -> show scroll bars -> check Always":"")+"
",n}getSelectionHints(){let e=this.icn3dui;e.icn3d;let t="";if(e.utilsCls.isMobile())t+='Select Aligned Sequences: touch to select, touch again to deselect, multiple selection is allowed without Ctrl key, click "Save Selection" to save the current selection.
';else{t+='Select on 1D sequences: drag to select, drag again to deselect, multiple selection is allowed without Ctrl key, click "Save Selection" to save the current selection.
',t+="Select on 2D interaction diagram: click on the nodes or lines. The nodes are chains and can be united with the Ctrl key. The lines are interactions and can NOT be united. Each click on the lines selects half of the lines, i.e., select the interacting residues in one of the two chains.
",t+="Select on 3D structures: "+(e.utilsCls.isMobile()?"use finger to pick":'hold "Alt" and use mouse to pick')+', click the second time to deselect, hold "Ctrl" to union selection, hold "Shift" to select a range, press the up/down arrow to switch among atom/residue/strand/chain/structure, click "Save Selection" to save the current selection.
',t+='Save the current selection(either on 3D structure, 2D interactions, or 1D sequence): open the menu "Select -> Save Selection", specify the name and description for the selection, and click "Save".
'}return t}addGsizeSalt(e){let t=this.icn3dui;t.icn3d;let s="";s+="Grid Size:
",s}getFootHtml(e,t){let s=this.icn3dui;s.icn3d;let i="
":(i+="Note: Only the selected residues are used for DelPhi potential calculation by solving linear Poisson-Boltzmann equation.",i+='
',i+=s.htmlCls.divStr+t+"' style='display:none;'>",i+="
The hydrogens and partial charges of proteins and nucleotides are added using DelPhiPKa with the Amber charge and size files. The hydrogens of ligands are added using Open Babel. The partial charges of ligands are calculated using Antechamber with the Gasteiger charge method. All partial charges are calculated at pH 7.
",i+='Lipids are treated as ligands. Please use "HETATM" instead of "ATOM " for each lipid atom in your PDB file. Each phosphate in lipids is assigned with a charge of -1. You can download PQR and modify it, or prepare your PQR file using other tools. Then load the PQR file at the menu "Analysis > Load PQR/Potential".
',i+="
',i+=s.htmlCls.divStr+t+"' style='display:none;'>",i+='The PDB file can be loaded in the URL with "pdbid=" or at "File > Open File". The PQR file can be prepared at the menu "Analysis > Download PQR" with your modification or using other tools. The DelPhi potential file can be calculated at DelPhi Web Server and be exported as a Cube file. ',"url"==e&&(i+="The PQR or potential file can be accessed in a URL if it is located in the same host as iCn3D."),i+="
",i+=""),i+="",i}getPotentialHtml(e,t){let s=this.icn3dui;s.icn3d;let i,n,l,r,o,a="";r="Equipotential Map",o="Surface with Potential","delphi"==e?n="delphi":"local"==e?(i="pqr",n="phi",l="cube"):"url"==e&&(i="pqrurl",n="phiurl",l="cubeurl"),a+=s.htmlCls.divStr+"dl_"+n+"' class='"+t+"'>",a+=s.htmlCls.setDialogCls.addNotebookTitle("dl_"+n,"DelPhi Potential"),a+=s.htmlCls.divStr+"dl_"+n+"_tabs' style='border:0px;'>",a+="",a+="
",a+=s.htmlCls.divStr+n+"tab1'>","delphi"==e&&(a+=this.addGsizeSalt(n+"1")+"
"),a+="Potential contour at:
","delphi"==e?(a+=s.htmlCls.buttonStr+"reload_"+n+"file' style='margin-top: 6px;'>Equipotential Map",a+=s.htmlCls.buttonStr+n+"mapNo' style='margin-left:30px;'>Remove Map
"):"local"==e?(a+=s.htmlCls.divStr+n+"tab1_tabs' style='border:0px;'>",a+="",d=""+s.htmlCls.buttonStr+n+"mapNo'>Remove Map",a+=s.htmlCls.divStr+n+"tab1_"+i+"'>",a+=this.addGsizeSalt(i)+"
",a+="PQR File: "+s.htmlCls.inputFileStr+"id='"+s.pre+i+"file'>
"+s.htmlCls.buttonStr+"reload_"+i+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=s.htmlCls.divStr+n+"tab1_"+n+"'>",a+="Phi File: "+s.htmlCls.inputFileStr+"id='"+s.pre+n+"file'>
"+s.htmlCls.buttonStr+"reload_"+n+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=s.htmlCls.divStr+n+"tab1_"+l+"'>",a+="Cube File: "+s.htmlCls.inputFileStr+"id='"+s.pre+l+"file'>
"+s.htmlCls.buttonStr+"reload_"+l+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=""):"url"==e&&(a+=s.htmlCls.divStr+n+"tab1_tabs' style='border:0px;'>",a+="",d=""+s.htmlCls.buttonStr+n+"mapNo'>Remove Map",a+=s.htmlCls.divStr+n+"tab1_"+i+"2'>",a+=this.addGsizeSalt(i)+"
",a+="PQR URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+i+"file'>
"+s.htmlCls.buttonStr+"reload_"+i+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=s.htmlCls.divStr+n+"tab1_"+n+"2'>",a+="Phi URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+n+"file'>
"+s.htmlCls.buttonStr+"reload_"+n+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=s.htmlCls.divStr+n+"tab1_"+l+"2'>",a+="Cube URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+l+"file'>
"+s.htmlCls.buttonStr+"reload_"+l+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=""),a+="
"+this.getFootHtml(e,n+"tab1_foot"),a+="",a+=s.htmlCls.divStr+n+"tab2'>","delphi"==e&&(a+=this.addGsizeSalt(n+"2")+"
"),a+="Surface with max potential at:
",a+="Surface:
",a+="
","delphi"==e?(a+=s.htmlCls.buttonStr+"reload_"+n+"file2' style='margin-top: 6px;'>Surface with Potential",a+=s.htmlCls.buttonStr+n+"mapNo2' style='margin-left:30px;'>Remove Surface
"):"local"==e?(a+=s.htmlCls.divStr+n+"tab2_tabs' style='border:0px;'>",a+="",d=""+s.htmlCls.buttonStr+n+"mapNo2'>Remove Surface",a+=s.htmlCls.divStr+n+"tab2_"+i+"'>",a+=this.addGsizeSalt(i+"2")+"
",a+="PQR File: "+s.htmlCls.inputFileStr+"id='"+s.pre+i+"file2'>
"+s.htmlCls.buttonStr+"reload_"+i+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=s.htmlCls.divStr+n+"tab2_"+n+"'>",a+="Phi File: "+s.htmlCls.inputFileStr+"id='"+s.pre+n+"file2'>
"+s.htmlCls.buttonStr+"reload_"+n+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=s.htmlCls.divStr+n+"tab2_"+l+"'>",a+="Cube File: "+s.htmlCls.inputFileStr+"id='"+s.pre+l+"file2'>
"+s.htmlCls.buttonStr+"reload_"+l+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=""):"url"==e&&(a+=s.htmlCls.divStr+n+"tab2_tabs' style='border:0px;'>",a+="",d=""+s.htmlCls.buttonStr+n+"mapNo2'>Remove Surface",a+=s.htmlCls.divStr+n+"tab2_"+i+"2'>",a+=this.addGsizeSalt(i+"2")+"
",a+="PQR URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+i+"file2'>
"+s.htmlCls.buttonStr+"reload_"+i+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=s.htmlCls.divStr+n+"tab2_"+n+"2'>",a+="Phi URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+n+"file2'>
"+s.htmlCls.buttonStr+"reload_"+n+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=s.htmlCls.divStr+n+"tab2_"+l+"2'>",a+="Cube URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+l+"file2'>
"+s.htmlCls.buttonStr+"reload_"+l+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=""),a+="
"+this.getFootHtml(e,n+"tab2_foot"),a+="",a+="",a+="",a}async exportPqr(e){let t=this.icn3dui,s=t.icn3d,i={},n={},l=t.hashUtilsCls.intHash(s.dAtoms,s.hAtoms);for(let e in l)s.atoms[e],s.ions.hasOwnProperty(e)?i[e]=1:n[e]=1;let r=e?"pdb":"pqr";if(t.cfg.cid){let l="",o=!e;l+=s.saveFileCls.getAtomPDB(n,o)+s.saveFileCls.getAtomPDB(i,o);let a=Object.keys(t.utilsCls.getHlStructures()).join(",");s.saveFileCls.saveFile(a+"_icn3d."+r,"text",[l])}else{if(t.utilsCls.isCalphaPhosOnly(t.hashUtilsCls.hash2Atoms(n,s.atoms)))return void alert("The potential will not be shown because the side chains are missing in the structure...");let l="",o=!0;l+=s.saveFileCls.getAtomPDB(n,void 0,void 0,void 0,void 0,void 0,o),l+=s.saveFileCls.getAtomPDB(i,!0,void 0,!0);let a=t.htmlCls.baseUrl+"delphi/delphi.cgi",d={pdb2pqr:l,pdbid:t.cfg.cid?t.cfg.cid:Object.keys(s.structures).toString()},c=await t.getAjaxPostPromise(a,d,!0,void 0,void 0,!0,"text");if(e){let e=c.split("\n"),s="";for(let i=0,n=e.length;i",t).replace("#include {const t=new Map;for(const[e,s]of n.associations)(e instanceof Material||e instanceof Texture)&&t.set(e,s);return e.traverse((e=>{const s=n.associations.get(e);null!=s&&t.set(e,s)})),t})(l),l}))}}function me(e,t,s,i){const n=s.nodes[e];return i.getDependency("node",e).then((function(e){if(void 0===n.skin)return e;let t;return i.getDependency("skin",n.skin).then((function(e){t=e;const s=[];for(let e=0,n=t.joints.length;e1)if(void 0!==d){let i,n,l=[];for(let r=0,o=p.length;rStructure ":"",a=Object.keys(i).length>1?"Chain ":"";n+=""+o+a+" ";for(let e in l.resid2area){let d=e.lastIndexOf("_"),c=e.substr(d+1),h=r.utilsCls.getIdArray(e.substr(0,d));o=Object.keys(s).length>1?"Residue Number SASA (Å2) Percent Out In/Out "+h[0]+" ":"",a=Object.keys(i).length>1?""+h[1]+" ":"";let p="",m="";l.resid2area[e]=(l.resid2area[e]/t).toFixed(2),r.parasCls.residueArea.hasOwnProperty(c)&&(m=parseInt(l.resid2area[e]/r.parasCls.residueArea[c]*100),m>100&&(m=100),m>=50&&(p="out"),m<20&&(p="in")),n+=''+o+a+" "}return n+=""+c+' '+h[2]+' '+l.resid2area[e]+' '+m+"% "+p+" 0?-parseInt(C.z):parseInt(C.z),y.onBeforeRender=function(e,t,s,i,n,o){let a,d=new THREE.Vector3(0,0,0),c=i.getAttribute("position").array;for(let e=0,t=c.length;e0&&t.applySymdCls.applySymd(),void 0!==t.prevOtherMesh)for(let e=0,s=t.prevOtherMesh.length;e0&&(e=s.hashUtilsCls.hash2Atoms(t.chemicals,t.atoms));let i=4;if(void 0!==e){let n=t.contactCls.getAtomsWithinAtom(t.atoms,e,i),l=3.5;t.opts.hbonds="yes",Object.keys(n).length>0&&t.hBondCls.calculateChemicalHbonds(e,n,parseFloat(l)),t.bSetFog||t.transformCls.zoominSelection(s.hashUtilsCls.unionHash(e,n))}}else"hide"===e.chemicalbinding&&(t.hBondCls.hideHbonds(),t.showInterCls.hideExtraBonds(),t.bSetFog||t.transformCls.zoominSelection(t.atoms))}updateStabilizer(){let e=this.icn3d;if(e.icn3dui,e.stabilizerpnts=[],void 0!==e.pairArray)for(let t=0,s=e.pairArray.length;t=0;i--){let r=t.ssbondpnts[e][2*i],o=t.ssbondpnts[e][2*i+1],a={};a.color=n,a.dashed=!1;let d=[],c=[],h=[],p=[],m=!1,u=!1;for(let e in t.residues[r])"SG"===t.atoms[e].name&&(h.push(t.atoms[e].coord),d.push(t.atoms[e].serial),m=!0);if(!m)for(let e in t.residues[r])if("CA"===t.atoms[e].name){h.push(t.atoms[e].coord),d.push(t.atoms[e].serial),m=!0,u=!0;break}m=!1;for(let e in t.residues[o])"SG"===t.atoms[e].name&&(p.push(t.atoms[e].coord),c.push(t.atoms[e].serial),m=!0);if(!m)for(let e in t.residues[o])if("CA"===t.atoms[e].name){p.push(t.atoms[e].coord),c.push(t.atoms[e].serial),m=!0,u=!0;break}let g=u?7:3,f=!1;for(let e=0,t=h.length;e0&&(e.mdl.remove(e.prevMaps[e.prevMaps.length-1]),e.prevMaps.slice(e.prevMaps.length-1,1))}removeLastEmmap(){let e=this.icn3d;e.icn3dui,e.prevEmmaps.length>0&&(e.mdl.remove(e.prevEmmaps[e.prevEmmaps.length-1]),e.prevEmmaps.slice(e.prevEmmaps.length-1,1))}removeLastPhimap(){let e=this.icn3d;e.icn3dui,e.prevPhimaps.length>0&&(e.mdl.remove(e.prevPhimaps[e.prevPhimaps.length-1]),e.prevPhimaps.slice(e.prevPhimaps.length-1,1))}}class ot{constructor(e){this.icn3d=e}addResidueLabels(e,t,s,i,n){let l=this.icn3d,r=l.icn3dui;if(r.bNode)return;let o=r.hashUtilsCls.intHash(l.hAtoms,e);t?void 0===l.labels.schematic&&(l.labels.schematic=[]):void 0===l.labels.residue&&(l.labels.residue=[]);let a="";for(let e in o){let s=l.atoms[e],o={},d=s.structure+"_"+s.chain+"_"+s.resi;if(!s.het&&("CA"===s.name||"O3'"===s.name||"O3*"===s.name)||l.water.hasOwnProperty(s.serial)||l.ions.hasOwnProperty(s.serial)||l.chemicals.hasOwnProperty(s.serial)&&d!==a){if(o.position=s.coord,o.bSchematic=0,t&&(o.bSchematic=1),o.text=r.utilsCls.residueName2Abbr(s.resn),i)o.text+=s.resi;else if(n){let e=s.structure+"_"+s.chain+"_"+s.resi,t="";l.resid2refnum[e]&&(t=" "==l.resid2refnum[e].substr(0,1)?"":l.resid2refnum[e]),o.text=t}o.size=18,o.factor=.3;let e=s.color.getHexString().toUpperCase();o.color=i?"black"!=l.opts.background?l.colorWhitebkgd:l.colorBlackbkgd:n?"#00FFFF":"CCCCCC"===e||"C8C8C8"===e?"#888888":"#"+e,o.background="#FFFFFF",t?l.labels.schematic.push(o):l.labels.residue.push(o)}a=d}l.hlObjectsCls.removeHlObjects()}addNonCarbonAtomLabels(e){let t=this.icn3d,s=t.icn3dui;if(s.bNode)return;let i=s.hashUtilsCls.intHash(t.hAtoms,e);void 0===t.labels.schematic&&(t.labels.schematic=[]);for(let e in i){let s=t.atoms[e];if(!t.residues.hasOwnProperty(s.structure+"_"+s.chain+"_"+s.resi))continue;if("C"===s.elem)continue;let i={};i.position=s.coord,i.bSchematic=1,i.text=s.elem,i.size=18,i.color="black"!=t.opts.background?t.colorWhitebkgd:s.color.getHexString(),i.background="#FFFFFF",t.labels.schematic.push(i)}t.hlObjectsCls.removeHlObjects()}addAtomLabels(e,t){let s=this.icn3d,i=s.icn3dui;if(i.bNode)return;let n=i.hashUtilsCls.intHash(s.hAtoms,e);n=i.hashUtilsCls.intHash(s.dAtoms,n),void 0===s.labels.residue&&(s.labels.residue=[]);for(let e in n){let i=s.atoms[e],n={};n.position=i.coord,n.bSchematic=0,n.text=t?i.elem:i.name.padEnd(2," "),n.size=18,t&&(n.bSchematic=!0);let l=i.color.getHexString().toUpperCase();n.color="black"!=s.opts.background?s.colorWhitebkgd:s.colorBlackbkgd,t&&(n.color="CCCCCC"===l||"C8C8C8"===l?"#888888":"#"+l),n.background="#FFFFFF",s.labels.residue.push(n)}s.hlObjectsCls.removeHlObjects()}}class at{constructor(e){this.icn3d=e}onBeforeRender(e,t,s,i,n,l){let r=n.uniforms,o=[];if(r.objectId&&(r.objectId.value=SupportsReadPixelsFloat?this.id:this.id/255,o.push("objectId")),(r.modelViewMatrixInverse||r.modelViewMatrixInverseTranspose||r.modelViewProjectionMatrix||r.modelViewProjectionMatrixInverse)&&this.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,this.matrixWorld),r.modelViewMatrixInverse&&(r.modelViewMatrixInverse.value.copy(this.modelViewMatrix).invert(),o.push("modelViewMatrixInverse")),r.modelViewMatrixInverseTranspose&&(r.modelViewMatrixInverse?r.modelViewMatrixInverseTranspose.value.copy(r.modelViewMatrixInverse.value).transpose():r.modelViewMatrixInverseTranspose.value.copy(this.modelViewMatrix).invert().transpose(),o.push("modelViewMatrixInverseTranspose")),r.modelViewProjectionMatrix&&(s.updateProjectionMatrix(),r.modelViewProjectionMatrix.value.multiplyMatrices(s.projectionMatrix,this.modelViewMatrix),o.push("modelViewProjectionMatrix")),r.modelViewProjectionMatrixInverse){let e=new THREE.Matrix4;r.modelViewProjectionMatrix?(e.copy(r.modelViewProjectionMatrix.value),r.modelViewProjectionMatrixInverse.value.copy(e).invert()):(s.updateProjectionMatrix(),e.multiplyMatrices(s.projectionMatrix,this.modelViewMatrix),r.modelViewProjectionMatrixInverse.value.copy(e).invert()),o.push("modelViewProjectionMatrixInverse")}if(r.projectionMatrix&&(s.updateProjectionMatrix(),r.projectionMatrix.value.copy(s.projectionMatrix),o.push("projectionMatrix")),r.projectionMatrixInverse&&(s.updateProjectionMatrix(),r.projectionMatrixInverse.value.copy(s.projectionMatrix).invert(),o.push("projectionMatrixInverse")),o.length){let t=e.properties.get(n);if(t.program){let s=e.getContext(),i=t.program;s.useProgram(i.program);let n=i.getUniforms();o.forEach((function(e){n.setValue(s,e,r[e].value)}))}}}setParametersForShader(e){let t,s=this.icn3d,i=s.icn3dui.parasCls.backgroundColors[s.opts.background.toLowerCase()],n=2.5*s.maxD,l=4*s.maxD,r=void 0!==s.biomtMatrices&&s.biomtMatrices.length*s.cnt>s.maxatomcnt;"yes"===s.opts.slab?r?t=.1:void 0!==s.camMaxDFactorFog?(t=s.maxD*s.camMaxDFactorFog-10,n=2.5*s.maxD-t<0?0:2.5*s.maxD-t,l=4*s.maxD-t):t=s.maxD*s.camMaxDFactor:t=.1;let o=void 0!==e?e:1,a=s.shininess/100*.5;s.uniforms=THREE.UniformsUtils.merge([THREE.UniformsLib.common,{modelViewMatrix:{value:new THREE.Matrix4},modelViewMatrixInverse:{value:new THREE.Matrix4},modelViewMatrixInverseTranspose:{value:new THREE.Matrix4},modelViewProjectionMatrix:{value:new THREE.Matrix4},modelViewProjectionMatrixInverse:{value:new THREE.Matrix4},projectionMatrix:{value:new THREE.Matrix4},projectionMatrixInverse:{value:new THREE.Matrix4},diffuse:{type:"v3",value:[1,1,1]},emissive:{type:"v3",value:[.06,.06,.06]},roughness:{type:"f",value:.5},metalness:{type:"f",value:a},opacity:{type:"f",value:o},nearClip:{type:"f",value:t},ortho:{type:"f",value:0},shrink:{type:"f",value:.13},fogColor:{type:"v3",value:[i.r,i.g,i.b]},fogNear:{type:"f",value:n},fogFar:{type:"f",value:l},fogDensity:{type:"f",value:2}},THREE.UniformsLib.ambient,THREE.UniformsLib.lights]),s.defines={USE_COLOR:1,NEAR_CLIP:1,CAP:1},"yes"!==s.opts.fog||r||(s.defines.USE_FOG=1,"orthographic"===s.opts.camera&&(s.defines.FOG_EXP2=1)),s.bExtFragDepth&&(s.defines.USE_LOGDEPTHBUF_EXT=1)}drawImpostorShader(){this.icn3d.icn3dui.bNode||(this.setParametersForShader(),this.createImpostorShaderSphere("SphereImpostor"),this.createImpostorShaderCylinder("CylinderImpostor"))}getShader(e){this.icn3d.icn3dui;let t=$NGL_shaderTextHash[e];return t=t.replace(/#include\s+(\S+)/gim,(function(e,t){let s;return THREE.ShaderChunk.hasOwnProperty(t)&&(s=THREE.ShaderChunk[t]),s||""})),t}createImpostorShaderBase(e,t,s,i,n,l,r,o,a){let d=this.icn3d;d.icn3dui;let c=new THREE.ShaderMaterial({defines:d.defines,uniforms:d.uniforms,vertexShader:this.getShader(e+".vert"),fragmentShader:this.getShader(e+".frag"),depthTest:!0,depthWrite:!0,lights:!0});c.extensions.fragDepth=!0,"CylinderImpostor"==e?d.CylinderImpostorMaterial=c:"SphereImpostor"==e&&(d.SphereImpostorMaterial=c);let h,p,m=l*r,u=l*o,g=new(m>65535?Uint32Array:Uint16Array)(u);for(let e=0;eo?r:o,d=Math.sqrt(a),c=(d+s)*(d+s),h={};for(let r in e){let e=n.atoms[r];!i&&t.hasOwnProperty(e.serial)||(this.bOpm&&"DUM"===e.resn||e.coord.x
";if("atom"==e){let e=["proteins","nucleotides","chemicals","ions","water"];for(let i=0,l=e.length;i
",n+="Light green (P, T, S, A, Q, N, G): Polar
",n+="Grey: Charged, not hydrophobic
"):(n+="Green (W, F, L, I, Y, M, V, C): Hydrophobic
",n+="Yellow (P, T, S, A, Q, N, G): Polar
",n+="Red: Negatively Charged
",n+="Blue: Positively Charged
");let a=0;for(let e of r)s.parasCls.residueAbbrev[e[0]]&&(n+="
"),++a);n+="
",n+=s.htmlCls.clickMenuCls.setLegendHtml()):"confidence"==e?n+=s.htmlCls.clickMenuCls.setLegendHtml(!0):"exon"==e?(t.startColor="red",t.midColor="white",t.endColor="blue",t.startValue="Start",t.midValue="Middle",t.endValue="End",n+=s.htmlCls.clickMenuCls.setLegendHtml()):n="";n?($("#"+s.pre+"dl_legend_html").html(n),s.htmlCls.dialogCls.openDlg("dl_legend","Color Legend")):$("#"+s.pre+"dl_legend").hasClass("ui-dialog-content")&&$("#"+s.pre+"dl_legend").dialog("isOpen")&&$("#"+s.pre+"dl_legend").dialog("close")}getColorLegendForElem(e,t){let s=this.icn3d,i=s.icn3dui,n="",l={};for(let e in t){let t=s.atoms[e],i=void 0===t||void 0===t.color||"FFFFFF"===t.color.getHexString().toUpperCase()?"DDDDDD":t.color.getHexString();void 0===l[t.elem]&&(l[t.elem]={}),l[t.elem][i]=1}if(Object.keys(l).length>0){n+=""+e+"
";let t=Object.keys(l).sort();for(let e=0,s=t.length;e";for(let e in l[s])n+=" ";n+=i.parasCls.atomnames[s.toUpperCase()]+"
"}n+="
"}return n}getRes2color(e,t){let s=this.icn3d,i=s.icn3dui,n={},l=s.firstAtomObjCls.getResiduesFromAtoms(e);for(let e in l){let l=s.residues[e],r=s.firstAtomObjCls.getFirstAtomObj(l),o=t?r.resn:i.parasCls.residueAbbrev[r.resn],a=void 0===r||void 0===r.color||"FFFFFF"===r.color.getHexString().toUpperCase()?"DDDDDD":r.color.getHexString();null!=o&&(void 0===n[o]&&(n[o]={}),n[o][a]=1)}return n}getColorLegendForResidue(e){this.icn3d.icn3dui;let t="",s=this.getRes2color(e);if(Object.keys(s).length>0){t+="
"),-1!=o.indexOf("(")?(t+=r,++n):i+=r}i&&(t+="
"+i),t+=""}return t}getColorLegendForCharge(e){let t=this.icn3d;t.icn3dui;let s="",i=t.firstAtomObjCls.getResiduesFromAtoms(e),n={};for(let e in i){let s=t.residues[e],i=t.firstAtomObjCls.getFirstAtomObj(s);"ARG"==i.resn||"LYS"==i.resn?n.Positive=1:"HIS"==i.resn?n["Partial-Positive"]=1:"ASP"==i.resn||"GLU"==i.resn||t.nucleotides[i.serial]?n.Negative=1:n.Neutral=1}const l={Positive:"0000ff","Partial-Positive":"8080ff",Negative:"ff0000",Neutral:"888888"};let r=["Positive","Partial-Positive","Negative","Neutral"];s+="
")}return s+="
(Charges are at pH 7)",s+="
"}return t+="
Linker":"","C'' Strand":"FF0000","
Protodomain 2":"","D Strand":"0000FF","E Strand":"006400","F Strand":"F7DC6F","G Strand":"FFA500","":"",Loop:"CCCCCC"};t+="
that by its duplication, symmetry operations
can generate a structural domain.
";for(let e in s){let i=s[e];t+="",i&&(t+=" "),t+=e,t+="
"}return t+="'+s+"
",h+=d+u+g,p+=d+u+g;let f="site"+e.toString(),b=0,y=0,v=1;i.seqStartLen&&i.seqStartLen[c]&&(p+=i.showSeqCls.insertMulGapOverview(c,i.seqStartLen[c])),i.seqStartLen&&i.seqStartLen[c]&&(h+=i.showSeqCls.insertMulGap(i.seqStartLen[c],"-"));for(let t=0,s=i.giSeq[c].length;t1&&(l=s[0]+"..");let r=i.ParserUtilsCls.getResi(c,t);if(h+=''+s+"",n.bNode){let t={};t[c+"_"+r]="site: "+C[e].title,i.resid2site[c].push(t)}p+=i.showSeqCls.insertGapOverview(c,t);let o=n.cfg.blast_rep_id==c?Math.round(i.seqAnnWidth*t/(i.maxAnnoLength+i.nTotalGap)-b-y):Math.round(i.seqAnnWidth*t/i.maxAnnoLength-b-y);o>=0&&(p+='",g+="
",h+=g,p+=g}h+="",p+="",m+="",$("#"+i.pre+"dt_site_"+c).html(h),$("#"+i.pre+"ov_site_"+c).html(p),$("#"+i.pre+"tt_site_"+c).html(m)}}for(let e in i.protein_chainid)r.hasOwnProperty(e)||($("#"+i.pre+"dt_cdd_"+e).html(""),$("#"+i.pre+"ov_cdd_"+e).html(""),$("#"+i.pre+"tt_cdd_"+e).html(""),$("#"+i.pre+"dt_site_"+e).html(""),$("#"+i.pre+"ov_site_"+e).html(""),$("#"+i.pre+"tt_site_"+e).html(""));i.showAnnoCls.enableHlSeq(),i.bAjaxCddSite=!0}getNoCdd(e){let t=this.icn3d;t.icn3dui,console.log("No CDD data were found for the protein "+e+"...");for(let e in t.protein_chainid)$("#"+t.pre+"dt_cdd_"+e).html(""),$("#"+t.pre+"ov_cdd_"+e).html(""),$("#"+t.pre+"tt_cdd_"+e).html(""),$("#"+t.pre+"dt_site_"+e).html(""),$("#"+t.pre+"ov_site_"+e).html(""),$("#"+t.pre+"tt_site_"+e).html("");t.showAnnoCls.enableHlSeq(),t.bAjaxCddSite=!0}setDomainFeature(e,t,s,i,n,l,r){let o,a,d,c=this.icn3d,h=c.icn3dui;s&&(r={},o={},a={},d={});let p=void 0!==e?e.length:0,m=s?14:19,u=s?100:120;for(let g=0;g
";let T='';i+=R+I+T,s&&(n+='
",i+=T,n+=T,s&&(n+=' ')}}return{html:i,html2:n,html3:l,acc2domain:r,pssmid2name:o,pssmid2fromArray:a,pssmid2toArray:d}}showAnnoType(e,t,s,i,n,l){let r=this.icn3d,o=r.icn3dui,a='
";let b='';a+=g+f+b,d+=g+f+b;let C=s,y=0,v=0;r.seqStartLen&&r.seqStartLen[e]&&(d+=r.showSeqCls.insertMulGapOverview(e,r.seqStartLen[e])),r.seqStartLen&&r.seqStartLen[e]&&(a+=r.showSeqCls.insertMulGap(r.seqStartLen[e],"-"));for(let t=0,i=r.giSeq[e].length;t1&&(c=n[0]+"..");let h=i,p=e+"_"+i,m=n+i;if("ssbond"==s){m="Residue "+p+" has disulfide bond with";let t="";if(void 0!==l[p])for(let e=0,s=l[p].length;e'+c+"",d+=r.showSeqCls.insertGapOverview(e,t);let u=o.cfg.blast_rep_id==e?Math.round(r.seqAnnWidth*t/(r.maxAnnoLength+r.nTotalGap)-y-v):Math.round(r.seqAnnWidth*t/r.maxAnnoLength-y-v);u>=0&&(d+='
",a+=b,d+=b,a+="",d+="",c+="",$("#"+r.pre+"dt_"+s+"_"+e).html(a),$("#"+r.pre+"ov_"+s+"_"+e).html(d),$("#"+r.pre+"tt_"+s+"_"+e).html(c)}setToolTip(){let e=this.icn3d;e.icn3dui,$("[id^="+e.pre+"snp]").add("[id^="+e.pre+"clinvar]").add("[id^="+e.pre+"ssbond]").add("[id^="+e.pre+"crosslink]").tooltip({content:function(){return $(this).prop("title")},show:null,close:function(e,t){t.tooltip.hover((function(){$(this).stop(!0).fadeTo(400,1)}),(function(){$(this).fadeOut("400",(function(){$(this).remove()}))}))}})}}class _t{constructor(e){this.icn3d=e}showInteraction(e,t){this.icn3d.icn3dui,this.showInteraction_base(e,t)}showInteraction_base(e,t){let s=this.icn3d,i=s.icn3dui;i.bNode&&(s.resid2contact||(s.resid2contact={}),s.resid2contact[e]||(s.resid2contact[e]=[])),void 0===s.chainname2residues&&(s.chainname2residues={});let n=Object.keys(s.chains),l=e,r=Math.round(l.indexOf("_"));if(s.firstAtomObjCls.getFirstCalphaAtomObj(s.chains[l]),void 0===s.chainname2residues[l]){s.chainname2residues[l]={};let t=n.length;if(t>100&&void 0===i.cfg.mmdbid&&void 0===i.cfg.gi&&void 0===i.cfg.blast_rep_id&&void 0===i.cfg.align&&void 0===i.cfg.chainalign)return $("#"+s.pre+"dt_interaction_"+e).html(""),void $("#"+s.pre+"ov_interaction_"+e).html("");for(let e=0;e
";let f='';o+=u+g+f,a+=u+g+f;let b="inter"+c.toString(),C=0,y=0,v=1;s.seqStartLen&&s.seqStartLen[e]&&(a+=s.showSeqCls.insertMulGapOverview(e,s.seqStartLen[e])),s.seqStartLen&&s.seqStartLen[e]&&(o+=s.showSeqCls.insertMulGap(s.seqStartLen[e],"-"));for(let t=0,n=s.giSeq[e].length;t
",o+=f,a+=f,++c}o+="",a+="",d+="",$("#"+s.pre+"dt_interaction_"+e).html(o),$("#"+s.pre+"ov_interaction_"+e).html(a),$("#"+s.pre+"tt_interaction_"+e).html(d),i.utilsCls.isMobile()?(s.hlSeqCls.selectSequenceMobile(),s.hlSeqCls.selectChainMobile()):s.hlSeqCls.selectSequenceNonMobile()}}class wt{constructor(e){this.icn3d=e}async showPTM(e,t,s,i,n){let l=this.icn3d,r=l.icn3dui,o=this,a=e.substr(0,e.indexOf("_")),d=e.substr(e.indexOf("_")+1);if("afmem"==s){let t={Transmembrane:[{begin:i,end:n}]};this.setAnnoPtmTransmem("transmem",t,e)}else if(a.length>5){let t,i="https://www.ebi.ac.uk/proteins/api/features/"+a;try{t=await r.getAjaxPromise(i,"json"),o.parsePTM(t,e,s)}catch{return void o.getNoPTM(e,s)}}else{let t,i=a.substr(0,4).toLowerCase(),n="https://www.ebi.ac.uk/pdbe/api/mappings/uniprot/"+i;try{t=await r.getAjaxPromise(n,"json");let a="";l.UPResi2ResiPosPerChain||(l.UPResi2ResiPosPerChain={}),l.UPResi2ResiPosPerChain[e]={};let c=t[i].UniProt,h=!1;for(let t in c){let s=c[t].mappings;for(let i=0,n=s.length;i
",r+=b+C+y,o+=b+C+y;let v=e+l.toString(),_=0,w=0,S=1;i.seqStartLen&&i.seqStartLen[s]&&(o+=i.showSeqCls.insertMulGapOverview(s,i.seqStartLen[s])),i.seqStartLen&&i.seqStartLen[s]&&(r+=i.showSeqCls.insertMulGap(i.seqStartLen[s],"-"));for(let e=0,t=i.giSeq[s].length;e
",r+=y,o+=y,++l}r+="",o+="",a+="",$("#"+i.pre+"dt_"+e+"_"+s).html(r),$("#"+i.pre+"ov_"+e+"_"+s).html(o),$("#"+i.pre+"tt_"+e+"_"+s).html(a)}getNoPTM(e,t){let s=this.icn3d;s.icn3dui,console.log("No PTM data were found for the chain "+e+"...");let i="ptm"==t?"ptm":"transmem";$("#"+s.pre+"dt_"+i+"_"+e).html(""),$("#"+s.pre+"ov_"+i+"_"+e).html(""),$("#"+s.pre+"tt_"+i+"_"+e).html(""),s.showAnnoCls.enableHlSeq(),s.bAjaxPTM=!0}}class St{constructor(e){this.icn3d=e}showCrosslink(e,t){let s=this.icn3d;s.icn3dui;let i=this;void 0===s.clbondpnts?setTimeout((function(){i.showCrosslink_base(e,t)}),1e3):this.showCrosslink_base(e,t)}showCrosslink_base(e,t){let s=this.icn3d;s.icn3dui.bNode&&(s.resid2crosslink||(s.resid2crosslink={}),s.resid2crosslink[e]||(s.resid2crosslink[e]=[]));let i=t,n={},l=i.substr(0,i.indexOf("_")),r=s.clbondpnts[l];if(void 0===r)return $("#"+s.pre+"dt_crosslink_"+e).html(""),$("#"+s.pre+"ov_crosslink_"+e).html(""),void $("#"+s.pre+"tt_crosslink_"+e).html("");for(let e=0,t=r.length;e17?s.substr(0,17)+"...":s,h=i[t].intervals,p={},m={},u=[],g=[],f={},b=0;for(let e=0,t=h.length;e
";let v='';o+=C+y+v,a+=C+y+v;let _="domain3d"+t.toString();l.seqStartLen&&l.seqStartLen[e]&&(o+=l.showSeqCls.insertMulGap(l.seqStartLen[e],"-"));for(let t=0,s=l.giSeq[e].length;t1&&(n=i[0]+"..");let r=s;o+=''+i+""}else o+="-"}l.seqStartLen&&l.seqStartLen[e]&&(o+=l.showSeqCls.insertMulGap(l.seqEndLen[e],"-"));let w=l.firstAtomObjCls.getFirstCalphaAtomObj(l.chains[e]),S=void 0===w.color||"FFFFFF"===w.color.getHexString()?"DDDDDD":w.color.getHexString(),A=void 0!==w.color?S:"CCCCCC";if(l.seqStartLen&&l.seqStartLen[e]&&(a+=l.showSeqCls.insertMulGapOverview(e,l.seqStartLen[e])),r.cfg.blast_rep_id!=e)for(let i=0,n=u.length;i",v+="
",o+=v,a+=v}o+="",a+="",d+="",$("#"+l.pre+"dt_domain_"+e).html(o),$("#"+l.pre+"ov_domain_"+e).html(a),$("#"+l.pre+"tt_domain_"+e).html(d)}}class xt{constructor(e){this.icn3d=e}async showSnp(e,t){this.icn3d.icn3dui,await this.showSnpClinvar(e,t,!0)}async showClinvar(e,t){this.icn3d.icn3dui,await this.showSnpClinvar(e,t,!1)}async showSnpClinvar(e,t,s){let i=this.icn3d.icn3dui,n=this,l=i.htmlCls.baseUrl+"vastdyn/vastdyn.cgi?chainid="+t;try{let r=await i.getAjaxPromise(l,"jsonp"),o=r.snpgi,a=r.gi;if(s)await n.showSnpPart2(e,t,o);else{let s=o;[6137708,1942289,224510717,2624886,253723219,2554905,75765331,3660278,312207882,319443632,342350956,1827805,109157826,1065265,40889086,6730307,163931185,494469,163931091,60594093,55669745,18655489,17942684,6980537,166235465,6435586,4139398,4389047,364506122,78101667,262118402,20664221,2624640,158430173,494395,28948777,34810587,13399647,3660342,261278854,342350965,384482350,378792570,15988303,213424334,4558333,2098365,10835631,3318817,374074330,332639529,122919696,4389286,319443573,2781341,67464020,194709238,210061039,364506106,28949044,40889076,161172338,17943181,4557976,62738484,365813173,6137343,350610552,17942703,576308,223674070,15826518,1310997,93279697,4139395,255311799,157837067,361132363,357380836,146387678,383280379,1127268,299856826,13786789,1311054,46015217,3402130,381353319,30750059,218766885,340707375,27065817,355333104,2624634,62738384,241913553,304446010].includes(a)&&(s=a),await n.showClinvarPart2(e,t,s)}}catch(t){return void(s?n.processNoSnp(e):n.processNoClinvar(e))}}navClinVar(e){let t=this.icn3d;t.icn3dui;let s=this;t.currClin[e]=-1,$(document).on("click","#"+t.pre+e+"_prevclin",(function(t){let i=s.icn3d;t.stopImmediatePropagation();let n=void 0!==i.resi2disease_nonempty[e]?Object.keys(i.resi2disease_nonempty[e]).length:0;--i.currClin[e],i.currClin[e]<0&&(i.currClin[e]=n-1),s.showClinVarLabelOn3D(e)})),$(document).on("click","#"+t.pre+e+"_nextclin",(function(t){let i=s.icn3d;t.stopImmediatePropagation();let n=void 0!==i.resi2disease_nonempty[e]?Object.keys(i.resi2disease_nonempty[e]).length:0;++i.currClin[e],i.currClin[e]>n-1&&(i.currClin[e]=0),s.showClinVarLabelOn3D(e)}))}showClinVarLabelOn3D(e){let t,s,i=this.icn3d,n=i.icn3dui,l=Object.keys(i.resi2disease_nonempty[e]);t=e,s=t+"_"+(parseInt(l[i.currClin[e]])+i.baseResi[e]).toString();let r="",o=i.resi2disease_nonempty[e][l[i.currClin[e]]];for(let e=0,t=o.length;e(from human)",i=" (based on human sequences and mapped to this structure by sequence similarity)"),C+=m?'
";C+='';let O="",R=0,I=0;p?f.seqStartLen&&f.seqStartLen[h]&&(C+=f.showSeqCls.insertMulGapOverview(h,f.seqStartLen[h])):f.seqStartLen&&f.seqStartLen[h]&&(C+=f.showSeqCls.insertMulGap(f.seqStartLen[h],"-"));for(let t=1,a=f.giSeq[h].length;t<=a;++t)if(p){if(void 0!==r[t]){let e=f.giSeq[h][t-1],i=e;e.length>1&&(i=e[0]+"..");let n=f.ParserUtilsCls.getResi(h,t-1)+i+">";for(let e=0,i=s[t].length;e=0&&(C+='
"+f.showAnnoCls.addSnpButton(m,"snpin3d","3D with scap","SNP in 3D with scap",70,g)+" ",u+=f.showAnnoCls.addSnpButton(m,"snpinter","Interactions","SNP Interactions in 3D",70,g)+" ",u+=f.showAnnoCls.addSnpButton(m,"snppdb","PDB","Download SNP PDB",35,g)),u+="
Links: ClinVar, dbSNP(rs"+i[t][e]+")",e
"),++r)}r>d&&2==e&&(p+="..")}else{d=1;for(let e=v;e
"+f.showAnnoCls.addSnpButton(r,"snpin3d","3D with scap","SNP in 3D with scap",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snpinter","Interactions","SNP Interactions in 3D",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snppdb","PDB","Download SNP PDB",35,m)),0!=i[t][e]&&(u+="
Link: dbSNP(rs"+i[t][e]+")"),e
");else{let s=l[t][e].split("; "),a=o[t][e].split("; "),d="",c=0;for(let t=0,i=s.length;t0?d+="; ":0!==e&&1!==e||(O='disease="'+s[t]+'"'),d+=s[t]+"("+a[t]+")",++c;""!=d?(u+=": "+d,C&&!b.cfg.hidelicense&&(u+="
"+f.showAnnoCls.addSnpButton(r,"snpin3d","3D with scap","SNP in 3D with scap",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snpinter","Interactions","SNP Interactions in 3D",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snppdb","PDB","Download SNP PDB",35,m)),u+="
Links: ClinVar, dbSNP(rs"+i[t][e]+")"):(C&&!b.cfg.hidelicense&&(u+="
"+f.showAnnoCls.addSnpButton(r,"snpin3d","3D with scap","SNP in 3D with scap",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snpinter","Interactions","SNP Interactions in 3D",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snppdb","PDB","Download SNP PDB",35,m)),u+="
Link: dbSNP(rs"+i[t][e]+")"),e
")}}y>d&&2==e&&(p+="..")}u+="
",C}processSnpClinvar(e,t,s,i,n){let l=this.icn3d,r=l.icn3dui,o='")+1),h=s[4],p=i?"":s[5],S=i?"":s[6],A=i?"":s[7],x=l.ParserUtilsCls.getResi(t,d-1);v[x]=1,""!=S&&(_[x]=1),g[d]=e+1,void 0===u[d]&&(u[d]=[]),u[d].push(c),void 0===C[d]&&(C[d]=[]),C[d].push(h),void 0===y[d]&&(y[d]=[]),y[d].push(p),void 0===f[d]&&(f[d]=[]),f[d].push(S),""!=S&&(void 0===l.resi2disease_nonempty[t][d]&&(l.resi2disease_nonempty[t][d]=[]),l.resi2disease_nonempty[t][d].push(S)),void 0===b[d]&&(b[d]=[]),b[d].push(A)}let S=Object.keys(v),A=Object.keys(_);if(i){let e=!1;o+=this.getSnpLine(1,2,u,C,y,f,g,b,S,A,1,t,!1,e,void 0,i),o+=this.getSnpLine(2,2,u,C,y,f,g,b,S,A,0,t,!1,e,void 0,i),d+=this.getSnpLine(1,2,u,C,y,f,g,b,S,A,1,t,!1,e,!0,i),d+=this.getSnpLine(2,2,u,C,y,f,g,b,S,A,0,t,!1,e,!0,i),a+=this.getSnpLine(1,2,u,C,y,f,g,b,S,A,1,t,!0,e,void 0,i),o+="0&&this.elt_size[s.sse-1]>=6&&0!=s.adj_strand2&&e++}for(let e=0;e
",w+=x+k+"
";let O='';C+=A+k+O,y+=x+k+O,v+=A+k+O;let R=e.indexOf("_"),I="cst"+e.substr(R+1),T=0,E=0,P=(void 0===l||"seq"===l||"custom"===l)&&-1==s.indexOf("cannot-be-aligned")&&-1==s.indexOf("cannot be aligned"),M="identity"===l&&-1==s.indexOf("cannot-be-aligned")&&-1==s.indexOf("cannot be aligned"),D={},H=0;A="";let F={},L={},N={},q=0;if(h)for(let e=0,t=h.length;e
",O+="",C+=O,v+=A+O,y+=O,_+="",w+="",h?($("#"+p.pre+"dt_custom_"+e+"_"+f).html(y+C),$("#"+p.pre+"ov_custom_"+e+"_"+f).html(v),$("#"+p.pre+"tt_custom_"+e+"_"+f).html(w+_)):($("#"+p.pre+"dt_custom_"+e+"_"+f).html(C),$("#"+p.pre+"ov_custom_"+e+"_"+f).html(v),$("#"+p.pre+"tt_custom_"+e+"_"+f).html(_))}getExonHtml(e,t,s,i,n,l,r){let o=this.icn3d;return o.icn3dui,'20)return!1;if(void 0!==o.giSeq&&void 0!==o.giSeq[e]){let r=this.getFullText(s);return s=r.text,this.showNewTrack(e,t,s,void 0,void 0,i,n,l),!1}setTimeout((function(){a.checkGiSeq(e,t,s,i,n,l,r+1)}),100)}getFullText(e){this.icn3d.icn3dui;let t="",s=[],i=[],n=e.split(","),l=-1;for(let e=0,r=n.length;eA&&(A=e)}let x=S,k=w.length-(A+1),O=[],R=[];for(let e=0,t=p.length;e"),d=a[1].indexOf("\n");n=a[1].substr(d+1).replace(/\n/g,"");for(let e=2,t=a.length;e
Click \"Assembly\" in the menu \"View\" to switch between asymmetric unit and biological assembly("+e.asuCnt+" asymmetric unit).e.maxAnnoLengthOri&&(e.protein_chainid.hasOwnProperty(t)||s.hasOwnProperty(t))&&(e.maxAnnoLengthOri=e.chainsSeq[t].length);e.maxAnnoLength=e.maxAnnoLengthOri}return{nucleotide_chainid:s,chemical_chainid:i,chemical_set:n}}async showAnnotations(){let e=this.icn3d,t=e.icn3dui,s=this,i=this.showAnnotations_part1(),n=i.nucleotide_chainid,l=i.chemical_chainid,r=i.chemical_set;if(!e.bAnnoShown||e.bResetAnno)if(e.bAnnoShown=!0,void 0===t.cfg.blast_rep_id){if(e.bFullUi){if(void 0!==t.cfg.mmtfid){let t=Object.keys(e.structures)[0];await e.mmcifParserCls.downloadMmcifSymmetry(t,"mmtfid")}await this.showAnnoSeqData(n,l,r)}}else if(void 0===t.cfg.blast_rep_id||e.bSmithwm||e.bLocalSmithwm){if(void 0!==t.cfg.blast_rep_id&&(e.bSmithwm||e.bLocalSmithwm)){let i,o,a=[t.cfg.blast_rep_id];if(-1!=t.cfg.query_id.indexOf(">")?o=t.cfg.query_id.substr(t.cfg.query_id.indexOf("\n")+1):!/\d/.test(t.cfg.query_id)||t.cfg.query_id.length>50?o=t.cfg.query_id:a.push(t.cfg.query_id),e.blastAcxn){let s=t.cfg.afid+"_A",n="";for(let t=0,i=e.chainsSeq[s].length;t5){let n;e.uniprot2acc&&e.uniprot2acc[i]?e.uniprot2acc[i]:e.uniprot2acc={},n="https://rest.uniprot.org/uniprotkb/search?format=json&fields=xref_geneid,gene_names&query="+i;let l=await t.getAjaxPromise(n,"json"),r=l.results[0]&&l.results[0].uniProtKBCrossReferences&&l.results[0].uniProtKBCrossReferences[0]?l.results[0].uniProtKBCrossReferences[0].id:void 0,o=l.results[0]&&l.results[0].genes&&l.results[0].genes[0]&&l.results[0].genes[0].geneName?l.results[0].genes[0].geneName.value:"ID "+r;e.chainsGene[s]={geneId:r,geneSymbol:o}}}for(let s in e.protein_chainid){let i=t.utilsCls.isMobile()?"none":"button",l=e.showSeqCls.getProteinName(s),r=l,o=0==n?"Proteins:
":"",a=e.chainsGene[s]&&e.chainsGene[s].geneId&&e.chainsGene[s].geneDesc?"(Gene: "+e.chainsGene[s].geneSymbol+")":"",d=s.substr(0,s.indexOf("_")),c=d.length>5?''+s+"":s,h="
"),++n}if(t.bNode||e.annoCddSiteCls.setToolTip(),void 0!==e.chainid_seq)await this.processSeqData(e.chainid_seq);else try{let n=[],l=[];for(let e=0,t=i.length;e40&&(r=r.substr(0,40)+"...");let o="";0==i&&("protein"==s?o="Proteins:
":"nucleotide"==s?o="Nucleotides:
":"chemical"==s&&(o="Chemicals/Ions/Water:
")),$("#"+n.pre+"dl_annotations").append("
"),n.giSeq[e]=[];for(let t=0;t
":"",o=t[0].lastIndexOf("_"),a=t[0].substr(0,o),d=void 0!==l.cfg.mmdbid&&void 0!==n.chainid2sid?n.chainid2sid[a]:void 0;i=void 0!==d?""+e+" ":""+e+"",$("#"+n.pre+"dl_annotations").append("
");let c='
",c+="
",g+=u+'';let s=0,i=0,n="";a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e]," "));for(let t=0,l=o.length;t
",g+="
",g+=u+'',a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e],"-"));for(let t=0,s=o.length;t':'',g+=" ";else if("E"==a.secondaries[s]){a.firstAtomObjCls.getFirstCalphaAtomObj(a.residues[s]).ssend?"green"==a.sheetcolor?g+='':"yellow"==a.sheetcolor&&(g+=''):"green"==a.sheetcolor?g+='':"yellow"==a.sheetcolor&&(g+=''),g+=" "}else"c"==a.secondaries[s]?g+=' ':"o"==a.secondaries[s]&&(g+=' ');else g+="-"}a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqEndLen[e],"-")),g+='',g+="",g+="
",g+="
";let v='';g+=u+v,f+=u+v;let _,w=0;a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e],"-"));for(let t=0,s=o.length;t1&&(i=s[0]+".."),_=a.ParserUtilsCls.getResi(e,t),a.residues.hasOwnProperty(e+"_"+_)){let n="333333";if(d.cfg.blast_rep_id==e&&void 0!==a.fullpos2ConsTargetpos&&void 0!==a.fullpos2ConsTargetpos[t+w])n=a.fullpos2ConsTargetpos[t+w].color;else{let t=a.firstAtomObjCls.getFirstCalphaAtomObj(a.residues[e+"_"+_]),s=void 0===t.color||"FFFFFF"===t.color.getHexString().toUpperCase()||"FFF"===t.color.getHexString().toUpperCase()?"DDDDDD":t.color.getHexString();n=void 0!==t.color?s:"CCCCCC"}g+=''+i+""}else i=i.toLowerCase(),g+=''+i+""}a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqEndLen[e],"-")),d.cfg.blast_rep_id==e&&(a.opts.color=a.blastAcxn?"confidence":"conservation",a.setColorCls.setColorByOptions(a.opts,a.atoms));let S=a.firstAtomObjCls.getFirstCalphaAtomObj(a.chains[e]),A=S.color?S.color.getHexString():"CCCCCC",x=Math.round(a.seqAnnWidth*o.length/(a.maxAnnoLength+a.nTotalGap));if(x<1&&(x=1),a.seqStartLen&&a.seqStartLen[e]&&(f+=this.insertMulGapOverview(e,a.seqStartLen[e])),d.cfg.blast_rep_id!=e)f+='
",g+=u,f+=u,d.cfg.blast_rep_id==e){if(void 0!==r&&""!==r){u='
";let t='';g+=u+t,f+=u+t;let s=0,i=0,l=1;a.queryStart;for(let t=0,n=r.length;t
",g+=u,f+=u}u='
";let t='';g+=u+t,f+=u+t;let s=a.queryStart;for(let t=0,i=l.length;t-":(void 0===a.fullpos2ConsTargetpos||void 0===a.fullpos2ConsTargetpos[t]||a.residues.hasOwnProperty(e+"_"+a.fullpos2ConsTargetpos[t].pos)||(i=i.toLowerCase()),g+=''+i+"",++s)}let o=a.firstAtomObjCls.getFirstCalphaAtomObj(a.chains[e]),d=void 0===o.color||"FFFFFF"===o.color.getHexString()?"DDDDDD":o.color.getHexString(),c=void 0!==o.color?d:"CCCCCC",h=[],p=[],m="-";for(let e=0,t=l.length;e
",g+=u,f+=u}if(g+="",f+="",b+="",a.giSeq[e].length>10){let t=a.firstAtomObjCls.getFirstCalphaAtomObj(a.chains[e]);if((void 0!==d.cfg.mmdbid||void 0!==d.cfg.gi||void 0!==d.cfg.blast_rep_id||void 0!==d.cfg.align||void 0!==d.cfg.chainalign||void 0!==d.cfg.mmdbafid)&&void 0!==t.resi_ori&&t.resi_ori!=t.resi&&-1==e.indexOf("Misc")){u='
",g+=u+'',a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e],"-"));for(let t=0,s=o.length;t",e%10==0&&(g+=e+" "),g+=""}else g+=""}a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqEndLen[e],"-")),g+='',g+="",g+="
",g+="
",r+=c+'';let h=!1;for(let s=0,l=e.length;s
",r+="",A="-",x="--";for(let t=0,s=r.length;t0&&(T=1,t=i.getGraphCls.getNodeTopBottom(c[e],d,void 0,T,g[e]),h[e]=t.nodeArray1,m[e]=t.nodeArray2,d=n.hashUtilsCls.unionHash(d,t.name2node),T=2,t=i.getGraphCls.getNodeTopBottom(c[e],d,void 0,T,y[e]),f[e]=t.nodeArray1,b[e]=t.nodeArray2,d=n.hashUtilsCls.unionHash(d,t.name2node)),k[e]=l[e].length,O[e]=o[e].length,R=Math.max(R,O[e]),I.push(p[e])}let E,P,M,D,H,F=1,L=3*F,N=7*F,q=10,U=10,$=30,j=20;t?(M=(n.utilsCls.sumArray(k)+2*I.length)*(L+N)+4*U+2*$+j*I.length,P=(R+2)*(L+N)+2*q+$):(E=110+j,M=E*I.length,P=(R+2)*(L+N)+2*q,P+=20),Object.keys(i.chainsMapping).length>0&&(M*=3),t?(i.scatterplotWidth=2*P,H=i.scatterplotWidth,D=n.scatterplotid):(i.linegraphWidth=2*P,H=i.linegraphWidth,D=n.linegraphid),s=0==I.length?"No interactions found for each structure
":"2D integration graph for "+I.length+" structure(s) "+I+'. There are three sections: "Interactions", "Common interactions", and "Different interactions". Each section has '+I.length+" graphs.
",s+=""}else if(t){let e,t,l,c,h=p[0],m=o.length,u=a.length,g=1,f=3*g,b=7*g,C=30;t=(m+2)*(f+b)+2*10+C,e=(u+2)*(f+b)+2*10+C,i.scatterplotWidth=2*e,c=i.scatterplotWidth,l=n.scatterplotid,s=r.length>0?"":"No interactions found for these two sets
",s+=""}else{let e=p[0],t=o.length,l=a.length,c=1,h=3*c,m=7*c,u=110,g=10,f=t>l?t*(h+m)+2*g:l*(h+m)+2*g;i.linegraphWidth=2*f,s=r.length>0?"":"No interactions found for these two sets
",s+=""}return i.lineGraphStr+="}\n",i.scatterplotStr=i.lineGraphStr,t?$("#"+i.pre+"scatterplotDiv").html(s):$("#"+i.pre+"linegraphDiv").html(s),s}drawGraphPerType(e,t,s,i,n,l,r,o,a,d,c,h,p,m){let u=this.icn3d;u.icn3dui;let g,f,b="",C=2==t.length&&"2"==t[1].replace(t[0],"");0==e?(g="Interactions in ",f=""):1==e?(g="Common interactions in ",f="_common"):2==e&&(g="Different interactions in ",f="_diff");for(let y=0,v=t.length;y
",E=p.resid2specCls.atoms2residues(Object.keys(C)),P=p.resid2specCls.atoms2residues(Object.keys(y)),M="select "+p.resid2specCls.residueids2spec(E),D="select "+p.resid2specCls.residueids2spec(P);T+="Set 1: "+e+'
',T+="Set 2: "+t+'
',T+='
';let H=p.resid2specCls.atoms2residues(Object.keys(R)),F=p.resid2specCls.atoms2residues(Object.keys(I)),L="select "+p.resid2specCls.residueids2spec(H),N="select "+p.resid2specCls.residueids2spec(F);T+='interface_1
',T+='interface_2
';let q=T;if(("graph"==i||"linegraph"==i||"scatterplot"==i||b)&&(T=""),T+=O,"save1"==i||"save2"==i){T=q;let e="";"save1"==i?e="Set 1":"save2"==i&&(e="Set 2"),T+='
Interactions Sorted on '+e+': 0&&l!=a&&(i.push({res1:a,res2:w,cntHbond:f,cntIonic:b,cntContact:C,cntHalegen:y,cntPication:v,cntPistacking:_}),o+=this.getInteractionPerResidue(d,c,h,p,m,u,g,f,b,C,y,v,_),c="",h="",p="",m="",u="",g="",f=0,b=0,C=0,y=0,v=0,_=0,w=""),x=t.resids2inter[S].hbond,k=this.getInteractionPairDetails(x,e,"hbond"),c+=k.html,f+=k.cnt,k.cnt>0&&(w+=r+":hbond_"+k.cnt+" "),x=t.resids2inter[S].ionic,k=this.getInteractionPairDetails(x,e,"ionic"),h+=k.html,b+=k.cnt,k.cnt>0&&(w+=r+":ionic_"+k.cnt+" "),x=t.resids2inter[S].contact,k=this.getContactPairDetails(x,e,"contact"),p+=k.html,C+=k.cnt,k.cnt>0&&(w+=r+":contact_"+k.cnt+" "),x=t.resids2inter[S].halogen,k=this.getInteractionPairDetails(x,e,"halogen"),m+=k.html,y+=k.cnt,k.cnt>0&&(w+=r+":halogen_"+k.cnt+" "),x=t.resids2inter[S]["pi-cation"],k=this.getInteractionPairDetails(x,e,"pi-cation"),u+=k.html,v+=k.cnt,k.cnt>0&&(w+=r+":pi-cation_"+k.cnt+" "),x=t.resids2inter[S]["pi-stacking"],k=this.getInteractionPairDetails(x,e,"pi-stacking"),g+=k.html,_+=k.cnt,k.cnt>0&&(w+=r+":pi-stacking_"+k.cnt+" "),a=l,d=O}i.push({res1:a,res2:w,cntHbond:f,cntIonic:b,cntContact:C,cntHalegen:y,cntPication:v,cntPistacking:_}),o+=this.getInteractionPerResidue(d,c,h,p,m,u,g,f,b,C,y,v,_);let S="";if(n.length>0){S+='',S+="
",S+="Residue # Hydrogen
Bond# Salt Bridge
/Ionic Interaction# Contact ",S+="# Halogen
Bond# π-Cation # π-Stacking ",S+="Hydrogen Bond (backbone atoms: @CA, @N, @C, @O) Salt Bridge/Ionic Interaction Contact ",S+="Halogen Bond π-Cation π-Stacking ";let e=' ",S+="",S+=o,S+=" ';S+=e,S+=e,S+='Atom1 Atom2 Distance(Å) Highlight in 3D ',S+=e,S+=e,S+=e,S+="Atom1 Atom2 # Contacts Min Distance(Å) C-alpha Distance(Å) Highlight in 3D
"}return{html:S,bondCnt:i}}getInteractionPerResidue(e,t,s,i,n,l,r,o,a,d,c,h,p){this.icn3d.icn3dui;let m="";m+=' ",m}getInteractionPairDetails(e,t,s){let i=this.icn3d;i.icn3dui;let n="",l=0,r=' ';if(void 0!==e)for(let a in e){let d=a.split(","),c="save1"==t?d[0]:d[1],h="save1"==t?d[1]:d[0],p=i.getGraphCls.convertLabel2Resid(c),m=i.firstAtomObjCls.getFirstAtomObj(i.residues[p]),u=m.color?m.color.getHexString():"",g=i.getGraphCls.convertLabel2Resid(h),f=i.firstAtomObjCls.getFirstAtomObj(i.residues[g]),b=f.color?f.color.getHexString():"",C=Math.sqrt(e[a]).toFixed(1);n+=''+e[3]+e[2]+" "+o+" "+a+" "+d+" "+c+" "+h+" "+p+" ";let u=[t,s,i,n,l,r];for(let e in u){m+=' "}return m+="'+u[e]+"
",++l}return{html:n,cnt:l}}getContactPairDetails(e,t){let s=this.icn3d;s.icn3dui;let i="",n=0,l=' ';if(void 0!==e)for(let o in e){let a=o.split(","),d="save1"==t?a[0]:a[1],c="save1"==t?a[1]:a[0],h=s.getGraphCls.convertLabel2Resid(d),p=s.firstAtomObjCls.getFirstAtomObj(s.residues[h]),m=p.color?p.color.getHexString():"",u=s.getGraphCls.convertLabel2Resid(c),g=s.firstAtomObjCls.getFirstAtomObj(s.residues[u]),f=g.color?g.color.getHexString():"",b=e[o].split("_"),C=b[0],y=b[1],v=b[2],_=b[3],w=b[4];i+=' '+c+r+u+o+' '+h+r+b+o+' '+C+" ",n+='',n+=" ",n+=parseInt(w)}return{html:i,cnt:n}}exportInteractions(){var e=this.icn3d,t=e.icn3dui;let s=' '+d+"@"+v+l+m+r+' '+c+"@"+_+l+f+r+' '+w+' '+C+' '+y+" ",i+='',i+="
Interacting residues: ';for(let t in e.chainname2residues)for(let i in e.chainname2residues[t]){let n=t.substr(0,t.indexOf("_"))+"_"+i.substr(0,i.indexOf(" "));s+="Base Chain: Residues Interacting Chain "}s+=""+t+": ",s+=e.resid2specCls.residueids2spec(e.chainname2residues[t][i]),s+=" "+n+" "+n[e]+" Cys "+n[e+1]+" Cys ",++i}}let n='
'+i+" disulfide pairs: ";n+=s,n+="Residue ID 1 Residue ID 2 "+r+" "+t.resn+" "+o+" "+n.resn+" ",++i}n[r+"_"+o]=1,n[o+"_"+r]=1}}let l='
'+i+" cross-linkage pairs: ";l+=s,l+="Residue ID 1 Residue ID 2 ",++l}}let a=' '+t+r+d+o+' '+i+r+h+o+' '+p+" ","view"==e&&(n+=''),n+="
'+l+" hydrogen bond pairs (backbone atoms: @CA, @N, @C, @O):
";if(l>0&&(a+=" ",a+=n,a+="Atom 1 Atom 2 Distance(Å) ","view"==e&&(a+='Highlight in 3D '),a+="
"),"graph"==e||"linegraph"==e||"scatterplot"==e){return s.getGraphCls.getGraphLinks(s.resid2ResidhashHbond,s.resid2ResidhashHbond,i.htmlCls.hbondColor,t,i.htmlCls.hbondValue)}return a}exportSaltbridgePairs(e,t){var s=this.icn3d,i=s.icn3dui;let n="",l=0,r=' ';for(let t in s.resid2ResidhashSaltbridge){let i=s.getGraphCls.convertLabel2Resid(t),a=s.firstAtomObjCls.getFirstAtomObj(s.residues[i]),d=a.color?a.color.getHexString():"";for(let i in s.resid2ResidhashSaltbridge[t]){let a=s.getGraphCls.convertLabel2Resid(i),c=s.firstAtomObjCls.getFirstAtomObj(s.residues[a]),h=c.color?c.color.getHexString():"",p=Math.sqrt(s.resid2ResidhashSaltbridge[t][i]).toFixed(1);n+=' ",++l}}let a=' '+t+r+d+o+' '+i+r+h+o+' '+p+" ","view"==e&&(n+=''),n+="
'+l+" salt bridge/ionic interaction pairs:
";if(l>0&&(a+=" ",a+=n,a+="Atom 1 Atom 2 Distance(Å) ","view"==e&&(a+='Highlight in 3D '),a+="
"),"graph"==e||"linegraph"==e||"scatterplot"==e){return s.getGraphCls.getGraphLinks(s.resid2ResidhashSaltbridge,s.resid2ResidhashSaltbridge,i.htmlCls.ionicColor,t,i.htmlCls.ionicValue)}return a}exportHalogenPiPairs(e,t,s){var i=this.icn3d,n=i.icn3dui;let l,r,o,a="",d=0,c=' ';"halogen"==s?(l=i.resid2ResidhashHalogen,r=n.htmlCls.halogenColor,o=n.htmlCls.halogenValue):"pi-cation"==s?(l=i.resid2ResidhashPication,r=n.htmlCls.picationColor,o=n.htmlCls.picationValue):"pi-stacking"==s&&(l=i.resid2ResidhashPistacking,r=n.htmlCls.pistackingColor,o=n.htmlCls.pistackingValue);for(let t in l){let n=i.getGraphCls.convertLabel2Resid(t),r=i.firstAtomObjCls.getFirstAtomObj(i.residues[n]),o=r.color?r.color.getHexString():"";for(let n in l[t]){let r=i.getGraphCls.convertLabel2Resid(n),p=i.firstAtomObjCls.getFirstAtomObj(i.residues[r]),m=p.color?p.color.getHexString():"",u=Math.sqrt(l[t][n]).toFixed(1);a+=' ",++d}}let p=' '+t+c+o+h+' '+n+c+m+h+' '+u+" ","view"==e&&(a+=''),a+="
'+d+" "+s+" pairs:
";if(d>0&&(p+=" ",p+=a,p+="Atom 1 Atom 2 Distance(Å) ","view"==e&&(p+='Highlight in 3D '),p+="
"),"graph"==e||"linegraph"==e||"scatterplot"==e){return i.getGraphCls.getGraphLinks(l,l,r,t,o)}return p}exportSpherePairs(e,t,s){var i=this.icn3d,n=i.icn3dui;let l="",r=0,o=e?i.resid2ResidhashInteractions:i.resid2ResidhashSphere,a=' ';for(let s in o){let n=i.getGraphCls.convertLabel2Resid(s),c=i.firstAtomObjCls.getFirstAtomObj(i.residues[n]),h=c.color?c.color.getHexString():"";for(let n in o[s]){let p=i.getGraphCls.convertLabel2Resid(n),m=i.firstAtomObjCls.getFirstAtomObj(i.residues[p]),u=m.color?m.color.getHexString():"",g=o[s][n].split("_"),f=g[0],b=g[1];c=g[2],m=g[3];let C=g[4];e?(l+=' "):l+=" '+s+"@"+c+a+h+d+' '+n+"@"+m+a+u+d+' '+C+' '+f+' '+b+" ","view"==t&&(l+=''),l+=" ",++r}}let c='"+s+" "+n+' '+C+' '+f+' '+b+"
'+r+" residue pairs in "+(e?"the contacts":"sphere")+":
";if(r>0&&(e?(c+=' "):c+='Residue 1 Residue 2 Num Contacts Min Distance(Å) C-alpha Distance(Å) ',"view"==t&&(c+='Highlight in 3D '),c+=" ',c+=l,c+="Residue 1 Residue 2 Num Contacts Min Distance(Å) C-alpha Distance(Å)
"),"graph"==t||"linegraph"==t||"scatterplot"==t||"calpha"==t||"cbeta"==t||"heavyatoms"==t){return i.getGraphCls.getGraphLinks(o,o,n.htmlCls.contactColor,s,n.htmlCls.contactValue)}return c}}class $t{constructor(e){this.icn3d=e}drawGraph(e,t){var s=this.icn3d,i=s.icn3dui;if(void 0===n)var n=d3;var l=JSON.parse(e),r=$("#"+t).width(),o=$("#"+t).height(),a=isNaN(r)?300:1*r,d=isNaN(o)?300:1*o,c=r,h=o,p=d3.select("#"+i.svgid).attr("width",r).attr("height",o).attr("viewBox","0,0,"+a+","+d);p.selectAll(".g-main").remove();var m=p.append("g").classed("g-main",!0),u=m.append("rect").attr("width",c).attr("height",h).style("fill","#FFF"),g=m.append("g"),f=n.zoom().on("zoom",(function(){g.attr("transform",n.event.transform)}));if(m.call(f),l.links){for(var b=[],C={},y=0,v=l.nodes.length;y
",i+="",g+="}\n",t){n.alignerrormapStr=g,$("#"+n.pre+"alignerrormapDiv").html(i);let e=$("#"+l.alignerrormapid+"_scale").val();$("#"+l.alignerrormapid).attr("width",(n.alignerrormapWidth*parseFloat(e)).toString()+"px")}else n.contactmapStr=g,$("#"+n.pre+"contactmapDiv").html(i);return i}}class Bt{constructor(e){this.icn3d=e}async downloadAlignment(e,t){let s=this.icn3d,i=s.icn3dui,n=this;s.opts.proteins="c alpha trace";let l=e.split(","),r="ids="+e,o=i.htmlCls.baseUrl+"vastplus/vastplus.cgi?v=3&cmd=c&b=1&s=1&w3d&"+r;void 0!==i.cfg.inpara&&(o+=i.cfg.inpara),s.pdbid_chain2title={},void 0===s.chainids2resids&&(s.chainids2resids={});let a={},d="These two MMDB IDs "+l+' do not have 3D alignment data in the VAST+ database. You can try the VAST alignment by visiting the VAST+ page https://www.ncbi.nlm.nih.gov/Structure/vastplus/vastplus.cgi?uid=[PDB ID] (e.g., uid=1KQ2), and clicking "Original VAST"',c=await i.getAjaxPromise(o,"jsonp",!0,d);if(a=c.seqalign,void 0===a)return alert(d),!1;s.pdbid_molid2chain={},s.chainsColor={};for(let e=0,t=2;e5){let s=!0,i=!0;c=await r.pdbParserCls.loadPdbData(t[e],l,!1,s,"query",h,i)}else{let s=!0;c=await r.mmdbParserCls.parseMmdbData(t[e],"query",i[e+1],e,h,s)}d=o.hashUtilsCls.unionHash(d,c)}if(o.cfg.resnum)await r.realignParserCls.realignChainOnSeqAlign(s,i);else if(o.cfg.resdef)await r.realignParserCls.realignChainOnSeqAlign(s,i,void 0,!0);else{await r.pdbParserCls.applyCommandDssp(!0);for(let e in r.pdbChainIndexHash){let t=r.pdbChainIndexHash[e].split("_");l=t[0],t[1],n=t[2],t[3],a.transformStructure(l,e-1,"query")}let e=[],t=[],c=[],h=o.htmlCls.baseUrl+"vastdyn/vastdyn.cgi",p=o.htmlCls.baseUrl+"tmalign/tmalign.cgi";for(let s in r.afChainIndexHash){let i=r.afChainIndexHash[s].split("_");l=i[0];let a=i[1];n=i[2];let d,m=i[3];if("tmalign"!=o.cfg.aligntool){let e={domains1:r.domain3dCls.getDomainJsonForAlign(r.chains[l+"_"+a]),domains2:r.domain3dCls.getDomainJsonForAlign(r.chains[n+"_"+m])};d=o.getAjaxPostPromise(h,e)}else{let e={pdb_query:r.saveFileCls.getAtomPDB(r.chains[l+"_"+a]),pdb_target:r.saveFileCls.getAtomPDB(r.chains[n+"_"+m])};d=o.getAjaxPostPromise(p,e)}e.push(d),t.push(s-1),c.push(l)}let m=Promise.allSettled(e),u=await m;await a.downloadChainalignmentPart2b(s,i,d,u,t,n,c)}}async downloadChainalignmentPart2b(e,t,s,i,n,l,r){let o=this.icn3d,a=o.icn3dui;for(let e=0,t=i.length;e
",r.tmscore=e[0].score.toPrecision(4)),$("#"+r.pre+"dl_rmsd_html").html(n),o.cfg.bSidebyside||o.htmlCls.dialogCls.openDlg("dl_rmsd","RMSD of alignment"),a=!0}return a}async loadOpmDataForChainalign(e,t,s,i){let n=this.icn3d,l=n.icn3dui,r=this;if(l.cfg.resnum||l.cfg.resdef)n.bCommandLoad||n.init(),await this.downloadChainalignmentPart2(e,t,void 0,s);else{let o=l.htmlCls.baseUrl+"vastdyn/vastdyn.cgi?mmdbids2opm="+i.join("','"),a=await l.getAjaxPromise(o,"jsonp");if(a&&a.mmdbid){let i=a.mmdbid;n.selectedPdbid=i;let o="https://opm-assets.storage.googleapis.com/pdb/"+i.toLowerCase()+".pdb",d=await l.getAjaxPromise(o,"text");n.bOpm=!0;let c=!0,h=n.loadPDBCls.loadPDB(d,i,n.bOpm,c);$("#"+n.pre+"selectplane_z1").val(n.halfBilayerSize),$("#"+n.pre+"selectplane_z2").val(-n.halfBilayerSize),$("#"+n.pre+"extra_mem_z").val(n.halfBilayerSize),$("#"+n.pre+"intra_mem_z").val(-n.halfBilayerSize),n.bCommandLoad||n.init(),await r.downloadChainalignmentPart2(e,t,h,s)}else n.bCommandLoad||n.init(),await r.downloadChainalignmentPart2(e,t,void 0,s)}}async downloadMmdbAf(e,t,s){let i=this.icn3d,n=i.icn3dui;i.structArray=i.structures?Object.keys(i.structures):[],0==i.structArray.length?i.init():(i.resetConfig(),i.bResetAnno=!0,i.bResetSets=!0);let l=e.split(","),r=[];for(let e=0,t=l.length;e1&&($("#"+i.pre+"assemblyWrapper").show(),i.asuCnt=i.biomtMatrices.length);let d,c,h,p,m,u,g,f,b,C,y,v,_,w,S,A,x,k,O,R={},I=[],T="coil",E="",P=0,M=0,D={onModel:function(e){d=0===e.modelIndex?a:a+(e.modelIndex+1).toString()},onChain:function(e){c=e.chainName;let t=d+"_"+c;void 0===i.structures[d]&&(i.structures[d]=[]),i.structures[d].push(t)},onGroup:function(e){h=e.groupName,p=e.groupId;let t=d+"_"+c+"_"+p;m=0===e.secStruct||2===e.secStruct||4===e.secStruct?"helix":3===e.secStruct?"sheet":-1===e.secStruct?"other":"coil";let s=!1;if(c!==E){if(x=void 0,O=void 0,"coil"!==m&&"other"!==m?(u=!0,g=!1):(u=!1,g=!1),"coil"!==T&&"other"!==T){let e=d+"_"+E+"_"+P.toString();for(let t in i.residues[e])i.atoms[t].ssbegin=!1,i.atoms[t].ssend=!0}}else x=A,O=k,m!==T?"coil"===T||"other"===T?(u=!0,g=!1):"coil"===m||"other"===m?(s=!0,u=!1,g=!1):("sheet"===T&&"helix"===m||"helix"===T&&"sheet"===m)&&(s=!0,u=!0,g=!1):(u=!1,g=!1);if(s&&!isNaN(p)){let e=d+"_"+c+"_"+(p-1).toString();for(let t in i.residues[e])i.atoms[t].ssbegin=!1,i.atoms[t].ssend=!0}T=m,E=c,P=p,f=!1,b=!1,C=!1,"non-polymer"===e.chemCompType.toLowerCase()||"other"===e.chemCompType.toLowerCase()||-1!==e.chemCompType.toLowerCase().indexOf("saccharide")?f=!0:-1!==e.chemCompType.toLowerCase().indexOf("peptide")?b=!0:-1!==e.chemCompType.toLowerCase().indexOf("dna")||-1!==e.chemCompType.toLowerCase().indexOf("rna")?C=!0:b=!0;let l=d+"_"+c,r={};r.resi=p,r.name=n.utilsCls.residueName2Abbr(h),i.residueId2Name[t]=r.name,r.resi%10==0&&r.resi.toString();let o="-";"helix"===m?o="H":"sheet"===m?o="E":"coil"===m?o="c":"other"===m&&(o="o"),void 0===i.chainsSeq[l]&&(i.chainsSeq[l]=[]),i.bFullUi&&i.chainsSeq[l].push(r),i.secondaries[t]=o},onAtom:function(e){if(y=e.element,v=e.atomName,_=new THREE.Vector3(e.xCoord,e.yCoord,e.zCoord),w=e.bFactor,S=e.altLoc,"\0"===e.altLoc&&(S=""),""===S||"A"===S){++M,"SG"===v&&I.push(M),R[e.atomIndex]=M;let t={het:f,serial:M,name:v,alt:S,resn:h,structure:d,chain:c,resi:p,coord:_,b:w,elem:y,bonds:[],bondOrder:[],ss:m,ssbegin:u,ssend:g};if(t.het||"C"!==t.name||(A=M),t.het||"O"!==t.name||(k=M),!t.het&&"N"===t.name&&void 0!==x&&void 0!==O){let e=i.atoms[x].coord.distanceTo(i.atoms[O].coord),s=t.coord.x+(i.atoms[x].coord.x-i.atoms[O].coord.x)/e,n=t.coord.y+(i.atoms[x].coord.y-i.atoms[O].coord.y)/e,l=t.coord.z+(i.atoms[x].coord.z-i.atoms[O].coord.z)/e;t.hcoord=new THREE.Vector3(s,n,l)}i.atoms[M]=t,l.min(_),r.max(_),o.add(_);let a=d+"_"+c,T=a+"_"+p;void 0===i.chains[a]&&(i.chains[a]={}),i.chains[a][M]=1,void 0===i.residues[T]&&(i.residues[T]={}),i.residues[T][M]=1,b?(i.proteins[M]=1,"CA"===v&&(i.calphas[M]=1),"N"!==v&&"H"!==v&&"CA"!==v&&"HA"!==v&&"C"!==v&&"O"!==v&&(i.sidec[M]=1)):C?(i.nucleotides[M]=1,(!s||"O3'"!=v&&"O3*"!=v)&&(s||"P"!=v)||(i.nucleotidesO3[M]=1),-1===n.parasCls.nuclMainArray.indexOf(v)&&(i.ntbase[M]=1)):y.toLowerCase()===h.toLowerCase()?i.ions[M]=1:"HOH"===h||"WAT"===h||"SQL"===h||"H2O"===h||"W"===h||"DOD"===h||"D3O"===h?i.water[M]=1:i.chemicals[M]=1,i.dAtoms[M]=1,i.hAtoms[M]=1}},onBond:function(e){let t=R[e.atomIndex1],s=R[e.atomIndex2];if(R.hasOwnProperty(e.atomIndex1)&&R.hasOwnProperty(e.atomIndex2)&&(i.atoms[t].bonds.push(s),i.atoms[s].bonds.push(t),f)){let n=e.bondOrder;i.atoms[t].bondOrder.push(n),i.atoms[s].bondOrder.push(n),2===n?(i.doublebonds[t+"_"+s]=1,i.doublebonds[s+"_"+t]=1):3===n&&(i.triplebonds[t+"_"+s]=1,i.triplebonds[s+"_"+t]=1)}}};MMTF.traverse(e,D),i.loadPDBCls.setResidMapping();for(let e=0,t=I.length;e5){let e=r.cfg.chainalign.split(",");e.length>0&&(l.hAtoms=l.definedSetsCls.getAtomsFromNameArray(e)),r.cfg.aligntool="tmalign",await l.realignParserCls.realignOnStructAlign()}else l.hAtoms=l.chainalignParserCls.setMsa(e),l.transformCls.zoominSelection(),await l.chainalignParserCls.downloadChainalignmentPart3(void 0,e,l.hAtoms)}async parseChainRealignData(e,t,s,i,n,l,r){let o=this.icn3d,a=o.icn3dui,d=s[0].substr(0,s[0].indexOf("_"));r||(d=d.toUpperCase());let c={};o.realignResid={},o.opts.color="grey",o.setColorCls.setColorByOptions(o.opts,o.dAtoms),o.qt_start_end=[];for(let t=0,h=e.length;t9||s<0)return n*i|0;i=10*i+s|0}return n*i}function u(e,t,s){let i=1,n=0,l=0,r=1;for(45===e.charCodeAt(t)&&(i=-1,++t);t=0&&o<10)){if(-2===o){for(++t;t=0&&o<10))return 53===o||21===o?parseScientific(i*(n+l/r),e,t+1,s):i*(n+l/r);l=10*l+o,r*=10,++t}return i*(n+l/r)}if(53===o||21===o)return parseScientific(i*n,e,t+1,s);break}n=10*n+o,++t}return i*n}let g=function(){function e(e){this.data=e,this.isDefined=!0}return e.prototype.getString=function(e){return""+this.data[e]},e.prototype.getInteger=function(e){return 0|this.data[e]},e.prototype.getFloat=function(e){return 1*this.data[e]},e.prototype.stringEquals=function(e,t){return this.data[e]===u(t,0,t.length)},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return 0},e}(),f=function(){function e(e,t){this.data=e,this.mask=t,this.isDefined=!0}return e.prototype.getString=function(e){return 0===this.mask[e]?""+this.data[e]:null},e.prototype.getInteger=function(e){return 0===this.mask[e]?this.data[e]:0},e.prototype.getFloat=function(e){return 0===this.mask[e]?this.data[e]:0},e.prototype.stringEquals=function(e,t){return 0===this.mask[e]?this.data[e]===u(t,0,t.length):null==t},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return this.mask[e]},e}(),b=function(){function e(e){this.data=e,this.isDefined=!0}return e.prototype.getString=function(e){return this.data[e]},e.prototype.getInteger=function(e){let t=this.data[e];return m(t,0,t.length)},e.prototype.getFloat=function(e){let t=this.data[e];return u(t,0,t.length)},e.prototype.stringEquals=function(e,t){return this.data[e]===t},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return 0},e}(),C=function(){function e(e,t){this.data=e,this.mask=t,this.isDefined=!0}return e.prototype.getString=function(e){return 0===this.mask[e]?this.data[e]:null},e.prototype.getInteger=function(e){if(0!==this.mask[e])return 0;let t=this.data[e];return m(t||"",0,(t||"").length)},e.prototype.getFloat=function(e){if(0!==this.mask[e])return 0;let t=this.data[e];return u(t||"",0,(t||"").length)},e.prototype.stringEquals=function(e,t){return this.data[e]===t},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return this.mask[e]},e}(),y=function(){function e(e){this.dataBlocks=e.dataBlocks.map((function(e){return new i(e)}))}return e.prototype.toJSON=function(){return this.dataBlocks.map((function(e){return e.toJSON()}))},e}();return new y(s)}MessagePackParse(e){this.icn3d.icn3dui;let t=this;function s(e,s){let i={};for(let n=0;n0&&(i[i.length]=l.slice(0,a).join(""));return i.join("")}(e.buffer,e.offset,t);return e.offset+=t,s}let r=function(){let e=[];for(let t=0;t<1024;t++)e[t]=String.fromCharCode(t);return e}();let o,a,d=e.buffer[e.offset];if(0==(128&d))return e.offset++,d;if(128==(240&d))return a=15&d,e.offset++,s(e,a);if(144==(240&d))return a=15&d,e.offset++,n(e,a);if(160==(224&d))return a=31&d,e.offset++,l(e,a);if(224==(224&d))return o=e.dataView.getInt8(e.offset),e.offset++,o;switch(d){case 192:return e.offset++,null;case 194:return e.offset++,!1;case 195:return e.offset++,!0;case 196:return a=e.dataView.getUint8(e.offset+1),e.offset+=2,i(e,a);case 197:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,i(e,a);case 198:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,i(e,a);case 202:return o=e.dataView.getFloat32(e.offset+1),e.offset+=5,o;case 203:return o=e.dataView.getFloat64(e.offset+1),e.offset+=9,o;case 204:return o=e.buffer[e.offset+1],e.offset+=2,o;case 205:return o=e.dataView.getUint16(e.offset+1),e.offset+=3,o;case 206:return o=e.dataView.getUint32(e.offset+1),e.offset+=5,o;case 208:return o=e.dataView.getInt8(e.offset+1),e.offset+=2,o;case 209:return o=e.dataView.getInt16(e.offset+1),e.offset+=3,o;case 210:return o=e.dataView.getInt32(e.offset+1),e.offset+=5,o;case 217:return a=e.dataView.getUint8(e.offset+1),e.offset+=2,l(e,a);case 218:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,l(e,a);case 219:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,l(e,a);case 220:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,n(e,a);case 221:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,n(e,a);case 222:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,s(e,a);case 223:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,s(e,a)}}}class ss{constructor(e){this.icn3d=e}alignCoords(e,t,s,i,n,l,r,o){let a,d=this.icn3d,c=d.icn3dui,h=e.length
Realignment RMSD: "+a.toPrecision(4)+" Å
";d.bAfMem&&!c.cfg.chainalign&&(e+=c.utilsCls.getMemDesc()),$("#"+d.pre+"dl_rmsd_html").html(e),c.cfg.bSidebyside||c.htmlCls.dialogCls.openDlg("dl_rmsd","Realignment RMSD")}let r={};for(let n=0,l=d.structures[s].length;n
"+t.diagram2dCls.set2DdgmNote(),$("#"+t.pre+"dl_2ddgm_html").html(t.html2ddgm)),t.b2DShown=!0}showLoading(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"wait")&&$("#"+e.pre+"wait").show(),$("#"+e.pre+"canvas")&&$("#"+e.pre+"canvas").hide(),$("#"+e.pre+"cmdlog")&&$("#"+e.pre+"cmdlog").hide()}hideLoading(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"wait")&&$("#"+e.pre+"wait").hide(),$("#"+e.pre+"canvas")&&$("#"+e.pre+"canvas").show(),$("#"+e.pre+"cmdlog")&&$("#"+e.pre+"cmdlog").show()}setYourNote(e){let t=this.icn3d,s=t.icn3dui;t.yournote=e,$("#"+t.pre+"yournote").val(t.yournote),s.cfg.shownote&&(document.title=t.yournote)}transformToOpmOri(e){let t=this.icn3d;if(t.icn3dui,void 0!==t.rmsd_supr&&void 0!==t.rmsd_supr.rot){let s=t.rmsd_supr.rot,i=t.rmsd_supr.trans1,n=t.rmsd_supr.trans2;t.rmsd_supr.rmsd;let l=0;for(let e in t.atoms){let r=t.atoms[e];r.coord=t.surfaceCls.transformMemPro(r.coord,s,i,n);let o=r.coord.x*r.coord.x+r.coord.y*r.coord.y;Math.abs(r.coord.z)<=25&&o>l&&(l=o)}this.addMemAtoms(t.halfBilayerSize,e,Math.sqrt(l)),t.bStopRotate=!0,t.bOpm=!0,$("#"+t.pre+"togglememli").show(),$("#"+t.pre+"adjustmemli").show(),$("#"+t.pre+"selectplaneli").show()}else t.bOpm=!1}transformToOpmOriForAlign(e,t,s){let i=this.icn3d,n=i.icn3dui;if(void 0!==t){let l=i.loadPDBCls.getChainCalpha(i.chains,i.atoms,s,e),r=1==Object.keys(l.chainresiCalphaHash).length||1==Object.keys(t.chainresiCalphaHash).length,o=[],a=[];for(let e in l.chainresiCalphaHash)if(t.chainresiCalphaHash.hasOwnProperty(e)){let s=l.chainresiCalphaHash[e],i=t.chainresiCalphaHash[e];if((s.length==i.length||r)&&(o=o.concat(s),a=a.concat(i)),o.length>500)break}let d=o.length=2?$("#"+e.pre+"mn2_alternateWrap").show():$("#"+e.pre+"mn2_alternateWrap").hide(),setTimeout((async function(){if(e.bInitial){if(void 0!==t.cfg.align||void 0!==t.cfg.chainalign){let s=e.pre+"selection";if($("#"+s).show(),$("#"+s+"_expand").hide(),$("#"+s+"_shrink").show(),void 0!==t.cfg.align&&2!=t.cfg.atype){let s=!1,i=t.htmlCls.alignSeqCls.getAlignSequencesAnnotations(Object.keys(e.alnChains),void 0,void 0,s);$("#"+e.pre+"dl_sequence2").html(i.sequencesHtml),$("#"+e.pre+"dl_sequence2").width(t.htmlCls.RESIDUE_WIDTH*i.maxSeqCnt+200)}}if(t.cfg.showanno){let s="view annotations";t.htmlCls.clickMenuCls.setLogCmd(s,!0),await e.showAnnoCls.showAnnotations()}(t.cfg.closepopup||t.cfg.imageonly)&&e.resizeCanvasCls.closeDialogs()}else e.hlUpdateCls.updateHlAll();$("#"+e.pre+"atomsCustom").length>0&&$("#"+e.pre+"atomsCustom")[0].blur(),e.bInitial=!1,t.cfg.imageonly&&e.saveFileCls.saveFile(void 0,"png",void 0,!0)}),0)}processCommand(){let e=this.icn3d,t=e.icn3dui;if(1==Object.keys(e.structures).length){let s=Object.keys(e.structures)[0];t.cfg.command=t.cfg.command.replace(new RegExp("!","g"),s+"_")}}getMassCenter(e,t){return this.icn3d.icn3dui,e.multiplyScalar(1/t)}getGeoCenter(e,t){return this.icn3d.icn3dui,e.clone().add(t).multiplyScalar(.5)}getStructureSize(e,t,s,i){let n=this.icn3d;n.icn3dui;let l=0;for(let r in e){let e=n.atoms[r].coord;if(Math.round(t.x)==Math.round(e.x)||Math.round(t.y)==Math.round(e.y)||Math.round(t.z)==Math.round(e.z)||Math.round(s.x)==Math.round(e.x)||Math.round(s.y)==Math.round(e.y)||Math.round(s.z)==Math.round(e.z)){let t=2*e.distanceTo(i);t>l&&(l=t)}}return l}async checkMemProteinAndRotate(){let e=this.icn3d,t=e.icn3dui;if(!e.bCheckMemProtein){e.bCheckMemProtein=!0;let s=t.cfg.afid?t.cfg.afid:t.cfg.mmdbafid;if(await e.ParserUtilsCls.checkMemProtein(s),t.cfg.url&&-1!=t.cfg.url.indexOf("membranome")){let t=new THREE.Vector3(1,0,0),s=-.5*Math.PI;e.transformCls.setRotation(t,s)}}}async checkMemProtein(e){let t=this.icn3d,s=t.icn3dui;try{let i=s.htmlCls.baseUrl+"vastdyn/vastdyn.cgi?afid2mem="+e,n=await s.getAjaxPromise(i,"jsonp");if(n&&n.pdbid){let e='This is a single-spanning (bitopic) transmembrane protein according to the Membranome database. Do you want to align the protein with the model from Membranome? If you click "OK", you can press the letter "a" to alternate the structures.';if("off"==s.cfg.afmem);else if("on"==s.cfg.afmem||confirm(e))try{let e="https://storage.googleapis.com/membranome-assets/pdb_files/proteins/"+n.pdbid+".pdb",i=await s.getAjaxPromise(e,"text");t.bAfMem=!0,s.bNode||$("#"+s.pre+"togglememli").show();let l=n.pdbid.substr(0,n.pdbid.indexOf("_")),r=!0,o=!0;await t.pdbParserCls.loadPdbData(i,l,r,o),o&&(t.bSetChainsAdvancedMenu&&t.definedSetsCls.showSets(),t.bAnnoShown&&await t.showAnnoCls.showAnnotations());let a=n.segment.replace(/ /gi,"").split("(")[0];t.afmem_start_end=a.split("-"),t.hAtoms={},t.dAtoms={};for(let e in t.atoms)t.atoms[e].structure!=l&&(t.hAtoms[e]=1),t.dAtoms[e]=1;for(let e=parseInt(t.afmem_start_end[0]);e<=parseInt(t.afmem_start_end[1]);++e)t.hAtoms=s.hashUtilsCls.unionHash(t.hAtoms,t.residues[l+"_A_"+e]);await t.realignParserCls.realignOnSeqAlign(l)}catch(e){return void console.log("Error in retrieving matched PDB from Membranome...")}}}catch(e){return void console.log("Error in finding matched PDB in Membranome...")}}getResi(e,t){let s=this.icn3d;s.icn3dui;let i=s.ncbi2resid[e+"_"+(t+1).toString()];return i?i.substr(i.lastIndexOf("_")+1):""}getResiNCBI(e,t){let s=this.icn3d;s.icn3dui;let i=s.resid2ncbi[e+"_"+t];return i?parseInt(i.substr(i.lastIndexOf("_")+1)):0}}class is{constructor(e){this.icn3d=e}loadAtomDataIn(e,t,s,i,n,l,r,o,a){let d=this.icn3d,c=d.icn3dui;d.pmin=new THREE.Vector3(9999,9999,9999),d.pmax=new THREE.Vector3(-9999,-9999,-9999),d.psum=new THREE.Vector3;let h=e.atoms,p=d.atoms?Object.keys(d.atoms).length:0,m={},u={};d.pmid=e.pubmedId,void 0===d.chainid2title&&(d.chainid2title={}),void 0===d.chainid2sid&&(d.chainid2sid={});let g={},f={};if("align"===s){d.pmid="",d.molTitle="",c.cfg.inpara&&-1!==c.cfg.inpara.indexOf("atype=1")?d.molTitle="Invariant Core Structure Alignment (VAST) of ":c.cfg.inpara&&-1!==c.cfg.inpara.indexOf("atype=2")?d.molTitle="Structure Alignment (TM-align) of ":d.molTitle="Structure Alignment (VAST) of ";let t=!1;for(let s=0,i=e.alignedStructures[0].length;s'+i.pdbId.toUpperCase()+"",void 0!==i.descr&&(d.pmid+=i.descr.pubmedid),0===s&&(d.molTitle+=" and ",void 0!==i.descr&&(d.pmid+="_")),t=!0}d.molTitle+=" from VAST+",t||(d.molTitle="")}else if(void 0!==e.descr&&(d.molTitle+=e.descr.name),"mmdbid"===s){let s=isNaN(t)?t:e.pdbId,i={};void 0===d.alignmolid2color&&(d.alignmolid2color=[]);let n=1;for(let t in e.moleculeInfor){if(0===Object.keys(e.moleculeInfor[t]).length)continue;let l=e.moleculeInfor[t].chain.trim();(parseInt(c.cfg.date)>=20231001||!c.cfg.date&&parseInt(c.utilsCls.getDateDigitStr())>=20231001)&&(l=l.replace(/_/g,""));let r=s+"_"+l;i.hasOwnProperty(l)?(++i[l],r+=i[l]):i[l]=1,void 0!==d.mmdbid_q&&(d.mmdbid_q,d.mmdbid_t);let o=e.moleculeInfor[t].kind,a=e.moleculeInfor[t].color,h=e.moleculeInfor[t].sid;if(g[r]=o,f[r]=a,"protein"==o&&(d.organism=e.moleculeInfor[t].taxonomyName.toLowerCase()),void 0!==h&&(d.chainid2sid[r]=h),void 0===d.pdbid_chain2title&&(d.pdbid_chain2title={}),d.pdbid_chain2title[r]=e.moleculeInfor[t].name,l==r.substr(r.lastIndexOf("_"))){let e={};e[t]=n.toString(),d.alignmolid2color.push(e)}++n}}"mmdbid"===s&&(d.molTitleHash||(d.molTitleHash={}),d.molTitleHash[t]=d.molTitle);let b,C,y,v,_,w={},S="",A="",x="",k="",O="",R="",I=0,T=0,E="",P=!0,M=!1,D="",H=c.utilsCls.isCalphaPhosOnly(h),F=0,L={};for(let e in h){++p,w[e]=p;let i,n=h[e];n.serial=p,"mmdbid"===s||"mmcifid"===s?i=t:"align"===s&&(i=m[p]);let l=!1;if(void 0!==n.chain||"mmdbid"!==s&&"align"!==s)n.chain=""===n.chain?"Misc":n.chain;else if("mmdbid"===s)if(b=n.ids.m,void 0!==d.molid2chain[b]){let e=d.molid2chain[b].indexOf("_");n.chain=d.molid2chain[b].substr(e+1)}else{let e="Misc";("protein"===g[O]&&"nucleotide"===g[O]&&n.resi!=T||"protein"!==g[O]&&"nucleotide"!==g[O]&&(n.resn.substr(0,3)!=E.substr(0,3)||n.resi!=T||"solvent"===g[O]||"HOH"===n.resn))&&++F,n.resi_ori=n.resi,n.resi=F,l=!0,n.chain=e}else if("align"===s)if(b=n.ids.m,void 0!==d.pdbid_molid2chain[i+"_"+b])n.chain=d.pdbid_molid2chain[i+"_"+b];else{let e="Misc";("protein"===g[O]&&"nucleotide"===g[O]&&n.resi!=T||"protein"!==g[O]&&"nucleotide"!==g[O]&&(n.resn.substr(0,3)!=E.substr(0,3)||n.resi!=T||"solvent"===g[O]||"HOH"===n.resn))&&(++F,n.resi_ori=n.resi,n.resi=F,l=!0),n.chain=e}if(n.chain=n.chain.trim(),(parseInt(c.cfg.date)>=20231001||!c.cfg.date&&parseInt(c.utilsCls.getDateDigitStr())>=20231001)&&(n.chain=n.chain.replace(/_/g,"")),"mmdbid"!==s&&"align"!==s||(n.structure=i,"mmdbid"===s&&void 0!==d.mmdbid_q&&(d.mmdbid_q,d.mmdbid_t)),k=n.structure,O=k+"_"+n.chain,"mmdbid"===s||"align"===s){l||(n.resi_ori=n.resi,d.bUsePdbNum?n.resi=n.resi_ori:n.resi=n.ids.r);let e=n.resn.indexOf(" ");-1!==e&&0!=e&&(n.resn=n.resn.substr(0,e))}O!==A&&(I=0),n.resi!==I&&(O!==A?(y=void 0,_=void 0):(y=C,_=v)),n.coord="mmdbid"===s?new THREE.Vector3(n.coord[0],n.coord[1],n.coord[2]):new THREE.Vector3(n.coord.x,n.coord.y,n.coord.z);let r=c.utilsCls.residueName2Abbr(n.resn.substr(0,3));"mmdbid"!==s&&"align"!==s||!d.bFullUi||(void 0===d.mmdbMolidResid2mmdbChainResi&&(d.mmdbMolidResid2mmdbChainResi={}),d.mmdbMolidResid2mmdbChainResi[i+"_"+n.ids.m+"_"+n.ids.r]=i+"_"+n.chain+"_"+n.resi),d.pmin.min(n.coord),d.pmax.max(n.coord),d.psum.add(n.coord);let o=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"protein"===g[O]:"p"===n.mt,a=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"nucleotide"===g[O]:"n"===n.mt,u=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"solvent"===g[O]:"s"===n.mt,N=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"ligand"===g[O]||void 0!==g[O]&&-1!==g[O].indexOf("other")||void 0===g[O]:"l"===n.mt;if("Misc"!==n.chain&&"other"!==g[O]||"protein"===L[O]||"nucleotide"===L[O]||("CA"===n.name&&"C"===n.elem?L[O]="protein":"P"===n.name&&"P"===n.elem?L[O]="nucleotide":L[O]="chemical"),o||a?(o?(d.proteins[p]=1,"CA"===n.name&&(d.calphas[p]=1),"N"!==n.name&&"H"!==n.name&&"CA"!==n.name&&"HA"!==n.name&&"C"!==n.name&&"O"!==n.name&&(d.sidec[p]=1)):a&&(d.nucleotides[p]=1,("O3'"==n.name||"O3*"==n.name||H&&"P"==n.name)&&(d.nucleotidesO3[p]=1),-1===c.parasCls.nuclMainArray.indexOf(n.name)&&(d.ntbase[p]=1)),n.het=!1):u?(d.water[p]=1,n.het=!0):N&&("HOH"===n.resn||"O"===n.resn?d.water[p]=1:n.elem===n.resn?d.ions[p]=1:d.chemicals[p]=1,n.het=!0),"mmdbid"===s?n.het?n.color=c.parasCls.atomColors[n.elem]||c.parasCls.defaultAtomColor:n.color=void 0!==f[O]?c.parasCls.thr(f[O]):c.parasCls.chargeColors[n.resn]:void 0!==n.color&&(n.color=c.parasCls.thr(n.color))," "!==n.resn.charAt(0)&&" "===n.resn.charAt(1)&&(n.resn=n.resn.charAt(0)),n.het||"C"!==n.name||(C=p),n.het||"O"!==n.name||(v=p),!n.het&&"N"===n.name&&void 0!==y&&void 0!==_){let e=d.atoms[y].coord.distanceTo(d.atoms[_].coord),t=n.coord.x+(d.atoms[y].coord.x-d.atoms[_].coord.x)/e,s=n.coord.y+(d.atoms[y].coord.y-d.atoms[_].coord.y)/e,i=n.coord.z+(d.atoms[y].coord.z-d.atoms[_].coord.z)/e;n.hcoord=new THREE.Vector3(t,s,i)}"HOH"==n.resn&&(d.water[p]=1),d.atoms[p]=n,d.dAtoms[p]=1,d.hAtoms[p]=1;let q=n.structure+"_"+n.chain;void 0===d.chains[q]&&(d.chains[q]={}),d.chains[q][p]=1;let U=q+"_"+n.resi;void 0===d.residues[U]&&(d.residues[U]={}),d.residues[U][p]=1,R=O+"_"+n.resi,R!==x&&O!==A&&(P=!0,""!==S&&(void 0===d.structures[S]&&(d.structures[S]=[]),d.structures[S].push(A))),d.residueId2Name[U]=r;let $="-";if("helix"===n.ss?$="H":"sheet"===n.ss?$="E":n.het||a?$="o":(!n.het&&c.parasCls.residueColors.hasOwnProperty(n.resn.toUpperCase())||"coil"===n.ss)&&($="c"),d.secondaries[n.structure+"_"+n.chain+"_"+n.resi]=$,(n.resi!=I||b!=D)&&d.bFullUi&&(void 0===d.chainsSeq[q]&&(d.chainsSeq[q]=[],P=!1),!isNaN(n.resi)))if(P&&!M&&void 0!==d.chainsSeq[q][n.resi-1])d.chainsSeq[q][n.resi-1].name=r;else if(!P||!d.chainsSeq[q].hasOwnProperty(n.resi-1)){let e={};e.resi=n.resi,e.name=r,n.resi%10==0&&n.resi.toString(),d.chainsSeq[q].push(e),M=!0}I=n.resi,T=n.resi_ori,E=n.resn,S=k,A=O,x=R,D=b}for(let e in d.chemicals){let t=d.atoms[e];if("P"==t.elem&&t.bonds.length>=4)for(let e=t.bonds.length-1;e>=0;--e){"P"==d.atoms[t.bonds[e]].elem&&t.bonds.splice(e,1)}}for(let e in L)if(!(Object.keys(d.chains[e]).length<10)&&"chemical"!==L[e])for(let t in d.chains[e]){let s=d.atoms[t];delete d.chemicals[t],s.het=!1,"protein"===L[e]?(d.proteins[t]=1,"CA"===s.name&&(d.calphas[t]=1),"N"!==s.name&&"H"!==s.name&&"CA"!==s.name&&"HA"!==s.name&&"C"!==s.name&&"O"!==s.name&&(d.sidec[t]=1)):"nucleotide"===L[e]&&(d.nucleotides[t]=1,("O3'"==s.name||"O3*"==s.name||H&&"P"==s.name)&&(d.nucleotidesO3[t]=1),-1===c.parasCls.nuclMainArray.indexOf(s.name)&&(d.ntbase[t]=1))}if(void 0===d.structures[k]&&(d.structures[k]=[]),d.structures[k].push(O),d.bFullUi)if("mmdbid"===s||"mmcifid"===s)for(let i in e.sequences){let n=e.sequences[i],l=t+"_"+i;void 0!==d.mmdbid_q&&(d.mmdbid_q,d.mmdbid_t),d.ParserUtilsCls.getMissingResidues(n,s,l)}else if("align"===s)for(let e in d.chainid2seq){let t=d.chainid2seq[e];d.ParserUtilsCls.getMissingResidues(t,s,e)}if(d.loadPDBCls.setResidMapping(),"mmcifid"!==s)for(let e in h){let t=w[e],s=void 0===d.atoms[t].bonds?0:d.atoms[t].bonds.length;for(let e=0;ed.maxatomcnt||void 0!==d.biomtMatrices&&d.biomtMatrices.length*d.cnt>10*d.maxatomcnt)&&(d.opts.proteins="c alpha trace",d.opts.nucleotides="o3 trace"),d.center=d.ParserUtilsCls.getGeoCenter(d.pmin,d.pmax),d.maxD=d.ParserUtilsCls.getStructureSize(d.atoms,d.pmin,d.pmax,d.center),d.maxD<5&&(d.maxD=5),d.oriMaxD=d.maxD,("align"===s||o)&&(d.ssbondpnts={},d.loadPDBCls.setSsbond()),"mmdbid"===s&&1==Object.keys(d.structures).length){let t=e.disulfides;if(void 0!==t)for(let e=0,s=t.length;ep&&(p=e)),c[e]={resi:t,resn:i,aligned:n}}r=e[t][1];let u=r.moleculeId,g=s.pdbid_molid2chain[l+"_"+u],f=l+"_"+g;void 0===s.alnChainsAnTtl[d]&&(s.alnChainsAnTtl[d]=[]),void 0===s.alnChainsAnTtl[d][0]&&(s.alnChainsAnTtl[d][0]=[]),void 0===s.alnChainsAnTtl[d][1]&&(s.alnChainsAnTtl[d][1]=[]),void 0===s.alnChainsAnTtl[d][2]&&(s.alnChainsAnTtl[d][2]=[]),void 0===s.alnChainsAnTtl[d][3]&&(s.alnChainsAnTtl[d][3]=[]),void 0===s.alnChainsAnTtl[d][4]&&(s.alnChainsAnTtl[d][4]=[]),void 0===s.alnChainsAnTtl[d][5]&&(s.alnChainsAnTtl[d][5]=[]),void 0===s.alnChainsAnTtl[d][6]&&(s.alnChainsAnTtl[d][6]=[]),s.alnChainsAnTtl[d][0].push(f),s.alnChainsAnTtl[d][1].push(d),s.alnChainsAnTtl[d][2].push(""),s.alnChainsAnTtl[d][3].push(""),s.alnChainsAnTtl[d][4].push(f),s.alnChainsAnTtl[d][5].push(d),s.alnChainsAnTtl[d][6].push("");let b=1;s.chainsMapping[d]||(s.chainsMapping[d]={}),s.chainsMapping[f]||(s.chainsMapping[f]={});for(let e=h;e<=p;++e){let t,o,p,m=s.bUsePdbNum?s.ParserUtilsCls.getResi(f,r.sequence[e][0]-1):r.sequence[e][0],u="~"===r.sequence[e][2]?"-":r.sequence[e][2],C=r.sequence[e][3]?1:0,y=c[e].aligned+C;2===y?(c[e].resn===u?(t="#FF0000",p="icn3d-cons",s.consHash1[d+"_"+c[e].resi]=1,s.consHash2[f+"_"+m]=1):(t="#0000FF",p="icn3d-ncons",s.nconsHash1[d+"_"+c[e].resi]=1,s.nconsHash2[f+"_"+m]=1),s.chainsMapping[d][d+"_"+c[e].resi]=c[e].resn+c[e].resi,s.chainsMapping[f][f+"_"+m]=c[e].resn+c[e].resi,o="#"+s.showAnnoCls.getColorhexFromBlosum62(c[e].resn,u)):(t=i.htmlCls.GREY8,p="icn3d-nalign",s.nalignHash1[d+"_"+c[e].resi]=1,s.nalignHash2[f+"_"+m]=1),void 0===s.alnChainsSeq[d]&&(s.alnChainsSeq[d]=[]);let v={};v.mmdbid=n,v.chain=a,v.resi=c[e].resi,v.resn=""===v.resi||"icn3d-nalign"===p?c[e].resn.toLowerCase():c[e].resn,v.aligned=y,v.color=""===v.resi?i.htmlCls.GREYC:t,v.color2=""===v.resi?i.htmlCls.GREYC:o,v.class=p,s.alnChainsSeq[d].push(v),""!==c[e].resi&&(void 0===s.alnChains[d]&&(s.alnChains[d]={}),$.extend(s.alnChains[d],s.residues[d+"_"+c[e].resi])),void 0===s.alnChainsSeq[f]&&(s.alnChainsSeq[f]=[]),v={},v.mmdbid=l,v.chain=g,v.resi=m,v.resn=""===v.resi||"icn3d-nalign"===p?u.toLowerCase():u,v.aligned=y,v.color=""===v.resi?i.htmlCls.GREYC:t,v.color2=""===v.resi?i.htmlCls.GREYC:o,v.class=p,s.alnChainsSeq[f].push(v),""!==v.resi&&(void 0===s.alnChains[f]&&(s.alnChains[f]={}),$.extend(s.alnChains[f],s.residues[f+"_"+m])),void 0===s.alnChainsAnno[d]&&(s.alnChainsAnno[d]=[]),void 0===s.alnChainsAnno[d][0]&&(s.alnChainsAnno[d][0]=[]),void 0===s.alnChainsAnno[d][1]&&(s.alnChainsAnno[d][1]=[]),void 0===s.alnChainsAnno[d][2]&&(s.alnChainsAnno[d][2]=[]),void 0===s.alnChainsAnno[d][3]&&(s.alnChainsAnno[d][3]=[]),e===h&&(void 0===s.alnChainsAnno[d][4]&&(s.alnChainsAnno[d][4]=[]),void 0===s.alnChainsAnno[d][5]&&(s.alnChainsAnno[d][5]=[]),void 0===s.alnChainsAnno[d][6]&&(s.alnChainsAnno[d][6]=[]),s.alnChainsAnno[d][4].push(s.pdbid_chain2title[f]),s.alnChainsAnno[d][5].push(s.pdbid_chain2title[d]),s.alnChainsAnno[d][6].push(""));let _=d+"_"+c[e].resi,w=f+"_"+m,S=s.secondaries[_],A=s.secondaries[w];A?s.alnChainsAnno[d][0].push(A):s.alnChainsAnno[d][0].push("-"),S?s.alnChainsAnno[d][1].push(S):s.alnChainsAnno[d][1].push("-");let x=".";b%5==0&&(x="*"),b%10==0&&(x="|"),s.alnChainsAnno[d][2].push(x);let k="";b%10==0&&(k=b.toString()),s.alnChainsAnno[d][3].push(k),++b}}e={}}getPosFromResi(e,t){let s=this.icn3d;s.icn3dui;let i,n=s.resid2ncbi[e+"_"+t];if(n){i=n.substr(n.lastIndexOf("_")+1)-1}return i}getResnFromResi(e,t){let s=this.icn3d;s.icn3dui;let i=e+"_"+t,n=s.residueId2Name[i];return n||(n="?"),n}getResiAferAlign(e,t,s){let i,n=this.icn3d,l=n.icn3dui;if(t&&"tmalign"==l.cfg.aligntool)i=s;else if(n.posid2resid){let t=n.posid2resid[e+"_"+s];i=t.substr(t.lastIndexOf("_")+1)}else i=n.chainsSeq[e][s].resi;return i}setSeqAlignChain(e,t,s){let i,n,l,r,o,a,d,c,h,p,m,u=this.icn3d,g=u.icn3dui,f={},b=!!s;if(b){if(o=s[1],a=s[0],t=s[2],d=o.indexOf("_"),c=a.indexOf("_"),i=o.substr(0,d).toUpperCase(),n=a.substr(0,c).toUpperCase(),l=o.substr(d+1),r=a.substr(d+1),i==n&&l==r){let e=u.chainsSeq[n+"_"+r].length;u.qt_start_end[t]={q_start:1,q_end:e,t_start:1,t_end:e}}}else{let d=s[0].indexOf("_"),c=e.indexOf("_");if(i=u.mmdbid_t,n=e.substr(0,c).toUpperCase(),l=s[0].substr(d+1),r=e.substr(c+1),i==n&&l==r){let e=u.chainsSeq[u.mmdbid_q+"_"+u.chain_q].length;u.qt_start_end[t]={q_start:1,q_end:e,t_start:1,t_end:e}}o=i+"_"+l,a=n+"_"+r,void 0!==n&&u.mmdbid_t}u.conservedName1=o+"_cons",u.nonConservedName1=o+"_ncons",u.notAlignedName1=o+"_nalign",u.conservedName2=a+"_cons",u.nonConservedName2=a+"_ncons",u.notAlignedName2=a+"_nalign",u.consHash1={},u.nconsHash1={},u.nalignHash1={},u.consHash2={},u.nconsHash2={},u.nalignHash2={},u.alnChains={},u.alnChainsSeq[o]=[],u.alnChains[o]={},u.alnChainsSeq[a]=[],u.alnChains[a]={},u.alnChainsAnno[o]=[],u.alnChainsAnTtl[o]=[],void 0===u.alnChainsAnTtl[o]&&(u.alnChainsAnTtl[o]=[]);for(let e=0;e<7;++e)void 0===u.alnChainsAnTtl[o][e]&&(u.alnChainsAnTtl[o][e]=[]);u.alnChainsAnTtl[o][0].push(a),u.alnChainsAnTtl[o][1].push(o),u.alnChainsAnTtl[o][2].push(""),u.alnChainsAnTtl[o][3].push(""),u.alnChainsAnTtl[o][4].push(a),u.alnChainsAnTtl[o][5].push(o),u.alnChainsAnTtl[o][6].push("");let C=0,y=0;if(void 0===u.qt_start_end[t])return;let v=1;u.chainsMapping[o]||(u.chainsMapping[o]={}),u.chainsMapping[a]||(u.chainsMapping[a]={});let _={},w={};for(let e=0,s=u.qt_start_end[t].length;e0){let e=v;for(let t=C+1,i=s;tc&&(c=t)}}}"tmalign"==n.cfg.aligntool&&(s=!0);let p=Object.keys(a);p.sort((function(e,t){return parseInt(e)-parseInt(t)}));let m=-999,u=0,g=0,f=[],b=0;for(let e=0,t=p.length;en)for(let e=0,t=d-a;e0?void 0!==n?p.alnChainsAnno[t][0].push(n):p.alnChainsAnno[t][0].push("-"):console.log("Error: ic.alnChainsAnno[chainid1] is undefined")}}}class ls{constructor(e){this.icn3d=e}getStructureId(e,t,s){let i=this.icn3d;i.icn3dui;let n=e;return(e==i.defaultPdbId||s||i.structures.hasOwnProperty(e))&&(n=1===t?e:e+t.toString()),n}loadPDB(e,t,s,i,n,l,r,o){let a,d,c=this.icn3d,h=c.icn3dui,p={},m=!1,u=e.split("\n"),g={},f={};c.atoms||(l=!1),n||l?(c.oriNStru=c.structures?Object.keys(c.structures).length:0,d=c.oriNStru+1,a=c.atoms?Object.keys(c.atoms).length:0):(c.init(),d=1,a=0);let b,C,y,v,_,w,S,A=[],x=[],k=[],O=[],R=[],I=[],T="",E="",P="",M={},D=t||c.defaultPdbId,H=D,F="",L=!1,N=!0;for(let e in u){let r=u[e],q=r.substr(0,6);if("HEADER"!==q||L||t)if("TITLE "===q){let e=r.substr(10).replace(/ALPHAFOLD MONOMER V2.0 PREDICTION FOR /gi,"");c.molTitle+=e.trim()+" ",o&&c.esmTitle&&(c.molTitle=c.esmTitle),c.molTitleHash||(c.molTitleHash={}),c.molTitleHash[H]=c.molTitle}else if("HELIX "===q){c.bSecondaryStructure=!0;let e=""==r.substr(18,2).trim()?"A":r.substr(18,2).trim(),t=parseInt(r.substr(21,4)),s=parseInt(r.substr(33,4));for(let i=t;i<=s;++i){let n=H+"_"+e+"_"+i;O.push(n),i===t&&R.push(n),i===s&&I.push(n)}}else if("SHEET "===q){void 0!==s&&s||(c.bSecondaryStructure=!0);let e=""==r.substr(20,2).trim()?"A":r.substr(20,2).trim(),t=parseInt(r.substr(22,4)),i=parseInt(r.substr(33,4));for(let s=t;s<=i;++s){let n=H+"_"+e+"_"+s;A.push(n),s===t&&x.push(n),s===i&&k.push(n)}}else if("HBOND "===q)void 0!==s&&s||(c.bSecondaryStructure=!0);else if("SSBOND"===q){c.bSsbondProvided=!0;let e=D+"_"+(" "==r.substr(15,1)?"A":r.substr(15,1))+"_"+r.substr(17,4).trim(),t=D+"_"+(" "==r.substr(29,1)?"A":r.substr(29,1))+"_"+r.substr(31,4).trim();void 0===c.ssbondpnts[D]&&(c.ssbondpnts[D]=[]),c.ssbondpnts[D].push(e),c.ssbondpnts[D].push(t)}else if("REMARK"===q){let e=parseInt(r.substr(7,3));if(-1!==r.indexOf("1/2 of bilayer thickness:"))c.halfBilayerSize=parseFloat(r.substr(r.indexOf(":")+1).trim());else if(210==e)"EXPERIMENT TYPE"==r.substr(11,32).trim()&&"NMR"==r.substr(45).trim()&&(m=!0);else if(350==e&&"BIOMT"==r.substr(13,5)){let e=parseInt(r[18])-1,t=parseInt(r.substr(21,2))-1;null==c.biomtMatrices[t]&&(c.biomtMatrices[t]=(new THREE.Matrix4).identity()),c.biomtMatrices[t].elements[e]=parseFloat(r.substr(24,9)),c.biomtMatrices[t].elements[e+4]=parseFloat(r.substr(34,9)),c.biomtMatrices[t].elements[e+8]=parseFloat(r.substr(44,9)),c.biomtMatrices[t].elements[e+12]=parseFloat(r.substr(54,14))}else if(465==e&&" "==r.substr(18,1)&&" "==r.substr(20,1)&&"S"!=r.substr(21,1)){let e=r.substr(15,3),t=r.substr(18,2).trim(),s=r.substr(21,5).trim(),i=D+"_"+t;void 0===c.chainMissingResidueArray[i]&&(c.chainMissingResidueArray[i]=[]);let n={};n.resi=s,n.name=h.utilsCls.residueName2Abbr(e).toLowerCase(),""!=F&&t==F&&t!=F||(c.chainMissingResidueArray[i].push(n),F=t)}else 900==e&&void 0===c.emd&&"RELATED DB: EMDB"==r.substr(34).trim()&&(c.emd=r.substr(23,11).trim())}else if("SOURCE"===q&&void 0===c.organism&&"ORGANISM_COMMON"==r.substr(11,15).trim())c.organism=r.substr(28).toLowerCase().trim(),c.organism=c.organism.substr(0,c.organism.length-1);else if("ENDMDL"===q)++d,D=c.defaultPdbId,H=this.getStructureId(D,d,n),m||(A=[],x=[],k=[],O=[],R=[],I=[]),L=!1;else if("JRNL "===q)"PMID"===r.substr(12,4)&&(c.pmid=r.substr(19).trim());else if("ATOM "===q||"HETATM"===q){N&&(H=this.getStructureId(D,d,n),N=!1);let e=r.substr(16,1);++a,M[parseInt(r.substr(6,5))]=a;let t=r.substr(76,2).trim();""===t&&(t=r.substr(12,2).trim());let l=r.substr(12,4).trim(),u=r.substr(17,3),F=r.substr(20,2).trim();""===F&&(F="A");let L=r.substr(22,5).trim(),U=L;if(s&&"DUM"===u&&(t=l,F="MEM",U=1,L=1),i&&"DUM"===u)break;b=H+"_"+F,y=b+"_"+L,C=b+"_"+U;let $=parseFloat(r.substr(30,8)),j=parseFloat(r.substr(38,8)),B=parseFloat(r.substr(46,8)),z=new THREE.Vector3($,j,B),G=parseFloat(r.substr(60,8));o&&(G*=100);let V={het:"H"===q[0],serial:a,name:l,alt:e,resn:u,structure:H,chain:F,resi:U,coord:z,b:G,elem:t,bonds:[],ss:"coil",ssbegin:!1,ssend:!1};if(V.het||"C"!==V.name||(v=a),V.het||"O"!==V.name||(w=a),!V.het&&"N"===V.name&&void 0!==_&&void 0!==S){let e=c.atoms[_].coord.distanceTo(c.atoms[S].coord),t=V.coord.x+(c.atoms[_].coord.x-c.atoms[S].coord.x)/e,s=V.coord.y+(c.atoms[_].coord.y-c.atoms[S].coord.y)/e,i=V.coord.z+(c.atoms[_].coord.z-c.atoms[S].coord.z)/e;V.hcoord=new THREE.Vector3(t,s,i)}c.atoms[a]=V,c.dAtoms[a]=1,c.hAtoms[a]=1,p[a]=1,this.isSecondary(C,A,m)?(c.atoms[a].ss="sheet",this.isSecondary(C,x,m)&&(c.atoms[a].ssbegin=!0),this.isSecondary(C,k,m)&&(c.atoms[a].ssend=!0)):this.isSecondary(C,O,m)&&(c.atoms[a].ss="helix",this.isSecondary(C,R,m)&&(c.atoms[a].ssbegin=!0),this.isSecondary(C,I,m)&&(c.atoms[a].ssend=!0));let W="-";if(W="helix"===c.atoms[a].ss?"H":"sheet"===c.atoms[a].ss?"E":!c.atoms[a].het&&h.parasCls.residueColors.hasOwnProperty(c.atoms[a].resn.toUpperCase())?"c":"o",c.secondaries[C]=W,y!==P){let e=h.utilsCls.residueName2Abbr(u);if(c.residueId2Name[C]=e,1!==a&&""!==E&&(c.residues[E]=f),C!==E&&(f={}),b!==T){_=void 0,S=void 0,1!==a&&""!==T&&(void 0===c.chains[T]&&(c.chains[T]={}),c.chains[T]=h.hashUtilsCls.unionHash(c.chains[T],g)),g={},void 0===c.structures[H.toString()]&&(c.structures[H.toString()]=[]),c.structures[H.toString()].includes(b)||c.structures[H.toString()].push(b),void 0===c.chainsSeq[b]&&(c.chainsSeq[b]=[]);let t={};t.resi=U,t.name=e,c.chainsSeq[b].push(t)}else{_=v,S=w;let t={};t.resi=U,t.name=e,c.chainsSeq[b].push(t)}}g[a]=1,f[a]=1,T=b,E=C,P=y}else if("CONECT"===q){let e=parseInt(r.substr(6,5));for(let t=0;t<4;++t){let s=parseInt(r.substr([11,16,21,26][t],5));isNaN(s)||void 0!==c.atoms[M[e]]&&c.atoms[M[e]].bonds.push(M[s])}}else q.substr(0,3);else D=r.substr(62).trim(),""==D&&(D=l?c.defaultPdbId:c.inputid&&-1==c.inputid.indexOf("/")?c.inputid.substr(0,10):c.defaultPdbId),H=this.getStructureId(D,d,n),c.molTitle="",c.molTitleHash={},L=!0}c.residues[C]=f,void 0===c.chains[b]&&(c.chains[b]={}),c.chains[b]=h.hashUtilsCls.unionHash2Atoms(c.chains[b],g,c.atoms),this.adjustSeq(c.chainMissingResidueArray);let q=Object.keys(c.structures);for(let e=0,t=q.length;er&&i>r&&(h=!0),s<=r&&i>r?s>i||h?(o[c]=t[d],d++):(o[c]=e[a],a++):s>r&&i<=r?s<=i||h?(o[c]=e[a],a++):(o[c]=t[d],d++):s<=i?(o[c]=e[a],a++):(o[c]=t[d],d++),c++}if(a4||Math.abs(l.y-r.y)>4||Math.abs(l.z-r.z)>4||(l.x-r.x)*(l.x-r.x)+(l.y-r.y)*(l.y-r.y)+(l.z-r.z)*(l.z-r.z)<16&&(void 0===t.ssbondpnts[e]&&(t.ssbondpnts[e]=[]),t.ssbondpnts[e].push(o),t.ssbondpnts[e].push(a)))}}}getChainCalpha(e,t,s,i){let n=this.icn3d,l=n.icn3dui,r={};for(let o in e){if(void 0!==i){if(o.split("_")[0]!==i)continue}let a=Object.keys(e[o]),d=[],c=0,h=0;for(let e=0,i=a.length;e3?i.resn.trim().substr(0,3):i.resn.trim();if(!l.parasCls.chargeColors.hasOwnProperty(e))continue;s?i.resi_ori:i.resi,d.push(i.coord.clone()),++c,h=i.resi}}if(c>0){r[t[a[0]].chain]=d}}return{chainresiCalphaHash:r,center:n.center.clone()}}isSecondary(e,t,s){if(this.icn3d.icn3dui,s){let s=e.substr(e.indexOf("_")+1),i=!1;for(let e=0,n=t.length;ep[e]
"),l.cfg.bSidebyside||l.htmlCls.dialogCls.openDlg("dl_rmsd","Realignment RMSD"),n.q_rotation=[],n.q_trans_sub=[],n.t_trans_add=[],n.q_rotation.push({x1:e[0],y1:e[1],z1:e[2],x2:e[3],y2:e[4],z2:e[5],x3:e[6],y3:e[7],z3:e[8]}),n.q_trans_sub.push(i),n.t_trans_add.push({x:-r.x,y:-r.y,z:-r.z}),l.cfg.aligntool="vast";//!= 'tmalign';
-let c=0,h="query",p=o.substr(0,o.indexOf("_")),m=!0;n.chainalignParserCls.transformStructure(p,c,h,m);let u="";for(let e=0,i=s.length;e8)return s;let g=[];g[0]=n[0]*r[0]+n[1]*r[1]+n[2]*r[2],g[1]=n[3]*r[0]+n[4]*r[1]+n[5]*r[2],g[2]=n[6]*r[0]+n[7]*r[1]+n[8]*r[2],g[0]-=n[0]*a[0]+n[1]*a[1]+n[2]*a[2],g[1]-=n[3]*a[0]+n[4]*a[1]+n[5]*a[2],g[2]-=n[6]*a[0]+n[7]*a[1]+n[8]*a[2];let f=0;return f=c[0]*g[0],f+=c[1]*g[1],f+=c[2]*g[2],f/=p*m,f<.866?s:(g[0]=l[0]*r[0]+l[1]*r[1]+l[2]*r[2],g[1]=l[3]*r[0]+l[4]*r[1]+l[5]*r[2],g[2]=l[6]*r[0]+l[7]*r[1]+l[8]*r[2],g[0]-=l[0]*a[0]+l[1]*a[1]+l[2]*a[2],g[1]-=l[3]*a[0]+l[4]*a[1]+l[5]*a[2],g[2]-=l[6]*a[0]+l[7]*a[1]+l[8]*a[2],f=c[0]*g[0],f+=c[1]*g[1],f+=c[2]*g[2],f/=p*m,f<.866?s:(u=0,u+=Math.pow(e.q_rotation.x1-t.q_rotation.x1,2),u+=Math.pow(e.q_rotation.y1-t.q_rotation.y1,2),u+=Math.pow(e.q_rotation.z1-t.q_rotation.z1,2),u+=Math.pow(e.q_rotation.x2-t.q_rotation.x2,2),u+=Math.pow(e.q_rotation.y2-t.q_rotation.y2,2),u+=Math.pow(e.q_rotation.z2-t.q_rotation.z2,2),u+=Math.pow(e.q_rotation.x3-t.q_rotation.x3,2),u+=Math.pow(e.q_rotation.y3-t.q_rotation.y3,2),u+=Math.pow(e.q_rotation.z3-t.q_rotation.z3,2),Math.sqrt(u)))}GetRotMatrix(e,t,s){this.icn3d.icn3dui;let i=[];return i&&(i[0]=e.q_rotation.x1/t,i[1]=e.q_rotation.y1/t,i[2]=e.q_rotation.z1/t,i[3]=e.q_rotation.x2/t,i[4]=e.q_rotation.y2/t,i[5]=e.q_rotation.z2/t,i[6]=e.q_rotation.x3/t,i[7]=e.q_rotation.y3/t,i[8]=e.q_rotation.z3/t,2!=s?(i[9]=e.t_trans_add.x/t,i[10]=e.t_trans_add.y/t,i[11]=e.t_trans_add.z/t,i[12]=-e.q_trans_sub.x/t,i[13]=-e.q_trans_sub.y/t,i[14]=-e.q_trans_sub.z/t):(i[9]=-e.q_trans_add.x/t,i[10]=-e.q_trans_add.y/t,i[11]=-e.q_trans_add.z/t,i[12]=0,i[13]=0,i[14]=0)),i}cbu_dist(e,t,s){return e=5&&(e=l[4].substr(5)),l.length>=6&&(s=l[5].substr(6)),l.length>=7&&(n=l[6].substr(4)),$("#"+t.pre+"anno_custom")[0]&&($("#"+t.pre+"anno_custom")[0].checked=!0),$("[id^="+t.pre+"custom]").show(),"0"==s&&(s=void 0),t.addTrackCls.checkGiSeq(r,o,a,e,s,n,0)}else if(0==n.indexOf("remove one stabilizer")){let e=n.split(" | ")[1].split(" "),s=[];s.push(parseInt(e[0])),s.push(parseInt(e[1])),t.threeDPrintCls.removeOneStabilizer(s),t.drawCls.draw()}else if(0==n.indexOf("add one stabilizer")){let e=n.split(" | ")[1].split(" ");void 0===t.pairArray&&(t.pairArray=[]),t.pairArray.push(parseInt(e[0])),t.pairArray.push(parseInt(e[1])),t.drawCls.draw()}else if(0==n.indexOf("select planes z-axis")){let e=n.split(" ");if(5==e.length){let s=parseFloat(e[3]),i=parseFloat(e[4]);t.selectionCls.selectBtwPlanes(s,i)}}else if(0==n.indexOf("adjust membrane z-axis")){let e=n.split(" ");if(5==e.length){let s=parseFloat(e[3]),i=parseFloat(e[4]);t.selectionCls.adjustMembrane(s,i)}}else if(0==n.indexOf("toggle membrane"))t.selectionCls.toggleMembrane();else if(0==i.indexOf("calc buried surface")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(" ");if(2==s.length){let e=s[0].split(","),i=s[1].split(",");t.analysisCls.calcBuriedSurface(e,i)}}}else if(0==i.indexOf("dist ")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(" ");if(2==s.length){let e=s[0].split(","),i=s[1].split(",");t.analysisCls.measureDistTwoSets(e,i)}}}else if(0==i.indexOf("disttable")){let e=i.split(" | ");if(2==e.length){let i=e[1].split(" ");if(2==i.length){let e=i[0].split(","),n=i[1].split(",");t.analysisCls.measureDistManySets(e,n),s.htmlCls.dialogCls.openDlg("dl_disttable","Distance among the sets")}}}else if(0==i.indexOf("display interaction 3d")||0==i.indexOf("view interaction pairs")||0==i.indexOf("save1 interaction pairs")||0==i.indexOf("save2 interaction pairs")||0==i.indexOf("line graph interaction pairs")||0==i.indexOf("scatterplot interaction pairs")){let e=i.split(" | ");if(e.length>=3){let s=e[1].split(" ");if(2==s.length){let n,l,r=s[0].split(","),o=s[1].split(","),a=-1!==e[2].indexOf("hbonds"),d=-1!==e[2].indexOf("salt bridge"),c=-1!==e[2].indexOf("interactions"),h=-1!==e[2].indexOf("halogen"),p=-1!==e[2].indexOf("pi-cation"),m=-1!==e[2].indexOf("pi-stacking");if(e.length>=4&&(n="true"==e[3]),e.length>=5){let s=e[4].split(" ");s.length>=4&&($("#"+t.pre+"hbondthreshold").val(s[1]),$("#"+t.pre+"saltbridgethreshold").val(s[2]),$("#"+t.pre+"contactthreshold").val(s[3]),7==s.length&&($("#"+t.pre+"halogenthreshold").val(s[4]),$("#"+t.pre+"picationthreshold").val(s[5]),$("#"+t.pre+"pistackingthreshold").val(s[6])))}0==i.indexOf("display interaction 3d")?l="3d":0==i.indexOf("view interaction pairs")?l="view":0==i.indexOf("save1 interaction pairs")?l="save1":0==i.indexOf("save2 interaction pairs")?l="save2":0==i.indexOf("line graph interaction pairs")?l="linegraph":0==i.indexOf("scatterplot interaction pairs")&&(l="scatterplot"),await t.viewInterPairsCls.viewInteractionPairs(r,o,n,l,a,d,c,h,p,m)}}}else if(0==i.indexOf("export pairs")){let e=i.split(" | ");if(3==e.length){let i=e[1].split(" ");if(2==i.length){let n=i[0].split(","),l=i[1].split(","),r=e[2].split(" ")[1];t.showInterCls.pickCustomSphere(r,n,l,t.bSphereCalc),t.bSphereCalc=!0;let o=t.viewInterPairsCls.exportSpherePairs(),a=Object.keys(s.utilsCls.getHlStructures()).join(",");t.saveFileCls.saveFile(a+"_sphere_pairs.html","html",o)}}}else if(0==n.indexOf("graph label")){let e=n.lastIndexOf(" "),t=n.substr(e+1);$("#"+s.svgid+"_label").val(t),$("#"+s.svgid+" text").removeClass(),$("#"+s.svgid+" text").addClass(t)}else if(0==n.indexOf("cartoon label")){let e=n.lastIndexOf(" "),t=n.substr(e+1);$("#"+s.svgid_ct+"_label").val(t),$("#"+s.svgid_ct+" text").removeClass(),$("#"+s.svgid_ct+" text").addClass(t)}else if(0==n.indexOf("line graph scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.linegraphid+"_scale").val(i),$("#"+s.linegraphid).attr("width",(t.linegraphWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("scatterplot scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.scatterplotid+"_scale").val(i),$("#"+s.scatterplotid).attr("width",(t.scatterplotWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("contactmap scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.contactmapid+"_scale").val(i),$("#"+s.contactmapid).attr("width",(t.contactmapWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("alignerrormap scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.alignerrormapid+"_scale").val(i),$("#"+s.alignerrormapid).attr("width",(t.alignerrormapWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("graph force")){let e=n.lastIndexOf(" ");s.htmlCls.force=parseInt(n.substr(e+1)),$("#"+s.svgid+"_force").val(s.htmlCls.force),t.getGraphCls.handleForce()}else if(0==n.indexOf("hide edges")){let e=n.lastIndexOf(" ");s.htmlCls.hideedges=parseInt(n.substr(e+1)),$("#"+s.svgid+"_hideedges").val(s.htmlCls.hideedges),s.htmlCls.hideedges?(s.htmlCls.contactInsideColor="FFF",s.htmlCls.hbondInsideColor="FFF",s.htmlCls.ionicInsideColor="FFF"):(s.htmlCls.contactInsideColor="DDD",s.htmlCls.hbondInsideColor="AFA",s.htmlCls.ionicInsideColor="8FF"),void 0!==t.graphStr&&t.bRender&&s.htmlCls.force&&t.drawGraphCls.drawGraph(t.graphStr,t.pre+"dl_graph")}else if(0==n.indexOf("reset interaction pairs"))t.viewInterPairsCls.resetInteractionPairs();else if(0==n.indexOf("side by side")){let e=n.split(" | ")[1],t="_blank";window.open(e,t)}else if(0==i.indexOf("your note")){let e=i.split(" | ");t.yournote=e[1],$("#"+t.pre+"yournote").val(t.yournote),s.cfg.shownote&&(document.title=t.yournote)}else if(0==n.indexOf("cross structure interaction"))t.crossstrucinter=parseInt(n.substr(n.lastIndexOf(" ")+1)),$("#"+t.pre+"crossstrucinter").val(t.crossstrucinter);else if("replay on"==n)await t.resizeCanvasCls.replayon();else if("replay off"==n)await t.resizeCanvasCls.replayoff();else if(0==n.indexOf("contact map")){let e=n.split(" | ");if(3===e.length){let s=parseFloat(e[1].split(" ")[1]),i=e[2].split(" ")[1];await t.contactMapCls.contactMap(s,i)}}else if(0==n.indexOf("pickatom")){let e=parseInt(n.substr(n.lastIndexOf(" ")+1));t.pAtom=t.atoms[e],t.pickingCls.showPicking(t.pAtom)}else if(0==i.indexOf("set color spectrum")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!0;t.setColorCls.setColorAcrossSets(s,i)}}else if(0==i.indexOf("set residues color spectrum")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!0;t.setColorCls.setColorBySets(s,i)}}else if(0==i.indexOf("set color rainbow")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!1;t.setColorCls.setColorAcrossSets(s,i)}}else if(0==i.indexOf("set residues color rainbow")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!1;t.setColorCls.setColorBySets(s,i)}}else if(0==i.indexOf("color")){let e=i.split(" | "),n=e[0].substr(e[0].indexOf(" ")+1);if(t.opts.color=n,"residue custom"==n&&2==e.length){t.customResidueColors=JSON.parse(e[1]);for(let e in t.customResidueColors)t.customResidueColors[e.toUpperCase()]=s.parasCls.thr("#"+t.customResidueColors[e])}else if("align custom"==n&&3==e.length){let s=e[1],i=e[2].split(", ");t.queryresi2score={},t.queryresi2score[s]={};for(let e=0,n=i.length;e1&&"3"===x[t][0]&&isNaN(x[t][1])&&"-"!==x[t][0]){i=x[t].toUpperCase().substr(1),m=!0}else if(""===x[t]||isNaN(parseInt(x[t]))){if("*"===x[t])h=!0;else if("proteins"!==x[t]&&"nucleotides"!==x[t]&&"chemicals"!==x[t]&&"ions"!==x[t]&&"water"!==x[t]&&"anchors"!==x[t]&&"strands"!==x[t]&&"loops"!==x[t]){s=x[t].toUpperCase(),p=!0}}else v=x[t],_=v,n=!0;for(let a=0,u=S.length;a1?e.substr(0,l-1)===n.atoms[i].name.substr(0,l-1)&&(0===s?t[i]=1:t.hasOwnProperty(i)||delete t[i]):"*"!==e&&e!==n.atoms[i].name||(0===s?t[i]=1:t.hasOwnProperty(i)||delete t[i]),t}}class hs{constructor(e){this.icn3d=e}selectAll(){let e=this.icn3d;e.icn3dui,this.selectAll_base(),e.hlObjectsCls.removeHlObjects(),e.hlUpdateCls.removeHl2D(),e.hlUpdateCls.removeHlMenus(),e.bSelectResidue=!1,e.bSelectAlignResidue=!1,e.hlUpdateCls.removeSeqResidueBkgd(),e.hlUpdateCls.update2DdgmContent(),$("#"+e.pre+"dl_annotations > .icn3d-annotation").show(),e.definedSetsCls.setMode("all"),e.saveFileCls.showTitle()}selectAll_base(){let e=this.icn3d,t=e.icn3dui;e.hAtoms={},e.dAtoms={};for(let s in e.chains)e.hAtoms=t.hashUtilsCls.unionHash(e.hAtoms,e.chains[s]);e.dAtoms=t.hashUtilsCls.cloneHash(e.hAtoms),e.viewSelectionAtoms=t.hashUtilsCls.cloneHash(e.hAtoms),e.ALTERNATE_STRUCTURE=-1}selectAChain(e,t,s,i){let n=this.icn3d,l=n.icn3dui;t=t.replace(/\s/g,"");let r=void 0!==s||s?"select alignChain "+e:"select chain "+e;void 0!==i&&i?(n.hAtoms=l.hashUtilsCls.unionHash(n.hAtoms,n.chains[e]),void 0===n.nameArray&&(n.nameArray=[])):(n.hAtoms={},n.nameArray=[]),n.nameArray.push(e);let o,a=s?n.alnChainsSeq[e]:n.chainsSeq[e];o=void 0===a?0:a.length;let d={};for(let t=0,s=o;t0){if(void 0!==i&&i?void 0===r.nameArray&&(r.nameArray=[]):(r.hAtoms={},r.nameArray=[]),l)for(let t in e)r.hAtoms[t]=1;else for(let t in e)for(let e in r.residues[t])r.hAtoms[e]=1;let o,a;t=t.replace(/\s/g,""),r.nameArray.push(t),l?(o="select "+r.resid2specCls.atoms2spec(r.hAtoms),a=!1):(o="select "+r.resid2specCls.residueids2spec(Object.keys(e)),a=!0);let d=Object.keys(e);this.addCustomSelection(d,t,s,o,a),(void 0===n||n)&&r.hlUpdateCls.updateHlAll(r.nameArray,void 0,i)}}selectMainChains(){let e=this.icn3d,t=e.icn3dui.hashUtilsCls.cloneHash(e.hAtoms);e.hAtoms=e.applyDisplayCls.selectMainChainSubset(t),e.hlUpdateCls.showHighlight()}selectSideChains(){let e=this.icn3d,t=e.icn3dui,s=t.hashUtilsCls.cloneHash(e.hAtoms);e.hAtoms={};for(let i in s)(e.proteins.hasOwnProperty(i)&&"N"!==e.atoms[i].name&&"H"!==e.atoms[i].name&&"C"!==e.atoms[i].name&&"O"!==e.atoms[i].name&&("CA"!==e.atoms[i].name||"C"!==e.atoms[i].elem)&&"HA"!==e.atoms[i].name||e.nucleotides.hasOwnProperty(i)&&-1===t.parasCls.nuclMainArray.indexOf(e.atoms[i].name))&&(e.hAtoms[i]=1);e.hlUpdateCls.showHighlight()}selectMainSideChains(){let e=this.icn3d,t=e.icn3dui,s=e.firstAtomObjCls.getResiduesFromAtoms(e.hAtoms);e.hAtoms={};for(let i in s)e.hAtoms=t.hashUtilsCls.unionHash(e.hAtoms,e.residues[i]),e.dAtoms=t.hashUtilsCls.unionHash(e.dAtoms,e.residues[i]);e.drawCls.draw(),e.hlUpdateCls.showHighlight()}clickShow_selected(){let e=this.icn3d,t=e.icn3dui,s=this;t.myEventCls.onIds(["#"+e.pre+"show_selected","#"+e.pre+"mn2_show_selected"],"click",(function(e){s.icn3d,s.showSelection(),t.htmlCls.clickMenuCls.setLogCmd("show selection",!0)}))}clickHide_selected(){let e=this.icn3d,t=e.icn3dui,s=this;t.myEventCls.onIds("#"+e.pre+"mn2_hide_selected","click",(function(e){s.icn3d,s.hideSelection(),t.htmlCls.clickMenuCls.setLogCmd("hide selection",!0)}))}getGraphDataForDisplayed(){let e=this.icn3d;e.icn3dui;let t=JSON.parse(e.graphStr),s=e.firstAtomObjCls.getResiduesFromAtoms(e.dAtoms),i=[],n=[],l={};for(let e=0,n=t.nodes.length;et&&(t=C[s].length,e=s);let s=Object.keys(p),i=Object.keys(m);for(let t=0,n=C[e].length;t
The following sequence alignment shows the residue mapping of the best aligned sets: "symOri" and "symPerm", which are also available in the menu "Analysis > Defined Sets".
',$("#"+e.pre+"symd_info").html(A),s.setSeqAlignForSymmetry(_,w,S);let x=!1,k=t.htmlCls.alignSeqCls.getAlignSequencesAnnotations(Object.keys(e.alnChains),void 0,void 0,x,S);A=$("#"+e.pre+"dl_sequence2").html()+k.sequencesHtml,$("#"+e.pre+"dl_sequence2").html(A),$("#"+e.pre+"dl_sequence2").width(t.htmlCls.RESIDUE_WIDTH*k.maxSeqCnt+200),t.htmlCls.dialogCls.openDlg("dl_alignment","Select residues in aligned sequences from SymD");let O=Object.keys(e.defNames2Residues).length+Object.keys(e.defNames2Atoms).length,R="symOri"+O;e.selectionCls.selectResidueList(y,R,R),e.selectionCls.updateSelectionNameDesc(),t.htmlCls.clickMenuCls.setLogCmd("select "+e.resid2specCls.residueids2spec(Object.keys(y))+" | name "+R,!1),R="symPerm"+O,e.selectionCls.selectResidueList(v,R,R),e.selectionCls.updateSelectionNameDesc(),t.htmlCls.clickMenuCls.setLogCmd("select "+e.resid2specCls.residueids2spec(Object.keys(v))+" | name "+R,!1),R="symBoth"+O,y=t.hashUtilsCls.unionHash(y,v),e.selectionCls.selectResidueList(y,R,R),e.selectionCls.updateSelectionNameDesc(),t.htmlCls.clickMenuCls.setLogCmd("select "+e.resid2specCls.residueids2spec(Object.keys(y))+" | name "+R,!1)}}else $("#"+e.pre+"dl_symd").html("
The selected residues have no detected symmetry with a Z score of "+a.zscore+" from the program SymD."),t.htmlCls.dialogCls.openDlg("dl_symd","Dynamically Calculated Symmetry Using SymD");e.symdtitle="none"===h?void 0:h,e.drawCls.draw()}catch(s){return $("#"+e.pre+"dl_symd").html("
The web service can not determine the symmetry of the input set."),t.htmlCls.dialogCls.openDlg("dl_symd","Dynamically Calculated Symmetry Using SymD"),void e.ParserUtilsCls.hideLoading()}}getResObj(e){this.icn3d.icn3dui;let t=e.substr(0,e.indexOf(" ")),s=e.indexOf("$"),i=e.indexOf("."),n=e.indexOf(":"),l=e.substr(s+1,i-s-1),r=e.substr(i+1,n-i-1),o=e.substr(n+1);return{resn:t,resid:l+"_"+r+"_"+o,resi:o,aligned:!0}}setSeqAlignForSymmetry(e,t,s){let i=this.icn3d,n=i.icn3dui;i.conservedName1="symOri_cons",i.conservedName2="symPerm_cons",i.consHash1={},i.consHash2={},i.alnChainsAnTtl={},i.alnChainsAnno={},i.alnChainsSeq={},i.alnChains={},i.alnChainsSeq={};let l={};for(let r=0,o=e.length;r
This structure has no symmetry.");i.htmlCls.dialogCls.openDlg("dl_symmetry","Symmetry")}getPolygonColor(e){let t=this.icn3d.icn3dui,s=e.substr(0,1);return"C"==s?t.parasCls.thr(16747520):"D"==s?t.parasCls.thr(65535):"T"==s?t.parasCls.thr(15631086):"O"==s?t.parasCls.thr(16753920):"I"==s?t.parasCls.thr(65280):t.parasCls.thr(11119017)}getAxisColor(e,t){let s=this.icn3d.icn3dui,i=e.substr(0,1);return"C"==i?s.parasCls.thr(16711680):"D"==i?2==t?s.parasCls.thr(65535):s.parasCls.thr(16711680):"T"==i?2==t?s.parasCls.thr(65535):s.parasCls.thr(65280):"O"==i||"I"==i?2==t?s.parasCls.thr(65535):3==t?s.parasCls.thr(65280):s.parasCls.thr(16711680):s.parasCls.thr(16711680)}}class Cs{constructor(e){this.icn3d=e}alignSW(e,t,s,i,n,l,r){this.icn3d.icn3dui;let o=this.bsa_align(r,e,t,[s,i],[n,l]),a="score: "+o[0]+"\n";a+="start: "+o[1]+"\n",a+="cigar: "+this.bsa_cigar2str(o[2])+"\n\n",a+="alignment:\n\n";let d=this.bsa_cigar2gaps(e,t,o[1],o[2]),c={};return c.score=o[0],c.start=o[1],c.cigar=this.bsa_cigar2str(o[2]),c.target=d[0],c.query=d[1],c}bsg_enc_seq(e,t){if(this.icn3d.icn3dui,null==t)return null;let s=[];s.length=e.length;for(let i=0;i
Calculate solvent accessible surface area in the interface:
";C+="Set 1: "+e+", Surface: "+o+" Å2
",C+="Set 2: "+t+", Surface: "+d+" Å2
",C+="Total Surface: "+h+" Å2
",C+="Buried Surface for Set 1: "+u+" Å2
",C+="Buried Surface for Set 2: "+m+" Å2
",$("#"+s.pre+"dl_buriedarea_html").html(C),i.htmlCls.dialogCls.openDlg("dl_buriedarea","Buried solvent accessible surface area in the interface"),i.htmlCls.clickMenuCls.setLogCmd("buried surface "+b,!1)}}measureDistTwoSets(e,t){var s=this.icn3d,i=s.icn3dui;if(0==e.length||0==t.length)alert("Please select two sets");else{let n=i.hashUtilsCls.cloneHash(s.hAtoms),l=s.definedSetsCls.getAtomsFromNameArray(e),r=s.definedSetsCls.getAtomsFromNameArray(t),o=s.contactCls.getExtent(l),a=s.contactCls.getExtent(r),d=new THREE.Vector3(o[2][0],o[2][1],o[2][2]),c=new THREE.Vector3(a[2][0],a[2][1],a[2][2]);s.hAtoms=i.hashUtilsCls.cloneHash(n),void 0===s.distPnts&&(s.distPnts=[]),s.distPnts.push(d),s.distPnts.push(c);let h=$("#"+s.pre+"distancecolor2").val();this.addLine(d.x,d.y,d.z,c.x,c.y,c.z,h,!0,"distance");let p=0,m=0,u=d.clone().add(c).multiplyScalar(.5),g=(parseInt(10*d.distanceTo(c))/10).toString()+" A";this.addLabel(g,u.x,u.y,u.z,p,h,m,"distance"),s.drawCls.draw()}}measureDistManySets(e,t){var s=this.icn3d,i=s.icn3dui;if(0==e.length||0==t.length)alert("Please select sets for distance calculation...");else{let n=i.hashUtilsCls.cloneHash(s.hAtoms),l={};for(let i=0,n=e.length;i ";for(let s=0,i=e.length;s";for(let e=0,s=t.length;e "+t[e]+" (Å)"}r+=""+i+" (Å) ";for(let e=0,s=t.length;e'+l[i][s]+"":r+="0 "}r+=""}r+="
",$("#"+i.pre+"dl_disttable_html").html(r)}}addLine(e,t,s,i,n,l,r,o,a,d,c){var h=this.icn3d;h.icn3dui;let p={};p.position1=new THREE.Vector3(e,t,s),p.position2=new THREE.Vector3(i,n,l),p.color=r,p.dashed=o,p.radius=d,p.opacity=c,void 0===h.lines[a]&&(h.lines[a]=[]),void 0!==a?h.lines[a].push(p):(void 0===h.lines.custom&&(h.lines.custom=[]),h.lines.custom.push(p)),h.hlObjectsCls.removeHlObjects()}addLineFromPicking(e){var t=this.icn3d,s=t.icn3dui;let i=$("#"+t.pre+e+"color").val();t.pAtom.coord.x,t.pAtom2.coord.x,t.pAtom.coord.y,t.pAtom2.coord.y,t.pAtom.coord.z,t.pAtom2.coord.z;let n="stabilizer"!=e;s.htmlCls.clickMenuCls.setLogCmd("add line | x1 "+t.pAtom.coord.x.toPrecision(4)+" y1 "+t.pAtom.coord.y.toPrecision(4)+" z1 "+t.pAtom.coord.z.toPrecision(4)+" | x2 "+t.pAtom2.coord.x.toPrecision(4)+" y2 "+t.pAtom2.coord.y.toPrecision(4)+" z2 "+t.pAtom2.coord.z.toPrecision(4)+" | color "+i+" | dashed "+n+" | type "+e,!0),this.addLine(t.pAtom.coord.x,t.pAtom.coord.y,t.pAtom.coord.z,t.pAtom2.coord.x,t.pAtom2.coord.y,t.pAtom2.coord.z,i,n,e),t.pickpair=!1}addLabel(e,t,s,i,n,l,r,o){var a=this.icn3d;a.icn3dui;let d={};"0"!==n&&""!==n&&"undefined"!==n||(n=void 0),"0"!==l&&""!==l&&"undefined"!==l||(l=void 0),"0"!==r&&""!==r&&"undefined"!==r||(r=void 0);let c=new THREE.Vector3;c.x=t,c.y=s,c.z=i,d.position=c,d.text=e,d.size=n,d.color=l,d.background=r,void 0===a.labels[o]&&(a.labels[o]=[]),void 0!==o?a.labels[o].push(d):(void 0===a.labels.custom&&(a.labels.custom=[]),a.labels.custom.push(d)),a.hlObjectsCls.removeHlObjects()}addChainLabels(e){var t=this.icn3d;let s=t.icn3dui.hashUtilsCls.intHash(t.hAtoms,e);void 0===t.labels.chain&&(t.labels.chain=[]);let i=t.firstAtomObjCls.getChainsFromAtoms(s);for(let e in i){let s={};s.position=t.applyCenterCls.centerAtoms(t.chains[e]).center;let i=e.indexOf("_"),n=e.substr(i+1),l=t.showSeqCls.getProteinName(e);l.length>20&&(l=l.substr(0,20)+"..."),s.text="Chain "+n+": "+l,s.size=18,t.firstAtomObjCls.getFirstCalphaAtomObj(t.chains[e]).color.getHexString().toUpperCase(),s.color="black"!=t.opts.background?t.colorWhitebkgd:t.colorBlackbkgd,s.background="#FFFFFF",t.labels.chain.push(s)}t.hlObjectsCls.removeHlObjects()}addTerminiLabels(e){var t=this.icn3d,s=t.icn3dui;let i,n="#FFFFFF";i=s.hashUtilsCls.unionHash(i,t.proteins),i=s.hashUtilsCls.unionHash(i,t.nucleotides);let l=s.hashUtilsCls.intHash(t.dAtoms,i),r=s.hashUtilsCls.intHash(l,e);void 0===t.labels.chain&&(t.labels.chain=[]);let o=t.firstAtomObjCls.getChainsFromAtoms(r);for(let e in o){let i=s.hashUtilsCls.intHash(l,t.chains[e]),r=Object.keys(i),o=t.atoms[r[0]],a=t.atoms[r[r.length-1]],d={},c={};d.position=o.coord,c.position=a.coord,d.text="N-",c.text="C-",t.nucleotides.hasOwnProperty(o.serial)&&(d.text="5'",c.text="3'"),d.size=18,c.size=18,o.color.getHexString().toUpperCase(),a.color.getHexString().toUpperCase(),d.color="black"!=t.opts.background?t.colorWhitebkgd:t.colorBlackbkgd,c.color="black"!=t.opts.background?t.colorWhitebkgd:t.colorBlackbkgd,d.background=n,c.background=n,t.labels.chain.push(d),t.labels.chain.push(c)}t.hlObjectsCls.removeHlObjects()}}class vs{constructor(e){this.icn3d=e}draw2Ddgm(e,t,s,i){let n=this.icn3d,l=n.icn3dui,r=.667,o={},a={},d={},c={},h={};if(void 0===e)return"";for(let s in e.moleculeInfor){let i="#"+("000000"+e.moleculeInfor[s].color.toString(16)).slice(-6),l=e.moleculeInfor[s].chain.trim();void 0===h[l]?h[l]=1:++h[l];let r=t+"_"+(1===h[l]?l:l+h[l].toString());void 0!==n.mmdbid_q&&(n.mmdbid_q,n.mmdbid_t),o[s]=r,a[s]=i,d[s]=e.moleculeInfor[s].name,c[r]=s}if(void 0===i||!i)for(let s=0,i=e.intracResidues.length;s";p+=""+t.toUpperCase()+"
",p+="",p+="",n.html2ddgm+=p,$("#"+n.pre+"dl_2ddgm_html").html(n.html2ddgm),p}set2DdgmNote(e){let t="
";return this.icn3d.icn3dui.utilsCls.isMac()?(t+="◯Protein
",t+="▢Nucleotide
",t+="♢Chemical
",t+="▢Biopolymer
"):(t+="OProtein
",t+="▢Nucleotide
",t+="◇Chemical
",t+="▢Biopolymer
"),t+="
Lines:
Interactions at 4 Å
",e&&(t+="Numbers in red:
Aligned chains"),t+="
",t}highlightNode(e,t,s,i){let n=this.icn3d.icn3dui;i<.2&&(i=.2);if("rect"===e){$(t).attr("stroke",n.htmlCls.ORANGE),$(t).attr("stroke-width",3);let e=Number($(s).attr("x")),l=Number($(s).attr("y")),r=Number($(s).attr("width")),o=Number($(s).attr("height"));$(t).attr("x",e+r/2*(1-i)),$(t).attr("y",l+o/2*(1-i)),$(t).attr("width",r*i),$(t).attr("height",o*i)}else if("circle"===e)$(t).attr("stroke",n.htmlCls.ORANGE),$(t).attr("stroke-width",3),$(t).attr("r",Number($(s).attr("r"))*i);else if("polygon"===e){$(t).attr("stroke",n.htmlCls.ORANGE),$(t).attr("stroke-width",3);let e=Number($(s).attr("x")),l=Number($(s).attr("y")),r=Number($(s).attr("x0d")),o=Number($(s).attr("y0d")),a=Number($(s).attr("x1d")),d=Number($(s).attr("y1d")),c=Number($(s).attr("x2d")),h=Number($(s).attr("y2d")),p=Number($(s).attr("x3d")),m=Number($(s).attr("y3d"));$(t).attr("points",(e+r*i).toString()+", "+(l+o*i).toString()+", "+(e+a*i).toString()+", "+(l+d*i).toString()+", "+(e+c*i).toString()+", "+(l+h*i).toString()+", "+(e+p*i).toString()+", "+(l+m*i).toString())}}removeLineGraphSelection(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"dl_linegraph circle").attr("stroke","#000000"),$("#"+e.pre+"dl_linegraph circle").attr("stroke-width",1),$("#"+e.pre+"dl_linegraph svg line.icn3d-hlline").attr("stroke","#FFF")}removeScatterplotSelection(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"dl_scatterplot circle").attr("stroke","#000000"),$("#"+e.pre+"dl_scatterplot circle").attr("stroke-width",1),$("#"+e.pre+"dl_scatterplot rect").attr("stroke","#000000"),$("#"+e.pre+"dl_scatterplot rect").attr("stroke-width",1)}click2Ddgm(){let e=this.icn3d,t=e.icn3dui,s=this;$(document).on("click","#"+e.pre+"dl_2ddgm .icn3d-node",(function(e){let i=s.icn3d;e.stopImmediatePropagation(),Object.keys(i.hAtoms).length";return u+="n&&(n=C),ya&&(a=y);let v=.5;m=v*o.htmlCls.width2d*m/(t[1][0]-t[0][0]),u=v*o.htmlCls.width2d*u/(t[1][1]-t[0][1]),m>h&&(h=m),u>h&&(h=u),p.push({id:d,r:l,x:C,y:y,rx:m,ry:u,ang:g,c:b.color.getHexString()})}let m=h+2,u=n-s,g=a-i;for(let e=0,t=p.length;e0&&m==S.chain&&c.push('{"source": "'+u+'", "target": "'+n+'", "v": '+p+', "c": "'+t.color.getHexString().toUpperCase()+'"}'),A.push({id:n,r:l,ss:C,x:s,y:i,x1:d,y1:g,x2:k,y2:O,c:S.color.getHexString()}),m=S.chain,u=n,++h}}}let x=S+2,k=_-y,O=w-v;for(let e=0,t=A.length;e4e3||0!==s.indexOf("http")||l.bInputfile&&!l.bInputUrlfile?$("#"+l.pre+"viewer").html(""):$("#"+l.pre+"viewer").html("
"),$("#"+l.pre+"viewer").width(i),$("#"+l.pre+"viewer").height(n),$("#"+l.pre+"cmdlog").hide(),$("#"+l.pre+"title").hide(),$("#"+l.pre+"mnlist").hide(),$("#"+l.pre+"fullscreen").length>0&&$("#"+l.pre+"fullscreen").hide(),l={}}else saveAs(e,t)}saveSvg(e,t,s){if(this.icn3d.icn3dui.bNode)return"";let i=$("#"+e).width(),n=$("#"+e).height();s&&(n=i);let l=this.getSvgXml(e,i,n,s),r=new Blob([l],{type:"image/svg+xml"});saveAs(r,t)}getSvgXml(e,t,s,i){if(this.icn3d.icn3dui.bNode)return"";return(t&&s?'"}savePng(e,t,s){let i=this.icn3d,n=i.icn3dui;if(n.bNode)return"";let l=$("#"+e).width(),r=$("#"+e).height();s&&(r=l);let o=document.getElementById(e),a=o.getBBox(),d=o.cloneNode(!0);i.lineGraphCls.copyStylesInline(d,o);let c=document.createElement("CANVAS");c.width=l,c.height=r;let h=c.getContext("2d");h.clearRect(0,0,a.width,a.height);let p=this.getSvgXml(e,l,r,s),m=window.URL||window.webkitURL||window,u=new Blob([p],{type:"image/svg+xml;charset=utf-8"}),g=new Image;g.src=m.createObjectURL(u),g.onload=function(){if(h.drawImage(g,0,0),m.revokeObjectURL(this.src),n.utilsCls.isIE()){let e=c.msToBlob();e&&(saveAs(e,t),c.remove())}else c.toBlob((function(e){e&&(saveAs(e,t),c.remove())}))}}exportCustomAtoms(e){var t=this.icn3d;t.icn3dui;let s="",i=void 0!==t.defNames2Residues?Object.keys(t.defNames2Residues).sort():[];for(let n=0,l=i.length;n
20&&(e=e.substr(0,17)+"..."),l="Query: "+e+"; target: "+s,$("#"+i.pre+"title").html(l+", "+t)}else $("#"+i.pre+"title").html(r+" "+l+": "+t);else $("#"+i.pre+"title").html(t)}getLinkToStructureSummary(e){var t=this.icn3d,s=t.icn3dui;let i="https://www.ncbi.nlm.nih.gov/structure/?term=";if(i=void 0!==s.cfg.cid?"https://www.ncbi.nlm.nih.gov/pccompound/?term=":void 0!==s.cfg.refseqid?"https://www.ncbi.nlm.nih.gov/protein/":void 0!==s.cfg.afid?"https://alphafold.ebi.ac.uk/search/text/":Object.keys(t.structures).length>1?"https://www.ncbi.nlm.nih.gov/structure/?term=":s.htmlCls.baseUrl+"pdb/",void 0===t.inputid)i="https://www.ncbi.nlm.nih.gov/pccompound/?term="+t.molTitle;else{let n=t.inputid.split("_");1===n.length?(i+=t.inputid,e&&s.htmlCls.clickMenuCls.setLogCmd("link to "+t.inputid+": "+i,!1)):2===n.length&&(s.cfg.afid?i+=n[0]+" "+n[1]:i+=n[0]+" OR "+n[1],e&&s.htmlCls.clickMenuCls.setLogCmd("link to structures "+n[0]+" and "+n[1]+": "+i,!1))}return i}setEntrezLinks(e){var t=this.icn3d,s=t.icn3dui;let i,n=Object.keys(t.structures);if(1===n.length){i="https://www.ncbi.nlm.nih.gov/"+e+"/?term="+n[0],s.htmlCls.clickMenuCls.setLogCmd("Entrez "+e+" about PDB "+n[0]+": "+i,!1);let l=t.structures&&Object.keys(t.structures).length>0?"_blank":"_self";window.open(i,l)}else if(2===n.length){i="https://www.ncbi.nlm.nih.gov/"+e+"/?term="+n[0]+" OR "+n[1],s.htmlCls.clickMenuCls.setLogCmd("Entrez "+e+" about PDB "+n[0]+" OR "+n[1]+": "+i,!1);let l=t.structures&&Object.keys(t.structures).length>0?"_blank":"_self";window.open(i,l)}}}class xs{constructor(e){this.icn3d=e}async shareLink(e,t){let s=this.icn3d,i=s.icn3dui,n=this.shareLinkUrl(),l=n.length>4e3||0!==n.indexOf("http"),r=Object.keys(s.structures).join("_");if(r==s.defaultPdbId&&(s.filename?r=s.filename:s.inputid&&(r=s.inputid)),e){if(t||s.bInputfile||l)return void s.saveFileCls.saveFile(r+"_icn3d_loadable.png","png")}else{if(s.bInputfile&&!s.bInputUrlfile)return void alert("Share Link does NOT work when the data are from custom files. Please save 'iCn3D PNG Image' in the File menu and open it in iCn3D.");if(l)return void alert("The url is more than 4000 characters and may not work. Please save 'iCn3D PNG Image' or 'State File' and open them in iCn3D.");i.htmlCls.clickMenuCls.setLogCmd("share link: "+n,!1)}let o="Problem in getting shortened URL";if(!i.cfg.notebook){let t=await this.getShareLinkPrms(n,e);if(void 0!==t.shortLink&&(o=t.shortLink,e)){let e=o.split("/"),t=e[e.length-1];s.saveFileCls.saveFile(r+"-"+t+".png","png");let i='\n\n",s.saveFileCls.saveFile(r+"-"+t+".html","html",i)}e&&void 0===t.shortLink&&s.saveFileCls.saveFile(r+"_icn3d_loadable.png","png");let i=o.split("page.link/");2==i.length&&(o="https://structure.ncbi.nlm.nih.gov/icn3d/share.html?"+i[1]),$("#"+s.pre+"short_url").val(o),$("#"+s.pre+"short_url_title").val(o+"&t="+s.yournote)}let a=this.shareLinkUrl(void 0,!0),d="view = icn3dpy.view(q='"+(i.cfg.url?"url="+i.cfg.url:i.cfg.idname+"="+i.cfg.idvalue)+"',command='"+a+"')\nview";(i.cfg.url||i.cfg.idname)&&$("#"+s.pre+"jn_commands").val(d),$("#"+s.pre+"ori_url").val(n),e||i.htmlCls.dialogCls.openDlg("dl_copyurl","Copy a Share Link URL or Jupyter Notebook Commands")}getShareLinkPrms(e,t){let s=this.icn3d,i=s.icn3dui;return new Promise((function(n,l){$.ajax({url:"https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=AIzaSyBxl9CgM0dY5lagHL4UOhEpLWE1fuwdnvc",type:"POST",data:{longDynamicLink:"https://icn3d.page.link/?link="+encodeURIComponent(e)},dataType:"json",success:function(e){n(e)},error:function(n,l,r){let o="Problem in getting shortened URL";$("#"+s.pre+"ori_url").val(e),$("#"+s.pre+"short_url").val(o),$("#"+s.pre+"short_url_title").val(o+"&t="+s.yournote),t||i.htmlCls.dialogCls.openDlg("dl_copyurl","Copy a Share Link URL")}})}))}shareLinkUrl(e,t){let s=this.icn3d,i=s.icn3dui,n=i.htmlCls.baseUrl+"icn3d/?",l="";if(i.cfg.bSidebyside&&(n=i.htmlCls.baseUrl+"icn3d/full2.html?"),s.bInputUrlfile){n=window.location.href.split("?")[0]+"?"+s.inputurl+"&"}let r,o={};for(let e in s.cfg){let t=s.cfg[e];"inpara"!==e&&"command"!==e&&"usepdbnum"!==e&&"date"!==e&&"v"!==e&&void 0!==t&&("width"===e&&"100%"===t||"height"===e&&"100%"===t||"resize"===e&&!0===t||"showmenu"===e&&!0===t||"showtitle"===e&&!0===t||"showcommand"===e&&!0===t||"mobilemenu"===e&&!1===t||"showanno"===e&&!1===t||"showseq"===e&&!1===t||"showalignseq"===e&&!1===t||"show2d"===e&&!1===t||"showsets"===e&&!1===t||"rotate"===e&&"right"===t||"command"!==e&&("options"===e?Object.keys(t).length>0&&(o[e]=JSON.stringify(t)):!0===t?o[e]=1:!1===t?o[e]=0:""!==t&&(o[e]=t)))}s.bAfMem?o.afmem="on":(i.cfg.afid||1==Object.keys(s.structures).length&&Object.keys(s.structures)[0].length>5)&&(o.afmem="off");let a=-1;void 0!==i.cfg.inpara&&(a=i.cfg.inpara.indexOf("&command=")),r=-1!==a?i.cfg.inpara.substr(0,a):i.cfg.inpara;let d=!1;if(!s.bInputUrlfile){let e=r&&r.substr(1)?r.substr(1).split("&"):[];for(let t=0,s=e.length;tc){u=s.commands[c].split("|||")[0].split("&command=")[0].trim(),-1!==u.indexOf(g)&&++f}let b,C=c+1,y="";for(let e=s.commands.length;Ct.substr(0,s))return 1;if(e.substr(0,s)==t.substr(0,s)){if(parseInt(e.substr(s+1))
",void(l.areahtml=n)}let p,m,u,g=c.vertices,f=c.faces,b=r.parasCls.thr("#00FFFF"),C=r.parasCls.thr("#00FF00"),y=r.parasCls.thr("#ff0000"),v=r.parasCls.thr("#00FFFF"),_=r.parasCls.thr("#0000FF"),w=r.parasCls.thr("#FF0000");11!=t&&12!=t&&13!=t&&14!=t||void 0===l.rmsd_supr||void 0===l.rmsd_supr.rot||(p=l.rmsd_supr.rot,m=l.rmsd_supr.trans1,u=l.rmsd_supr.trans2);let S=(11==t||12==t||13==t||14==t&&"delphi"!=l.loadPhiFrom)&&void 0!==l.rmsd_supr&&void 0!==l.rmsd_supr.rot;n=new THREE.BufferGeometry;let A,x=[],k=[],O=[],R=0;for(let e=0,s=g.length;e ";for(let e=0,t=i.length;eStructure Chain Residue Number "+i[e].substr(0,t)+" "+i[e].substr(t+1,s-t-1)+" "+i[e].substr(s+1)+" "}let l=Object.keys(t.utilsCls.getHlStructures()).join(",");e.saveFileCls.saveFile(l+"_residues.txt","html",n)}addStabilizer(){let e=this.icn3d,t=e.icn3dui,s=3.5;if(Object.keys(e.dAtoms).length>0){let i,n={},l=12.25,r=3.2*3.2;for(let t in e.dAtoms){let s=e.atoms[t];!e.nucleotides.hasOwnProperty(s.serial)||"N1"!==s.name&&"N2"!==s.name&&"N3"!==s.name&&"N4"!==s.name&&"N6"!==s.name&&"O2"!==s.name&&"O6"!==s.name||(i=s.structure+"_"+s.chain+"_"+s.resi+"_"+s.name,n[i]=s)}let o=Object.keys(n),a=o.length;void 0===e.pairArray&&(e.pairArray=[]);for(let t=0;ts)continue;let h=Math.abs(n[a].coord.y-n[d].coord.y);if(h>s)continue;let p=Math.abs(n[a].coord.z-n[d].coord.z);if(p>s)continue;let m=c*c+h*h+p*p;m>l||m0&&(l+=","),l+=n[e].substr(0,n[e].indexOf("_"));s.chainidArray=[e].concat(n),s.chainidArray=s.chainalignParserCls.addPostfixForChainids(s.chainidArray),t.htmlCls.clickMenuCls.setLogCmd("resdef "+t.cfg.resdef,!0),s.loadCmd="vast_search_chainid "+s.chainidArray,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),s.bMmdbafid=!0;let r=!0;await s.chainalignParserCls.downloadMmdbAf(l,r)}}else if(void 0!==t.cfg.url){s.bInputUrlfile=!0;let e=t.cfg.url.split("|"),i=e[0],n=e[1];s.molTitle="",s.inputid=n,s.inputurl="type="+i+"&url="+encodeURIComponent(n),s.loadCmd="load url "+n+" | type "+i,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.pdbParserCls.downloadUrl(n,i,t.cfg.command)}else if(void 0!==t.cfg.mmtfid)s.inputid=t.cfg.mmtfid,s.loadCmd="load mmtf "+t.cfg.mmtfid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmtfParserCls.downloadMmtf(t.cfg.mmtfid);else if(void 0!==t.cfg.pdbid)s.inputid=t.cfg.pdbid,s.loadCmd="load pdb "+t.cfg.pdbid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.pdbParserCls.downloadPdb(t.cfg.pdbid);else if(void 0!==t.cfg.afid){s.inputid=t.cfg.afid,s.loadCmd="load af "+t.cfg.afid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0);let e=!0;await s.pdbParserCls.downloadPdb(t.cfg.afid,e)}else if(void 0!==t.cfg.opmid)s.inputid=t.cfg.opmid,s.loadCmd="load opm "+t.cfg.opmid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.opmParserCls.downloadOpm(t.cfg.opmid);else if(void 0!==t.cfg.mmdbid)s.inputid=t.cfg.mmdbid,s.loadCmd="load mmdb "+t.cfg.mmdbid+" | parameters "+t.cfg.inpara,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadMmdb(t.cfg.mmdbid);else if(void 0!==t.cfg.gi)s.loadCmd="load gi "+t.cfg.gi,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadGi(t.cfg.gi);else if(void 0!==t.cfg.refseqid)s.inputid=t.cfg.refseqid,s.loadCmd="load refseq "+t.cfg.refseqid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadRefseq(t.cfg.refseqid);else if(void 0!==t.cfg.protein)s.inputid=t.cfg.protein,s.loadCmd="load protein "+t.cfg.protein,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadProteinname(t.cfg.protein);else if(void 0!==t.cfg.blast_rep_id)if(s.inputid=t.cfg.query_id+","+t.cfg.blast_rep_id,t.cfg.oriQuery_id=t.cfg.query_id,t.cfg.oriBlast_rep_id=t.cfg.blast_rep_id,"Query"!==t.cfg.query_id.substr(0,5)&&void 0===t.cfg.rid)"icn3d"==t.cfg.from&&"1TSR_A"==t.cfg.blast_rep_id&&"NP_001108451.1"==t.cfg.query_id&&(t.cfg.command="view annotations; set annotation cdd; set annotation site; set view detailed view; select chain 1TSR_A; show selection"),"smithwm"==t.cfg.alg?(s.loadCmd="load seq_struct_ids_smithwm "+t.cfg.query_id+","+t.cfg.blast_rep_id,s.bSmithwm=!0):"local_smithwm"==t.cfg.alg?(s.loadCmd="load seq_struct_ids_local_smithwm "+t.cfg.query_id+","+t.cfg.blast_rep_id,s.bLocalSmithwm=!0):(s.loadCmd="load seq_struct_ids "+t.cfg.query_id+","+t.cfg.blast_rep_id,s.bSmithwm=!1,s.bLocalSmithwm=!1),t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadBlast_rep_id(t.cfg.query_id+","+t.cfg.blast_rep_id);else if(void 0!==t.cfg.rid){let e="https://blast.ncbi.nlm.nih.gov/Blast.cgi?RESULTS_FILE=on&FORMAT_TYPE=JSON2_S&FORMAT_OBJECT=Alignment&CMD=Get&RID="+t.cfg.rid,i=await t.getAjaxPromise(e,"json",!1,"The RID "+t.cfg.rid+" may have expired...");for(let e=0,n=i.BlastOutput2.length;e";for(let e=1;e<=4;++e){let s=2*e;t+=this.getRadio("mn6_labelscale","mn6_labelscale0"+s,"0."+s,void 0,1,2)}for(let e=1;e<=5;++e)t+=1==e?this.getRadio("mn6_labelscale","mn6_labelscale"+e+"0",e+".0",!0,1,2):this.getRadio("mn6_labelscale","mn6_labelscale"+e+"0",e+".0",void 0,1,2);if(t+="
",t+="",t+=this.getMenuSep(),void 0===e.cfg.cid){t+=this.getMenuText("mn6_chemicalbindingwrap","Chem. Binding",void 0,void 0,1),t+="",t+=this.getRadio("mn6_chemicalbinding","mn6_chemicalbindingshow","Show",void 0,void 0,2),t+=this.getRadio("mn6_chemicalbinding","mn6_chemicalbindinghide","Hide",!0,void 0,2),t+="
",t+="",t+=this.getMenuText("mn6_ssbondswrap","Disulfide Bonds",void 0,1,1),t+="",t+=this.getRadio("mn6_ssbonds","mn6_ssbondsYes","Show",!0,1,2),t+=this.getRadio("mn6_ssbonds","mn6_ssbondsExport","Export Pairs",void 0,void 0,2),t+=this.getRadio("mn6_ssbonds","mn6_ssbondsNo","Hide",void 0,1,2),t+="
",t+="",t+=this.getMenuText("mn6_clbondswrap","Cross-Linkages",void 0,void 0,1),t+="",t+=this.getRadio("mn6_clbonds","mn6_clbondsYes","Show",!0,void 0,2),t+=this.getRadio("mn6_clbonds","mn6_clbondsExport","Export Pairs",void 0,void 0,2),t+=this.getRadio("mn6_clbonds","mn6_clbondsNo","Hide",void 0,void 0,2),t+="
",t+="";let s=void 0!==e.cfg.mmtfid||void 0!==e.cfg.pdbid||void 0!==e.cfg.opmid||void 0!==e.cfg.mmcifid||void 0!==e.cfg.mmdbid||void 0!==e.cfg.mmdbafid||void 0!==e.cfg.gi||void 0!==e.cfg.blast_rep_id;s&&(t+=this.getMenuText("assemblyWrapper","Assembly",void 0,1,1),t+="",e.cfg.bu?(t+=this.getRadio("mn6_assembly","mn6_assemblyYes","Biological Assembly",!0,1,2),t+=this.getRadio("mn6_assembly","mn6_assemblyNo","Asymmetric Unit",void 0,1,2)):(t+=this.getRadio("mn6_assembly","mn6_assemblyYes","Biological Assembly",void 0,1,2),t+=this.getRadio("mn6_assembly","mn6_assemblyNo","Asymmetric Unit",!0,1,2)),t+="
",t+=""),t+=this.getMenuText("mn6_symmetrywrap","Symmetry",void 0,void 0,1),t+="",s&&(t+=this.getLink("mn6_symmetry","from PDB(precalculated) "+e.htmlCls.wifiStr,void 0,2)),t+=this.getLink("mn6_symd","from SymD(Dynamic) "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn6_clear_sym","Clear SymD Symmetry",void 0,2),t+=this.getLink("mn6_axes_only","Show Axes Only",void 0,2),t+="
",t+="",t+=this.getMenuText("mn6_igrefwrap","Ref. Number",void 0,void 0,1),t+="",
+//!!!
+t+=this.getLink("mn6_igrefYes","Show Ig Ref. Number",void 0,2),t+=this.getLink("mn6_igrefTpl","Ig w/ Specified Template",void 0,2),t+=this.getLink("mn6_igrefNo","Hide Ig Ref. Number",void 0,2),t+=this.getMenuSep(),t+=this.getLink("mn6_customref","Custom Ref. Number",void 0,2),t+="
",t+="",t+=this.getMenuSep()}return t+=this.getLink("mn6_yournote","Window Title",void 0,1),void 0!==e.cfg.cid?(t+=this.getMenuText("mn1_linkwrap","Links",void 0,void 0,1),t+="",t+=this.getLink("mn1_link_structure","Compound Summary "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_vast","Similar Compounds "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_bind","Structures Bound "+e.htmlCls.wifiStr,void 0,2),t+="
",t+=""):(t+=this.getMenuText("mn1_linkwrap","Links",void 0,void 0,1),t+="",t+=this.getLink("mn1_link_structure","Structure Summary "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_vast","Similar Structures "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_pubmed","Literature "+e.htmlCls.wifiStr,void 0,2),t+=this.getLink("mn1_link_protein","Protein "+e.htmlCls.wifiStr,void 0,2),t+="
",t+=""),t+="",t+=this.getMenuUrl("abouticn3d",e.htmlCls.baseUrl+"icn3d/icn3d.html#about","About iCn3D "+e.REVISION+"",1,1),t+=this.getMenuUrl("gallery",e.htmlCls.baseUrl+"icn3d/icn3d.html#gallery","Live Gallery "+e.htmlCls.wifiStr,1,1),t+=this.getMenuUrl("video",e.htmlCls.baseUrl+"icn3d/icn3d.html#videos","Videos & Tutorials",1,1),t+=this.getMenuText("mn6_faq","FAQ",void 0,1,1),t+="
",t}hideMenu(){let e=this.icn3dui;e.bNode||(void 0!==$("#"+e.pre+"mnlist")[0]&&($("#"+e.pre+"mnlist")[0].style.display="none"),void 0!==$("#"+e.pre+"mnLogSection")[0]&&($("#"+e.pre+"mnLogSection")[0].style.display="none"),void 0!==$("#"+e.pre+"cmdlog")[0]&&($("#"+e.pre+"cmdlog")[0].style.display="none"),$("#"+e.pre+"title")[0].style.margin="10px 0 0 10px")}showMenu(){let e=this.icn3dui;e.bNode||(void 0!==$("#"+e.pre+"mnlist")[0]&&($("#"+e.pre+"mnlist")[0].style.display="block"),void 0!==$("#"+e.pre+"mnLogSection")[0]&&($("#"+e.pre+"mnLogSection")[0].style.display="block"),void 0!==$("#"+e.pre+"cmdlog")[0]&&($("#"+e.pre+"cmdlog")[0].style.display="block"))}}class c{constructor(e){this.icn3dui=e}openDlg(e,t){let s=this.icn3dui;s.icn3d,s.bNode||(e=s.pre+e,s.cfg.notebook?this.openDlgNotebook(e,t):this.openDlgRegular(e,t),s.htmlCls.themecolor||(s.htmlCls.themecolor="blue"),s.htmlCls.setMenuCls.setTheme(s.htmlCls.themecolor))}addSaveButton(e){let t=this.icn3dui;t.icn3d,t.bNode||void 0!==this.dialogHashSave&&this.dialogHashSave.hasOwnProperty(e)||($("#"+e).parent().children(".ui-dialog-titlebar").append(""),void 0===this.dialogHashSave&&(this.dialogHashSave={}),this.dialogHashSave[e]=1)}addHideButton(e){let t=this.icn3dui;t.icn3d,t.bNode||void 0!==this.dialogHashHide&&this.dialogHashHide.hasOwnProperty(e)||($("#"+e).parent().children(".ui-dialog-titlebar").append(""),void 0===this.dialogHashHide&&(this.dialogHashHide={}),this.dialogHashHide[e]=1)}getDialogStatus(){let e=this.icn3dui;if(e.icn3d,e.bNode)return;let t={},s={},i=$("#"+e.pre+"dl_selectannotations").hasClass("ui-dialog-content"),n=$("#"+e.pre+"dl_graph").hasClass("ui-dialog-content"),l=$("#"+e.pre+"dl_linegraph").hasClass("ui-dialog-content"),r=$("#"+e.pre+"dl_scatterplot").hasClass("ui-dialog-content"),o=$("#"+e.pre+"dl_contactmap").hasClass("ui-dialog-content"),a=$("#"+e.pre+"dl_alignerrormap").hasClass("ui-dialog-content"),d=$("#"+e.pre+"dl_interactionsorted").hasClass("ui-dialog-content"),c=$("#"+e.pre+"dl_alignment").hasClass("ui-dialog-content"),h=$("#"+e.pre+"dl_2ddgm").hasClass("ui-dialog-content"),p=$("#"+e.pre+"dl_2dctn").hasClass("ui-dialog-content"),m=$("#"+e.pre+"dl_definedsets").hasClass("ui-dialog-content");return t.bSelectannotationsInit2=!1,t.bGraph2=!1,t.bLineGraph2=!1,t.bScatterplot2=!1,t.bTable2=!1,t.bAlignmentInit2=!1,t.bTwoddgmInit2=!1,t.bTwodctnInit2=!1,t.bSetsInit2=!1,s.dl_selectannotations="bSelectannotationsInit2",s.dl_graph="bGraph2",s.dl_linegraph="bLineGraph2",s.dl_scatterplot="bScatterplot2",s.dl_contactmap="bContactmap2",s.dl_alignerrormap="bAlignerrormap2",s.dl_interactionsorted="bTable2",s.dl_alignment="bAlignmentInit2",s.dl_2ddgm="bTwoddgmInit2",s.dl_2dctn="bTwodctnInit2",s.dl_definedsets="bSetsInit2",i&&(t.bSelectannotationsInit2=$("#"+e.pre+"dl_selectannotations").dialog("isOpen")),n&&(t.bGraph2=$("#"+e.pre+"dl_graph").dialog("isOpen")),l&&(t.bLineGraph2=$("#"+e.pre+"dl_linegraph").dialog("isOpen")),r&&(t.bScatterplot2=$("#"+e.pre+"dl_scatterplot").dialog("isOpen")),o&&(t.bContactmap2=$("#"+e.pre+"dl_contactmap").dialog("isOpen")),a&&(t.bAlignerror2=$("#"+e.pre+"dl_alignerrormap").dialog("isOpen")),d&&(t.bTable2=$("#"+e.pre+"dl_interactionsorted").dialog("isOpen")),c&&(t.bAlignmentInit2=$("#"+e.pre+"dl_alignment").dialog("isOpen")),h&&(t.bTwoddgmInit2=$("#"+e.pre+"dl_2ddgm").dialog("isOpen")),p&&(t.bTwodctnInit2=$("#"+e.pre+"dl_2dctn").dialog("isOpen")),m&&(t.bSetsInit2=$("#"+e.pre+"dl_definedsets").dialog("isOpen")),{status:t,id2flag:s}}openDlgHalfWindow(e,t,s,i){let n=this.icn3dui,l=n.icn3d;if(n.bNode)return;let r=this,o=n.htmlCls.width2d+20;l.resizeCanvasCls.resizeCanvas(n.htmlCls.WIDTH-s,n.htmlCls.HEIGHT,i);let a,d=n.htmlCls.HEIGHT,c=s;a=!n.cfg.showmenu||n.utilsCls.isMobile()||n.cfg.mobilemenu?{my:"left top",at:"right top",of:"#"+n.pre+"viewer",collision:"none"}:{my:"left top",at:"right top+40",of:"#"+n.pre+"viewer",collision:"none"},n.cfg.resize=!1,window.dialog=$("#"+e).dialog({autoOpen:!0,title:t,height:d,width:c,modal:!1,position:a,close:function(t){let s=r.getDialogStatus(),i=s.status,a=s.id2flag,d=!1;for(let t in a){let s=e===n.pre+t;for(let e in i)i.hasOwnProperty(e)||(s=s&&!i[e]);d=d||s}if(d)if(i.bTwoddgmInit2||i.bTwodctnInit2||i.bSetsInit2){let e=n.utilsCls.isMobile()?n.htmlCls.WIDTH:n.htmlCls.WIDTH-o;l.resizeCanvasCls.resizeCanvas(e,n.htmlCls.HEIGHT,!0),i.bTwoddgmInit2&&r.openDlg2Ddgm(n.pre+"dl_2ddgm",void 0,i.bSetsInit2),i.bTwodctnInit2&&r.openDlg2Ddgm(n.pre+"dl_2dctn",void 0,i.bSetsInit2),i.bSetsInit2&&r.openDlg2Ddgm(n.pre+"dl_definedsets")}else l.resizeCanvasCls.resizeCanvas(n.htmlCls.WIDTH,n.htmlCls.HEIGHT,!0)},resize:function(t){if(e==n.pre+"dl_selectannotations")l.annotationCls.hideFixedTitle();else if(e==n.pre+"dl_graph"){let t=$("#"+e).width(),s=$("#"+e).height();d3.select("#"+n.svgid).attr("width",t).attr("height",s)}else if(e==n.pre+"dl_linegraph"||e==n.pre+"dl_scatterplot"||e==n.pre+"dl_contactmap"||e==n.pre+"dl_alignerrormap"){let t=status.bTwoddgmInit2||status.bSetsInit2?(n.htmlCls.WIDTH-o)/2:n.htmlCls.WIDTH/2,s=$("#"+e).width()/t;if(e==n.pre+"dl_linegraph"){let e=l.linegraphWidth*s;$("#"+n.linegraphid).attr("width",e)}else if(e==n.pre+"dl_scatterplot"){let e=l.scatterplotWidth*s;$("#"+n.scatterplotid).attr("width",e)}else if(e==n.pre+"dl_contactmap"){let e=l.contactmapWidth*s;$("#"+n.contactmapid).attr("width",e)}else if(e==n.pre+"dl_alignerrormap"){let e=l.alignerrormapWidth*s;$("#"+n.alignerrormapid).attr("width",e)}}}}),this.addSaveButton(e),this.addHideButton(e)}openDlg2Ddgm(e,t,s){let i=this.icn3dui,n=i.icn3d;if(i.bNode)return;let l,r,o=this,a=i.htmlCls.width2d+20;e===i.pre+"dl_definedsets"?(l="right top",r="Select sets"):e!==i.pre+"dl_2ddgm"&&e!==i.pre+"dl_2dctn"||(l=s?"right top+240":"right top",r=e===i.pre+"dl_2ddgm"?"2D Diagram":"2D Cartoon");let d={my:"left top+"+i.htmlCls.MENU_HEIGHT,at:l,of:"#"+i.pre+"viewer",collision:"none"};window.dialog=$("#"+e).dialog({autoOpen:!0,title:r,height:"auto",width:a,modal:!1,position:d,close:function(e){let t=o.getDialogStatus().status;t.bSelectannotationsInit2||t.bGraph2||t.bLineGraph2||t.bScatterplot2||t.bTable2||t.bAlignmentInit2||n.resizeCanvasCls.resizeCanvas(i.htmlCls.WIDTH,i.htmlCls.HEIGHT,!0)},resize:function(t,s){e==i.pre+"dl_2dctn"&&(n.resizeRatioX=s.size.width/i.htmlCls.width2d,n.resizeRatioY=s.size.height/(i.htmlCls.width2d+70))},resizeStop:function(e,t){n.resizeRatioX=t.size.width/i.htmlCls.width2d,n.resizeRatioY=t.size.height/(i.htmlCls.width2d+70)}}),this.addSaveButton(e),this.addHideButton(e)}openDlgRegular(e,t){let s=this.icn3dui,i=s.icn3d;if(s.bNode)return;let n=400,l=150,r=s.htmlCls.width2d+20,o=this.getDialogStatus().status;if(e===s.pre+"dl_selectannotations"||e===s.pre+"dl_graph"||e===s.pre+"dl_linegraph"||e===s.pre+"dl_scatterplot"||e===s.pre+"dl_contactmap"||e===s.pre+"dl_alignerrormap"||e===s.pre+"dl_interactionsorted"||e===s.pre+"dl_alignment"){let a=.5*s.htmlCls.WIDTH-.5*r;if(s.htmlCls.WIDTH>=s.htmlCls.HEIGHT)this.openDlgHalfWindow(e,t,a,!0),(o.bTwoddgmInit2||o.bTwodctnInit2||o.bSetsInit2)&&(i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH-a-r,s.htmlCls.HEIGHT,!0),o.bTwoddgmInit2&&this.openDlg2Ddgm(s.pre+"dl_2ddgm",void 0,o.bSetsInit2),o.bTwodctnInit2&&this.openDlg2Ddgm(s.pre+"dl_2dctn",void 0,o.bSetsInit2),o.bSetsInit2&&this.openDlg2Ddgm(s.pre+"dl_definedsets"));else{i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH,.5*s.htmlCls.HEIGHT,!0),l=.5*s.htmlCls.HEIGHT,n=s.htmlCls.WIDTH;let a={my:"left top",at:"left bottom+32",of:"#"+s.pre+"canvas",collision:"none"};window.dialog=$("#"+e).dialog({autoOpen:!0,title:t,height:l,width:n,modal:!1,position:a,close:function(t){if(!((e!==s.pre+"dl_selectannotations"||o.bAlignmentInit2||o.bGraph2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_graph"||o.bSelectannotationsInit2||o.bAlignmentInit2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_alignment"||o.bSelectannotationsInit2||o.bGraph2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_interactionsorted"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_linegraph"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bTable2||o.bScatterplot2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_scatterplot"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bTable2||o.bLineGraph2||o.bContactmap2||o.bAlignerrormap2)&&(e!==s.pre+"dl_contactmap"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bAlignerrormap2)&&(e!==s.pre+"dl_alignerrormap"||o.bSelectannotationsInit2||o.bGraph2||o.bAlignmentInit2||o.bTable2||o.bLineGraph2||o.bScatterplot2||o.bContactmap2)))if(o.bTwoddgmInit2||o.bTwodctnInit2||o.bSetsInit2){let e=s.utilsCls.isMobile()?s.htmlCls.WIDTH:s.htmlCls.WIDTH-r;i.resizeCanvasCls.resizeCanvas(e,s.htmlCls.HEIGHT,!0),o.bTwoddgmInit2&&thisClass.openDlg2Ddgm(s.pre+"dl_2ddgm",void 0,o.bSetsInit2),o.bTwodctnInit2&&thisClass.openDlg2Ddgm(s.pre+"dl_2dctn",void 0,o.bSetsInit2),o.bSetsInit2&&thisClass.openDlg2Ddgm(s.pre+"dl_definedsets")}else i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH,s.htmlCls.HEIGHT,!0)},resize:function(t){if(e==s.pre+"dl_selectannotations")i.annotationCls.hideFixedTitle();else if(e==s.pre+"dl_graph"){let t=$("#"+e).width(),i=$("#"+e).height();d3.select("#"+s.svgid).attr("width",t).attr("height",i)}else if(e==s.pre+"dl_linegraph"||e==s.pre+"dl_scatterplot"||e==s.pre+"dl_contactmap"||e==s.pre+"dl_alignerrormap"){let t=o.bTwoddgmInit2||o.bSetsInit2?(s.htmlCls.WIDTH-r)/2:s.htmlCls.WIDTH/2,n=$("#"+e).width()/t;if(e==s.pre+"dl_linegraph"){let e=i.linegraphWidth*n;$("#"+s.linegraphid).attr("width",e)}else if(e==s.pre+"dl_scatterplot"){let e=i.scatterplotWidth*n;$("#"+s.scatterplotid).attr("width",e)}else if(e==s.pre+"dl_contactmap"){let e=i.contactmapWidth*n;$("#"+s.contactmapid).attr("width",e)}else if(e==s.pre+"dl_alignerrormap"){let e=i.alignerrormapWidth*n;$("#"+s.alignerrormapid).attr("width",e)}}}}),this.addSaveButton(e),this.addHideButton(e)}}else if(e===s.pre+"dl_2ddgm"||e===s.pre+"dl_2dctn"){let t=0;if(s.htmlCls.WIDTH>=s.htmlCls.HEIGHT)(o.bSelectannotationsInit2||o.bGraph2||o.bLineGraph2||o.bScatterplot2||o.bTable2||o.bAlignmentInit2)&&(t=.5*s.htmlCls.WIDTH-.5*r),i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH-t-r,s.htmlCls.HEIGHT,!0),this.openDlg2Ddgm(e,void 0,o.bSetsInit2);else{let t=s.utilsCls.isMobile()?s.htmlCls.WIDTH:s.htmlCls.WIDTH-r;i.resizeCanvasCls.resizeCanvas(t,.5*s.htmlCls.HEIGHT,!0),this.openDlg2Ddgm(e,.5*s.htmlCls.HEIGHT),this.openDlg2Ddgm(e,.5*s.htmlCls.HEIGHT,o.bSetsInit2)}}else{let a;if(l="auto",n="auto",e===s.pre+"dl_addtrack"?n="50%":e===s.pre+"dl_menupref"&&(n=600,l=500),e===s.pre+"dl_definedsets"){let t=0;if(s.htmlCls.WIDTH>=s.htmlCls.HEIGHT)(o.bSelectannotationsInit2||o.bGraph2||o.bLineGraph2||o.bScatterplot2||o.bTable2||o.bAlignmentInit2)&&(t=.5*s.htmlCls.WIDTH-.5*r),i.resizeCanvasCls.resizeCanvas(s.htmlCls.WIDTH-t-r,s.htmlCls.HEIGHT,!0),this.openDlg2Ddgm(e),o.bTwoddgmInit2&&this.openDlg2Ddgm(s.pre+"dl_2ddgm",void 0,!0),o.bTwodctnInit2&&this.openDlg2Ddgm(s.pre+"dl_2dctn",void 0,!0);else{let t=s.utilsCls.isMobile()?s.htmlCls.WIDTH:s.htmlCls.WIDTH-r;i.resizeCanvasCls.resizeCanvas(t,.5*s.htmlCls.HEIGHT,!0),this.openDlg2Ddgm(e,.5*s.htmlCls.HEIGHT),o.bTwoddgmInit2&&this.openDlg2Ddgm(s.pre+"dl_2ddgm",.5*s.htmlCls.HEIGHT,!0),o.bTwodctnInit2&&this.openDlg2Ddgm(s.pre+"dl_2dctn",.5*s.htmlCls.HEIGHT,!0)}}else s.utilsCls.isMobile()?a={my:"left top",at:"left bottom-50",of:"#"+s.pre+"canvas",collision:"none"}:e===s.pre+"dl_allinteraction"||e===s.pre+"dl_buriedarea"?(a={my:"right top",at:"right top+50",of:"#"+i.divid,collision:"none"},n=700,l=500):a=e===s.pre+"dl_rmsd"||e===s.pre+"dl_legend"?{my:"left bottom",at:"left+20 bottom-20",of:"#"+s.pre+"canvas",collision:"none"}:e===s.pre+"dl_symd"?{my:"left top",at:"right-200 bottom-200",of:"#"+s.pre+"canvas",collision:"none"}:s.cfg.align?{my:"left top",at:"left top+90",of:"#"+s.pre+"canvas",collision:"none"}:e===s.pre+"dl_mmdbafid"?{my:"left top",at:"left top+130",of:"#"+s.pre+"canvas",collision:"none"}:{my:"left top",at:"left top+50",of:"#"+s.pre+"canvas",collision:"none"},window.dialog=$("#"+e).dialog({autoOpen:!0,title:t,height:l,width:n,modal:!1,position:a}),this.addSaveButton(e),this.addHideButton(e)}$(".ui-dialog .ui-button span").removeClass("ui-icon-closethick").addClass("ui-icon-close")}openDlgNotebook(e,t){let s=this.icn3dui,i=s.icn3d;if(s.bNode)return;let n=400,l=150,r=s.htmlCls.width2d+20;e===s.pre+"dl_selectannotations"||e===s.pre+"dl_graph"||e===s.pre+"dl_linegraph"||e===s.pre+"dl_scatterplot"||e===s.pre+"dl_contactmap"||e===s.pre+"dl_alignerrormap"||e===s.pre+"dl_interactionsorted"||e===s.pre+"dl_alignment"?($("#"+e).show(),$("#"+e+"_nb").show(),$("#"+e+"_title").html(t),l=.5*s.htmlCls.HEIGHT,n=s.htmlCls.WIDTH,$("#"+e).width(n),$("#"+e).height(l),$("#"+e).resize((function(t){let n=s.htmlCls.WIDTH/2,l=$("#"+e).width()/n;if(e==s.pre+"dl_selectannotations")i.annotationCls.hideFixedTitle();else if(e==s.pre+"dl_graph"){let t=$("#"+e).width(),i=$("#"+e).height();d3.select("#"+s.svgid).attr("width",t).attr("height",i)}else if(e==s.pre+"dl_linegraph"){let e=i.linegraphWidth*l;$("#"+s.linegraphid).attr("width",e)}else if(e==s.pre+"dl_scatterplot"){let e=i.scatterplotWidth*l;$("#"+s.scatterplotid).attr("width",e)}else if(e==s.pre+"dl_contactmap"){let e=i.contactmapWidth*l;$("#"+s.contactmapid).attr("width",e)}else if(e==s.pre+"dl_alignerrormap"){let e=i.alignerrormapWidth*l;$("#"+s.alignerrormapid).attr("width",e)}}))):(i.bRender&&($("#"+e).show(),$("#"+e+"_nb").show(),$("#"+e+"_title").html(t)),l="auto",n="auto",e===s.pre+"dl_addtrack"?n="50%":e===s.pre+"dl_2ddgm"||e===s.pre+"dl_2dctn"||e===s.pre+"dl_definedsets"?n=r:e!==s.pre+"dl_allinteraction"&&e!==s.pre+"dl_buriedarea"||(n=700,l=500),$("#"+e).width(n),$("#"+e).height(l))}}class h{constructor(e){this.icn3dui=e}setCustomDialogs(){let e=this.icn3dui;if(e.icn3d,e.bNode)return"";return""}getHtmlAlignResidueByResidue(e,t,s){let i=this.icn3dui;i.icn3d;let n="";return n+="All chains will be aligned to the first chain in the comma-separated chain IDs. Each chain ID has the form of PDBID_chain (e.g., 1HHO_A, case sensitive) or UniprotID (e.g., P69905 for AlphaFold structures).",t+=this.getMenuUrl("faq_viewstru",e.htmlCls.baseUrl+"icn3d/icn3d.html#viewstru","View structure",1,2),t+=this.getMenuUrl("faq_tfstru",e.htmlCls.baseUrl+"icn3d/icn3d.html#tfstru","Transform Structure",1,2),t+=this.getMenuUrl("faq_selsubset",e.htmlCls.baseUrl+"icn3d/icn3d.html#selsubset","Select Subsets",1,2),t+=this.getMenuUrl("faq_stylecolor",e.htmlCls.baseUrl+"icn3d/icn3d.html#changestylecolor","Change Style/Color",1,2),t+=this.getMenuUrl("faq_savework",e.htmlCls.baseUrl+"icn3d/icn3d.html#saveview","Save Work",1,2),t+=this.getMenuUrl("faq_showanno",e.htmlCls.baseUrl+"icn3d/icn3d.html#showanno","Show Annotations",1,2),t+=this.getMenuUrl("faq_exportanno",e.htmlCls.baseUrl+"icn3d/icn3d.html#exportanno","Export Annotations",1,2),t+=this.getMenuUrl("faq_interanal",e.htmlCls.baseUrl+"icn3d/icn3d.html#interanalysis","Interaction Analysis",1,2),t+=this.getMenuUrl("faq_mutanal",e.htmlCls.baseUrl+"icn3d/icn3d.html#mutationanalysis","Mutation Analysis",1,2),t+=this.getMenuUrl("faq_elecpot",e.htmlCls.baseUrl+"icn3d/icn3d.html#elecpot","Electrostatic Pot.",1,2),t+=this.getMenuUrl("faq_simipdb",e.htmlCls.baseUrl+"icn3d/icn3d.html#simivast","Similar PDB",1,2),t+=this.getMenuUrl("faq_simialphapdb",e.htmlCls.baseUrl+"icn3d/icn3d.html#simifoldseek","Similar AlphaFold/PDB",1,2),t+=this.getMenuUrl("faq_alnstru",e.htmlCls.baseUrl+"icn3d/icn3d.html#alignmul","Align Multiple Structures",1,2),t+=this.getMenuUrl("faq_batchanal",e.htmlCls.baseUrl+"icn3d/icn3d.html#batchanalysis","Batch Analysis",1,2),t+=this.getMenuUrl("faq_embedicn3d",e.htmlCls.baseUrl+"icn3d/icn3d.html#embedicn3d","Embed iCn3D",1,2),t+="
",t+="",t+=this.getMenuUrl("citing",e.htmlCls.baseUrl+"icn3d/icn3d.html#citing","Citing iCn3D",void 0,1),t+=this.getMenuText("mn6_source","Source Code",void 0,1,1),t+="",t+=this.getMenuUrl("github","https://github.com/ncbi/icn3d","GitHub (browser) "+e.htmlCls.wifiStr,1,2),t+=this.getMenuUrl("npm","https://www.npmjs.com/package/icn3d","npm (Node.js) "+e.htmlCls.wifiStr,1,2),t+=this.getMenuUrl("notebook","https://pypi.org/project/icn3dpy","Jupyter Notebook "+e.htmlCls.wifiStr,1,2),t+="
",t+="",t+=this.getMenuText("mn6_develop","Develop",void 0,void 0,1),t+="",t+=this.getMenuUrl("dev_embedicn3d2",e.htmlCls.baseUrl+"icn3d/icn3d.html#HowToUse","Embed iCn3D",void 0,2),t+=this.getMenuUrl("dev_urlpara",e.htmlCls.baseUrl+"icn3d/icn3d.html#parameters","URL Parameters",void 0,2),t+=this.getMenuUrl("dev_command",e.htmlCls.baseUrl+"icn3d/icn3d.html#commands","Commands",void 0,2),t+=this.getMenuUrl("dev_datastru",e.htmlCls.baseUrl+"icn3d/icn3d.html#datastructure","Data Structure",void 0,2),t+=this.getMenuUrl("dev_classstru",e.htmlCls.baseUrl+"icn3d/icn3d.html#classstructure","Class Structure",void 0,2),t+=this.getMenuUrl("dev_addclass",e.htmlCls.baseUrl+"icn3d/icn3d.html#addclass","Add New Classes",void 0,2),t+=this.getMenuUrl("dev_modfunc",e.htmlCls.baseUrl+"icn3d/icn3d.html#modifyfunction","Modify Functions",void 0,2),t+=this.getMenuUrl("dev_restful",e.htmlCls.baseUrl+"icn3d/icn3d.html#restfulapi","RESTful APIs",void 0,2),t+=this.getMenuUrl("dev_contributor",e.htmlCls.baseUrl+"icn3d/icn3d.html#contributors","iCn3D Contributors",void 0,2),t+="
",t+="",t+=this.getMenuUrl("helpdoc",e.htmlCls.baseUrl+"icn3d/docs/icn3d_help.html","Help Doc "+e.htmlCls.wifiStr,1,1),t+=this.getMenuSep(),t+=this.getMenuText("mn6_tfhint","Transform Hints",void 0,1,1),t+="",t+=this.getMenuText("mn6_rotate","Rotate",void 0,1,2),t+="
",t+="",t+=this.getMenuUrl("selhints",e.htmlCls.baseUrl+"icn3d/icn3d.html#selsubset","Selection Hints",void 0,1),t+=this.getMenuUrl("helpdesk","https://support.nlm.nih.gov/support/create-case/","Write to Help Desk",1,1),t+="",t+="
",t+="",t+=this.getMenuText("mn6_zoom","Zoom",void 0,1,2),t+="",t+="
",t+="",t+=this.getMenuText("mn6_translate","Translate",void 0,1,2),t+="
(Pinch & Spread)",t+="
",t+="",t+="
(Two Finger Click & Drag)
",n+="Chain IDs: "+i.htmlCls.inputTextStr+"id='"+i.pre+e+"' value='P69905,P01942,1HHO_A' size=50>
",n+='Each alignment is defined as " | "-separated residue lists in one line. "10-50" means a range of residues from 10 to 50.
",n+=i.htmlCls.buttonStr+s+"'>Align Residue by Residue
",n}addNotebookTitle(e,t,s){let i=this.icn3dui;i.icn3d;let n=' ';return s&&(n+=''),n}setDialogs(){let e=this.icn3dui,t=e.icn3d;if(e.bNode)return"";let s="";e.htmlCls.optionStr="",s+=e.htmlCls.optionStr+"'"+r+"4'>4px",s+=e.htmlCls.optionStr+"'"+r+"8' selected>8px",s+=e.htmlCls.optionStr+"'"+r+"12'>12px",s+=e.htmlCls.optionStr+"'"+r+"16'>16px",s+=e.htmlCls.optionStr+"'"+r+"24'>24px",s+=e.htmlCls.optionStr+"'"+r+"32'>32px",s+="",s+="",s+="",s+="",s+=e.htmlCls.divStr+"dl_alignment' class='"+n+"' style='background-color:white;'>",s+=this.addNotebookTitle("dl_alignment","Dynamically Calculated Symmetry using SymD"),s+=e.htmlCls.divStr+"symd_info'>",s+=e.htmlCls.divStr+"alignseqguide_wrapper'>
"+e.htmlCls.setHtmlCls.setAlignSequenceGuide()+"",s+=e.htmlCls.divStr+"dl_sequence2' class='icn3d-dl_sequence'>",s+=this.addNotebookTitle("dl_sequence2","Select Residues in Aligned Sequences"),s+="",s+="",s+=e.htmlCls.divStr+"dl_definedsets' class='"+n+"'>",s+=this.addNotebookTitle("dl_definedsets","Defined Sets"),s+=e.htmlCls.divStr+"dl_setsmenu'>",s+="Defined Sets:
",s+="
',s+="",s+=e.htmlCls.divStr+"dl_command' style='display:none;'>",s+=e.htmlCls.divStr+"dl_setoperations'>",s+="
",s+="
",s+="",s+="
",s+=e.htmlCls.setHtmlCls.setAdvanced(),s+="",s+="",s+=e.htmlCls.setHtmlCls.setAdvanced(2),s+=e.htmlCls.divStr+"dl_vastplus' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_vastplus","Please input PDB ID for VAST+"),s+="Note: VAST+ finds other macromolecular structures that have a similar biological unit. To do this, VAST+ takes into consideration the complete set of 3D domains that VAST identified within a query structure, throughout all of its component protein molecules, and finds other macromolecular structures that have a similar set of proteins/3D domains.
",s+="PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"vastpluspdbid' value='6VXX' size=8>
",s+=e.htmlCls.buttonStr+"reload_vastplus'>VAST+",s+="",s+=e.htmlCls.divStr+"dl_vast' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_vast","Pleaes input chain or PDB file for VAST"),s+="Note: VAST identifies 3D domains (substructures) within each protein structure in the Molecular Modeling Database (MMDB), and then finds other protein structures that have one or more similar 3D domains, using purely geometric criteria. You have two ways to do a VAST search.
",s+="Option 1, search with your selection (all residues are selected by default) in the loaded structures:
",s+='
",s+="Option 2, search with PDB ID and chain name:
",s+="PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"vastpdbid' value='4N7N' size=8> ",s+="Chain Name: "+e.htmlCls.inputTextStr+"id='"+e.pre+"vastchainid' value='A' size=8>
",s+=e.htmlCls.buttonStr+"reload_vast'>VAST
",s+="Option 3, search with a PDB file:
",s+='
",s+="",s+=e.htmlCls.divStr+"dl_foldseek' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_foldseek","Submit your selection to Foldseek"),s+='1. your selection (all residues are selected by default) in the loaded structures to Foldseek web server.
',s+='2 (Optional). Once you see the structure neighbors, you can view the alignment in iCn3D by inputing a list of PDB chain IDs or AlphaFold UniProt IDs below.
The PDB chain IDs are the same as the record names such as "1HHO_A". The UniProt ID is the text between "AF-" and "-F1". For example, the UniProt ID for the record name "AF-P69905-F1-model_v4" is "P69905".
',s+="Chain ID List: "+e.htmlCls.inputTextStr+"id='"+e.pre+"foldseekchainids' value='P69905,P01942,1HHO_A' size=30> ",s+=e.htmlCls.buttonStr+"reload_foldseek'>Align",s+="",s+=e.htmlCls.divStr+"dl_mmtfid' class='"+n+"'>",s+=this.addNotebookTitle("dl_mmtfid","Please input an MMTF ID"),s+="MMTF ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"mmtfid' value='1TUP' size=8> ",s+=e.htmlCls.buttonStr+"reload_mmtf'>Load",s+="",s+=e.htmlCls.divStr+"dl_pdbid' class='"+n+"'>",s+=this.addNotebookTitle("dl_pdbid","Please input a PDB ID"),s+="PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"pdbid' value='1TUP' size=8> ",s+=e.htmlCls.buttonStr+"reload_pdb'>Load",s+="",s+=e.htmlCls.divStr+"dl_afid' class='"+n+"'>",s+=this.addNotebookTitle("dl_afid","Please input an AlphaFold UniProt ID"),s+="Note: AlphaFold produces a per-residue confidence score (pLDDT) between 0 and 100:
",s+=e.htmlCls.clickMenuCls.setAlphaFoldLegend()+"
";let o=e.cfg.afid?e.cfg.afid:"A4D1S0";s+="AlphaFold Uniprot ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"afid' value='"+o+"' size=10>
",s+=e.htmlCls.buttonStr+"reload_af'>Load Structure
",s+="PAE Map: "+e.htmlCls.buttonStr+"reload_afmap'>Load Half"+e.htmlCls.buttonStr+"reload_afmapfull' style='margin-left:30px'>Load Full (slow)",s+="",s+=e.htmlCls.divStr+"dl_refseqid' class='"+n+"'>",s+=this.addNotebookTitle("dl_refseqid","Please input an NCBI protein accession"),s+="NCBI Protein Accession: "+e.htmlCls.inputTextStr+"id='"+e.pre+"refseqid' value='NP_001743.1' size=8> ",s+=e.htmlCls.buttonStr+"reload_refseq'>Load",s+="",s+=e.htmlCls.divStr+"dl_opmid' class='"+n+"'>",s+=this.addNotebookTitle("dl_opmid","Please input an OPM PDB ID"),s+="Orientations of Proteins in Membranes(OPM) PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"opmid' value='6JXR' size=8> ",s+=e.htmlCls.buttonStr+"reload_opm'>Load",s+="",s+=e.htmlCls.divStr+"dl_pdbfile' class='"+n+"'>",s+=this.addNotebookTitle("dl_pdbfile","Please input a PDB file"),s+='Note: Several PDB files could be concatenated into a single PDB file. Use the line "ENDMDL" to separate PDB files.
',s+="PDB File: "+e.htmlCls.inputFileStr+" id='"+e.pre+"pdbfile' size=8> ",s+=e.htmlCls.buttonStr+"reload_pdbfile'>Load",s+="",s+=e.htmlCls.divStr+"dl_pdbfile_app' class='"+n+"'>",s+=this.addNotebookTitle("dl_pdbfile_app","Please append PDB files"),s+="Multiple PDB Files: ",s+=e.htmlCls.buttonStr+"reload_pdbfile_app'>Append",s+="",s+=e.htmlCls.divStr+"dl_rescolorfile' class='"+n+"'>",s+=this.addNotebookTitle("dl_rescolorfile","Please input a residue color file"),s+='
',s+='{"ALA":"#C8C8C8", "ARG":"#145AFF", ..., "G":"#008000", "A":"#6080FF", ...}
',s+="Residue Color File: "+e.htmlCls.inputFileStr+"id='"+e.pre+"rescolorfile' size=8> ",s+=e.htmlCls.buttonStr+"reload_rescolorfile'>Load",s+="",s+=e.htmlCls.divStr+"dl_customcolor' class='"+n+"'>",s+=this.addNotebookTitle("dl_customcolor","Please input a custom color file"),s+=" ",s+='
',s+="Custom File: "+e.htmlCls.inputFileStr+"id='"+e.pre+"cstcolorfile' size=8>
",s+="1. "+e.htmlCls.buttonStr+"reload_customcolorfile'>Apply Custom Color"+e.htmlCls.buttonStr+"remove_legend' style='margin-left:30px;'>Remove Legend
",s+="Score to Color: 0:
",s+="or
",s+="2. "+e.htmlCls.buttonStr+"reload_customtubefile'>Apply Custom Tube",s+="",s+=e.htmlCls.divStr+"dl_customref' class='"+n+"'>",s+=this.addNotebookTitle("dl_customref","Please input a reference number file"),s+='
',s+="refnum,11,12,,21,22,,10C,11C,20C
",s+="1TUP_C,,,,,,,200,201,230",s+='The first row defines the reference residue numbers, which could be any strings. The 1st cell could be anything. The rest cells are reference residue numbers (e.g., 11, 21, 10C, etc.) 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 fourth row shows another set of reference numners for the chain "1TUP_C". It could be a chain from a different structure.
",s+="1TUP_A,100,101,,,132,,,,
",s+="1TUP_B,110,111,,141,142,,,,
',s+='To select all residues corresponding to the reference numbers, you can simplay replace ":" with "%" in the Specification. 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.
',s+="
",s+="Custom File: "+e.htmlCls.inputFileStr+"id='"+e.pre+"cstreffile' size=8>
",s+=e.htmlCls.buttonStr+"reload_customreffile'>Apply Custom Reference Numbers",s+="",s+=e.htmlCls.divStr+"dl_align' class='"+n+"'>",s+=this.addNotebookTitle("dl_align","Please select residues in aligned sequences"),s+="Enter the PDB IDs or MMDB IDs of the structures:
ID1: "+e.htmlCls.inputTextStr+"id='"+e.pre+"alignid1' value='2DN3' size=8>"+e.htmlCls.space3+e.htmlCls.space3+"ID2: "+e.htmlCls.inputTextStr+"id='"+e.pre+"alignid2' value='4N7N' size=8>
",s+="VAST+ based on VAST: "+e.htmlCls.buttonStr+"reload_align_ori'>All Matching Molecules Superposed"+e.htmlCls.space3+e.htmlCls.buttonStr+"reload_align_refined'>Invariant Substructure Superposed
",s+="VAST+ based on TM-align: "+e.htmlCls.buttonStr+"reload_align_tmalign'>All Matching Molecules Superposed
",s+="",s+=e.htmlCls.divStr+"dl_alignaf' class='"+n+"'>",s+=this.addNotebookTitle("dl_alignaf","Align AlphaFold structures"),s+="Enter two AlphaFold Uniprot IDs:
ID1: "+e.htmlCls.inputTextStr+"id='"+e.pre+"alignafid1' value='P41327' size=8>"+e.htmlCls.space3+e.htmlCls.space3+"ID2: "+e.htmlCls.inputTextStr+"id='"+e.pre+"alignafid2' value='P41331' size=8>
",s+=e.htmlCls.buttonStr+"reload_alignaf_tmalign'>Align with TM-align"+e.htmlCls.buttonStr+"reload_alignaf' style='margin-left:30px'>Align with VAST",s+="",s+=e.htmlCls.divStr+"dl_chainalign' class='"+n+"'>",s+=this.addNotebookTitle("dl_chainalign","Align chains"),s+="
",s+="Chain IDs: "+e.htmlCls.inputTextStr+"id='"+e.pre+"chainalignids' value='P69905,P01942,1HHO_A' size=50>
",s+=e.htmlCls.buttonStr+"reload_chainalign_tmalign'>Align with TM-align"+e.htmlCls.buttonStr+"reload_chainalign_asym' style='margin-left:30px'>Align with VAST
",s+='(Note: To align chains in custom PDB files, you could load them in "File > Open File > PDB Files (appendable)" and click "Analysis > Defined Sets". Finally select multiple chains in Defined Sets and click "File > Realign Selection".)
',s+="
",s+="Chain IDs: "+e.htmlCls.inputTextStr+"id='"+e.pre+"chainalignids2' value='P69905,P01942,1HHO_A' size=50>
",s+="The sequence alignment (followed by structure alignemnt) is based on residue numbers in the First/Master chain:
"+e.htmlCls.inputTextStr+"id='"+e.pre+"resalignids' value='1,5,10-50' size=50>
",s+=e.htmlCls.buttonStr+"reload_chainalign_asym2' style='margin-top:3px;'>Align by Sequence Alignment
",s+='(Note: To align chains in custom PDB files, you could load them in "File > Open File > PDB Files (appendable)" and click "Analysis > Defined Sets". Finally select multiple chains in Defined Sets and click "File > Realign Selection".)
',s+="
",s+="Option 2:
",s+="
If you load a custom structure without PDB or UniProt ID, you can open "Seq. & Annotations" window and find the chain ID such as "stru_A". The part before the underscore is the structure ID, which can be used to specify the mutation such as "stru_A_...". Remember to choose "Show Mutation in: Current Page".
',s+="
",s+="ID Type: ",s+='PDB ID',s+='AlphaFold UniProt ID
',s+="Show Mutation in: ",s+='Current Page',s+='New Page
',s+=e.htmlCls.buttonStr+"reload_mutation_3d' title='Show the mutations in 3D using the scap program'>3D with scap",s+=e.htmlCls.buttonStr+"reload_mutation_inter' style='margin-left:20px' title='Show the mutations in 3D and the change of interactions'>Interactions",s+=e.htmlCls.buttonStr+"reload_mutation_pdb' style='margin-left:20px' title='Show the mutations in 3D and export the PDB of the mutant within 10 angstrom'>PDB",s+="
",s+=e.htmlCls.buttonStr+"reload_afmapfile'>Load Half PAE Map"+e.htmlCls.buttonStr+"reload_afmapfilefull' style='margin-left:30px'>Load Full PAE Map (slow)",s+="",s+=e.htmlCls.divStr+"dl_urlfile' class='"+n+"'>",s+=this.addNotebookTitle("dl_urlfile","Please input a file via URL"),s+="File type: ",s+="
",s+="URL in the same host: "+e.htmlCls.inputTextStr+"id='"+e.pre+"urlfile' size=20>
",s+=e.htmlCls.buttonStr+"reload_urlfile'>Load",s+="",s+=e.htmlCls.divStr+"dl_mmciffile' class='"+n+"'>",s+=this.addNotebookTitle("dl_mmciffile","Please input an mmCIF file"),s+="mmCIF File: "+e.htmlCls.inputFileStr+"id='"+e.pre+"mmciffile' value='1TUP' size=8> ",s+=e.htmlCls.buttonStr+"reload_mmciffile'>Load",s+="",s+=e.htmlCls.divStr+"dl_mmcifid' class='"+n+"'>",s+=this.addNotebookTitle("dl_mmcifid","Please input an mmCIF ID"),s+="mmCIF ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"mmcifid' value='1TUP' size=8> ",s+=e.htmlCls.buttonStr+"reload_mmcif'>Load",s+="",s+=e.htmlCls.divStr+"dl_mmdbid' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_mmdbid","Please input an MMDB ID"),s+="MMDB or PDB ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"mmdbid' value='1TUP' size=8>
",s+=e.htmlCls.buttonStr+"reload_mmdb'>Load Biological Unit"+e.htmlCls.buttonStr+"reload_mmdb_asym' style='margin-left:30px'>Load Asymmetric Unit (All Chains)
",s+='Note: The "biological unit" is the biochemically active form of a biomolecule,
The "asymmetric unit" is the raw 3D structure data resolved by X-ray crystallography, NMR, or Cryo-electron microscopy. The asymmetric unit is equivalent to the biological unit in approximately 60% of structure records. In the remaining 40% of the records, the asymmetric unit represents a portion of the biological unit that can be reconstructed using crystallographic symmetry, or it represents multiple copies of the biological unit.',s+="",s+=e.htmlCls.divStr+"dl_mmdbafid' class='"+n+"' style='max-width:600px'>",s+=this.addNotebookTitle("dl_mmdbafid","Please input a list of PDB/AlphaFold IDs"),s+="List of PDB, MMDB, or AlphaFold UniProt structures: "+e.htmlCls.inputTextStr+"id='"+e.pre+"mmdbafid' placeholder='e.g., 1HHO,4N7N,P69905,P01942' size=30>
",s+=""+e.htmlCls.buttonStr+"reload_mmdbaf' style='width:150px'>Load Biological Unit"+e.htmlCls.buttonStr+"reload_mmdbaf_asym' style='margin-left:30px; width:250px'>Load Asymmetric Unit (All Chains)
",s+="
",s+='Note: The "biological unit" is the biochemically active form of a biomolecule,
The "asymmetric unit" is the raw 3D structure data resolved by X-ray crystallography, NMR, or Cryo-electron microscopy. The asymmetric unit is equivalent to the biological unit in approximately 60% of structure records. In the remaining 40% of the records, the asymmetric unit represents a portion of the biological unit that can be reconstructed using crystallographic symmetry, or it represents multiple copies of the biological unit.',s+="",s+=e.htmlCls.divStr+"dl_blast_rep_id' style='max-width:600px;' class='"+n+"'>",s+=this.addNotebookTitle("dl_blast_rep_id","Align sequence to structure"),s+="Enter a Sequence ID (or FASTA sequence) and the aligned protein accession, which can be found using the BLAST search with the Sequence ID or FASTA sequence as input. If the protein accession is not a PDB chain, the corresponding AlphaFold UniProt structure is used.
",s+="Sequence ID(NCBI protein accession of a sequence): "+e.htmlCls.inputTextStr+"id='"+e.pre+"query_id' value='NP_001108451.1' size=8>
",s+="or FASTA sequence:
",s+="NCBI protein accession (or a chain of a PDB): "+e.htmlCls.inputTextStr+"id='"+e.pre+"blast_rep_id' value='1TSR_A' size=8>
",s+=e.htmlCls.buttonStr+"reload_blast_rep_id'>Align with BLAST "+e.htmlCls.wifiStr+e.htmlCls.buttonStr+"reload_alignsw' style='margin-left:30px'>Align with Global Smith-Waterman"+e.htmlCls.buttonStr+"reload_alignswlocal' style='margin-left:30px'>Align with Local Smith-Waterman",s+="",s+=e.htmlCls.divStr+"dl_esmfold' style='max-width:600px;' class='"+n+"'>",s+=this.addNotebookTitle("dl_esmfold","Sequence to structure prediction with ESMFold"),s+="The sequence to structure prediction is done via ESM Metagenomic Atlas. The sequence should be less than 400 characters. For any sequence longer than 400, please see the discussion here.
",s+="FASTA sequence:
",s+=e.htmlCls.buttonStr+"run_esmfold'>ESMFold ",s+="",s+=e.htmlCls.divStr+"dl_yournote' class='"+n+"'>",s+=this.addNotebookTitle("dl_yournote","Your Note"),s+='Your note will be saved in the HTML file when you click "File > Save File > iCn3D PNG Image".
',s+="
",s+=e.htmlCls.buttonStr+"applyyournote'>Save",s+="",s+=e.htmlCls.divStr+"dl_proteinname' class='"+n+"'>",s+=this.addNotebookTitle("dl_proteinname","Please input a protein/gene name"),s+="Protein/Gene name: "+e.htmlCls.inputTextStr+"id='"+e.pre+"proteinname' value='TP53' size=8> ",s+=e.htmlCls.buttonStr+"reload_proteinname'>Search",s+="",s+=e.htmlCls.divStr+"dl_cid' class='"+n+"'>",s+=this.addNotebookTitle("dl_cid","Please input a PubChem CID"),s+="PubChem CID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"cid' value='2244' size=8> ",s+=e.htmlCls.buttonStr+"reload_cid'>Load",s+="",s+=e.htmlCls.divStr+"dl_pngimage' class='"+n+"'>",s+=this.addNotebookTitle("dl_pngimage","Please input an iCn3D PNG Image file"),s+="iCn3D PNG image: "+e.htmlCls.inputFileStr+"id='"+e.pre+"pngimage'>
",s+=e.htmlCls.buttonStr+"reload_pngimage' style='margin-top: 6px;'>Load",s+="",s+=e.htmlCls.divStr+"dl_state' class='"+n+"'>",s+=this.addNotebookTitle("dl_state","Please input a state file"),s+="State file: "+e.htmlCls.inputFileStr+"id='"+e.pre+"state'>
",s+=e.htmlCls.buttonStr+"reload_state' style='margin-top: 6px;'>Load",s+="",s+=e.htmlCls.divStr+"dl_fixedversion' style='max-width:500px' class='"+n+"'>",s+=this.addNotebookTitle("dl_fixedversion","Use fixed version of iCn3D"),s+='Since January 6, 2021, you can show the original view with the archived version of iCn3D by pasting your URL below and click "Show Originial View". Note the version in the parameter "v" was used to replace "full.html" with "full_[v].html" in the URL.
',s+="Share Link URL: "+e.htmlCls.inputTextStr+"id='"+e.pre+"sharelinkurl' size=60>
",s+=e.htmlCls.buttonStr+"reload_fixedversion'>Show Original View
",s+="",s+=e.htmlCls.divStr+"dl_selection' class='"+n+"'>",s+=this.addNotebookTitle("dl_selection","Load a selection file"),s+="Selection file: "+e.htmlCls.inputFileStr+"id='"+e.pre+"selectionfile'>
",s+=e.htmlCls.buttonStr+"reload_selectionfile' style='margin-top: 6px;'>Load",s+="",s+=e.htmlCls.divStr+"dl_menuloadpref' class='"+n+"'>",s+=this.addNotebookTitle("dl_menuloadpref","Load a preference file"),s+="Preference file: "+e.htmlCls.inputFileStr+"id='"+e.pre+"menupreffile'>
",s+=e.htmlCls.buttonStr+"reload_menupreffile' style='margin-top: 6px;'>Load",s+="",s+=e.htmlCls.divStr+"dl_dsn6' class='"+n+"'>",s+=this.addNotebookTitle("dl_dsn6","Load a map file"),s+="Note: Always load a PDB file before loading map files.
",s+="2fofc contour at:
",s+=e.htmlCls.inputFileStr+"id='"+e.pre+"dsn6file2fofc'> "+e.htmlCls.buttonStr+"reload_dsn6file2fofc' style='margin: 6px 20px 0 0;'>Load DSN6
",s+="fofc contour at:
",s+=e.htmlCls.inputFileStr+"id='"+e.pre+"dsn6filefofc'> "+e.htmlCls.buttonStr+"reload_dsn6filefofc' style='margin: 6px 20px 0 0;'>Load DSN6
",s+=e.htmlCls.buttonStr+"elecmapNo4'>Remove Map
",s+="",s+=e.htmlCls.divStr+"dl_dsn6url' class='"+n+"'>",s+=this.addNotebookTitle("dl_dsn6url","Load a selection file via a URL"),s+="Note: Always load a PDB file before loading map files.
",s+="2fofc contour at:
",s+="URL in the same host: "+e.htmlCls.inputTextStr+"id='"+e.pre+"dsn6fileurl2fofc' size=20>"+e.htmlCls.space3+e.htmlCls.buttonStr+"reload_dsn6fileurl2fofc' style='margin-top: 6px;'>Load
",s+="fofc contour at:
",s+="URL in the same host: "+e.htmlCls.inputTextStr+"id='"+e.pre+"dsn6fileurlfofc' size=20>"+e.htmlCls.space3+e.htmlCls.buttonStr+"reload_dsn6fileurlfofc' style='margin-top: 6px;'>Load
",s+=e.htmlCls.buttonStr+"elecmapNo5'>Remove Map
",s+="",s+=e.htmlCls.divStr+"dl_clr' class='"+n+"'>",s+=this.addNotebookTitle("dl_clr","Pick a color"),s+="Click in the input box to use the color picker:
",s+="Custom Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"colorcustom' value='FF0000' size=8> ",s+=e.htmlCls.buttonStr+"applycustomcolor'>Apply",s+="",s+=e.htmlCls.setHtmlCls.getPotentialHtml("delphi",n),s+=e.htmlCls.setHtmlCls.getPotentialHtml("local",n),s+=e.htmlCls.setHtmlCls.getPotentialHtml("url",n),s+=e.htmlCls.divStr+"dl_symmetry' class='"+n+"'>
",s+=this.addNotebookTitle("dl_symmetry","Symmetry"),s+=e.htmlCls.divNowrapStr+"Symmetry:
",s+=this.addNotebookTitle("dl_symd","Dynamically symmetry calculation using SymD"),s+="",s+=e.htmlCls.divStr+"dl_contact' class='"+n+"'>",s+=this.addNotebookTitle("dl_contact","Contact Map"),s+="Distance:
",s+=""+e.htmlCls.buttonStr+"applycontactmap'>Display
",s+="",s+=e.htmlCls.divStr+"dl_hbonds' class='"+n+"'>",s+=this.addNotebookTitle("dl_hbonds","Interaction Analysis"),s+="1. Choose interaction types and their thresholds:
",s+="",s+=" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_hbond' checked>Hydrogen Bonds "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_saltbridge' checked>Salt Bridge/Ionic "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_contact' checked>Contacts/Interactions "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+="",s+=" "+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_halogen' checked>Halogen Bonds "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_pication' checked>π-Cation "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+=""+e.htmlCls.inputCheckStr+"id='"+e.pre+"analysis_pistacking' checked>π-Stacking "+e.htmlCls.space3+" ",s+="",s+=e.htmlCls.divNowrapStr+" ",s+="
",s+="",s+=e.htmlCls.divNowrapStr+"2. Select the first set:",s+=" ",s+=e.htmlCls.divNowrapStr+"3. Select the second set:",s+="
",s+="
",s+="
",s+="
",r=': "+e.htmlCls.buttonStr+"hbondGraph'>2D Graph(Force-Directed) to show interactions with strength parameters in 0-200:",s+=' ',s+="Helix or Sheet'+r+e.pre+'dist_ss" size="4" value="100"> ',s+="Coil or Nucleotide"+r+e.pre+'dist_coil" size="4" value="50"> ',s+="Disulfide Bonds"+r+e.pre+'dist_ssbond" size="4" value="50"> ',s+="Hydrogen Bonds"+r+e.pre+'dist_hbond" size="4" value="50"> ',s+="Salt Bridge/Ionic"+r+e.pre+'dist_ionic" size="4" value="50"> ',s+="Contacts"+r+e.pre+'dist_inter" size="4" value="25"> Halogen Bonds"+r+e.pre+'dist_halogen" size="4" value="50"> ',s+="π-Cation"+r+e.pre+'dist_pication" size="4" value="50"> ',s+="π-Stacking"+r+e.pre+'dist_pistacking" size="4" value="50">
',s+="
",s+="
or use your current selection:
",s+="
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_realignbystruct' class='"+n+"' style='max-width:500px'>",s+=this.addNotebookTitle("dl_realignbystruct","Realign by structure"),s+="
",s+="
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_realigntwostru' class='"+n+"'>",s+=this.addNotebookTitle("dl_realigntwostru","Realign two structure complexes"),s+=e.htmlCls.divNowrapStr+"1. Select sets below or use your current selection:
",s+="
",s+="2. Overall maximum RMSD: "+e.htmlCls.inputTextStr+"id='"+e.pre+"maxrmsd' value='30' size='2'> Å
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_colorspectrumacrosssets' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorspectrumacrosssets","Set color spectrum across sets"),s+=e.htmlCls.divNowrapStr+"1. Select sets below:
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_colorspectrumbysets' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorspectrumbysets","Set color spectrum for residues in sets"),s+=e.htmlCls.divNowrapStr+"1. Select sets below:
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_colorrainbowacrosssets' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorrainbowacrosssets","Set color rainbow across sets"),s+=e.htmlCls.divNowrapStr+"1. Select sets below:
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_colorrainbowbysets' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorrainbowbysets","Set color rainbow for residues in sets"),s+=e.htmlCls.divNowrapStr+"1. Select sets below:
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_allinteraction' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_allinteraction","All interactions",!0),s+="",s+=e.htmlCls.divStr+"dl_interactionsorted' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_interactionsorted","Sorted interactions",!0),s+="",s+=e.htmlCls.divStr+"dl_linegraph' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_linegraph","2D Interaction Network"),s+=e.htmlCls.divNowrapStr+'
",e.linegraphid=e.pre+"linegraph",s+=e.htmlCls.divNowrapStr+l+e.linegraphid+'_svg">SVG'+e.htmlCls.space2,s+=l+e.linegraphid+'_png">PNG'+e.htmlCls.space2,s+=l+e.linegraphid+'_json">JSON'+e.htmlCls.space4,s+="Scale:
",s+='',s+="",s+=e.htmlCls.divStr+"dl_scatterplot' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_scatterplot","2D Interaction Map"),s+=e.htmlCls.divNowrapStr+"Hold Ctrl key to select multiple nodes."+e.htmlCls.space3,s+='
",s+='',s+="",s+=e.htmlCls.divStr+"dl_contactmap' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_contactmap","Contact Map"),s+=e.htmlCls.divNowrapStr+"Hold Ctrl key to select multiple nodes."+e.htmlCls.space3+"",e.contactmapid=e.pre+"contactmap",s+=e.htmlCls.divNowrapStr+l+e.contactmapid+'_svg">SVG'+e.htmlCls.space2,s+=l+e.contactmapid+'_png">PNG'+e.htmlCls.space2,s+=l+e.contactmapid+'_json">JSON'+e.htmlCls.space4,s+="Scale:
",s+='',s+="",s+=e.htmlCls.divStr+"dl_alignerrormap' style='background-color:white' class='"+n+"'>",s+=this.addNotebookTitle("dl_alignerrormap","PAE Map"),s+=e.htmlCls.divNowrapStr+"Hold Ctrl key to select multiple nodes."+e.htmlCls.space3+"",e.alignerrormapid=e.pre+"alignerrormap",s+=e.htmlCls.divNowrapStr+l+e.alignerrormapid+'_svg">SVG'+e.htmlCls.space2,s+=l+e.alignerrormapid+'_png">PNG (slow)'+e.htmlCls.space2,s+=l+e.alignerrormapid+'_json">JSON'+e.htmlCls.space4,s+='Scale:
";s+="0 5 10 15 20 25 30 Expected position error (Angstroms)
",s+='',s+="",s+=e.htmlCls.divStr+"dl_elecmap2fofc' class='"+n+"'>",s+=this.addNotebookTitle("dl_elecmap2fofc","Electron Density 2F0-Fc Map"),s+="Contour at:
"+e.htmlCls.buttonStr+"applyemmap'>Display "+e.htmlCls.buttonStr+"emmapNo2'>Remove EM Map",s+="",s+=e.htmlCls.divStr+"dl_aroundsphere' class='"+n+"'>",s+=this.addNotebookTitle("dl_aroundsphere","Select a sphere around a set of residues"),s+=e.htmlCls.divNowrapStr+"1. Select the first set:",s+="
",s+=e.htmlCls.divNowrapStr+"2. Sphere with a radius: "+e.htmlCls.inputTextStr+"id='"+e.pre+"radius_aroundsphere' value='4' size='2'> Å
",s+=e.htmlCls.divNowrapStr+"3. Select the second set to apply the sphere:",s+="
",s+=e.htmlCls.divNowrapStr+"4. "+e.htmlCls.buttonStr+"applypick_aroundsphere'>Display the sphere around the first set of atoms
",s+="
",s+=e.htmlCls.divNowrapStr+"1. Extracellular membrane Z-axis position: "+e.htmlCls.inputTextStr+"id='"+e.pre+"extra_mem_z' value='' size='3'> Å
",s+=e.htmlCls.divNowrapStr+"2. intracellular membrane Z-axis position: "+e.htmlCls.inputTextStr+"id='"+e.pre+"intra_mem_z' value='' size='3'> Å
",s+=e.htmlCls.divNowrapStr+"3. "+e.htmlCls.buttonStr+"apply_adjustmem'>Display the adjusted membranes
",s+="",s+=e.htmlCls.divStr+"dl_selectplane' class='"+n+"'>",s+=this.addNotebookTitle("dl_selectplane","Select a plane"),s+="Note: The membranes are parallel to the X-Y plane. The center of the membranes is at Z = 0.
",s+=e.htmlCls.divNowrapStr+"1. Z-axis position of the first X-Y plane: "+e.htmlCls.inputTextStr+"id='"+e.pre+"selectplane_z1' value='15' size='3'> Å
",s+=e.htmlCls.divNowrapStr+"2. Z-axis position of the second X-Y plane: "+e.htmlCls.inputTextStr+"id='"+e.pre+"selectplane_z2' value='-15' size='3'> Å
",s+=e.htmlCls.divNowrapStr+"3. "+e.htmlCls.buttonStr+"apply_selectplane'>Save the region between the planes to Defined Sets
",s+="",s+=e.htmlCls.divStr+"dl_addlabel' class='"+n+"'>",s+=this.addNotebookTitle("dl_addlabel","Add labels between two atoms"),s+="1. Text: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labeltext' value='Text' size=4>
",s+="2. Size: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelsize' value='18' size=4 maxlength=2>
",s+="3. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelcolor' value='"+"#ffff00' size=4>
",e.utilsCls.isMobile()?s+=e.htmlCls.spanNowrapStr+"4. Touch TWO atoms
":s+=e.htmlCls.spanNowrapStr+'4. Pick TWO atoms while holding "Alt" key
',s+=e.htmlCls.spanNowrapStr+"5. "+e.htmlCls.buttonStr+"applypick_labels'>Display",s+="",s+=e.htmlCls.divStr+"dl_addlabelselection' class='"+n+"'>",s+=this.addNotebookTitle("dl_addlabelselection","Add labels for your selection"),s+="1. Text: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labeltext2' value='Text' size=4>
",s+="2. Size: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelsize2' value='18' size=4 maxlength=2>
",s+="3. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelcolor2' value='"+"#ffff00' size=4>
",s+=e.htmlCls.spanNowrapStr+"4. "+e.htmlCls.buttonStr+"applyselection_labels'>Display",s+="",s+=e.htmlCls.divStr+"dl_labelColor' class='"+n+"'>",s+=this.addNotebookTitle("dl_labelColor","Change label color"),s+="Color for all labels: "+e.htmlCls.inputTextStr+"id='"+e.pre+"labelcolorall' value='"+"#ffff00' size=4>
",s+=e.htmlCls.spanNowrapStr+e.htmlCls.buttonStr+"applylabelcolor'>Display",s+="",s+=e.htmlCls.divStr+"dl_distance' class='"+n+"'>",s+=this.addNotebookTitle("dl_distance","Measure distance"),e.utilsCls.isMobile()?s+=e.htmlCls.spanNowrapStr+"1. Touch TWO atoms
":s+=e.htmlCls.spanNowrapStr+'1. Pick TWO atoms while holding "Alt" key
',s+=e.htmlCls.spanNowrapStr+"2. Line Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"distancecolor' value='"+"#ffff00' size=4>
",s+=e.htmlCls.spanNowrapStr+"3. "+e.htmlCls.buttonStr+"applypick_measuredistance'>Display",s+="",s+=e.htmlCls.divStr+"dl_stabilizer' class='"+n+"'>",s+=this.addNotebookTitle("dl_stabilizer","Add a stabilizer"),e.utilsCls.isMobile()?s+=e.htmlCls.spanNowrapStr+"1. Touch TWO atoms
":s+=e.htmlCls.spanNowrapStr+'1. Pick TWO atoms while holding "Alt" key
',s+=e.htmlCls.spanNowrapStr+"2. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"stabilizercolor' value='ffffff' size=4>
",s+=e.htmlCls.spanNowrapStr+"3. "+e.htmlCls.buttonStr+"applypick_stabilizer'>Add",s+="",s+=e.htmlCls.divStr+"dl_disttwosets' class='"+n+"'>",s+=this.addNotebookTitle("dl_disttwosets","Measure the distance between two sets"),s+=e.htmlCls.spanNowrapStr+"1. Select two sets
",s+="
",s+=e.htmlCls.spanNowrapStr+"2. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"distancecolor2' value='"+"#ffff00' size=4>",s+=e.htmlCls.divNowrapStr+"First set:",s+=" ",s+=e.htmlCls.divNowrapStr+"Second set:",s+="
",s+=e.htmlCls.spanNowrapStr+"3. "+e.htmlCls.buttonStr+"applydist2'>Display",s+="",s+=e.htmlCls.divStr+"dl_linebtwsets' class='"+n+"'>",s+=this.addNotebookTitle("dl_linebtwsets","Add a line between two sets"),s+=e.htmlCls.spanNowrapStr+"1. Select two sets
",s+="
",s+=e.htmlCls.divNowrapStr+"2. Line style: ",s+=e.htmlCls.divNowrapStr+"First set:",s+=" ",s+=e.htmlCls.divNowrapStr+"Second set:",s+="
",s+="3. Line radius: "+e.htmlCls.inputTextStr+"id='"+e.pre+"linebtwsets_radius' value='0.4' size=4>
",s+="4. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"linebtwsets_customcolor' value='"+"#ffff00' size=4>
",s+=e.htmlCls.divNowrapStr+"5. Opacity:
",s+=e.htmlCls.spanNowrapStr+"6. "+e.htmlCls.buttonStr+"applylinebtwsets'>Display",s+=e.htmlCls.space3+e.htmlCls.spanNowrapStr+e.htmlCls.buttonStr+"clearlinebtwsets'>Clear",s+="",s+=e.htmlCls.divStr+"dl_cartoonshape' class='"+n+"'>",s+=this.addNotebookTitle("dl_cartoonshape","Cartoon Shape"),s+=e.htmlCls.spanNowrapStr+"1. Select a set:
",s+="
",s+=e.htmlCls.divNowrapStr+"2. Shape:
",s+="3. Radius: "+e.htmlCls.inputTextStr+"id='"+e.pre+"cartoonshape_radius' value='1.5' size=4>
",s+="4. Color: "+e.htmlCls.inputTextStr+"id='"+e.pre+"cartoonshape_customcolor' value='"+"#ffff00' size=4>
",s+=e.htmlCls.divNowrapStr+"5. Opacity:
",s+=e.htmlCls.spanNowrapStr+"6. "+e.htmlCls.buttonStr+"applycartoonshape'>Display",s+=e.htmlCls.space3+e.htmlCls.spanNowrapStr+e.htmlCls.buttonStr+"clearcartoonshape'>Clear",s+="",s+=e.htmlCls.divStr+"dl_distmanysets' class='"+n+"'>",s+=this.addNotebookTitle("dl_distmanysets","Measure distances among many sets"),s+=e.htmlCls.spanNowrapStr+"1. Select sets for pairwise distances
",s+="
",s+=e.htmlCls.spanNowrapStr+"2. "+e.htmlCls.buttonStr+"applydisttable'>Distances in Table",s+="",s+=e.htmlCls.divStr+"dl_stabilizer_rm' class='"+n+"'>",s+=this.addNotebookTitle("dl_stabilizer_rm","Remove a stabilizer"),e.utilsCls.isMobile()?s+=e.htmlCls.spanNowrapStr+"1. Touch TWO atoms",s+=e.htmlCls.divNowrapStr+"First sets:",s+=" ",s+=e.htmlCls.divNowrapStr+"Second sets:",s+="
":s+=e.htmlCls.spanNowrapStr+'1. Pick TWO atoms while holding "Alt" key
',s+=e.htmlCls.spanNowrapStr+"2. "+e.htmlCls.buttonStr+"applypick_stabilizer_rm'>Remove",s+="",s+=e.htmlCls.divStr+"dl_thickness' class='"+n+"'>",s+=this.addNotebookTitle("dl_thickness","Set thickness"),s+=e.htmlCls.setHtmlCls.setThicknessHtml("3dprint"),s+="",s+=e.htmlCls.divStr+"dl_thickness2' class='"+n+"'>",s+=this.addNotebookTitle("dl_thickness2","Set thickness"),s+=e.htmlCls.setHtmlCls.setThicknessHtml("style"),s+="",s+=e.htmlCls.divStr+"dl_menupref' class='"+n+"'>",s+=this.addNotebookTitle("dl_menupref","Preferences for menus"),s+="Note: The following parameters will be saved in cache. You just need to set them once.
",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"apply_menupref'>Apply",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"reset_menupref' style='margin-left:30px'>Reset to Simple Menus",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"reset_menupref_all' style='margin-left:30px'>Reset to All Menus",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"savepref' style='margin-left:30px'>Save Preferences
",s+="
",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"apply_menupref2'>Apply",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"reset_menupref2' style='margin-left:30px'>Reset to Simple Menus",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"reset_menupref_all2' style='margin-left:30px'>Reset to All Menus",s+=e.htmlCls.spanNowrapStr+""+e.htmlCls.buttonStr+"savepref2' style='margin-left:30px'>Save Preferences",s+="",s+=e.htmlCls.divStr+"dl_addtrack' class='"+n+"'>",s+=this.addNotebookTitle("dl_addtrack","Add a track"),s+=" ",s+=e.htmlCls.divStr+"dl_addtrack_tabs' style='border:0px;'>",s+="",s+="
",s+=e.htmlCls.divStr+"tracktab1'>",s+="NCBI gi/Accession: "+e.htmlCls.inputTextStr+"id='"+e.pre+"track_gi' placeholder='gi' size=16>
",s+=e.htmlCls.buttonStr+"addtrack_button1'>Add Track",s+="",s+=e.htmlCls.divStr+"tracktab2'>",s+="FASTA Title: "+e.htmlCls.inputTextStr+"id='"+e.pre+"fasta_title' placeholder='track title' size=16>
",s+="FASTA sequence:
",s+=e.htmlCls.buttonStr+"addtrack_button2'>Add Track",s+="",s+=e.htmlCls.divStr+"tracktab2b'>",s+="
",s+="Precalculated Multiple Sequence Alignment (MSA):
",s+="
",s+="Position of the first residue in Sequences & Annotations window: "+e.htmlCls.inputTextStr+"id='"+e.pre+"fasta_startpos' value='1' size=2>
",s+="Color Sequence by:
",s+=e.htmlCls.buttonStr+"addtrack_button2b'>Add Track(s)",s+="",s+=e.htmlCls.divStr+"tracktab2c'>",s+="
",s+="NCBI Gene ID: "+e.htmlCls.inputTextStr+"id='"+e.pre+"track_geneid' size=20>"+e.htmlCls.space3+e.htmlCls.buttonStr+"exons_table'>Exons & Introns in Gene Table
",s+="Position of the first residue in Sequences & Annotations window: "+e.htmlCls.inputTextStr+"id='"+e.pre+"fasta_startpos2' value='1' size=2>
",s+=e.htmlCls.buttonStr+"addtrack_button2c'>Show Isoforms & Exons",s+="",s+=e.htmlCls.divStr+"tracktab3'>",s+="BED file: "+e.htmlCls.inputFileStr+"id='"+e.pre+"track_bed' size=16>
",s+=e.htmlCls.buttonStr+"addtrack_button3'>Add Track",s+="",s+=e.htmlCls.divStr+"tracktab4'>",s+="Track Title: "+e.htmlCls.inputTextStr+"id='"+e.pre+"track_title' placeholder='track title' size=16>
",s+='Track Text (e.g., "2 G, 5-6 RR" defines a character "G" at the position 2 and two continuous characters "RR" at positions from 5 to 6. The starting position is 1):
',s+="
",s+=e.htmlCls.buttonStr+"addtrack_button4'>Add Track",s+="",s+=e.htmlCls.divStr+"tracktab5'>",s+="Track Title: "+e.htmlCls.inputTextStr+"id='"+e.pre+"track_selection' placeholder='track title' size=16>
",s+=e.htmlCls.buttonStr+"addtrack_button5'>Add Track",s+="",s+="",s+="",s+=e.htmlCls.divStr+"dl_saveselection' class='"+n+"'>",s+=this.addNotebookTitle("dl_saveselection","Save Selection");let m=t&&t.defNames2Atoms?Object.keys(t.defNames2Atoms).length:1;s+="Name: "+e.htmlCls.inputTextStr+"id='"+e.pre+"seq_command_name' value='seq_"+m+"' size='5'>
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_copyurl' style='width:520px;' class='"+n+"'>",s+=this.addNotebookTitle("dl_copyurl","Share Link"),s+="
",s+="1. URLs Used in Browsers
",s+='Please copy one of the URLs below. They show the same result.
(To add a title to share link, click "Windows > Your Note" and click "File > Share Link" again.)
',s+="Original URL with commands:
",e.cfg.notebook||(s+="Lifelong Short URL:(To replace this URL, send a pull request to update share.html at iCn3D GitHub)
"+e.htmlCls.inputTextStr+"id='"+e.pre+"short_url' value='' style='width:100%'>
",s+='Lifelong Short URL + Window Title:(To update the window title, click "Analysis > Your Note/Window Title".)
'+e.htmlCls.inputTextStr+"id='"+e.pre+"short_url_title' value='' style='width:100%'>
"),s+="2. Commands Used in Jupyter Noteboook
",s+="Please copy the following commands into a cell in Jupyter Notebook to show the same result.
More details are at https://github.com/ncbi/icn3d/tree/master/jupyternotebook.
",s+='
',s+=l+e.pre+'jn_copy">Copy Commands
',s+="",s+=e.htmlCls.divStr+"dl_selectannotations' class='"+n+" icn3d-annotation' style='background-color:white;'>",s+=this.addNotebookTitle("dl_selectannotations","Sequences & Annotations"),s+=e.htmlCls.divStr+"dl_annotations_tabs'>",s+=e.htmlCls.divStr+"dl_anno_view_tabs' style='border:0px; height:33px;'>",s+="",s+=e.htmlCls.divStr+"anno_tmp1'>",s+="",s+=e.htmlCls.divStr+"anno_tmp2'>",s+="",s+="",s+=this.getAnnoHeader(),s+="
",s+=e.htmlCls.divStr+"seqguide_wrapper' style='display:none'>
"+e.htmlCls.setHtmlCls.setSequenceGuide("2")+"",s+="
",s+=e.htmlCls.divStr+"dl_annotations'>",s+="",s+="",s+=e.htmlCls.divStr+"dl_graph' style='background-color:white;' class='"+n+"'>",s+=this.addNotebookTitle("dl_graph","Interactions"),e.svgid=e.pre+"icn3d_viz",s+="",s+=e.htmlCls.divNowrapStr+"Zoom: mouse wheel; "+e.htmlCls.space3+" Move: left button; "+e.htmlCls.space3+" Select Multiple Nodes: Ctrl Key and drag an Area"+e.htmlCls.space3,s+='
",s+='(0-20% out is considered "in". 50-100% out is considered "out".)
',s+="Toal: "+e.htmlCls.inputTextStr+"id='"+e.pre+"areavalue' value='' size='10'> Å2
",s+="",s+="",s+=e.htmlCls.divStr+"dl_colorbyarea' class='"+n+"'>",s+=this.addNotebookTitle("dl_colorbyarea","Color by surface area"),s+="
",s+="Middle Percentage(White): "+e.htmlCls.inputTextStr+"id='"+e.pre+"midpercent' value='35' size='10'>%
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_rmsd' class='"+n+"' style='max-width:300px'>",s+=this.addNotebookTitle("dl_rmsd","RMSD",!0),s+="",s+=e.htmlCls.divStr+"dl_buriedarea' class='"+n+"'>",s+=this.addNotebookTitle("dl_buriedarea","Buried surface area",!0),s+="",s+=e.htmlCls.divStr+"dl_propbypercentout' class='"+n+"'>",s+=this.addNotebookTitle("dl_propbypercentout","Select residues basen on solvent accessilbe surface area"),s+="
",s+="Min Percentage: "+e.htmlCls.inputTextStr+"id='"+e.pre+"minpercentout' value='0' size='10'>%
",s+="Max Percentage: "+e.htmlCls.inputTextStr+"id='"+e.pre+"maxpercentout' value='100' size='10'>%
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_propbybfactor' class='"+n+"'>",s+=this.addNotebookTitle("dl_propbybfactor","Select residues basen on B-factor/pLDDT"),s+="
",s+="Min B-factor/pLDDT: "+e.htmlCls.inputTextStr+"id='"+e.pre+"minbfactor' value='0' size='10'>%
",s+="Max B-factor/pLDDT: "+e.htmlCls.inputTextStr+"id='"+e.pre+"maxbfactor' value='100' size='10'>%
",s+="
",s+="",s+=e.htmlCls.divStr+"dl_legend' class='"+n+"' style='max-width:500px; background-color:white'>",s+=this.addNotebookTitle("dl_legend","Legend",!0),s+="",s+=e.htmlCls.divStr+"dl_disttable' class='"+n+"'>",s+=this.addNotebookTitle("dl_disttable","Distance Table",!0),s+="",s+=e.htmlCls.divStr+"dl_igrefTpl' class='"+n+"'>",s+=this.addNotebookTitle("dl_igrefTpl","Choose an Ig template"),s+="Choose an Ig template for selected residues:
"+e.htmlCls.buttonStr+"mn6_igrefTpl_apply'>Show Ig Ref. Number",s+="",s+="",s+="\x3c!--/form--\x3e",s}getAnnoHeader(){let e=this.icn3dui;e.icn3d;let t="";t+="
",t+="";let s=" ",i=" ";return t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_all'>All"+e.htmlCls.space2+" ",t+=i+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_cdd' checked>Conserved Domains"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_clinvar'>ClinVar"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_binding'>Functional Sites"+e.htmlCls.space2+"",t+="",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_custom'>Custom"+e.htmlCls.space2+"",t+=i+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_3dd'>3D Domains"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_snp'>SNPs"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_ptm'>PTM (UniProt)"+e.htmlCls.space2+"",t+=" ",t+=" ",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_ssbond'>Disulfide Bonds"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_interact'>Interactions"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_crosslink'>Cross-Linkages"+e.htmlCls.space2+"",t+=s+e.htmlCls.inputCheckStr+"id='"+e.pre+"anno_transmem'>Transmembrane"+e.htmlCls.space2+"",t+=" ",t+=" ";for(let e=0,i=o.alnChainsAnno[l][t].length;e ':' ';else if("E"==i)if(void 0!==o.alnChainsSeq[s][e]){let i=s+"_"+o.alnChainsSeq[s][e].resi;if(o.residues.hasOwnProperty(i)){o.firstAtomObjCls.getFirstCalphaAtomObj(o.residues[i]).ssend?b[t]+=' ':b[t]+=' '}else b[t]+=' '}else b[t]+=' ';else b[t]+="c"==i?' ':"o"==i?' ':"";else b[t]+=""+i+""}b[t]+=""}let O=l,R=void 0!==o.pdbid_chain2title?o.pdbid_chain2title[u]:"";for(let e=k-1;e>=0;--e){let t=o.alnChainsAnTtl[l][e][0];"SS"==t&&(t=""),a+="
",g>0&&(f+=y),++g}return{sequencesHtml:a,maxSeqCnt:d}}}class u{constructor(e){this.icn3dui=e}getLink(e,t,s,i){let n=this.icn3dui;return n.icn3d,n.htmlCls.allMenus[e]=t,i&&(n.htmlCls.allMenusSel[e]=i),s&&(n.htmlCls.simpleMenus[e]=1),"
",n+="",n}getOptionHtml(e,t){let s=this.icn3dui;s.icn3d;let i="";for(let n=0,l=e.length;n ",n+=" ",n+="",n+="
",n+="Select: "+t.htmlCls.inputTextStr+"id='"+t.pre+"command"+s+"' placeholder='$[structures].[chains]:[residues]@[atoms]' size='60'> ",n+="Name: "+t.htmlCls.inputTextStr+"id='"+t.pre+"command_name"+s+"' placeholder='my_selection' size='60'> ",n+=""+t.htmlCls.space3+t.htmlCls.buttonStr+"command_apply"+s+"'>Save Selection to Defined Sets ",n+='Specification Tips:
',n+=t.htmlCls.divStr+"specguide"+s+"' style='display:none; width:500px' class='icn3d-box'>",n+='Specification: In the selection "$1HHO,4N7N.A,B,C:5-10,LV,3AlaVal,chemicals@CA,C,C*":',n+='
",n+="Set Operation:",n+='
',n+='
',n+='
',n+='
',n+='
',n+='
',n+='
',n+="Full commands in url or command window:",n+="
',n+='
",n+="",n+="
",n+="
",i+="1. Shininess: "+t.htmlCls.inputTextStr+"id='"+t.pre+"shininess' value='"+m+"' size=4>"+t.htmlCls.space3+"(for the shininess of the 3D objects, default 40)
",i+="2. Three directional lights:
",i+="Key Light: "+t.htmlCls.inputTextStr+"id='"+t.pre+"light1' value='"+u+"' size=4>"+t.htmlCls.space3+"(for the light strength of the key light, default 0.8)
",i+="Fill Light: "+t.htmlCls.inputTextStr+"id='"+t.pre+"light2' value='"+g+"' size=4>"+t.htmlCls.space3+"(for the light strength of the fill light, default 0.4)
",i+="Back Light: "+t.htmlCls.inputTextStr+"id='"+t.pre+"light3' value='"+f+"' size=4>"+t.htmlCls.space3+"(for the light strength of the back light, default 0.2)
",i+="3. Thickness:
"}return i+="Line Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"linerad_"+e+"' value='"+n+"' size=4>"+t.htmlCls.space3+"(for stabilizers, hydrogen bonds, distance lines, default 0.1)
",i+="Coil Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"coilrad_"+e+"' value='"+l+"' size=4>"+t.htmlCls.space3+"(for coils, default 0.3)
",i+="Stick Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"stickrad_"+e+"' value='"+r+"' size=4>"+t.htmlCls.space3+"(for sticks, default 0.4)
",i+="Cross-Linkage Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"crosslinkrad_"+e+"' value='"+o+"' size=4>"+t.htmlCls.space3+"(for cross-linkages, default 0.4)
",i+="Trace Radius: "+t.htmlCls.inputTextStr+"id='"+t.pre+"tracerad_"+e+"' value='"+a+"' size=4>"+t.htmlCls.space3+"(for C alpha trace, O3' trace, default 0.4)
",i+="Ribbon Thickness: "+t.htmlCls.inputTextStr+"id='"+t.pre+"ribbonthick_"+e+"' value='"+c+"' size=4>"+t.htmlCls.space3+"(for helix and sheet ribbons, nucleotide ribbons, default 0.2)
",i+="Protein Ribbon Width: "+t.htmlCls.inputTextStr+"id='"+t.pre+"prtribbonwidth_"+e+"' value='"+h+"' size=4>"+t.htmlCls.space3+"(for helix and sheet ribbons, default 1.3)
",i+="Nucleotide Ribbon Width: "+t.htmlCls.inputTextStr+"id='"+t.pre+"nucleotideribbonwidth_"+e+"' value='"+p+"' size=4>"+t.htmlCls.space3+"(for nucleotide ribbons, default 0.8)
",i+="Ball Scale: "+t.htmlCls.inputTextStr+"id='"+t.pre+"ballscale_"+e+"' value='"+d+"' size=4>"+t.htmlCls.space3+"(for styles 'Ball and Stick' and 'Dot', default 0.3)
","style"==e&&(i+="
4. Show Glycan Cartoon: "+t.htmlCls.inputTextStr+"id='"+t.pre+"glycan' value='"+b+"' size=4>"+t.htmlCls.space3+"(0: hide, 1: show, default 0)
",i+="
5. Show Membrane: "+t.htmlCls.inputTextStr+"id='"+t.pre+"membrane' value='"+C+"' size=4>"+t.htmlCls.space3+"(0: hide, 1: show, default 1)
",i+="
6. Enlarge Command Window: "+t.htmlCls.inputTextStr+"id='"+t.pre+"cmdwindow' value='"+y+"' size=4>"+t.htmlCls.space3+"(0: Regular, 1: Large, default 0)
"),i+=t.htmlCls.spanNowrapStr+""+t.htmlCls.buttonStr+"apply_thickness_"+e+"'>Apply ",i+=t.htmlCls.spanNowrapStr+""+t.htmlCls.buttonStr+"reset_thickness_"+e+"'>Reset",i}getCookie(e){let t=e+"=",s=decodeURIComponent(document.cookie).split(";");for(let e=0;e
",n+=s.htmlCls.divStr+"seqguide"+e+"' style='display:none; white-space:normal;' class='icn3d-box'>"),n+=this.getSelectionHints();return n+="Residue labeling: standard residue with coordinates: UPPER case letter; nonstandard residue with coordinates: the first UPPER case letter plus a period except that water residue uses the letter 'O'; residue missing coordinates: lower case letter."+(s.utilsCls.isMac()&&!s.utilsCls.isMobile()?"
Turn on scroll bar: System preferences -> General -> show scroll bars -> check Always":"")+"
",n}setAlignSequenceGuide(e,t){let s=this.icn3dui,i=s.icn3d,n="";let l=i&&i.defNames2Atoms?Object.keys(i.defNames2Atoms).length:1;n+='
",n+=s.htmlCls.divStr+"alignseqguide' style='display:none; white-space:normal;' class='icn3d-box'>",n+=this.getSelectionHints();return n+="Residue labeling: aligned residue with coordinates: UPPER case letter; non-aligned residue with coordinates: lower case letter which can be highlighted; residue missing coordinates: lower case letter which can NOT be highlighted."+(s.utilsCls.isMac()&&!s.utilsCls.isMobile()?"
Turn on scroll bar: System preferences -> General -> show scroll bars -> check Always":"")+"
",n}getSelectionHints(){let e=this.icn3dui;e.icn3d;let t="";if(e.utilsCls.isMobile())t+='Select Aligned Sequences: touch to select, touch again to deselect, multiple selection is allowed without Ctrl key, click "Save Selection" to save the current selection.
';else{t+='Select on 1D sequences: drag to select, drag again to deselect, multiple selection is allowed without Ctrl key, click "Save Selection" to save the current selection.
',t+="Select on 2D interaction diagram: click on the nodes or lines. The nodes are chains and can be united with the Ctrl key. The lines are interactions and can NOT be united. Each click on the lines selects half of the lines, i.e., select the interacting residues in one of the two chains.
",t+="Select on 3D structures: "+(e.utilsCls.isMobile()?"use finger to pick":'hold "Alt" and use mouse to pick')+', click the second time to deselect, hold "Ctrl" to union selection, hold "Shift" to select a range, press the up/down arrow to switch among atom/residue/strand/chain/structure, click "Save Selection" to save the current selection.
',t+='Save the current selection(either on 3D structure, 2D interactions, or 1D sequence): open the menu "Select -> Save Selection", specify the name and description for the selection, and click "Save".
'}return t}addGsizeSalt(e){let t=this.icn3dui;t.icn3d;let s="";s+="Grid Size:
",s}getFootHtml(e,t){let s=this.icn3dui;s.icn3d;let i="
":(i+="Note: Only the selected residues are used for DelPhi potential calculation by solving linear Poisson-Boltzmann equation.",i+='
',i+=s.htmlCls.divStr+t+"' style='display:none;'>",i+="
The hydrogens and partial charges of proteins and nucleotides are added using DelPhiPKa with the Amber charge and size files. The hydrogens of ligands are added using Open Babel. The partial charges of ligands are calculated using Antechamber with the Gasteiger charge method. All partial charges are calculated at pH 7.
",i+='Lipids are treated as ligands. Please use "HETATM" instead of "ATOM " for each lipid atom in your PDB file. Each phosphate in lipids is assigned with a charge of -1. You can download PQR and modify it, or prepare your PQR file using other tools. Then load the PQR file at the menu "Analysis > Load PQR/Potential".
',i+="
',i+=s.htmlCls.divStr+t+"' style='display:none;'>",i+='The PDB file can be loaded in the URL with "pdbid=" or at "File > Open File". The PQR file can be prepared at the menu "Analysis > Download PQR" with your modification or using other tools. The DelPhi potential file can be calculated at DelPhi Web Server and be exported as a Cube file. ',"url"==e&&(i+="The PQR or potential file can be accessed in a URL if it is located in the same host as iCn3D."),i+="
",i+=""),i+="",i}getPotentialHtml(e,t){let s=this.icn3dui;s.icn3d;let i,n,l,r,o,a="";r="Equipotential Map",o="Surface with Potential","delphi"==e?n="delphi":"local"==e?(i="pqr",n="phi",l="cube"):"url"==e&&(i="pqrurl",n="phiurl",l="cubeurl"),a+=s.htmlCls.divStr+"dl_"+n+"' class='"+t+"'>",a+=s.htmlCls.setDialogCls.addNotebookTitle("dl_"+n,"DelPhi Potential"),a+=s.htmlCls.divStr+"dl_"+n+"_tabs' style='border:0px;'>",a+="",a+="
",a+=s.htmlCls.divStr+n+"tab1'>","delphi"==e&&(a+=this.addGsizeSalt(n+"1")+"
"),a+="Potential contour at:
","delphi"==e?(a+=s.htmlCls.buttonStr+"reload_"+n+"file' style='margin-top: 6px;'>Equipotential Map",a+=s.htmlCls.buttonStr+n+"mapNo' style='margin-left:30px;'>Remove Map
"):"local"==e?(a+=s.htmlCls.divStr+n+"tab1_tabs' style='border:0px;'>",a+="",d=""+s.htmlCls.buttonStr+n+"mapNo'>Remove Map",a+=s.htmlCls.divStr+n+"tab1_"+i+"'>",a+=this.addGsizeSalt(i)+"
",a+="PQR File: "+s.htmlCls.inputFileStr+"id='"+s.pre+i+"file'>
"+s.htmlCls.buttonStr+"reload_"+i+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=s.htmlCls.divStr+n+"tab1_"+n+"'>",a+="Phi File: "+s.htmlCls.inputFileStr+"id='"+s.pre+n+"file'>
"+s.htmlCls.buttonStr+"reload_"+n+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=s.htmlCls.divStr+n+"tab1_"+l+"'>",a+="Cube File: "+s.htmlCls.inputFileStr+"id='"+s.pre+l+"file'>
"+s.htmlCls.buttonStr+"reload_"+l+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=""):"url"==e&&(a+=s.htmlCls.divStr+n+"tab1_tabs' style='border:0px;'>",a+="",d=""+s.htmlCls.buttonStr+n+"mapNo'>Remove Map",a+=s.htmlCls.divStr+n+"tab1_"+i+"2'>",a+=this.addGsizeSalt(i)+"
",a+="PQR URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+i+"file'>
"+s.htmlCls.buttonStr+"reload_"+i+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=s.htmlCls.divStr+n+"tab1_"+n+"2'>",a+="Phi URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+n+"file'>
"+s.htmlCls.buttonStr+"reload_"+n+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=s.htmlCls.divStr+n+"tab1_"+l+"2'>",a+="Cube URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+l+"file'>
"+s.htmlCls.buttonStr+"reload_"+l+"file' style='margin-top: 6px;'>Equipotential Map"+d,a+=""),a+="
"+this.getFootHtml(e,n+"tab1_foot"),a+="",a+=s.htmlCls.divStr+n+"tab2'>","delphi"==e&&(a+=this.addGsizeSalt(n+"2")+"
"),a+="Surface with max potential at:
",a+="Surface:
",a+="
","delphi"==e?(a+=s.htmlCls.buttonStr+"reload_"+n+"file2' style='margin-top: 6px;'>Surface with Potential",a+=s.htmlCls.buttonStr+n+"mapNo2' style='margin-left:30px;'>Remove Surface
"):"local"==e?(a+=s.htmlCls.divStr+n+"tab2_tabs' style='border:0px;'>",a+="",d=""+s.htmlCls.buttonStr+n+"mapNo2'>Remove Surface",a+=s.htmlCls.divStr+n+"tab2_"+i+"'>",a+=this.addGsizeSalt(i+"2")+"
",a+="PQR File: "+s.htmlCls.inputFileStr+"id='"+s.pre+i+"file2'>
"+s.htmlCls.buttonStr+"reload_"+i+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=s.htmlCls.divStr+n+"tab2_"+n+"'>",a+="Phi File: "+s.htmlCls.inputFileStr+"id='"+s.pre+n+"file2'>
"+s.htmlCls.buttonStr+"reload_"+n+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=s.htmlCls.divStr+n+"tab2_"+l+"'>",a+="Cube File: "+s.htmlCls.inputFileStr+"id='"+s.pre+l+"file2'>
"+s.htmlCls.buttonStr+"reload_"+l+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=""):"url"==e&&(a+=s.htmlCls.divStr+n+"tab2_tabs' style='border:0px;'>",a+="",d=""+s.htmlCls.buttonStr+n+"mapNo2'>Remove Surface",a+=s.htmlCls.divStr+n+"tab2_"+i+"2'>",a+=this.addGsizeSalt(i+"2")+"
",a+="PQR URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+i+"file2'>
"+s.htmlCls.buttonStr+"reload_"+i+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=s.htmlCls.divStr+n+"tab2_"+n+"2'>",a+="Phi URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+n+"file2'>
"+s.htmlCls.buttonStr+"reload_"+n+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=s.htmlCls.divStr+n+"tab2_"+l+"2'>",a+="Cube URL in the same host: "+s.htmlCls.inputTextStr+"id='"+s.pre+l+"file2'>
"+s.htmlCls.buttonStr+"reload_"+l+"file2' style='margin-top: 6px;'>Surface with Potential"+d,a+=""),a+="
"+this.getFootHtml(e,n+"tab2_foot"),a+="",a+="",a+="",a}async exportPqr(e){let t=this.icn3dui,s=t.icn3d,i={},n={},l=t.hashUtilsCls.intHash(s.dAtoms,s.hAtoms);for(let e in l)s.atoms[e],s.ions.hasOwnProperty(e)?i[e]=1:n[e]=1;let r=e?"pdb":"pqr";if(t.cfg.cid){let l="",o=!e;l+=s.saveFileCls.getAtomPDB(n,o)+s.saveFileCls.getAtomPDB(i,o);let a=Object.keys(t.utilsCls.getHlStructures()).join(",");s.saveFileCls.saveFile(a+"_icn3d."+r,"text",[l])}else{if(t.utilsCls.isCalphaPhosOnly(t.hashUtilsCls.hash2Atoms(n,s.atoms)))return void alert("The potential will not be shown because the side chains are missing in the structure...");let l="",o=!0;l+=s.saveFileCls.getAtomPDB(n,void 0,void 0,void 0,void 0,void 0,o),l+=s.saveFileCls.getAtomPDB(i,!0,void 0,!0);let a=t.htmlCls.baseUrl+"delphi/delphi.cgi",d={pdb2pqr:l,pdbid:t.cfg.cid?t.cfg.cid:Object.keys(s.structures).toString()},c=await t.getAjaxPostPromise(a,d,!0,void 0,void 0,!0,"text");if(e){let e=c.split("\n"),s="";for(let i=0,n=e.length;i",t).replace("#include {const t=new Map;for(const[e,s]of n.associations)(e instanceof Material||e instanceof Texture)&&t.set(e,s);return e.traverse((e=>{const s=n.associations.get(e);null!=s&&t.set(e,s)})),t})(l),l}))}}function me(e,t,s,i){const n=s.nodes[e];return i.getDependency("node",e).then((function(e){if(void 0===n.skin)return e;let t;return i.getDependency("skin",n.skin).then((function(e){t=e;const s=[];for(let e=0,n=t.joints.length;e1)if(void 0!==d){let i,n,l=[];for(let r=0,o=p.length;rStructure ":"",a=Object.keys(i).length>1?"Chain ":"";n+=""+o+a+" ";for(let e in l.resid2area){let d=e.lastIndexOf("_"),c=e.substr(d+1),h=r.utilsCls.getIdArray(e.substr(0,d));o=Object.keys(s).length>1?"Residue Number SASA (Å2) Percent Out In/Out "+h[0]+" ":"",a=Object.keys(i).length>1?""+h[1]+" ":"";let p="",m="";l.resid2area[e]=(l.resid2area[e]/t).toFixed(2),r.parasCls.residueArea.hasOwnProperty(c)&&(m=parseInt(l.resid2area[e]/r.parasCls.residueArea[c]*100),m>100&&(m=100),m>=50&&(p="out"),m<20&&(p="in")),n+=''+o+a+" "}return n+=""+c+' '+h[2]+' '+l.resid2area[e]+' '+m+"% "+p+" 0?-parseInt(C.z):parseInt(C.z),y.onBeforeRender=function(e,t,s,i,n,o){let a,d=new THREE.Vector3(0,0,0),c=i.getAttribute("position").array;for(let e=0,t=c.length;e0&&t.applySymdCls.applySymd(),void 0!==t.prevOtherMesh)for(let e=0,s=t.prevOtherMesh.length;e0&&(e=s.hashUtilsCls.hash2Atoms(t.chemicals,t.atoms));let i=4;if(void 0!==e){let n=t.contactCls.getAtomsWithinAtom(t.atoms,e,i),l=3.5;t.opts.hbonds="yes",Object.keys(n).length>0&&t.hBondCls.calculateChemicalHbonds(e,n,parseFloat(l)),t.bSetFog||t.transformCls.zoominSelection(s.hashUtilsCls.unionHash(e,n))}}else"hide"===e.chemicalbinding&&(t.hBondCls.hideHbonds(),t.showInterCls.hideExtraBonds(),t.bSetFog||t.transformCls.zoominSelection(t.atoms))}updateStabilizer(){let e=this.icn3d;if(e.icn3dui,e.stabilizerpnts=[],void 0!==e.pairArray)for(let t=0,s=e.pairArray.length;t=0;i--){let r=t.ssbondpnts[e][2*i],o=t.ssbondpnts[e][2*i+1],a={};a.color=n,a.dashed=!1;let d=[],c=[],h=[],p=[],m=!1,u=!1;for(let e in t.residues[r])"SG"===t.atoms[e].name&&(h.push(t.atoms[e].coord),d.push(t.atoms[e].serial),m=!0);if(!m)for(let e in t.residues[r])if("CA"===t.atoms[e].name){h.push(t.atoms[e].coord),d.push(t.atoms[e].serial),m=!0,u=!0;break}m=!1;for(let e in t.residues[o])"SG"===t.atoms[e].name&&(p.push(t.atoms[e].coord),c.push(t.atoms[e].serial),m=!0);if(!m)for(let e in t.residues[o])if("CA"===t.atoms[e].name){p.push(t.atoms[e].coord),c.push(t.atoms[e].serial),m=!0,u=!0;break}let g=u?7:3,f=!1;for(let e=0,t=h.length;e0&&(e.mdl.remove(e.prevMaps[e.prevMaps.length-1]),e.prevMaps.slice(e.prevMaps.length-1,1))}removeLastEmmap(){let e=this.icn3d;e.icn3dui,e.prevEmmaps.length>0&&(e.mdl.remove(e.prevEmmaps[e.prevEmmaps.length-1]),e.prevEmmaps.slice(e.prevEmmaps.length-1,1))}removeLastPhimap(){let e=this.icn3d;e.icn3dui,e.prevPhimaps.length>0&&(e.mdl.remove(e.prevPhimaps[e.prevPhimaps.length-1]),e.prevPhimaps.slice(e.prevPhimaps.length-1,1))}}class ot{constructor(e){this.icn3d=e}addResidueLabels(e,t,s,i,n){let l=this.icn3d,r=l.icn3dui;if(r.bNode)return;let o=r.hashUtilsCls.intHash(l.hAtoms,e);t?void 0===l.labels.schematic&&(l.labels.schematic=[]):void 0===l.labels.residue&&(l.labels.residue=[]);let a="";for(let e in o){let s=l.atoms[e],o={},d=s.structure+"_"+s.chain+"_"+s.resi;if(!s.het&&("CA"===s.name||"O3'"===s.name||"O3*"===s.name)||l.water.hasOwnProperty(s.serial)||l.ions.hasOwnProperty(s.serial)||l.chemicals.hasOwnProperty(s.serial)&&d!==a){if(o.position=s.coord,o.bSchematic=0,t&&(o.bSchematic=1),o.text=r.utilsCls.residueName2Abbr(s.resn),i)o.text+=s.resi;else if(n){let e=s.structure+"_"+s.chain+"_"+s.resi,t="";l.resid2refnum[e]&&(t=" "==l.resid2refnum[e].substr(0,1)?"":l.resid2refnum[e]),o.text=t}o.size=18,o.factor=.3;let e=s.color.getHexString().toUpperCase();o.color=i?"black"!=l.opts.background?l.colorWhitebkgd:l.colorBlackbkgd:n?"#00FFFF":"CCCCCC"===e||"C8C8C8"===e?"#888888":"#"+e,o.background="#FFFFFF",t?l.labels.schematic.push(o):l.labels.residue.push(o)}a=d}l.hlObjectsCls.removeHlObjects()}addNonCarbonAtomLabels(e){let t=this.icn3d,s=t.icn3dui;if(s.bNode)return;let i=s.hashUtilsCls.intHash(t.hAtoms,e);void 0===t.labels.schematic&&(t.labels.schematic=[]);for(let e in i){let s=t.atoms[e];if(!t.residues.hasOwnProperty(s.structure+"_"+s.chain+"_"+s.resi))continue;if("C"===s.elem)continue;let i={};i.position=s.coord,i.bSchematic=1,i.text=s.elem,i.size=18,i.color="black"!=t.opts.background?t.colorWhitebkgd:s.color.getHexString(),i.background="#FFFFFF",t.labels.schematic.push(i)}t.hlObjectsCls.removeHlObjects()}addAtomLabels(e,t){let s=this.icn3d,i=s.icn3dui;if(i.bNode)return;let n=i.hashUtilsCls.intHash(s.hAtoms,e);n=i.hashUtilsCls.intHash(s.dAtoms,n),void 0===s.labels.residue&&(s.labels.residue=[]);for(let e in n){let i=s.atoms[e],n={};n.position=i.coord,n.bSchematic=0,n.text=t?i.elem:i.name.padEnd(2," "),n.size=18,t&&(n.bSchematic=!0);let l=i.color.getHexString().toUpperCase();n.color="black"!=s.opts.background?s.colorWhitebkgd:s.colorBlackbkgd,t&&(n.color="CCCCCC"===l||"C8C8C8"===l?"#888888":"#"+l),n.background="#FFFFFF",s.labels.residue.push(n)}s.hlObjectsCls.removeHlObjects()}}class at{constructor(e){this.icn3d=e}onBeforeRender(e,t,s,i,n,l){let r=n.uniforms,o=[];if(r.objectId&&(r.objectId.value=SupportsReadPixelsFloat?this.id:this.id/255,o.push("objectId")),(r.modelViewMatrixInverse||r.modelViewMatrixInverseTranspose||r.modelViewProjectionMatrix||r.modelViewProjectionMatrixInverse)&&this.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,this.matrixWorld),r.modelViewMatrixInverse&&(r.modelViewMatrixInverse.value.copy(this.modelViewMatrix).invert(),o.push("modelViewMatrixInverse")),r.modelViewMatrixInverseTranspose&&(r.modelViewMatrixInverse?r.modelViewMatrixInverseTranspose.value.copy(r.modelViewMatrixInverse.value).transpose():r.modelViewMatrixInverseTranspose.value.copy(this.modelViewMatrix).invert().transpose(),o.push("modelViewMatrixInverseTranspose")),r.modelViewProjectionMatrix&&(s.updateProjectionMatrix(),r.modelViewProjectionMatrix.value.multiplyMatrices(s.projectionMatrix,this.modelViewMatrix),o.push("modelViewProjectionMatrix")),r.modelViewProjectionMatrixInverse){let e=new THREE.Matrix4;r.modelViewProjectionMatrix?(e.copy(r.modelViewProjectionMatrix.value),r.modelViewProjectionMatrixInverse.value.copy(e).invert()):(s.updateProjectionMatrix(),e.multiplyMatrices(s.projectionMatrix,this.modelViewMatrix),r.modelViewProjectionMatrixInverse.value.copy(e).invert()),o.push("modelViewProjectionMatrixInverse")}if(r.projectionMatrix&&(s.updateProjectionMatrix(),r.projectionMatrix.value.copy(s.projectionMatrix),o.push("projectionMatrix")),r.projectionMatrixInverse&&(s.updateProjectionMatrix(),r.projectionMatrixInverse.value.copy(s.projectionMatrix).invert(),o.push("projectionMatrixInverse")),o.length){let t=e.properties.get(n);if(t.program){let s=e.getContext(),i=t.program;s.useProgram(i.program);let n=i.getUniforms();o.forEach((function(e){n.setValue(s,e,r[e].value)}))}}}setParametersForShader(e){let t,s=this.icn3d,i=s.icn3dui.parasCls.backgroundColors[s.opts.background.toLowerCase()],n=2.5*s.maxD,l=4*s.maxD,r=void 0!==s.biomtMatrices&&s.biomtMatrices.length*s.cnt>s.maxatomcnt;"yes"===s.opts.slab?r?t=.1:void 0!==s.camMaxDFactorFog?(t=s.maxD*s.camMaxDFactorFog-10,n=2.5*s.maxD-t<0?0:2.5*s.maxD-t,l=4*s.maxD-t):t=s.maxD*s.camMaxDFactor:t=.1;let o=void 0!==e?e:1,a=s.shininess/100*.5;s.uniforms=THREE.UniformsUtils.merge([THREE.UniformsLib.common,{modelViewMatrix:{value:new THREE.Matrix4},modelViewMatrixInverse:{value:new THREE.Matrix4},modelViewMatrixInverseTranspose:{value:new THREE.Matrix4},modelViewProjectionMatrix:{value:new THREE.Matrix4},modelViewProjectionMatrixInverse:{value:new THREE.Matrix4},projectionMatrix:{value:new THREE.Matrix4},projectionMatrixInverse:{value:new THREE.Matrix4},diffuse:{type:"v3",value:[1,1,1]},emissive:{type:"v3",value:[.06,.06,.06]},roughness:{type:"f",value:.5},metalness:{type:"f",value:a},opacity:{type:"f",value:o},nearClip:{type:"f",value:t},ortho:{type:"f",value:0},shrink:{type:"f",value:.13},fogColor:{type:"v3",value:[i.r,i.g,i.b]},fogNear:{type:"f",value:n},fogFar:{type:"f",value:l},fogDensity:{type:"f",value:2}},THREE.UniformsLib.ambient,THREE.UniformsLib.lights]),s.defines={USE_COLOR:1,NEAR_CLIP:1,CAP:1},"yes"!==s.opts.fog||r||(s.defines.USE_FOG=1,"orthographic"===s.opts.camera&&(s.defines.FOG_EXP2=1)),s.bExtFragDepth&&(s.defines.USE_LOGDEPTHBUF_EXT=1)}drawImpostorShader(){this.icn3d.icn3dui.bNode||(this.setParametersForShader(),this.createImpostorShaderSphere("SphereImpostor"),this.createImpostorShaderCylinder("CylinderImpostor"))}getShader(e){this.icn3d.icn3dui;let t=$NGL_shaderTextHash[e];return t=t.replace(/#include\s+(\S+)/gim,(function(e,t){let s;return THREE.ShaderChunk.hasOwnProperty(t)&&(s=THREE.ShaderChunk[t]),s||""})),t}createImpostorShaderBase(e,t,s,i,n,l,r,o,a){let d=this.icn3d;d.icn3dui;let c=new THREE.ShaderMaterial({defines:d.defines,uniforms:d.uniforms,vertexShader:this.getShader(e+".vert"),fragmentShader:this.getShader(e+".frag"),depthTest:!0,depthWrite:!0,lights:!0});c.extensions.fragDepth=!0,"CylinderImpostor"==e?d.CylinderImpostorMaterial=c:"SphereImpostor"==e&&(d.SphereImpostorMaterial=c);let h,p,m=l*r,u=l*o,g=new(m>65535?Uint32Array:Uint16Array)(u);for(let e=0;eo?r:o,d=Math.sqrt(a),c=(d+s)*(d+s),h={};for(let r in e){let e=n.atoms[r];!i&&t.hasOwnProperty(e.serial)||(this.bOpm&&"DUM"===e.resn||e.coord.x
";if("atom"==e){let e=["proteins","nucleotides","chemicals","ions","water"];for(let i=0,l=e.length;i
",n+="Light green (P, T, S, A, Q, N, G): Polar
",n+="Grey: Charged, not hydrophobic
"):(n+="Green (W, F, L, I, Y, M, V, C): Hydrophobic
",n+="Yellow (P, T, S, A, Q, N, G): Polar
",n+="Red: Negatively Charged
",n+="Blue: Positively Charged
");let a=0;for(let e of r)s.parasCls.residueAbbrev[e[0]]&&(n+="
"),++a);n+="
",n+=s.htmlCls.clickMenuCls.setLegendHtml()):"confidence"==e?n+=s.htmlCls.clickMenuCls.setLegendHtml(!0):"exon"==e?(t.startColor="red",t.midColor="white",t.endColor="blue",t.startValue="Start",t.midValue="Middle",t.endValue="End",n+=s.htmlCls.clickMenuCls.setLegendHtml()):n="";n?($("#"+s.pre+"dl_legend_html").html(n),s.htmlCls.dialogCls.openDlg("dl_legend","Color Legend")):$("#"+s.pre+"dl_legend").hasClass("ui-dialog-content")&&$("#"+s.pre+"dl_legend").dialog("isOpen")&&$("#"+s.pre+"dl_legend").dialog("close")}getColorLegendForElem(e,t){let s=this.icn3d,i=s.icn3dui,n="",l={};for(let e in t){let t=s.atoms[e],i=void 0===t||void 0===t.color||"FFFFFF"===t.color.getHexString().toUpperCase()?"DDDDDD":t.color.getHexString();void 0===l[t.elem]&&(l[t.elem]={}),l[t.elem][i]=1}if(Object.keys(l).length>0){n+=""+e+"
";let t=Object.keys(l).sort();for(let e=0,s=t.length;e";for(let e in l[s])n+=" ";n+=i.parasCls.atomnames[s.toUpperCase()]+"
"}n+="
"}return n}getRes2color(e,t){let s=this.icn3d,i=s.icn3dui,n={},l=s.firstAtomObjCls.getResiduesFromAtoms(e);for(let e in l){let l=s.residues[e],r=s.firstAtomObjCls.getFirstAtomObj(l),o=t?r.resn:i.parasCls.residueAbbrev[r.resn],a=void 0===r||void 0===r.color||"FFFFFF"===r.color.getHexString().toUpperCase()?"DDDDDD":r.color.getHexString();null!=o&&(void 0===n[o]&&(n[o]={}),n[o][a]=1)}return n}getColorLegendForResidue(e){this.icn3d.icn3dui;let t="",s=this.getRes2color(e);if(Object.keys(s).length>0){t+="
"),-1!=o.indexOf("(")?(t+=r,++n):i+=r}i&&(t+="
"+i),t+=""}return t}getColorLegendForCharge(e){let t=this.icn3d;t.icn3dui;let s="",i=t.firstAtomObjCls.getResiduesFromAtoms(e),n={};for(let e in i){let s=t.residues[e],i=t.firstAtomObjCls.getFirstAtomObj(s);"ARG"==i.resn||"LYS"==i.resn?n.Positive=1:"HIS"==i.resn?n["Partial-Positive"]=1:"ASP"==i.resn||"GLU"==i.resn||t.nucleotides[i.serial]?n.Negative=1:n.Neutral=1}const l={Positive:"0000ff","Partial-Positive":"8080ff",Negative:"ff0000",Neutral:"888888"};let r=["Positive","Partial-Positive","Negative","Neutral"];s+="
")}return s+="
(Charges are at pH 7)",s+="
"}return t+="
Linker":"","C'' Strand":"FF0000","
Protodomain 2":"","D Strand":"0000FF","E Strand":"006400","F Strand":"FFD700","G Strand":"FF8C00","":"",Loop:"CCCCCC"};t+="
that by its duplication, symmetry operations
can generate a structural domain.
";for(let e in s){let i=s[e];t+="",i&&(t+=" "),t+=e,t+="
"}return t+="'+s+"
",h+=d+u+g,p+=d+u+g;let f="site"+e.toString(),b=0,y=0,v=1;i.seqStartLen&&i.seqStartLen[c]&&(p+=i.showSeqCls.insertMulGapOverview(c,i.seqStartLen[c])),i.seqStartLen&&i.seqStartLen[c]&&(h+=i.showSeqCls.insertMulGap(i.seqStartLen[c],"-"));for(let t=0,s=i.giSeq[c].length;t1&&(l=s[0]+"..");let r=i.ParserUtilsCls.getResi(c,t);if(h+=''+s+"",n.bNode){let t={};t[c+"_"+r]="site: "+C[e].title,i.resid2site[c].push(t)}p+=i.showSeqCls.insertGapOverview(c,t);let o=n.cfg.blast_rep_id==c?Math.round(i.seqAnnWidth*t/(i.maxAnnoLength+i.nTotalGap)-b-y):Math.round(i.seqAnnWidth*t/i.maxAnnoLength-b-y);o>=0&&(p+='",g+="
",h+=g,p+=g}h+="",p+="",m+="",$("#"+i.pre+"dt_site_"+c).html(h),$("#"+i.pre+"ov_site_"+c).html(p),$("#"+i.pre+"tt_site_"+c).html(m)}}for(let e in i.protein_chainid)r.hasOwnProperty(e)||($("#"+i.pre+"dt_cdd_"+e).html(""),$("#"+i.pre+"ov_cdd_"+e).html(""),$("#"+i.pre+"tt_cdd_"+e).html(""),$("#"+i.pre+"dt_site_"+e).html(""),$("#"+i.pre+"ov_site_"+e).html(""),$("#"+i.pre+"tt_site_"+e).html(""));i.showAnnoCls.enableHlSeq(),i.bAjaxCddSite=!0}getNoCdd(e){let t=this.icn3d;t.icn3dui,console.log("No CDD data were found for the protein "+e+"...");for(let e in t.protein_chainid)$("#"+t.pre+"dt_cdd_"+e).html(""),$("#"+t.pre+"ov_cdd_"+e).html(""),$("#"+t.pre+"tt_cdd_"+e).html(""),$("#"+t.pre+"dt_site_"+e).html(""),$("#"+t.pre+"ov_site_"+e).html(""),$("#"+t.pre+"tt_site_"+e).html("");t.showAnnoCls.enableHlSeq(),t.bAjaxCddSite=!0}setDomainFeature(e,t,s,i,n,l,r){let o,a,d,c=this.icn3d,h=c.icn3dui;s&&(r={},o={},a={},d={});let p=void 0!==e?e.length:0,m=s?14:19,u=s?100:120;for(let g=0;g
";let T='';i+=R+I+T,s&&(n+='
",i+=T,n+=T,s&&(n+=' ')}}return{html:i,html2:n,html3:l,acc2domain:r,pssmid2name:o,pssmid2fromArray:a,pssmid2toArray:d}}showAnnoType(e,t,s,i,n,l){let r=this.icn3d,o=r.icn3dui,a='
";let b='';a+=g+f+b,d+=g+f+b;let C=s,y=0,v=0;r.seqStartLen&&r.seqStartLen[e]&&(d+=r.showSeqCls.insertMulGapOverview(e,r.seqStartLen[e])),r.seqStartLen&&r.seqStartLen[e]&&(a+=r.showSeqCls.insertMulGap(r.seqStartLen[e],"-"));for(let t=0,i=r.giSeq[e].length;t1&&(c=n[0]+"..");let h=i,p=e+"_"+i,m=n+i;if("ssbond"==s){m="Residue "+p+" has disulfide bond with";let t="";if(void 0!==l[p])for(let e=0,s=l[p].length;e'+c+"",d+=r.showSeqCls.insertGapOverview(e,t);let u=o.cfg.blast_rep_id==e?Math.round(r.seqAnnWidth*t/(r.maxAnnoLength+r.nTotalGap)-y-v):Math.round(r.seqAnnWidth*t/r.maxAnnoLength-y-v);u>=0&&(d+='
",a+=b,d+=b,a+="",d+="",c+="",$("#"+r.pre+"dt_"+s+"_"+e).html(a),$("#"+r.pre+"ov_"+s+"_"+e).html(d),$("#"+r.pre+"tt_"+s+"_"+e).html(c)}setToolTip(){let e=this.icn3d;e.icn3dui,$("[id^="+e.pre+"snp]").add("[id^="+e.pre+"clinvar]").add("[id^="+e.pre+"ssbond]").add("[id^="+e.pre+"crosslink]").tooltip({content:function(){return $(this).prop("title")},show:null,close:function(e,t){t.tooltip.hover((function(){$(this).stop(!0).fadeTo(400,1)}),(function(){$(this).fadeOut("400",(function(){$(this).remove()}))}))}})}}class _t{constructor(e){this.icn3d=e}showInteraction(e,t){this.icn3d.icn3dui,this.showInteraction_base(e,t)}showInteraction_base(e,t){let s=this.icn3d,i=s.icn3dui;i.bNode&&(s.resid2contact||(s.resid2contact={}),s.resid2contact[e]||(s.resid2contact[e]=[])),void 0===s.chainname2residues&&(s.chainname2residues={});let n=Object.keys(s.chains),l=e,r=Math.round(l.indexOf("_"));if(s.firstAtomObjCls.getFirstCalphaAtomObj(s.chains[l]),void 0===s.chainname2residues[l]){s.chainname2residues[l]={};let t=n.length;if(t>100&&void 0===i.cfg.mmdbid&&void 0===i.cfg.gi&&void 0===i.cfg.blast_rep_id&&void 0===i.cfg.align&&void 0===i.cfg.chainalign)return $("#"+s.pre+"dt_interaction_"+e).html(""),void $("#"+s.pre+"ov_interaction_"+e).html("");for(let e=0;e
";let f='';o+=u+g+f,a+=u+g+f;let b="inter"+c.toString(),C=0,y=0,v=1;s.seqStartLen&&s.seqStartLen[e]&&(a+=s.showSeqCls.insertMulGapOverview(e,s.seqStartLen[e])),s.seqStartLen&&s.seqStartLen[e]&&(o+=s.showSeqCls.insertMulGap(s.seqStartLen[e],"-"));for(let t=0,n=s.giSeq[e].length;t
",o+=f,a+=f,++c}o+="",a+="",d+="",$("#"+s.pre+"dt_interaction_"+e).html(o),$("#"+s.pre+"ov_interaction_"+e).html(a),$("#"+s.pre+"tt_interaction_"+e).html(d),i.utilsCls.isMobile()?(s.hlSeqCls.selectSequenceMobile(),s.hlSeqCls.selectChainMobile()):s.hlSeqCls.selectSequenceNonMobile()}}class wt{constructor(e){this.icn3d=e}async showPTM(e,t,s,i,n){let l=this.icn3d,r=l.icn3dui,o=this,a=e.substr(0,e.indexOf("_")),d=e.substr(e.indexOf("_")+1);if("afmem"==s){let t={Transmembrane:[{begin:i,end:n}]};this.setAnnoPtmTransmem("transmem",t,e)}else if(a.length>5){let t,i="https://www.ebi.ac.uk/proteins/api/features/"+a;try{t=await r.getAjaxPromise(i,"json"),o.parsePTM(t,e,s)}catch{return void o.getNoPTM(e,s)}}else{let t,i=a.substr(0,4).toLowerCase(),n="https://www.ebi.ac.uk/pdbe/api/mappings/uniprot/"+i;try{t=await r.getAjaxPromise(n,"json");let a="";l.UPResi2ResiPosPerChain||(l.UPResi2ResiPosPerChain={}),l.UPResi2ResiPosPerChain[e]={};let c=t[i].UniProt,h=!1;for(let t in c){let s=c[t].mappings;for(let i=0,n=s.length;i
",r+=b+C+y,o+=b+C+y;let v=e+l.toString(),_=0,w=0,S=1;i.seqStartLen&&i.seqStartLen[s]&&(o+=i.showSeqCls.insertMulGapOverview(s,i.seqStartLen[s])),i.seqStartLen&&i.seqStartLen[s]&&(r+=i.showSeqCls.insertMulGap(i.seqStartLen[s],"-"));for(let e=0,t=i.giSeq[s].length;e
",r+=y,o+=y,++l}r+="",o+="",a+="",$("#"+i.pre+"dt_"+e+"_"+s).html(r),$("#"+i.pre+"ov_"+e+"_"+s).html(o),$("#"+i.pre+"tt_"+e+"_"+s).html(a)}getNoPTM(e,t){let s=this.icn3d;s.icn3dui,console.log("No PTM data were found for the chain "+e+"...");let i="ptm"==t?"ptm":"transmem";$("#"+s.pre+"dt_"+i+"_"+e).html(""),$("#"+s.pre+"ov_"+i+"_"+e).html(""),$("#"+s.pre+"tt_"+i+"_"+e).html(""),s.showAnnoCls.enableHlSeq(),s.bAjaxPTM=!0}}class St{constructor(e){this.icn3d=e}showCrosslink(e,t){let s=this.icn3d;s.icn3dui;let i=this;void 0===s.clbondpnts?setTimeout((function(){i.showCrosslink_base(e,t)}),1e3):this.showCrosslink_base(e,t)}showCrosslink_base(e,t){let s=this.icn3d;s.icn3dui.bNode&&(s.resid2crosslink||(s.resid2crosslink={}),s.resid2crosslink[e]||(s.resid2crosslink[e]=[]));let i=t,n={},l=i.substr(0,i.indexOf("_")),r=s.clbondpnts[l];if(void 0===r)return $("#"+s.pre+"dt_crosslink_"+e).html(""),$("#"+s.pre+"ov_crosslink_"+e).html(""),void $("#"+s.pre+"tt_crosslink_"+e).html("");for(let e=0,t=r.length;e17?s.substr(0,17)+"...":s,h=i[t].intervals,p={},m={},u=[],g=[],f={},b=0;for(let e=0,t=h.length;e
";let v='';o+=C+y+v,a+=C+y+v;let _="domain3d"+t.toString();l.seqStartLen&&l.seqStartLen[e]&&(o+=l.showSeqCls.insertMulGap(l.seqStartLen[e],"-"));for(let t=0,s=l.giSeq[e].length;t1&&(n=i[0]+"..");let r=s;o+=''+i+""}else o+="-"}l.seqStartLen&&l.seqStartLen[e]&&(o+=l.showSeqCls.insertMulGap(l.seqEndLen[e],"-"));let w=l.firstAtomObjCls.getFirstCalphaAtomObj(l.chains[e]),S=void 0===w.color||"FFFFFF"===w.color.getHexString()?"DDDDDD":w.color.getHexString(),A=void 0!==w.color?S:"CCCCCC";if(l.seqStartLen&&l.seqStartLen[e]&&(a+=l.showSeqCls.insertMulGapOverview(e,l.seqStartLen[e])),r.cfg.blast_rep_id!=e)for(let i=0,n=u.length;i",v+="
",o+=v,a+=v}o+="",a+="",d+="",$("#"+l.pre+"dt_domain_"+e).html(o),$("#"+l.pre+"ov_domain_"+e).html(a),$("#"+l.pre+"tt_domain_"+e).html(d)}}class xt{constructor(e){this.icn3d=e}async showSnp(e,t){this.icn3d.icn3dui,await this.showSnpClinvar(e,t,!0)}async showClinvar(e,t){this.icn3d.icn3dui,await this.showSnpClinvar(e,t,!1)}async showSnpClinvar(e,t,s){let i=this.icn3d.icn3dui,n=this,l=i.htmlCls.baseUrl+"vastdyn/vastdyn.cgi?chainid="+t;try{let r=await i.getAjaxPromise(l,"jsonp"),o=r.snpgi,a=r.gi;if(s)await n.showSnpPart2(e,t,o);else{let s=o;[6137708,1942289,224510717,2624886,253723219,2554905,75765331,3660278,312207882,319443632,342350956,1827805,109157826,1065265,40889086,6730307,163931185,494469,163931091,60594093,55669745,18655489,17942684,6980537,166235465,6435586,4139398,4389047,364506122,78101667,262118402,20664221,2624640,158430173,494395,28948777,34810587,13399647,3660342,261278854,342350965,384482350,378792570,15988303,213424334,4558333,2098365,10835631,3318817,374074330,332639529,122919696,4389286,319443573,2781341,67464020,194709238,210061039,364506106,28949044,40889076,161172338,17943181,4557976,62738484,365813173,6137343,350610552,17942703,576308,223674070,15826518,1310997,93279697,4139395,255311799,157837067,361132363,357380836,146387678,383280379,1127268,299856826,13786789,1311054,46015217,3402130,381353319,30750059,218766885,340707375,27065817,355333104,2624634,62738384,241913553,304446010].includes(a)&&(s=a),await n.showClinvarPart2(e,t,s)}}catch(t){return void(s?n.processNoSnp(e):n.processNoClinvar(e))}}navClinVar(e){let t=this.icn3d;t.icn3dui;let s=this;t.currClin[e]=-1,$(document).on("click","#"+t.pre+e+"_prevclin",(function(t){let i=s.icn3d;t.stopImmediatePropagation();let n=void 0!==i.resi2disease_nonempty[e]?Object.keys(i.resi2disease_nonempty[e]).length:0;--i.currClin[e],i.currClin[e]<0&&(i.currClin[e]=n-1),s.showClinVarLabelOn3D(e)})),$(document).on("click","#"+t.pre+e+"_nextclin",(function(t){let i=s.icn3d;t.stopImmediatePropagation();let n=void 0!==i.resi2disease_nonempty[e]?Object.keys(i.resi2disease_nonempty[e]).length:0;++i.currClin[e],i.currClin[e]>n-1&&(i.currClin[e]=0),s.showClinVarLabelOn3D(e)}))}showClinVarLabelOn3D(e){let t,s,i=this.icn3d,n=i.icn3dui,l=Object.keys(i.resi2disease_nonempty[e]);t=e,s=t+"_"+(parseInt(l[i.currClin[e]])+i.baseResi[e]).toString();let r="",o=i.resi2disease_nonempty[e][l[i.currClin[e]]];for(let e=0,t=o.length;e(from human)",i=" (based on human sequences and mapped to this structure by sequence similarity)"),C+=m?'
";C+='';let O="",R=0,I=0;p?f.seqStartLen&&f.seqStartLen[h]&&(C+=f.showSeqCls.insertMulGapOverview(h,f.seqStartLen[h])):f.seqStartLen&&f.seqStartLen[h]&&(C+=f.showSeqCls.insertMulGap(f.seqStartLen[h],"-"));for(let t=1,a=f.giSeq[h].length;t<=a;++t)if(p){if(void 0!==r[t]){let e=f.giSeq[h][t-1],i=e;e.length>1&&(i=e[0]+"..");let n=f.ParserUtilsCls.getResi(h,t-1)+i+">";for(let e=0,i=s[t].length;e=0&&(C+='
"+f.showAnnoCls.addSnpButton(m,"snpin3d","3D with scap","SNP in 3D with scap",70,g)+" ",u+=f.showAnnoCls.addSnpButton(m,"snpinter","Interactions","SNP Interactions in 3D",70,g)+" ",u+=f.showAnnoCls.addSnpButton(m,"snppdb","PDB","Download SNP PDB",35,g)),u+="
Links: ClinVar, dbSNP(rs"+i[t][e]+")",e
"),++r)}r>d&&2==e&&(p+="..")}else{d=1;for(let e=v;e
"+f.showAnnoCls.addSnpButton(r,"snpin3d","3D with scap","SNP in 3D with scap",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snpinter","Interactions","SNP Interactions in 3D",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snppdb","PDB","Download SNP PDB",35,m)),0!=i[t][e]&&(u+="
Link: dbSNP(rs"+i[t][e]+")"),e
");else{let s=l[t][e].split("; "),a=o[t][e].split("; "),d="",c=0;for(let t=0,i=s.length;t0?d+="; ":0!==e&&1!==e||(O='disease="'+s[t]+'"'),d+=s[t]+"("+a[t]+")",++c;""!=d?(u+=": "+d,C&&!b.cfg.hidelicense&&(u+="
"+f.showAnnoCls.addSnpButton(r,"snpin3d","3D with scap","SNP in 3D with scap",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snpinter","Interactions","SNP Interactions in 3D",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snppdb","PDB","Download SNP PDB",35,m)),u+="
Links: ClinVar, dbSNP(rs"+i[t][e]+")"):(C&&!b.cfg.hidelicense&&(u+="
"+f.showAnnoCls.addSnpButton(r,"snpin3d","3D with scap","SNP in 3D with scap",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snpinter","Interactions","SNP Interactions in 3D",70,m)+" ",u+=f.showAnnoCls.addSnpButton(r,"snppdb","PDB","Download SNP PDB",35,m)),u+="
Link: dbSNP(rs"+i[t][e]+")"),e
")}}y>d&&2==e&&(p+="..")}u+="
",C}processSnpClinvar(e,t,s,i,n){let l=this.icn3d,r=l.icn3dui,o='")+1),h=s[4],p=i?"":s[5],S=i?"":s[6],A=i?"":s[7],x=l.ParserUtilsCls.getResi(t,d-1);v[x]=1,""!=S&&(_[x]=1),g[d]=e+1,void 0===u[d]&&(u[d]=[]),u[d].push(c),void 0===C[d]&&(C[d]=[]),C[d].push(h),void 0===y[d]&&(y[d]=[]),y[d].push(p),void 0===f[d]&&(f[d]=[]),f[d].push(S),""!=S&&(void 0===l.resi2disease_nonempty[t][d]&&(l.resi2disease_nonempty[t][d]=[]),l.resi2disease_nonempty[t][d].push(S)),void 0===b[d]&&(b[d]=[]),b[d].push(A)}let S=Object.keys(v),A=Object.keys(_);if(i){let e=!1;o+=this.getSnpLine(1,2,u,C,y,f,g,b,S,A,1,t,!1,e,void 0,i),o+=this.getSnpLine(2,2,u,C,y,f,g,b,S,A,0,t,!1,e,void 0,i),d+=this.getSnpLine(1,2,u,C,y,f,g,b,S,A,1,t,!1,e,!0,i),d+=this.getSnpLine(2,2,u,C,y,f,g,b,S,A,0,t,!1,e,!0,i),a+=this.getSnpLine(1,2,u,C,y,f,g,b,S,A,1,t,!0,e,void 0,i),o+="0&&this.elt_size[s.sse-1]>=6&&0!=s.adj_strand2&&e++}for(let e=0;e
",w+=x+k+"
";let O='';C+=A+k+O,y+=x+k+O,v+=A+k+O;let R=e.indexOf("_"),I="cst"+e.substr(R+1),T=0,E=0,P=(void 0===l||"seq"===l||"custom"===l)&&-1==s.indexOf("cannot-be-aligned")&&-1==s.indexOf("cannot be aligned"),M="identity"===l&&-1==s.indexOf("cannot-be-aligned")&&-1==s.indexOf("cannot be aligned"),D={},H=0;A="";let F={},L={},N={},q=0;if(h)for(let e=0,t=h.length;e
",O+="",C+=O,v+=A+O,y+=O,_+="",w+="",h?($("#"+p.pre+"dt_custom_"+e+"_"+f).html(y+C),$("#"+p.pre+"ov_custom_"+e+"_"+f).html(v),$("#"+p.pre+"tt_custom_"+e+"_"+f).html(w+_)):($("#"+p.pre+"dt_custom_"+e+"_"+f).html(C),$("#"+p.pre+"ov_custom_"+e+"_"+f).html(v),$("#"+p.pre+"tt_custom_"+e+"_"+f).html(_))}getExonHtml(e,t,s,i,n,l,r){let o=this.icn3d;return o.icn3dui,'20)return!1;if(void 0!==o.giSeq&&void 0!==o.giSeq[e]){let r=this.getFullText(s);return s=r.text,this.showNewTrack(e,t,s,void 0,void 0,i,n,l),!1}setTimeout((function(){a.checkGiSeq(e,t,s,i,n,l,r+1)}),100)}getFullText(e){this.icn3d.icn3dui;let t="",s=[],i=[],n=e.split(","),l=-1;for(let e=0,r=n.length;eA&&(A=e)}let x=S,k=w.length-(A+1),O=[],R=[];for(let e=0,t=p.length;e"),d=a[1].indexOf("\n");n=a[1].substr(d+1).replace(/\n/g,"");for(let e=2,t=a.length;e
Click \"Assembly\" in the menu \"View\" to switch between asymmetric unit and biological assembly("+e.asuCnt+" asymmetric unit).e.maxAnnoLengthOri&&(e.protein_chainid.hasOwnProperty(t)||s.hasOwnProperty(t))&&(e.maxAnnoLengthOri=e.chainsSeq[t].length);e.maxAnnoLength=e.maxAnnoLengthOri}return{nucleotide_chainid:s,chemical_chainid:i,chemical_set:n}}async showAnnotations(){let e=this.icn3d,t=e.icn3dui,s=this,i=this.showAnnotations_part1(),n=i.nucleotide_chainid,l=i.chemical_chainid,r=i.chemical_set;if(!e.bAnnoShown||e.bResetAnno)if(e.bAnnoShown=!0,void 0===t.cfg.blast_rep_id){if(e.bFullUi){if(void 0!==t.cfg.mmtfid){let t=Object.keys(e.structures)[0];await e.mmcifParserCls.downloadMmcifSymmetry(t,"mmtfid")}await this.showAnnoSeqData(n,l,r)}}else if(void 0===t.cfg.blast_rep_id||e.bSmithwm||e.bLocalSmithwm){if(void 0!==t.cfg.blast_rep_id&&(e.bSmithwm||e.bLocalSmithwm)){let i,o,a=[t.cfg.blast_rep_id];if(-1!=t.cfg.query_id.indexOf(">")?o=t.cfg.query_id.substr(t.cfg.query_id.indexOf("\n")+1):!/\d/.test(t.cfg.query_id)||t.cfg.query_id.length>50?o=t.cfg.query_id:a.push(t.cfg.query_id),e.blastAcxn){let s=t.cfg.afid+"_A",n="";for(let t=0,i=e.chainsSeq[s].length;t5){let n;e.uniprot2acc&&e.uniprot2acc[i]?e.uniprot2acc[i]:e.uniprot2acc={},n="https://rest.uniprot.org/uniprotkb/search?format=json&fields=xref_geneid,gene_names&query="+i;let l=await t.getAjaxPromise(n,"json"),r=l.results[0]&&l.results[0].uniProtKBCrossReferences&&l.results[0].uniProtKBCrossReferences[0]?l.results[0].uniProtKBCrossReferences[0].id:void 0,o=l.results[0]&&l.results[0].genes&&l.results[0].genes[0]&&l.results[0].genes[0].geneName?l.results[0].genes[0].geneName.value:"ID "+r;e.chainsGene[s]={geneId:r,geneSymbol:o}}}for(let s in e.protein_chainid){let i=t.utilsCls.isMobile()?"none":"button",l=e.showSeqCls.getProteinName(s),r=l,o=0==n?"Proteins:
":"",a=e.chainsGene[s]&&e.chainsGene[s].geneId&&e.chainsGene[s].geneDesc?"(Gene: "+e.chainsGene[s].geneSymbol+")":"",d=s.substr(0,s.indexOf("_")),c=d.length>5?''+s+"":s,h="
"),++n}if(t.bNode||e.annoCddSiteCls.setToolTip(),void 0!==e.chainid_seq)await this.processSeqData(e.chainid_seq);else try{let n=[],l=[];for(let e=0,t=i.length;e40&&(r=r.substr(0,40)+"...");let o="";0==i&&("protein"==s?o="Proteins:
":"nucleotide"==s?o="Nucleotides:
":"chemical"==s&&(o="Chemicals/Ions/Water:
")),$("#"+n.pre+"dl_annotations").append("
"),n.giSeq[e]=[];for(let t=0;t
":"",o=t[0].lastIndexOf("_"),a=t[0].substr(0,o),d=void 0!==l.cfg.mmdbid&&void 0!==n.chainid2sid?n.chainid2sid[a]:void 0;i=void 0!==d?""+e+" ":""+e+"",$("#"+n.pre+"dl_annotations").append("
");let c='
",c+="
",g+=u+'';let s=0,i=0,n="";a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e]," "));for(let t=0,l=o.length;t
",g+="
",g+=u+'',a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e],"-"));for(let t=0,s=o.length;t':'',g+=" ";else if("E"==a.secondaries[s]){a.firstAtomObjCls.getFirstCalphaAtomObj(a.residues[s]).ssend?"green"==a.sheetcolor?g+='':"yellow"==a.sheetcolor&&(g+=''):"green"==a.sheetcolor?g+='':"yellow"==a.sheetcolor&&(g+=''),g+=" "}else"c"==a.secondaries[s]?g+=' ':"o"==a.secondaries[s]&&(g+=' ');else g+="-"}a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqEndLen[e],"-")),g+='',g+="",g+="
",g+="
";let v='';g+=u+v,f+=u+v;let _,w=0;a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e],"-"));for(let t=0,s=o.length;t1&&(i=s[0]+".."),_=a.ParserUtilsCls.getResi(e,t),a.residues.hasOwnProperty(e+"_"+_)){let n="333333";if(d.cfg.blast_rep_id==e&&void 0!==a.fullpos2ConsTargetpos&&void 0!==a.fullpos2ConsTargetpos[t+w])n=a.fullpos2ConsTargetpos[t+w].color;else{let t=a.firstAtomObjCls.getFirstCalphaAtomObj(a.residues[e+"_"+_]),s=void 0===t.color||"FFFFFF"===t.color.getHexString().toUpperCase()||"FFF"===t.color.getHexString().toUpperCase()?"DDDDDD":t.color.getHexString();n=void 0!==t.color?s:"CCCCCC"}g+=''+i+""}else i=i.toLowerCase(),g+=''+i+""}a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqEndLen[e],"-")),d.cfg.blast_rep_id==e&&(a.opts.color=a.blastAcxn?"confidence":"conservation",a.setColorCls.setColorByOptions(a.opts,a.atoms));let S=a.firstAtomObjCls.getFirstCalphaAtomObj(a.chains[e]),A=S.color?S.color.getHexString():"CCCCCC",x=Math.round(a.seqAnnWidth*o.length/(a.maxAnnoLength+a.nTotalGap));if(x<1&&(x=1),a.seqStartLen&&a.seqStartLen[e]&&(f+=this.insertMulGapOverview(e,a.seqStartLen[e])),d.cfg.blast_rep_id!=e)f+='
",g+=u,f+=u,d.cfg.blast_rep_id==e){if(void 0!==r&&""!==r){u='
";let t='';g+=u+t,f+=u+t;let s=0,i=0,l=1;a.queryStart;for(let t=0,n=r.length;t
",g+=u,f+=u}u='
";let t='';g+=u+t,f+=u+t;let s=a.queryStart;for(let t=0,i=l.length;t-":(void 0===a.fullpos2ConsTargetpos||void 0===a.fullpos2ConsTargetpos[t]||a.residues.hasOwnProperty(e+"_"+a.fullpos2ConsTargetpos[t].pos)||(i=i.toLowerCase()),g+=''+i+"",++s)}let o=a.firstAtomObjCls.getFirstCalphaAtomObj(a.chains[e]),d=void 0===o.color||"FFFFFF"===o.color.getHexString()?"DDDDDD":o.color.getHexString(),c=void 0!==o.color?d:"CCCCCC",h=[],p=[],m="-";for(let e=0,t=l.length;e
",g+=u,f+=u}if(g+="",f+="",b+="",a.giSeq[e].length>10){let t=a.firstAtomObjCls.getFirstCalphaAtomObj(a.chains[e]);if((void 0!==d.cfg.mmdbid||void 0!==d.cfg.gi||void 0!==d.cfg.blast_rep_id||void 0!==d.cfg.align||void 0!==d.cfg.chainalign||void 0!==d.cfg.mmdbafid)&&void 0!==t.resi_ori&&t.resi_ori!=t.resi&&-1==e.indexOf("Misc")){u='
",g+=u+'',a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqStartLen[e],"-"));for(let t=0,s=o.length;t",e%10==0&&(g+=e+" "),g+=""}else g+=""}a.seqStartLen&&a.seqStartLen[e]&&(g+=this.insertMulGap(a.seqEndLen[e],"-")),g+='',g+="",g+="
",g+="
",r+=p+'';let m=!1;for(let s=0,l=e.length;s
",r+="",A="-",x="--";for(let t=0,s=r.length;t0&&(T=1,t=i.getGraphCls.getNodeTopBottom(c[e],d,void 0,T,g[e]),h[e]=t.nodeArray1,m[e]=t.nodeArray2,d=n.hashUtilsCls.unionHash(d,t.name2node),T=2,t=i.getGraphCls.getNodeTopBottom(c[e],d,void 0,T,y[e]),f[e]=t.nodeArray1,b[e]=t.nodeArray2,d=n.hashUtilsCls.unionHash(d,t.name2node)),k[e]=l[e].length,O[e]=o[e].length,R=Math.max(R,O[e]),I.push(p[e])}let E,P,M,D,H,F=1,L=3*F,N=7*F,q=10,U=10,$=30,j=20;t?(M=(n.utilsCls.sumArray(k)+2*I.length)*(L+N)+4*U+2*$+j*I.length,P=(R+2)*(L+N)+2*q+$):(E=110+j,M=E*I.length,P=(R+2)*(L+N)+2*q,P+=20),Object.keys(i.chainsMapping).length>0&&(M*=3),t?(i.scatterplotWidth=2*P,H=i.scatterplotWidth,D=n.scatterplotid):(i.linegraphWidth=2*P,H=i.linegraphWidth,D=n.linegraphid),s=0==I.length?"No interactions found for each structure
":"2D integration graph for "+I.length+" structure(s) "+I+'. There are three sections: "Interactions", "Common interactions", and "Different interactions". Each section has '+I.length+" graphs.
",s+=""}else if(t){let e,t,l,c,h=p[0],m=o.length,u=a.length,g=1,f=3*g,b=7*g,C=30;t=(m+2)*(f+b)+2*10+C,e=(u+2)*(f+b)+2*10+C,i.scatterplotWidth=2*e,c=i.scatterplotWidth,l=n.scatterplotid,s=r.length>0?"":"No interactions found for these two sets
",s+=""}else{let e=p[0],t=o.length,l=a.length,c=1,h=3*c,m=7*c,u=110,g=10,f=t>l?t*(h+m)+2*g:l*(h+m)+2*g;i.linegraphWidth=2*f,s=r.length>0?"":"No interactions found for these two sets
",s+=""}return i.lineGraphStr+="}\n",i.scatterplotStr=i.lineGraphStr,t?$("#"+i.pre+"scatterplotDiv").html(s):$("#"+i.pre+"linegraphDiv").html(s),s}drawGraphPerType(e,t,s,i,n,l,r,o,a,d,c,h,p,m){let u=this.icn3d;u.icn3dui;let g,f,b="",C=2==t.length&&"2"==t[1].replace(t[0],"");0==e?(g="Interactions in ",f=""):1==e?(g="Common interactions in ",f="_common"):2==e&&(g="Different interactions in ",f="_diff");for(let y=0,v=t.length;y
",E=p.resid2specCls.atoms2residues(Object.keys(C)),P=p.resid2specCls.atoms2residues(Object.keys(y)),M="select "+p.resid2specCls.residueids2spec(E),D="select "+p.resid2specCls.residueids2spec(P);T+="Set 1: "+e+'
',T+="Set 2: "+t+'
',T+='
';let H=p.resid2specCls.atoms2residues(Object.keys(R)),F=p.resid2specCls.atoms2residues(Object.keys(I)),L="select "+p.resid2specCls.residueids2spec(H),N="select "+p.resid2specCls.residueids2spec(F);T+='interface_1
',T+='interface_2
';let q=T;if(("graph"==i||"linegraph"==i||"scatterplot"==i||b)&&(T=""),T+=O,"save1"==i||"save2"==i){T=q;let e="";"save1"==i?e="Set 1":"save2"==i&&(e="Set 2"),T+='
Interactions Sorted on '+e+': 0&&l!=a&&(i.push({res1:a,res2:w,cntHbond:f,cntIonic:b,cntContact:C,cntHalegen:y,cntPication:v,cntPistacking:_}),o+=this.getInteractionPerResidue(d,c,h,p,m,u,g,f,b,C,y,v,_),c="",h="",p="",m="",u="",g="",f=0,b=0,C=0,y=0,v=0,_=0,w=""),x=t.resids2inter[S].hbond,k=this.getInteractionPairDetails(x,e,"hbond"),c+=k.html,f+=k.cnt,k.cnt>0&&(w+=r+":hbond_"+k.cnt+" "),x=t.resids2inter[S].ionic,k=this.getInteractionPairDetails(x,e,"ionic"),h+=k.html,b+=k.cnt,k.cnt>0&&(w+=r+":ionic_"+k.cnt+" "),x=t.resids2inter[S].contact,k=this.getContactPairDetails(x,e,"contact"),p+=k.html,C+=k.cnt,k.cnt>0&&(w+=r+":contact_"+k.cnt+" "),x=t.resids2inter[S].halogen,k=this.getInteractionPairDetails(x,e,"halogen"),m+=k.html,y+=k.cnt,k.cnt>0&&(w+=r+":halogen_"+k.cnt+" "),x=t.resids2inter[S]["pi-cation"],k=this.getInteractionPairDetails(x,e,"pi-cation"),u+=k.html,v+=k.cnt,k.cnt>0&&(w+=r+":pi-cation_"+k.cnt+" "),x=t.resids2inter[S]["pi-stacking"],k=this.getInteractionPairDetails(x,e,"pi-stacking"),g+=k.html,_+=k.cnt,k.cnt>0&&(w+=r+":pi-stacking_"+k.cnt+" "),a=l,d=O}i.push({res1:a,res2:w,cntHbond:f,cntIonic:b,cntContact:C,cntHalegen:y,cntPication:v,cntPistacking:_}),o+=this.getInteractionPerResidue(d,c,h,p,m,u,g,f,b,C,y,v,_);let S="";if(n.length>0){S+='',S+="
",S+="Residue # Hydrogen
Bond# Salt Bridge
/Ionic Interaction# Contact ",S+="# Halogen
Bond# π-Cation # π-Stacking ",S+="Hydrogen Bond (backbone atoms: @CA, @N, @C, @O) Salt Bridge/Ionic Interaction Contact ",S+="Halogen Bond π-Cation π-Stacking ";let e=' ",S+="",S+=o,S+=" ';S+=e,S+=e,S+='Atom1 Atom2 Distance(Å) Highlight in 3D ',S+=e,S+=e,S+=e,S+="Atom1 Atom2 # Contacts Min Distance(Å) C-alpha Distance(Å) Highlight in 3D
"}return{html:S,bondCnt:i}}getInteractionPerResidue(e,t,s,i,n,l,r,o,a,d,c,h,p){this.icn3d.icn3dui;let m="";m+=' ",m}getInteractionPairDetails(e,t,s){let i=this.icn3d;i.icn3dui;let n="",l=0,r=' ';if(void 0!==e)for(let a in e){let d=a.split(","),c="save1"==t?d[0]:d[1],h="save1"==t?d[1]:d[0],p=i.getGraphCls.convertLabel2Resid(c),m=i.firstAtomObjCls.getFirstAtomObj(i.residues[p]),u=m.color?m.color.getHexString():"",g=i.getGraphCls.convertLabel2Resid(h),f=i.firstAtomObjCls.getFirstAtomObj(i.residues[g]),b=f.color?f.color.getHexString():"",C=Math.sqrt(e[a]).toFixed(1);n+=''+e[3]+e[2]+" "+o+" "+a+" "+d+" "+c+" "+h+" "+p+" ";let u=[t,s,i,n,l,r];for(let e in u){m+=' "}return m+="'+u[e]+"
",++l}return{html:n,cnt:l}}getContactPairDetails(e,t){let s=this.icn3d;s.icn3dui;let i="",n=0,l=' ';if(void 0!==e)for(let o in e){let a=o.split(","),d="save1"==t?a[0]:a[1],c="save1"==t?a[1]:a[0],h=s.getGraphCls.convertLabel2Resid(d),p=s.firstAtomObjCls.getFirstAtomObj(s.residues[h]),m=p.color?p.color.getHexString():"",u=s.getGraphCls.convertLabel2Resid(c),g=s.firstAtomObjCls.getFirstAtomObj(s.residues[u]),f=g.color?g.color.getHexString():"",b=e[o].split("_"),C=b[0],y=b[1],v=b[2],_=b[3],w=b[4];i+=' '+c+r+u+o+' '+h+r+b+o+' '+C+" ",n+='',n+=" ",n+=parseInt(w)}return{html:i,cnt:n}}exportInteractions(){var e=this.icn3d,t=e.icn3dui;let s=' '+d+"@"+v+l+m+r+' '+c+"@"+_+l+f+r+' '+w+' '+C+' '+y+" ",i+='',i+="
Interacting residues: ';for(let t in e.chainname2residues)for(let i in e.chainname2residues[t]){let n=t.substr(0,t.indexOf("_"))+"_"+i.substr(0,i.indexOf(" "));s+="Base Chain: Residues Interacting Chain "}s+=""+t+": ",s+=e.resid2specCls.residueids2spec(e.chainname2residues[t][i]),s+=" "+n+" "+n[e]+" Cys "+n[e+1]+" Cys ",++i}}let n='
'+i+" disulfide pairs: ";n+=s,n+="Residue ID 1 Residue ID 2 "+r+" "+t.resn+" "+o+" "+n.resn+" ",++i}n[r+"_"+o]=1,n[o+"_"+r]=1}}let l='
'+i+" cross-linkage pairs: ";l+=s,l+="Residue ID 1 Residue ID 2 ",++l}}let a=' '+t+r+d+o+' '+i+r+h+o+' '+p+" ","view"==e&&(n+=''),n+="
'+l+" hydrogen bond pairs (backbone atoms: @CA, @N, @C, @O):
";if(l>0&&(a+=" ",a+=n,a+="Atom 1 Atom 2 Distance(Å) ","view"==e&&(a+='Highlight in 3D '),a+="
"),"graph"==e||"linegraph"==e||"scatterplot"==e){return s.getGraphCls.getGraphLinks(s.resid2ResidhashHbond,s.resid2ResidhashHbond,i.htmlCls.hbondColor,t,i.htmlCls.hbondValue)}return a}exportSaltbridgePairs(e,t){var s=this.icn3d,i=s.icn3dui;let n="",l=0,r=' ';for(let t in s.resid2ResidhashSaltbridge){let i=s.getGraphCls.convertLabel2Resid(t),a=s.firstAtomObjCls.getFirstAtomObj(s.residues[i]),d=a.color?a.color.getHexString():"";for(let i in s.resid2ResidhashSaltbridge[t]){let a=s.getGraphCls.convertLabel2Resid(i),c=s.firstAtomObjCls.getFirstAtomObj(s.residues[a]),h=c.color?c.color.getHexString():"",p=Math.sqrt(s.resid2ResidhashSaltbridge[t][i]).toFixed(1);n+=' ",++l}}let a=' '+t+r+d+o+' '+i+r+h+o+' '+p+" ","view"==e&&(n+=''),n+="
'+l+" salt bridge/ionic interaction pairs:
";if(l>0&&(a+=" ",a+=n,a+="Atom 1 Atom 2 Distance(Å) ","view"==e&&(a+='Highlight in 3D '),a+="
"),"graph"==e||"linegraph"==e||"scatterplot"==e){return s.getGraphCls.getGraphLinks(s.resid2ResidhashSaltbridge,s.resid2ResidhashSaltbridge,i.htmlCls.ionicColor,t,i.htmlCls.ionicValue)}return a}exportHalogenPiPairs(e,t,s){var i=this.icn3d,n=i.icn3dui;let l,r,o,a="",d=0,c=' ';"halogen"==s?(l=i.resid2ResidhashHalogen,r=n.htmlCls.halogenColor,o=n.htmlCls.halogenValue):"pi-cation"==s?(l=i.resid2ResidhashPication,r=n.htmlCls.picationColor,o=n.htmlCls.picationValue):"pi-stacking"==s&&(l=i.resid2ResidhashPistacking,r=n.htmlCls.pistackingColor,o=n.htmlCls.pistackingValue);for(let t in l){let n=i.getGraphCls.convertLabel2Resid(t),r=i.firstAtomObjCls.getFirstAtomObj(i.residues[n]),o=r.color?r.color.getHexString():"";for(let n in l[t]){let r=i.getGraphCls.convertLabel2Resid(n),p=i.firstAtomObjCls.getFirstAtomObj(i.residues[r]),m=p.color?p.color.getHexString():"",u=Math.sqrt(l[t][n]).toFixed(1);a+=' ",++d}}let p=' '+t+c+o+h+' '+n+c+m+h+' '+u+" ","view"==e&&(a+=''),a+="
'+d+" "+s+" pairs:
";if(d>0&&(p+=" ",p+=a,p+="Atom 1 Atom 2 Distance(Å) ","view"==e&&(p+='Highlight in 3D '),p+="
"),"graph"==e||"linegraph"==e||"scatterplot"==e){return i.getGraphCls.getGraphLinks(l,l,r,t,o)}return p}exportSpherePairs(e,t,s){var i=this.icn3d,n=i.icn3dui;let l="",r=0,o=e?i.resid2ResidhashInteractions:i.resid2ResidhashSphere,a=' ';for(let s in o){let n=i.getGraphCls.convertLabel2Resid(s),c=i.firstAtomObjCls.getFirstAtomObj(i.residues[n]),h=c.color?c.color.getHexString():"";for(let n in o[s]){let p=i.getGraphCls.convertLabel2Resid(n),m=i.firstAtomObjCls.getFirstAtomObj(i.residues[p]),u=m.color?m.color.getHexString():"",g=o[s][n].split("_"),f=g[0],b=g[1];c=g[2],m=g[3];let C=g[4];e?(l+=' "):l+=" '+s+"@"+c+a+h+d+' '+n+"@"+m+a+u+d+' '+C+' '+f+' '+b+" ","view"==t&&(l+=''),l+=" ",++r}}let c='"+s+" "+n+' '+C+' '+f+' '+b+"
'+r+" residue pairs in "+(e?"the contacts":"sphere")+":
";if(r>0&&(e?(c+=' "):c+='Residue 1 Residue 2 Num Contacts Min Distance(Å) C-alpha Distance(Å) ',"view"==t&&(c+='Highlight in 3D '),c+=" ',c+=l,c+="Residue 1 Residue 2 Num Contacts Min Distance(Å) C-alpha Distance(Å)
"),"graph"==t||"linegraph"==t||"scatterplot"==t||"calpha"==t||"cbeta"==t||"heavyatoms"==t){return i.getGraphCls.getGraphLinks(o,o,n.htmlCls.contactColor,s,n.htmlCls.contactValue)}return c}}class $t{constructor(e){this.icn3d=e}drawGraph(e,t){var s=this.icn3d,i=s.icn3dui;if(void 0===n)var n=d3;var l=JSON.parse(e),r=$("#"+t).width(),o=$("#"+t).height(),a=isNaN(r)?300:1*r,d=isNaN(o)?300:1*o,c=r,h=o,p=d3.select("#"+i.svgid).attr("width",r).attr("height",o).attr("viewBox","0,0,"+a+","+d);p.selectAll(".g-main").remove();var m=p.append("g").classed("g-main",!0),u=m.append("rect").attr("width",c).attr("height",h).style("fill","#FFF"),g=m.append("g"),f=n.zoom().on("zoom",(function(){g.attr("transform",n.event.transform)}));if(m.call(f),l.links){for(var b=[],C={},y=0,v=l.nodes.length;y
",i+="",g+="}\n",t){n.alignerrormapStr=g,$("#"+n.pre+"alignerrormapDiv").html(i);let e=$("#"+l.alignerrormapid+"_scale").val();$("#"+l.alignerrormapid).attr("width",(n.alignerrormapWidth*parseFloat(e)).toString()+"px")}else n.contactmapStr=g,$("#"+n.pre+"contactmapDiv").html(i);return i}}class Bt{constructor(e){this.icn3d=e}async downloadAlignment(e,t){let s=this.icn3d,i=s.icn3dui,n=this;s.opts.proteins="c alpha trace";let l=e.split(","),r="ids="+e,o=i.htmlCls.baseUrl+"vastplus/vastplus.cgi?v=3&cmd=c&b=1&s=1&w3d&"+r;void 0!==i.cfg.inpara&&(o+=i.cfg.inpara),s.pdbid_chain2title={},void 0===s.chainids2resids&&(s.chainids2resids={});let a={},d="These two MMDB IDs "+l+' do not have 3D alignment data in the VAST+ database. You can try the VAST alignment by visiting the VAST+ page https://www.ncbi.nlm.nih.gov/Structure/vastplus/vastplus.cgi?uid=[PDB ID] (e.g., uid=1KQ2), and clicking "Original VAST"',c=await i.getAjaxPromise(o,"jsonp",!0,d);if(a=c.seqalign,void 0===a)return alert(d),!1;s.pdbid_molid2chain={},s.chainsColor={};for(let e=0,t=2;e5){let s=!0,i=!0;c=await r.pdbParserCls.loadPdbData(t[e],l,!1,s,"query",h,i)}else{let s=!0;c=await r.mmdbParserCls.parseMmdbData(t[e],"query",i[e+1],e,h,s)}d=o.hashUtilsCls.unionHash(d,c)}if(o.cfg.resnum)await r.realignParserCls.realignChainOnSeqAlign(s,i);else if(o.cfg.resdef)await r.realignParserCls.realignChainOnSeqAlign(s,i,void 0,!0);else{await r.pdbParserCls.applyCommandDssp(!0);for(let e in r.pdbChainIndexHash){let t=r.pdbChainIndexHash[e].split("_");l=t[0],t[1],n=t[2],t[3],a.transformStructure(l,e-1,"query")}let e=[],t=[],c=[],h=o.htmlCls.baseUrl+"vastdyn/vastdyn.cgi",p=o.htmlCls.baseUrl+"tmalign/tmalign.cgi";for(let s in r.afChainIndexHash){let i=r.afChainIndexHash[s].split("_");l=i[0];let a=i[1];n=i[2];let d,m=i[3];if("tmalign"!=o.cfg.aligntool){let e={domains1:r.domain3dCls.getDomainJsonForAlign(r.chains[l+"_"+a]),domains2:r.domain3dCls.getDomainJsonForAlign(r.chains[n+"_"+m])};d=o.getAjaxPostPromise(h,e)}else{let e={pdb_query:r.saveFileCls.getAtomPDB(r.chains[l+"_"+a]),pdb_target:r.saveFileCls.getAtomPDB(r.chains[n+"_"+m])};d=o.getAjaxPostPromise(p,e)}e.push(d),t.push(s-1),c.push(l)}let m=Promise.allSettled(e),u=await m;await a.downloadChainalignmentPart2b(s,i,d,u,t,n,c)}}async downloadChainalignmentPart2b(e,t,s,i,n,l,r){let o=this.icn3d,a=o.icn3dui;for(let e=0,t=i.length;e
",r.tmscore=e[0].score.toPrecision(4)),$("#"+r.pre+"dl_rmsd_html").html(n),o.cfg.bSidebyside||o.htmlCls.dialogCls.openDlg("dl_rmsd","RMSD of alignment"),a=!0}return a}async loadOpmDataForChainalign(e,t,s,i){let n=this.icn3d,l=n.icn3dui,r=this;if(l.cfg.resnum||l.cfg.resdef)n.bCommandLoad||n.init(),await this.downloadChainalignmentPart2(e,t,void 0,s);else{let o=l.htmlCls.baseUrl+"vastdyn/vastdyn.cgi?mmdbids2opm="+i.join("','"),a=await l.getAjaxPromise(o,"jsonp");if(a&&a.mmdbid){let i=a.mmdbid;n.selectedPdbid=i;let o="https://opm-assets.storage.googleapis.com/pdb/"+i.toLowerCase()+".pdb",d=await l.getAjaxPromise(o,"text");n.bOpm=!0;let c=!0,h=n.loadPDBCls.loadPDB(d,i,n.bOpm,c);$("#"+n.pre+"selectplane_z1").val(n.halfBilayerSize),$("#"+n.pre+"selectplane_z2").val(-n.halfBilayerSize),$("#"+n.pre+"extra_mem_z").val(n.halfBilayerSize),$("#"+n.pre+"intra_mem_z").val(-n.halfBilayerSize),n.bCommandLoad||n.init(),await r.downloadChainalignmentPart2(e,t,h,s)}else n.bCommandLoad||n.init(),await r.downloadChainalignmentPart2(e,t,void 0,s)}}async downloadMmdbAf(e,t,s){let i=this.icn3d,n=i.icn3dui;i.structArray=i.structures?Object.keys(i.structures):[],0==i.structArray.length?i.init():(i.resetConfig(),i.bResetAnno=!0,i.bResetSets=!0);let l=e.split(","),r=[];for(let e=0,t=l.length;e1&&($("#"+i.pre+"assemblyWrapper").show(),i.asuCnt=i.biomtMatrices.length);let d,c,h,p,m,u,g,f,b,C,y,v,_,w,S,A,x,k,O,R={},I=[],T="coil",E="",P=0,M=0,D={onModel:function(e){d=0===e.modelIndex?a:a+(e.modelIndex+1).toString()},onChain:function(e){c=e.chainName;let t=d+"_"+c;void 0===i.structures[d]&&(i.structures[d]=[]),i.structures[d].push(t)},onGroup:function(e){h=e.groupName,p=e.groupId;let t=d+"_"+c+"_"+p;m=0===e.secStruct||2===e.secStruct||4===e.secStruct?"helix":3===e.secStruct?"sheet":-1===e.secStruct?"other":"coil";let s=!1;if(c!==E){if(x=void 0,O=void 0,"coil"!==m&&"other"!==m?(u=!0,g=!1):(u=!1,g=!1),"coil"!==T&&"other"!==T){let e=d+"_"+E+"_"+P.toString();for(let t in i.residues[e])i.atoms[t].ssbegin=!1,i.atoms[t].ssend=!0}}else x=A,O=k,m!==T?"coil"===T||"other"===T?(u=!0,g=!1):"coil"===m||"other"===m?(s=!0,u=!1,g=!1):("sheet"===T&&"helix"===m||"helix"===T&&"sheet"===m)&&(s=!0,u=!0,g=!1):(u=!1,g=!1);if(s&&!isNaN(p)){let e=d+"_"+c+"_"+(p-1).toString();for(let t in i.residues[e])i.atoms[t].ssbegin=!1,i.atoms[t].ssend=!0}T=m,E=c,P=p,f=!1,b=!1,C=!1,"non-polymer"===e.chemCompType.toLowerCase()||"other"===e.chemCompType.toLowerCase()||-1!==e.chemCompType.toLowerCase().indexOf("saccharide")?f=!0:-1!==e.chemCompType.toLowerCase().indexOf("peptide")?b=!0:-1!==e.chemCompType.toLowerCase().indexOf("dna")||-1!==e.chemCompType.toLowerCase().indexOf("rna")?C=!0:b=!0;let l=d+"_"+c,r={};r.resi=p,r.name=n.utilsCls.residueName2Abbr(h),i.residueId2Name[t]=r.name,r.resi%10==0&&r.resi.toString();let o="-";"helix"===m?o="H":"sheet"===m?o="E":"coil"===m?o="c":"other"===m&&(o="o"),void 0===i.chainsSeq[l]&&(i.chainsSeq[l]=[]),i.bFullUi&&i.chainsSeq[l].push(r),i.secondaries[t]=o},onAtom:function(e){if(y=e.element,v=e.atomName,_=new THREE.Vector3(e.xCoord,e.yCoord,e.zCoord),w=e.bFactor,S=e.altLoc,"\0"===e.altLoc&&(S=""),""===S||"A"===S){++M,"SG"===v&&I.push(M),R[e.atomIndex]=M;let t={het:f,serial:M,name:v,alt:S,resn:h,structure:d,chain:c,resi:p,coord:_,b:w,elem:y,bonds:[],bondOrder:[],ss:m,ssbegin:u,ssend:g};if(t.het||"C"!==t.name||(A=M),t.het||"O"!==t.name||(k=M),!t.het&&"N"===t.name&&void 0!==x&&void 0!==O){let e=i.atoms[x].coord.distanceTo(i.atoms[O].coord),s=t.coord.x+(i.atoms[x].coord.x-i.atoms[O].coord.x)/e,n=t.coord.y+(i.atoms[x].coord.y-i.atoms[O].coord.y)/e,l=t.coord.z+(i.atoms[x].coord.z-i.atoms[O].coord.z)/e;t.hcoord=new THREE.Vector3(s,n,l)}i.atoms[M]=t,l.min(_),r.max(_),o.add(_);let a=d+"_"+c,T=a+"_"+p;void 0===i.chains[a]&&(i.chains[a]={}),i.chains[a][M]=1,void 0===i.residues[T]&&(i.residues[T]={}),i.residues[T][M]=1,b?(i.proteins[M]=1,"CA"===v&&(i.calphas[M]=1),"N"!==v&&"H"!==v&&"CA"!==v&&"HA"!==v&&"C"!==v&&"O"!==v&&(i.sidec[M]=1)):C?(i.nucleotides[M]=1,(!s||"O3'"!=v&&"O3*"!=v)&&(s||"P"!=v)||(i.nucleotidesO3[M]=1),-1===n.parasCls.nuclMainArray.indexOf(v)&&(i.ntbase[M]=1)):y.toLowerCase()===h.toLowerCase()?i.ions[M]=1:"HOH"===h||"WAT"===h||"SQL"===h||"H2O"===h||"W"===h||"DOD"===h||"D3O"===h?i.water[M]=1:i.chemicals[M]=1,i.dAtoms[M]=1,i.hAtoms[M]=1}},onBond:function(e){let t=R[e.atomIndex1],s=R[e.atomIndex2];if(R.hasOwnProperty(e.atomIndex1)&&R.hasOwnProperty(e.atomIndex2)&&(i.atoms[t].bonds.push(s),i.atoms[s].bonds.push(t),f)){let n=e.bondOrder;i.atoms[t].bondOrder.push(n),i.atoms[s].bondOrder.push(n),2===n?(i.doublebonds[t+"_"+s]=1,i.doublebonds[s+"_"+t]=1):3===n&&(i.triplebonds[t+"_"+s]=1,i.triplebonds[s+"_"+t]=1)}}};MMTF.traverse(e,D),i.loadPDBCls.setResidMapping();for(let e=0,t=I.length;e5){let e=r.cfg.chainalign.split(",");e.length>0&&(l.hAtoms=l.definedSetsCls.getAtomsFromNameArray(e)),r.cfg.aligntool="tmalign",await l.realignParserCls.realignOnStructAlign()}else l.hAtoms=l.chainalignParserCls.setMsa(e),l.transformCls.zoominSelection(),await l.chainalignParserCls.downloadChainalignmentPart3(void 0,e,l.hAtoms)}async parseChainRealignData(e,t,s,i,n,l,r){let o=this.icn3d,a=o.icn3dui,d=s[0].substr(0,s[0].indexOf("_"));r||(d=d.toUpperCase());let c={};o.realignResid={},o.opts.color="grey",o.setColorCls.setColorByOptions(o.opts,o.dAtoms),o.qt_start_end=[];for(let t=0,h=e.length;t9||s<0)return n*i|0;i=10*i+s|0}return n*i}function u(e,t,s){let i=1,n=0,l=0,r=1;for(45===e.charCodeAt(t)&&(i=-1,++t);t=0&&o<10)){if(-2===o){for(++t;t=0&&o<10))return 53===o||21===o?parseScientific(i*(n+l/r),e,t+1,s):i*(n+l/r);l=10*l+o,r*=10,++t}return i*(n+l/r)}if(53===o||21===o)return parseScientific(i*n,e,t+1,s);break}n=10*n+o,++t}return i*n}let g=function(){function e(e){this.data=e,this.isDefined=!0}return e.prototype.getString=function(e){return""+this.data[e]},e.prototype.getInteger=function(e){return 0|this.data[e]},e.prototype.getFloat=function(e){return 1*this.data[e]},e.prototype.stringEquals=function(e,t){return this.data[e]===u(t,0,t.length)},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return 0},e}(),f=function(){function e(e,t){this.data=e,this.mask=t,this.isDefined=!0}return e.prototype.getString=function(e){return 0===this.mask[e]?""+this.data[e]:null},e.prototype.getInteger=function(e){return 0===this.mask[e]?this.data[e]:0},e.prototype.getFloat=function(e){return 0===this.mask[e]?this.data[e]:0},e.prototype.stringEquals=function(e,t){return 0===this.mask[e]?this.data[e]===u(t,0,t.length):null==t},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return this.mask[e]},e}(),b=function(){function e(e){this.data=e,this.isDefined=!0}return e.prototype.getString=function(e){return this.data[e]},e.prototype.getInteger=function(e){let t=this.data[e];return m(t,0,t.length)},e.prototype.getFloat=function(e){let t=this.data[e];return u(t,0,t.length)},e.prototype.stringEquals=function(e,t){return this.data[e]===t},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return 0},e}(),C=function(){function e(e,t){this.data=e,this.mask=t,this.isDefined=!0}return e.prototype.getString=function(e){return 0===this.mask[e]?this.data[e]:null},e.prototype.getInteger=function(e){if(0!==this.mask[e])return 0;let t=this.data[e];return m(t||"",0,(t||"").length)},e.prototype.getFloat=function(e){if(0!==this.mask[e])return 0;let t=this.data[e];return u(t||"",0,(t||"").length)},e.prototype.stringEquals=function(e,t){return this.data[e]===t},e.prototype.areValuesEqual=function(e,t){return this.data[e]===this.data[t]},e.prototype.getValuePresence=function(e){return this.mask[e]},e}(),y=function(){function e(e){this.dataBlocks=e.dataBlocks.map((function(e){return new i(e)}))}return e.prototype.toJSON=function(){return this.dataBlocks.map((function(e){return e.toJSON()}))},e}();return new y(s)}MessagePackParse(e){this.icn3d.icn3dui;let t=this;function s(e,s){let i={};for(let n=0;n0&&(i[i.length]=l.slice(0,a).join(""));return i.join("")}(e.buffer,e.offset,t);return e.offset+=t,s}let r=function(){let e=[];for(let t=0;t<1024;t++)e[t]=String.fromCharCode(t);return e}();let o,a,d=e.buffer[e.offset];if(0==(128&d))return e.offset++,d;if(128==(240&d))return a=15&d,e.offset++,s(e,a);if(144==(240&d))return a=15&d,e.offset++,n(e,a);if(160==(224&d))return a=31&d,e.offset++,l(e,a);if(224==(224&d))return o=e.dataView.getInt8(e.offset),e.offset++,o;switch(d){case 192:return e.offset++,null;case 194:return e.offset++,!1;case 195:return e.offset++,!0;case 196:return a=e.dataView.getUint8(e.offset+1),e.offset+=2,i(e,a);case 197:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,i(e,a);case 198:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,i(e,a);case 202:return o=e.dataView.getFloat32(e.offset+1),e.offset+=5,o;case 203:return o=e.dataView.getFloat64(e.offset+1),e.offset+=9,o;case 204:return o=e.buffer[e.offset+1],e.offset+=2,o;case 205:return o=e.dataView.getUint16(e.offset+1),e.offset+=3,o;case 206:return o=e.dataView.getUint32(e.offset+1),e.offset+=5,o;case 208:return o=e.dataView.getInt8(e.offset+1),e.offset+=2,o;case 209:return o=e.dataView.getInt16(e.offset+1),e.offset+=3,o;case 210:return o=e.dataView.getInt32(e.offset+1),e.offset+=5,o;case 217:return a=e.dataView.getUint8(e.offset+1),e.offset+=2,l(e,a);case 218:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,l(e,a);case 219:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,l(e,a);case 220:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,n(e,a);case 221:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,n(e,a);case 222:return a=e.dataView.getUint16(e.offset+1),e.offset+=3,s(e,a);case 223:return a=e.dataView.getUint32(e.offset+1),e.offset+=5,s(e,a)}}}class ss{constructor(e){this.icn3d=e}alignCoords(e,t,s,i,n,l,r,o){let a,d=this.icn3d,c=d.icn3dui,h=e.length
Realignment RMSD: "+a.toPrecision(4)+" Å
";d.bAfMem&&!c.cfg.chainalign&&(e+=c.utilsCls.getMemDesc()),$("#"+d.pre+"dl_rmsd_html").html(e),c.cfg.bSidebyside||c.htmlCls.dialogCls.openDlg("dl_rmsd","Realignment RMSD")}let r={};for(let n=0,l=d.structures[s].length;n
"+t.diagram2dCls.set2DdgmNote(),$("#"+t.pre+"dl_2ddgm_html").html(t.html2ddgm)),t.b2DShown=!0}showLoading(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"wait")&&$("#"+e.pre+"wait").show(),$("#"+e.pre+"canvas")&&$("#"+e.pre+"canvas").hide(),$("#"+e.pre+"cmdlog")&&$("#"+e.pre+"cmdlog").hide()}hideLoading(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"wait")&&$("#"+e.pre+"wait").hide(),$("#"+e.pre+"canvas")&&$("#"+e.pre+"canvas").show(),$("#"+e.pre+"cmdlog")&&$("#"+e.pre+"cmdlog").show()}setYourNote(e){let t=this.icn3d,s=t.icn3dui;t.yournote=e,$("#"+t.pre+"yournote").val(t.yournote),s.cfg.shownote&&(document.title=t.yournote)}transformToOpmOri(e){let t=this.icn3d;if(t.icn3dui,void 0!==t.rmsd_supr&&void 0!==t.rmsd_supr.rot){let s=t.rmsd_supr.rot,i=t.rmsd_supr.trans1,n=t.rmsd_supr.trans2;t.rmsd_supr.rmsd;let l=0;for(let e in t.atoms){let r=t.atoms[e];r.coord=t.surfaceCls.transformMemPro(r.coord,s,i,n);let o=r.coord.x*r.coord.x+r.coord.y*r.coord.y;Math.abs(r.coord.z)<=25&&o>l&&(l=o)}this.addMemAtoms(t.halfBilayerSize,e,Math.sqrt(l)),t.bStopRotate=!0,t.bOpm=!0,$("#"+t.pre+"togglememli").show(),$("#"+t.pre+"adjustmemli").show(),$("#"+t.pre+"selectplaneli").show()}else t.bOpm=!1}transformToOpmOriForAlign(e,t,s){let i=this.icn3d,n=i.icn3dui;if(void 0!==t){let l=i.loadPDBCls.getChainCalpha(i.chains,i.atoms,s,e),r=1==Object.keys(l.chainresiCalphaHash).length||1==Object.keys(t.chainresiCalphaHash).length,o=[],a=[];for(let e in l.chainresiCalphaHash)if(t.chainresiCalphaHash.hasOwnProperty(e)){let s=l.chainresiCalphaHash[e],i=t.chainresiCalphaHash[e];if((s.length==i.length||r)&&(o=o.concat(s),a=a.concat(i)),o.length>500)break}let d=o.length=2?$("#"+e.pre+"mn2_alternateWrap").show():$("#"+e.pre+"mn2_alternateWrap").hide(),setTimeout((async function(){if(e.bInitial){if(void 0!==t.cfg.align||void 0!==t.cfg.chainalign){let s=e.pre+"selection";if($("#"+s).show(),$("#"+s+"_expand").hide(),$("#"+s+"_shrink").show(),void 0!==t.cfg.align&&2!=t.cfg.atype){let s=!1,i=t.htmlCls.alignSeqCls.getAlignSequencesAnnotations(Object.keys(e.alnChains),void 0,void 0,s);$("#"+e.pre+"dl_sequence2").html(i.sequencesHtml),$("#"+e.pre+"dl_sequence2").width(t.htmlCls.RESIDUE_WIDTH*i.maxSeqCnt+200)}}if(t.cfg.showanno){let s="view annotations";t.htmlCls.clickMenuCls.setLogCmd(s,!0),await e.showAnnoCls.showAnnotations()}(t.cfg.closepopup||t.cfg.imageonly)&&e.resizeCanvasCls.closeDialogs()}else e.hlUpdateCls.updateHlAll();$("#"+e.pre+"atomsCustom").length>0&&$("#"+e.pre+"atomsCustom")[0].blur(),e.bInitial=!1,t.cfg.imageonly&&e.saveFileCls.saveFile(void 0,"png",void 0,!0)}),0)}processCommand(){let e=this.icn3d,t=e.icn3dui;if(1==Object.keys(e.structures).length){let s=Object.keys(e.structures)[0];t.cfg.command=t.cfg.command.replace(new RegExp("!","g"),s+"_")}}getMassCenter(e,t){return this.icn3d.icn3dui,e.multiplyScalar(1/t)}getGeoCenter(e,t){return this.icn3d.icn3dui,e.clone().add(t).multiplyScalar(.5)}getStructureSize(e,t,s,i){let n=this.icn3d;n.icn3dui;let l=0;for(let r in e){let e=n.atoms[r].coord;if(Math.round(t.x)==Math.round(e.x)||Math.round(t.y)==Math.round(e.y)||Math.round(t.z)==Math.round(e.z)||Math.round(s.x)==Math.round(e.x)||Math.round(s.y)==Math.round(e.y)||Math.round(s.z)==Math.round(e.z)){let t=2*e.distanceTo(i);t>l&&(l=t)}}return l}async checkMemProteinAndRotate(){let e=this.icn3d,t=e.icn3dui;if(!e.bCheckMemProtein){e.bCheckMemProtein=!0;let s=t.cfg.afid?t.cfg.afid:t.cfg.mmdbafid;if(await e.ParserUtilsCls.checkMemProtein(s),t.cfg.url&&-1!=t.cfg.url.indexOf("membranome")){let t=new THREE.Vector3(1,0,0),s=-.5*Math.PI;e.transformCls.setRotation(t,s)}}}async checkMemProtein(e){let t=this.icn3d,s=t.icn3dui;try{let i=s.htmlCls.baseUrl+"vastdyn/vastdyn.cgi?afid2mem="+e,n=await s.getAjaxPromise(i,"jsonp");if(n&&n.pdbid){let e='This is a single-spanning (bitopic) transmembrane protein according to the Membranome database. Do you want to align the protein with the model from Membranome? If you click "OK", you can press the letter "a" to alternate the structures.';if("off"==s.cfg.afmem);else if("on"==s.cfg.afmem||confirm(e))try{let e="https://storage.googleapis.com/membranome-assets/pdb_files/proteins/"+n.pdbid+".pdb",i=await s.getAjaxPromise(e,"text");t.bAfMem=!0,s.bNode||$("#"+s.pre+"togglememli").show();let l=n.pdbid.substr(0,n.pdbid.indexOf("_")),r=!0,o=!0;await t.pdbParserCls.loadPdbData(i,l,r,o),o&&(t.bSetChainsAdvancedMenu&&t.definedSetsCls.showSets(),t.bAnnoShown&&await t.showAnnoCls.showAnnotations());let a=n.segment.replace(/ /gi,"").split("(")[0];t.afmem_start_end=a.split("-"),t.hAtoms={},t.dAtoms={};for(let e in t.atoms)t.atoms[e].structure!=l&&(t.hAtoms[e]=1),t.dAtoms[e]=1;for(let e=parseInt(t.afmem_start_end[0]);e<=parseInt(t.afmem_start_end[1]);++e)t.hAtoms=s.hashUtilsCls.unionHash(t.hAtoms,t.residues[l+"_A_"+e]);await t.realignParserCls.realignOnSeqAlign(l)}catch(e){return void console.log("Error in retrieving matched PDB from Membranome...")}}}catch(e){return void console.log("Error in finding matched PDB in Membranome...")}}getResi(e,t){let s=this.icn3d;s.icn3dui;let i=s.ncbi2resid[e+"_"+(t+1).toString()];return i?i.substr(i.lastIndexOf("_")+1):""}getResiNCBI(e,t){let s=this.icn3d;s.icn3dui;let i=s.resid2ncbi[e+"_"+t];return i?parseInt(i.substr(i.lastIndexOf("_")+1)):0}}class is{constructor(e){this.icn3d=e}loadAtomDataIn(e,t,s,i,n,l,r,o,a){let d=this.icn3d,c=d.icn3dui;d.pmin=new THREE.Vector3(9999,9999,9999),d.pmax=new THREE.Vector3(-9999,-9999,-9999),d.psum=new THREE.Vector3;let h=e.atoms,p=d.atoms?Object.keys(d.atoms).length:0,m={},u={};d.pmid=e.pubmedId,void 0===d.chainid2title&&(d.chainid2title={}),void 0===d.chainid2sid&&(d.chainid2sid={});let g={},f={};if("align"===s){d.pmid="",d.molTitle="",c.cfg.inpara&&-1!==c.cfg.inpara.indexOf("atype=1")?d.molTitle="Invariant Core Structure Alignment (VAST) of ":c.cfg.inpara&&-1!==c.cfg.inpara.indexOf("atype=2")?d.molTitle="Structure Alignment (TM-align) of ":d.molTitle="Structure Alignment (VAST) of ";let t=!1;for(let s=0,i=e.alignedStructures[0].length;s'+i.pdbId.toUpperCase()+"",void 0!==i.descr&&(d.pmid+=i.descr.pubmedid),0===s&&(d.molTitle+=" and ",void 0!==i.descr&&(d.pmid+="_")),t=!0}d.molTitle+=" from VAST+",t||(d.molTitle="")}else if(void 0!==e.descr&&(d.molTitle+=e.descr.name),"mmdbid"===s){let s=isNaN(t)?t:e.pdbId,i={};void 0===d.alignmolid2color&&(d.alignmolid2color=[]);let n=1;for(let t in e.moleculeInfor){if(0===Object.keys(e.moleculeInfor[t]).length)continue;let l=e.moleculeInfor[t].chain.trim();(parseInt(c.cfg.date)>=20231001||!c.cfg.date&&parseInt(c.utilsCls.getDateDigitStr())>=20231001)&&(l=l.replace(/_/g,""));let r=s+"_"+l;i.hasOwnProperty(l)?(++i[l],r+=i[l]):i[l]=1,void 0!==d.mmdbid_q&&(d.mmdbid_q,d.mmdbid_t);let o=e.moleculeInfor[t].kind,a=e.moleculeInfor[t].color,h=e.moleculeInfor[t].sid;if(g[r]=o,f[r]=a,"protein"==o&&(d.organism=e.moleculeInfor[t].taxonomyName.toLowerCase()),void 0!==h&&(d.chainid2sid[r]=h),void 0===d.pdbid_chain2title&&(d.pdbid_chain2title={}),d.pdbid_chain2title[r]=e.moleculeInfor[t].name,l==r.substr(r.lastIndexOf("_"))){let e={};e[t]=n.toString(),d.alignmolid2color.push(e)}++n}}"mmdbid"===s&&(d.molTitleHash||(d.molTitleHash={}),d.molTitleHash[t]=d.molTitle);let b,C,y,v,_,w={},S="",A="",x="",k="",O="",R="",I=0,T=0,E="",P=!0,M=!1,D="",H=c.utilsCls.isCalphaPhosOnly(h),F=0,L={};for(let e in h){++p,w[e]=p;let i,n=h[e];n.serial=p,"mmdbid"===s||"mmcifid"===s?i=t:"align"===s&&(i=m[p]);let l=!1;if(void 0!==n.chain||"mmdbid"!==s&&"align"!==s)n.chain=""===n.chain?"Misc":n.chain;else if("mmdbid"===s)if(b=n.ids.m,void 0!==d.molid2chain[b]){let e=d.molid2chain[b].indexOf("_");n.chain=d.molid2chain[b].substr(e+1)}else{let e="Misc";("protein"===g[O]&&"nucleotide"===g[O]&&n.resi!=T||"protein"!==g[O]&&"nucleotide"!==g[O]&&(n.resn.substr(0,3)!=E.substr(0,3)||n.resi!=T||"solvent"===g[O]||"HOH"===n.resn))&&++F,n.resi_ori=n.resi,n.resi=F,l=!0,n.chain=e}else if("align"===s)if(b=n.ids.m,void 0!==d.pdbid_molid2chain[i+"_"+b])n.chain=d.pdbid_molid2chain[i+"_"+b];else{let e="Misc";("protein"===g[O]&&"nucleotide"===g[O]&&n.resi!=T||"protein"!==g[O]&&"nucleotide"!==g[O]&&(n.resn.substr(0,3)!=E.substr(0,3)||n.resi!=T||"solvent"===g[O]||"HOH"===n.resn))&&(++F,n.resi_ori=n.resi,n.resi=F,l=!0),n.chain=e}if(n.chain=n.chain.trim(),(parseInt(c.cfg.date)>=20231001||!c.cfg.date&&parseInt(c.utilsCls.getDateDigitStr())>=20231001)&&(n.chain=n.chain.replace(/_/g,"")),"mmdbid"!==s&&"align"!==s||(n.structure=i,"mmdbid"===s&&void 0!==d.mmdbid_q&&(d.mmdbid_q,d.mmdbid_t)),k=n.structure,O=k+"_"+n.chain,"mmdbid"===s||"align"===s){l||(n.resi_ori=n.resi,d.bUsePdbNum?n.resi=n.resi_ori:n.resi=n.ids.r);let e=n.resn.indexOf(" ");-1!==e&&0!=e&&(n.resn=n.resn.substr(0,e))}O!==A&&(I=0),n.resi!==I&&(O!==A?(y=void 0,_=void 0):(y=C,_=v)),n.coord="mmdbid"===s?new THREE.Vector3(n.coord[0],n.coord[1],n.coord[2]):new THREE.Vector3(n.coord.x,n.coord.y,n.coord.z);let r=c.utilsCls.residueName2Abbr(n.resn.substr(0,3));"mmdbid"!==s&&"align"!==s||!d.bFullUi||(void 0===d.mmdbMolidResid2mmdbChainResi&&(d.mmdbMolidResid2mmdbChainResi={}),d.mmdbMolidResid2mmdbChainResi[i+"_"+n.ids.m+"_"+n.ids.r]=i+"_"+n.chain+"_"+n.resi),d.pmin.min(n.coord),d.pmax.max(n.coord),d.psum.add(n.coord);let o=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"protein"===g[O]:"p"===n.mt,a=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"nucleotide"===g[O]:"n"===n.mt,u=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"solvent"===g[O]:"s"===n.mt,N=void 0===c.cfg.mmcifid&&"mmcif"!=d.InputfileType?"ligand"===g[O]||void 0!==g[O]&&-1!==g[O].indexOf("other")||void 0===g[O]:"l"===n.mt;if("Misc"!==n.chain&&"other"!==g[O]||"protein"===L[O]||"nucleotide"===L[O]||("CA"===n.name&&"C"===n.elem?L[O]="protein":"P"===n.name&&"P"===n.elem?L[O]="nucleotide":L[O]="chemical"),o||a?(o?(d.proteins[p]=1,"CA"===n.name&&(d.calphas[p]=1),"N"!==n.name&&"H"!==n.name&&"CA"!==n.name&&"HA"!==n.name&&"C"!==n.name&&"O"!==n.name&&(d.sidec[p]=1)):a&&(d.nucleotides[p]=1,("O3'"==n.name||"O3*"==n.name||H&&"P"==n.name)&&(d.nucleotidesO3[p]=1),-1===c.parasCls.nuclMainArray.indexOf(n.name)&&(d.ntbase[p]=1)),n.het=!1):u?(d.water[p]=1,n.het=!0):N&&("HOH"===n.resn||"O"===n.resn?d.water[p]=1:n.elem===n.resn?d.ions[p]=1:d.chemicals[p]=1,n.het=!0),"mmdbid"===s?n.het?n.color=c.parasCls.atomColors[n.elem]||c.parasCls.defaultAtomColor:n.color=void 0!==f[O]?c.parasCls.thr(f[O]):c.parasCls.chargeColors[n.resn]:void 0!==n.color&&(n.color=c.parasCls.thr(n.color))," "!==n.resn.charAt(0)&&" "===n.resn.charAt(1)&&(n.resn=n.resn.charAt(0)),n.het||"C"!==n.name||(C=p),n.het||"O"!==n.name||(v=p),!n.het&&"N"===n.name&&void 0!==y&&void 0!==_){let e=d.atoms[y].coord.distanceTo(d.atoms[_].coord),t=n.coord.x+(d.atoms[y].coord.x-d.atoms[_].coord.x)/e,s=n.coord.y+(d.atoms[y].coord.y-d.atoms[_].coord.y)/e,i=n.coord.z+(d.atoms[y].coord.z-d.atoms[_].coord.z)/e;n.hcoord=new THREE.Vector3(t,s,i)}"HOH"==n.resn&&(d.water[p]=1),d.atoms[p]=n,d.dAtoms[p]=1,d.hAtoms[p]=1;let q=n.structure+"_"+n.chain;void 0===d.chains[q]&&(d.chains[q]={}),d.chains[q][p]=1;let U=q+"_"+n.resi;void 0===d.residues[U]&&(d.residues[U]={}),d.residues[U][p]=1,R=O+"_"+n.resi,R!==x&&O!==A&&(P=!0,""!==S&&(void 0===d.structures[S]&&(d.structures[S]=[]),d.structures[S].push(A))),d.residueId2Name[U]=r;let $="-";if("helix"===n.ss?$="H":"sheet"===n.ss?$="E":n.het||a?$="o":(!n.het&&c.parasCls.residueColors.hasOwnProperty(n.resn.toUpperCase())||"coil"===n.ss)&&($="c"),d.secondaries[n.structure+"_"+n.chain+"_"+n.resi]=$,(n.resi!=I||b!=D)&&d.bFullUi&&(void 0===d.chainsSeq[q]&&(d.chainsSeq[q]=[],P=!1),!isNaN(n.resi)))if(P&&!M&&void 0!==d.chainsSeq[q][n.resi-1])d.chainsSeq[q][n.resi-1].name=r;else if(!P||!d.chainsSeq[q].hasOwnProperty(n.resi-1)){let e={};e.resi=n.resi,e.name=r,n.resi%10==0&&n.resi.toString(),d.chainsSeq[q].push(e),M=!0}I=n.resi,T=n.resi_ori,E=n.resn,S=k,A=O,x=R,D=b}for(let e in d.chemicals){let t=d.atoms[e];if("P"==t.elem&&t.bonds.length>=4)for(let e=t.bonds.length-1;e>=0;--e){"P"==d.atoms[t.bonds[e]].elem&&t.bonds.splice(e,1)}}for(let e in L)if(!(Object.keys(d.chains[e]).length<10)&&"chemical"!==L[e])for(let t in d.chains[e]){let s=d.atoms[t];delete d.chemicals[t],s.het=!1,"protein"===L[e]?(d.proteins[t]=1,"CA"===s.name&&(d.calphas[t]=1),"N"!==s.name&&"H"!==s.name&&"CA"!==s.name&&"HA"!==s.name&&"C"!==s.name&&"O"!==s.name&&(d.sidec[t]=1)):"nucleotide"===L[e]&&(d.nucleotides[t]=1,("O3'"==s.name||"O3*"==s.name||H&&"P"==s.name)&&(d.nucleotidesO3[t]=1),-1===c.parasCls.nuclMainArray.indexOf(s.name)&&(d.ntbase[t]=1))}if(void 0===d.structures[k]&&(d.structures[k]=[]),d.structures[k].push(O),d.bFullUi)if("mmdbid"===s||"mmcifid"===s)for(let i in e.sequences){let n=e.sequences[i],l=t+"_"+i;void 0!==d.mmdbid_q&&(d.mmdbid_q,d.mmdbid_t),d.ParserUtilsCls.getMissingResidues(n,s,l)}else if("align"===s)for(let e in d.chainid2seq){let t=d.chainid2seq[e];d.ParserUtilsCls.getMissingResidues(t,s,e)}if(d.loadPDBCls.setResidMapping(),"mmcifid"!==s)for(let e in h){let t=w[e],s=void 0===d.atoms[t].bonds?0:d.atoms[t].bonds.length;for(let e=0;ed.maxatomcnt||void 0!==d.biomtMatrices&&d.biomtMatrices.length*d.cnt>10*d.maxatomcnt)&&(d.opts.proteins="c alpha trace",d.opts.nucleotides="o3 trace"),d.center=d.ParserUtilsCls.getGeoCenter(d.pmin,d.pmax),d.maxD=d.ParserUtilsCls.getStructureSize(d.atoms,d.pmin,d.pmax,d.center),d.maxD<5&&(d.maxD=5),d.oriMaxD=d.maxD,("align"===s||o)&&(d.ssbondpnts={},d.loadPDBCls.setSsbond()),"mmdbid"===s&&1==Object.keys(d.structures).length){let t=e.disulfides;if(void 0!==t)for(let e=0,s=t.length;ep&&(p=e)),c[e]={resi:t,resn:i,aligned:n}}r=e[t][1];let u=r.moleculeId,g=s.pdbid_molid2chain[l+"_"+u],f=l+"_"+g;void 0===s.alnChainsAnTtl[d]&&(s.alnChainsAnTtl[d]=[]),void 0===s.alnChainsAnTtl[d][0]&&(s.alnChainsAnTtl[d][0]=[]),void 0===s.alnChainsAnTtl[d][1]&&(s.alnChainsAnTtl[d][1]=[]),void 0===s.alnChainsAnTtl[d][2]&&(s.alnChainsAnTtl[d][2]=[]),void 0===s.alnChainsAnTtl[d][3]&&(s.alnChainsAnTtl[d][3]=[]),void 0===s.alnChainsAnTtl[d][4]&&(s.alnChainsAnTtl[d][4]=[]),void 0===s.alnChainsAnTtl[d][5]&&(s.alnChainsAnTtl[d][5]=[]),void 0===s.alnChainsAnTtl[d][6]&&(s.alnChainsAnTtl[d][6]=[]),s.alnChainsAnTtl[d][0].push(f),s.alnChainsAnTtl[d][1].push(d),s.alnChainsAnTtl[d][2].push(""),s.alnChainsAnTtl[d][3].push(""),s.alnChainsAnTtl[d][4].push(f),s.alnChainsAnTtl[d][5].push(d),s.alnChainsAnTtl[d][6].push("");let b=1;s.chainsMapping[d]||(s.chainsMapping[d]={}),s.chainsMapping[f]||(s.chainsMapping[f]={});for(let e=h;e<=p;++e){let t,o,p,m=s.bUsePdbNum?s.ParserUtilsCls.getResi(f,r.sequence[e][0]-1):r.sequence[e][0],u="~"===r.sequence[e][2]?"-":r.sequence[e][2],C=r.sequence[e][3]?1:0,y=c[e].aligned+C;2===y?(c[e].resn===u?(t="#FF0000",p="icn3d-cons",s.consHash1[d+"_"+c[e].resi]=1,s.consHash2[f+"_"+m]=1):(t="#0000FF",p="icn3d-ncons",s.nconsHash1[d+"_"+c[e].resi]=1,s.nconsHash2[f+"_"+m]=1),s.chainsMapping[d][d+"_"+c[e].resi]=c[e].resn+c[e].resi,s.chainsMapping[f][f+"_"+m]=c[e].resn+c[e].resi,o="#"+s.showAnnoCls.getColorhexFromBlosum62(c[e].resn,u)):(t=i.htmlCls.GREY8,p="icn3d-nalign",s.nalignHash1[d+"_"+c[e].resi]=1,s.nalignHash2[f+"_"+m]=1),void 0===s.alnChainsSeq[d]&&(s.alnChainsSeq[d]=[]);let v={};v.mmdbid=n,v.chain=a,v.resi=c[e].resi,v.resn=""===v.resi||"icn3d-nalign"===p?c[e].resn.toLowerCase():c[e].resn,v.aligned=y,v.color=""===v.resi?i.htmlCls.GREYC:t,v.color2=""===v.resi?i.htmlCls.GREYC:o,v.class=p,s.alnChainsSeq[d].push(v),""!==c[e].resi&&(void 0===s.alnChains[d]&&(s.alnChains[d]={}),$.extend(s.alnChains[d],s.residues[d+"_"+c[e].resi])),void 0===s.alnChainsSeq[f]&&(s.alnChainsSeq[f]=[]),v={},v.mmdbid=l,v.chain=g,v.resi=m,v.resn=""===v.resi||"icn3d-nalign"===p?u.toLowerCase():u,v.aligned=y,v.color=""===v.resi?i.htmlCls.GREYC:t,v.color2=""===v.resi?i.htmlCls.GREYC:o,v.class=p,s.alnChainsSeq[f].push(v),""!==v.resi&&(void 0===s.alnChains[f]&&(s.alnChains[f]={}),$.extend(s.alnChains[f],s.residues[f+"_"+m])),void 0===s.alnChainsAnno[d]&&(s.alnChainsAnno[d]=[]),void 0===s.alnChainsAnno[d][0]&&(s.alnChainsAnno[d][0]=[]),void 0===s.alnChainsAnno[d][1]&&(s.alnChainsAnno[d][1]=[]),void 0===s.alnChainsAnno[d][2]&&(s.alnChainsAnno[d][2]=[]),void 0===s.alnChainsAnno[d][3]&&(s.alnChainsAnno[d][3]=[]),e===h&&(void 0===s.alnChainsAnno[d][4]&&(s.alnChainsAnno[d][4]=[]),void 0===s.alnChainsAnno[d][5]&&(s.alnChainsAnno[d][5]=[]),void 0===s.alnChainsAnno[d][6]&&(s.alnChainsAnno[d][6]=[]),s.alnChainsAnno[d][4].push(s.pdbid_chain2title[f]),s.alnChainsAnno[d][5].push(s.pdbid_chain2title[d]),s.alnChainsAnno[d][6].push(""));let _=d+"_"+c[e].resi,w=f+"_"+m,S=s.secondaries[_],A=s.secondaries[w];A?s.alnChainsAnno[d][0].push(A):s.alnChainsAnno[d][0].push("-"),S?s.alnChainsAnno[d][1].push(S):s.alnChainsAnno[d][1].push("-");let x=".";b%5==0&&(x="*"),b%10==0&&(x="|"),s.alnChainsAnno[d][2].push(x);let k="";b%10==0&&(k=b.toString()),s.alnChainsAnno[d][3].push(k),++b}}e={}}getPosFromResi(e,t){let s=this.icn3d;s.icn3dui;let i,n=s.resid2ncbi[e+"_"+t];if(n){i=n.substr(n.lastIndexOf("_")+1)-1}return i}getResnFromResi(e,t){let s=this.icn3d;s.icn3dui;let i=e+"_"+t,n=s.residueId2Name[i];return n||(n="?"),n}getResiAferAlign(e,t,s){let i,n=this.icn3d,l=n.icn3dui;if(t&&"tmalign"==l.cfg.aligntool)i=s;else if(n.posid2resid){let t=n.posid2resid[e+"_"+s];i=t.substr(t.lastIndexOf("_")+1)}else i=n.chainsSeq[e][s].resi;return i}setSeqAlignChain(e,t,s){let i,n,l,r,o,a,d,c,h,p,m,u=this.icn3d,g=u.icn3dui,f={},b=!!s;if(b){if(o=s[1],a=s[0],t=s[2],d=o.indexOf("_"),c=a.indexOf("_"),i=o.substr(0,d).toUpperCase(),n=a.substr(0,c).toUpperCase(),l=o.substr(d+1),r=a.substr(d+1),i==n&&l==r){let e=u.chainsSeq[n+"_"+r].length;u.qt_start_end[t]={q_start:1,q_end:e,t_start:1,t_end:e}}}else{let d=s[0].indexOf("_"),c=e.indexOf("_");if(i=u.mmdbid_t,n=e.substr(0,c).toUpperCase(),l=s[0].substr(d+1),r=e.substr(c+1),i==n&&l==r){let e=u.chainsSeq[u.mmdbid_q+"_"+u.chain_q].length;u.qt_start_end[t]={q_start:1,q_end:e,t_start:1,t_end:e}}o=i+"_"+l,a=n+"_"+r,void 0!==n&&u.mmdbid_t}u.conservedName1=o+"_cons",u.nonConservedName1=o+"_ncons",u.notAlignedName1=o+"_nalign",u.conservedName2=a+"_cons",u.nonConservedName2=a+"_ncons",u.notAlignedName2=a+"_nalign",u.consHash1={},u.nconsHash1={},u.nalignHash1={},u.consHash2={},u.nconsHash2={},u.nalignHash2={},u.alnChains={},u.alnChainsSeq[o]=[],u.alnChains[o]={},u.alnChainsSeq[a]=[],u.alnChains[a]={},u.alnChainsAnno[o]=[],u.alnChainsAnTtl[o]=[],void 0===u.alnChainsAnTtl[o]&&(u.alnChainsAnTtl[o]=[]);for(let e=0;e<7;++e)void 0===u.alnChainsAnTtl[o][e]&&(u.alnChainsAnTtl[o][e]=[]);u.alnChainsAnTtl[o][0].push(a),u.alnChainsAnTtl[o][1].push(o),u.alnChainsAnTtl[o][2].push(""),u.alnChainsAnTtl[o][3].push(""),u.alnChainsAnTtl[o][4].push(a),u.alnChainsAnTtl[o][5].push(o),u.alnChainsAnTtl[o][6].push("");let C=0,y=0;if(void 0===u.qt_start_end[t])return;let v=1;u.chainsMapping[o]||(u.chainsMapping[o]={}),u.chainsMapping[a]||(u.chainsMapping[a]={});let _={},w={};for(let e=0,s=u.qt_start_end[t].length;e0){let e=v;for(let t=C+1,i=s;tc&&(c=t)}}}"tmalign"==n.cfg.aligntool&&(s=!0);let p=Object.keys(a);p.sort((function(e,t){return parseInt(e)-parseInt(t)}));let m=-999,u=0,g=0,f=[],b=0;for(let e=0,t=p.length;en)for(let e=0,t=d-a;e0?void 0!==n?p.alnChainsAnno[t][0].push(n):p.alnChainsAnno[t][0].push("-"):console.log("Error: ic.alnChainsAnno[chainid1] is undefined")}}}class ls{constructor(e){this.icn3d=e}getStructureId(e,t,s){let i=this.icn3d;i.icn3dui;let n=e;return(e==i.defaultPdbId||s||i.structures.hasOwnProperty(e))&&(n=1===t?e:e+t.toString()),n}loadPDB(e,t,s,i,n,l,r,o){let a,d,c=this.icn3d,h=c.icn3dui,p={},m=!1,u=e.split("\n"),g={},f={};c.atoms||(l=!1),n||l?(c.oriNStru=c.structures?Object.keys(c.structures).length:0,d=c.oriNStru+1,a=c.atoms?Object.keys(c.atoms).length:0):(c.init(),d=1,a=0);let b,C,y,v,_,w,S,A=[],x=[],k=[],O=[],R=[],I=[],T="",E="",P="",M={},D=t||c.defaultPdbId,H=D,F="",L=!1,N=!0;for(let e in u){let r=u[e],q=r.substr(0,6);if("HEADER"!==q||L||t)if("TITLE "===q){let e=r.substr(10).replace(/ALPHAFOLD MONOMER V2.0 PREDICTION FOR /gi,"");c.molTitle+=e.trim()+" ",o&&c.esmTitle&&(c.molTitle=c.esmTitle),c.molTitleHash||(c.molTitleHash={}),c.molTitleHash[H]=c.molTitle}else if("HELIX "===q){c.bSecondaryStructure=!0;let e=""==r.substr(18,2).trim()?"A":r.substr(18,2).trim(),t=parseInt(r.substr(21,4)),s=parseInt(r.substr(33,4));for(let i=t;i<=s;++i){let n=H+"_"+e+"_"+i;O.push(n),i===t&&R.push(n),i===s&&I.push(n)}}else if("SHEET "===q){void 0!==s&&s||(c.bSecondaryStructure=!0);let e=""==r.substr(20,2).trim()?"A":r.substr(20,2).trim(),t=parseInt(r.substr(22,4)),i=parseInt(r.substr(33,4));for(let s=t;s<=i;++s){let n=H+"_"+e+"_"+s;A.push(n),s===t&&x.push(n),s===i&&k.push(n)}}else if("HBOND "===q)void 0!==s&&s||(c.bSecondaryStructure=!0);else if("SSBOND"===q){c.bSsbondProvided=!0;let e=D+"_"+(" "==r.substr(15,1)?"A":r.substr(15,1))+"_"+r.substr(17,4).trim(),t=D+"_"+(" "==r.substr(29,1)?"A":r.substr(29,1))+"_"+r.substr(31,4).trim();void 0===c.ssbondpnts[D]&&(c.ssbondpnts[D]=[]),c.ssbondpnts[D].push(e),c.ssbondpnts[D].push(t)}else if("REMARK"===q){let e=parseInt(r.substr(7,3));if(-1!==r.indexOf("1/2 of bilayer thickness:"))c.halfBilayerSize=parseFloat(r.substr(r.indexOf(":")+1).trim());else if(210==e)"EXPERIMENT TYPE"==r.substr(11,32).trim()&&"NMR"==r.substr(45).trim()&&(m=!0);else if(350==e&&"BIOMT"==r.substr(13,5)){let e=parseInt(r[18])-1,t=parseInt(r.substr(21,2))-1;null==c.biomtMatrices[t]&&(c.biomtMatrices[t]=(new THREE.Matrix4).identity()),c.biomtMatrices[t].elements[e]=parseFloat(r.substr(24,9)),c.biomtMatrices[t].elements[e+4]=parseFloat(r.substr(34,9)),c.biomtMatrices[t].elements[e+8]=parseFloat(r.substr(44,9)),c.biomtMatrices[t].elements[e+12]=parseFloat(r.substr(54,14))}else if(465==e&&" "==r.substr(18,1)&&" "==r.substr(20,1)&&"S"!=r.substr(21,1)){let e=r.substr(15,3),t=r.substr(18,2).trim(),s=r.substr(21,5).trim(),i=D+"_"+t;void 0===c.chainMissingResidueArray[i]&&(c.chainMissingResidueArray[i]=[]);let n={};n.resi=s,n.name=h.utilsCls.residueName2Abbr(e).toLowerCase(),""!=F&&t==F&&t!=F||(c.chainMissingResidueArray[i].push(n),F=t)}else 900==e&&void 0===c.emd&&"RELATED DB: EMDB"==r.substr(34).trim()&&(c.emd=r.substr(23,11).trim())}else if("SOURCE"===q&&void 0===c.organism&&"ORGANISM_COMMON"==r.substr(11,15).trim())c.organism=r.substr(28).toLowerCase().trim(),c.organism=c.organism.substr(0,c.organism.length-1);else if("ENDMDL"===q)++d,D=c.defaultPdbId,H=this.getStructureId(D,d,n),m||(A=[],x=[],k=[],O=[],R=[],I=[]),L=!1;else if("JRNL "===q)"PMID"===r.substr(12,4)&&(c.pmid=r.substr(19).trim());else if("ATOM "===q||"HETATM"===q){N&&(H=this.getStructureId(D,d,n),N=!1);let e=r.substr(16,1);++a,M[parseInt(r.substr(6,5))]=a;let t=r.substr(76,2).trim();""===t&&(t=r.substr(12,2).trim());let l=r.substr(12,4).trim(),u=r.substr(17,3),F=r.substr(20,2).trim();""===F&&(F="A");let L=r.substr(22,5).trim(),U=L;if(s&&"DUM"===u&&(t=l,F="MEM",U=1,L=1),i&&"DUM"===u)break;b=H+"_"+F,y=b+"_"+L,C=b+"_"+U;let $=parseFloat(r.substr(30,8)),j=parseFloat(r.substr(38,8)),B=parseFloat(r.substr(46,8)),z=new THREE.Vector3($,j,B),G=parseFloat(r.substr(60,8));o&&(G*=100);let V={het:"H"===q[0],serial:a,name:l,alt:e,resn:u,structure:H,chain:F,resi:U,coord:z,b:G,elem:t,bonds:[],ss:"coil",ssbegin:!1,ssend:!1};if(V.het||"C"!==V.name||(v=a),V.het||"O"!==V.name||(w=a),!V.het&&"N"===V.name&&void 0!==_&&void 0!==S){let e=c.atoms[_].coord.distanceTo(c.atoms[S].coord),t=V.coord.x+(c.atoms[_].coord.x-c.atoms[S].coord.x)/e,s=V.coord.y+(c.atoms[_].coord.y-c.atoms[S].coord.y)/e,i=V.coord.z+(c.atoms[_].coord.z-c.atoms[S].coord.z)/e;V.hcoord=new THREE.Vector3(t,s,i)}c.atoms[a]=V,c.dAtoms[a]=1,c.hAtoms[a]=1,p[a]=1,this.isSecondary(C,A,m)?(c.atoms[a].ss="sheet",this.isSecondary(C,x,m)&&(c.atoms[a].ssbegin=!0),this.isSecondary(C,k,m)&&(c.atoms[a].ssend=!0)):this.isSecondary(C,O,m)&&(c.atoms[a].ss="helix",this.isSecondary(C,R,m)&&(c.atoms[a].ssbegin=!0),this.isSecondary(C,I,m)&&(c.atoms[a].ssend=!0));let W="-";if(W="helix"===c.atoms[a].ss?"H":"sheet"===c.atoms[a].ss?"E":!c.atoms[a].het&&h.parasCls.residueColors.hasOwnProperty(c.atoms[a].resn.toUpperCase())?"c":"o",c.secondaries[C]=W,y!==P){let e=h.utilsCls.residueName2Abbr(u);if(c.residueId2Name[C]=e,1!==a&&""!==E&&(c.residues[E]=f),C!==E&&(f={}),b!==T){_=void 0,S=void 0,1!==a&&""!==T&&(void 0===c.chains[T]&&(c.chains[T]={}),c.chains[T]=h.hashUtilsCls.unionHash(c.chains[T],g)),g={},void 0===c.structures[H.toString()]&&(c.structures[H.toString()]=[]),c.structures[H.toString()].includes(b)||c.structures[H.toString()].push(b),void 0===c.chainsSeq[b]&&(c.chainsSeq[b]=[]);let t={};t.resi=U,t.name=e,c.chainsSeq[b].push(t)}else{_=v,S=w;let t={};t.resi=U,t.name=e,c.chainsSeq[b].push(t)}}g[a]=1,f[a]=1,T=b,E=C,P=y}else if("CONECT"===q){let e=parseInt(r.substr(6,5));for(let t=0;t<4;++t){let s=parseInt(r.substr([11,16,21,26][t],5));isNaN(s)||void 0!==c.atoms[M[e]]&&c.atoms[M[e]].bonds.push(M[s])}}else q.substr(0,3);else D=r.substr(62).trim(),""==D&&(D=l?c.defaultPdbId:c.inputid&&-1==c.inputid.indexOf("/")?c.inputid.substr(0,10):c.defaultPdbId),H=this.getStructureId(D,d,n),c.molTitle="",c.molTitleHash={},L=!0}c.residues[C]=f,void 0===c.chains[b]&&(c.chains[b]={}),c.chains[b]=h.hashUtilsCls.unionHash2Atoms(c.chains[b],g,c.atoms),this.adjustSeq(c.chainMissingResidueArray);let q=Object.keys(c.structures);for(let e=0,t=q.length;er&&i>r&&(h=!0),s<=r&&i>r?s>i||h?(o[c]=t[d],d++):(o[c]=e[a],a++):s>r&&i<=r?s<=i||h?(o[c]=e[a],a++):(o[c]=t[d],d++):s<=i?(o[c]=e[a],a++):(o[c]=t[d],d++),c++}if(a4||Math.abs(l.y-r.y)>4||Math.abs(l.z-r.z)>4||(l.x-r.x)*(l.x-r.x)+(l.y-r.y)*(l.y-r.y)+(l.z-r.z)*(l.z-r.z)<16&&(void 0===t.ssbondpnts[e]&&(t.ssbondpnts[e]=[]),t.ssbondpnts[e].push(o),t.ssbondpnts[e].push(a)))}}}getChainCalpha(e,t,s,i){let n=this.icn3d,l=n.icn3dui,r={};for(let o in e){if(void 0!==i){if(o.split("_")[0]!==i)continue}let a=Object.keys(e[o]),d=[],c=0,h=0;for(let e=0,i=a.length;e3?i.resn.trim().substr(0,3):i.resn.trim();if(!l.parasCls.chargeColors.hasOwnProperty(e))continue;s?i.resi_ori:i.resi,d.push(i.coord.clone()),++c,h=i.resi}}if(c>0){r[t[a[0]].chain]=d}}return{chainresiCalphaHash:r,center:n.center.clone()}}isSecondary(e,t,s){if(this.icn3d.icn3dui,s){let s=e.substr(e.indexOf("_")+1),i=!1;for(let e=0,n=t.length;ep[e]
"),l.cfg.bSidebyside||l.htmlCls.dialogCls.openDlg("dl_rmsd","Realignment RMSD"),n.q_rotation=[],n.q_trans_sub=[],n.t_trans_add=[],n.q_rotation.push({x1:e[0],y1:e[1],z1:e[2],x2:e[3],y2:e[4],z2:e[5],x3:e[6],y3:e[7],z3:e[8]}),n.q_trans_sub.push(i),n.t_trans_add.push({x:-r.x,y:-r.y,z:-r.z}),l.cfg.aligntool="vast";//!= 'tmalign';
+let c=0,h="query",p=o.substr(0,o.indexOf("_")),m=!0;n.chainalignParserCls.transformStructure(p,c,h,m);let u="";for(let e=0,i=s.length;e8)return s;let g=[];g[0]=n[0]*r[0]+n[1]*r[1]+n[2]*r[2],g[1]=n[3]*r[0]+n[4]*r[1]+n[5]*r[2],g[2]=n[6]*r[0]+n[7]*r[1]+n[8]*r[2],g[0]-=n[0]*a[0]+n[1]*a[1]+n[2]*a[2],g[1]-=n[3]*a[0]+n[4]*a[1]+n[5]*a[2],g[2]-=n[6]*a[0]+n[7]*a[1]+n[8]*a[2];let f=0;return f=c[0]*g[0],f+=c[1]*g[1],f+=c[2]*g[2],f/=p*m,f<.866?s:(g[0]=l[0]*r[0]+l[1]*r[1]+l[2]*r[2],g[1]=l[3]*r[0]+l[4]*r[1]+l[5]*r[2],g[2]=l[6]*r[0]+l[7]*r[1]+l[8]*r[2],g[0]-=l[0]*a[0]+l[1]*a[1]+l[2]*a[2],g[1]-=l[3]*a[0]+l[4]*a[1]+l[5]*a[2],g[2]-=l[6]*a[0]+l[7]*a[1]+l[8]*a[2],f=c[0]*g[0],f+=c[1]*g[1],f+=c[2]*g[2],f/=p*m,f<.866?s:(u=0,u+=Math.pow(e.q_rotation.x1-t.q_rotation.x1,2),u+=Math.pow(e.q_rotation.y1-t.q_rotation.y1,2),u+=Math.pow(e.q_rotation.z1-t.q_rotation.z1,2),u+=Math.pow(e.q_rotation.x2-t.q_rotation.x2,2),u+=Math.pow(e.q_rotation.y2-t.q_rotation.y2,2),u+=Math.pow(e.q_rotation.z2-t.q_rotation.z2,2),u+=Math.pow(e.q_rotation.x3-t.q_rotation.x3,2),u+=Math.pow(e.q_rotation.y3-t.q_rotation.y3,2),u+=Math.pow(e.q_rotation.z3-t.q_rotation.z3,2),Math.sqrt(u)))}GetRotMatrix(e,t,s){this.icn3d.icn3dui;let i=[];return i&&(i[0]=e.q_rotation.x1/t,i[1]=e.q_rotation.y1/t,i[2]=e.q_rotation.z1/t,i[3]=e.q_rotation.x2/t,i[4]=e.q_rotation.y2/t,i[5]=e.q_rotation.z2/t,i[6]=e.q_rotation.x3/t,i[7]=e.q_rotation.y3/t,i[8]=e.q_rotation.z3/t,2!=s?(i[9]=e.t_trans_add.x/t,i[10]=e.t_trans_add.y/t,i[11]=e.t_trans_add.z/t,i[12]=-e.q_trans_sub.x/t,i[13]=-e.q_trans_sub.y/t,i[14]=-e.q_trans_sub.z/t):(i[9]=-e.q_trans_add.x/t,i[10]=-e.q_trans_add.y/t,i[11]=-e.q_trans_add.z/t,i[12]=0,i[13]=0,i[14]=0)),i}cbu_dist(e,t,s){return e=5&&(e=l[4].substr(5)),l.length>=6&&(s=l[5].substr(6)),l.length>=7&&(n=l[6].substr(4)),$("#"+t.pre+"anno_custom")[0]&&($("#"+t.pre+"anno_custom")[0].checked=!0),$("[id^="+t.pre+"custom]").show(),"0"==s&&(s=void 0),t.addTrackCls.checkGiSeq(r,o,a,e,s,n,0)}else if(0==n.indexOf("remove one stabilizer")){let e=n.split(" | ")[1].split(" "),s=[];s.push(parseInt(e[0])),s.push(parseInt(e[1])),t.threeDPrintCls.removeOneStabilizer(s),t.drawCls.draw()}else if(0==n.indexOf("add one stabilizer")){let e=n.split(" | ")[1].split(" ");void 0===t.pairArray&&(t.pairArray=[]),t.pairArray.push(parseInt(e[0])),t.pairArray.push(parseInt(e[1])),t.drawCls.draw()}else if(0==n.indexOf("select planes z-axis")){let e=n.split(" ");if(5==e.length){let s=parseFloat(e[3]),i=parseFloat(e[4]);t.selectionCls.selectBtwPlanes(s,i)}}else if(0==n.indexOf("adjust membrane z-axis")){let e=n.split(" ");if(5==e.length){let s=parseFloat(e[3]),i=parseFloat(e[4]);t.selectionCls.adjustMembrane(s,i)}}else if(0==n.indexOf("toggle membrane"))t.selectionCls.toggleMembrane();else if(0==i.indexOf("calc buried surface")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(" ");if(2==s.length){let e=s[0].split(","),i=s[1].split(",");t.analysisCls.calcBuriedSurface(e,i)}}}else if(0==i.indexOf("dist ")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(" ");if(2==s.length){let e=s[0].split(","),i=s[1].split(",");t.analysisCls.measureDistTwoSets(e,i)}}}else if(0==i.indexOf("disttable")){let e=i.split(" | ");if(2==e.length){let i=e[1].split(" ");if(2==i.length){let e=i[0].split(","),n=i[1].split(",");t.analysisCls.measureDistManySets(e,n),s.htmlCls.dialogCls.openDlg("dl_disttable","Distance among the sets")}}}else if(0==i.indexOf("display interaction 3d")||0==i.indexOf("view interaction pairs")||0==i.indexOf("save1 interaction pairs")||0==i.indexOf("save2 interaction pairs")||0==i.indexOf("line graph interaction pairs")||0==i.indexOf("scatterplot interaction pairs")){let e=i.split(" | ");if(e.length>=3){let s=e[1].split(" ");if(2==s.length){let n,l,r=s[0].split(","),o=s[1].split(","),a=-1!==e[2].indexOf("hbonds"),d=-1!==e[2].indexOf("salt bridge"),c=-1!==e[2].indexOf("interactions"),h=-1!==e[2].indexOf("halogen"),p=-1!==e[2].indexOf("pi-cation"),m=-1!==e[2].indexOf("pi-stacking");if(e.length>=4&&(n="true"==e[3]),e.length>=5){let s=e[4].split(" ");s.length>=4&&($("#"+t.pre+"hbondthreshold").val(s[1]),$("#"+t.pre+"saltbridgethreshold").val(s[2]),$("#"+t.pre+"contactthreshold").val(s[3]),7==s.length&&($("#"+t.pre+"halogenthreshold").val(s[4]),$("#"+t.pre+"picationthreshold").val(s[5]),$("#"+t.pre+"pistackingthreshold").val(s[6])))}0==i.indexOf("display interaction 3d")?l="3d":0==i.indexOf("view interaction pairs")?l="view":0==i.indexOf("save1 interaction pairs")?l="save1":0==i.indexOf("save2 interaction pairs")?l="save2":0==i.indexOf("line graph interaction pairs")?l="linegraph":0==i.indexOf("scatterplot interaction pairs")&&(l="scatterplot"),await t.viewInterPairsCls.viewInteractionPairs(r,o,n,l,a,d,c,h,p,m)}}}else if(0==i.indexOf("export pairs")){let e=i.split(" | ");if(3==e.length){let i=e[1].split(" ");if(2==i.length){let n=i[0].split(","),l=i[1].split(","),r=e[2].split(" ")[1];t.showInterCls.pickCustomSphere(r,n,l,t.bSphereCalc),t.bSphereCalc=!0;let o=t.viewInterPairsCls.exportSpherePairs(),a=Object.keys(s.utilsCls.getHlStructures()).join(",");t.saveFileCls.saveFile(a+"_sphere_pairs.html","html",o)}}}else if(0==n.indexOf("graph label")){let e=n.lastIndexOf(" "),t=n.substr(e+1);$("#"+s.svgid+"_label").val(t),$("#"+s.svgid+" text").removeClass(),$("#"+s.svgid+" text").addClass(t)}else if(0==n.indexOf("cartoon label")){let e=n.lastIndexOf(" "),t=n.substr(e+1);$("#"+s.svgid_ct+"_label").val(t),$("#"+s.svgid_ct+" text").removeClass(),$("#"+s.svgid_ct+" text").addClass(t)}else if(0==n.indexOf("line graph scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.linegraphid+"_scale").val(i),$("#"+s.linegraphid).attr("width",(t.linegraphWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("scatterplot scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.scatterplotid+"_scale").val(i),$("#"+s.scatterplotid).attr("width",(t.scatterplotWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("contactmap scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.contactmapid+"_scale").val(i),$("#"+s.contactmapid).attr("width",(t.contactmapWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("alignerrormap scale")){let e=n.lastIndexOf(" "),i=n.substr(e+1);$("#"+s.alignerrormapid+"_scale").val(i),$("#"+s.alignerrormapid).attr("width",(t.alignerrormapWidth*parseFloat(i)).toString()+"px")}else if(0==n.indexOf("graph force")){let e=n.lastIndexOf(" ");s.htmlCls.force=parseInt(n.substr(e+1)),$("#"+s.svgid+"_force").val(s.htmlCls.force),t.getGraphCls.handleForce()}else if(0==n.indexOf("hide edges")){let e=n.lastIndexOf(" ");s.htmlCls.hideedges=parseInt(n.substr(e+1)),$("#"+s.svgid+"_hideedges").val(s.htmlCls.hideedges),s.htmlCls.hideedges?(s.htmlCls.contactInsideColor="FFF",s.htmlCls.hbondInsideColor="FFF",s.htmlCls.ionicInsideColor="FFF"):(s.htmlCls.contactInsideColor="DDD",s.htmlCls.hbondInsideColor="AFA",s.htmlCls.ionicInsideColor="8FF"),void 0!==t.graphStr&&t.bRender&&s.htmlCls.force&&t.drawGraphCls.drawGraph(t.graphStr,t.pre+"dl_graph")}else if(0==n.indexOf("reset interaction pairs"))t.viewInterPairsCls.resetInteractionPairs();else if(0==n.indexOf("side by side")){let e=n.split(" | ")[1],t="_blank";window.open(e,t)}else if(0==i.indexOf("your note")){let e=i.split(" | ");t.yournote=e[1],$("#"+t.pre+"yournote").val(t.yournote),s.cfg.shownote&&(document.title=t.yournote)}else if(0==n.indexOf("cross structure interaction"))t.crossstrucinter=parseInt(n.substr(n.lastIndexOf(" ")+1)),$("#"+t.pre+"crossstrucinter").val(t.crossstrucinter);else if("replay on"==n)await t.resizeCanvasCls.replayon();else if("replay off"==n)await t.resizeCanvasCls.replayoff();else if(0==n.indexOf("contact map")){let e=n.split(" | ");if(3===e.length){let s=parseFloat(e[1].split(" ")[1]),i=e[2].split(" ")[1];await t.contactMapCls.contactMap(s,i)}}else if(0==n.indexOf("pickatom")){let e=parseInt(n.substr(n.lastIndexOf(" ")+1));t.pAtom=t.atoms[e],t.pickingCls.showPicking(t.pAtom)}else if(0==i.indexOf("set color spectrum")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!0;t.setColorCls.setColorAcrossSets(s,i)}}else if(0==i.indexOf("set residues color spectrum")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!0;t.setColorCls.setColorBySets(s,i)}}else if(0==i.indexOf("set color rainbow")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!1;t.setColorCls.setColorAcrossSets(s,i)}}else if(0==i.indexOf("set residues color rainbow")){let e=i.split(" | ");if(2==e.length){let s=e[1].split(","),i=!1;t.setColorCls.setColorBySets(s,i)}}else if(0==i.indexOf("color")){let e=i.split(" | "),n=e[0].substr(e[0].indexOf(" ")+1);if(t.opts.color=n,"residue custom"==n&&2==e.length){t.customResidueColors=JSON.parse(e[1]);for(let e in t.customResidueColors)t.customResidueColors[e.toUpperCase()]=s.parasCls.thr("#"+t.customResidueColors[e])}else if("align custom"==n&&3==e.length){let s=e[1],i=e[2].split(", ");t.queryresi2score={},t.queryresi2score[s]={};for(let e=0,n=i.length;e1&&"3"===x[t][0]&&isNaN(x[t][1])&&"-"!==x[t][0]){i=x[t].toUpperCase().substr(1),m=!0}else if(""===x[t]||isNaN(parseInt(x[t]))){if("*"===x[t])h=!0;else if("proteins"!==x[t]&&"nucleotides"!==x[t]&&"chemicals"!==x[t]&&"ions"!==x[t]&&"water"!==x[t]&&"anchors"!==x[t]&&"strands"!==x[t]&&"loops"!==x[t]){s=x[t].toUpperCase(),p=!0}}else v=x[t],_=v,n=!0;for(let a=0,u=S.length;a1?e.substr(0,l-1)===n.atoms[i].name.substr(0,l-1)&&(0===s?t[i]=1:t.hasOwnProperty(i)||delete t[i]):"*"!==e&&e!==n.atoms[i].name||(0===s?t[i]=1:t.hasOwnProperty(i)||delete t[i]),t}}class hs{constructor(e){this.icn3d=e}selectAll(){let e=this.icn3d;e.icn3dui,this.selectAll_base(),e.hlObjectsCls.removeHlObjects(),e.hlUpdateCls.removeHl2D(),e.hlUpdateCls.removeHlMenus(),e.bSelectResidue=!1,e.bSelectAlignResidue=!1,e.hlUpdateCls.removeSeqResidueBkgd(),e.hlUpdateCls.update2DdgmContent(),$("#"+e.pre+"dl_annotations > .icn3d-annotation").show(),e.definedSetsCls.setMode("all"),e.saveFileCls.showTitle()}selectAll_base(){let e=this.icn3d,t=e.icn3dui;e.hAtoms={},e.dAtoms={};for(let s in e.chains)e.hAtoms=t.hashUtilsCls.unionHash(e.hAtoms,e.chains[s]);e.dAtoms=t.hashUtilsCls.cloneHash(e.hAtoms),e.viewSelectionAtoms=t.hashUtilsCls.cloneHash(e.hAtoms),e.ALTERNATE_STRUCTURE=-1}selectAChain(e,t,s,i){let n=this.icn3d,l=n.icn3dui;t=t.replace(/\s/g,"");let r=void 0!==s||s?"select alignChain "+e:"select chain "+e;void 0!==i&&i?(n.hAtoms=l.hashUtilsCls.unionHash(n.hAtoms,n.chains[e]),void 0===n.nameArray&&(n.nameArray=[])):(n.hAtoms={},n.nameArray=[]),n.nameArray.push(e);let o,a=s?n.alnChainsSeq[e]:n.chainsSeq[e];o=void 0===a?0:a.length;let d={};for(let t=0,s=o;t0){if(void 0!==i&&i?void 0===r.nameArray&&(r.nameArray=[]):(r.hAtoms={},r.nameArray=[]),l)for(let t in e)r.hAtoms[t]=1;else for(let t in e)for(let e in r.residues[t])r.hAtoms[e]=1;let o,a;t=t.replace(/\s/g,""),r.nameArray.push(t),l?(o="select "+r.resid2specCls.atoms2spec(r.hAtoms),a=!1):(o="select "+r.resid2specCls.residueids2spec(Object.keys(e)),a=!0);let d=Object.keys(e);this.addCustomSelection(d,t,s,o,a),(void 0===n||n)&&r.hlUpdateCls.updateHlAll(r.nameArray,void 0,i)}}selectMainChains(){let e=this.icn3d,t=e.icn3dui.hashUtilsCls.cloneHash(e.hAtoms);e.hAtoms=e.applyDisplayCls.selectMainChainSubset(t),e.hlUpdateCls.showHighlight()}selectSideChains(){let e=this.icn3d,t=e.icn3dui,s=t.hashUtilsCls.cloneHash(e.hAtoms);e.hAtoms={};for(let i in s)(e.proteins.hasOwnProperty(i)&&"N"!==e.atoms[i].name&&"H"!==e.atoms[i].name&&"C"!==e.atoms[i].name&&"O"!==e.atoms[i].name&&("CA"!==e.atoms[i].name||"C"!==e.atoms[i].elem)&&"HA"!==e.atoms[i].name||e.nucleotides.hasOwnProperty(i)&&-1===t.parasCls.nuclMainArray.indexOf(e.atoms[i].name))&&(e.hAtoms[i]=1);e.hlUpdateCls.showHighlight()}selectMainSideChains(){let e=this.icn3d,t=e.icn3dui,s=e.firstAtomObjCls.getResiduesFromAtoms(e.hAtoms);e.hAtoms={};for(let i in s)e.hAtoms=t.hashUtilsCls.unionHash(e.hAtoms,e.residues[i]),e.dAtoms=t.hashUtilsCls.unionHash(e.dAtoms,e.residues[i]);e.drawCls.draw(),e.hlUpdateCls.showHighlight()}clickShow_selected(){let e=this.icn3d,t=e.icn3dui,s=this;t.myEventCls.onIds(["#"+e.pre+"show_selected","#"+e.pre+"mn2_show_selected"],"click",(function(e){s.icn3d,s.showSelection(),t.htmlCls.clickMenuCls.setLogCmd("show selection",!0)}))}clickHide_selected(){let e=this.icn3d,t=e.icn3dui,s=this;t.myEventCls.onIds("#"+e.pre+"mn2_hide_selected","click",(function(e){s.icn3d,s.hideSelection(),t.htmlCls.clickMenuCls.setLogCmd("hide selection",!0)}))}getGraphDataForDisplayed(){let e=this.icn3d;e.icn3dui;let t=JSON.parse(e.graphStr),s=e.firstAtomObjCls.getResiduesFromAtoms(e.dAtoms),i=[],n=[],l={};for(let e=0,n=t.nodes.length;et&&(t=C[s].length,e=s);let s=Object.keys(p),i=Object.keys(m);for(let t=0,n=C[e].length;t
The following sequence alignment shows the residue mapping of the best aligned sets: "symOri" and "symPerm", which are also available in the menu "Analysis > Defined Sets".
',$("#"+e.pre+"symd_info").html(A),s.setSeqAlignForSymmetry(_,w,S);let x=!1,k=t.htmlCls.alignSeqCls.getAlignSequencesAnnotations(Object.keys(e.alnChains),void 0,void 0,x,S);A=$("#"+e.pre+"dl_sequence2").html()+k.sequencesHtml,$("#"+e.pre+"dl_sequence2").html(A),$("#"+e.pre+"dl_sequence2").width(t.htmlCls.RESIDUE_WIDTH*k.maxSeqCnt+200),t.htmlCls.dialogCls.openDlg("dl_alignment","Select residues in aligned sequences from SymD");let O=Object.keys(e.defNames2Residues).length+Object.keys(e.defNames2Atoms).length,R="symOri"+O;e.selectionCls.selectResidueList(y,R,R),e.selectionCls.updateSelectionNameDesc(),t.htmlCls.clickMenuCls.setLogCmd("select "+e.resid2specCls.residueids2spec(Object.keys(y))+" | name "+R,!1),R="symPerm"+O,e.selectionCls.selectResidueList(v,R,R),e.selectionCls.updateSelectionNameDesc(),t.htmlCls.clickMenuCls.setLogCmd("select "+e.resid2specCls.residueids2spec(Object.keys(v))+" | name "+R,!1),R="symBoth"+O,y=t.hashUtilsCls.unionHash(y,v),e.selectionCls.selectResidueList(y,R,R),e.selectionCls.updateSelectionNameDesc(),t.htmlCls.clickMenuCls.setLogCmd("select "+e.resid2specCls.residueids2spec(Object.keys(y))+" | name "+R,!1)}}else $("#"+e.pre+"dl_symd").html("
The selected residues have no detected symmetry with a Z score of "+a.zscore+" from the program SymD."),t.htmlCls.dialogCls.openDlg("dl_symd","Dynamically Calculated Symmetry Using SymD");e.symdtitle="none"===h?void 0:h,e.drawCls.draw()}catch(s){return $("#"+e.pre+"dl_symd").html("
The web service can not determine the symmetry of the input set."),t.htmlCls.dialogCls.openDlg("dl_symd","Dynamically Calculated Symmetry Using SymD"),void e.ParserUtilsCls.hideLoading()}}getResObj(e){this.icn3d.icn3dui;let t=e.substr(0,e.indexOf(" ")),s=e.indexOf("$"),i=e.indexOf("."),n=e.indexOf(":"),l=e.substr(s+1,i-s-1),r=e.substr(i+1,n-i-1),o=e.substr(n+1);return{resn:t,resid:l+"_"+r+"_"+o,resi:o,aligned:!0}}setSeqAlignForSymmetry(e,t,s){let i=this.icn3d,n=i.icn3dui;i.conservedName1="symOri_cons",i.conservedName2="symPerm_cons",i.consHash1={},i.consHash2={},i.alnChainsAnTtl={},i.alnChainsAnno={},i.alnChainsSeq={},i.alnChains={},i.alnChainsSeq={};let l={};for(let r=0,o=e.length;r
This structure has no symmetry.");i.htmlCls.dialogCls.openDlg("dl_symmetry","Symmetry")}getPolygonColor(e){let t=this.icn3d.icn3dui,s=e.substr(0,1);return"C"==s?t.parasCls.thr(16747520):"D"==s?t.parasCls.thr(65535):"T"==s?t.parasCls.thr(15631086):"O"==s?t.parasCls.thr(16753920):"I"==s?t.parasCls.thr(65280):t.parasCls.thr(11119017)}getAxisColor(e,t){let s=this.icn3d.icn3dui,i=e.substr(0,1);return"C"==i?s.parasCls.thr(16711680):"D"==i?2==t?s.parasCls.thr(65535):s.parasCls.thr(16711680):"T"==i?2==t?s.parasCls.thr(65535):s.parasCls.thr(65280):"O"==i||"I"==i?2==t?s.parasCls.thr(65535):3==t?s.parasCls.thr(65280):s.parasCls.thr(16711680):s.parasCls.thr(16711680)}}class Cs{constructor(e){this.icn3d=e}alignSW(e,t,s,i,n,l,r){this.icn3d.icn3dui;let o=this.bsa_align(r,e,t,[s,i],[n,l]),a="score: "+o[0]+"\n";a+="start: "+o[1]+"\n",a+="cigar: "+this.bsa_cigar2str(o[2])+"\n\n",a+="alignment:\n\n";let d=this.bsa_cigar2gaps(e,t,o[1],o[2]),c={};return c.score=o[0],c.start=o[1],c.cigar=this.bsa_cigar2str(o[2]),c.target=d[0],c.query=d[1],c}bsg_enc_seq(e,t){if(this.icn3d.icn3dui,null==t)return null;let s=[];s.length=e.length;for(let i=0;i
Calculate solvent accessible surface area in the interface:
";C+="Set 1: "+e+", Surface: "+o+" Å2
",C+="Set 2: "+t+", Surface: "+d+" Å2
",C+="Total Surface: "+h+" Å2
",C+="Buried Surface for Set 1: "+u+" Å2
",C+="Buried Surface for Set 2: "+m+" Å2
",$("#"+s.pre+"dl_buriedarea_html").html(C),i.htmlCls.dialogCls.openDlg("dl_buriedarea","Buried solvent accessible surface area in the interface"),i.htmlCls.clickMenuCls.setLogCmd("buried surface "+b,!1)}}measureDistTwoSets(e,t){var s=this.icn3d,i=s.icn3dui;if(0==e.length||0==t.length)alert("Please select two sets");else{let n=i.hashUtilsCls.cloneHash(s.hAtoms),l=s.definedSetsCls.getAtomsFromNameArray(e),r=s.definedSetsCls.getAtomsFromNameArray(t),o=s.contactCls.getExtent(l),a=s.contactCls.getExtent(r),d=new THREE.Vector3(o[2][0],o[2][1],o[2][2]),c=new THREE.Vector3(a[2][0],a[2][1],a[2][2]);s.hAtoms=i.hashUtilsCls.cloneHash(n),void 0===s.distPnts&&(s.distPnts=[]),s.distPnts.push(d),s.distPnts.push(c);let h=$("#"+s.pre+"distancecolor2").val();this.addLine(d.x,d.y,d.z,c.x,c.y,c.z,h,!0,"distance");let p=0,m=0,u=d.clone().add(c).multiplyScalar(.5),g=(parseInt(10*d.distanceTo(c))/10).toString()+" A";this.addLabel(g,u.x,u.y,u.z,p,h,m,"distance"),s.drawCls.draw()}}measureDistManySets(e,t){var s=this.icn3d,i=s.icn3dui;if(0==e.length||0==t.length)alert("Please select sets for distance calculation...");else{let n=i.hashUtilsCls.cloneHash(s.hAtoms),l={};for(let i=0,n=e.length;i ";for(let s=0,i=e.length;s";for(let e=0,s=t.length;e "+t[e]+" (Å)"}r+=""+i+" (Å) ";for(let e=0,s=t.length;e'+l[i][s]+"":r+="0 "}r+=""}r+="
",$("#"+i.pre+"dl_disttable_html").html(r)}}addLine(e,t,s,i,n,l,r,o,a,d,c){var h=this.icn3d;h.icn3dui;let p={};p.position1=new THREE.Vector3(e,t,s),p.position2=new THREE.Vector3(i,n,l),p.color=r,p.dashed=o,p.radius=d,p.opacity=c,void 0===h.lines[a]&&(h.lines[a]=[]),void 0!==a?h.lines[a].push(p):(void 0===h.lines.custom&&(h.lines.custom=[]),h.lines.custom.push(p)),h.hlObjectsCls.removeHlObjects()}addLineFromPicking(e){var t=this.icn3d,s=t.icn3dui;let i=$("#"+t.pre+e+"color").val();t.pAtom.coord.x,t.pAtom2.coord.x,t.pAtom.coord.y,t.pAtom2.coord.y,t.pAtom.coord.z,t.pAtom2.coord.z;let n="stabilizer"!=e;s.htmlCls.clickMenuCls.setLogCmd("add line | x1 "+t.pAtom.coord.x.toPrecision(4)+" y1 "+t.pAtom.coord.y.toPrecision(4)+" z1 "+t.pAtom.coord.z.toPrecision(4)+" | x2 "+t.pAtom2.coord.x.toPrecision(4)+" y2 "+t.pAtom2.coord.y.toPrecision(4)+" z2 "+t.pAtom2.coord.z.toPrecision(4)+" | color "+i+" | dashed "+n+" | type "+e,!0),this.addLine(t.pAtom.coord.x,t.pAtom.coord.y,t.pAtom.coord.z,t.pAtom2.coord.x,t.pAtom2.coord.y,t.pAtom2.coord.z,i,n,e),t.pickpair=!1}addLabel(e,t,s,i,n,l,r,o){var a=this.icn3d;a.icn3dui;let d={};"0"!==n&&""!==n&&"undefined"!==n||(n=void 0),"0"!==l&&""!==l&&"undefined"!==l||(l=void 0),"0"!==r&&""!==r&&"undefined"!==r||(r=void 0);let c=new THREE.Vector3;c.x=t,c.y=s,c.z=i,d.position=c,d.text=e,d.size=n,d.color=l,d.background=r,void 0===a.labels[o]&&(a.labels[o]=[]),void 0!==o?a.labels[o].push(d):(void 0===a.labels.custom&&(a.labels.custom=[]),a.labels.custom.push(d)),a.hlObjectsCls.removeHlObjects()}addChainLabels(e){var t=this.icn3d;let s=t.icn3dui.hashUtilsCls.intHash(t.hAtoms,e);void 0===t.labels.chain&&(t.labels.chain=[]);let i=t.firstAtomObjCls.getChainsFromAtoms(s);for(let e in i){let s={};s.position=t.applyCenterCls.centerAtoms(t.chains[e]).center;let i=e.indexOf("_"),n=e.substr(i+1),l=t.showSeqCls.getProteinName(e);l.length>20&&(l=l.substr(0,20)+"..."),s.text="Chain "+n+": "+l,s.size=18,t.firstAtomObjCls.getFirstCalphaAtomObj(t.chains[e]).color.getHexString().toUpperCase(),s.color="black"!=t.opts.background?t.colorWhitebkgd:t.colorBlackbkgd,s.background="#FFFFFF",t.labels.chain.push(s)}t.hlObjectsCls.removeHlObjects()}addTerminiLabels(e){var t=this.icn3d,s=t.icn3dui;let i,n="#FFFFFF";i=s.hashUtilsCls.unionHash(i,t.proteins),i=s.hashUtilsCls.unionHash(i,t.nucleotides);let l=s.hashUtilsCls.intHash(t.dAtoms,i),r=s.hashUtilsCls.intHash(l,e);void 0===t.labels.chain&&(t.labels.chain=[]);let o=t.firstAtomObjCls.getChainsFromAtoms(r);for(let e in o){let i=s.hashUtilsCls.intHash(l,t.chains[e]),r=Object.keys(i),o=t.atoms[r[0]],a=t.atoms[r[r.length-1]],d={},c={};d.position=o.coord,c.position=a.coord,d.text="N-",c.text="C-",t.nucleotides.hasOwnProperty(o.serial)&&(d.text="5'",c.text="3'"),d.size=18,c.size=18,o.color.getHexString().toUpperCase(),a.color.getHexString().toUpperCase(),d.color="black"!=t.opts.background?t.colorWhitebkgd:t.colorBlackbkgd,c.color="black"!=t.opts.background?t.colorWhitebkgd:t.colorBlackbkgd,d.background=n,c.background=n,t.labels.chain.push(d),t.labels.chain.push(c)}t.hlObjectsCls.removeHlObjects()}}class vs{constructor(e){this.icn3d=e}draw2Ddgm(e,t,s,i){let n=this.icn3d,l=n.icn3dui,r=.667,o={},a={},d={},c={},h={};if(void 0===e)return"";for(let s in e.moleculeInfor){let i="#"+("000000"+e.moleculeInfor[s].color.toString(16)).slice(-6),l=e.moleculeInfor[s].chain.trim();void 0===h[l]?h[l]=1:++h[l];let r=t+"_"+(1===h[l]?l:l+h[l].toString());void 0!==n.mmdbid_q&&(n.mmdbid_q,n.mmdbid_t),o[s]=r,a[s]=i,d[s]=e.moleculeInfor[s].name,c[r]=s}if(void 0===i||!i)for(let s=0,i=e.intracResidues.length;s";p+=""+t.toUpperCase()+"
",p+="",p+="",n.html2ddgm+=p,$("#"+n.pre+"dl_2ddgm_html").html(n.html2ddgm),p}set2DdgmNote(e){let t="
";return this.icn3d.icn3dui.utilsCls.isMac()?(t+="◯Protein
",t+="▢Nucleotide
",t+="♢Chemical
",t+="▢Biopolymer
"):(t+="OProtein
",t+="▢Nucleotide
",t+="◇Chemical
",t+="▢Biopolymer
"),t+="
Lines:
Interactions at 4 Å
",e&&(t+="Numbers in red:
Aligned chains"),t+="
",t}highlightNode(e,t,s,i){let n=this.icn3d.icn3dui;i<.2&&(i=.2);if("rect"===e){$(t).attr("stroke",n.htmlCls.ORANGE),$(t).attr("stroke-width",3);let e=Number($(s).attr("x")),l=Number($(s).attr("y")),r=Number($(s).attr("width")),o=Number($(s).attr("height"));$(t).attr("x",e+r/2*(1-i)),$(t).attr("y",l+o/2*(1-i)),$(t).attr("width",r*i),$(t).attr("height",o*i)}else if("circle"===e)$(t).attr("stroke",n.htmlCls.ORANGE),$(t).attr("stroke-width",3),$(t).attr("r",Number($(s).attr("r"))*i);else if("polygon"===e){$(t).attr("stroke",n.htmlCls.ORANGE),$(t).attr("stroke-width",3);let e=Number($(s).attr("x")),l=Number($(s).attr("y")),r=Number($(s).attr("x0d")),o=Number($(s).attr("y0d")),a=Number($(s).attr("x1d")),d=Number($(s).attr("y1d")),c=Number($(s).attr("x2d")),h=Number($(s).attr("y2d")),p=Number($(s).attr("x3d")),m=Number($(s).attr("y3d"));$(t).attr("points",(e+r*i).toString()+", "+(l+o*i).toString()+", "+(e+a*i).toString()+", "+(l+d*i).toString()+", "+(e+c*i).toString()+", "+(l+h*i).toString()+", "+(e+p*i).toString()+", "+(l+m*i).toString())}}removeLineGraphSelection(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"dl_linegraph circle").attr("stroke","#000000"),$("#"+e.pre+"dl_linegraph circle").attr("stroke-width",1),$("#"+e.pre+"dl_linegraph svg line.icn3d-hlline").attr("stroke","#FFF")}removeScatterplotSelection(){let e=this.icn3d;e.icn3dui,$("#"+e.pre+"dl_scatterplot circle").attr("stroke","#000000"),$("#"+e.pre+"dl_scatterplot circle").attr("stroke-width",1),$("#"+e.pre+"dl_scatterplot rect").attr("stroke","#000000"),$("#"+e.pre+"dl_scatterplot rect").attr("stroke-width",1)}click2Ddgm(){let e=this.icn3d,t=e.icn3dui,s=this;$(document).on("click","#"+e.pre+"dl_2ddgm .icn3d-node",(function(e){let i=s.icn3d;e.stopImmediatePropagation(),Object.keys(i.hAtoms).length";return u+="n&&(n=C),ya&&(a=y);let v=.5;m=v*o.htmlCls.width2d*m/(t[1][0]-t[0][0]),u=v*o.htmlCls.width2d*u/(t[1][1]-t[0][1]),m>h&&(h=m),u>h&&(h=u),p.push({id:d,r:l,x:C,y:y,rx:m,ry:u,ang:g,c:b.color.getHexString()})}let m=h+2,u=n-s,g=a-i;for(let e=0,t=p.length;e0&&m==S.chain&&c.push('{"source": "'+u+'", "target": "'+n+'", "v": '+p+', "c": "'+t.color.getHexString().toUpperCase()+'"}'),A.push({id:n,r:l,ss:C,x:s,y:i,x1:d,y1:g,x2:k,y2:O,c:S.color.getHexString()}),m=S.chain,u=n,++h}}}let x=S+2,k=_-y,O=w-v;for(let e=0,t=A.length;e4e3||0!==s.indexOf("http")||l.bInputfile&&!l.bInputUrlfile?$("#"+l.pre+"viewer").html(""):$("#"+l.pre+"viewer").html("
"),$("#"+l.pre+"viewer").width(i),$("#"+l.pre+"viewer").height(n),$("#"+l.pre+"cmdlog").hide(),$("#"+l.pre+"title").hide(),$("#"+l.pre+"mnlist").hide(),$("#"+l.pre+"fullscreen").length>0&&$("#"+l.pre+"fullscreen").hide(),l={}}else saveAs(e,t)}saveSvg(e,t,s){if(this.icn3d.icn3dui.bNode)return"";let i=$("#"+e).width(),n=$("#"+e).height();s&&(n=i);let l=this.getSvgXml(e,i,n,s),r=new Blob([l],{type:"image/svg+xml"});saveAs(r,t)}getSvgXml(e,t,s,i){if(this.icn3d.icn3dui.bNode)return"";return(t&&s?'"}savePng(e,t,s){let i=this.icn3d,n=i.icn3dui;if(n.bNode)return"";let l=$("#"+e).width(),r=$("#"+e).height();s&&(r=l);let o=document.getElementById(e),a=o.getBBox(),d=o.cloneNode(!0);i.lineGraphCls.copyStylesInline(d,o);let c=document.createElement("CANVAS");c.width=l,c.height=r;let h=c.getContext("2d");h.clearRect(0,0,a.width,a.height);let p=this.getSvgXml(e,l,r,s),m=window.URL||window.webkitURL||window,u=new Blob([p],{type:"image/svg+xml;charset=utf-8"}),g=new Image;g.src=m.createObjectURL(u),g.onload=function(){if(h.drawImage(g,0,0),m.revokeObjectURL(this.src),n.utilsCls.isIE()){let e=c.msToBlob();e&&(saveAs(e,t),c.remove())}else c.toBlob((function(e){e&&(saveAs(e,t),c.remove())}))}}exportCustomAtoms(e){var t=this.icn3d;t.icn3dui;let s="",i=void 0!==t.defNames2Residues?Object.keys(t.defNames2Residues).sort():[];for(let n=0,l=i.length;n
20&&(e=e.substr(0,17)+"..."),l="Query: "+e+"; target: "+s,$("#"+i.pre+"title").html(l+", "+t)}else $("#"+i.pre+"title").html(r+" "+l+": "+t);else $("#"+i.pre+"title").html(t)}getLinkToStructureSummary(e){var t=this.icn3d,s=t.icn3dui;let i="https://www.ncbi.nlm.nih.gov/structure/?term=";if(i=void 0!==s.cfg.cid?"https://www.ncbi.nlm.nih.gov/pccompound/?term=":void 0!==s.cfg.refseqid?"https://www.ncbi.nlm.nih.gov/protein/":void 0!==s.cfg.afid?"https://alphafold.ebi.ac.uk/search/text/":Object.keys(t.structures).length>1?"https://www.ncbi.nlm.nih.gov/structure/?term=":s.htmlCls.baseUrl+"pdb/",void 0===t.inputid)i="https://www.ncbi.nlm.nih.gov/pccompound/?term="+t.molTitle;else{let n=t.inputid.split("_");1===n.length?(i+=t.inputid,e&&s.htmlCls.clickMenuCls.setLogCmd("link to "+t.inputid+": "+i,!1)):2===n.length&&(s.cfg.afid?i+=n[0]+" "+n[1]:i+=n[0]+" OR "+n[1],e&&s.htmlCls.clickMenuCls.setLogCmd("link to structures "+n[0]+" and "+n[1]+": "+i,!1))}return i}setEntrezLinks(e){var t=this.icn3d,s=t.icn3dui;let i,n=Object.keys(t.structures);if(1===n.length){i="https://www.ncbi.nlm.nih.gov/"+e+"/?term="+n[0],s.htmlCls.clickMenuCls.setLogCmd("Entrez "+e+" about PDB "+n[0]+": "+i,!1);let l=t.structures&&Object.keys(t.structures).length>0?"_blank":"_self";window.open(i,l)}else if(2===n.length){i="https://www.ncbi.nlm.nih.gov/"+e+"/?term="+n[0]+" OR "+n[1],s.htmlCls.clickMenuCls.setLogCmd("Entrez "+e+" about PDB "+n[0]+" OR "+n[1]+": "+i,!1);let l=t.structures&&Object.keys(t.structures).length>0?"_blank":"_self";window.open(i,l)}}}class xs{constructor(e){this.icn3d=e}async shareLink(e,t){let s=this.icn3d,i=s.icn3dui,n=this.shareLinkUrl(),l=n.length>4e3||0!==n.indexOf("http"),r=Object.keys(s.structures).join("_");if(r==s.defaultPdbId&&(s.filename?r=s.filename:s.inputid&&(r=s.inputid)),e){if(t||s.bInputfile||l)return void s.saveFileCls.saveFile(r+"_icn3d_loadable.png","png")}else{if(s.bInputfile&&!s.bInputUrlfile)return void alert("Share Link does NOT work when the data are from custom files. Please save 'iCn3D PNG Image' in the File menu and open it in iCn3D.");if(l)return void alert("The url is more than 4000 characters and may not work. Please save 'iCn3D PNG Image' or 'State File' and open them in iCn3D.");i.htmlCls.clickMenuCls.setLogCmd("share link: "+n,!1)}let o="Problem in getting shortened URL";if(!i.cfg.notebook){let t=await this.getShareLinkPrms(n,e);if(void 0!==t.shortLink&&(o=t.shortLink,e)){let e=o.split("/"),t=e[e.length-1];s.saveFileCls.saveFile(r+"-"+t+".png","png");let i='\n\n",s.saveFileCls.saveFile(r+"-"+t+".html","html",i)}e&&void 0===t.shortLink&&s.saveFileCls.saveFile(r+"_icn3d_loadable.png","png");let i=o.split("page.link/");2==i.length&&(o="https://structure.ncbi.nlm.nih.gov/icn3d/share.html?"+i[1]),$("#"+s.pre+"short_url").val(o),$("#"+s.pre+"short_url_title").val(o+"&t="+s.yournote)}let a=this.shareLinkUrl(void 0,!0),d="view = icn3dpy.view(q='"+(i.cfg.url?"url="+i.cfg.url:i.cfg.idname+"="+i.cfg.idvalue)+"',command='"+a+"')\nview";(i.cfg.url||i.cfg.idname)&&$("#"+s.pre+"jn_commands").val(d),$("#"+s.pre+"ori_url").val(n),e||i.htmlCls.dialogCls.openDlg("dl_copyurl","Copy a Share Link URL or Jupyter Notebook Commands")}getShareLinkPrms(e,t){let s=this.icn3d,i=s.icn3dui;return new Promise((function(n,l){$.ajax({url:"https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=AIzaSyBxl9CgM0dY5lagHL4UOhEpLWE1fuwdnvc",type:"POST",data:{longDynamicLink:"https://icn3d.page.link/?link="+encodeURIComponent(e)},dataType:"json",success:function(e){n(e)},error:function(n,l,r){let o="Problem in getting shortened URL";$("#"+s.pre+"ori_url").val(e),$("#"+s.pre+"short_url").val(o),$("#"+s.pre+"short_url_title").val(o+"&t="+s.yournote),t||i.htmlCls.dialogCls.openDlg("dl_copyurl","Copy a Share Link URL")}})}))}shareLinkUrl(e,t){let s=this.icn3d,i=s.icn3dui,n=i.htmlCls.baseUrl+"icn3d/?",l="";if(i.cfg.bSidebyside&&(n=i.htmlCls.baseUrl+"icn3d/full2.html?"),s.bInputUrlfile){n=window.location.href.split("?")[0]+"?"+s.inputurl+"&"}let r,o={};for(let e in s.cfg){let t=s.cfg[e];"inpara"!==e&&"command"!==e&&"usepdbnum"!==e&&"date"!==e&&"v"!==e&&void 0!==t&&("width"===e&&"100%"===t||"height"===e&&"100%"===t||"resize"===e&&!0===t||"showmenu"===e&&!0===t||"showtitle"===e&&!0===t||"showcommand"===e&&!0===t||"mobilemenu"===e&&!1===t||"showanno"===e&&!1===t||"showseq"===e&&!1===t||"showalignseq"===e&&!1===t||"show2d"===e&&!1===t||"showsets"===e&&!1===t||"rotate"===e&&"right"===t||"command"!==e&&("options"===e?Object.keys(t).length>0&&(o[e]=JSON.stringify(t)):!0===t?o[e]=1:!1===t?o[e]=0:""!==t&&(o[e]=t)))}s.bAfMem?o.afmem="on":(i.cfg.afid||1==Object.keys(s.structures).length&&Object.keys(s.structures)[0].length>5)&&(o.afmem="off");let a=-1;void 0!==i.cfg.inpara&&(a=i.cfg.inpara.indexOf("&command=")),r=-1!==a?i.cfg.inpara.substr(0,a):i.cfg.inpara;let d=!1;if(!s.bInputUrlfile){let e=r&&r.substr(1)?r.substr(1).split("&"):[];for(let t=0,s=e.length;tc){u=s.commands[c].split("|||")[0].split("&command=")[0].trim(),-1!==u.indexOf(g)&&++f}let b,C=c+1,y="";for(let e=s.commands.length;Ct.substr(0,s))return 1;if(e.substr(0,s)==t.substr(0,s)){if(parseInt(e.substr(s+1)) ";for(let e=0,t=i.length;eStructure Chain Residue Number "+i[e].substr(0,t)+" "+i[e].substr(t+1,s-t-1)+" "+i[e].substr(s+1)+" "}let l=Object.keys(t.utilsCls.getHlStructures()).join(",");e.saveFileCls.saveFile(l+"_residues.txt","html",n)}addStabilizer(){let e=this.icn3d,t=e.icn3dui,s=3.5;if(Object.keys(e.dAtoms).length>0){let i,n={},l=12.25,r=3.2*3.2;for(let t in e.dAtoms){let s=e.atoms[t];!e.nucleotides.hasOwnProperty(s.serial)||"N1"!==s.name&&"N2"!==s.name&&"N3"!==s.name&&"N4"!==s.name&&"N6"!==s.name&&"O2"!==s.name&&"O6"!==s.name||(i=s.structure+"_"+s.chain+"_"+s.resi+"_"+s.name,n[i]=s)}let o=Object.keys(n),a=o.length;void 0===e.pairArray&&(e.pairArray=[]);for(let t=0;ts)continue;let h=Math.abs(n[a].coord.y-n[d].coord.y);if(h>s)continue;let p=Math.abs(n[a].coord.z-n[d].coord.z);if(p>s)continue;let m=c*c+h*h+p*p;m>l||m0&&(l+=","),l+=n[e].substr(0,n[e].indexOf("_"));s.chainidArray=[e].concat(n),s.chainidArray=s.chainalignParserCls.addPostfixForChainids(s.chainidArray),t.htmlCls.clickMenuCls.setLogCmd("resdef "+t.cfg.resdef,!0),s.loadCmd="vast_search_chainid "+s.chainidArray,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),s.bMmdbafid=!0;let r=!0;await s.chainalignParserCls.downloadMmdbAf(l,r)}}else if(void 0!==t.cfg.url){s.bInputUrlfile=!0;let e=t.cfg.url.split("|"),i=e[0],n=e[1];s.molTitle="",s.inputid=n,s.inputurl="type="+i+"&url="+encodeURIComponent(n),s.loadCmd="load url "+n+" | type "+i,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.pdbParserCls.downloadUrl(n,i,t.cfg.command)}else if(void 0!==t.cfg.mmtfid)s.inputid=t.cfg.mmtfid,s.loadCmd="load mmtf "+t.cfg.mmtfid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmtfParserCls.downloadMmtf(t.cfg.mmtfid);else if(void 0!==t.cfg.pdbid)s.inputid=t.cfg.pdbid,s.loadCmd="load pdb "+t.cfg.pdbid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.pdbParserCls.downloadPdb(t.cfg.pdbid);else if(void 0!==t.cfg.afid){s.inputid=t.cfg.afid,s.loadCmd="load af "+t.cfg.afid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0);let e=!0;await s.pdbParserCls.downloadPdb(t.cfg.afid,e)}else if(void 0!==t.cfg.opmid)s.inputid=t.cfg.opmid,s.loadCmd="load opm "+t.cfg.opmid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.opmParserCls.downloadOpm(t.cfg.opmid);else if(void 0!==t.cfg.mmdbid)s.inputid=t.cfg.mmdbid,s.loadCmd="load mmdb "+t.cfg.mmdbid+" | parameters "+t.cfg.inpara,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadMmdb(t.cfg.mmdbid);else if(void 0!==t.cfg.gi)s.loadCmd="load gi "+t.cfg.gi,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadGi(t.cfg.gi);else if(void 0!==t.cfg.refseqid)s.inputid=t.cfg.refseqid,s.loadCmd="load refseq "+t.cfg.refseqid,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadRefseq(t.cfg.refseqid);else if(void 0!==t.cfg.protein)s.inputid=t.cfg.protein,s.loadCmd="load protein "+t.cfg.protein,t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadProteinname(t.cfg.protein);else if(void 0!==t.cfg.blast_rep_id)if(s.inputid=t.cfg.query_id+","+t.cfg.blast_rep_id,t.cfg.oriQuery_id=t.cfg.query_id,t.cfg.oriBlast_rep_id=t.cfg.blast_rep_id,"Query"!==t.cfg.query_id.substr(0,5)&&void 0===t.cfg.rid)"icn3d"==t.cfg.from&&"1TSR_A"==t.cfg.blast_rep_id&&"NP_001108451.1"==t.cfg.query_id&&(t.cfg.command="view annotations; set annotation cdd; set annotation site; set view detailed view; select chain 1TSR_A; show selection"),"smithwm"==t.cfg.alg?(s.loadCmd="load seq_struct_ids_smithwm "+t.cfg.query_id+","+t.cfg.blast_rep_id,s.bSmithwm=!0):"local_smithwm"==t.cfg.alg?(s.loadCmd="load seq_struct_ids_local_smithwm "+t.cfg.query_id+","+t.cfg.blast_rep_id,s.bLocalSmithwm=!0):(s.loadCmd="load seq_struct_ids "+t.cfg.query_id+","+t.cfg.blast_rep_id,s.bSmithwm=!1,s.bLocalSmithwm=!1),t.htmlCls.clickMenuCls.setLogCmd(s.loadCmd,!0),await s.mmdbParserCls.downloadBlast_rep_id(t.cfg.query_id+","+t.cfg.blast_rep_id);else if(void 0!==t.cfg.rid){let e="https://blast.ncbi.nlm.nih.gov/Blast.cgi?RESULTS_FILE=on&FORMAT_TYPE=JSON2_S&FORMAT_OBJECT=Alignment&CMD=Get&RID="+t.cfg.rid,i=await t.getAjaxPromise(e,"json",!1,"The RID "+t.cfg.rid+" may have expired...");for(let e=0,n=i.BlastOutput2.length;e
";
+ html += this.addNotebookTitle('dl_dsn6', 'Load a map file');
+ html += "Note: Always load a PDB file before loading map files.
";
html += "2fofc contour at:
";
- html += me.htmlCls.inputFileStr + "id='" + me.pre + "dsn6file2fofc'> " + me.htmlCls.buttonStr + "reload_dsn6file2fofc' style='margin-top: 6px;'>Load
";
+ html += me.htmlCls.inputFileStr + "id='" + me.pre + "dsn6file2fofc'> " + me.htmlCls.buttonStr + "reload_dsn6file2fofc' style='margin: 6px 20px 0 0;'>Load DSN6
";
+ //html += me.htmlCls.inputFileStr + "id='" + me.pre + "dsn6file2fofc'> " + me.htmlCls.buttonStr + "reload_dsn6file2fofc' style='margin: 6px 20px 0 0;'>Load DSN6" + me.htmlCls.buttonStr + "reload_ccp4file2fofc' style='margin-top: 6px;'>Load CCP4
";
html += "fofc contour at:
";
- html += me.htmlCls.inputFileStr + "id='" + me.pre + "dsn6filefofc'> " + me.htmlCls.buttonStr + "reload_dsn6filefofc' style='margin-top: 6px;'>Load
";
+ html += me.htmlCls.inputFileStr + "id='" + me.pre + "dsn6filefofc'> " + me.htmlCls.buttonStr + "reload_dsn6filefofc' style='margin: 6px 20px 0 0;'>Load DSN6
";
+ //html += me.htmlCls.inputFileStr + "id='" + me.pre + "dsn6filefofc'> " + me.htmlCls.buttonStr + "reload_dsn6filefofc' style='margin: 6px 20px 0 0;'>Load DSN6" + me.htmlCls.buttonStr + "reload_ccp4filefofc' style='margin-top: 6px;'>Load CCP4
";
html += me.htmlCls.buttonStr + "elecmapNo4'>Remove Map
";
@@ -508,7 +510,7 @@ class SetDialog {
html += me.htmlCls.divStr + "dl_dsn6url' class='" + dialogClass + "'>";
html += this.addNotebookTitle('dl_dsn6url', 'Load a selection file via a URL');
- html += "Note: Always load a PDB file before loading DSN6 files.
";
+ html += "Note: Always load a PDB file before loading map files.
";
html += "2fofc contour at: ";
html += this.getLink('mn1_dsn6', 'Local File', undefined, 3);
html += this.getLink('mn1_dsn6url', 'URL(CORS) ' + me.htmlCls.wifiStr, undefined, 3);
@@ -677,14 +677,14 @@ class SetMenu {
}
//!!!
-/*
+
html += this.getMenuText('m1_exportrefnum', 'Reference Numbers', undefined, undefined, 2);
html += "
";
html += this.getLink('mn1_exportIgstrand', 'Ig Strand', undefined, 3);
html += this.getLink('mn1_exportKabat', 'Kabat', undefined, 3);
html += this.getLink('mn1_exportImgt', 'IMGT', undefined, 3);
html += "
";
-*/
+
html += "
Potential ' + me.htmlCls.licenseStr + '');
@@ -1659,7 +1659,7 @@ class SetMenu {
html += this.getRadio('mn6_addlabel', 'mn6_addlabelResidues', 'per Residue', undefined, 1, 2);
html += this.getRadio('mn6_addlabel', 'mn6_addlabelResnum', 'per Residue & Number', undefined, 1, 2);
//!!!
- //html += this.getRadio('mn6_addlabel', 'mn6_addlabelRefnum', 'per Reference Number', undefined, 1, 2);
+ html += this.getRadio('mn6_addlabel', 'mn6_addlabelRefnum', 'per Reference Number', undefined, 1, 2);
html += this.getRadio('mn6_addlabel', 'mn6_addlabelChains', 'per Chain', undefined, undefined, 2);
html += this.getRadio('mn6_addlabel', 'mn6_addlabelTermini', 'N- & C-Termini', undefined, 1, 2);
}
@@ -1751,11 +1751,11 @@ class SetMenu {
html += "";
//!!!
-/*
+
html += this.getLink('mn6_igrefYes', 'Show Ig Ref. Number', undefined, 2);
html += this.getLink('mn6_igrefTpl', 'Ig w/ Specified Template', undefined, 2);
html += this.getLink('mn6_igrefNo', 'Hide Ig Ref. Number', undefined, 2);
-*/
+
html += this.getMenuSep();
html += this.getLink('mn6_customref', 'Custom Ref. Number', undefined, 2);
diff --git a/src/icn3d/analysis/refnum.js b/src/icn3d/analysis/refnum.js
index ab9ec935..9dad0d9c 100644
--- a/src/icn3d/analysis/refnum.js
+++ b/src/icn3d/analysis/refnum.js
@@ -115,8 +115,11 @@
// try {
if(!template) {
- let allPromise = Promise.allSettled(pdbAjaxArray);
- ic.pdbDataArray = await allPromise;
+ //let allPromise = Promise.allSettled(pdbAjaxArray);
+ //ic.pdbDataArray = await allPromise;
+
+ ic.pdbDataArray = await this.promiseWithFixedJobs(pdbAjaxArray);
+
await thisClass.parseRefPdbData(ic.pdbDataArray, template);
}
else {
@@ -227,6 +230,7 @@
}
if(!ic.domainid2refpdbname) ic.domainid2refpdbname = {};
+ if(!ic.domainid2score) ic.domainid2score = {};
for(let k = 0, kl = domainAtomsArray.length; k < kl; ++k) {
let pdb_target = ic.saveFileCls.getAtomPDB(domainAtomsArray[k], undefined, undefined, undefined, undefined, struct);
@@ -238,7 +242,7 @@
let atomLast = ic.firstAtomObjCls.getLastAtomObj(domainAtomsArray[k]);
let resiSum = atomFirst.resi + ':' + atomLast.resi;
//let domainid = chainid + '-' + k + '_' + Object.keys(domainAtomsArray[k]).length;
- let domainid = chainid + '-' + k + '_' + resiSum;
+ let domainid = chainid + ',' + k + '_' + resiSum;
ic.domainid2pdb[domainid] = pdb_target;
if(!template) {
@@ -268,30 +272,14 @@
}
}
- try {
+ //try {
if(!template) {
let dataArray2 = [];
// let allPromise = Promise.allSettled(ajaxArray);
// dataArray2 = await allPromise;
- //split arrays into chunks of 48 jobs or me.cfg.maxajax jobs
- let n = (me.cfg.maxajax) ? me.cfg.maxajax : ic.refpdbArray.length * 6;
-
- for(let i = 0, il = parseInt((ajaxArray.length - 1) / n + 1); i < il; ++i) {
- let currAjaxArray = []
- if(i == il - 1) { // last one
- currAjaxArray = ajaxArray.slice(i * n, ajaxArray.length);
- }
- else {
- currAjaxArray = ajaxArray.slice(i * n, (i + 1) * n);
- }
-
- let currPromise = Promise.allSettled(currAjaxArray);
- let currDataArray = await currPromise;
-
- dataArray2 = dataArray2.concat(currDataArray);
- }
+ dataArray2 = await this.promiseWithFixedJobs(ajaxArray);
let bRound1 = true;
await thisClass.parseAlignData(dataArray2, domainidpairArray, bRound1);
@@ -311,12 +299,14 @@
let pdbAjaxArray = [];
pdbAjaxArray.push(pdbAjax);
- let allPromise2 = Promise.allSettled(pdbAjaxArray);
- ic.pdbDataArray = await allPromise2;
+ //let allPromise2 = Promise.allSettled(pdbAjaxArray);
+ //ic.pdbDataArray = await allPromise2;
+
+ ic.pdbDataArray = await this.promiseWithFixedJobs(pdbAjaxArray);
for(let domainid in ic.domainid2refpdbname) {
let refpdbname = ic.domainid2refpdbname[domainid];
- let chainid = domainid.substr(0, domainid.indexOf('-'));
+ let chainid = domainid.substr(0, domainid.indexOf(','));
let pdb_target = ic.domainid2pdb[domainid];
for(let index = 0, indexl = ic.pdbDataArray.length; index < indexl; ++index) {
@@ -336,11 +326,14 @@
}
let dataArray3 = [];
- let allPromise = Promise.allSettled(ajaxArray);
- dataArray3 = await allPromise;
+ //let allPromise = Promise.allSettled(ajaxArray);
+ //dataArray3 = await allPromise;
+
+ dataArray3 = await this.promiseWithFixedJobs(ajaxArray);
await thisClass.parseAlignData(dataArray3, domainidpairArray3);
}
+ /*
}
catch(err) {
let mess = "Some of " + ajaxArray.length + " TM-align alignments failed. Please select a chain or a subset to assing reference numbers to avoid overloading the server...";
@@ -352,17 +345,23 @@
}
//console.log("Error in aligning with TM-align...");
return;
- }
+ }
+ */
}
getTemplateList(chainid) { let ic = this.icn3d, me = ic.icn3dui;
- let domainid2refpdbname = {};
+ let domainid2refpdbname = {}, domainid2score = {};
for(let i = 0, il = ic.chainid2refpdbname[chainid].length; i < il; ++i) {
let refpdbname_domainid = ic.chainid2refpdbname[chainid][i].split('|');
domainid2refpdbname[refpdbname_domainid[1]] = refpdbname_domainid[0];
}
+ for(let i = 0, il = ic.chainid2score[chainid].length; i < il; ++i) {
+ let score_domainid = ic.chainid2score[chainid][i].split('|');
+ domainid2score[score_domainid[1]] = score_domainid[0];
+ }
+
let domainidArray = Object.keys(domainid2refpdbname);
domainidArray.sort(function(id1, id2) {
let resi1 = parseInt(id1.substr(id1.lastIndexOf('_') + 1));
@@ -370,13 +369,19 @@
return resi1 - resi2;
});
- let chainList = '';
+ let refpdbnameList = '';
for(let i = 0, il = domainidArray.length; i < il; ++i) {
- chainList += domainid2refpdbname[domainidArray[i]];
- if(i < il - 1) chainList += ", ";
+ refpdbnameList += domainid2refpdbname[domainidArray[i]];
+ if(i < il - 1) refpdbnameList += ", ";
}
- return chainList;
+ let scoreList = '';
+ for(let i = 0, il = domainidArray.length; i < il; ++i) {
+ scoreList += domainid2score[domainidArray[i]];
+ if(i < il - 1) scoreList += ", ";
+ }
+
+ return {'refpdbnameList': refpdbnameList, 'scoreList': scoreList};
}
async parseAlignData(dataArray, domainidpairArray, bRound1) { let ic = this.icn3d, me = ic.icn3dui;
@@ -386,33 +391,35 @@
let rmsdThreshold = 10;
// find the best alignment for each chain
- let domainid2score = {}, domainid2segs = {}, chainid2segs = {};
+ let domainid2segs = {}, chainid2segs = {};
if(!ic.chainid2refpdbname) ic.chainid2refpdbname = {};
+ if(!ic.chainid2score) ic.chainid2score = {};
if(!ic.domainid2refpdbname) ic.domainid2refpdbname = {};
+ if(!ic.domainid2score) ic.domainid2score = {};
if(!ic.domainid2ig2kabat) ic.domainid2ig2kabat = {};
if(!ic.domainid2ig2imgt) ic.domainid2ig2imgt = {};
- // ic.chainid2refpdbname = {};
- // ic.domainid2refpdbname = {};
- // ic.domainid2ig2kabat = {};
- // ic.domainid2ig2imgt = {};
-
let minResidues = 20;
for(let i = 0, il = domainidpairArray.length; i < il; ++i) {
//let queryData = (me.bNode) ? dataArray[i] : dataArray[i].value; //[0];
let queryData = dataArray[i].value; //[0];
- if(!queryData) {
+ if(!queryData || queryData.length == 0) {
if(!me.bNode) console.log("The alignment data for " + domainidpairArray[i] + " is unavailable...");
continue;
}
-
- if(queryData.length == 0) continue;
+ //let domainid_index = domainidpairArray[i].split(',');
+ //let domainid = domainid_index[0];
+ let domainid = domainidpairArray[i].substr(0, domainidpairArray[i].indexOf('|'));
+ let refpdbname = domainidpairArray[i].substr(domainidpairArray[i].indexOf('|') + 1);
+ //let chainid = domainid.split('-')[0];
+
if(!bRound1) {
if(queryData[0].score < tmscoreThreshold || queryData[0].num_res < minResidues) {
+ if(!me.bNode) console.log("domainid " + domainid + " and refpdbname " + refpdbname + " were skipped due to a TM-score less than " + tmscoreThreshold);
continue;
}
}
@@ -424,12 +431,6 @@
continue;
}
}
-
- //let domainid_index = domainidpairArray[i].split(',');
- //let domainid = domainid_index[0];
- let domainid = domainidpairArray[i].substr(0, domainidpairArray[i].indexOf('|'));
- let refpdbname = domainidpairArray[i].substr(domainidpairArray[i].indexOf('|') + 1);
- //let chainid = domainid.split('-')[0];
if(!bRound1) {
if(!me.bNode) console.log("refpdbname " + refpdbname + " TM-score: " + queryData[0].score);
@@ -446,16 +447,16 @@
for(let i = 0, il = queryData[0].segs.length; i < il; ++i) {
let seg = queryData[0].segs[i];
- if(seg.q_start.indexOf('2150') != -1 || seg.q_start.indexOf('2250') != -1) {
+ if(seg.q_start.indexOf('2550') != -1) {
bBstrand = true;
}
- else if(seg.q_start.indexOf('3150') != -1 || seg.q_start.indexOf('3250') != -1) {
+ else if(seg.q_start.indexOf('3550') != -1) {
bCstrand = true;
}
- else if(seg.q_start.indexOf('7150') != -1 || seg.q_start.indexOf('7250') != -1) {
+ else if(seg.q_start.indexOf('7550') != -1) {
bEstrand = true;
}
- else if(seg.q_start.indexOf('8150') != -1 || seg.q_start.indexOf('8250') != -1) {
+ else if(seg.q_start.indexOf('8550') != -1) {
bFstrand = true;
}
@@ -466,7 +467,10 @@
//if(!(bBstrand && bCstrand && bEstrand && bFstrand && bGstrand)) continue;
if(!(bBstrand && bCstrand && bEstrand && bFstrand)) {
if(!me.bNode) console.log("Some of the Ig strands B, C, E, F are missing in the domain " + domainid + "...");
- if(ic.domainid2refpdbname[domainid] == refpdbname) delete ic.domainid2refpdbname[domainid];
+ if(ic.domainid2refpdbname[domainid] == refpdbname) {
+ delete ic.domainid2refpdbname[domainid];
+ delete ic.domainid2score[domainid];
+ }
continue;
}
}
@@ -474,8 +478,8 @@
if(!bRound1) {
console.log("domainid: " + domainid);
- if(!domainid2score.hasOwnProperty(domainid) || queryData[0].score > domainid2score[domainid]) {
- domainid2score[domainid] = queryData[0].score;
+ if(!ic.domainid2score.hasOwnProperty(domainid) || queryData[0].score >= ic.domainid2score[domainid]) {
+ ic.domainid2score[domainid] = queryData[0].score;
ic.domainid2refpdbname[domainid] = refpdbname;
domainid2segs[domainid] = queryData[0].segs;
@@ -487,8 +491,8 @@
//let mixScore = 10 / queryData[0].super_rmsd + queryData[0].num_seg / 5;
let mixScore = queryData[0].score;
- if(!domainid2score.hasOwnProperty(domainid) || mixScore > domainid2score[domainid]) {
- domainid2score[domainid] = mixScore;
+ if(!ic.domainid2score.hasOwnProperty(domainid) || mixScore > ic.domainid2score[domainid]) {
+ ic.domainid2score[domainid] = mixScore;
ic.domainid2refpdbname[domainid] = refpdbname;
domainid2segs[domainid] = queryData[0].segs;
@@ -509,7 +513,7 @@
let pdbAjaxArray = [];
let refpdbname = ic.domainid2refpdbname[domainid];
//let pdbid = domainid.substr(0, domainid.indexOf('_'));
- let chainid = domainid.substr(0, domainid.indexOf('-'));
+ let chainid = domainid.substr(0, domainid.indexOf(','));
//if(ic.refpdbHash.hasOwnProperty(pdbid)) {
if(ic.refpdbHash.hasOwnProperty(chainid)) {
@@ -532,8 +536,10 @@
pdbAjaxArray.push(pdbAjax);
}
- let allPromise2 = Promise.allSettled(pdbAjaxArray);
- ic.pdbDataArray = await allPromise2;
+ //let allPromise2 = Promise.allSettled(pdbAjaxArray);
+ //ic.pdbDataArray = await allPromise2;
+
+ ic.pdbDataArray = await this.promiseWithFixedJobs(pdbAjaxArray);
let pdb_target = ic.domainid2pdb[domainid];
for(let index = 0, indexl = ic.pdbDataArray.length; index < indexl; ++index) {
@@ -556,23 +562,7 @@
//let allPromise = Promise.allSettled(ajaxArray);
//dataArray3 = await allPromise;
- //split arrays into chunks of 48 jobs or me.cfg.maxajax jobs
- let n = (me.cfg.maxajax) ? me.cfg.maxajax : ic.refpdbArray.length * 6;
-
- for(let i = 0, il = parseInt((ajaxArray.length - 1) / n + 1); i < il; ++i) {
- let currAjaxArray = []
- if(i == il - 1) { // last one
- currAjaxArray = ajaxArray.slice(i * n, ajaxArray.length);
- }
- else {
- currAjaxArray = ajaxArray.slice(i * n, (i + 1) * n);
- }
-
- let currPromise = Promise.allSettled(currAjaxArray);
- let currDataArray = await currPromise;
-
- dataArray3 = dataArray3.concat(currDataArray);
- }
+ dataArray3 = await this.promiseWithFixedJobs(ajaxArray);
await thisClass.parseAlignData(dataArray3, domainidpairArray3, false);
@@ -583,22 +573,35 @@
// combine domainid into chainid
let processedChainid = {};
for(let domainid in ic.domainid2refpdbname) {
- let chainid = domainid.split('-')[0];
+ // remove the first round template
+ if(ic.domainid2refpdbname[domainid].substr(0,1) == '1') {
+ delete ic.domainid2refpdbname[domainid];
+ delete ic.domainid2score[domainid];
+ continue;
+ }
+
+ let chainid = domainid.split(',')[0];
- if(!processedChainid.hasOwnProperty(chainid)) ic.chainid2refpdbname[chainid] = [];
+ if(!processedChainid.hasOwnProperty(chainid)) {
+ ic.chainid2refpdbname[chainid] = [];
+ ic.chainid2score[chainid] = [];
+ }
processedChainid[chainid] = 1;
if(!ic.chainid2refpdbname.hasOwnProperty(chainid)) ic.chainid2refpdbname[chainid] = [];
ic.chainid2refpdbname[chainid].push(ic.domainid2refpdbname[domainid] + '|' + domainid);
+
+ if(!ic.chainid2score.hasOwnProperty(chainid)) ic.chainid2score[chainid] = [];
+ ic.chainid2score[chainid].push(ic.domainid2score[domainid] + '|' + domainid);
}
-
+
// combine domainid into chainid
for(let domainid in domainid2segs) {
- let chainid = domainid.split('-')[0];
+ let chainid = domainid.split(',')[0];
if(!chainid2segs[chainid]) chainid2segs[chainid] = [];
chainid2segs[chainid] = chainid2segs[chainid].concat(domainid2segs[domainid]);
}
-
+
// assign ic.resid2refnum, ic.refnum2residArray, ic.chainsMapping
if(!ic.resid2refnum) ic.resid2refnum = {};
if(!ic.refnum2residArray) ic.refnum2residArray = {};
@@ -611,11 +614,16 @@
let refpdbnameArray = ic.chainid2refpdbname[chainid];
- let chainList = this.getTemplateList(chainid);
+ let result = this.getTemplateList(chainid);
+ let refpdbnameList = result.refpdbnameList;
+ let scoreList = result.scoreList;
- //if(!me.bNode) console.log("The reference PDB(s) for chain " + chainid + " are " + chainList);
- if(!me.bNode) console.log("The reference PDB(s) for chain " + chainid + " are " + chainList);
- ic.refPdbList.push("The reference PDB(s) for chain " + chainid + " are " + chainList);
+ let message = "The reference PDBs for chain " + chainid + " are " + refpdbnameList + ". The TM-scores are " + scoreList + ".";
+ if(!me.bNode) {
+ console.log(message);
+ me.htmlCls.clickMenuCls.setLogCmd(message, true);
+ }
+ ic.refPdbList.push(message);
let prevStrand;
let bCd19 = refpdbnameArray.length == 1 && refpdbnameArray[0] == 'CD19_6al5A_human_C2orV-n1';
@@ -686,50 +694,52 @@
getLabelFromRefnum(oriRefnum, prevStrand, bCd19) { let ic = this.icn3d, me = ic.icn3dui;
let refnum = parseInt(oriRefnum);
- // A-: 10xx
- // A: 11xx
- // A+ continue A
- // A': 12xx
- // B: 21xx
- // C: 32xx
- // C': 42xx
- // C'': 51xx, 52xx
- // D: 61xx
- // E: 71xx
- // E+: continue E
- // F: 82xx
- // G: 91xx, 92xx
- // G+: continue G
-
- // if(refnum < 100) return " " + oriRefnum;
- // else if(refnum >= 100 && refnum < 1000) {
- // if(bCd19) return " " + oriRefnum;
- // else return "A^" + oriRefnum;
- // }
- if(refnum < 900) return undefined;
- else if(refnum >= 900 && refnum < 1000) return " " + oriRefnum;
- else if(refnum >= 1000 && refnum < 1100) return "A-" + oriRefnum;
- else if(refnum >= 1100 && refnum < 1200) return "A" + oriRefnum; // could be A+
- else if(refnum >= 1200 && refnum < 1300) return "A'" + oriRefnum;
- //else if(refnum >= 1300 && refnum < 1400) return "A+" + oriRefnum;
- else if(refnum >= 1300 && refnum < 2000) {
- if(prevStrand && prevStrand.substr(0, 1) == 'A') {
- return prevStrand + oriRefnum;
- }
- else {
- return "A" + oriRefnum;
- }
- }
- else if(refnum >= 2000 && refnum < 3000) return "B" + oriRefnum;
- else if(refnum >= 3000 && refnum < 4000) return "C" + oriRefnum;
- else if(refnum >= 4000 && refnum < 5000) return "C'" + oriRefnum;
- else if(refnum >= 5000 && refnum < 6000) return "C''" + oriRefnum;
- else if(refnum >= 6000 && refnum < 7000) return "D" + oriRefnum;
- else if(refnum >= 7000 && refnum < 8000) return "E" + oriRefnum; // could be E+
- else if(refnum >= 8000 && refnum < 9000) return "F" + oriRefnum;
- else if(refnum >= 9000 && refnum < 9300) return "G" + oriRefnum; // could be G+
- //else if(refnum >= 9400 && refnum < 9500) return "G+" + oriRefnum;
- else if(refnum >= 9300) return "G" + oriRefnum;
+ //N-terminus = 0999-0001
+ //A--- = 12xx
+ //A-- = 13xx
+ //A- = 14xx
+ //A = 15xx (anchor 1550)
+ //A+ = 16xx
+ //A' = 18xx (anchor 1850)
+ //B = 25xx (anchor 2550)
+ //C-- = 33xx
+ //C- = 34xx
+ //C = 35xx (anchor 3550)
+ //C' = 45xx (anchor 4550)
+ //C'' = 55xx (anchor 5550)
+ //D = 65xx (anchor 3550)
+ //E = 75xx (anchor 7550)
+ //E+ = 76xx
+ //F = 85xx (anchor 8550)
+ //G = 95xx (anchor 9550)
+ //G+ = 96xx
+ //G++ = 97xx
+ //C-terminus = 9901-9999 (no anchor, numbering going forward)
+
+ // loops may have numbers such as 1310, 1410
+
+ if(refnum < 1000) return undefined;
+ else if(refnum >= 1200 && refnum < 1290) return "A---" + oriRefnum;
+ else if(refnum >= 1320 && refnum < 1390) return "A--" + oriRefnum;
+ else if(refnum >= 1420 && refnum < 1490) return "A-" + oriRefnum;
+ else if(refnum >= 1520 && refnum < 1590) return "A" + oriRefnum;
+ else if(refnum >= 1620 && refnum < 1690) return "A+" + oriRefnum;
+ else if(refnum >= 1820 && refnum < 1890) return "A'" + oriRefnum;
+ else if(refnum >= 2000 && refnum < 2900) return "B" + oriRefnum;
+ else if(refnum >= 3300 && refnum < 3390) return "C--" + oriRefnum;
+ else if(refnum >= 3420 && refnum < 3490) return "C-" + oriRefnum;
+ else if(refnum >= 3520 && refnum < 3590) return "C" + oriRefnum;
+ else if(refnum >= 4000 && refnum < 4900) return "C'" + oriRefnum;
+ else if(refnum >= 5000 && refnum < 5900) return "C''" + oriRefnum;
+ else if(refnum >= 6000 && refnum < 6900) return "D" + oriRefnum;
+ else if(refnum >= 7500 && refnum < 7590) return "E" + oriRefnum;
+ else if(refnum >= 7620 && refnum < 7900) return "E+" + oriRefnum;
+ else if(refnum >= 8000 && refnum < 8900) return "F" + oriRefnum;
+ else if(refnum >= 9500 && refnum < 9590) return "G" + oriRefnum;
+ else if(refnum >= 9620 && refnum < 9690) return "G+" + oriRefnum;
+ else if(refnum >= 9720 && refnum < 9790) return "G++" + oriRefnum;
+ else if(refnum > 9900) return undefined;
+ else return " " + oriRefnum;;
}
async parseCustomRefFile(data) { let ic = this.icn3d, me = ic.icn3dui;
@@ -912,6 +922,32 @@
return refData;
}
}
+
+ async promiseWithFixedJobs(ajaxArray) { let ic = this.icn3d, me = ic.icn3dui;
+ let dataArray3 = [];
+ //let allPromise = Promise.allSettled(ajaxArray);
+ //dataArray3 = await allPromise;
+
+ //split arrays into chunks of 48 jobs or me.cfg.maxajax jobs
+ let n = (me.cfg.maxajax) ? me.cfg.maxajax : ic.refpdbArray.length * 6;
+
+ for(let i = 0, il = parseInt((ajaxArray.length - 1) / n + 1); i < il; ++i) {
+ let currAjaxArray = []
+ if(i == il - 1) { // last one
+ currAjaxArray = ajaxArray.slice(i * n, ajaxArray.length);
+ }
+ else {
+ currAjaxArray = ajaxArray.slice(i * n, (i + 1) * n);
+ }
+
+ let currPromise = Promise.allSettled(currAjaxArray);
+ let currDataArray = await currPromise;
+
+ dataArray3 = dataArray3.concat(currDataArray);
+ }
+
+ return dataArray3;
+ }
}
export {Refnum}
diff --git a/src/icn3d/annotations/annoDomain.js b/src/icn3d/annotations/annoDomain.js
index 30ff37d2..c38ce958 100644
--- a/src/icn3d/annotations/annoDomain.js
+++ b/src/icn3d/annotations/annoDomain.js
@@ -98,6 +98,10 @@ class AnnoDomain {
let domainArray, proteinname;
let pos = chnid.indexOf('_');
let chain = chnid.substr(pos + 1);
+ // MMDB symmetry chain has the form of 'A1'
+ if(chain.length > 1 && chain.substr(chain.length - 1) == '1') {
+ chain = chain.substr(0, chain.length - 1);
+ }
if(bCalcDirect) {
proteinname = chnid;
diff --git a/src/icn3d/annotations/domain3d.js b/src/icn3d/annotations/domain3d.js
index 3ad9f978..77e32e35 100644
--- a/src/icn3d/annotations/domain3d.js
+++ b/src/icn3d/annotations/domain3d.js
@@ -10,7 +10,8 @@ class Domain3d {
//this.dcut = 8; // threshold for C-alpha interactions
// It seemed the threshold 7 angstrom works better
- this.dcut = 7; // threshold for C-alpha interactions
+ //this.dcut = 7; // threshold for C-alpha interactions
+ this.dcut = 8; // threshold for C-alpha interactions
this.MAX_SSE = 512;
diff --git a/src/icn3d/annotations/showAnno.js b/src/icn3d/annotations/showAnno.js
index 52e24d44..86f52561 100644
--- a/src/icn3d/annotations/showAnno.js
+++ b/src/icn3d/annotations/showAnno.js
@@ -71,6 +71,10 @@ class ShowAnno {
chainLetter = chainLetter.substr(0, chainLetter.indexOf('_'));
chainidBase = chainArray[i].substr(0, chainArray[i].indexOf('_')) + '_' + chainLetter;
}
+ else if(chainLetter.length > 1 && chainLetter.substr(chainLetter.length - 1) == '1') { // NCBI modified chainid, e.g., A1
+ chainLetter = chainLetter.substr(0, chainLetter.length - 1);
+ chainidBase = chainArray[i].substr(0, chainArray[i].indexOf('_')) + '_' + chainLetter;
+ }
else {
chainidBase = chainArray[i];
}
diff --git a/src/icn3d/annotations/showSeq.js b/src/icn3d/annotations/showSeq.js
index 15f8e0ec..d4a0b807 100644
--- a/src/icn3d/annotations/showSeq.js
+++ b/src/icn3d/annotations/showSeq.js
@@ -461,7 +461,7 @@ class ShowSeq {
html += '';
html3 += '';
}
-
+
if(ic.bShowRefnum && ic.chainid2refpdbname.hasOwnProperty(chnid) && ic.chainid2refpdbname[chnid].length > 0) {
let result = this.showAllRefNum(giSeq, chnid);
@@ -530,9 +530,11 @@ class ShowSeq {
if(!ic.chainid2refpdbname[chnid]) return {html: html, html3: html3};
- let chainList = ic.refnumCls.getTemplateList(chnid);
+ let result = ic.refnumCls.getTemplateList(chnid);
+ let refpdbnameList = result.refpdbnameList;
+ let scoreList = result.scoreList;
- let refStruTitle = (chainList) ? "based on " + chainList : "";
+ let refStruTitle = (refpdbnameList) ? "based on " + refpdbnameList + ". The TM-scores are " + scoreList + "." : "";
let htmlTmp = '
Linker": "",
"C'' Strand": "FF0000",
"
Protodomain 2": "",
"D Strand": "0000FF",
"E Strand": "006400",
- "F Strand": "F7DC6F", //"FFFF00", //"F0E68C",
- "G Strand": "FFA500",
+ "F Strand": "FFD700", //"FFFF00", //"F0E68C",
+ "G Strand": "FF8C00",
"": "",
"Loop": "CCCCCC"
};
diff --git a/src/icn3d/highlight/hlUpdate.js b/src/icn3d/highlight/hlUpdate.js
index 3badcb87..c418cbeb 100644
--- a/src/icn3d/highlight/hlUpdate.js
+++ b/src/icn3d/highlight/hlUpdate.js
@@ -118,8 +118,8 @@ class HlUpdate {
updateHlObjects(bForceHighlight) { let ic = this.icn3d, me = ic.icn3dui;
ic.hlObjectsCls.removeHlObjects();
- if((ic.hAtoms && ic.atoms && Object.keys(ic.hAtoms).length < Object.keys(ic.atoms).length) || bForceHighlight) {
- ic.hlObjectsCls.addHlObjects();
+ if((ic.hAtoms && ic.atoms && Object.keys(ic.hAtoms).length < Object.keys(ic.dAtoms).length) || bForceHighlight) {
+ if(ic.bShowHighlight === undefined || ic.bShowHighlight) ic.hlObjectsCls.addHlObjects();
ic.definedSetsCls.setMode('selection');
}
}
diff --git a/src/icn3d/parsers/chainalignParser.js b/src/icn3d/parsers/chainalignParser.js
index 3a186682..e33b6d9c 100644
--- a/src/icn3d/parsers/chainalignParser.js
+++ b/src/icn3d/parsers/chainalignParser.js
@@ -126,6 +126,8 @@ class ChainalignParser {
let queryData = {}; // check whether undefined
+ me.htmlCls.clickMenuCls.setLogCmd("Align " + mmdbid_t + " with " + mmdbid_q, false);
+
this.processAlign(align, index, queryData, bEqualMmdbid, bEqualChain);
}
@@ -223,6 +225,8 @@ class ChainalignParser {
continue;
}
+ me.htmlCls.clickMenuCls.setLogCmd("Align " + mmdbid1 + " with " + mmdbid2, false);
+
let bNoAlert = true;
let bAligned = this.processAlign(align, i, queryData, bEqualMmdbid, bEqualChain, bNoAlert);
@@ -678,6 +682,8 @@ class ChainalignParser {
let bEqualMmdbid = (mmdbid_q == mmdbid_t);
let bEqualChain = (chain_q == chain_t);
+ me.htmlCls.clickMenuCls.setLogCmd("Align " + mmdbid_t + " with " + mmdbid_q, false);
+
this.processAlign(align, index-1, queryData, bEqualMmdbid, bEqualChain);
}
}
@@ -738,6 +744,7 @@ class ChainalignParser {
ic.qt_start_end[index] = align[0].segs;
let rmsd = align[0].super_rmsd;
+console.log()
let logStr = "alignment RMSD: " + rmsd.toPrecision(4);
if(me.cfg.aligntool == 'tmalign') logStr += "; TM-score: " + align[0].score.toPrecision(4);
diff --git a/src/icn3d/parsers/densityCifParser.js b/src/icn3d/parsers/densityCifParser.js
index 6cbaec97..e928e968 100644
--- a/src/icn3d/parsers/densityCifParser.js
+++ b/src/icn3d/parsers/densityCifParser.js
@@ -9,7 +9,7 @@ class DensityCifParser {
this.icn3d = icn3d;
}
- async densityCifParser(pdbid, type, sigma, emd) { let ic = this.icn3d, me = ic.icn3dui;
+ async densityCifParser(pdbid, type, sigma, emd, bOutput) { let ic = this.icn3d, me = ic.icn3dui;
let thisClass = this;
let url;
diff --git a/src/icn3d/parsers/dsn6Parser.js b/src/icn3d/parsers/dsn6Parser.js
index 8d6bb53f..593cf059 100644
--- a/src/icn3d/parsers/dsn6Parser.js
+++ b/src/icn3d/parsers/dsn6Parser.js
@@ -237,7 +237,7 @@ class Dsn6Parser {
return matrix;
}
- loadDsn6File(type) {var ic = this.icn3d, me = ic.icn3dui;
+ loadDsn6File(type, bCcp4) {var ic = this.icn3d, me = ic.icn3dui;
let thisClass = this;
let file = $("#" + ic.pre + "dsn6file" + type)[0].files[0];
@@ -250,7 +250,13 @@ class Dsn6Parser {
let reader = new FileReader();
reader.onload = function(e) { let ic = thisClass.icn3d;
let arrayBuffer = e.target.result; // or = reader.result;
- thisClass.loadDsn6Data(arrayBuffer, type, sigma);
+ if(bCcp4) {
+ ic.densityCifParserCls.parseChannels(arrayBuffer, type, sigma);
+ }
+ else {
+ thisClass.loadDsn6Data(arrayBuffer, type, sigma);
+ }
+
if(type == '2fofc') {
ic.bAjax2fofc = true;
}
@@ -258,7 +264,7 @@ class Dsn6Parser {
ic.bAjaxfofc = true;
}
ic.setOptionCls.setOption('map', type);
- me.htmlCls.clickMenuCls.setLogCmd('load dsn6 file ' + $("#" + ic.pre + "dsn6file" + type).val(), false);
+ me.htmlCls.clickMenuCls.setLogCmd('load map file ' + $("#" + ic.pre + "dsn6file" + type).val(), false);
}
reader.readAsArrayBuffer(file);
}
diff --git a/src/icn3d/picking/picking.js b/src/icn3d/picking/picking.js
index 7b2291be..b7a876f0 100644
--- a/src/icn3d/picking/picking.js
+++ b/src/icn3d/picking/picking.js
@@ -26,13 +26,25 @@ class Picking {
y += me.htmlCls.MENU_HEIGHT;
}
let text =(ic.pk == 1) ? atom.resn + atom.resi + '@' + atom.name : atom.resn + atom.resi;
+ let chainid = atom.structure + '_' + atom.chain;
+ let textWidth;
if(ic.structures !== undefined && Object.keys(ic.structures).length > 1) {
- text = atom.structure + '_' + atom.chain + ' ' + text;
- $("#" + ic.pre + "popup").css("width", "160px");
+ text = chainid + ' ' + text;
+ textWidth = (ic.chainid2refpdbname && ic.chainid2refpdbname[chainid]) ? 160 + 80 : 160;
+ $("#" + ic.pre + "popup").css("width", textWidth + "px");
}
else {
- $("#" + ic.pre + "popup").css("width", "80px");
+ textWidth = (ic.chainid2refpdbname && ic.chainid2refpdbname[chainid]) ? 80 + 80 : 80;
+ $("#" + ic.pre + "popup").css("width", textWidth + "px");
}
+
+
+ if(ic.chainid2refpdbname && ic.chainid2refpdbname[chainid]) {
+ let refnumLabel = ic.resid2refnum[chainid + '_' + atom.resi];
+
+ if(refnumLabel) text += ', Ig: ' + refnumLabel;
+ }
+
$("#" + ic.pre + "popup").html(text);
$("#" + ic.pre + "popup").css("top", y).css("left", x+20).show();
}
diff --git a/src/icn3d/selection/loadScript.js b/src/icn3d/selection/loadScript.js
index f69fb2c4..5f60caca 100644
--- a/src/icn3d/selection/loadScript.js
+++ b/src/icn3d/selection/loadScript.js
@@ -89,7 +89,7 @@ class LoadScript {
let bFinalStep =(i === steps - 1) ? true : false;
if(!ic.commands[i].trim()) continue;
- let nAtoms = Object.keys(ic.atoms).length;
+ let nAtoms = (ic.atoms) ? Object.keys(ic.atoms).length : 0;
if(nAtoms == 0 && ic.commands[i].indexOf('load') == -1) continue;