(function(M,ia,ja,ka,w,la,s,r,t,y,z,n,ma,F,Z,$,D,N,H,X,R,K,na,ca,oa,pa,qa,P,ra,da,ea,sa,fa,aa,ta,ua,ba,va,ga,wa,xa,ya,za,Aa,Ba,Ca,Da,Ea,Fa,Ga,Ha,Ia,Ja,Ka,La,d,h){s("J.adapter.readers.pdb");t(["J.adapter.smarter.AtomSetCollectionReader","java.util.Hashtable"],"J.adapter.readers.pdb.PdbReader","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.$cryst1=0;this.htGroup1=this.fileSgName=null;this.maxLength=80;this.pdbID=null;this.haveDoubleBonds=!1;this.vConnect=this.tlsU=this.dataT=null;this.connectNextAtomSet=
this.connectNextAtomIndex=0;this.connectLast=null;y(this,arguments)},J.adapter.readers.pdb,"PdbReader",J.adapter.smarter.AtomSetCollectionReader);X(b,function(){this.htFormul=new java.util.Hashtable;this.dataT=N(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"),e=this.isbiomol&&this.checkFilterKey("BYSYMOP");(this.isCourseGrained=a||e)||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,e=a[1].indexOf("="),0<=e?this.setFilterAtomTypeStr(a[1].substring(e+1).toUpperCase()):e=a[1].length,this.atomTypeLen=Integer.parseInt(a[1].substring(0,e)));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,e=0==a||1==a,c=2==a;this.serial=e?this.getSerial(6,11):0;var g=(this.isTrajectory||this.isSequential)&&!this.isMultiModel&&e&&1==
this.serial;this.getHeader&&(e||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||!e)return!0}if(this.isMultiModel&&!this.doProcessLines)return!0;if(e)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});d(b,"checkRemark",function(){this.checkCurrentLineForScript()});
d(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 e=this.line.substring(12,15).trim();this.htGroup1.put(e,a)}});d(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()});d(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.asc.newFileSymmetry();var e=this.asc.atomSetCount;if(e==this.vTlsModels.size())for(;0<=--e;)this.setTlsGroups(e,e,a);else if(JU.Logger.info(e+" 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<=--e;)this.setTlsGroups(0,e,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.checkNearAtoms=!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(e=this.asc.iSet+1;0<=--e;)this.asc.setModelInfoForSet("compoundSource",this.vCompnds,e)}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()))});d(b,"checkUnitCellParams",function(){if(this.isbiomol&&(null==this.unitCellParams||
Double.isNaN(this.unitCellParams[0])))this.setUnitCell(1,1,1,90,90,90),this.addSpaceGroupName("P1");this.iHaveUnitCell&&(this.asc.setCurrentModelInfo("unitCellParams",this.unitCellParams),null!=this.sgName&&this.asc.setCurrentModelInfo("spaceGroup",this.sgName))});d(b,"checkForResidualBFactors",function(a){for(var e=this.asc.atoms,c=!1,g=this.asc.ac;0<=--g;){var f=this.tlsU.get(e[g]);if(null!=f){var q=f[7]-(f[0]+f[1]+f[2])/3;if(0>q||Float.isNaN(q)){c=!0;break}}}JU.Logger.info("TLS analysis suggests Bfactors are "+
(c?"":"NOT")+" residuals");for(var b,e=this.tlsU.entrySet().iterator();e.hasNext()&&((b=e.next())||1);)f=b.getValue(),q=f[7],0!=q&&(c||(q-=(f[0]+f[1]+f[2])/3),f[0]+=q,f[1]+=q,f[2]+=q,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.adapter.smarter.XtalSymmetry.FileSymmetry");d(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()))});d(b,"title",function(){10<this.lineLength&&this.appendLoadNote(this.line.substring(10,Math.min(this.maxLength,this.line.length)).trim())});d(b,"compnd",
function(a){if(!a){this.$compnd=null==this.$compnd?"":this.$compnd+" ";var e=this.line;62<this.lineLength&&(e=e.substring(0,62));this.$compnd+=e.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;e=this.line.substring(0,c).trim();c=c<this.line.length?this.line.substring(c+1).trim():null;if(e.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+=e,0==this.vCompnds.size()&&this.vCompnds.addLast(this.currentCompnd)):this.currentKey=e,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");d(b,"setBiomoleculeAtomCounts",function(){for(var a=this.vBiomolecules.size();0<=--a;){for(var e=
this.vBiomolecules.get(a),c=e.get("biomts"),g=e.get("chains"),f=0,c=c.size();0<=--c;)for(var q=g.get(c),b=q.length-1;0<=--b;)":"==q.charAt(b)&&(f+=this.biomtChainAtomCounts[0+q.charAt(b+1).charCodeAt(0)]);e.put("atomCount",Integer.$valueOf(f))}});d(b,"remark350",function(){var a=null,e=null;this.vBiomolecules=new JU.Lst;this.biomtChainAtomCounts=D(255,0);for(var c="",g="",f="",q=!0,b=null,d=0,k=JU.M4.newM4(null);;){q?this.readHeader(!0):q=!0;if(null==this.line||!this.line.startsWith("REMARK 350"))break;
try{if(this.line.startsWith("REMARK 350 BIOMOLECULE:")&&(0<d&&JU.Logger.info("biomolecule "+f+": number of transforms: "+d),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",e=new JU.Lst),b.put("biomts",a=new JU.Lst),this.vBiomolecules.addLast(b),d=0),0<=this.line.indexOf("APPLY THE FOLLOWING TO CHAINS:"))if(null==b)q=
!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(q=!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 ")){d++;for(var m=N(16,0),x=0;12>x;){var h=this.getTokens();m[x++]=this.parseFloatStr(h[4]);m[x++]=this.parseFloatStr(h[5]);m[x++]=this.parseFloatStr(h[6]);m[x++]=this.parseFloatStr(h[7]);(4==x||8==x)&&this.readHeader(!0)}m[15]=1;var A=new JU.M4;A.setA(m);A.equals(k)?(a.add(0,A),e.add(0,g)):(a.addLast(A),e.addLast(g))}}catch(u){if($(u,
Exception))return this.vBiomolecules=this.thisBiomolecule=null,!1;throw u;}}0<d&&JU.Logger.info("biomolecule "+f+": number of transforms: "+d);return!1});d(b,"remark285",function(){return!0});d(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});d(b,"getSerial",
function(a,e){var c=this.line.charAt(a),g=" "==c||" "==this.line.charAt(e-1);switch(this.serMode){default:case 0:if(g)return this.parseIntRange(this.line,a,e);try{return this.serial=Integer.parseInt(this.line.substring(a,e))}catch(f){if($(f,Exception))return this.serMode=JU.PT.isDigit(c)?1:2,this.getSerial(a,e);throw f;}case 2:return g||JU.PT.isDigit(c)?this.parseIntRange(this.line,a,e):JU.PT.parseIntRadix(this.line.substring(a,e),36)+(JU.PT.isUpperCase(c)?-16696160:26973856);case 1:if(!g)return this.serial=
JU.PT.parseIntRadix(this.line.substring(a,e),16);this.serMode=0;return this.getSerial(a,e)}},"~N,~N");d(b,"getSeqNo",function(a,e){var c=this.line.charAt(a),g=" "==c||" "==this.line.charAt(e-1);switch(this.seqMode){default:case 0:if(g)return this.parseIntRange(this.line,a,e);try{return Integer.parseInt(this.line.substring(a,e))}catch(f){if($(f,Exception))return this.seqMode=JU.PT.isDigit(c)?1:2,this.getSeqNo(a,e);throw f;}case 2:return g||JU.PT.isDigit(c)?this.parseIntRange(this.line,a,e):JU.PT.parseIntRadix(this.line.substring(a,
e),36)+(JU.PT.isUpperCase(c)?-456560:756496);case 1:if(!g)return JU.PT.parseIntRadix(this.line.substring(a,e),16);this.seqMode=0;return this.getSeqNo(a,e)}},"~N,~N");d(b,"processAtom",function(a,e,c,g,f,q,b,d,k){a.atomName=e;" "!=c&&(a.altLoc=c);a.group3=null==g?"UNK":g;a.chainID=f;null!=this.biomtChainAtomCounts&&this.biomtChainAtomCounts[f%256]++;a.sequenceNumber=q;a.insertionCode=J.api.JmolAdapter.canonizeInsertionCode(b);a.isHetero=d;a.elementSymbol=k;return a},"J.adapter.smarter.Atom,~S,~S,~S,~N,~N,~S,~B,~S");
d(b,"processAtom2",function(a,e,c,g,f,q){a.atomSerial=e;e>this.maxSerial&&(this.maxSerial=e);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=q;this.haveMappedSerials?this.asc.addAtomWithMappedSerialNumber(a):this.asc.addAtom(a);this.setAdditionalAtomParameters(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");d(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 e=this.line.substring(this.atomTypePt0,this.atomTypePt0+this.atomTypeLen).trim();0<e.length&&(a.atomName+="\x00"+e)}if(this.filterPDBAtom(a,this.fileAtomIndex++)){var e=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))e=c.charCodeAt(0)-48,"-"==g&&(e=-e);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,e)}});d(b,"filterPDBAtom",function(a,e){if(!this.filterAtom(a,e))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");d(b,"setAdditionalAtomParameters",function(a){var e;this.gromacsWideFormat?(e=this.parseFloatRange(this.line,60,68),a.bfactor=J.adapter.readers.pdb.PdbReader.fixRadius(this.parseFloatRange(this.line,68,76))):(e=this.parseFloatRange(this.line,54,60),a.bfactor=this.parseFloatRange(this.line,60,66));a.foccupancy=Float.isNaN(e)?1:e},"J.adapter.smarter.Atom");
d(b,"deduceElementSymbol",function(a){if(78<=this.lineLength){var e=this.line.charAt(76),c=this.line.charAt(77);if(" "==e&&J.adapter.smarter.Atom.isValidSym1(c))return""+c;if(J.adapter.smarter.Atom.isValidSymNoCase(e,c))return""+e+c}e=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(e,c))return a||"H"!=e?""+e+c:"H";if("H"==e)return"H";if((null==this.htElementsInCurrentGroup||
null!=this.htElementsInCurrentGroup.get(""+c))&&J.adapter.smarter.Atom.isValidSym1(c))return""+c;if(" "!=e&&(null==this.htElementsInCurrentGroup||null!=this.htElementsInCurrentGroup.get(""+e))&&J.adapter.smarter.Atom.isValidSym1(e))return""+e;a=this.line.charAt(14);return" "==e&&"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");d(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 e=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:e=2048;break;case 41:continue}var f=this.getSerial(g,g+5);if(!(0>f)){var q=a==this.lastSourceSerial&&f==this.lastTargetSerial;q&&(this.haveDoubleBonds=!0);this.lastSourceSerial=a;this.lastTargetSerial=f;var b;f<a?(b=f,f=a):b=a;var d=";"+b+" "+f+";";if(!(0<=this.sbConect.indexOf(d))||
q){if(this.haveDoubleBonds){q="--"+d;if(0<=this.sbConect.indexOf(q))continue;this.sb.append(q)}this.sbConect.append(d);this.addConnection(D(-1,[b,f,e]))}}}this.sbConect.appendSB(this.sb)}});d(b,"structure",function(){var a=J.c.STR.NONE,e=J.c.STR.NONE,c,g,f,q,b=0;if(this.line.startsWith("HELIX "))a=J.c.STR.HELIX,c=19,g=21,f=31,q=33,40<=this.line.length&&(e=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,q=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,q=31;else return;if(!(this.lineLength<q+4)){var d=this.line.substring(11,15).trim(),k=this.line.substring(7,10).trim();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,q,q+4),x=" ";this.lineLength>q+4&&(x=this.line.charAt(q+4));
e===J.c.STR.NONE&&(e=a);a=new J.adapter.smarter.Structure(-1,a,e,d,k,b,null);a.set(c,p,g,f,m,x,0,0);this.asc.addStructure(a)}});d(b,"getModelNumber",function(){var a=14;a>this.lineLength&&(a=this.lineLength);a=this.parseIntRange(this.line,6,a);return-2147483648==a?0:a});d(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});d(b,"model",function(a,e){this.checkNotPDB();
null==e&&(e=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",e);this.checkUnitCellParams();this.isCourseGrained||this.setModelPDB(!0);this.asc.setCurrentAtomSetNumber(a);this.isCourseGrained&&this.asc.setCurrentModelInfo("courseGrained",Boolean.TRUE)},"~N,~S");d(b,"checkNotPDB",
function(){var a=!this.isCourseGrained&&(0==this.nRes||this.nUNK!=this.nRes);this.checkNearAtoms=!a;this.setModelPDB(a);this.nUNK=this.nRes=0;this.currentGroup3=null});d(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.addSpaceGroupName(JU.PT.parseTrimmedRange(this.line,55,66))});d(b,"addSpaceGroupName",function(a){this.isbiomol&&(this.doConvertToFractional=
!1);(null==this.sgName||this.sgName.equals("unspecified!"))&&this.setSpaceGroupName(a);this.fileSgName=this.sgName},"~S");d(b,"getFloat",function(a,e){return this.parseFloatRange(this.line,a,a+e)},"~N,~N");d(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");d(b,"expdta",function(){0<=this.line.toUpperCase().indexOf("NMR")&&this.asc.setInfo("isNMRdata","true")});d(b,"formul",function(){var a=this.parseTokenRange(this.line,12,15),e=JU.PT.parseTrimmedRange(this.line,19,70),c=e.indexOf("(");if(0<=c){var g=e.indexOf(")");if(0>g||c>=g||c+1==g)return;e=JU.PT.parseTrimmedRange(e,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(e));)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))});d(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 e=JU.PT.parseTrimmedRange(this.line,30,70);this.htHetero.put(a,e)}}});d(b,"hetnam",function(){null==this.htHetero&&(this.htHetero=new java.util.Hashtable);
var a=this.parseTokenRange(this.line,11,14),e=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&&(e=c+e);this.htHetero.put(a,e);this.appendLoadNote(a+" = "+e)}});d(b,"anisou",function(){var a=N(8,0);a[6]=1;var e=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}e=this.asc.getAtomFromName(e);if(null!=e){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(e,a,12)}});d(b,"site",function(){null==this.htSites&&(this.htSites=new java.util.Hashtable);var a=this.parseIntRange(this.line,15,17),e=JU.PT.parseTrimmedRange(this.line,
11,14),c=this.htSites.get(e);null==c&&(c=new java.util.Hashtable,c.put("nResidues",Integer.$valueOf(a)),c.put("groups",""),this.htSites.put(e,c));a=c.get("groups");for(e=0;4>e;e++){var g=18+11*e,f=JU.PT.parseTrimmedRange(this.line,g,g+3);if(0==f.length)break;var q=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<q.length&&(a+=":"+q);c.put("groups",a)}});
d(b,"remarkTls",function(){for(var a=0,e=0,c=null,g=null,f=null,q=null,b=null,d=this.line.substring(0,11);null!=this.readHeader(!0)&&this.line.startsWith(d);)try{var k=JU.PT.getTokens(this.line.substring(10).$replace(":"," "));if(!(2>k.length))if(JU.Logger.info(this.line),k[1].equalsIgnoreCase("GROUP"))f=new java.util.Hashtable,q=new JU.Lst,f.put("ranges",q),g.addLast(f),this.tlsGroupID=this.parseIntStr(k[k.length-1]),f.put("id",Integer.$valueOf(this.tlsGroupID));else if(k[0].equalsIgnoreCase("NUMBER")){if(!k[2].equalsIgnoreCase("COMPONENTS")){a=
this.parseIntStr(k[k.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(k[0].equalsIgnoreCase("COMPONENTS"))c=this.line;else if(k[0].equalsIgnoreCase("RESIDUE")){var b=new java.util.Hashtable,p,m,x,h;if(6==k.length)p=k[2].charAt(0),m=k[4].charAt(0),x=this.parseIntStr(k[3]),h=this.parseIntStr(k[5]);else{var A=c.indexOf(" C "),u=c.indexOf(" C ",A+4);p=this.line.charAt(u);m=this.line.charAt(A);x=this.parseIntRange(this.line,
u+1,A);h=this.parseIntStr(this.line.substring(A+1))}p==m?(b.put("chains",""+p+m),x<=h?(b.put("residues",D(-1,[x,h])),q.addLast(b)):this.tlsAddError(" TLS group residues are not in order (range ignored)")):this.tlsAddError(" TLS group chains are different (range ignored)")}else if(k[0].equalsIgnoreCase("SELECTION"))for(var v="\x00",n=1;n<k.length;n++)if(0<=k[n].toUpperCase().indexOf("CHAIN"))v=k[++n].charAt(0);else{var w=this.parseIntStr(k[n]);-2147483648!=w&&(b=new java.util.Hashtable,b.put("residues",
D(-1,[w,this.parseIntStr(k[++n])])),"\x00"!=v&&b.put("chains",""+v+v),q.addLast(b))}else if(k[0].equalsIgnoreCase("ORIGIN")){var Y=new JU.P3;f.put("origin",Y);if(8==k.length)Y.set(this.parseFloatStr(k[5]),this.parseFloatStr(k[6]),this.parseFloatStr(k[7]));else{var s=this.line.length;Y.set(this.parseFloatRange(this.line,s-27,s-18),this.parseFloatRange(this.line,s-18,s-9),this.parseFloatRange(this.line,s-9,s))}if(Float.isNaN(Y.x)||Float.isNaN(Y.y)||Float.isNaN(Y.z))Y.set(NaN,NaN,NaN),this.tlsAddError("invalid origin: "+
this.line)}else if(k[1].equalsIgnoreCase("TENSOR")){var t=k[0].charAt(0),B=(this.readHeader(!0).substring(10)+this.readHeader(!0).substring(10)+this.readHeader(!0).substring(10)).$replace(t," ").$replace(":"," "),k=JU.PT.getTokens(B),C=N(3,3,0);f.put("t"+t,C);for(n=0;n<k.length;n++){var r=k[n].charAt(0).charCodeAt(0)-49,y=k[n].charAt(1).charCodeAt(0)-49;C[r][y]=this.parseFloatStr(k[++n]);r<y&&(C[y][r]=C[r][y])}for(n=0;3>n;n++)for(v=0;3>v;v++)Float.isNaN(C[n][v])&&this.tlsAddError("invalid tensor: "+
JU.Escape.escapeFloatAA(C,!1));if("S"==t&&++e==a){JU.Logger.info(a+" TLS groups read");this.readHeader(!0);break}}}catch(z){if($(z,Exception)){JU.Logger.error(this.line+"\nError in TLS parser: ");System.out.println(z.getMessage());g=null;break}else throw z;}null!=g&&(e=new java.util.Hashtable,e.put("groupCount",Integer.$valueOf(a)),e.put("groups",g),this.vTlsModels.addLast(e));return 1>a});d(b,"handleTlsMissingModels",function(){this.vTlsModels=null});d(b,"setTlsGroups",function(a,e,c){JU.Logger.info("TLS model "+
(e+1)+" set "+(a+1));a=this.vTlsModels.get(a);for(var g=a.get("groups"),f=this.asc.getAtomSetAtomIndex(e),q=N(this.asc.getAtomSetAtomCount(e),0),b=f+q.length,d=this.asc.atoms,k=g.size(),p=0;p<k;p++){var m=g.get(p),x=m.get("ranges");this.tlsGroupID=m.get("id").intValue();for(var h=x.size();0<=--h;){var n=x.get(h).get("chains"),u=x.get(h).get("residues"),v=0+n.charAt(0).charCodeAt(0),n=0+n.charAt(1).charCodeAt(0),w=u[0],u=u[1],s=this.findAtomForRange(f,b,v,w,!1),t=0<=s?this.findAtomForRange(s,b,n,u,
!1):-1;if(0>t){JU.Logger.info("TLS processing terminated");return}JU.Logger.info("TLS ID="+this.tlsGroupID+" model atom index range "+s+"-"+t);s=v==n;for(t=f;t<b;t++){var r=d[t];if(s?r.sequenceNumber>=w&&r.sequenceNumber<=u:r.chainID>v&&r.chainID<n||r.chainID==v&&r.sequenceNumber>=w||r.chainID==n&&r.sequenceNumber<=u)q[t-f]=this.tlsGroupID,this.setTlsTensor(r,m,c)}}}this.asc.setAtomProperties("tlsGroup",q,e,!0);this.asc.setModelInfoForSet("TLS",a,e);this.asc.setTensors()},"~N,~N,J.adapter.smarter.XtalSymmetry.FileSymmetry");
d(b,"findAtomForRange",function(a,e,c,g,f){a=this.findAtom(a,e,c,g,!0);return f&&0<=a?this.findAtom(a,e,c,g,!1):a},"~N,~N,~N,~N,~B");d(b,"findAtom",function(a,e,c,g,f){for(var q=this.asc.atoms;a<e;a++){var b=q[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:e},"~N,~N,~N,~N,~B");d(b,"setTlsTensor",function(a,e,c){var g=e.get("origin");if(!Float.isNaN(g.x)){var f=
e.get("tT"),q=e.get("tL");e=e.get("tS");if(!(null==f||null==q||null==e)){var b=0.017453292519943295*(a.x-g.x),d=0.017453292519943295*(a.y-g.y),g=0.017453292519943295*(a.z-g.z),k=b*b,p=d*d,m=g*g,x=b*d,h=b*g,n=d*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=N(8,0),u=Float.isNaN(a.bfactor)?0:a.bfactor/78.95683520871486;f[0]=this.dataT[0]+q[1][1]*m+q[2][2]*p-2*q[1][2]*n+2*e[1][0]*g-2*e[2][0]*
d;f[1]=this.dataT[1]+q[0][0]*m+q[2][2]*k-2*q[2][0]*h-2*e[0][1]*g+2*e[2][1]*b;f[2]=this.dataT[2]+q[0][0]*p+q[1][1]*k-2*q[0][1]*x-2*e[1][2]*b+2*e[0][2]*d;f[3]=this.dataT[3]-q[2][2]*x+q[1][2]*h+q[2][0]*n-q[0][1]*m-e[0][0]*g+e[1][1]*g+e[2][0]*b-e[2][1]*d;f[4]=this.dataT[4]-q[1][1]*h+q[1][2]*x-q[2][0]*p+q[0][1]*n+e[0][0]*d-e[2][2]*d+e[1][2]*g-e[1][0]*b;f[5]=this.dataT[5]-q[0][0]*n-q[1][2]*k+q[2][0]*x+q[0][1]*h-e[1][1]*b+e[2][2]*b+e[0][1]*d-e[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.adapter.smarter.XtalSymmetry.FileSymmetry");d(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=d(b,"fixRadius",function(a){return 0.9>a?1:a},"~N");d(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");d(b,"connectAllBad",function(a){for(var e=this.connectNextAtomIndex,c=this.connectNextAtomSet;c<this.asc.atomSetCount;c++){var g=this.asc.getAtomSetAtomCount(c);this.asc.setModelInfoForSet("PDB_CONECT_firstAtom_count_max",D(-1,[e,g,a]),c);null!=this.vConnect&&(this.asc.setModelInfoForSet("PDB_CONECT_bonds",
this.vConnect,c),this.asc.setGlobalBoolean(3));e+=g}this.vConnect=null;this.connectNextAtomSet=this.asc.iSet+1;this.connectNextAtomIndex=e},"~N");d(b,"connectAll",function(a,e){var c=this.asc,g=c.iSet;if(!(0>g))if(e)this.connectAllBad(a);else if(c.setCurrentModelInfo("PDB_CONECT_firstAtom_count_max",D(-1,[c.getAtomSetAtomIndex(g),c.getAtomSetAtomCount(g),a])),null!=this.vConnect){for(var f=this.connectNextAtomIndex,q=c.atomSetCount;--q>=this.connectNextAtomSet;)c.setModelInfoForSet("PDB_CONECT_bonds",
this.vConnect,q),c.setGlobalBoolean(3),f+=c.getAtomSetAtomCount(q);this.vConnect=null;this.connectNextAtomSet=g+1;this.connectNextAtomIndex=f}},"~N,~B")});s("J.adapter.smarter");t(null,"J.adapter.smarter.Structure",["J.c.STR"],function(){var b=z(function(){this.strandID=this.structureID=this.substructureType=this.structureType=null;this.startChainID=this.startSequenceNumber=this.strandCount=0;this.startInsertionCode="\x00";this.endChainID=this.endSequenceNumber=0;this.endInsertionCode="\x00";this.bsAll=
this.modelStartEnd=this.atomStartEnd=null;y(this,arguments)},J.adapter.smarter,"Structure",null,Cloneable);X(b,function(){this.atomStartEnd=D(2,0);this.modelStartEnd=D(-1,[-1,-1])});F(b,function(a,e,c,g,f,q,b){null!=b?(this.modelStartEnd=D(-1,[0,a]),this.bsAll=b):(this.structureType=e,this.substructureType=c,null!=g&&(this.modelStartEnd[0]=this.modelStartEnd[1]=a,this.structureID=g,this.strandCount=q,this.strandID=f))},"~N,J.c.STR,J.c.STR,~S,~S,~N,~A");b.getHelixType=d(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");d(b,"set",function(a,e,c,g,f,q,b,d){this.startChainID=a;this.startSequenceNumber=e;this.startInsertionCode=c;this.endChainID=g;this.endSequenceNumber=f;this.endInsertionCode=q;this.atomStartEnd[0]=b;this.atomStartEnd[1]=d},"~N,~N,~S,~N,~N,~S,~N,~N");d(b,"clone",function(){var a=null;try{a=ea(this,J.adapter.smarter.Structure,"clone",[])}catch(e){if(!$(e,"CloneNotSupportedException"))throw e;}return a})});s("JM");
t(["JM.Group"],"JM.Monomer","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;y(this,arguments)},JM,"Monomer",JM.Group);F(b,function(){R(this,JM.Monomer,[])});b.have=d(b,"have",function(a,e){return 255!=(a[e]&255)},"~A,~N");d(b,"set2",function(a,e,c,g,f,q){this.setGroup(a,e,c,g,f);this.offsets=
q;this.setLeadAtomIndex();return this},"JM.Chain,~S,~N,~N,~N,~A");d(b,"setLeadAtomIndex",function(){var a=this.offsets[0]&255;255!=a&&(this.leadAtomIndex=this.firstAtomIndex+a)});d(b,"setBioPolymer",function(a,e){this.bioPolymer=a;this.monomerIndex=e},"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});d(b,"getMonomerIndex",function(){return this.monomerIndex});h(b,"getAtomIndex",function(a,e){if(null!=this.bioPolymer){var c=this.bioPolymer.monomers,g=this.monomerIndex+e;if(0<=g&&g<c.length){c=c[g];if(1==e&&!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");d(b,"getBioPolymerIndexInModel",function(){return null==this.bioPolymer?-1:this.bioPolymer.bioPolymerIndexInModel});b.scanForOffsets=d(b,"scanForOffsets",function(a,e,c){for(var g=c.length,f=K(g,0);0<=--g;){var q,b=c[g];if(0>b)q=e[~b];else if(q=e[b],0>q)return null;var d;if(0>q)d=255;else if(d=q-a,0>d||254<d)JU.Logger.warn("Monomer.scanForOffsets i="+g+" atomID="+b+" atomIndex:"+q+" firstAtomIndex:"+a+" offset out of 0-254 range. Groups aren't organized correctly. Is this really a protein?: "+
d),0>b&&(d=255);f[g]=d}return f},"~N,~A,~A");h(b,"getProteinStructureType",function(){return J.c.STR.NONE});d(b,"isHelix",function(){return!1});d(b,"isSheet",function(){return!1});h(b,"setStrucNo",function(){},"~N");d(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");d(b,"getSpecialAtom",function(a,e){for(var c=a.length;0<=--c;){var g=a[c];0>g&&(g=-g);if(e==g)return c=this.offsets[c]&
255,255==c?null:this.chain.model.ms.at[this.firstAtomIndex+c]}return null},"~A,~N");d(b,"getSpecialAtomPoint",function(a,e){for(var c=a.length;0<=--c;){var g=a[c];0>g&&(g=-g);if(e==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)});d(b,"getWingAtom",function(){return this.getAtomFromOffsetIndex(1)});d(b,"getInitiatorAtom",
function(){return this.getLeadAtom()});d(b,"getTerminatorAtom",function(){return this.getLeadAtom()});d(b,"findNearestAtomIndex",function(){},"~N,~N,~A,~N,~N");d(b,"getMyInfo",function(a){a=this.getGroupInfo(this.groupIndex,a);a.put("chain",this.chain.getIDStr());var e=this.getResno();0<e&&a.put("sequenceNumber",Integer.$valueOf(e));e=this.getInsertionCode();0!=e.charCodeAt(0)&&a.put("insertionCode",""+e);e=this.getGroupParameter(1111490569);Float.isNaN(e)||a.put("phi",Float.$valueOf(e));e=this.getGroupParameter(1111490570);
Float.isNaN(e)||a.put("psi",Float.$valueOf(e));e=this.getGroupParameter(1111490565);Float.isNaN(e)||a.put("mu",Float.$valueOf(e));e=this.getGroupParameter(1111490576);Float.isNaN(e)||a.put("theta",Float.$valueOf(e));e=this.getStructure();r(e,"JM.ProteinStructure")&&(a.put("structureId",Integer.$valueOf(e.strucNo)),a.put("structureType",e.type.getBioStructureTypeName(!1)));a.put("shapeVisibilityFlags",Integer.$valueOf(this.shapeVisibilityFlags));return a},"JU.P3");h(b,"getStructureId",function(){var a=
this.getStructure();return r(a,"JM.ProteinStructure")?a.type.getBioStructureTypeName(!1):""});d(b,"updateOffsetsForAlternativeLocations",function(a,e){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],j=b.atomID;if(0!=b.altloc.charCodeAt(0))for(var d=this.lastAtomIndex-this.firstAtomIndex,k=1;k<=d;k++){var p=f+k;p>this.lastAtomIndex&&(p-=d+1);var m=p-this.firstAtomIndex;if(!(0>m||255<m||p==f||!e.get(p))){var x=a[p].atomID;if(!(x!=j||
0==x&&!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");d(b,"getMonomerSequenceAtoms",function(a,e){this.setAtomBits(e);e.and(a)},"JU.BS,JU.BS");b.checkOptional=d(b,"checkOptional",function(a,e,c,g){if(JM.Monomer.have(a,e))return!0;if(0>g)return!1;a[e]=g-c;return!0},"~A,~N,~N,~N");d(b,"getQuaternionFrameCenter",function(){return null},"~S");d(b,"getHelixData2",function(a,e,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(e),b=1>c?JU.Quat.getQuaternionFrameV(JV.JC.axisX,JV.JC.axisY,JV.JC.axisZ,!1):null==f?null:f.getQuaternion(e);if(null==b||null==g)return ea(this,JM.Monomer,"getHelixData",[a,e,c]);var f=1>c?JU.P3.new3(0,0,0):f.getQuaternionFrameCenter(e),j=this.getQuaternionFrameCenter(e);return null==f||null==j?this.getHelixData(a,e,c):JU.Escape.escapeHelical(135176==a?"helixaxis"+
this.getUniqueID():null,a,f,j,JU.Measure.computeHelicalAxis(f,j,g.div(b)))},"~N,~S,~N");d(b,"getUniqueID",function(){var a=this.chain.chainID,e=this.getLeadAtom(),a=(null==e?"":"_"+e.mi)+"_"+this.getResno()+(0==a?"":"_"+a),e=null==e?"\x00":this.getLeadAtom().altloc;"\x00"!=e&&(a+="_"+e);return a});h(b,"isCrossLinked",function(a){for(var e=this.firstAtomIndex;e<=this.lastAtomIndex;e++)if(this.getCrossLinkGroup(e,null,a,!0,!0,!1))return!0;return!1},"JM.Group");h(b,"getCrossLinkVector",function(a,e,
c){for(var g=null==a,f=this.firstAtomIndex;f<=this.lastAtomIndex;f++)if(this.getCrossLinkGroup(f,a,null,e,c,g)&&g)return!0;return!g&&0<a.size()},"JU.Lst,~B,~B");d(b,"getCrossLinkGroup",function(a,e,c,g,f,b){var j=this.chain.model.ms.at[a],d=j.bonds,k=this.getBioPolymerIndexInModel();if(0>k||null==d)return!1;var p=!1;b=!b&&null==e&&null==c;for(var m=0;m<d.length;m++){var x=d[m];if(!(x.isCovalent()?!g:!f)){var x=x.getOtherAtom(j),h=x.group;if(!(null!=c&&h!==c)){var n=h.getBioPolymerIndexInModel(),u=
h.getMonomerIndex();if(b){if(n==k&&u==this.monomerIndex-1)return!0}else if(0<=n&&0<=u&&(n!=k||u<this.monomerIndex-1||u>this.monomerIndex+1)){p=!0;if(null!=c||null==e)break;e.addLast(Integer.$valueOf(a));e.addLast(Integer.$valueOf(x.i));e.addLast(Integer.$valueOf(h.leadAtomIndex))}}}}return p},"~N,JU.Lst,JM.Group,~B,~B,~B");d(b,"isConnectedPrevious",function(){return!0});d(b,"setGroupParameter",function(a,e){switch(a){case 1111490569:this.phi=e;break;case 1111490570:this.psi=e;break;case 1111490568:this.omega=
e;break;case 1111490565:this.mu=e;break;case 1111490576:this.theta=e;break;case 1111490574:this.straightness=e}},"~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()});d(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()+"]"})});s("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;y(this,arguments)},JM,"AlphaMonomer",JM.Monomer);ba(b,function(){});h(b,"isProtein",function(){return!0});b.validateAndAllocateA=d(b,"validateAndAllocateA",function(a,e,c,g,f,b){return g!=f||b[2]!=g?null:(new JM.AlphaMonomer).set2(a,e,c,g,f,JM.AlphaMonomer.alphaOffsets)},"JM.Chain,~S,~N,~N,~N,~A");d(b,"isAlphaMonomer",function(){return!0});
h(b,"getStructure",function(){return this.proteinStructure});d(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,e){null!=this.proteinStructure&&this.proteinStructure.removeMonomer(this.monomerIndex);if(0>e||0<e&&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(e)),null!=this.proteinStructure&&this.proteinStructure.addMonomer(this.monomerIndex);return this.monomerIndex},"J.c.STR,~N");d(b,"getAtom",function(a){return 2==a?this.getLeadAtom():
null},"~N");d(b,"getAtomPoint",function(a){return 2==a?this.getLeadAtom():null},"~N");h(b,"isConnectedAfter",function(a){if(null==a)return!0;var e=this.getLeadAtom();a=a.getLeadAtom();return e.isBonded(a)||4.2>=e.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");
d(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,e,c){return this.getHelixData2(a,e,c)},"~N,~S,~N");h(b,"getQuaternion",function(a){return this.getQuaternionAlpha(a)},"~S");d(b,"getQuaternionAlpha",function(a){if(0>this.monomerIndex)return null;var e=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);e.sub2(g,a);c.sub2(f,a)}return JU.Quat.getQuaternionFrameV(e,c,null,!1)},"~S");b.alphaOffsets=K(-1,[0])});s("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.strucNo=0;this.serialID=null;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;y(this,arguments)},JM,"ProteinStructure",null,JM.Structure);F(b,function(){this.incrementID()});d(b,"incrementID",function(){this.id=++JM.ProteinStructure.ids});d(b,"setupPS",function(a,e,c,g){this.strucNo=++JM.ProteinStructure.globalStrucNo;this.apolymer=
a;this.type=e;this.vectorProjection=new JU.V3;this.monomerIndexFirst=c;this.addMonomer(c+g-1);JU.Logger.debugging&&JU.Logger.info("Creating ProteinStructure "+this.strucNo+" "+e.getBioStructureTypeName(!1)+" from "+a.monomers[this.monomerIndexFirst]+" through "+a.monomers[this.monomerIndexLast]+" in polymer "+a)},"JM.AlphaPolymer,J.c.STR,~N,~N");d(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");d(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 e=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<e;b++,
a++)c[a].setStructure(null),f=c[a].setProteinStructureType(g,f)}},"~N");d(b,"calcAxis",function(){});d(b,"isWithin",function(a){return a>this.monomerIndexFirst&&a<this.monomerIndexLast},"~N");d(b,"getIndex",function(a){if(null==this.resMap){this.resMap=new java.util.Hashtable;for(var e=this.nRes;0<=--e;)this.resMap.put(this.apolymer.monomers[this.monomerIndexFirst+e],Integer.$valueOf(e))}a=this.resMap.get(a);return null==a?-1:a.intValue()},"JM.Monomer");d(b,"getSegments",function(){null==this.segments&&
this.calcSegments();return this.segments});d(b,"getStructureMidPoint",function(a){null==this.segments&&this.calcSegments();return this.segments[a]},"~N");d(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 e=1;e<this.nRes;e++)(this.segments[e]=new JU.P3).add2(this.segments[e-1],a)}});d(b,
"getAxisStartPoint",function(){this.calcAxis();return this.axisA});d(b,"getAxisEndPoint",function(){this.calcAxis();return this.axisB});d(b,"resetAxes",function(){this.segments=this.axisA=null});h(b,"setAtomBits",function(a){for(var e=this.apolymer.monomers,c=this.monomerIndexFirst;c<=this.monomerIndexLast;c++)e[c].setAtomBits(a)},"JU.BS");h(b,"setAtomBitsAndClear",function(a,e){for(var c=this.apolymer.monomers,g=this.monomerIndexFirst;g<=this.monomerIndexLast;g++)c[g].setAtomBitsAndClear(a,e)},"JU.BS,JU.BS");
d(b,"findMonomer",function(a,e){var c=this.apolymer.monomers;if(0>this.monomerIndexFirst)return null;if(e)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+
")]"});b.ids=0;b.globalStrucNo=1E3});s("JM");t(["JM.ProteinStructure"],"JM.Helix",["JU.Measure","$.P3","$.V3","J.c.STR"],function(){var b=H(JM,"Helix",JM.ProteinStructure);F(b,function(a,e,c,g){R(this,JM.Helix,[]);this.setupPS(a,J.c.STR.HELIX,e,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),e=0;e<=this.nRes;e++)this.apolymer.getLeadMidPoint(this.monomerIndexFirst+e,a[e]=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)}})});s("JM");t(["JM.ProteinStructure"],"JM.Sheet",["JU.Measure","$.P3","$.V3","J.c.STR"],function(){var b=z(function(){this.heightUnitVector=this.widthUnitVector=null;y(this,arguments)},JM,"Sheet",JM.ProteinStructure);F(b,function(a,e,c,g){R(this,JM.Sheet,[]);
this.incrementID();this.setupPS(a,J.c.STR.SHEET,e,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 e=new JU.P3;this.apolymer.getLeadMidPoint(this.monomerIndexFirst+this.nRes,e);this.notHelixOrSheet(this.monomerIndexFirst+this.nRes)&&JU.Measure.projectOntoAxis(e,this.axisA,this.axisUnitVector,this.vectorProjection);
this.axisA=a;this.axisB=e}});d(b,"notHelixOrSheet",function(a){return 0>a||a>=this.apolymer.monomerCount||!this.apolymer.monomers[a].isHelix()&&!this.apolymer.monomers[a].isSheet()},"~N");d(b,"calcSheetUnitVectors",function(){if(r(this.apolymer,"JM.AminoPolymer")&&null==this.widthUnitVector){var a=new JU.V3,e=new JU.V3,c=this.apolymer.monomers[this.monomerIndexFirst];e.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>e.angle(a)?e.add(a):e.sub(a);this.heightUnitVector=a;this.heightUnitVector.cross(this.axisUnitVector,e);this.heightUnitVector.normalize();this.widthUnitVector=e;this.widthUnitVector.cross(this.axisUnitVector,this.heightUnitVector)}});d(b,"setBox",function(a,e,c,g,f,b,j){null==this.heightUnitVector&&this.calcSheetUnitVectors();g.setT(this.widthUnitVector);g.scale(j*a);f.setT(this.heightUnitVector);f.scale(j*e);b.ave(g,f);b.sub2(c,
b)},"~N,~N,JU.P3,JU.V3,JU.V3,JU.P3,~N")});s("JM");t(["JM.ProteinStructure"],"JM.Turn",["J.c.STR"],function(){var b=H(JM,"Turn",JM.ProteinStructure);F(b,function(a,e,c){R(this,JM.Turn,[]);this.setupPS(a,J.c.STR.TURN,e,c);this.subtype=J.c.STR.TURN},"JM.AlphaPolymer,~N,~N")});s("JM");t(["JM.Structure","JU.V3"],"JM.BioPolymer",["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;y(this,arguments)},JM,"BioPolymer",null,JM.Structure);X(b,function(){this.unitVectorX=JU.V3.new3(1,0,0)});F(b,function(a,e){this.monomers=a;this.hasStructure=e;for(var c=this.monomerCount=a.length;0<=
--c;)a[c].setBioPolymer(this,c);this.model=a[0].getModel()},"~A,~B");h(b,"setAtomBits",function(a){this.getRange(a,!0)},"JU.BS");h(b,"setAtomBitsAndClear",function(a,e){for(var c=this.monomerCount;0<=--c;)this.monomers[c].setAtomBitsAndClear(a,e)},"JU.BS,JU.BS");d(b,"getRange",function(a,e){if(0!=this.monomerCount)if(e)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");
d(b,"clearStructures",function(){});d(b,"getLeadAtomIndices",function(){null==this.leadAtomIndices&&(this.leadAtomIndices=D(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});d(b,"getIndex",function(a,e,c,g){var f;for(f=this.monomerCount;0<=--f;){var b=this.monomers[f];if(b.chain.chainID==a&&b.seqcode==e&&(0>c||c==b.firstAtomIndex||g==b.lastAtomIndex))break}return f},
"~N,~N,~N,~N");d(b,"getLeadPoint",function(a){return this.monomers[a].getLeadAtom()},"~N");d(b,"getInitiatorPoint",function(){return this.monomers[0].getInitiatorAtom()});d(b,"getTerminatorPoint",function(){return this.monomers[this.monomerCount-1].getTerminatorAtom()});d(b,"getLeadMidPoint",function(a,e){if(a==this.monomerCount)--a;else if(0<a){e.ave(this.getLeadPoint(a),this.getLeadPoint(a-1));return}e.setT(this.getLeadPoint(a))},"~N,JU.P3");d(b,"getWingPoint",function(a){return this.monomers[a].getWingAtom()},
"~N");d(b,"setConformation",function(a){for(var e=this.model.ms.at,c=!1,g=this.monomerCount;0<=--g;)this.monomers[g].updateOffsetsForAlternativeLocations(e,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(e=a.bioShapes.length;0<=--e;)c=a.bioShapes[e],c.bioPolymer===this&&c.falsifyMesh()}},"JU.BS");d(b,"recalculateLeadMidpointsAndWingVectors",function(){this.invalidLead=this.invalidControl=!0;this.getLeadAtomIndices();
this.resetHydrogenPoints();this.calcLeadMidpointsAndWingVectors()});d(b,"resetHydrogenPoints",function(){});d(b,"getLeadMidpoints",function(){null==this.leadMidpoints&&this.calcLeadMidpointsAndWingVectors();return this.leadMidpoints});d(b,"getLeadPoints",function(){null==this.leadPoints&&this.calcLeadMidpointsAndWingVectors();return this.leadPoints});d(b,"getControlPoints",function(a,e,c){c&&(this.invalidControl=!0);return!a?this.leadMidpoints:0==e?this.leadPoints:this.getControlPoints2(e)},"~B,~N,~B");
d(b,"getControlPoints2",function(a){if(!this.invalidControl&&a==this.sheetSmoothing)return this.controlPoints;this.getLeadPoints();var e=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,e);this.controlPoints[this.monomerCount]=this.getTerminatorPoint();this.invalidControl=!1;return this.controlPoints},"~N");d(b,"getControlPoint",function(a){return this.leadPoints[a]},
"~N,JU.V3");d(b,"getWingVectors",function(){null==this.leadMidpoints&&this.calcLeadMidpointsAndWingVectors();return this.wingVectors});d(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,e=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 j=null,d=1;d<this.monomerCount;++d){f=b;b=this.getLeadPoint(d);if(null==b)return;this.leadPoints[d]=b;var k=new JU.P3;k.ave(b,f);this.leadMidpoints[d]=k;this.hasWingPoints&&(a.sub2(b,f),e.sub2(f,this.getWingPoint(d-1)),c.cross(a,e),g.cross(a,c),g.normalize(),!this.twistedSheets&&(null!=j&&1.5707963267948966<j.angle(g))&&(this.reversed.set(d),g.scale(-1)),
j=this.wingVectors[d]=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(d=1;d<this.monomerCount;++d)a.sub2(this.leadMidpoints[d],this.leadPoints[d]),e.sub2(this.leadPoints[d],this.leadMidpoints[d+1]),0==e.length()?c=g:(c.cross(a,e),c.normalize(),null!=g&&1.5707963267948966<g.angle(c)&&c.scale(-1)),g=this.wingVectors[d]=JU.V3.newV(c)}this.wingVectors[0]=
this.wingVectors[1];this.wingVectors[this.monomerCount]=this.wingVectors[this.monomerCount-1]});d(b,"findNearestAtomIndex",function(a,e,c,g,f,b){for(var j=this.monomerCount;0<=--j;)if(0!=(this.monomers[j].shapeVisibilityFlags&f)){var d=this.monomers[j].getLeadAtom();d.checkVisible()&&!(null!=b&&b.get(d.i))&&(0<g[j]||0<g[j+1])&&this.monomers[j].findNearestAtomIndex(a,e,c,g[j],g[j+1])}},"~N,~N,~A,~A,~N,JU.BS");d(b,"getSelectedMonomerCount",function(){return this.selectedMonomerCount});d(b,"calcSelectedMonomersCount",
function(a){this.selectedMonomerCount=0;null==this.bsSelectedMonomers&&(this.bsSelectedMonomers=new JU.BS);this.bsSelectedMonomers.clearAll();for(var e=0;e<this.monomerCount;e++)this.monomers[e].isSelected(a)&&(++this.selectedMonomerCount,this.bsSelectedMonomers.set(e))},"JU.BS");d(b,"isMonomerSelected",function(a){return 0<=a&&this.bsSelectedMonomers.get(a)},"~N");d(b,"getPolymerPointsAndVectors",function(a,e,c,g,f){g=this.getControlPoints(g,f,!1);f=this.getWingVectors();for(var b=this.monomerCount,
j=0;j<b;j++)e.get(this.monomers[j].leadAtomIndex)?(c.addLast(P(-1,[g[j],JU.P3.newP(f[j])])),a=j):2147483646!=a&&(c.addLast(P(-1,[g[j],JU.P3.newP(f[j])])),a=2147483646);a+1<b&&c.addLast(P(-1,[g[a+1],JU.P3.newP(f[a+1])]));return a},"~N,JU.BS,JU.Lst,~B,~N");d(b,"getSequence",function(){for(var a=aa(this.monomerCount,"\x00"),e=0;e<this.monomerCount;e++)a[e]=this.monomers[e].getGroup1();return String.valueOf(a)});d(b,"getPolymerSequenceAtoms",function(a,e,c,g){for(e=Math.min(this.monomerCount,a+e);--e>=
a;)this.monomers[e].getMonomerSequenceAtoms(c,g)},"~N,~N,JU.BS,JU.BS");d(b,"getProteinStructure",function(){return null},"~N");d(b,"calcParameters",function(){this.haveParameters=!0;return this.calcEtaThetaAngles()||this.calcPhiPsiAngles()});d(b,"calcEtaThetaAngles",function(){return!1});d(b,"calcPhiPsiAngles",function(){return!1});d(b,"calculateRamachandranHelixAngle",function(){return NaN},"~N,~S");d(b,"isNucleic",function(){return 0<this.monomerCount&&r(this,"JM.NucleicPolymer")});d(b,"getRangeGroups",
function(a,e,c){for(var g=new JU.BS,f=0;f<this.monomerCount;f++)this.monomers[f].isSelected(e)&&(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");d(b,"calcRasmolHydrogenBonds",function(){},"JM.BioPolymer,JU.BS,JU.BS,JU.Lst,~N,~A,~B,~B");d(b,"getType",function(){return this.type});d(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]:"")+"]"})});s("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;y(this,arguments)},JM,"AlphaPolymer",JM.BioPolymer);F(b,function(a,c){R(this,JM.AlphaPolymer,[a,!0]);this.pt0=c},"~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");d(b,"addStructure",function(a,c,g,f,b,j,d,k,p,m,x){var h=-1,n=-1;if(p<m){if(this.monomers[0].firstAtomIndex>m||this.monomers[this.monomerCount-1].lastAtomIndex<p)return;h=p;n=m}var u;
if(!(-1==(b=this.getIndex(b,j,h,n))||-1==(u=this.getIndex(d,k,h,n)))){if(0<=p&&(p=this.monomers[b].firstAtomIndex,m=this.monomers[u].lastAtomIndex,d=x.nextSetBit(p),0<=d&&d<m))return;this.addStructureProtected(a,c,g,f,b,u)&&0<=p&&x.setBits(p,m+1)}},"J.c.STR,~S,~S,~N,~N,~N,~N,~N,~N,~N,JU.BS");d(b,"addStructureProtected",function(a,c,g,f,b,j){if(j<b)return JU.Logger.error("AlphaPolymer:addSecondaryStructure error:  indexStart:"+b+" indexEnd:"+j),!1;var d=j-b+1,k=null;switch(a){case J.c.STR.HELIX:case J.c.STR.HELIXALPHA:case J.c.STR.HELIX310:case J.c.STR.HELIXPI:k=
new JM.Helix(this,b,d,a);break;case J.c.STR.SHEET:k=new JM.Sheet(this,b,d,a);break;case J.c.STR.TURN:k=new JM.Turn(this,b,d);break;default:return JU.Logger.error("unrecognized secondary structure type"),!1}k.structureID=c;k.serialID=g;k.strandCount=f;for(a=b;a<=j;++a)this.monomers[a].setStructure(k);return!0},"J.c.STR,~S,~S,~N,~N,~N");h(b,"clearStructures",function(){for(var a=0;a<this.monomerCount;a++)this.monomers[a].setStructure(null)});d(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");d(b,"calculateAnglesInDegrees",function(){for(var a=N(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});
d(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");d(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");d(b,"calculateRunsFourOrMore",function(a){for(var c=Array(this.monomerCount),g=J.c.STR.NONE,f=JM.AlphaPolymer.Code.NADA,b=0,j=0;j<this.monomerCount;++j)if(a[j]===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,d=4;0<=--d;)c[j-d]=g;else 4<b&&(c[j]=g);else b=1,f=a[j];return c},"~A");d(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");d(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");d(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,null,0,c,f-1);c=f}}},"~A");d(b,"setStructureBS",function(a,c,g,f,b){b=b?this.pt0:0;for(var j=0,d=f.nextSetBit(b),k=0,p=this.monomerCount+b;0<=d&&d<p;d=f.nextSetBit(k+1)){if(0>(k=f.nextClearBit(d))||k>p)k=p;this.addStructureProtected(g,
JM.AlphaPolymer.dsspTypes[c]+ ++j,""+a++,3==c?1:0,d-b,k-1-b)}return a},"~N,~N,J.c.STR,JU.BS,~B");var a=H(JM.AlphaPolymer,"Code",Enum);Z(a,"NADA",0,[]);Z(a,"RIGHT_HELIX",1,[]);Z(a,"BETA_SHEET",2,[]);Z(a,"LEFT_HELIX",3,[]);Z(a,"LEFT_TURN",4,[]);Z(a,"RIGHT_TURN",5,[]);b.dsspTypes=P(-1,["H",null,"H","S","H",null,"T"])});s("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;y(this,arguments)},JM,"AminoMonomer",JM.AlphaMonomer);ba(b,function(){});b.validateAndAllocate=d(b,"validateAndAllocate",function(a,e,c,g,f,b,d){var l=JM.Monomer.scanForOffsets(g,b,JM.AminoMonomer.interestingAminoAtomIDs);if(null==l)return null;JM.Monomer.checkOptional(l,1,g,b[5]);return d[g].isHetero()&&!JM.AminoMonomer.isBondedCorrectly(g,l,d)?null:(new JM.AminoMonomer).set2(a,e,c,g,f,l)},"JM.Chain,~S,~N,~N,~N,~A,~A");b.isBondedCorrectlyRange=d(b,"isBondedCorrectlyRange",function(a,e,c,g,f){a=
c+(g[a]&255);e=c+(g[e]&255);return a!=e&&f[a].isBonded(f[e])},"~N,~N,~N,~A,~A");b.isBondedCorrectly=d(b,"isBondedCorrectly",function(a,e,c){return JM.AminoMonomer.isBondedCorrectlyRange(2,0,a,e,c)&&JM.AminoMonomer.isBondedCorrectlyRange(0,3,a,e,c)&&(!JM.Monomer.have(e,1)||JM.AminoMonomer.isBondedCorrectlyRange(3,1,a,e,c))},"~N,~A,~A");h(b,"getNitrogenAtom",function(){return this.getAtomFromOffsetIndex(2)});d(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)});d(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,e,c,g,f){var b=c[0],d=this.getNitrogenAtom();g=w(g/2);1200>
g&&(g=1200);if(0!=d.sZ){g=n(this.scaleToScreen(d.sZ,g));4>g&&(g=4);var l=this.getCarbonylCarbonAtom();f=w(f/2);1200>f&&(f=1200);f=n(this.scaleToScreen(d.sZ,f));4>f&&(f=4);var k=this.getLeadAtom();if(this.isCursorOnTopOf(k,a,e,w((g+f)/2),b)||this.isCursorOnTopOf(d,a,e,g,b)||this.isCursorOnTopOf(l,a,e,f,b))c[0]=k}},"~N,~N,~A,~N,~N");d(b,"resetHydrogenPoint",function(){this.nhChecked=!1;this.nitrogenHydrogenPoint=null});d(b,"getNitrogenHydrogenPoint",function(){null==this.nitrogenHydrogenPoint&&!this.nhChecked&&
(this.nhChecked=!0,this.nitrogenHydrogenPoint=this.getExplicitNH());return this.nitrogenHydrogenPoint});d(b,"getExplicitNH",function(){var a=this.getNitrogenAtom(),e=null,c=a.bonds;if(null!=c)for(var g=0;g<c.length;g++)if(1==(e=c[g].getOtherAtom(a)).getElementNumber())return e;return null});d(b,"getNHPoint",function(a,e,c,g){if(0>=this.monomerIndex||15==this.groupID)return!1;var f=this.getNitrogenAtom(),b=this.getNitrogenHydrogenPoint();if(null!=b&&!g)return e.sub2(b,f),a.setT(b),!0;g=this.bioPolymer.monomers[this.monomerIndex-
1];if(c)e.sub2(f,this.getLeadAtom()),e.normalize(),c=JU.V3.newVsub(f,g.getCarbonylCarbonAtom()),c.normalize(),e.add(c);else{c=g.getCarbonylOxygenAtom();if(null==c)return!1;e.sub2(g.getCarbonylCarbonAtom(),c)}e.normalize();a.add2(f,e);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 e=new JU.P3;e.ave(this.getCarbonylCarbonAtom(),a.getNitrogenAtom());return e}},"~S");h(b,"getQuaternion",function(a){if(0>this.monomerIndex)return null;var e=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(e,c);f.sub2(this.getNitrogenAtom(),c);break;case 112:case 120:if(this.monomerIndex==
this.bioPolymer.monomerCount-1)return null;g.sub2(c,e);f.sub2(this.bioPolymer.monomers[this.monomerIndex+1].getNitrogenAtom(),e);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,e);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.formatStringS("%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});d(b,"clear",function(a,e,c){if(null!=e&&(a.clear(e.i),c)){c=e.bonds;for(var g,f=c.length;0<=--f;)1==(g=c[f].getOtherAtom(e)).getElementNumber()&&a.clear(g.i)}},"JU.BS,JM.Atom,~B");b.interestingAminoAtomIDs=K(-1,[2,-5,1,3,-65])});s("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;y(this,arguments)},JM,"AminoPolymer",JM.AlphaPolymer);F(b,function(a,e){R(this,JM.AminoPolymer,[a,e]);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,e=null,c=0;c<this.monomerCount;c++){if(null!=(a=this.getProteinStructure(c))&&a!==e)(e=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});d(b,"calcPhiPsiAngles2",function(a,e){var c=a.getNitrogenAtom(),g=a.getLeadAtom(),f=a.getCarbonylCarbonAtom(),b=e.getNitrogenAtom(),d=e.getLeadAtom(),l=e.getCarbonylCarbonAtom();e.setGroupParameter(1111490569,JU.Measure.computeTorsion(f,b,d,l,!0));a.setGroupParameter(1111490570,JU.Measure.computeTorsion(c,g,f,b,!0));a.setGroupParameter(1111490568,JU.Measure.computeTorsion(g,f,b,d,!0))},"JM.AminoMonomer,JM.AminoMonomer");
h(b,"calculateRamachandranHelixAngle",function(a,e){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),d=a==this.monomerCount-1?NaN:this.monomers[a+1].getGroupParameter(1111490570);switch(e.charCodeAt(0)){default:case 112:case 114:case 80:return c=3.141592653589793*((b-f)/2)/180,g=3.141592653589793*((d-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,e,c,g,f,b,d,l){null==a&&(a=this);if(r(a,"JM.AminoPolymer")){f=new JU.P3;for(var k=new JU.V3,p,m=null==b?D(2,3,0):null,x=1;x<this.monomerCount;++x)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[x],(p=this.monomers[x]).getNHPoint(f,k,d,l)){var h=null==e||e.get(p.getNitrogenAtom().i);
if(h&&(d||null!=p.getCarbonylOxygenAtom()))this.checkRasmolHydrogenBond(p,a,x,f,h?c:e,g,m,d)}}},"JM.BioPolymer,JU.BS,JU.BS,JU.Lst,~N,~A,~B,~B");d(b,"checkRasmolHydrogenBond",function(a,e,c,g,f,b,d,l){var k=a.getLeadAtom(),p=a.getNitrogenAtom();a=a.getNitrogenAtom();for(var m,x=e.monomerCount;0<=--x;)if(!(e===this&&(x==c||x+1==c))){m=e.monomers[x];var h=m.getCarbonylOxygenAtom();if(!(null==h||null!=f&&!f.get(h.i)))if(h=m.getLeadAtom(),!(81<=k.distanceSquared(h))){h=this.calcHbondEnergy(p,g,m,l);if(h<
d[0][2])m=d[1],d[1]=d[0],d[0]=m;else if(h<d[1][2])m=d[1];else continue;m[0]=e.bioPolymerIndexInModel;m[1]=-500>h?x:-1-x;m[2]=h}}if(null!=b)for(x=0;2>x;x++)0<=d[x][1]&&this.addResidueHydrogenBond(a,e.monomers[d[x][1]].getCarbonylOxygenAtom(),e===this?c:-99,d[x][1],d[x][2]/1E3,b)},"JM.AminoMonomer,JM.BioPolymer,~N,JU.P3,JU.BS,JU.Lst,~A,~B");d(b,"calcHbondEnergy",function(a,e,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(e);
if(0.25>f)return 0;c=c.getCarbonylCarbonAtom();e=c.distanceSquared(e);if(0.25>e)return 0;c=c.distanceSquared(a);if(0.25>c)return 0;a=Math.sqrt(f);f=Math.sqrt(e);e=Math.sqrt(c);b=Math.sqrt(b);b=JM.HBond.calcEnergy(a,f,e,b);return!(-500>b&&(!g||e>f&&3>=a))&&g||-9900>b?0:b},"JU.P3,JU.P3,JM.AminoMonomer,~B");d(b,"addResidueHydrogenBond",function(a,e,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,e,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=aa(this.monomerCount,"\x00");for(var e=0;e<this.monomerCount-1;++e){var c=this.monomers[e],g=this.monomers[e+1],f=g.getGroupParameter(1111490569),b=c.getGroupParameter(1111490570);a[e]=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:"+e+" "+g.getGroupParameter(1111490569)+","+c.getGroupParameter(1111490570)+" "+a[e])}for(e=0;e<this.monomerCount;++e)if("4"==a[e]){for(c=e+1;c<this.monomerCount&&"4"==a[c];++c);c--;c>=e+3&&this.addStructureProtected(J.c.STR.HELIX,null,null,0,e,c);e=c}for(e=0;e<this.monomerCount;++e)if("3"==a[e]){for(c=e+1;c<this.monomerCount&&"3"==a[c];++c);c--;c>=e+3&&this.addStructureProtected(J.c.STR.HELIX,null,null,0,e,c);e=c}for(e=0;e<this.monomerCount;++e)if("s"==
a[e]){for(c=e+1;c<this.monomerCount&&"s"==a[c];++c);c--;c>=e+2&&this.addStructureProtected(J.c.STR.SHEET,null,null,0,e,c);e=c}for(e=0;e<this.monomerCount;++e)if("t"==a[e]){for(c=e+1;c<this.monomerCount&&"t"==a[c];++c);c--;c>=e+2&&this.addStructureProtected(J.c.STR.TURN,null,null,0,e,c);e=c}}},"~B");d(b,"isTurn",function(a,e){return JM.AminoPolymer.checkPhiPsi(this.structureList.get(J.c.STR.TURN),a,e)},"~N,~N");d(b,"isSheet",function(a,e){return JM.AminoPolymer.checkPhiPsi(this.structureList.get(J.c.STR.SHEET),
a,e)},"~N,~N");d(b,"isHelix",function(a,e){return JM.AminoPolymer.checkPhiPsi(this.structureList.get(J.c.STR.HELIX),a,e)},"~N,~N");b.checkPhiPsi=d(b,"checkPhiPsi",function(a,e,c){for(var g=0;g<a.length;g+=4)if(c>=a[g]&&c<=a[g+1]&&e>=a[g+2]&&e<=a[g+3])return!0;return!1},"~A,~N,~N");d(b,"setStructureList",function(a){this.structureList=a},"java.util.Map")});s("JM");t(null,"JM.BioModelSet","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;y(this,arguments)},JM,"BioModelSet",null);d(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});d(b,"set",function(a,e){this.vwr=a;this.ms=e;this.unitIdSets=null;null!=this.ext&&this.ext.set(a,e);return this},"JV.Viewer,JM.ModelSet");d(b,"calcAllRasmolHydrogenBonds",function(a,e,c,g,f,b,d,l){var k=this.ms.am;if(null==c){var p=
a;null!=e&&!a.equals(e)&&(p=JU.BSUtil.copy(a)).or(e);for(var m=new JU.BS,h=new JU.BS,n=this.ms.am,A=this.ms.bo,u=this.ms.bondCount;0<=--u;){var v=A[u];null==v||0==(v.order&28672)||(p.get(v.atom1.i)?m.set(u):h.set(n[v.atom1.mi].trajectoryBaseIndex))}for(u=this.ms.mc;0<=--u;)n[u].isBioModel&&(n[u].hasRasmolHBonds=h.get(u));0<=m.nextSetBit(0)&&this.ms.deleteBonds(m,!1)}for(u=this.ms.mc;0<=--u;)k[u].isBioModel&&!this.ms.isTrajectorySubFrame(u)&&k[u].getRasmolHydrogenBonds(a,e,c,g,f,b,d,l)},"JU.BS,JU.BS,JU.Lst,~B,~N,~B,JU.BS,~N");
d(b,"calcSelectedMonomersCount",function(){for(var a=this.vwr.bsA(),e=this.ms.mc;0<=--e;)if(this.ms.am[e].isBioModel)for(var c=this.ms.am[e],g=c.bioPolymerCount;0<=--g;)c.bioPolymers[g].calcSelectedMonomersCount(a)});d(b,"calculateAllPolymers",function(a,e,c,g){var f=!this.vwr.getBoolean(603979896);0>e&&(e=a.length);if(null!=g)for(var b=0;b<e;++b){var d=a[b];r(d,"JM.Monomer")&&null!=d.bioPolymer&&!g.get(d.chain.model.modelIndex)&&d.setBioPolymer(null,-1)}for(var d=0,l=this.ms.mc;d<l;d++)if((null==
g||!g.get(d))&&this.ms.am[d].isBioModel)for(var k=0,b=c;b<e;++b,k++){var p=a[b],m=p.getModel();if(m.isBioModel&&r(p,"JM.Monomer")&&null!=p.getLeadAtom()){var h=f&&!this.ms.isJmolDataFrame(this.ms.at[p.getLeadAtom().i].mi),p=null==p.bioPolymer?JM.BioResolver.allocateBioPolymer(a,b,h,k):null;null==p||0==p.monomerCount||(m=m.addBioPolymer(p),b+=m-1,k+=m-1)}}},"~A,~N,~N,JU.BS");d(b,"calculateAllStructuresExcept",function(a,e,c,g,f,b,d){var l="";a=JU.BSUtil.copyInvert(a,this.ms.mc);f&&this.setAllDefaultStructure(a);
for(var k=a.nextSetBit(0);0<=k;k=a.nextSetBit(k+1))this.ms.am[k].isBioModel&&(l+=this.ms.am[k].calculateStructures(e,c,g,f,b,d));f&&this.ms.setStructureIndexes();return l},"JU.BS,~B,~B,~B,~B,~B,~N");d(b,"calculateAllStuctures",function(a,e,c,g,f,b){0>=b&&(b=2);var d=new JU.BS;a=JU.BSUtil.copyInvert(this.modelsOf(a,d),this.ms.mc);if(!f)return this.ms.calculateStructuresAllExcept(a,e,c,g,!1,!1,b);this.ms.recalculatePolymers(a);e=this.ms.calculateStructuresAllExcept(a,e,c,g,!0,!1,b);this.vwr.shm.resetBioshapes(d);
this.ms.setStructureIndexes();return e},"JU.BS,~B,~B,~B,~B,~N");d(b,"calculateStraightnessAll",function(){this.getBioExt().calculateStraightnessAll()});d(b,"calculateStruts",function(a,e){return this.getBioExt().calculateAllstruts(this.vwr,this.ms,a,e)},"JU.BS,JU.BS");d(b,"getAllDefaultStructures",function(a,e){for(var c=this.modelsOf(a,e),g=new JU.SB,f=c.nextSetBit(0);0<=f;f=c.nextSetBit(f+1))this.ms.am[f].isBioModel&&null!=this.ms.am[f].defaultStructure&&g.append(this.ms.am[f].defaultStructure);
return g.toString()},"JU.BS,JU.BS");d(b,"getAllHeteroList",function(a){for(var e=new java.util.Hashtable,c=!1,g=this.ms.mc;0<=--g;)if(0>a||g==a){var f=this.ms.getInfo(g,"hetNames");if(null!=f)for(var c=!0,b,f=f.entrySet().iterator();f.hasNext()&&((b=f.next())||1);){var d=b.getKey();e.put(d,b.getValue())}}return c?e:null},"~N");d(b,"getAllPolymerInfo",function(a,e){this.getBioExt().getAllPolymerInfo(a,e)},"JU.BS,java.util.Map");d(b,"getAllPolymerPointsAndVectors",function(a,e,c,g){for(var f=0;f<this.ms.mc;++f)if(this.ms.am[f].isBioModel)for(var b=
this.ms.am[f],d=2147483646,l=0;l<b.bioPolymerCount;l++)d=b.bioPolymers[l].getPolymerPointsAndVectors(d,a,e,c,g)},"JU.BS,JU.Lst,~B,~N");d(b,"getAllSequenceBits",function(a,e,c){if(0<a.length){null==e&&(e=this.vwr.getAllAtoms());if(a.indexOf("|")<a.lastIndexOf("|"))return this.getAllUnitIds(a,e,c);for(var g=this.ms.am,f=this.ms.mc;0<=--f;)if(g[f].isBioModel)for(var b=g[f],d=a.length,l=0;l<b.bioPolymerCount;l++)for(var k=b.bioPolymers[l].getSequence(),p=-1;0<=(p=k.indexOf(a,++p));)b.bioPolymers[l].getPolymerSequenceAtoms(p,
d,e,c)}return c},"~S,JU.BS,JU.BS");d(b,"getAtomBitsBS",function(a,e,c){var g=this.ms.at,f=this.ms.ac,b=0,d;switch(a){case 136314895:case 2097184:for(var l=136314895==a?J.c.STR.HELIX:J.c.STR.SHEET,b=f;0<=--b;)null!=g[b]&&((d=g[b].group).isWithinStructure(l)&&d.setAtomBits(c),b=d.firstAtomIndex);break;case 2097188:for(b=f;0<=--b;)null!=g[b]&&((d=g[b].group).isCarbohydrate()&&d.setAtomBits(c),b=d.firstAtomIndex);break;case 2097156:for(b=f;0<=--b;)null!=g[b]&&((d=g[b].group).isDna()&&d.setAtomBits(c),
b=d.firstAtomIndex);break;case 2097166:for(b=f;0<=--b;)null!=g[b]&&((d=g[b].group).isNucleic()&&d.setAtomBits(c),b=d.firstAtomIndex);break;case 2097168:for(b=f;0<=--b;)null!=g[b]&&((d=g[b].group).isProtein()&&d.setAtomBits(c),b=d.firstAtomIndex);break;case 2097170:for(b=f;0<=--b;)null!=g[b]&&((d=g[b].group).isPurine()&&d.setAtomBits(c),b=d.firstAtomIndex);break;case 2097172:for(b=f;0<=--b;)null!=g[b]&&((d=g[b].group).isPyrimidine()&&d.setAtomBits(c),b=d.firstAtomIndex);break;case 2097174:for(b=f;0<=
--b;)null!=g[b]&&((d=g[b].group).isRna()&&d.setAtomBits(c),b=d.firstAtomIndex)}if(0>b)return c;f=e.nextSetBit(0);if(0>f)return c;b=0;switch(a){case 1094713362:for(b=f;0<=b;b=e.nextSetBit(b+1))0<=g[b].group.getBioPolymerIndexInModel()&&g[b].group.bioPolymer.setAtomBitsAndClear(c,e);break;case 1639976963:for(b=f;0<=b;b=e.nextSetBit(b+1))f=g[b].group.getStructure(),null!=f&&f.setAtomBitsAndClear(c,e)}0==b&&JU.Logger.error("MISSING getAtomBits entry for "+JS.T.nameOf(a));return c},"~N,JU.BS,JU.BS");d(b,
"getAtomBitsStr",function(a,e,c){switch(a){default:return new JU.BS;case 1073741925:return this.getAnnotationBits("domains",1073741925,e);case 1073742189:return this.getAnnotationBits("validation",1073742189,e);case 1073742128:return this.getAnnotationBits("rna3d",1073742128,e);case 1073741863:return c=new JU.BS,0!=e.length%2?c:this.ms.getAtomBitsMDa(1086324742,this.getAllBasePairBits(e),c);case 1111490587:return this.getAnnotationBits("dssr",1111490587,e);case 1086324744:return this.getAllSequenceBits(e,
null,c)}},"~N,~S,JU.BS");d(b,"getBioPolymerCountInModel",function(a){if(0>a){a=0;for(var e=this.ms.mc;0<=--e;)!this.ms.isTrajectorySubFrame(e)&&this.ms.am[e].isBioModel&&(a+=this.ms.am[e].getBioPolymerCount());return a}return this.ms.isTrajectorySubFrame(a)||!this.ms.am[a].isBioModel?0:this.ms.am[a].getBioPolymerCount()},"~N");d(b,"getFullProteinStructureState",function(a,e){var c=1073742327==e;if(c&&!this.ms.proteinStructureTainted)return"";var g=1073742158==e||1073742327==e,b=this.ms.at,d=(null==
a?this.vwr.getAllAtoms():a).nextSetBit(0);if(0>d)return"";if(null!=a&&4138==e){a=JU.BSUtil.copy(a);for(var j=this.ms.ac;0<=--j;)(null==b[j]||Float.isNaN(b[j].group.getGroupParameter(1111490569))||Float.isNaN(b[j].group.getGroupParameter(1111490570)))&&a.clear(j)}for(var l=(null==a?this.vwr.getAllAtoms():a).length()-1,k=b[d].mi,d=b[l].mi,l=new JU.Lst,p=new java.util.Hashtable,m=new JU.SB;k<=d;k++)if(this.ms.am[k].isBioModel&&(j=this.ms.am[k],!c||j.structureTainted)){var h=new JU.BS;h.or(j.bsAtoms);
h.andNot(j.bsAtomsDeleted);j=h.nextSetBit(0);if(!(0>j)){g&&m.append("  structure none ").append(JU.Escape.eBS(this.ms.getModelAtomBitSetIncludingDeleted(k,!1))).append("    \t# model="+this.ms.getModelNumberDotted(k)).append(";\n");for(var n;0<=j;j=h.nextSetBit(j+1)){var A=b[j];if(!(null==A||!r(A.group,"JM.AlphaMonomer")||null==(n=A.group.proteinStructure)||p.containsKey(n)))l.addLast(n),p.put(n,Boolean.TRUE)}}}this.getStructureLines(a,m,l,J.c.STR.HELIX,g,e);this.getStructureLines(a,m,l,J.c.STR.SHEET,
g,e);this.getStructureLines(a,m,l,J.c.STR.TURN,g,e);return m.toString()},"JU.BS,~N");d(b,"getGroupsWithinAll",function(a,e){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 d=this.ms.am[b],j=d.bioPolymerCount;0<=--j;)d.bioPolymers[j].getRangeGroups(a,e,c);return c},"~N,JU.BS");d(b,"getIdentifierOrNull",function(a){for(var e=a.length,c=0;c<e&&JU.PT.isLetter(a.charAt(c));)++c;var g=this.ms.getSpecNameOrNull(a.substring(0,c),!1);
if(c==e)return g;null==g&&(g=new JU.BS);for(var b=c;c<e&&JU.PT.isDigit(a.charAt(c));)++c;if(c==b)return null;var d=0;try{d=Integer.parseInt(a.substring(b,c))}catch(j){if($(j,"NumberFormatException"))return null;throw j;}b=" ";c<e&&"^"==a.charAt(c)&&++c<e&&(b=a.charAt(c));d=JM.Group.getSeqcodeFor(d,b);d=this.ms.getSeqcodeBits(d,!1);if(null==d){" "!=b&&(d=this.ms.getSeqcodeBits(Character.toUpperCase(a.charAt(c)).charCodeAt(0),!1));if(null==d)return null;c++}g.and(d);if(c>=e)return g;if(c!=e-1)return null;
g.and(this.ms.getChainBits(a.charAt(c).charCodeAt(0)));return g},"~S");d(b,"mutate",function(a,e,c,g,b){return this.getBioExt().mutate(this.vwr,a,e,c,g,b)},"JU.BS,~S,~A,~S,~A");d(b,"recalculateAllPolymers",function(a,e){for(var c=0;c<this.ms.mc;c++)this.ms.am[c].isBioModel&&!a.get(c)&&this.ms.am[c].clearBioPolymers();this.calculateAllPolymers(e,-1,0,a)},"JU.BS,~A");d(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");d(b,"setAllConformation",function(a){this.vwr.ms.recalculatePositionDependentQuantities(a,null);for(var e=this.ms.getModelBS(a,!1),c=e.nextSetBit(0);0<=c;c=e.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");d(b,"setAllProteinType",function(a,e){var c=-1,g=this.ms.getModelBS(a,
!1);this.setAllDefaultStructure(g);for(var g=this.ms.getGroups(),b=0,d=-2147483648,j=null,l=null,k=e===J.c.STR.NONE,p=0;p<g.length;p++){var m=g[p];if(0!=m.getBioPolymerLength()&&a.get(m.firstAtomIndex)){var h=m.getModel();if(!k){h!==l&&(l=h,b=0,j=null);j!==m.bioPolymer&&(d=-2147483648,j=m.bioPolymer);var n=m.getResno();n!=d+1&&(c=-1);d=n}c=m.setProteinStructureType(e,c);1E3<m.getStrucNo()&&m.setStrucNo(++b);this.ms.proteinStructureTainted=h.structureTainted=!0}}},"JU.BS,J.c.STR");d(b,"setAllStructureList",
function(a){for(var e=this.ms.mc;0<=--e;)if(this.ms.am[e].isBioModel){var c=this.ms.am[e];c.bioPolymers=JU.AU.arrayCopyObject(c.bioPolymers,c.bioPolymerCount);for(var g=c.bioPolymerCount;0<=--g;){var b=c.bioPolymers[g];r(b,"JM.AminoPolymer")&&b.setStructureList(a)}}},"java.util.Map");d(b,"getAllBasePairBits",function(a){var e=null,c=null,g=new JU.Lst;if(0==a.length)e=c=this.vwr.getAllAtoms(),this.calcAllRasmolHydrogenBonds(e,c,g,!0,1,!1,null,0);else for(var b=0;b<a.length;)e=this.ms.getSequenceBits(a.substring(b,
++b),null,new JU.BS),0>e.nextSetBit(0)||(c=this.ms.getSequenceBits(a.substring(b,++b),null,new JU.BS),0>c.nextSetBit(0)||this.calcAllRasmolHydrogenBonds(e,c,g,!0,1,!1,null,0));a=new JU.BS;for(b=g.size();0<=--b;)e=g.get(b),a.set(e.atom1.i),a.set(e.atom2.i);return a},"~S");d(b,"getAllUnitIds",function(a,e,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 d=this.ms.am[b];if(d.isBioModel){this.ms.isTrajectory(b)&&
(d=this.ms.am[b=d.trajectoryBaseIndex]);var j="|"+this.ms.getInfo(b,"modelNumber");this.checkMap(g[0],this.ms.getInfo(b,"modelName")+j,d.bsAtoms);this.checkMap(g[0],j,d.bsAtoms)}}}var j=d=null,l=new JU.BS;a=JU.PT.getTokens(JU.PT.replaceAllCharacters(a,', \t\n[]"='," "));for(var k=D(8,0),b=a.length;0<=--b;){var p=a[b]+"|";if(!(5>p.length)){for(var m=0,h=0,n=0,A=p.lastIndexOf("|")+1;h<A&&8>n;h++)"|"==p.charAt(h)?k[n++]=h:m|=1<<n;if(22==(m&22)){l.clearAll();l.or(e);h=p.substring(0,k[2]);if(null!=j&&
j.equals(h))l.and(d);else{if(!this.addUnit(1094717454,p.substring(0,k[1]).toUpperCase(),l,g[0])||!this.addUnit(1073742357,p.substring(k[1]+1,k[2]),l,g[1]))continue;d=JU.BSUtil.copy(l);j=h}h=0!=(m&32);n=0!=(m&64);this.addUnit(1094715412,p.substring(k[3]+1,k[4]),l,g[2])&&(this.addUnit(5,0==(m&128)?"\x00":p.substring(k[6]+1,k[7]),l,g[3])&&!(h?!this.addUnit(1086326786,p.substring(k[4]+1,k[5]).toUpperCase(),l,g[4])||!this.addUnit(1073742355,p.substring(k[5]+1,k[6]),l,g[5]):n&&!this.addUnit(1094717448,
p.substring(k[5]+1,k[6]),l,g[6])))&&c.or(l)}}}return c},"~S,JU.BS,JU.BS");d(b,"checkMap",function(a,e,c){c=JU.BSUtil.copy(c);var g=a.get(e);null==g?a.put(e,g=c):g.or(c);return g},"java.util.Map,~S,JU.BS");d(b,"addUnit",function(a,e,c,g){var b=g.get(e);if(null==b){var d;switch(a){default:return!1;case 1073742357:d=Integer.$valueOf(this.vwr.getChainID(e,!1));break;case 1094715412:d=Integer.$valueOf(JU.PT.parseInt(e));break;case 5:d=Integer.$valueOf(e.charAt(0).charCodeAt(0));break;case 1094717448:b=
this.ms.getAtomBitsMDa(a=1073742355,null,new JU.BS);case 1086326786:d=e;break;case 1073742355:d=0==e.length?null:e}g.put(e,b=this.ms.getAtomBitsMDa(a,d,null==b?new JU.BS:b))}c.and(b);return 0<=c.nextSetBit(0)},"~N,~S,JU.BS,java.util.Map");d(b,"getAnnotationBits",function(a,e,c){for(var g=new JU.BS,b=this.vwr.getAnnotationParser(a.equals("dssr")),d,j=this.ms.mc;0<=--j;)null!=(d=this.ms.getInfo(j,a))&&g.or(b.getAtomBits(this.vwr,c,this.ms.am[j].getCachedAnnotationMap(a+" V ",d),this.ms.am[j].dssrCache,
e,j,this.ms.am[j].bsAtoms));return g},"~S,~N,~S");d(b,"getStructureLines",function(a,e,c,g,b,d){d=134222350==d;for(var j=0,l=0,k=0,p=null,m=new JU.BS,h=0,n=0,A=c.size();n<A;n++){var u=c.get(n);if(u.type===g){var v=u.findMonomer(a,!0),s=u.findMonomer(a,!1);if(!(null==v||null==s)){var w=u.apolymer.model.modelIndex,p=b?"    \t# model="+this.ms.getModelNumberDotted(w):null,w=v.getResno(),r=s.getResno(),t=u.subtype;switch(g){case J.c.STR.HELIX:case J.c.STR.TURN:case J.c.STR.SHEET:if(h++,b){m.clearAll();
u.setAtomBits(m);var E=t.getBioStructureTypeName(!1);e.append("  structure ").append(E).append(" ").append(JU.Escape.eBS(m)).append(p).append(" & ("+w+" - "+r+")").append(";\n")}else{var B;switch(g){case J.c.STR.HELIX:E=++j;p=JU.PT.formatStringI("%3N %3N","N",E);B="HELIX  %ID %3GROUPA %1CA %4RESA  %3GROUPB %1CB %4RESB";E=null;switch(t){case J.c.STR.HELIX:case J.c.STR.HELIXALPHA:E="  1";break;case J.c.STR.HELIX310:E="  5";break;case J.c.STR.HELIXPI:E="  3"}null!=E&&(B+=E);break;case J.c.STR.SHEET:E=
++l;p=JU.PT.formatStringI("%3N %3A 0","N",E);p=JU.PT.formatStringS(p,"A","S"+E);B="SHEET  %ID %3GROUPA %1CA%4RESA  %3GROUPB %1CB%4RESB";break;default:E=++k,p=JU.PT.formatStringI("%3N %3N","N",E),B="TURN   %ID %3GROUPA %1CA%4RESA  %3GROUPB %1CB%4RESB"}B=JU.PT.formatStringS(B,"ID",p);B=JU.PT.formatStringS(B,"GROUPA",v.getGroup3());B=JU.PT.formatStringS(B,"CA",v.getLeadAtom().getChainIDStr());B=JU.PT.formatStringI(B,"RESA",w);B=JU.PT.formatStringS(B,"GROUPB",s.getGroup3());B=JU.PT.formatStringS(B,"CB",
s.getLeadAtom().getChainIDStr());B=JU.PT.formatStringI(B,"RESB",r);e.append(B);d&&e.append(" strucno= ").appendI(u.strucNo);e.append("\n")}}}}}0<h&&e.append("\n");return h},"JU.BS,JU.SB,JU.Lst,J.c.STR,~B,~N");d(b,"modelsOf",function(a,e){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 d=this.ms.am[this.ms.at[b].mi].trajectoryBaseIndex;this.ms.isJmolDataFrame(d)||(c.set(d),e.set(b))}return c},"JU.BS,JU.BS");d(b,
"setAllDefaultStructure",function(a){for(var e=a.nextSetBit(0);0<=e;e=a.nextSetBit(e+1))if(this.ms.am[e].isBioModel){var c=this.ms.am[e];null==c.defaultStructure&&(c.defaultStructure=this.getFullProteinStructureState(c.bsAtoms,1073742158))}},"JU.BS");d(b,"getAminoAcidValenceAndCharge",function(a,e,c){return this.getBioExt().getAminoAcidValenceAndCharge(a,e,c)},"~S,~S,~A")});s("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;y(this,arguments)},JM,"BioModel",JM.Model);d(b,"setBioModel",function(a,e,c,g,b,d){this.setupArrays();this.vwr=a.vwr;this.set(a,e,c,g,b,d);this.isBioModel=!0;this.vwr.getJBR().getBioModelSet(a);this.clearBioPolymers();a.am[e]=this;this.pdbID=d.get("name");return this},"JM.ModelSet,~N,~N,java.util.Map,java.util.Properties,java.util.Map");d(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");d(b,"addSecondaryStructure",function(a,e,c,g,b,d,j,l,k,p,m){for(var h=this.bioPolymerCount;0<=--h;)r(this.bioPolymers[h],"JM.AlphaPolymer")&&this.bioPolymers[h].addStructure(a,e,c,g,b,d,j,l,k,p,m)},"J.c.STR,~S,~S,~N,~N,~N,~N,~N,~N,~N,JU.BS");d(b,
"addStructureByBS",function(a,e,c,g){for(var b=this.bioPolymerCount;0<=--b;)r(this.bioPolymers[b],"JM.AlphaPolymer")&&(a=this.bioPolymers[b].setStructureBS(++a,e,c,g,!0))},"~N,~N,J.c.STR,JU.BS");d(b,"calculateDssx",function(a,e,c,b,f){for(var d=!1,j=!1,l=0;l<this.bioPolymerCount&&(!d||!j);l++)this.bioPolymers[l].isNucleic()?j=!0:r(this.bioPolymers[l],"JM.AminoPolymer")&&(d=!0);l="";d&&(l+=J.api.Interface.getOption("dssx.DSSP",this.vwr,"ms").calculateDssp(this.bioPolymers,this.bioPolymerCount,a,e,
c,b,f));j&&(this.auxiliaryInfo.containsKey("dssr")&&null!=a)&&(l+=this.vwr.getAnnotationParser(!0).getHBonds(this.ms,this.modelIndex,a,e));return l},"JU.Lst,~B,~B,~B,~N");d(b,"calculateStructures",function(a,e,c,b,f,d){if(0==this.bioPolymerCount||!b&&!a)return"";this.ms.proteinStructureTainted=this.structureTainted=!0;if(b)for(var j=this.bioPolymerCount;0<=--j;)(!a||null!=this.bioPolymers[j].monomers[0].getNitrogenAtom())&&this.bioPolymers[j].clearStructures();if(!a||f)for(j=this.bioPolymerCount;0<=
--j;)r(this.bioPolymers[j],"JM.AlphaPolymer")&&this.bioPolymers[j].calculateStructures(f);return a?this.calculateDssx(null,e,c,b,d):""},"~B,~B,~B,~B,~B,~N");d(b,"clearBioPolymers",function(){this.bioPolymers=Array(8);this.bioPolymerCount=0});h(b,"fixIndices",function(a,e,c){this.fixIndicesM(a,e,c);this.recalculateLeadMidpointsAndWingVectors()},"~N,~N,JU.BS");h(b,"freeze",function(){this.freezeM();this.bioPolymers=JU.AU.arrayCopyObject(this.bioPolymers,this.bioPolymerCount);return!0});d(b,"getBioBranches",
function(a){for(var e,c=0;c<this.bioPolymerCount;c++)e=new JU.BS,this.bioPolymers[c].getRange(e,this.isMutated),0<=e.nextSetBit(0)&&(null==a&&(a=new JU.Lst),a.addLast(e));return a},"JU.Lst");d(b,"getBioPolymerCount",function(){return this.bioPolymerCount});d(b,"getCachedAnnotationMap",function(a,e){var c=null==this.dssrCache&&null!=e?this.dssrCache=new java.util.Hashtable:this.dssrCache;if(null==c)return null;var b=c.get(a);null==b&&null!=e&&(b=r(e,"JS.SV")||r(e,"java.util.Hashtable")?e:this.vwr.parseJSONMap(e),
c.put(a,b));return r(b,"JS.SV")||r(b,"java.util.Hashtable")?b:null},"~S,~O");d(b,"getConformation",function(a,e,c,b){var f=0==a;if(0==this.altLocCount)f&&b.or(c);else{var d=0>=a,j=this.ms.at,l=-32==a,k=d&&!l?String.fromCharCode(-a):"\x00";if(d){a=-2147483648;for(var p="\x00",m=-2147483648,h=new java.util.Hashtable,d=c.nextSetBit(0);0<=d;d=c.nextSetBit(d+1)){var n=j[d],A=n.getChainID(),u=n.getResno(),v=n.getInsertionCode();if(u!=m||v!=p||A!=a)a=A,m=u,p=v,h.clear();u=n.getAtomName();A=h.get(u);null==
A&&h.put(u,A=D(1,0));u=A[0]-1;0>u?-2==u?c.clear(d):l?"\x00"!=n.altloc&&c.clear(d):A[0]=d+1:(f?(c.clear(d),A[0]=-1):n.altloc==k?A[0]=-1:u=d,c.clear(u))}}else{a--;f=null;l="\x00";k=a;p=new JU.BS;for(d=c.nextSetBit(0);0<=d;d=c.nextSetBit(d+1))n=j[d],m=n.altloc,"\x00"!=m&&(n.group!==f&&(f=n.group,l="\x00",k=a,p.clearAll()),0<=k&&(m!=l&&!p.get(m.charCodeAt(0)))&&(l=m,k--,p.set(m.charCodeAt(0))),(0<=k||m!=l)&&c.clear(d))}if(0<=c.nextSetBit(0)&&(b.or(c),e))for(e=this.bioPolymerCount;0<=--e;)this.bioPolymers[e].setConformation(c)}},
"~N,~B,JU.BS,JU.BS");d(b,"getDefaultLargePDBRendering",function(a,e){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<=e||(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");d(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)});d(b,"getPdbData",function(a,e,
c,b,f,d,j,l){this.ms.bioModelset.getBioExt().getPdbDataM(this,this.vwr,a,e,c,b,f,d,j,l)},"~S,~S,~B,JU.BS,JU.OC,~A,JU.SB,JU.BS");d(b,"getRasmolHydrogenBonds",function(a,e,c,b,f,d,j,l){var k=null==c;k&&(c=new JU.Lst);0>f&&(f=2147483647);var p;if(null==e&&0<this.bioPolymerCount)this.calculateDssx(c,!1,d,!1,l);else for(d=this.bioPolymerCount;0<=--d;)if(l=this.bioPolymers[d],0!=l.monomerCount){var m=l.getType(),h=!1;switch(m){case 1:if(b)continue;l.calcRasmolHydrogenBonds(null,a,e,c,f,null,!0,!1);break;
case 2:h=l.monomers[0].isRna();break;default:continue}for(var n=this.bioPolymerCount;0<=--n;)null!=(p=this.bioPolymers[n])&&((h||d!=n)&&m==p.getType())&&p.calcRasmolHydrogenBonds(l,a,e,c,f,null,!0,!1)}if(0!=c.size()&&k){this.hasRasmolHBonds=!0;for(d=0;d<c.size();d++)a=c.get(d),e=a.atom1,b=a.atom2,e.isBonded(b)||(a=this.ms.addHBond(e,b,a.order,a.getEnergy()),null!=j&&j.set(a))}},"JU.BS,JU.BS,JU.Lst,~B,~N,~B,JU.BS,~N");d(b,"getUnitID",function(a,e){var c=new JU.SB,b=a.group,f=16!=(e&16),d=8==(e&8)?
b.getInsertionCode():"\x00",j="\x00"!=d;1==(e&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==(e&4)?(c.append("|").append(a.getAtomName()),"\x00"!=a.altloc?c.append("|").appendC(a.altloc):(f||j)&&c.append("|")):(f||j)&&c.append("||");j?c.append("|").appendC(d):f&&c.append("|");f&&c.append("|");return c.toString()},
"JM.Atom,~N");d(b,"recalculateLeadMidpointsAndWingVectors",function(){for(var a=0;a<this.bioPolymerCount;a++)this.bioPolymers[a].recalculateLeadMidpointsAndWingVectors()});d(b,"resetRasmolBonds",function(a,e){var c=new JU.BS;this.hasRasmolHBonds=!1;for(var b=this.ms.am,f=this.ms.bo,d=this.ms.bondCount;0<=--d;){var j=f[d];null!=j&&(0!=(j.order&28672)&&b[j.atom1.mi].trajectoryBaseIndex==this.modelIndex)&&c.set(d)}0<=c.nextSetBit(0)&&this.ms.deleteBonds(c,!1);this.getRasmolHydrogenBonds(a,a,null,!1,
2147483647,!1,null,e)},"JU.BS,~N");d(b,"getAtomicDSSRData",function(a,e){this.auxiliaryInfo.containsKey("dssr")&&this.vwr.getAnnotationParser(!0).getAtomicDSSRData(this.ms,this.modelIndex,a,e)},"~A,~S")});s("JM");t(["java.util.Hashtable","J.c.STR"],"JM.BioResolver","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.carbohydrates=this.bsAssigned=null;y(this,arguments)},JM,"BioResolver",null,java.util.Comparator);d(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=D(JM.BioResolver.ATOMID_MAX,0),this.hasCONECT=this.ms.getInfoM(JV.JC.getBoolName(3))===Boolean.TRUE);return this},"JM.ModelLoader");d(b,"setViewer",function(a){this.vwr=a;if(null==JM.Group.standardGroupList){var e=new JU.SB;for(a=1;42>a;a++)e.append(",[").append(JM.BioResolver.predefinedGroup3Names[a]).append("]");e.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=w(e.length()/6);JM.Group.standardGroupList=e.toString();a=0;for(e=JM.BioResolver.predefinedGroup3Names.length;a<e;++a)JM.BioResolver.addGroup3Name(JM.BioResolver.predefinedGroup3Names[a].trim())}return this},"JV.Viewer");d(b,"getBioModel",function(a,e,c,b,f){return(new JM.BioModel).setBioModel(this.ms,a,e,c,b,f)},"~N,~N,java.util.Map,java.util.Properties,java.util.Map");d(b,"distinguishAndPropagateGroup",function(a,e,c,b,f,d,j){for(var l=0,k=JM.BioResolver.ATOMID_MAX;0<=
--k;)d[k]=-2147483648;for(k=f;k>=b;--k){var p=j[k].atomID;0>=p||(14>p&&(l|=1<<p),d[p]=k)}k=null;14==(l&14)?k=JM.AminoMonomer.validateAndAllocate(a,e,c,b,f,d,j):4==l?k=JM.AlphaMonomer.validateAndAllocateA(a,e,c,b,f,d):8128==(l&8128)?k=JM.NucleicMonomer.validateAndAllocate(a,e,c,b,f,d):8192==l?k=JM.PhosphorusMonomer.validateAndAllocateP(a,e,c,b,f,d):this.checkCarbohydrate(e)&&(k=JM.CarbohydrateMonomer.validateAndAllocate(a,e,c,b,f));return null!=k&&0<=k.leadAtomIndex?k:null},"JM.Chain,~S,~N,~N,~N,~A,~A");
d(b,"setHaveHsAlready",function(a){this.haveHsAlready=a},"~B");d(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});d(b,"addImplicitHydrogenAtoms",function(a,e,c){var b=this.ml.getGroup3(e),f;if(!(this.haveHsAlready&&this.hasCONECT||null==b||0==(f=
JM.BioResolver.getStandardPdbHydrogenCount(b)))){c=0>f?-1:f+c;f=null;e=this.ml.getFirstAtomIndex(e);var d=this.ms.ac;if(0>c){if(1==d-e)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[e].mi].isPdbWithMultipleBonds=!0;if(!this.haveHsAlready){this.bsAtomsForHs.setBits(e,d);this.bsAddedHydrogens.setBits(d,d+c);a=this.ms.at[e].isHetero();b=JU.P3.new3(NaN,NaN,NaN);e=this.ms.at[e];for(f=0;f<
c;f++)this.ms.addAtom(e.mi,e.group,1,"H",null,0,e.getSeqID(),0,b,NaN,null,0,0,1,0,null,a,!1,0,null,NaN).$delete(null)}}},"J.api.JmolAdapter,~N,~N");d(b,"getBondInfo",function(a,e,c){if(null==this.htGroupBonds.get(e)&&(a=null==c?this.getPdbBondInfo(e,this.vwr.getBoolean(603979873)):this.getLigandBondInfo(a,c,e),null!=a)){this.htGroupBonds.put(e,Boolean.TRUE);for(c=0;c<a.length;c++)null!=a[c]&&("H"==a[c][1].charAt(0)?this.htBondMap.put(e+"."+a[c][0],a[c][1]):this.htBondMap.put(e+":"+a[c][0]+":"+a[c][1],
a[c][2]))}},"J.api.JmolAdapter,~S,~O");d(b,"getLigandBondInfo",function(a,e,c){var b=a.getBondList(e),f=new java.util.Hashtable;for(a=a.getAtomIterator(e);a.hasNext();)f.put(a.getAtomName(),a.getXYZ());a=Array(2*b.length);for(var d=e=0;d<b.length;d++){var j=b[d];"H"!=j[0].charAt(0)&&(a[e++]=P(-1,[j[0],j[1],j[2],j[1].startsWith("H")?"0":"1"]));"H"!=j[1].charAt(0)&&(a[e++]=P(-1,[j[1],j[0],j[2],j[0].startsWith("H")?"0":"1"]))}java.util.Arrays.sort(a,this);for(var l,d=0;d<e;){l=a[d];for(var b=l[0],k=
j=0;d<e&&(l=a[d])[0].equals(b);d++)l[3].equals("0")?j++:l[3].equals("1")&&k++;b=d-j-k;if(1!=j)switch(k){case 1:for(var k=2==j?"@":"|",p=1;p<j;p++)a[b][1]+=k+a[b+p][1],a[b+p]=null;continue;case 2:if(2!=j)continue;var k=a[b][0],p=a[b+j][1],j=a[b+j+1][1],m=p.compareTo(j);JU.Measure.getPlaneThroughPoints(f.get(p),f.get(k),f.get(j),this.vNorm,this.vAB,this.plane);j=JU.Measure.distanceToPlane(this.plane,f.get(a[b][1]))*m;a[b][1]=0<j?a[b][1]+"@"+a[b+1][1]:a[b+1][1]+"@"+a[b][1];a[b+1]=null}}for(d=0;d<e;d++)null!=
(l=a[d])&&"H"!=l[1].charAt(0)&&0<l[0].compareTo(l[1])?a[d]=null:null!=l&&JU.Logger.info(" ligand "+c+": "+a[d][0]+" - "+a[d][1]+" order "+a[d][2]);return a},"J.api.JmolAdapter,~O,~S");h(b,"compare",function(a,e){return null==e?null==a?0:-1:null==a?1:0>a[0].compareTo(e[0])?-1:0<a[0].compareTo(e[0])?1:0>a[3].compareTo(e[3])?-1:0<a[3].compareTo(e[3])?1:0>a[1].compareTo(e[1])?-1:0<a[1].compareTo(e[1])?1:0},"~A,~A");d(b,"finalizeHydrogens",function(){this.vwr.getLigandModel(null,null,null,null);this.finalizePdbMultipleBonds();
this.addHydrogens()});d(b,"addHydrogens",function(){if(!(0>this.bsAddedHydrogens.nextSetBit(0))){this.bsAddedMask=JU.BSUtil.copy(this.bsAddedHydrogens);this.finalizePdbCharges();for(var a=D(1,0),a=this.ms.calculateHydrogens(this.bsAtomsForHs,a,null,256),e=null,c=0,b,f=0;f<a.length;f++)if(!(null==a[f]||null==(b=this.ms.at[f]))){var d=b.group;if(d!==e){e=d;for(c=d.lastAtomIndex;this.bsAddedHydrogens.get(c);)c--}var j=b.getGroup3(!1),l=b.getAtomName(),k=this.htBondMap.get(j+"."+l);if(null!=k){var p=
k.contains("@"),m=k.endsWith("?")||0<=k.indexOf("|"),h=a[f].length;3==h&&(!m&&k.equals("H@H2"))&&(k="H|H2|H3",m=!0,p=!1);if(p&&3==h||m!=(3==h))JU.Logger.info("Error adding H atoms to "+j+d.getResno()+": "+a[f].length+" atoms should not be added to "+l);else switch(l=k.indexOf("@"),a[f].length){case 1:0<l&&(k=k.substring(0,l));this.setHydrogen(f,++c,k,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),h=p.getAtomName().compareTo(m.getAtomName()),
p=JU.Measure.distanceToPlane(JU.Measure.getPlaneThroughPoints(p,b,m,this.vNorm,this.vAB,this.plane),a[f][0])*h}0>l?(JU.Logger.info("Error adding H atoms to "+j+d.getResno()+": expected to only need 1 H but needed 2"),d=j="H"):0>p?(j=k.substring(0,l),d=k.substring(l+1)):(d=k.substring(0,l),j=k.substring(l+1));this.setHydrogen(f,++c,d,a[f][0]);this.setHydrogen(f,++c,j,a[f][1]);break;case 3:d=k.indexOf("|"),0<=d?(j=k.lastIndexOf("|"),this.hNames[0]=k.substring(0,d),this.hNames[1]=k.substring(d+1,j),
this.hNames[2]=k.substring(j+1)):(this.hNames[0]=k.$replace("?","1"),this.hNames[1]=k.$replace("?","2"),this.hNames[2]=k.$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))}});d(b,"deleteUnneededAtoms",function(){for(var a=new JU.BS,e=this.bsAtomsForHs.nextSetBit(0);0<=e;e=this.bsAtomsForHs.nextSetBit(e+
1)){var c=this.ms.at[e];if(c.isHetero()&&!(8!=c.getElementNumber()||0!=c.getFormalCharge()||2!=c.getCovalentBondCount())){var b=c.bonds,f=b[0].getOtherAtom(c),c=b[1].getOtherAtom(c);1==f.getElementNumber()&&(b=f,f=c,c=b);if(1==c.getElementNumber())for(var b=f.bonds,d=0;d<b.length;d++)if(2==b[d].order&&8==b[d].getOtherAtom(f).getElementNumber()){this.bsAddedHydrogens.set(c.i);c.$delete(a);break}}}this.ms.deleteBonds(a,!0);this.deleteAtoms(this.bsAddedHydrogens)});d(b,"deleteAtoms",function(a){for(var e=
D(this.ms.ac,0),c=D(this.ms.ac-a.cardinality(),0),b=this.ml.baseAtomIndex,f=this.ms.am,d=this.ms.at,j=this.ml.baseAtomIndex;j<this.ms.ac;j++){var l=d[j];null!=l&&(f[l.mi].bsAtoms.clear(j),f[l.mi].bsAtomsDeleted.clear(j),a.get(j)?(e[j]=b-1,f[d[j].mi].act--):(c[b]=j,e[j]=b++))}this.ms.msInfo.put("bsDeletedAtoms",a);for(j=this.ml.baseGroupIndex;j<this.ml.groups.length;j++)f=this.ml.groups[j],f.firstAtomIndex>=this.ml.baseAtomIndex&&(f.firstAtomIndex=e[f.firstAtomIndex],f.lastAtomIndex=e[f.lastAtomIndex],
0<=f.leadAtomIndex&&(f.leadAtomIndex=e[f.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(j=this.ml.baseModelIndex;j<this.ms.mc;j++)this.fixAnnotations(j,"domains",1073741925),this.fixAnnotations(j,"validation",1073742189)},"JU.BS");d(b,"fixAnnotations",function(a,e,c){var b=this.ml.ms.getInfo(a,e);null!=b&&(e=this.ms.am[a].getCachedAnnotationMap(e,
b),null!=e&&this.vwr.getAnnotationParser(!1).fixAtoms(a,e,this.bsAddedMask,c,20))},"~N,~S,~N");d(b,"finalizePdbCharges",function(){for(var a=this.ms.at,e=this.bsAtomsForHs.nextSetBit(0);0<=e;e=this.bsAtomsForHs.nextSetBit(e+1)){var c=a[e];c.group.getNitrogenAtom()===c&&1==c.getCovalentBondCount()&&c.setFormalCharge(1);if(0>(e=this.bsAtomsForHs.nextClearBit(e+1)))break}});d(b,"finalizePdbMultipleBonds",function(){for(var a=new java.util.Hashtable,e=this.ms.bondCount,c=this.ms.bo,b=this.baseBondIndex;b<
e;b++)if(null!=c[b]){var f=c[b].atom1,d=c[b].atom2,j=f.group;if(j===d.group){var l=(new JU.SB).append(j.getGroup3());l.append(":");f=f.getAtomName();d=d.getAtomName();0<f.compareTo(d)?l.append(d).append(":").append(f):l.append(f).append(":").append(d);d=l.toString();f=this.htBondMap.get(d);null!=f&&(a.put(d,Boolean.TRUE),c[b].setOrder(JU.PT.parseInt(f)))}}for(b=this.htBondMap.keySet().iterator();b.hasNext()&&((l=b.next())||1);)if(null==a.get(l))if(0>l.indexOf(":"))a.put(l,Boolean.TRUE);else{var k=
this.htBondMap.get(l);JU.Logger.info("bond "+l+" was not used; order="+k);this.htBondMap.get(l).equals("1")&&a.put(l,Boolean.TRUE)}j=new java.util.Hashtable;for(b=this.htBondMap.keySet().iterator();b.hasNext()&&((l=b.next())||1);)null==a.get(l)&&j.put(l.substring(0,l.lastIndexOf(":")),this.htBondMap.get(l));if(!j.isEmpty())for(b=0;b<e;b++)if(f=c[b].atom1,d=c[b].atom2,f.group!==d.group&&!(null==(k=j.get(f.getGroup3(!1)+":"+f.getAtomName()))&&null==(k=j.get(d.getGroup3(!1)+":"+d.getAtomName()))))c[b].setOrder(JU.PT.parseInt(k)),
JU.Logger.info("assigning order "+c[b].order+" to bond "+c[b])});d(b,"setHydrogen",function(a,e,c,b){if(this.bsAddedHydrogens.get(e)){var f=this.ms.at;this.bsAddedHydrogens.clear(e);this.ms.setAtomName(e,c,!1);f[e].setT(b);f[e].atomSymmetry=f[a].atomSymmetry;this.ml.undeleteAtom(e);this.ms.bondAtoms(f[a],f[e],1,this.ms.getDefaultMadFromOrder(1),null,0,!0,!1)}},"~N,~N,~S,JU.P3");d(b,"fixPropertyValue",function(a,e,c){for(var b=this.ms.at,f=N(a.cardinality(),0),d=0,j=0,l=0,k=a.nextSetBit(0);0<=k;k=
a.nextSetBit(k+1),l++){if(1==b[k].getElementNumber()){if(!c)continue}else d=e[j++];f[l]=d}return f},"JU.BS,~O,~B");b.allocateBioPolymer=d(b,"allocateBioPolymer",function(a,e,c,b){for(var f=null,d=0,j=e;j<a.length;++j){var l=a[j],k;if(!r(l,"JM.Monomer")||null!=(k=l).bioPolymer||null!=f&&f.getClass()!==k.getClass()||c&&!k.isConnectedAfter(f))break;f=k;d++}if(2>d)return null;c=Array(d);for(j=0;j<d;++j)c[j]=a[e+j];if(r(f,"JM.AminoMonomer"))return new JM.AminoPolymer(c,b);if(r(f,"JM.AlphaMonomer"))return new JM.AlphaPolymer(c,
b);if(r(f,"JM.NucleicMonomer"))return new JM.NucleicPolymer(c);if(r(f,"JM.PhosphorusMonomer"))return new JM.PhosphorusPolymer(c);if(r(f,"JM.CarbohydrateMonomer"))return new JM.CarbohydratePolymer(c);JU.Logger.error("Polymer.allocatePolymer() ... no matching polymer for monomor "+f);throw new NullPointerException;},"~A,~N,~B,~N");d(b,"iterateOverAllNewStructures",function(a,e){var c=a.getStructureIterator(e);if(null!=c){var b=c.getStructuredModels();if(null!=b)for(var f=b.nextSetBit(0);0<=f;f=b.nextSetBit(f+
1))this.ml.structuresDefinedInFile.set(this.ml.baseModelIndex+f);for(;c.hasNext();)c.getStructureType()!==J.c.STR.TURN&&this.setStructure(c);for(c=a.getStructureIterator(e);c.hasNext();)c.getStructureType()===J.c.STR.TURN&&this.setStructure(c)}},"J.api.JmolAdapter,~O");d(b,"setStructure",function(a){var e=a.getSubstructureType(),c=a.getStructureID(),b=a.getStrandID(),f=a.getStrandCount(),d=a.getAtomIndices(),j=a.getModelIndices(),l=a.getBSAll(),k,p=this.ms.am;this.ml.isTrajectory?k=j=j[0]:(k=j[0]+
this.ml.baseModelIndex,j=j[1]+this.ml.baseModelIndex);this.ml.structuresDefinedInFile.setBits(k,j+1);var m;if(null!=l){a=k;for(var h;a<=j;a++)if(r(k=p[a],"JM.BioModel"))for(c=0;5>c;c++)null!=(m=l[h=JM.BioResolver.mytypes[c]])&&!m.isEmpty()&&k.addStructureByBS(0,h,JM.BioResolver.types[c],m)}else{var l=a.getStartChainID(),n=a.getStartSequenceNumber(),A=a.getStartInsertionCode();h=a.getEndSequenceNumber();m=a.getEndChainID();a=a.getEndInsertionCode();e=e===J.c.STR.NOT?J.c.STR.NONE:e;n=JM.Group.getSeqcodeFor(n,
A);h=JM.Group.getSeqcodeFor(h,a);null==this.bsAssigned&&(this.bsAssigned=new JU.BS);a=k;for(A=0;a<=j;a++)if(r(k=p[a],"JM.BioModel"))k.addSecondaryStructure(e,c,b,f,l,n,m,h,(A=k.firstAtomIndex)+d[0],A+d[1],this.bsAssigned)}},"J.api.JmolAdapterStructureIterator");d(b,"setGroupLists",function(a){this.ml.group3Lists[a+1]=JM.Group.standardGroupList;this.ml.group3Counts[a+1]=D(JM.BioResolver.group3Count+10,0);null==this.ml.group3Lists[0]&&(this.ml.group3Lists[0]=JM.Group.standardGroupList,this.ml.group3Counts[0]=
D(JM.BioResolver.group3Count+10,0))},"~N");d(b,"isKnownPDBGroup",function(a,e){var c=JM.BioResolver.knownGroupID(a);return 0<c?c<e:2147483647==e&&this.checkCarbohydrate(a)},"~S,~N");d(b,"lookupSpecialAtomID",function(a){if(null==JM.BioResolver.htSpecialAtoms){JM.BioResolver.htSpecialAtoms=new java.util.Hashtable;for(var e=JM.BioResolver.specialAtomNames.length;0<=--e;){var c=JM.BioResolver.specialAtomNames[e];null!=c&&JM.BioResolver.htSpecialAtoms.put(c,Byte.$valueOf(e))}}a=JM.BioResolver.htSpecialAtoms.get(a);
return null==a?0:a.byteValue()},"~S");d(b,"getPdbBondInfo",function(a,e){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(e&&0<=(c=b.indexOf("O3'")))b=b.substring(0,c);for(var f=JU.PT.getTokens(b),c=Array(w(f.length/2)),d=0,j=0;d<c.length;d++){var l=f[j++],k=f[j++];if(1==
k.length)switch(k.charAt(0).charCodeAt(0)){case 78:k="H@H2";break;case 66:k="HB3@HB2";break;case 68:k="HD3@HD2";break;case 71:k="HG3@HG2";break;case 50:k="H2'@H2''";break;case 53:k="H5''@H5'"}"H"!=k.charAt(0)&&0<l.compareTo(k)&&(b=k,k=l,l=b);c[d]=P(-1,[l,k,k.startsWith("H")?"1":"2"])}JM.BioResolver.htPdbBondInfo.put(a,c);return c},"~S,~B");b.knownGroupID=d(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");d(b,"checkCarbohydrate",
function(a){if(null==a)return!1;a="["+a.toUpperCase()+"]";return 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)||null!=this.carbohydrates&&0<=this.carbohydrates.indexOf(a)},"~S");d(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<=w(a/6)+1},"~S");d(b,"toStdAmino3",function(a){if(0==a.length)return"";var e=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,f=a.length;b<f;b++)c=a.charAt(b),c=JM.BioResolver.knownGroupID("=="+
c),0>c&&(c=23),e.append(" ").append(JM.BioResolver.predefinedGroup3Names[c]);return e.toString().substring(1)},"~S");d(b,"getGroupID",function(a){return JM.BioResolver.getGroupIdFor(a)},"~S");b.getGroupIdFor=d(b,"getGroupIdFor",function(a){null!=a&&(a=a.trim());var e=JM.BioResolver.knownGroupID(a);return-1==e?JM.BioResolver.addGroup3Name(a):e},"~S");b.addGroup3Name=d(b,"addGroup3Name",function(a){JM.BioResolver.group3NameCount==JM.Group.group3Names.length&&(JM.Group.group3Names=JU.AU.doubleLengthS(JM.Group.group3Names));
var e=JM.BioResolver.group3NameCount++;JM.Group.group3Names[e]=a;JM.BioResolver.htGroup.put(a,Short.$valueOf(e));return e},"~S");b.getStandardPdbHydrogenCount=d(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=d(b,"getSpecialAtomName",function(a){return JM.BioResolver.specialAtomNames[a]},"~N");d(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");d(b,"getBioModelSet",function(a){null==a.bioModelset&&(a.bioModelset=(new JM.BioModelSet).set(this.vwr,a));return a.bioModelset},"JM.ModelSet");b.htGroup=new java.util.Hashtable;b.types=P(-1,[J.c.STR.HELIXPI,J.c.STR.HELIXALPHA,J.c.STR.SHEET,J.c.STR.HELIX310,J.c.STR.TURN]);b.mytypes=
D(-1,[0,2,3,4,6]);b.htPdbBondInfo=null;b.pdbBondInfo=P(-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(";"));
b.pdbHydrogenCount=D(-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]);b.group3Count=0;b.predefinedGroup1Names=aa(-1,"\x00ARNDCQEGHILKMFPSTWYVAG?GCATUIGCATUIGCATUI".split(""));b.group3NameCount=0;b.predefinedGroup3Names=P(-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(";"));b.specialAtomNames=
P(-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=JM.BioResolver.specialAtomNames.length;b.htSpecialAtoms=null;b.argbsAmino=D(-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]);b.argbsNucleic=D(-1,[4290682990,4288716960,4279206415,4293322240,4293265930,4279524095,
4278246620,4278246620,4279206415,4293322240,4293265930,4279524095,4278246620,4278246620,4279206415,4293322240,4293265930,4279524095,4278246620,4278246620]);b.argbsChainAtom=D(-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]);b.argbsChainHetero=D(-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]);b.argbsShapely=D(-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])});s("JM");t(["JM.Monomer"],"JM.CarbohydrateMonomer",["J.c.STR"],function(){var b=H(JM,"CarbohydrateMonomer",JM.Monomer);ba(b,function(){});b.validateAndAllocate=d(b,"validateAndAllocate",function(a,e,c,b,f){return(new JM.CarbohydrateMonomer).set2(a,e,c,b,f,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 e=this.firstAtomIndex;e<=this.lastAtomIndex;e++)for(var c=a.firstAtomIndex;c<=a.lastAtomIndex;c++){var b=this.chain.model.ms.at[e],f=this.chain.model.ms.at[c];if(null!=b&&null!=f&&14==b.getElementNumber()+f.getElementNumber()&&3.24>b.distanceSquared(f))return!0}return!1},"JM.Monomer");h(b,"findNearestAtomIndex",
function(a,e,c,b){var f=c[0],d=this.getLeadAtom();b=w(b/2);1200>b&&(b=1200);0!=d.sZ&&(b=n(this.scaleToScreen(d.sZ,b)),4>b&&(b=4),this.isCursorOnTopOf(d,a,e,b,f)&&(c[0]=d))},"~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});b.alphaOffsets=K(-1,[0])});s("JM");t(["JM.BioPolymer"],"JM.CarbohydratePolymer",null,function(){var b=H(JM,"CarbohydratePolymer",
JM.BioPolymer);F(b,function(a){R(this,JM.CarbohydratePolymer,[a,!1]);this.type=3},"~A")});s("JM");t(["JM.Monomer"],"JM.PhosphorusMonomer",["JU.Quat","$.V3","J.c.STR"],function(){var b=H(JM,"PhosphorusMonomer",JM.Monomer);ba(b,function(){});h(b,"isNucleic",function(){return!0});b.validateAndAllocateP=d(b,"validateAndAllocateP",function(a,e,c,b,f,d){return b!=f||d[13]!=b?null:(new JM.PhosphorusMonomer).set2(a,e,c,b,f,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");d(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");d(b,"getQuaternionP",function(){var a=this.monomerIndex;if(0>=a||a>=this.bioPolymer.monomerCount-1)return null;var e=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==e||null==c||null==a)return null;var b=new JU.V3,f=new JU.V3;b.sub2(c,e);f.sub2(a,e);return JU.Quat.getQuaternionFrameV(b,f,null,!1)});h(b,
"getQuaternionFrameCenter",function(){return this.getAtomFromOffsetIndex(0)},"~S");h(b,"getHelixData",function(a,e,c){return this.getHelixData2(a,e,c)},"~N,~S,~N");b.phosphorusOffsets=K(-1,[0]);b.MAX_ADJACENT_PHOSPHORUS_DISTANCE=8});s("JM");M=z(function(){this.g2=this.g1=this.info=null;y(this,arguments)},JM,"BasePair",null);M.add=d(M,"add",function(b,a,e){if(null==a||null==e)return null;var c=new JM.BasePair;c.info=b;(c.g1=a).addBasePair(c);(c.g2=e).addBasePair(c);return c},"java.util.Map,JM.NucleicMonomer,JM.NucleicMonomer");
d(M,"getPartnerAtom",function(b){return(b===this.g1?this.g2:this.g1).getLeadAtom().i},"JM.NucleicMonomer");d(M,"toString",function(){return this.info.toString()});s("JM");t(["JM.PhosphorusMonomer"],"JM.NucleicMonomer","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;y(this,arguments)},JM,"NucleicMonomer",
JM.PhosphorusMonomer);ba(b,function(){});b.validateAndAllocate=d(b,"validateAndAllocate",function(a,e,c,b,f,d){var j=JM.Monomer.scanForOffsets(b,d,JM.NucleicMonomer.interestingNucleicAtomIDs);if(null==j||!JM.Monomer.checkOptional(j,19,b,d[73]))return null;JM.Monomer.checkOptional(j,20,b,d[89]);JM.Monomer.checkOptional(j,18,b,d[90]);JM.Monomer.checkOptional(j,23,b,d[75]);JM.Monomer.checkOptional(j,24,b,d[77]);return(new JM.NucleicMonomer).set4(a,e,c,b,f,j)},"JM.Chain,~S,~N,~N,~N,~A");d(b,"set4",function(a,
e,c,b,f,d){this.set2(a,e,c,b,f,d);JM.Monomer.have(d,15)||(d[0]=d[19],this.setLeadAtomIndex());this.hasRnaO2Prime=JM.Monomer.have(d,2);this.$isPyrimidine=JM.Monomer.have(d,8);this.$isPurine=JM.Monomer.have(d,9)&&JM.Monomer.have(d,10)&&JM.Monomer.have(d,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()});d(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});d(b,"getP",function(){return this.getAtomFromOffsetIndex(0)});d(b,"getC1P",function(){return this.getAtomFromOffsetIndex(25)});d(b,"getC2",function(){return this.getAtomFromOffsetIndex(5)});d(b,"getC5",function(){return this.getAtomFromOffsetIndex(3)});
d(b,"getC6",function(){return this.getAtomFromOffsetIndex(1)});d(b,"getC8",function(){return this.getAtomFromOffsetIndex(10)});d(b,"getC4P",function(){return this.getAtomFromOffsetIndex(27)});d(b,"getN1",function(){return this.getAtomFromOffsetIndex(4)});d(b,"getN3",function(){return this.getAtomFromOffsetIndex(6)});d(b,"getN2",function(){return this.getAtomFromOffsetIndex(17)});d(b,"getN4",function(){return this.getAtomFromOffsetIndex(14)});d(b,"getN6",function(){return this.getAtomFromOffsetIndex(16)});
d(b,"getO2",function(){return this.getAtomFromOffsetIndex(8)});d(b,"getO4",function(){return this.getAtomFromOffsetIndex(12)});d(b,"getO6",function(){return this.getAtomFromOffsetIndex(13)});h(b,"getTerminatorAtom",function(){return this.getAtomFromOffsetIndex(JM.Monomer.have(this.offsets,20)?20:21)});d(b,"getBaseRing6Points",function(a){this.getPoints(JM.NucleicMonomer.ring6OffsetIndexes,a)},"~A");d(b,"getPoints",function(a,e){for(var c=a.length;0<=--c;)e[c]=this.getAtomFromOffsetIndex(a[c])},"~A,~A");
d(b,"maybeGetBaseRing5Points",function(a){this.$isPurine&&this.getPoints(JM.NucleicMonomer.ring5OffsetIndexes,a);return this.$isPurine},"~A");d(b,"getRiboseRing5Points",function(a){this.getPoints(JM.NucleicMonomer.riboseOffsetIndexes,a)},"~A");h(b,"isConnectedAfter",function(a){if(null==a)return!0;var e=this.getAtomFromOffsetIndex(15);return null==e?!1:a.getAtomFromOffsetIndex(21).isBonded(e)||this.isCA2(a)},"JM.Monomer");h(b,"findNearestAtomIndex",function(a,e,c,b){var f=c[0],d=this.getLeadAtom(),
j=this.getAtomFromOffsetIndex(19),l=this.getAtomFromOffsetIndex(22);b=w(b/2);1900>b&&(b=1900);b=n(this.scaleToScreen(d.sZ,b));4>b&&(b=4);if(this.isCursorOnTopOf(d,a,e,b,f)||this.isCursorOnTopOf(j,a,e,b,f)||this.isCursorOnTopOf(l,a,e,b,f))c[0]=d},"~N,~N,~A,~N,~N");d(b,"setRingsVisible",function(a){for(var e=6;0<=--e;)this.getAtomFromOffsetIndex(JM.NucleicMonomer.ring6OffsetIndexes[e]).setShapeVisibility(32768,a);if(this.$isPurine)for(e=4;1<=--e;)this.getAtomFromOffsetIndex(JM.NucleicMonomer.ring5OffsetIndexes[e]).setShapeVisibility(32768,
a)},"~B");d(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)});d(b,"getN0",function(){return this.getAtomFromOffsetIndex(this.$isPurine?11:4)});h(b,"getHelixData",function(a,e,b){return this.getHelixData2(a,e,b)},"~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 e=0;e<JM.NucleicMonomer.heavyAtomIndexes.length;e++){var b=this.getAtomFromOffsetIndex(JM.NucleicMonomer.heavyAtomIndexes[e]);null!=b&&(this.baseCenter.add(b),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 e=null,b=null,g=!1,f=!1;switch(a.charCodeAt(0)){case 97:a=this.getP();if(0==this.monomerIndex||null==a)return null;
g=!0;e=this.bioPolymer.monomers[this.monomerIndex-1].getC4P();b=this.getC4P();break;case 120:a=this.getP();if(this.monomerIndex==this.bioPolymer.monomerCount-1||null==a)return null;e=this.bioPolymer.monomers[this.monomerIndex+1].getP();b=this.getC4P();break;case 98:return this.getQuaternionP();case 99:case 110:a=this.getN0();if(null==a)return null;f=g=!0;e=this.getAtomFromOffsetIndex(5);b=this.getAtomFromOffsetIndex(25);break;case 112:a=this.getP();if(null==a)return null;var d=this.getAtomFromOffsetIndex(23),
j=this.getAtomFromOffsetIndex(24),l=a.bonds;if(null==l)return null;for(var k=a.group,h=0;h<l.length;h++){var m=l[h].getOtherAtom(a);null!=d&&m.i==d.i||null!=j&&m.i==j.i||(m.group===k?b=m:e=m)}break;case 113:return null;default:a=this.getN0();if(null==a)return null;this.$isPurine?(e=this.getAtomFromOffsetIndex(5),b=this.getAtomFromOffsetIndex(9)):(e=this.getAtomFromOffsetIndex(6),b=this.getAtomFromOffsetIndex(1))}if(null==e||null==b)return null;e=JU.V3.newVsub(e,a);b=JU.V3.newVsub(b,a);f&&b.scale(-1);
return JU.Quat.getQuaternionFrameV(e,b,null,g)},"~S");h(b,"isCrossLinked",function(a){if(!r(a,"JM.NucleicMonomer")||this.$isPurine==a.isPurine())return!1;var e=this.$isPurine?a:this;a=(this.$isPurine?this:a).getN1();e=e.getN3();return a.isBonded(e)},"JM.Group");h(b,"getCrossLinkVector",function(a,e,b){if(!b)return!1;e=this.$isPurine?this.getN1():this.getN3();b=e.bonds;if(null==b)return!1;for(var g=0;g<b.length;g++)if(b[g].isHydrogen()){var f=b[g].getOtherAtom(e),d=f.group;if(r(d,"JM.NucleicMonomer")&&
(this.$isPurine?d.getN3():d.getN1())===f){if(null==a)return!0;a.addLast(Integer.$valueOf(e.i));a.addLast(Integer.$valueOf(f.i));a.addLast(Integer.$valueOf(d.leadAtomIndex))}}return null!=a&&0<a.size()},"JU.Lst,~B,~B");d(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");d(b,"addBasePair",function(a){null==this.bps&&(this.bps=new JU.Lst);this.bps.addLast(a)},"JM.BasePair");d(b,"setGroup1",function(a){"\x00"==this.group1&&(this.group1=a)},"~S");d(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],e=null==JM.NucleicPolymer.htGroup1?null:JM.NucleicPolymer.htGroup1.get(a);return null==e?Character.toLowerCase(a.charAt(a.length-1)):e.charAt(0)});d(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 e=4;0<=--e;)a[e]=new JU.P3;if(this.isPurine()){e=JU.P3.newP(this.getC5());e.sub(this.getC8());
e.normalize();a[2].setT(e);a[2].scale(-1);a[0].scaleAdd2(4.9,e,this.getC8());var b=JU.P3.newP(this.getN0());b.sub(this.getC8());a[3].cross(b,e);a[3].normalize()}else e=JU.P3.newP(this.getN0()),e.sub(this.getC6()),b=JU.P3.newP(this.getC5()),b.sub(this.getC6()),a[3].cross(e,b),a[3].normalize(),a[2].setT(e),a[2].normalize(),e=JU.A4.new4(a[3].x,a[3].y,a[3].z,1.1623892818282233),b=new JU.M3,b.setAA(e),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");b.interestingNucleicAtomIDs=K(-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]);b.ring6OffsetIndexes=K(-1,[3,1,4,5,6,7]);b.ring5OffsetIndexes=K(-1,[3,9,10,11,7]);b.riboseOffsetIndexes=K(-1,[25,26,22,27,28,21,29,19,0]);b.heavyAtomIndexes=K(-1,[3,1,4,5,6,7,11,10,9,16,14,8,12,17,13])});s("JM");t(["JM.PhosphorusPolymer"],"JM.NucleicPolymer",["JU.Measure","$.P4","$.V3","JM.HBond"],function(){var b=z(function(){this.isDssrSet=
!1;y(this,arguments)},JM,"NucleicPolymer",JM.PhosphorusPolymer);F(b,function(a){R(this,JM.NucleicPolymer,[a]);this.type=2;this.hasWingPoints=!0},"~A");d(b,"getNucleicPhosphorusAtom",function(a){return this.monomers[a].getLeadAtom()},"~N");h(b,"calcEtaThetaAngles",function(){for(var a=NaN,e=0;e<this.monomerCount-2;++e){var b=this.monomers[e],g=this.monomers[e+1],f=b.getP(),d=b.getC4P(),j=g.getP(),g=g.getC4P();0<e&&(a=this.monomers[e-1].getC4P(),a=JU.Measure.computeTorsion(a,f,d,j,!0));f=JU.Measure.computeTorsion(f,
d,j,g,!0);0>a&&(a+=360);0>f&&(f+=360);b.setGroupParameter(1111490565,a);b.setGroupParameter(1111490576,f)}return!0});h(b,"calcRasmolHydrogenBonds",function(a,e,b,g,f){for(var d=new JU.V3,j=new JU.V3,l=this.monomerCount;0<=--l;){var k=this.monomers[l];if(k.isPurine()){var h=k.getN3(),m=e.get(h.i);if(m||b.get(h.i)){for(var n=k.getN1(),s=k.getN0(),A=JU.Measure.getPlaneThroughPoints(h,n,s,d,j,new JU.P4),h=null,u=25,v=null,w=a.monomerCount;0<=--w;){var r=a.monomers[w];if(r.$isPyrimidine){var t=r.getN3();
if(!(m?!b.get(t.i):!e.get(t.i))){var y=r.getN0(),E=n.distanceSquared(t);E<u&&(50<s.distanceSquared(y)&&1>Math.abs(JU.Measure.distanceToPlane(A,t)))&&(v=r,h=t,u=E)}}}m=0;null!=h&&(m+=JM.NucleicPolymer.addHydrogenBond(g,n,h),m>=f||(k.isGuanine()?(m+=JM.NucleicPolymer.addHydrogenBond(g,k.getN2(),v.getO2()),m>=f||JM.NucleicPolymer.addHydrogenBond(g,k.getO6(),v.getN4())):JM.NucleicPolymer.addHydrogenBond(g,k.getN6(),v.getO4())))}}}},"JM.BioPolymer,JU.BS,JU.BS,JU.Lst,~N,~A,~B,~B");b.addHydrogenBond=d(b,
"addHydrogenBond",function(a,e,b){if(null==e||null==b)return 0;a.addLast(new JM.HBond(e,b,18432,1,0,0));return 1},"JU.Lst,JM.Atom,JM.Atom");b.htGroup1=null});s("JM");M=z(function(){this.g2=this.g1=this.info=null;y(this,arguments)},JM,"BasePair",null);M.add=d(M,"add",function(b,a,e){if(null==a||null==e)return null;var c=new JM.BasePair;c.info=b;(c.g1=a).addBasePair(c);(c.g2=e).addBasePair(c);return c},"java.util.Map,JM.NucleicMonomer,JM.NucleicMonomer");d(M,"getPartnerAtom",function(b){return(b===
this.g1?this.g2:this.g1).getLeadAtom().i},"JM.NucleicMonomer");d(M,"toString",function(){return this.info.toString()});s("JM");t(["JM.BioPolymer"],"JM.PhosphorusPolymer",null,function(){var b=H(JM,"PhosphorusPolymer",JM.BioPolymer);F(b,function(a){R(this,JM.PhosphorusPolymer,[a,!0])},"~A")});s("J.dssx");t(null,"J.dssx.Bridge",["JU.Escape"],function(){var b=z(function(){this.ladder=this.b=this.a=null;this.isAntiparallel=!1;y(this,arguments)},J.dssx,"Bridge",null);F(b,function(a,e,b){this.a=a;this.b=
e;this.ladder=D(2,2,0);this.ladder[0][0]=this.ladder[0][1]=Math.min(a.i,e.i);this.ladder[1][0]=this.ladder[1][1]=Math.max(a.i,e.i);this.addLadder(b)},"JM.Atom,JM.Atom,java.util.Map");d(b,"addBridge",function(a,e){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&&(e.remove(a.ladder),this.addLadder(e));return!0},"J.dssx.Bridge,java.util.Map");
d(b,"addLadder",function(a){a.put(this.ladder,this.isAntiparallel?Boolean.TRUE:Boolean.FALSE)},"java.util.Map");d(b,"canAdd",function(a){var e=a.a.i;a=a.b.i;return this.isAntiparallel?e>=this.ladder[0][1]&&a<=this.ladder[1][0]||e<=this.ladder[0][0]&&a>=this.ladder[1][1]:e<=this.ladder[0][0]&&a<=this.ladder[1][0]||e>=this.ladder[0][1]&&a>=this.ladder[1][1]},"J.dssx.Bridge");d(b,"extendLadder",function(a,e){this.ladder[0][0]>a&&(this.ladder[0][0]=a);this.ladder[0][1]<a&&(this.ladder[0][1]=a);this.ladder[1][0]>
e&&(this.ladder[1][0]=e);this.ladder[1][1]<e&&(this.ladder[1][1]=e)},"~N,~N");h(b,"toString",function(){return(this.isAntiparallel?"a ":"p ")+this.a+" - "+this.b+"\t"+JU.Escape.e(this.ladder)})});s("J.dssx");t(null,"J.dssx.DSSP","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;y(this,arguments)},J.dssx,"DSSP",null);X(b,function(){this.sheetOffsets=P(-1,[D(-1,[0,-1,1,0,1,0,0,-1]),D(-1,[0,0,0,0,1,-1,1,-1])])});F(b,function(){});d(b,"calculateDssp",function(a,e,b,g,f,d,j){this.bioPolymers=a;this.bioPolymerCount=e;this.vHBonds=b;this.doReport=g;this.dsspIgnoreHydrogens=f;this.setStructure=d;this.isDSSP2=1<j;a=new JU.BS;for(j=0;j<e;j++)r(this.bioPolymers[j],
"JM.AminoPolymer")&&a.set(j);if(a.isEmpty())return"";j=this.bioPolymers[0].model;b=new JU.SB;b.append("Jmol ").append(JV.Viewer.getJmolVersion()).append(" DSSP analysis for model ").append(j.ms.getModelNumberDotted(j.modelIndex)).append(" - ").append(j.ms.getModelTitle(j.modelIndex)).append("\n");0==j.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");d&&0==j.modelIndex&&b.append("\nAll bioshapes have been deleted and must be regenerated.\n");0<j.altLocCount&&b.append("\nNote: This model contains alternative locations. Use  'CONFIGURATION 1' to be consistent with CMBI DSSP.\n");this.labels=aa(e,"\x00");this.done=Array(e);this.bsBad=new JU.BS;var l=!1;for(j=a.nextSetBit(0);0<=j;j=a.nextSetBit(j+1)){d=this.bioPolymers[j];!l&&null!=d.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")),
l=!0);d.recalculateLeadMidpointsAndWingVectors();var k=d.monomerCount;this.labels[j]=aa(k,"\x00");this.done[j]=new JU.BS;for(var h=0;h<k;h++)null==d.monomers[h].getCarbonylOxygenAtom()&&this.bsBad.set(d.monomers[h].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();e=Array(e);for(j=a.nextSetBit(0);0<=j;j=a.nextSetBit(j+1))null!=
f[j]&&(e[j]=this.findHelixes(j,f[j]));if(g){g=new JU.SB;b.append("\n------------------------------\n");for(j=a.nextSetBit(0);0<=j;j=a.nextSetBit(j+1))null!=this.labels[j]&&(d=this.bioPolymers[j],g.append(this.dumpSummary(d,this.labels[j])),b.append(e[j]).append(this.dumpTags(d,"$.1: "+String.valueOf(this.labels[j]),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:"+g)}return b.toString()},
"~A,~N,~O,~B,~B,~B,~N");d(b,"getDualHydrogenBondArray",function(){for(var a=JU.AU.newInt4(this.bioPolymerCount),e=0;e<this.bioPolymerCount;e++)if(r(this.bioPolymers[e],"JM.AminoPolymer")){var b=this.bioPolymers[e].monomerCount;a[e]=D(b,2,3,0);for(var g=0;g<b;++g)a[e][g][0][1]=a[e][g][1][1]=-2147483648,a[e][g][0][2]=a[e][g][1][2]=0}for(e=0;e<this.bioPolymerCount;e++)if(null!=a[e])for(g=0;g<this.bioPolymerCount;g++)null!=a[g]&&this.bioPolymers[e].calcRasmolHydrogenBonds(this.bioPolymers[g],null,null,
null,2,a[e],!1,this.dsspIgnoreHydrogens);return a});d(b,"getBridges",function(a){for(var e=this.bioPolymers[0].model.ms.at,b=null,g=new java.util.Hashtable,f=0;f<a.length;f++)if(r(this.bioPolymers[f],"JM.AminoPolymer"))for(var d=this.bioPolymers[f],j=a[f].length-1,l=1;l<j;l++){var k=d.monomers[l].leadAtomIndex;if(!this.bsBad.get(k))for(var h=f;h<a.length;h++)if(r(this.bioPolymers[h],"JM.AminoPolymer"))for(var m=f==h?l+3:1;m<a[h].length-1;m++){var n=this.bioPolymers[h],s=n.monomers[m].leadAtomIndex;
if(!this.bsBad.get(s)){if(null==(b=this.getBridge(a,f,l,h,m,this.bridgesP,e[k],e[s],d,n,g,!1)))if(null!=(b=this.getBridge(a,f,l,h,m,this.bridgesA,e[k],e[s],d,n,g,!0)))b.isAntiparallel=!0;else continue;JU.Logger.debugging&&JU.Logger.debug("Bridge found "+b);this.done[f].set(l);this.done[h].set(m);this.htBridges.put(k+"-"+s,b)}}}},"~A");d(b,"getBridge",function(a,e,b,g,f,d,j,l,k,h,m,n){var s=null,A=null,u=0,v=n?this.sheetOffsets[1]:this.sheetOffsets[0];return null!=(s=this.isHbonded(b+v[0],f+v[1],e,
g,a))&&null!=(A=this.isHbonded(f+v[2],b+v[3],g,e,a))||null!=(s=this.isHbonded(b+v[u=4],f+v[5],e,g,a))&&null!=(A=this.isHbonded(f+v[6],b+v[7],g,e,a))?(a=new J.dssx.Bridge(j,l,this.htLadders),d.addLast(a),null!=this.vHBonds&&(d=n?14336:6144,this.addHbond(k.monomers[b+v[u]],h.monomers[f+v[++u]],s[2],d,m),this.addHbond(h.monomers[f+v[++u]],k.monomers[b+v[++u]],A[2],d,m)),a):null},"~A,~N,~N,~N,~N,JU.Lst,JM.Atom,JM.Atom,JM.AminoPolymer,JM.AminoPolymer,java.util.Map,~B");d(b,"addHbond",function(a,e,b,g,
d){a=a.getNitrogenAtom();e=e.getCarbonylOxygenAtom();if(null!=d){var q=a.i+" "+e.i;if(d.containsKey(q))return;d.put(q,Boolean.TRUE)}this.vHBonds.addLast(new JM.HBond(a,e,g,1,0,b/1E3))},"JM.Monomer,JM.Monomer,~N,~N,java.util.Map");d(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,e=new JU.BS,b,g=this.htLadders.keySet().iterator();g.hasNext()&&((b=g.next())||1);)b[0][0]==
b[0][1]&&b[1][0]==b[1][1]?(e.set(b[0][0]),e.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 g=new JU.BS,d=this.bioPolymers.length;0<=--d;)if(r(this.bioPolymers[d],"JM.AminoPolymer")){b.clearAll();g.clearAll();for(var q=this.bioPolymers[d],j=0;j<q.monomerCount;){var l=q.monomers[j].leadAtomIndex;if(a.get(l)){for(l=j+1;l<q.monomerCount&&a.get(q.monomers[l].leadAtomIndex);)l++;b.setBits(j,l);j=l}else e.get(l)&&g.set(j),++j}this.doReport&&(this.setTag(this.labels[d],
g,"B"),this.setTag(this.labels[d],b,"E"));this.setStructure&&q.setStructureBS(0,3,J.c.STR.SHEET,b,!1);this.done[d].or(b);this.done[d].or(g)}}});d(b,"createLadders",function(a,e){for(var b=e?-1:1,d=a.size(),f=0;f<d;f++)this.checkBridge(a.get(f),e,1,b);for(f=0;f<d;f++)this.checkBulge(a.get(f),e,1)},"JU.Lst,~B");d(b,"checkBridge",function(a,e,b,d){e=this.htBridges.get(a.a.getOffsetResidueAtom("\x00",b)+"-"+a.b.getOffsetResidueAtom("\x00",d));return null!=e&&a.addBridge(e,this.htLadders)},"J.dssx.Bridge,~B,~N,~N");
d(b,"checkBulge",function(a,b,c){for(var d=b?-1:1,f=0;3>f;f++)for(var q=0==f?1:0;6>q;q++)this.checkBridge(a,b,f*c,q*d),q>f&&this.checkBridge(a,b,q*c,f*d)},"J.dssx.Bridge,~B,~N");d(b,"dumpSummary",function(a,b){for(var c=a.monomers[0].getLeadAtom(),c=0==c.getChainID()?"":c.getChainIDStr()+":",d=new JU.SB,f="\x00",q="\x00",j="\x00",l=-1,k=-1,h=a.monomerCount,m=a.monomers,n=0;n<=h;n++){if(n==h||b[n]!=f){"\x00"!=f&&d.appendC("\n").appendC(f).append(" : ").append(c).appendI(l).append("\x00"==q?"":String.valueOf(q)).append("_").append(c).appendI(k).append("\x00"==
j?"":String.valueOf(j));if(n==h)break;f=b[n];l=m[n].getResno();q=m[n].getInsertionCode()}k=m[n].getResno();j=m[n].getInsertionCode()}return d.toString()},"JM.AminoPolymer,~A");d(b,"dumpTags",function(a,b,c,d){var f=a.monomers[0].getLeadAtom().getChainID()+"."+(a.bioPolymerIndexInModel+1);b=JU.PT.rep(b,"$",f);for(var q=a.monomers[0].getResno(),j="\n"+f,f=new JU.SB,l=(new JU.SB).append(j+".8: "),k=(new JU.SB).append(j+".7: "),h=(new JU.SB).append(j+".6: "),j=(new JU.SB).append(j+".0: "),m=a.monomerCount,
n=0;n<m;n++)q=a.monomers[n].getResno(),l.append(0==q%100?""+w(q/100)%100:" "),k.append(0==q%10?""+w(q/10)%10:" "),h.appendI(q%10),j.appendC(c.get(a.monomers[n].leadAtomIndex)?"!":a.monomers[n].getGroup1());1==(d&1)&&f.appendSB(l).appendSB(k).appendSB(h);f.append("\n");f.append(b);2==(d&2)&&(f.appendSB(j),f.append("\n\n"));return f.toString().$replace("\x00",".")},"JM.AminoPolymer,~S,JU.BS,~N");d(b,"isHbonded",function(a,b,c,d,f){if(0>a||0>b)return null;c=f[c];f=f[d];return a>=c.length||b>=f.length?
null:c[a][0][0]==d&&c[a][0][1]==b?c[a][0]:c[a][1][0]==d&&c[a][1][1]==b?c[a][1]:null},"~N,~N,~N,~N,~A");d(b,"findHelixes",function(a,b){var c=this.bioPolymers[a];if(JU.Logger.debugging)for(var d=0;d<c.monomerCount;d++)JU.Logger.debug(a+"."+c.monomers[d].getResno()+"\t"+JU.Escape.e(b[d]));var d=new JU.BS,f,q,j;this.isDSSP2?(j=this.findHelixes2(0,a,5,b,J.c.STR.HELIXPI,12288,d,!0),q=this.findHelixes2(2,a,4,b,J.c.STR.HELIXALPHA,10240,d,!1),f=this.findHelixes2(4,a,3,b,J.c.STR.HELIX310,8192,d,!1)):(q=this.findHelixes2(2,
a,4,b,J.c.STR.HELIXALPHA,10240,d,!0),f=this.findHelixes2(4,a,3,b,J.c.STR.HELIX310,8192,d,!1),j=this.findHelixes2(0,a,5,b,J.c.STR.HELIXPI,12288,d,!1));this.setStructure&&c.setStructureBS(0,6,J.c.STR.TURN,d,!1);return this.doReport?(this.setTag(this.labels[a],d,"T"),this.dumpTags(c,"$.5: "+j+"\n$.4: "+q+"\n$.3: "+f,this.bsBad,1)):""},"~N,~A");d(b,"findHelixes2",function(a,b,c,d,f,q,j,l){for(var k=this.bioPolymers[b],h=new JU.BS,m=new JU.BS,n=new JU.BS,s=new JU.BS,A=new JU.BS,u=this.done[b],v="",w=k.monomerCount,
r=c;r<w;++r){var t=r-c,y=0;if(d[r][0][0]==b&&d[r][0][1]==t||d[r][y=1][0]==b&&d[r][1][1]==t){var E=k.monomers[t].leadAtomIndex,B=this.bsBad.nextSetBit(E),C=k.monomers[r];if(!(B>=E&&B<=C.leadAtomIndex)){h.set(t);m.setBits(t+1,r);s.set(r);var B=u.nextSetBit(t),E=0>B||B>=r,z=!1;if(0<t&&h.get(t-1)&&(l||E))A.setBits(t,r),E||(v+="  WARNING! Bridge to helix at "+k.monomers[B]),z=!0;else if(E||u.nextClearBit(B)<r)z=!0;s.get(t)&&n.set(t);z&&null!=this.vHBonds&&this.addHbond(C,k.monomers[t],d[r][y][2],q,null)}}}this.doReport?
(d=aa(w,"\x00"),this.setTag(d,m,String.fromCharCode(48+c)),this.setTag(d,h,">"),this.setTag(d,s,"<"),this.setTag(d,n,"X")):d=null;u.or(A);m.andNot(u);j.or(m);j.andNot(A);this.setStructure&&k.setStructureBS(0,a,f,A,!1);return this.doReport?(this.setTag(this.labels[b],A,String.fromCharCode(68+c)),String.valueOf(d)+v):""},"~N,~N,~N,~A,J.c.STR,~N,JU.BS,~B");d(b,"setTag",function(a,b,c){for(var d=b.nextSetBit(0);0<=d;d=b.nextSetBit(d+1))a[d]=c},"~A,JU.BS,~S")});s("J.g3d");t(["J.g3d.G3DRenderer","JU.P3",
"$.V3"],"J.g3d.HermiteRenderer",["JU.Lst","$.P3i"],function(){var b=z(function(){this.needToFill=this.depth1=this.T2=this.T1=this.d2=this.d1=this.c2=this.c1=this.b2=this.b1=this.a2=this.a1=this.pBotRight=this.pBotLeft=this.pTopRight=this.pTopLeft=this.sRight=this.sLeft=this.pRight=this.pLeft=this.gdata=this.g3d=null;y(this,arguments)},J.g3d,"HermiteRenderer",null,J.g3d.G3DRenderer);X(b,function(){this.pLeft=Array(16);this.pRight=Array(16);this.sLeft=N(16,0);this.sRight=N(16,0);this.pTopLeft=Array(16);
this.pTopRight=Array(16);this.pBotLeft=Array(16);this.pBotRight=Array(16);for(var a=16;0<=--a;)this.pLeft[a]=new JU.P3i,this.pRight[a]=new JU.P3i,this.pTopLeft[a]=new JU.P3,this.pTopRight[a]=new JU.P3,this.pBotLeft[a]=new JU.P3,this.pBotRight[a]=new JU.P3;this.a1=new JU.P3;this.a2=new JU.P3;this.b1=new JU.P3;this.b2=new JU.P3;this.c1=new JU.P3;this.c2=new JU.P3;this.d1=new JU.P3;this.d2=new JU.P3;this.T1=new JU.V3;this.T2=new JU.V3;this.depth1=new JU.V3;this.needToFill=fa(16,!1)});F(b,function(){});
h(b,"set",function(a,b){this.g3d=a;this.gdata=b;return this},"J.api.JmolRendererInterface,JU.GData");d(b,"renderHermiteRope",function(a,b,c,d,f,q,j,h,k){var p=n(j.z),m=n(h.z);if(!(1==q.z||1==p||1==m||1==k.z)&&!this.gdata.isClippedZ(p)&&!this.gdata.isClippedZ(m)){var s=n(j.x);j=n(j.y);var r=n(h.x);h=n(h.y);var t=w((r-n(q.x))*b/8),u=w((h-n(q.y))*b/8);q=w((m-n(q.z))*b/8);var v=w((n(k.x)-s)*b/8),y=w((n(k.y)-j)*b/8);b=w((n(k.z)-p)*b/8);this.sLeft[0]=0;this.pLeft[0].set(s,j,p);this.sRight[0]=1;this.pRight[0].set(r,
h,m);var z=k=0,D=0;a&&(z=2*(d-c),D=2*(f-d));do{var F=this.pLeft[k];f=this.pRight[k];var E=f.x-F.x;if(-1<=E&&1>=E&&(f=f.y-F.y,-1<=f&&1>=f)){f=this.sLeft[k];a?(f=0.5>f?c+n(z*f):d+n(D*(f-0.5)),this.g3d.fillSphereI(f,F)):this.g3d.plotPixelClippedP3i(F);--k;continue}f=(this.sLeft[k]+this.sRight[k])/2;var B=f*f,C=B*f,F=2*C-3*B+1,E=-2*C+3*B,H=C-2*B+f,B=C-B;if(15<=k)break;C=this.pRight[k+1];C.x=w(F*s+E*r+H*t+B*v);C.y=w(F*j+E*h+H*u+B*y);C.z=w(F*p+E*m+H*q+B*b);this.pRight[k+1]=this.pRight[k];this.sRight[k+
1]=this.sRight[k];this.pRight[k]=C;this.sRight[k]=f;++k;this.pLeft[k].setT(C);this.sLeft[k]=f}while(0<=k)}},"~B,~N,~N,~N,~N,JU.P3,JU.P3,JU.P3,JU.P3");d(b,"renderHermiteRibbon",function(a,b,c,d,f,h,j,l,k,p,m,s,r){if(!(1==d.z||1==f.z||1==h.z||1==j.z||1==l.z||1==k.z||1==p.z||1==m.z))if(a){(a=0>c)&&(c=-c);var t=1/s,u=n(f.x),v=n(f.y);f=n(f.z);var y=n(h.x),z=n(h.y);h=n(h.z);var D=w((y-n(d.x))*c/8),F=w((z-n(d.y))*c/8);d=w((h-n(d.z))*c/8);var E=w((n(j.x)-u)*c/8),B=w((n(j.y)-v)*c/8);j=w((n(j.z)-f)*c/8);this.pTopLeft[0].set(u,
v,f);this.pTopRight[0].set(y,z,h);var C=n(k.x),H=n(k.y);k=n(k.z);var S=n(p.x),P=n(p.y);p=n(p.z);var Q=w((S-n(l.x))*c/8),N=w((P-n(l.y))*c/8);l=w((p-n(l.z))*c/8);var ha=w((n(m.x)-C)*c/8),K=w((n(m.y)-H)*c/8);c=w((n(m.z)-k)*c/8);this.pBotLeft[0].set(C,H,k);this.pBotRight[0].set(S,P,p);this.sLeft[0]=0;this.sRight[0]=1;this.needToFill[0]=!0;m=0;var M=!1;do{var L=this.pTopLeft[m],O=this.pTopRight[m],T=O.x-L.x,T=T*T;if(10>T){var U=O.y-L.y,U=U*U;if(10>U){var I=this.pBotLeft[m],G=this.pBotRight[m],V=G.x-I.x,
V=V*V;if(8>V){var W=G.y-I.y,W=W*W;if(8>W&&(b&&(this.g3d.fillSphereBits(3,L),this.g3d.fillSphereBits(3,I)),this.needToFill[m]&&(0<s?(this.T1.sub2(L,I),this.T1.scale(t),this.T2.sub2(L,O),this.depth1.cross(this.T1,this.T2),this.depth1.scale(this.T1.length()/this.depth1.length()),this.a1.add2(L,this.depth1),this.a2.sub2(L,this.depth1),this.b1.add2(O,this.depth1),this.b2.sub2(O,this.depth1),this.c1.add2(I,this.depth1),this.c2.sub2(I,this.depth1),this.d1.add2(G,this.depth1),this.d2.sub2(G,this.depth1),
this.g3d.fillQuadrilateral(this.a1,this.b1,this.d1,this.c1,!1),this.g3d.fillQuadrilateral(this.a2,this.b2,this.d2,this.c2,!1),this.g3d.fillQuadrilateral(this.a1,this.b1,this.b2,this.a2,!1),this.g3d.fillQuadrilateral(this.c1,this.d1,this.d2,this.c2,!1),M=!0):0==r?a?this.g3d.fillQuadrilateral(I,G,O,L,!1):this.g3d.fillQuadrilateral(L,O,G,I,!1):a?(r!=J.g3d.HermiteRenderer.isFront(L,O,G)&&this.g3d.fillTriangle3f(L,O,G,!1),r!=J.g3d.HermiteRenderer.isFront(L,G,I)&&this.g3d.fillTriangle3f(L,G,I,!1)):(r==
J.g3d.HermiteRenderer.isFront(L,O,G)&&this.g3d.fillTriangle3f(L,O,G,!1),r==J.g3d.HermiteRenderer.isFront(L,G,I)&&this.g3d.fillTriangle3f(L,G,I,!1)),this.needToFill[m]=!1),2>T+U&&2>V+W)){--m;continue}}}}L=(this.sLeft[m]+this.sRight[m])/2;I=L*L;G=I*L;O=2*G-3*I+1;T=-2*G+3*I;U=G-2*I+L;I=G-I;if(15<=m)break;G=m+1;V=this.pTopRight[G];V.x=O*u+T*y+U*D+I*E;V.y=O*v+T*z+U*F+I*B;V.z=O*f+T*h+U*d+I*j;W=this.pBotRight[G];W.x=O*C+T*S+U*Q+I*ha;W.y=O*H+T*P+U*N+I*K;W.z=O*k+T*p+U*l+I*c;this.pTopRight[G]=this.pTopRight[m];
this.pTopRight[m]=V;this.pBotRight[G]=this.pBotRight[m];this.pBotRight[m]=W;this.sRight[G]=this.sRight[m];this.sRight[m]=L;this.needToFill[G]=this.needToFill[m];this.pTopLeft[G].setT(V);this.pBotLeft[G].setT(W);this.sLeft[G]=L;++m}while(0<=m);M&&(this.a1.z+=1,this.c1.z+=1,this.c2.z+=1,this.a2.z+=1,this.g3d.fillQuadrilateral(this.a1,this.c1,this.c2,this.a2,!1))}else c=Math.abs(c),this.renderParallelPair(a,c,d,f,h,j,l,k,p,m)},"~B,~B,~N,JU.P3,JU.P3,JU.P3,JU.P3,JU.P3,JU.P3,JU.P3,JU.P3,~N,~N");b.isFront=
d(b,"isFront",function(a,b,c){J.g3d.HermiteRenderer.vAB.sub2(b,a);J.g3d.HermiteRenderer.vAC.sub2(c,a);J.g3d.HermiteRenderer.vAB.cross(J.g3d.HermiteRenderer.vAB,J.g3d.HermiteRenderer.vAC);return 0>J.g3d.HermiteRenderer.vAB.z?-1:1},"JU.P3,JU.P3,JU.P3");d(b,"renderParallelPair",function(a,b,c,d,f,h,j,l,k,p){var m=P(-1,[f,d,k,l]);a=new JU.Lst;var r=0,s=2,t=0,u=n(d.x),v=n(d.y);d=n(d.z);var y=n(f.x),z=n(f.y);f=n(f.z);var D=w((y-n(c.x))*b/8),F=w((z-n(c.y))*b/8);c=w((f-n(c.z))*b/8);var E=w((n(h.x)-u)*b/8),
B=w((n(h.y)-v)*b/8);h=w((n(h.z)-d)*b/8);this.sLeft[0]=0;this.pLeft[0].set(u,v,d);this.sRight[0]=1;this.pRight[0].set(y,z,f);for(var C=0,H=2;0<H;H--){1==H&&(u=n(l.x),v=n(l.y),d=n(l.z),y=n(k.x),z=n(k.y),f=n(k.z),D=w((y-n(j.x))*b/8),F=w((z-n(j.y))*b/8),c=w((f-n(j.z))*b/8),E=w((n(p.x)-u)*b/8),B=w((n(p.y)-v)*b/8),h=w((n(p.z)-d)*b/8),this.sLeft[0]=0,this.pLeft[0].set(u,v,d),this.sRight[0]=1,this.pRight[0].set(y,z,f),C=0);a.addLast(m[r++]);t=0.2;do{var S=this.pLeft[C],M=this.pRight[C],Q=M.x-S.x,M=M.y-S.y;
if(2>=Q*Q+M*M)Q=this.sLeft[C],this.g3d.fillSphereI(3,S),Q<1-t&&(Q=new JU.P3,Q.set(S.x,S.y,S.z),a.addLast(Q),t+=0.2,2==H&&s++),--C;else{var Q=(this.sLeft[C]+this.sRight[C])/2,N=Q*Q,K=N*Q,S=2*K-3*N+1,M=-2*K+3*N,R=K-2*N+Q,N=K-N;if(15<=C)break;K=this.pRight[C+1];K.x=w(S*u+M*y+R*D+N*E);K.y=w(S*v+M*z+R*F+N*B);K.z=w(S*d+M*f+R*c+N*h);this.pRight[C+1]=this.pRight[C];this.sRight[C+1]=this.sRight[C];this.pRight[C]=K;this.sRight[C]=Q;++C;this.pLeft[C].setT(K);this.sLeft[C]=Q}}while(0<=C);a.addLast(m[r++])}b=
a.size();for(j=0;j<s&&j+s<b;j++)this.g3d.drawLineAB(a.get(j),a.get(j+s))},"~B,~N,JU.P3,JU.P3,JU.P3,JU.P3,JU.P3,JU.P3,JU.P3,JU.P3");b.vAB=new JU.V3;b.vAC=new JU.V3});s("J.shapebio");t(["J.shape.AtomShape"],"J.shapebio.BioShape","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;y(this,arguments)},J.shapebio,"BioShape",J.shape.AtomShape);F(b,function(a,b,c){R(this,J.shapebio.BioShape,[]);this.shape=a;this.modelIndex=b;this.bioPolymer=c;this.isActive=a.isActive;this.bsSizeDefault=new JU.BS;this.monomerCount=c.monomerCount;0<this.monomerCount&&(this.colixes=ca(this.monomerCount,0),this.paletteIDs=K(this.monomerCount,0),this.mads=ca(this.monomerCount+1,0),this.monomers=c.monomers,this.meshReady=fa(this.monomerCount,
!1),this.meshes=Array(this.monomerCount),this.wingVectors=c.getWingVectors(),this.leadAtomIndices=c.getLeadAtomIndices())},"J.shapebio.BioShapeCollection,~N,JM.BioPolymer");h(b,"setProperty",function(a,b,c){this.setPropAS(a,b,c)},"~S,~O,JU.BS");d(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});d(b,"calcMeanPositionalDisplacement",function(a){return ga(1E3*Math.sqrt(a/7895.6835208714865))},"~N");h(b,"findNearestAtomIndex",function(a,b,c,d){this.bioPolymer.findNearestAtomIndex(a,b,c,this.mads,this.shape.vf,d)},"~N,~N,~A,JU.BS");d(b,"setMad",function(a,b,c){if(!(2>this.monomerCount)){this.isActive=!0;null==this.bsSizeSet&&(this.bsSizeSet=new JU.BS);for(var d=this.shape.vf,f=32768==d&&r(this.bioPolymer,
"JM.NucleicPolymer"),h=this.monomerCount;0<=--h;){var j=this.leadAtomIndices[h];if(b.get(j)){if(null!=c&&j<c.length){if(Float.isNaN(c[j]))continue;a=da(2E3*c[j])}var l=0<(this.mads[h]=this.getMad(h,a));this.bsSizeSet.setBitTo(h,l);this.monomers[h].setShapeVisibility(d,l);this.shape.atoms[j].setShapeVisibility(d,l);f&&this.monomers[h].setRingsVisible(l);this.falsifyNearbyMesh(h)}}1<this.monomerCount&&(this.mads[this.monomerCount]=this.mads[this.monomerCount-1])}},"~N,JU.BS,~A");d(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 da(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");d(b,"falsifyMesh",function(){if(null!=this.meshReady)for(var a=0;a<this.monomerCount;a++)this.meshReady[a]=!1});d(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");d(b,"setColixBS",function(a,b,c){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=JU.BS.newN(this.monomerCount));for(var d=this.monomerCount;0<=--d;){var f=this.leadAtomIndices[d];c.get(f)&&(this.colixes[d]=this.shape.getColixI(a,b,f),null!=this.colixesBack&&this.colixesBack.length>d&&(this.colixesBack[d]=0),this.paletteIDs[d]=b,this.bsColixSet.setBitTo(d,0!=this.colixes[d]))}},"~N,~N,JU.BS");d(b,"setColixBack",function(a,b){null==this.colixesBack&&(this.colixesBack=
ca(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");d(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 d=this.leadAtomIndices[c];b.get(d)&&(c<this.colixes.length&&d<a.length)&&(this.colixes[c]=
this.shape.getColixI(a[d],J.c.PAL.UNKNOWN.id,d),null!=this.colixesBack&&c<this.colixesBack.length&&(this.colixesBack[c]=0),this.paletteIDs[c]=J.c.PAL.UNKNOWN.id,this.bsColixSet.set(c))}},"~A,JU.BS");d(b,"setParams",function(a,b,c){if(0!=this.monomerCount){var d=a[0];a=a[1];this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=JU.BS.newN(this.monomerCount));for(var f=b.length,h=this.monomerCount;0<=--h;){var j=this.leadAtomIndices[h];if(c.get(j)&&h<this.colixes.length&&j<f){var l=b[j],k=null==d?
0:d[l],l=null==a?0:a[l];0.01<l&&(k=JU.C.getColixTranslucent3(k,!0,l));this.colixes[h]=this.shape.getColixI(k,J.c.PAL.UNKNOWN.id,j);null!=this.colixesBack&&h<this.colixesBack.length&&(this.colixesBack[h]=0);this.paletteIDs[h]=J.c.PAL.UNKNOWN.id;this.bsColixSet.set(h)}}}},"~A,~A,JU.BS");d(b,"setTranslucent",function(a,b,c){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=JU.BS.newN(this.monomerCount));for(var d=this.monomerCount;0<=--d;)b.get(this.leadAtomIndices[d])&&(this.colixes[d]=JU.C.getColixTranslucent3(this.colixes[d],
a,c),null!=this.colixesBack&&this.colixesBack.length>d&&(this.colixesBack[d]=JU.C.getColixTranslucent3(this.colixesBack[d],a,c)),this.bsColixSet.setBitTo(d,0!=this.colixes[d]))},"~B,JU.BS,~N");h(b,"setAtomClickability",function(){if(this.isActive&&!(null==this.wingVectors||0==this.monomerCount))for(var a=r(this.bioPolymer,"JM.NucleicPolymer")&&11==this.shape.shapeID,b=r(this.bioPolymer,"JM.AlphaPolymer")||15!=this.shape.shapeID,c=this.monomers[0].chain.model.ms,d=this.monomerCount;0<=--d;)if(!(0>=
this.mads[d])){var f=this.leadAtomIndices[d];c.isAtomHidden(f)||(b&&c.at[f].setClickable(1040384),a&&this.monomers[d].setRingsClickable())}});d(b,"getBioShapeState",function(a,b,c,d){if(0<this.monomerCount&&this.isActive&&!(null==this.bsSizeSet&&null==this.bsColixSet))for(var f=0;f<this.monomerCount;f++){var h=this.monomers[f].firstAtomIndex,j=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,
h,j,a+(this.bsSizeSet.get(f)?" on":" off")):JU.BSUtil.setMapBitSet(c,h,j,a+" "+JU.PT.escF(this.mads[f]/2E3));if(null!=this.bsColixSet&&this.bsColixSet.get(f)){var l=J.shape.Shape.getColorCommand(a,this.paletteIDs[f],this.colixes[f],b);null!=this.colixesBack&&(this.colixesBack.length>f&&0!=this.colixesBack[f])&&(l+=" "+JU.C.getHexCode(this.colixesBack[f]));JU.BSUtil.setMapBitSet(d,h,j,l)}}},"~S,~B,java.util.Map,java.util.Map");h(b,"getShapeState",function(){return null})});s("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;y(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 d=this.bioShapes[c],f=0;f<d.monomerCount;f++)if(d.monomers[f].groupIndex==b&&d.monomers[f].getLeadAtom().i==a)return d.mads[f];return 0},"JM.Group");h(b,"replaceGroup",function(a,b){for(var c=this.bioShapes.length;0<=--c;)for(var d=this.bioShapes[c],f=0;f<d.monomerCount;f++)if(d.monomers[f]===a){d.monomers[f]=b;break}},"JM.Group,JM.Group");h(b,"setShapeSizeRD",function(a,b,c){this.initialize();for(var d=this.bioShapes.length;0<=
--d;){var f=this.bioShapes[d];0<f.monomerCount&&f.setMad(a,c,null==b?null:b.values)}},"~N,J.atomdata.RadiusData,JU.BS");h(b,"setProperty",function(a,b,c){this.setPropBSC(a,b,c)},"~S,~O,JU.BS");d(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 d=J.c.PAL.pidOf(b),f=JU.C.getColixO(b);for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],0<b.monomerCount&&b.setColixBS(f,d,c)}else if("pymolparams"===a){a=c.length();d=D(a,0);f=0;for(a=c.nextSetBit(0);0<=a;a=c.nextSetBit(a+1),f++)d[a]=f;for(a=this.bioShapes.length;0<=--a;)this.bioShapes[a].setParams(b,d,c)}else if("colorPhase"===
a){d=JU.C.getColixO(b[0]);f=JU.C.getColixO(b[1]);for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],0<b.monomerCount&&(b.setColixBS(f,64,c),b.setColixBack(d,c))}else if("translucency"===a){d="translucent".equals(b);for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],0<b.monomerCount&&b.setTranslucent(d,c,this.translucentLevel)}else this.setPropS(a,b,c)},"~S,~O,JU.BS");h(b,"getShapeState",function(){for(var a=new java.util.Hashtable,b=new java.util.Hashtable,c=JV.JC.shapeClassBases[this.shapeID],
d=this.bioShapes.length;0<=--d;)this.bioShapes[d].getBioShapeState(c,this.translucentAllowed,a,b);return"\n"+this.vwr.getCommands(a,b,9==this.shapeID?"Backbone":"select")});d(b,"initialize",function(){for(var a=this.ms.mc,b=this.ms.am,c=this.ms.getBioPolymerCountInModel(-1),d=Array(c--);0<=--a;)for(var f=this.ms.getBioPolymerCountInModel(a);0<=--f;c--){var h=b[a].bioPolymers[f];d[c]=null==this.bioShapes||this.bioShapes.length<=c||null==this.bioShapes[c]||this.bioShapes[c].bioPolymer!==h?new J.shapebio.BioShape(this,
a,h):this.bioShapes[c]}this.bioShapes=d});h(b,"findNearestAtomIndex",function(a,b,c,d){for(var f=this.bioShapes.length;0<=--f;)this.bioShapes[f].findNearestAtomIndex(a,b,c,d)},"~N,~N,~A,JU.BS");h(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()});d(b,"getMpsShapeCount",function(){return this.bioShapes.length});d(b,"getBioShape",function(a){return this.bioShapes[a]},"~N")});s("J.shapebio");t(["J.shapebio.BioShapeCollection"],"J.shapebio.Rockets",null,function(){var b=H(J.shapebio,"Rockets",J.shapebio.BioShapeCollection);h(b,"initShape",function(){this.setTurn()});d(b,"setTurn",function(){this.madTurnRandom=500})});s("J.shapebio");t(["J.shapebio.Rockets"],
"J.shapebio.Cartoon",null,function(){var b=H(J.shapebio,"Cartoon",J.shapebio.Rockets);h(b,"initShape",function(){this.setTurn();this.madDnaRna=1E3})});s("J.shapebio");t(["J.shapebio.BioShapeCollection"],"J.shapebio.Backbone",["JU.BS"],function(){var b=z(function(){this.bsSelected=null;y(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 d=null!=this.bsSelected;d&&(c=this.bsSelected);for(var f=this.bioShapes.length;0<=--f;){var h=this.bioShapes[f];if(0!=h.monomerCount){var j=this.vwr.getBoolean(603979812),l=h.bioPolymer.getLeadAtomIndices(),k=0!=a;null==h.bsSizeSet&&(h.bsSizeSet=new JU.BS);h.isActive=!0;for(var n=h.monomerCount,m=n-(h.bioPolymer.isCyclic()?0:1);0<=--m;){var r=l[m],s=l[(m+
1)%n],t=c.get(r),u=c.get(s);if(t&&u||d&&t||j&&(t||u)){h.monomers[m].setShapeVisibility(this.vf,k);t=this.ms.at[r];if(null!=b){if(Float.isNaN(b.values[r])||Float.isNaN(b.values[s]))continue;a=da(1E3*(b.values[r]+b.values[s]));k=0!=a}r=this.ms.at[s];0!=h.mads[m]!=k&&(this.addDisplayedBackbone(t,k),this.addDisplayedBackbone(r,k));h.mads[m]=a;h.bsSizeSet.setBitTo(m,k);h.bsSizeDefault.setBitTo(m,-1==a)}}}}d&&(this.bsSelected=null)},"~N,J.atomdata.RadiusData,JU.BS");d(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 d=this.ms.at[c[b]];0<d.nBackbonesDisplayed&&!this.ms.isAtomHidden(d.i)&&d.setClickable(this.vf)}})});s("J.shapebio");t(["J.shapebio.BioShapeCollection"],"J.shapebio.Strands",null,function(){z(function(){this.isMesh=!1;y(this,arguments)},
J.shapebio,"Strands",J.shapebio.BioShapeCollection)});s("J.shapebio");t(["J.shapebio.BioShapeCollection"],"J.shapebio.Ribbons",null,function(){H(J.shapebio,"Ribbons",J.shapebio.BioShapeCollection)});s("J.shapebio");t(["J.shapebio.Strands"],"J.shapebio.MeshRibbon",null,function(){var b=H(J.shapebio,"MeshRibbon",J.shapebio.Strands);h(b,"initShape",function(){this.isMesh=!0})});s("J.shapebio");t(["J.shapebio.BioShapeCollection"],"J.shapebio.Trace",["J.atomdata.RadiusData","J.c.VDW"],function(){var b=
H(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");d(b,"setPutty",function(a,b){var c=b.cardinality();if(0!=c){for(var d=N(b.length(),0),f=0,h=0,j=3.4028235E38,l=0,k=b.nextSetBit(0);0<=k;k=b.nextSetBit(k+1)){var p=this.atoms[k].atomPropertyFloat(null,1111492620,null),f=f+p,h=h+p*p;p<j&&
(j=p);p>l&&(l=p)}var p=f/c,c=Math.sqrt((h-f*f/c)/c),f=a[1],h=a[2],m=a[3],r=a[4],s=a[5],t=n(a[6]),l=l-j,u=!1;switch(t){case 0:case 1:case 2:case 3:u=!0}for(k=b.nextSetBit(0);0<=k;k=b.nextSetBit(k+1)){var v=this.atoms[k].atomPropertyFloat(null,1111492620,null);switch(t){case 0:case 4:v=1+(v-p)/h/c;break;case 1:case 5:v=(v-j)/l/h;break;case 2:case 6:v/=h;break;case 8:0>v&&(v=0),v=Math.sqrt(v/8)/3.141592653589793}0>v&&(v=0);u&&(v=Math.pow(v,s));v<m&&0<=m&&(v=m);v>r&&0<=r&&(v=r);d[k]=v*f}d=new J.atomdata.RadiusData(d,
0,J.atomdata.RadiusData.EnumType.ABSOLUTE,J.c.VDW.AUTO);this.setShapeSizeRD(0,d,b)}},"~A,JU.BS")});s("J.renderbio");t(["J.render.ShapeRenderer","JU.BS","$.P3"],"J.renderbio.BioShapeRenderer",["javajs.api.Interface","J.c.STR","JU.C","$.Point3fi"],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.renderStruts=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;y(this,arguments)},J.renderbio,"BioShapeRenderer",J.render.ShapeRenderer);X(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});d(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(603979863);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);this.renderStruts=
this.vwr.shm.getShape(1).haveStrutPoints});d(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())});
d(b,"setBioColix",function(a){if(this.g3d.setC(a))return!0;this.needTranslucent=!0;return!1},"~N");d(b,"freeTempArrays",function(){this.haveControlPointScreens&&this.vwr.freeTempPoints(this.controlPointScreens);this.vwr.freeTempEnum(this.structureTypes)});d(b,"initializePolymer",function(a){var b=this.vwr.slm.bsDeleted;this.controlPoints=this.ms.isJmolDataFrame(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 d=this.monomerCount;0<=--d;)if(!(0==(this.monomers[d].shapeVisibilityFlags&this.myVisibilityFlag)||this.ms.isAtomHidden(this.leadAtomIndices[d])||null!=b&&b.get(this.leadAtomIndices[d]))){var f=this.ms.at[this.leadAtomIndices[d]];this.g3d.isInDisplayRange(f.sX,f.sY)&&(this.bsVisible.set(d),
c=!0)}if(!c)return!1;this.ribbonBorder=this.vwr.getBoolean(603979901);this.isNucleic=r(a.bioPolymer,"JM.NucleicPolymer");this.isPhosphorusOnly=!this.isNucleic&&r(a.bioPolymer,"JM.PhosphorusPolymer");this.isCarbohydrate=r(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");d(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]});d(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});d(b,"calcScreens",function(a,b){var c=this.controlPoints.length,d=this.vwr.allocTempPoints(c);if(0==a)for(;0<=--c;)this.tm.transformPtScrT3(this.controlPoints[c],d[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,d[c]);return d},"~N,~A");d(b,"calc1Screen",function(a,b,c,d,f){this.pointT.scaleAdd2(c*d,b,a);this.tm.transformPtScrT3(this.pointT,f)},"JU.P3,JU.V3,~N,~N,JU.P3");d(b,"getLeadColix",function(a){return JU.C.getColixInherited(this.colixes[a],
this.monomers[a].getLeadAtom().colixAtom)},"~N");d(b,"getLeadColixBack",function(a){return null==this.colixesBack||this.colixesBack.length<=a?0:this.colixesBack[a]},"~N");d(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");d(b,"setColix",function(a){this.colix=a;return this.g3d.setC(a)},"~N");d(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&&(r(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=n(this.vwr.tm.scaleToScreen(n(this.controlPointScreens[a].z),this.madBeg));this.diameterMid=n(this.vwr.tm.scaleToScreen(this.monomers[a].getLeadAtom().sZ,this.madMid));this.diameterEnd=n(this.vwr.tm.scaleToScreen(n(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],d=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,d)},"~N,~B");d(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");d(b,"renderHermiteConic",function(a,b,c){this.setNeighbors(a);this.colix=this.getLeadColix(a);this.checkStruts(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");d(b,"checkStruts",function(a){if(this.renderStruts&&this.monomers[a].isSheet()&&null!=this.monomers[a].strutPoint){var b=new JU.Point3fi;b.add2(this.controlPoints[a],this.controlPoints[a+1]);b.scale(0.5);this.setStrutPoint(this.monomers[a].getLeadAtom(),b)}},"~N");d(b,"renderHermiteRibbon",function(a,b,c){this.setNeighbors(b);this.checkStruts(b);
var d=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=d;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],n(this.aspectRatio),f);c&&0!=this.colixBack&&this.setColix(d)}},"~B,~N,~B");d(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],n(this.aspectRatio),this.colixBack);this.g3d.setC(this.colix);this.ribbonBorder&&0==this.aspectRatio&&this.g3d.fillCylinderBits(3,3,this.screenArrowTop,this.screenArrowBot)}},"~N");d(b,"drawSegmentAB",function(a,b,c,d,f){var h=a.sX,j=a.sY;a=a.sZ;var l=b.sX,k=b.sY;b=b.sZ;var p=this.mad;1E3==f&&(p>>=1);0>p?this.g3d.drawLine(c,d,h,j,a,l,k,b):(f=n(this.isExport?p:this.vwr.tm.scaleToScreen(w((a+b)/2),p)),this.g3d.fillCylinderXYZ(c,d,3,f,h,j,a,l,k,b))},"JM.Atom,JM.Atom,~N,~N,~N");
d(b,"getStrutPointIfNeeded",function(a){a=a.group.strutPoint;return null!=a&&-2147483648==a.sX?a:null},"JM.Atom");d(b,"setStrutPoint",function(a,b){var c=this.getStrutPointIfNeeded(a);null!=c&&(null==b&&(b=a),c.setP(b),c.sX=b.sX,c.sY=b.sY,c.sZ=b.sZ)},"JM.Atom,JU.Point3fi")});s("J.renderbio");t(["J.renderbio.BioShapeRenderer"],"J.renderbio.StrandsRenderer",null,function(){var b=z(function(){this.strandCount=1;this.baseStrandOffset=this.strandSeparation=0;y(this,arguments)},J.renderbio,"StrandsRenderer",
J.renderbio.BioShapeRenderer);h(b,"renderBioShape",function(){this.renderStrandShape()},"J.shapebio.BioShape");d(b,"renderStrandShape",function(){this.setStrandCount()&&this.renderStrands()});d(b,"setStrandCount",function(){if(null==this.wingVectors)return!1;this.strandCount=r(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});d(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))});d(b,"renderStrand",function(a){for(var b=this.bsVisible.nextSetBit(0);0<=b;b=this.bsVisible.nextSetBit(b+
1))this.renderHermiteCylinder(a,b)},"~A")});s("J.renderbio");t(["J.renderbio.MeshRibbonRenderer"],"J.renderbio.RibbonsRenderer",null,function(){var b=H(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")});s("J.renderbio");t(["J.renderbio.StrandsRenderer"],"J.renderbio.MeshRibbonRenderer",null,function(){var b=
H(J.renderbio,"MeshRibbonRenderer",J.renderbio.StrandsRenderer);h(b,"renderBioShape",function(){this.wireframeOnly?this.renderStrands():this.renderMeshRibbon()},"J.shapebio.BioShape");d(b,"renderMeshRibbon",function(){if(this.setStrandCount()){var a=(this.strandCount>>1)*this.strandSeparation+this.baseStrandOffset;this.render2Strand(!1,a,a);this.renderStrands()}});d(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")});s("J.renderbio");t(null,"J.renderbio.NucleicRenderer",["JU.P3","JU.C"],function(){var b=z(function(){this.cartoonBlocks=this.cartoonBaseEdges=!1;this.blockHeight=0;this.cartoonRibose=this.cartoonLadders=!1;this.bsr=this.g3d=this.tm=this.vwr=this.ptTemp=
this.backboneScreen=this.baseScreen=this.backbonePt=this.basePt=this.rScr5=this.rScr=this.rPt5=this.rPt=null;this.colix=0;this.cartoonSteps=!1;this.triangles=this.scrBox=null;y(this,arguments)},J.renderbio,"NucleicRenderer",null);X(b,function(){this.triangles=D(-1,[1,0,3,1,3,2,0,4,7,0,7,3,4,5,6,4,6,7,5,1,2,5,2,6,2,3,7,2,7,6,0,1,5,0,5,4])});F(b,function(){});d(b,"renderNucleic",function(a){null==this.vwr&&(this.rPt=Array(10),this.rScr=Array(10),this.rPt5=Array(5),this.rScr5=Array(5),this.backboneScreen=
new JU.P3,this.backbonePt=new JU.P3,this.bsr=a,this.tm=a.vwr.tm,this.vwr=a.vwr);this.g3d=a.g3d;var b=a.controlPointScreens;a=a.controlPoints;this.cartoonBlocks=this.vwr.getBoolean(603979810);this.cartoonBaseEdges=this.vwr.getBoolean(603979815);this.cartoonSteps=this.vwr.getBoolean(603979811);this.cartoonLadders=this.vwr.getBoolean(603979817);this.cartoonRibose=this.vwr.getBoolean(603979818);this.blockHeight=this.vwr.getFloat(570425347);for(var c=this.vwr.getBoolean(603979966),d=this.bsr.bsVisible,
f=d.nextSetBit(0);0<=f;f=d.nextSetBit(f+1)){var h=b[f+1];c?(this.backboneScreen.ave(b[f],h),this.backbonePt.ave(a[f],a[f+1])):(this.backboneScreen.setT(h),this.backbonePt.setT(a[f+1]));this.bsr.renderHermiteConic(f,!1,4);this.colix=this.bsr.getLeadColix(f);this.bsr.setBioColix(this.colix)&&(this.cartoonRibose&&d.get(f+1)?this.renderNucleicBaseStep(f,a[f+1],b[f+1]):this.renderNucleicBaseStep(f,null,null))}},"J.renderbio.BioShapeRenderer");d(b,"renderNucleicBaseStep",function(a,b,c){if(!this.bsr.isPhosphorusOnly){var d=
this.bsr.monomers[a],f=this.bsr.mad=this.bsr.mads[a];if(null==this.rScr[0]){for(var h=10;0<=--h;)this.rScr[h]=new JU.P3;for(h=5;0<=--h;)this.rScr5[h]=new JU.P3;this.baseScreen=new JU.P3;this.basePt=new JU.P3;this.rPt[9]=new JU.P3}if(this.cartoonBlocks)this.renderBlock(d);else if(this.cartoonBaseEdges)this.renderLeontisWesthofEdges(d);else if(this.cartoonSteps)this.renderSteps(d,a);else{d.getBaseRing6Points(this.rPt);this.transformPoints(6,this.rPt,this.rScr);this.cartoonLadders||this.renderRing6();
var j;(a=d.maybeGetBaseRing5Points(this.rPt5))?this.cartoonLadders?(h=this.rScr[2],j=this.rPt[2]):(this.transformPoints(5,this.rPt5,this.rScr5),this.renderRing5(),h=this.rScr5[3],j=this.rPt5[3]):(j=this.cartoonLadders?4:2,h=this.rScr[j],j=this.rPt[j]);var l=1<f?w(f/2):f,f=l/2E3,l=n(this.vwr.tm.scaleToScreen(n(this.backboneScreen.z),l));(this.cartoonLadders||!this.cartoonRibose)&&this.g3d.fillCylinderScreen3I(3,l,this.backboneScreen,h,this.backbonePt,j,f);if(!this.cartoonLadders&&(this.drawEdges(this.rScr,
this.rPt,6),a?this.drawEdges(this.rScr5,this.rPt5,5):this.renderEdge(this.rScr,this.rPt,0,5),this.cartoonRibose)){this.baseScreen.setT(h);this.basePt.setT(j);d.getRiboseRing5Points(this.rPt);d=this.rPt[9];d.set(0,0,0);for(h=0;5>h;h++)d.add(this.rPt[h]);d.scale(0.2);this.transformPoints(10,this.rPt,this.rScr);this.renderRibose();this.renderEdge(this.rScr,this.rPt,2,5);this.renderEdge(this.rScr,this.rPt,3,6);this.renderEdge(this.rScr,this.rPt,6,7);this.renderEdge(this.rScr,this.rPt,7,8);this.renderEdge(this.rScr,
this.rPt,0,4);this.renderCyl(this.rScr[0],this.baseScreen,this.rPt[0],this.basePt);null!=b&&this.renderCyl(this.rScr[5],c,this.rPt[5],b);this.drawEdges(this.rScr,this.rPt,5)}}}},"~N,JU.T3,JU.T3");d(b,"renderSteps",function(a,b){var c=a.getBasePairs(),d=a.getLeadAtom(),f=JU.C.getColixInherited(this.colix,d.colixAtom);if(null!=c)for(var h=!this.bsr.isExport&&!this.vwr.gdata.isPass2,j=this.vwr.ms.at,l=c.size();0<=--l;){var k=c.get(l).getPartnerAtom(a);if(k>b){var k=j[k],n=JU.C.getColixInherited(this.colix,
k.colixAtom);(!h||this.bsr.setBioColix(f)||this.bsr.setBioColix(n))&&this.bsr.drawSegmentAB(d,k,f,n,1E3)}}},"JM.NucleicMonomer,~N");d(b,"transformPoints",function(a,b,c){for(;0<=--a;)this.tm.transformPtScrT3(b[a],c[a])},"~N,~A,~A");d(b,"drawEdges",function(a,b,c){for(var d=c;0<=--d;)a[d].z--;for(d=c;0<--d;)this.renderEdge(a,b,d,d-1)},"~A,~A,~N");d(b,"renderBlock",function(a){var b=a.getLeadAtom(),c=this.colix;if(null==this.scrBox){this.scrBox=Array(8);for(var d=0;8>d;d++)this.scrBox[d]=new JU.P3}var f=
a.getDSSRFrame(this.vwr),h=a.dssrBox,d=a.dssrBoxHeight,j=a.isPurine();if(null==h||d!=this.blockHeight){a.dssrBoxHeight=this.blockHeight;if(null==h){h=Array(8);for(d=8;0<=--d;)h[d]=new JU.P3;a.dssrBox=h}d=this.vwr.getSymTemp().getUnitCell(f,!1,null);null==this.ptTemp&&(this.ptTemp=new JU.P3);this.ptTemp.setT(f[0]);d.toFractional(this.ptTemp,!0);d.setOffsetPt(JU.P3.new3(this.ptTemp.x-2.25,this.ptTemp.y+5,this.ptTemp.z-this.blockHeight/2));f=j?-4.5:-3;j=this.blockHeight;d.toCartesian(h[0]=JU.P3.new3(0,
0,0),!1);d.toCartesian(h[1]=JU.P3.new3(4.5,0,0),!1);d.toCartesian(h[2]=JU.P3.new3(4.5,f,0),!1);d.toCartesian(h[3]=JU.P3.new3(0,f,0),!1);d.toCartesian(h[4]=JU.P3.new3(0,0,j),!1);d.toCartesian(h[5]=JU.P3.new3(4.5,0,j),!1);d.toCartesian(h[6]=JU.P3.new3(4.5,f,j),!1);d.toCartesian(h[7]=JU.P3.new3(0,f,j),!1)}for(d=0;8>d;d++)this.vwr.tm.transformPt3f(h[d],this.scrBox[d]);for(d=0;36>d;)this.g3d.fillTriangle3f(this.scrBox[this.triangles[d++]],this.scrBox[this.triangles[d++]],this.scrBox[this.triangles[d++]],
!1);h=a.getC1P();a=a.getN0();null!=h&&null!=a&&(this.bsr.drawSegmentAB(b,h,c,c,1E3),this.bsr.drawSegmentAB(h,a,c,c,1E3))},"JM.NucleicMonomer");d(b,"renderLeontisWesthofEdges",function(a){if(a.getEdgePoints(this.rPt)){this.transformPoints(6,this.rPt,this.rScr);this.renderTriangle(this.rScr,this.rPt,2,3,4,!0);this.renderEdge(this.rScr,this.rPt,0,1);this.renderEdge(this.rScr,this.rPt,1,2);var b=JU.C.isColixTranslucent(this.colix),c=JU.C.getColixTranslucencyLevel(this.colix);a=JU.C.getColixTranslucent3(10,
b,c);var d=JU.C.getColixTranslucent3(11,b,c),b=JU.C.getColixTranslucent3(7,b,c);this.g3d.setC(a);this.renderEdge(this.rScr,this.rPt,2,3);this.g3d.setC(d);this.renderEdge(this.rScr,this.rPt,3,4);this.g3d.setC(b);this.renderEdge(this.rScr,this.rPt,4,5)}},"JM.NucleicMonomer");d(b,"renderEdge",function(a,b,c,d){this.renderCyl(a[c],a[d],b[c],b[d])},"~A,~A,~N,~N");d(b,"renderCyl",function(a,b,c,d){this.g3d.fillCylinderScreen3I(3,3,a,b,c,d,0.005)},"JU.P3,JU.P3,JU.P3,JU.P3");d(b,"renderTriangle",function(a,
b,c,d,f,h){this.g3d.fillTriangle3i(a[c],a[d],a[f],b[c],b[d],b[f],h)},"~A,~A,~N,~N,~N,~B");d(b,"renderRing6",function(){this.renderTriangle(this.rScr,this.rPt,0,2,4,!0);this.renderTriangle(this.rScr,this.rPt,0,1,2,!1);this.renderTriangle(this.rScr,this.rPt,0,4,5,!1);this.renderTriangle(this.rScr,this.rPt,2,3,4,!1)});d(b,"renderRing5",function(){this.renderTriangle(this.rScr5,this.rPt5,0,1,2,!1);this.renderTriangle(this.rScr5,this.rPt5,0,2,3,!1);this.renderTriangle(this.rScr5,this.rPt5,0,3,4,!1)});
d(b,"renderRibose",function(){this.renderTriangle(this.rScr,this.rPt,0,1,9,!0);this.renderTriangle(this.rScr,this.rPt,1,2,9,!0);this.renderTriangle(this.rScr,this.rPt,2,3,9,!0);this.renderTriangle(this.rScr,this.rPt,3,4,9,!0);this.renderTriangle(this.rScr,this.rPt,4,0,9,!0)})});s("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;y(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");d(b,"renderRockets",function(){null==this.rr&&(this.rr=javajs.api.Interface.getInterface("J.renderbio.RocketRenderer").set(this));this.rr.renderRockets()});d(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");d(b,"calcRopeMidPoints",function(){this.cordMidPoints=this.vwr.allocTempPoints(this.monomerCount+1);for(var a=null,b,c=-10,d=new JU.P3,f=new JU.P3,h=0;h<=this.monomerCount;++h)if(b=this.cordMidPoints[h],h<this.monomerCount&&(this.helixRockets&&this.structureTypes[h]===
J.c.STR.HELIX||this.isRockets&&this.structureTypes[h]===J.c.STR.SHEET)){var j=this.monomers[h].getStructure();j===a?(d.add(f),c=h):(a=j,d.setT(j.getAxisStartPoint()),f.sub2(j.getAxisEndPoint(),d),f.scale(1/(j.nRes-1)),c==h-3&&this.cordMidPoints[h-1].ave(this.cordMidPoints[h-2],d));b.setT(d)}else c==h-1&&1<h&&this.cordMidPoints[h-1].setT(this.cordMidPoints[2<h?h-3:h-2]),b.setT(null==a?this.controlPoints[h]:a.getAxisEndPoint()),a=null;this.controlPoints=this.cordMidPoints;this.calcScreenControlPoints()});
d(b,"adjustStrut",function(a,b,c,d){for(;b<=c;b++){var f=this.monomers[b+d].getLeadAtom(),f=this.getStrutPointIfNeeded(f);null!=f&&(f.setT(a[b]),f.sX=0)}},"~A,~N,~N,~N")});s("J.renderbio");t(["J.renderbio.RocketsRenderer"],"J.renderbio.CartoonRenderer",["J.api.Interface","J.c.STR"],function(){var b=z(function(){this.nucleicRenderer=null;y(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");d(b,"renderProtein",function(){for(var a=!1,b=!1,c=null,d,f=this.helixRockets||!this.renderArrowHeads,h=!1,j=this.monomerCount;0<=--j;){d=this.monomers[j].getStructure();d!==c&&(a=!1);c=d;d=this.structureTypes[j]===J.c.STR.HELIX;var l=this.structureTypes[j]===J.c.STR.SHEET;this.bsVisible.get(j)&&(d&&f?h=!0:l||d?a&&l||b&&d?this.renderHermiteRibbon(!0,j,!0):this.renderHermiteArrowHead(j):this.renderHermiteConic(j,!0,7));a=l;
b=d&&!this.helixRockets}h&&this.renderRockets()})});s("J.renderbio");t(["J.renderbio.BioShapeRenderer"],"J.renderbio.BackboneRenderer",["JU.C"],function(){var b=z(function(){this.isDataFrame=!1;y(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.isJmolDataFrame(a.modelIndex);a=this.monomerCount;for(var c=this.ms.at,d=this.bsVisible.nextSetBit(0);0<=d;d=this.bsVisible.nextSetBit(d+
1)){var f=c[this.leadAtomIndices[d]],h=this.colixes[d];this.mad=this.mads[d];var j=(d+1)%a,l=c[this.leadAtomIndices[j]],j=this.colixes[j];if(0<f.nBackbonesDisplayed&&0<l.nBackbonesDisplayed&&!this.ms.isAtomHidden(l.i)&&(this.isDataFrame||100>f.distanceSquared(l)))if(h=JU.C.getColixInherited(h,f.colixAtom),j=JU.C.getColixInherited(j,l.colixAtom),!b||this.setBioColix(h)||this.setBioColix(j))this.drawSegmentAB(f,l,h,j,100),this.renderStruts&&(this.setStrutPoint(f,null),this.setStrutPoint(l,null))}},
"J.shapebio.BioShape")});s("J.renderbio");t(["J.renderbio.StrandsRenderer"],"J.renderbio.TraceRenderer",null,function(){var b=H(J.renderbio,"TraceRenderer",J.renderbio.StrandsRenderer);h(b,"renderBioShape",function(){this.wireframeOnly?this.renderStrands():this.renderTrace()},"J.shapebio.BioShape");d(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.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,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);
