(function(H,W,X,Y,F,Z,r,x,t,w,z,B,$,D,M,N,s,I,A,P,K,G,aa,Q,ba,ca,da,E,ea,R,S,fa,T,O,ga,ha,L,ia,U,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,c,h){r("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.htGroup1=null;this.maxLength=80;this.pdbID=null;this.haveDoubleBonds=!1;this.$cryst1=0;this.vConnect=this.tlsU=this.dataT=this.fileSgName=null;this.connectNextAtomSet=
this.connectNextAtomIndex=0;this.connectLast=null;w(this,arguments)},J.adapter.readers.pdb,"PdbReader",J.adapter.smarter.AtomSetCollectionReader);P(b,function(){this.htFormul=new java.util.Hashtable;this.dataT=I(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,d=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||d?this.getHeader=!1:this.readHeader(!1));if(d||g){this.isMultiModel=d;this.getHeader=!1;d=g?this.modelNumber+1:this.getModelNumber();g=this.getModelName();this.modelNumber=this.useFileModelNumbers?d: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(d,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});c(b,"checkRemark",function(){this.checkCurrentLineForScript()});
c(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)}});c(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()});c(b,"finalizeReaderPDB",function(){this.checkNotPDB();
null!=this.pdbID&&0<this.pdbID.length&&(this.isMultiModel||this.asc.setAtomSetName(this.pdbID),this.asc.setCurrentModelInfo("pdbID",this.pdbID));this.checkUnitCellParams();this.isCourseGrained||this.connectAll(this.maxSerial,this.isConnectStateBug);var a;null!=this.vBiomolecules&&(0<this.vBiomolecules.size()&&0<this.asc.ac)&&(this.asc.setCurrentModelInfo("biomolecules",this.vBiomolecules),this.setBiomoleculeAtomCounts(),null!=this.thisBiomolecule&&this.applySymmetry&&(this.asc.getXSymmetry().applySymmetryBio(this.thisBiomolecule,
this.applySymmetryToBonds,this.filter),this.vTlsModels=null,this.asc.xtalSymmetry=null));if(null!=this.vTlsModels){a=this.getInterface("JS.Symmetry");var 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()))});c(b,"checkUnitCellParams",function(){this.iHaveUnitCell&&(this.asc.setCurrentModelInfo("unitCellParams",
this.unitCellParams),null!=this.sgName&&this.asc.setCurrentModelInfo("spaceGroup",this.sgName))});c(b,"checkForResidualBFactors",function(a){for(var e=this.asc.atoms,d=!1,g=this.asc.ac;0<=--g;){var f=this.tlsU.get(e[g]);if(null!=f){var l=f[7]-(f[0]+f[1]+f[2])/3;if(0>l||Float.isNaN(l)){d=!0;break}}}JU.Logger.info("TLS analysis suggests Bfactors are "+(d?"":"NOT")+" residuals");for(var b,e=this.tlsU.entrySet().iterator();e.hasNext()&&((b=e.next())||1);)f=b.getValue(),l=f[7],0!=l&&(d||(l-=(f[0]+f[1]+
f[2])/3),f[0]+=l,f[1]+=l,f[2]+=l,b.getKey().addTensor(a.getTensor(this.vwr,f).setType(null),"TLS-R",!1),JU.Logger.info("TLS-U:  "+JU.Escape.eAF(f)),f=b.getKey().anisoBorU,null!=f&&JU.Logger.info("ANISOU: "+JU.Escape.eAF(f)));this.tlsU=null},"J.api.SymmetryInterface");c(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()))});c(b,"title",function(){10<this.lineLength&&this.appendLoadNote(this.line.substring(10,Math.min(this.maxLength,this.line.length)).trim())});c(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 d=this.line.indexOf(":");if(0>d||0<d&&"\\"==this.line.charAt(d-
1))d=this.line.length;e=this.line.substring(0,d).trim();d=d<this.line.length?this.line.substring(d+1).trim():null;if(e.equals("MOL_ID")){if(null==d)return;if(a){this.currentCompnd=this.htMolIds.remove(d);return}this.currentCompnd=new java.util.Hashtable;this.vCompnds.addLast(this.currentCompnd);this.htMolIds.put(d,this.currentCompnd)}null!=this.currentCompnd&&(null==d?(d=this.currentCompnd.get(this.currentKey),null==d&&(d=""),d+=e,0==this.vCompnds.size()&&this.vCompnds.addLast(this.currentCompnd)):
this.currentKey=e,d.endsWith(";")&&(d=d.substring(0,d.length-1)),this.currentCompnd.put(this.currentKey,d),this.currentKey.equals("CHAIN")&&this.currentCompnd.put("select","(:"+JU.PT.rep(JU.PT.rep(d,", ",",:")," ","")+")"))},"~B");c(b,"setBiomoleculeAtomCounts",function(){for(var a=this.vBiomolecules.size();0<=--a;){for(var e=this.vBiomolecules.get(a),d=e.get("biomts"),g=e.get("chains"),f=0,d=d.size();0<=--d;)for(var l=g.get(d),b=l.length-1;0<=--b;)":"==l.charAt(b)&&(f+=this.biomtChainAtomCounts[0+
l.charAt(b+1).charCodeAt(0)]);e.put("atomCount",Integer.$valueOf(f))}});c(b,"remark350",function(){var a=null,e=null;this.vBiomolecules=new JU.Lst;this.biomtChainAtomCounts=s(255,0);for(var d="",g="",f="",l=!0,b=null,c=0,k=JU.M4.newM4(null);;){l?this.readHeader(!0):l=!0;if(null==this.line||!this.line.startsWith("REMARK 350"))break;try{if(this.line.startsWith("REMARK 350 BIOMOLECULE:")&&(0<c&&JU.Logger.info("biomolecule "+f+": number of transforms: "+c),b=new java.util.Hashtable,f=this.line.substring(this.line.indexOf(":")+
1).trim(),d=this.line.trim(),b.put("name","biomolecule "+f),b.put("molecule",3==f.length?f:Integer.$valueOf(this.parseIntStr(f))),b.put("title",d),b.put("chains",e=new JU.Lst),b.put("biomts",a=new JU.Lst),this.vBiomolecules.addLast(b),c=0),0<=this.line.indexOf("APPLY THE FOLLOWING TO CHAINS:"))if(null==b)l=!1,this.line="REMARK 350 BIOMOLECULE: 1  APPLY THE FOLLOWING TO CHAINS:";else{var m=this.line.substring(41).trim();this.appendLoadNote("found biomolecule "+f+": "+m);g=":"+m.$replace(",",";").$replace(" ",
":");for(l=!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 ")){c++;for(var n=I(16,0),p=0;12>
p;){var h=this.getTokens();n[p++]=this.parseFloatStr(h[4]);n[p++]=this.parseFloatStr(h[5]);n[p++]=this.parseFloatStr(h[6]);n[p++]=this.parseFloatStr(h[7]);(4==p||8==p)&&this.readHeader(!0)}n[15]=1;var v=new JU.M4;v.setA(n);v.equals(k)?(a.add(0,v),e.add(0,g)):(a.addLast(v),e.addLast(g))}}catch(u){if(N(u,Exception))return this.vBiomolecules=this.thisBiomolecule=null,!1;throw u;}}0<c&&JU.Logger.info("biomolecule "+f+": number of transforms: "+c);return!1});c(b,"remark285",function(){return!0});c(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});c(b,"getSerial",function(a,e){var d=this.line.charAt(a),g=" "==d||" "==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(N(f,Exception))return this.serMode=JU.PT.isDigit(d)?1:2,this.getSerial(a,e);throw f;}case 2:return g||JU.PT.isDigit(d)?this.parseIntRange(this.line,a,e):JU.PT.parseIntRadix(this.line.substring(a,e),36)+(JU.PT.isUpperCase(d)?-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");c(b,"getSeqNo",function(a,e){var d=this.line.charAt(a),g=" "==d||" "==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(N(f,Exception))return this.seqMode=JU.PT.isDigit(d)?1:2,this.getSeqNo(a,e);throw f;}case 2:return g||JU.PT.isDigit(d)?this.parseIntRange(this.line,a,e):JU.PT.parseIntRadix(this.line.substring(a,e),36)+(JU.PT.isUpperCase(d)?-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");c(b,"processAtom",function(a,e,d,g,f,l,b,c,k){a.atomName=e;" "!=d&&(a.altLoc=
d);a.group3=null==g?"UNK":g;a.chainID=f;null!=this.biomtChainAtomCounts&&this.biomtChainAtomCounts[f%256]++;a.sequenceNumber=l;a.insertionCode=J.api.JmolAdapter.canonizeInsertionCode(b);a.isHetero=c;a.elementSymbol=k;return a},"J.adapter.smarter.Atom,~S,~S,~S,~N,~N,~S,~B,~S");c(b,"processAtom2",function(a,e,d,g,f,l){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,d,g,f);a.formalCharge=l;this.setAdditionalAtomParameters(a);this.haveMappedSerials?this.asc.addAtomWithMappedSerialNumber(a):this.asc.addAtom(a);0==this.ac++&&!this.isCourseGrained&&this.setModelPDB(!0);a.isHetero&&null!=this.htHetero&&
(this.asc.setCurrentModelInfo("hetNames",this.htHetero),this.htHetero=null)},"J.adapter.smarter.Atom,~N,~N,~N,~N,~N");c(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,d,g,f;if(this.gromacsWideFormat)d=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&&(d=this.line.charAt(78),g=this.line.charAt(79),"0"<=g&&"7">=g&&(f=g,g=d,d=f),("+"==g||"-"==g||" "==g)&&"0"<=d&&"7">=d))e=d.charCodeAt(0)-48,"-"==g&&(e=-e);d=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,d,g,f,e)}});c(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 d=" 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(d),!1;this.sbSelected.append("loading").append(d)}}return!0},"J.adapter.smarter.Atom,~N");c(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");c(b,"deduceElementSymbol",function(a){if(78<=this.lineLength){var e=this.line.charAt(76),d=this.line.charAt(77);if(" "==e&&J.adapter.smarter.Atom.isValidSym1(d))return""+d;if(J.adapter.smarter.Atom.isValidSymNoCase(e,d))return""+
e+d}e=this.line.charAt(12);d=this.line.charAt(13);if((null==this.htElementsInCurrentGroup||null!=this.htElementsInCurrentGroup.get(this.line.substring(12,14)))&&J.adapter.smarter.Atom.isValidSymNoCase(e,d))return a||"H"!=e?""+e+d:"H";if("H"==e)return"H";if((null==this.htElementsInCurrentGroup||null!=this.htElementsInCurrentGroup.get(""+d))&&J.adapter.smarter.Atom.isValidSym1(d))return""+d;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"!=d&&(null==this.htElementsInCurrentGroup||null!=this.htElementsInCurrentGroup.get(this.line.substring(13,15)))&&J.adapter.smarter.Atom.isValidSymNoCase(d,a)?""+d+a:"Xx"},"~B");c(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,d=this.line.trim().length;56<d&&(d=this.line.substring(0,56).trim().length);for(var g=11;g<d;g+=5){switch(g){case 31:e=2048;break;
case 41:continue}var f=this.getSerial(g,g+5);if(!(0>f)){var l=a==this.lastSourceSerial&&f==this.lastTargetSerial;l&&(this.haveDoubleBonds=!0);this.lastSourceSerial=a;this.lastTargetSerial=f;var b;f<a?(b=f,f=a):b=a;var c=";"+b+" "+f+";";if(!(0<=this.sbConect.indexOf(c))||l){if(this.haveDoubleBonds){l="--"+c;if(0<=this.sbConect.indexOf(l))continue;this.sb.append(l)}this.sbConect.append(c);this.addConnection(s(-1,[b,f,e]))}}}this.sbConect.appendSB(this.sb)}});c(b,"structure",function(){var a=J.c.STR.NONE,
e=J.c.STR.NONE,d,g,f,l,b=0;if(this.line.startsWith("HELIX "))a=J.c.STR.HELIX,d=19,g=21,f=31,l=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,d=21,g=22,f=32,l=33,b=this.parseIntRange(this.line,14,16);else if(this.line.startsWith("TURN  "))a=J.c.STR.TURN,d=19,g=20,f=30,l=31;else return;if(!(this.lineLength<l+4)){var c=this.line.substring(11,15).trim(),k=this.line.substring(7,10).trim();
d=this.vwr.getChainID(this.line.substring(d,d+1),!0);var m=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 n=this.parseIntRange(this.line,l,l+4),p=" ";this.lineLength>l+4&&(p=this.line.charAt(l+4));e===J.c.STR.NONE&&(e=a);a=new J.adapter.smarter.Structure(-1,a,e,c,k,b,null);a.set(d,m,g,f,n,p,0,0);this.asc.addStructure(a)}});c(b,"getModelNumber",function(){var a=14;a>this.lineLength&&(a=this.lineLength);a=this.parseIntRange(this.line,
6,a);return-2147483648==a?0:a});c(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});c(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");c(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});c(b,"cryst1",function(){var a=this.$cryst1=this.getFloat(6,9);1==a&&(a=NaN);this.setUnitCell(a,
this.getFloat(15,9),this.getFloat(24,9),this.getFloat(33,7),this.getFloat(40,7),this.getFloat(47,7));this.isbiomol&&(this.doConvertToFractional=!1);(null==this.sgName||this.sgName.equals("unspecified!"))&&this.setSpaceGroupName(JU.PT.parseTrimmedRange(this.line,55,66));this.fileSgName=this.sgName});c(b,"getFloat",function(a,e){return this.parseFloatRange(this.line,a,a+e)},"~N,~N");c(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");c(b,"expdta",function(){0<=this.line.toUpperCase().indexOf("NMR")&&this.asc.setInfo("isNMRdata","true")});c(b,"formul",function(){var a=this.parseTokenRange(this.line,12,15),e=JU.PT.parseTrimmedRange(this.line,19,70),d=e.indexOf("(");if(0<=d){var g=e.indexOf(")");if(0>g||d>=g||d+1==
g)return;e=JU.PT.parseTrimmedRange(e,d+1,g)}d=this.htFormul.get(a);null==d&&this.htFormul.put(a,d=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)?d.put(""+a+g,Boolean.TRUE):J.adapter.smarter.Atom.isValidSym1(a)&&d.put(""+a,Boolean.TRUE))});c(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)}}});c(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 d=this.htHetero.get(a);null!=d&&(e=d+e);this.htHetero.put(a,e);this.appendLoadNote(a+" = "+e)}});c(b,"anisou",function(){var a=
I(8,0);a[6]=1;var e=this.line.substring(6,11).trim();if(!this.haveMappedSerials&&0<this.asc.ac){for(var d=this.asc.getAtomSetAtomIndex(this.asc.iSet);d<this.asc.ac;d++){var g=this.asc.atoms[d].atomSerial;-2147483648!=g&&this.asc.atomSymbolicMap.put(""+g,this.asc.atoms[d])}this.haveMappedSerials=!0}e=this.asc.getAtomFromName(e);if(null!=e){d=28;for(g=0;70>d;d+=7,g++)a[g]=this.parseFloatRange(this.line,d,d+7);for(d=0;6>d;d++){if(Float.isNaN(a[d])){JU.Logger.error("Bad ANISOU record: "+this.line);return}a[d]/=
1E4}this.asc.setAnisoBorU(e,a,12)}});c(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),d=this.htSites.get(e);null==d&&(d=new java.util.Hashtable,d.put("nResidues",Integer.$valueOf(a)),d.put("groups",""),this.htSites.put(e,d));a=d.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 l=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<l.length&&(a+=":"+l);d.put("groups",a)}});c(b,"remarkTls",function(){for(var a=0,e=0,d=null,g=null,f=null,l=null,b=null,c=this.line.substring(0,11);null!=this.readHeader(!0)&&this.line.startsWith(c);)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,l=new JU.Lst,f.put("ranges",l),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"))d=this.line;else if(k[0].equalsIgnoreCase("RESIDUE")){var b=
new java.util.Hashtable,m,n,p,h;if(6==k.length)m=k[2].charAt(0),n=k[4].charAt(0),p=this.parseIntStr(k[3]),h=this.parseIntStr(k[5]);else{var v=d.indexOf(" C "),u=d.indexOf(" C ",v+4);m=this.line.charAt(u);n=this.line.charAt(v);p=this.parseIntRange(this.line,u+1,v);h=this.parseIntStr(this.line.substring(v+1))}m==n?(b.put("chains",""+m+n),p<=h?(b.put("residues",s(-1,[p,h])),l.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 C=
"\x00",r=1;r<k.length;r++)if(0<=k[r].toUpperCase().indexOf("CHAIN"))C=k[++r].charAt(0);else{var x=this.parseIntStr(k[r]);-2147483648!=x&&(b=new java.util.Hashtable,b.put("residues",s(-1,[x,this.parseIntStr(k[++r])])),"\x00"!=C&&b.put("chains",""+C+C),l.addLast(b))}else if(k[0].equalsIgnoreCase("ORIGIN")){var t=new JU.P3;f.put("origin",t);if(8==k.length)t.set(this.parseFloatStr(k[5]),this.parseFloatStr(k[6]),this.parseFloatStr(k[7]));else{var w=this.line.length;t.set(this.parseFloatRange(this.line,
w-27,w-18),this.parseFloatRange(this.line,w-18,w-9),this.parseFloatRange(this.line,w-9,w))}if(Float.isNaN(t.x)||Float.isNaN(t.y)||Float.isNaN(t.z))t.set(NaN,NaN,NaN),this.tlsAddError("invalid origin: "+this.line)}else if(k[1].equalsIgnoreCase("TENSOR")){var z=k[0].charAt(0),V=(this.readHeader(!0).substring(10)+this.readHeader(!0).substring(10)+this.readHeader(!0).substring(10)).$replace(z," ").$replace(":"," "),k=JU.PT.getTokens(V),A=I(3,3,0);f.put("t"+z,A);for(r=0;r<k.length;r++){var B=k[r].charAt(0).charCodeAt(0)-
49,D=k[r].charAt(1).charCodeAt(0)-49;A[B][D]=this.parseFloatStr(k[++r]);B<D&&(A[D][B]=A[B][D])}for(r=0;3>r;r++)for(C=0;3>C;C++)Float.isNaN(A[r][C])&&this.tlsAddError("invalid tensor: "+JU.Escape.escapeFloatAA(A,!1));if("S"==z&&++e==a){JU.Logger.info(a+" TLS groups read");this.readHeader(!0);break}}}catch(E){if(N(E,Exception)){JU.Logger.error(this.line+"\nError in TLS parser: ");System.out.println(E.getMessage());g=null;break}else throw E;}null!=g&&(e=new java.util.Hashtable,e.put("groupCount",Integer.$valueOf(a)),
e.put("groups",g),this.vTlsModels.addLast(e));return 1>a});c(b,"handleTlsMissingModels",function(){this.vTlsModels=null});c(b,"setTlsGroups",function(a,e,d){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),b=I(this.asc.getAtomSetAtomCount(e),0),j=f+b.length,c=this.asc.atoms,k=g.size(),m=0;m<k;m++){var n=g.get(m),p=n.get("ranges");this.tlsGroupID=n.get("id").intValue();for(var h=p.size();0<=--h;){var v=p.get(h).get("chains"),
u=p.get(h).get("residues"),C=0+v.charAt(0).charCodeAt(0),v=0+v.charAt(1).charCodeAt(0),r=u[0],u=u[1],t=this.findAtomForRange(f,j,C,r,!1),x=0<=t?this.findAtomForRange(t,j,v,u,!1):-1;if(0>x){JU.Logger.info("TLS processing terminated");return}JU.Logger.info("TLS ID="+this.tlsGroupID+" model atom index range "+t+"-"+x);t=C==v;for(x=f;x<j;x++){var w=c[x];if(t?w.sequenceNumber>=r&&w.sequenceNumber<=u:w.chainID>C&&w.chainID<v||w.chainID==C&&w.sequenceNumber>=r||w.chainID==v&&w.sequenceNumber<=u)b[x-f]=this.tlsGroupID,
this.setTlsTensor(w,n,d)}}}this.asc.setAtomProperties("tlsGroup",b,e,!0);this.asc.setModelInfoForSet("TLS",a,e);this.asc.setTensors()},"~N,~N,J.api.SymmetryInterface");c(b,"findAtomForRange",function(a,e,d,g,f){a=this.findAtom(a,e,d,g,!0);return f&&0<=a?this.findAtom(a,e,d,g,!1):a},"~N,~N,~N,~N,~B");c(b,"findAtom",function(a,e,d,g,f){for(var b=this.asc.atoms;a<e;a++){var j=b[a];if((j.chainID==d&&j.sequenceNumber==g)==f)return a}f&&(JU.Logger.warn("PdbReader findAtom chain="+d+" resno="+g+" not found"),
this.tlsAddError("atom not found: chain="+d+" resno="+g));return f?-1:e},"~N,~N,~N,~N,~B");c(b,"setTlsTensor",function(a,e,d){var g=e.get("origin");if(!Float.isNaN(g.x)){var f=e.get("tT"),b=e.get("tL");e=e.get("tS");if(!(null==f||null==b||null==e)){var j=0.017453292519943295*(a.x-g.x),c=0.017453292519943295*(a.y-g.y),g=0.017453292519943295*(a.z-g.z),k=j*j,m=c*c,n=g*g,p=j*c,h=j*g,v=c*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=I(8,0),u=Float.isNaN(a.bfactor)?0:a.bfactor/78.95683520871486;f[0]=this.dataT[0]+b[1][1]*n+b[2][2]*m-2*b[1][2]*v+2*e[1][0]*g-2*e[2][0]*c;f[1]=this.dataT[1]+b[0][0]*n+b[2][2]*k-2*b[2][0]*h-2*e[0][1]*g+2*e[2][1]*j;f[2]=this.dataT[2]+b[0][0]*m+b[1][1]*k-2*b[0][1]*p-2*e[1][2]*j+2*e[0][2]*c;f[3]=this.dataT[3]-b[2][2]*p+b[1][2]*h+b[2][0]*v-b[0][1]*n-e[0][0]*g+e[1][1]*g+e[2][0]*j-e[2][1]*c;f[4]=this.dataT[4]-b[1][1]*h+b[1][2]*p-b[2][0]*m+b[0][1]*v+e[0][0]*c-e[2][2]*c+e[1][2]*
g-e[1][0]*j;f[5]=this.dataT[5]-b[0][0]*v-b[1][2]*k+b[2][0]*p+b[0][1]*h-e[1][1]*j+e[2][2]*j+e[0][1]*c-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(d.getTensor(this.vwr,this.dataT).setType(null),"TLS-U",!1)}}},"J.adapter.smarter.Atom,java.util.Map,J.api.SymmetryInterface");c(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=c(b,"fixRadius",function(a){return 0.9>a?1:a},"~N");c(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");c(b,"connectAllBad",function(a){for(var e=this.connectNextAtomIndex,d=this.connectNextAtomSet;d<this.asc.atomSetCount;d++){var g=this.asc.getAtomSetAtomCount(d);this.asc.setModelInfoForSet("PDB_CONECT_firstAtom_count_max",
s(-1,[e,g,a]),d);null!=this.vConnect&&(this.asc.setModelInfoForSet("PDB_CONECT_bonds",this.vConnect,d),this.asc.setGlobalBoolean(3));e+=g}this.vConnect=null;this.connectNextAtomSet=this.asc.iSet+1;this.connectNextAtomIndex=e},"~N");c(b,"connectAll",function(a,e){var d=this.asc,g=d.iSet;if(!(0>g))if(e)this.connectAllBad(a);else if(d.setCurrentModelInfo("PDB_CONECT_firstAtom_count_max",s(-1,[d.getAtomSetAtomIndex(g),d.getAtomSetAtomCount(g),a])),null!=this.vConnect){for(var f=this.connectNextAtomIndex,
b=d.atomSetCount;--b>=this.connectNextAtomSet;)d.setModelInfoForSet("PDB_CONECT_bonds",this.vConnect,b),d.setGlobalBoolean(3),f+=d.getAtomSetAtomCount(b);this.vConnect=null;this.connectNextAtomSet=g+1;this.connectNextAtomIndex=f}},"~N,~B")});r("J.adapter.smarter");t(null,"J.adapter.smarter.Structure",["J.c.STR"],function(){var b=z(function(){this.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;w(this,arguments)},J.adapter.smarter,"Structure",null,Cloneable);P(b,function(){this.atomStartEnd=s(2,0);this.modelStartEnd=s(-1,[-1,-1])});D(b,function(a,e,d,g,f,b,j){null!=j?(this.modelStartEnd=s(-1,[0,a]),this.bsAll=j):(this.structureType=e,this.substructureType=d,null!=g&&(this.modelStartEnd[0]=this.modelStartEnd[1]=a,this.structureID=g,this.strandCount=b,this.strandID=
f))},"~N,J.c.STR,J.c.STR,~S,~S,~N,~A");b.getHelixType=c(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");c(b,"set",function(a,e,d,g,f,b,j,c){this.startChainID=a;this.startSequenceNumber=e;this.startInsertionCode=d;this.endChainID=g;this.endSequenceNumber=f;this.endInsertionCode=b;this.atomStartEnd[0]=j;this.atomStartEnd[1]=c},"~N,~N,~S,~N,~N,~S,~N,~N");c(b,"clone",function(){var a=null;
try{a=S(this,J.adapter.smarter.Structure,"clone",[])}catch(e){if(!N(e,"CloneNotSupportedException"))throw e;}return a})});r("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;w(this,arguments)},JM,"Monomer",JM.Group);D(b,function(){K(this,JM.Monomer,[])});
b.have=c(b,"have",function(a,e){return 255!=(a[e]&255)},"~A,~N");c(b,"set2",function(a,e,d,g,f,b){this.setGroup(a,e,d,g,f);this.offsets=b;this.setLeadAtomIndex();return this},"JM.Chain,~S,~N,~N,~N,~A");c(b,"setLeadAtomIndex",function(){var a=this.offsets[0]&255;255!=a&&(this.leadAtomIndex=this.firstAtomIndex+a)});c(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});c(b,"getMonomerIndex",function(){return this.monomerIndex});h(b,"getAtomIndex",function(a,e){if(null!=this.bioPolymer){var d=this.bioPolymer.monomers,g=this.monomerIndex+e;if(0<=g&&g<d.length){d=d[g];if(1==e&&!d.isConnectedPrevious())return-1;if("\x00".equals(a))return d.leadAtomIndex;
for(var g=this.chain.model.ms.at,f=d.firstAtomIndex;f<=d.lastAtomIndex;f++)if(null!=g[f]&&(null==a||a.equalsIgnoreCase(g[f].getAtomName())))return f}}return-1},"~S,~N");c(b,"getBioPolymerIndexInModel",function(){return null==this.bioPolymer?-1:this.bioPolymer.bioPolymerIndexInModel});b.scanForOffsets=c(b,"scanForOffsets",function(a,e,d){for(var g=d.length,f=G(g,0);0<=--g;){var b,j=d[g];if(0>j)b=e[~j];else if(b=e[j],0>b)return null;var c;if(0>b)c=255;else if(c=b-a,0>c||254<c)JU.Logger.warn("Monomer.scanForOffsets i="+
g+" atomID="+j+" atomIndex:"+b+" firstAtomIndex:"+a+" offset out of 0-254 range. Groups aren't organized correctly. Is this really a protein?: "+c),0>j&&(c=255);f[g]=c}return f},"~N,~A,~A");h(b,"getProteinStructureType",function(){return J.c.STR.NONE});c(b,"isHelix",function(){return!1});c(b,"isSheet",function(){return!1});h(b,"setStrucNo",function(){},"~N");c(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");c(b,"getSpecialAtom",function(a,e){for(var d=a.length;0<=--d;){var g=a[d];0>g&&(g=-g);if(e==g)return d=this.offsets[d]&255,255==d?null:this.chain.model.ms.at[this.firstAtomIndex+d]}return null},"~A,~N");c(b,"getSpecialAtomPoint",function(a,e){for(var d=a.length;0<=--d;){var g=a[d];0>g&&(g=-g);if(e==g)return d=this.offsets[d]&255,255==d?null:this.chain.model.ms.at[this.firstAtomIndex+d]}return null},"~A,~N");h(b,"isLeadAtom",function(a){return a==this.leadAtomIndex},"~N");h(b,"getLeadAtom",
function(){return this.getAtomFromOffsetIndex(0)});c(b,"getWingAtom",function(){return this.getAtomFromOffsetIndex(1)});c(b,"getInitiatorAtom",function(){return this.getLeadAtom()});c(b,"getTerminatorAtom",function(){return this.getLeadAtom()});c(b,"findNearestAtomIndex",function(){},"~N,~N,~A,~N,~N");c(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();x(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 x(a,"JM.ProteinStructure")?a.type.getBioStructureTypeName(!1):""});c(b,"updateOffsetsForAlternativeLocations",function(a,e){for(var d=!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 c=this.lastAtomIndex-
this.firstAtomIndex,k=1;k<=c;k++){var m=f+k;m>this.lastAtomIndex&&(m-=c+1);var n=m-this.firstAtomIndex;if(!(0>n||255<n||m==f||!e.get(m))){var p=a[m].atomID;if(!(p!=j||0==p&&!a[m].getAtomName().equals(b.getAtomName()))){this.offsets[g]=n;a[m].nBackbonesDisplayed=b.nBackbonesDisplayed;d=!0;break}}}}}this.setLeadAtomIndex();return d},"~A,JU.BS");c(b,"getMonomerSequenceAtoms",function(a,e){this.setAtomBits(e);e.and(a)},"JU.BS,JU.BS");b.checkOptional=c(b,"checkOptional",function(a,e,d,g){if(JM.Monomer.have(a,
e))return!0;if(0>g)return!1;a[e]=g-d;return!0},"~A,~N,~N,~N");c(b,"getQuaternionFrameCenter",function(){return null},"~S");c(b,"getHelixData2",function(a,e,d){if(0>this.monomerIndex)return null;var g=this.monomerIndex-d,f=1>d||0>=this.monomerIndex?null:this.bioPolymer.monomers[g],g=this.getQuaternion(e),b=1>d?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 S(this,JM.Monomer,"getHelixData",[a,e,d]);var f=1>d?JU.P3.new3(0,
0,0):f.getQuaternionFrameCenter(e),j=this.getQuaternionFrameCenter(e);return null==f||null==j?this.getHelixData(a,e,d):JU.Escape.escapeHelical(135176==a?"helixaxis"+this.getUniqueID():null,a,f,j,JU.Measure.computeHelicalAxis(f,j,g.div(b)))},"~N,~S,~N");c(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,d){for(var g=null==a,f=this.firstAtomIndex;f<=this.lastAtomIndex;f++)if(this.getCrossLinkGroup(f,a,null,e,d,g)&&g)return!0;return!g&&0<a.size()},"JU.Lst,~B,~B");c(b,"getCrossLinkGroup",function(a,e,d,g,f,b){var j=this.chain.model.ms.at[a],c=j.bonds,k=this.getBioPolymerIndexInModel();if(0>k||null==c)return!1;var m=!1;b=!b&&null==e&&null==d;
for(var n=0;n<c.length;n++){var p=c[n];if(!(p.isCovalent()?!g:!f)){var p=p.getOtherAtom(j),h=p.group;if(!(null!=d&&h!==d)){var v=h.getBioPolymerIndexInModel(),u=h.getMonomerIndex();if(b){if(v==k&&u==this.monomerIndex-1)return!0}else if(0<=v&&0<=u&&(v!=k||u<this.monomerIndex-1||u>this.monomerIndex+1)){m=!0;if(null!=d||null==e)break;e.addLast(Integer.$valueOf(a));e.addLast(Integer.$valueOf(p.i));e.addLast(Integer.$valueOf(h.leadAtomIndex))}}}}return m},"~N,JU.Lst,JM.Group,~B,~B,~B");c(b,"isConnectedPrevious",
function(){return!0});c(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()});c(b,"getGroup1b",function(){return"?"});h(b,"setGroupID",function(a){this.groupID=JM.BioResolver.getGroupIdFor(a)},
"~S");h(b,"toString",function(){return"["+this.getGroup3()+"-"+this.getSeqcodeString()+" "+this.getStructure()+"]"})});r("JM");t(["JM.Monomer"],"JM.AlphaMonomer","JU.Quat $.V3 J.c.STR JM.Helix $.Sheet $.Turn".split(" "),function(){var b=z(function(){this.nitrogenHydrogenPoint=this.proteinStructure=null;w(this,arguments)},JM,"AlphaMonomer",JM.Monomer);L(b,function(){});h(b,"isProtein",function(){return!0});b.validateAndAllocateA=c(b,"validateAndAllocateA",function(a,e,d,g,f,b){return g!=f||b[2]!=g?
null:(new JM.AlphaMonomer).set2(a,e,d,g,f,JM.AlphaMonomer.alphaOffsets)},"JM.Chain,~S,~N,~N,~N,~A");c(b,"isAlphaMonomer",function(){return!0});h(b,"getStructure",function(){return this.proteinStructure});c(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");c(b,"getAtom",function(a){return 2==a?this.getLeadAtom():null},"~N");c(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");c(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,d){return this.getHelixData2(a,e,d)},"~N,~S,~N");h(b,"getQuaternion",function(a){return this.getQuaternionAlpha(a)},
"~S");c(b,"getQuaternionAlpha",function(a){if(0>this.monomerIndex)return null;var e=new JU.V3,d=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);d.sub2(f,a)}return JU.Quat.getQuaternionFrameV(e,d,null,!1)},"~S");
b.alphaOffsets=G(-1,[0])});r("JM");t(["JM.Structure"],"JM.ProteinStructure",["java.util.Hashtable","JU.P3","$.V3","JU.Logger"],function(){var b=z(function(){this.structureID=this.subtype=this.type=null;this.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;w(this,arguments)},JM,"ProteinStructure",null,JM.Structure);D(b,function(){this.id=
++JM.ProteinStructure.ids});c(b,"setupPS",function(a,e,d,g){this.strucNo=++JM.ProteinStructure.globalStrucNo;this.apolymer=a;this.type=e;this.vectorProjection=new JU.V3;this.monomerIndexFirst=d;this.addMonomer(d+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");c(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");c(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 d=this.apolymer.monomers,g=d[++a].getProteinStructureType(),f=-1,b=0;b<e;b++,a++)d[a].setStructure(null),f=d[a].setProteinStructureType(g,f)}},"~N");c(b,"calcAxis",function(){});c(b,"isWithin",function(a){return a>this.monomerIndexFirst&&a<this.monomerIndexLast},"~N");c(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");c(b,"getSegments",function(){null==this.segments&&this.calcSegments();return this.segments});c(b,"getStructureMidPoint",function(a){null==this.segments&&this.calcSegments();return this.segments[a]},"~N");c(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)}});c(b,"getAxisStartPoint",function(){this.calcAxis();return this.axisA});c(b,"getAxisEndPoint",function(){this.calcAxis();return this.axisB});c(b,"resetAxes",function(){this.segments=this.axisA=null});h(b,"setAtomBits",function(a){for(var e=this.apolymer.monomers,d=this.monomerIndexFirst;d<=this.monomerIndexLast;d++)e[d].setAtomBits(a)},"JU.BS");h(b,"setAtomBitsAndClear",function(a,e){for(var d=this.apolymer.monomers,
g=this.monomerIndexFirst;g<=this.monomerIndexLast;g++)d[g].setAtomBitsAndClear(a,e)},"JU.BS,JU.BS");c(b,"findMonomer",function(a,e){var d=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(d[g].leadAtomIndex))return d[g]}else for(g=this.monomerIndexLast;g>=this.monomerIndexFirst;--g)if(null==a||a.get(d[g].leadAtomIndex))return d[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});r("JM");t(["JM.ProteinStructure"],"JM.Helix",["JU.Measure","$.P3","$.V3","J.c.STR"],function(){var b=A(JM,"Helix",JM.ProteinStructure);L(b,function(a,e,d,g){this.setupPS(a,J.c.STR.HELIX,e,d);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)}})});r("JM");t(["JM.ProteinStructure"],"JM.Sheet",["JU.Measure","$.P3","$.V3","J.c.STR"],function(){var b=z(function(){this.heightUnitVector=this.widthUnitVector=null;w(this,arguments)},JM,"Sheet",JM.ProteinStructure);
L(b,function(a,e,d,g){this.setupPS(a,J.c.STR.SHEET,e,d);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}});c(b,"notHelixOrSheet",function(a){return 0>a||a>=this.apolymer.monomerCount||!this.apolymer.monomers[a].isHelix()&&!this.apolymer.monomers[a].isSheet()},"~N");c(b,"calcSheetUnitVectors",function(){if(x(this.apolymer,"JM.AminoPolymer")&&null==this.widthUnitVector){var a=new JU.V3,e=new JU.V3,d=this.apolymer.monomers[this.monomerIndexFirst];e.sub2(d.getCarbonylOxygenAtom(),d.getCarbonylCarbonAtom());for(var g=this.nRes;--g>this.monomerIndexFirst;)d=this.apolymer.monomers[g],
a.sub2(d.getCarbonylOxygenAtom(),d.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)}});c(b,"setBox",function(a,e,d,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(d,
b)},"~N,~N,JU.P3,JU.V3,JU.V3,JU.P3,~N")});r("JM");t(["JM.ProteinStructure"],"JM.Turn",["J.c.STR"],function(){var b=A(JM,"Turn",JM.ProteinStructure);L(b,function(a,e,d){this.setupPS(a,J.c.STR.TURN,e,d);this.subtype=J.c.STR.TURN},"JM.AlphaPolymer,~N,~N")});r("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;w(this,arguments)},JM,"BioPolymer",null,JM.Structure);P(b,function(){this.unitVectorX=JU.V3.new3(1,0,0)});D(b,function(){});c(b,"set",function(a){this.monomers=a;for(var e=this.monomerCount=a.length;0<=
--e;)a[e].setBioPolymer(this,e);this.model=a[0].getModel()},"~A");h(b,"setAtomBits",function(a){this.getRange(a,!0)},"JU.BS");h(b,"setAtomBitsAndClear",function(a,e){for(var d=this.monomerCount;0<=--d;)this.monomers[d].setAtomBitsAndClear(a,e)},"JU.BS,JU.BS");c(b,"getRange",function(a,e){if(0!=this.monomerCount)if(e)for(var d=this.monomerCount;0<=--d;)this.monomers[d].setAtomBits(a);else a.setBits(this.monomers[0].firstAtomIndex,this.monomers[this.monomerCount-1].lastAtomIndex+1)},"JU.BS,~B");c(b,
"clearStructures",function(){});c(b,"getLeadAtomIndices",function(){null==this.leadAtomIndices&&(this.leadAtomIndices=s(this.monomerCount,0),this.invalidLead=!0);if(this.invalidLead){for(var a=this.monomerCount;0<=--a;)this.leadAtomIndices[a]=this.monomers[a].leadAtomIndex;this.invalidLead=!1}return this.leadAtomIndices});c(b,"getIndex",function(a,e,d,g){var f;for(f=this.monomerCount;0<=--f;){var b=this.monomers[f];if(b.chain.chainID==a&&b.seqcode==e&&(0>d||d==b.firstAtomIndex||g==b.lastAtomIndex))break}return f},
"~N,~N,~N,~N");c(b,"getLeadPoint",function(a){return this.monomers[a].getLeadAtom()},"~N");c(b,"getInitiatorPoint",function(){return this.monomers[0].getInitiatorAtom()});c(b,"getTerminatorPoint",function(){return this.monomers[this.monomerCount-1].getTerminatorAtom()});c(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");c(b,"getWingPoint",function(a){return this.monomers[a].getWingAtom()},
"~N");c(b,"setConformation",function(a){for(var e=this.model.ms.at,d=!1,g=this.monomerCount;0<=--g;)this.monomers[g].updateOffsetsForAlternativeLocations(e,a)&&(d=!0);if(d){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;)d=a.bioShapes[e],d.bioPolymer===this&&d.falsifyMesh()}},"JU.BS");c(b,"recalculateLeadMidpointsAndWingVectors",function(){this.invalidLead=this.invalidControl=!0;this.getLeadAtomIndices();
this.resetHydrogenPoints();this.calcLeadMidpointsAndWingVectors()});c(b,"resetHydrogenPoints",function(){});c(b,"getLeadMidpoints",function(){null==this.leadMidpoints&&this.calcLeadMidpointsAndWingVectors();return this.leadMidpoints});c(b,"getLeadPoints",function(){null==this.leadPoints&&this.calcLeadMidpointsAndWingVectors();return this.leadPoints});c(b,"getControlPoints",function(a,e,d){d&&(this.invalidControl=!0);return!a?this.leadMidpoints:0==e?this.leadPoints:this.getControlPoints2(e)},"~B,~N,~B");
c(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");c(b,"getControlPoint",function(a){return this.leadPoints[a]},
"~N,JU.V3");c(b,"getWingVectors",function(){null==this.leadMidpoints&&this.calcLeadMidpointsAndWingVectors();return this.wingVectors});c(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,d=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,c=1;c<this.monomerCount;++c){f=b;b=this.getLeadPoint(c);if(null==b)return;this.leadPoints[c]=b;var k=new JU.P3;k.ave(b,f);this.leadMidpoints[c]=k;this.hasWingPoints&&(a.sub2(b,f),e.sub2(f,this.getWingPoint(c-1)),d.cross(a,e),g.cross(a,d),g.normalize(),!this.twistedSheets&&(null!=j&&1.5707963267948966<j.angle(g))&&(this.reversed.set(c),g.scale(-1)),
j=this.wingVectors[c]=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(c=1;c<this.monomerCount;++c)a.sub2(this.leadMidpoints[c],this.leadPoints[c]),e.sub2(this.leadPoints[c],this.leadMidpoints[c+1]),0==e.length()?d=g:(d.cross(a,e),d.normalize(),null!=g&&1.5707963267948966<g.angle(d)&&d.scale(-1)),g=this.wingVectors[c]=JU.V3.newV(d)}this.wingVectors[0]=
this.wingVectors[1];this.wingVectors[this.monomerCount]=this.wingVectors[this.monomerCount-1]});c(b,"findNearestAtomIndex",function(a,e,d,g,f,b){for(var j=this.monomerCount;0<=--j;)if(0!=(this.monomers[j].shapeVisibilityFlags&f)){var c=this.monomers[j].getLeadAtom();c.checkVisible()&&!(null!=b&&b.get(c.i))&&(0<g[j]||0<g[j+1])&&this.monomers[j].findNearestAtomIndex(a,e,d,g[j],g[j+1])}},"~N,~N,~A,~A,~N,JU.BS");c(b,"getSelectedMonomerCount",function(){return this.selectedMonomerCount});c(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");c(b,"isMonomerSelected",function(a){return 0<=a&&this.bsSelectedMonomers.get(a)},"~N");c(b,"getPolymerPointsAndVectors",function(a,e,d,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)?(d.addLast(E(-1,[g[j],JU.P3.newP(f[j])])),a=j):2147483646!=a&&(d.addLast(E(-1,[g[j],JU.P3.newP(f[j])])),a=2147483646);a+1<b&&d.addLast(E(-1,[g[a+1],JU.P3.newP(f[a+1])]));return a},"~N,JU.BS,JU.Lst,~B,~N");c(b,"getSequence",function(){for(var a=O(this.monomerCount,"\x00"),e=0;e<this.monomerCount;e++)a[e]=this.monomers[e].getGroup1();return String.valueOf(a)});c(b,"getPolymerSequenceAtoms",function(a,e,d,g){for(e=Math.min(this.monomerCount,a+e);--e>=
a;)this.monomers[e].getMonomerSequenceAtoms(d,g)},"~N,~N,JU.BS,JU.BS");c(b,"getProteinStructure",function(){return null},"~N");c(b,"calcParameters",function(){this.haveParameters=!0;return this.calcEtaThetaAngles()||this.calcPhiPsiAngles()});c(b,"calcEtaThetaAngles",function(){return!1});c(b,"calcPhiPsiAngles",function(){return!1});c(b,"calculateRamachandranHelixAngle",function(){return NaN},"~N,~S");c(b,"isNucleic",function(){return 0<this.monomerCount&&x(this,"JM.NucleicPolymer")});c(b,"getRangeGroups",
function(a,e,d){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(d)},"~N,JU.BS,JU.BS");c(b,"calcRasmolHydrogenBonds",function(){},"JM.BioPolymer,JU.BS,JU.BS,JU.Lst,~N,~A,~B,~B");c(b,"getType",function(){return this.type});c(b,"isCyclic",function(){return 1==(0==this.cyclicFlag?this.cyclicFlag=4<=this.monomerCount&&this.monomers[0].isConnectedAfter(this.monomers[this.monomerCount-
1])?1:-1:this.cyclicFlag)});h(b,"toString",function(){return"[Polymer type "+this.type+" n="+this.monomerCount+" "+(0<this.monomerCount?this.monomers[0]+" "+this.monomers[this.monomerCount-1]:"")+"]"})});r("JM");t(["java.lang.Enum","JM.BioPolymer"],"JM.AlphaPolymer","JU.Measure $.P3 J.c.STR JM.Helix $.Sheet $.Turn JU.Logger".split(" "),function(){var b=z(function(){this.pt0=0;w(this,arguments)},JM,"AlphaPolymer",JM.BioPolymer);D(b,function(a,d){K(this,JM.AlphaPolymer,[]);this.pt0=d;this.set(a);this.hasStructure=
!0},"~A,~N");h(b,"getProteinStructure",function(a){return this.monomers[a].getStructure()},"~N");h(b,"getControlPoint",function(a,d){if(!this.monomers[a].isSheet())return this.leadPoints[a];d.sub2(this.leadMidpoints[a],this.leadPoints[a]);d.scale(this.sheetSmoothing);var g=JU.P3.newP(this.leadPoints[a]);g.add(d);return g},"~N,JU.V3");c(b,"addStructure",function(a,d,g,f,b,j,c,k,m,n,p){var h=-1,v=-1;if(m<n){if(this.monomers[0].firstAtomIndex>n||this.monomers[this.monomerCount-1].lastAtomIndex<m)return;
h=m;v=n}var u;if(!(-1==(b=this.getIndex(b,j,h,v))||-1==(u=this.getIndex(c,k,h,v)))){if(0<=m&&null!=p&&(c=p.nextSetBit(this.monomers[b].firstAtomIndex),0<=c&&c<this.monomers[u].lastAtomIndex))return;this.addStructureProtected(a,d,g,f,b,u)&&0<=m&&p.setBits(m,n+1)}},"J.c.STR,~S,~S,~N,~N,~N,~N,~N,~N,~N,JU.BS");c(b,"addStructureProtected",function(a,d,g,f,b,j){if(j<b)return JU.Logger.error("AlphaPolymer:addSecondaryStructure error:  indexStart:"+b+" indexEnd:"+j),!1;var c=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,c,a);break;case J.c.STR.SHEET:k=new JM.Sheet(this,b,c,a);break;case J.c.STR.TURN:k=new JM.Turn(this,b,c);break;default:return JU.Logger.error("unrecognized secondary structure type"),!1}k.structureID=d;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)});c(b,"calculateStructures",function(){if(!(4>this.monomerCount)){var a=
this.calculateAnglesInDegrees(),d=this.calculateCodes(a);this.checkBetaSheetAlphaHelixOverlap(d,a);var g=this.calculateRunsFourOrMore(d);this.extendRuns(g);this.searchForTurns(d,a,g);this.addStructuresFromTags(g)}},"~B");c(b,"calculateAnglesInDegrees",function(){for(var a=I(this.monomerCount,0),d=this.monomerCount-1;2<=--d;)a[d]=JU.Measure.computeTorsion(this.monomers[d-2].getLeadAtom(),this.monomers[d-1].getLeadAtom(),this.monomers[d].getLeadAtom(),this.monomers[d+1].getLeadAtom(),!0);return a});
c(b,"calculateCodes",function(a){for(var d=Array(this.monomerCount),g=this.monomerCount-1;2<=--g;){var f=a[g];d[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 d},"~A");c(b,"checkBetaSheetAlphaHelixOverlap",function(a,d){for(var g=this.monomerCount-2;2<=--g;)a[g]===JM.AlphaPolymer.Code.BETA_SHEET&&(140>=d[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");c(b,"calculateRunsFourOrMore",function(a){for(var d=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,c=4;0<=--c;)d[j-c]=g;else 4<b&&(d[j]=g);else b=1,f=a[j];return d},"~A");c(b,"extendRuns",
function(a){for(var d=1;d<this.monomerCount-4;++d)a[d]===J.c.STR.NONE&&a[d+1]!==J.c.STR.NONE&&(a[d]=a[d+1]);a[0]=a[1];a[this.monomerCount-1]=a[this.monomerCount-2]},"~A");c(b,"searchForTurns",function(a,d,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=d[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");c(b,"addStructuresFromTags",function(a){for(var d=0;d<this.monomerCount;){var g=a[d];if(null==g||g===J.c.STR.NONE)++d;else{var f;for(f=d+1;f<this.monomerCount&&a[f]===g;++f);this.addStructureProtected(g,null,null,0,d,f-1);d=f}}},"~A");c(b,"setStructureBS",function(a,d,g,f,b){b=b?this.pt0:0;for(var j=0,c=f.nextSetBit(b),k=0,m=this.monomerCount+b;0<=c&&c<m;c=f.nextSetBit(k+1)){if(0>(k=f.nextClearBit(c))||k>m)k=m;this.addStructureProtected(g,
JM.AlphaPolymer.dsspTypes[d]+ ++j,""+a++,3==d?1:0,c-b,k-1-b)}return a},"~N,~N,J.c.STR,JU.BS,~B");var a=A(JM.AlphaPolymer,"Code",Enum);M(a,"NADA",0,[]);M(a,"RIGHT_HELIX",1,[]);M(a,"BETA_SHEET",2,[]);M(a,"LEFT_HELIX",3,[]);M(a,"LEFT_TURN",4,[]);M(a,"RIGHT_TURN",5,[]);b.dsspTypes=E(-1,["H",null,"H","S","H",null,"T"])});r("JM");t(["JM.AlphaMonomer"],"JM.AminoMonomer","JU.A4 $.BS $.M3 $.P3 $.PT $.Quat $.V3 J.c.STR JU.Escape $.Logger".split(" "),function(){var b=z(function(){this.nhChecked=!1;this.ptTemp=
null;w(this,arguments)},JM,"AminoMonomer",JM.AlphaMonomer);L(b,function(){});b.validateAndAllocate=c(b,"validateAndAllocate",function(a,e,d,g,f,b,j){var c=JM.Monomer.scanForOffsets(g,b,JM.AminoMonomer.interestingAminoAtomIDs);if(null==c)return null;JM.Monomer.checkOptional(c,1,g,b[5]);return j[g].isHetero()&&!JM.AminoMonomer.isBondedCorrectly(g,c,j)?null:(new JM.AminoMonomer).set2(a,e,d,g,f,c)},"JM.Chain,~S,~N,~N,~N,~A,~A");b.isBondedCorrectlyRange=c(b,"isBondedCorrectlyRange",function(a,e,d,g,f){a=
d+(g[a]&255);e=d+(g[e]&255);return a!=e&&f[a].isBonded(f[e])},"~N,~N,~N,~A,~A");b.isBondedCorrectly=c(b,"isBondedCorrectly",function(a,e,d){return JM.AminoMonomer.isBondedCorrectlyRange(2,0,a,e,d)&&JM.AminoMonomer.isBondedCorrectlyRange(0,3,a,e,d)&&(!JM.Monomer.have(e,1)||JM.AminoMonomer.isBondedCorrectlyRange(3,1,a,e,d))},"~N,~A,~A");c(b,"isAminoMonomer",function(){return!0});h(b,"getNitrogenAtom",function(){return this.getAtomFromOffsetIndex(2)});c(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)});c(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,d,g,f){var b=d[0],c=this.getNitrogenAtom();
g=F(g/2);1200>g&&(g=1200);if(0!=c.sZ){g=B(this.scaleToScreen(c.sZ,g));4>g&&(g=4);var q=this.getCarbonylCarbonAtom();f=F(f/2);1200>f&&(f=1200);f=B(this.scaleToScreen(c.sZ,f));4>f&&(f=4);var k=this.getLeadAtom();if(this.isCursorOnTopOf(k,a,e,F((g+f)/2),b)||this.isCursorOnTopOf(c,a,e,g,b)||this.isCursorOnTopOf(q,a,e,f,b))d[0]=k}},"~N,~N,~A,~N,~N");c(b,"resetHydrogenPoint",function(){this.nhChecked=!1;this.nitrogenHydrogenPoint=null});c(b,"getNitrogenHydrogenPoint",function(){null==this.nitrogenHydrogenPoint&&
!this.nhChecked&&(this.nhChecked=!0,this.nitrogenHydrogenPoint=this.getExplicitNH());return this.nitrogenHydrogenPoint});c(b,"getExplicitNH",function(){var a=this.getNitrogenAtom(),e=null,d=a.bonds;if(null!=d)for(var g=0;g<d.length;g++)if(1==(e=d[g].getOtherAtom(a)).getElementNumber())return e;return null});c(b,"getNHPoint",function(a,e,d,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(d)e.sub2(f,this.getLeadAtom()),e.normalize(),d=JU.V3.newVsub(f,g.getCarbonylCarbonAtom()),d.normalize(),e.add(d);else{d=g.getCarbonylOxygenAtom();if(null==d)return!1;e.sub2(g.getCarbonylCarbonAtom(),d)}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(),d=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(d,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,d);f.sub2(this.getNitrogenAtom(),d);break;case 112:case 120:if(this.monomerIndex==
this.bioPolymer.monomerCount-1)return null;g.sub2(d,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(d,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});c(b,"clear",function(a,e,d){if(null!=e&&(a.clear(e.i),d)){d=e.bonds;for(var g,f=d.length;0<=--f;)1==(g=d[f].getOtherAtom(e)).getElementNumber()&&a.clear(g.i)}},"JU.BS,JM.Atom,~B");b.interestingAminoAtomIDs=G(-1,[2,-5,1,3,-65])});r("JM");t(["JM.AlphaPolymer"],"JM.AminoPolymer","JU.Measure $.P3 $.V3 J.c.STR JM.HBond JU.Logger".split(" "),
function(){var b=z(function(){this.structureList=null;w(this,arguments)},JM,"AminoPolymer",JM.AlphaPolymer);D(b,function(a,e){K(this,JM.AminoPolymer,[a,e]);this.type=1;for(var d=0;d<this.monomerCount;++d)if(!a[d].hasOAtom())return;this.hasWingPoints=!0},"~A,~N");h(b,"resetHydrogenPoints",function(){for(var a,e=null,d=0;d<this.monomerCount;d++){if(null!=(a=this.getProteinStructure(d))&&a!==e)(e=a).resetAxes();this.monomers[d].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});c(b,"calcPhiPsiAngles2",function(a,e){var d=a.getNitrogenAtom(),g=a.getLeadAtom(),f=a.getCarbonylCarbonAtom(),b=e.getNitrogenAtom(),c=e.getLeadAtom(),q=e.getCarbonylCarbonAtom();e.setGroupParameter(1111490569,JU.Measure.computeTorsion(f,b,c,q,!0));a.setGroupParameter(1111490570,JU.Measure.computeTorsion(d,g,f,b,!0));a.setGroupParameter(1111490568,JU.Measure.computeTorsion(g,f,b,c,!0))},"JM.AminoMonomer,JM.AminoMonomer");
h(b,"calculateRamachandranHelixAngle",function(a,e){var d=0==a?NaN:this.monomers[a-1].getGroupParameter(1111490570),g=this.monomers[a].getGroupParameter(1111490570),b=this.monomers[a].getGroupParameter(1111490569),l=a==this.monomerCount-1?NaN:this.monomers[a+1].getGroupParameter(1111490569),c=a==this.monomerCount-1?NaN:this.monomers[a+1].getGroupParameter(1111490570);switch(e.charCodeAt(0)){default:case 112:case 114:case 80:return d=3.141592653589793*((l-b)/2)/180,g=3.141592653589793*((c-g)/2)/180,
114.59155902616465*Math.acos(Math.cos(g)*Math.cos(d)-Math.sin(g)*Math.sin(d)/3);case 99:case 67:return g-d+l-b}},"~N,~S");h(b,"calcRasmolHydrogenBonds",function(a,e,d,g,b,l,c,q){null==a&&(a=this);if(x(a,"JM.AminoPolymer")){b=new JU.P3;for(var k=new JU.V3,m,n=null==l?s(2,3,0):null,h=1;h<this.monomerCount;++h)if(null==l?(n[0][0]=n[1][0]=this.bioPolymerIndexInModel,n[0][1]=n[1][1]=-2147483648,n[0][2]=n[1][2]=0):n=l[h],(m=this.monomers[h]).getNHPoint(b,k,c,q)){var y=null==e||e.get(m.getNitrogenAtom().i);
if(y&&(c||null!=m.getCarbonylOxygenAtom()))this.checkRasmolHydrogenBond(m,a,h,b,y?d:e,g,n,c)}}},"JM.BioPolymer,JU.BS,JU.BS,JU.Lst,~N,~A,~B,~B");c(b,"checkRasmolHydrogenBond",function(a,e,d,g,b,l,c,q){var k=a.getLeadAtom(),m=a.getNitrogenAtom();a=a.getNitrogenAtom();for(var n,h=e.monomerCount;0<=--h;)if(!(e===this&&(h==d||h+1==d))){n=e.monomers[h];var y=n.getCarbonylOxygenAtom();if(!(null==y||null!=b&&!b.get(y.i)))if(y=n.getLeadAtom(),!(81<=k.distanceSquared(y))){y=this.calcHbondEnergy(m,g,n,q);if(y<
c[0][2])n=c[1],c[1]=c[0],c[0]=n;else if(y<c[1][2])n=c[1];else continue;n[0]=e.bioPolymerIndexInModel;n[1]=-500>y?h:-1-h;n[2]=y}}if(null!=l)for(h=0;2>h;h++)0<=c[h][1]&&this.addResidueHydrogenBond(a,e.monomers[c[h][1]].getCarbonylOxygenAtom(),e===this?d:-99,c[h][1],c[h][2]/1E3,l)},"JM.AminoMonomer,JM.BioPolymer,~N,JU.P3,JU.BS,JU.Lst,~A,~B");c(b,"calcHbondEnergy",function(a,e,d,g){var b=d.getCarbonylOxygenAtom();if(null==b)return 0;var l=b.distanceSquared(a);if(0.25>l)return 0;b=b.distanceSquared(e);
if(0.25>b)return 0;d=d.getCarbonylCarbonAtom();e=d.distanceSquared(e);if(0.25>e)return 0;d=d.distanceSquared(a);if(0.25>d)return 0;a=Math.sqrt(b);b=Math.sqrt(e);e=Math.sqrt(d);l=Math.sqrt(l);l=JM.HBond.getEnergy(a,b,e,l);return!(-500>l&&(!g||e>b&&3>=a))&&g||-9900>l?0:l},"JU.P3,JU.P3,JM.AminoMonomer,~B");c(b,"addResidueHydrogenBond",function(a,e,d,g,b,l){switch(d-g){case 2:d=6144;break;case 3:d=8192;break;case 4:d=10240;break;case 5:d=12288;break;case -3:d=14336;break;case -4:d=16384;break;default:d=
4096}l.addLast(new JM.HBond(a,e,d,1,0,b))},"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=O(this.monomerCount,"\x00");for(var e=0;e<this.monomerCount-1;++e){var d=this.monomers[e],g=this.monomers[e+1],b=g.getGroupParameter(1111490569),l=d.getGroupParameter(1111490570);a[e]=this.isHelix(l,b)?0>b&&25>l?"4":"3":this.isSheet(l,b)?"s":this.isTurn(l,b)?"t":"n";JU.Logger.debugging&&JU.Logger.debug(0+
this.monomers[0].chain.chainID+" aminopolymer:"+e+" "+g.getGroupParameter(1111490569)+","+d.getGroupParameter(1111490570)+" "+a[e])}for(e=0;e<this.monomerCount;++e)if("4"==a[e]){for(d=e+1;d<this.monomerCount&&"4"==a[d];++d);d--;d>=e+3&&this.addStructureProtected(J.c.STR.HELIX,null,null,0,e,d);e=d}for(e=0;e<this.monomerCount;++e)if("3"==a[e]){for(d=e+1;d<this.monomerCount&&"3"==a[d];++d);d--;d>=e+3&&this.addStructureProtected(J.c.STR.HELIX,null,null,0,e,d);e=d}for(e=0;e<this.monomerCount;++e)if("s"==
a[e]){for(d=e+1;d<this.monomerCount&&"s"==a[d];++d);d--;d>=e+2&&this.addStructureProtected(J.c.STR.SHEET,null,null,0,e,d);e=d}for(e=0;e<this.monomerCount;++e)if("t"==a[e]){for(d=e+1;d<this.monomerCount&&"t"==a[d];++d);d--;d>=e+2&&this.addStructureProtected(J.c.STR.TURN,null,null,0,e,d);e=d}}},"~B");c(b,"isTurn",function(a,e){return JM.AminoPolymer.checkPhiPsi(this.structureList.get(J.c.STR.TURN),a,e)},"~N,~N");c(b,"isSheet",function(a,e){return JM.AminoPolymer.checkPhiPsi(this.structureList.get(J.c.STR.SHEET),
a,e)},"~N,~N");c(b,"isHelix",function(a,e){return JM.AminoPolymer.checkPhiPsi(this.structureList.get(J.c.STR.HELIX),a,e)},"~N,~N");b.checkPhiPsi=c(b,"checkPhiPsi",function(a,e,d){for(var g=0;g<a.length;g+=4)if(d>=a[g]&&d<=a[g+1]&&e>=a[g+2]&&e<=a[g+3])return!0;return!1},"~A,~N,~N");c(b,"setStructureList",function(a){this.structureList=a},"java.util.Map")});r("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;w(this,arguments)},JM,"BioModelSet",null);c(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});c(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");c(b,"calcAllRasmolHydrogenBonds",function(a,e,d,g,b,l,c,q){var k=this.ms.am;if(null==d){var m=
a;null!=e&&!a.equals(e)&&(m=JU.BSUtil.copy(a)).or(e);for(var n=new JU.BS,h=new JU.BS,y=this.ms.am,v=this.ms.bo,u=this.ms.bondCount;0<=--u;){var C=v[u];0!=(C.order&28672)&&(m.get(C.atom1.i)?n.set(u):h.set(y[C.atom1.mi].trajectoryBaseIndex))}for(u=this.ms.mc;0<=--u;)y[u].isBioModel&&(y[u].hasRasmolHBonds=h.get(u));0<=n.nextSetBit(0)&&this.ms.deleteBonds(n,!1)}for(u=this.ms.mc;0<=--u;)k[u].isBioModel&&!this.ms.isTrajectorySubFrame(u)&&k[u].getRasmolHydrogenBonds(a,e,d,g,b,l,c,q)},"JU.BS,JU.BS,JU.Lst,~B,~N,~B,JU.BS,~N");
c(b,"calcSelectedMonomersCount",function(){for(var a=this.vwr.bsA(),e=this.ms.mc;0<=--e;)if(this.ms.am[e].isBioModel)for(var d=this.ms.am[e],g=d.bioPolymerCount;0<=--g;)d.bioPolymers[g].calcSelectedMonomersCount(a)});c(b,"calculateAllPolymers",function(a,e,d,g){var b=!this.vwr.getBoolean(603979896);0>e&&(e=a.length);if(null!=g)for(var l=0;l<e;++l){var c=a[l];x(c,"JM.Monomer")&&null!=c.bioPolymer&&!g.get(c.chain.model.modelIndex)&&c.setBioPolymer(null,-1)}for(var c=0,q=this.ms.mc;c<q;c++)if((null==
g||!g.get(c))&&this.ms.am[c].isBioModel)for(var k=0,l=d;l<e;++l,k++){var m=a[l],h=m.getModel();if(h.isBioModel&&x(m,"JM.Monomer")&&null!=m.getLeadAtom()){var p=b&&!this.ms.isJmolDataFrameForModel(this.ms.at[m.getLeadAtom().i].mi),m=null==m.bioPolymer?JM.BioResolver.allocateBioPolymer(a,l,p,k):null;null==m||0==m.monomerCount||(h=h.addBioPolymer(m),l+=h-1,k+=h-1)}}},"~A,~N,~N,JU.BS");c(b,"calculateAllStructuresExcept",function(a,e,d,g,b,l,c){var q="";a=JU.BSUtil.copyInvert(a,this.ms.mc);b&&this.setAllDefaultStructure(a);
for(var k=a.nextSetBit(0);0<=k;k=a.nextSetBit(k+1))this.ms.am[k].isBioModel&&(q+=this.ms.am[k].calculateStructures(e,d,g,b,l,c));b&&this.ms.setStructureIndexes();return q},"JU.BS,~B,~B,~B,~B,~B,~N");c(b,"calculateAllStuctures",function(a,e,d,g,b,l){0>=l&&(l=2);var c=new JU.BS;a=JU.BSUtil.copyInvert(this.modelsOf(a,c),this.ms.mc);if(!b)return this.ms.calculateStructuresAllExcept(a,e,d,g,!1,!1,l);this.ms.recalculatePolymers(a);e=this.ms.calculateStructuresAllExcept(a,e,d,g,!0,!1,l);this.vwr.shm.resetBioshapes(c);
this.ms.setStructureIndexes();return e},"JU.BS,~B,~B,~B,~B,~N");c(b,"calculateStraightnessAll",function(){this.getBioExt().calculateStraightnessAll()});c(b,"calculateStruts",function(a,e){return this.getBioExt().calculateAllstruts(this.vwr,this.ms,a,e)},"JU.BS,JU.BS");c(b,"getAllDefaultStructures",function(a,e){for(var d=this.modelsOf(a,e),g=new JU.SB,b=d.nextSetBit(0);0<=b;b=d.nextSetBit(b+1))this.ms.am[b].isBioModel&&null!=this.ms.am[b].defaultStructure&&g.append(this.ms.am[b].defaultStructure);
return g.toString()},"JU.BS,JU.BS");c(b,"getAllHeteroList",function(a){for(var e=new java.util.Hashtable,d=!1,g=this.ms.mc;0<=--g;)if(0>a||g==a){var b=this.ms.getInfo(g,"hetNames");if(null!=b)for(var d=!0,l,b=b.entrySet().iterator();b.hasNext()&&((l=b.next())||1);){var c=l.getKey();e.put(c,l.getValue())}}return d?e:null},"~N");c(b,"getAllPolymerInfo",function(a,e){this.getBioExt().getAllPolymerInfo(a,e)},"JU.BS,java.util.Map");c(b,"getAllPolymerPointsAndVectors",function(a,e,d,g){for(var b=0;b<this.ms.mc;++b)if(this.ms.am[b].isBioModel)for(var l=
this.ms.am[b],c=2147483646,q=0;q<l.bioPolymerCount;q++)c=l.bioPolymers[q].getPolymerPointsAndVectors(c,a,e,d,g)},"JU.BS,JU.Lst,~B,~N");c(b,"getAllSequenceBits",function(a,e,d){if(0<a.length){null==e&&(e=this.vwr.getAllAtoms());if(a.indexOf("|")<a.lastIndexOf("|"))return this.getAllUnitIds(a,e,d);for(var g=this.ms.am,b=this.ms.mc;0<=--b;)if(g[b].isBioModel)for(var l=g[b],c=a.length,q=0;q<l.bioPolymerCount;q++)for(var k=l.bioPolymers[q].getSequence(),m=-1;0<=(m=k.indexOf(a,++m));)l.bioPolymers[q].getPolymerSequenceAtoms(m,
c,e,d)}return d},"~S,JU.BS,JU.BS");c(b,"getAtomBitsBS",function(a,e,d){var g=this.ms.at,b=this.ms.ac,c=0,j;switch(a){case 136314895:case 2097184:for(var q=136314895==a?J.c.STR.HELIX:J.c.STR.SHEET,c=b;0<=--c;)null!=g[c]&&((j=g[c].group).isWithinStructure(q)&&j.setAtomBits(d),c=j.firstAtomIndex);break;case 2097188:for(c=b;0<=--c;)null!=g[c]&&((j=g[c].group).isCarbohydrate()&&j.setAtomBits(d),c=j.firstAtomIndex);break;case 2097156:for(c=b;0<=--c;)null!=g[c]&&((j=g[c].group).isDna()&&j.setAtomBits(d),
c=j.firstAtomIndex);break;case 2097166:for(c=b;0<=--c;)null!=g[c]&&((j=g[c].group).isNucleic()&&j.setAtomBits(d),c=j.firstAtomIndex);break;case 2097168:for(c=b;0<=--c;)null!=g[c]&&((j=g[c].group).isProtein()&&j.setAtomBits(d),c=j.firstAtomIndex);break;case 2097170:for(c=b;0<=--c;)null!=g[c]&&((j=g[c].group).isPurine()&&j.setAtomBits(d),c=j.firstAtomIndex);break;case 2097172:for(c=b;0<=--c;)null!=g[c]&&((j=g[c].group).isPyrimidine()&&j.setAtomBits(d),c=j.firstAtomIndex);break;case 2097174:for(c=b;0<=
--c;)null!=g[c]&&((j=g[c].group).isRna()&&j.setAtomBits(d),c=j.firstAtomIndex)}if(0>c)return d;b=e.nextSetBit(0);if(0>b)return d;c=0;switch(a){case 1094713362:for(c=b;0<=c;c=e.nextSetBit(c+1))0<=g[c].group.getBioPolymerIndexInModel()&&g[c].group.bioPolymer.setAtomBitsAndClear(d,e);break;case 1639976963:for(c=b;0<=c;c=e.nextSetBit(c+1))b=g[c].group.getStructure(),null!=b&&b.setAtomBitsAndClear(d,e)}0==c&&JU.Logger.error("MISSING getAtomBits entry for "+JS.T.nameOf(a));return d},"~N,JU.BS,JU.BS");c(b,
"getAtomBitsStr",function(a,e,d){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 d=new JU.BS,0!=e.length%2?d:this.ms.getAtomBitsMDa(1086324742,this.getAllBasePairBits(e),d);case 1111490587:return this.getAnnotationBits("dssr",1111490587,e);case 1086324744:return this.getAllSequenceBits(e,
null,d)}},"~N,~S,JU.BS");c(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");c(b,"getFullProteinStructureState",function(a,e){var d=1073742327==e;if(d&&!this.ms.proteinStructureTainted)return"";var g=1073742158==e||1073742327==e,b=this.ms.at,c=(null==
a?this.vwr.getAllAtoms():a).nextSetBit(0);if(0>c)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 q=(null==a?this.vwr.getAllAtoms():a).length()-1,k=b[c].mi,c=b[q].mi,q=new JU.Lst,m=new java.util.Hashtable,h=new JU.SB;k<=c;k++)if(this.ms.am[k].isBioModel&&(j=this.ms.am[k],!d||j.structureTainted)){var p=new JU.BS;p.or(j.bsAtoms);
p.andNot(j.bsAtomsDeleted);j=p.nextSetBit(0);if(!(0>j)){g&&h.append("  structure none ").append(JU.Escape.eBS(this.ms.getModelAtomBitSetIncludingDeleted(k,!1))).append("    \t# model="+this.ms.getModelNumberDotted(k)).append(";\n");for(var y;0<=j;j=p.nextSetBit(j+1)){var v=b[j];if(!(null==v||!x(v.group,"JM.AlphaMonomer")||null==(y=v.group.proteinStructure)||m.containsKey(y)))q.addLast(y),m.put(y,Boolean.TRUE)}}}this.getStructureLines(a,h,q,J.c.STR.HELIX,g,e);this.getStructureLines(a,h,q,J.c.STR.SHEET,
g,e);this.getStructureLines(a,h,q,J.c.STR.TURN,g,e);return h.toString()},"JU.BS,~N");c(b,"getGroupsWithinAll",function(a,e){for(var d=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 c=this.ms.am[b],j=c.bioPolymerCount;0<=--j;)c.bioPolymers[j].getRangeGroups(a,e,d);return d},"~N,JU.BS");c(b,"getIdentifierOrNull",function(a){for(var e=a.length,d=0;d<e&&JU.PT.isLetter(a.charAt(d));)++d;var g=this.ms.getSpecNameOrNull(a.substring(0,d),!1);
if(d==e)return g;null==g&&(g=new JU.BS);for(var b=d;d<e&&JU.PT.isDigit(a.charAt(d));)++d;var c=0;try{c=Integer.parseInt(a.substring(b,d))}catch(j){if(N(j,"NumberFormatException"))return null;throw j;}b=" ";d<e&&"^"==a.charAt(d)&&++d<e&&(b=a.charAt(d));c=JM.Group.getSeqcodeFor(c,b);c=this.ms.getSeqcodeBits(c,!1);if(null==c){" "!=b&&(c=this.ms.getSeqcodeBits(Character.toUpperCase(a.charAt(d)).charCodeAt(0),!1));if(null==c)return null;d++}g.and(c);if(d>=e)return g;if(d!=e-1)return null;g.and(this.ms.getChainBits(a.charAt(d).charCodeAt(0)));
return g},"~S");c(b,"mutate",function(a,e,d,g,b){return this.getBioExt().mutate(this.vwr,a,e,d,g,b)},"JU.BS,~S,~A,~S,~A");c(b,"recalculateAllPolymers",function(a,e){for(var d=0;d<this.ms.mc;d++)this.ms.am[d].isBioModel&&!a.get(d)&&this.ms.am[d].clearBioPolymers();this.calculateAllPolymers(e,-1,0,a)},"JU.BS,~A");c(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");c(b,"setAllConformation",function(a){this.vwr.ms.recalculatePositionDependentQuantities(a,null);for(var e=this.ms.getModelBS(a,!1),d=e.nextSetBit(0);0<=d;d=e.nextSetBit(d+1))if(this.ms.am[d].isBioModel){var g=this.ms.am[d];if(0<g.altLocCount)for(var b=g.bioPolymerCount;0<=--b;)g.bioPolymers[b].setConformation(a)}},"JU.BS");c(b,"setAllProteinType",function(a,e){var d=-1,g=this.ms.getModelBS(a,!1);this.setAllDefaultStructure(g);
for(var g=this.ms.getGroups(),b=0,c=-2147483648,j=null,q=null,k=e===J.c.STR.NONE,m=0;m<g.length;m++){var h=g[m];if(0!=h.getBioPolymerLength()&&a.get(h.firstAtomIndex)){var p=h.getModel();if(!k){p!==q&&(q=p,b=0,j=null);j!==h.bioPolymer&&(c=-2147483648,j=h.bioPolymer);var y=h.getResno();y!=c+1&&(d=-1);c=y}d=h.setProteinStructureType(e,d);1E3<h.getStrucNo()&&h.setStrucNo(++b);this.ms.proteinStructureTainted=p.structureTainted=!0}}},"JU.BS,J.c.STR");c(b,"setAllStructureList",function(a){for(var e=this.ms.mc;0<=
--e;)if(this.ms.am[e].isBioModel){var d=this.ms.am[e];d.bioPolymers=JU.AU.arrayCopyObject(d.bioPolymers,d.bioPolymerCount);for(var g=d.bioPolymerCount;0<=--g;){var b=d.bioPolymers[g];x(b,"JM.AminoPolymer")&&b.setStructureList(a)}}},"java.util.Map");c(b,"getAllBasePairBits",function(a){var e=null,d=null,g=new JU.Lst;if(0==a.length)e=d=this.vwr.getAllAtoms(),this.calcAllRasmolHydrogenBonds(e,d,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)||(d=this.ms.getSequenceBits(a.substring(b,++b),null,new JU.BS),0>d.nextSetBit(0)||this.calcAllRasmolHydrogenBonds(e,d,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");c(b,"getAllUnitIds",function(a,e,d){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 c=this.ms.am[b];if(c.isBioModel){this.ms.isTrajectory(b)&&(c=this.ms.am[b=
c.trajectoryBaseIndex]);var j="|"+this.ms.getInfo(b,"modelNumber");this.checkMap(g[0],this.ms.getInfo(b,"modelName")+j,c.bsAtoms);this.checkMap(g[0],j,c.bsAtoms)}}}var j=c=null,q=new JU.BS;a=JU.PT.getTokens(JU.PT.replaceAllCharacters(a,', \t\n[]"='," "));for(var k=s(8,0),b=a.length;0<=--b;){var h=a[b]+"|";if(!(5>h.length)){for(var n=0,p=0,y=0,v=h.lastIndexOf("|")+1;p<v&&8>y;p++)"|"==h.charAt(p)?k[y++]=p:n|=1<<y;if(22==(n&22)){q.clearAll();q.or(e);p=h.substring(0,k[2]);if(null!=j&&j.equals(p))q.and(c);
else{if(!this.addUnit(1094717454,h.substring(0,k[1]).toUpperCase(),q,g[0])||!this.addUnit(1073742357,h.substring(k[1]+1,k[2]),q,g[1]))continue;c=JU.BSUtil.copy(q);j=p}p=0!=(n&32);y=0!=(n&64);this.addUnit(1094715412,h.substring(k[3]+1,k[4]),q,g[2])&&(this.addUnit(5,0==(n&128)?"\x00":h.substring(k[6]+1,k[7]),q,g[3])&&!(p?!this.addUnit(1086326786,h.substring(k[4]+1,k[5]).toUpperCase(),q,g[4])||!this.addUnit(1073742355,h.substring(k[5]+1,k[6]),q,g[5]):y&&!this.addUnit(1094717448,h.substring(k[5]+1,k[6]),
q,g[6])))&&d.or(q)}}}return d},"~S,JU.BS,JU.BS");c(b,"checkMap",function(a,e,d){d=JU.BSUtil.copy(d);var b=a.get(e);null==b?a.put(e,b=d):b.or(d);return b},"java.util.Map,~S,JU.BS");c(b,"addUnit",function(a,e,d,b){var f=b.get(e);if(null==f){var c;switch(a){default:return!1;case 1073742357:c=Integer.$valueOf(this.vwr.getChainID(e,!1));break;case 1094715412:c=Integer.$valueOf(JU.PT.parseInt(e));break;case 5:c=Integer.$valueOf(e.charAt(0).charCodeAt(0));break;case 1094717448:f=this.ms.getAtomBitsMDa(a=
1073742355,null,new JU.BS);case 1086326786:c=e;break;case 1073742355:c=0==e.length?null:e}b.put(e,f=this.ms.getAtomBitsMDa(a,c,null==f?new JU.BS:f))}d.and(f);return 0<=d.nextSetBit(0)},"~N,~S,JU.BS,java.util.Map");c(b,"getAnnotationBits",function(a,e,d){for(var b=new JU.BS,f=this.vwr.getAnnotationParser(a.equals("dssr")),c,j=this.ms.mc;0<=--j;)null!=(c=this.ms.getInfo(j,a))&&b.or(f.getAtomBits(this.vwr,d,this.ms.am[j].getCachedAnnotationMap(a+" V ",c),this.ms.am[j].dssrCache,e,j,this.ms.am[j].bsAtoms));
return b},"~S,~N,~S");c(b,"getStructureLines",function(a,e,d,b,f,c){c=134222350==c;for(var j=0,q=0,k=0,h=null,n=new JU.BS,p=0,y=0,v=d.size();y<v;y++){var u=d.get(y);if(u.type===b){var C=u.findMonomer(a,!0),r=u.findMonomer(a,!1);if(!(null==C||null==r)){var t=u.apolymer.model.modelIndex,h=f?"    \t# model="+this.ms.getModelNumberDotted(t):null,t=C.getResno(),x=r.getResno(),w=u.subtype;switch(b){case J.c.STR.HELIX:case J.c.STR.TURN:case J.c.STR.SHEET:if(p++,f){n.clearAll();u.setAtomBits(n);var z=w.getBioStructureTypeName(!1);
e.append("  structure ").append(z).append(" ").append(JU.Escape.eBS(n)).append(h).append(" & ("+t+" - "+x+")").append(";\n")}else{var s;switch(b){case J.c.STR.HELIX:z=++j;h=JU.PT.formatStringI("%3N %3N","N",z);s="HELIX  %ID %3GROUPA %1CA %4RESA  %3GROUPB %1CB %4RESB";z=null;switch(w){case J.c.STR.HELIX:case J.c.STR.HELIXALPHA:z="  1";break;case J.c.STR.HELIX310:z="  5";break;case J.c.STR.HELIXPI:z="  3"}null!=z&&(s+=z);break;case J.c.STR.SHEET:z=++q;h=JU.PT.formatStringI("%3N %3A 0","N",z);h=JU.PT.formatStringS(h,
"A","S"+z);s="SHEET  %ID %3GROUPA %1CA%4RESA  %3GROUPB %1CB%4RESB";break;default:z=++k,h=JU.PT.formatStringI("%3N %3N","N",z),s="TURN   %ID %3GROUPA %1CA%4RESA  %3GROUPB %1CB%4RESB"}s=JU.PT.formatStringS(s,"ID",h);s=JU.PT.formatStringS(s,"GROUPA",C.getGroup3());s=JU.PT.formatStringS(s,"CA",C.getLeadAtom().getChainIDStr());s=JU.PT.formatStringI(s,"RESA",t);s=JU.PT.formatStringS(s,"GROUPB",r.getGroup3());s=JU.PT.formatStringS(s,"CB",r.getLeadAtom().getChainIDStr());s=JU.PT.formatStringI(s,"RESB",x);
e.append(s);c&&e.append(" strucno= ").appendI(u.strucNo);e.append("\n")}}}}}0<p&&e.append("\n");return p},"JU.BS,JU.SB,JU.Lst,J.c.STR,~B,~N");c(b,"modelsOf",function(a,e){for(var d=JU.BS.newN(this.ms.mc),b=null==a,f=b?this.ms.ac-1:a.nextSetBit(0);0<=f;f=b?f-1:a.nextSetBit(f+1))if(null!=this.ms.at[f]){var c=this.ms.am[this.ms.at[f].mi].trajectoryBaseIndex;this.ms.isJmolDataFrameForModel(c)||(d.set(c),e.set(f))}return d},"JU.BS,JU.BS");c(b,"setAllDefaultStructure",function(a){for(var e=a.nextSetBit(0);0<=
e;e=a.nextSetBit(e+1))if(this.ms.am[e].isBioModel){var d=this.ms.am[e];null==d.defaultStructure&&(d.defaultStructure=this.getFullProteinStructureState(d.bsAtoms,1073742158))}},"JU.BS");c(b,"getAminoAcidValenceAndCharge",function(a,e,d){return this.getBioExt().getAminoAcidValenceAndCharge(a,e,d)},"~S,~S,~A")});r("JM");t(["JM.Model"],"JM.BioModel","java.util.Hashtable JU.AU $.BS $.Lst $.SB J.api.Interface JU.Escape".split(" "),function(){var b=z(function(){this.vwr=null;this.bioPolymerCount=0;this.bioPolymers=
null;this.isMutated=!1;this.defaultStructure=null;w(this,arguments)},JM,"BioModel",JM.Model);D(b,function(a,e,d,b,f,c){K(this,JM.BioModel,[]);this.vwr=a.vwr;this.set(a,e,d,b,f,c);this.isBioModel=!0;this.vwr.getJBR().getBioModelSet(a);this.clearBioPolymers();a.am[e]=this;this.pdbID=c.get("name")},"JM.ModelSet,~N,~N,~S,java.util.Properties,java.util.Map");c(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");c(b,"addSecondaryStructure",function(a,e,d,b,f,c,j,q,k,h,n){for(var p=this.bioPolymerCount;0<=--p;)x(this.bioPolymers[p],"JM.AlphaPolymer")&&this.bioPolymers[p].addStructure(a,e,d,b,f,c,j,q,k,h,n)},"J.c.STR,~S,~S,~N,~N,~N,~N,~N,~N,~N,JU.BS");c(b,"addStructureByBS",function(a,e,d,b){for(var f=this.bioPolymerCount;0<=--f;)x(this.bioPolymers[f],
"JM.AlphaPolymer")&&(a=this.bioPolymers[f].setStructureBS(++a,e,d,b,!0))},"~N,~N,J.c.STR,JU.BS");c(b,"calculateDssx",function(a,e,d,b,f){for(var c=!1,j=!1,q=0;q<this.bioPolymerCount&&(!c||!j);q++)this.bioPolymers[q].isNucleic()?j=!0:x(this.bioPolymers[q],"JM.AminoPolymer")&&(c=!0);q="";c&&(q+=J.api.Interface.getOption("dssx.DSSP",this.vwr,"ms").calculateDssp(this.bioPolymers,this.bioPolymerCount,a,e,d,b,f));j&&(this.auxiliaryInfo.containsKey("dssr")&&null!=a)&&(q+=this.vwr.getAnnotationParser(!0).getHBonds(this.ms,
this.modelIndex,a,e));return q},"JU.Lst,~B,~B,~B,~N");c(b,"calculateStructures",function(a,e,d,b,f,c){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;)x(this.bioPolymers[j],"JM.AlphaPolymer")&&this.bioPolymers[j].calculateStructures(f);return a?this.calculateDssx(null,
e,d,b,c):""},"~B,~B,~B,~B,~B,~N");c(b,"clearBioPolymers",function(){this.bioPolymers=Array(8);this.bioPolymerCount=0});h(b,"fixIndices",function(a,e,d){this.fixIndicesM(a,e,d);this.recalculateLeadMidpointsAndWingVectors()},"~N,~N,JU.BS");h(b,"freeze",function(){this.freezeM();this.bioPolymers=JU.AU.arrayCopyObject(this.bioPolymers,this.bioPolymerCount);return!0});c(b,"getBioBranches",function(a){for(var e,d=0;d<this.bioPolymerCount;d++)e=new JU.BS,this.bioPolymers[d].getRange(e,this.isMutated),0<=
e.nextSetBit(0)&&(null==a&&(a=new JU.Lst),a.addLast(e));return a},"JU.Lst");c(b,"getBioPolymerCount",function(){return this.bioPolymerCount});c(b,"getCachedAnnotationMap",function(a,e){var d=null==this.dssrCache&&null!=e?this.dssrCache=new java.util.Hashtable:this.dssrCache;if(null==d)return null;var b=d.get(a);null==b&&null!=e&&(b=x(e,"JS.SV")||x(e,"java.util.Hashtable")?e:this.vwr.parseJSONMap(e),d.put(a,b));return x(b,"JS.SV")||x(b,"java.util.Hashtable")?b:null},"~S,~O");c(b,"getConformation",
function(a,e,d,b){var f=0==a;if(0==this.altLocCount)f&&b.or(d);else{var c=0>=a,j=this.ms.at,q=-32==a,k=c&&!q?String.fromCharCode(-a):"\x00";if(c){a=-2147483648;for(var h="\x00",n=-2147483648,p=new java.util.Hashtable,c=d.nextSetBit(0);0<=c;c=d.nextSetBit(c+1)){var y=j[c],v=y.getChainID(),u=y.getResno(),r=y.getInsertionCode();if(u!=n||r!=h||v!=a)a=v,n=u,h=r,p.clear();u=y.getAtomName();v=p.get(u);null==v&&p.put(u,v=s(1,0));u=v[0]-1;0>u?-2==u?d.clear(c):q?"\x00"!=y.altloc&&d.clear(c):v[0]=c+1:(f?(d.clear(c),
v[0]=-1):y.altloc==k?v[0]=-1:u=c,d.clear(u))}}else{a--;f=null;q="\x00";k=a;h=new JU.BS;for(c=d.nextSetBit(0);0<=c;c=d.nextSetBit(c+1))y=j[c],n=y.altloc,"\x00"!=n&&(y.group!==f&&(f=y.group,q="\x00",k=a,h.clearAll()),0<=k&&(n!=q&&!h.get(n.charCodeAt(0)))&&(q=n,k--,h.set(n.charCodeAt(0))),(0<=k||n!=q)&&d.clear(c))}if(0<=d.nextSetBit(0)&&(b.or(d),e))for(e=this.bioPolymerCount;0<=--e;)this.bioPolymers[e].setConformation(d)}},"~N,~B,JU.BS,JU.BS");c(b,"getDefaultLargePDBRendering",function(a,e){var d=new JU.BS;
0==this.getBondCount()&&(d=this.bsAtoms);if(d!==this.bsAtoms)for(var b=0;b<this.bioPolymerCount;b++)this.bioPolymers[b].getRange(d,this.isMutated);if(!(0>d.nextSetBit(0))){var f=new JU.BS;if(d===this.bsAtoms)f=d;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(d)).append(" & connected; wireframe only;"),
d!==this.bsAtoms&&(f.clearAll(),f.or(this.bsAtoms),f.andNot(d),0<=f.nextSetBit(0)&&a.append("select "+JU.Escape.eBS(f)+" & !connected;stars 0.5;spacefill off;")))}},"JU.SB,~N");c(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)});c(b,"getPdbData",function(a,e,d,b,f,c,j,h){this.ms.bioModelset.getBioExt().getPdbDataM(this,this.vwr,a,e,d,b,f,c,j,h)},"~S,~S,~B,JU.BS,JU.OC,~A,JU.SB,JU.BS");
c(b,"getRasmolHydrogenBonds",function(a,e,d,b,f,c,j,h){var k=null==d;k&&(d=new JU.Lst);0>f&&(f=2147483647);var m;if(null==e&&0<this.bioPolymerCount)this.calculateDssx(d,!1,c,!1,h);else for(c=this.bioPolymerCount;0<=--c;)if(h=this.bioPolymers[c],0!=h.monomerCount){var n=h.getType(),p=!1;switch(n){case 1:if(b)continue;h.calcRasmolHydrogenBonds(null,a,e,d,f,null,!0,!1);break;case 2:p=h.monomers[0].isRna();break;default:continue}for(var y=this.bioPolymerCount;0<=--y;)null!=(m=this.bioPolymers[y])&&((p||
c!=y)&&n==m.getType())&&m.calcRasmolHydrogenBonds(h,a,e,d,f,null,!0,!1)}if(0!=d.size()&&k){this.hasRasmolHBonds=!0;for(c=0;c<d.size();c++)a=d.get(c),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");c(b,"getUnitID",function(a,e){var d=new JU.SB,b=a.group,f=16!=(e&16),c=8==(e&8)?b.getInsertionCode():"\x00",j="\x00"!=c;1==(e&1)&&null!=this.pdbID&&d.append(this.pdbID);d.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)?(d.append("|").append(a.getAtomName()),"\x00"!=a.altloc?d.append("|").appendC(a.altloc):(f||j)&&d.append("|")):(f||j)&&d.append("||");j?d.append("|").appendC(c):f&&d.append("|");f&&d.append("|");return d.toString()},"JM.Atom,~N");c(b,"recalculateLeadMidpointsAndWingVectors",function(){for(var a=0;a<this.bioPolymerCount;a++)this.bioPolymers[a].recalculateLeadMidpointsAndWingVectors()});
c(b,"resetRasmolBonds",function(a,e){var d=new JU.BS;this.hasRasmolHBonds=!1;for(var b=this.ms.am,f=this.ms.bo,c=this.ms.bondCount;0<=--c;){var j=f[c];0!=(j.order&28672)&&b[j.atom1.mi].trajectoryBaseIndex==this.modelIndex&&d.set(c)}0<=d.nextSetBit(0)&&this.ms.deleteBonds(d,!1);this.getRasmolHydrogenBonds(a,a,null,!1,2147483647,!1,null,e)},"JU.BS,~N");c(b,"getAtomicDSSRData",function(a,e){this.auxiliaryInfo.containsKey("dssr")&&this.vwr.getAnnotationParser(!0).getAtomicDSSRData(this.ms,this.modelIndex,
a,e)},"~A,~S")});r("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.bsAssigned=null;w(this,arguments)},JM,"BioResolver",null,java.util.Comparator);c(b,"setLoader",function(a){this.ml=a;this.bsAddedMask=null;this.haveHsAlready=!1;null==a?this.hNames=this.htGroupBonds=this.htBondMap=this.bsAddedHydrogens=this.bsAtomsForHs=this.bsAssigned=this.ms=null:(JM.Group.specialAtomNames=JM.BioResolver.specialAtomNames,this.ms=a.ms,this.vwr=
a.ms.vwr,a.specialAtomIndexes=s(JM.BioResolver.ATOMID_MAX,0),this.hasCONECT=this.ms.getInfoM(JV.JC.getBoolName(3))===Boolean.TRUE);return this},"JM.ModelLoader");c(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=F(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");c(b,"getBioModel",function(a,e,d,b,f){return new JM.BioModel(this.ms,a,e,d,b,f)},"~N,~N,~S,java.util.Properties,java.util.Map");c(b,"distinguishAndPropagateGroup",function(a,e,d,b,f,c,j){for(var h=0,k=JM.BioResolver.ATOMID_MAX;0<=--k;)c[k]=-2147483648;for(k=
f;k>=b;--k){var m=j[k].atomID;0>=m||(14>m&&(h|=1<<m),c[m]=k)}k=null;14==(h&14)?k=JM.AminoMonomer.validateAndAllocate(a,e,d,b,f,c,j):4==h?k=JM.AlphaMonomer.validateAndAllocateA(a,e,d,b,f,c):8128==(h&8128)?k=JM.NucleicMonomer.validateAndAllocate(a,e,d,b,f,c):8192==h?k=JM.PhosphorusMonomer.validateAndAllocateP(a,e,d,b,f,c):JM.BioResolver.checkCarbohydrate(e)&&(k=JM.CarbohydrateMonomer.validateAndAllocate(a,e,d,b,f));return null!=k&&0<=k.leadAtomIndex?k:null},"JM.Chain,~S,~N,~N,~N,~A,~A");c(b,"setHaveHsAlready",
function(a){this.haveHsAlready=a},"~B");c(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});c(b,"addImplicitHydrogenAtoms",function(a,e,d){var b=this.ml.getGroup3(e),c;if(!(this.haveHsAlready&&this.hasCONECT||null==b||0==(c=JM.BioResolver.getStandardPdbHydrogenCount(b)))){d=
0>c?-1:c+d;c=null;e=this.ml.getFirstAtomIndex(e);var l=this.ms.ac;if(0>d){if(1==l-e)return;c=this.vwr.getLigandModel(b,"ligand_","_data",null);if(null==c)return;d=a.getHydrogenAtomCount(c);if(1>d)return}this.getBondInfo(a,b,c);this.ms.am[this.ms.at[e].mi].isPdbWithMultipleBonds=!0;if(!this.haveHsAlready){this.bsAtomsForHs.setBits(e,l);this.bsAddedHydrogens.setBits(l,l+d);a=this.ms.at[e].isHetero();b=JU.P3.new3(NaN,NaN,NaN);e=this.ms.at[e];for(c=0;c<d;c++)this.ms.addAtom(e.mi,e.group,1,"H",null,0,
e.getSeqID(),0,b,NaN,null,0,0,1,0,null,a,0,null,NaN).$delete(null)}}},"J.api.JmolAdapter,~N,~N");c(b,"getBondInfo",function(a,e,d){if(null==this.htGroupBonds.get(e)&&(a=null==d?this.getPdbBondInfo(e,this.vwr.getBoolean(603979873)):this.getLigandBondInfo(a,d,e),null!=a)){this.htGroupBonds.put(e,Boolean.TRUE);for(d=0;d<a.length;d++)null!=a[d]&&("H"==a[d][1].charAt(0)?this.htBondMap.put(e+"."+a[d][0],a[d][1]):this.htBondMap.put(e+":"+a[d][0]+":"+a[d][1],a[d][2]))}},"J.api.JmolAdapter,~S,~O");c(b,"getLigandBondInfo",
function(a,e,d){var b=a.getBondList(e),c=new java.util.Hashtable;for(a=a.getAtomIterator(e);a.hasNext();)c.put(a.getAtomName(),a.getXYZ());a=Array(2*b.length);for(var l=e=0;l<b.length;l++){var j=b[l];"H"!=j[0].charAt(0)&&(a[e++]=E(-1,[j[0],j[1],j[2],j[1].startsWith("H")?"0":"1"]));"H"!=j[1].charAt(0)&&(a[e++]=E(-1,[j[1],j[0],j[2],j[0].startsWith("H")?"0":"1"]))}java.util.Arrays.sort(a,this);for(var h,l=0;l<e;){h=a[l];for(var b=h[0],k=j=0;l<e&&(h=a[l])[0].equals(b);l++)h[3].equals("0")?j++:h[3].equals("1")&&
k++;b=l-j-k;if(1!=j)switch(k){case 1:for(var k=2==j?"@":"|",m=1;m<j;m++)a[b][1]+=k+a[b+m][1],a[b+m]=null;continue;case 2:if(2!=j)continue;var k=a[b][0],m=a[b+j][1],j=a[b+j+1][1],n=m.compareTo(j);JU.Measure.getPlaneThroughPoints(c.get(m),c.get(k),c.get(j),this.vNorm,this.vAB,this.plane);j=JU.Measure.distanceToPlane(this.plane,c.get(a[b][1]))*n;a[b][1]=0<j?a[b][1]+"@"+a[b+1][1]:a[b+1][1]+"@"+a[b][1];a[b+1]=null}}for(l=0;l<e;l++)null!=(h=a[l])&&"H"!=h[1].charAt(0)&&0<h[0].compareTo(h[1])?a[l]=null:null!=
h&&JU.Logger.info(" ligand "+d+": "+a[l][0]+" - "+a[l][1]+" order "+a[l][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");c(b,"finalizeHydrogens",function(){this.vwr.getLigandModel(null,null,null,null);this.finalizePdbMultipleBonds();this.addHydrogens()});c(b,"addHydrogens",function(){if(!(0>
this.bsAddedHydrogens.nextSetBit(0))){this.bsAddedMask=JU.BSUtil.copy(this.bsAddedHydrogens);this.finalizePdbCharges();for(var a=s(1,0),a=this.ms.calculateHydrogens(this.bsAtomsForHs,a,null,256),e=null,d=0,b,c=0;c<a.length;c++)if(!(null==a[c]||null==(b=this.ms.at[c]))){var l=b.group;if(l!==e){e=l;for(d=l.lastAtomIndex;this.bsAddedHydrogens.get(d);)d--}var j=b.getGroup3(!1),h=b.getAtomName(),k=this.htBondMap.get(j+"."+h);if(null!=k){var m=k.contains("@"),n=k.endsWith("?")||0<=k.indexOf("|"),p=a[c].length;
3==p&&(!n&&k.equals("H@H2"))&&(k="H|H2|H3",n=!0,m=!1);if(m&&3==p||n!=(3==p))JU.Logger.info("Error adding H atoms to "+j+l.getResno()+": "+a[c].length+" atoms should not be added to "+h);else switch(h=k.indexOf("@"),a[c].length){case 1:0<h&&(k=k.substring(0,h));this.setHydrogen(c,++d,k,a[c][0]);break;case 2:m=-1;n=b.bonds;if(null!=n)switch(n.length){case 2:m=n[0].getOtherAtom(b),n=n[1].getOtherAtom(b),p=m.getAtomName().compareTo(n.getAtomName()),m=JU.Measure.distanceToPlane(JU.Measure.getPlaneThroughPoints(m,
b,n,this.vNorm,this.vAB,this.plane),a[c][0])*p}0>h?(JU.Logger.info("Error adding H atoms to "+j+l.getResno()+": expected to only need 1 H but needed 2"),l=j="H"):0>m?(j=k.substring(0,h),l=k.substring(h+1)):(l=k.substring(0,h),j=k.substring(h+1));this.setHydrogen(c,++d,l,a[c][0]);this.setHydrogen(c,++d,j,a[c][1]);break;case 3:l=k.indexOf("|"),0<=l?(j=k.lastIndexOf("|"),this.hNames[0]=k.substring(0,l),this.hNames[1]=k.substring(l+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(c,++d,this.hNames[0],a[c][0]),this.setHydrogen(c,++d,this.hNames[1],a[c][2]),this.setHydrogen(c,++d,this.hNames[2],a[c][1])}}}this.deleteUnneededAtoms();this.ms.fixFormalCharges(JU.BSUtil.newBitSet2(this.ml.baseAtomIndex,this.ml.ms.ac))}});c(b,"deleteUnneededAtoms",function(){for(var a=new JU.BS,e=this.bsAtomsForHs.nextSetBit(0);0<=e;e=this.bsAtomsForHs.nextSetBit(e+1)){var d=this.ms.at[e];if(d.isHetero()&&
!(8!=d.getElementNumber()||0!=d.getFormalCharge()||2!=d.getCovalentBondCount())){var b=d.bonds,c=b[0].getOtherAtom(d),d=b[1].getOtherAtom(d);1==c.getElementNumber()&&(b=c,c=d,d=b);if(1==d.getElementNumber())for(var b=c.bonds,l=0;l<b.length;l++)if(2==b[l].order&&8==b[l].getOtherAtom(c).getElementNumber()){this.bsAddedHydrogens.set(d.i);d.$delete(a);break}}}this.ms.deleteBonds(a,!0);this.deleteAtoms(this.bsAddedHydrogens)});c(b,"deleteAtoms",function(a){for(var e=s(this.ms.ac,0),d=s(this.ms.ac-a.cardinality(),
0),b=this.ml.baseAtomIndex,c=this.ms.am,l=this.ms.at,j=this.ml.baseAtomIndex;j<this.ms.ac;j++){var h=l[j];null!=h&&(c[h.mi].bsAtoms.clear(j),c[h.mi].bsAtomsDeleted.clear(j),a.get(j)?(e[j]=b-1,c[l[j].mi].act--):(d[b]=j,e[j]=b++))}this.ms.msInfo.put("bsDeletedAtoms",a);for(j=this.ml.baseGroupIndex;j<this.ml.groups.length;j++)c=this.ml.groups[j],c.firstAtomIndex>=this.ml.baseAtomIndex&&(c.firstAtomIndex=e[c.firstAtomIndex],c.lastAtomIndex=e[c.lastAtomIndex],0<=c.leadAtomIndex&&(c.leadAtomIndex=e[c.leadAtomIndex]));
this.ms.adjustAtomArrays(d,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");c(b,"fixAnnotations",function(a,e,d){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,d,20))},"~N,~S,~N");c(b,"finalizePdbCharges",function(){for(var a=this.ms.at,e=this.bsAtomsForHs.nextSetBit(0);0<=e;e=this.bsAtomsForHs.nextSetBit(e+1)){var d=a[e];d.group.getNitrogenAtom()===d&&1==d.getCovalentBondCount()&&d.setFormalCharge(1);if(0>(e=this.bsAtomsForHs.nextClearBit(e+1)))break}});c(b,"finalizePdbMultipleBonds",function(){for(var a=new java.util.Hashtable,e=this.ms.bondCount,d=this.ms.bo,b=this.baseBondIndex;b<e;b++){var c=d[b].atom1,l=d[b].atom2,j=c.group;if(j===
l.group){var h=(new JU.SB).append(j.getGroup3());h.append(":");c=c.getAtomName();l=l.getAtomName();0<c.compareTo(l)?h.append(l).append(":").append(c):h.append(c).append(":").append(l);l=h.toString();c=this.htBondMap.get(l);null!=c&&(a.put(l,Boolean.TRUE),d[b].setOrder(JU.PT.parseInt(c)))}}for(b=this.htBondMap.keySet().iterator();b.hasNext()&&((h=b.next())||1);)if(null==a.get(h))if(0>h.indexOf(":"))a.put(h,Boolean.TRUE);else{var k=this.htBondMap.get(h);JU.Logger.info("bond "+h+" was not used; order="+
k);this.htBondMap.get(h).equals("1")&&a.put(h,Boolean.TRUE)}j=new java.util.Hashtable;for(b=this.htBondMap.keySet().iterator();b.hasNext()&&((h=b.next())||1);)null==a.get(h)&&j.put(h.substring(0,h.lastIndexOf(":")),this.htBondMap.get(h));if(!j.isEmpty())for(b=0;b<e;b++)if(c=d[b].atom1,l=d[b].atom2,c.group!==l.group&&!(null==(k=j.get(c.getGroup3(!1)+":"+c.getAtomName()))&&null==(k=j.get(l.getGroup3(!1)+":"+l.getAtomName()))))d[b].setOrder(JU.PT.parseInt(k)),JU.Logger.info("assigning order "+d[b].order+
" to bond "+d[b])});c(b,"setHydrogen",function(a,e,d,b){if(this.bsAddedHydrogens.get(e)){var c=this.ms.at;this.bsAddedHydrogens.clear(e);this.ms.setAtomName(e,d,!1);c[e].setT(b);c[e].atomSymmetry=c[a].atomSymmetry;this.ml.undeleteAtom(e);this.ms.bondAtoms(c[a],c[e],1,this.ms.getDefaultMadFromOrder(1),null,0,!0,!1)}},"~N,~N,~S,JU.P3");c(b,"fixPropertyValue",function(a,e,d){for(var b=this.ms.at,c=I(a.cardinality(),0),l=0,j=0,h=0,k=a.nextSetBit(0);0<=k;k=a.nextSetBit(k+1),h++){if(1==b[k].getElementNumber()){if(!d)continue}else l=
e[j++];c[h]=l}return c},"JU.BS,~O,~B");b.allocateBioPolymer=c(b,"allocateBioPolymer",function(a,e,d,b){for(var c=null,l=0,j=e;j<a.length;++j){var h=a[j],k;if(!x(h,"JM.Monomer")||null!=(k=h).bioPolymer||null!=c&&c.getClass()!==k.getClass()||d&&!k.isConnectedAfter(c))break;c=k;l++}if(2>l)return null;d=Array(l);for(j=0;j<l;++j)d[j]=a[e+j];if(x(c,"JM.AminoMonomer"))return new JM.AminoPolymer(d,b);if(x(c,"JM.AlphaMonomer"))return new JM.AlphaPolymer(d,b);if(x(c,"JM.NucleicMonomer"))return new JM.NucleicPolymer(d);
if(x(c,"JM.PhosphorusMonomer"))return new JM.PhosphorusPolymer(d);if(x(c,"JM.CarbohydrateMonomer"))return new JM.CarbohydratePolymer(d);JU.Logger.error("Polymer.allocatePolymer() ... no matching polymer for monomor "+c);throw new NullPointerException;},"~A,~N,~B,~N");c(b,"iterateOverAllNewStructures",function(a,e){var d=a.getStructureIterator(e);if(null!=d){var b=d.getStructuredModels();if(null!=b)for(var c=b.nextSetBit(0);0<=c;c=b.nextSetBit(c+1))this.ml.structuresDefinedInFile.set(this.ml.baseModelIndex+
c);for(;d.hasNext();)d.getStructureType()!==J.c.STR.TURN&&this.setStructure(d);for(d=a.getStructureIterator(e);d.hasNext();)d.getStructureType()===J.c.STR.TURN&&this.setStructure(d)}},"J.api.JmolAdapter,~O");c(b,"setStructure",function(a){var e=a.getSubstructureType(),d=a.getStructureID(),b=a.getStrandID(),c=a.getStrandCount(),l=a.getAtomIndices(),j=a.getModelIndices(),h=a.getBSAll(),k,m=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 n;if(null!=h){a=k;for(var p;a<=j;a++)if(x(k=m[a],"JM.BioModel"))for(d=0;5>d;d++)null!=(n=h[p=JM.BioResolver.mytypes[d]])&&!n.isEmpty()&&k.addStructureByBS(0,p,JM.BioResolver.types[d],n)}else{var h=a.getStartChainID(),y=a.getStartSequenceNumber(),v=a.getStartInsertionCode();p=a.getEndSequenceNumber();n=a.getEndChainID();a=a.getEndInsertionCode();e=e===J.c.STR.NOT?J.c.STR.NONE:e;y=JM.Group.getSeqcodeFor(y,v);p=JM.Group.getSeqcodeFor(p,a);null==this.bsAssigned&&(this.bsAssigned=new JU.BS);a=
k;for(v=0;a<=j;a++)if(x(k=m[a],"JM.BioModel"))k.addSecondaryStructure(e,d,b,c,h,y,n,p,(v=k.firstAtomIndex)+l[0],v+l[1],this.bsAssigned)}},"J.api.JmolAdapterStructureIterator");c(b,"setGroupLists",function(a){this.ml.group3Lists[a+1]=JM.Group.standardGroupList;this.ml.group3Counts[a+1]=s(JM.BioResolver.group3Count+10,0);null==this.ml.group3Lists[0]&&(this.ml.group3Lists[0]=JM.Group.standardGroupList,this.ml.group3Counts[0]=s(JM.BioResolver.group3Count+10,0))},"~N");c(b,"isKnownPDBGroup",function(a,
e){var d=JM.BioResolver.knownGroupID(a);return 0<d?d<e:2147483647==e&&JM.BioResolver.checkCarbohydrate(a)},"~S,~N");c(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 d=JM.BioResolver.specialAtomNames[e];null!=d&&JM.BioResolver.htSpecialAtoms.put(d,Byte.$valueOf(e))}}a=JM.BioResolver.htSpecialAtoms.get(a);return null==a?0:a.byteValue()},"~S");c(b,"getPdbBondInfo",
function(a,e){null==JM.BioResolver.htPdbBondInfo&&(JM.BioResolver.htPdbBondInfo=new java.util.Hashtable);var d=JM.BioResolver.htPdbBondInfo.get(a);if(null!=d)return d;d=JM.BioResolver.knownGroupID(a);if(0>d||d>JM.BioResolver.pdbBondInfo.length)return null;var b=JM.BioResolver.pdbBondInfo[d];if(e&&0<=(d=b.indexOf("O3'")))b=b.substring(0,d);for(var c=JU.PT.getTokens(b),d=Array(F(c.length/2)),l=0,j=0;l<d.length;l++){var h=c[j++],k=c[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<h.compareTo(k)&&(b=k,k=h,h=b);d[l]=E(-1,[h,k,k.startsWith("H")?"1":"2"])}JM.BioResolver.htPdbBondInfo.put(a,d);return d},"~S,~B");b.knownGroupID=c(b,"knownGroupID",function(a){if(null==a||0==a.length)return 0;a=JM.BioResolver.htGroup.get(a);return null==a?-1:a.shortValue()},"~S");b.checkCarbohydrate=c(b,"checkCarbohydrate",function(a){return null!=
a&&0<=",[AHR],[ALL],[AMU],[ARA],[ARB],[BDF],[BDR],[BGC],[BMA],[FCA],[FCB],[FRU],[FUC],[FUL],[GAL],[GLA],[GLC],[GXL],[GUP],[LXC],[MAN],[RAM],[RIB],[RIP],[XYP],[XYS],[CBI],[CT3],[CTR],[CTT],[LAT],[MAB],[MAL],[MLR],[MTT],[SUC],[TRE],[GCU],[MTL],[NAG],[NDG],[RHA],[SOR],[SOL],[SOE],[XYL],[A2G],[LBT],[NGA],[SIA],[SLB],[AFL],[AGC],[GLB],[NAN],[RAA]".indexOf("["+a.toUpperCase()+"]")},"~S");c(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<=F(a/6)+1},"~S");c(b,"toStdAmino3",function(a){if(0==a.length)return"";var e=new JU.SB,d=JM.BioResolver.knownGroupID("==A");if(0>d)for(var b=1;20>=b;b++)d=JM.BioResolver.knownGroupID(JM.BioResolver.predefinedGroup3Names[b]),JM.BioResolver.htGroup.put("=="+JM.BioResolver.predefinedGroup1Names[b],Short.$valueOf(d));for(var b=0,c=a.length;b<c;b++)d=a.charAt(b),d=JM.BioResolver.knownGroupID("=="+d),0>d&&(d=23),e.append(" ").append(JM.BioResolver.predefinedGroup3Names[d]);
return e.toString().substring(1)},"~S");c(b,"getGroupID",function(a){return JM.BioResolver.getGroupIdFor(a)},"~S");b.getGroupIdFor=c(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=c(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=c(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=c(b,"getSpecialAtomName",function(a){return JM.BioResolver.specialAtomNames[a]},"~N");c(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");c(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=E(-1,[J.c.STR.HELIXPI,J.c.STR.HELIXALPHA,J.c.STR.SHEET,J.c.STR.HELIX310,J.c.STR.TURN]);b.mytypes=s(-1,[0,2,3,4,6]);b.htPdbBondInfo=null;b.pdbBondInfo=
E(-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=s(-1,[0,6,16,7,6,6,9,8,4,9,12,12,14,10,10,8,6,8,11,10,10,3,5,0,13,13,13,-1,12,12,13,13,13,14,12,12]);b.group3Count=0;b.predefinedGroup1Names=O(-1,"\x00ARNDCQEGHILKMFPSTWYVAG?GCATUIGCATUIGCATUI".split(""));b.group3NameCount=0;b.predefinedGroup3Names=E(-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=
E(-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=s(-1,[4290682990,4291348680,4279524095,4278246620,4293265930,4293322240,4278246620,4293265930,4293651435,4286743250,4279206415,4279206415,4279524095,4293322240,4281479850,4292646530,4294612480,4294612480,4290009780,4281479850,4279206415,4294928820,4294928820,4290682990]);b.argbsNucleic=s(-1,[4290682990,4288716960,4279206415,4293322240,4293265930,4279524095,
4278246620,4278246620,4279206415,4293322240,4293265930,4279524095,4278246620,4278246620,4279206415,4293322240,4293265930,4279524095,4278246620,4278246620]);b.argbsChainAtom=s(-1,[4294967295,4290826495,4289789872,4294951112,4294967168,4294951167,4289786096,4294955120,4293951616,4294303411,4278239231,4291648604,4284927402,4288335154,4293821166,4278243025,4278255487,4282168177,4278190219,4290623339,4278215680,4286578688,4286611456,4286578816,4278222976,4290283019,4289864226]);b.argbsChainHetero=s(-1,
[4294967295,-7298865,-8335464,-3174224,-3158160,-3174193,-8339264,-3170208,-4173712,-3821949,-16734257,-4895668,-11094638,-7686870,-4296002,-16730463,-16724113,-13329567,-16777029,-5922981,-16739328,-5242880,-5197824,-5242704,-16731984,-1526253,-4050382]);b.argbsShapely=s(-1,[4294902015,4278190204,4294933616,4287430540,4288675906,4294967152,4294921292,4284874752,4294967295,4285559039,4278209536,4282736197,4282861496,4283649106,4290289730,4283585106,4294930498,4290268160,4283385344,4287393868,4294937855,
4294902015,4294902015,4294902015,4294930544,4294937675,4288717055,4288741280,4294934656,4286644223,4294930544,4294937675,4288717055,4288741280,4294934656,4286644223,4294930544,4294937675,4288717055,4288741280,4294934656,4286644223])});r("JM");t(["JM.Monomer"],"JM.CarbohydrateMonomer",["J.c.STR"],function(){var b=A(JM,"CarbohydrateMonomer",JM.Monomer);L(b,function(){});b.validateAndAllocate=c(b,"validateAndAllocate",function(a,e,d,b,c){return(new JM.CarbohydrateMonomer).set2(a,e,d,b,c,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 d=a.firstAtomIndex;d<=a.lastAtomIndex;d++){var b=this.chain.model.ms.at[e],c=this.chain.model.ms.at[d];if(null!=b&&null!=c&&14==b.getElementNumber()+c.getElementNumber()&&3.24>b.distanceSquared(c))return!0}return!1},"JM.Monomer");h(b,"findNearestAtomIndex",
function(a,e,d,b){var c=d[0],l=this.getLeadAtom();b=F(b/2);1200>b&&(b=1200);0!=l.sZ&&(b=B(this.scaleToScreen(l.sZ,b)),4>b&&(b=4),this.isCursorOnTopOf(l,a,e,b,c)&&(d[0]=l))},"~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=G(-1,[0])});r("JM");t(["JM.BioPolymer"],"JM.CarbohydratePolymer",null,function(){var b=A(JM,"CarbohydratePolymer",
JM.BioPolymer);D(b,function(a){K(this,JM.CarbohydratePolymer,[]);this.set(a);this.type=3},"~A")});r("JM");t(["JM.Monomer"],"JM.PhosphorusMonomer",["JU.Quat","$.V3","J.c.STR"],function(){var b=A(JM,"PhosphorusMonomer",JM.Monomer);L(b,function(){});h(b,"isNucleic",function(){return!0});b.validateAndAllocateP=c(b,"validateAndAllocateP",function(a,e,d,b,c,l){return b!=c||l[13]!=b?null:(new JM.PhosphorusMonomer).set2(a,e,d,b,c,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");c(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");c(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),d;d=this.bioPolymer.monomers[a+1].getAtomFromOffsetIndex(0);a=this.bioPolymer.monomers[a-1].getAtomFromOffsetIndex(0);if(null==e||null==d||null==a)return null;var b=new JU.V3,c=new JU.V3;b.sub2(d,e);c.sub2(a,e);return JU.Quat.getQuaternionFrameV(b,c,
null,!1)});h(b,"getQuaternionFrameCenter",function(){return this.getAtomFromOffsetIndex(0)},"~S");h(b,"getHelixData",function(a,e,d){return this.getHelixData2(a,e,d)},"~N,~S,~N");b.phosphorusOffsets=G(-1,[0]);b.MAX_ADJACENT_PHOSPHORUS_DISTANCE=8});r("JM");H=z(function(){this.g2=this.g1=this.info=null;w(this,arguments)},JM,"BasePair",null);H.add=c(H,"add",function(b,a,e){if(null==a||null==e)return null;var d=new JM.BasePair;d.info=b;(d.g1=a).addBasePair(d);(d.g2=e).addBasePair(d);return d},"java.util.Map,JM.NucleicMonomer,JM.NucleicMonomer");
c(H,"getPartnerAtom",function(b){return(b===this.g1?this.g2:this.g1).getLeadAtom().i},"JM.NucleicMonomer");c(H,"toString",function(){return this.info.toString()});r("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;w(this,arguments)},JM,"NucleicMonomer",
JM.PhosphorusMonomer);L(b,function(){});b.validateAndAllocate=c(b,"validateAndAllocate",function(a,e,d,b,c,l){var j=JM.Monomer.scanForOffsets(b,l,JM.NucleicMonomer.interestingNucleicAtomIDs);if(null==j||!JM.Monomer.checkOptional(j,19,b,l[73]))return null;JM.Monomer.checkOptional(j,20,b,l[89]);JM.Monomer.checkOptional(j,18,b,l[90]);JM.Monomer.checkOptional(j,23,b,l[75]);JM.Monomer.checkOptional(j,24,b,l[77]);return(new JM.NucleicMonomer).set4(a,e,d,b,c,j)},"JM.Chain,~S,~N,~N,~N,~A");c(b,"set4",function(a,
e,b,c,f,l){this.set2(a,e,b,c,f,l);JM.Monomer.have(l,15)||(l[0]=l[19],this.setLeadAtomIndex());this.hasRnaO2Prime=JM.Monomer.have(l,2);this.$isPyrimidine=JM.Monomer.have(l,8);this.$isPurine=JM.Monomer.have(l,9)&&JM.Monomer.have(l,10)&&JM.Monomer.have(l,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()});c(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});c(b,"getP",function(){return this.getAtomFromOffsetIndex(0)});c(b,"getC1P",function(){return this.getAtomFromOffsetIndex(25)});c(b,"getC2",function(){return this.getAtomFromOffsetIndex(5)});c(b,"getC5",function(){return this.getAtomFromOffsetIndex(3)});
c(b,"getC6",function(){return this.getAtomFromOffsetIndex(1)});c(b,"getC8",function(){return this.getAtomFromOffsetIndex(10)});c(b,"getC4P",function(){return this.getAtomFromOffsetIndex(27)});c(b,"getN1",function(){return this.getAtomFromOffsetIndex(4)});c(b,"getN3",function(){return this.getAtomFromOffsetIndex(6)});c(b,"getN2",function(){return this.getAtomFromOffsetIndex(17)});c(b,"getN4",function(){return this.getAtomFromOffsetIndex(14)});c(b,"getN6",function(){return this.getAtomFromOffsetIndex(16)});
c(b,"getO2",function(){return this.getAtomFromOffsetIndex(8)});c(b,"getO4",function(){return this.getAtomFromOffsetIndex(12)});c(b,"getO6",function(){return this.getAtomFromOffsetIndex(13)});h(b,"getTerminatorAtom",function(){return this.getAtomFromOffsetIndex(JM.Monomer.have(this.offsets,20)?20:21)});c(b,"getBaseRing6Points",function(a){this.getPoints(JM.NucleicMonomer.ring6OffsetIndexes,a)},"~A");c(b,"getPoints",function(a,e){for(var b=a.length;0<=--b;)e[b]=this.getAtomFromOffsetIndex(a[b])},"~A,~A");
c(b,"maybeGetBaseRing5Points",function(a){this.$isPurine&&this.getPoints(JM.NucleicMonomer.ring5OffsetIndexes,a);return this.$isPurine},"~A");c(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,b,c){var f=b[0],l=this.getLeadAtom(),
j=this.getAtomFromOffsetIndex(19),h=this.getAtomFromOffsetIndex(22);c=F(c/2);1900>c&&(c=1900);c=B(this.scaleToScreen(l.sZ,c));4>c&&(c=4);if(this.isCursorOnTopOf(l,a,e,c,f)||this.isCursorOnTopOf(j,a,e,c,f)||this.isCursorOnTopOf(h,a,e,c,f))b[0]=l},"~N,~N,~A,~N,~N");c(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");c(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)});c(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,c=!1,f=!1;switch(a.charCodeAt(0)){case 97:a=this.getP();if(0==this.monomerIndex||null==a)return null;
c=!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=c=!0;e=this.getAtomFromOffsetIndex(5);b=this.getAtomFromOffsetIndex(25);break;case 112:a=this.getP();if(null==a)return null;var l=this.getAtomFromOffsetIndex(23),
j=this.getAtomFromOffsetIndex(24),h=a.bonds;if(null==h)return null;for(var k=a.group,m=0;m<h.length;m++){var n=h[m].getOtherAtom(a);null!=l&&n.i==l.i||null!=j&&n.i==j.i||(n.group===k?b=n:e=n)}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,c)},"~S");h(b,"isCrossLinked",function(a){if(!x(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 c=0;c<b.length;c++)if(b[c].isHydrogen()){var f=b[c].getOtherAtom(e),l=f.group;if(x(l,"JM.NucleicMonomer")&&
(this.$isPurine?l.getN3():l.getN1())===f){if(null==a)return!0;a.addLast(Integer.$valueOf(e.i));a.addLast(Integer.$valueOf(f.i));a.addLast(Integer.$valueOf(l.leadAtomIndex))}}return null!=a&&0<a.size()},"JU.Lst,~B,~B");c(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");c(b,"addBasePair",function(a){null==this.bps&&(this.bps=new JU.Lst);this.bps.addLast(a)},"JM.BasePair");c(b,"setGroup1",function(a){"\x00"==this.group1&&(this.group1=a)},"~S");c(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)});c(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=G(-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=G(-1,[3,1,4,5,6,7]);b.ring5OffsetIndexes=G(-1,[3,9,10,11,7]);b.riboseOffsetIndexes=G(-1,[25,26,22,27,28,21,29,19,0]);b.heavyAtomIndexes=G(-1,[3,1,4,5,6,7,11,10,9,16,14,8,12,17,13])});r("JM");t(["JM.PhosphorusPolymer"],"JM.NucleicPolymer",["JU.Measure","$.P4","$.V3","JM.HBond"],function(){var b=z(function(){this.isDssrSet=
!1;w(this,arguments)},JM,"NucleicPolymer",JM.PhosphorusPolymer);D(b,function(a){K(this,JM.NucleicPolymer,[a]);this.type=2;this.hasWingPoints=!0},"~A");c(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],c=this.monomers[e+1],f=b.getP(),l=b.getC4P(),j=c.getP(),c=c.getC4P();0<e&&(a=this.monomers[e-1].getC4P(),a=JU.Measure.computeTorsion(a,f,l,j,!0));f=JU.Measure.computeTorsion(f,
l,j,c,!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,c,f){for(var l=new JU.V3,j=new JU.V3,h=this.monomerCount;0<=--h;){var k=this.monomers[h];if(k.isPurine()){var m=k.getN3(),n=e.get(m.i);if(n||b.get(m.i)){for(var p=k.getN1(),y=k.getN0(),v=JU.Measure.getPlaneThroughPoints(m,p,y,l,j,new JU.P4),m=null,u=25,r=null,t=a.monomerCount;0<=--t;){var x=a.monomers[t];if(x.$isPyrimidine){var s=x.getN3();
if(!(n?!b.get(s.i):!e.get(s.i))){var w=x.getN0(),z=p.distanceSquared(s);z<u&&(50<y.distanceSquared(w)&&1>Math.abs(JU.Measure.distanceToPlane(v,s)))&&(r=x,m=s,u=z)}}}n=0;null!=m&&(n+=JM.NucleicPolymer.addHydrogenBond(c,p,m),n>=f||(k.isGuanine()?(n+=JM.NucleicPolymer.addHydrogenBond(c,k.getN2(),r.getO2()),n>=f||JM.NucleicPolymer.addHydrogenBond(c,k.getO6(),r.getN4())):JM.NucleicPolymer.addHydrogenBond(c,k.getN6(),r.getO4())))}}}},"JM.BioPolymer,JU.BS,JU.BS,JU.Lst,~N,~A,~B,~B");b.addHydrogenBond=c(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});r("JM");H=z(function(){this.g2=this.g1=this.info=null;w(this,arguments)},JM,"BasePair",null);H.add=c(H,"add",function(b,a,e){if(null==a||null==e)return null;var d=new JM.BasePair;d.info=b;(d.g1=a).addBasePair(d);(d.g2=e).addBasePair(d);return d},"java.util.Map,JM.NucleicMonomer,JM.NucleicMonomer");c(H,"getPartnerAtom",function(b){return(b===
this.g1?this.g2:this.g1).getLeadAtom().i},"JM.NucleicMonomer");c(H,"toString",function(){return this.info.toString()});r("JM");t(["JM.BioPolymer"],"JM.PhosphorusPolymer",null,function(){var b=A(JM,"PhosphorusPolymer",JM.BioPolymer);D(b,function(a){K(this,JM.PhosphorusPolymer,[]);this.set(a);this.hasStructure=!0},"~A")});r("J.dssx");t(null,"J.dssx.Bridge",["JU.Escape"],function(){var b=z(function(){this.ladder=this.b=this.a=null;this.isAntiparallel=!1;w(this,arguments)},J.dssx,"Bridge",null);D(b,function(a,
e,b){this.a=a;this.b=e;this.ladder=s(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");c(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");c(b,"addLadder",function(a){a.put(this.ladder,this.isAntiparallel?Boolean.TRUE:Boolean.FALSE)},"java.util.Map");c(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");c(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)})});r("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;w(this,arguments)},J.dssx,"DSSP",null);P(b,function(){this.sheetOffsets=E(-1,[s(-1,[0,-1,1,0,1,0,0,-1]),s(-1,[0,0,0,0,1,-1,1,-1])])});D(b,function(){});c(b,"calculateDssp",function(a,e,b,c,f,l,j){this.bioPolymers=a;this.bioPolymerCount=e;this.vHBonds=b;this.doReport=c;this.dsspIgnoreHydrogens=f;this.setStructure=l;this.isDSSP2=1<
j;a=new JU.BS;for(j=0;j<e;j++)x(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");l&&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=O(e,"\x00");this.done=Array(e);this.bsBad=new JU.BS;var h=!1;for(j=a.nextSetBit(0);0<=j;j=a.nextSetBit(j+1)){l=this.bioPolymers[j];!h&&null!=l.monomers[0].getExplicitNH()&&
(f?b.append(J.i18n.GT.o(J.i18n.GT.$("NOTE: Backbone amide hydrogen positions are present and will be ignored. Their positions will be approximated, as in standard DSSP analysis.\nUse {0} to not use this approximation.\n\n"),"SET dsspCalculateHydrogenAlways FALSE")):b.append(J.i18n.GT.o(J.i18n.GT.$("NOTE: Backbone amide hydrogen positions are present and will be used. Results may differ significantly from standard DSSP analysis.\nUse {0} to ignore these hydrogen positions.\n\n"),"SET dsspCalculateHydrogenAlways TRUE")),
h=!0);l.recalculateLeadMidpointsAndWingVectors();var k=l.monomerCount;this.labels[j]=O(k,"\x00");this.done[j]=new JU.BS;for(var m=0;m<k;m++)null==l.monomers[m].getCarbonylOxygenAtom()&&this.bsBad.set(l.monomers[m].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(c){c=new JU.SB;b.append("\n------------------------------\n");for(j=a.nextSetBit(0);0<=j;j=a.nextSetBit(j+1))null!=this.labels[j]&&(l=this.bioPolymers[j],c.append(this.dumpSummary(l,this.labels[j])),b.append(e[j]).append(this.dumpTags(l,"$.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:"+c)}return b.toString()},
"~A,~N,~O,~B,~B,~B,~N");c(b,"getDualHydrogenBondArray",function(){for(var a=JU.AU.newInt4(this.bioPolymerCount),e=0;e<this.bioPolymerCount;e++)if(x(this.bioPolymers[e],"JM.AminoPolymer")){var b=this.bioPolymers[e].monomerCount;a[e]=s(b,2,3,0);for(var c=0;c<b;++c)a[e][c][0][1]=a[e][c][1][1]=-2147483648,a[e][c][0][2]=a[e][c][1][2]=0}for(e=0;e<this.bioPolymerCount;e++)if(null!=a[e])for(c=0;c<this.bioPolymerCount;c++)null!=a[c]&&this.bioPolymers[e].calcRasmolHydrogenBonds(this.bioPolymers[c],null,null,
null,2,a[e],!1,this.dsspIgnoreHydrogens);return a});c(b,"getBridges",function(a){for(var e=this.bioPolymers[0].model.ms.at,b=null,c=new java.util.Hashtable,f=0;f<a.length;f++)if(x(this.bioPolymers[f],"JM.AminoPolymer"))for(var l=this.bioPolymers[f],j=a[f].length-1,h=1;h<j;h++){var k=l.monomers[h].leadAtomIndex;if(!this.bsBad.get(k))for(var m=f;m<a.length;m++)if(x(this.bioPolymers[m],"JM.AminoPolymer"))for(var n=f==m?h+3:1;n<a[m].length-1;n++){var p=this.bioPolymers[m],r=p.monomers[n].leadAtomIndex;
if(!this.bsBad.get(r)){if(null==(b=this.getBridge(a,f,h,m,n,this.bridgesP,e[k],e[r],l,p,c,!1)))if(null!=(b=this.getBridge(a,f,h,m,n,this.bridgesA,e[k],e[r],l,p,c,!0)))b.isAntiparallel=!0;else continue;JU.Logger.debugging&&JU.Logger.debug("Bridge found "+b);this.done[f].set(h);this.done[m].set(n);this.htBridges.put(k+"-"+r,b)}}}},"~A");c(b,"getBridge",function(a,e,b,c,f,l,j,h,k,m,n,p){var r=null,v=null,u=0,t=p?this.sheetOffsets[1]:this.sheetOffsets[0];return null!=(r=this.isHbonded(b+t[0],f+t[1],e,
c,a))&&null!=(v=this.isHbonded(f+t[2],b+t[3],c,e,a))||null!=(r=this.isHbonded(b+t[u=4],f+t[5],e,c,a))&&null!=(v=this.isHbonded(f+t[6],b+t[7],c,e,a))?(a=new J.dssx.Bridge(j,h,this.htLadders),l.addLast(a),null!=this.vHBonds&&(l=p?14336:6144,this.addHbond(k.monomers[b+t[u]],m.monomers[f+t[++u]],r[2],l,n),this.addHbond(m.monomers[f+t[++u]],k.monomers[b+t[++u]],v[2],l,n)),a):null},"~A,~N,~N,~N,~N,JU.Lst,JM.Atom,JM.Atom,JM.AminoPolymer,JM.AminoPolymer,java.util.Map,~B");c(b,"addHbond",function(a,e,b,c,
f){a=a.getNitrogenAtom();e=e.getCarbonylOxygenAtom();if(null!=f){var l=a.i+" "+e.i;if(f.containsKey(l))return;f.put(l,Boolean.TRUE)}this.vHBonds.addLast(new JM.HBond(a,e,c,1,0,b/1E3))},"JM.Monomer,JM.Monomer,~N,~N,java.util.Map");c(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,c=this.htLadders.keySet().iterator();c.hasNext()&&((b=c.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 c=new JU.BS,f=this.bioPolymers.length;0<=--f;)if(x(this.bioPolymers[f],"JM.AminoPolymer")){b.clearAll();c.clearAll();for(var l=this.bioPolymers[f],j=0;j<l.monomerCount;){var h=l.monomers[j].leadAtomIndex;if(a.get(h)){for(h=j+1;h<l.monomerCount&&a.get(l.monomers[h].leadAtomIndex);)h++;b.setBits(j,h);j=h}else e.get(h)&&c.set(j),++j}this.doReport&&(this.setTag(this.labels[f],
c,"B"),this.setTag(this.labels[f],b,"E"));this.setStructure&&l.setStructureBS(0,3,J.c.STR.SHEET,b,!1);this.done[f].or(b);this.done[f].or(c)}}});c(b,"createLadders",function(a,b){for(var d=b?-1:1,c=a.size(),f=0;f<c;f++)this.checkBridge(a.get(f),b,1,d);for(f=0;f<c;f++)this.checkBulge(a.get(f),b,1)},"JU.Lst,~B");c(b,"checkBridge",function(a,b,d,c){b=this.htBridges.get(a.a.getOffsetResidueAtom("\x00",d)+"-"+a.b.getOffsetResidueAtom("\x00",c));return null!=b&&a.addBridge(b,this.htLadders)},"J.dssx.Bridge,~B,~N,~N");
c(b,"checkBulge",function(a,b,d){for(var c=b?-1:1,f=0;3>f;f++)for(var l=0==f?1:0;6>l;l++)this.checkBridge(a,b,f*d,l*c),l>f&&this.checkBridge(a,b,l*d,f*c)},"J.dssx.Bridge,~B,~N");c(b,"dumpSummary",function(a,b){for(var d=a.monomers[0].getLeadAtom(),d=0==d.getChainID()?"":d.getChainIDStr()+":",c=new JU.SB,f="\x00",l="\x00",j="\x00",h=-1,k=-1,m=a.monomerCount,n=a.monomers,p=0;p<=m;p++){if(p==m||b[p]!=f){"\x00"!=f&&c.appendC("\n").appendC(f).append(" : ").append(d).appendI(h).append("\x00"==l?"":String.valueOf(l)).append("_").append(d).appendI(k).append("\x00"==
j?"":String.valueOf(j));if(p==m)break;f=b[p];h=n[p].getResno();l=n[p].getInsertionCode()}k=n[p].getResno();j=n[p].getInsertionCode()}return c.toString()},"JM.AminoPolymer,~A");c(b,"dumpTags",function(a,b,d,c){var f=a.monomers[0].getLeadAtom().getChainID()+"."+(a.bioPolymerIndexInModel+1);b=JU.PT.rep(b,"$",f);for(var l=a.monomers[0].getResno(),j="\n"+f,f=new JU.SB,h=(new JU.SB).append(j+".8: "),k=(new JU.SB).append(j+".7: "),m=(new JU.SB).append(j+".6: "),j=(new JU.SB).append(j+".0: "),n=a.monomerCount,
p=0;p<n;p++)l=a.monomers[p].getResno(),h.append(0==l%100?""+F(l/100)%100:" "),k.append(0==l%10?""+F(l/10)%10:" "),m.appendI(l%10),j.appendC(d.get(a.monomers[p].leadAtomIndex)?"!":a.monomers[p].getGroup1());1==(c&1)&&f.appendSB(h).appendSB(k).appendSB(m);f.append("\n");f.append(b);2==(c&2)&&(f.appendSB(j),f.append("\n\n"));return f.toString().$replace("\x00",".")},"JM.AminoPolymer,~S,JU.BS,~N");c(b,"isHbonded",function(a,b,d,c,f){if(0>a||0>b)return null;d=f[d];f=f[c];return a>=d.length||b>=f.length?
null:d[a][0][0]==c&&d[a][0][1]==b?d[a][0]:d[a][1][0]==c&&d[a][1][1]==b?d[a][1]:null},"~N,~N,~N,~N,~A");c(b,"findHelixes",function(a,b){var d=this.bioPolymers[a];if(JU.Logger.debugging)for(var c=0;c<d.monomerCount;c++)JU.Logger.debug(a+"."+d.monomers[c].getResno()+"\t"+JU.Escape.e(b[c]));var c=new JU.BS,f,l,j;this.isDSSP2?(j=this.findHelixes2(0,a,5,b,J.c.STR.HELIXPI,12288,c,!0),l=this.findHelixes2(2,a,4,b,J.c.STR.HELIXALPHA,10240,c,!1),f=this.findHelixes2(4,a,3,b,J.c.STR.HELIX310,8192,c,!1)):(l=this.findHelixes2(2,
a,4,b,J.c.STR.HELIXALPHA,10240,c,!0),f=this.findHelixes2(4,a,3,b,J.c.STR.HELIX310,8192,c,!1),j=this.findHelixes2(0,a,5,b,J.c.STR.HELIXPI,12288,c,!1));this.setStructure&&d.setStructureBS(0,6,J.c.STR.TURN,c,!1);return this.doReport?(this.setTag(this.labels[a],c,"T"),this.dumpTags(d,"$.5: "+j+"\n$.4: "+l+"\n$.3: "+f,this.bsBad,1)):""},"~N,~A");c(b,"findHelixes2",function(a,b,d,c,f,l,j,h){for(var k=this.bioPolymers[b],m=new JU.BS,n=new JU.BS,p=new JU.BS,r=new JU.BS,v=new JU.BS,u=this.done[b],t="",x=k.monomerCount,
s=d;s<x;++s){var w=s-d,z=0;if(c[s][0][0]==b&&c[s][0][1]==w||c[s][z=1][0]==b&&c[s][1][1]==w){var A=k.monomers[w].leadAtomIndex,B=this.bsBad.nextSetBit(A),D=k.monomers[s];if(!(B>=A&&B<=D.leadAtomIndex)){m.set(w);n.setBits(w+1,s);r.set(s);var B=u.nextSetBit(w),A=0>B||B>=s,E=!1;if(0<w&&m.get(w-1)&&(h||A))v.setBits(w,s),A||(t+="  WARNING! Bridge to helix at "+k.monomers[B]),E=!0;else if(A||u.nextClearBit(B)<s)E=!0;r.get(w)&&p.set(w);E&&null!=this.vHBonds&&this.addHbond(D,k.monomers[w],c[s][z][2],l,null)}}}this.doReport?
(c=O(x,"\x00"),this.setTag(c,n,String.fromCharCode(48+d)),this.setTag(c,m,">"),this.setTag(c,r,"<"),this.setTag(c,p,"X")):c=null;u.or(v);n.andNot(u);j.or(n);j.andNot(v);this.setStructure&&k.setStructureBS(0,a,f,v,!1);return this.doReport?(this.setTag(this.labels[b],v,String.fromCharCode(68+d)),String.valueOf(c)+t):""},"~N,~N,~N,~A,J.c.STR,~N,JU.BS,~B");c(b,"setTag",function(a,b,d){for(var c=b.nextSetBit(0);0<=c;c=b.nextSetBit(c+1))a[c]=d},"~A,JU.BS,~S")});r("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;w(this,arguments)},J.shapebio,"BioShape",J.shape.AtomShape);D(b,function(a,b,d){K(this,J.shapebio.BioShape,[]);this.shape=a;this.modelIndex=b;this.bioPolymer=
d;this.isActive=a.isActive;this.bsSizeDefault=new JU.BS;this.monomerCount=d.monomerCount;0<this.monomerCount&&(this.colixes=Q(this.monomerCount,0),this.paletteIDs=G(this.monomerCount,0),this.mads=Q(this.monomerCount+1,0),this.monomers=d.monomers,this.meshReady=T(this.monomerCount,!1),this.meshes=Array(this.monomerCount),this.wingVectors=d.getWingVectors(),this.leadAtomIndices=d.getLeadAtomIndices())},"J.shapebio.BioShapeCollection,~N,JM.BioPolymer");h(b,"setProperty",function(a,b,d){this.setPropAS(a,
b,d)},"~S,~O,JU.BS");c(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});c(b,"calcMeanPositionalDisplacement",function(a){return U(1E3*Math.sqrt(a/7895.6835208714865))},"~N");h(b,"findNearestAtomIndex",
function(a,b,d,c){this.bioPolymer.findNearestAtomIndex(a,b,d,this.mads,this.shape.vf,c)},"~N,~N,~A,JU.BS");c(b,"setMad",function(a,b,d){if(!(2>this.monomerCount)){this.isActive=!0;null==this.bsSizeSet&&(this.bsSizeSet=new JU.BS);for(var c=this.shape.vf,f=32768==c&&x(this.bioPolymer,"JM.NucleicPolymer"),l=this.monomerCount;0<=--l;){var j=this.leadAtomIndices[l];if(b.get(j)){if(null!=d&&j<d.length){if(Float.isNaN(d[j]))continue;a=R(2E3*d[j])}var h=0<(this.mads[l]=this.getMad(l,a));this.bsSizeSet.setBitTo(l,
h);this.monomers[l].setShapeVisibility(c,h);this.shape.atoms[j].setShapeVisibility(c,h);f&&this.monomers[l].setRingsVisible(h);this.falsifyNearbyMesh(l)}}1<this.monomerCount&&(this.mads[this.monomerCount]=this.mads[this.monomerCount-1])}},"~N,JU.BS,~A");c(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 d=this.monomers[a].getLeadAtom(),d=d.getBfactor100()-this.bfactorMin;if(0==this.range)return 0;d/=this.floatRange;(0>d||1<d)&&JU.Logger.error("Que ha ocurrido? "+d);return R(1750*d+250);case -4:return d=this.monomers[a].getLeadAtom(),2*this.calcMeanPositionalDisplacement(d.getBfactor100())}JU.Logger.error("unrecognized setMad("+b+")");return 0},
"~N,~N");c(b,"falsifyMesh",function(){if(null!=this.meshReady)for(var a=0;a<this.monomerCount;a++)this.meshReady[a]=!1});c(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");c(b,"setColixBS",function(a,b,d){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=JU.BS.newN(this.monomerCount));for(var c=this.monomerCount;0<=--c;){var f=this.leadAtomIndices[c];d.get(f)&&(this.colixes[c]=
this.shape.getColixI(a,b,f),null!=this.colixesBack&&this.colixesBack.length>c&&(this.colixesBack[c]=0),this.paletteIDs[c]=b,this.bsColixSet.setBitTo(c,0!=this.colixes[c]))}},"~N,~N,JU.BS");c(b,"setColixBack",function(a,b){null==this.colixesBack&&(this.colixesBack=Q(this.colixes.length,0));this.colixesBack.length<this.colixes.length&&(this.colixesBack=JU.AU.ensureLengthShort(this.colixesBack,this.colixes.length));for(var d=this.monomerCount;0<=--d;)b.get(this.leadAtomIndices[d])&&(this.colixesBack[d]=
a)},"~N,JU.BS");c(b,"setColixes",function(a,b){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=JU.BS.newN(this.monomerCount));for(var d=this.monomerCount;0<=--d;){var c=this.leadAtomIndices[d];b.get(c)&&(d<this.colixes.length&&c<a.length)&&(this.colixes[d]=this.shape.getColixI(a[c],J.c.PAL.UNKNOWN.id,c),null!=this.colixesBack&&d<this.colixesBack.length&&(this.colixesBack[d]=0),this.paletteIDs[d]=J.c.PAL.UNKNOWN.id,this.bsColixSet.set(d))}},"~A,JU.BS");c(b,"setParams",function(a,b,d){if(0!=
this.monomerCount){var c=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(d.get(j)&&h<this.colixes.length&&j<f){var q=b[j],k=null==c?0:c[q],q=null==a?0:a[q];0.01<q&&(k=JU.C.getColixTranslucent3(k,!0,q));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");c(b,"setTranslucent",function(a,b,d){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=JU.BS.newN(this.monomerCount));for(var c=this.monomerCount;0<=--c;)b.get(this.leadAtomIndices[c])&&(this.colixes[c]=JU.C.getColixTranslucent3(this.colixes[c],a,d),null!=this.colixesBack&&this.colixesBack.length>c&&(this.colixesBack[c]=JU.C.getColixTranslucent3(this.colixesBack[c],a,d)),this.bsColixSet.setBitTo(c,0!=this.colixes[c]))},"~B,JU.BS,~N");h(b,"setAtomClickability",
function(){if(this.isActive&&!(null==this.wingVectors||0==this.monomerCount))for(var a=x(this.bioPolymer,"JM.NucleicPolymer")&&11==this.shape.shapeID,b=x(this.bioPolymer,"JM.AlphaPolymer")||15!=this.shape.shapeID,d=this.monomers[0].chain.model.ms,c=this.monomerCount;0<=--c;)if(!(0>=this.mads[c])){var f=this.leadAtomIndices[c];d.isAtomHidden(f)||(b&&d.at[f].setClickable(1040384),a&&this.monomers[c].setRingsClickable())}});c(b,"getBioShapeState",function(a,b,d,c){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(d,h,j,a+(this.bsSizeSet.get(f)?" on":" off")):JU.BSUtil.setMapBitSet(d,h,j,a+" "+JU.PT.escF(this.mads[f]/2E3));if(null!=this.bsColixSet&&this.bsColixSet.get(f)){var q=J.shape.Shape.getColorCommand(a,this.paletteIDs[f],
this.colixes[f],b);null!=this.colixesBack&&(this.colixesBack.length>f&&0!=this.colixesBack[f])&&(q+=" "+JU.C.getHexCode(this.colixesBack[f]));JU.BSUtil.setMapBitSet(c,h,j,q)}}},"~S,~B,java.util.Map,java.util.Map");h(b,"getShapeState",function(){return null})});r("J.shapebio");t(["J.shape.Shape"],"J.shapebio.BioShapeCollection","java.util.Hashtable JU.AU J.c.PAL J.shapebio.BioShape JU.BSUtil $.C JV.JC".split(" "),function(){var b=z(function(){this.atoms=null;this.madOn=-2;this.madHelixSheet=3E3;this.madTurnRandom=
800;this.madDnaRna=5E3;this.isActive=!1;this.bioShapes=null;w(this,arguments)},J.shapebio,"BioShapeCollection",J.shape.Shape);h(b,"initModelSet",function(){this.isBioShape=!0;this.atoms=this.ms.at;this.initialize()});h(b,"initShape",function(){});h(b,"getSizeG",function(a){var b=a.groupIndex;a=a.getLeadAtom().i;for(var d=this.bioShapes.length;0<=--d;)for(var c=this.bioShapes[d],f=0;f<c.monomerCount;f++)if(c.monomers[f].groupIndex==b&&c.monomers[f].getLeadAtom().i==a)return c.mads[f];return 0},"JM.Group");
h(b,"replaceGroup",function(a,b){for(var d=this.bioShapes.length;0<=--d;)for(var c=this.bioShapes[d],f=0;f<c.monomerCount;f++)if(c.monomers[f]===a){c.monomers[f]=b;break}},"JM.Group,JM.Group");h(b,"setShapeSizeRD",function(a,b,d){this.initialize();for(var c=this.bioShapes.length;0<=--c;){var f=this.bioShapes[c];0<f.monomerCount&&f.setMad(a,d,null==b?null:b.values)}},"~N,J.atomdata.RadiusData,JU.BS");h(b,"setProperty",function(a,b,d){this.setPropBSC(a,b,d)},"~S,~O,JU.BS");c(b,"setPropBSC",function(a,
b,d){if("refreshTrajectories"===a){d=b[0].intValue();for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],b.modelIndex==d&&b.falsifyMesh()}else if("deleteModelAtoms"===a){this.atoms=b[1];d=b[2][0];for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],b.modelIndex>d?(b.modelIndex--,b.leadAtomIndices=b.bioPolymer.getLeadAtomIndices()):b.modelIndex==d&&(this.bioShapes=JU.AU.deleteElements(this.bioShapes,a,1))}else if(this.initialize(),"color"===a){var c=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,c,d)}else if("params"===a){a=d.length();c=s(a,0);f=0;for(a=d.nextSetBit(0);0<=a;a=d.nextSetBit(a+1),f++)c[a]=f;for(a=this.bioShapes.length;0<=--a;)this.bioShapes[a].setParams(b,c,d)}else if("colorPhase"===a){c=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,d),b.setColixBack(c,d))}else if("translucency"===a){c="translucent".equals(b);
for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],0<b.monomerCount&&b.setTranslucent(c,d,this.translucentLevel)}else this.setPropS(a,b,d)},"~S,~O,JU.BS");h(b,"getShapeState",function(){for(var a=new java.util.Hashtable,b=new java.util.Hashtable,d=JV.JC.shapeClassBases[this.shapeID],c=this.bioShapes.length;0<=--c;)this.bioShapes[c].getBioShapeState(d,this.translucentAllowed,a,b);return"\n"+this.vwr.getCommands(a,b,9==this.shapeID?"Backbone":"select")});c(b,"initialize",function(){for(var a=this.ms.mc,
b=this.ms.am,d=this.ms.getBioPolymerCountInModel(-1),c=Array(d--);0<=--a;)for(var f=this.ms.getBioPolymerCountInModel(a);0<=--f;d--){var h=b[a].bioPolymers[f];c[d]=null==this.bioShapes||this.bioShapes.length<=d||null==this.bioShapes[d]||this.bioShapes[d].bioPolymer!==h?new J.shapebio.BioShape(this,a,h):this.bioShapes[d]}this.bioShapes=c});h(b,"findNearestAtomIndex",function(a,b,d,c){for(var f=this.bioShapes.length;0<=--f;)this.bioShapes[f].findNearestAtomIndex(a,b,d,c)},"~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 d=this.bioShapes[b];d.modelVisibilityFlags=a.get(d.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()});c(b,"getMpsShapeCount",function(){return this.bioShapes.length});c(b,"getBioShape",function(a){return this.bioShapes[a]},
"~N")});r("J.shapebio");t(["J.shapebio.BioShapeCollection"],"J.shapebio.Rockets",null,function(){var b=A(J.shapebio,"Rockets",J.shapebio.BioShapeCollection);h(b,"initShape",function(){this.madTurnRandom=500})});r("J.shapebio");t(["J.shapebio.Rockets"],"J.shapebio.Cartoon",null,function(){var b=A(J.shapebio,"Cartoon",J.shapebio.Rockets);c(b,"initShape",function(){S(this,J.shapebio.Cartoon,"initShape",[]);this.madDnaRna=1E3})});r("J.shapebio");t(["J.shapebio.BioShapeCollection"],"J.shapebio.Backbone",
["JU.BS"],function(){var b=z(function(){this.bsSelected=null;w(this,arguments)},J.shapebio,"Backbone",J.shapebio.BioShapeCollection);h(b,"initShape",function(){this.madOn=1;this.madHelixSheet=1500;this.madTurnRandom=500;this.madDnaRna=2E3;this.isActive=!0});h(b,"setProperty",function(a,b,d){"bitset"===a?this.bsSelected=b:this.setPropBSC(a,b,d)},"~S,~O,JU.BS");h(b,"setShapeSizeRD",function(a,b,d){this.initialize();var c=null!=this.bsSelected;c&&(d=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),q=h.bioPolymer.getLeadAtomIndices(),k=0!=a;null==h.bsSizeSet&&(h.bsSizeSet=new JU.BS);h.isActive=!0;for(var m=h.monomerCount,n=m-(h.bioPolymer.isCyclic()?0:1);0<=--n;){var p=q[n],r=q[(n+1)%m],t=d.get(p),u=d.get(r);if(t&&u||c&&t||j&&(t||u)){h.monomers[n].setShapeVisibility(this.vf,k);t=this.ms.at[p];if(null!=b){if(Float.isNaN(b.values[p])||Float.isNaN(b.values[r]))continue;a=R(1E3*(b.values[p]+b.values[r]));k=
0!=a}p=this.ms.at[r];0!=h.mads[n]!=k&&(this.addDisplayedBackbone(t,k),this.addDisplayedBackbone(p,k));h.mads[n]=a;h.bsSizeSet.setBitTo(n,k);h.bsSizeDefault.setBitTo(n,-1==a)}}}}c&&(this.bsSelected=null)},"~N,J.atomdata.RadiusData,JU.BS");c(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],d=b.bioPolymer.getLeadAtomIndices(),
b=b.monomerCount;0<=--b;){var c=this.ms.at[d[b]];0<c.nBackbonesDisplayed&&!this.ms.isAtomHidden(c.i)&&c.setClickable(this.vf)}})});r("J.shapebio");t(["J.shapebio.BioShapeCollection"],"J.shapebio.Strands",null,function(){z(function(){this.isMesh=!1;w(this,arguments)},J.shapebio,"Strands",J.shapebio.BioShapeCollection)});r("J.shapebio");t(["J.shapebio.BioShapeCollection"],"J.shapebio.Ribbons",null,function(){A(J.shapebio,"Ribbons",J.shapebio.BioShapeCollection)});r("J.shapebio");t(["J.shapebio.Strands"],
"J.shapebio.MeshRibbon",null,function(){var b=A(J.shapebio,"MeshRibbon",J.shapebio.Strands);h(b,"initShape",function(){this.isMesh=!0})});r("J.shapebio");t(["J.shapebio.BioShapeCollection"],"J.shapebio.Trace",["J.atomdata.RadiusData","J.c.VDW"],function(){var b=A(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,d){"putty"===a?this.setPutty(b,d):this.setPropBSC(a,
b,d)},"~S,~O,JU.BS");c(b,"setPutty",function(a,b){var d=b.cardinality();if(0!=d){for(var c=I(b.length(),0),f=0,h=0,j=3.4028235E38,q=0,k=b.nextSetBit(0);0<=k;k=b.nextSetBit(k+1)){var m=this.atoms[k].atomPropertyFloat(null,1111492620,null),f=f+m,h=h+m*m;m<j&&(j=m);m>q&&(q=m)}var m=f/d,d=Math.sqrt((h-f*f/d)/d),f=a[1],h=a[2],n=a[3],p=a[4],r=a[5],t=B(a[6]),q=q-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 s=this.atoms[k].atomPropertyFloat(null,1111492620,
null);switch(t){case 0:case 4:s=1+(s-m)/h/d;break;case 1:case 5:s=(s-j)/q/h;break;case 2:case 6:s/=h;break;case 8:0>s&&(s=0),s=Math.sqrt(s/8)/3.141592653589793}0>s&&(s=0);u&&(s=Math.pow(s,r));s<n&&0<=n&&(s=n);s>p&&0<=p&&(s=p);c[k]=s*f}c=new J.atomdata.RadiusData(c,0,J.atomdata.RadiusData.EnumType.ABSOLUTE,J.c.VDW.AUTO);this.setShapeSizeRD(0,c,b)}},"~A,JU.BS")});r("J.renderbio");t(["J.render.ShapeRenderer","JU.BS","$.P3"],"J.renderbio.BioShapeRenderer",["javajs.api.Interface","J.c.STR","JU.C"],function(){var b=
z(function(){this.haveControlPointScreens=this.ribbonBorder=this.isTraceAlpha=this.invalidateSheets=this.invalidateMesh=!1;this.sheetSmoothing=this.hermiteLevel=this.aspectRatio=0;this.cartoonsFancy=!1;this.monomerCount=0;this.monomers=null;this.isCarbohydrate=this.isPhosphorusOnly=this.isNucleic=!1;this.structureTypes=this.colixesBack=this.colixes=this.mads=this.wingVectors=this.leadAtomIndices=this.controlPointScreens=this.controlPoints=this.ribbonBottomScreens=this.ribbonTopScreens=this.bsVisible=
null;this.needTranslucent=this.wireframeOnly=this.isHighRes=!1;this.pointT=this.bioShape=this.meshRenderer=null;this.colixBack=this.madEnd=this.madMid=this.madBeg=this.diameterEnd=this.diameterMid=this.diameterBeg=this.iNext3=this.iNext2=this.iNext=this.iPrev=0;this.reversed=null;this.isCyclic=!1;this.screenArrowBotPrev=this.screenArrowBot=this.screenArrowTopPrev=this.screenArrowTop=null;w(this,arguments)},J.renderbio,"BioShapeRenderer",J.render.ShapeRenderer);P(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});c(b,"setGlobals",function(){this.needTranslucent=this.invalidateMesh=!1;this.g3d.addRenderer(553648143);var a=!this.isExport&&!this.vwr.checkMotionRendering(1112152066);a!=this.wireframeOnly&&(this.invalidateMesh=!0);this.wireframeOnly=
a;a=this.isExport||!this.wireframeOnly&&this.vwr.getBoolean(603979864);a!=this.isHighRes&&(this.invalidateMesh=!0);this.isHighRes=a;a=!this.wireframeOnly&&(this.vwr.getBoolean(603979816)||this.isExport);this.cartoonsFancy!=a&&(this.invalidateMesh=!0,this.cartoonsFancy=a);a=this.vwr.getHermiteLevel();a=0>=a?-a:this.vwr.getInMotion(!0)?0:a;this.cartoonsFancy&&!this.wireframeOnly&&(a=Math.max(a,3));a!=this.hermiteLevel&&(this.invalidateMesh=!0);this.hermiteLevel=Math.min(a,8);var b=this.vwr.getInt(553648166),
b=Math.min(Math.max(0,b),20);this.cartoonsFancy&&16<=b&&(b=4);if(this.wireframeOnly||0==this.hermiteLevel)b=0;b!=this.aspectRatio&&(0!=b&&0!=a)&&(this.invalidateMesh=!0);this.aspectRatio=b;0<this.aspectRatio&&(null==this.meshRenderer&&(this.meshRenderer=javajs.api.Interface.getInterface("J.renderbio.BioMeshRenderer"),this.meshRenderer.setViewerG3dShapeID(this.vwr,this.shape.shapeID)),this.meshRenderer.setup(this.g3d,this.ms,this.shape));a=this.vwr.getBoolean(603979966);a!=this.isTraceAlpha&&(this.invalidateMesh=
!0);this.isTraceAlpha=a;this.invalidateSheets=!1;a=this.vwr.getFloat(570425392);a!=this.sheetSmoothing&&this.isTraceAlpha&&(this.sheetSmoothing=a,this.invalidateSheets=this.invalidateMesh=!0)});c(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())});c(b,"setBioColix",function(a){if(this.g3d.setC(a))return!0;this.needTranslucent=!0;return!1},"~N");c(b,"freeTempArrays",function(){this.haveControlPointScreens&&this.vwr.freeTempPoints(this.controlPointScreens);this.vwr.freeTempEnum(this.structureTypes)});c(b,"initializePolymer",function(a){var b=this.vwr.slm.bsDeleted;this.controlPoints=this.ms.isJmolDataFrameForModel(a.modelIndex)?
a.bioPolymer.getControlPoints(!0,0,!1):a.bioPolymer.getControlPoints(this.isTraceAlpha,this.sheetSmoothing,this.invalidateSheets);this.monomerCount=a.monomerCount;this.monomers=a.monomers;this.reversed=a.bioPolymer.reversed;this.leadAtomIndices=a.bioPolymer.getLeadAtomIndices();this.bsVisible.clearAll();var d=!1;this.invalidateMesh&&a.falsifyMesh();for(var c=this.monomerCount;0<=--c;)if(!(0==(this.monomers[c].shapeVisibilityFlags&this.myVisibilityFlag)||this.ms.isAtomHidden(this.leadAtomIndices[c])||
null!=b&&b.get(this.leadAtomIndices[c]))){var f=this.ms.at[this.leadAtomIndices[c]];this.g3d.isInDisplayRange(f.sX,f.sY)&&(this.bsVisible.set(c),d=!0)}if(!d)return!1;this.ribbonBorder=this.vwr.getBoolean(603979901);this.isNucleic=x(a.bioPolymer,"JM.NucleicPolymer");this.isPhosphorusOnly=!this.isNucleic&&x(a.bioPolymer,"JM.PhosphorusPolymer");this.isCarbohydrate=x(a.bioPolymer,"JM.CarbohydratePolymer");this.haveControlPointScreens=!1;this.wingVectors=a.wingVectors;null!=this.meshRenderer&&this.meshRenderer.initialize(this,
a,this.monomerCount);this.mads=a.mads;this.colixes=a.colixes;this.colixesBack=a.colixesBack;this.setStructureTypes();return!0},"J.shapebio.BioShape");c(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]});c(b,"calcScreenControlPoints",function(){for(var a=this.monomerCount+1,b=this.controlPointScreens=
this.vwr.allocTempPoints(a),d=this.controlPoints;0<=--a;)this.tm.transformPtScrT3(d[a],b[a]);this.haveControlPointScreens=!0});c(b,"calcScreens",function(a,b){var d=this.controlPoints.length,c=this.vwr.allocTempPoints(d);if(0==a)for(;0<=--d;)this.tm.transformPtScrT3(this.controlPoints[d],c[d]);else for(var f=a/1E3;0<=--d;)this.calc1Screen(this.controlPoints[d],this.wingVectors[d],0==b[d]&&0<d?b[d-1]:b[d],f,c[d]);return c},"~N,~A");c(b,"calc1Screen",function(a,b,d,c,f){this.pointT.scaleAdd2(d*c,b,
a);this.tm.transformPtScrT3(this.pointT,f)},"JU.P3,JU.V3,~N,~N,JU.P3");c(b,"getLeadColix",function(a){return JU.C.getColixInherited(this.colixes[a],this.monomers[a].getLeadAtom().colixAtom)},"~N");c(b,"getLeadColixBack",function(a){return null==this.colixesBack||this.colixesBack.length<=a?0:this.colixesBack[a]},"~N");c(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");c(b,"setColix",function(a){this.colix=a;return this.g3d.setC(a)},"~N");c(b,"setMads",function(a,b){this.madMid=this.madBeg=this.madEnd=this.mads[a];if(this.isTraceAlpha){if(!b||this.structureTypes[a]===this.structureTypes[this.iNext])this.madEnd=this.mads[this.iNext],0==this.madEnd&&(x(this,"J.renderbio.TraceRenderer"),
this.madEnd=this.madBeg),this.madMid=this.madBeg+this.madEnd>>1}else{if(!b||this.structureTypes[a]===this.structureTypes[this.iPrev])this.madBeg=(0==this.mads[this.iPrev]?this.madMid:this.mads[this.iPrev])+this.madMid>>1;if(!b||this.structureTypes[a]===this.structureTypes[this.iNext])this.madEnd=(0==this.mads[this.iNext]?this.madMid:this.mads[this.iNext])+this.madMid>>1}this.diameterBeg=B(this.vwr.tm.scaleToScreen(B(this.controlPointScreens[a].z),this.madBeg));this.diameterMid=B(this.vwr.tm.scaleToScreen(this.monomers[a].getLeadAtom().sZ,
this.madMid));this.diameterEnd=B(this.vwr.tm.scaleToScreen(B(this.controlPointScreens[this.iNext].z),this.madEnd));var d=a==this.iPrev||!this.bsVisible.get(this.iPrev)||b&&this.structureTypes[a]!==this.structureTypes[this.iPrev],c=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(d,c)},"~N,~B");c(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");c(b,"renderHermiteConic",function(a,b,d){this.setNeighbors(a);this.colix=this.getLeadColix(a);this.setBioColix(this.colix)&&(this.setMads(a,b)||this.isExport?this.meshRenderer.setFancyConic(a,d):0==this.diameterBeg&&0==this.diameterEnd||this.wireframeOnly?this.g3d.drawLineAB(this.controlPointScreens[a],this.controlPointScreens[this.iNext]):
this.g3d.fillHermite(this.isNucleic?4:7,this.diameterBeg,this.diameterMid,this.diameterEnd,this.controlPointScreens[this.iPrev],this.controlPointScreens[a],this.controlPointScreens[this.iNext],this.controlPointScreens[this.iNext2]))},"~N,~B,~N");c(b,"renderHermiteRibbon",function(a,b,d){this.setNeighbors(b);var c=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,d)||this.isExport){this.meshRenderer.setFancyRibbon(b);
return}if((d=this.reversed.get(b))&&0!=this.colixBack)this.setColix(this.colixBack),f=c;this.g3d.drawHermite7(a,this.ribbonBorder,(d?-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],B(this.aspectRatio),f);d&&0!=this.colixBack&&this.setColix(c)}},"~B,~N,~B");
c(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],B(this.aspectRatio),this.colixBack);this.g3d.setC(this.colix);this.ribbonBorder&&0==this.aspectRatio&&this.g3d.fillCylinderBits(3,3,this.screenArrowTop,this.screenArrowBot)}},
"~N");c(b,"drawSegmentAB",function(a,b,d,c,f){var h=a.sX,j=a.sY;a=a.sZ;var q=b.sX,k=b.sY;b=b.sZ;var m=this.mad;1E3==f&&(m>>=1);0>m?this.g3d.drawLine(d,c,h,j,a,q,k,b):(f=B(this.isExport?m:this.vwr.tm.scaleToScreen(F((a+b)/2),m)),this.g3d.fillCylinderXYZ(d,c,3,f,h,j,a,q,k,b))},"JM.Atom,JM.Atom,~N,~N,~N")});r("J.renderbio");t(["J.renderbio.BioShapeRenderer"],"J.renderbio.StrandsRenderer",null,function(){var b=z(function(){this.strandCount=1;this.baseStrandOffset=this.strandSeparation=0;w(this,arguments)},
J.renderbio,"StrandsRenderer",J.renderbio.BioShapeRenderer);h(b,"renderBioShape",function(){this.renderStrandShape()},"J.shapebio.BioShape");c(b,"renderStrandShape",function(){this.setStrandCount()&&this.renderStrands()});c(b,"setStrandCount",function(){if(null==this.wingVectors)return!1;this.strandCount=x(this.shape,"J.shapebio.Strands")?this.vwr.getStrandCount(this.shape.shapeID):10;this.strandSeparation=1>=this.strandCount?0:1/(this.strandCount-1);this.baseStrandOffset=0==(this.strandCount&1)?
this.strandSeparation/2:this.strandSeparation;return!0});c(b,"renderStrands",function(){for(var a,b=this.strandCount>>1;0<=--b;){var d=b*this.strandSeparation+this.baseStrandOffset;a=this.calcScreens(d,this.mads);this.renderStrand(a);this.vwr.freeTempPoints(a);a=this.calcScreens(-d,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))});c(b,"renderStrand",function(a){for(var b=this.bsVisible.nextSetBit(0);0<=
b;b=this.bsVisible.nextSetBit(b+1))this.renderHermiteCylinder(a,b)},"~A")});r("J.renderbio");t(["J.renderbio.MeshRibbonRenderer"],"J.renderbio.RibbonsRenderer",null,function(){var b=A(J.renderbio,"RibbonsRenderer",J.renderbio.MeshRibbonRenderer);h(b,"renderBioShape",function(){null!=this.wingVectors&&(this.wireframeOnly?this.renderStrands():this.render2Strand(!0,this.isNucleic?1:0.5,this.isNucleic?0:0.5))},"J.shapebio.BioShape")});r("J.renderbio");t(["J.renderbio.StrandsRenderer"],"J.renderbio.MeshRibbonRenderer",
null,function(){var b=A(J.renderbio,"MeshRibbonRenderer",J.renderbio.StrandsRenderer);h(b,"renderBioShape",function(){this.wireframeOnly?this.renderStrands():this.renderMeshRibbon()},"J.shapebio.BioShape");c(b,"renderMeshRibbon",function(){if(this.setStrandCount()){var a=(this.strandCount>>1)*this.strandSeparation+this.baseStrandOffset;this.render2Strand(!1,a,a);this.renderStrands()}});c(b,"render2Strand",function(a,b,d){this.calcScreenControlPoints();this.ribbonTopScreens=this.calcScreens(b,this.mads);
this.ribbonBottomScreens=this.calcScreens(-d,this.mads);for(b=this.bsVisible.nextSetBit(0);0<=b;b=this.bsVisible.nextSetBit(b+1))this.renderHermiteRibbon(a,b,!1);this.vwr.freeTempPoints(this.ribbonTopScreens);this.vwr.freeTempPoints(this.ribbonBottomScreens)},"~B,~N,~N")});r("J.renderbio");t(["J.renderbio.StrandsRenderer"],"J.renderbio.RocketsRenderer",["javajs.api.Interface","JU.P3","J.c.STR"],function(){var b=z(function(){this.isRockets=!1;this.helixRockets=!0;this.renderArrowHeads=!1;this.rr=this.cordMidPoints=
null;w(this,arguments)},J.renderbio,"RocketsRenderer",J.renderbio.StrandsRenderer);h(b,"renderBioShape",function(a){this.setupRR(a,!0)&&(this.calcRopeMidPoints(),this.renderRockets(),this.vwr.freeTempPoints(this.cordMidPoints))},"J.shapebio.BioShape");c(b,"renderRockets",function(){null==this.rr&&(this.rr=javajs.api.Interface.getInterface("J.renderbio.RocketRenderer").set(this));this.rr.renderRockets()});c(b,"setupRR",function(a,b){this.isRockets=b;if(this.wireframeOnly)this.renderStrands();else if(null!=
this.wingVectors&&!this.isCarbohydrate&&(!b||!this.isNucleic)){var d=!this.vwr.getBoolean(603979902);!this.isNucleic&&this.renderArrowHeads!=d&&(a.falsifyMesh(),this.renderArrowHeads=d);return!0}return!1},"J.shapebio.BioShape,~B");c(b,"calcRopeMidPoints",function(){this.cordMidPoints=this.vwr.allocTempPoints(this.monomerCount+1);for(var a=null,b,d=-10,c=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?(c.add(f),d=h):(a=j,c.setT(j.getAxisStartPoint()),f.sub2(j.getAxisEndPoint(),c),f.scale(1/(j.nRes-1)),d==h-3&&this.cordMidPoints[h-1].ave(this.cordMidPoints[h-2],c));b.setT(c)}else d==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()})});r("J.renderbio");
t(["J.renderbio.RocketsRenderer"],"J.renderbio.CartoonRenderer",["J.api.Interface","J.c.STR"],function(){var b=z(function(){this.nucleicRenderer=null;w(this,arguments)},J.renderbio,"CartoonRenderer",J.renderbio.RocketsRenderer);h(b,"renderBioShape",function(a){if(this.setupRR(a,!1))if(this.isNucleic||this.isPhosphorusOnly)null==this.nucleicRenderer&&(this.nucleicRenderer=J.api.Interface.getInterface("J.renderbio.NucleicRenderer",this.vwr,"render")),this.calcScreenControlPoints(),this.nucleicRenderer.renderNucleic(this);
else{var b=this.vwr.getBoolean(603979819);this.helixRockets!=b&&(a.falsifyMesh(),this.helixRockets=b);this.ribbonTopScreens=this.calcScreens(0.5,this.mads);this.ribbonBottomScreens=this.calcScreens(-0.5,this.mads);this.calcRopeMidPoints();this.renderProtein();this.vwr.freeTempPoints(this.cordMidPoints);this.vwr.freeTempPoints(this.ribbonTopScreens);this.vwr.freeTempPoints(this.ribbonBottomScreens)}},"J.shapebio.BioShape");c(b,"renderProtein",function(){for(var a=!1,b=!1,c=null,g,f=this.helixRockets||
!this.renderArrowHeads,h=!1,j=this.monomerCount;0<=--j;){g=this.monomers[j].getStructure();g!==c&&(a=!1);c=g;g=this.structureTypes[j]===J.c.STR.HELIX;var q=this.structureTypes[j]===J.c.STR.SHEET;this.bsVisible.get(j)&&(g&&f?h=!0:q||g?a&&q||b&&g?this.renderHermiteRibbon(!0,j,!0):this.renderHermiteArrowHead(j):this.renderHermiteConic(j,!0,7));a=q;b=g&&!this.helixRockets}h&&this.renderRockets()})});r("J.renderbio");t(["J.renderbio.BioShapeRenderer"],"J.renderbio.BackboneRenderer",["JU.C"],function(){var b=
z(function(){this.isDataFrame=!1;w(this,arguments)},J.renderbio,"BackboneRenderer",J.renderbio.BioShapeRenderer);h(b,"renderBioShape",function(a){var b=!this.isExport&&!this.vwr.gdata.isPass2;this.isDataFrame=this.ms.isJmolDataFrameForModel(a.modelIndex);a=this.monomerCount;for(var c=this.ms.at,g=this.bsVisible.nextSetBit(0);0<=g;g=this.bsVisible.nextSetBit(g+1)){var f=c[this.leadAtomIndices[g]],h=this.colixes[g];this.mad=this.mads[g];var j=(g+1)%a,q=c[this.leadAtomIndices[j]],j=this.colixes[j];if(0<
f.nBackbonesDisplayed&&0<q.nBackbonesDisplayed&&!this.ms.isAtomHidden(q.i)&&(this.isDataFrame||100>f.distanceSquared(q)))h=JU.C.getColixInherited(h,f.colixAtom),j=JU.C.getColixInherited(j,q.colixAtom),(!b||this.setBioColix(h)||this.setBioColix(j))&&this.drawSegmentAB(f,q,h,j,100)}},"J.shapebio.BioShape")});r("J.renderbio");t(["J.renderbio.StrandsRenderer"],"J.renderbio.TraceRenderer",null,function(){var b=A(J.renderbio,"TraceRenderer",J.renderbio.StrandsRenderer);h(b,"renderBioShape",function(){this.wireframeOnly?
this.renderStrands():this.renderTrace()},"J.shapebio.BioShape");c(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);
