(function(E,X,Y,Z,G,$,r,x,t,w,z,D,aa,A,N,O,s,I,K,B,Q,L,H,ba,ca,da,R,ea,fa,ga,F,ha,S,T,ia,U,P,ja,ka,M,la,V,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,Aa,Ba,e,h){r("J.adapter.readers.pdb");t(["J.adapter.smarter.AtomSetCollectionReader","java.util.Hashtable"],"J.adapter.readers.pdb.PdbReader","java.lang.Boolean $.Float JU.Lst $.M4 $.P3 $.PT $.SB J.adapter.smarter.Atom $.Structure J.api.JmolAdapter J.c.STR JU.Escape $.Logger".split(" "),function(){var b=z(function(){this.lineLength=this.serial=this.seqMode=
this.serMode=0;this.pdbHeader=null;this.gromacsWideFormat=this.isLegacyModelType=this.isConnectStateBug=this.haveMappedSerials=this.isMultiModel=this.getTlsGroups=this.applySymmetry=!1;this.sb=this.sbConect=this.sbSelected=this.sbIgnored=this.biomtChainAtomCounts=this.sbTlsErrors=this.vTlsModels=this.vBiomolecules=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.isbiomol=this.isCourseGrained=!1;this.htGroup1=null;this.maxLength=80;this.pdbID=null;this.haveDoubleBonds=!1;this.$cryst1=0;this.vConnect=this.tlsU=this.dataT=this.fileSgName=
null;this.connectNextAtomSet=this.connectNextAtomIndex=0;this.connectLast=null;w(this,arguments)},J.adapter.readers.pdb,"PdbReader",J.adapter.smarter.AtomSetCollectionReader);Q(b,function(){this.htFormul=new java.util.Hashtable;this.dataT=K(8,0)});h(b,"initializeReader",function(){this.allowPDBFilter=!0;this.pdbHeader=this.getHeader?new JU.SB:null;this.applySymmetry=!this.checkFilterKey("NOSYMMETRY");this.isDSSP1&&this.asc.setInfo("isDSSP1",Boolean.TRUE);this.getTlsGroups=this.checkFilterKey("TLS");
this.checkFilterKey("ASSEMBLY")&&(this.filter=JU.PT.rep(this.filter,"ASSEMBLY","BIOMOLECULE"));if(this.isbiomol=this.checkFilterKey("BIOMOLECULE"))this.filter=this.filter.$replace(":"," ");var a=this.isbiomol&&this.checkFilterKey("BYCHAIN"),d=this.isbiomol&&this.checkFilterKey("BYSYMOP");(this.isCourseGrained=a||d)||this.setIsPDB();this.isConcatenated=(new Boolean(this.isConcatenated|this.filePath.endsWith(".dssr"))).valueOf();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,d=a[1].indexOf("="),0<=d?this.setFilterAtomTypeStr(a[1].substring(d+1).toUpperCase()):d=a[1].length,this.atomTypeLen=Integer.parseInt(a[1].substring(0,d)));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(b,"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,d=0==a||1==a,c=2==a;this.serial=d?this.getSerial(6,11):0;var g=(this.isTrajectory||this.isSequential)&&
!this.isMultiModel&&d&&1==this.serial;this.getHeader&&(d||c?this.getHeader=!1:this.readHeader(!1));if(c||g){this.isMultiModel=c;this.getHeader=!1;c=g?this.modelNumber+1:this.getModelNumber();g=this.getModelName();this.modelNumber=this.useFileModelNumbers?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,g);if(this.isLegacyModelType||!d)return!0}if(this.isMultiModel&&!this.doProcessLines)return!0;if(d)return this.getHeader=!1,this.atom(),!0;switch(a){case 3:this.conect();break;case 4:case 5:case 6:this.ignoreStructure||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.startsWith("REMARK 285"))return this.remark285();if(this.line.startsWith("REMARK 350"))return this.remark350();if(this.line.startsWith("REMARK 290"))return this.remark290();this.line.contains("This file does not adhere to the PDB standard")&&(this.gromacsWideFormat=!0);if(this.getTlsGroups&&0<this.line.indexOf("TLS DETAILS"))return this.remarkTls();this.checkRemark();break;case 18:this.header();break;case 19:case 20:this.compnd(20==a);break;case 21:this.title();
break;case 22:this.seqAdv()}return!0});e(b,"checkRemark",function(){this.checkCurrentLineForScript()});e(b,"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 d=this.line.substring(12,15).trim();this.htGroup1.put(d,a)}});e(b,"readHeader",function(a){if(a&&(this.rd(),!this.getHeader))return this.line;this.pdbHeader.append(this.line).appendC("\n");return this.line},"~B");
h(b,"finalizeSubclassReader",function(){this.finalizeReaderPDB()});e(b,"finalizeReaderPDB",function(){this.checkNotPDB();null!=this.pdbID&&0<this.pdbID.length&&(this.isMultiModel||this.asc.setAtomSetName(this.pdbID),this.asc.setCurrentModelInfo("pdbID",this.pdbID));this.checkUnitCellParams();this.isCourseGrained||this.connectAll(this.maxSerial,this.isConnectStateBug);var a;null!=this.vBiomolecules&&(0<this.vBiomolecules.size()&&0<this.asc.ac)&&(this.asc.setCurrentModelInfo("biomolecules",this.vBiomolecules),
this.setBiomoleculeAtomCounts(),null!=this.thisBiomolecule&&this.applySymmetry&&(this.asc.getXSymmetry().applySymmetryBio(this.thisBiomolecule,this.applySymmetryToBonds,this.filter),this.vTlsModels=null,this.asc.xtalSymmetry=null));if(null!=this.vTlsModels){a=this.getInterface("JS.Symmetry");var d=this.asc.atomSetCount;if(d==this.vTlsModels.size())for(;0<=--d;)this.setTlsGroups(d,d,a);else if(JU.Logger.info(d+" 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<=
--d;)this.setTlsGroups(0,d,a);this.checkForResidualBFactors(a)}null!=this.sbTlsErrors&&(this.asc.setInfo("tlsErrors",this.sbTlsErrors.toString()),this.appendLoadNote(this.sbTlsErrors.toString()));if((this.doCheckUnitCell=(new Boolean(this.doCheckUnitCell&(this.iHaveUnitCell&&this.doApplySymmetry))).valueOf())&&this.isbiomol)this.ignoreFileSpaceGroupName=!0,this.sgName=this.fileSgName,this.fractionalizeCoordinates(!0),this.asc.setModelInfoForSet("biosymmetry",null,this.asc.iSet),this.asc.checkSpecial=
!1;null!=this.latticeCells&&0!=this.latticeCells[0]&&this.addJmolScript("unitcell;axes on;axes unitcell;");this.finalizeReaderASCR();if(null!=this.vCompnds){this.asc.setInfo("compoundSource",this.vCompnds);for(d=this.asc.iSet+1;0<=--d;)this.asc.setModelInfoForSet("compoundSource",this.vCompnds,d)}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(b,"checkUnitCellParams",function(){this.iHaveUnitCell&&(this.asc.setCurrentModelInfo("unitCellParams",this.unitCellParams),null!=this.sgName&&this.asc.setCurrentModelInfo("spaceGroup",this.sgName))});e(b,"checkForResidualBFactors",function(a){for(var d=this.asc.atoms,c=!1,g=this.asc.ac;0<=--g;){var f=this.tlsU.get(d[g]);if(null!=f){var j=f[7]-(f[0]+f[1]+f[2])/3;if(0>j||Float.isNaN(j)){c=!0;break}}}JU.Logger.info("TLS analysis suggests Bfactors are "+(c?"":"NOT")+" residuals");for(var b,d=this.tlsU.entrySet().iterator();d.hasNext()&&
((b=d.next())||1);)f=b.getValue(),j=f[7],0!=j&&(c||(j-=(f[0]+f[1]+f[2])/3),f[0]+=j,f[1]+=j,f[2]+=j,b.getKey().addTensor(a.getTensor(this.vwr,f).setType(null),"TLS-R",!1),JU.Logger.info("TLS-U:  "+JU.Escape.eAF(f)),f=b.getKey().anisoBorU,null!=f&&JU.Logger.info("ANISOU: "+JU.Escape.eAF(f)));this.tlsU=null},"J.api.SymmetryInterface");e(b,"header",function(){8>this.lineLength||(this.appendLoadNote(this.line.substring(7).trim()),80==this.lineLength&&(this.maxLength=72),this.pdbID=66<=this.lineLength?
this.line.substring(62,66).trim():"",4==this.pdbID.length&&(this.asc.setCollectionName(this.pdbID),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(b,"title",function(){10<this.lineLength&&this.appendLoadNote(this.line.substring(10,Math.min(this.maxLength,this.line.length)).trim())});e(b,"compnd",function(a){if(!a){this.$compnd=null==this.$compnd?"":this.$compnd+" ";var d=
this.line;62<this.lineLength&&(d=d.substring(0,62));this.$compnd+=d.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;d=this.line.substring(0,c).trim();c=c<this.line.length?this.line.substring(c+1).trim():null;if(d.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+=d,0==this.vCompnds.size()&&this.vCompnds.addLast(this.currentCompnd)):this.currentKey=d,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(b,"setBiomoleculeAtomCounts",function(){for(var a=this.vBiomolecules.size();0<=--a;){for(var d=this.vBiomolecules.get(a),c=d.get("biomts"),g=d.get("chains"),f=0,c=c.size();0<=--c;)for(var j=
g.get(c),b=j.length-1;0<=--b;)":"==j.charAt(b)&&(f+=this.biomtChainAtomCounts[0+j.charCodeAt(b+1)]);d.put("atomCount",Integer.$valueOf(f))}});e(b,"remark350",function(){var a=null,d=null;this.vBiomolecules=new JU.Lst;this.biomtChainAtomCounts=s(255,0);for(var c="",g="",f="",j=!0,b=null,e=0,l=JU.M4.newM4(null);;){j?this.readHeader(!0):j=!0;if(null==this.line||!this.line.startsWith("REMARK 350"))break;try{if(this.line.startsWith("REMARK 350 BIOMOLECULE:")&&(0<e&&JU.Logger.info("biomolecule "+f+": number of transforms: "+
e),b=new java.util.Hashtable,f=this.line.substring(this.line.indexOf(":")+1).trim(),c=this.line.trim(),b.put("name","biomolecule "+f),b.put("molecule",3==f.length?f:Integer.$valueOf(this.parseIntStr(f))),b.put("title",c),b.put("chains",d=new JU.Lst),b.put("biomts",a=new JU.Lst),this.vBiomolecules.addLast(b),e=0),0<=this.line.indexOf("APPLY THE FOLLOWING TO CHAINS:"))if(null==b)j=!1,this.line="REMARK 350 BIOMOLECULE: 1  APPLY THE FOLLOWING TO CHAINS:";else{var p=this.line.substring(41).trim();this.appendLoadNote("found biomolecule "+
f+": "+p);g=":"+p.$replace(",",";").$replace(" ",":");for(j=!1;null!=this.readHeader(!0)&&0>this.line.indexOf("BIOMT")&&7==this.line.indexOf("350");)g+=":"+this.line.substring(11).trim().$replace(",",";").$replace(" ",":");g+=";";if(this.checkFilterKey("BIOMOLECULE "+f+";")||this.checkFilterKey("BIOMOLECULE="+f+";"))this.setFilter(this.filterCased+g),JU.Logger.info('filter set to "'+this.filter+'"'),this.thisBiomolecule=b,this.haveMappedSerials=this.applySymmetry}else if(this.line.startsWith("REMARK 350   BIOMT1 ")){e++;
for(var m=K(16,0),q=0;12>q;){var h=this.getTokens();m[q++]=this.parseFloatStr(h[4]);m[q++]=this.parseFloatStr(h[5]);m[q++]=this.parseFloatStr(h[6]);m[q++]=this.parseFloatStr(h[7]);(4==q||8==q)&&this.readHeader(!0)}m[15]=1;var v=new JU.M4;v.setA(m);v.equals(l)?(a.add(0,v),d.add(0,g)):(a.addLast(v),d.addLast(g))}}catch(u){if(O(u,Exception))return this.vBiomolecules=this.thisBiomolecule=null,!1;throw u;}}0<e&&JU.Logger.info("biomolecule "+f+": number of transforms: "+e);return!1});e(b,"remark285",function(){return!0});
e(b,"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])}return!1});e(b,"getSerial",function(a,d){var c=this.line.charAt(a),g=" "==c||" "==this.line.charAt(d-1);switch(this.serMode){default:case 0:if(g)return this.parseIntRange(this.line,a,d);try{return this.serial=Integer.parseInt(this.line.substring(a,
d))}catch(f){if(O(f,Exception))return this.serMode=JU.PT.isDigit(c)?1:2,this.getSerial(a,d);throw f;}case 2:return g||JU.PT.isDigit(c)?this.parseIntRange(this.line,a,d):JU.PT.parseIntRadix(this.line.substring(a,d),36)+(JU.PT.isUpperCase(c)?-16696160:26973856);case 1:if(!g)return this.serial=JU.PT.parseIntRadix(this.line.substring(a,d),16);this.serMode=0;return this.getSerial(a,d)}},"~N,~N");e(b,"getSeqNo",function(a,d){var c=this.line.charAt(a),g=" "==c||" "==this.line.charAt(d-1);switch(this.seqMode){default:case 0:if(g)return this.parseIntRange(this.line,
a,d);try{return Integer.parseInt(this.line.substring(a,d))}catch(f){if(O(f,Exception))return this.seqMode=JU.PT.isDigit(c)?1:2,this.getSeqNo(a,d);throw f;}case 2:return g||JU.PT.isDigit(c)?this.parseIntRange(this.line,a,d):JU.PT.parseIntRadix(this.line.substring(a,d),36)+(JU.PT.isUpperCase(c)?-456560:756496);case 1:if(!g)return JU.PT.parseIntRadix(this.line.substring(a,d),16);this.seqMode=0;return this.getSeqNo(a,d)}},"~N,~N");e(b,"processAtom",function(a,d,c,g,f,j,b,e,l){a.atomName=d;" "!=c&&(a.altLoc=
c);a.group3=null==g?"UNK":g;a.chainID=f;null!=this.biomtChainAtomCounts&&this.biomtChainAtomCounts[f%256]++;a.sequenceNumber=j;a.insertionCode=J.api.JmolAdapter.canonizeInsertionCode(b);a.isHetero=e;a.elementSymbol=l;return a},"J.adapter.smarter.Atom,~S,~S,~S,~N,~N,~S,~B,~S");e(b,"processAtom2",function(a,d,c,g,f,j){a.atomSerial=d;d>this.maxSerial&&(this.maxSerial=d);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,g,f);a.formalCharge=j;this.setAdditionalAtomParameters(a);this.haveMappedSerials?this.asc.addAtomWithMappedSerialNumber(a):this.asc.addAtom(a);0==this.ac++&&!this.isCourseGrained&&this.setModelPDB(!0);a.isHetero&&null!=this.htHetero&&
(this.asc.setCurrentModelInfo("hetNames",this.htHetero),this.htHetero=null)},"J.adapter.smarter.Atom,~N,~N,~N,~N,~N");e(b,"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.vwr.getChainID(this.line.substring(21,22),!0),this.getSeqNo(22,26),this.line.charAt(26),a,this.deduceElementSymbol(a));if(0<this.atomTypeLen){var d=this.line.substring(this.atomTypePt0,
this.atomTypePt0+this.atomTypeLen).trim();0<d.length&&(a.atomName+="\x00"+d)}if(this.filterPDBAtom(a,this.fileAtomIndex++)){var d=0,c,g,f;if(this.gromacsWideFormat)c=this.parseFloatRange(this.line,30,40),g=this.parseFloatRange(this.line,40,50),f=this.parseFloatRange(this.line,50,60);else{if(80<=this.lineLength&&(c=this.line.charAt(78),g=this.line.charAt(79),"0"<=g&&"7">=g&&(f=g,g=c,c=f),("+"==g||"-"==g||" "==g)&&"0"<=c&&"7">=c))d=c.charCodeAt(0)-48,"-"==g&&(d=-d);c=this.parseFloatRange(this.line,
30,38);g=this.parseFloatRange(this.line,38,46);f=this.parseFloatRange(this.line,46,54)}this.processAtom2(a,this.serial,c,g,f,d)}});e(b,"filterPDBAtom",function(a,d){if(!this.filterAtom(a,d))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(b,"setAdditionalAtomParameters",function(a){var d;this.gromacsWideFormat?
(d=this.parseFloatRange(this.line,60,68),a.bfactor=J.adapter.readers.pdb.PdbReader.fixRadius(this.parseFloatRange(this.line,68,76))):(d=this.parseFloatRange(this.line,54,60),a.bfactor=this.parseFloatRange(this.line,60,66));a.foccupancy=Float.isNaN(d)?1:d},"J.adapter.smarter.Atom");e(b,"deduceElementSymbol",function(a){if(78<=this.lineLength){var d=this.line.charAt(76),c=this.line.charAt(77);if(" "==d&&J.adapter.smarter.Atom.isValidSym1(c))return""+c;if(J.adapter.smarter.Atom.isValidSymNoCase(d,c))return""+
d+c}d=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.isValidSymNoCase(d,c))return a||"H"!=d?""+d+c:"H";if("H"==d)return"H";if((null==this.htElementsInCurrentGroup||null!=this.htElementsInCurrentGroup.get(""+c))&&J.adapter.smarter.Atom.isValidSym1(c))return""+c;if(" "!=d&&(null==this.htElementsInCurrentGroup||null!=this.htElementsInCurrentGroup.get(""+d))&&J.adapter.smarter.Atom.isValidSym1(d))return""+
d;a=this.line.charAt(14);return" "==d&&"X"!=c&&(null==this.htElementsInCurrentGroup||null!=this.htElementsInCurrentGroup.get(this.line.substring(13,15)))&&J.adapter.smarter.Atom.isValidSymNoCase(c,a)?""+c+a:"Xx"},"~B");e(b,"conect",function(){null==this.sbConect?(this.sbConect=new JU.SB,this.sb=new JU.SB):this.sb.setLength(0);var a=this.getSerial(6,11);if(!(0>a)){var d=1,c=this.line.trim().length;56<c&&(c=this.line.substring(0,56).trim().length);for(var g=11;g<c;g+=5){switch(g){case 31:d=2048;break;
case 41:continue}var f=this.getSerial(g,g+5);if(!(0>f)){var j=a==this.lastSourceSerial&&f==this.lastTargetSerial;j&&(this.haveDoubleBonds=!0);this.lastSourceSerial=a;this.lastTargetSerial=f;var b;f<a?(b=f,f=a):b=a;var e=";"+b+" "+f+";";if(!(0<=this.sbConect.indexOf(e))||j){if(this.haveDoubleBonds){j="--"+e;if(0<=this.sbConect.indexOf(j))continue;this.sb.append(j)}this.sbConect.append(e);this.addConnection(s(-1,[b,f,d]))}}}this.sbConect.appendSB(this.sb)}});e(b,"structure",function(){var a=J.c.STR.NONE,
d=J.c.STR.NONE,c,g,f,j,b=0;if(this.line.startsWith("HELIX "))a=J.c.STR.HELIX,c=19,g=21,f=31,j=33,40<=this.line.length&&(d=J.adapter.smarter.Structure.getHelixType(this.parseIntRange(this.line,38,40)));else if(this.line.startsWith("SHEET "))a=J.c.STR.SHEET,c=21,g=22,f=32,j=33,b=this.parseIntRange(this.line,14,16);else if(this.line.startsWith("TURN  "))a=J.c.STR.TURN,c=19,g=20,f=30,j=31;else return;if(!(this.lineLength<j+4)){var e=this.line.substring(11,15).trim(),l=this.parseIntRange(this.line,7,10);
c=this.vwr.getChainID(this.line.substring(c,c+1),!0);var p=this.parseIntRange(this.line,g,g+4);g=this.line.charAt(g+4);f=this.vwr.getChainID(this.line.substring(f,f+1),!0);var m=this.parseIntRange(this.line,j,j+4),q=" ";this.lineLength>j+4&&(q=this.line.charAt(j+4));d===J.c.STR.NONE&&(d=a);a=new J.adapter.smarter.Structure(-1,a,d,e,l,b,null);a.set(c,p,g,f,m,q,0,0);this.asc.addStructure(a)}});e(b,"getModelNumber",function(){var a=14;a>this.lineLength&&(a=this.lineLength);a=this.parseIntRange(this.line,
6,a);return-2147483648==a?0:a});e(b,"getModelName",function(){if(16>this.lineLength)return null;if(this.line.startsWith("ATOM"))return"";var a=this.line.substring(15,this.lineLength).trim();return 0==a.length?null:a});e(b,"model",function(a,d){this.checkNotPDB();null==d&&(d=this.pdbID);this.haveMappedSerials=null!=this.thisBiomolecule&&this.applySymmetry;this.sbConect=null;this.asc.newAtomSet();this.asc.setCurrentModelInfo("pdbID",this.pdbID);(0==this.asc.iSet||this.isTrajectory)&&this.asc.setAtomSetName(this.pdbID);
this.asc.setCurrentModelInfo("name",d);this.checkUnitCellParams();this.isCourseGrained||this.setModelPDB(!0);this.asc.setCurrentAtomSetNumber(a);this.isCourseGrained&&this.asc.setCurrentModelInfo("courseGrained",Boolean.TRUE)},"~N,~S");e(b,"checkNotPDB",function(){var a=!this.isCourseGrained&&(0==this.nRes||this.nUNK!=this.nRes);this.asc.checkSpecial=!a;this.setModelPDB(a);this.nUNK=this.nRes=0;this.currentGroup3=null});e(b,"cryst1",function(){var a=this.$cryst1=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));this.isbiomol&&(this.doConvertToFractional=!1);(null==this.sgName||this.sgName.equals("unspecified!"))&&this.setSpaceGroupName(JU.PT.parseTrimmedRange(this.line,55,66));this.fileSgName=this.sgName});e(b,"getFloat",function(a,d){return this.parseFloatRange(this.line,a,a+d)},"~N,~N");e(b,"scale",function(a){null!=this.unitCellParams&&(a=4*a+2,this.unitCellParams[0]=this.$cryst1,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)),this.isbiomol&&(this.doConvertToFractional=!1))},"~N");e(b,"expdta",function(){0<=this.line.toUpperCase().indexOf("NMR")&&this.asc.setInfo("isNMRdata","true")});e(b,"formul",function(){var a=this.parseTokenRange(this.line,12,15),d=JU.PT.parseTrimmedRange(this.line,19,70),c=d.indexOf("(");if(0<=c){var g=d.indexOf(")");if(0>g||c>=g||c+1==
g)return;d=JU.PT.parseTrimmedRange(d,c+1,g)}c=this.htFormul.get(a);null==c&&this.htFormul.put(a,c=new java.util.Hashtable);for(this.next[0]=0;null!=(g=this.parseTokenNext(d));)2>g.length||(a=g.charAt(0),g=g.charAt(1),J.adapter.smarter.Atom.isValidSymNoCase(a,g)?c.put(""+a+g,Boolean.TRUE):J.adapter.smarter.Atom.isValidSym1(a)&&c.put(""+a,Boolean.TRUE))});e(b,"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 d=JU.PT.parseTrimmedRange(this.line,30,70);this.htHetero.put(a,d)}}});e(b,"hetnam",function(){null==this.htHetero&&(this.htHetero=new java.util.Hashtable);var a=this.parseTokenRange(this.line,11,14),d=JU.PT.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&&(d=c+d);this.htHetero.put(a,d);this.appendLoadNote(a+" = "+d)}});e(b,"anisou",function(){var a=
K(8,0);a[6]=1;var d=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 g=this.asc.atoms[c].atomSerial;-2147483648!=g&&this.asc.atomSymbolicMap.put(""+g,this.asc.atoms[c])}this.haveMappedSerials=!0}d=this.asc.getAtomFromName(d);if(null!=d){c=28;for(g=0;70>c;c+=7,g++)a[g]=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(d,a,12)}});e(b,"site",function(){null==this.htSites&&(this.htSites=new java.util.Hashtable);var a=this.parseIntRange(this.line,15,17),d=JU.PT.parseTrimmedRange(this.line,11,14),c=this.htSites.get(d);null==c&&(c=new java.util.Hashtable,c.put("nResidues",Integer.$valueOf(a)),c.put("groups",""),this.htSites.put(d,c));a=c.get("groups");for(d=0;4>d;d++){var g=18+11*d,f=JU.PT.parseTrimmedRange(this.line,g,g+3);if(0==f.length)break;var j=JU.PT.parseTrimmedRange(this.line,g+4,g+
5),b=JU.PT.parseTrimmedRange(this.line,g+5,g+9),g=JU.PT.parseTrimmedRange(this.line,g+9,g+10),a=a+((0==a.length?"":",")+"["+f+"]"+b);0<g.length&&(a+="^"+g);0<j.length&&(a+=":"+j);c.put("groups",a)}});e(b,"remarkTls",function(){for(var a=0,d=0,c=null,g=null,f=null,j=null,b=null,e=this.line.substring(0,11);null!=this.readHeader(!0)&&this.line.startsWith(e);)try{var l=JU.PT.getTokens(this.line.substring(10).$replace(":"," "));if(!(2>l.length))if(JU.Logger.info(this.line),l[1].equalsIgnoreCase("GROUP"))f=
new java.util.Hashtable,j=new JU.Lst,f.put("ranges",j),g.addLast(f),this.tlsGroupID=this.parseIntStr(l[l.length-1]),f.put("id",Integer.$valueOf(this.tlsGroupID));else if(l[0].equalsIgnoreCase("NUMBER")){if(!l[2].equalsIgnoreCase("COMPONENTS")){a=this.parseIntStr(l[l.length-1]);if(1>a)break;null==this.vTlsModels&&(this.vTlsModels=new JU.Lst);g=new JU.Lst;this.appendLoadNote(this.line.substring(11).trim())}}else if(l[0].equalsIgnoreCase("COMPONENTS"))c=this.line;else if(l[0].equalsIgnoreCase("RESIDUE")){var b=
new java.util.Hashtable,p,m,q,h;if(6==l.length)p=l[2].charAt(0),m=l[4].charAt(0),q=this.parseIntStr(l[3]),h=this.parseIntStr(l[5]);else{var v=c.indexOf(" C "),u=c.indexOf(" C ",v+4);p=this.line.charAt(u);m=this.line.charAt(v);q=this.parseIntRange(this.line,u+1,v);h=this.parseIntStr(this.line.substring(v+1))}p==m?(b.put("chains",""+p+m),q<=h?(b.put("residues",s(-1,[q,h])),j.addLast(b)):this.tlsAddError(" TLS group residues are not in order (range ignored)")):this.tlsAddError(" TLS group chains are different (range ignored)")}else if(l[0].equalsIgnoreCase("SELECTION"))for(var C=
"\x00",r=1;r<l.length;r++)if(0<=l[r].toUpperCase().indexOf("CHAIN"))C=l[++r].charAt(0);else{var x=this.parseIntStr(l[r]);-2147483648!=x&&(b=new java.util.Hashtable,b.put("residues",s(-1,[x,this.parseIntStr(l[++r])])),"\x00"!=C&&b.put("chains",""+C+C),j.addLast(b))}else if(l[0].equalsIgnoreCase("ORIGIN")){var t=new JU.P3;f.put("origin",t);if(8==l.length)t.set(this.parseFloatStr(l[5]),this.parseFloatStr(l[6]),this.parseFloatStr(l[7]));else{var w=this.line.length;t.set(this.parseFloatRange(this.line,
w-27,w-18),this.parseFloatRange(this.line,w-18,w-9),this.parseFloatRange(this.line,w-9,w))}if(Float.isNaN(t.x)||Float.isNaN(t.y)||Float.isNaN(t.z))t.set(NaN,NaN,NaN),this.tlsAddError("invalid origin: "+this.line)}else if(l[1].equalsIgnoreCase("TENSOR")){var z=l[0].charAt(0),W=(this.readHeader(!0).substring(10)+this.readHeader(!0).substring(10)+this.readHeader(!0).substring(10)).$replace(z," ").$replace(":"," "),l=JU.PT.getTokens(W),A=K(3,3,0);f.put("t"+z,A);for(r=0;r<l.length;r++){var B=l[r].charCodeAt(0)-
49,D=l[r].charCodeAt(1)-49;A[B][D]=this.parseFloatStr(l[++r]);B<D&&(A[D][B]=A[B][D])}for(r=0;3>r;r++)for(C=0;3>C;C++)Float.isNaN(A[r][C])&&this.tlsAddError("invalid tensor: "+JU.Escape.escapeFloatAA(A,!1));if("S"==z&&++d==a){JU.Logger.info(a+" TLS groups read");this.readHeader(!0);break}}}catch(E){if(O(E,Exception)){JU.Logger.error(this.line+"\nError in TLS parser: ");System.out.println(E.getMessage());g=null;break}else throw E;}null!=g&&(d=new java.util.Hashtable,d.put("groupCount",Integer.$valueOf(a)),
d.put("groups",g),this.vTlsModels.addLast(d));return 1>a});e(b,"handleTlsMissingModels",function(){this.vTlsModels=null});e(b,"setTlsGroups",function(a,d,c){JU.Logger.info("TLS model "+(d+1)+" set "+(a+1));a=this.vTlsModels.get(a);for(var g=a.get("groups"),f=this.asc.getAtomSetAtomIndex(d),j=K(this.asc.getAtomSetAtomCount(d),0),b=f+j.length,e=this.asc.atoms,l=g.size(),p=0;p<l;p++){var m=g.get(p),q=m.get("ranges");this.tlsGroupID=m.get("id").intValue();for(var h=q.size();0<=--h;){var v=q.get(h).get("chains"),
u=q.get(h).get("residues"),C=0+v.charCodeAt(0),v=0+v.charCodeAt(1),r=u[0],u=u[1],t=this.findAtomForRange(f,b,C,r,!1),x=0<=t?this.findAtomForRange(t,b,v,u,!1):-1;if(0>x){JU.Logger.info("TLS processing terminated");return}JU.Logger.info("TLS ID="+this.tlsGroupID+" model atom index range "+t+"-"+x);t=C==v;for(x=f;x<b;x++){var w=e[x];if(t?w.sequenceNumber>=r&&w.sequenceNumber<=u:w.chainID>C&&w.chainID<v||w.chainID==C&&w.sequenceNumber>=r||w.chainID==v&&w.sequenceNumber<=u)j[x-f]=this.tlsGroupID,this.setTlsTensor(w,
m,c)}}}this.asc.setAtomProperties("tlsGroup",j,d,!0);this.asc.setModelInfoForSet("TLS",a,d);this.asc.setTensors()},"~N,~N,J.api.SymmetryInterface");e(b,"findAtomForRange",function(a,d,c,g,f){a=this.findAtom(a,d,c,g,!0);return f&&0<=a?this.findAtom(a,d,c,g,!1):a},"~N,~N,~N,~N,~B");e(b,"findAtom",function(a,d,c,g,f){for(var j=this.asc.atoms;a<d;a++){var b=j[a];if((b.chainID==c&&b.sequenceNumber==g)==f)return a}f&&(JU.Logger.warn("PdbReader findAtom chain="+c+" resno="+g+" not found"),this.tlsAddError("atom not found: chain="+
c+" resno="+g));return f?-1:d},"~N,~N,~N,~N,~B");e(b,"setTlsTensor",function(a,d,c){var g=d.get("origin");if(!Float.isNaN(g.x)){var f=d.get("tT"),j=d.get("tL");d=d.get("tS");if(!(null==f||null==j||null==d)){var b=0.017453292519943295*(a.x-g.x),e=0.017453292519943295*(a.y-g.y),g=0.017453292519943295*(a.z-g.z),l=b*b,p=e*e,m=g*g,q=b*e,h=b*g,v=e*g;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=
K(8,0),u=Float.isNaN(a.bfactor)?0:a.bfactor/78.95683520871486;f[0]=this.dataT[0]+j[1][1]*m+j[2][2]*p-2*j[1][2]*v+2*d[1][0]*g-2*d[2][0]*e;f[1]=this.dataT[1]+j[0][0]*m+j[2][2]*l-2*j[2][0]*h-2*d[0][1]*g+2*d[2][1]*b;f[2]=this.dataT[2]+j[0][0]*p+j[1][1]*l-2*j[0][1]*q-2*d[1][2]*b+2*d[0][2]*e;f[3]=this.dataT[3]-j[2][2]*q+j[1][2]*h+j[2][0]*v-j[0][1]*m-d[0][0]*g+d[1][1]*g+d[2][0]*b-d[2][1]*e;f[4]=this.dataT[4]-j[1][1]*h+j[1][2]*q-j[2][0]*p+j[0][1]*v+d[0][0]*e-d[2][2]*e+d[1][2]*g-d[1][0]*b;f[5]=this.dataT[5]-
j[0][0]*v-j[1][2]*l+j[2][0]*q+j[0][1]*h-d[1][1]*b+d[2][2]*b+d[0][1]*e-d[0][2]*g;f[6]=12;f[7]=u;null==this.tlsU&&(this.tlsU=new java.util.Hashtable);this.tlsU.put(a,f);a.addTensor(c.getTensor(this.vwr,this.dataT).setType(null),"TLS-U",!1)}}},"J.adapter.smarter.Atom,java.util.Map,J.api.SymmetryInterface");e(b,"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");b.fixRadius=e(b,"fixRadius",function(a){return 0.9>a?1:a},"~N");e(b,"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(b,"connectAllBad",function(a){for(var d=this.connectNextAtomIndex,c=this.connectNextAtomSet;c<this.asc.atomSetCount;c++){var g=this.asc.getAtomSetAtomCount(c);this.asc.setModelInfoForSet("PDB_CONECT_firstAtom_count_max",
s(-1,[d,g,a]),c);null!=this.vConnect&&(this.asc.setModelInfoForSet("PDB_CONECT_bonds",this.vConnect,c),this.asc.setGlobalBoolean(3));d+=g}this.vConnect=null;this.connectNextAtomSet=this.asc.iSet+1;this.connectNextAtomIndex=d},"~N");e(b,"connectAll",function(a,d){var c=this.asc,g=c.iSet;if(!(0>g))if(d)this.connectAllBad(a);else if(c.setCurrentModelInfo("PDB_CONECT_firstAtom_count_max",s(-1,[c.getAtomSetAtomIndex(g),c.getAtomSetAtomCount(g),a])),null!=this.vConnect){for(var f=this.connectNextAtomIndex,
b=c.atomSetCount;--b>=this.connectNextAtomSet;)c.setModelInfoForSet("PDB_CONECT_bonds",this.vConnect,b),c.setGlobalBoolean(3),f+=c.getAtomSetAtomCount(b);this.vConnect=null;this.connectNextAtomSet=g+1;this.connectNextAtomIndex=f}},"~N,~B")});r("J.adapter.smarter");t(null,"J.adapter.smarter.Structure",["J.c.STR"],function(){var b=z(function(){this.structureID=this.substructureType=this.structureType=null;this.startChainID=this.startSequenceNumber=this.strandCount=this.serialID=0;this.startInsertionCode=
"\x00";this.endChainID=this.endSequenceNumber=0;this.endInsertionCode="\x00";this.bsAll=this.modelStartEnd=this.atomStartEnd=null;w(this,arguments)},J.adapter.smarter,"Structure",null,Cloneable);Q(b,function(){this.atomStartEnd=s(2,0);this.modelStartEnd=s(-1,[-1,-1])});b.getHelixType=e(b,"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");A(b,function(a,d,c,g,f,b,k){null!=k?(this.modelStartEnd=
s(-1,[0,a]),this.bsAll=k):(this.structureType=d,this.substructureType=c,null!=g&&(this.modelStartEnd[0]=this.modelStartEnd[1]=a,this.structureID=g,this.strandCount=b,this.serialID=f))},"~N,J.c.STR,J.c.STR,~S,~N,~N,~A");e(b,"set",function(a,d,c,g,f,b,k,e){this.startChainID=a;this.startSequenceNumber=d;this.startInsertionCode=c;this.endChainID=g;this.endSequenceNumber=f;this.endInsertionCode=b;this.atomStartEnd[0]=k;this.atomStartEnd[1]=e},"~N,~N,~S,~N,~N,~S,~N,~N");e(b,"clone",function(){var a=null;
try{a=T(this,J.adapter.smarter.Structure,"clone",[])}catch(d){if(!O(d,"CloneNotSupportedException"))throw d;}return a})});r("JM");t(["JM.Group"],"JM.Monomer","java.lang.Float JU.Measure $.P3 $.Quat J.c.STR JM.BioResolver JU.Escape $.Logger JV.JC".split(" "),function(){var b=z(function(){this.offsets=this.bioPolymer=null;this.monomerIndex=-1;this.theta=this.mu=this.straightness=this.omega=this.psi=this.phi=NaN;this.backboneBlockVis=!1;w(this,arguments)},JM,"Monomer",JM.Group);A(b,function(){L(this,
JM.Monomer,[])});b.have=e(b,"have",function(a,d){return 255!=(a[d]&255)},"~A,~N");e(b,"set2",function(a,d,c,g,f,b){this.setGroup(a,d,c,g,f);this.offsets=b;this.setLeadAtomIndex();return this},"JM.Chain,~S,~N,~N,~N,~A");e(b,"setLeadAtomIndex",function(){var a=this.offsets[0]&255;255!=a&&(this.leadAtomIndex=this.firstAtomIndex+a)});e(b,"setBioPolymer",function(a,d){this.bioPolymer=a;this.monomerIndex=d},"JM.BioPolymer,~N");h(b,"getSelectedMonomerCount",function(){return null==this.bioPolymer?0:this.bioPolymer.getSelectedMonomerCount()});
h(b,"getSelectedMonomerIndex",function(){return null==this.bioPolymer||!this.bioPolymer.isMonomerSelected(this.monomerIndex)?-1:this.monomerIndex});h(b,"getBioPolymerLength",function(){return null==this.bioPolymer?0:this.bioPolymer.monomerCount});e(b,"getMonomerIndex",function(){return this.monomerIndex});h(b,"getAtomIndex",function(a,d){if(null!=this.bioPolymer){var c=this.bioPolymer.monomers,g=this.monomerIndex+d;if(0<=g&&g<c.length){c=c[g];if(1==d&&!c.isConnectedPrevious())return-1;if("\x00".equals(a))return c.leadAtomIndex;
for(var g=this.chain.model.ms.at,f=c.firstAtomIndex;f<=c.lastAtomIndex;f++)if(null!=g[f]&&(null==a||a.equalsIgnoreCase(g[f].getAtomName())))return f}}return-1},"~S,~N");e(b,"getBioPolymerIndexInModel",function(){return null==this.bioPolymer?-1:this.bioPolymer.bioPolymerIndexInModel});b.scanForOffsets=e(b,"scanForOffsets",function(a,d,c){for(var g=c.length,f=H(g,0);0<=--g;){var b,k=c[g];if(0>k)b=d[~k];else if(b=d[k],0>b)return null;var e;if(0>b)e=255;else if(e=b-a,0>e||254<e)JU.Logger.warn("Monomer.scanForOffsets i="+
g+" atomID="+k+" atomIndex:"+b+" firstAtomIndex:"+a+" offset out of 0-254 range. Groups aren't organized correctly. Is this really a protein?: "+e),0>k&&(e=255);f[g]=e}return f},"~N,~A,~A");h(b,"getProteinStructureType",function(){return J.c.STR.NONE});e(b,"isHelix",function(){return!1});e(b,"isSheet",function(){return!1});h(b,"setStrucNo",function(){},"~N");e(b,"getAtomFromOffsetIndex",function(a){if(a>this.offsets.length)return null;a=this.offsets[a]&255;return 255==a?null:this.chain.model.ms.at[this.firstAtomIndex+
a]},"~N");e(b,"getSpecialAtom",function(a,d){for(var c=a.length;0<=--c;){var g=a[c];0>g&&(g=-g);if(d==g)return c=this.offsets[c]&255,255==c?null:this.chain.model.ms.at[this.firstAtomIndex+c]}return null},"~A,~N");e(b,"getSpecialAtomPoint",function(a,d){for(var c=a.length;0<=--c;){var g=a[c];0>g&&(g=-g);if(d==g)return c=this.offsets[c]&255,255==c?null:this.chain.model.ms.at[this.firstAtomIndex+c]}return null},"~A,~N");h(b,"isLeadAtom",function(a){return a==this.leadAtomIndex},"~N");h(b,"getLeadAtom",
function(){return this.getAtomFromOffsetIndex(0)});e(b,"getWingAtom",function(){return this.getAtomFromOffsetIndex(1)});e(b,"getInitiatorAtom",function(){return this.getLeadAtom()});e(b,"getTerminatorAtom",function(){return this.getLeadAtom()});e(b,"findNearestAtomIndex",function(){},"~N,~N,~A,~N,~N");e(b,"getMyInfo",function(a){a=this.getGroupInfo(this.groupIndex,a);a.put("chain",this.chain.getIDStr());var d=this.getResno();0<d&&a.put("sequenceNumber",Integer.$valueOf(d));d=this.getInsertionCode();
0!=d.charCodeAt(0)&&a.put("insertionCode",""+d);d=this.getGroupParameter(1111490569);Float.isNaN(d)||a.put("phi",Float.$valueOf(d));d=this.getGroupParameter(1111490570);Float.isNaN(d)||a.put("psi",Float.$valueOf(d));d=this.getGroupParameter(1111490565);Float.isNaN(d)||a.put("mu",Float.$valueOf(d));d=this.getGroupParameter(1111490576);Float.isNaN(d)||a.put("theta",Float.$valueOf(d));d=this.getStructure();x(d,"JM.ProteinStructure")&&(a.put("structureId",Integer.$valueOf(d.strucNo)),a.put("structureType",
d.type.getBioStructureTypeName(!1)));a.put("shapeVisibilityFlags",Integer.$valueOf(this.shapeVisibilityFlags));return a},"JU.P3");h(b,"getStructureId",function(){var a=this.getStructure();return x(a,"JM.ProteinStructure")?a.type.getBioStructureTypeName(!1):""});e(b,"updateOffsetsForAlternativeLocations",function(a,d){for(var c=!1,g=this.offsets.length;0<=--g;){var f=this.offsets[g]&255;if(255!=f){var f=this.firstAtomIndex+f,b=a[f],k=b.atomID;if(0!=b.altloc.charCodeAt(0))for(var e=this.lastAtomIndex-
this.firstAtomIndex,l=1;l<=e;l++){var p=f+l;p>this.lastAtomIndex&&(p-=e+1);var m=p-this.firstAtomIndex;if(!(0>m||255<m||p==f||!d.get(p))){var q=a[p].atomID;if(!(q!=k||0==q&&!a[p].getAtomName().equals(b.getAtomName()))){this.offsets[g]=m;a[p].nBackbonesDisplayed=b.nBackbonesDisplayed;c=!0;break}}}}}this.setLeadAtomIndex();return c},"~A,JU.BS");e(b,"getMonomerSequenceAtoms",function(a,d){this.setAtomBits(d);d.and(a)},"JU.BS,JU.BS");b.checkOptional=e(b,"checkOptional",function(a,d,c,g){if(JM.Monomer.have(a,
d))return!0;if(0>g)return!1;a[d]=g-c;return!0},"~A,~N,~N,~N");e(b,"getQuaternionFrameCenter",function(){return null},"~S");e(b,"getHelixData2",function(a,d,c){if(0>this.monomerIndex)return null;var g=this.monomerIndex-c,f=1>c||0>=this.monomerIndex?null:this.bioPolymer.monomers[g],g=this.getQuaternion(d),b=1>c?JU.Quat.getQuaternionFrameV(JV.JC.axisX,JV.JC.axisY,JV.JC.axisZ,!1):null==f?null:f.getQuaternion(d);if(null==b||null==g)return T(this,JM.Monomer,"getHelixData",[a,d,c]);var f=1>c?JU.P3.new3(0,
0,0):f.getQuaternionFrameCenter(d),k=this.getQuaternionFrameCenter(d);return null==f||null==k?this.getHelixData(a,d,c):JU.Escape.escapeHelical(135176==a?"helixaxis"+this.getUniqueID():null,a,f,k,JU.Measure.computeHelicalAxis(f,k,g.div(b)))},"~N,~S,~N");e(b,"getUniqueID",function(){var a=this.chain.chainID,d=this.getLeadAtom(),a=(null==d?"":"_"+d.mi)+"_"+this.getResno()+(0==a?"":"_"+a),d=null==d?"\x00":this.getLeadAtom().altloc;"\x00"!=d&&(a+="_"+d);return a});h(b,"isCrossLinked",function(a){for(var d=
this.firstAtomIndex;d<=this.lastAtomIndex;d++)if(this.getCrossLinkGroup(d,null,a,!0,!0,!1))return!0;return!1},"JM.Group");h(b,"getCrossLinkVector",function(a,d,c){for(var g=null==a,f=this.firstAtomIndex;f<=this.lastAtomIndex;f++)if(this.getCrossLinkGroup(f,a,null,d,c,g)&&g)return!0;return!g&&0<a.size()},"JU.Lst,~B,~B");e(b,"getCrossLinkGroup",function(a,d,c,g,f,b){var k=this.chain.model.ms.at[a],e=k.bonds,l=this.getBioPolymerIndexInModel();if(0>l||null==e)return!1;var p=!1;b=!b&&null==d&&null==c;
for(var m=0;m<e.length;m++){var q=e[m];if(!(q.isCovalent()?!g:!f)){var q=q.getOtherAtom(k),h=q.group;if(!(null!=c&&h!==c)){var v=h.getBioPolymerIndexInModel(),u=h.getMonomerIndex();if(b){if(v==l&&u==this.monomerIndex-1)return!0}else if(0<=v&&0<=u&&(v!=l||u<this.monomerIndex-1||u>this.monomerIndex+1)){p=!0;if(null!=c||null==d)break;d.addLast(Integer.$valueOf(a));d.addLast(Integer.$valueOf(q.i));d.addLast(Integer.$valueOf(h.leadAtomIndex))}}}}return p},"~N,JU.Lst,JM.Group,~B,~B,~B");e(b,"isConnectedPrevious",
function(){return!0});e(b,"setGroupParameter",function(a,d){switch(a){case 1111490569:this.phi=d;break;case 1111490570:this.psi=d;break;case 1111490568:this.omega=d;break;case 1111490565:this.mu=d;break;case 1111490576:this.theta=d;break;case 1111490574:this.straightness=d}},"~N,~N");h(b,"getGroupParameter",function(a){if(null==this.bioPolymer)return 0;this.bioPolymer.haveParameters||this.bioPolymer.calcParameters();switch(a){case 1094713361:return 1;case 1111490568:return this.omega;case 1111490569:return this.phi;
case 1111490570:return this.psi;case 1111490565:return this.mu;case 1111490576:return this.theta;case 1111490574:return this.straightness}return NaN},"~N");h(b,"getGroup1",function(){return this.groupID<JM.BioResolver.predefinedGroup1Names.length?JM.BioResolver.predefinedGroup1Names[this.groupID]:1<this.group1.charCodeAt(0)?this.group1:1==this.group1.charCodeAt(0)?"?":this.group1=this.getGroup1b()});e(b,"getGroup1b",function(){return"?"});h(b,"setGroupID",function(a){this.groupID=JM.BioResolver.getGroupIdFor(a)},
"~S");h(b,"toString",function(){return"["+this.getGroup3()+"-"+this.getSeqcodeString()+" "+this.getStructure()+"]"})});r("JM");t(["JM.Monomer"],"JM.AlphaMonomer","JU.Quat $.V3 J.c.STR JM.Helix $.Sheet $.Turn".split(" "),function(){var b=z(function(){this.nitrogenHydrogenPoint=this.proteinStructure=null;w(this,arguments)},JM,"AlphaMonomer",JM.Monomer);h(b,"isProtein",function(){return!0});b.validateAndAllocateA=e(b,"validateAndAllocateA",function(a,d,c,g,f,b){return g!=f||b[2]!=g?null:(new JM.AlphaMonomer).set2(a,
d,c,g,f,JM.AlphaMonomer.alphaOffsets)},"JM.Chain,~S,~N,~N,~N,~A");M(b,function(){});e(b,"isAlphaMonomer",function(){return!0});h(b,"getStructure",function(){return this.proteinStructure});e(b,"setStructure",function(a){if(null==(this.proteinStructure=a))this.nitrogenHydrogenPoint=null},"JM.ProteinStructure");h(b,"setStrucNo",function(a){null!=this.proteinStructure&&(this.proteinStructure.strucNo=a)},"~N");h(b,"getProteinStructureType",function(){return null==this.proteinStructure?J.c.STR.NONE:this.proteinStructure.type});
h(b,"getProteinStructureSubType",function(){return null==this.proteinStructure?J.c.STR.NONE:this.proteinStructure.subtype});h(b,"getStrucNo",function(){return null!=this.proteinStructure?this.proteinStructure.strucNo:0});h(b,"isHelix",function(){return null!=this.proteinStructure&&this.proteinStructure.type===J.c.STR.HELIX});h(b,"isSheet",function(){return null!=this.proteinStructure&&this.proteinStructure.type===J.c.STR.SHEET});h(b,"setProteinStructureType",function(a,d){null!=this.proteinStructure&&
this.proteinStructure.removeMonomer(this.monomerIndex);if(0>d||0<d&&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(d)),
null!=this.proteinStructure&&this.proteinStructure.addMonomer(this.monomerIndex);return this.monomerIndex},"J.c.STR,~N");e(b,"getAtom",function(a){return 2==a?this.getLeadAtom():null},"~N");e(b,"getAtomPoint",function(a){return 2==a?this.getLeadAtom():null},"~N");h(b,"isConnectedAfter",function(a){if(null==a)return!0;var d=this.getLeadAtom();a=a.getLeadAtom();return d.isBonded(a)||4.2>=d.distance(a)},"JM.Monomer");h(b,"getQuaternionFrameCenter",function(a){return this.getQuaternionFrameCenterAlpha(a)},
"~S");h(b,"isWithinStructure",function(a){return null!=this.proteinStructure&&this.proteinStructure.type===a&&this.proteinStructure.isWithin(this.monomerIndex)},"J.c.STR");e(b,"getQuaternionFrameCenterAlpha",function(a){switch(a.charCodeAt(0)){case 98:case 99:case 67:case 120:return this.getLeadAtom();default:case 97:case 110:case 112:case 80:case 113:return null}},"~S");h(b,"getHelixData",function(a,d,c){return this.getHelixData2(a,d,c)},"~N,~S,~N");h(b,"getQuaternion",function(a){return this.getQuaternionAlpha(a)},
"~S");e(b,"getQuaternionAlpha",function(a){if(0>this.monomerIndex)return null;var d=new JU.V3,c=new JU.V3;switch(a.charCodeAt(0)){default:case 97:case 110:case 112:case 113:return null;case 98:case 99:case 120:if(0==this.monomerIndex||this.monomerIndex==this.bioPolymer.monomerCount-1)return null;a=this.getLeadAtom();var g=this.bioPolymer.getLeadPoint(this.monomerIndex+1),f=this.bioPolymer.getLeadPoint(this.monomerIndex-1);d.sub2(g,a);c.sub2(f,a)}return JU.Quat.getQuaternionFrameV(d,c,null,!1)},"~S");
I(b,"alphaOffsets",H(-1,[0]))});r("JM");t(["JM.Structure"],"JM.ProteinStructure",["java.util.Hashtable","JU.P3","$.V3","JU.Logger"],function(){var b=z(function(){this.structureID=this.subtype=this.type=null;this.serialID=this.strucNo=0;this.strandCount=1;this.nRes=this.id=0;this.apolymer=null;this.monomerIndexLast=this.monomerIndexFirst=0;this.resMap=this.segments=this.vectorProjection=this.axisUnitVector=this.axisB=this.axisA=null;w(this,arguments)},JM,"ProteinStructure",null,JM.Structure);A(b,function(){this.id=
++JM.ProteinStructure.ids});e(b,"setupPS",function(a,d,c,g){this.strucNo=++JM.ProteinStructure.globalStrucNo;this.apolymer=a;this.type=d;this.vectorProjection=new JU.V3;this.monomerIndexFirst=c;this.addMonomer(c+g-1);JU.Logger.debugging&&JU.Logger.info("Creating ProteinStructure "+this.strucNo+" "+d.getBioStructureTypeName(!1)+" from "+a.monomers[this.monomerIndexFirst]+" through "+a.monomers[this.monomerIndexLast]+" in polymer "+a)},"JM.AlphaPolymer,J.c.STR,~N,~N");e(b,"addMonomer",function(a){this.resMap=
null;this.resetAxes();this.monomerIndexFirst=Math.min(this.monomerIndexFirst,a);this.monomerIndexLast=Math.max(this.monomerIndexLast,a);this.nRes=this.monomerIndexLast-this.monomerIndexFirst+1},"~N");e(b,"removeMonomer",function(a){this.resMap=null;this.resetAxes();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 d=this.monomerIndexLast-a;this.monomerIndexLast=
a-1;this.nRes=a-this.monomerIndexFirst;for(var c=this.apolymer.monomers,g=c[++a].getProteinStructureType(),f=-1,b=0;b<d;b++,a++)c[a].setStructure(null),f=c[a].setProteinStructureType(g,f)}},"~N");e(b,"calcAxis",function(){});e(b,"isWithin",function(a){return a>this.monomerIndexFirst&&a<this.monomerIndexLast},"~N");e(b,"getIndex",function(a){if(null==this.resMap){this.resMap=new java.util.Hashtable;for(var d=this.nRes;0<=--d;)this.resMap.put(this.apolymer.monomers[this.monomerIndexFirst+d],Integer.$valueOf(d))}a=
this.resMap.get(a);return null==a?-1:a.intValue()},"JM.Monomer");e(b,"getSegments",function(){null==this.segments&&this.calcSegments();return this.segments});e(b,"getStructureMidPoint",function(a){null==this.segments&&this.calcSegments();return this.segments[a]},"~N");e(b,"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 d=1;d<this.nRes;d++)(this.segments[d]=new JU.P3).add2(this.segments[d-1],a)}});e(b,"getAxisStartPoint",function(){this.calcAxis();return this.axisA});e(b,"getAxisEndPoint",function(){this.calcAxis();return this.axisB});e(b,"resetAxes",function(){this.segments=this.axisA=null});h(b,"setAtomBits",function(a){for(var d=this.apolymer.monomers,c=this.monomerIndexFirst;c<=this.monomerIndexLast;c++)d[c].setAtomBits(a)},"JU.BS");h(b,"setAtomBitsAndClear",function(a,d){for(var c=this.apolymer.monomers,
g=this.monomerIndexFirst;g<=this.monomerIndexLast;g++)c[g].setAtomBitsAndClear(a,d)},"JU.BS,JU.BS");e(b,"findMonomer",function(a,d){var c=this.apolymer.monomers;if(0>this.monomerIndexFirst)return null;if(d)for(var g=this.monomerIndexFirst;g<=this.monomerIndexLast;g++){if(null==a||a.get(c[g].leadAtomIndex))return c[g]}else for(g=this.monomerIndexLast;g>=this.monomerIndexFirst;--g)if(null==a||a.get(c[g].leadAtomIndex))return c[g];return null},"JU.BS,~B");h(b,"toString",function(){return"["+this.id+
" "+this.type+(null==this.subtype?"":" "+this.subtype)+" ("+this.monomerIndexFirst+"-"+this.monomerIndexLast+")]"});I(b,"ids",0,"globalStrucNo",1E3)});r("JM");t(["JM.ProteinStructure"],"JM.Helix",["JU.Measure","$.P3","$.V3","J.c.STR"],function(){var b=B(JM,"Helix",JM.ProteinStructure);M(b,function(a,d,c,g){this.setupPS(a,J.c.STR.HELIX,d,c);this.subtype=g},"JM.AlphaPolymer,~N,~N,J.c.STR");h(b,"calcAxis",function(){if(null==this.axisA){for(var a=Array(this.nRes+1),d=0;d<=this.nRes;d++)this.apolymer.getLeadMidPoint(this.monomerIndexFirst+
d,a[d]=new JU.P3);this.axisA=new JU.P3;this.axisUnitVector=new JU.V3;JU.Measure.calcBestAxisThroughPoints(a,a.length,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)}})});r("JM");t(["JM.ProteinStructure"],"JM.Sheet",["JU.Measure","$.P3","$.V3","J.c.STR"],function(){var b=z(function(){this.heightUnitVector=this.widthUnitVector=null;w(this,arguments)},JM,"Sheet",JM.ProteinStructure);
M(b,function(a,d,c,g){this.setupPS(a,J.c.STR.SHEET,d,c);this.subtype=g},"JM.AlphaPolymer,~N,~N,J.c.STR");h(b,"calcAxis",function(){if(null==this.axisA){2==this.nRes?(this.axisA=this.apolymer.getLeadPoint(this.monomerIndexFirst),this.axisB=this.apolymer.getLeadPoint(this.monomerIndexFirst+1)):(this.axisA=new JU.P3,this.apolymer.getLeadMidPoint(this.monomerIndexFirst+1,this.axisA),this.axisB=new JU.P3,this.apolymer.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.apolymer.getLeadMidPoint(this.monomerIndexFirst,a);this.notHelixOrSheet(this.monomerIndexFirst-1)&&JU.Measure.projectOntoAxis(a,this.axisA,this.axisUnitVector,this.vectorProjection);var d=new JU.P3;this.apolymer.getLeadMidPoint(this.monomerIndexFirst+this.nRes,d);this.notHelixOrSheet(this.monomerIndexFirst+this.nRes)&&JU.Measure.projectOntoAxis(d,this.axisA,this.axisUnitVector,this.vectorProjection);
this.axisA=a;this.axisB=d}});e(b,"notHelixOrSheet",function(a){return 0>a||a>=this.apolymer.monomerCount||!this.apolymer.monomers[a].isHelix()&&!this.apolymer.monomers[a].isSheet()},"~N");e(b,"calcSheetUnitVectors",function(){if(x(this.apolymer,"JM.AminoPolymer")&&null==this.widthUnitVector){var a=new JU.V3,d=new JU.V3,c=this.apolymer.monomers[this.monomerIndexFirst];d.sub2(c.getCarbonylOxygenAtom(),c.getCarbonylCarbonAtom());for(var g=this.nRes;--g>this.monomerIndexFirst;)c=this.apolymer.monomers[g],
a.sub2(c.getCarbonylOxygenAtom(),c.getCarbonylCarbonAtom()),1.5707964>d.angle(a)?d.add(a):d.sub(a);this.heightUnitVector=a;this.heightUnitVector.cross(this.axisUnitVector,d);this.heightUnitVector.normalize();this.widthUnitVector=d;this.widthUnitVector.cross(this.axisUnitVector,this.heightUnitVector)}});e(b,"setBox",function(a,d,c,g,f,b,k){null==this.heightUnitVector&&this.calcSheetUnitVectors();g.setT(this.widthUnitVector);g.scale(k*a);f.setT(this.heightUnitVector);f.scale(k*d);b.ave(g,f);b.sub2(c,
b)},"~N,~N,JU.P3,JU.V3,JU.V3,JU.P3,~N")});r("JM");t(["JM.ProteinStructure"],"JM.Turn",["J.c.STR"],function(){var b=B(JM,"Turn",JM.ProteinStructure);M(b,function(a,d,c){this.setupPS(a,J.c.STR.TURN,d,c);this.subtype=J.c.STR.TURN},"JM.AlphaPolymer,~N,~N")});r("JM");t(["JM.Structure","JU.V3"],"JM.BioPolymer",["java.lang.Float","JU.BS","$.P3"],function(){var b=z(function(){this.monomers=this.model=null;this.hasStructure=!1;this.leadAtomIndices=this.wingVectors=this.controlPoints=this.leadPoints=this.leadMidpoints=
null;this.cyclicFlag=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;w(this,arguments)},JM,"BioPolymer",null,JM.Structure);Q(b,function(){this.unitVectorX=JU.V3.new3(1,0,0)});A(b,function(){});e(b,"set",function(a){this.monomers=a;for(var d=this.monomerCount=a.length;0<=
--d;)a[d].setBioPolymer(this,d);this.model=a[0].getModel()},"~A");h(b,"setAtomBits",function(a){this.getRange(a,!0)},"JU.BS");h(b,"setAtomBitsAndClear",function(a,d){for(var c=this.monomerCount;0<=--c;)this.monomers[c].setAtomBitsAndClear(a,d)},"JU.BS,JU.BS");e(b,"getRange",function(a,d){if(0!=this.monomerCount)if(d)for(var c=this.monomerCount;0<=--c;)this.monomers[c].setAtomBits(a);else a.setBits(this.monomers[0].firstAtomIndex,this.monomers[this.monomerCount-1].lastAtomIndex+1)},"JU.BS,~B");e(b,
"clearStructures",function(){});e(b,"getLeadAtomIndices",function(){null==this.leadAtomIndices&&(this.leadAtomIndices=s(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(b,"getIndex",function(a,d,c,g){var f;for(f=this.monomerCount;0<=--f;){var b=this.monomers[f];if(b.chain.chainID==a&&b.seqcode==d&&(0>c||c==b.firstAtomIndex||g==b.lastAtomIndex))break}return f},
"~N,~N,~N,~N");e(b,"getLeadPoint",function(a){return this.monomers[a].getLeadAtom()},"~N");e(b,"getInitiatorPoint",function(){return this.monomers[0].getInitiatorAtom()});e(b,"getTerminatorPoint",function(){return this.monomers[this.monomerCount-1].getTerminatorAtom()});e(b,"getLeadMidPoint",function(a,d){if(a==this.monomerCount)--a;else if(0<a){d.ave(this.getLeadPoint(a),this.getLeadPoint(a-1));return}d.setT(this.getLeadPoint(a))},"~N,JU.P3");e(b,"getWingPoint",function(a){return this.monomers[a].getWingAtom()},
"~N");e(b,"setConformation",function(a){for(var d=this.model.ms.at,c=!1,g=this.monomerCount;0<=--g;)this.monomers[g].updateOffsetsForAlternativeLocations(d,a)&&(c=!0);if(c){this.recalculateLeadMidpointsAndWingVectors();for(g=9;16>g;g++)if(a=this.model.ms.vwr.shm.shapes[g],null!=a)for(d=a.bioShapes.length;0<=--d;)c=a.bioShapes[d],c.bioPolymer===this&&c.falsifyMesh()}},"JU.BS");e(b,"recalculateLeadMidpointsAndWingVectors",function(){this.invalidLead=this.invalidControl=!0;this.getLeadAtomIndices();
this.resetHydrogenPoints();this.calcLeadMidpointsAndWingVectors()});e(b,"resetHydrogenPoints",function(){});e(b,"getLeadMidpoints",function(){null==this.leadMidpoints&&this.calcLeadMidpointsAndWingVectors();return this.leadMidpoints});e(b,"getLeadPoints",function(){null==this.leadPoints&&this.calcLeadMidpointsAndWingVectors();return this.leadPoints});e(b,"getControlPoints",function(a,d,c){c&&(this.invalidControl=!0);return!a?this.leadMidpoints:0==d?this.leadPoints:this.getControlPoints2(d)},"~B,~N,~B");
e(b,"getControlPoints2",function(a){if(!this.invalidControl&&a==this.sheetSmoothing)return this.controlPoints;this.getLeadPoints();var d=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,d);this.controlPoints[this.monomerCount]=this.getTerminatorPoint();this.invalidControl=!1;return this.controlPoints},"~N");e(b,"getControlPoint",function(a){return this.leadPoints[a]},
"~N,JU.V3");e(b,"getWingVectors",function(){null==this.leadMidpoints&&this.calcLeadMidpointsAndWingVectors();return this.wingVectors});e(b,"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,d=new JU.V3,c=new JU.V3,g=new JU.V3,f,b;this.leadMidpoints[0]=this.getInitiatorPoint();this.leadPoints[0]=b=this.getLeadPoint(0);for(var k=null,e=1;e<this.monomerCount;++e){f=b;b=this.getLeadPoint(e);if(null==b)return;this.leadPoints[e]=b;var l=new JU.P3;l.ave(b,f);this.leadMidpoints[e]=l;this.hasWingPoints&&(a.sub2(b,f),d.sub2(f,this.getWingPoint(e-1)),c.cross(a,d),g.cross(a,c),g.normalize(),!this.twistedSheets&&(null!=k&&1.5707963267948966<k.angle(g))&&(this.reversed.set(e),g.scale(-1)),
k=this.wingVectors[e]=JU.V3.newV(g))}this.leadPoints[this.monomerCount]=this.leadMidpoints[this.monomerCount]=this.getTerminatorPoint();if(!this.hasWingPoints)if(3>this.monomerCount)this.wingVectors[1]=this.unitVectorX;else{g=null;for(e=1;e<this.monomerCount;++e)a.sub2(this.leadMidpoints[e],this.leadPoints[e]),d.sub2(this.leadPoints[e],this.leadMidpoints[e+1]),0==d.length()?c=g:(c.cross(a,d),c.normalize(),null!=g&&1.5707963267948966<g.angle(c)&&c.scale(-1)),g=this.wingVectors[e]=JU.V3.newV(c)}this.wingVectors[0]=
this.wingVectors[1];this.wingVectors[this.monomerCount]=this.wingVectors[this.monomerCount-1]});e(b,"findNearestAtomIndex",function(a,d,c,g,f,b){for(var k=this.monomerCount;0<=--k;)if(0!=(this.monomers[k].shapeVisibilityFlags&f)){var e=this.monomers[k].getLeadAtom();e.checkVisible()&&!(null!=b&&b.get(e.i))&&(0<g[k]||0<g[k+1])&&this.monomers[k].findNearestAtomIndex(a,d,c,g[k],g[k+1])}},"~N,~N,~A,~A,~N,JU.BS");e(b,"getSelectedMonomerCount",function(){return this.selectedMonomerCount});e(b,"calcSelectedMonomersCount",
function(a){this.selectedMonomerCount=0;null==this.bsSelectedMonomers&&(this.bsSelectedMonomers=new JU.BS);this.bsSelectedMonomers.clearAll();for(var d=0;d<this.monomerCount;d++)this.monomers[d].isSelected(a)&&(++this.selectedMonomerCount,this.bsSelectedMonomers.set(d))},"JU.BS");e(b,"isMonomerSelected",function(a){return 0<=a&&this.bsSelectedMonomers.get(a)},"~N");e(b,"getPolymerPointsAndVectors",function(a,d,c,g,f){g=this.getControlPoints(g,f,!1);f=this.getWingVectors();for(var b=this.monomerCount,
k=0;k<b;k++)d.get(this.monomers[k].leadAtomIndex)?(c.addLast(F(-1,[g[k],JU.P3.newP(f[k])])),a=k):2147483646!=a&&(c.addLast(F(-1,[g[k],JU.P3.newP(f[k])])),a=2147483646);a+1<b&&c.addLast(F(-1,[g[a+1],JU.P3.newP(f[a+1])]));return a},"~N,JU.BS,JU.Lst,~B,~N");e(b,"getSequence",function(){for(var a=P(this.monomerCount,"\x00"),d=0;d<this.monomerCount;d++)a[d]=this.monomers[d].getGroup1();return String.valueOf(a)});e(b,"getPolymerSequenceAtoms",function(a,d,c,g){for(d=Math.min(this.monomerCount,a+d);--d>=
a;)this.monomers[d].getMonomerSequenceAtoms(c,g)},"~N,~N,JU.BS,JU.BS");e(b,"getProteinStructure",function(){return null},"~N");e(b,"calcParameters",function(){this.haveParameters=!0;return this.calcEtaThetaAngles()||this.calcPhiPsiAngles()});e(b,"calcEtaThetaAngles",function(){return!1});e(b,"calcPhiPsiAngles",function(){return!1});e(b,"calculateRamachandranHelixAngle",function(){return NaN},"~N,~S");e(b,"isNucleic",function(){return 0<this.monomerCount&&x(this,"JM.NucleicPolymer")});e(b,"getRangeGroups",
function(a,d,c){for(var g=new JU.BS,f=0;f<this.monomerCount;f++)this.monomers[f].isSelected(d)&&(g.setBits(Math.max(0,f-a),f+a+1),f+=a-1);for(f=g.nextSetBit(0);0<=f&&f<this.monomerCount;f=g.nextSetBit(f+1))this.monomers[f].setAtomBits(c)},"~N,JU.BS,JU.BS");e(b,"calcRasmolHydrogenBonds",function(){},"JM.BioPolymer,JU.BS,JU.BS,JU.Lst,~N,~A,~B,~B");e(b,"getType",function(){return this.type});e(b,"isCyclic",function(){return 1==(0==this.cyclicFlag?this.cyclicFlag=4<=this.monomerCount&&this.monomers[0].isConnectedAfter(this.monomers[this.monomerCount-
1])?1:-1:this.cyclicFlag)});h(b,"toString",function(){return"[Polymer type "+this.type+" n="+this.monomerCount+" "+(0<this.monomerCount?this.monomers[0]+" "+this.monomers[this.monomerCount-1]:"")+"]"})});r("JM");t(["java.lang.Enum","JM.BioPolymer"],"JM.AlphaPolymer","JU.Measure $.P3 J.c.STR JM.Helix $.Sheet $.Turn JU.Logger".split(" "),function(){var b=z(function(){this.pt0=0;w(this,arguments)},JM,"AlphaPolymer",JM.BioPolymer);A(b,function(a,c){L(this,JM.AlphaPolymer,[]);this.pt0=c;this.set(a);this.hasStructure=
!0},"~A,~N");h(b,"getProteinStructure",function(a){return this.monomers[a].getStructure()},"~N");h(b,"getControlPoint",function(a,c){if(!this.monomers[a].isSheet())return this.leadPoints[a];c.sub2(this.leadMidpoints[a],this.leadPoints[a]);c.scale(this.sheetSmoothing);var g=JU.P3.newP(this.leadPoints[a]);g.add(c);return g},"~N,JU.V3");e(b,"addStructure",function(a,c,g,f,b,k,e,l,p,m,q){var h=-1,v=-1;if(p<m){if(this.monomers[0].firstAtomIndex>m||this.monomers[this.monomerCount-1].lastAtomIndex<p)return;
h=p;v=m}var u;if(!(-1==(b=this.getIndex(b,k,h,v))||-1==(u=this.getIndex(e,l,h,v)))){if(0<=p&&null!=q&&(e=q.nextSetBit(this.monomers[b].firstAtomIndex),0<=e&&e<this.monomers[u].lastAtomIndex))return;this.addStructureProtected(a,c,g,f,b,u)&&0<=p&&q.setBits(p,m+1)}},"J.c.STR,~S,~N,~N,~N,~N,~N,~N,~N,~N,JU.BS");e(b,"addStructureProtected",function(a,c,g,f,b,e){if(e<b)return JU.Logger.error("AlphaPolymer:addSecondaryStructure error:  indexStart:"+b+" indexEnd:"+e),!1;var n=e-b+1,l=null;switch(a){case J.c.STR.HELIX:case J.c.STR.HELIXALPHA:case J.c.STR.HELIX310:case J.c.STR.HELIXPI:l=
new JM.Helix(this,b,n,a);break;case J.c.STR.SHEET:l=new JM.Sheet(this,b,n,a);break;case J.c.STR.TURN:l=new JM.Turn(this,b,n);break;default:return JU.Logger.error("unrecognized secondary structure type"),!1}l.structureID=c;l.serialID=g;l.strandCount=f;for(a=b;a<=e;++a)this.monomers[a].setStructure(l);return!0},"J.c.STR,~S,~N,~N,~N,~N");h(b,"clearStructures",function(){for(var a=0;a<this.monomerCount;a++)this.monomers[a].setStructure(null)});e(b,"calculateStructures",function(){if(!(4>this.monomerCount)){var a=
this.calculateAnglesInDegrees(),c=this.calculateCodes(a);this.checkBetaSheetAlphaHelixOverlap(c,a);var g=this.calculateRunsFourOrMore(c);this.extendRuns(g);this.searchForTurns(c,a,g);this.addStructuresFromTags(g)}},"~B");e(b,"calculateAnglesInDegrees",function(){for(var a=K(this.monomerCount,0),c=this.monomerCount-1;2<=--c;)a[c]=JU.Measure.computeTorsion(this.monomers[c-2].getLeadAtom(),this.monomers[c-1].getLeadAtom(),this.monomers[c].getLeadAtom(),this.monomers[c+1].getLeadAtom(),!0);return a});
e(b,"calculateCodes",function(a){for(var c=Array(this.monomerCount),g=this.monomerCount-1;2<=--g;){var f=a[g];c[g]=10<=f&&120>f?JM.AlphaPolymer.Code.RIGHT_HELIX:120<=f||-90>f?JM.AlphaPolymer.Code.BETA_SHEET:-90<=f&&0>f?JM.AlphaPolymer.Code.LEFT_HELIX:JM.AlphaPolymer.Code.NADA}return c},"~A");e(b,"checkBetaSheetAlphaHelixOverlap",function(a,c){for(var g=this.monomerCount-2;2<=--g;)a[g]===JM.AlphaPolymer.Code.BETA_SHEET&&(140>=c[g]&&a[g-2]===JM.AlphaPolymer.Code.RIGHT_HELIX&&a[g-1]===JM.AlphaPolymer.Code.RIGHT_HELIX&&
a[g+1]===JM.AlphaPolymer.Code.RIGHT_HELIX&&a[g+2]===JM.AlphaPolymer.Code.RIGHT_HELIX)&&(a[g]=JM.AlphaPolymer.Code.RIGHT_HELIX)},"~A,~A");e(b,"calculateRunsFourOrMore",function(a){for(var c=Array(this.monomerCount),g=J.c.STR.NONE,f=JM.AlphaPolymer.Code.NADA,b=0,e=0;e<this.monomerCount;++e)if(a[e]===f&&f!==JM.AlphaPolymer.Code.NADA)if(++b,4==b)for(var g=f===JM.AlphaPolymer.Code.BETA_SHEET?J.c.STR.SHEET:J.c.STR.HELIX,n=4;0<=--n;)c[e-n]=g;else 4<b&&(c[e]=g);else b=1,f=a[e];return c},"~A");e(b,"extendRuns",
function(a){for(var c=1;c<this.monomerCount-4;++c)a[c]===J.c.STR.NONE&&a[c+1]!==J.c.STR.NONE&&(a[c]=a[c+1]);a[0]=a[1];a[this.monomerCount-1]=a[this.monomerCount-2]},"~A");e(b,"searchForTurns",function(a,c,g){for(var f=this.monomerCount-1;2<=--f;)if(a[f]=JM.AlphaPolymer.Code.NADA,null==g[f]||g[f]===J.c.STR.NONE){var b=c[f];-90<=b&&0>b?a[f]=JM.AlphaPolymer.Code.LEFT_TURN:0<=b&&90>b&&(a[f]=JM.AlphaPolymer.Code.RIGHT_TURN)}for(f=this.monomerCount-1;0<=--f;)a[f]!==JM.AlphaPolymer.Code.NADA&&(a[f+1]===
a[f]&&g[f]===J.c.STR.NONE)&&(g[f]=J.c.STR.TURN)},"~A,~A,~A");e(b,"addStructuresFromTags",function(a){for(var c=0;c<this.monomerCount;){var g=a[c];if(null==g||g===J.c.STR.NONE)++c;else{var f;for(f=c+1;f<this.monomerCount&&a[f]===g;++f);this.addStructureProtected(g,null,0,0,c,f-1);c=f}}},"~A");e(b,"setStructureBS",function(a,c,g,f,b){b=b?this.pt0:0;for(var e=0,n=f.nextSetBit(b),l=0,p=this.monomerCount+b;0<=n&&n<p;n=f.nextSetBit(l+1)){if(0>(l=f.nextClearBit(n))||l>p)l=p;this.addStructureProtected(g,
JM.AlphaPolymer.dsspTypes[c]+ ++e,a++,3==c?1:0,n-b,l-1-b)}return a},"~N,~N,J.c.STR,JU.BS,~B");var a=B(JM.AlphaPolymer,"Code",Enum);N(a,"NADA",0,[]);N(a,"RIGHT_HELIX",1,[]);N(a,"BETA_SHEET",2,[]);N(a,"LEFT_HELIX",3,[]);N(a,"LEFT_TURN",4,[]);N(a,"RIGHT_TURN",5,[]);I(b,"dsspTypes",F(-1,["H",null,"H","S","H",null,"T"]))});r("JM");t(["JM.AlphaMonomer"],"JM.AminoMonomer","JU.A4 $.BS $.M3 $.P3 $.PT $.Quat $.V3 J.c.STR JU.Escape $.Logger".split(" "),function(){var b=z(function(){this.nhChecked=!1;this.ptTemp=
null;w(this,arguments)},JM,"AminoMonomer",JM.AlphaMonomer);M(b,function(){});b.validateAndAllocate=e(b,"validateAndAllocate",function(a,d,c,g,f,b,e){var n=JM.Monomer.scanForOffsets(g,b,JM.AminoMonomer.interestingAminoAtomIDs);if(null==n)return null;JM.Monomer.checkOptional(n,1,g,b[5]);return e[g].isHetero()&&!JM.AminoMonomer.isBondedCorrectly(g,n,e)?null:(new JM.AminoMonomer).set2(a,d,c,g,f,n)},"JM.Chain,~S,~N,~N,~N,~A,~A");b.isBondedCorrectlyRange=e(b,"isBondedCorrectlyRange",function(a,d,c,g,f){a=
c+(g[a]&255);d=c+(g[d]&255);return a!=d&&f[a].isBonded(f[d])},"~N,~N,~N,~A,~A");b.isBondedCorrectly=e(b,"isBondedCorrectly",function(a,d,c){return JM.AminoMonomer.isBondedCorrectlyRange(2,0,a,d,c)&&JM.AminoMonomer.isBondedCorrectlyRange(0,3,a,d,c)&&(!JM.Monomer.have(d,1)||JM.AminoMonomer.isBondedCorrectlyRange(3,1,a,d,c))},"~N,~A,~A");e(b,"isAminoMonomer",function(){return!0});h(b,"getNitrogenAtom",function(){return this.getAtomFromOffsetIndex(2)});e(b,"getCarbonylCarbonAtom",function(){return this.getAtomFromOffsetIndex(3)});
h(b,"getCarbonylOxygenAtom",function(){return this.getWingAtom()});h(b,"getInitiatorAtom",function(){return this.getNitrogenAtom()});h(b,"getTerminatorAtom",function(){return this.getAtomFromOffsetIndex(JM.Monomer.have(this.offsets,4)?4:3)});e(b,"hasOAtom",function(){return JM.Monomer.have(this.offsets,1)});h(b,"isConnectedAfter",function(a){return null==a?!0:a.getCarbonylCarbonAtom().isBonded(this.getNitrogenAtom())},"JM.Monomer");h(b,"findNearestAtomIndex",function(a,d,c,g,f){var b=c[0],e=this.getNitrogenAtom();
g=G(g/2);1200>g&&(g=1200);if(0!=e.sZ){g=D(this.scaleToScreen(e.sZ,g));4>g&&(g=4);var n=this.getCarbonylCarbonAtom();f=G(f/2);1200>f&&(f=1200);f=D(this.scaleToScreen(e.sZ,f));4>f&&(f=4);var l=this.getLeadAtom();if(this.isCursorOnTopOf(l,a,d,G((g+f)/2),b)||this.isCursorOnTopOf(e,a,d,g,b)||this.isCursorOnTopOf(n,a,d,f,b))c[0]=l}},"~N,~N,~A,~N,~N");e(b,"resetHydrogenPoint",function(){this.nhChecked=!1;this.nitrogenHydrogenPoint=null});e(b,"getNitrogenHydrogenPoint",function(){null==this.nitrogenHydrogenPoint&&
!this.nhChecked&&(this.nhChecked=!0,this.nitrogenHydrogenPoint=this.getExplicitNH());return this.nitrogenHydrogenPoint});e(b,"getExplicitNH",function(){var a=this.getNitrogenAtom(),d=null,c=a.bonds;if(null!=c)for(var g=0;g<c.length;g++)if(1==(d=c[g].getOtherAtom(a)).getElementNumber())return d;return null});e(b,"getNHPoint",function(a,d,c,g){if(0>=this.monomerIndex||15==this.groupID)return!1;var f=this.getNitrogenAtom(),b=this.getNitrogenHydrogenPoint();if(null!=b&&!g)return d.sub2(b,f),a.setT(b),
!0;g=this.bioPolymer.monomers[this.monomerIndex-1];if(c)d.sub2(f,this.getLeadAtom()),d.normalize(),c=JU.V3.newVsub(f,g.getCarbonylCarbonAtom()),c.normalize(),d.add(c);else{c=g.getCarbonylOxygenAtom();if(null==c)return!1;d.sub2(g.getCarbonylCarbonAtom(),c)}d.normalize();a.add2(f,d);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(b,"getQuaternionFrameCenter",
function(a){if(0>this.monomerIndex)return null;switch(a.charCodeAt(0)){default:case 97:case 98:case 99:case 67:return this.getQuaternionFrameCenterAlpha(a);case 110:return this.getNitrogenAtom();case 112:case 80:return this.getCarbonylCarbonAtom();case 113:if(this.monomerIndex==this.bioPolymer.monomerCount-1)return null;a=this.bioPolymer.monomers[this.monomerIndex+1];var d=new JU.P3;d.ave(this.getCarbonylCarbonAtom(),a.getNitrogenAtom());return d}},"~S");h(b,"getQuaternion",function(a){if(0>this.monomerIndex)return null;
var d=this.getCarbonylCarbonAtom(),c=this.getLeadAtom(),g=new JU.V3,f=new JU.V3,b=null;switch(a.charCodeAt(0)){case 97:case 110:if(0==this.monomerIndex||15==this.groupID)return null;b=new JU.V3;null==this.ptTemp&&(this.ptTemp=new JU.P3);this.getNHPoint(this.ptTemp,b,!0,!1);f.sub2(c,this.getNitrogenAtom());f.cross(b,f);(new JU.M3).setAA(JU.A4.newVA(f,-0.29670596)).rotate(b);g.cross(f,b);break;case 98:return this.getQuaternionAlpha("b");case 99:g.sub2(d,c);f.sub2(this.getNitrogenAtom(),c);break;case 112:case 120:if(this.monomerIndex==
this.bioPolymer.monomerCount-1)return null;g.sub2(c,d);f.sub2(this.bioPolymer.monomers[this.monomerIndex+1].getNitrogenAtom(),d);break;case 113:if(this.monomerIndex==this.bioPolymer.monomerCount-1)return null;a=this.bioPolymer.monomers[this.monomerIndex+1];f.sub2(a.getLeadAtom(),a.getNitrogenAtom());g.sub2(c,d);break;default:return null}return JU.Quat.getQuaternionFrameV(g,f,b,!1)},"~S");h(b,"getStructureId",function(){return null==this.proteinStructure||null==this.proteinStructure.structureID?"":
this.proteinStructure.structureID});h(b,"getProteinStructureTag",function(){if(null==this.proteinStructure||null==this.proteinStructure.structureID)return null;var a;a=JU.PT.formatStringI("%3N %3ID","N",this.proteinStructure.serialID);a=JU.PT.formatStringS(a,"ID",this.proteinStructure.structureID);this.proteinStructure.type===J.c.STR.SHEET&&(a+=JU.PT.formatStringI("%2SC","SC",this.proteinStructure.strandCount));return a});h(b,"getBSSideChain",function(){var a=new JU.BS;this.setAtomBits(a);this.clear(a,
this.getLeadAtom(),!0);this.clear(a,this.getCarbonylCarbonAtom(),!1);this.clear(a,this.getCarbonylOxygenAtom(),!1);this.clear(a,this.getNitrogenAtom(),!0);return a});e(b,"clear",function(a,d,c){if(null!=d&&(a.clear(d.i),c)){c=d.bonds;for(var g,f=c.length;0<=--f;)1==(g=c[f].getOtherAtom(d)).getElementNumber()&&a.clear(g.i)}},"JU.BS,JM.Atom,~B");I(b,"interestingAminoAtomIDs",H(-1,[2,-5,1,3,-65]))});r("JM");t(["JM.AlphaPolymer"],"JM.AminoPolymer","JU.Measure $.P3 $.V3 J.c.STR JM.HBond JU.Logger".split(" "),
function(){var b=z(function(){this.structureList=null;w(this,arguments)},JM,"AminoPolymer",JM.AlphaPolymer);A(b,function(a,d){L(this,JM.AminoPolymer,[a,d]);this.type=1;for(var c=0;c<this.monomerCount;++c)if(!a[c].hasOAtom())return;this.hasWingPoints=!0},"~A,~N");h(b,"resetHydrogenPoints",function(){for(var a,d=null,c=0;c<this.monomerCount;c++){if(null!=(a=this.getProteinStructure(c))&&a!==d)(d=a).resetAxes();this.monomers[c].resetHydrogenPoint()}});h(b,"calcPhiPsiAngles",function(){for(var a=0;a<
this.monomerCount-1;++a)this.calcPhiPsiAngles2(this.monomers[a],this.monomers[a+1]);return!0});e(b,"calcPhiPsiAngles2",function(a,d){var c=a.getNitrogenAtom(),g=a.getLeadAtom(),f=a.getCarbonylCarbonAtom(),b=d.getNitrogenAtom(),e=d.getLeadAtom(),n=d.getCarbonylCarbonAtom();d.setGroupParameter(1111490569,JU.Measure.computeTorsion(f,b,e,n,!0));a.setGroupParameter(1111490570,JU.Measure.computeTorsion(c,g,f,b,!0));a.setGroupParameter(1111490568,JU.Measure.computeTorsion(g,f,b,e,!0))},"JM.AminoMonomer,JM.AminoMonomer");
h(b,"calculateRamachandranHelixAngle",function(a,d){var c=0==a?NaN:this.monomers[a-1].getGroupParameter(1111490570),g=this.monomers[a].getGroupParameter(1111490570),f=this.monomers[a].getGroupParameter(1111490569),b=a==this.monomerCount-1?NaN:this.monomers[a+1].getGroupParameter(1111490569),e=a==this.monomerCount-1?NaN:this.monomers[a+1].getGroupParameter(1111490570);switch(d.charCodeAt(0)){default:case 112:case 114:case 80:return c=3.141592653589793*((b-f)/2)/180,g=3.141592653589793*((e-g)/2)/180,
114.59155902616465*Math.acos(Math.cos(g)*Math.cos(c)-Math.sin(g)*Math.sin(c)/3);case 99:case 67:return g-c+b-f}},"~N,~S");h(b,"calcRasmolHydrogenBonds",function(a,d,c,g,f,b,e,n){null==a&&(a=this);if(x(a,"JM.AminoPolymer")){f=new JU.P3;for(var l=new JU.V3,p,m=null==b?s(2,3,0):null,h=1;h<this.monomerCount;++h)if(null==b?(m[0][0]=m[1][0]=this.bioPolymerIndexInModel,m[0][1]=m[1][1]=-2147483648,m[0][2]=m[1][2]=0):m=b[h],(p=this.monomers[h]).getNHPoint(f,l,e,n)){var y=null==d||d.get(p.getNitrogenAtom().i);
if(y&&(e||null!=p.getCarbonylOxygenAtom()))this.checkRasmolHydrogenBond(p,a,h,f,y?c:d,g,m,e)}}},"JM.BioPolymer,JU.BS,JU.BS,JU.Lst,~N,~A,~B,~B");e(b,"checkRasmolHydrogenBond",function(a,d,c,g,f,b,e,n){var l=a.getLeadAtom(),p=a.getNitrogenAtom();a=a.getNitrogenAtom();for(var m,h=d.monomerCount;0<=--h;)if(!(d===this&&(h==c||h+1==c))){m=d.monomers[h];var y=m.getCarbonylOxygenAtom();if(!(null==y||null!=f&&!f.get(y.i)))if(y=m.getLeadAtom(),!(81<=l.distanceSquared(y))){y=this.calcHbondEnergy(p,g,m,n);if(y<
e[0][2])m=e[1],e[1]=e[0],e[0]=m;else if(y<e[1][2])m=e[1];else continue;m[0]=d.bioPolymerIndexInModel;m[1]=-500>y?h:-1-h;m[2]=y}}if(null!=b)for(h=0;2>h;h++)0<=e[h][1]&&this.addResidueHydrogenBond(a,d.monomers[e[h][1]].getCarbonylOxygenAtom(),d===this?c:-99,e[h][1],e[h][2]/1E3,b)},"JM.AminoMonomer,JM.BioPolymer,~N,JU.P3,JU.BS,JU.Lst,~A,~B");e(b,"calcHbondEnergy",function(a,d,c,g){var f=c.getCarbonylOxygenAtom();if(null==f)return 0;var b=f.distanceSquared(a);if(0.25>b)return 0;f=f.distanceSquared(d);
if(0.25>f)return 0;c=c.getCarbonylCarbonAtom();d=c.distanceSquared(d);if(0.25>d)return 0;c=c.distanceSquared(a);if(0.25>c)return 0;a=Math.sqrt(f);f=Math.sqrt(d);d=Math.sqrt(c);b=Math.sqrt(b);b=JM.HBond.getEnergy(a,f,d,b);return!(-500>b&&(!g||d>f&&3>=a))&&g||-9900>b?0:b},"JU.P3,JU.P3,JM.AminoMonomer,~B");e(b,"addResidueHydrogenBond",function(a,d,c,g,f,b){switch(c-g){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}b.addLast(new JM.HBond(a,d,c,1,0,f))},"JM.Atom,JM.Atom,~N,~N,~N,JU.Lst");h(b,"calculateStructures",function(a){if(!a){null==this.structureList&&(this.structureList=this.model.ms.getStructureList());a=P(this.monomerCount,"\x00");for(var d=0;d<this.monomerCount-1;++d){var c=this.monomers[d],g=this.monomers[d+1],f=g.getGroupParameter(1111490569),b=c.getGroupParameter(1111490570);a[d]=this.isHelix(b,f)?0>f&&25>b?"4":"3":this.isSheet(b,f)?"s":this.isTurn(b,f)?"t":"n";JU.Logger.debugging&&JU.Logger.debug(0+
this.monomers[0].chain.chainID+" aminopolymer:"+d+" "+g.getGroupParameter(1111490569)+","+c.getGroupParameter(1111490570)+" "+a[d])}for(d=0;d<this.monomerCount;++d)if("4"==a[d]){for(c=d+1;c<this.monomerCount&&"4"==a[c];++c);c--;c>=d+3&&this.addStructureProtected(J.c.STR.HELIX,null,0,0,d,c);d=c}for(d=0;d<this.monomerCount;++d)if("3"==a[d]){for(c=d+1;c<this.monomerCount&&"3"==a[c];++c);c--;c>=d+3&&this.addStructureProtected(J.c.STR.HELIX,null,0,0,d,c);d=c}for(d=0;d<this.monomerCount;++d)if("s"==a[d]){for(c=
d+1;c<this.monomerCount&&"s"==a[c];++c);c--;c>=d+2&&this.addStructureProtected(J.c.STR.SHEET,null,0,0,d,c);d=c}for(d=0;d<this.monomerCount;++d)if("t"==a[d]){for(c=d+1;c<this.monomerCount&&"t"==a[c];++c);c--;c>=d+2&&this.addStructureProtected(J.c.STR.TURN,null,0,0,d,c);d=c}}},"~B");e(b,"isTurn",function(a,d){return JM.AminoPolymer.checkPhiPsi(this.structureList.get(J.c.STR.TURN),a,d)},"~N,~N");e(b,"isSheet",function(a,d){return JM.AminoPolymer.checkPhiPsi(this.structureList.get(J.c.STR.SHEET),a,d)},
"~N,~N");e(b,"isHelix",function(a,d){return JM.AminoPolymer.checkPhiPsi(this.structureList.get(J.c.STR.HELIX),a,d)},"~N,~N");b.checkPhiPsi=e(b,"checkPhiPsi",function(a,d,c){for(var g=0;g<a.length;g+=4)if(c>=a[g]&&c<=a[g+1]&&d>=a[g+2]&&d<=a[g+3])return!0;return!1},"~A,~N,~N");e(b,"setStructureList",function(a){this.structureList=a},"java.util.Map")});r("JM");t(null,"JM.BioModelSet","java.lang.Boolean $.Character $.Float java.util.Hashtable JU.AU $.BS $.Lst $.PT $.SB J.api.Interface J.c.STR JM.Group JM.BioResolver JS.T JU.BSUtil $.Escape $.Logger".split(" "),
function(){var b=z(function(){this.unitIdSets=this.ext=this.ms=this.vwr=null;w(this,arguments)},JM,"BioModelSet");e(b,"getBioExt",function(){return null==this.ext?(this.ext=J.api.Interface.getInterface("JM.BioExt",this.vwr,"script")).set(this.vwr,this.vwr.ms):this.ext});e(b,"set",function(a,d){this.vwr=a;this.ms=d;this.unitIdSets=null;null!=this.ext&&this.ext.set(a,d);return this},"JV.Viewer,JM.ModelSet");e(b,"calcAllRasmolHydrogenBonds",function(a,d,c,g,b,j,e,n){var l=this.ms.am;if(null==c){var p=
a;null!=d&&!a.equals(d)&&(p=JU.BSUtil.copy(a)).or(d);for(var m=new JU.BS,h=new JU.BS,y=this.ms.am,v=this.ms.bo,u=this.ms.bondCount;0<=--u;){var C=v[u];0!=(C.order&28672)&&(p.get(C.atom1.i)?m.set(u):h.set(y[C.atom1.mi].trajectoryBaseIndex))}for(u=this.ms.mc;0<=--u;)y[u].isBioModel&&(y[u].hasRasmolHBonds=h.get(u));0<=m.nextSetBit(0)&&this.ms.deleteBonds(m,!1)}for(u=this.ms.mc;0<=--u;)l[u].isBioModel&&!this.ms.isTrajectorySubFrame(u)&&l[u].getRasmolHydrogenBonds(a,d,c,g,b,j,e,n)},"JU.BS,JU.BS,JU.Lst,~B,~N,~B,JU.BS,~N");
e(b,"calcSelectedMonomersCount",function(){for(var a=this.vwr.bsA(),d=this.ms.mc;0<=--d;)if(this.ms.am[d].isBioModel)for(var c=this.ms.am[d],g=c.bioPolymerCount;0<=--g;)c.bioPolymers[g].calcSelectedMonomersCount(a)});e(b,"calculateAllPolymers",function(a,d,c,g){var b=!this.vwr.getBoolean(603979896);0>d&&(d=a.length);if(null!=g)for(var j=0;j<d;++j){var e=a[j];x(e,"JM.Monomer")&&null!=e.bioPolymer&&!g.get(e.chain.model.modelIndex)&&e.setBioPolymer(null,-1)}for(var e=0,n=this.ms.mc;e<n;e++)if((null==
g||!g.get(e))&&this.ms.am[e].isBioModel)for(var l=0,j=c;j<d;++j,l++){var p=a[j],h=p.getModel();if(h.isBioModel&&x(p,"JM.Monomer")&&null!=p.getLeadAtom()){var q=b&&!this.ms.isJmolDataFrameForModel(this.ms.at[p.getLeadAtom().i].mi),p=null==p.bioPolymer?JM.BioResolver.allocateBioPolymer(a,j,q,l):null;null==p||0==p.monomerCount||(h=h.addBioPolymer(p),j+=h-1,l+=h-1)}}},"~A,~N,~N,JU.BS");e(b,"calculateAllStructuresExcept",function(a,d,c,g,b,j,e){var n="";a=JU.BSUtil.copyInvert(a,this.ms.mc);b&&this.setAllDefaultStructure(a);
for(var l=a.nextSetBit(0);0<=l;l=a.nextSetBit(l+1))this.ms.am[l].isBioModel&&(n+=this.ms.am[l].calculateStructures(d,c,g,b,j,e));b&&this.ms.setStructureIndexes();return n},"JU.BS,~B,~B,~B,~B,~B,~N");e(b,"calculateAllStuctures",function(a,d,c,g,b,j){0>=j&&(j=2);var e=new JU.BS;a=JU.BSUtil.copyInvert(this.modelsOf(a,e),this.ms.mc);if(!b)return this.ms.calculateStructuresAllExcept(a,d,c,g,!1,!1,j);this.ms.recalculatePolymers(a);d=this.ms.calculateStructuresAllExcept(a,d,c,g,!0,!1,j);this.vwr.shm.resetBioshapes(e);
this.ms.setStructureIndexes();return d},"JU.BS,~B,~B,~B,~B,~N");e(b,"calculateStraightnessAll",function(){this.getBioExt().calculateStraightnessAll()});e(b,"calculateStruts",function(a,d){return this.getBioExt().calculateAllstruts(this.vwr,this.ms,a,d)},"JU.BS,JU.BS");e(b,"getAllDefaultStructures",function(a,d){for(var c=this.modelsOf(a,d),g=new JU.SB,b=c.nextSetBit(0);0<=b;b=c.nextSetBit(b+1))this.ms.am[b].isBioModel&&null!=this.ms.am[b].defaultStructure&&g.append(this.ms.am[b].defaultStructure);
return g.toString()},"JU.BS,JU.BS");e(b,"getAllHeteroList",function(a){for(var d=new java.util.Hashtable,c=!1,g=this.ms.mc;0<=--g;)if(0>a||g==a){var b=this.ms.getInfo(g,"hetNames");if(null!=b)for(var c=!0,j,b=b.entrySet().iterator();b.hasNext()&&((j=b.next())||1);){var e=j.getKey();d.put(e,j.getValue())}}return c?d:null},"~N");e(b,"getAllPolymerInfo",function(a,d){this.getBioExt().getAllPolymerInfo(a,d)},"JU.BS,java.util.Map");e(b,"getAllPolymerPointsAndVectors",function(a,d,c,g){for(var b=0;b<this.ms.mc;++b)if(this.ms.am[b].isBioModel)for(var j=
this.ms.am[b],e=2147483646,n=0;n<j.bioPolymerCount;n++)e=j.bioPolymers[n].getPolymerPointsAndVectors(e,a,d,c,g)},"JU.BS,JU.Lst,~B,~N");e(b,"getAllSequenceBits",function(a,d,c){if(0<a.length){null==d&&(d=this.vwr.getAllAtoms());if(a.indexOf("|")<a.lastIndexOf("|"))return this.getAllUnitIds(a,d,c);for(var g=this.ms.am,b=this.ms.mc;0<=--b;)if(g[b].isBioModel)for(var j=g[b],e=a.length,n=0;n<j.bioPolymerCount;n++)for(var l=j.bioPolymers[n].getSequence(),p=-1;0<=(p=l.indexOf(a,++p));)j.bioPolymers[n].getPolymerSequenceAtoms(p,
e,d,c)}return c},"~S,JU.BS,JU.BS");e(b,"getAtomBitsBS",function(a,d,c){var g=this.ms.at,b=this.ms.ac,j=0,e;switch(a){case 136314895:case 2097184:for(var n=136314895==a?J.c.STR.HELIX:J.c.STR.SHEET,j=b;0<=--j;)null!=g[j]&&((e=g[j].group).isWithinStructure(n)&&e.setAtomBits(c),j=e.firstAtomIndex);break;case 2097188:for(j=b;0<=--j;)null!=g[j]&&((e=g[j].group).isCarbohydrate()&&e.setAtomBits(c),j=e.firstAtomIndex);break;case 2097156:for(j=b;0<=--j;)null!=g[j]&&((e=g[j].group).isDna()&&e.setAtomBits(c),
j=e.firstAtomIndex);break;case 2097166:for(j=b;0<=--j;)null!=g[j]&&((e=g[j].group).isNucleic()&&e.setAtomBits(c),j=e.firstAtomIndex);break;case 2097168:for(j=b;0<=--j;)null!=g[j]&&((e=g[j].group).isProtein()&&e.setAtomBits(c),j=e.firstAtomIndex);break;case 2097170:for(j=b;0<=--j;)null!=g[j]&&((e=g[j].group).isPurine()&&e.setAtomBits(c),j=e.firstAtomIndex);break;case 2097172:for(j=b;0<=--j;)null!=g[j]&&((e=g[j].group).isPyrimidine()&&e.setAtomBits(c),j=e.firstAtomIndex);break;case 2097174:for(j=b;0<=
--j;)null!=g[j]&&((e=g[j].group).isRna()&&e.setAtomBits(c),j=e.firstAtomIndex)}if(0>j)return c;b=d.nextSetBit(0);if(0>b)return c;j=0;switch(a){case 1094713362:for(j=b;0<=j;j=d.nextSetBit(j+1))0<=g[j].group.getBioPolymerIndexInModel()&&g[j].group.bioPolymer.setAtomBitsAndClear(c,d);break;case 1639976963:for(j=b;0<=j;j=d.nextSetBit(j+1))b=g[j].group.getStructure(),null!=b&&b.setAtomBitsAndClear(c,d)}0==j&&JU.Logger.error("MISSING getAtomBits entry for "+JS.T.nameOf(a));return c},"~N,JU.BS,JU.BS");e(b,
"getAtomBitsStr",function(a,d,c){switch(a){default:return new JU.BS;case 1073741925:return this.getAnnotationBits("domains",1073741925,d);case 1073742189:return this.getAnnotationBits("validation",1073742189,d);case 1073742128:return this.getAnnotationBits("rna3d",1073742128,d);case 1073741863:return c=new JU.BS,0!=d.length%2?c:this.ms.getAtomBitsMDa(1086324742,this.getAllBasePairBits(d),c);case 1111490587:return this.getAnnotationBits("dssr",1111490587,d);case 1086324744:return this.getAllSequenceBits(d,
null,c)}},"~N,~S,JU.BS");e(b,"getBioPolymerCountInModel",function(a){if(0>a){a=0;for(var d=this.ms.mc;0<=--d;)!this.ms.isTrajectorySubFrame(d)&&this.ms.am[d].isBioModel&&(a+=this.ms.am[d].getBioPolymerCount());return a}return this.ms.isTrajectorySubFrame(a)||!this.ms.am[a].isBioModel?0:this.ms.am[a].getBioPolymerCount()},"~N");e(b,"getFullProteinStructureState",function(a,d){var c=1073742327==d;if(c&&!this.ms.proteinStructureTainted)return"";var g=1073742158==d||1073742327==d,b=this.ms.at,e=(null==
a?this.vwr.getAllAtoms():a).nextSetBit(0);if(0>e)return"";if(null!=a&&4138==d){a=JU.BSUtil.copy(a);for(var k=this.ms.ac;0<=--k;)(null==b[k]||Float.isNaN(b[k].group.getGroupParameter(1111490569))||Float.isNaN(b[k].group.getGroupParameter(1111490570)))&&a.clear(k)}for(var n=(null==a?this.vwr.getAllAtoms():a).length()-1,l=b[e].mi,e=b[n].mi,n=new JU.Lst,p=new java.util.Hashtable,h=new JU.SB;l<=e;l++)if(this.ms.am[l].isBioModel&&(k=this.ms.am[l],!c||k.structureTainted)){var q=new JU.BS;q.or(k.bsAtoms);
q.andNot(k.bsAtomsDeleted);k=q.nextSetBit(0);if(!(0>k)){g&&h.append("  structure none ").append(JU.Escape.eBS(this.ms.getModelAtomBitSetIncludingDeleted(l,!1))).append("    \t# model="+this.ms.getModelNumberDotted(l)).append(";\n");for(var y;0<=k;k=q.nextSetBit(k+1)){var v=b[k];if(!(null==v||!x(v.group,"JM.AlphaMonomer")||null==(y=v.group.proteinStructure)||p.containsKey(y)))n.addLast(y),p.put(y,Boolean.TRUE)}}}this.getStructureLines(a,h,n,J.c.STR.HELIX,g,d);this.getStructureLines(a,h,n,J.c.STR.SHEET,
g,d);this.getStructureLines(a,h,n,J.c.STR.TURN,g,d);return h.toString()},"JU.BS,~N");e(b,"getGroupsWithinAll",function(a,d){for(var c=new JU.BS,g=this.ms.getIterativeModels(!1),b=this.ms.mc;0<=--b;)if(g.get(b)&&this.ms.am[b].isBioModel)for(var e=this.ms.am[b],k=e.bioPolymerCount;0<=--k;)e.bioPolymers[k].getRangeGroups(a,d,c);return c},"~N,JU.BS");e(b,"getIdentifierOrNull",function(a){for(var d=a.length,c=0;c<d&&JU.PT.isLetter(a.charAt(c));)++c;var g=this.ms.getSpecNameOrNull(a.substring(0,c),!1);
if(c==d)return g;null==g&&(g=new JU.BS);for(var b=c;c<d&&JU.PT.isDigit(a.charAt(c));)++c;var e=0;try{e=Integer.parseInt(a.substring(b,c))}catch(k){if(O(k,"NumberFormatException"))return null;throw k;}b=" ";c<d&&"^"==a.charAt(c)&&++c<d&&(b=a.charAt(c));e=JM.Group.getSeqcodeFor(e,b);e=this.ms.getSeqcodeBits(e,!1);if(null==e){" "!=b&&(e=this.ms.getSeqcodeBits(Character.toUpperCase(a.charAt(c)).charCodeAt(0),!1));if(null==e)return null;c++}g.and(e);if(c>=d)return g;if(c!=d-1)return null;g.and(this.ms.getChainBits(a.charCodeAt(c)));
return g},"~S");e(b,"mutate",function(a,d,c,g,b){return this.getBioExt().mutate(this.vwr,a,d,c,g,b)},"JU.BS,~S,~A,~S,~A");e(b,"recalculateAllPolymers",function(a,d){for(var c=0;c<this.ms.mc;c++)this.ms.am[c].isBioModel&&!a.get(c)&&this.ms.am[c].clearBioPolymers();this.calculateAllPolymers(d,-1,0,a)},"JU.BS,~A");e(b,"recalculatePoints",function(a){if(0>a)for(a=this.ms.mc;0<=--a;)!this.ms.isTrajectorySubFrame(a)&&this.ms.am[a].isBioModel&&this.ms.am[a].recalculateLeadMidpointsAndWingVectors();else!this.ms.isTrajectorySubFrame(a)&&
this.ms.am[a].isBioModel&&this.ms.am[a].recalculateLeadMidpointsAndWingVectors()},"~N");e(b,"setAllConformation",function(a){this.vwr.ms.recalculatePositionDependentQuantities(a,null);for(var d=this.ms.getModelBS(a,!1),c=d.nextSetBit(0);0<=c;c=d.nextSetBit(c+1))if(this.ms.am[c].isBioModel){var g=this.ms.am[c];if(0<g.altLocCount)for(var b=g.bioPolymerCount;0<=--b;)g.bioPolymers[b].setConformation(a)}},"JU.BS");e(b,"setAllProteinType",function(a,d){var c=-1,g=this.ms.getModelBS(a,!1);this.setAllDefaultStructure(g);
for(var g=this.ms.getGroups(),b=0,e=-2147483648,k=null,n=null,l=d===J.c.STR.NONE,p=0;p<g.length;p++){var h=g[p];if(0!=h.getBioPolymerLength()&&a.get(h.firstAtomIndex)){var q=h.getModel();if(!l){q!==n&&(n=q,b=0,k=null);k!==h.bioPolymer&&(e=-2147483648,k=h.bioPolymer);var y=h.getResno();y!=e+1&&(c=-1);e=y}c=h.setProteinStructureType(d,c);1E3<h.getStrucNo()&&h.setStrucNo(++b);this.ms.proteinStructureTainted=q.structureTainted=!0}}},"JU.BS,J.c.STR");e(b,"setAllStructureList",function(a){for(var d=this.ms.mc;0<=
--d;)if(this.ms.am[d].isBioModel){var c=this.ms.am[d];c.bioPolymers=JU.AU.arrayCopyObject(c.bioPolymers,c.bioPolymerCount);for(var g=c.bioPolymerCount;0<=--g;){var b=c.bioPolymers[g];x(b,"JM.AminoPolymer")&&b.setStructureList(a)}}},"java.util.Map");e(b,"getAllBasePairBits",function(a){var d=null,c=null,g=new JU.Lst;if(0==a.length)d=c=this.vwr.getAllAtoms(),this.calcAllRasmolHydrogenBonds(d,c,g,!0,1,!1,null,0);else for(var b=0;b<a.length;)d=this.ms.getSequenceBits(a.substring(b,++b),null,new JU.BS),
0>d.nextSetBit(0)||(c=this.ms.getSequenceBits(a.substring(b,++b),null,new JU.BS),0>c.nextSetBit(0)||this.calcAllRasmolHydrogenBonds(d,c,g,!0,1,!1,null,0));a=new JU.BS;for(b=g.size();0<=--b;)d=g.get(b),a.set(d.atom1.i),a.set(d.atom2.i);return a},"~S");e(b,"getAllUnitIds",function(a,d,c){var g=this.unitIdSets;if(null==g){for(var g=this.unitIdSets=Array(7),b=0;7>b;b++)g[b]=new java.util.Hashtable;for(b=this.ms.mc;0<=--b;){var e=this.ms.am[b];if(e.isBioModel){this.ms.isTrajectory(b)&&(e=this.ms.am[b=
e.trajectoryBaseIndex]);var k="|"+this.ms.getInfo(b,"modelNumber");this.checkMap(g[0],this.ms.getInfo(b,"modelName")+k,e.bsAtoms);this.checkMap(g[0],k,e.bsAtoms)}}}var k=e=null,n=new JU.BS;a=JU.PT.getTokens(JU.PT.replaceAllCharacters(a,', \t\n[]"='," "));for(var l=s(8,0),b=a.length;0<=--b;){var h=a[b]+"|";if(!(5>h.length)){for(var m=0,q=0,y=0,v=h.lastIndexOf("|")+1;q<v&&8>y;q++)"|"==h.charAt(q)?l[y++]=q:m|=1<<y;if(22==(m&22)){n.clearAll();n.or(d);q=h.substring(0,l[2]);if(null!=k&&k.equals(q))n.and(e);
else{if(!this.addUnit(1094717454,h.substring(0,l[1]).toUpperCase(),n,g[0])||!this.addUnit(1073742357,h.substring(l[1]+1,l[2]),n,g[1]))continue;e=JU.BSUtil.copy(n);k=q}q=0!=(m&32);y=0!=(m&64);this.addUnit(1094715412,h.substring(l[3]+1,l[4]),n,g[2])&&(this.addUnit(5,0==(m&128)?"\x00":h.substring(l[6]+1,l[7]),n,g[3])&&!(q?!this.addUnit(1086326786,h.substring(l[4]+1,l[5]).toUpperCase(),n,g[4])||!this.addUnit(1073742355,h.substring(l[5]+1,l[6]),n,g[5]):y&&!this.addUnit(1094717448,h.substring(l[5]+1,l[6]),
n,g[6])))&&c.or(n)}}}return c},"~S,JU.BS,JU.BS");e(b,"checkMap",function(a,d,c){c=JU.BSUtil.copy(c);var g=a.get(d);null==g?a.put(d,g=c):g.or(c);return g},"java.util.Map,~S,JU.BS");e(b,"addUnit",function(a,d,c,g){var b=g.get(d);if(null==b){var e;switch(a){default:return!1;case 1073742357:e=Integer.$valueOf(this.vwr.getChainID(d,!1));break;case 1094715412:e=Integer.$valueOf(JU.PT.parseInt(d));break;case 5:e=Integer.$valueOf(d.charCodeAt(0));break;case 1094717448:b=this.ms.getAtomBitsMDa(a=1073742355,
null,new JU.BS);case 1086326786:e=d;break;case 1073742355:e=0==d.length?null:d}g.put(d,b=this.ms.getAtomBitsMDa(a,e,null==b?new JU.BS:b))}c.and(b);return 0<=c.nextSetBit(0)},"~N,~S,JU.BS,java.util.Map");e(b,"getAnnotationBits",function(a,d,c){for(var g=new JU.BS,b=this.vwr.getAnnotationParser(a.equals("dssr")),e,k=this.ms.mc;0<=--k;)null!=(e=this.ms.getInfo(k,a))&&g.or(b.getAtomBits(this.vwr,c,this.ms.am[k].getCachedAnnotationMap(a+" V ",e),this.ms.am[k].dssrCache,d,k,this.ms.am[k].bsAtoms));return g},
"~S,~N,~S");e(b,"getStructureLines",function(a,d,c,g,b,e){e=134222350==e;for(var k=0,n=0,l=0,h=null,m=new JU.BS,q=0,y=0,v=c.size();y<v;y++){var u=c.get(y);if(u.type===g){var C=u.findMonomer(a,!0),r=u.findMonomer(a,!1);if(!(null==C||null==r)){var t=u.apolymer.model.modelIndex,h=b?"    \t# model="+this.ms.getModelNumberDotted(t):null,t=C.getResno(),x=r.getResno(),w=u.subtype;switch(g){case J.c.STR.HELIX:case J.c.STR.TURN:case J.c.STR.SHEET:if(q++,b){m.clearAll();u.setAtomBits(m);var z=w.getBioStructureTypeName(!1);
d.append("  structure ").append(z).append(" ").append(JU.Escape.eBS(m)).append(h).append(" & ("+t+" - "+x+")").append(";\n")}else{var s;switch(g){case J.c.STR.HELIX:z=++k;h=JU.PT.formatStringI("%3N %3N","N",z);s="HELIX  %ID %3GROUPA %1CA %4RESA  %3GROUPB %1CB %4RESB";z=null;switch(w){case J.c.STR.HELIX:case J.c.STR.HELIXALPHA:z="  1";break;case J.c.STR.HELIX310:z="  5";break;case J.c.STR.HELIXPI:z="  3"}null!=z&&(s+=z);break;case J.c.STR.SHEET:z=++n;h=JU.PT.formatStringI("%3N %3A 0","N",z);h=JU.PT.formatStringS(h,
"A","S"+z);s="SHEET  %ID %3GROUPA %1CA%4RESA  %3GROUPB %1CB%4RESB";break;default:z=++l,h=JU.PT.formatStringI("%3N %3N","N",z),s="TURN   %ID %3GROUPA %1CA%4RESA  %3GROUPB %1CB%4RESB"}s=JU.PT.formatStringS(s,"ID",h);s=JU.PT.formatStringS(s,"GROUPA",C.getGroup3());s=JU.PT.formatStringS(s,"CA",C.getLeadAtom().getChainIDStr());s=JU.PT.formatStringI(s,"RESA",t);s=JU.PT.formatStringS(s,"GROUPB",r.getGroup3());s=JU.PT.formatStringS(s,"CB",r.getLeadAtom().getChainIDStr());s=JU.PT.formatStringI(s,"RESB",x);
d.append(s);e&&d.append(" strucno= ").appendI(u.strucNo);d.append("\n")}}}}}0<q&&d.append("\n");return q},"JU.BS,JU.SB,JU.Lst,J.c.STR,~B,~N");e(b,"modelsOf",function(a,d){for(var c=JU.BS.newN(this.ms.mc),g=null==a,b=g?this.ms.ac-1:a.nextSetBit(0);0<=b;b=g?b-1:a.nextSetBit(b+1))if(null!=this.ms.at[b]){var e=this.ms.am[this.ms.at[b].mi].trajectoryBaseIndex;this.ms.isJmolDataFrameForModel(e)||(c.set(e),d.set(b))}return c},"JU.BS,JU.BS");e(b,"setAllDefaultStructure",function(a){for(var d=a.nextSetBit(0);0<=
d;d=a.nextSetBit(d+1))if(this.ms.am[d].isBioModel){var c=this.ms.am[d];null==c.defaultStructure&&(c.defaultStructure=this.getFullProteinStructureState(c.bsAtoms,1073742158))}},"JU.BS");e(b,"getAminoAcidValenceAndCharge",function(a,d,c){return this.getBioExt().getAminoAcidValenceAndCharge(a,d,c)},"~S,~S,~A")});r("JM");t(["JM.Model"],"JM.BioModel","java.util.Hashtable JU.AU $.BS $.Lst $.SB J.api.Interface JU.Escape".split(" "),function(){var b=z(function(){this.vwr=null;this.bioPolymerCount=0;this.bioPolymers=
null;this.isMutated=!1;this.defaultStructure=null;w(this,arguments)},JM,"BioModel",JM.Model);A(b,function(a,d,c,b,f,e){L(this,JM.BioModel,[]);this.vwr=a.vwr;this.set(a,d,c,b,f,e);this.isBioModel=!0;this.vwr.getJBR().getBioModelSet(a);this.clearBioPolymers();a.am[d]=this;this.pdbID=e.get("name")},"JM.ModelSet,~N,~N,~S,java.util.Properties,java.util.Map");e(b,"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;return a.monomerCount},"JM.BioPolymer");e(b,"addSecondaryStructure",function(a,d,c,b,f,e,k,n,l,h,m){for(var q=this.bioPolymerCount;0<=--q;)x(this.bioPolymers[q],"JM.AlphaPolymer")&&this.bioPolymers[q].addStructure(a,d,c,b,f,e,k,n,l,h,m)},"J.c.STR,~S,~N,~N,~N,~N,~N,~N,~N,~N,JU.BS");e(b,"addStructureByBS",function(a,d,c,b){for(var f=this.bioPolymerCount;0<=--f;)x(this.bioPolymers[f],
"JM.AlphaPolymer")&&(a=this.bioPolymers[f].setStructureBS(++a,d,c,b,!0))},"~N,~N,J.c.STR,JU.BS");e(b,"calculateDssx",function(a,d,c,b,f){for(var e=!1,k=!1,n=0;n<this.bioPolymerCount&&(!e||!k);n++)this.bioPolymers[n].isNucleic()?k=!0:x(this.bioPolymers[n],"JM.AminoPolymer")&&(e=!0);n="";e&&(n+=J.api.Interface.getOption("dssx.DSSP",this.vwr,"ms").calculateDssp(this.bioPolymers,this.bioPolymerCount,a,d,c,b,f));k&&(this.auxiliaryInfo.containsKey("dssr")&&null!=a)&&(n+=this.vwr.getAnnotationParser(!0).getHBonds(this.ms,
this.modelIndex,a,d));return n},"JU.Lst,~B,~B,~B,~N");e(b,"calculateStructures",function(a,d,c,b,f,e){if(0==this.bioPolymerCount||!b&&!a)return"";this.ms.proteinStructureTainted=this.structureTainted=!0;if(b)for(var k=this.bioPolymerCount;0<=--k;)(!a||null!=this.bioPolymers[k].monomers[0].getNitrogenAtom())&&this.bioPolymers[k].clearStructures();if(!a||f)for(k=this.bioPolymerCount;0<=--k;)x(this.bioPolymers[k],"JM.AlphaPolymer")&&this.bioPolymers[k].calculateStructures(f);return a?this.calculateDssx(null,
d,c,b,e):""},"~B,~B,~B,~B,~B,~N");e(b,"clearBioPolymers",function(){this.bioPolymers=Array(8);this.bioPolymerCount=0});h(b,"fixIndices",function(a,d,c){this.fixIndicesM(a,d,c);this.recalculateLeadMidpointsAndWingVectors()},"~N,~N,JU.BS");h(b,"freeze",function(){this.freezeM();this.bioPolymers=JU.AU.arrayCopyObject(this.bioPolymers,this.bioPolymerCount);return!0});e(b,"getBioBranches",function(a){for(var d,c=0;c<this.bioPolymerCount;c++)d=new JU.BS,this.bioPolymers[c].getRange(d,this.isMutated),0<=
d.nextSetBit(0)&&(null==a&&(a=new JU.Lst),a.addLast(d));return a},"JU.Lst");e(b,"getBioPolymerCount",function(){return this.bioPolymerCount});e(b,"getCachedAnnotationMap",function(a,d){var c=null==this.dssrCache&&null!=d?this.dssrCache=new java.util.Hashtable:this.dssrCache;if(null==c)return null;var b=c.get(a);null==b&&null!=d&&(b=x(d,"JS.SV")||x(d,"java.util.Hashtable")?d:this.vwr.parseJSONMap(d),c.put(a,b));return x(b,"JS.SV")||x(b,"java.util.Hashtable")?b:null},"~S,~O");e(b,"getConformation",
function(a,d,c,b){var f=0==a;if(0==this.altLocCount)f&&b.or(c);else{var e=0>=a,k=this.ms.at,n=-32==a,l=e&&!n?String.fromCharCode(-a):"\x00";if(e){a=-2147483648;for(var h="\x00",m=-2147483648,q=new java.util.Hashtable,e=c.nextSetBit(0);0<=e;e=c.nextSetBit(e+1)){var y=k[e],v=y.getChainID(),u=y.getResno(),r=y.getInsertionCode();if(u!=m||r!=h||v!=a)a=v,m=u,h=r,q.clear();u=y.getAtomName();v=q.get(u);null==v&&q.put(u,v=s(1,0));u=v[0]-1;0>u?-2==u?c.clear(e):n?"\x00"!=y.altloc&&c.clear(e):v[0]=e+1:(f?(c.clear(e),
v[0]=-1):y.altloc==l?v[0]=-1:u=e,c.clear(u))}}else{a--;f=null;n="\x00";l=a;h=new JU.BS;for(e=c.nextSetBit(0);0<=e;e=c.nextSetBit(e+1))y=k[e],m=y.altloc,"\x00"!=m&&(y.group!==f&&(f=y.group,n="\x00",l=a,h.clearAll()),0<=l&&(m!=n&&!h.get(m.charCodeAt(0)))&&(n=m,l--,h.set(m.charCodeAt(0))),(0<=l||m!=n)&&c.clear(e))}if(0<=c.nextSetBit(0)&&(b.or(c),d))for(d=this.bioPolymerCount;0<=--d;)this.bioPolymers[d].setConformation(c)}},"~N,~B,JU.BS,JU.BS");e(b,"getDefaultLargePDBRendering",function(a,d){var c=new JU.BS;
0==this.getBondCount()&&(c=this.bsAtoms);if(c!==this.bsAtoms)for(var b=0;b<this.bioPolymerCount;b++)this.bioPolymers[b].getRange(c,this.isMutated);if(!(0>c.nextSetBit(0))){var f=new JU.BS;if(c===this.bsAtoms)f=c;else for(b=0;b<this.bioPolymerCount;b++)0==this.bioPolymers[b].getType()&&this.bioPolymers[b].getRange(f,this.isMutated);0<=f.nextSetBit(0)&&a.append("select ").append(JU.Escape.eBS(f)).append(";backbone only;");this.act<=d||(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");e(b,"getFullPDBHeader",function(){if(0>this.modelIndex)return"";var a=this.auxiliaryInfo.get("fileHeader");return null!=a?a:this.ms.bioModelset.getBioExt().getFullPDBHeader(this.auxiliaryInfo)});e(b,"getPdbData",function(a,d,c,b,f,e,k,n){this.ms.bioModelset.getBioExt().getPdbDataM(this,this.vwr,a,d,c,b,f,e,k,n)},"~S,~S,~B,JU.BS,JU.OC,~A,JU.SB,JU.BS");
e(b,"getRasmolHydrogenBonds",function(a,d,c,b,f,e,k,n){var l=null==c;l&&(c=new JU.Lst);0>f&&(f=2147483647);var h;if(null==d&&0<this.bioPolymerCount)this.calculateDssx(c,!1,e,!1,n);else for(e=this.bioPolymerCount;0<=--e;)if(n=this.bioPolymers[e],0!=n.monomerCount){var m=n.getType(),q=!1;switch(m){case 1:if(b)continue;n.calcRasmolHydrogenBonds(null,a,d,c,f,null,!0,!1);break;case 2:q=n.monomers[0].isRna();break;default:continue}for(var y=this.bioPolymerCount;0<=--y;)null!=(h=this.bioPolymers[y])&&((q||
e!=y)&&m==h.getType())&&h.calcRasmolHydrogenBonds(n,a,d,c,f,null,!0,!1)}if(0!=c.size()&&l){this.hasRasmolHBonds=!0;for(e=0;e<c.size();e++)a=c.get(e),d=a.atom1,b=a.atom2,d.isBonded(b)||(a=this.ms.addHBond(d,b,a.order,a.getEnergy()),null!=k&&k.set(a))}},"JU.BS,JU.BS,JU.Lst,~B,~N,~B,JU.BS,~N");e(b,"getUnitID",function(a,d){var c=new JU.SB,b=a.group,f=16!=(d&16),e=8==(d&8)?b.getInsertionCode():"\x00",k="\x00"!=e;1==(d&1)&&null!=this.pdbID&&c.append(this.pdbID);c.append("|").appendO(this.ms.getInfo(this.modelIndex,
"modelNumber")).append("|").append(this.vwr.getChainIDStr(b.chain.chainID)).append("|").append(b.getGroup3()).append("|").appendI(b.getResno());4==(d&4)?(c.append("|").append(a.getAtomName()),"\x00"!=a.altloc?c.append("|").appendC(a.altloc):(f||k)&&c.append("|")):(f||k)&&c.append("||");k?c.append("|").appendC(e):f&&c.append("|");f&&c.append("|");return c.toString()},"JM.Atom,~N");e(b,"recalculateLeadMidpointsAndWingVectors",function(){for(var a=0;a<this.bioPolymerCount;a++)this.bioPolymers[a].recalculateLeadMidpointsAndWingVectors()});
e(b,"resetRasmolBonds",function(a,d){var c=new JU.BS;this.hasRasmolHBonds=!1;for(var b=this.ms.am,f=this.ms.bo,e=this.ms.bondCount;0<=--e;){var k=f[e];0!=(k.order&28672)&&b[k.atom1.mi].trajectoryBaseIndex==this.modelIndex&&c.set(e)}0<=c.nextSetBit(0)&&this.ms.deleteBonds(c,!1);this.getRasmolHydrogenBonds(a,a,null,!1,2147483647,!1,null,d)},"JU.BS,~N");e(b,"getAtomicDSSRData",function(a,d){this.auxiliaryInfo.containsKey("dssr")&&this.vwr.getAnnotationParser(!0).getAtomicDSSRData(this.ms,this.modelIndex,
a,d)},"~A,~S")});r("JM");t(["java.util.Hashtable","J.c.STR"],"JM.BioResolver","java.lang.Boolean $.Byte $.NullPointerException $.Short java.util.Arrays JU.AU $.BS $.Measure $.P3 $.P4 $.PT $.SB $.V3 JM.Group JM.AlphaMonomer $.AlphaPolymer $.AminoMonomer $.AminoPolymer $.BioModel $.BioModelSet $.CarbohydrateMonomer $.CarbohydratePolymer $.NucleicMonomer $.NucleicPolymer $.PhosphorusMonomer $.PhosphorusPolymer JU.BSUtil $.Logger JV.JC".split(" "),function(){var b=z(function(){this.bsAddedMask=this.ms=
this.ml=this.plane=this.vNorm=this.vAB=this.vwr=null;this.haveHsAlready=!1;this.hNames=this.htGroupBonds=this.htBondMap=this.bsAtomsForHs=this.bsAddedHydrogens=null;this.baseBondIndex=0;this.hasCONECT=!1;this.bsAssigned=null;w(this,arguments)},JM,"BioResolver",null,java.util.Comparator);A(b,function(){});e(b,"setLoader",function(a){this.ml=a;this.bsAddedMask=null;this.haveHsAlready=!1;null==a?this.hNames=this.htGroupBonds=this.htBondMap=this.bsAddedHydrogens=this.bsAtomsForHs=this.bsAssigned=this.ms=
null:(JM.Group.specialAtomNames=JM.BioResolver.specialAtomNames,this.ms=a.ms,this.vwr=a.ms.vwr,a.specialAtomIndexes=s(JM.BioResolver.ATOMID_MAX,0),this.hasCONECT=this.ms.getInfoM(JV.JC.getBoolName(3))===Boolean.TRUE);return this},"JM.ModelLoader");e(b,"setViewer",function(a){this.vwr=a;if(null==JM.Group.standardGroupList){var d=new JU.SB;for(a=1;42>a;a++)d.append(",[").append(JM.BioResolver.predefinedGroup3Names[a]).append("]");d.append(",[AHR],[ALL],[AMU],[ARA],[ARB],[BDF],[BDR],[BGC],[BMA],[FCA],[FCB],[FRU],[FUC],[FUL],[GAL],[GLA],[GLC],[GXL],[GUP],[LXC],[MAN],[RAM],[RIB],[RIP],[XYP],[XYS],[CBI],[CT3],[CTR],[CTT],[LAT],[MAB],[MAL],[MLR],[MTT],[SUC],[TRE],[GCU],[MTL],[NAG],[NDG],[RHA],[SOR],[SOL],[SOE],[XYL],[A2G],[LBT],[NGA],[SIA],[SLB],[AFL],[AGC],[GLB],[NAN],[RAA]");
JM.BioResolver.group3Count=G(d.length()/6);JM.Group.standardGroupList=d.toString();a=0;for(d=JM.BioResolver.predefinedGroup3Names.length;a<d;++a)JM.BioResolver.addGroup3Name(JM.BioResolver.predefinedGroup3Names[a].trim())}return this},"JV.Viewer");e(b,"getBioModel",function(a,d,c,b,f){return new JM.BioModel(this.ms,a,d,c,b,f)},"~N,~N,~S,java.util.Properties,java.util.Map");e(b,"distinguishAndPropagateGroup",function(a,d,c,b,f,e,k){for(var n=0,l=JM.BioResolver.ATOMID_MAX;0<=--l;)e[l]=-2147483648;for(l=
f;l>=b;--l){var h=k[l].atomID;0>=h||(14>h&&(n|=1<<h),e[h]=l)}l=null;14==(n&14)?l=JM.AminoMonomer.validateAndAllocate(a,d,c,b,f,e,k):4==n?l=JM.AlphaMonomer.validateAndAllocateA(a,d,c,b,f,e):8128==(n&8128)?l=JM.NucleicMonomer.validateAndAllocate(a,d,c,b,f,e):8192==n?l=JM.PhosphorusMonomer.validateAndAllocateP(a,d,c,b,f,e):JM.BioResolver.checkCarbohydrate(d)&&(l=JM.CarbohydrateMonomer.validateAndAllocate(a,d,c,b,f));return null!=l&&0<=l.leadAtomIndex?l:null},"JM.Chain,~S,~N,~N,~N,~A,~A");e(b,"setHaveHsAlready",
function(a){this.haveHsAlready=a},"~B");e(b,"initializeHydrogenAddition",function(){this.baseBondIndex=this.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.vNorm=new JU.V3;this.plane=new JU.P4});e(b,"addImplicitHydrogenAtoms",function(a,d,c){var b=this.ml.getGroup3(d),f;if(!(this.haveHsAlready&&this.hasCONECT||null==b||0==(f=JM.BioResolver.getStandardPdbHydrogenCount(b)))){c=
0>f?-1:f+c;f=null;d=this.ml.getFirstAtomIndex(d);var e=this.ms.ac;if(0>c){if(1==e-d)return;f=this.vwr.getLigandModel(b,"ligand_","_data",null);if(null==f)return;c=a.getHydrogenAtomCount(f);if(1>c)return}this.getBondInfo(a,b,f);this.ms.am[this.ms.at[d].mi].isPdbWithMultipleBonds=!0;if(!this.haveHsAlready){this.bsAtomsForHs.setBits(d,e);this.bsAddedHydrogens.setBits(e,e+c);a=this.ms.at[d].isHetero();b=JU.P3.new3(NaN,NaN,NaN);d=this.ms.at[d];for(f=0;f<c;f++)this.ms.addAtom(d.mi,d.group,1,"H",null,0,
d.getSeqID(),0,b,NaN,null,0,0,1,0,null,a,0,null,NaN).$delete(null)}}},"J.api.JmolAdapter,~N,~N");e(b,"getBondInfo",function(a,d,c){if(null==this.htGroupBonds.get(d)&&(a=null==c?this.getPdbBondInfo(d,this.vwr.getBoolean(603979873)):this.getLigandBondInfo(a,c,d),null!=a)){this.htGroupBonds.put(d,Boolean.TRUE);for(c=0;c<a.length;c++)null!=a[c]&&("H"==a[c][1].charAt(0)?this.htBondMap.put(d+"."+a[c][0],a[c][1]):this.htBondMap.put(d+":"+a[c][0]+":"+a[c][1],a[c][2]))}},"J.api.JmolAdapter,~S,~O");e(b,"getLigandBondInfo",
function(a,d,c){var b=a.getBondList(d),f=new java.util.Hashtable;for(a=a.getAtomIterator(d);a.hasNext();)f.put(a.getAtomName(),a.getXYZ());a=Array(2*b.length);for(var e=d=0;e<b.length;e++){var k=b[e];"H"!=k[0].charAt(0)&&(a[d++]=F(-1,[k[0],k[1],k[2],k[1].startsWith("H")?"0":"1"]));"H"!=k[1].charAt(0)&&(a[d++]=F(-1,[k[1],k[0],k[2],k[0].startsWith("H")?"0":"1"]))}java.util.Arrays.sort(a,this);for(var n,e=0;e<d;){n=a[e];for(var b=n[0],l=k=0;e<d&&(n=a[e])[0].equals(b);e++)n[3].equals("0")?k++:n[3].equals("1")&&
l++;b=e-k-l;if(1!=k)switch(l){case 1:for(var l=2==k?"@":"|",h=1;h<k;h++)a[b][1]+=l+a[b+h][1],a[b+h]=null;continue;case 2:if(2!=k)continue;var l=a[b][0],h=a[b+k][1],k=a[b+k+1][1],m=h.compareTo(k);JU.Measure.getPlaneThroughPoints(f.get(h),f.get(l),f.get(k),this.vNorm,this.vAB,this.plane);k=JU.Measure.distanceToPlane(this.plane,f.get(a[b][1]))*m;a[b][1]=0<k?a[b][1]+"@"+a[b+1][1]:a[b+1][1]+"@"+a[b][1];a[b+1]=null}}for(e=0;e<d;e++)null!=(n=a[e])&&"H"!=n[1].charAt(0)&&0<n[0].compareTo(n[1])?a[e]=null:null!=
n&&JU.Logger.info(" ligand "+c+": "+a[e][0]+" - "+a[e][1]+" order "+a[e][2]);return a},"J.api.JmolAdapter,~O,~S");h(b,"compare",function(a,d){return null==d?null==a?0:-1:null==a?1:0>a[0].compareTo(d[0])?-1:0<a[0].compareTo(d[0])?1:0>a[3].compareTo(d[3])?-1:0<a[3].compareTo(d[3])?1:0>a[1].compareTo(d[1])?-1:0<a[1].compareTo(d[1])?1:0},"~A,~A");e(b,"finalizeHydrogens",function(){this.vwr.getLigandModel(null,null,null,null);this.finalizePdbMultipleBonds();this.addHydrogens()});e(b,"addHydrogens",function(){if(!(0>
this.bsAddedHydrogens.nextSetBit(0))){this.bsAddedMask=JU.BSUtil.copy(this.bsAddedHydrogens);this.finalizePdbCharges();for(var a=s(1,0),a=this.ms.calculateHydrogens(this.bsAtomsForHs,a,null,256),d=null,c=0,b,f=0;f<a.length;f++)if(!(null==a[f]||null==(b=this.ms.at[f]))){var e=b.group;if(e!==d){d=e;for(c=e.lastAtomIndex;this.bsAddedHydrogens.get(c);)c--}var k=b.getGroup3(!1),h=b.getAtomName(),l=this.htBondMap.get(k+"."+h);if(null!=l){var p=l.contains("@"),m=l.endsWith("?")||0<=l.indexOf("|"),q=a[f].length;
3==q&&(!m&&l.equals("H@H2"))&&(l="H|H2|H3",m=!0,p=!1);if(p&&3==q||m!=(3==q))JU.Logger.info("Error adding H atoms to "+k+e.getResno()+": "+a[f].length+" atoms should not be added to "+h);else switch(h=l.indexOf("@"),a[f].length){case 1:0<h&&(l=l.substring(0,h));this.setHydrogen(f,++c,l,a[f][0]);break;case 2:p=-1;m=b.bonds;if(null!=m)switch(m.length){case 2:p=m[0].getOtherAtom(b),m=m[1].getOtherAtom(b),q=p.getAtomName().compareTo(m.getAtomName()),p=JU.Measure.distanceToPlane(JU.Measure.getPlaneThroughPoints(p,
b,m,this.vNorm,this.vAB,this.plane),a[f][0])*q}0>h?(JU.Logger.info("Error adding H atoms to "+k+e.getResno()+": expected to only need 1 H but needed 2"),e=k="H"):0>p?(k=l.substring(0,h),e=l.substring(h+1)):(e=l.substring(0,h),k=l.substring(h+1));this.setHydrogen(f,++c,e,a[f][0]);this.setHydrogen(f,++c,k,a[f][1]);break;case 3:e=l.indexOf("|"),0<=e?(k=l.lastIndexOf("|"),this.hNames[0]=l.substring(0,e),this.hNames[1]=l.substring(e+1,k),this.hNames[2]=l.substring(k+1)):(this.hNames[0]=l.$replace("?",
"1"),this.hNames[1]=l.$replace("?","2"),this.hNames[2]=l.$replace("?","3")),this.setHydrogen(f,++c,this.hNames[0],a[f][0]),this.setHydrogen(f,++c,this.hNames[1],a[f][2]),this.setHydrogen(f,++c,this.hNames[2],a[f][1])}}}this.deleteUnneededAtoms();this.ms.fixFormalCharges(JU.BSUtil.newBitSet2(this.ml.baseAtomIndex,this.ml.ms.ac))}});e(b,"deleteUnneededAtoms",function(){for(var a=new JU.BS,d=this.bsAtomsForHs.nextSetBit(0);0<=d;d=this.bsAtomsForHs.nextSetBit(d+1)){var c=this.ms.at[d];if(c.isHetero()&&
!(8!=c.getElementNumber()||0!=c.getFormalCharge()||2!=c.getCovalentBondCount())){var b=c.bonds,e=b[0].getOtherAtom(c),c=b[1].getOtherAtom(c);1==e.getElementNumber()&&(b=e,e=c,c=b);if(1==c.getElementNumber())for(var b=e.bonds,j=0;j<b.length;j++)if(2==b[j].order&&8==b[j].getOtherAtom(e).getElementNumber()){this.bsAddedHydrogens.set(c.i);c.$delete(a);break}}}this.ms.deleteBonds(a,!0);this.deleteAtoms(this.bsAddedHydrogens)});e(b,"deleteAtoms",function(a){for(var d=s(this.ms.ac,0),c=s(this.ms.ac-a.cardinality(),
0),b=this.ml.baseAtomIndex,e=this.ms.am,j=this.ms.at,k=this.ml.baseAtomIndex;k<this.ms.ac;k++){var h=j[k];null!=h&&(e[h.mi].bsAtoms.clear(k),e[h.mi].bsAtomsDeleted.clear(k),a.get(k)?(d[k]=b-1,e[j[k].mi].act--):(c[b]=k,d[k]=b++))}this.ms.msInfo.put("bsDeletedAtoms",a);for(k=this.ml.baseGroupIndex;k<this.ml.groups.length;k++)e=this.ml.groups[k],e.firstAtomIndex>=this.ml.baseAtomIndex&&(e.firstAtomIndex=d[e.firstAtomIndex],e.lastAtomIndex=d[e.lastAtomIndex],0<=e.leadAtomIndex&&(e.leadAtomIndex=d[e.leadAtomIndex]));
this.ms.adjustAtomArrays(c,this.ml.baseAtomIndex,b);this.ms.calcBoundBoxDimensions(null,1);this.ms.resetMolecules();this.ms.validateBspf(!1);this.bsAddedMask=JU.BSUtil.deleteBits(this.bsAddedMask,a);for(k=this.ml.baseModelIndex;k<this.ms.mc;k++)this.fixAnnotations(k,"domains",1073741925),this.fixAnnotations(k,"validation",1073742189)},"JU.BS");e(b,"fixAnnotations",function(a,d,c){var b=this.ml.ms.getInfo(a,d);null!=b&&(d=this.ms.am[a].getCachedAnnotationMap(d,b),null!=d&&this.vwr.getAnnotationParser(!1).fixAtoms(a,
d,this.bsAddedMask,c,20))},"~N,~S,~N");e(b,"finalizePdbCharges",function(){for(var a=this.ms.at,d=this.bsAtomsForHs.nextSetBit(0);0<=d;d=this.bsAtomsForHs.nextSetBit(d+1)){var c=a[d];c.group.getNitrogenAtom()===c&&1==c.getCovalentBondCount()&&c.setFormalCharge(1);if(0>(d=this.bsAtomsForHs.nextClearBit(d+1)))break}});e(b,"finalizePdbMultipleBonds",function(){for(var a=new java.util.Hashtable,d=this.ms.bondCount,c=this.ms.bo,b=this.baseBondIndex;b<d;b++){var e=c[b].atom1,j=c[b].atom2,k=e.group;if(k===
j.group){var h=(new JU.SB).append(k.getGroup3());h.append(":");e=e.getAtomName();j=j.getAtomName();0<e.compareTo(j)?h.append(j).append(":").append(e):h.append(e).append(":").append(j);j=h.toString();e=this.htBondMap.get(j);null!=e&&(a.put(j,Boolean.TRUE),c[b].setOrder(JU.PT.parseInt(e)))}}for(b=this.htBondMap.keySet().iterator();b.hasNext()&&((h=b.next())||1);)if(null==a.get(h))if(0>h.indexOf(":"))a.put(h,Boolean.TRUE);else{var l=this.htBondMap.get(h);JU.Logger.info("bond "+h+" was not used; order="+
l);this.htBondMap.get(h).equals("1")&&a.put(h,Boolean.TRUE)}k=new java.util.Hashtable;for(b=this.htBondMap.keySet().iterator();b.hasNext()&&((h=b.next())||1);)null==a.get(h)&&k.put(h.substring(0,h.lastIndexOf(":")),this.htBondMap.get(h));if(!k.isEmpty())for(b=0;b<d;b++)if(e=c[b].atom1,j=c[b].atom2,e.group!==j.group&&!(null==(l=k.get(e.getGroup3(!1)+":"+e.getAtomName()))&&null==(l=k.get(j.getGroup3(!1)+":"+j.getAtomName()))))c[b].setOrder(JU.PT.parseInt(l)),JU.Logger.info("assigning order "+c[b].order+
" to bond "+c[b])});e(b,"setHydrogen",function(a,d,c,b){if(this.bsAddedHydrogens.get(d)){var e=this.ms.at;this.bsAddedHydrogens.clear(d);this.ms.setAtomName(d,c,!1);e[d].setT(b);e[d].atomSymmetry=e[a].atomSymmetry;this.ml.undeleteAtom(d);this.ms.bondAtoms(e[a],e[d],1,this.ms.getDefaultMadFromOrder(1),null,0,!0,!1)}},"~N,~N,~S,JU.P3");e(b,"fixPropertyValue",function(a,d,c){for(var b=this.ms.at,e=K(a.cardinality(),0),j=0,k=0,h=0,l=a.nextSetBit(0);0<=l;l=a.nextSetBit(l+1),h++){if(1==b[l].getElementNumber()){if(!c)continue}else j=
d[k++];e[h]=j}return e},"JU.BS,~O,~B");b.allocateBioPolymer=e(b,"allocateBioPolymer",function(a,d,c,b){for(var e=null,j=0,k=d;k<a.length;++k){var h=a[k],l;if(!x(h,"JM.Monomer")||null!=(l=h).bioPolymer||null!=e&&e.getClass()!==l.getClass()||c&&!l.isConnectedAfter(e))break;e=l;j++}if(2>j)return null;c=Array(j);for(k=0;k<j;++k)c[k]=a[d+k];if(x(e,"JM.AminoMonomer"))return new JM.AminoPolymer(c,b);if(x(e,"JM.AlphaMonomer"))return new JM.AlphaPolymer(c,b);if(x(e,"JM.NucleicMonomer"))return new JM.NucleicPolymer(c);
if(x(e,"JM.PhosphorusMonomer"))return new JM.PhosphorusPolymer(c);if(x(e,"JM.CarbohydrateMonomer"))return new JM.CarbohydratePolymer(c);JU.Logger.error("Polymer.allocatePolymer() ... no matching polymer for monomor "+e);throw new NullPointerException;},"~A,~N,~B,~N");e(b,"iterateOverAllNewStructures",function(a,d){var c=a.getStructureIterator(d);if(null!=c){var b=c.getStructuredModels();if(null!=b)for(var e=b.nextSetBit(0);0<=e;e=b.nextSetBit(e+1))this.ml.structuresDefinedInFile.set(this.ml.baseModelIndex+
e);for(;c.hasNext();)c.getStructureType()!==J.c.STR.TURN&&this.setStructure(c);for(c=a.getStructureIterator(d);c.hasNext();)c.getStructureType()===J.c.STR.TURN&&this.setStructure(c)}},"J.api.JmolAdapter,~O");e(b,"setStructure",function(a){var d=a.getSubstructureType(),c=a.getStructureID(),b=a.getSerialID(),e=a.getStrandCount(),j=a.getAtomIndices(),k=a.getModelIndices(),h=a.getBSAll(),l,p=this.ms.am;this.ml.isTrajectory?l=k=k[0]:(l=k[0]+this.ml.baseModelIndex,k=k[1]+this.ml.baseModelIndex);this.ml.structuresDefinedInFile.setBits(l,
k+1);var m;if(null!=h){a=l;for(var q;a<=k;a++)if(x(l=p[a],"JM.BioModel"))for(c=0;5>c;c++)null!=(m=h[q=JM.BioResolver.mytypes[c]])&&!m.isEmpty()&&l.addStructureByBS(0,q,JM.BioResolver.types[c],m)}else{var h=a.getStartChainID(),y=a.getStartSequenceNumber(),v=a.getStartInsertionCode();q=a.getEndSequenceNumber();m=a.getEndChainID();a=a.getEndInsertionCode();d=d===J.c.STR.NOT?J.c.STR.NONE:d;y=JM.Group.getSeqcodeFor(y,v);q=JM.Group.getSeqcodeFor(q,a);null==this.bsAssigned&&(this.bsAssigned=new JU.BS);a=
l;for(v=0;a<=k;a++)if(x(l=p[a],"JM.BioModel"))l.addSecondaryStructure(d,c,b,e,h,y,m,q,(v=l.firstAtomIndex)+j[0],v+j[1],this.bsAssigned)}},"J.api.JmolAdapterStructureIterator");e(b,"setGroupLists",function(a){this.ml.group3Lists[a+1]=JM.Group.standardGroupList;this.ml.group3Counts[a+1]=s(JM.BioResolver.group3Count+10,0);null==this.ml.group3Lists[0]&&(this.ml.group3Lists[0]=JM.Group.standardGroupList,this.ml.group3Counts[0]=s(JM.BioResolver.group3Count+10,0))},"~N");e(b,"isKnownPDBGroup",function(a,
d){var c=JM.BioResolver.knownGroupID(a);return 0<c?c<d:2147483647==d&&JM.BioResolver.checkCarbohydrate(a)},"~S,~N");e(b,"lookupSpecialAtomID",function(a){if(null==JM.BioResolver.htSpecialAtoms){JM.BioResolver.htSpecialAtoms=new java.util.Hashtable;for(var d=JM.BioResolver.specialAtomNames.length;0<=--d;){var c=JM.BioResolver.specialAtomNames[d];null!=c&&JM.BioResolver.htSpecialAtoms.put(c,Byte.$valueOf(d))}}a=JM.BioResolver.htSpecialAtoms.get(a);return null==a?0:a.byteValue()},"~S");e(b,"getPdbBondInfo",
function(a,d){null==JM.BioResolver.htPdbBondInfo&&(JM.BioResolver.htPdbBondInfo=new java.util.Hashtable);var c=JM.BioResolver.htPdbBondInfo.get(a);if(null!=c)return c;c=JM.BioResolver.knownGroupID(a);if(0>c||c>JM.BioResolver.pdbBondInfo.length)return null;var b=JM.BioResolver.pdbBondInfo[c];if(d&&0<=(c=b.indexOf("O3'")))b=b.substring(0,c);for(var e=JU.PT.getTokens(b),c=Array(G(e.length/2)),j=0,k=0;j<c.length;j++){var h=e[k++],l=e[k++];if(1==l.length)switch(l.charAt(0).charCodeAt(0)){case 78:l="H@H2";
break;case 66:l="HB3@HB2";break;case 68:l="HD3@HD2";break;case 71:l="HG3@HG2";break;case 50:l="H2'@H2''";break;case 53:l="H5''@H5'"}"H"!=l.charAt(0)&&0<h.compareTo(l)&&(b=l,l=h,h=b);c[j]=F(-1,[h,l,l.startsWith("H")?"1":"2"])}JM.BioResolver.htPdbBondInfo.put(a,c);return c},"~S,~B");b.knownGroupID=e(b,"knownGroupID",function(a){if(null==a||0==a.length)return 0;a=JM.BioResolver.htGroup.get(a);return null==a?-1:a.shortValue()},"~S");b.checkCarbohydrate=e(b,"checkCarbohydrate",function(a){return null!=
a&&0<=",[AHR],[ALL],[AMU],[ARA],[ARB],[BDF],[BDR],[BGC],[BMA],[FCA],[FCB],[FRU],[FUC],[FUL],[GAL],[GLA],[GLC],[GXL],[GUP],[LXC],[MAN],[RAM],[RIB],[RIP],[XYP],[XYS],[CBI],[CT3],[CTR],[CTT],[LAT],[MAB],[MAL],[MLR],[MTT],[SUC],[TRE],[GCU],[MTL],[NAG],[NDG],[RHA],[SOR],[SOL],[SOE],[XYL],[A2G],[LBT],[NGA],[SIA],[SLB],[AFL],[AGC],[GLB],[NAN],[RAA]".indexOf("["+a.toUpperCase()+"]")},"~S");e(b,"isHetero",function(a){switch(a.length){case 1:a+="  ";break;case 2:a+=" ";break;case 3:break;default:return!0}a=
JM.Group.standardGroupList.indexOf(a);return 0>a||42<=G(a/6)+1},"~S");e(b,"toStdAmino3",function(a){if(0==a.length)return"";var d=new JU.SB,c=JM.BioResolver.knownGroupID("==A");if(0>c)for(var b=1;20>=b;b++)c=JM.BioResolver.knownGroupID(JM.BioResolver.predefinedGroup3Names[b]),JM.BioResolver.htGroup.put("=="+JM.BioResolver.predefinedGroup1Names[b],Short.$valueOf(c));for(var b=0,e=a.length;b<e;b++)c=a.charAt(b),c=JM.BioResolver.knownGroupID("=="+c),0>c&&(c=23),d.append(" ").append(JM.BioResolver.predefinedGroup3Names[c]);
return d.toString().substring(1)},"~S");e(b,"getGroupID",function(a){return JM.BioResolver.getGroupIdFor(a)},"~S");b.getGroupIdFor=e(b,"getGroupIdFor",function(a){null!=a&&(a=a.trim());var d=JM.BioResolver.knownGroupID(a);return-1==d?JM.BioResolver.addGroup3Name(a):d},"~S");b.addGroup3Name=e(b,"addGroup3Name",function(a){JM.BioResolver.group3NameCount==JM.Group.group3Names.length&&(JM.Group.group3Names=JU.AU.doubleLengthS(JM.Group.group3Names));var d=JM.BioResolver.group3NameCount++;JM.Group.group3Names[d]=
a;JM.BioResolver.htGroup.put(a,Short.$valueOf(d));return d},"~S");b.getStandardPdbHydrogenCount=e(b,"getStandardPdbHydrogenCount",function(a){a=JM.BioResolver.knownGroupID(a);return 0>a||a>=JM.BioResolver.pdbHydrogenCount.length?-1:JM.BioResolver.pdbHydrogenCount[a]},"~S");b.getSpecialAtomName=e(b,"getSpecialAtomName",function(a){return JM.BioResolver.specialAtomNames[a]},"~N");e(b,"getArgbs",function(a){switch(a){case 2097166:return JM.BioResolver.argbsNucleic;case 2097154:return JM.BioResolver.argbsAmino;
case 1073742144:return JM.BioResolver.argbsShapely;case 1153433601:return JM.BioResolver.argbsChainAtom;case 1612709894:return JM.BioResolver.argbsChainHetero}return null},"~N");e(b,"getBioModelSet",function(a){null==a.bioModelset&&(a.bioModelset=(new JM.BioModelSet).set(this.vwr,a));return a.bioModelset},"JM.ModelSet");b.htGroup=b.prototype.htGroup=new java.util.Hashtable;b.types=b.prototype.types=F(-1,[J.c.STR.HELIXPI,J.c.STR.HELIXALPHA,J.c.STR.SHEET,J.c.STR.HELIX310,J.c.STR.TURN]);I(b,"mytypes",
s(-1,[0,2,3,4,6]),"htPdbBondInfo",null,"pdbBondInfo",F(-1,";N N CA HA C O CB HB?;N N CA HA C O CB B CG G CD D NE HE CZ NH1 NH1 HH11@HH12 NH2 HH22@HH21;N N CA HA C O CB B CG OD1 ND2 HD21@HD22;N N CA HA C O CB B CG OD1;N N CA HA C O CB B SG HG;N N CA HA C O CB B CG G CD OE1 NE2 HE22@HE21;N N CA HA C O CB B CG G CD OE1;N N CA HA2@HA3 C O;N N CA HA C O CB B CG CD2 ND1 CE1 ND1 HD1 CD2 HD2 CE1 HE1 NE2 HE2;N N CA HA C O CB HB CG1 HG13@HG12 CG2 HG2? CD1 HD1?;N N CA HA C O CB B CG HG CD1 HD1? CD2 HD2?;N N CA HA C O CB B CG G CD HD2@HD3 CE HE3@HE2 NZ HZ?;N N CA HA C O CB B CG G CE HE?;N N CA HA C O CB B CG CD1 CD1 HD1 CD2 CE2 CD2 HD2 CE1 CZ CE1 HE1 CE2 HE2 CZ HZ;N H CA HA C O CB B CG G CD D;N N CA HA C O CB B OG HG;N N CA HA C O CB HB OG1 HG1 CG2 HG2?;N N CA HA C O CB B CG CD1 CD1 HD1 CD2 CE2 NE1 HE1 CE3 CZ3 CE3 HE3 CZ2 CH2 CZ2 HZ2 CZ3 HZ3 CH2 HH2;N N CA HA C O CB B CG CD1 CD1 HD1 CD2 CE2 CD2 HD2 CE1 CZ CE1 HE1 CE2 HE2 OH HH;N N CA HA C O CB HB CG1 HG1? CG2 HG2?;N N CA HA C O CB B;N N CA HA C O CB B CG G;;P OP1 C5' 5 C4' H4' C3' H3' C2' H2' O2' HO2' C1' H1' C8 N7 C8 H8 C5 C4 C6 O6 N1 H1 C2 N3 N2 H22@H21 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' H2' O2' HO2' C1' H1' C2 O2 N3 C4 N4 H41@H42 C5 C6 C5 H5 C6 H6 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' H2' O2' HO2' C1' H1' C8 N7 C8 H8 C5 C4 C6 N1 N6 H61@H62 C2 N3 C2 H2 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' 2 C1' H1' C2 O2 N3 H3 C4 O4 C5 C6 C7 H7? C6 H6 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' H2' O2' HO2' C1' H1' C2 O2 N3 H3 C4 O4 C5 C6 C5 H5 C6 H6 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' H2' O2' HO2' C1' H1' C8 N7 C8 H8 C5 C4 C6 O6 N1 H1 C2 N3 C2 H2 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' 2 C1' H1' C8 N7 C8 H8 C5 C4 C6 O6 N1 H1 C2 N3 N2 H22@H21 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' 2 C1' H1' C2 O2 N3 C4 N4 H41@H42 C5 C6 C5 H5 C6 H6 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' 2 C1' H1' C8 N7 C8 H8 C5 C4 C6 N1 N6 H61@H62 C2 N3 C2 H2 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' 2 C1' H1' C2 O2 N3 H3 C4 O4 C5 C6 C7 H7? C6 H6 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' 2 C1' H1' C2 O2 N3 H3 C4 O4 C5 C6 C5 H5 C6 H6 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' 2 C1' H1' C8 N7 C8 H8 C5 C4 C6 O6 N1 H1 C2 N3 C2 H2 O3' HO3' O5' HO5'".split(";")),
"pdbHydrogenCount",s(-1,[0,6,16,7,6,6,9,8,4,9,12,12,14,10,10,8,6,8,11,10,10,3,5,0,13,13,13,-1,12,12,13,13,13,14,12,12]),"group3Count",0,"predefinedGroup1Names",P(-1,"\x00ARNDCQEGHILKMFPSTWYVAG?GCATUIGCATUIGCATUI".split("")),"group3NameCount",0,"predefinedGroup3Names",F(-1,"   ;ALA;ARG;ASN;ASP;CYS;GLN;GLU;GLY;HIS;ILE;LEU;LYS;MET;PHE;PRO;SER;THR;TRP;TYR;VAL;ASX;GLX;UNK;G  ;C  ;A  ;T  ;U  ;I  ;DG ;DC ;DA ;DT ;DU ;DI ;+G ;+C ;+A ;+T ;+U ;+I ;HOH;DOD;WAT;UREA;PO4;SO4;UNL".split(";")),"specialAtomNames",
F(-1,[null,"N","CA","C","O","O1","O5'","C5'","C4'","C3'","O3'","C2'","C1'","P","OD1","OD2","OE1","OE2","SG",null,null,null,null,null,null,null,null,null,null,null,null,null,"N1","C2","N3","C4","C5","C6","O2","N7","C8","N9","N4","N2","N6","C5M","O6","O4","S4","C7","H1","H2","H3",null,null,null,null,null,null,null,null,null,null,null,"OXT","H","1H","2H","3H","HA","1HA","2HA","H5T","O5T","O1P","OP1","O2P","OP2","O4'","O2'","1H5'","2H5'","H4'","H3'","1H2'","2H2'","2HO'","H1'","H3T","HO3'","HO5'","HA2",
"HA3","HA2","H5'","H5''","H2'","H2''","HO2'","O3P","OP3"]));b.ATOMID_MAX=b.prototype.ATOMID_MAX=JM.BioResolver.specialAtomNames.length;I(b,"htSpecialAtoms",null,"argbsAmino",s(-1,[4290682990,4291348680,4279524095,4278246620,4293265930,4293322240,4278246620,4293265930,4293651435,4286743250,4279206415,4279206415,4279524095,4293322240,4281479850,4292646530,4294612480,4294612480,4290009780,4281479850,4279206415,4294928820,4294928820,4290682990]),"argbsNucleic",s(-1,[4290682990,4288716960,4279206415,4293322240,
4293265930,4279524095,4278246620,4278246620,4279206415,4293322240,4293265930,4279524095,4278246620,4278246620,4279206415,4293322240,4293265930,4279524095,4278246620,4278246620]),"argbsChainAtom",s(-1,[4294967295,4290826495,4289789872,4294951112,4294967168,4294951167,4289786096,4294955120,4293951616,4294303411,4278239231,4291648604,4284927402,4288335154,4293821166,4278243025,4278255487,4282168177,4278190219,4290623339,4278215680,4286578688,4286611456,4286578816,4278222976,4290283019,4289864226]),"argbsChainHetero",
s(-1,[4294967295,-7298865,-8335464,-3174224,-3158160,-3174193,-8339264,-3170208,-4173712,-3821949,-16734257,-4895668,-11094638,-7686870,-4296002,-16730463,-16724113,-13329567,-16777029,-5922981,-16739328,-5242880,-5197824,-5242704,-16731984,-1526253,-4050382]),"argbsShapely",s(-1,[4294902015,4278190204,4294933616,4287430540,4288675906,4294967152,4294921292,4284874752,4294967295,4285559039,4278209536,4282736197,4282861496,4283649106,4290289730,4283585106,4294930498,4290268160,4283385344,4287393868,
4294937855,4294902015,4294902015,4294902015,4294930544,4294937675,4288717055,4288741280,4294934656,4286644223,4294930544,4294937675,4288717055,4288741280,4294934656,4286644223,4294930544,4294937675,4288717055,4288741280,4294934656,4286644223]))});r("JM");t(["JM.Monomer"],"JM.CarbohydrateMonomer",["J.c.STR"],function(){var b=B(JM,"CarbohydrateMonomer",JM.Monomer);M(b,function(){});b.validateAndAllocate=e(b,"validateAndAllocate",function(a,d,c,b,e){return(new JM.CarbohydrateMonomer).set2(a,d,c,b,e,
JM.CarbohydrateMonomer.alphaOffsets)},"JM.Chain,~S,~N,~N,~N");h(b,"isCarbohydrate",function(){return!0});h(b,"getProteinStructureType",function(){return J.c.STR.CARBOHYDRATE});h(b,"isConnectedAfter",function(a){if(null==a)return!0;for(var d=this.firstAtomIndex;d<=this.lastAtomIndex;d++)for(var c=a.firstAtomIndex;c<=a.lastAtomIndex;c++){var b=this.chain.model.ms.at[d],e=this.chain.model.ms.at[c];if(null!=b&&null!=e&&14==b.getElementNumber()+e.getElementNumber()&&3.24>b.distanceSquared(e))return!0}return!1},
"JM.Monomer");h(b,"findNearestAtomIndex",function(a,d,c,b){var e=c[0],j=this.getLeadAtom();b=G(b/2);1200>b&&(b=1200);0!=j.sZ&&(b=D(this.scaleToScreen(j.sZ,b)),4>b&&(b=4),this.isCursorOnTopOf(j,a,d,b,e)&&(c[0]=j))},"~N,~N,~A,~N,~N");h(b,"isConnectedPrevious",function(){if(0>=this.monomerIndex)return!1;for(var a=this.firstAtomIndex;a<=this.lastAtomIndex;a++)if(this.getCrossLinkGroup(a,null,null,!0,!1,!1))return!0;return!1});I(b,"alphaOffsets",H(-1,[0]))});r("JM");t(["JM.BioPolymer"],"JM.CarbohydratePolymer",
null,function(){var b=B(JM,"CarbohydratePolymer",JM.BioPolymer);A(b,function(a){L(this,JM.CarbohydratePolymer,[]);this.set(a);this.type=3},"~A")});r("JM");t(["JM.Monomer"],"JM.PhosphorusMonomer",["JU.Quat","$.V3","J.c.STR"],function(){var b=B(JM,"PhosphorusMonomer",JM.Monomer);h(b,"isNucleic",function(){return!0});M(b,function(){});b.validateAndAllocateP=e(b,"validateAndAllocateP",function(a,d,c,b,e,j){return b!=e||j[13]!=b?null:(new JM.PhosphorusMonomer).set2(a,d,c,b,e,JM.PhosphorusMonomer.phosphorusOffsets)},
"JM.Chain,~S,~N,~N,~N,~A");h(b,"isDna",function(){return this.isDnaByID()});h(b,"isRna",function(){return this.isRnaByID()});h(b,"isPurine",function(){return this.isPurineByID()});h(b,"isPyrimidine",function(){return this.isPyrimidineByID()});h(b,"getStructure",function(){return this.chain});h(b,"getProteinStructureType",function(){return J.c.STR.NONE});h(b,"isConnectedAfter",function(a){return this.isCA2(a)},"JM.Monomer");e(b,"isCA2",function(a){return null==a?!0:this.getLeadAtom().distance(a.getLeadAtom())<=
JM.PhosphorusMonomer.MAX_ADJACENT_PHOSPHORUS_DISTANCE},"JM.Monomer");h(b,"getQuaternion",function(){return this.getQuaternionP()},"~S");e(b,"getQuaternionP",function(){var a=this.monomerIndex;if(0>=a||a>=this.bioPolymer.monomerCount-1)return null;var d=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==d||null==c||null==a)return null;var b=new JU.V3,e=new JU.V3;b.sub2(c,
d);e.sub2(a,d);return JU.Quat.getQuaternionFrameV(b,e,null,!1)});h(b,"getQuaternionFrameCenter",function(){return this.getAtomFromOffsetIndex(0)},"~S");h(b,"getHelixData",function(a,d,c){return this.getHelixData2(a,d,c)},"~N,~S,~N");I(b,"phosphorusOffsets",H(-1,[0]),"MAX_ADJACENT_PHOSPHORUS_DISTANCE",8)});r("JM");E=z(function(){this.g2=this.g1=this.info=null;w(this,arguments)},JM,"BasePair");A(E,function(){});E.add=e(E,"add",function(b,a,d){if(null==a||null==d)return null;var c=new JM.BasePair;c.info=
b;(c.g1=a).addBasePair(c);(c.g2=d).addBasePair(c);return c},"java.util.Map,JM.NucleicMonomer,JM.NucleicMonomer");e(E,"getPartnerAtom",function(b){return(b===this.g1?this.g2:this.g1).getLeadAtom().i},"JM.NucleicMonomer");e(E,"toString",function(){return this.info.toString()});r("JM");t(["JM.PhosphorusMonomer"],"JM.NucleicMonomer","java.lang.Character JU.A4 $.Lst $.M3 $.P3 $.Quat $.V3 J.c.STR JM.Group JM.NucleicPolymer".split(" "),function(){var b=z(function(){this.hasRnaO2Prime=this.$isPyrimidine=
this.$isPurine=!1;this.dssrBox=this.bps=this.baseCenter=null;this.dssrBoxHeight=0;this.dssrFrame=null;w(this,arguments)},JM,"NucleicMonomer",JM.PhosphorusMonomer);M(b,function(){});b.validateAndAllocate=e(b,"validateAndAllocate",function(a,d,c,b,e,j){var k=JM.Monomer.scanForOffsets(b,j,JM.NucleicMonomer.interestingNucleicAtomIDs);if(null==k||!JM.Monomer.checkOptional(k,19,b,j[73]))return null;JM.Monomer.checkOptional(k,20,b,j[89]);JM.Monomer.checkOptional(k,18,b,j[90]);JM.Monomer.checkOptional(k,
23,b,j[75]);JM.Monomer.checkOptional(k,24,b,j[77]);return(new JM.NucleicMonomer).set4(a,d,c,b,e,k)},"JM.Chain,~S,~N,~N,~N,~A");e(b,"set4",function(a,d,c,b,e,j){this.set2(a,d,c,b,e,j);JM.Monomer.have(j,15)||(j[0]=j[19],this.setLeadAtomIndex());this.hasRnaO2Prime=JM.Monomer.have(j,2);this.$isPyrimidine=JM.Monomer.have(j,8);this.$isPurine=JM.Monomer.have(j,9)&&JM.Monomer.have(j,10)&&JM.Monomer.have(j,11);return this},"JM.Chain,~S,~N,~N,~N,~A");h(b,"isNucleicMonomer",function(){return!0});h(b,"isDna",
function(){return!this.hasRnaO2Prime});h(b,"isRna",function(){return this.hasRnaO2Prime});h(b,"isPurine",function(){return this.$isPurine||!this.$isPyrimidine&&this.isPurineByID()});h(b,"isPyrimidine",function(){return this.$isPyrimidine||!this.$isPurine&&this.isPyrimidineByID()});e(b,"isGuanine",function(){return JM.Monomer.have(this.offsets,17)});h(b,"getProteinStructureType",function(){return this.hasRnaO2Prime?J.c.STR.RNA:J.c.STR.DNA});e(b,"getP",function(){return this.getAtomFromOffsetIndex(0)});
e(b,"getC1P",function(){return this.getAtomFromOffsetIndex(25)});e(b,"getC2",function(){return this.getAtomFromOffsetIndex(5)});e(b,"getC5",function(){return this.getAtomFromOffsetIndex(3)});e(b,"getC6",function(){return this.getAtomFromOffsetIndex(1)});e(b,"getC8",function(){return this.getAtomFromOffsetIndex(10)});e(b,"getC4P",function(){return this.getAtomFromOffsetIndex(27)});e(b,"getN1",function(){return this.getAtomFromOffsetIndex(4)});e(b,"getN3",function(){return this.getAtomFromOffsetIndex(6)});
e(b,"getN2",function(){return this.getAtomFromOffsetIndex(17)});e(b,"getN4",function(){return this.getAtomFromOffsetIndex(14)});e(b,"getN6",function(){return this.getAtomFromOffsetIndex(16)});e(b,"getO2",function(){return this.getAtomFromOffsetIndex(8)});e(b,"getO4",function(){return this.getAtomFromOffsetIndex(12)});e(b,"getO6",function(){return this.getAtomFromOffsetIndex(13)});h(b,"getTerminatorAtom",function(){return this.getAtomFromOffsetIndex(JM.Monomer.have(this.offsets,20)?20:21)});e(b,"getBaseRing6Points",
function(a){this.getPoints(JM.NucleicMonomer.ring6OffsetIndexes,a)},"~A");e(b,"getPoints",function(a,d){for(var c=a.length;0<=--c;)d[c]=this.getAtomFromOffsetIndex(a[c])},"~A,~A");e(b,"maybeGetBaseRing5Points",function(a){this.$isPurine&&this.getPoints(JM.NucleicMonomer.ring5OffsetIndexes,a);return this.$isPurine},"~A");e(b,"getRiboseRing5Points",function(a){this.getPoints(JM.NucleicMonomer.riboseOffsetIndexes,a)},"~A");h(b,"isConnectedAfter",function(a){if(null==a)return!0;var d=this.getAtomFromOffsetIndex(15);
return null==d?!1:a.getAtomFromOffsetIndex(21).isBonded(d)||this.isCA2(a)},"JM.Monomer");h(b,"findNearestAtomIndex",function(a,d,c,b){var e=c[0],j=this.getLeadAtom(),k=this.getAtomFromOffsetIndex(19),h=this.getAtomFromOffsetIndex(22);b=G(b/2);1900>b&&(b=1900);b=D(this.scaleToScreen(j.sZ,b));4>b&&(b=4);if(this.isCursorOnTopOf(j,a,d,b,e)||this.isCursorOnTopOf(k,a,d,b,e)||this.isCursorOnTopOf(h,a,d,b,e))c[0]=j},"~N,~N,~A,~N,~N");e(b,"setRingsVisible",function(a){for(var d=6;0<=--d;)this.getAtomFromOffsetIndex(JM.NucleicMonomer.ring6OffsetIndexes[d]).setShapeVisibility(32768,
a);if(this.$isPurine)for(d=4;1<=--d;)this.getAtomFromOffsetIndex(JM.NucleicMonomer.ring5OffsetIndexes[d]).setShapeVisibility(32768,a)},"~B");e(b,"setRingsClickable",function(){for(var a=6;0<=--a;)this.getAtomFromOffsetIndex(JM.NucleicMonomer.ring6OffsetIndexes[a]).setClickable(32768);if(this.$isPurine)for(a=4;1<=--a;)this.getAtomFromOffsetIndex(JM.NucleicMonomer.ring5OffsetIndexes[a]).setClickable(32768)});e(b,"getN0",function(){return this.getAtomFromOffsetIndex(this.$isPurine?11:4)});h(b,"getHelixData",
function(a,d,c){return this.getHelixData2(a,d,c)},"~N,~S,~N");h(b,"getQuaternionFrameCenter",function(a){switch(a.charCodeAt(0)){case 120:case 97:case 98:case 112:return this.getP();case 99:if(null==this.baseCenter){a=0;this.baseCenter=new JU.P3;for(var d=0;d<JM.NucleicMonomer.heavyAtomIndexes.length;d++){var c=this.getAtomFromOffsetIndex(JM.NucleicMonomer.heavyAtomIndexes[d]);null!=c&&(this.baseCenter.add(c),a++)}this.baseCenter.scale(1/a)}return this.baseCenter;default:return this.getN0()}},"~S");
h(b,"getQuaternion",function(a){if(null==this.bioPolymer)return null;var d=null,c=null,b=!1,e=!1;switch(a.charCodeAt(0)){case 97:a=this.getP();if(0==this.monomerIndex||null==a)return null;b=!0;d=this.bioPolymer.monomers[this.monomerIndex-1].getC4P();c=this.getC4P();break;case 120:a=this.getP();if(this.monomerIndex==this.bioPolymer.monomerCount-1||null==a)return null;d=this.bioPolymer.monomers[this.monomerIndex+1].getP();c=this.getC4P();break;case 98:return this.getQuaternionP();case 99:case 110:a=
this.getN0();if(null==a)return null;e=b=!0;d=this.getAtomFromOffsetIndex(5);c=this.getAtomFromOffsetIndex(25);break;case 112:a=this.getP();if(null==a)return null;var j=this.getAtomFromOffsetIndex(23),k=this.getAtomFromOffsetIndex(24),h=a.bonds;if(null==h)return null;for(var l=a.group,p=0;p<h.length;p++){var m=h[p].getOtherAtom(a);null!=j&&m.i==j.i||null!=k&&m.i==k.i||(m.group===l?c=m:d=m)}break;case 113:return null;default:a=this.getN0();if(null==a)return null;this.$isPurine?(d=this.getAtomFromOffsetIndex(5),
c=this.getAtomFromOffsetIndex(9)):(d=this.getAtomFromOffsetIndex(6),c=this.getAtomFromOffsetIndex(1))}if(null==d||null==c)return null;d=JU.V3.newVsub(d,a);c=JU.V3.newVsub(c,a);e&&c.scale(-1);return JU.Quat.getQuaternionFrameV(d,c,null,b)},"~S");h(b,"isCrossLinked",function(a){if(!x(a,"JM.NucleicMonomer")||this.$isPurine==a.isPurine())return!1;var d=this.$isPurine?a:this;a=(this.$isPurine?this:a).getN1();d=d.getN3();return a.isBonded(d)},"JM.Group");h(b,"getCrossLinkVector",function(a,d,c){if(!c)return!1;
d=this.$isPurine?this.getN1():this.getN3();c=d.bonds;if(null==c)return!1;for(var b=0;b<c.length;b++)if(c[b].isHydrogen()){var e=c[b].getOtherAtom(d),j=e.group;if(x(j,"JM.NucleicMonomer")&&(this.$isPurine?j.getN3():j.getN1())===e){if(null==a)return!0;a.addLast(Integer.$valueOf(d.i));a.addLast(Integer.$valueOf(e.i));a.addLast(Integer.$valueOf(j.leadAtomIndex))}}return null!=a&&0<a.size()},"JU.Lst,~B,~B");e(b,"getEdgePoints",function(a){a[0]=this.getLeadAtom();a[1]=this.getC4P();a[2]=a[5]=this.getC1P();
switch(this.getGroup1().charCodeAt(0)){case 67:return a[3]=this.getO2(),a[4]=this.getN4(),!0;case 65:return a[3]=this.getC2(),a[4]=this.getN6(),!0;case 71:case 73:return a[3]=this.getC2(),a[4]=this.getO6(),!0;case 84:case 85:return a[3]=this.getO2(),a[4]=this.getO4(),!0;default:return!1}},"~A");e(b,"addBasePair",function(a){null==this.bps&&(this.bps=new JU.Lst);this.bps.addLast(a)},"JM.BasePair");e(b,"setGroup1",function(a){"\x00"==this.group1&&(this.group1=a)},"~S");e(b,"getBasePairs",function(){null!=
this.bioPolymer&&!this.bioPolymer.isDssrSet&&this.bioPolymer.model.ms.vwr.getAnnotationParser(!0).getBasePairs(this.bioPolymer.model.ms.vwr,this.bioPolymer.model.modelIndex);return this.bps});h(b,"getGroup1b",function(){var a=JM.Group.group3Names[this.groupID],d=null==JM.NucleicPolymer.htGroup1?null:JM.NucleicPolymer.htGroup1.get(a);return null==d?Character.toLowerCase(a.charAt(a.length-1)):d.charAt(0)});e(b,"getDSSRFrame",function(a){if(null!=this.dssrFrame)return this.dssrFrame;if(null!=this.dssrNT)return this.dssrFrame=
a.getAnnotationParser(!0).getDSSRFrame(this.dssrNT);a=this.dssrFrame=Array(4);for(var d=4;0<=--d;)a[d]=new JU.P3;if(this.isPurine()){d=JU.P3.newP(this.getC5());d.sub(this.getC8());d.normalize();a[2].setT(d);a[2].scale(-1);a[0].scaleAdd2(4.9,d,this.getC8());var b=JU.P3.newP(this.getN0());b.sub(this.getC8());a[3].cross(b,d);a[3].normalize()}else d=JU.P3.newP(this.getN0()),d.sub(this.getC6()),b=JU.P3.newP(this.getC5()),b.sub(this.getC6()),a[3].cross(d,b),a[3].normalize(),a[2].setT(d),a[2].normalize(),
d=JU.A4.new4(a[3].x,a[3].y,a[3].z,1.1623892818282233),b=new JU.M3,b.setAA(d),b.rotate(a[2]),a[0].scaleAdd2(5.1,a[2],this.getC6()),a[2].scale(-1);a[1].cross(a[2],a[3]);return this.dssrFrame},"JV.Viewer");I(b,"interestingNucleicAtomIDs",H(-1,[-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",H(-1,[3,1,4,5,6,7]),"ring5OffsetIndexes",H(-1,[3,9,10,11,7]),"riboseOffsetIndexes",H(-1,[25,26,22,27,28,21,29,19,0]),"heavyAtomIndexes",
H(-1,[3,1,4,5,6,7,11,10,9,16,14,8,12,17,13]))});r("JM");t(["JM.PhosphorusPolymer"],"JM.NucleicPolymer",["JU.Measure","$.P4","$.V3","JM.HBond"],function(){var b=z(function(){this.isDssrSet=!1;w(this,arguments)},JM,"NucleicPolymer",JM.PhosphorusPolymer);A(b,function(a){L(this,JM.NucleicPolymer,[a]);this.type=2;this.hasWingPoints=!0},"~A");e(b,"getNucleicPhosphorusAtom",function(a){return this.monomers[a].getLeadAtom()},"~N");h(b,"calcEtaThetaAngles",function(){for(var a=NaN,d=0;d<this.monomerCount-
2;++d){var b=this.monomers[d],e=this.monomers[d+1],f=b.getP(),j=b.getC4P(),k=e.getP(),e=e.getC4P();0<d&&(a=this.monomers[d-1].getC4P(),a=JU.Measure.computeTorsion(a,f,j,k,!0));f=JU.Measure.computeTorsion(f,j,k,e,!0);0>a&&(a+=360);0>f&&(f+=360);b.setGroupParameter(1111490565,a);b.setGroupParameter(1111490576,f)}return!0});h(b,"calcRasmolHydrogenBonds",function(a,d,b,e,f){for(var j=new JU.V3,k=new JU.V3,h=this.monomerCount;0<=--h;){var l=this.monomers[h];if(l.isPurine()){var p=l.getN3(),m=d.get(p.i);
if(m||b.get(p.i)){for(var q=l.getN1(),y=l.getN0(),v=JU.Measure.getPlaneThroughPoints(p,q,y,j,k,new JU.P4),p=null,u=25,r=null,t=a.monomerCount;0<=--t;){var x=a.monomers[t];if(x.$isPyrimidine){var s=x.getN3();if(!(m?!b.get(s.i):!d.get(s.i))){var w=x.getN0(),z=q.distanceSquared(s);z<u&&(50<y.distanceSquared(w)&&1>Math.abs(JU.Measure.distanceToPlane(v,s)))&&(r=x,p=s,u=z)}}}m=0;null!=p&&(m+=JM.NucleicPolymer.addHydrogenBond(e,q,p),m>=f||(l.isGuanine()?(m+=JM.NucleicPolymer.addHydrogenBond(e,l.getN2(),
r.getO2()),m>=f||JM.NucleicPolymer.addHydrogenBond(e,l.getO6(),r.getN4())):JM.NucleicPolymer.addHydrogenBond(e,l.getN6(),r.getO4())))}}}},"JM.BioPolymer,JU.BS,JU.BS,JU.Lst,~N,~A,~B,~B");b.addHydrogenBond=e(b,"addHydrogenBond",function(a,d,b){if(null==d||null==b)return 0;a.addLast(new JM.HBond(d,b,18432,1,0,0));return 1},"JU.Lst,JM.Atom,JM.Atom");I(b,"htGroup1",null)});r("JM");E=z(function(){this.g2=this.g1=this.info=null;w(this,arguments)},JM,"BasePair");A(E,function(){});E.add=e(E,"add",function(b,
a,d){if(null==a||null==d)return null;var c=new JM.BasePair;c.info=b;(c.g1=a).addBasePair(c);(c.g2=d).addBasePair(c);return c},"java.util.Map,JM.NucleicMonomer,JM.NucleicMonomer");e(E,"getPartnerAtom",function(b){return(b===this.g1?this.g2:this.g1).getLeadAtom().i},"JM.NucleicMonomer");e(E,"toString",function(){return this.info.toString()});r("JM");t(["JM.BioPolymer"],"JM.PhosphorusPolymer",null,function(){var b=B(JM,"PhosphorusPolymer",JM.BioPolymer);A(b,function(a){L(this,JM.PhosphorusPolymer,[]);
this.set(a);this.hasStructure=!0},"~A")});r("J.dssx");t(null,"J.dssx.Bridge",["java.lang.Boolean","JU.Escape"],function(){var b=z(function(){this.ladder=this.b=this.a=null;this.isAntiparallel=!1;w(this,arguments)},J.dssx,"Bridge");A(b,function(a,d,b){this.a=a;this.b=d;this.ladder=s(2,2,0);this.ladder[0][0]=this.ladder[0][1]=Math.min(a.i,d.i);this.ladder[1][0]=this.ladder[1][1]=Math.max(a.i,d.i);this.addLadder(b)},"JM.Atom,JM.Atom,java.util.Map");e(b,"addBridge",function(a,d){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&&(d.remove(a.ladder),this.addLadder(d));return!0},"J.dssx.Bridge,java.util.Map");e(b,"addLadder",function(a){a.put(this.ladder,this.isAntiparallel?Boolean.TRUE:Boolean.FALSE)},"java.util.Map");e(b,"canAdd",function(a){var d=a.a.i;a=a.b.i;return this.isAntiparallel?d>=this.ladder[0][1]&&a<=this.ladder[1][0]||
d<=this.ladder[0][0]&&a>=this.ladder[1][1]:d<=this.ladder[0][0]&&a<=this.ladder[1][0]||d>=this.ladder[0][1]&&a>=this.ladder[1][1]},"J.dssx.Bridge");e(b,"extendLadder",function(a,d){this.ladder[0][0]>a&&(this.ladder[0][0]=a);this.ladder[0][1]<a&&(this.ladder[0][1]=a);this.ladder[1][0]>d&&(this.ladder[1][0]=d);this.ladder[1][1]<d&&(this.ladder[1][1]=d)},"~N,~N");h(b,"toString",function(){return(this.isAntiparallel?"a ":"p ")+this.a+" - "+this.b+"\t"+JU.Escape.e(this.ladder)})});r("J.dssx");t(null,"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 JU.Escape $.Logger JV.Viewer".split(" "),function(){var b=z(function(){this.done=this.vHBonds=this.bioPolymers=null;this.setStructure=this.dsspIgnoreHydrogens=this.doReport=!1;this.bsBad=this.labels=null;this.bioPolymerCount=0;this.bridgesP=this.bridgesA=this.htLadders=this.htBridges=null;this.isDSSP2=!1;this.sheetOffsets=null;w(this,arguments)},J.dssx,"DSSP");Q(b,function(){this.sheetOffsets=
F(-1,[s(-1,[0,-1,1,0,1,0,0,-1]),s(-1,[0,0,0,0,1,-1,1,-1])])});A(b,function(){});e(b,"calculateDssp",function(a,d,b,e,f,j,k){this.bioPolymers=a;this.bioPolymerCount=d;this.vHBonds=b;this.doReport=e;this.dsspIgnoreHydrogens=f;this.setStructure=j;this.isDSSP2=1<k;a=new JU.BS;for(k=0;k<d;k++)x(this.bioPolymers[k],"JM.AminoPolymer")&&a.set(k);if(a.isEmpty())return"";k=this.bioPolymers[0].model;b=new JU.SB;b.append("Jmol ").append(JV.Viewer.getJmolVersion()).append(" DSSP analysis for model ").append(k.ms.getModelNumberDotted(k.modelIndex)).append(" - ").append(k.ms.getModelTitle(k.modelIndex)).append("\n");
0==k.modelIndex&&b.append("\nW. Kabsch and C. Sander, Biopolymers, vol 22, 1983, pp 2577-2637\n\nWe thank Wolfgang Kabsch and Chris Sander for writing the DSSP software,\nand we thank the CMBI for maintaining it to the extent that it was easy to\nre-engineer in Java for our purposes. \n\nSecond generation DSSP 2.0 is ").append(this.isDSSP2?"":"NOT ").append("used in this analysis. See Int. J. Mol. Sci. 2014, 15, 7841-7864; doi:10.3390/ijms15057841.\n");j&&0==k.modelIndex&&b.append("\nAll bioshapes have been deleted and must be regenerated.\n");
0<k.altLocCount&&b.append("\nNote: This model contains alternative locations. Use  'CONFIGURATION 1' to be consistent with CMBI DSSP.\n");this.labels=P(d,"\x00");this.done=Array(d);this.bsBad=new JU.BS;var h=!1;for(k=a.nextSetBit(0);0<=k;k=a.nextSetBit(k+1)){j=this.bioPolymers[k];!h&&null!=j.monomers[0].getExplicitNH()&&(f?b.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")):b.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);j.recalculateLeadMidpointsAndWingVectors();var l=j.monomerCount;this.labels[k]=P(l,"\x00");this.done[k]=new JU.BS;for(var p=0;p<l;p++)null==j.monomers[p].getCarbonylOxygenAtom()&&this.bsBad.set(j.monomers[p].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();d=Array(d);for(k=a.nextSetBit(0);0<=k;k=a.nextSetBit(k+1))null!=f[k]&&(d[k]=this.findHelixes(k,f[k]));if(e){e=new JU.SB;b.append("\n------------------------------\n");for(k=a.nextSetBit(0);0<=k;k=a.nextSetBit(k+1))null!=this.labels[k]&&(j=this.bioPolymers[k],e.append(this.dumpSummary(j,this.labels[k])),
b.append(d[k]).append(this.dumpTags(j,"$.1: "+String.valueOf(this.labels[k]),this.bsBad,2)));0<=this.bsBad.nextSetBit(0)&&b.append("\nNOTE: '!' indicates a residue that is missing a backbone carbonyl oxygen atom.\n");b.append("\n").append("SUMMARY:"+e)}return b.toString()},"~A,~N,~O,~B,~B,~B,~N");e(b,"getDualHydrogenBondArray",function(){for(var a=JU.AU.newInt4(this.bioPolymerCount),d=0;d<this.bioPolymerCount;d++)if(x(this.bioPolymers[d],"JM.AminoPolymer")){var b=this.bioPolymers[d].monomerCount;
a[d]=s(b,2,3,0);for(var e=0;e<b;++e)a[d][e][0][1]=a[d][e][1][1]=-2147483648,a[d][e][0][2]=a[d][e][1][2]=0}for(d=0;d<this.bioPolymerCount;d++)if(null!=a[d])for(e=0;e<this.bioPolymerCount;e++)null!=a[e]&&this.bioPolymers[d].calcRasmolHydrogenBonds(this.bioPolymers[e],null,null,null,2,a[d],!1,this.dsspIgnoreHydrogens);return a});e(b,"getBridges",function(a){for(var d=this.bioPolymers[0].model.ms.at,b=null,e=new java.util.Hashtable,f=0;f<a.length;f++)if(x(this.bioPolymers[f],"JM.AminoPolymer"))for(var j=
this.bioPolymers[f],k=a[f].length-1,h=1;h<k;h++){var l=j.monomers[h].leadAtomIndex;if(!this.bsBad.get(l))for(var p=f;p<a.length;p++)if(x(this.bioPolymers[p],"JM.AminoPolymer"))for(var m=f==p?h+3:1;m<a[p].length-1;m++){var q=this.bioPolymers[p],r=q.monomers[m].leadAtomIndex;if(!this.bsBad.get(r)){if(null==(b=this.getBridge(a,f,h,p,m,this.bridgesP,d[l],d[r],j,q,e,!1)))if(null!=(b=this.getBridge(a,f,h,p,m,this.bridgesA,d[l],d[r],j,q,e,!0)))b.isAntiparallel=!0;else continue;JU.Logger.debugging&&JU.Logger.debug("Bridge found "+
b);this.done[f].set(h);this.done[p].set(m);this.htBridges.put(l+"-"+r,b)}}}},"~A");e(b,"getBridge",function(a,d,b,e,f,j,k,h,l,p,m,q){var r=null,v=null,u=0,t=q?this.sheetOffsets[1]:this.sheetOffsets[0];return null!=(r=this.isHbonded(b+t[0],f+t[1],d,e,a))&&null!=(v=this.isHbonded(f+t[2],b+t[3],e,d,a))||null!=(r=this.isHbonded(b+t[u=4],f+t[5],d,e,a))&&null!=(v=this.isHbonded(f+t[6],b+t[7],e,d,a))?(a=new J.dssx.Bridge(k,h,this.htLadders),j.addLast(a),null!=this.vHBonds&&(j=q?14336:6144,this.addHbond(l.monomers[b+
t[u]],p.monomers[f+t[++u]],r[2],j,m),this.addHbond(p.monomers[f+t[++u]],l.monomers[b+t[++u]],v[2],j,m)),a):null},"~A,~N,~N,~N,~N,JU.Lst,JM.Atom,JM.Atom,JM.AminoPolymer,JM.AminoPolymer,java.util.Map,~B");e(b,"addHbond",function(a,d,b,e,f){a=a.getNitrogenAtom();d=d.getCarbonylOxygenAtom();if(null!=f){var j=a.i+" "+d.i;if(f.containsKey(j))return;f.put(j,Boolean.TRUE)}this.vHBonds.addLast(new JM.HBond(a,d,e,1,0,b/1E3))},"JM.Monomer,JM.Monomer,~N,~N,java.util.Map");e(b,"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,d=new JU.BS,b,e=this.htLadders.keySet().iterator();e.hasNext()&&((b=e.next())||1);)b[0][0]==b[0][1]&&b[1][0]==b[1][1]?(d.set(b[0][0]),d.set(b[1][0])):(a.setBits(b[0][0],b[0][1]+1),a.setBits(b[1][0],b[1][1]+1));b=new JU.BS;for(var e=new JU.BS,f=this.bioPolymers.length;0<=--f;)if(x(this.bioPolymers[f],"JM.AminoPolymer")){b.clearAll();e.clearAll();for(var j=this.bioPolymers[f],
k=0;k<j.monomerCount;){var h=j.monomers[k].leadAtomIndex;if(a.get(h)){for(h=k+1;h<j.monomerCount&&a.get(j.monomers[h].leadAtomIndex);)h++;b.setBits(k,h);k=h}else d.get(h)&&e.set(k),++k}this.doReport&&(this.setTag(this.labels[f],e,"B"),this.setTag(this.labels[f],b,"E"));this.setStructure&&j.setStructureBS(0,3,J.c.STR.SHEET,b,!1);this.done[f].or(b);this.done[f].or(e)}}});e(b,"createLadders",function(a,d){for(var b=d?-1:1,e=a.size(),f=0;f<e;f++)this.checkBridge(a.get(f),d,1,b);for(f=0;f<e;f++)this.checkBulge(a.get(f),
d,1)},"JU.Lst,~B");e(b,"checkBridge",function(a,d,b,e){d=this.htBridges.get(a.a.getOffsetResidueAtom("\x00",b)+"-"+a.b.getOffsetResidueAtom("\x00",e));return null!=d&&a.addBridge(d,this.htLadders)},"J.dssx.Bridge,~B,~N,~N");e(b,"checkBulge",function(a,d,b){for(var e=d?-1:1,f=0;3>f;f++)for(var j=0==f?1:0;6>j;j++)this.checkBridge(a,d,f*b,j*e),j>f&&this.checkBridge(a,d,j*b,f*e)},"J.dssx.Bridge,~B,~N");e(b,"dumpSummary",function(a,d){for(var b=a.monomers[0].getLeadAtom(),b=0==b.getChainID()?"":b.getChainIDStr()+
":",e=new JU.SB,f="\x00",j="\x00",k="\x00",h=-1,l=-1,p=a.monomerCount,m=a.monomers,q=0;q<=p;q++){if(q==p||d[q]!=f){"\x00"!=f&&e.appendC("\n").appendC(f).append(" : ").append(b).appendI(h).append("\x00"==j?"":String.valueOf(j)).append("_").append(b).appendI(l).append("\x00"==k?"":String.valueOf(k));if(q==p)break;f=d[q];h=m[q].getResno();j=m[q].getInsertionCode()}l=m[q].getResno();k=m[q].getInsertionCode()}return e.toString()},"JM.AminoPolymer,~A");e(b,"dumpTags",function(a,d,b,e){var f=a.monomers[0].getLeadAtom().getChainID()+
"."+(a.bioPolymerIndexInModel+1);d=JU.PT.rep(d,"$",f);for(var j=a.monomers[0].getResno(),k="\n"+f,f=new JU.SB,h=(new JU.SB).append(k+".8: "),l=(new JU.SB).append(k+".7: "),p=(new JU.SB).append(k+".6: "),k=(new JU.SB).append(k+".0: "),m=a.monomerCount,q=0;q<m;q++)j=a.monomers[q].getResno(),h.append(0==j%100?""+G(j/100)%100:" "),l.append(0==j%10?""+G(j/10)%10:" "),p.appendI(j%10),k.appendC(b.get(a.monomers[q].leadAtomIndex)?"!":a.monomers[q].getGroup1());1==(e&1)&&f.appendSB(h).appendSB(l).appendSB(p);
f.append("\n");f.append(d);2==(e&2)&&(f.appendSB(k),f.append("\n\n"));return f.toString().$replace("\x00",".")},"JM.AminoPolymer,~S,JU.BS,~N");e(b,"isHbonded",function(a,d,b,e,f){if(0>a||0>d)return null;b=f[b];f=f[e];return a>=b.length||d>=f.length?null:b[a][0][0]==e&&b[a][0][1]==d?b[a][0]:b[a][1][0]==e&&b[a][1][1]==d?b[a][1]:null},"~N,~N,~N,~N,~A");e(b,"findHelixes",function(a,d){var b=this.bioPolymers[a];if(JU.Logger.debugging)for(var e=0;e<b.monomerCount;e++)JU.Logger.debug(a+"."+b.monomers[e].getResno()+
"\t"+JU.Escape.e(d[e]));var e=new JU.BS,f,j,k;this.isDSSP2?(k=this.findHelixes2(0,a,5,d,J.c.STR.HELIXPI,12288,e,!0),j=this.findHelixes2(2,a,4,d,J.c.STR.HELIXALPHA,10240,e,!1),f=this.findHelixes2(4,a,3,d,J.c.STR.HELIX310,8192,e,!1)):(j=this.findHelixes2(2,a,4,d,J.c.STR.HELIXALPHA,10240,e,!0),f=this.findHelixes2(4,a,3,d,J.c.STR.HELIX310,8192,e,!1),k=this.findHelixes2(0,a,5,d,J.c.STR.HELIXPI,12288,e,!1));this.setStructure&&b.setStructureBS(0,6,J.c.STR.TURN,e,!1);return this.doReport?(this.setTag(this.labels[a],
e,"T"),this.dumpTags(b,"$.5: "+k+"\n$.4: "+j+"\n$.3: "+f,this.bsBad,1)):""},"~N,~A");e(b,"findHelixes2",function(a,b,c,e,f,j,k,h){for(var l=this.bioPolymers[b],p=new JU.BS,m=new JU.BS,q=new JU.BS,r=new JU.BS,v=new JU.BS,u=this.done[b],t="",x=l.monomerCount,s=c;s<x;++s){var w=s-c,z=0;if(e[s][0][0]==b&&e[s][0][1]==w||e[s][z=1][0]==b&&e[s][1][1]==w){var A=l.monomers[w].leadAtomIndex,B=this.bsBad.nextSetBit(A),D=l.monomers[s];if(!(B>=A&&B<=D.leadAtomIndex)){p.set(w);m.setBits(w+1,s);r.set(s);var B=u.nextSetBit(w),
A=0>B||B>=s,E=!1;if(0<w&&p.get(w-1)&&(h||A))v.setBits(w,s),A||(t+="  WARNING! Bridge to helix at "+l.monomers[B]),E=!0;else if(A||u.nextClearBit(B)<s)E=!0;r.get(w)&&q.set(w);E&&null!=this.vHBonds&&this.addHbond(D,l.monomers[w],e[s][z][2],j,null)}}}this.doReport?(e=P(x,"\x00"),this.setTag(e,m,String.fromCharCode(48+c)),this.setTag(e,p,">"),this.setTag(e,r,"<"),this.setTag(e,q,"X")):e=null;u.or(v);m.andNot(u);k.or(m);k.andNot(v);this.setStructure&&l.setStructureBS(0,a,f,v,!1);return this.doReport?(this.setTag(this.labels[b],
v,String.fromCharCode(68+c)),String.valueOf(e)+t):""},"~N,~N,~N,~A,J.c.STR,~N,JU.BS,~B");e(b,"setTag",function(a,b,c){for(var e=b.nextSetBit(0);0<=e;e=b.nextSetBit(e+1))a[e]=c},"~A,JU.BS,~S")});r("J.shapebio");t(["J.shape.AtomShape"],"J.shapebio.BioShape","java.lang.Float JU.AU $.BS $.PT J.c.PAL $.STR JU.BSUtil $.C $.Logger".split(" "),function(){var b=z(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;w(this,arguments)},J.shapebio,"BioShape",J.shape.AtomShape);h(b,"setProperty",function(a,b,c){this.setPropAS(a,b,c)},"~S,~O,JU.BS");A(b,function(a,b,c){L(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=R(this.monomerCount,0),this.paletteIDs=
H(this.monomerCount,0),this.mads=R(this.monomerCount+1,0),this.monomers=c.monomers,this.meshReady=U(this.monomerCount,!1),this.meshes=Array(this.monomerCount),this.wingVectors=c.getWingVectors(),this.leadAtomIndices=c.getLeadAtomIndices())},"J.shapebio.BioShapeCollection,~N,JM.BioPolymer");e(b,"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(b,"calcMeanPositionalDisplacement",function(a){return V(1E3*Math.sqrt(a/7895.6835208714865))},"~N");h(b,"findNearestAtomIndex",function(a,b,c,e){this.bioPolymer.findNearestAtomIndex(a,b,c,this.mads,this.shape.vf,e)},"~N,~N,~A,JU.BS");e(b,"setMad",function(a,b,c){if(!(2>this.monomerCount)){this.isActive=!0;null==this.bsSizeSet&&(this.bsSizeSet=new JU.BS);for(var e=
this.shape.vf,f=32768==e&&x(this.bioPolymer,"JM.NucleicPolymer"),j=this.monomerCount;0<=--j;){var k=this.leadAtomIndices[j];if(b.get(k)){if(null!=c&&k<c.length){if(Float.isNaN(c[k]))continue;a=S(2E3*c[k])}var h=0<(this.mads[j]=this.getMad(j,a));this.bsSizeSet.setBitTo(j,h);this.monomers[j].setShapeVisibility(e,h);this.shape.atoms[k].setShapeVisibility(e,h);f&&this.monomers[j].setRingsVisible(h);this.falsifyNearbyMesh(j)}}1<this.monomerCount&&(this.mads[this.monomerCount]=this.mads[this.monomerCount-
1])}},"~N,JU.BS,~A");e(b,"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 S(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(b,"falsifyMesh",function(){if(null!=this.meshReady)for(var a=0;a<this.monomerCount;a++)this.meshReady[a]=!1});e(b,"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(b,"setColixBS",function(a,b,c){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=JU.BS.newN(this.monomerCount));for(var e=this.monomerCount;0<=--e;){var f=this.leadAtomIndices[e];c.get(f)&&(this.colixes[e]=this.shape.getColixI(a,b,f),null!=this.colixesBack&&this.colixesBack.length>e&&(this.colixesBack[e]=0),this.paletteIDs[e]=b,this.bsColixSet.setBitTo(e,0!=this.colixes[e]))}},"~N,~N,JU.BS");e(b,"setColixBack",
function(a,b){null==this.colixesBack&&(this.colixesBack=R(this.colixes.length,0));this.colixesBack.length<this.colixes.length&&(this.colixesBack=JU.AU.ensureLengthShort(this.colixesBack,this.colixes.length));for(var c=this.monomerCount;0<=--c;)b.get(this.leadAtomIndices[c])&&(this.colixesBack[c]=a)},"~N,JU.BS");e(b,"setColixes",function(a,b){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=JU.BS.newN(this.monomerCount));for(var c=this.monomerCount;0<=--c;){var e=this.leadAtomIndices[c];b.get(e)&&
(c<this.colixes.length&&e<a.length)&&(this.colixes[c]=this.shape.getColixI(a[e],J.c.PAL.UNKNOWN.id,e),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(b,"setParams",function(a,b,c){if(0!=this.monomerCount){var e=a[0];a=a[1];this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=JU.BS.newN(this.monomerCount));for(var f=b.length,j=this.monomerCount;0<=--j;){var k=this.leadAtomIndices[j];if(c.get(k)&&
j<this.colixes.length&&k<f){var h=b[k],l=null==e?0:e[h],h=null==a?0:a[h];0.01<h&&(l=JU.C.getColixTranslucent3(l,!0,h));this.colixes[j]=this.shape.getColixI(l,J.c.PAL.UNKNOWN.id,k);null!=this.colixesBack&&j<this.colixesBack.length&&(this.colixesBack[j]=0);this.paletteIDs[j]=J.c.PAL.UNKNOWN.id;this.bsColixSet.set(j)}}}},"~A,~A,JU.BS");e(b,"setTranslucent",function(a,b,c){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=JU.BS.newN(this.monomerCount));for(var e=this.monomerCount;0<=--e;)b.get(this.leadAtomIndices[e])&&
(this.colixes[e]=JU.C.getColixTranslucent3(this.colixes[e],a,c),null!=this.colixesBack&&this.colixesBack.length>e&&(this.colixesBack[e]=JU.C.getColixTranslucent3(this.colixesBack[e],a,c)),this.bsColixSet.setBitTo(e,0!=this.colixes[e]))},"~B,JU.BS,~N");h(b,"setAtomClickability",function(){if(this.isActive&&!(null==this.wingVectors||0==this.monomerCount))for(var a=x(this.bioPolymer,"JM.NucleicPolymer")&&11==this.shape.shapeID,b=x(this.bioPolymer,"JM.AlphaPolymer")||15!=this.shape.shapeID,c=this.monomers[0].chain.model.ms,
e=this.monomerCount;0<=--e;)if(!(0>=this.mads[e])){var f=this.leadAtomIndices[e];c.isAtomHidden(f)||(b&&c.at[f].setClickable(1040384),a&&this.monomers[e].setRingsClickable())}});e(b,"getBioShapeState",function(a,b,c,e){if(0<this.monomerCount&&this.isActive&&!(null==this.bsSizeSet&&null==this.bsColixSet))for(var f=0;f<this.monomerCount;f++){var j=this.monomers[f].firstAtomIndex,h=this.monomers[f].lastAtomIndex;if(null!=this.bsSizeSet&&(this.bsSizeSet.get(f)||null!=this.bsColixSet&&this.bsColixSet.get(f)))this.bsSizeDefault.get(f)?
JU.BSUtil.setMapBitSet(c,j,h,a+(this.bsSizeSet.get(f)?" on":" off")):JU.BSUtil.setMapBitSet(c,j,h,a+" "+JU.PT.escF(this.mads[f]/2E3));if(null!=this.bsColixSet&&this.bsColixSet.get(f)){var n=J.shape.Shape.getColorCommand(a,this.paletteIDs[f],this.colixes[f],b);null!=this.colixesBack&&(this.colixesBack.length>f&&0!=this.colixesBack[f])&&(n+=" "+JU.C.getHexCode(this.colixesBack[f]));JU.BSUtil.setMapBitSet(e,j,h,n)}}},"~S,~B,java.util.Map,java.util.Map");h(b,"getShapeState",function(){return null})});
r("J.shapebio");t(["J.shape.Shape"],"J.shapebio.BioShapeCollection","java.util.Hashtable JU.AU J.c.PAL J.shapebio.BioShape JU.BSUtil $.C JV.JC".split(" "),function(){var b=z(function(){this.atoms=null;this.madOn=-2;this.madHelixSheet=3E3;this.madTurnRandom=800;this.madDnaRna=5E3;this.isActive=!1;this.bioShapes=null;w(this,arguments)},J.shapebio,"BioShapeCollection",J.shape.Shape);h(b,"initModelSet",function(){this.isBioShape=!0;this.atoms=this.ms.at;this.initialize()});h(b,"initShape",function(){});
h(b,"getSizeG",function(a){var b=a.groupIndex;a=a.getLeadAtom().i;for(var c=this.bioShapes.length;0<=--c;)for(var e=this.bioShapes[c],f=0;f<e.monomerCount;f++)if(e.monomers[f].groupIndex==b&&e.monomers[f].getLeadAtom().i==a)return e.mads[f];return 0},"JM.Group");h(b,"replaceGroup",function(a,b){for(var c=this.bioShapes.length;0<=--c;)for(var e=this.bioShapes[c],f=0;f<e.monomerCount;f++)if(e.monomers[f]===a){e.monomers[f]=b;break}},"JM.Group,JM.Group");h(b,"setShapeSizeRD",function(a,b,c){this.initialize();
for(var e=this.bioShapes.length;0<=--e;){var f=this.bioShapes[e];0<f.monomerCount&&f.setMad(a,c,null==b?null:b.values)}},"~N,J.atomdata.RadiusData,JU.BS");h(b,"setProperty",function(a,b,c){this.setPropBSC(a,b,c)},"~S,~O,JU.BS");e(b,"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 e=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,e,c)}else if("params"===a){a=c.length();e=s(a,0);f=0;for(a=c.nextSetBit(0);0<=a;a=c.nextSetBit(a+1),f++)e[a]=f;for(a=this.bioShapes.length;0<=--a;)this.bioShapes[a].setParams(b,
e,c)}else if("colorPhase"===a){e=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,64,c),b.setColixBack(e,c))}else if("translucency"===a){e="translucent".equals(b);for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],0<b.monomerCount&&b.setTranslucent(e,c,this.translucentLevel)}else this.setPropS(a,b,c)},"~S,~O,JU.BS");h(b,"getShapeState",function(){for(var a=new java.util.Hashtable,b=new java.util.Hashtable,c=
JV.JC.shapeClassBases[this.shapeID],e=this.bioShapes.length;0<=--e;)this.bioShapes[e].getBioShapeState(c,this.translucentAllowed,a,b);return"\n"+this.vwr.getCommands(a,b,9==this.shapeID?"Backbone":"select")});e(b,"initialize",function(){for(var a=this.ms.mc,b=this.ms.am,c=this.ms.getBioPolymerCountInModel(-1),e=Array(c--);0<=--a;)for(var f=this.ms.getBioPolymerCountInModel(a);0<=--f;c--){var j=b[a].bioPolymers[f];e[c]=null==this.bioShapes||this.bioShapes.length<=c||null==this.bioShapes[c]||this.bioShapes[c].bioPolymer!==
j?new J.shapebio.BioShape(this,a,j):this.bioShapes[c]}this.bioShapes=e});h(b,"findNearestAtomIndex",function(a,b,c,e){for(var f=this.bioShapes.length;0<=--f;)this.bioShapes[f].findNearestAtomIndex(a,b,c,e)},"~N,~N,~A,JU.BS");h(b,"setModelVisibilityFlags",function(a){if(null!=this.bioShapes){a=JU.BSUtil.copy(a);null!=this.ms.trajectory&&this.ms.trajectory.setBaseModels(a);for(var b=this.bioShapes.length;0<=--b;){var c=this.bioShapes[b];c.modelVisibilityFlags=a.get(c.modelIndex)?this.vf:0}}},"JU.BS");
h(b,"setAtomClickability",function(){if(null!=this.bioShapes)for(var a=this.bioShapes.length;0<=--a;)this.bioShapes[a].setAtomClickability()});e(b,"getMpsShapeCount",function(){return this.bioShapes.length});e(b,"getBioShape",function(a){return this.bioShapes[a]},"~N")});r("J.shapebio");t(["J.shapebio.BioShapeCollection"],"J.shapebio.Rockets",null,function(){var b=B(J.shapebio,"Rockets",J.shapebio.BioShapeCollection);h(b,"initShape",function(){this.madTurnRandom=500})});r("J.shapebio");t(["J.shapebio.Rockets"],
"J.shapebio.Cartoon",null,function(){var b=B(J.shapebio,"Cartoon",J.shapebio.Rockets);e(b,"initShape",function(){T(this,J.shapebio.Cartoon,"initShape",[]);this.madDnaRna=1E3})});r("J.shapebio");t(["J.shapebio.BioShapeCollection"],"J.shapebio.Backbone",["java.lang.Float","JU.BS"],function(){var b=z(function(){this.bsSelected=null;w(this,arguments)},J.shapebio,"Backbone",J.shapebio.BioShapeCollection);h(b,"initShape",function(){this.madOn=1;this.madHelixSheet=1500;this.madTurnRandom=500;this.madDnaRna=
2E3;this.isActive=!0});h(b,"setProperty",function(a,b,c){"bitset"===a?this.bsSelected=b:this.setPropBSC(a,b,c)},"~S,~O,JU.BS");h(b,"setShapeSizeRD",function(a,b,c){this.initialize();var e=null!=this.bsSelected;e&&(c=this.bsSelected);for(var f=this.bioShapes.length;0<=--f;){var j=this.bioShapes[f];if(0!=j.monomerCount){var h=this.vwr.getBoolean(603979812),n=j.bioPolymer.getLeadAtomIndices(),l=0!=a;null==j.bsSizeSet&&(j.bsSizeSet=new JU.BS);j.isActive=!0;for(var p=j.monomerCount,m=p-(j.bioPolymer.isCyclic()?
0:1);0<=--m;){var q=n[m],r=n[(m+1)%p],t=c.get(q),u=c.get(r);if(t&&u||e&&t||h&&(t||u)){j.monomers[m].setShapeVisibility(this.vf,l);t=this.ms.at[q];if(null!=b){if(Float.isNaN(b.values[q])||Float.isNaN(b.values[r]))continue;a=S(1E3*(b.values[q]+b.values[r]));l=0!=a}q=this.ms.at[r];0!=j.mads[m]!=l&&(this.addDisplayedBackbone(t,l),this.addDisplayedBackbone(q,l));j.mads[m]=a;j.bsSizeSet.setBitTo(m,l);j.bsSizeDefault.setBitTo(m,-1==a)}}}}e&&(this.bsSelected=null)},"~N,J.atomdata.RadiusData,JU.BS");e(b,"addDisplayedBackbone",
function(a,b){a.nBackbonesDisplayed+=b?1:-1;a.setShapeVisibility(this.vf,b)},"JM.Atom,~B");h(b,"setAtomClickability",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 e=this.ms.at[c[b]];0<e.nBackbonesDisplayed&&!this.ms.isAtomHidden(e.i)&&e.setClickable(this.vf)}})});r("J.shapebio");t(["J.shapebio.BioShapeCollection"],"J.shapebio.Strands",null,function(){z(function(){this.isMesh=
!1;w(this,arguments)},J.shapebio,"Strands",J.shapebio.BioShapeCollection)});r("J.shapebio");t(["J.shapebio.BioShapeCollection"],"J.shapebio.Ribbons",null,function(){B(J.shapebio,"Ribbons",J.shapebio.BioShapeCollection)});r("J.shapebio");t(["J.shapebio.Strands"],"J.shapebio.MeshRibbon",null,function(){var b=B(J.shapebio,"MeshRibbon",J.shapebio.Strands);h(b,"initShape",function(){this.isMesh=!0})});r("J.shapebio");t(["J.shapebio.BioShapeCollection"],"J.shapebio.Trace",["J.atomdata.RadiusData","J.c.VDW"],
function(){var b=B(J.shapebio,"Trace",J.shapebio.BioShapeCollection);h(b,"initShape",function(){this.madOn=600;this.madHelixSheet=1500;this.madTurnRandom=500;this.madDnaRna=1500});h(b,"setProperty",function(a,b,c){"putty"===a?this.setPutty(b,c):this.setPropBSC(a,b,c)},"~S,~O,JU.BS");e(b,"setPutty",function(a,b){var c=b.cardinality();if(0!=c){for(var e=K(b.length(),0),f=0,j=0,h=3.4028235E38,n=0,l=b.nextSetBit(0);0<=l;l=b.nextSetBit(l+1)){var p=this.atoms[l].atomPropertyFloat(null,1111492620,null),
f=f+p,j=j+p*p;p<h&&(h=p);p>n&&(n=p)}var p=f/c,c=Math.sqrt((j-f*f/c)/c),f=a[1],j=a[2],m=a[3],q=a[4],r=a[5],t=D(a[6]),n=n-h,u=!1;switch(t){case 0:case 1:case 2:case 3:u=!0}for(l=b.nextSetBit(0);0<=l;l=b.nextSetBit(l+1)){var s=this.atoms[l].atomPropertyFloat(null,1111492620,null);switch(t){case 0:case 4:s=1+(s-p)/j/c;break;case 1:case 5:s=(s-h)/n/j;break;case 2:case 6:s/=j;break;case 8:0>s&&(s=0),s=Math.sqrt(s/8)/3.141592653589793}0>s&&(s=0);u&&(s=Math.pow(s,r));s<m&&0<=m&&(s=m);s>q&&0<=q&&(s=q);e[l]=
s*f}e=new J.atomdata.RadiusData(e,0,J.atomdata.RadiusData.EnumType.ABSOLUTE,J.c.VDW.AUTO);this.setShapeSizeRD(0,e,b)}},"~A,JU.BS")});r("J.renderbio");t(["J.render.ShapeRenderer","JU.BS","$.P3"],"J.renderbio.BioShapeRenderer",["javajs.api.Interface","J.c.STR","JU.C"],function(){var b=z(function(){this.haveControlPointScreens=this.ribbonBorder=this.isTraceAlpha=this.invalidateSheets=this.invalidateMesh=!1;this.sheetSmoothing=this.hermiteLevel=this.aspectRatio=0;this.cartoonsFancy=!1;this.monomerCount=
0;this.monomers=null;this.isCarbohydrate=this.isPhosphorusOnly=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.needTranslucent=this.wireframeOnly=this.isHighRes=!1;this.pointT=this.bioShape=this.meshRenderer=null;this.colixBack=this.madEnd=this.madMid=this.madBeg=this.diameterEnd=this.diameterMid=this.diameterBeg=this.iNext3=
this.iNext2=this.iNext=this.iPrev=0;this.reversed=null;this.isCyclic=!1;this.screenArrowBotPrev=this.screenArrowBot=this.screenArrowTopPrev=this.screenArrowTop=null;w(this,arguments)},J.renderbio,"BioShapeRenderer",J.render.ShapeRenderer);Q(b,function(){this.bsVisible=new JU.BS;this.pointT=new JU.P3;this.screenArrowTop=new JU.P3;this.screenArrowTopPrev=new JU.P3;this.screenArrowBot=new JU.P3;this.screenArrowBotPrev=new JU.P3});h(b,"render",function(){if(null==this.shape)return!1;this.setGlobals();
this.renderShapes();return this.needTranslucent});e(b,"setGlobals",function(){this.needTranslucent=this.invalidateMesh=!1;this.g3d.addRenderer(553648143);var a=!this.isExport&&!this.vwr.checkMotionRendering(1112152066);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(603979816)||this.isExport);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;0<this.aspectRatio&&(null==
this.meshRenderer&&(this.meshRenderer=javajs.api.Interface.getInterface("J.renderbio.BioMeshRenderer"),this.meshRenderer.setViewerG3dShapeID(this.vwr,this.shape.shapeID)),this.meshRenderer.setup(this.g3d,this.ms,this.shape));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(b,"renderShapes",
function(){for(var a=this.shape,b=a.bioShapes.length;0<=--b;)this.bioShape=a.getBioShape(b),0!=(this.bioShape.modelVisibilityFlags&this.myVisibilityFlag)&&(2<=this.bioShape.monomerCount&&this.initializePolymer(this.bioShape))&&(null!=this.meshRenderer&&this.meshRenderer.initBS(),this.isCyclic=this.bioShape.bioPolymer.isCyclic(),this.renderBioShape(this.bioShape),null!=this.meshRenderer&&this.meshRenderer.renderMeshes(),this.freeTempArrays())});e(b,"setBioColix",function(a){if(this.g3d.setC(a))return!0;
this.needTranslucent=!0;return!1},"~N");e(b,"freeTempArrays",function(){this.haveControlPointScreens&&this.vwr.freeTempPoints(this.controlPointScreens);this.vwr.freeTempEnum(this.structureTypes)});e(b,"initializePolymer",function(a){var b=this.vwr.slm.bsDeleted;this.controlPoints=this.ms.isJmolDataFrameForModel(a.modelIndex)?a.bioPolymer.getControlPoints(!0,0,!1):a.bioPolymer.getControlPoints(this.isTraceAlpha,this.sheetSmoothing,this.invalidateSheets);this.monomerCount=a.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 e=this.monomerCount;0<=--e;)if(!(0==(this.monomers[e].shapeVisibilityFlags&this.myVisibilityFlag)||this.ms.isAtomHidden(this.leadAtomIndices[e])||null!=b&&b.get(this.leadAtomIndices[e]))){var f=this.ms.at[this.leadAtomIndices[e]];this.g3d.isInDisplayRange(f.sX,f.sY)&&(this.bsVisible.set(e),c=!0)}if(!c)return!1;this.ribbonBorder=
this.vwr.getBoolean(603979901);this.isNucleic=x(a.bioPolymer,"JM.NucleicPolymer");this.isPhosphorusOnly=!this.isNucleic&&x(a.bioPolymer,"JM.PhosphorusPolymer");this.isCarbohydrate=x(a.bioPolymer,"JM.CarbohydratePolymer");this.haveControlPointScreens=!1;this.wingVectors=a.wingVectors;null!=this.meshRenderer&&this.meshRenderer.initialize(this,a,this.monomerCount);this.mads=a.mads;this.colixes=a.colixes;this.colixesBack=a.colixesBack;this.setStructureTypes();return!0},"J.shapebio.BioShape");e(b,"setStructureTypes",
function(){for(var a=this.structureTypes=this.vwr.allocTempEnum(this.monomerCount+1),b=this.monomerCount;0<=--b;)if((a[b]=this.monomers[b].getProteinStructureType())===J.c.STR.TURN)a[b]=J.c.STR.NONE;a[this.monomerCount]=a[this.monomerCount-1]});e(b,"calcScreenControlPoints",function(){for(var a=this.monomerCount+1,b=this.controlPointScreens=this.vwr.allocTempPoints(a),c=this.controlPoints;0<=--a;)this.tm.transformPtScrT3(c[a],b[a]);this.haveControlPointScreens=!0});e(b,"calcScreens",function(a,b){var c=
this.controlPoints.length,e=this.vwr.allocTempPoints(c);if(0==a)for(;0<=--c;)this.tm.transformPtScrT3(this.controlPoints[c],e[c]);else for(var f=a/1E3;0<=--c;)this.calc1Screen(this.controlPoints[c],this.wingVectors[c],0==b[c]&&0<c?b[c-1]:b[c],f,e[c]);return e},"~N,~A");e(b,"calc1Screen",function(a,b,c,e,f){this.pointT.scaleAdd2(c*e,b,a);this.tm.transformPtScrT3(this.pointT,f)},"JU.P3,JU.V3,~N,~N,JU.P3");e(b,"getLeadColix",function(a){return JU.C.getColixInherited(this.colixes[a],this.monomers[a].getLeadAtom().colixAtom)},
"~N");e(b,"getLeadColixBack",function(a){return null==this.colixesBack||this.colixesBack.length<=a?0:this.colixesBack[a]},"~N");e(b,"setNeighbors",function(a){this.isCyclic?(a+=this.monomerCount,this.iPrev=(a-1)%this.monomerCount,this.iNext=(a+1)%this.monomerCount,this.iNext2=(a+2)%this.monomerCount,this.iNext3=(a+3)%this.monomerCount):(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(b,"setColix",function(a){this.colix=a;return this.g3d.setC(a)},"~N");e(b,"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&&(x(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=D(this.vwr.tm.scaleToScreen(D(this.controlPointScreens[a].z),this.madBeg));this.diameterMid=D(this.vwr.tm.scaleToScreen(this.monomers[a].getLeadAtom().sZ,this.madMid));this.diameterEnd=D(this.vwr.tm.scaleToScreen(D(this.controlPointScreens[this.iNext].z),this.madEnd));var c=a==this.iPrev||!this.bsVisible.get(this.iPrev)||
b&&this.structureTypes[a]!==this.structureTypes[this.iPrev],e=this.iNext==this.iNext2||this.iNext2==this.iNext3||!this.bsVisible.get(this.iNext)||b&&this.structureTypes[a]!==this.structureTypes[this.iNext];return 0<this.aspectRatio&&null!=this.meshRenderer&&this.meshRenderer.check(c,e)},"~N,~B");e(b,"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(b,"renderHermiteConic",function(a,b,c){this.setNeighbors(a);this.colix=this.getLeadColix(a);this.setBioColix(this.colix)&&(this.setMads(a,b)||this.isExport?this.meshRenderer.setFancyConic(a,c):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(b,"renderHermiteRibbon",function(a,b,c){this.setNeighbors(b);var e=this.colix=this.getLeadColix(b);if(this.setBioColix(this.colix)){var f=this.colixBack=this.getLeadColixBack(b);if(a&&(0!=this.aspectRatio||this.isExport))if(this.setMads(b,c)||this.isExport){this.meshRenderer.setFancyRibbon(b);return}if((c=this.reversed.get(b))&&0!=this.colixBack)this.setColix(this.colixBack),f=e;this.g3d.drawHermite7(a,this.ribbonBorder,
(c?-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],D(this.aspectRatio),f);c&&0!=this.colixBack&&this.setColix(e)}},"~B,~N,~B");e(b,"renderHermiteArrowHead",function(a){this.colix=this.getLeadColix(a);if(this.setBioColix(this.colix))if(this.colixBack=this.getLeadColixBack(a),
this.setNeighbors(a),this.setMads(a,!1)||this.isExport)this.meshRenderer.setFancyArrowHead(a);else{var b=this.controlPoints[a];a=this.wingVectors[a];this.calc1Screen(b,a,this.madBeg,7E-4,this.screenArrowTop);this.calc1Screen(b,a,this.madBeg,-7E-4,this.screenArrowBot);this.calc1Screen(b,a,this.madBeg,0.001,this.screenArrowTopPrev);this.calc1Screen(b,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],D(this.aspectRatio),this.colixBack);this.g3d.setC(this.colix);this.ribbonBorder&&0==this.aspectRatio&&this.g3d.fillCylinderBits(3,3,this.screenArrowTop,this.screenArrowBot)}},"~N");e(b,"drawSegmentAB",function(a,b,c,e,f){var j=a.sX,h=a.sY;a=a.sZ;var n=b.sX,l=b.sY;b=b.sZ;var p=this.mad;1E3==f&&(p>>=1);0>p?this.g3d.drawLine(c,
e,j,h,a,n,l,b):(f=D(this.isExport?p:this.vwr.tm.scaleToScreen(G((a+b)/2),p)),this.g3d.fillCylinderXYZ(c,e,3,f,j,h,a,n,l,b))},"JM.Atom,JM.Atom,~N,~N,~N")});r("J.renderbio");t(["J.renderbio.BioShapeRenderer"],"J.renderbio.StrandsRenderer",null,function(){var b=z(function(){this.strandCount=1;this.baseStrandOffset=this.strandSeparation=0;w(this,arguments)},J.renderbio,"StrandsRenderer",J.renderbio.BioShapeRenderer);h(b,"renderBioShape",function(){this.renderStrandShape()},"J.shapebio.BioShape");e(b,
"renderStrandShape",function(){this.setStrandCount()&&this.renderStrands()});e(b,"setStrandCount",function(){if(null==this.wingVectors)return!1;this.strandCount=x(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(b,"renderStrands",function(){for(var a,b=this.strandCount>>1;0<=--b;){var c=b*this.strandSeparation+
this.baseStrandOffset;a=this.calcScreens(c,this.mads);this.renderStrand(a);this.vwr.freeTempPoints(a);a=this.calcScreens(-c,this.mads);this.renderStrand(a);this.vwr.freeTempPoints(a)}1==this.strandCount%2&&(a=this.calcScreens(0,this.mads),this.renderStrand(a),this.vwr.freeTempPoints(a))});e(b,"renderStrand",function(a){for(var b=this.bsVisible.nextSetBit(0);0<=b;b=this.bsVisible.nextSetBit(b+1))this.renderHermiteCylinder(a,b)},"~A")});r("J.renderbio");t(["J.renderbio.MeshRibbonRenderer"],"J.renderbio.RibbonsRenderer",
null,function(){var b=B(J.renderbio,"RibbonsRenderer",J.renderbio.MeshRibbonRenderer);h(b,"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")});r("J.renderbio");t(["J.renderbio.StrandsRenderer"],"J.renderbio.MeshRibbonRenderer",null,function(){var b=B(J.renderbio,"MeshRibbonRenderer",J.renderbio.StrandsRenderer);h(b,"renderBioShape",function(){this.wireframeOnly?this.renderStrands():
this.renderMeshRibbon()},"J.shapebio.BioShape");e(b,"renderMeshRibbon",function(){if(this.setStrandCount()){var a=(this.strandCount>>1)*this.strandSeparation+this.baseStrandOffset;this.render2Strand(!1,a,a);this.renderStrands()}});e(b,"render2Strand",function(a,b,c){this.calcScreenControlPoints();this.ribbonTopScreens=this.calcScreens(b,this.mads);this.ribbonBottomScreens=this.calcScreens(-c,this.mads);for(b=this.bsVisible.nextSetBit(0);0<=b;b=this.bsVisible.nextSetBit(b+1))this.renderHermiteRibbon(a,
b,!1);this.vwr.freeTempPoints(this.ribbonTopScreens);this.vwr.freeTempPoints(this.ribbonBottomScreens)},"~B,~N,~N")});r("J.renderbio");t(["J.renderbio.StrandsRenderer"],"J.renderbio.RocketsRenderer",["javajs.api.Interface","JU.P3","J.c.STR"],function(){var b=z(function(){this.isRockets=!1;this.helixRockets=!0;this.renderArrowHeads=!1;this.rr=this.cordMidPoints=null;w(this,arguments)},J.renderbio,"RocketsRenderer",J.renderbio.StrandsRenderer);h(b,"renderBioShape",function(a){this.setupRR(a,!0)&&(this.calcRopeMidPoints(),
this.renderRockets(),this.vwr.freeTempPoints(this.cordMidPoints))},"J.shapebio.BioShape");e(b,"renderRockets",function(){null==this.rr&&(this.rr=javajs.api.Interface.getInterface("J.renderbio.RocketRenderer").set(this));this.rr.renderRockets()});e(b,"setupRR",function(a,b){this.isRockets=b;if(this.wireframeOnly)this.renderStrands();else if(null!=this.wingVectors&&!this.isCarbohydrate&&(!b||!this.isNucleic)){var c=!this.vwr.getBoolean(603979902);!this.isNucleic&&this.renderArrowHeads!=c&&(a.falsifyMesh(),
this.renderArrowHeads=c);return!0}return!1},"J.shapebio.BioShape,~B");e(b,"calcRopeMidPoints",function(){this.cordMidPoints=this.vwr.allocTempPoints(this.monomerCount+1);for(var a=null,b,c=-10,e=new JU.P3,f=new JU.P3,j=0;j<=this.monomerCount;++j)if(b=this.cordMidPoints[j],j<this.monomerCount&&(this.helixRockets&&this.structureTypes[j]===J.c.STR.HELIX||this.isRockets&&this.structureTypes[j]===J.c.STR.SHEET)){var h=this.monomers[j].getStructure();h===a?(e.add(f),c=j):(a=h,e.setT(h.getAxisStartPoint()),
f.sub2(h.getAxisEndPoint(),e),f.scale(1/(h.nRes-1)),c==j-3&&this.cordMidPoints[j-1].ave(this.cordMidPoints[j-2],e));b.setT(e)}else c==j-1&&1<j&&this.cordMidPoints[j-1].setT(this.cordMidPoints[2<j?j-3:j-2]),b.setT(null==a?this.controlPoints[j]:a.getAxisEndPoint()),a=null;this.controlPoints=this.cordMidPoints;this.calcScreenControlPoints()})});r("J.renderbio");t(["J.renderbio.RocketsRenderer"],"J.renderbio.CartoonRenderer",["J.api.Interface","J.c.STR"],function(){var b=z(function(){this.nucleicRenderer=
null;w(this,arguments)},J.renderbio,"CartoonRenderer",J.renderbio.RocketsRenderer);h(b,"renderBioShape",function(a){if(this.setupRR(a,!1))if(this.isNucleic||this.isPhosphorusOnly)null==this.nucleicRenderer&&(this.nucleicRenderer=J.api.Interface.getInterface("J.renderbio.NucleicRenderer",this.vwr,"render")),this.calcScreenControlPoints(),this.nucleicRenderer.renderNucleic(this);else{var b=this.vwr.getBoolean(603979819);this.helixRockets!=b&&(a.falsifyMesh(),this.helixRockets=b);this.ribbonTopScreens=
this.calcScreens(0.5,this.mads);this.ribbonBottomScreens=this.calcScreens(-0.5,this.mads);this.calcRopeMidPoints();this.renderProtein();this.vwr.freeTempPoints(this.cordMidPoints);this.vwr.freeTempPoints(this.ribbonTopScreens);this.vwr.freeTempPoints(this.ribbonBottomScreens)}},"J.shapebio.BioShape");e(b,"renderProtein",function(){for(var a=!1,b=!1,c=null,e,f=this.helixRockets||!this.renderArrowHeads,j=!1,h=this.monomerCount;0<=--h;){e=this.monomers[h].getStructure();e!==c&&(a=!1);c=e;e=this.structureTypes[h]===
J.c.STR.HELIX;var n=this.structureTypes[h]===J.c.STR.SHEET;this.bsVisible.get(h)&&(e&&f?j=!0:n||e?a&&n||b&&e?this.renderHermiteRibbon(!0,h,!0):this.renderHermiteArrowHead(h):this.renderHermiteConic(h,!0,7));a=n;b=e&&!this.helixRockets}j&&this.renderRockets()})});r("J.renderbio");t(["J.renderbio.BioShapeRenderer"],"J.renderbio.BackboneRenderer",["JU.C"],function(){var b=z(function(){this.isDataFrame=!1;w(this,arguments)},J.renderbio,"BackboneRenderer",J.renderbio.BioShapeRenderer);h(b,"renderBioShape",
function(a){var b=!this.isExport&&!this.vwr.gdata.isPass2;this.isDataFrame=this.ms.isJmolDataFrameForModel(a.modelIndex);a=this.monomerCount;for(var c=this.ms.at,e=this.bsVisible.nextSetBit(0);0<=e;e=this.bsVisible.nextSetBit(e+1)){var f=c[this.leadAtomIndices[e]],h=this.colixes[e];this.mad=this.mads[e];var k=(e+1)%a,n=c[this.leadAtomIndices[k]],k=this.colixes[k];if(0<f.nBackbonesDisplayed&&0<n.nBackbonesDisplayed&&!this.ms.isAtomHidden(n.i)&&(this.isDataFrame||100>f.distanceSquared(n)))h=JU.C.getColixInherited(h,
f.colixAtom),k=JU.C.getColixInherited(k,n.colixAtom),(!b||this.setBioColix(h)||this.setBioColix(k))&&this.drawSegmentAB(f,n,h,k,100)}},"J.shapebio.BioShape")});r("J.renderbio");t(["J.renderbio.StrandsRenderer"],"J.renderbio.TraceRenderer",null,function(){var b=B(J.renderbio,"TraceRenderer",J.renderbio.StrandsRenderer);h(b,"renderBioShape",function(){this.wireframeOnly?this.renderStrands():this.renderTrace()},"J.shapebio.BioShape");e(b,"renderTrace",function(){this.calcScreenControlPoints();for(var a=
this.bsVisible.nextSetBit(0);0<=a;a=this.bsVisible.nextSetBit(a+1))this.renderHermiteConic(a,!1,7)})})})(Clazz,Clazz.getClassName,Clazz.newLongArray,Clazz.doubleToByte,Clazz.doubleToInt,Clazz.doubleToLong,Clazz.declarePackage,Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,Clazz.floatToInt,Clazz.floatToLong,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.isAB,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);
