(function(ka,C,n,A,v,x,y,F,H,W,P,Q,G,T,E,S,R,ba,ca,da,ea,aa,fa,ga,ha,la,ma,$,X,na,ia,Y,oa,pa,Z,qa,ja,ra,sa,ta,ua,va,wa,xa,ya,za,Aa,Ba,Ca,Da,Ea,Fa,e,h){n("J.adapter.readers.pdb");v(["J.adapter.smarter.AtomSetCollectionReader","java.util.Hashtable"],"J.adapter.readers.pdb.PdbReader","java.lang.Boolean $.Character $.Float JU.Lst $.M4 $.P3 $.PT $.SB J.adapter.smarter.Atom $.Structure J.api.Interface $.JmolAdapter J.c.STR JU.Escape $.Logger".split(" "),function(){c$=y(function(){this.lineLength=this.serial=
this.seqMode=this.serMode=0;this.pdbHeader=null;this.isPQR=this.gromacsWideFormat=this.isLegacyModelType=this.isConnectStateBug=this.haveMappedSerials=this.isMultiModel=this.getTlsGroups=this.applySymmetry=!1;this.sb=this.sbConect=this.sbSelected=this.sbIgnored=this.chainAtomCounts=this.sbTlsErrors=this.vTlsModels=this.vBiomolecules=this.thisBiomolecule=this.vCompnds=this.htMolIds=this.htElementsInCurrentGroup=this.htSites=this.htHetero=this.htFormul=null;this.nRes=this.nUNK=this.maxSerial=this.ac=
0;this.currentKey=this.currentGroup3=this.currentCompnd=null;this.configurationPtr=this.currentResno=-2147483648;this.resetKey=!0;this.$compnd=null;this.fileAtomIndex=this.conformationIndex=0;this.lastAltLoc="\x00";this.lastGroup=-2147483648;this.lastInsertion="\x00";this.lastTargetSerial=this.lastSourceSerial=-2147483648;this.atomTypeLen=this.atomTypePt0=this.tlsGroupID=0;this.isConcatenated=this.isbiomol=this.isCourseGrained=!1;this.htGroup1=null;this.haveDoubleBonds=!1;this.vConnect=this.tlsU=
this.dataT=null;this.connectNextAtomSet=this.connectNextAtomIndex=0;this.connectLast=null;x(this,arguments)},J.adapter.readers.pdb,"PdbReader",J.adapter.smarter.AtomSetCollectionReader);S(c$,function(){this.htFormul=new java.util.Hashtable;this.dataT=T(8,0)});h(c$,"initializeReader",function(){this.allowPDBFilter=!0;this.pdbHeader=this.getHeader?new JU.SB:null;this.applySymmetry=!this.checkFilterKey("NOSYMMETRY");this.getTlsGroups=this.checkFilterKey("TLS");this.checkFilterKey("ASSEMBLY")&&(this.filter=
JU.PT.rep(this.filter,"ASSEMBLY","BIOMOLECULE"));var a=(this.isbiomol=this.checkFilterKey("BIOMOLECULE"))&&this.checkFilterKey("BYCHAIN"),b=this.isbiomol&&this.checkFilterKey("BYSYMOP");(this.isCourseGrained=a||b)||this.setIsPDB();this.isConcatenated=this.htParams.containsKey("concatenate")||this.filePath.endsWith(".dssr");this.htParams.containsKey("vTlsModels")&&(this.vTlsModels=this.htParams.remove("vTlsModels"));a=this.getFilter("TYPE ");null!=a&&(a=JU.PT.getTokens(a.$replace(","," ")),this.atomTypePt0=
Integer.parseInt(a[0])-1,b=a[1].indexOf("="),0<=b?this.setFilterAtomTypeStr(a[1].substring(b+1).toUpperCase()):b=a[1].length,this.atomTypeLen=Integer.parseInt(a[1].substring(0,b)));a=this.getFilter("CONF ");null!=a&&(this.configurationPtr=this.parseIntStr(a),this.sbIgnored=new JU.SB,this.sbSelected=new JU.SB);this.isLegacyModelType=12E4>this.stateScriptVersionInt;this.isConnectStateBug=120151<=this.stateScriptVersionInt&&120220>=this.stateScriptVersionInt||120300<=this.stateScriptVersionInt&&120320>=
this.stateScriptVersionInt});h(c$,"checkLine",function(){var a=(6>(this.lineLength=this.line.length)?-1:"ATOM    HETATM  MODEL   CONECT  HELIX   SHEET   TURN    HET     HETNAM  ANISOU  SITE    CRYST1  SCALE1  SCALE2  SCALE3  EXPDTA  FORMUL  REMARK  HEADER  COMPND  SOURCE  TITLE   SEQADV  ".indexOf(this.line.substring(0,6)))>>3,b=0==a||1==a,c=2==a;this.serial=b?this.getSerial(6,11):0;var d=(this.isTrajectory||this.isSequential)&&!this.isMultiModel&&b&&1==this.serial;this.getHeader&&(b||c?this.getHeader=
!1:this.readHeader(!1));if(c||d){this.isMultiModel=c;this.getHeader=!1;c=d?this.modelNumber+1:this.getModelNumber();this.modelNumber=null==this.bsModels?c:this.modelNumber+1;if(!this.doGetModel(this.modelNumber,null))return this.handleTlsMissingModels(),a=this.checkLastModel(),!a&&this.isConcatenated&&(a=this.continuing=!0),a;this.isCourseGrained||this.connectAll(this.maxSerial,this.isConnectStateBug);0<this.ac&&this.applySymmetryAndSetTrajectory();this.model(c);if(this.isLegacyModelType||!b)return!0}if(this.isMultiModel&&
!this.doProcessLines)return this.isConcatenated&&this.checkDSSR(),!0;if(b)return this.getHeader=!1,this.atom(),!0;switch(a){case 3:this.conect();break;case 4:case 5:case 6:this.structure();break;case 7:this.het();break;case 8:this.hetnam();break;case 9:this.anisou();break;case 10:this.site();break;case 11:this.cryst1();break;case 12:case 13:case 14:this.scale(a-11);break;case 15:this.expdta();break;case 16:this.formul();break;case 17:if(this.line.contains("The B-factors in this file hold atomic radii")){this.isPQR=
!0;break}if(this.line.contains("This file does not adhere to the PDB standard")){this.gromacsWideFormat=!0;break}if(this.line.startsWith("REMARK 350"))return this.remark350(),!1;if(this.line.startsWith("REMARK 290"))return this.remark290(),!1;if(this.getTlsGroups&&0<this.line.indexOf("TLS DETAILS"))return this.remarkTls();this.checkCurrentLineForScript();break;case 18:this.header();break;case 19:case 20:this.compnd(20==a);break;case 21:this.title();break;case 22:this.seqAdv();break;default:this.checkDSSR()}return!0});
e(c$,"checkDSSR",function(){this.line.trim().startsWith("DSSR:")&&0<this.asc.ac&&this.processDSSR(this,this.htGroup1)});e(c$,"seqAdv",function(){var a=this.line.substring(39,42).trim().toLowerCase();if(1==a.length){null==this.htGroup1&&this.asc.setInfo("htGroup1",this.htGroup1=new java.util.Hashtable);var b=this.line.substring(12,15).trim();this.htGroup1.put(b,a)}});e(c$,"readHeader",function(a){if(a&&(this.rd(),!this.getHeader))return this.line;this.pdbHeader.append(this.line).appendC("\n");return this.line},
"~B");h(c$,"finalizeReader",function(){this.finalizeReaderPDB()});e(c$,"finalizeReaderPDB",function(){this.checkNotPDB();this.isCourseGrained||this.connectAll(this.maxSerial,this.isConnectStateBug);var a;null!=this.vBiomolecules&&(0<this.vBiomolecules.size()&&0<this.asc.ac)&&(this.asc.setAtomSetAuxiliaryInfo("biomolecules",this.vBiomolecules),this.setBiomoleculeAtomCounts(),null!=this.thisBiomolecule&&this.applySymmetry&&(this.asc.getXSymmetry().applySymmetryBio(this.thisBiomolecule,this.notionalUnitCell,
this.applySymmetryToBonds,this.filter),this.vTlsModels=null,this.asc.xtalSymmetry=null));if(null!=this.vTlsModels){a=J.api.Interface.getSymmetry();var b=this.asc.atomSetCount;if(b==this.vTlsModels.size())for(;0<=--b;)this.setTlsGroups(b,b,a);else if(JU.Logger.info(b+" models but "+this.vTlsModels.size()+" TLS descriptions"),1==this.vTlsModels.size())for(JU.Logger.info(" -- assuming all models have the same TLS description -- check REMARK 3 for details.");0<=--b;)this.setTlsGroups(0,b,a);this.checkForResidualBFactors(a)}null!=
this.sbTlsErrors&&(this.asc.setInfo("tlsErrors",this.sbTlsErrors.toString()),this.appendLoadNote(this.sbTlsErrors.toString()));this.doCheckUnitCell=(new Boolean(this.doCheckUnitCell&(this.iHaveUnitCell&&(this.doApplySymmetry||this.isbiomol)))).valueOf();this.finalizeReaderASCR();null!=this.vCompnds&&this.asc.setInfo("compoundSource",this.vCompnds);null!=this.htSites&&this.addSites(this.htSites);null!=this.pdbHeader&&this.asc.setInfo("fileHeader",this.pdbHeader.toString());0<this.configurationPtr&&
(JU.Logger.info(this.sbSelected.toString()),JU.Logger.info(this.sbIgnored.toString()))});e(c$,"checkForResidualBFactors",function(a){for(var b=this.asc.atoms,c=!1,d=this.asc.ac;0<=--d;){var f=this.tlsU.get(b[d]);if(null!=f){var g=f[7]-(f[0]+f[1]+f[2])/3;if(0>g||Float.isNaN(g)){c=!0;break}}}JU.Logger.info("TLS analysis suggests Bfactors are "+(c?"":"NOT")+" residuals");for(var k,b=this.tlsU.entrySet().iterator();b.hasNext()&&((k=b.next())||1);)f=k.getValue(),g=f[7],0!=g&&(c||(g-=(f[0]+f[1]+f[2])/3),
f[0]+=g,f[1]+=g,f[2]+=g,k.getKey().addTensor(a.getTensor(f).setType(null),"TLS-R",!1),JU.Logger.info("TLS-U:  "+JU.Escape.eAF(f)),f=k.getKey().anisoBorU,null!=f&&JU.Logger.info("ANISOU: "+JU.Escape.eAF(f)));this.tlsU=null},"J.api.SymmetryInterface");e(c$,"header",function(){if(!(8>this.lineLength)){this.appendLoadNote(this.line.substring(7).trim());var a=66<=this.lineLength?this.line.substring(62,66).trim():"";4==a.length&&(this.asc.setCollectionName(a),this.asc.setInfo("havePDBHeaderName",Boolean.TRUE));
50<this.lineLength&&(this.line=this.line.substring(0,50));this.asc.setInfo("CLASSIFICATION",this.line.substring(7).trim())}});e(c$,"title",function(){10>this.lineLength||this.appendLoadNote(this.line.substring(10).trim())});e(c$,"compnd",function(a){if(!a){this.$compnd=null==this.$compnd?"":this.$compnd+" ";var b=this.line;62<this.lineLength&&(b=b.substring(0,62));this.$compnd+=b.substring(10).trim();this.asc.setInfo("COMPND",this.$compnd)}if(null==this.vCompnds){if(a)return;this.vCompnds=new JU.Lst;
this.htMolIds=new java.util.Hashtable;this.currentCompnd=new java.util.Hashtable;this.currentCompnd.put("select","(*)");this.currentKey="MOLECULE";this.htMolIds.put("",this.currentCompnd)}a&&this.resetKey&&(this.resetKey=!1,this.currentKey="SOURCE",this.currentCompnd=this.htMolIds.get(""));this.line=this.line.substring(10,Math.min(this.lineLength,72)).trim();var c=this.line.indexOf(":");if(0>c||0<c&&"\\"==this.line.charAt(c-1))c=this.line.length;b=this.line.substring(0,c).trim();c=c<this.line.length?
this.line.substring(c+1):null;if(b.equals("MOL_ID")){if(null==c)return;if(a){this.currentCompnd=this.htMolIds.remove(c);return}this.currentCompnd=new java.util.Hashtable;this.vCompnds.addLast(this.currentCompnd);this.htMolIds.put(c,this.currentCompnd)}null!=this.currentCompnd&&(null==c?(c=this.currentCompnd.get(this.currentKey),null==c&&(c=""),c+=b,0==this.vCompnds.size()&&this.vCompnds.addLast(this.currentCompnd)):this.currentKey=b,c.endsWith(";")&&(c=c.substring(0,c.length-1)),this.currentCompnd.put(this.currentKey,
c),this.currentKey.equals("CHAIN")&&this.currentCompnd.put("select","(:"+JU.PT.rep(JU.PT.rep(c,", ",",:")," ","")+")"))},"~B");e(c$,"setBiomoleculeAtomCounts",function(){for(var a=this.vBiomolecules.size();0<=--a;){for(var b=this.vBiomolecules.get(a),c=b.get("chains"),d=b.get("biomts").size(),f=0,g=c.length-1;0<=--g;)":"==c.charAt(g)&&(f+=this.chainAtomCounts[c.charCodeAt(g+1)]);b.put("atomCount",Integer.$valueOf(f*d))}});e(c$,"remark350",function(){var a=null;this.vBiomolecules=new JU.Lst;this.chainAtomCounts=
Q(255,0);for(var b="",c="",d="",f=!0,g=null,k=0,e=JU.M4.newM4(null);;){f?this.readHeader(!0):f=!0;if(null==this.line||!this.line.startsWith("REMARK 350"))break;try{if(this.line.startsWith("REMARK 350 BIOMOLECULE:")&&(0<k&&JU.Logger.info("biomolecule "+d+": number of transforms: "+k),g=new java.util.Hashtable,a=new JU.Lst,d=this.line.substring(this.line.indexOf(":")+1).trim(),b=this.line.trim(),g.put("name","biomolecule "+d),g.put("molecule",3==d.length?d:Integer.$valueOf(this.parseIntStr(d))),g.put("title",
b),g.put("chains",""),g.put("biomts",a),this.vBiomolecules.addLast(g),k=0),0<=this.line.indexOf("APPLY THE FOLLOWING TO CHAINS:"))if(null==g)f=!1,this.line="REMARK 350 BIOMOLECULE: 1  APPLY THE FOLLOWING TO CHAINS:";else{var j=this.line.substring(41).trim();this.appendLoadNote("found biomolecule "+d+": "+j);c=":"+j.$replace(" ",":");for(f=!1;null!=this.readHeader(!0)&&0>this.line.indexOf("BIOMT")&&7==this.line.indexOf("350");)c+=":"+this.line.substring(11).trim().$replace(" ",":");this.checkFilterKey("BIOMOLECULE "+
d+";")&&(this.setFilter(this.filter.$replace(":","_")+c),JU.Logger.info('filter set to "'+this.filter+'"'),this.thisBiomolecule=g);g.put("chains",c)}else if(this.line.startsWith("REMARK 350   BIOMT1 ")){k++;for(var l=T(16,0),m=0;12>m;){var p=this.getTokens();l[m++]=this.parseFloatStr(p[4]);l[m++]=this.parseFloatStr(p[5]);l[m++]=this.parseFloatStr(p[6]);l[m++]=this.parseFloatStr(p[7]);(4==m||8==m)&&this.readHeader(!0)}l[15]=1;var h=new JU.M4;h.setA(l);h.equals(e)?a.add(0,h):a.addLast(h)}}catch(u){if(P(u,
Exception)){this.vBiomolecules=this.thisBiomolecule=null;return}throw u;}}0<k&&JU.Logger.info("biomolecule "+d+": number of transforms: "+k)});e(c$,"remark290",function(){for(;null!=this.readHeader(!0)&&this.line.startsWith("REMARK 290");)if(0<=this.line.indexOf("NNNMMM   OPERATOR"))for(;null!=this.readHeader(!0);){var a=this.getTokens();if(4>a.length)break;(this.doApplySymmetry||this.isbiomol)&&this.setSymmetryOperator(a[3])}});e(c$,"getSerial",function(a,b){var c=this.line.charAt(a),d=" "==c||" "==
this.line.charAt(b-1);switch(this.serMode){default:case 0:if(d)return this.parseIntRange(this.line,a,b);try{return this.serial=Integer.parseInt(this.line.substring(a,b))}catch(f){if(P(f,Exception))return this.serMode=Character.isDigit(c)?1:2,this.getSerial(a,b);throw f;}case 2:return d||Character.isDigit(c)?this.parseIntRange(this.line,a,b):JU.PT.parseIntRadix(this.line.substring(a,b),36)+(Character.isUpperCase(c)?-16696160:26973856);case 1:if(!d)return this.serial=JU.PT.parseIntRadix(this.line.substring(a,
b),16);this.serMode=0;return this.getSerial(a,b)}},"~N,~N");e(c$,"getSeqNo",function(a,b){var c=this.line.charAt(a),d=" "==c||" "==this.line.charAt(b-1);switch(this.seqMode){default:case 0:if(d)return this.parseIntRange(this.line,a,b);try{return Integer.parseInt(this.line.substring(a,b))}catch(f){if(P(f,Exception))return this.seqMode=Character.isDigit(c)?1:2,this.getSeqNo(a,b);throw f;}case 2:return d||Character.isDigit(c)?this.parseIntRange(this.line,a,b):JU.PT.parseIntRadix(this.line.substring(a,
b),36)+(Character.isUpperCase(c)?-456560:756496);case 1:if(!d)return JU.PT.parseIntRadix(this.line.substring(a,b),16);this.seqMode=0;return this.getSeqNo(a,b)}},"~N,~N");e(c$,"processAtom",function(a,b,c,d,f,g,k,e,j){a.atomName=b;b=c;" "!=b&&(a.altLoc=b);a.group3=d;b=256>f?String.fromCharCode(f):0;null!=this.chainAtomCounts&&this.chainAtomCounts[b.charCodeAt(0)]++;this.setChainID(a,b);a.sequenceNumber=g;a.insertionCode=J.api.JmolAdapter.canonizeInsertionCode(k);a.isHetero=e;a.elementSymbol=j;return a},
"J.adapter.smarter.Atom,~S,~S,~S,~N,~N,~S,~B,~S");e(c$,"processAtom2",function(a,b,c,d,f,g){a.atomSerial=b;b>this.maxSerial&&(this.maxSerial=b);if(null==a.group3)null!=this.currentGroup3&&(this.currentGroup3=null,this.currentResno=-2147483648,this.htElementsInCurrentGroup=null);else if(!a.group3.equals(this.currentGroup3)||a.sequenceNumber!=this.currentResno)this.currentGroup3=a.group3,this.currentResno=a.sequenceNumber,this.htElementsInCurrentGroup=this.htFormul.get(a.group3),this.nRes++,a.group3.equals("UNK")&&
this.nUNK++;this.setAtomCoordXYZ(a,c,d,f);a.formalCharge=g;this.setAdditionalAtomParameters(a);this.haveMappedSerials?this.asc.addAtomWithMappedSerialNumber(a):this.asc.addAtom(a);0==this.ac++&&!this.isCourseGrained&&this.asc.setAtomSetAuxiliaryInfo("isPDB",Boolean.TRUE);a.isHetero&&null!=this.htHetero&&(this.asc.setAtomSetAuxiliaryInfo("hetNames",this.htHetero),this.htHetero=null)},"J.adapter.smarter.Atom,~N,~N,~N,~N,~N");e(c$,"atom",function(){var a=this.line.startsWith("HETATM"),a=this.processAtom(new J.adapter.smarter.Atom,
this.line.substring(12,16).trim(),this.line.charAt(16),this.parseTokenRange(this.line,17,20),this.line.charCodeAt(21),this.getSeqNo(22,26),this.line.charAt(26),a,this.deduceElementSymbol(a));if(0<this.atomTypeLen){var b=this.line.substring(this.atomTypePt0,this.atomTypePt0+this.atomTypeLen).trim();0<b.length&&(a.atomName+="\x00"+b)}if(this.filterPDBAtom(a,this.fileAtomIndex++)){var b=0,c,d,f;if(this.gromacsWideFormat)c=this.parseFloatRange(this.line,30,40),d=this.parseFloatRange(this.line,40,50),
f=this.parseFloatRange(this.line,50,60);else{if(80<=this.lineLength&&(c=this.line.charAt(78),d=this.line.charAt(79),"0"<=d&&"7">=d&&(f=d,d=c,c=f),("+"==d||"-"==d||" "==d)&&"0"<=c&&"7">=c))b=c.charCodeAt(0)-48,"-"==d&&(b=-b);c=this.parseFloatRange(this.line,30,38);d=this.parseFloatRange(this.line,38,46);f=this.parseFloatRange(this.line,46,54)}this.processAtom2(a,this.serial,c,d,f,b)}});e(c$,"filterPDBAtom",function(a,b){if(!this.filterAtom(a,b))return!1;if(0<this.configurationPtr){if(a.sequenceNumber!=
this.lastGroup||a.insertionCode!=this.lastInsertion)this.conformationIndex=this.configurationPtr-1,this.lastGroup=a.sequenceNumber,this.lastInsertion=a.insertionCode,this.lastAltLoc="\x00";if("\x00"!=a.altLoc){var c=" atom ["+a.group3+"]"+a.sequenceNumber+("\x00"==a.insertionCode?"":"^"+a.insertionCode)+(0==a.chainID?"":":"+this.vwr.getChainIDStr(a.chainID))+"."+a.atomName+"%"+a.altLoc+"\n";0<=this.conformationIndex&&a.altLoc!=this.lastAltLoc&&(this.lastAltLoc=a.altLoc,this.conformationIndex--);if(0>
this.conformationIndex&&a.altLoc!=this.lastAltLoc)return this.sbIgnored.append("ignoring").append(c),!1;this.sbSelected.append("loading").append(c)}}return!0},"J.adapter.smarter.Atom,~N");e(c$,"setAdditionalAtomParameters",function(a){if(this.isPQR)if(this.gromacsWideFormat)a.partialCharge=this.parseFloatRange(this.line,60,68),a.radius=J.adapter.readers.pdb.PdbReader.fixRadius(this.parseFloatRange(this.line,68,76));else{var b=this.getTokens(),c=b.length-2-(75<this.line.length?1:0);a.partialCharge=
this.parseFloatStr(b[c++]);a.radius=J.adapter.readers.pdb.PdbReader.fixRadius(this.parseFloatStr(b[c]))}else this.gromacsWideFormat?(b=this.parseFloatRange(this.line,60,68),a.bfactor=J.adapter.readers.pdb.PdbReader.fixRadius(this.parseFloatRange(this.line,68,76))):(b=this.parseFloatRange(this.line,54,60),a.bfactor=this.parseFloatRange(this.line,60,66)),a.foccupancy=Float.isNaN(b)?1:b},"J.adapter.smarter.Atom");e(c$,"deduceElementSymbol",function(a){if(78<=this.lineLength){var b=this.line.charAt(76),
c=this.line.charAt(77);if(" "==b&&J.adapter.smarter.Atom.isValidElementSymbol(c))return""+c;if(J.adapter.smarter.Atom.isValidElementSymbolNoCaseSecondChar2(b,c))return""+b+c}b=this.line.charAt(12);c=this.line.charAt(13);if((null==this.htElementsInCurrentGroup||null!=this.htElementsInCurrentGroup.get(this.line.substring(12,14)))&&J.adapter.smarter.Atom.isValidElementSymbolNoCaseSecondChar2(b,c))return a||"H"!=b?""+b+c:"H";if("H"==b)return"H";if((null==this.htElementsInCurrentGroup||null!=this.htElementsInCurrentGroup.get(""+
c))&&J.adapter.smarter.Atom.isValidElementSymbol(c))return""+c;if(" "!=b&&(null==this.htElementsInCurrentGroup||null!=this.htElementsInCurrentGroup.get(""+b))&&J.adapter.smarter.Atom.isValidElementSymbol(b))return""+b;a=this.line.charAt(14);return" "==b&&"X"!=c&&(null==this.htElementsInCurrentGroup||null!=this.htElementsInCurrentGroup.get(this.line.substring(13,15)))&&J.adapter.smarter.Atom.isValidElementSymbolNoCaseSecondChar2(c,a)?""+c+a:"Xx"},"~B");e(c$,"conect",function(){null==this.sbConect?
(this.sbConect=new JU.SB,this.sb=new JU.SB):this.sb.setLength(0);var a=-1,a=this.getSerial(6,11);if(!(0>a)){for(var b=0;9>b;b+=5==b?2:1){var c=5*b+11,d=c+5,c=d<=this.lineLength?this.getSerial(c,d):-1;if(!(0>c)){var f=a==this.lastSourceSerial&&c==this.lastTargetSerial;f&&(this.haveDoubleBonds=!0);this.lastSourceSerial=a;this.lastTargetSerial=c;c<a?(d=c,c=a):d=a;var g=";"+d+" "+c+";";if(!(0<=this.sbConect.indexOf(g))||f){if(this.haveDoubleBonds){f="--"+g;if(0<=this.sbConect.indexOf(f))continue;this.sbConect.append(g);
this.sb.append(f)}else this.sbConect.append(g);this.addConnection([d,c,4>b?1:2048])}}}this.sbConect.appendSB(this.sb)}});e(c$,"structure",function(){var a=J.c.STR.NONE,b=J.c.STR.NONE,c,d,f,g,k=0;if(this.line.startsWith("HELIX "))a=J.c.STR.HELIX,c=19,d=21,f=31,g=33,40<=this.line.length&&(b=J.adapter.smarter.Structure.getHelixType(this.parseIntRange(this.line,38,40)));else if(this.line.startsWith("SHEET "))a=J.c.STR.SHEET,c=21,d=22,f=32,g=33,k=this.parseIntRange(this.line,14,16);else if(this.line.startsWith("TURN  "))a=
J.c.STR.TURN,c=19,d=20,f=30,g=31;else return;if(!(this.lineLength<g+4)){var e=this.line.substring(11,15).trim(),j=this.parseIntRange(this.line,7,10);c=this.line.charAt(c);var l=this.parseIntRange(this.line,d,d+4);d=this.line.charAt(d+4);f=this.line.charAt(f);var m=this.parseIntRange(this.line,g,g+4),p=" ";this.lineLength>g+4&&(p=this.line.charAt(g+4));b===J.c.STR.NONE&&(b=a);a=new J.adapter.smarter.Structure(-1,a,b,e,j,k);a.set(c.charCodeAt(0),l,d,f.charCodeAt(0),m,p,-2147483648,2147483647);this.asc.addStructure(a)}});
e(c$,"getModelNumber",function(){var a=14;a>this.lineLength&&(a=this.lineLength);a=this.parseIntRange(this.line,6,a);return-2147483648==a?0:a});e(c$,"model",function(a){this.checkNotPDB();this.haveMappedSerials=!1;this.sbConect=null;this.asc.newAtomSet();this.isCourseGrained||this.asc.setAtomSetAuxiliaryInfo("isPDB",Boolean.TRUE);this.asc.setCurrentAtomSetNumber(a);this.isCourseGrained&&this.asc.setAtomSetAuxiliaryInfo("courseGrained",Boolean.TRUE)},"~N");e(c$,"checkNotPDB",function(){var a=!this.isCourseGrained&&
(0==this.nRes||this.nUNK!=this.nRes);this.asc.setCheckSpecial(!a);this.asc.setAtomSetAuxiliaryInfo("isPDB",a?Boolean.TRUE:Boolean.FALSE);this.nUNK=this.nRes=0;this.currentGroup3=null});e(c$,"cryst1",function(){var a=this.getFloat(6,9);1==a&&(a=NaN);this.setUnitCell(a,this.getFloat(15,9),this.getFloat(24,9),this.getFloat(33,7),this.getFloat(40,7),this.getFloat(47,7));null==this.sgName&&this.setSpaceGroupName(J.adapter.smarter.AtomSetCollectionReader.parseTrimmedRange(this.line,55,66))});e(c$,"getFloat",
function(a,b){return this.parseFloatRange(this.line,a,a+b)},"~N,~N");e(c$,"scale",function(a){a=4*a+2;this.setUnitCellItem(a++,this.getFloat(10,10));this.setUnitCellItem(a++,this.getFloat(20,10));this.setUnitCellItem(a++,this.getFloat(30,10));this.setUnitCellItem(a++,this.getFloat(45,10))},"~N");e(c$,"expdta",function(){0<=this.line.toUpperCase().indexOf("NMR")&&this.asc.setInfo("isNMRdata","true")});e(c$,"formul",function(){var a=this.parseTokenRange(this.line,12,15),b=J.adapter.smarter.AtomSetCollectionReader.parseTrimmedRange(this.line,
19,70),c=b.indexOf("(");if(0<=c){var d=b.indexOf(")");if(0>d||c>=d||c+1==d)return;b=J.adapter.smarter.AtomSetCollectionReader.parseTrimmedRange(b,c+1,d)}c=this.htFormul.get(a);null==c&&this.htFormul.put(a,c=new java.util.Hashtable);for(this.next[0]=0;null!=(d=this.parseTokenNext(b));)2>d.length||(a=d.charAt(0),d=d.charAt(1),J.adapter.smarter.Atom.isValidElementSymbolNoCaseSecondChar2(a,d)?c.put(""+a+d,Boolean.TRUE):J.adapter.smarter.Atom.isValidElementSymbol(a)&&c.put(""+a,Boolean.TRUE))});e(c$,"het",
function(){if(!(30>this.line.length)){null==this.htHetero&&(this.htHetero=new java.util.Hashtable);var a=this.parseTokenRange(this.line,7,10);if(!this.htHetero.containsKey(a)){var b=J.adapter.smarter.AtomSetCollectionReader.parseTrimmedRange(this.line,30,70);this.htHetero.put(a,b)}}});e(c$,"hetnam",function(){null==this.htHetero&&(this.htHetero=new java.util.Hashtable);var a=this.parseTokenRange(this.line,11,14),b=J.adapter.smarter.AtomSetCollectionReader.parseTrimmedRange(this.line,15,70);if(null==
a)JU.Logger.error("ERROR: HETNAM record does not contain a group name: "+this.line);else{var c=this.htHetero.get(a);null!=c&&(b=c+b);this.htHetero.put(a,b)}});e(c$,"anisou",function(){var a=T(8,0);a[6]=1;var b=this.line.substring(6,11).trim();if(!this.haveMappedSerials&&0<this.asc.ac){for(var c=this.asc.getAtomSetAtomIndex(this.asc.iSet);c<this.asc.ac;c++){var d=this.asc.atoms[c].atomSerial;-2147483648!=d&&this.asc.atomSymbolicMap.put(""+d,this.asc.atoms[c])}this.haveMappedSerials=!0}b=this.asc.getAtomFromName(b);
if(null!=b){c=28;for(d=0;70>c;c+=7,d++)a[d]=this.parseFloatRange(this.line,c,c+7);for(c=0;6>c;c++){if(Float.isNaN(a[c])){JU.Logger.error("Bad ANISOU record: "+this.line);return}a[c]/=1E4}this.asc.setAnisoBorU(b,a,12)}});e(c$,"site",function(){null==this.htSites&&(this.htSites=new java.util.Hashtable);var a=this.parseIntRange(this.line,15,17),b=J.adapter.smarter.AtomSetCollectionReader.parseTrimmedRange(this.line,11,14),c=this.htSites.get(b);null==c&&(c=new java.util.Hashtable,c.put("nResidues",Integer.$valueOf(a)),
c.put("groups",""),this.htSites.put(b,c));a=c.get("groups");for(b=0;4>b;b++){var d=18+11*b,f=J.adapter.smarter.AtomSetCollectionReader.parseTrimmedRange(this.line,d,d+3);if(0==f.length)break;var g=J.adapter.smarter.AtomSetCollectionReader.parseTrimmedRange(this.line,d+4,d+5),k=J.adapter.smarter.AtomSetCollectionReader.parseTrimmedRange(this.line,d+5,d+9),d=J.adapter.smarter.AtomSetCollectionReader.parseTrimmedRange(this.line,d+9,d+10),a=a+((0==a.length?"":",")+"["+f+"]"+k);0<d.length&&(a+="^"+d);
0<g.length&&(a+=":"+g);c.put("groups",a)}});e(c$,"remarkTls",function(){for(var a=0,b=0,c=null,d=null,f=null,g=null,k=null,e=this.line.substring(0,11);null!=this.readHeader(!0)&&this.line.startsWith(e);)try{var j=J.adapter.smarter.AtomSetCollectionReader.getTokensStr(this.line.substring(10).$replace(":"," "));if(!(2>j.length))if(JU.Logger.info(this.line),j[1].equalsIgnoreCase("GROUP"))f=new java.util.Hashtable,g=new JU.Lst,f.put("ranges",g),d.addLast(f),this.tlsGroupID=this.parseIntStr(j[j.length-
1]),f.put("id",Integer.$valueOf(this.tlsGroupID));else if(j[0].equalsIgnoreCase("NUMBER")){if(!j[2].equalsIgnoreCase("COMPONENTS")){a=this.parseIntStr(j[j.length-1]);if(1>a)break;null==this.vTlsModels&&(this.vTlsModels=new JU.Lst);d=new JU.Lst;this.appendLoadNote(this.line.substring(11).trim())}}else if(j[0].equalsIgnoreCase("COMPONENTS"))c=this.line;else if(j[0].equalsIgnoreCase("RESIDUE")){var k=new java.util.Hashtable,l,m,p,h;if(6==j.length)l=j[2].charAt(0),m=j[4].charAt(0),p=this.parseIntStr(j[3]),
h=this.parseIntStr(j[5]);else{var u=c.indexOf(" C "),V=c.indexOf(" C ",u+4);l=this.line.charAt(V);m=this.line.charAt(u);p=this.parseIntRange(this.line,V+1,u);h=this.parseIntStr(this.line.substring(u+1))}l==m?(k.put("chains",""+l+m),p<=h?(k.put("residues",[p,h]),g.addLast(k)):this.tlsAddError(" TLS group residues are not in order (range ignored)")):this.tlsAddError(" TLS group chains are different (range ignored)")}else if(j[0].equalsIgnoreCase("SELECTION"))for(var r="\x00",q=1;q<j.length;q++)if(0<=
j[q].toUpperCase().indexOf("CHAIN"))r=j[++q].charAt(0);else{var n=this.parseIntStr(j[q]);-2147483648!=n&&(k=new java.util.Hashtable,k.put("residues",[n,this.parseIntStr(j[++q])]),"\x00"!=r&&k.put("chains",""+r+r),g.addLast(k))}else if(j[0].equalsIgnoreCase("ORIGIN")){var w=new JU.P3;f.put("origin",w);if(8==j.length)w.set(this.parseFloatStr(j[5]),this.parseFloatStr(j[6]),this.parseFloatStr(j[7]));else{var t=this.line.length;w.set(this.parseFloatRange(this.line,t-27,t-18),this.parseFloatRange(this.line,
t-18,t-9),this.parseFloatRange(this.line,t-9,t))}if(Float.isNaN(w.x)||Float.isNaN(w.y)||Float.isNaN(w.z))w.set(NaN,NaN,NaN),this.tlsAddError("invalid origin: "+this.line)}else if(j[1].equalsIgnoreCase("TENSOR")){var v=j[0].charAt(0),A=(this.readHeader(!0).substring(10)+this.readHeader(!0).substring(10)+this.readHeader(!0).substring(10)).$replace(v," ").$replace(":"," "),j=J.adapter.smarter.AtomSetCollectionReader.getTokensStr(A),x=T(3,3,0);f.put("t"+v,x);for(q=0;q<j.length;q++){var z=j[q].charCodeAt(0)-
49,y=j[q].charCodeAt(1)-49;x[z][y]=this.parseFloatStr(j[++q]);z<y&&(x[y][z]=x[z][y])}for(q=0;3>q;q++)for(r=0;3>r;r++)Float.isNaN(x[q][r])&&this.tlsAddError("invalid tensor: "+JU.Escape.escapeFloatAA(x,!1));if("S"==v&&++b==a){JU.Logger.info(a+" TLS groups read");this.readHeader(!0);break}}}catch(C){if(P(C,Exception)){JU.Logger.error(this.line+"\nError in TLS parser: ");System.out.println(C.getMessage());d=null;break}else throw C;}null!=d&&(b=new java.util.Hashtable,b.put("groupCount",Integer.$valueOf(a)),
b.put("groups",d),this.vTlsModels.addLast(b));return 1>a});e(c$,"handleTlsMissingModels",function(){this.vTlsModels=null});e(c$,"setTlsGroups",function(a,b,c){JU.Logger.info("TLS model "+(b+1)+" set "+(a+1));a=this.vTlsModels.get(a);for(var d=a.get("groups"),f=this.asc.getAtomSetAtomIndex(b),g=Q(this.asc.getAtomSetAtomCount(b),0),k=f+g.length,e=this.asc.atoms,j=d.size(),l=0;l<j;l++){var m=d.get(l),h=m.get("ranges");this.tlsGroupID=m.get("id").intValue();for(var s=h.size();0<=--s;){var u=h.get(s).get("chains"),
V=h.get(s).get("residues"),r=0+u.charCodeAt(0),u=0+u.charCodeAt(1),q=V[0],V=V[1],n=this.findAtomForRange(f,k,r,q,!1),w=0<=n?this.findAtomForRange(n,k,u,V,!1):-1;if(0>w){JU.Logger.info("TLS processing terminated");return}JU.Logger.info("TLS ID="+this.tlsGroupID+" model atom index range "+n+"-"+w);n=r==u;for(w=f;w<k;w++){var t=e[w];if(n?t.sequenceNumber>=q&&t.sequenceNumber<=V:t.chainID>r&&t.chainID<u||t.chainID==r&&t.sequenceNumber>=q||t.chainID==u&&t.sequenceNumber<=V)g[w-f]=this.tlsGroupID,this.setTlsTensor(t,
m,c)}}}c=new JU.SB;for(l=0;l<g.length;l++)c.appendI(g[l]).appendC("\n");this.asc.setAtomSetAtomProperty("tlsGroup",c.toString(),b);this.asc.setAtomSetAuxiliaryInfoForSet("TLS",a,b);this.asc.setTensors()},"~N,~N,J.api.SymmetryInterface");e(c$,"findAtomForRange",function(a,b,c,d,f){a=this.findAtom(a,b,c,d,!0);return f&&0<=a?this.findAtom(a,b,c,d,!1):a},"~N,~N,~N,~N,~B");e(c$,"findAtom",function(a,b,c,d,f){for(var g=this.asc.atoms;a<b;a++){var k=g[a];if((k.chainID==c&&k.sequenceNumber==d)==f)return a}f&&
(JU.Logger.warn("PdbReader findAtom chain="+c+" resno="+d+" not found"),this.tlsAddError("atom not found: chain="+c+" resno="+d));return f?-1:b},"~N,~N,~N,~N,~B");e(c$,"setTlsTensor",function(a,b,c){var d=b.get("origin");if(!Float.isNaN(d.x)){var f=b.get("tT"),g=b.get("tL");b=b.get("tS");if(!(null==f||null==g||null==b)){var k=0.017453292*(a.x-d.x),e=0.017453292*(a.y-d.y),d=0.017453292*(a.z-d.z),j=k*k,l=e*e,m=d*d,h=k*e,s=k*d,u=e*d;this.dataT[0]=f[0][0];this.dataT[1]=f[1][1];this.dataT[2]=f[2][2];this.dataT[3]=
f[0][1];this.dataT[4]=f[0][2];this.dataT[5]=f[1][2];this.dataT[6]=12;var f=T(8,0),n=Float.isNaN(a.bfactor)?0:a.bfactor/78.95683;f[0]=this.dataT[0]+g[1][1]*m+g[2][2]*l-2*g[1][2]*u+2*b[1][0]*d-2*b[2][0]*e;f[1]=this.dataT[1]+g[0][0]*m+g[2][2]*j-2*g[2][0]*s-2*b[0][1]*d+2*b[2][1]*k;f[2]=this.dataT[2]+g[0][0]*l+g[1][1]*j-2*g[0][1]*h-2*b[1][2]*k+2*b[0][2]*e;f[3]=this.dataT[3]-g[2][2]*h+g[1][2]*s+g[2][0]*u-g[0][1]*m-b[0][0]*d+b[1][1]*d+b[2][0]*k-b[2][1]*e;f[4]=this.dataT[4]-g[1][1]*s+g[1][2]*h-g[2][0]*l+
g[0][1]*u+b[0][0]*e-b[2][2]*e+b[1][2]*d-b[1][0]*k;f[5]=this.dataT[5]-g[0][0]*u-g[1][2]*j+g[2][0]*h+g[0][1]*s-b[1][1]*k+b[2][2]*k+b[0][1]*e-b[0][2]*d;f[6]=12;f[7]=n;null==this.tlsU&&(this.tlsU=new java.util.Hashtable);this.tlsU.put(a,f);a.addTensor(c.getTensor(this.dataT).setType(null),"TLS-U",!1)}}},"J.adapter.smarter.Atom,java.util.Map,J.api.SymmetryInterface");e(c$,"tlsAddError",function(a){null==this.sbTlsErrors&&(this.sbTlsErrors=new JU.SB);this.sbTlsErrors.append(this.fileName).appendC("\t").append("TLS group ").appendI(this.tlsGroupID).appendC("\t").append(a).appendC("\n")},
"~S");c$.fixRadius=e(c$,"fixRadius",function(a){return 0.9>a?1:a},"~N");e(c$,"addConnection",function(a){null==this.vConnect&&(this.connectLast=null,this.vConnect=new JU.Lst);null!=this.connectLast&&a[0]==this.connectLast[0]&&a[1]==this.connectLast[1]&&2048!=a[2]?this.connectLast[2]++:this.vConnect.addLast(this.connectLast=a)},"~A");e(c$,"connectAllBad",function(a){for(var b=this.connectNextAtomIndex,c=this.connectNextAtomSet;c<this.asc.atomSetCount;c++){var d=this.asc.getAtomSetAtomCount(c);this.asc.setAtomSetAuxiliaryInfoForSet("PDB_CONECT_firstAtom_count_max",
[b,d,a],c);null!=this.vConnect&&(this.asc.setAtomSetAuxiliaryInfoForSet("PDB_CONECT_bonds",this.vConnect,c),this.asc.setGlobalBoolean(3));b+=d}this.vConnect=null;this.connectNextAtomSet=this.asc.iSet+1;this.connectNextAtomIndex=b},"~N");e(c$,"connectAll",function(a,b){var c=this.asc,d=c.iSet;if(!(0>d))if(b)this.connectAllBad(a);else if(c.setAtomSetAuxiliaryInfo("PDB_CONECT_firstAtom_count_max",[c.getAtomSetAtomIndex(d),c.getAtomSetAtomCount(d),a]),null!=this.vConnect){for(var f=this.connectNextAtomIndex,
g=c.atomSetCount;--g>=this.connectNextAtomSet;)c.setAtomSetAuxiliaryInfoForSet("PDB_CONECT_bonds",this.vConnect,g),c.setGlobalBoolean(3),f+=c.getAtomSetAtomCount(g);this.vConnect=null;this.connectNextAtomSet=d+1;this.connectNextAtomIndex=f}},"~N,~B");G(c$,"MODE_PDB",0,"MODE_HEX",1,"MODE_HYBRID36",2,"lineOptions","ATOM    HETATM  MODEL   CONECT  HELIX   SHEET   TURN    HET     HETNAM  ANISOU  SITE    CRYST1  SCALE1  SCALE2  SCALE3  EXPDTA  FORMUL  REMARK  HEADER  COMPND  SOURCE  TITLE   SEQADV  ",
"RAD_PER_DEG",0.017453292519943295,"_8PI2_",78.95683520871486)});n("J.adapter.smarter");v(null,"J.adapter.smarter.Structure",["J.c.STR"],function(){c$=y(function(){this.structureID=this.substructureType=this.structureType=null;this.startChainID=this.strandCount=this.serialID=0;this.startChainStr=null;this.startInsertionCode="\x00";this.endChainID=0;this.endChainStr=null;this.endInsertionCode="\x00";this.endSequenceNumber=this.startSequenceNumber=0;this.modelStartEnd=this.atomStartEnd=null;x(this,
arguments)},J.adapter.smarter,"Structure");S(c$,function(){this.atomStartEnd=Q(2,0);this.modelStartEnd=[-1,-1]});c$.getHelixType=e(c$,"getHelixType",function(a){switch(a){case 1:return J.c.STR.HELIXALPHA;case 3:return J.c.STR.HELIXPI;case 5:return J.c.STR.HELIX310}return J.c.STR.HELIX},"~N");H(c$,function(a,b,c,d,f,g){this.structureType=b;this.substructureType=c;null!=d&&(this.setModels(a,0),this.structureID=d,this.strandCount=g,this.serialID=f)},"~N,J.c.STR,J.c.STR,~S,~N,~N");e(c$,"set",function(a,
b,c,d,f,g,k,e){this.startChainID=a;this.startSequenceNumber=b;this.startInsertionCode=c;this.endChainID=d;this.endSequenceNumber=f;this.endInsertionCode=g;this.atomStartEnd[0]=k;this.atomStartEnd[1]=e},"~N,~N,~S,~N,~N,~S,~N,~N");e(c$,"setModels",function(a,b){this.modelStartEnd[0]=a;this.modelStartEnd[1]=0==b?a:b},"~N,~N")});n("J.api");ca(J.api,"JmolBioResolver");n("JM");v(["J.api.JmolBioResolver"],"JM.Resolver","java.lang.Boolean $.NullPointerException java.util.Arrays $.Hashtable JU.BS $.P3 $.P4 $.PT $.SB $.V3 J.c.STR JM.Group JM.AlphaMonomer $.AlphaPolymer $.AminoMonomer $.AminoPolymer $.BioModel $.CarbohydrateMonomer $.CarbohydratePolymer $.Monomer $.NucleicMonomer $.NucleicPolymer $.PhosphorusMonomer $.PhosphorusPolymer JU.BSUtil $.Logger $.Measure JV.JC".split(" "),
function(){c$=y(function(){this.hNames=this.htGroupBonds=this.htBondMap=this.bsAtomsForHs=this.bsAddedHydrogens=this.ms=this.ml=null;this.lastSetH=-2147483648;this.baseBondIndex=this.maxSerial=0;this.haveHsAlready=!1;this.plane=this.vNorm=this.vAC=this.vAB=null;ga("JM.Resolver.BondSorter")||JM.Resolver.$Resolver$BondSorter$();this.bsAssigned=null;x(this,arguments)},JM,"Resolver",null,J.api.JmolBioResolver);H(c$,function(){});h(c$,"getBioModel",function(a,b,c,d,f){return new JM.BioModel(this.ms,a,
b,c,d,f)},"~N,~N,~S,java.util.Properties,java.util.Map");h(c$,"distinguishAndPropagateGroup",function(a,b,c,d,f,g,k,e){g=f-1;for(var j=0,l=JV.JC.ATOMID_MAX;0<=--l;)k[l]=-2147483648;for(l=f;--l>=d;)f=e[l].getAtomID(),0>=f||(14>f&&(j|=1<<f),k[f]=l);if(g<d)throw new NullPointerException;f=null;14==(j&14)?f=JM.AminoMonomer.validateAndAllocate(a,b,c,d,g,k,e):4==j?f=JM.AlphaMonomer.validateAndAllocateA(a,b,c,d,g,k):8128==(j&8128)?f=JM.NucleicMonomer.validateAndAllocate(a,b,c,d,g,k):8192==j?f=JM.PhosphorusMonomer.validateAndAllocateP(a,
b,c,d,g,k):JV.JC.checkCarbohydrate(b)&&(f=JM.CarbohydrateMonomer.validateAndAllocate(a,b,c,d,g));return null!=f&&0<=f.leadAtomIndex?f:null},"JM.Chain,~S,~N,~N,~N,~N,~A,~A");h(c$,"setHaveHsAlready",function(a){this.haveHsAlready=a},"~B");h(c$,"initialize",function(a){this.ml=a;this.ms=a.ms},"JM.ModelLoader");h(c$,"initializeHydrogenAddition",function(){this.baseBondIndex=this.ml.ms.bondCount;this.bsAddedHydrogens=new JU.BS;this.bsAtomsForHs=new JU.BS;this.htBondMap=new java.util.Hashtable;this.htGroupBonds=
new java.util.Hashtable;this.hNames=Array(3);this.vAB=new JU.V3;this.vAC=new JU.V3;this.vNorm=new JU.V3;this.plane=new JU.P4});h(c$,"addImplicitHydrogenAtoms",function(a,b,c){var d=this.ml.getGroup3(b),f;if(!this.haveHsAlready&&!(null==d||0==(f=JV.JC.getStandardPdbHydrogenCount(JM.Group.lookupGroupID(d))))){c=0>f?-1:f+c;f=null;b=this.ml.getFirstAtomIndex(b);var g=this.ms.getAtomCount();if(0>c){if(1==g-b)return;f=this.ms.vwr.getLigandModel(d,"ligand_","_data",null);if(null==f)return;c=a.getHydrogenAtomCount(f);
if(1>c)return}this.getBondInfo(a,d,f);this.ms.am[this.ms.at[b].mi].isPdbWithMultipleBonds=!0;this.bsAtomsForHs.setBits(b,g);this.bsAddedHydrogens.setBits(g,g+c);a=this.ms.at[b].isHetero();d=JU.P3.new3(NaN,NaN,NaN);for(f=0;f<c;f++)this.ms.addAtom(this.ms.at[b].mi,this.ms.at[b].getGroup(),1,"H",0,0,d,NaN,null,0,0,1,0,null,a,0,null).deleteBonds(null)}},"J.api.JmolAdapter,~N,~N");e(c$,"getBondInfo",function(a,b,c){if(null==this.htGroupBonds.get(b)&&(a=null==c?this.ms.vwr.getPdbBondInfo(b):this.getLigandBondInfo(a,
c,b),null!=a)){this.htGroupBonds.put(b,Boolean.TRUE);for(c=0;c<a.length;c++)null!=a[c]&&("H"==a[c][1].charAt(0)?this.htBondMap.put(b+"."+a[c][0],a[c][1]):this.htBondMap.put(b+":"+a[c][0]+":"+a[c][1],a[c][2]))}},"J.api.JmolAdapter,~S,~O");e(c$,"getLigandBondInfo",function(a,b,c){var d=a.getBondList(b),f=new java.util.Hashtable;for(a=a.getAtomIterator(b);a.hasNext();)f.put(a.getAtomName(),a.getXYZ());a=Array(2*d.length);for(var g=b=0;g<d.length;g++){var k=d[g];"H"!=k[0].charAt(0)&&(a[b++]=[k[0],k[1],
k[2],k[1].startsWith("H")?"0":"1"]);"H"!=k[1].charAt(0)&&(a[b++]=[k[1],k[0],k[2],k[0].startsWith("H")?"0":"1"])}java.util.Arrays.sort(a,fa(JM.Resolver.BondSorter,this,null));for(var e,g=0;g<b;){e=a[g];for(var d=e[0],j=k=0;g<b&&(e=a[g])[0].equals(d);g++)e[3].equals("0")?k++:e[3].equals("1")&&j++;d=g-k-j;if(1!=k)switch(j){case 1:for(var j=2==k?"@":"|",l=1;l<k;l++)a[d][1]+=j+a[d+l][1],a[d+l]=null;continue;case 2:if(2!=k)continue;var j=a[d][0],l=a[d+k][1],k=a[d+k+1][1],m=l.compareTo(k);JU.Measure.getPlaneThroughPoints(f.get(l),
f.get(j),f.get(k),this.vNorm,this.vAB,this.vAC,this.plane);k=JU.Measure.distanceToPlane(this.plane,f.get(a[d][1]))*m;a[d][1]=0<k?a[d][1]+"@"+a[d+1][1]:a[d+1][1]+"@"+a[d][1];a[d+1]=null}}for(g=0;g<b;g++)null!=(e=a[g])&&"H"!=e[1].charAt(0)&&0<e[0].compareTo(e[1])?a[g]=null:null!=e&&JU.Logger.info(" ligand "+c+": "+a[g][0]+" - "+a[g][1]+" order "+a[g][2]);return a},"J.api.JmolAdapter,~O,~S");h(c$,"finalizeHydrogens",function(){this.ms.vwr.getLigandModel(null,null,null,null);this.finalizePdbMultipleBonds();
this.addHydrogens()});e(c$,"addHydrogens",function(){if(!(0>this.bsAddedHydrogens.nextSetBit(0))){this.finalizePdbCharges();for(var a=Q(1,0),a=this.ms.calculateHydrogens(this.bsAtomsForHs,a,!0,!1,null),b=null,c=0,d=0;d<a.length;d++)if(null!=a[d]){var f=this.ms.at[d],g=f.getGroup();if(g!==b){b=g;for(c=g.lastAtomIndex;this.bsAddedHydrogens.get(c);)c--}var k=f.getGroup3(!1),e=f.getAtomName(),j=this.htBondMap.get(k+"."+e);if(null!=j){var l=j.contains("@"),m=j.endsWith("?")||0<=j.indexOf("|"),h=a[d].length;
3==h&&(!m&&j.equals("H@H2"))&&(j="H|H2|H3",m=!0,l=!1);if(l&&3==h||m!=(3==h))JU.Logger.info("Error adding H atoms to "+k+g.getResno()+": "+a[d].length+" atoms should not be added to "+e);else switch(e=j.indexOf("@"),a[d].length){case 1:0<e&&(j=j.substring(0,e));this.setHydrogen(d,++c,j,a[d][0]);break;case 2:l=-1;m=f.getBonds();if(null!=m)switch(m.length){case 2:l=m[0].getOtherAtom(f),m=m[1].getOtherAtom(f),h=l.getAtomName().compareTo(m.getAtomName()),JU.Measure.getPlaneThroughPoints(l,f,m,this.vNorm,
this.vAB,this.vAC,this.plane),l=JU.Measure.distanceToPlane(this.plane,a[d][0])*h}0>e?(JU.Logger.info("Error adding H atoms to "+k+g.getResno()+": expected to only need 1 H but needed 2"),f=g="H"):0>l?(g=j.substring(0,e),f=j.substring(e+1)):(f=j.substring(0,e),g=j.substring(e+1));this.setHydrogen(d,++c,f,a[d][0]);this.setHydrogen(d,++c,g,a[d][1]);break;case 3:f=j.indexOf("|"),0<=f?(g=j.lastIndexOf("|"),this.hNames[0]=j.substring(0,f),this.hNames[1]=j.substring(f+1,g),this.hNames[2]=j.substring(g+1)):
(this.hNames[0]=j.$replace("?","1"),this.hNames[1]=j.$replace("?","2"),this.hNames[2]=j.$replace("?","3")),this.setHydrogen(d,++c,this.hNames[0],a[d][0]),this.setHydrogen(d,++c,this.hNames[1],a[d][2]),this.setHydrogen(d,++c,this.hNames[2],a[d][1])}}}this.deleteUnneededAtoms();this.ms.fixFormalCharges(JU.BSUtil.newBitSet2(this.ml.baseAtomIndex,this.ml.ms.ac))}});e(c$,"deleteUnneededAtoms",function(){for(var a=new JU.BS,b=this.bsAtomsForHs.nextSetBit(0);0<=b;b=this.bsAtomsForHs.nextSetBit(b+1)){var c=
this.ms.at[b];if(c.isHetero()&&!(8!=c.getElementNumber()||0!=c.getFormalCharge()||2!=c.getCovalentBondCount())){var d=c.getBonds(),f=d[0].getOtherAtom(c),c=d[1].getOtherAtom(c);1==f.getElementNumber()&&(d=f,f=c,c=d);if(1==c.getElementNumber())for(var d=f.getBonds(),g=0;g<d.length;g++)if(2==d[g].order&&8==d[g].getOtherAtom(f).getElementNumber()){this.bsAddedHydrogens.set(c.i);c.deleteBonds(a);break}}}this.ms.deleteBonds(a,!0);this.ml.deleteAtoms(this.bsAddedHydrogens)});e(c$,"finalizePdbCharges",function(){for(var a=
this.ms.at,b=this.bsAtomsForHs.nextSetBit(0);0<=b;b=this.bsAtomsForHs.nextSetBit(b+1)){var c=a[b];c.getGroup().getNitrogenAtom()===c&&1==c.getCovalentBondCount()&&c.setFormalCharge(1);if(0>(b=this.bsAtomsForHs.nextClearBit(b+1)))break}});e(c$,"finalizePdbMultipleBonds",function(){for(var a=new java.util.Hashtable,b=this.ms.bondCount,c=this.ms.bo,d=this.baseBondIndex;d<b;d++){var f=c[d].getAtom1(),g=c[d].getAtom2(),k=f.getGroup();if(k===g.getGroup()){var e=(new JU.SB).append(k.getGroup3());e.append(":");
f=f.getAtomName();g=g.getAtomName();0<f.compareTo(g)?e.append(g).append(":").append(f):e.append(f).append(":").append(g);g=e.toString();f=this.htBondMap.get(g);null!=f&&(a.put(g,Boolean.TRUE),c[d].setOrder(JU.PT.parseInt(f)))}}for(d=this.htBondMap.keySet().iterator();d.hasNext()&&((e=d.next())||1);)if(null==a.get(e))if(0>e.indexOf(":"))a.put(e,Boolean.TRUE);else{var j=this.htBondMap.get(e);JU.Logger.info("bond "+e+" was not used; order="+j);this.htBondMap.get(e).equals("1")&&a.put(e,Boolean.TRUE)}k=
new java.util.Hashtable;for(d=this.htBondMap.keySet().iterator();d.hasNext()&&((e=d.next())||1);)null==a.get(e)&&k.put(e.substring(0,e.lastIndexOf(":")),this.htBondMap.get(e));if(!k.isEmpty())for(d=0;d<b;d++)if(f=c[d].getAtom1(),g=c[d].getAtom2(),f.getGroup()!==g.getGroup()&&!(null==(j=k.get(f.getGroup3(!1)+":"+f.getAtomName()))&&null==(j=k.get(g.getGroup3(!1)+":"+g.getAtomName()))))c[d].setOrder(JU.PT.parseInt(j)),JU.Logger.info("assigning order "+c[d].order+" to bond "+c[d])});e(c$,"setHydrogen",
function(a,b,c,d){if(this.bsAddedHydrogens.get(b)){var f=this.ms.at;if(-2147483648==this.lastSetH||f[b].mi!=f[this.lastSetH].mi)this.maxSerial=this.ms.getInfo(f[this.lastSetH=b].mi,"PDB_CONECT_firstAtom_count_max")[2];this.bsAddedHydrogens.clear(b);this.ms.setAtomName(b,c);f[b].setT(d);this.ms.setAtomNumber(b,++this.maxSerial);f[b].setAtomSymmetry(f[a].getAtomSymmetry());this.ml.undeleteAtom(b);this.ms.bondAtoms(f[a],f[b],1,this.ms.getDefaultMadFromOrder(1),null,0,!0,!1)}},"~N,~N,~S,JU.P3");h(c$,
"fixPropertyValue",function(a,b){for(var c=JU.PT.split(b,"\n"),d=this.ms.at,f=Array(a.cardinality()),g="",k=0,e=0,j=a.nextSetBit(0);0<=j;j=a.nextSetBit(j),e++)1!=d[j].getElementNumber()&&(g=c[k++]),f[e]=g;return JU.PT.join(f,"\n",0)},"JU.BS,~S");c$.allocateBioPolymer=e(c$,"allocateBioPolymer",function(a,b,c){for(var d=null,f=0,g=b;g<a.length;++g){var k=a[g],e;if(!A(k,JM.Monomer)||null!=(e=k).bioPolymer||null!=d&&d.getClass()!==e.getClass()||c&&!e.isConnectedAfter(d))break;d=e;f++}if(0==f)return null;
c=Array(f);for(g=0;g<f;++g)c[g]=a[b+g];if(A(d,JM.AminoMonomer))return new JM.AminoPolymer(c);if(A(d,JM.AlphaMonomer))return new JM.AlphaPolymer(c);if(A(d,JM.NucleicMonomer))return new JM.NucleicPolymer(c);if(A(d,JM.PhosphorusMonomer))return new JM.PhosphorusPolymer(c);if(A(d,JM.CarbohydrateMonomer))return new JM.CarbohydratePolymer(c);JU.Logger.error("Polymer.allocatePolymer() ... no matching polymer for monomor "+d);throw new NullPointerException;},"~A,~N,~B");h(c$,"iterateOverAllNewStructures",
function(a,b){var c=a.getStructureIterator(b);if(null!=c){var d=c.getStructuredModels();if(null!=d)for(var f=d.nextSetBit(0);0<=f;f=d.nextSetBit(f+1))this.ml.structuresDefinedInFile.set(this.ml.baseModelIndex+f);for(;c.hasNext();)c.getStructureType()!==J.c.STR.TURN&&this.setStructure(c);for(c=a.getStructureIterator(b);c.hasNext();)c.getStructureType()===J.c.STR.TURN&&this.setStructure(c)}},"J.api.JmolAdapter,~O");e(c$,"setStructure",function(a){var b=a.getSubstructureType(),c=a.getStructureID(),d=
a.getSerialID(),f=a.getStrandCount(),g=a.getAtomIndices(),k=a.getModelIndices();null==this.bsAssigned&&(this.bsAssigned=new JU.BS);this.defineStructure(b,c,d,f,a.getStartChainID(),a.getStartSequenceNumber(),a.getStartInsertionCode(),a.getEndChainID(),a.getEndSequenceNumber(),a.getEndInsertionCode(),g,k,this.bsAssigned)},"J.api.JmolAdapterStructureIterator");e(c$,"defineStructure",function(a,b,c,d,f,g,k,e,j,l,m,h,s){a=a===J.c.STR.NOT?J.c.STR.NONE:a;g=JM.Group.getSeqcodeFor(g,k);j=JM.Group.getSeqcodeFor(j,
l);l=this.ms.am;this.ml.isTrajectory?h[1]=h[0]:(h[0]+=this.ml.baseModelIndex,h[1]+=this.ml.baseModelIndex);this.ml.structuresDefinedInFile.setBits(h[0],h[1]+1);for(k=h[0];k<=h[1];k++){var u=l[k].firstAtomIndex;A(l[k],JM.BioModel)&&l[k].addSecondaryStructure(a,b,c,d,f,g,e,j,u+m[0],u+m[1],s)}},"J.c.STR,~S,~N,~N,~N,~N,~S,~N,~N,~S,~A,~A,JU.BS");c$.$Resolver$BondSorter$=function(){ea(self.c$);c$=y(function(){ha(this,arguments);x(this,arguments)},JM.Resolver,"BondSorter",null,java.util.Comparator);h(c$,
"compare",function(a,b){return null==b?null==a?0:-1:null==a?1:0>a[0].compareTo(b[0])?-1:0<a[0].compareTo(b[0])?1:0>a[3].compareTo(b[3])?-1:0<a[3].compareTo(b[3])?1:0>a[1].compareTo(b[1])?-1:0<a[1].compareTo(b[1])?1:0},"~A,~A");c$=da()}});n("JM");v(["JM.Group"],"JM.Monomer","java.lang.Float JU.P3 $.Quat J.c.STR JU.Logger $.Measure JV.JC".split(" "),function(){c$=y(function(){this.offsets=this.bioPolymer=null;this.monomerIndex=0;this.theta=this.mu=this.straightness=this.omega=this.psi=this.phi=NaN;
x(this,arguments)},JM,"Monomer",JM.Group);c$.have=e(c$,"have",function(a,b){return 255!=(a[b]&255)},"~A,~N");e(c$,"set2",function(a,b,c,d,f,g){this.setGroup(a,b,c,d,f);this.offsets=g;a=this.offsets[0]&255;255!=a&&(this.leadAtomIndex=d+a);return this},"JM.Chain,~S,~N,~N,~N,~A");h(c$,"getGroups",function(){return this.bioPolymer.getGroups()});e(c$,"setBioPolymer",function(a,b){this.bioPolymer=a;this.monomerIndex=b},"JM.BioPolymer,~N");h(c$,"getSelectedMonomerCount",function(){return this.bioPolymer.getSelectedMonomerCount()});
h(c$,"getSelectedMonomerIndex",function(){return 0<=this.monomerIndex&&this.bioPolymer.isMonomerSelected(this.monomerIndex)?this.monomerIndex:-1});h(c$,"getBioPolymerLength",function(){return null==this.bioPolymer?0:this.bioPolymer.monomerCount});e(c$,"getMonomerIndex",function(){return this.monomerIndex});h(c$,"getAtomIndex",function(a,b){var c=this.getGroups(),d=this.monomerIndex+b;if(0<=d&&d<c.length){c=c[d];if(1==b&&!c.isConnectedPrevious())return-1;if("0".equals(a))return c.leadAtomIndex;for(var d=
this.chain.model.ms.at,f=c.firstAtomIndex;f<=c.lastAtomIndex;f++)if(null==a||a.equalsIgnoreCase(d[f].getAtomName()))return f}return-1},"~S,~N");e(c$,"getBioPolymerIndexInModel",function(){return null==this.bioPolymer?-1:this.bioPolymer.bioPolymerIndexInModel});c$.scanForOffsets=e(c$,"scanForOffsets",function(a,b,c){for(var d=c.length,f=ba(d,0);0<=--d;){var g,k=c[d];if(0>k)g=b[~k];else if(g=b[k],0>g)return null;var e;if(0>g)e=255;else if(e=g-a,0>e||254<e)JU.Logger.warn("Monomer.scanForOffsets i="+
d+" atomID="+k+" atomIndex:"+g+" firstAtomIndex:"+a+" offset out of 0-254 range. Groups aren't organized correctly. Is this really a protein?: "+e),0>k&&(e=255);f[d]=e}return f},"~N,~A,~A");h(c$,"getProteinStructureType",function(){return J.c.STR.NONE});e(c$,"isHelix",function(){return!1});e(c$,"isSheet",function(){return!1});h(c$,"setStrucNo",function(){},"~N");e(c$,"getAtomFromOffsetIndex",function(a){if(a>this.offsets.length)return null;a=this.offsets[a]&255;return 255==a?null:this.chain.getAtom(this.firstAtomIndex+
a)},"~N");e(c$,"getSpecialAtom",function(a,b){for(var c=a.length;0<=--c;){var d=a[c];0>d&&(d=-d);if(b==d){c=this.offsets[c]&255;if(255==c)break;return this.chain.getAtom(this.firstAtomIndex+c)}}return null},"~A,~N");e(c$,"getSpecialAtomPoint",function(a,b){for(var c=a.length;0<=--c;){var d=a[c];0>d&&(d=-d);if(b==d){c=this.offsets[c]&255;if(255==c)break;return this.chain.getAtom(this.firstAtomIndex+c)}}return null},"~A,~N");h(c$,"isLeadAtom",function(a){return a==this.leadAtomIndex},"~N");h(c$,"getLeadAtom",
function(){return this.getAtomFromOffsetIndex(0)});e(c$,"getWingAtom",function(){return this.getAtomFromOffsetIndex(1)});e(c$,"getInitiatorAtom",function(){return this.getLeadAtom()});e(c$,"getTerminatorAtom",function(){return this.getLeadAtom()});e(c$,"findNearestAtomIndex",function(){},"~N,~N,~A,~N,~N");e(c$,"calcBioParameters",function(){return this.bioPolymer.calcParameters()});e(c$,"haveParameters",function(){return this.bioPolymer.haveParameters});e(c$,"getMyInfo",function(a){a=this.getGroupInfo(this.groupIndex,
a);a.put("chain",this.chain.getIDStr());var b=this.getResno();0<b&&a.put("sequenceNumber",Integer.$valueOf(b));b=this.getInsertionCode();0!=b.charCodeAt(0)&&a.put("insertionCode",""+b);b=this.getGroupParameter(1112539145);Float.isNaN(b)||a.put("phi",Float.$valueOf(b));b=this.getGroupParameter(1112539146);Float.isNaN(b)||a.put("psi",Float.$valueOf(b));b=this.getGroupParameter(1112539141);Float.isNaN(b)||a.put("mu",Float.$valueOf(b));b=this.getGroupParameter(1112539152);Float.isNaN(b)||a.put("theta",
Float.$valueOf(b));b=this.getStructure();null!=b&&(a.put("structureId",Integer.$valueOf(b.strucNo)),a.put("structureType",b.type.getBioStructureTypeName(!1)));a.put("shapeVisibilityFlags",Integer.$valueOf(this.shapeVisibilityFlags));return a},"JU.P3");h(c$,"getStructureId",function(){var a=this.getStructure();return null==a?"":a.type.getBioStructureTypeName(!1)});e(c$,"getConformation",function(a,b,c){for(var d="\x00",f=this.firstAtomIndex;f<=this.lastAtomIndex;f++){var g=a[f].getAlternateLocationID();
"\x00"!=g&&(0<=c&&g!=d&&(d=g,c--),0>c&&g!=d&&b.clear(f))}},"~A,JU.BS,~N");e(c$,"updateOffsetsForAlternativeLocations",function(a,b){for(var c=this.offsets.length;0<=--c;){var d=this.offsets[c]&255;if(255!=d){var d=this.firstAtomIndex+d,f=a[d],g=f.getAtomID();if(0!=f.getAlternateLocationID().charCodeAt(0))for(var k=this.lastAtomIndex-this.firstAtomIndex,e=1;e<=k;e++){var j=d+e;j>this.lastAtomIndex&&(j-=k+1);var l=j-this.firstAtomIndex;if(!(0>l||255<l||j==d||!b.get(j))){var h=a[j].getAtomID();if(!(h!=
g||0==h&&!a[j].getAtomName().equals(f.getAtomName()))){JU.Logger.debugging&&JU.Logger.debug("Chain.udateOffsetsForAlternativeLocation "+a[j]+" was "+f);this.offsets[c]=l;break}}}}}},"~A,JU.BS");e(c$,"getMonomerSequenceAtoms",function(a,b){this.selectAtoms(b);b.and(a)},"JU.BS,JU.BS");c$.checkOptional=e(c$,"checkOptional",function(a,b,c,d){if(JM.Monomer.have(a,b))return!0;if(0>d)return!1;a[b]=d-c;return!0},"~A,~N,~N,~N");e(c$,"getQuaternionFrameCenter",function(){return null},"~S");e(c$,"getHelixData2",
function(a,b,c){var d=this.monomerIndex-c,f=1>c||0>=this.monomerIndex?null:this.bioPolymer.monomers[d],d=this.getQuaternion(b),g=1>c?JU.Quat.getQuaternionFrameV(JV.JC.axisX,JV.JC.axisY,JV.JC.axisZ,!1):null==f?null:f.getQuaternion(b);if(null==g||null==d)return this.getHelixData(a,b,c);var f=1>c?JU.P3.new3(0,0,0):f.getQuaternionFrameCenter(b),k=this.getQuaternionFrameCenter(b);return null==f||null==k?this.getHelixData(a,b,c):JU.Measure.computeHelicalAxis(135176==a?"helixaxis"+this.getUniqueID():null,
a,f,k,d.div(g))},"~N,~S,~N");e(c$,"getUniqueID",function(){var a=this.getChainID(),b=this.getLeadAtom(),a=(null==b?"":"_"+b.getModelIndex())+"_"+this.getResno()+(0==a?"":"_"+a),b=null==b?"\x00":this.getLeadAtom().getAlternateLocationID();"\x00"!=b&&(a+="_"+b);return a});h(c$,"isCrossLinked",function(a){for(var b=this.firstAtomIndex;b<=this.lastAtomIndex;b++)if(this.getCrossLinkGroup(b,null,a))return!0;return!1},"JM.Group");h(c$,"getCrossLinkLead",function(a){for(var b=this.firstAtomIndex;b<=this.lastAtomIndex;b++)if(this.getCrossLink(b,
a)&&null==a)return!0;return!1},"JU.Lst");e(c$,"getCrossLink",function(a,b){return this.getCrossLinkGroup(a,b,null)},"~N,JU.Lst");e(c$,"getCrossLinkGroup",function(a,b,c){a=this.chain.getAtom(a);var d=a.getBonds(),f=this.getBioPolymerIndexInModel();if(0>f||null==d)return!1;for(var g=!1,k=null==b&&null==c,e=0;e<d.length;e++){var j=d[e].getOtherAtom(a).getGroup();if(!(null!=c&&j!==c)){var l=j.getBioPolymerIndexInModel(),h=j.getMonomerIndex();if(k){if(l==f&&h==this.monomerIndex-1)return!0}else if(0<=
l&&0<=h&&(l!=f||h<this.monomerIndex-1||h>this.monomerIndex+1)){g=!0;if(null!=c)break;b.addLast(Integer.$valueOf(j.leadAtomIndex))}}}return g},"~N,JU.Lst,JM.Group");e(c$,"isConnectedPrevious",function(){return!0});e(c$,"setGroupParameter",function(a,b){switch(a){case 1112539145:this.phi=b;break;case 1112539146:this.psi=b;break;case 1112539144:this.omega=b;break;case 1112539141:this.mu=b;break;case 1112539152:this.theta=b;break;case 1112539150:this.straightness=b}},"~N,~N");h(c$,"getGroupParameter",
function(a){this.haveParameters()||this.calcBioParameters();switch(a){case 1073742029:return 1;case 1112539144:return this.omega;case 1112539145:return this.phi;case 1112539146:return this.psi;case 1112539141:return this.mu;case 1112539152:return this.theta;case 1112539150:return this.straightness}return NaN},"~N")});n("JM");v(["JM.Monomer"],"JM.AlphaMonomer","JU.Quat $.V3 J.c.STR JM.Helix $.Sheet $.Turn".split(" "),function(){c$=y(function(){this.nitrogenHydrogenPoint=this.proteinStructure=null;
x(this,arguments)},JM,"AlphaMonomer",JM.Monomer);h(c$,"isProtein",function(){return!0});c$.validateAndAllocateA=e(c$,"validateAndAllocateA",function(a,b,c,d,f,g){return d!=f||g[2]!=d?null:(new JM.AlphaMonomer).set2(a,b,c,d,f,JM.AlphaMonomer.alphaOffsets)},"JM.Chain,~S,~N,~N,~N,~A");Z(c$,function(){});e(c$,"isAlphaMonomer",function(){return!0});h(c$,"getStructure",function(){return this.proteinStructure});e(c$,"setStructure",function(a){if(null==(this.proteinStructure=a))this.nitrogenHydrogenPoint=
null},"JM.ProteinStructure");h(c$,"setStrucNo",function(a){null!=this.proteinStructure&&(this.proteinStructure.strucNo=a)},"~N");h(c$,"getProteinStructureType",function(){return null==this.proteinStructure?J.c.STR.NONE:this.proteinStructure.type});h(c$,"getProteinStructureSubType",function(){return null==this.proteinStructure?J.c.STR.NONE:this.proteinStructure.subtype});h(c$,"getStrucNo",function(){return null!=this.proteinStructure?this.proteinStructure.strucNo:0});h(c$,"isHelix",function(){return null!=
this.proteinStructure&&this.proteinStructure.type===J.c.STR.HELIX});h(c$,"isSheet",function(){return null!=this.proteinStructure&&this.proteinStructure.type===J.c.STR.SHEET});h(c$,"setProteinStructureType",function(a,b){null!=this.proteinStructure&&this.proteinStructure.removeMonomer(this.monomerIndex);if(0>b||0<b&&0==this.monomerIndex)switch(a){case J.c.STR.HELIX:case J.c.STR.HELIXALPHA:case J.c.STR.HELIX310:case J.c.STR.HELIXPI:this.setStructure(new JM.Helix(this.bioPolymer,this.monomerIndex,1,
a));break;case J.c.STR.SHEET:this.setStructure(new JM.Sheet(this.bioPolymer,this.monomerIndex,1,a));break;case J.c.STR.TURN:this.setStructure(new JM.Turn(this.bioPolymer,this.monomerIndex,1));break;case J.c.STR.NONE:this.setStructure(null)}else this.setStructure(this.bioPolymer.getProteinStructure(b)),null!=this.proteinStructure&&this.proteinStructure.addMonomer(this.monomerIndex);return this.monomerIndex},"J.c.STR,~N");e(c$,"getAtom",function(a){return 2==a?this.getLeadAtom():null},"~N");e(c$,"getAtomPoint",
function(a){return 2==a?this.getLeadAtom():null},"~N");h(c$,"isConnectedAfter",function(a){if(null==a)return!0;var b=this.getLeadAtom();a=a.getLeadAtom();return b.isBonded(a)||4.2>=b.distance(a)},"JM.Monomer");h(c$,"getQuaternionFrameCenter",function(a){return this.getQuaternionFrameCenterAlpha(a)},"~S");h(c$,"isWithinStructure",function(a){return null!=this.proteinStructure&&this.proteinStructure.type===a&&this.proteinStructure.isWithin(this.monomerIndex)},"J.c.STR");e(c$,"getQuaternionFrameCenterAlpha",
function(a){switch(a){case "b":case "c":case "C":case "x":return this.getLeadAtom();default:case "a":case "n":case "p":case "P":case "q":return null}},"~S");h(c$,"getHelixData",function(a,b,c){return this.getHelixData2(a,b,c)},"~N,~S,~N");h(c$,"getQuaternion",function(a){return this.getQuaternionAlpha(a)},"~S");e(c$,"getQuaternionAlpha",function(a){var b=new JU.V3,c=new JU.V3;switch(a){default:case "a":case "n":case "p":case "q":return null;case "b":case "c":case "x":if(0==this.monomerIndex||this.monomerIndex==
this.bioPolymer.monomerCount-1)return null;a=this.getLeadAtom();var d=this.bioPolymer.getLeadPoint(this.monomerIndex+1),f=this.bioPolymer.getLeadPoint(this.monomerIndex-1);b.sub2(d,a);c.sub2(f,a)}return JU.Quat.getQuaternionFrameV(b,c,null,!1)},"~S");G(c$,"alphaOffsets",[0])});n("JM");v(["JU.V3"],"JM.ProteinStructure",["java.util.Hashtable","JU.AU","$.P3","JU.Logger"],function(){c$=y(function(){this.structureID=this.subtype=this.type=null;this.strandCount=this.serialID=this.strucNo=0;this.apolymer=
null;this.nRes=this.monomerIndexFirst=0;this.vectorProjection=this.axisUnitVector=this.axisB=this.axisA=null;this.monomerIndexLast=0;this.resMap=this.segments=null;x(this,arguments)},JM,"ProteinStructure");S(c$,function(){this.vectorProjection=new JU.V3});e(c$,"setupPS",function(a,b,c,d){this.strucNo=++JM.ProteinStructure.globalStrucNo;this.apolymer=a;this.type=b;this.monomerIndexFirst=c;this.addMonomer(c+d-1);JU.Logger.debugging&&JU.Logger.info("Creating ProteinStructure "+this.strucNo+" "+b.getBioStructureTypeName(!1)+
" from "+this.monomerIndexFirst+" through "+this.monomerIndexLast+" in polymer "+a)},"JM.AlphaPolymer,J.c.STR,~N,~N");e(c$,"addMonomer",function(a){this.resMap=null;this.monomerIndexFirst=Math.min(this.monomerIndexFirst,a);this.monomerIndexLast=Math.max(this.monomerIndexLast,a);this.nRes=this.monomerIndexLast-this.monomerIndexFirst+1},"~N");e(c$,"removeMonomer",function(a){this.resMap=null;if(!(a>this.monomerIndexLast||a<this.monomerIndexFirst))if(a==this.monomerIndexFirst)this.monomerIndexFirst++,
this.nRes--;else if(a==this.monomerIndexLast)this.monomerIndexLast--,this.nRes--;else{var b=this.monomerIndexLast-a;this.monomerIndexLast=a-1;this.nRes=a-this.monomerIndexFirst;for(var c=this.apolymer.monomers,d=c[++a].getProteinStructureType(),f=-1,g=0;g<b;g++,a++)c[a].setStructure(null),f=c[a].setProteinStructureType(d,f)}},"~N");e(c$,"calcAxis",function(){});e(c$,"calcSegments",function(){if(null==this.segments){this.calcAxis();this.segments=Array(this.nRes+1);this.segments[this.nRes]=this.axisB;
this.segments[0]=this.axisA;var a=JU.V3.newV(this.axisUnitVector);a.scale(this.axisB.distance(this.axisA)/this.nRes);for(var b=1;b<this.nRes;b++)(this.segments[b]=new JU.P3).add2(this.segments[b-1],a)}});e(c$,"lowerNeighborIsHelixOrSheet",function(){return 0==this.monomerIndexFirst?!1:this.apolymer.monomers[this.monomerIndexFirst-1].isHelix()||this.apolymer.monomers[this.monomerIndexFirst-1].isSheet()});e(c$,"upperNeighborIsHelixOrSheet",function(){var a=this.monomerIndexFirst+this.nRes;return a==
this.apolymer.monomerCount?!1:this.apolymer.monomers[a].isHelix()||this.apolymer.monomers[a].isSheet()});e(c$,"getMonomerCount",function(){return this.nRes});e(c$,"isWithin",function(a){return a>this.monomerIndexFirst&&a<this.monomerIndexLast},"~N");e(c$,"getMonomerIndex",function(){return this.monomerIndexFirst});e(c$,"getIndex",function(a){if(null==this.resMap){this.resMap=new java.util.Hashtable;for(var b=this.nRes;0<=--b;)this.resMap.put(this.apolymer.monomers[this.monomerIndexFirst+b],Integer.$valueOf(b))}a=
this.resMap.get(a);return null==a?-1:a.intValue()},"JM.Monomer");e(c$,"getSegments",function(){null==this.segments&&this.calcSegments();return this.segments});e(c$,"getAxisStartPoint",function(){this.calcAxis();return this.axisA});e(c$,"getAxisEndPoint",function(){this.calcAxis();return this.axisB});e(c$,"getStructureMidPoint",function(a){null==this.segments&&this.calcSegments();return this.segments[a]},"~N");e(c$,"getInfo",function(a){a.put("type",this.type.getBioStructureTypeName(!1));var b=this.apolymer.getLeadAtomIndices(),
b=JU.AU.arrayCopyRangeI(b,this.monomerIndexFirst,this.monomerIndexFirst+this.nRes);a.put("leadAtomIndices",b);this.calcAxis();null!=this.axisA&&(a.put("axisA",this.axisA),a.put("axisB",this.axisB),a.put("axisUnitVector",this.axisUnitVector))},"java.util.Map");e(c$,"resetAxes",function(){this.segments=this.axisA=null});G(c$,"globalStrucNo",1E3)});n("JM");v(["JM.ProteinStructure"],"JM.Helix",["JU.P3","$.V3","J.c.STR","JU.Measure"],function(){c$=E(JM,"Helix",JM.ProteinStructure);H(c$,function(a,b,c,
d){R(this,JM.Helix,[]);this.setupPS(a,J.c.STR.HELIX,b,c);this.subtype=d},"JM.AlphaPolymer,~N,~N,J.c.STR");h(c$,"calcAxis",function(){if(null==this.axisA){for(var a=Array(this.nRes+1),b=0;b<=this.nRes;b++)this.apolymer.getLeadMidPoint(this.monomerIndexFirst+b,a[b]=new JU.P3);this.axisA=new JU.P3;this.axisUnitVector=new JU.V3;JU.Measure.calcBestAxisThroughPoints(a,this.axisA,this.axisUnitVector,this.vectorProjection,4);this.axisB=JU.P3.newP(a[this.nRes]);JU.Measure.projectOntoAxis(this.axisB,this.axisA,
this.axisUnitVector,this.vectorProjection)}})});n("JM");v(["JM.ProteinStructure"],"JM.Sheet",["JU.P3","$.V3","J.c.STR","JM.AminoPolymer","JU.Measure"],function(){c$=y(function(){this.heightUnitVector=this.widthUnitVector=this.alphaPolymer=null;x(this,arguments)},JM,"Sheet",JM.ProteinStructure);H(c$,function(a,b,c,d){R(this,JM.Sheet,[]);this.setupPS(a,J.c.STR.SHEET,b,c);this.alphaPolymer=a;this.subtype=d},"JM.AlphaPolymer,~N,~N,J.c.STR");h(c$,"calcAxis",function(){if(null==this.axisA){2==this.nRes?
(this.axisA=this.alphaPolymer.getLeadPoint(this.monomerIndexFirst),this.axisB=this.alphaPolymer.getLeadPoint(this.monomerIndexFirst+1)):(this.axisA=new JU.P3,this.alphaPolymer.getLeadMidPoint(this.monomerIndexFirst+1,this.axisA),this.axisB=new JU.P3,this.alphaPolymer.getLeadMidPoint(this.monomerIndexFirst+this.nRes-1,this.axisB));this.axisUnitVector=new JU.V3;this.axisUnitVector.sub2(this.axisB,this.axisA);this.axisUnitVector.normalize();var a=new JU.P3;this.alphaPolymer.getLeadMidPoint(this.monomerIndexFirst,
a);this.lowerNeighborIsHelixOrSheet()||JU.Measure.projectOntoAxis(a,this.axisA,this.axisUnitVector,this.vectorProjection);var b=new JU.P3;this.alphaPolymer.getLeadMidPoint(this.monomerIndexFirst+this.nRes,b);this.upperNeighborIsHelixOrSheet()||JU.Measure.projectOntoAxis(b,this.axisA,this.axisUnitVector,this.vectorProjection);this.axisA=a;this.axisB=b}});e(c$,"calcSheetUnitVectors",function(){if(A(this.alphaPolymer,JM.AminoPolymer)&&null==this.widthUnitVector){var a=new JU.V3,b=new JU.V3,c=this.alphaPolymer.monomers[this.monomerIndexFirst];
b.sub2(c.getCarbonylOxygenAtom(),c.getCarbonylCarbonAtom());for(var d=this.nRes;--d>this.monomerIndexFirst;)c=this.alphaPolymer.monomers[d],a.sub2(c.getCarbonylOxygenAtom(),c.getCarbonylCarbonAtom()),1.5707964>b.angle(a)?b.add(a):b.sub(a);this.heightUnitVector=a;this.heightUnitVector.cross(this.axisUnitVector,b);this.heightUnitVector.normalize();this.widthUnitVector=b;this.widthUnitVector.cross(this.axisUnitVector,this.heightUnitVector)}});e(c$,"getWidthUnitVector",function(){null==this.widthUnitVector&&
this.calcSheetUnitVectors();return this.widthUnitVector});e(c$,"getHeightUnitVector",function(){null==this.heightUnitVector&&this.calcSheetUnitVectors();return this.heightUnitVector})});n("JM");v(["JM.ProteinStructure"],"JM.Turn",["J.c.STR"],function(){c$=E(JM,"Turn",JM.ProteinStructure);H(c$,function(a,b,c){R(this,JM.Turn,[]);this.setupPS(a,J.c.STR.TURN,b,c);this.subtype=J.c.STR.TURN},"JM.AlphaPolymer,~N,~N")});n("JM");v(["JU.V3"],"JM.BioPolymer","java.lang.Float java.util.Hashtable JU.BS $.Lst $.P3 $.Quat JU.Escape $.Logger $.Txt".split(" "),
function(){c$=y(function(){this.monomers=null;this.hasStructure=!1;this.leadAtomIndices=this.wingVectors=this.controlPoints=this.leadPoints=this.leadMidpoints=this.model=null;this.monomerCount=this.bioPolymerIndexInModel=this.type=0;this.invalidControl=this.invalidLead=!1;this.sheetSmoothing=0;this.hasWingPoints=!1;this.reversed=null;this.twistedSheets=!1;this.unitVectorX=null;this.selectedMonomerCount=0;this.bsSelectedMonomers=null;this.haveParameters=!1;x(this,arguments)},JM,"BioPolymer");S(c$,
function(){this.unitVectorX=JU.V3.new3(1,0,0)});e(c$,"getGroups",function(){return this.monomers});H(c$,function(a){this.monomers=a;for(var b=this.monomerCount=a.length;0<=--b;)a[b].setBioPolymer(this,b);this.model=a[0].getModel()},"~A");e(c$,"getRange",function(a){0!=this.monomerCount&&a.setBits(this.monomers[0].firstAtomIndex,this.monomers[this.monomerCount-1].lastAtomIndex+1)},"JU.BS");e(c$,"clearStructures",function(){});e(c$,"getLeadAtomIndices",function(){null==this.leadAtomIndices&&(this.leadAtomIndices=
Q(this.monomerCount,0),this.invalidLead=!0);if(this.invalidLead){for(var a=this.monomerCount;0<=--a;)this.leadAtomIndices[a]=this.monomers[a].leadAtomIndex;this.invalidLead=!1}return this.leadAtomIndices});e(c$,"getIndex",function(a,b,c,d){var f;for(f=this.monomerCount;0<=--f;){var g=this.monomers[f];if(g.chain.chainID==a&&g.seqcode==b&&(0>c||c==g.firstAtomIndex||d==g.lastAtomIndex))break}return f},"~N,~N,~N,~N");e(c$,"getLeadPoint",function(a){return this.monomers[a].getLeadAtom()},"~N");e(c$,"getInitiatorPoint",
function(){return this.monomers[0].getInitiatorAtom()});e(c$,"getTerminatorPoint",function(){return this.monomers[this.monomerCount-1].getTerminatorAtom()});e(c$,"getLeadMidPoint",function(a,b){if(a==this.monomerCount)--a;else if(0<a){b.ave(this.getLeadPoint(a),this.getLeadPoint(a-1));return}b.setT(this.getLeadPoint(a))},"~N,JU.P3");e(c$,"getWingPoint",function(a){return this.monomers[a].getWingAtom()},"~N");e(c$,"getConformation",function(a,b){for(var c=this.model.getModelSet().at,d=this.monomerCount;0<=
--d;)this.monomers[d].getConformation(c,a,b);this.recalculateLeadMidpointsAndWingVectors()},"JU.BS,~N");e(c$,"setConformation",function(a){for(var b=this.model.getModelSet().at,c=this.monomerCount;0<=--c;)this.monomers[c].updateOffsetsForAlternativeLocations(b,a);this.recalculateLeadMidpointsAndWingVectors()},"JU.BS");e(c$,"recalculateLeadMidpointsAndWingVectors",function(){this.invalidLead=this.invalidControl=!0;this.getLeadAtomIndices();this.resetHydrogenPoints();this.calcLeadMidpointsAndWingVectors()});
e(c$,"resetHydrogenPoints",function(){});e(c$,"getLeadMidpoints",function(){null==this.leadMidpoints&&this.calcLeadMidpointsAndWingVectors();return this.leadMidpoints});e(c$,"getLeadPoints",function(){null==this.leadPoints&&this.calcLeadMidpointsAndWingVectors();return this.leadPoints});e(c$,"getControlPoints",function(a,b,c){c&&(this.invalidControl=!0);return!a?this.leadMidpoints:0==b?this.leadPoints:this.getControlPoints2(b)},"~B,~N,~B");e(c$,"getControlPoints2",function(a){if(!this.invalidControl&&
a==this.sheetSmoothing)return this.controlPoints;this.getLeadPoints();var b=new JU.V3;null==this.controlPoints&&(this.controlPoints=Array(this.monomerCount+1));Float.isNaN(a)||(this.sheetSmoothing=a);for(a=0;a<this.monomerCount;a++)this.controlPoints[a]=this.getControlPoint(a,b);this.controlPoints[this.monomerCount]=this.getTerminatorPoint();this.invalidControl=!1;return this.controlPoints},"~N");e(c$,"getControlPoint",function(a){return this.leadPoints[a]},"~N,JU.V3");e(c$,"getWingVectors",function(){null==
this.leadMidpoints&&this.calcLeadMidpointsAndWingVectors();return this.wingVectors});e(c$,"calcLeadMidpointsAndWingVectors",function(){null==this.leadMidpoints&&(this.leadMidpoints=Array(this.monomerCount+1),this.leadPoints=Array(this.monomerCount+1),this.wingVectors=Array(this.monomerCount+1),this.sheetSmoothing=1.4E-45);null==this.reversed?this.reversed=JU.BS.newN(this.monomerCount):this.reversed.clearAll();this.twistedSheets=this.model.ms.vwr.getBoolean(603979968);var a=new JU.V3,b=new JU.V3,c=
new JU.V3,d=new JU.V3,f,g;this.leadMidpoints[0]=this.getInitiatorPoint();this.leadPoints[0]=g=this.getLeadPoint(0);for(var k=null,e=1;e<this.monomerCount;++e){f=g;this.leadPoints[e]=g=this.getLeadPoint(e);var j=new JU.P3;j.ave(g,f);this.leadMidpoints[e]=j;this.hasWingPoints&&(a.sub2(g,f),b.sub2(f,this.getWingPoint(e-1)),c.cross(a,b),d.cross(a,c),d.normalize(),!this.twistedSheets&&(null!=k&&1.5707963267948966<k.angle(d))&&(this.reversed.set(e),d.scale(-1)),k=this.wingVectors[e]=JU.V3.newV(d))}this.leadPoints[this.monomerCount]=
this.leadMidpoints[this.monomerCount]=this.getTerminatorPoint();if(!this.hasWingPoints)if(3>this.monomerCount)this.wingVectors[1]=this.unitVectorX;else{d=null;for(e=1;e<this.monomerCount;++e)a.sub2(this.leadMidpoints[e],this.leadPoints[e]),b.sub2(this.leadPoints[e],this.leadMidpoints[e+1]),c.cross(a,b),c.normalize(),null!=d&&1.5707963267948966<d.angle(c)&&c.scale(-1),d=this.wingVectors[e]=JU.V3.newV(c)}this.wingVectors[0]=this.wingVectors[1];this.wingVectors[this.monomerCount]=this.wingVectors[this.monomerCount-
1]});e(c$,"findNearestAtomIndex",function(a,b,c,d,f,g){for(var k=this.monomerCount;0<=--k;)if(0!=(this.monomers[k].shapeVisibilityFlags&f)){var e=this.monomers[k].getLeadAtom();e.checkVisible()&&!(null!=g&&g.get(e.i))&&(0<d[k]||0<d[k+1])&&this.monomers[k].findNearestAtomIndex(a,b,c,d[k],d[k+1])}},"~N,~N,~A,~A,~N,JU.BS");e(c$,"getSelectedMonomerCount",function(){return this.selectedMonomerCount});e(c$,"calcSelectedMonomersCount",function(a){this.selectedMonomerCount=0;null==this.bsSelectedMonomers&&
(this.bsSelectedMonomers=new JU.BS);this.bsSelectedMonomers.clearAll();for(var b=0;b<this.monomerCount;b++)this.monomers[b].isSelected(a)&&(++this.selectedMonomerCount,this.bsSelectedMonomers.set(b))},"JU.BS");e(c$,"isMonomerSelected",function(a){return 0<=a&&this.bsSelectedMonomers.get(a)},"~N");e(c$,"getPolymerPointsAndVectors",function(a,b,c,d,f){d=this.getControlPoints(d,f,!1);f=this.getWingVectors();for(var g=this.monomerCount,k=0;k<g;k++)b.get(this.monomers[k].leadAtomIndex)?(c.addLast([d[k],
JU.P3.newP(f[k])]),a=k):2147483646!=a&&(c.addLast([d[k],JU.P3.newP(f[k])]),a=2147483646);a+1<g&&c.addLast([d[a+1],JU.P3.newP(f[a+1])]);return a},"~N,JU.BS,JU.Lst,~B,~N");e(c$,"getSequence",function(){for(var a=Y(this.monomerCount,"\x00"),b=0;b<this.monomerCount;b++)a[b]=this.monomers[b].getGroup1();return String.valueOf(a)});e(c$,"getPolymerInfo",function(a){for(var b=new java.util.Hashtable,c=new JU.Lst,d=null,f,g=null,k=0,e=new JU.P3,j=0;j<this.monomerCount;j++)if(a.get(this.monomers[j].leadAtomIndex)){var l=
this.monomers[j].getMyInfo(e);l.put("monomerIndex",Integer.$valueOf(j));c.addLast(l);if(null!=(f=this.getProteinStructure(j))&&f!==g)l=new java.util.Hashtable,(g=f).getInfo(l),null==d&&(d=new JU.Lst),l.put("index",Integer.$valueOf(k++)),d.addLast(l)}0<c.size()&&(b.put("sequence",this.getSequence()),b.put("monomers",c),null!=d&&b.put("structures",d));return b},"JU.BS");e(c$,"getPolymerSequenceAtoms",function(a,b,c,d){for(b=Math.min(this.monomerCount,a+b);--b>=a;)this.monomers[b].getMonomerSequenceAtoms(c,
d)},"~N,~N,JU.BS,JU.BS");e(c$,"getProteinStructure",function(){return null},"~N");e(c$,"calcParameters",function(){this.haveParameters=!0;return this.calcEtaThetaAngles()||this.calcPhiPsiAngles()});e(c$,"calcEtaThetaAngles",function(){return!1});e(c$,"calcPhiPsiAngles",function(){return!1});e(c$,"getPdbData",function(a,b,c,d,f,g,k,e,j,l,h,p,s,u,n){var r="C"==c||"P"==c,q="R"==b||"S"==b&&r;if(!q||this.calcPhiPsiAngles()){var v=1==this.type,w="r"==b,t=!q&&"S"==b;2==f&&w&&(b="w");t&&(f=2);var x="S"==
b,y=0<="rcpCP".indexOf(c);JU.Logger.debugging&&(t||r)&&JU.Logger.debug("For straightness calculation: useQuaternionStraightness = "+x+" and quaternionFrame = "+c);if(l&&!j){p.append("REMARK   6    AT GRP CH RESNO  ");switch(b){default:case "w":p.append("x*10___ y*10___ z*10___      w*10__       ");break;case "x":p.append("y*10___ z*10___ w*10___      x*10__       ");break;case "y":p.append("z*10___ w*10___ x*10___      y*10__       ");break;case "z":p.append("w*10___ x*10___ y*10___      z*10__       ");
break;case "R":y?p.append("phi____ psi____ theta         Straightness"):p.append("phi____ psi____ omega-180    PartialCharge")}p.append("    Sym   q0_______ q1_______ q2_______ q3_______");p.append("  theta_  aaX_______ aaY_______ aaZ_______");"R"!=b&&p.append("  centerX___ centerY___ centerZ___");"n"==c&&p.append("  NHX_______ NHY_______ NHZ_______");p.append("\n\n")}l="R"==b?1:10;e=!1;for(var A=0;A<(e?2:1);A++,l*=-1)for(var z=0;z<(1>d?1:d);z++)this.getData(a,z,d,this,b,c,f,g,k,j,q,r,x,y,t,l,v,w,
h,p,s,u,n)}},"JV.Viewer,~S,~S,~N,~N,JU.BS,JU.BS,~B,~B,~B,~A,JU.OC,JU.SB,JU.BS,JU.P3");e(c$,"getData",function(a,b,c,d,f,g,e,h,j,l,m,p,s,u,n,r,q,v,w,t,x,y,A){if(this.hasStructure){n=0<e?"dq"+(2==e?"2":""):"q";for(var z,H=null,G=null,M=null,E=null,F=null,L=null,N=M=0,B=0,K=0,D="",Q=NaN,R=NaN,P=l?new JU.P3:null,T=1>=c?1:c;b<d.monomerCount;b+=T){var I=d.monomers[b];if(null==h||h.get(I.leadAtomIndex)){var O=I.getLeadAtom(),D=I.getUniqueID();if(m){"S"==f&&I.setGroupParameter(1112539150,NaN);M=I.getGroupParameter(1112539145);
N=I.getGroupParameter(1112539146);B=I.getGroupParameter(1112539144);-90>B&&(B+=360);B-=180;if(Float.isNaN(M)||Float.isNaN(N)||Float.isNaN(B)){null!=h&&h.clear(O.i);continue}var U=u?d.calculateRamachandranHelixAngle(b,g):0,S=p||u?JM.BioPolymer.getStraightness(Math.cos(3.141592653589793*(U/2/180))):0;if("S"==f){I.setGroupParameter(1112539150,S);continue}if(l){if(null!=j&&!j.get(O.getIndex()))continue;P.set(-M,M,0.5);t.append('draw ID "phi').append(D).append('" ARROW ARC ').append(JU.Escape.eP(I.getNitrogenAtom())).append(JU.Escape.eP(O)).append(JU.Escape.eP(I.getCarbonylCarbonAtom())).append(JU.Escape.eP(P)).append(' "phi = ').append(String.valueOf(Math.round(M))).append('" color ').append(JM.BioPolymer.qColor[2]).append("\n");
P.set(0,N,0.5);t.append('draw ID "psi').append(D).append('" ARROW ARC ').append(JU.Escape.eP(O)).append(JU.Escape.eP(I.getCarbonylCarbonAtom())).append(JU.Escape.eP(I.getNitrogenAtom())).append(JU.Escape.eP(P)).append(' "psi = ').append(String.valueOf(Math.round(N))).append('" color ').append(JM.BioPolymer.qColor[1]).append("\n");t.append('draw ID "planeNCC').append(D).append('" ').append(JU.Escape.eP(I.getNitrogenAtom())).append(JU.Escape.eP(O)).append(JU.Escape.eP(I.getCarbonylCarbonAtom())).append(" color ").append(JM.BioPolymer.qColor[0]).append("\n");
t.append('draw ID "planeCNC').append(D).append('" ').append(JU.Escape.eP(d.monomers[b-1].getCarbonylCarbonAtom())).append(JU.Escape.eP(I.getNitrogenAtom())).append(JU.Escape.eP(O)).append(" color ").append(JM.BioPolymer.qColor[1]).append("\n");t.append('draw ID "planeCCN').append(D).append('" ').append(JU.Escape.eP(O)).append(JU.Escape.eP(I.getCarbonylCarbonAtom())).append(JU.Escape.eP(d.monomers[b+1].getNitrogenAtom())).append(" color ").append(JM.BioPolymer.qColor[2]).append("\n");continue}if(Float.isNaN(U)){if(D=
"",u)continue}else z=JU.Quat.newVA(JU.P3.new3(1,0,0),U),D=JM.BioPolymer.getQInfo(z),u?(B=U,K=S):K=O.getPartialCharge()}else{z=I.getQuaternion(g);null!=z&&(z.setRef(F),F=JU.Quat.newQ(z));2==e&&I.setGroupParameter(1112539150,NaN);null==z?F=G=null:0<e&&(N=O,B=z,null==G?E=z=null:(M=v?G.leftDifference(z):z.rightDifference(G),1==e?z=M:null==E?z=null:(z=M.rightDifference(E),Q=JM.BioPolymer.getQuaternionStraightness(D,E,M),R=JM.BioPolymer.get3DStraightness(D,E,M),H.getGroup().setGroupParameter(1112539150,
s?Q:R)),E=M),H=N,G=B);if(null==z){L=null;continue}switch(f){default:M=z.q1;N=z.q2;B=z.q3;K=z.q0;break;case "x":M=z.q0;N=z.q1;B=z.q2;K=z.q3;break;case "y":M=z.q3;N=z.q0;B=z.q1;K=z.q2;break;case "z":M=z.q2,N=z.q3,B=z.q0,K=z.q1}U=I.getQuaternionFrameCenter(g);null==U&&(U=new JU.P3);if(l){if(null!=j&&!j.get(O.getIndex()))continue;O=C(Math.floor(360*Math.acos(K)/3.141592653589793));0==e&&(t.append(JU.Escape.drawQuat(z,n,D,U,1)),"n"==g&&q&&(z=I.getNitrogenHydrogenPoint(),null!=z&&t.append('draw ID "').append(n).append("nh").append(D).append('" width 0.1 ').append(JU.Escape.eP(z)).append("\n")));
if(1==e){t.append(I.getHelixData(135176,g,c)).append("\n");continue}P.set(2*M,2*N,2*B);t.append('draw ID "').append(n).append("a").append(D).append('" VECTOR ').append(JU.Escape.eP(U)).append(JU.Escape.eP(P)).append(' ">').append(String.valueOf(O)).append('" color ').append(JM.BioPolymer.qColor[e]).append("\n");continue}D=JM.BioPolymer.getQInfo(z)+JU.Txt.sprintf("  %10.5p %10.5p %10.5p","p",[U]);"n"==g&&q?D+=JU.Txt.sprintf("  %10.5p %10.5p %10.5p","p",[I.getNitrogenHydrogenPoint()]):2==e&&!Float.isNaN(Q)&&
(D+=JU.Txt.sprintf(" %10.5f %10.5f","F",[[Q,R]]))}null!=t&&(y.set(O.getGroup().leadAtomIndex),t.append(a.ms.getLabeler().formatLabelAtomArray(a,O,w,"\x00",null,A)),t.append(JU.Txt.sprintf("%8.2f%8.2f%8.2f      %6.3f          %2s    %s\n","ssF",[O.getElementSymbolIso(!1).toUpperCase(),D,[M*r,N*r,B*r,K*r]])),null!=L&&L.getPolymerIndexInModel()==O.getPolymerIndexInModel()&&x.append("CONECT").append(JU.Txt.formatStringI("%5i","i",L.getAtomNumber())).append(JU.Txt.formatStringI("%5i","i",O.getAtomNumber())).appendC("\n"),
L=O)}}}},"JV.Viewer,~N,~N,JM.BioPolymer,~S,~S,~N,JU.BS,JU.BS,~B,~B,~B,~B,~B,~B,~N,~B,~B,~A,JU.OC,JU.SB,JU.BS,JU.P3");e(c$,"drawQuat",function(a,b,c,d,f){d=" VECTOR "+JU.Escape.eP(d)+" ";0==f&&(f=1);return"draw "+b+"x"+c+d+JU.Escape.eP(a.getVectorScaled(0,f))+" color red\ndraw "+b+"y"+c+d+JU.Escape.eP(a.getVectorScaled(1,f))+" color green\ndraw "+b+"z"+c+d+JU.Escape.eP(a.getVectorScaled(2,f))+" color blue\n"},"JU.Quat,~S,~S,JU.P3,~N");c$.getQInfo=e(c$,"getQInfo",function(a){var b=a.toAxisAngle4f();
return JU.Txt.sprintf("%10.6f%10.6f%10.6f%10.6f  %6.2f  %10.5f %10.5f %10.5f","F",[[a.q0,a.q1,a.q2,a.q3,180*b.angle/3.141592653589793,b.x,b.y,b.z]])},"JU.Quat");e(c$,"calculateRamachandranHelixAngle",function(){return NaN},"~N,~S");c$.get3DStraightness=e(c$,"get3DStraightness",function(a,b,c){return b.getNormal().dot(c.getNormal())},"~S,JU.Quat,JU.Quat");c$.getQuaternionStraightness=e(c$,"getQuaternionStraightness",function(a,b,c){return JM.BioPolymer.getStraightness(b.dot(c))},"~S,JU.Quat,JU.Quat");
c$.getStraightness=e(c$,"getStraightness",function(a){return 1-2*Math.acos(Math.abs(a))/3.141592653589793},"~N");e(c$,"isRna",function(){return 0<this.monomerCount&&this.monomers[0].isRna()});e(c$,"isNucleic",function(){return 0<this.monomerCount&&(this.monomers[0].isDna()||this.monomers[0].isRna())});e(c$,"getRangeGroups",function(a,b,c){for(var d=new JU.BS,f=0;f<this.monomerCount;f++)this.monomers[f].isSelected(b)&&(d.setBits(Math.max(0,f-a),f+a+1),f+=a-1);for(f=d.nextSetBit(0);0<=f&&f<this.monomerCount;f=
d.nextSetBit(f+1))this.monomers[f].selectAtoms(c)},"~N,JU.BS,JU.BS");e(c$,"calcRasmolHydrogenBonds",function(){},"JM.BioPolymer,JU.BS,JU.BS,JU.Lst,~N,~A,~B,~B");e(c$,"setStructureList",function(){},"java.util.Map");e(c$,"getType",function(){return this.type});e(c$,"calculateStruts",function(){return null},"JM.ModelSet,JU.BS,JU.BS,JU.Lst,~N,~N,~B");G(c$,"TYPE_NOBONDING",0,"TYPE_AMINO",1,"TYPE_NUCLEIC",2,"TYPE_CARBOHYDRATE",3,"qColor",["yellow","orange","purple"])});n("JM");v(["java.lang.Enum","JM.BioPolymer"],
"JM.AlphaPolymer","JU.BS $.Lst $.P3 J.c.STR JM.Helix $.Sheet $.Turn JU.Logger $.Measure".split(" "),function(){c$=E(JM,"AlphaPolymer",JM.BioPolymer);H(c$,function(a){R(this,JM.AlphaPolymer,[a]);this.hasStructure=!0},"~A");h(c$,"getProteinStructure",function(a){return this.monomers[a].getStructure()},"~N");h(c$,"getControlPoint",function(a,b){if(!this.monomers[a].isSheet())return this.leadPoints[a];b.sub2(this.leadMidpoints[a],this.leadPoints[a]);b.scale(this.sheetSmoothing);var c=JU.P3.newP(this.leadPoints[a]);
c.add(b);return c},"~N,JU.V3");e(c$,"addStructure",function(a,b,c,d,f,g,e,h,j,l,m){var p=-1,s=-1;if(j<l){if(this.monomers[0].firstAtomIndex>l||this.monomers[this.monomerCount-1].lastAtomIndex<j)return;p=j;s=l}var u;if(!(-1==(f=this.getIndex(f,g,p,s))||-1==(u=this.getIndex(e,h,p,s)))){if(0<=j&&null!=m&&(e=m.nextSetBit(this.monomers[f].firstAtomIndex),0<=e&&e<this.monomers[u].lastAtomIndex))return;this.addStructureProtected(a,b,c,d,f,u);0<=j&&m.setBits(j,l+1)}},"J.c.STR,~S,~N,~N,~N,~N,~N,~N,~N,~N,JU.BS");
e(c$,"addStructureProtected",function(a,b,c,d,f,g){if(g<f)JU.Logger.error("AlphaPolymer:addSecondaryStructure error:  indexStart:"+f+" indexEnd:"+g);else{var e=g-f+1,h=null;switch(a){case J.c.STR.HELIX:case J.c.STR.HELIXALPHA:case J.c.STR.HELIX310:case J.c.STR.HELIXPI:h=new JM.Helix(this,f,e,a);break;case J.c.STR.SHEET:h=new JM.Sheet(this,f,e,a);break;case J.c.STR.TURN:h=new JM.Turn(this,f,e);break;default:JU.Logger.error("unrecognized secondary structure type");return}h.structureID=b;h.serialID=
c;h.strandCount=d;for(a=f;a<=g;++a)this.monomers[a].setStructure(h)}},"J.c.STR,~S,~N,~N,~N,~N");h(c$,"clearStructures",function(){for(var a=0;a<this.monomerCount;a++)this.monomers[a].setStructure(null)});h(c$,"calculateStruts",function(a,b,c,d,f,g,e){return this.calculateStrutsStatic(a,b,c,d,f,g,e)},"JM.ModelSet,JU.BS,JU.BS,JU.Lst,~N,~N,~B");e(c$,"calculateStrutsStatic",function(a,b,c,d,f,g,e){var h=new JU.Lst,j=f*f,l=d.size(),m=new JU.BS,p=new JU.BS,s=new JU.BS,u=d.get(0),n;a=a.getBioPolymerCountInModel(u.mi);
for(var r=Q(a,6,0),q=0;q<l;q++){var u=d.get(q),v=u.getPolymerIndexInModel(),w=u.getMonomerIndex(),t=w;3>t&&(r[v][t]=q+1);t=u.getGroup().getBioPolymerLength()-w-1;3>t&&(r[v][3+t]=q+1)}v=T(C(l*(l-1)/2),0);for(q=0;q<l;q++){u=d.get(q);for(w=q+1;w<l;w++){t=JM.AlphaPolymer.strutPoint(q,w,l);n=d.get(w);var x=u.getResno(),y=u.getPolymerIndexInModel(),A=n.getResno(),z=n.getPolymerIndexInModel();y==z&&Math.abs(A-x)<g&&s.set(t);(v[t]=u.distanceSquared(n))>=j&&p.set(t)}}for(u=5;0<=--u;){j=(f-u)*(f-u);for(q=0;q<
l;q++)if(e||!m.get(q))for(w=q+1;w<l;w++)t=JM.AlphaPolymer.strutPoint(q,w,l),!p.get(t)&&(!s.get(t)&&(e||!m.get(w))&&v[t]<=j)&&JM.AlphaPolymer.setStrut(q,w,l,d,b,c,h,m,p,s,g)}for(f=0;f<a;f++){for(e=0;6>e;e++)if(q=r[f][e]-1,0<=q&&m.get(q))for(w=0;3>w;w++)t=3*C(e/3)+w,0<=(q=r[f][t]-1)&&m.set(q),r[f][t]=-1;if(!(-1==r[f][0]&&-1==r[f][3])){for(var u=j=!1,A=y=x=n=0,E=z=3.4028235E38,w=0;w<l;w++)for(e=0;6>e;e++)if(q=r[f][e]-1,-2==q)e=3*(C(e/3)+1)-1;else if(!(w==q||-1==q))if(t=JM.AlphaPolymer.strutPoint(q,w,
l),!(s.get(t)||v[t]>(3>e?z:E)))3>e?(p.get(t)&&(j=!0),x=w,n=q,z=v[t]):(p.get(t)&&(u=!0),A=w,y=q,E=v[t]);j&&JM.AlphaPolymer.setStrut(n,x,l,d,b,c,h,m,p,s,g);u&&JM.AlphaPolymer.setStrut(y,A,l,d,b,c,h,m,p,s,g)}}return h},"JM.ModelSet,JU.BS,JU.BS,JU.Lst,~N,~N,~B");c$.strutPoint=e(c$,"strutPoint",function(a,b,c){return b<a?C(b*(2*c-b-1)/2)+a-b-1:C(a*(2*c-a-1)/2)+b-a-1},"~N,~N,~N");c$.setStrut=e(c$,"setStrut",function(a,b,c,d,f,g,e,h,j,l,m){var p=d.get(a);d=d.get(b);if(f.get(p.i)&&g.get(d.i)){e.addLast([p,
d]);h.set(a);h.set(b);for(f=Math.max(0,a-m);f<=a+m&&f<c;f++)for(g=Math.max(0,b-m);g<=b+m&&g<c;g++)f!=g&&(e=JM.AlphaPolymer.strutPoint(f,g,c),l.get(e)||j.set(e))}},"~N,~N,~N,JU.Lst,JU.BS,JU.BS,JU.Lst,JU.BS,JU.BS,JU.BS,~N");e(c$,"calculateStructures",function(){if(!(4>this.monomerCount)){var a=this.calculateAnglesInDegrees(),b=this.calculateCodes(a);this.checkBetaSheetAlphaHelixOverlap(b,a);var c=this.calculateRunsFourOrMore(b);this.extendRuns(c);this.searchForTurns(b,a,c);this.addStructuresFromTags(c)}},
"~B");e(c$,"calculateAnglesInDegrees",function(){for(var a=T(this.monomerCount,0),b=this.monomerCount-1;2<=--b;)a[b]=JU.Measure.computeTorsion(this.monomers[b-2].getLeadAtom(),this.monomers[b-1].getLeadAtom(),this.monomers[b].getLeadAtom(),this.monomers[b+1].getLeadAtom(),!0);return a});e(c$,"calculateCodes",function(a){for(var b=Array(this.monomerCount),c=this.monomerCount-1;2<=--c;){var d=a[c];b[c]=10<=d&&120>d?JM.AlphaPolymer.Code.RIGHT_HELIX:120<=d||-90>d?JM.AlphaPolymer.Code.BETA_SHEET:-90<=
d&&0>d?JM.AlphaPolymer.Code.LEFT_HELIX:JM.AlphaPolymer.Code.NADA}return b},"~A");e(c$,"checkBetaSheetAlphaHelixOverlap",function(a,b){for(var c=this.monomerCount-2;2<=--c;)a[c]===JM.AlphaPolymer.Code.BETA_SHEET&&(140>=b[c]&&a[c-2]===JM.AlphaPolymer.Code.RIGHT_HELIX&&a[c-1]===JM.AlphaPolymer.Code.RIGHT_HELIX&&a[c+1]===JM.AlphaPolymer.Code.RIGHT_HELIX&&a[c+2]===JM.AlphaPolymer.Code.RIGHT_HELIX)&&(a[c]=JM.AlphaPolymer.Code.RIGHT_HELIX)},"~A,~A");e(c$,"calculateRunsFourOrMore",function(a){for(var b=Array(this.monomerCount),
c=J.c.STR.NONE,d=JM.AlphaPolymer.Code.NADA,f=0,g=0;g<this.monomerCount;++g)if(a[g]===d&&d!==JM.AlphaPolymer.Code.NADA&&d!==JM.AlphaPolymer.Code.BETA_SHEET)if(++f,4==f)for(var c=d===JM.AlphaPolymer.Code.BETA_SHEET?J.c.STR.SHEET:J.c.STR.HELIX,e=4;0<=--e;)b[g-e]=c;else 4<f&&(b[g]=c);else f=1,d=a[g];return b},"~A");e(c$,"extendRuns",function(a){for(var b=1;b<this.monomerCount-4;++b)a[b]===J.c.STR.NONE&&a[b+1]!==J.c.STR.NONE&&(a[b]=a[b+1]);a[0]=a[1];a[this.monomerCount-1]=a[this.monomerCount-2]},"~A");
e(c$,"searchForTurns",function(a,b,c){for(var d=this.monomerCount-1;2<=--d;)if(a[d]=JM.AlphaPolymer.Code.NADA,null==c[d]||c[d]===J.c.STR.NONE){var f=b[d];-90<=f&&0>f?a[d]=JM.AlphaPolymer.Code.LEFT_TURN:0<=f&&90>f&&(a[d]=JM.AlphaPolymer.Code.RIGHT_TURN)}for(d=this.monomerCount-1;0<=--d;)a[d]!==JM.AlphaPolymer.Code.NADA&&(a[d+1]===a[d]&&c[d]===J.c.STR.NONE)&&(c[d]=J.c.STR.TURN)},"~A,~A,~A");e(c$,"addStructuresFromTags",function(a){for(var b=0;b<this.monomerCount;){var c=a[b];if(null==c||c===J.c.STR.NONE)++b;
else{var d;for(d=b+1;d<this.monomerCount&&a[d]===c;++d);this.addStructureProtected(c,null,0,0,b,d-1);b=d}}},"~A");ea(self.c$);c$=E(JM.AlphaPolymer,"Code",Enum);W(c$,"NADA",0,[]);W(c$,"RIGHT_HELIX",1,[]);W(c$,"BETA_SHEET",2,[]);W(c$,"LEFT_HELIX",3,[]);W(c$,"LEFT_TURN",4,[]);W(c$,"RIGHT_TURN",5,[]);c$=da()});n("JM");v(["JM.AlphaMonomer"],"JM.AminoMonomer","JU.A4 $.M3 $.P3 $.Quat $.V3 J.c.STR JU.Escape $.Logger $.Txt".split(" "),function(){c$=y(function(){this.nhChecked=!1;this.ptTemp=null;x(this,arguments)},
JM,"AminoMonomer",JM.AlphaMonomer);Z(c$,function(){});c$.validateAndAllocate=e(c$,"validateAndAllocate",function(a,b,c,d,f,g,e){var h=JM.Monomer.scanForOffsets(d,g,JM.AminoMonomer.interestingAminoAtomIDs);if(null==h)return null;JM.Monomer.checkOptional(h,1,d,g[5]);return e[d].isHetero()&&!JM.AminoMonomer.isBondedCorrectly(d,h,e)?null:(new JM.AminoMonomer).set2(a,b,c,d,f,h)},"JM.Chain,~S,~N,~N,~N,~A,~A");c$.isBondedCorrectlyRange=e(c$,"isBondedCorrectlyRange",function(a,b,c,d,f){a=c+(d[a]&255);b=c+
(d[b]&255);return a!=b&&f[a].isBonded(f[b])},"~N,~N,~N,~A,~A");c$.isBondedCorrectly=e(c$,"isBondedCorrectly",function(a,b,c){return JM.AminoMonomer.isBondedCorrectlyRange(2,0,a,b,c)&&JM.AminoMonomer.isBondedCorrectlyRange(0,3,a,b,c)&&(!JM.Monomer.have(b,1)||JM.AminoMonomer.isBondedCorrectlyRange(3,1,a,b,c))},"~N,~A,~A");e(c$,"isAminoMonomer",function(){return!0});h(c$,"getNitrogenAtom",function(){return this.getAtomFromOffsetIndex(2)});e(c$,"getCarbonylCarbonAtom",function(){return this.getAtomFromOffsetIndex(3)});
h(c$,"getCarbonylOxygenAtom",function(){return this.getWingAtom()});h(c$,"getInitiatorAtom",function(){return this.getNitrogenAtom()});h(c$,"getTerminatorAtom",function(){return this.getAtomFromOffsetIndex(JM.Monomer.have(this.offsets,4)?4:3)});e(c$,"hasOAtom",function(){return JM.Monomer.have(this.offsets,1)});h(c$,"isConnectedAfter",function(a){return null==a?!0:a.getCarbonylCarbonAtom().isBonded(this.getNitrogenAtom())},"JM.Monomer");h(c$,"findNearestAtomIndex",function(a,b,c,d,f){var g=c[0],e=
this.getNitrogenAtom();d=C(d/2);1200>d&&(d=1200);if(0!=e.sZ){d=F(this.scaleToScreen(e.sZ,d));4>d&&(d=4);var h=this.getCarbonylCarbonAtom();f=C(f/2);1200>f&&(f=1200);f=F(this.scaleToScreen(e.sZ,f));4>f&&(f=4);var j=this.getLeadAtom();if(this.isCursorOnTopOf(j,a,b,C((d+f)/2),g)||this.isCursorOnTopOf(e,a,b,d,g)||this.isCursorOnTopOf(h,a,b,f,g))c[0]=j}},"~N,~N,~A,~N,~N");e(c$,"resetHydrogenPoint",function(){this.nhChecked=!1;this.nitrogenHydrogenPoint=null});e(c$,"getNitrogenHydrogenPoint",function(){null==
this.nitrogenHydrogenPoint&&!this.nhChecked&&(this.nhChecked=!0,this.nitrogenHydrogenPoint=this.getExplicitNH());return this.nitrogenHydrogenPoint});e(c$,"getExplicitNH",function(){var a=this.getNitrogenAtom(),b=null,c=a.getBonds();if(null==c)return null;for(var d=0;d<c.length;d++)if(1==(b=c[d].getOtherAtom(a)).getElementNumber())return b;return null});e(c$,"getNHPoint",function(a,b,c,d){if(0==this.monomerIndex||15==this.groupID)return!1;var f=this.getNitrogenAtom(),g=this.getNitrogenHydrogenPoint();
if(null!=g&&!d)return b.sub2(g,f),a.setT(g),!0;d=this.bioPolymer.monomers[this.monomerIndex-1];if(c)b.sub2(f,this.getLeadAtom()),b.normalize(),c=JU.V3.newVsub(f,d.getCarbonylCarbonAtom()),c.normalize(),b.add(c);else{c=d.getCarbonylOxygenAtom();if(null==c)return!1;b.sub2(d.getCarbonylCarbonAtom(),c)}b.normalize();a.add2(f,b);this.nitrogenHydrogenPoint=JU.P3.newP(a);JU.Logger.debugging&&JU.Logger.debug('draw ID "pta'+this.monomerIndex+"_"+f.i+'" '+JU.Escape.eP(f)+JU.Escape.eP(a)+" # "+f);return!0},
"JU.P3,JU.V3,~B,~B");h(c$,"getQuaternionFrameCenter",function(a){switch(a){default:case "a":case "b":case "c":case "C":return this.getQuaternionFrameCenterAlpha(a);case "n":return this.getNitrogenAtom();case "p":case "P":return this.getCarbonylCarbonAtom();case "q":if(this.monomerIndex==this.bioPolymer.monomerCount-1)return null;a=this.bioPolymer.getGroups()[this.monomerIndex+1];var b=new JU.P3;b.ave(this.getCarbonylCarbonAtom(),a.getNitrogenAtom());return b}},"~S");h(c$,"getQuaternion",function(a){var b=
this.getCarbonylCarbonAtom(),c=this.getLeadAtom(),d=new JU.V3,f=new JU.V3,g=null;switch(a){case "a":case "n":if(0==this.monomerIndex||15==this.groupID)return null;g=new JU.V3;null==this.ptTemp&&(this.ptTemp=new JU.P3);this.getNHPoint(this.ptTemp,g,!0,!1);f.sub2(c,this.getNitrogenAtom());f.cross(g,f);(new JU.M3).setAA(JU.A4.newVA(f,-0.29670596)).rotate(g);d.cross(f,g);break;case "b":return this.getQuaternionAlpha("b");case "c":d.sub2(b,c);f.sub2(this.getNitrogenAtom(),c);break;case "p":case "x":if(this.monomerIndex==
this.bioPolymer.monomerCount-1)return null;d.sub2(c,b);f.sub2(this.bioPolymer.getGroups()[this.monomerIndex+1].getNitrogenAtom(),b);break;case "q":if(this.monomerIndex==this.bioPolymer.monomerCount-1)return null;a=this.bioPolymer.getGroups()[this.monomerIndex+1];f.sub2(a.getLeadAtom(),a.getNitrogenAtom());d.sub2(c,b);break;default:return null}return JU.Quat.getQuaternionFrameV(d,f,g,!1)},"~S");h(c$,"getStructureId",function(){return null==this.proteinStructure||null==this.proteinStructure.structureID?
"":this.proteinStructure.structureID});h(c$,"getProteinStructureTag",function(){if(null==this.proteinStructure||null==this.proteinStructure.structureID)return null;var a;a=JU.Txt.formatStringI("%3N %3ID","N",this.proteinStructure.serialID);a=JU.Txt.formatStringS(a,"ID",this.proteinStructure.structureID);this.proteinStructure.type===J.c.STR.SHEET&&(a+=JU.Txt.formatStringI("%2SC","SC",this.proteinStructure.strandCount));return a});G(c$,"CA",0,"O",1,"N",2,"C",3,"OT",4,"interestingAminoAtomIDs",[2,-5,
1,3,-65],"beta",0.29670597283903605)});n("JM");v(["JM.AlphaPolymer"],"JM.AminoPolymer","JU.P3 $.V3 J.c.STR JM.HBond JU.Logger $.Measure".split(" "),function(){c$=y(function(){this.structureList=null;x(this,arguments)},JM,"AminoPolymer",JM.AlphaPolymer);H(c$,function(a){R(this,JM.AminoPolymer,[a]);this.type=1;for(var b=0;b<this.monomerCount;++b)if(!a[b].hasOAtom())return;this.hasWingPoints=!0},"~A");h(c$,"resetHydrogenPoints",function(){for(var a,b=null,c=0;c<this.monomerCount;c++){if(null!=(a=this.getProteinStructure(c))&&
a!==b)(b=a).resetAxes();this.monomers[c].resetHydrogenPoint()}});h(c$,"calcPhiPsiAngles",function(){for(var a=0;a<this.monomerCount-1;++a)this.calcPhiPsiAngles2(this.monomers[a],this.monomers[a+1]);return!0});e(c$,"calcPhiPsiAngles2",function(a,b){var c=a.getNitrogenAtom(),d=a.getLeadAtom(),f=a.getCarbonylCarbonAtom(),g=b.getNitrogenAtom(),e=b.getLeadAtom(),h=b.getCarbonylCarbonAtom();b.setGroupParameter(1112539145,JU.Measure.computeTorsion(f,g,e,h,!0));a.setGroupParameter(1112539146,JU.Measure.computeTorsion(c,
d,f,g,!0));a.setGroupParameter(1112539144,JU.Measure.computeTorsion(d,f,g,e,!0))},"JM.AminoMonomer,JM.AminoMonomer");h(c$,"calculateRamachandranHelixAngle",function(a,b){var c=0==a?NaN:this.monomers[a-1].getGroupParameter(1112539146),d=this.monomers[a].getGroupParameter(1112539146),f=this.monomers[a].getGroupParameter(1112539145),g=a==this.monomerCount-1?NaN:this.monomers[a+1].getGroupParameter(1112539145),e=a==this.monomerCount-1?NaN:this.monomers[a+1].getGroupParameter(1112539146);switch(b){default:case "p":case "r":case "P":return c=
3.141592653589793*((g-f)/2)/180,d=3.141592653589793*((e-d)/2)/180,114.59155902616465*Math.acos(Math.cos(d)*Math.cos(c)-Math.sin(d)*Math.sin(c)/3);case "c":case "C":return d-c+g-f}},"~N,~S");h(c$,"calcRasmolHydrogenBonds",function(a,b,c,d,f,g,e,h){null==a&&(a=this);if(A(a,JM.AminoPolymer)){f=new JU.P3;for(var j=new JU.V3,l,m=null==g?Q(2,3,0):null,p=1;p<this.monomerCount;++p)if(null==g?(m[0][0]=m[1][0]=this.bioPolymerIndexInModel,m[0][1]=m[1][1]=-2147483648,m[0][2]=m[1][2]=0):m=g[p],(l=this.monomers[p]).getNHPoint(f,
j,e,h)){var s=null==b||b.get(l.getNitrogenAtom().i);if(s&&(e||null!=l.getCarbonylOxygenAtom()))this.checkRasmolHydrogenBond(l,a,p,f,s?c:b,d,m,e)}}},"JM.BioPolymer,JU.BS,JU.BS,JU.Lst,~N,~A,~B,~B");e(c$,"checkRasmolHydrogenBond",function(a,b,c,d,f,g,e,h){var j=a.getLeadAtom(),l=a.getNitrogenAtom();a=a.getNitrogenAtom();for(var m,p=b.monomerCount;0<=--p;)if(!(b===this&&(p==c||p+1==c))){m=b.monomers[p];var s=m.getCarbonylOxygenAtom();if(!(null==s||null!=f&&!f.get(s.i)))if(s=m.getLeadAtom(),!(81<=j.distanceSquared(s))){s=
this.calcHbondEnergy(l,d,m,h);if(s<e[0][2])m=e[1],e[1]=e[0],e[0]=m;else if(s<e[1][2])m=e[1];else continue;m[0]=b.bioPolymerIndexInModel;m[1]=-500>s?p:-1-p;m[2]=s}}if(null!=g)for(p=0;2>p;p++)0<=e[p][1]&&this.addResidueHydrogenBond(a,b.monomers[e[p][1]].getCarbonylOxygenAtom(),b===this?c:-99,e[p][1],e[p][2]/1E3,g)},"JM.AminoMonomer,JM.BioPolymer,~N,JU.P3,JU.BS,JU.Lst,~A,~B");e(c$,"calcHbondEnergy",function(a,b,c,d){var f=c.getCarbonylOxygenAtom();if(null==f)return 0;var g=f.distanceSquared(a);if(0.25>
g)return 0;f=f.distanceSquared(b);if(0.25>f)return 0;c=c.getCarbonylCarbonAtom();b=c.distanceSquared(b);if(0.25>b)return 0;c=c.distanceSquared(a);if(0.25>c)return 0;a=Math.sqrt(f);f=Math.sqrt(b);b=Math.sqrt(c);g=Math.sqrt(g);g=JM.HBond.getEnergy(a,f,b,g);return!(-500>g&&(!d||b>f&&3>=a))&&d||-9900>g?0:g},"JU.P3,JU.P3,JM.AminoMonomer,~B");e(c$,"addResidueHydrogenBond",function(a,b,c,d,f,g){switch(c-d){case 2:c=6144;break;case 3:c=8192;break;case 4:c=10240;break;case 5:c=12288;break;case -3:c=14336;
break;case -4:c=16384;break;default:c=4096}g.addLast(new JM.HBond(a,b,c,1,0,f))},"JM.Atom,JM.Atom,~N,~N,~N,JU.Lst");h(c$,"calculateStructures",function(a){if(!a){null==this.structureList&&(this.structureList=this.model.getModelSet().getStructureList());a=Y(this.monomerCount,"\x00");for(var b=0;b<this.monomerCount-1;++b){var c=this.monomers[b],d=this.monomers[b+1],f=d.getGroupParameter(1112539145),g=c.getGroupParameter(1112539146);a[b]=this.isHelix(g,f)?0>f&&25>g?"4":"3":this.isSheet(g,f)?"s":this.isTurn(g,
f)?"t":"n";JU.Logger.debugging&&JU.Logger.debug(0+this.monomers[0].getChainID()+" aminopolymer:"+b+" "+d.getGroupParameter(1112539145)+","+c.getGroupParameter(1112539146)+" "+a[b])}for(b=0;b<this.monomerCount;++b)if("4"==a[b]){for(c=b+1;c<this.monomerCount&&"4"==a[c];++c);c--;c>=b+3&&this.addStructureProtected(J.c.STR.HELIX,null,0,0,b,c);b=c}for(b=0;b<this.monomerCount;++b)if("3"==a[b]){for(c=b+1;c<this.monomerCount&&"3"==a[c];++c);c--;c>=b+3&&this.addStructureProtected(J.c.STR.HELIX,null,0,0,b,c);
b=c}for(b=0;b<this.monomerCount;++b)if("s"==a[b]){for(c=b+1;c<this.monomerCount&&"s"==a[c];++c);c--;c>=b+2&&this.addStructureProtected(J.c.STR.SHEET,null,0,0,b,c);b=c}for(b=0;b<this.monomerCount;++b)if("t"==a[b]){for(c=b+1;c<this.monomerCount&&"t"==a[c];++c);c--;c>=b+2&&this.addStructureProtected(J.c.STR.TURN,null,0,0,b,c);b=c}}},"~B");e(c$,"isTurn",function(a,b){return JM.AminoPolymer.checkPhiPsi(this.structureList.get(J.c.STR.TURN),a,b)},"~N,~N");e(c$,"isSheet",function(a,b){return JM.AminoPolymer.checkPhiPsi(this.structureList.get(J.c.STR.SHEET),
a,b)},"~N,~N");e(c$,"isHelix",function(a,b){return JM.AminoPolymer.checkPhiPsi(this.structureList.get(J.c.STR.HELIX),a,b)},"~N,~N");c$.checkPhiPsi=e(c$,"checkPhiPsi",function(a,b,c){for(var d=0;d<a.length;d+=4)if(c>=a[d]&&c<=a[d+1]&&b>=a[d+2]&&b<=a[d+3])return!0;return!1},"~A,~N,~N");h(c$,"setStructureList",function(a){this.structureList=a},"java.util.Map");G(c$,"maxHbondAlphaDistance",9,"maxHbondAlphaDistance2",81,"minimumHbondDistance2",0.25)});n("JM");v(["JM.Model"],"JM.BioModel","java.lang.Float java.util.Hashtable JU.AU $.BS $.Lst $.P3 $.SB J.api.Interface J.c.STR JM.AtomCollection JM.AlphaPolymer $.AminoPolymer $.Monomer $.Resolver JU.BSUtil $.Escape $.Txt JV.Viewer".split(" "),
function(){c$=y(function(){this.bioPolymerCount=0;this.bioPolymers=null;x(this,arguments)},JM,"BioModel",JM.Model);H(c$,function(a,b,c,d,f,g){R(this,JM.BioModel,[a,b,c,d,f,g]);this.isBioModel=!0;this.clearBioPolymers()},"JM.ModelSet,~N,~N,~S,java.util.Properties,java.util.Map");h(c$,"freeze",function(){this.freezeM();this.bioPolymers=JU.AU.arrayCopyObject(this.bioPolymers,this.bioPolymerCount)});e(c$,"addSecondaryStructure",function(a,b,c,d,f,g,e,h,j,l,m){for(var p=this.bioPolymerCount;0<=--p;)A(this.bioPolymers[p],
JM.AlphaPolymer)&&this.bioPolymers[p].addStructure(a,b,c,d,f,g,e,h,j,l,m)},"J.c.STR,~S,~N,~N,~N,~N,~N,~N,~N,~N,JU.BS");h(c$,"calculateStructures",function(a,b,c,d,f){if(0==this.bioPolymerCount||!d&&!a)return"";this.ms.proteinStructureTainted=this.structureTainted=!0;if(d)for(var g=this.bioPolymerCount;0<=--g;)(!a||null!=this.bioPolymers[g].getGroups()[0].getNitrogenAtom())&&this.bioPolymers[g].clearStructures();if(!a||f)for(g=this.bioPolymerCount;0<=--g;)A(this.bioPolymers[g],JM.AlphaPolymer)&&this.bioPolymers[g].calculateStructures(f);
return a?this.calculateDssx(null,b,c,d):""},"~B,~B,~B,~B,~B");e(c$,"calculateDssx",function(a,b,c,d){for(var f=!1,g=!1,e=0;e<this.bioPolymerCount&&(!f||!g);e++)this.bioPolymers[e].isNucleic()?g=!0:A(this.bioPolymers[e],JM.AminoPolymer)&&(f=!0);e="";f&&J.api.Interface.getOption("dssx.DSSP").calculateDssp(this.bioPolymers,this.bioPolymerCount,a,b,c,d);g&&(this.auxiliaryInfo.containsKey("dssr")&&null!=a)&&(e+=this.ms.vwr.getDSSRParser().getHBonds(this.ms,this.modelIndex,a,b));return e},"JU.Lst,~B,~B,~B");
h(c$,"setConformation",function(a){if(0<this.nAltLocs)for(var b=this.bioPolymerCount;0<=--b;)this.bioPolymers[b].setConformation(a)},"JU.BS");h(c$,"getPdbConformation",function(a,b){if(0<this.nAltLocs)for(var c=this.bioPolymerCount;0<=--c;)this.bioPolymers[c].getConformation(a,b);return!0},"JU.BS,~N");h(c$,"getBioPolymerCount",function(){return this.bioPolymerCount});h(c$,"calcSelectedMonomersCount",function(a){for(var b=this.bioPolymerCount;0<=--b;)this.bioPolymers[b].calcSelectedMonomersCount(a)},
"JU.BS");e(c$,"getBioPolymer",function(a){return this.bioPolymers[a]},"~N");h(c$,"getDefaultLargePDBRendering",function(a,b){var c=new JU.BS;0==this.getBondCount()&&(c=this.bsAtoms);if(c!==this.bsAtoms)for(var d=0;d<this.bioPolymerCount;d++)this.bioPolymers[d].getRange(c);if(!(0>c.nextSetBit(0))){var f=new JU.BS;if(c===this.bsAtoms)f=c;else for(d=0;d<this.bioPolymerCount;d++)0==this.bioPolymers[d].getType()&&this.bioPolymers[d].getRange(f);0<=f.nextSetBit(0)&&a.append("select ").append(JU.Escape.eBS(f)).append(";backbone only;");
this.ac<=b||(a.append("select ").append(JU.Escape.eBS(c)).append(" & connected; wireframe only;"),c!==this.bsAtoms&&(f.clearAll(),f.or(this.bsAtoms),f.andNot(c),0<=f.nextSetBit(0)&&a.append("select "+JU.Escape.eBS(f)+" & !connected;stars 0.5;spacefill off;")))}},"JU.SB,~N");h(c$,"fixIndices",function(a,b,c){this.fixIndicesM(a,b,c);for(a=0;a<this.bioPolymerCount;a++)this.bioPolymers[a].recalculateLeadMidpointsAndWingVectors()},"~N,~N,JU.BS");h(c$,"calculateStruts",function(a,b,c){var d=new JU.Lst,
f=null,g;b.equals(c)?g=b:(g=JU.BSUtil.copy(b),g.or(c));var e=a.at,h=a.vwr;g.and(h.getModelUndeletedAtomsBitSet(this.modelIndex));for(var j=g.nextSetBit(0);0<=j;j=g.nextSetBit(j+1))e[j].checkVisible()&&(2==e[j].atomID&&5!=e[j].getGroupID())&&d.addLast(f=e[j]);if(0==d.size())return 0;j=h.getFloat(570425408);g=$(2E3*h.getFloat(570425406));e=h.getInt(553648184);h=h.getBoolean(603979955);b=this.getBioPolymer(f.getPolymerIndexInModel()).calculateStruts(a,b,c,d,j,e,h);for(j=0;j<b.size();j++)c=b.get(j),a.bondAtoms(c[0],
c[1],32768,g,null,0,!1,!0);return b.size()},"JM.ModelSet,JU.BS,JU.BS");h(c$,"setStructureList",function(a){this.bioPolymers=JU.AU.arrayCopyObject(this.bioPolymers,this.bioPolymerCount);for(var b=this.bioPolymerCount;0<=--b;)this.bioPolymers[b].setStructureList(a)},"java.util.Map");h(c$,"calculateStraightness",function(a,b,c,d){for(var f=new JU.P3,g=0;g<this.bioPolymerCount;g++)this.bioPolymers[g].getPdbData(a,b,c,d,2,null,null,!1,!1,!1,null,null,null,new JU.BS,f)},"JV.Viewer,~S,~S,~N");h(c$,"getPolymerPointsAndVectors",
function(a,b,c,d){for(var f=2147483646,g=0;g<this.bioPolymerCount;g++)f=this.bioPolymers[g].getPolymerPointsAndVectors(f,a,b,c,d)},"JU.BS,JU.Lst,~B,~N");h(c$,"getPolymerLeadMidPoints",function(a){return this.bioPolymers[a].getLeadMidpoints()},"~N");h(c$,"recalculateLeadMidpointsAndWingVectors",function(){for(var a=0;a<this.bioPolymerCount;a++)this.bioPolymers[a].recalculateLeadMidpointsAndWingVectors()});h(c$,"getBioBranches",function(a){for(var b,c=0;c<this.bioPolymerCount;c++)b=new JU.BS,this.bioPolymers[c].getRange(b),
0<=b.nextSetBit(0)&&(null==a&&(a=new JU.Lst),a.addLast(b));return a},"JU.Lst");h(c$,"getGroupsWithin",function(a,b,c){for(var d=this.bioPolymerCount;0<=--d;)this.bioPolymers[d].getRangeGroups(a,b,c)},"~N,JU.BS,JU.BS");h(c$,"getSequenceBits",function(a,b,c){for(var d=a.length,f=0;f<this.bioPolymerCount;f++)for(var g=this.bioPolymers[f].getSequence(),e=-1;0<=(e=g.indexOf(a,++e));)this.bioPolymers[f].getPolymerSequenceAtoms(e,d,b,c)},"~S,JU.BS,JU.BS");h(c$,"selectSeqcodeRange",function(a,b,c,d,f){for(var g,
e=this.chainCount;0<=--e;){var h=this.chains[e];if(-1==c||c==(g=h.chainID)||!f&&256>g&&c==JM.AtomCollection.chainToUpper(g))for(h=0;0<=h;)h=this.chains[e].selectSeqcodeRange(h,a,b,d)}},"~N,~N,~N,JU.BS,~B");h(c$,"getRasmolHydrogenBonds",function(a,b,c,d,f,g,e){var h=null==c;h&&(c=new JU.Lst);0>f&&(f=2147483647);var j,l;if(null==b&&0<this.bioPolymerCount)this.calculateDssx(c,!1,g,!1);else for(g=this.bioPolymerCount;0<=--g;){j=this.bioPolymers[g];var m=j.getType();if(!((d||1!=m)&&2!=m)){var p=j.isRna();
1==m&&j.calcRasmolHydrogenBonds(null,a,b,c,f,null,!0,!1);for(var s=this.bioPolymerCount;0<=--s;)null!=(l=this.bioPolymers[s])&&((p||g!=s)&&m==l.getType())&&l.calcRasmolHydrogenBonds(j,a,b,c,f,null,!0,!1)}}if(0!=c.size()&&h){this.hasRasmolHBonds=!0;for(g=0;g<c.size();g++)a=c.get(g),b=a.getAtom1(),d=a.getAtom2(),b.isBonded(d)||(a=this.ms.addHBond(b,d,a.order,a.getEnergy()),null!=e&&e.set(a))}},"JU.BS,JU.BS,JU.Lst,~B,~N,~B,JU.BS");h(c$,"clearRasmolHydrogenBonds",function(a){var b=new JU.BS;this.hasRasmolHBonds=
!1;for(var c=this.ms.am,d=this.ms.bo,f=this.ms.bondCount;0<=--f;){var g=d[f],e=g.getAtom1(),h=c[e.mi];if(h.isBioModel&&!(h.trajectoryBaseIndex!=this.modelIndex||0==(g.order&28672)))null!=a&&!a.get(e.i)?this.hasRasmolHBonds=!0:b.set(f)}0<=b.nextSetBit(0)&&this.ms.deleteBonds(b,!1)},"JU.BS");h(c$,"calculatePolymers",function(a,b,c,d,f){null==a&&(a=this.ms.getGroups(),b=a.length);if(null!=d)for(var g=0;g<b;++g){var e=a[g];A(e,JM.Monomer)&&null!=e.bioPolymer&&!d.get(e.getModelIndex())&&e.setBioPolymer(null,
-1)}for(g=c;g<b;++g)d=a[g],c=d.getModel(),c.isBioModel&&A(d,JM.Monomer)&&(e=f&&!this.ms.isJmolDataFrameForModel(this.ms.at[d.firstAtomIndex].mi),d=null==d.bioPolymer?JM.Resolver.allocateBioPolymer(a,g,e):null,null==d||0==d.monomerCount||(c.addBioPolymer(d),g+=d.monomerCount-1))},"~A,~N,~N,JU.BS,~B");e(c$,"addBioPolymer",function(a){0==this.bioPolymers.length&&this.clearBioPolymers();this.bioPolymerCount==this.bioPolymers.length&&(this.bioPolymers=JU.AU.doubleLength(this.bioPolymers));a.bioPolymerIndexInModel=
this.bioPolymerCount;this.bioPolymers[this.bioPolymerCount++]=a},"JM.BioPolymer");h(c$,"clearBioPolymers",function(){this.bioPolymers=Array(8);this.bioPolymerCount=0});h(c$,"getAllPolymerInfo",function(a,b,c){b=new java.util.Hashtable;for(var d=new JU.Lst,f=0;f<this.bioPolymerCount;f++){var g=this.bioPolymers[f].getPolymerInfo(a);g.isEmpty()||d.addLast(g)}0<d.size()&&(b.put("modelIndex",Integer.$valueOf(this.modelIndex)),b.put("polymers",d),c.addLast(b))},"JU.BS,java.util.Map,JU.Lst");h(c$,"getChimeInfo",
function(a,b){var c=0,d=this.ms.am,f=this.ms.mc,g=this.ms.getAtomCount(),e=this.ms.at;a.append("\nMolecule name ....... "+this.ms.getInfoM("COMPND"));a.append("\nSecondary Structure . PDB Data Records");a.append("\nBrookhaven Code ..... "+this.ms.modelSetName);for(var h=f;0<=--h;)c+=d[h].getChainCount(!1);a.append("\nNumber of Chains .... "+c);c=0;for(h=f;0<=--h;)c+=d[h].getGroupCountHetero(!1);b=0;for(h=f;0<=--h;)b+=d[h].getGroupCountHetero(!0);a.append("\nNumber of Groups .... "+c);0<b&&a.append(" ("+
b+")");for(h=g;0<=--h;)e[h].isHetero()&&b++;this.getChimeInfoM(a,b);for(var f=d=c=0,j,l=-1,h=0;h<g&&0==e[h].mi;h++)if((j=e[h].getStrucNo())!=l&&0!=j)switch(l=j,e[h].getProteinStructureType()){case J.c.STR.HELIX:c++;break;case J.c.STR.SHEET:d++;break;case J.c.STR.TURN:f++}a.append("\nNumber of Helices ... "+c);a.append("\nNumber of Strands ... "+d);a.append("\nNumber of Turns ..... "+f)},"JU.SB,~N");h(c$,"getProteinStructureState",function(a,b,c,d){var f=3==d,g=1==d;d=0==d;var e=null,h=new JU.SB,j=
new JU.SB,l=new JU.SB,m=new JU.SB,p=J.c.STR.NONE,s=J.c.STR.NONE,u=0,n=0,r=-1,q=-1,v=0,w=0,t="",x="",y="",A="",z="",C=0,E=0,G=0,H=0,F=null,u=this.ms.am,L=this.ms.at,N=this.ms.getAtomCount();if(b){if(!this.ms.proteinStructureTainted)return"";for(var F=new JU.BS,B=this.firstAtomIndex;B<N;B++)u[L[B].mi].isStructureTainted()&&F.set(B);F.set(N)}for(B=0;B<=N;B++)if((B==N||null==a||a.get(B))&&(!b||F.get(B))){u=0;if(B==N||(u=L[B].getStrucNo())!=q){if(null!=e){switch(p){case J.c.STR.HELIX:case J.c.STR.TURN:case J.c.STR.SHEET:if(C++,
d){var K=L[n].mi,D="    \t# model="+this.ms.getModelNumberDotted(K);r!=K&&(r=K,h.append("  structure none ").append(JU.Escape.eBS(this.ms.getModelAtomBitSetIncludingDeleted(K,!1))).append(D).append(";\n"));D+=" & ("+v+" - "+w+")";K=s.getBioStructureTypeName(!1);h.append("  structure ").append(K).append(" ").append(JU.Escape.eBS(e)).append(D).append(";\n")}else{switch(p){case J.c.STR.HELIX:e=++E;if(null==t||g)t=JU.Txt.formatStringI("%3N %3N","N",e);e="HELIX  %ID %3GROUPA %1CA %4RESA  %3GROUPB %1CB %4RESB";
D=l;K=null;switch(s){case J.c.STR.HELIX:case J.c.STR.HELIXALPHA:K="  1";break;case J.c.STR.HELIX310:K="  5";break;case J.c.STR.HELIXPI:K="  3"}null!=K&&(e+=K);break;case J.c.STR.SHEET:e=++H;if(null==t||g)t=JU.Txt.formatStringI("%3N %3A 0","N",e),t=JU.Txt.formatStringS(t,"A","S"+e);e="SHEET  %ID %3GROUPA %1CA%4RESA  %3GROUPB %1CB%4RESB";D=m;break;default:e=++G;if(null==t||g)t=JU.Txt.formatStringI("%3N %3N","N",e);e="TURN   %ID %3GROUPA %1CA%4RESA  %3GROUPB %1CB%4RESB";D=j}e=JU.Txt.formatStringS(e,
"ID",t);e=JU.Txt.formatStringS(e,"GROUPA",x);e=JU.Txt.formatStringS(e,"CA",A);e=JU.Txt.formatStringI(e,"RESA",v);e=JU.Txt.formatStringS(e,"GROUPB",y);e=JU.Txt.formatStringS(e,"CB",z);e=JU.Txt.formatStringI(e,"RESB",w);D.append(e);f&&D.append(" strucno= ").appendI(q);D.append("\n")}}e=null}if(0==u||null!=a&&c&&(Float.isNaN(L[B].getGroupParameter(1112539145))||Float.isNaN(L[B].getGroupParameter(1112539146))))continue}n=L[B].getChainIDStr();null==e&&(e=new JU.BS,v=L[B].getResno(),x=L[B].getGroup3(!1),
A=n);p=L[B].getProteinStructureType();s=L[B].getProteinStructureSubType();t=L[B].getProteinStructureTag();e.set(B);q=u;w=L[B].getResno();y=L[B].getGroup3(!1);z=n;n=B}0<C&&h.append("\n");return d?h.toString():l.appendSB(m).appendSB(j).appendSB(h).toString()},"JU.BS,~B,~B,~N");h(c$,"getFullPDBHeader",function(){if(0>this.modelIndex)return"";var a=this.auxiliaryInfo.get("fileHeader");if(null!=a)return a;for(var a=this.ms.vwr.getCurrentFileAsString(),b=a.length,c=JM.BioModel.pdbRecords.length;0<=--c;){var d;
d=JM.BioModel.pdbRecords[c];switch(d=a.startsWith(d)?0:a.indexOf("\n"+d)){case -1:continue;case 0:return this.auxiliaryInfo.put("fileHeader",""),"";default:d<b&&(b=++d)}}a=a.substring(0,b);this.auxiliaryInfo.put("fileHeader",a);return a});h(c$,"getPdbData",function(a,b,c,d,f,e,k,h,j){var l=!1,m="R"!=c?"r":13<b.length&&0<=b.indexOf("ramachandran ")?b.charAt(13):"R";"r"==m&&(m=a.getQuaternionFrame());var p=a.getInt(553648146),s=0>b.indexOf("diff")?0:0>b.indexOf("2")?1:2;d||(e.append("REMARK   6 Jmol PDB-encoded data: "+
b+";"),"R"!=c&&(e.append('  quaternionFrame = "'+m+'"'),l=!0),e.append("\nREMARK   6 Jmol Version ").append(JV.Viewer.getJmolVersion()).append("\n"),"R"==c?e.append("REMARK   6 Jmol data min = {-180 -180 -180} max = {180 180 180} unScaledXyz = xyz * {1 1 1} + {0 0 0} plotScale = {100 100 100}\n"):e.append("REMARK   6 Jmol data min = {-1 -1 -1} max = {1 1 1} unScaledXyz = xyz * {0.1 0.1 0.1} + {0 0 0} plotScale = {100 100 100}\n"));b=new JU.P3;for(var u=0;u<this.bioPolymerCount;u++)this.bioPolymers[u].getPdbData(a,
c,m,p,s,this.bsAtoms,f,l,d,0==u,k,e,h,j,b)},"JV.Viewer,~S,~S,~B,JU.BS,JU.OC,~A,JU.SB,JU.BS");G(c$,"pdbRecords",["ATOM  ","MODEL ","HETATM"])});n("JM");v(["JM.Monomer"],"JM.CarbohydrateMonomer",["J.c.STR"],function(){c$=E(JM,"CarbohydrateMonomer",JM.Monomer);Z(c$,function(){});c$.validateAndAllocate=e(c$,"validateAndAllocate",function(a,b,c,d,f){return(new JM.CarbohydrateMonomer).set2(a,b,c,d,f,JM.CarbohydrateMonomer.alphaOffsets)},"JM.Chain,~S,~N,~N,~N");h(c$,"isCarbohydrate",function(){return!0});
h(c$,"getProteinStructureType",function(){return J.c.STR.CARBOHYDRATE});h(c$,"isConnectedAfter",function(a){if(null==a)return!0;for(var b=this.firstAtomIndex;b<=this.lastAtomIndex;b++)for(var c=a.firstAtomIndex;c<=a.lastAtomIndex;c++){var d=this.chain.getAtom(b),f=this.chain.getAtom(c);if(14==d.getElementNumber()+f.getElementNumber()&&3.24>d.distanceSquared(f))return!0}return!1},"JM.Monomer");h(c$,"findNearestAtomIndex",function(a,b,c,d){var f=c[0],e=this.getLeadAtom();d=C(d/2);1200>d&&(d=1200);0!=
e.sZ&&(d=F(this.scaleToScreen(e.sZ,d)),4>d&&(d=4),this.isCursorOnTopOf(e,a,b,d,f)&&(c[0]=e))},"~N,~N,~A,~N,~N");h(c$,"isConnectedPrevious",function(){if(0>=this.monomerIndex)return!1;for(var a=this.firstAtomIndex;a<=this.lastAtomIndex;a++)if(this.getCrossLink(a,null))return!0;return!1});G(c$,"alphaOffsets",[0])});n("JM");v(["JM.BioPolymer"],"JM.CarbohydratePolymer",null,function(){c$=E(JM,"CarbohydratePolymer",JM.BioPolymer);H(c$,function(a){R(this,JM.CarbohydratePolymer,[a]);this.type=3},"~A")});
n("JM");v(["JM.Monomer"],"JM.PhosphorusMonomer",["JU.Quat","$.V3","J.c.STR"],function(){c$=y(function(){this.$isPyrimidine=this.$isPurine=!1;x(this,arguments)},JM,"PhosphorusMonomer",JM.Monomer);h(c$,"isNucleic",function(){return!0});Z(c$,function(){});c$.validateAndAllocateP=e(c$,"validateAndAllocateP",function(a,b,c,d,f,e){return d!=f||e[13]!=d?null:(new JM.PhosphorusMonomer).set3(a,b,c,d,f,JM.PhosphorusMonomer.phosphorusOffsets)},"JM.Chain,~S,~N,~N,~N,~A");e(c$,"set3",function(a,b,c,d,f,e){this.set2(a,
b,c,d,f,e);0<=b.indexOf("T")&&(a.isDna=!0);-2<b.indexOf("U")+b.indexOf("I")&&(a.isRna=!0);this.$isPurine=-3<b.indexOf("A")+b.indexOf("G")+b.indexOf("I");this.$isPyrimidine=-3<b.indexOf("T")+b.indexOf("C")+b.indexOf("U");return this},"JM.Chain,~S,~N,~N,~N,~A");e(c$,"getP",function(){return this.getAtomFromOffsetIndex(0)});e(c$,"isPhosphorusMonomer",function(){return!0});h(c$,"isDna",function(){return this.chain.isDna});h(c$,"isRna",function(){return this.chain.isRna});h(c$,"isPurine",function(){return this.$isPurine});
h(c$,"isPyrimidine",function(){return this.$isPyrimidine});h(c$,"getStructure",function(){return this.chain});h(c$,"getProteinStructureType",function(){return J.c.STR.NONE});h(c$,"isConnectedAfter",function(a){return this.isCA2(a)},"JM.Monomer");e(c$,"isCA2",function(a){return null==a?!0:this.getLeadAtom().distance(a.getLeadAtom())<=JM.PhosphorusMonomer.MAX_ADJACENT_PHOSPHORUS_DISTANCE},"JM.Monomer");h(c$,"getQuaternion",function(){return this.getQuaternionP()},"~S");e(c$,"getQuaternionP",function(){var a=
this.monomerIndex;if(0==a||a>=this.bioPolymer.monomerCount-1)return null;var b=this.bioPolymer.monomers[a].getAtomFromOffsetIndex(0),c;c=this.bioPolymer.monomers[a+1].getAtomFromOffsetIndex(0);a=this.bioPolymer.monomers[a-1].getAtomFromOffsetIndex(0);if(null==b||null==c||null==a)return null;var d=new JU.V3,f=new JU.V3;d.sub2(c,b);f.sub2(a,b);return JU.Quat.getQuaternionFrameV(d,f,null,!1)});h(c$,"getQuaternionFrameCenter",function(){return this.getAtomFromOffsetIndex(0)},"~S");h(c$,"getHelixData",
function(a,b,c){return this.getHelixData2(a,b,c)},"~N,~S,~N");G(c$,"P",0,"phosphorusOffsets",[0],"MAX_ADJACENT_PHOSPHORUS_DISTANCE",8)});n("JM");c$=y(function(){this.g2=this.g1=this.info=null;x(this,arguments)},JM,"BasePair");H(c$,function(){});c$.add=e(c$,"add",function(a,b,c){var d=new JM.BasePair;d.info=a;(d.g1=b).addBasePair(d);(d.g2=c).addBasePair(d);return d},"java.util.Map,JM.NucleicMonomer,JM.NucleicMonomer");e(c$,"getPartnerAtom",function(a){return(a===this.g1?this.g2:this.g1).getLeadAtom().i},
"JM.NucleicMonomer");e(c$,"toString",function(){return this.info.toString()});n("JM");v(["JM.PhosphorusMonomer"],"JM.NucleicMonomer","java.lang.Character JU.Lst $.P3 $.Quat $.V3 J.c.STR JM.Group JM.NucleicPolymer J.shapebio.BioShape".split(" "),function(){c$=y(function(){this.hasRnaO2Prime=!1;this.bps=this.baseCenter=null;x(this,arguments)},JM,"NucleicMonomer",JM.PhosphorusMonomer);Z(c$,function(){});c$.validateAndAllocate=e(c$,"validateAndAllocate",function(a,b,c,d,f,e){var k=JM.Monomer.scanForOffsets(d,
e,JM.NucleicMonomer.interestingNucleicAtomIDs);if(null==k||!JM.Monomer.checkOptional(k,19,d,e[73]))return null;JM.Monomer.checkOptional(k,20,d,e[89]);JM.Monomer.checkOptional(k,18,d,e[90]);JM.Monomer.checkOptional(k,23,d,e[75]);JM.Monomer.checkOptional(k,24,d,e[77]);return(new JM.NucleicMonomer).set4(a,b,c,d,f,k)},"JM.Chain,~S,~N,~N,~N,~A");e(c$,"set4",function(a,b,c,d,f,e){this.set3(a,b,c,d,f,e);JM.Monomer.have(e,15)||(e[0]=e[19],a=e[0]&255,255!=a&&(this.leadAtomIndex=d+a));this.hasRnaO2Prime=JM.Monomer.have(e,
2);this.$isPyrimidine=JM.Monomer.have(e,8);this.$isPurine=JM.Monomer.have(e,9)&&JM.Monomer.have(e,10)&&JM.Monomer.have(e,11);return this},"JM.Chain,~S,~N,~N,~N,~A");e(c$,"isNucleicMonomer",function(){return!0});h(c$,"isDna",function(){return!this.hasRnaO2Prime});h(c$,"isRna",function(){return this.hasRnaO2Prime});h(c$,"isPurine",function(){return this.$isPurine});h(c$,"isPyrimidine",function(){return this.$isPyrimidine});e(c$,"isGuanine",function(){return JM.Monomer.have(this.offsets,17)});h(c$,"getProteinStructureType",
function(){return this.hasRnaO2Prime?J.c.STR.RNA:J.c.STR.DNA});e(c$,"getC1P",function(){return this.getAtomFromOffsetIndex(25)});e(c$,"getC2",function(){return this.getAtomFromOffsetIndex(5)});e(c$,"getC4P",function(){return this.getAtomFromOffsetIndex(27)});e(c$,"getN1",function(){return this.getAtomFromOffsetIndex(4)});e(c$,"getN3",function(){return this.getAtomFromOffsetIndex(6)});e(c$,"getN2",function(){return this.getAtomFromOffsetIndex(17)});e(c$,"getN4",function(){return this.getAtomFromOffsetIndex(14)});
e(c$,"getN6",function(){return this.getAtomFromOffsetIndex(16)});e(c$,"getO2",function(){return this.getAtomFromOffsetIndex(8)});e(c$,"getO4",function(){return this.getAtomFromOffsetIndex(12)});e(c$,"getO6",function(){return this.getAtomFromOffsetIndex(13)});h(c$,"getTerminatorAtom",function(){return this.getAtomFromOffsetIndex(JM.Monomer.have(this.offsets,20)?20:21)});e(c$,"getBaseRing6Points",function(a){this.getPoints(JM.NucleicMonomer.ring6OffsetIndexes,a)},"~A");e(c$,"getPoints",function(a,b){for(var c=
a.length;0<=--c;)b[c]=this.getAtomFromOffsetIndex(a[c])},"~A,~A");e(c$,"maybeGetBaseRing5Points",function(a){this.$isPurine&&this.getPoints(JM.NucleicMonomer.ring5OffsetIndexes,a);return this.$isPurine},"~A");e(c$,"getRiboseRing5Points",function(a){this.getPoints(JM.NucleicMonomer.riboseOffsetIndexes,a)},"~A");h(c$,"isConnectedAfter",function(a){if(null==a)return!0;var b=this.getAtomFromOffsetIndex(15);return null==b?!1:a.getAtomFromOffsetIndex(21).isBonded(b)||this.isCA2(a)},"JM.Monomer");h(c$,"findNearestAtomIndex",
function(a,b,c,d){var f=c[0],e=this.getLeadAtom(),k=this.getAtomFromOffsetIndex(19),h=this.getAtomFromOffsetIndex(22);d=C(d/2);1900>d&&(d=1900);d=F(this.scaleToScreen(e.sZ,d));4>d&&(d=4);if(this.isCursorOnTopOf(e,a,b,d,f)||this.isCursorOnTopOf(k,a,b,d,f)||this.isCursorOnTopOf(h,a,b,d,f))c[0]=e},"~N,~N,~A,~N,~N");e(c$,"setModelClickability",function(){var a;if(!this.isAtomHidden(this.leadAtomIndex)){for(var b=6;0<=--b;)a=this.getAtomFromOffsetIndex(JM.NucleicMonomer.ring6OffsetIndexes[b]),a.setClickable(J.shapebio.BioShape.CARTOON_VISIBILITY_FLAG);
if(this.$isPurine)for(b=4;1<=--b;)a=this.getAtomFromOffsetIndex(JM.NucleicMonomer.ring5OffsetIndexes[b]),a.setClickable(J.shapebio.BioShape.CARTOON_VISIBILITY_FLAG)}});e(c$,"getN0",function(){return this.getAtomFromOffsetIndex(this.$isPurine?11:4)});h(c$,"getHelixData",function(a,b,c){return this.getHelixData2(a,b,c)},"~N,~S,~N");h(c$,"getQuaternionFrameCenter",function(a){switch(a){case "x":case "a":case "b":case "p":return this.getP();case "c":if(null==this.baseCenter){a=0;this.baseCenter=new JU.P3;
for(var b=0;b<JM.NucleicMonomer.heavyAtomIndexes.length;b++){var c=this.getAtomFromOffsetIndex(JM.NucleicMonomer.heavyAtomIndexes[b]);null!=c&&(this.baseCenter.add(c),a++)}this.baseCenter.scale(1/a)}return this.baseCenter;default:return this.getN0()}},"~S");h(c$,"getQuaternion",function(a){var b=null,c=null,d=!1,f=!1;switch(a){case "a":a=this.getP();if(0==this.monomerIndex||null==a)return null;d=!0;b=this.bioPolymer.monomers[this.monomerIndex-1].getC4P();c=this.getC4P();break;case "x":a=this.getP();
if(this.monomerIndex==this.bioPolymer.monomerCount-1||null==a)return null;b=this.bioPolymer.monomers[this.monomerIndex+1].getP();c=this.getC4P();break;case "b":return this.getQuaternionP();case "c":case "n":a=this.getN0();if(null==a)return null;f=d=!0;b=this.getAtomFromOffsetIndex(5);c=this.getAtomFromOffsetIndex(25);break;case "p":a=this.getP();if(null==a)return null;var e=this.getAtomFromOffsetIndex(23),k=this.getAtomFromOffsetIndex(24),h=a.getBonds();if(null==h)return null;for(var j=a.getGroup(),
l=0;l<h.length;l++){var m=h[l].getOtherAtom(a);null!=e&&m.i==e.i||null!=k&&m.i==k.i||(m.getGroup()===j?c=m:b=m)}break;case "q":return null;default:a=this.getN0();if(null==a)return null;this.$isPurine?(b=this.getAtomFromOffsetIndex(5),c=this.getAtomFromOffsetIndex(9)):(b=this.getAtomFromOffsetIndex(6),c=this.getAtomFromOffsetIndex(1))}if(null==b||null==c)return null;b=JU.V3.newVsub(b,a);c=JU.V3.newVsub(c,a);f&&c.scale(-1);return JU.Quat.getQuaternionFrameV(b,c,null,d)},"~S");h(c$,"isCrossLinked",function(a){if(!A(a,
JM.NucleicMonomer)||this.$isPurine==a.isPurine())return!1;var b=this.$isPurine?a:this;a=(this.$isPurine?this:a).getN1();b=b.getN3();return a.isBonded(b)},"JM.Group");h(c$,"getCrossLinkLead",function(a){var b=this.$isPurine?this.getN1():this.getN3(),c=b.getBonds();if(null==c)return!1;for(var d=!1,f=0;f<c.length;f++)if(c[f].isHydrogen()){var e=c[f].getOtherAtom(b),k=e.getGroup();if(A(k,JM.NucleicMonomer)&&(this.$isPurine?k.getN3():k.getN1())===e){if(null==a)return!0;a.addLast(Integer.$valueOf(k.leadAtomIndex));
d=!0}}return d},"JU.Lst");e(c$,"getEdgePoints",function(a){a[0]=this.getLeadAtom();a[1]=this.getC4P();a[2]=a[5]=this.getC1P();switch(this.getGroup1()){case "C":return a[3]=this.getO2(),a[4]=this.getN4(),!0;case "A":return a[3]=this.getC2(),a[4]=this.getN6(),!0;case "G":case "I":return a[3]=this.getC2(),a[4]=this.getO6(),!0;case "T":case "U":return a[3]=this.getO2(),a[4]=this.getO4(),!0;default:return!1}},"~A");e(c$,"addBasePair",function(a){null==this.bps&&(this.bps=new JU.Lst);this.bps.addLast(a)},
"JM.BasePair");e(c$,"setGroup1",function(a){"\x00"==this.group1&&(this.group1=a)},"~S");e(c$,"getBasePairs",function(){this.bioPolymer.isDssrSet||this.bioPolymer.model.ms.vwr.getDSSRParser().setAllDSSRParametersForModel(this.bioPolymer.model.ms.vwr,this.bioPolymer.model.modelIndex);return this.bps});h(c$,"getGroup1b",function(){var a=JM.Group.group3Names[this.groupID],b=null==JM.NucleicPolymer.htGroup1?null:JM.NucleicPolymer.htGroup1.get(a);return null==b?Character.toLowerCase(a.charAt(a.length-1)):
b.charAt(0)});G(c$,"C6",1,"O2Pr",2,"C5",3,"N1",4,"C2",5,"N3",6,"C4",7,"O2",8,"N7",9,"C8",10,"N9",11,"O4",12,"O6",13,"N4",14,"NP",15,"N6",16,"N2",17,"H5T",18,"O5P",19,"H3T",20,"O3P",21,"C3P",22,"O1P",23,"O2P",24,"C1P",25,"C2P",26,"C4P",27,"O4P",28,"C5P",29,"interestingNucleicAtomIDs",[-14,37,-80,36,32,33,34,35,-39,-40,-41,-42,-48,-47,-43,-14,-45,-44,-73,-7,-89,10,9,-75,-77,-13,-12,-9,-79,-8],"ring6OffsetIndexes",[3,1,4,5,6,7],"ring5OffsetIndexes",[3,9,10,11,7],"riboseOffsetIndexes",[25,26,22,27,28,
21,29,19,0],"heavyAtomIndexes",[3,1,4,5,6,7,11,10,9,16,14,8,12,17,13])});n("JM");v(["JM.PhosphorusPolymer"],"JM.NucleicPolymer",["JU.P4","$.V3","JM.HBond","JU.Measure"],function(){c$=y(function(){this.isDssrSet=!1;x(this,arguments)},JM,"NucleicPolymer",JM.PhosphorusPolymer);H(c$,function(a){R(this,JM.NucleicPolymer,[a]);this.type=2;this.hasWingPoints=!0},"~A");e(c$,"getNucleicPhosphorusAtom",function(a){return this.monomers[a].getLeadAtom()},"~N");h(c$,"calcEtaThetaAngles",function(){for(var a=NaN,
b=0;b<this.monomerCount-2;++b){var c=this.monomers[b],d=this.monomers[b+1],f=c.getP(),e=c.getC4P(),k=d.getP(),d=d.getC4P();0<b&&(a=this.monomers[b-1].getC4P(),a=JU.Measure.computeTorsion(a,f,e,k,!0));f=JU.Measure.computeTorsion(f,e,k,d,!0);0>a&&(a+=360);0>f&&(f+=360);c.setGroupParameter(1112539141,a);c.setGroupParameter(1112539152,f)}return!0});h(c$,"calcRasmolHydrogenBonds",function(a,b,c,d,f){for(var e=new JU.V3,k=new JU.V3,h=new JU.V3,j=this.monomerCount;0<=--j;){var l=this.monomers[j];if(l.isPurine()){var m=
l.getN3(),p=b.get(m.i);if(p||c.get(m.i)){var s=l.getN1(),u=l.getN0(),n=new JU.P4;JU.Measure.getPlaneThroughPoints(m,s,u,e,k,h,n);for(var m=null,r=25,q=null,v=a.monomerCount;0<=--v;){var w=a.monomers[v];if(w.isPyrimidine()){var t=w.getN3();if(!(p?!c.get(t.i):!b.get(t.i))){var x=w.getN0(),y=s.distanceSquared(t);y<r&&(50<u.distanceSquared(x)&&1>Math.abs(JU.Measure.distanceToPlane(n,t)))&&(q=w,m=t,r=y)}}}p=0;null!=m&&(p+=JM.NucleicPolymer.addHydrogenBond(d,s,m),p>=f||(l.isGuanine()?(p+=JM.NucleicPolymer.addHydrogenBond(d,
l.getN2(),q.getO2()),p>=f||JM.NucleicPolymer.addHydrogenBond(d,l.getO6(),q.getN4())):JM.NucleicPolymer.addHydrogenBond(d,l.getN6(),q.getO4())))}}}},"JM.BioPolymer,JU.BS,JU.BS,JU.Lst,~N,~A,~B,~B");c$.addHydrogenBond=e(c$,"addHydrogenBond",function(a,b,c){if(null==b||null==c)return 0;a.addLast(new JM.HBond(b,c,18432,1,0,0));return 1},"JU.Lst,JM.Atom,JM.Atom");G(c$,"htGroup1",null)});n("JM");c$=y(function(){this.g2=this.g1=this.info=null;x(this,arguments)},JM,"BasePair");H(c$,function(){});c$.add=e(c$,
"add",function(a,b,c){var d=new JM.BasePair;d.info=a;(d.g1=b).addBasePair(d);(d.g2=c).addBasePair(d);return d},"java.util.Map,JM.NucleicMonomer,JM.NucleicMonomer");e(c$,"getPartnerAtom",function(a){return(a===this.g1?this.g2:this.g1).getLeadAtom().i},"JM.NucleicMonomer");e(c$,"toString",function(){return this.info.toString()});n("JM");v(["JM.BioPolymer"],"JM.PhosphorusPolymer",null,function(){c$=E(JM,"PhosphorusPolymer",JM.BioPolymer);H(c$,function(a){R(this,JM.PhosphorusPolymer,[a]);this.hasStructure=
!0},"~A")});n("J.dssx");v(null,"J.dssx.Bridge",["java.lang.Boolean","JU.Escape"],function(){c$=y(function(){this.ladder=this.b=this.a=null;this.isAntiparallel=!1;x(this,arguments)},J.dssx,"Bridge");H(c$,function(a,b,c){this.a=a;this.b=b;this.ladder=Q(2,2,0);this.ladder[0][0]=this.ladder[0][1]=Math.min(a.i,b.i);this.ladder[1][0]=this.ladder[1][1]=Math.max(a.i,b.i);this.addLadder(c)},"JM.Atom,JM.Atom,java.util.Map");e(c$,"addBridge",function(a,b){if(a.isAntiparallel!=this.isAntiparallel||!this.canAdd(a)||
!a.canAdd(this))return!1;this.extendLadder(a.ladder[0][0],a.ladder[1][0]);this.extendLadder(a.ladder[0][1],a.ladder[1][1]);a.ladder=this.ladder;a.ladder!==this.ladder&&(b.remove(a.ladder),this.addLadder(b));return!0},"J.dssx.Bridge,java.util.Map");e(c$,"addLadder",function(a){a.put(this.ladder,this.isAntiparallel?Boolean.TRUE:Boolean.FALSE)},"java.util.Map");e(c$,"canAdd",function(a){var b=a.a.i;a=a.b.i;return this.isAntiparallel?b>=this.ladder[0][1]&&a<=this.ladder[1][0]||b<=this.ladder[0][0]&&a>=
this.ladder[1][1]:b<=this.ladder[0][0]&&a<=this.ladder[1][0]||b>=this.ladder[0][1]&&a>=this.ladder[1][1]},"J.dssx.Bridge");e(c$,"extendLadder",function(a,b){this.ladder[0][0]>a&&(this.ladder[0][0]=a);this.ladder[0][1]<a&&(this.ladder[0][1]=a);this.ladder[1][0]>b&&(this.ladder[1][0]=b);this.ladder[1][1]<b&&(this.ladder[1][1]=b)},"~N,~N");h(c$,"toString",function(){return(this.isAntiparallel?"a ":"p ")+this.a+" - "+this.b+"\t"+JU.Escape.e(this.ladder)})});n("J.api");ca(J.api,"DSSPInterface");n("J.dssx");
v(["J.api.DSSPInterface"],"J.dssx.DSSP","java.lang.Boolean java.util.Hashtable JU.AU $.BS $.Lst $.PT $.SB J.c.STR J.dssx.Bridge J.i18n.GT JM.HBond JM.AminoPolymer JU.Escape $.Logger JV.Viewer".split(" "),function(){c$=y(function(){this.done=this.vHBonds=this.bioPolymers=null;this.$setStructure=this.dsspIgnoreHydrogens=this.doReport=!1;this.bsBad=this.labels=null;this.bioPolymerCount=0;this.sheetOffsets=this.bridgesP=this.bridgesA=this.htLadders=this.htBridges=null;x(this,arguments)},J.dssx,"DSSP",
null,J.api.DSSPInterface);S(c$,function(){this.sheetOffsets=[[0,-1,1,0,1,0,0,-1],[0,0,0,0,1,-1,1,-1]]});H(c$,function(){});h(c$,"calculateDssp",function(a,b,c,d,f,e){this.bioPolymers=a;this.bioPolymerCount=b;this.vHBonds=c;this.doReport=d;this.dsspIgnoreHydrogens=f;this.$setStructure=e;a=new JU.BS;for(var k=0;k<b;k++)A(this.bioPolymers[k],JM.AminoPolymer)&&a.set(k);if(a.isEmpty())return"";k=this.bioPolymers[0].model;c=new JU.SB;c.append("Jmol ").append(JV.Viewer.getJmolVersion()).append(" DSSP analysis for model ").append(k.getModelNumberDotted()).append(" - ").append(k.getModelTitle()).append("\n");
0==k.modelIndex&&c.append("\nW. Kabsch and C. Sander, Biopolymers, vol 22, 1983, pp 2577-2637\n").append("\nWe thank Wolfgang Kabsch and Chris Sander for writing the DSSP software,\n").append("and we thank the CMBI for maintaining it to the extent that it was easy to\n").append("re-engineer for our purposes. At this point in time, we make no guarantee\n").append("that this code gives precisely the same analysis as the code available via license\n").append("from CMBI at http://swift.cmbi.ru.nl/gv/dssp\n");
e&&0==k.modelIndex&&c.append("\nAll bioshapes have been deleted and must be regenerated.\n");0<k.nAltLocs&&c.append("\nNote: This model contains alternative locations. Use  'CONFIGURATION 1' to be consistent with CMBI DSSP.\n");this.labels=Y(b,"\x00");this.done=Array(b);this.bsBad=new JU.BS;for(var h=!1,k=a.nextSetBit(0);0<=k;k=a.nextSetBit(k+1)){e=this.bioPolymers[k];!h&&null!=e.monomers[0].getExplicitNH()&&(f?c.append(J.i18n.GT.o(J.i18n.GT._("NOTE: Backbone amide hydrogen positions are present and will be ignored. Their positions will be approximated, as in standard DSSP analysis.\nUse {0} to not use this approximation.\n\n"),
"SET dsspCalculateHydrogenAlways FALSE")):c.append(J.i18n.GT.o(J.i18n.GT._("NOTE: Backbone amide hydrogen positions are present and will be used. Results may differ significantly from standard DSSP analysis.\nUse {0} to ignore these hydrogen positions.\n\n"),"SET dsspCalculateHydrogenAlways TRUE")),h=!0);e.recalculateLeadMidpointsAndWingVectors();var j=e.monomerCount;this.labels[k]=Y(j,"\x00");this.done[k]=new JU.BS;for(var l=0;l<j;l++)null==e.monomers[l].getCarbonylOxygenAtom()&&this.bsBad.set(e.monomers[l].leadAtomIndex)}f=
this.getDualHydrogenBondArray();this.bridgesA=new JU.Lst;this.bridgesP=new JU.Lst;this.htBridges=new java.util.Hashtable;this.htLadders=new java.util.Hashtable;this.getBridges(f);this.getSheetStructures();b=Array(b);for(k=a.nextSetBit(0);0<=k;k=a.nextSetBit(k+1))null!=f[k]&&(b[k]=this.findHelixes(k,f[k]));if(d){d=new JU.SB;c.append("\n------------------------------\n");for(k=a.nextSetBit(0);0<=k;k=a.nextSetBit(k+1))null!=this.labels[k]&&(e=this.bioPolymers[k],d.append(this.dumpSummary(e,this.labels[k])),
c.append(b[k]).append(this.dumpTags(e,"$.1: "+String.valueOf(this.labels[k]),this.bsBad,2)));0<=this.bsBad.nextSetBit(0)&&c.append("\nNOTE: '!' indicates a residue that is missing a backbone carbonyl oxygen atom.\n");c.append("\n").append("SUMMARY:"+d)}return c.toString()},"~A,~N,~O,~B,~B,~B");e(c$,"getDualHydrogenBondArray",function(){for(var a=JU.AU.newInt4(this.bioPolymerCount),b=0;b<this.bioPolymerCount;b++)if(A(this.bioPolymers[b],JM.AminoPolymer)){var c=this.bioPolymers[b].monomerCount;a[b]=
Q(c,2,3,0);for(var d=0;d<c;++d)a[b][d][0][1]=a[b][d][1][1]=-2147483648,a[b][d][0][2]=a[b][d][1][2]=0}for(b=0;b<this.bioPolymerCount;b++)if(null!=a[b])for(d=0;d<this.bioPolymerCount;d++)null!=a[d]&&this.bioPolymers[b].calcRasmolHydrogenBonds(this.bioPolymers[d],null,null,null,2,a[b],!1,this.dsspIgnoreHydrogens);return a});e(c$,"getBridges",function(a){for(var b=this.bioPolymers[0].model.getModelSet().at,c=null,d=new java.util.Hashtable,f=0;f<a.length;f++)if(A(this.bioPolymers[f],JM.AminoPolymer))for(var e=
this.bioPolymers[f],k=a[f].length-1,h=1;h<k;h++){var j=e.monomers[h].leadAtomIndex;if(!this.bsBad.get(j))for(var l=f;l<a.length;l++)if(A(this.bioPolymers[l],JM.AminoPolymer))for(var m=f==l?h+3:1;m<a[l].length-1;m++){var p=this.bioPolymers[l],s=p.monomers[m].leadAtomIndex;if(!this.bsBad.get(s)){if(null==(c=this.getBridge(a,f,h,l,m,this.bridgesP,b[j],b[s],e,p,d,!1)))if(null!=(c=this.getBridge(a,f,h,l,m,this.bridgesA,b[j],b[s],e,p,d,!0)))c.isAntiparallel=!0;else continue;JU.Logger.debugging&&JU.Logger.debug("Bridge found "+
c);this.done[f].set(h);this.done[l].set(m);this.htBridges.put(j+"-"+s,c)}}}},"~A");e(c$,"getBridge",function(a,b,c,d,f,e,h,n,j,l,m,p){var s=null,u=null,v=0,r=p?this.sheetOffsets[1]:this.sheetOffsets[0];return null!=(s=this.isHbonded(c+r[0],f+r[1],b,d,a))&&null!=(u=this.isHbonded(f+r[2],c+r[3],d,b,a))||null!=(s=this.isHbonded(c+r[v=4],f+r[5],b,d,a))&&null!=(u=this.isHbonded(f+r[6],c+r[7],d,b,a))?(a=new J.dssx.Bridge(h,n,this.htLadders),e.addLast(a),null!=this.vHBonds&&(e=p?14336:6144,this.addHbond(j.monomers[c+
r[v]],l.monomers[f+r[++v]],s[2],e,m),this.addHbond(l.monomers[f+r[++v]],j.monomers[c+r[++v]],u[2],e,m)),a):null},"~A,~N,~N,~N,~N,JU.Lst,JM.Atom,JM.Atom,JM.AminoPolymer,JM.AminoPolymer,java.util.Map,~B");e(c$,"addHbond",function(a,b,c,d,f){a=a.getNitrogenAtom();b=b.getCarbonylOxygenAtom();if(null!=f){var e=a.i+" "+b.i;if(f.containsKey(e))return;f.put(e,Boolean.TRUE)}this.vHBonds.addLast(new JM.HBond(a,b,d,1,0,c/1E3))},"JM.Monomer,JM.Monomer,~N,~N,java.util.Map");e(c$,"getSheetStructures",function(){if(!(0==
this.bridgesA.size()&&0==this.bridgesP.size())){this.createLadders(this.bridgesA,!0);this.createLadders(this.bridgesP,!1);for(var a=new JU.BS,b=new JU.BS,c,d=this.htLadders.keySet().iterator();d.hasNext()&&((c=d.next())||1);)c[0][0]==c[0][1]&&c[1][0]==c[1][1]?(b.set(c[0][0]),b.set(c[1][0])):(a.setBits(c[0][0],c[0][1]+1),a.setBits(c[1][0],c[1][1]+1));c=new JU.BS;for(var d=new JU.BS,f=this.bioPolymers.length;0<=--f;)if(A(this.bioPolymers[f],JM.AminoPolymer)){c.clearAll();d.clearAll();for(var e=this.bioPolymers[f],
h=0;h<e.monomerCount;){var n=e.monomers[h].leadAtomIndex;if(a.get(n)){for(n=h+1;n<e.monomerCount&&a.get(e.monomers[n].leadAtomIndex);)n++;c.setBits(h,n);h=n}else b.get(n)&&d.set(h),++h}this.doReport&&(this.setTag(this.labels[f],d,"B"),this.setTag(this.labels[f],c,"E"));this.$setStructure&&this.setStructure(e,c,J.c.STR.SHEET);this.done[f].or(c);this.done[f].or(d)}}});e(c$,"createLadders",function(a,b){for(var c=b?-1:1,d=a.size(),f=0;f<d;f++)this.checkBridge(a.get(f),b,1,c);for(f=0;f<d;f++)this.checkBulge(a.get(f),
b,1)},"JU.Lst,~B");e(c$,"checkBridge",function(a,b,c,d){b=this.htBridges.get(a.a.getOffsetResidueAtom("0",c)+"-"+a.b.getOffsetResidueAtom("0",d));return null!=b&&a.addBridge(b,this.htLadders)},"J.dssx.Bridge,~B,~N,~N");e(c$,"checkBulge",function(a,b,c){for(var d=b?-1:1,f=0;3>f;f++)for(var e=0==f?1:0;6>e;e++)this.checkBridge(a,b,f*c,e*d),e>f&&this.checkBridge(a,b,e*c,f*d)},"J.dssx.Bridge,~B,~N");e(c$,"dumpSummary",function(a,b){for(var c=a.monomers[0].getLeadAtom(),c=0==c.getChainID()?"":c.getChainIDStr()+
":",d=new JU.SB,f="\x00",e="\x00",h="\x00",n=-1,j=-1,l=a.monomerCount,m=a.monomers,p=0;p<=l;p++){if(p==l||b[p]!=f){"\x00"!=f&&d.appendC("\n").appendC(f).append(" : ").append(c).appendI(n).append("\x00"==e?"":String.valueOf(e)).append("_").append(c).appendI(j).append("\x00"==h?"":String.valueOf(h));if(p==l)break;f=b[p];n=m[p].getResno();e=m[p].getInsertionCode()}j=m[p].getResno();h=m[p].getInsertionCode()}return d.toString()},"JM.AminoPolymer,~A");e(c$,"dumpTags",function(a,b,c,d){var f=a.monomers[0].getLeadAtom().getChainID()+
"."+(a.bioPolymerIndexInModel+1);b=JU.PT.rep(b,"$",f);for(var e=a.monomers[0].getResno(),h="\n"+f,f=new JU.SB,n=(new JU.SB).append(h+".8: "),j=(new JU.SB).append(h+".7: "),l=(new JU.SB).append(h+".6: "),h=(new JU.SB).append(h+".0: "),m=a.monomerCount,p=0;p<m;p++)e=a.monomers[p].getResno(),n.append(0==e%100?""+C(e/100)%100:" "),j.append(0==e%10?""+C(e/10)%10:" "),l.appendI(e%10),h.appendC(c.get(a.monomers[p].leadAtomIndex)?"!":a.monomers[p].getGroup1());1==(d&1)&&f.appendSB(n).appendSB(j).appendSB(l);
f.append("\n");f.append(b);2==(d&2)&&(f.appendSB(h),f.append("\n\n"));return f.toString().$replace("\x00",".")},"JM.AminoPolymer,~S,JU.BS,~N");e(c$,"isHbonded",function(a,b,c,d,f){if(0>a||0>b)return null;c=f[c];f=f[d];return a>=c.length||b>=f.length?null:c[a][0][0]==d&&c[a][0][1]==b?c[a][0]:c[a][1][0]==d&&c[a][1][1]==b?c[a][1]:null},"~N,~N,~N,~N,~A");e(c$,"findHelixes",function(a,b){var c=this.bioPolymers[a];if(JU.Logger.debugging)for(var d=0;d<c.monomerCount;d++)JU.Logger.debug(a+"."+c.monomers[d].getResno()+
"\t"+JU.Escape.e(b[d]));var d=new JU.BS,f=this.findHelixes2(a,4,b,J.c.STR.HELIXALPHA,10240,d),e=this.findHelixes2(a,3,b,J.c.STR.HELIX310,8192,d),h=this.findHelixes2(a,5,b,J.c.STR.HELIXPI,12288,d);this.$setStructure&&this.setStructure(c,d,J.c.STR.TURN);return this.doReport?(this.setTag(this.labels[a],d,"T"),this.dumpTags(c,"$.5: "+h+"\n$.4: "+f+"\n$.3: "+e,this.bsBad,1)):""},"~N,~A");e(c$,"findHelixes2",function(a,b,c,d,f,e){for(var h=this.bioPolymers[a],n=new JU.BS,j=new JU.BS,l=new JU.BS,m=new JU.BS,
p=new JU.BS,s=this.done[a],u="",v=h.monomerCount,r=b;r<v;++r){var q=r-b,x=0;if(c[r][0][0]==a&&c[r][0][1]==q||c[r][x=1][0]==a&&c[r][1][1]==q){var w=h.monomers[q].leadAtomIndex,t=this.bsBad.nextSetBit(w),y=h.monomers[r];if(!(t>=w&&t<=y.leadAtomIndex)){n.set(q);j.setBits(q+1,r);m.set(r);var t=s.nextSetBit(q),w=0>t||t>=r,A=!1;if(0<q&&n.get(q-1)&&(4==b||w))p.setBits(q,r),w||(u+="  WARNING! Bridge to helix at "+h.monomers[t]),A=!0;else if(w||s.nextClearBit(t)<r)A=!0;m.get(q)&&l.set(q);A&&null!=this.vHBonds&&
this.addHbond(y,h.monomers[q],c[r][x][2],f,null)}}}this.doReport?(c=Y(v,"\x00"),this.setTag(c,j,String.fromCharCode(48+b)),this.setTag(c,n,">"),this.setTag(c,m,"<"),this.setTag(c,l,"X")):c=null;s.or(p);j.andNot(s);e.or(j);e.andNot(p);this.$setStructure&&this.setStructure(h,p,d);return this.doReport?(this.setTag(this.labels[a],p,String.fromCharCode(68+b)),String.valueOf(c)+u):""},"~N,~N,~A,J.c.STR,~N,JU.BS");e(c$,"setTag",function(a,b,c){for(var d=b.nextSetBit(0);0<=d;d=b.nextSetBit(d+1))a[d]=c},"~A,JU.BS,~S");
e(c$,"setStructure",function(a,b,c){for(var d=b.nextSetBit(0);0<=d;d=b.nextSetBit(d+1)){var f=b.nextClearBit(d);0>f&&(f=a.monomerCount);a.addStructureProtected(c,null,0,0,d,f-1);d=f}},"JM.AminoPolymer,JU.BS,J.c.STR")});n("J.shapebio");v(["J.shape.AtomShape","JV.JC"],"J.shapebio.BioShape","java.lang.Float JU.AU $.BS J.c.PAL $.STR JM.NucleicPolymer JU.C $.Logger".split(" "),function(){c$=y(function(){this.modelVisibilityFlags=this.modelIndex=0;this.leadAtomIndices=this.wingVectors=this.monomers=this.colixesBack=
this.meshReady=this.meshes=this.bioPolymer=this.shape=null;this.hasBfactorRange=!1;this.floatRange=this.range=this.bfactorMax=this.bfactorMin=0;x(this,arguments)},J.shapebio,"BioShape",J.shape.AtomShape);h(c$,"setProperty",function(a,b,c){this.setPropAS(a,b,c)},"~S,~O,JU.BS");h(c$,"getMonomers",function(){return this.monomers});H(c$,function(a,b,c){R(this,J.shapebio.BioShape,[]);this.shape=a;this.modelIndex=b;this.bioPolymer=c;this.isActive=a.isActive;this.bsSizeDefault=new JU.BS;this.monomerCount=
c.monomerCount;0<this.monomerCount&&(this.colixes=aa(this.monomerCount,0),this.paletteIDs=ba(this.monomerCount,0),this.mads=aa(this.monomerCount+1,0),this.monomers=c.getGroups(),this.meshReady=ia(this.monomerCount,!1),this.meshes=Array(this.monomerCount),this.wingVectors=c.getWingVectors(),this.leadAtomIndices=c.getLeadAtomIndices())},"J.shapebio.BioShapeCollection,~N,JM.BioPolymer");e(c$,"calcBfactorRange",function(){this.bfactorMin=this.bfactorMax=this.monomers[0].getLeadAtom().getBfactor100();
for(var a=this.monomerCount;0<--a;){var b=this.monomers[a].getLeadAtom().getBfactor100();b<this.bfactorMin?this.bfactorMin=b:b>this.bfactorMax&&(this.bfactorMax=b)}this.floatRange=this.range=this.bfactorMax-this.bfactorMin;this.hasBfactorRange=!0});e(c$,"calcMeanPositionalDisplacement",function(a){return ja(1E3*Math.sqrt(a/7895.6835208714865))},"~N");h(c$,"findNearestAtomIndex",function(a,b,c,d){this.bioPolymer.findNearestAtomIndex(a,b,c,this.mads,this.shape.vf,d)},"~N,~N,~A,JU.BS");e(c$,"setMad",
function(a,b,c){if(!(2>this.monomerCount)){this.isActive=!0;null==this.bsSizeSet&&(this.bsSizeSet=new JU.BS);for(var d=this.shape.vf,f=this.monomerCount;0<=--f;){var e=this.leadAtomIndices[f];if(b.get(e)){if(null!=c&&e<c.length){if(Float.isNaN(c[e]))continue;a=$(2E3*c[e])}var h=0<(this.mads[f]=this.getMad(f,a));this.bsSizeSet.setBitTo(f,h);this.monomers[f].setShapeVisibility(d,h);this.shape.atoms[e].setShapeVisibility(d,h);this.falsifyNearbyMesh(f)}}1<this.monomerCount&&(this.mads[this.monomerCount]=
this.mads[this.monomerCount-1])}},"~N,JU.BS,~A");e(c$,"getMad",function(a,b){this.bsSizeDefault.setBitTo(a,-1==b||-2==b);if(0<=b)return b;switch(b){case -1:case -2:if(-1==b&&0<=this.shape.madOn)return this.shape.madOn;switch(this.monomers[a].getProteinStructureType()){case J.c.STR.SHEET:case J.c.STR.HELIX:return this.shape.madHelixSheet;case J.c.STR.DNA:case J.c.STR.RNA:return this.shape.madDnaRna;default:return this.shape.madTurnRandom}case -3:this.hasBfactorRange||this.calcBfactorRange();var c=
this.monomers[a].getLeadAtom(),c=c.getBfactor100()-this.bfactorMin;if(0==this.range)return 0;c/=this.floatRange;(0>c||1<c)&&JU.Logger.error("Que ha ocurrido? "+c);return $(1750*c+250);case -4:return c=this.monomers[a].getLeadAtom(),2*this.calcMeanPositionalDisplacement(c.getBfactor100())}JU.Logger.error("unrecognized setMad("+b+")");return 0},"~N,~N");e(c$,"falsifyMesh",function(){if(null!=this.meshReady)for(var a=0;a<this.monomerCount;a++)this.meshReady[a]=!1});e(c$,"falsifyNearbyMesh",function(a){null!=
this.meshReady&&(this.meshReady[a]=!1,0<a&&(this.meshReady[a-1]=!1),a<this.monomerCount-1&&(this.meshReady[a+1]=!1))},"~N");e(c$,"setColixBS",function(a,b,c){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=new JU.BS);for(var d=this.monomerCount;0<=--d;){var f=this.leadAtomIndices[d];c.get(f)&&(this.colixes[d]=this.shape.getColixI(a,b,f),null!=this.colixesBack&&this.colixesBack.length>d&&(this.colixesBack[d]=0),this.paletteIDs[d]=b,this.bsColixSet.setBitTo(d,0!=this.colixes[d]))}},"~N,~N,JU.BS");
e(c$,"setColixes",function(a,b){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=new JU.BS);for(var c=this.monomerCount;0<=--c;){var d=this.leadAtomIndices[c];b.get(d)&&(c<this.colixes.length&&d<a.length)&&(this.colixes[c]=this.shape.getColixI(a[d],J.c.PAL.UNKNOWN.id,d),null!=this.colixesBack&&c<this.colixesBack.length&&(this.colixesBack[c]=0),this.paletteIDs[c]=J.c.PAL.UNKNOWN.id,this.bsColixSet.set(c))}},"~A,JU.BS");e(c$,"setParams",function(a,b,c){if(0!=this.monomerCount){var d=a[0];a=
a[1];this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=new JU.BS);for(var f=b.length,e=this.monomerCount;0<=--e;){var h=this.leadAtomIndices[e];if(c.get(h)&&e<this.colixes.length&&h<f){var n=b[h],j=null==d?0:d[n],n=null==a?0:a[n];0.01<n&&(j=JU.C.getColixTranslucent3(j,!0,n));this.colixes[e]=this.shape.getColixI(j,J.c.PAL.UNKNOWN.id,h);null!=this.colixesBack&&e<this.colixesBack.length&&(this.colixesBack[e]=0);this.paletteIDs[e]=J.c.PAL.UNKNOWN.id;this.bsColixSet.set(e)}}}},"~A,~A,JU.BS");e(c$,
"setColixBack",function(a,b){for(var c=this.monomerCount;0<=--c;)b.get(this.leadAtomIndices[c])&&(null==this.colixesBack&&(this.colixesBack=aa(this.colixes.length,0)),this.colixesBack.length<this.colixes.length&&(this.colixesBack=JU.AU.ensureLengthShort(this.colixesBack,this.colixes.length)),this.colixesBack[c]=a)},"~N,JU.BS");e(c$,"setTranslucent",function(a,b,c){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=new JU.BS);for(var d=this.monomerCount;0<=--d;)b.get(this.leadAtomIndices[d])&&
(this.colixes[d]=JU.C.getColixTranslucent3(this.colixes[d],a,c),null!=this.colixesBack&&this.colixesBack.length>d&&(this.colixesBack[d]=JU.C.getColixTranslucent3(this.colixesBack[d],a,c)),this.bsColixSet.setBitTo(d,0!=this.colixes[d]))},"~B,JU.BS,~N");h(c$,"setModelClickability",function(){if(this.isActive&&null!=this.wingVectors)for(var a=A(this.bioPolymer,JM.NucleicPolymer),b=this.monomerCount;0<=--b;)if(!(0>=this.mads[b])){var c=this.leadAtomIndices[b];this.monomers[b].chain.model.ms.isAtomHidden(c)||
(this.shape.atoms[c].setClickable(J.shapebio.BioShape.ALPHA_CARBON_VISIBILITY_FLAG),a&&this.monomers[b].setModelClickability())}});c$.CARTOON_VISIBILITY_FLAG=c$.prototype.CARTOON_VISIBILITY_FLAG=JV.JC.getShapeVisibilityFlag(11);c$.ALPHA_CARBON_VISIBILITY_FLAG=c$.prototype.ALPHA_CARBON_VISIBILITY_FLAG=J.shapebio.BioShape.CARTOON_VISIBILITY_FLAG|JV.JC.getShapeVisibilityFlag(10)|JV.JC.getShapeVisibilityFlag(12)|JV.JC.getShapeVisibilityFlag(13)|JV.JC.getShapeVisibilityFlag(14)|8192;G(c$,"eightPiSquared100",
7895.6835208714865)});n("J.shapebio");v(["J.shape.Shape"],"J.shapebio.BioShapeCollection",["JU.AU","J.c.PAL","J.shapebio.BioShape","JU.BSUtil","$.C"],function(){c$=y(function(){this.atoms=null;this.madOn=-2;this.madHelixSheet=3E3;this.madTurnRandom=800;this.madDnaRna=5E3;this.isActive=!1;this.bioShapes=null;x(this,arguments)},J.shapebio,"BioShapeCollection",J.shape.Shape);h(c$,"initModelSet",function(){this.isBioShape=!0;this.atoms=this.ms.at;this.initialize()});h(c$,"getSizeG",function(a){var b=
a.getGroupIndex();a=a.getLeadAtom().i;for(var c=this.bioShapes.length;0<=--c;)for(var d=this.bioShapes[c],f=0;f<d.monomerCount;f++)if(d.monomers[f].getGroupIndex()==b&&d.monomers[f].getLeadAtom().i==a)return d.mads[f];return 0},"JM.Group");h(c$,"setShapeSizeRD",function(a,b,c){this.initialize();for(var d=this.bioShapes.length;0<=--d;){var f=this.bioShapes[d];0<f.monomerCount&&f.setMad(a,c,null==b?null:b.values)}},"~N,J.atomdata.RadiusData,JU.BS");h(c$,"setProperty",function(a,b,c){this.setPropBSC(a,
b,c)},"~S,~O,JU.BS");e(c$,"setPropBSC",function(a,b,c){if("refreshTrajectories"===a){c=b[0].intValue();for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],b.modelIndex==c&&b.falsifyMesh()}else if("deleteModelAtoms"===a){this.atoms=b[1];c=b[2][0];for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],b.modelIndex>c?(b.modelIndex--,b.leadAtomIndices=b.bioPolymer.getLeadAtomIndices()):b.modelIndex==c&&(this.bioShapes=JU.AU.deleteElements(this.bioShapes,a,1))}else if(this.initialize(),"color"===
a){var d=J.c.PAL.pidOf(b),f=JU.C.getColixO(b);for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],0<b.monomerCount&&b.setColixBS(f,d,c)}else if("params"===a){a=c.length();d=Q(a,0);f=0;for(a=c.nextSetBit(0);0<=a;a=c.nextSetBit(a+1),f++)d[a]=f;for(a=this.bioShapes.length;0<=--a;)this.bioShapes[a].setParams(b,d,c)}else if("colorPhase"===a){d=JU.C.getColixO(b[0]);f=JU.C.getColixO(b[1]);for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],0<b.monomerCount&&(b.setColixBS(f,0,c),b.setColixBack(d,
c))}else if("translucency"===a){d="translucent".equals(b);for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],0<b.monomerCount&&b.setTranslucent(d,c,this.translucentLevel)}else this.setPropS(a,b,c)},"~S,~O,JU.BS");h(c$,"getShapeState",function(){return this.vwr.getAtomShapeSetState(this,this.bioShapes)});e(c$,"initialize",function(){for(var a=this.ms.mc,b=this.ms.am,c=this.ms.getBioPolymerCount(),d=Array(c--);0<=--a;)for(var f=this.ms.getBioPolymerCountInModel(a);0<=--f;c--){var e=b[a].getBioPolymer(f);
d[c]=null==this.bioShapes||this.bioShapes.length<=c||null==this.bioShapes[c]||this.bioShapes[c].bioPolymer!==e?new J.shapebio.BioShape(this,a,e):this.bioShapes[c]}this.bioShapes=d});h(c$,"findNearestAtomIndex",function(a,b,c,d){for(var f=this.bioShapes.length;0<=--f;)this.bioShapes[f].findNearestAtomIndex(a,b,c,d)},"~N,~N,~A,JU.BS");h(c$,"setVisibilityFlags",function(a){if(null!=this.bioShapes){a=JU.BSUtil.copy(a);for(var b=this.ms.mc;0<=--b;)a.get(b)&&this.ms.isTrajectory(b)&&a.set(this.ms.getTrajectoryIndex(b));
for(b=this.bioShapes.length;0<=--b;){var c=this.bioShapes[b];c.modelVisibilityFlags=a.get(c.modelIndex)?this.vf:0}}},"JU.BS");h(c$,"setModelClickability",function(){if(null!=this.bioShapes)for(var a=this.bioShapes.length;0<=--a;)this.bioShapes[a].setModelClickability()});e(c$,"getMpsShapeCount",function(){return this.bioShapes.length});e(c$,"getBioShape",function(a){return this.bioShapes[a]},"~N")});n("J.shapebio");v(["J.shapebio.BioShapeCollection"],"J.shapebio.Rockets",null,function(){c$=E(J.shapebio,
"Rockets",J.shapebio.BioShapeCollection);e(c$,"initShape",function(){X(this,J.shapebio.Rockets,"initShape",[]);this.madTurnRandom=500})});n("J.shapebio");v(["J.shapebio.Rockets"],"J.shapebio.Cartoon",null,function(){c$=E(J.shapebio,"Cartoon",J.shapebio.Rockets);e(c$,"initShape",function(){X(this,J.shapebio.Cartoon,"initShape",[]);this.madDnaRna=1E3})});n("J.shapebio");v(["J.shapebio.BioShapeCollection"],"J.shapebio.Backbone",["java.lang.Float","JU.BS"],function(){c$=y(function(){this.bsSelected=null;
x(this,arguments)},J.shapebio,"Backbone",J.shapebio.BioShapeCollection);e(c$,"initShape",function(){X(this,J.shapebio.Backbone,"initShape",[]);this.madOn=1;this.madHelixSheet=1500;this.madTurnRandom=500;this.madDnaRna=2E3;this.isActive=!0});h(c$,"setProperty",function(a,b,c){"bitset"===a?this.bsSelected=b:this.setPropBSC(a,b,c)},"~S,~O,JU.BS");h(c$,"setShapeSizeRD",function(a,b,c){this.initialize();var d=null!=this.bsSelected;d&&(c=this.bsSelected);for(var f=this.bioShapes.length;0<=--f;){var e=this.bioShapes[f];
if(0!=e.monomerCount){var h=this.vwr.getBoolean(603979812),n=e.bioPolymer.getLeadAtomIndices(),j=0!=a;null==e.bsSizeSet&&(e.bsSizeSet=new JU.BS);e.isActive=!0;for(var l=e.monomerCount-1;0<=--l;){var m=n[l],p=n[l+1],s=c.get(m),u=c.get(p);if(s&&u||d&&s||h&&(s||u)){e.monomers[l].setShapeVisibility(this.vf,j);s=this.ms.at[m];if(null!=b){if(Float.isNaN(b.values[m])||Float.isNaN(b.values[p]))continue;a=$(1E3*(b.values[m]+b.values[p]));j=0!=a}m=this.ms.at[p];0!=e.mads[l]!=j&&(s.addDisplayedBackbone(this.vf,
j),m.addDisplayedBackbone(this.vf,j));e.mads[l]=a;e.bsSizeSet.setBitTo(l,j);e.bsSizeDefault.setBitTo(l,-1==a)}}}}d&&(this.bsSelected=null)},"~N,J.atomdata.RadiusData,JU.BS");h(c$,"setModelClickability",function(){if(null!=this.bioShapes)for(var a=this.bioShapes.length;0<=--a;)for(var b=this.bioShapes[a],c=b.bioPolymer.getLeadAtomIndices(),b=b.monomerCount;0<=--b;){var d=this.ms.at[c[b]];0<d.getNBackbonesDisplayed()&&!this.ms.isAtomHidden(b)&&d.setClickable(this.vf)}})});n("J.shapebio");v(["J.shapebio.BioShapeCollection"],
"J.shapebio.Strands",null,function(){c$=y(function(){this.isMesh=!1;x(this,arguments)},J.shapebio,"Strands",J.shapebio.BioShapeCollection)});n("J.shapebio");v(["J.shapebio.BioShapeCollection"],"J.shapebio.Ribbons",null,function(){c$=E(J.shapebio,"Ribbons",J.shapebio.BioShapeCollection)});n("J.shapebio");v(["J.shapebio.Strands"],"J.shapebio.MeshRibbon",null,function(){c$=E(J.shapebio,"MeshRibbon",J.shapebio.Strands);e(c$,"initShape",function(){X(this,J.shapebio.MeshRibbon,"initShape",[]);this.isMesh=
!0})});n("J.shapebio");v(["J.shapebio.BioShapeCollection"],"J.shapebio.Trace",["J.atomdata.RadiusData","J.c.VDW","JM.Atom"],function(){c$=E(J.shapebio,"Trace",J.shapebio.BioShapeCollection);e(c$,"initShape",function(){X(this,J.shapebio.Trace,"initShape",[]);this.madOn=600;this.madHelixSheet=1500;this.madTurnRandom=500;this.madDnaRna=1500});h(c$,"setProperty",function(a,b,c){"putty"===a?this.setPutty(b,c):this.setPropBSC(a,b,c)},"~S,~O,JU.BS");e(c$,"setPutty",function(a,b){var c=b.cardinality();if(0!=
c){for(var d=T(b.length(),0),f=0,e=0,h=3.4028235E38,n=0,j=b.nextSetBit(0);0<=j;j=b.nextSetBit(j+1)){var l=JM.Atom.atomPropertyFloat(null,this.atoms[j],1112541199,null),f=f+l,e=e+l*l;l<h&&(h=l);l>n&&(n=l)}var l=f/c,c=Math.sqrt((e-f*f/c)/c),f=a[1],e=a[2],m=a[3],p=a[4],s=a[5],u=F(a[6]),n=n-h,v=!1;switch(u){case 0:case 1:case 2:case 3:v=!0}for(j=b.nextSetBit(0);0<=j;j=b.nextSetBit(j+1)){var r=JM.Atom.atomPropertyFloat(null,this.atoms[j],1112541199,null);switch(u){case 0:case 4:r=1+(r-l)/e/c;break;case 1:case 5:r=
(r-h)/n/e;break;case 2:case 6:r/=e;break;case 8:0>r&&(r=0),r=Math.sqrt(r/8)/3.141592653589793}0>r&&(r=0);v&&(r=Math.pow(r,s));r<m&&0<=m&&(r=m);r>p&&0<=p&&(r=p);d[j]=r*f}d=new J.atomdata.RadiusData(d,0,J.atomdata.RadiusData.EnumType.ABSOLUTE,J.c.VDW.AUTO);this.setShapeSizeRD(0,d,b)}},"~A,JU.BS");G(c$,"PUTTY_NormalizedNonlinear",0,"PUTTY_RelativeNonlinear",1,"PUTTY_ScaledNonlinear",2,"PUTTY_AbsoluteNonlinear",3,"PUTTY_NormalizedLinear",4,"PUTTY_RelativeLinear",5,"PUTTY_ScaledLinear",6,"PUTTY_AbsoluteLinear",
7,"PUTTY_ImpliedRMS",8)});n("J.renderbio");v("J.render.MeshRenderer JU.A4 $.BS $.M3 $.P3 $.P3i $.V3".split(" "),"J.renderbio.BioShapeRenderer","J.c.STR JM.CarbohydratePolymer $.NucleicPolymer J.shape.Mesh JU.C $.GData $.Logger $.Normix".split(" "),function(){c$=y(function(){this.haveControlPointScreens=this.ribbonBorder=this.isTraceAlpha=this.isHighRes=this.invalidateSheets=this.invalidateMesh=!1;this.sheetSmoothing=this.hermiteLevel=this.aspectRatio=0;this.cartoonsFancy=!1;this.bsRenderMesh=this.meshReady=
this.meshes=null;this.monomerCount=0;this.monomers=null;this.isCarbohydrate=this.isNucleic=!1;this.structureTypes=this.colixesBack=this.colixes=this.mads=this.wingVectors=this.leadAtomIndices=this.controlPointScreens=this.controlPoints=this.ribbonBottomScreens=this.ribbonTopScreens=this.bsVisible=null;this.wireframeOnly=this.isPass2=!1;this.pointT=null;this.diameterEnd=this.diameterMid=this.diameterBeg=this.iNext3=this.iNext2=this.iNext=this.iPrev=0;this.doCap1=this.doCap0=!1;this.colixBack=0;this.norml=
this.bsTemp=this.mat=this.ptNext=this.ptPrev=this.pt1=this.pt=this.aa=this.wingT=this.wing1=this.wing=this.norm=this.radiusHermites=this.wingHermites=this.controlHermites=this.screenArrowBotPrev=this.screenArrowBot=this.screenArrowTopPrev=this.screenArrowTop=this.reversed=null;x(this,arguments)},J.renderbio,"BioShapeRenderer",J.render.MeshRenderer);S(c$,function(){this.bsVisible=new JU.BS;this.pointT=new JU.P3;this.screenArrowTop=new JU.P3i;this.screenArrowTopPrev=new JU.P3i;this.screenArrowBot=new JU.P3i;
this.screenArrowBotPrev=new JU.P3i;this.norm=new JU.V3;this.wing=new JU.V3;this.wing1=new JU.V3;this.wingT=new JU.V3;this.aa=new JU.A4;this.pt=new JU.P3;this.pt1=new JU.P3;this.ptPrev=new JU.P3;this.ptNext=new JU.P3;this.mat=new JU.M3;this.norml=new JU.V3});h(c$,"render",function(){if(null==this.shape)return!1;this.setGlobals();this.renderShapes();return this.needTranslucent});e(c$,"setGlobals",function(){this.isPass2=this.g3d.isPass2();this.needTranslucent=this.invalidateMesh=!1;this.g3d.addRenderer(553648147);
var a=!this.isExport&&!this.vwr.checkMotionRendering(1113200642);a!=this.wireframeOnly&&(this.invalidateMesh=!0);this.wireframeOnly=a;a=this.isExport||!this.wireframeOnly&&this.vwr.getBoolean(603979864);a!=this.isHighRes&&(this.invalidateMesh=!0);this.isHighRes=a;a=!this.wireframeOnly&&this.vwr.getBoolean(603979817);this.cartoonsFancy!=a&&(this.invalidateMesh=!0,this.cartoonsFancy=a);a=this.vwr.getHermiteLevel();a=0>=a?-a:this.vwr.getInMotion(!0)?0:a;this.cartoonsFancy&&!this.wireframeOnly&&(a=Math.max(a,
3));a!=this.hermiteLevel&&(this.invalidateMesh=!0);this.hermiteLevel=Math.min(a,8);var b=this.vwr.getInt(553648166),b=Math.min(Math.max(0,b),20);this.cartoonsFancy&&16<=b&&(b=4);if(this.wireframeOnly||0==this.hermiteLevel)b=0;b!=this.aspectRatio&&(0!=b&&0!=a)&&(this.invalidateMesh=!0);this.aspectRatio=b;a=this.vwr.getBoolean(603979966);a!=this.isTraceAlpha&&(this.invalidateMesh=!0);this.isTraceAlpha=a;this.invalidateSheets=!1;a=this.vwr.getFloat(570425392);a!=this.sheetSmoothing&&this.isTraceAlpha&&
(this.sheetSmoothing=a,this.invalidateSheets=this.invalidateMesh=!0)});e(c$,"renderShapes",function(){for(var a=this.shape,b=a.bioShapes.length;0<=--b;){var c=a.getBioShape(b);0!=(c.modelVisibilityFlags&this.myVisibilityFlag)&&(2<=c.monomerCount&&this.initializePolymer(c))&&(this.bsRenderMesh.clearAll(),this.renderBioShape(c),this.renderMeshes(),this.freeTempArrays())}});e(c$,"setBioColix",function(a){if(this.g3d.setC(a))return!0;this.needTranslucent=!0;return!1},"~N");e(c$,"freeTempArrays",function(){this.haveControlPointScreens&&
this.vwr.freeTempScreens(this.controlPointScreens);this.vwr.freeTempEnum(this.structureTypes)});e(c$,"initializePolymer",function(a){var b=this.vwr.getDeletedAtoms();this.controlPoints=this.vwr.ms.isJmolDataFrameForModel(a.modelIndex)?a.bioPolymer.getControlPoints(!0,0,!1):a.bioPolymer.getControlPoints(this.isTraceAlpha,this.sheetSmoothing,this.invalidateSheets);this.monomerCount=a.monomerCount;this.bsRenderMesh=JU.BS.newN(this.monomerCount);this.monomers=a.monomers;this.reversed=a.bioPolymer.reversed;
this.leadAtomIndices=a.bioPolymer.getLeadAtomIndices();this.bsVisible.clearAll();var c=!1;this.invalidateMesh&&a.falsifyMesh();for(var d=this.monomerCount;0<=--d;)if(!(0==(this.monomers[d].shapeVisibilityFlags&this.myVisibilityFlag)||this.ms.isAtomHidden(this.leadAtomIndices[d])||null!=b&&b.get(this.leadAtomIndices[d]))){var f=this.ms.at[this.leadAtomIndices[d]];this.g3d.isInDisplayRange(f.sX,f.sY)&&(this.bsVisible.set(d),c=!0)}if(!c)return!1;this.ribbonBorder=this.vwr.getBoolean(603979898);this.isNucleic=
A(a.bioPolymer,JM.NucleicPolymer);this.isCarbohydrate=A(a.bioPolymer,JM.CarbohydratePolymer);this.haveControlPointScreens=!1;this.wingVectors=a.wingVectors;this.meshReady=a.meshReady;this.meshes=a.meshes;this.mads=a.mads;this.colixes=a.colixes;this.colixesBack=a.colixesBack;this.setStructureTypes();return!0},"J.shapebio.BioShape");e(c$,"setStructureTypes",function(){this.structureTypes=this.vwr.allocTempEnum(this.monomerCount+1);for(var a=this.monomerCount;0<=--a;)this.structureTypes[a]=this.monomers[a].getProteinStructureType(),
this.structureTypes[a]===J.c.STR.TURN&&(this.structureTypes[a]=J.c.STR.NONE);this.structureTypes[this.monomerCount]=this.structureTypes[this.monomerCount-1]});e(c$,"isHelix",function(a){return this.structureTypes[a]===J.c.STR.HELIX},"~N");e(c$,"getScreenControlPoints",function(){this.calcScreenControlPoints(this.controlPoints)});e(c$,"calcScreenControlPoints",function(a){var b=this.monomerCount+1;for(this.controlPointScreens=this.vwr.allocTempScreens(b);0<=--b;)this.tm.transformPtScr(a[b],this.controlPointScreens[b]);
this.haveControlPointScreens=!0},"~A");e(c$,"calcScreens",function(a){var b=this.controlPoints.length,c=this.vwr.allocTempScreens(b);if(0==a)for(;0<=--b;)this.tm.transformPtScr(this.controlPoints[b],c[b]);else for(a/=1E3;0<=--b;)this.calc1Screen(this.controlPoints[b],this.wingVectors[b],0==this.mads[b]&&0<b?this.mads[b-1]:this.mads[b],a,c[b]);return c},"~N");e(c$,"calc1Screen",function(a,b,c,d,f){this.pointT.scaleAdd2(c*d,b,a);this.tm.transformPtScr(this.pointT,f)},"JU.P3,JU.V3,~N,~N,JU.P3i");e(c$,
"getLeadColix",function(a){return JU.C.getColixInherited(this.colixes[a],this.monomers[a].getLeadAtom().getColix())},"~N");e(c$,"getLeadColixBack",function(a){return null==this.colixesBack||this.colixesBack.length<=a?0:this.colixesBack[a]},"~N");e(c$,"setNeighbors",function(a){this.iPrev=Math.max(a-1,0);this.iNext=Math.min(a+1,this.monomerCount);this.iNext2=Math.min(a+2,this.monomerCount);this.iNext3=Math.min(a+3,this.monomerCount)},"~N");e(c$,"setMads",function(a,b){this.madMid=this.madBeg=this.madEnd=
this.mads[a];if(this.isTraceAlpha){if(!b||this.structureTypes[a]===this.structureTypes[this.iNext])this.madEnd=this.mads[this.iNext],0==this.madEnd&&(A(this,J.renderbio.TraceRenderer),this.madEnd=this.madBeg),this.madMid=this.madBeg+this.madEnd>>1}else{if(!b||this.structureTypes[a]===this.structureTypes[this.iPrev])this.madBeg=(0==this.mads[this.iPrev]?this.madMid:this.mads[this.iPrev])+this.madMid>>1;if(!b||this.structureTypes[a]===this.structureTypes[this.iNext])this.madEnd=(0==this.mads[this.iNext]?
this.madMid:this.mads[this.iNext])+this.madMid>>1}this.diameterBeg=F(this.vwr.tm.scaleToScreen(this.controlPointScreens[a].z,this.madBeg));this.diameterMid=F(this.vwr.tm.scaleToScreen(this.monomers[a].getLeadAtom().sZ,this.madMid));this.diameterEnd=F(this.vwr.tm.scaleToScreen(this.controlPointScreens[this.iNext].z,this.madEnd));this.doCap0=a==this.iPrev||b&&this.structureTypes[a]!==this.structureTypes[this.iPrev];this.doCap1=this.iNext==this.iNext2||b&&this.structureTypes[a]!==this.structureTypes[this.iNext];
return 0<this.aspectRatio&&(1==this.exportType||this.checkDiameter(this.diameterBeg)||this.checkDiameter(this.diameterMid)||this.checkDiameter(this.diameterEnd))},"~N,~B");e(c$,"checkDiameter",function(a){return(new Boolean((new Boolean(this.isHighRes&3<a)).valueOf()||8<=a)).valueOf()},"~N");e(c$,"renderHermiteCylinder",function(a,b){this.colix=this.getLeadColix(b);this.setBioColix(this.colix)&&(this.setNeighbors(b),this.g3d.drawHermite4(this.isNucleic?4:7,a[this.iPrev],a[b],a[this.iNext],a[this.iNext2]))},
"~A,~N");e(c$,"renderHermiteConic",function(a,b,c){this.setNeighbors(a);this.colix=this.getLeadColix(a);if(this.setBioColix(this.colix)){if(this.setMads(a,b)||this.isExport)try{if((null==this.meshes[a]||!this.meshReady[a])&&!this.createMesh(a,this.madBeg,this.madMid,this.madEnd,1,c))return;this.meshes[a].setColix(this.colix);this.bsRenderMesh.set(a);return}catch(d){if(P(d,Exception))this.bsRenderMesh.clear(a),this.meshes[a]=null,JU.Logger.error("render mesh error hermiteConic: "+d.toString());else throw d;
}0==this.diameterBeg&&0==this.diameterEnd||this.wireframeOnly?this.g3d.drawLineAB(this.controlPointScreens[a],this.controlPointScreens[this.iNext]):this.g3d.fillHermite(this.isNucleic?4:7,this.diameterBeg,this.diameterMid,this.diameterEnd,this.controlPointScreens[this.iPrev],this.controlPointScreens[a],this.controlPointScreens[this.iNext],this.controlPointScreens[this.iNext2])}},"~N,~B,~N");e(c$,"renderHermiteRibbon",function(a,b,c){this.setNeighbors(b);this.colix=this.getLeadColix(b);if(this.setBioColix(this.colix)){this.colixBack=
this.getLeadColixBack(b);if(a&&(0!=this.aspectRatio||this.isExport))if(this.setMads(b,c)||this.isExport)try{if((null==this.meshes[b]||!this.meshReady[b])&&!this.createMesh(b,this.madBeg,this.madMid,this.madEnd,this.aspectRatio,this.isNucleic?4:7))return;this.meshes[b].setColix(this.colix);this.meshes[b].setColixBack(this.colixBack);this.bsRenderMesh.set(b);return}catch(d){if(P(d,Exception))this.bsRenderMesh.clear(b),this.meshes[b]=null,JU.Logger.error("render mesh error hermiteRibbon: "+d.toString());
else throw d;}this.g3d.drawHermite7(a,this.ribbonBorder,(this.reversed.get(b)?-1:1)*(this.isNucleic?4:7),this.ribbonTopScreens[this.iPrev],this.ribbonTopScreens[b],this.ribbonTopScreens[this.iNext],this.ribbonTopScreens[this.iNext2],this.ribbonBottomScreens[this.iPrev],this.ribbonBottomScreens[b],this.ribbonBottomScreens[this.iNext],this.ribbonBottomScreens[this.iNext2],F(this.aspectRatio),this.colixBack)}},"~B,~N,~B");e(c$,"renderHermiteArrowHead",function(a){this.colix=this.getLeadColix(a);if(this.setBioColix(this.colix)){this.colixBack=
this.getLeadColixBack(a);this.setNeighbors(a);if(this.setMads(a,!1)||this.isExport)try{this.doCap0=!0;this.doCap1=!1;if((null==this.meshes[a]||!this.meshReady[a])&&!this.createMesh(a,C(Math.floor(1.2*this.madBeg)),C(Math.floor(0.6*this.madBeg)),0,1==this.aspectRatio?this.aspectRatio:this.aspectRatio/2,7))return;this.meshes[a].setColix(this.colix);this.bsRenderMesh.set(a);return}catch(b){if(P(b,Exception))this.bsRenderMesh.clear(a),this.meshes[a]=null,JU.Logger.error("render mesh error hermiteArrowHead: "+
b.toString());else throw b;}this.calc1Screen(this.controlPoints[a],this.wingVectors[a],this.madBeg,7E-4,this.screenArrowTop);this.calc1Screen(this.controlPoints[a],this.wingVectors[a],this.madBeg,-7E-4,this.screenArrowBot);this.calc1Screen(this.controlPoints[a],this.wingVectors[a],this.madBeg,0.001,this.screenArrowTopPrev);this.calc1Screen(this.controlPoints[a],this.wingVectors[a],this.madBeg,-0.001,this.screenArrowBotPrev);this.g3d.drawHermite7(!0,this.ribbonBorder,this.isNucleic?4:7,this.screenArrowTopPrev,
this.screenArrowTop,this.controlPointScreens[this.iNext],this.controlPointScreens[this.iNext2],this.screenArrowBotPrev,this.screenArrowBot,this.controlPointScreens[this.iNext],this.controlPointScreens[this.iNext2],F(this.aspectRatio),this.colixBack);this.ribbonBorder&&0==this.aspectRatio&&this.g3d.fillCylinderXYZ(this.colix,this.colix,3,1==this.exportType?50:3,this.screenArrowTop.x,this.screenArrowTop.y,this.screenArrowTop.z,this.screenArrowBot.x,this.screenArrowBot.y,this.screenArrowBot.z)}},"~N");
e(c$,"createMesh",function(a,b,c,d,f,e){this.setNeighbors(a);if(0==this.controlPoints[a].distance(this.controlPoints[this.iNext]))return!1;var h=1!=f&&null!=this.wingVectors,n=0==f,j=this.cartoonsFancy||6<=this.hermiteLevel,l=2*(this.hermiteLevel+1)+1,m=n?4:4*(this.hermiteLevel+1)-2,p=n?3.141592653589793/(m-1):6.283185307179586/m,s=this.meshes[a]=(new J.shape.Mesh).mesh1("mesh_"+this.shapeID+"_"+a,0,a),u=b!=c||c!=d;if(null==this.controlHermites||this.controlHermites.length<l+1)this.controlHermites=
Array(l+1);JU.GData.getHermiteList(e,this.controlPoints[this.iPrev],this.controlPoints[a],this.controlPoints[this.iNext],this.controlPoints[this.iNext2],this.controlPoints[this.iNext3],this.controlHermites,0,l,!0);if(null==this.wingHermites||this.wingHermites.length<l+1)this.wingHermites=Array(l+1);this.wing.setT(this.wingVectors[this.iPrev]);0==d&&this.wing.scale(2);JU.GData.getHermiteList(e,this.wing,this.wingVectors[a],this.wingVectors[this.iNext],this.wingVectors[this.iNext2],this.wingVectors[this.iNext3],
this.wingHermites,0,l,!1);b/=2E3;c/=2E3;d/=2E3;if(u){if(null==this.radiusHermites||this.radiusHermites.length<(l+1>>1)+1)this.radiusHermites=Array((l+1>>1)+1);this.ptPrev.set(b,b,0);this.pt.set(b,c,0);this.pt1.set(c,d,0);this.ptNext.set(d,d,0);JU.GData.getHermiteList(4,this.ptPrev,this.pt,this.pt1,this.ptNext,this.ptNext,this.radiusHermites,0,l+1>>1,!0)}d=0;c=l>>1;e=C((m+2)/4);for(var v=C((3*m+2)/4),h=!h?0:n?1:j?2:3,j=0==h||3==h,r=0;r<l;r++){this.norm.sub2(this.controlHermites[r+1],this.controlHermites[r]);
var q=!u?b:r<c?this.radiusHermites[r].x:this.radiusHermites[r-c].y;this.wing.setT(this.wingHermites[r]);this.wing1.setT(this.wing);switch(h){case 2:this.wing1.cross(this.norm,this.wing);this.wing1.normalize();this.wing1.scale(this.wing.length()/f);break;case 3:this.wing.scale(2/f);this.wing1.sub(this.wing);break;case 0:this.wing.cross(this.wing,this.norm),this.wing.normalize()}this.wing.scale(q);this.wing1.scale(q);j&&(this.aa.setVA(this.norm,p),this.mat.setAA(this.aa));this.pt1.setT(this.controlHermites[r]);
for(var x=n?0:p,q=0;q<m;q++,x+=p){j&&0<q&&this.mat.rotate(this.wing);switch(h){case 1:this.wingT.setT(this.wing1);this.wingT.scale(Math.cos(x));break;case 2:this.wingT.setT(this.wing1);this.wingT.scale(Math.sin(x));this.wingT.scaleAdd2(Math.cos(x),this.wing,this.wingT);break;case 3:this.wingT.setT(this.wing);(q==e||q==v)&&this.wing1.scale(-1);this.wingT.add(this.wing1);break;case 0:this.wingT.setT(this.wing)}this.pt.add2(this.pt1,this.wingT);s.addV(this.pt,!0)}if(0<r){x=n?m-1:m;for(q=0;q<x;q++){var w=
d-m+q,t=d-m+(q+1)%m,y=d+(q+1)%m,A=d+q;q<C(x/2)?s.addQuad(w,t,y,A):s.addQuad(t,y,A,w)}}d+=m}if(!n){f=d;if(this.doCap0){for(n=0;n<m;n++)s.addV(s.vs[n],!0);d+=m;for(q=2*this.hermiteLevel;0<=--q;)s.addQuad(d-m+q+2,d-m+q+1,d-m+(m-q)%m,d-q-1)}if(this.doCap1){for(n=0;n<m;n++)s.addV(s.vs[f-m+n],!0);d+=m;for(q=2*this.hermiteLevel;0<=--q;)s.addQuad(d-q-1,d-m+(m-q)%m,d-m+q+1,d-m+q+2)}}this.meshReady[a]=!0;this.adjustCartoonSeamNormals(a,m);s.setVisibilityFlags(1);return!0},"~N,~N,~N,~N,~N,~N");e(c$,"adjustCartoonSeamNormals",
function(a,b){null==this.bsTemp&&(this.bsTemp=JU.Normix.newVertexBitSet());if(a==this.iNext-1&&this.iNext<this.monomerCount&&this.monomers[a].getStrucNo()==this.monomers[this.iNext].getStrucNo()&&this.meshReady[a]&&this.meshReady[this.iNext])try{var c=this.meshes[this.iNext].getNormalsTemp(),d=this.meshes[a].getNormalsTemp(),e=d.length;this.doCap0&&(e-=b);for(var g=1;g<=b;++g)this.norml.add2(d[e-g],c[b-g]),this.norml.normalize(),this.meshes[a].normalsTemp[e-g].setT(this.norml),this.meshes[this.iNext].normalsTemp[b-
g].setT(this.norml)}catch(h){if(!P(h,Exception))throw h;}},"~N,~N");e(c$,"renderMeshes",function(){for(var a=this.bsRenderMesh.nextSetBit(0);0<=a;a=this.bsRenderMesh.nextSetBit(a+1))null!=this.meshes[a].normalsTemp?(this.meshes[a].setNormixes(this.meshes[a].normalsTemp),this.meshes[a].normalsTemp=null):null==this.meshes[a].normixes&&this.meshes[a].initialize(1073741958,null,null),this.renderMesh(this.meshes[a])});G(c$,"ABSOLUTE_MIN_MESH_SIZE",3,"MIN_MESH_RENDER_SIZE",8,"MODE_TUBE",0,"MODE_FLAT",1,
"MODE_ELLIPTICAL",2,"MODE_NONELLIPTICAL",3)});n("J.renderbio");v(["J.renderbio.BioShapeRenderer"],"J.renderbio.StrandsRenderer",["J.shapebio.Strands"],function(){c$=y(function(){this.strandCount=1;this.baseStrandOffset=this.strandSeparation=0;x(this,arguments)},J.renderbio,"StrandsRenderer",J.renderbio.BioShapeRenderer);h(c$,"renderBioShape",function(){this.renderStrandShape()},"J.shapebio.BioShape");e(c$,"renderStrandShape",function(){this.setStrandCount()&&this.renderStrands()});e(c$,"setStrandCount",
function(){if(null==this.wingVectors)return!1;this.strandCount=A(this.shape,J.shapebio.Strands)?this.vwr.getStrandCount(this.shape.shapeID):10;this.strandSeparation=1>=this.strandCount?0:1/(this.strandCount-1);this.baseStrandOffset=0==(this.strandCount&1)?this.strandSeparation/2:this.strandSeparation;return!0});e(c$,"renderStrands",function(){for(var a,b=this.strandCount>>1;0<=--b;){var c=b*this.strandSeparation+this.baseStrandOffset;a=this.calcScreens(c);this.renderStrand(a);this.vwr.freeTempScreens(a);
a=this.calcScreens(-c);this.renderStrand(a);this.vwr.freeTempScreens(a)}1==this.strandCount%2&&(a=this.calcScreens(0),this.renderStrand(a),this.vwr.freeTempScreens(a))});e(c$,"renderStrand",function(a){for(var b=this.bsVisible.nextSetBit(0);0<=b;b=this.bsVisible.nextSetBit(b+1))this.renderHermiteCylinder(a,b)},"~A")});n("J.renderbio");v(["J.renderbio.MeshRibbonRenderer"],"J.renderbio.RibbonsRenderer",null,function(){c$=E(J.renderbio,"RibbonsRenderer",J.renderbio.MeshRibbonRenderer);h(c$,"renderBioShape",
function(){null!=this.wingVectors&&(this.wireframeOnly?this.renderStrands():this.render2Strand(!0,this.isNucleic?1:0.5,this.isNucleic?0:0.5))},"J.shapebio.BioShape")});n("J.renderbio");v(["J.renderbio.StrandsRenderer"],"J.renderbio.MeshRibbonRenderer",null,function(){c$=E(J.renderbio,"MeshRibbonRenderer",J.renderbio.StrandsRenderer);h(c$,"renderBioShape",function(){this.wireframeOnly?this.renderStrands():this.renderMeshRibbon()},"J.shapebio.BioShape");e(c$,"renderMeshRibbon",function(){if(this.setStrandCount()){var a=
(this.strandCount>>1)*this.strandSeparation+this.baseStrandOffset;this.render2Strand(!1,a,a);this.renderStrands()}});e(c$,"render2Strand",function(a,b,c){this.getScreenControlPoints();this.ribbonTopScreens=this.calcScreens(b);this.ribbonBottomScreens=this.calcScreens(-c);for(b=this.bsVisible.nextSetBit(0);0<=b;b=this.bsVisible.nextSetBit(b+1))this.renderHermiteRibbon(a,b,!1);this.vwr.freeTempScreens(this.ribbonTopScreens);this.vwr.freeTempScreens(this.ribbonBottomScreens)},"~B,~N,~N")});n("J.renderbio");
v(["J.renderbio.StrandsRenderer","JU.P3","$.V3"],"J.renderbio.RocketsRenderer",["J.c.STR","JM.AlphaPolymer","$.Helix","$.Sheet"],function(){c$=y(function(){this.renderArrowHeads=this.newRockets=!1;this.cordMidPoints=null;this.tPending=!1;this.proteinstructurePending=null;this.endIndexPending=this.startIndexPending=0;this.screenCorners=this.corners=this.vH=this.vW=this.ptTip=this.ptC=this.vTemp=this.vtemp=this.screenC=this.screenB=this.screenA=null;x(this,arguments)},J.renderbio,"RocketsRenderer",
J.renderbio.StrandsRenderer);S(c$,function(){this.screenA=new JU.P3;this.screenB=new JU.P3;this.screenC=new JU.P3;this.vtemp=new JU.V3;this.vTemp=new JU.V3;this.ptC=new JU.P3;this.ptTip=new JU.P3;this.vW=new JU.V3;this.vH=new JU.V3;this.corners=Array(8);this.screenCorners=Array(8)});h(c$,"renderBioShape",function(a){if(A(a.bioPolymer,JM.AlphaPolymer))if(this.wireframeOnly)this.renderStrands();else{var b=!this.vwr.getBoolean(603979900);this.renderArrowHeads!=b&&(a.falsifyMesh(),this.renderArrowHeads=
b);this.calcRopeMidPoints(this.newRockets);this.calcScreenControlPoints(this.cordMidPoints);this.controlPoints=this.cordMidPoints;this.renderRockets();this.vwr.freeTempPoints(this.cordMidPoints)}},"J.shapebio.BioShape");e(c$,"isSheet",function(a){return this.structureTypes[a]===J.c.STR.SHEET},"~N");e(c$,"calcRopeMidPoints",function(a){this.cordMidPoints=this.vwr.allocTempPoints(this.monomerCount+1);for(var b=null,c,d=-10,e=new JU.P3,g=new JU.P3,h=0;h<this.monomerCount;++h){c=this.cordMidPoints[h];
var n=this.monomers[h];a&&this.renderArrowHeads?c.setT(this.controlPoints[h]):this.isHelix(h)||!a&&this.isSheet(h)?(n=n.getStructure(),n===b?(e.add(g),d=h):(b=n,e.setT(n.getAxisStartPoint()),g.sub2(n.getAxisEndPoint(),e),g.scale(1/(n.getMonomerCount()-1)),d==h-3&&this.cordMidPoints[h-1].ave(this.cordMidPoints[h-2],e)),c.setT(e)):(c.setT(null==b?this.controlPoints[h]:b.getAxisEndPoint()),b=null)}this.cordMidPoints[this.monomerCount].setT(null==b?this.controlPoints[this.monomerCount]:b.getAxisEndPoint())},
"~B");e(c$,"renderRockets",function(){this.tPending=!1;for(var a=this.bsVisible.nextSetBit(0);0<=a;a=this.bsVisible.nextSetBit(a+1)){var b=this.monomers[a];this.isHelix(a)||this.isSheet(a)?this.renderSpecialSegment(b,this.getLeadColix(a),this.mads[a]):(this.renderPending(),this.renderHermiteConic(a,!0,7))}this.renderPending()});e(c$,"renderSpecialSegment",function(a,b,c){var d=a.proteinStructure;if(this.tPending){if(d===this.proteinstructurePending&&c==this.mad&&b==this.colix&&d.getIndex(a)==this.endIndexPending+
1){++this.endIndexPending;return}this.renderPending()}this.proteinstructurePending=d;this.startIndexPending=this.endIndexPending=d.getIndex(a);this.colix=b;this.mad=c;this.tPending=!0},"JM.AlphaMonomer,~N,~N");e(c$,"renderPending",function(){if(this.tPending){var a=this.proteinstructurePending.getSegments(),b=this.endIndexPending==this.proteinstructurePending.getMonomerCount()-1;A(this.proteinstructurePending,JM.Helix)?this.renderPendingRocketSegment(this.endIndexPending,a[this.startIndexPending],
a[this.endIndexPending],a[this.endIndexPending+1],b):A(this.proteinstructurePending,JM.Sheet)&&this.renderPendingSheet(a[this.startIndexPending],a[this.endIndexPending],a[this.endIndexPending+1],b);this.tPending=!1}});e(c$,"renderPendingRocketSegment",function(a,b,c,d,e){this.tm.transformPt3f(b,this.screenA);this.tm.transformPt3f(d,this.screenB);c=C(Math.floor((this.screenA.z+this.screenB.z)/2));c=F(this.vwr.tm.scaleToScreen(c,this.mad));this.g3d.setC(this.colix)&&(this.g3d.fillCylinderBits(2,c,this.screenA,
this.screenB),e&&this.renderArrowHeads&&(this.vtemp.sub2(d,b),this.vtemp.normalize(),this.screenA.scaleAdd2(4,this.vtemp,d),this.tm.transformPt3f(this.screenA,this.screenC),this.renderCone(a,d,this.screenA,this.screenB,this.screenC)),this.startIndexPending!=this.endIndexPending&&(a=this.screenB,this.screenB=this.screenC,this.screenC=a))},"~N,JU.P3,JU.P3,JU.P3,~B");e(c$,"renderCone",function(a,b,c,d,e){a=(this.mad<<1)-(this.mad>>1);a=F(this.vwr.tm.scaleToScreen(C(Math.floor(d.z)),a));this.g3d.fillConeSceen3f(2,
a,d,e)},"~N,JU.P3,JU.P3,JU.P3,JU.P3");e(c$,"renderPendingSheet",function(a,b,c,d){if(this.g3d.setC(this.colix)){if(null==this.corners[0])for(var e=8;0<=--e;)this.corners[e]=new JU.P3,this.screenCorners[e]=new JU.P3;if(d&&this.renderArrowHeads){this.setBox(1.25,0.333,b);this.ptTip.scaleAdd2(-0.5,this.vH,c);for(e=4;0<=--e;)c=this.corners[e],c.setT(this.ptC),0!=(e&1)&&c.add(this.vW),0!=(e&2)&&c.add(this.vH),this.tm.transformPt3f(c,this.screenCorners[e]);this.corners[4].setT(this.ptTip);this.tm.transformPt3f(this.ptTip,
this.screenCorners[4]);this.corners[5].add2(this.ptTip,this.vH);this.tm.transformPt3f(this.corners[5],this.screenCorners[5]);this.g3d.fillTriangle3f(this.screenCorners[0],this.screenCorners[1],this.screenCorners[4],!0);this.g3d.fillTriangle3f(this.screenCorners[2],this.screenCorners[3],this.screenCorners[5],!0);for(e=0;12>e;e+=4){c=J.renderbio.RocketsRenderer.arrowHeadFaces[e];d=J.renderbio.RocketsRenderer.arrowHeadFaces[e+1];var g=J.renderbio.RocketsRenderer.arrowHeadFaces[e+2],h=J.renderbio.RocketsRenderer.arrowHeadFaces[e+
3];this.g3d.fillQuadrilateral(this.screenCorners[c],this.screenCorners[d],this.screenCorners[g],this.screenCorners[h])}c=b}this.setBox(1,0.25,a);this.vTemp.sub2(c,a);this.buildBox(this.ptC,this.vW,this.vH,this.vTemp);for(e=0;6>e;++e)c=J.renderbio.RocketsRenderer.boxFaces[4*e],d=J.renderbio.RocketsRenderer.boxFaces[4*e+1],g=J.renderbio.RocketsRenderer.boxFaces[4*e+2],h=J.renderbio.RocketsRenderer.boxFaces[4*e+3],this.g3d.fillQuadrilateral(this.screenCorners[c],this.screenCorners[d],this.screenCorners[g],
this.screenCorners[h])}},"JU.P3,JU.P3,JU.P3,~B");e(c$,"setBox",function(a,b,c){var d=this.proteinstructurePending,e=this.mad/1E3;this.vW.setT(d.getWidthUnitVector());this.vW.scale(e*a);this.vH.setT(d.getHeightUnitVector());this.vH.scale(e*b);this.ptC.ave(this.vW,this.vH);this.ptC.sub2(c,this.ptC)},"~N,~N,JU.P3");e(c$,"buildBox",function(a,b,c,d){for(var e=8;0<=--e;){var g=this.corners[e];g.setT(a);0!=(e&1)&&g.add(b);0!=(e&2)&&g.add(c);0!=(e&4)&&g.add(d);this.tm.transformPt3f(g,this.screenCorners[e])}},
"JU.P3,JU.V3,JU.V3,JU.V3");G(c$,"boxFaces",[0,1,3,2,0,2,6,4,0,4,5,1,7,5,4,6,7,6,2,3,7,3,1,5],"arrowHeadFaces",[0,1,3,2,0,4,5,2,1,4,5,3])});n("J.renderbio");v(["J.renderbio.RocketsRenderer","JU.P3","$.P3i"],"J.renderbio.CartoonRenderer",["JU.C"],function(){c$=y(function(){this.$renderRibose=this.ladderOnly=this.renderEdges=this.renderAsRockets=!1;this.baseScreen=this.basePt=this.rScr5=this.rPt5=this.rScr=this.rPt=this.ptConnect=this.ptConnectScr=null;x(this,arguments)},J.renderbio,"CartoonRenderer",
J.renderbio.RocketsRenderer);S(c$,function(){this.ptConnectScr=new JU.P3i;this.ptConnect=new JU.P3;this.rPt=Array(10);this.rScr=Array(10);this.rPt5=Array(5);this.rScr5=Array(5)});h(c$,"renderBioShape",function(a){if(this.wireframeOnly)this.renderStrands();else if(this.newRockets=!0,!(null==this.wingVectors||this.isCarbohydrate))if(this.getScreenControlPoints(),this.isNucleic)this.renderNucleic();else{var b=this.vwr.getBoolean(603979820);this.renderAsRockets!=b&&(a.falsifyMesh(),this.renderAsRockets=
b);b=!this.vwr.getBoolean(603979900);this.renderArrowHeads!=b&&(a.falsifyMesh(),this.renderArrowHeads=b);this.ribbonTopScreens=this.calcScreens(0.5);this.ribbonBottomScreens=this.calcScreens(-0.5);this.calcRopeMidPoints(this.newRockets);this.renderArrowHeads||(this.calcScreenControlPoints(this.cordMidPoints),this.controlPoints=this.cordMidPoints);this.renderRockets();this.vwr.freeTempPoints(this.cordMidPoints);this.vwr.freeTempScreens(this.ribbonTopScreens);this.vwr.freeTempScreens(this.ribbonBottomScreens)}},
"J.shapebio.BioShape");e(c$,"renderNucleic",function(){this.renderEdges=this.vwr.getBoolean(603979816);this.ladderOnly=this.vwr.getBoolean(603979818);this.$renderRibose=this.vwr.getBoolean(603979819);for(var a=this.vwr.getBoolean(603979966),b=this.bsVisible.nextSetBit(0);0<=b;b=this.bsVisible.nextSetBit(b+1))a?(this.ptConnectScr.set(C((this.controlPointScreens[b].x+this.controlPointScreens[b+1].x)/2),C((this.controlPointScreens[b].y+this.controlPointScreens[b+1].y)/2),C((this.controlPointScreens[b].z+
this.controlPointScreens[b+1].z)/2)),this.ptConnect.ave(this.controlPoints[b],this.controlPoints[b+1])):(this.ptConnectScr.setT(this.controlPointScreens[b+1]),this.ptConnect.setT(this.controlPoints[b+1])),this.renderHermiteConic(b,!1,4),this.colix=this.getLeadColix(b),this.setBioColix(this.colix)&&this.renderNucleicBaseStep(this.monomers[b],this.mads[b],this.ptConnectScr,this.ptConnect)});h(c$,"renderRockets",function(){for(var a=!1,b=!1,c=null,d,e=this.monomerCount;0<=--e;){d=this.monomers[e].getStructure();
d!==c&&(this.renderAsRockets&&(b=!1),a=!1);c=d;d=this.isHelix(e);var g=this.isSheet(e),h=this.renderAsRockets||!this.renderArrowHeads?d:!1;this.bsVisible.get(e)&&!h&&(g||d?a&&g||b&&d?this.renderHermiteRibbon(!0,e,!0):this.renderHermiteArrowHead(e):this.renderHermiteConic(e,!0,7));a=g;b=d}(this.renderAsRockets||!this.renderArrowHeads)&&this.renderCartoonRockets()});e(c$,"renderCartoonRockets",function(){this.tPending=!1;for(var a=this.bsVisible.nextSetBit(0);0<=a;a=this.bsVisible.nextSetBit(a+1))this.isHelix(a)&&
this.renderSpecialSegment(this.monomers[a],this.getLeadColix(a),this.mads[a]);this.renderPending()});e(c$,"renderNucleicBaseStep",function(a,b,c,d){if(null==this.rScr[0]){for(var e=10;0<=--e;)this.rScr[e]=new JU.P3i;for(e=5;0<=--e;)this.rScr5[e]=new JU.P3i;this.baseScreen=new JU.P3i;this.basePt=new JU.P3;this.rPt[9]=new JU.P3}if(this.renderEdges)this.renderLeontisWesthofEdges(a,b);else{a.getBaseRing6Points(this.rPt);this.tm.transformPoints(6,this.rPt,this.rScr);this.ladderOnly||this.renderRing6();
var g,h=a.maybeGetBaseRing5Points(this.rPt5);h?this.ladderOnly?(e=this.rScr[2],g=this.rPt[2]):(this.tm.transformPoints(5,this.rPt5,this.rScr5),this.renderRing5(),e=this.rScr5[3],g=this.rPt5[3]):(g=this.ladderOnly?4:2,e=this.rScr[g],g=this.rPt[g]);this.mad=1<b?C(b/2):b;b=this.mad/2E3;var n=F(this.vwr.tm.scaleToScreen(c.z,this.mad));(this.ladderOnly||!this.$renderRibose)&&this.g3d.fillCylinderScreen3I(3,n,c,e,d,g,b);if(!this.ladderOnly&&(this.drawEdges(this.rScr,this.rPt,6),h?this.drawEdges(this.rScr5,
this.rPt5,5):this.renderEdge(this.rScr,this.rPt,0,5),this.$renderRibose)){this.baseScreen.setT(e);this.basePt.setT(g);a.getRiboseRing5Points(this.rPt);a=this.rPt[9];a.set(0,0,0);for(e=0;5>e;e++)a.add(this.rPt[e]);a.scale(0.2);this.tm.transformPoints(10,this.rPt,this.rScr);this.renderRibose();this.renderEdge(this.rScr,this.rPt,2,5);this.renderEdge(this.rScr,this.rPt,3,6);this.renderEdge(this.rScr,this.rPt,6,7);this.renderEdge(this.rScr,this.rPt,7,8);this.renderCyl(this.rScr[0],this.baseScreen,this.rPt[0],
this.basePt);this.drawEdges(this.rScr,this.rPt,5)}}},"JM.NucleicMonomer,~N,JU.P3i,JU.P3");e(c$,"drawEdges",function(a,b,c){for(var d=c;0<=--d;)a[d].z--;for(d=c;0<--d;)this.renderEdge(a,b,d,d-1)},"~A,~A,~N");e(c$,"renderLeontisWesthofEdges",function(a,b){if(a.getEdgePoints(this.rPt)){this.tm.transformPoints(6,this.rPt,this.rScr);this.renderTriangle(this.rScr,this.rPt,2,3,4,!0);this.mad=1<b?C(b/2):b;this.renderEdge(this.rScr,this.rPt,0,1);this.renderEdge(this.rScr,this.rPt,1,2);var c=JU.C.isColixTranslucent(this.colix),
d=JU.C.getColixTranslucencyLevel(this.colix),e=JU.C.getColixTranslucent3(10,c,d),g=JU.C.getColixTranslucent3(11,c,d),c=JU.C.getColixTranslucent3(7,c,d);this.g3d.setC(e);this.renderEdge(this.rScr,this.rPt,2,3);this.g3d.setC(g);this.renderEdge(this.rScr,this.rPt,3,4);this.g3d.setC(c);this.renderEdge(this.rScr,this.rPt,4,5)}},"JM.NucleicMonomer,~N");e(c$,"renderEdge",function(a,b,c,d){this.renderCyl(a[c],a[d],b[c],b[d])},"~A,~A,~N,~N");e(c$,"renderCyl",function(a,b,c,d){this.g3d.fillCylinderScreen3I(3,
3,a,b,c,d,0.005)},"JU.P3i,JU.P3i,JU.P3,JU.P3");e(c$,"renderTriangle",function(a,b,c,d,e,g){g&&this.g3d.setNoisySurfaceShade(a[c],a[d],a[e]);this.g3d.fillTriangle3i(a[c],a[d],a[e],b[c],b[d],b[e])},"~A,~A,~N,~N,~N,~B");e(c$,"renderRing6",function(){this.renderTriangle(this.rScr,this.rPt,0,2,4,!0);this.renderTriangle(this.rScr,this.rPt,0,1,2,!1);this.renderTriangle(this.rScr,this.rPt,0,4,5,!1);this.renderTriangle(this.rScr,this.rPt,2,3,4,!1)});e(c$,"renderRing5",function(){this.renderTriangle(this.rScr5,
this.rPt5,0,1,2,!1);this.renderTriangle(this.rScr5,this.rPt5,0,2,3,!1);this.renderTriangle(this.rScr5,this.rPt5,0,3,4,!1)});e(c$,"renderRibose",function(){this.renderTriangle(this.rScr,this.rPt,0,1,9,!0);this.renderTriangle(this.rScr,this.rPt,1,2,9,!0);this.renderTriangle(this.rScr,this.rPt,2,3,9,!0);this.renderTriangle(this.rScr,this.rPt,3,4,9,!0);this.renderTriangle(this.rScr,this.rPt,4,0,9,!0)})});n("J.renderbio");v(["J.renderbio.BioShapeRenderer"],"J.renderbio.BackboneRenderer",["JU.C"],function(){c$=
y(function(){this.isDataFrame=!1;x(this,arguments)},J.renderbio,"BackboneRenderer",J.renderbio.BioShapeRenderer);h(c$,"renderBioShape",function(a){var b=this.vwr.getBoolean(603979811)&&a.bioPolymer.isNucleic();this.isDataFrame=this.vwr.ms.isJmolDataFrameForModel(a.modelIndex);for(a=this.bsVisible.nextSetBit(0);0<=a;a=this.bsVisible.nextSetBit(a+1)){var c=this.ms.at[this.leadAtomIndices[a]],d=this.colixes[a];this.mad=this.mads[a];this.drawSegment(c,this.ms.at[this.leadAtomIndices[a+1]],d,this.colixes[a+
1],100);if(b){var e=this.monomers[a],g=e.getBasePairs();if(null!=g)for(var h=g.size();0<=--h;){var n=g.get(h).getPartnerAtom(e);n>a&&this.drawSegment(c,this.ms.at[n],d,d,1E3)}}}},"J.shapebio.BioShape");e(c$,"drawSegment",function(a,b,c,d,e){if(!(0==a.getNBackbonesDisplayed()||0==b.getNBackbonesDisplayed()||this.ms.isAtomHidden(b.i)||!this.isDataFrame&&a.distanceSquared(b)>e))if(c=JU.C.getColixInherited(c,a.getColix()),d=JU.C.getColixInherited(d,b.getColix()),this.isExport||this.isPass2||this.setBioColix(c)||
this.setBioColix(d)){var g=a.sX,h=a.sY;a=a.sZ;var n=b.sX,j=b.sY;b=b.sZ;var l=this.mad;1E3==e&&(l>>=1);0>l?this.g3d.drawLine(c,d,g,h,a,n,j,b):(e=F(1==this.exportType?l:this.vwr.tm.scaleToScreen(C((a+b)/2),l)),this.g3d.fillCylinderXYZ(c,d,3,e,g,h,a,n,j,b))}},"JM.Atom,JM.Atom,~N,~N,~N")});n("J.renderbio");v(["J.renderbio.StrandsRenderer"],"J.renderbio.TraceRenderer",null,function(){c$=E(J.renderbio,"TraceRenderer",J.renderbio.StrandsRenderer);h(c$,"renderBioShape",function(){this.wireframeOnly?this.renderStrands():
this.renderTrace()},"J.shapebio.BioShape");e(c$,"renderTrace",function(){this.getScreenControlPoints();for(var a=this.bsVisible.nextSetBit(0);0<=a;a=this.bsVisible.nextSetBit(a+1))this.renderHermiteConic(a,!1,7)})})})(Clazz,Clazz.doubleToInt,Clazz.declarePackage,Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,Clazz.floatToInt,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.defineStatics,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,
Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.p0p,Clazz.pu$h,Clazz.newShortArray,Clazz.innerTypeInstance,Clazz.isClassDefined,Clazz.prepareCallback,Clazz.newArray,Clazz.castNullAs,Clazz.floatToShort,Clazz.superCall,Clazz.decorateAsType,Clazz.newBooleanArray,Clazz.newCharArray,Clazz.implementOf,Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.clone,Clazz.doubleToShort,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.isAI,Clazz.isAS,Clazz.isASS,Clazz.isAP,Clazz.isAFloat,
Clazz.isAII,Clazz.isAFF,Clazz.isAFFF,Clazz.tryToSearchAndExecute,Clazz.getStackTrace,Clazz.inheritArgs,Clazz.alert,Clazz.defineMethod,Clazz.overrideMethod,Clazz.declareAnonymous,Clazz.cloneFinals);
