(function(Z,$,aa,A,ba,p,u,s,v,w,E,ca,D,M,H,y,B,I,C,O,K,F,R,V,W,S,da,ea,fa,G,ga,T,P,ha,X,N,ia,ja,L,ka,Y,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,e,h){p("J.adapter.readers.pdb");s(["J.adapter.smarter.AtomSetCollectionReader","java.util.Hashtable"],"J.adapter.readers.pdb.PdbReader","java.lang.Boolean $.Float JU.Lst $.M4 $.P3 $.PT $.SB J.adapter.smarter.Atom $.Structure J.api.JmolAdapter J.c.STR JU.Escape $.Logger".split(" "),function(){c$=w(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.thisBiomolecule=this.vCompnds=this.htMolIds=this.htElementsInCurrentGroup=this.htSites=this.htHetero=this.htFormul=null;this.nRes=this.nUNK=this.maxSerial=this.ac=0;this.currentKey=this.currentGroup3=
this.currentCompnd=null;this.configurationPtr=this.currentResno=-2147483648;this.resetKey=!0;this.$compnd=null;this.fileAtomIndex=this.conformationIndex=0;this.lastAltLoc="\x00";this.lastGroup=-2147483648;this.lastInsertion="\x00";this.lastTargetSerial=this.lastSourceSerial=-2147483648;this.atomTypeLen=this.atomTypePt0=this.tlsGroupID=0;this.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=
null;this.connectNextAtomSet=this.connectNextAtomIndex=0;this.connectLast=null;v(this,arguments)},J.adapter.readers.pdb,"PdbReader",J.adapter.smarter.AtomSetCollectionReader);O(c$,function(){this.htFormul=new java.util.Hashtable;this.dataT=I(8,0)});h(c$,"initializeReader",function(){this.allowPDBFilter=!0;this.pdbHeader=this.getHeader?new JU.SB:null;this.applySymmetry=!this.checkFilterKey("NOSYMMETRY");this.getTlsGroups=this.checkFilterKey("TLS");this.checkFilterKey("ASSEMBLY")&&(this.filter=JU.PT.rep(this.filter,
"ASSEMBLY","BIOMOLECULE"));if(this.isbiomol=this.checkFilterKey("BIOMOLECULE"))this.filter=this.filter.$replace(":"," ");var a=this.isbiomol&&this.checkFilterKey("BYCHAIN"),b=this.isbiomol&&this.checkFilterKey("BYSYMOP");(this.isCourseGrained=a||b)||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,b=a[1].indexOf("="),0<=b?this.setFilterAtomTypeStr(a[1].substring(b+1).toUpperCase()):b=a[1].length,this.atomTypeLen=Integer.parseInt(a[1].substring(0,b)));a=this.getFilter("CONF ");null!=a&&(this.configurationPtr=this.parseIntStr(a),this.sbIgnored=new JU.SB,this.sbSelected=new JU.SB);this.isLegacyModelType=12E4>this.stateScriptVersionInt;this.isConnectStateBug=120151<=this.stateScriptVersionInt&&120220>=this.stateScriptVersionInt||120300<=this.stateScriptVersionInt&&
120320>=this.stateScriptVersionInt});h(c$,"checkLine",function(){var a=(6>(this.lineLength=this.line.length)?-1:"ATOM    HETATM  MODEL   CONECT  HELIX   SHEET   TURN    HET     HETNAM  ANISOU  SITE    CRYST1  SCALE1  SCALE2  SCALE3  EXPDTA  FORMUL  REMARK  HEADER  COMPND  SOURCE  TITLE   SEQADV  ".indexOf(this.line.substring(0,6)))>>3,b=0==a||1==a,c=2==a;this.serial=b?this.getSerial(6,11):0;var d=(this.isTrajectory||this.isSequential)&&!this.isMultiModel&&b&&1==this.serial;this.getHeader&&(b||c?this.getHeader=
!1:this.readHeader(!1));if(c||d){this.isMultiModel=c;this.getHeader=!1;c=d?this.modelNumber+1:this.getModelNumber();this.modelNumber=this.useFileModelNumbers?c:this.modelNumber+1;if(!this.doGetModel(this.modelNumber,null))return this.handleTlsMissingModels(),a=this.checkLastModel(),!a&&this.isConcatenated&&(a=this.continuing=!0),a;this.isCourseGrained||this.connectAll(this.maxSerial,this.isConnectStateBug);0<this.ac&&this.applySymmetryAndSetTrajectory();this.model(c);if(this.isLegacyModelType||!b)return!0}if(this.isMultiModel&&
!this.doProcessLines)return!0;if(b)return this.getHeader=!1,this.atom(),!0;switch(a){case 3:this.conect();break;case 4:case 5:case 6:this.structure();break;case 7:this.het();break;case 8:this.hetnam();break;case 9:this.anisou();break;case 10:this.site();break;case 11:this.cryst1();break;case 12:case 13:case 14:this.scale(a-11);break;case 15:this.expdta();break;case 16:this.formul();break;case 17:if(this.line.startsWith("REMARK 350"))return this.remark350(),!1;if(this.line.startsWith("REMARK 290"))return this.remark290(),
!1;this.line.contains("This file does not adhere to the PDB standard")&&(this.gromacsWideFormat=!0);if(this.getTlsGroups&&0<this.line.indexOf("TLS DETAILS"))return this.remarkTls();this.checkRemark();break;case 18:this.header();break;case 19:case 20:this.compnd(20==a);break;case 21:this.title();break;case 22:this.seqAdv()}return!0});e(c$,"checkRemark",function(){this.checkCurrentLineForScript()});e(c$,"seqAdv",function(){var a=this.line.substring(39,42).trim().toLowerCase();if(1==a.length){null==
this.htGroup1&&this.asc.setInfo("htGroup1",this.htGroup1=new java.util.Hashtable);var b=this.line.substring(12,15).trim();this.htGroup1.put(b,a)}});e(c$,"readHeader",function(a){if(a&&(this.rd(),!this.getHeader))return this.line;this.pdbHeader.append(this.line).appendC("\n");return this.line},"~B");h(c$,"finalizeSubclassReader",function(){this.finalizeReaderPDB()});e(c$,"finalizeReaderPDB",function(){this.checkNotPDB();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.unitCellParams,this.applySymmetryToBonds,this.filter),this.vTlsModels=null,this.asc.xtalSymmetry=null));if(null!=this.vTlsModels){a=this.getInterface("JS.Symmetry");var b=this.asc.atomSetCount;
if(b==this.vTlsModels.size())for(;0<=--b;)this.setTlsGroups(b,b,a);else if(JU.Logger.info(b+" models but "+this.vTlsModels.size()+" TLS descriptions"),1==this.vTlsModels.size())for(JU.Logger.info(" -- assuming all models have the same TLS description -- check REMARK 3 for details.");0<=--b;)this.setTlsGroups(0,b,a);this.checkForResidualBFactors(a)}null!=this.sbTlsErrors&&(this.asc.setInfo("tlsErrors",this.sbTlsErrors.toString()),this.appendLoadNote(this.sbTlsErrors.toString()));this.doCheckUnitCell=
(new Boolean(this.doCheckUnitCell&(this.iHaveUnitCell&&(this.doApplySymmetry||this.isbiomol)))).valueOf();this.finalizeReaderASCR();if(null!=this.vCompnds){this.asc.setInfo("compoundSource",this.vCompnds);for(b=this.asc.iSet+1;0<=--b;)this.asc.setModelInfoForSet("compoundSource",this.vCompnds,b)}null!=this.htSites&&this.addSites(this.htSites);null!=this.pdbHeader&&this.asc.setInfo("fileHeader",this.pdbHeader.toString());0<this.configurationPtr&&(JU.Logger.info(this.sbSelected.toString()),JU.Logger.info(this.sbIgnored.toString()))});
e(c$,"checkUnitCellParams",function(){this.iHaveUnitCell&&(this.asc.setCurrentModelInfo("unitCellParams",this.unitCellParams),null!=this.sgName&&this.asc.setCurrentModelInfo("spaceGroup",this.sgName))});e(c$,"checkForResidualBFactors",function(a){for(var b=this.asc.atoms,c=!1,d=this.asc.ac;0<=--d;){var f=this.tlsU.get(b[d]);if(null!=f){var g=f[7]-(f[0]+f[1]+f[2])/3;if(0>g||Float.isNaN(g)){c=!0;break}}}JU.Logger.info("TLS analysis suggests Bfactors are "+(c?"":"NOT")+" residuals");for(var k,b=this.tlsU.entrySet().iterator();b.hasNext()&&
((k=b.next())||1);)f=k.getValue(),g=f[7],0!=g&&(c||(g-=(f[0]+f[1]+f[2])/3),f[0]+=g,f[1]+=g,f[2]+=g,k.getKey().addTensor(a.getTensor(this.vwr,f).setType(null),"TLS-R",!1),JU.Logger.info("TLS-U:  "+JU.Escape.eAF(f)),f=k.getKey().anisoBorU,null!=f&&JU.Logger.info("ANISOU: "+JU.Escape.eAF(f)));this.tlsU=null},"J.api.SymmetryInterface");e(c$,"header",function(){8>this.lineLength||(this.appendLoadNote(this.line.substring(7).trim()),80==this.lineLength&&(this.maxLength=72),this.pdbID=66<=this.lineLength?
this.line.substring(62,66).trim():"",4==this.pdbID.length&&(this.asc.setCollectionName(this.pdbID),this.asc.setInfo("havePDBHeaderName",Boolean.TRUE)),50<this.lineLength&&(this.line=this.line.substring(0,50)),this.asc.setInfo("CLASSIFICATION",this.line.substring(7).trim()))});e(c$,"title",function(){10<this.lineLength&&this.appendLoadNote(this.line.substring(10,Math.min(this.maxLength,this.line.length)).trim())});e(c$,"compnd",function(a){if(!a){this.$compnd=null==this.$compnd?"":this.$compnd+" ";
var b=this.line;62<this.lineLength&&(b=b.substring(0,62));this.$compnd+=b.substring(10).trim();this.asc.setInfo("COMPND",this.$compnd)}if(null==this.vCompnds){if(a)return;this.vCompnds=new JU.Lst;this.htMolIds=new java.util.Hashtable;this.currentCompnd=new java.util.Hashtable;this.currentCompnd.put("select","(*)");this.currentKey="MOLECULE";this.htMolIds.put("",this.currentCompnd)}a&&this.resetKey&&(this.resetKey=!1,this.currentKey="SOURCE",this.currentCompnd=this.htMolIds.get(""));this.line=this.line.substring(10,
Math.min(this.lineLength,72)).trim();var c=this.line.indexOf(":");if(0>c||0<c&&"\\"==this.line.charAt(c-1))c=this.line.length;b=this.line.substring(0,c).trim();c=c<this.line.length?this.line.substring(c+1).trim():null;if(b.equals("MOL_ID")){if(null==c)return;if(a){this.currentCompnd=this.htMolIds.remove(c);return}this.currentCompnd=new java.util.Hashtable;this.vCompnds.addLast(this.currentCompnd);this.htMolIds.put(c,this.currentCompnd)}null!=this.currentCompnd&&(null==c?(c=this.currentCompnd.get(this.currentKey),
null==c&&(c=""),c+=b,0==this.vCompnds.size()&&this.vCompnds.addLast(this.currentCompnd)):this.currentKey=b,c.endsWith(";")&&(c=c.substring(0,c.length-1)),this.currentCompnd.put(this.currentKey,c),this.currentKey.equals("CHAIN")&&this.currentCompnd.put("select","(:"+JU.PT.rep(JU.PT.rep(c,", ",",:")," ","")+")"))},"~B");e(c$,"setBiomoleculeAtomCounts",function(){for(var a=this.vBiomolecules.size();0<=--a;){for(var b=this.vBiomolecules.get(a),c=b.get("biomts"),d=b.get("chains"),f=0,c=c.size();0<=--c;)for(var g=
d.get(c),k=g.length-1;0<=--k;)":"==g.charAt(k)&&(f+=this.biomtChainAtomCounts[0+g.charCodeAt(k+1)]);b.put("atomCount",Integer.$valueOf(f))}});e(c$,"remark350",function(){var a=null,b=null;this.vBiomolecules=new JU.Lst;this.biomtChainAtomCounts=y(255,0);for(var c="",d="",f="",g=!0,k=null,e=0,j=JU.M4.newM4(null);;){g?this.readHeader(!0):g=!0;if(null==this.line||!this.line.startsWith("REMARK 350"))break;try{if(this.line.startsWith("REMARK 350 BIOMOLECULE:")&&(0<e&&JU.Logger.info("biomolecule "+f+": number of transforms: "+
e),k=new java.util.Hashtable,f=this.line.substring(this.line.indexOf(":")+1).trim(),c=this.line.trim(),k.put("name","biomolecule "+f),k.put("molecule",3==f.length?f:Integer.$valueOf(this.parseIntStr(f))),k.put("title",c),k.put("chains",b=new JU.Lst),k.put("biomts",a=new JU.Lst),this.vBiomolecules.addLast(k),e=0),0<=this.line.indexOf("APPLY THE FOLLOWING TO CHAINS:"))if(null==k)g=!1,this.line="REMARK 350 BIOMOLECULE: 1  APPLY THE FOLLOWING TO CHAINS:";else{var n=this.line.substring(41).trim();this.appendLoadNote("found biomolecule "+
f+": "+n);d=":"+n.$replace(" ",":");for(g=!1;null!=this.readHeader(!0)&&0>this.line.indexOf("BIOMT")&&7==this.line.indexOf("350");)d+=":"+this.line.substring(11).trim().$replace(" ",":");d+=";";if(this.checkFilterKey("BIOMOLECULE "+f+";")||this.checkFilterKey("BIOMOLECULE="+f+";"))this.setFilter(this.filter+d),JU.Logger.info('filter set to "'+this.filter+'"'),this.thisBiomolecule=k}else if(this.line.startsWith("REMARK 350   BIOMT1 ")){e++;for(var l=I(16,0),h=0;12>h;){var q=this.getTokens();l[h++]=
this.parseFloatStr(q[4]);l[h++]=this.parseFloatStr(q[5]);l[h++]=this.parseFloatStr(q[6]);l[h++]=this.parseFloatStr(q[7]);(4==h||8==h)&&this.readHeader(!0)}l[15]=1;var x=new JU.M4;x.setA(l);x.equals(j)?(a.add(0,x),b.add(0,d)):(a.addLast(x),b.addLast(d))}}catch(Q){if(H(Q,Exception)){this.vBiomolecules=this.thisBiomolecule=null;return}throw Q;}}0<e&&JU.Logger.info("biomolecule "+f+": number of transforms: "+e)});e(c$,"remark290",function(){for(;null!=this.readHeader(!0)&&this.line.startsWith("REMARK 290");)if(0<=
this.line.indexOf("NNNMMM   OPERATOR"))for(;null!=this.readHeader(!0);){var a=this.getTokens();if(4>a.length)break;(this.doApplySymmetry||this.isbiomol)&&this.setSymmetryOperator(a[3])}});e(c$,"getSerial",function(a,b){var c=this.line.charAt(a),d=" "==c||" "==this.line.charAt(b-1);switch(this.serMode){default:case 0:if(d)return this.parseIntRange(this.line,a,b);try{return this.serial=Integer.parseInt(this.line.substring(a,b))}catch(f){if(H(f,Exception))return this.serMode=JU.PT.isDigit(c)?1:2,this.getSerial(a,
b);throw f;}case 2:return d||JU.PT.isDigit(c)?this.parseIntRange(this.line,a,b):JU.PT.parseIntRadix(this.line.substring(a,b),36)+(JU.PT.isUpperCase(c)?-16696160:26973856);case 1:if(!d)return this.serial=JU.PT.parseIntRadix(this.line.substring(a,b),16);this.serMode=0;return this.getSerial(a,b)}},"~N,~N");e(c$,"getSeqNo",function(a,b){var c=this.line.charAt(a),d=" "==c||" "==this.line.charAt(b-1);switch(this.seqMode){default:case 0:if(d)return this.parseIntRange(this.line,a,b);try{return Integer.parseInt(this.line.substring(a,
b))}catch(f){if(H(f,Exception))return this.seqMode=JU.PT.isDigit(c)?1:2,this.getSeqNo(a,b);throw f;}case 2:return d||JU.PT.isDigit(c)?this.parseIntRange(this.line,a,b):JU.PT.parseIntRadix(this.line.substring(a,b),36)+(JU.PT.isUpperCase(c)?-456560:756496);case 1:if(!d)return JU.PT.parseIntRadix(this.line.substring(a,b),16);this.seqMode=0;return this.getSeqNo(a,b)}},"~N,~N");e(c$,"processAtom",function(a,b,c,d,f,g,k,e,j){a.atomName=b;" "!=c&&(a.altLoc=c);a.group3=null==d?"UNK":d;a.chainID=f;null!=this.biomtChainAtomCounts&&
this.biomtChainAtomCounts[f%256]++;a.sequenceNumber=g;a.insertionCode=J.api.JmolAdapter.canonizeInsertionCode(k);a.isHetero=e;a.elementSymbol=j;return a},"J.adapter.smarter.Atom,~S,~S,~S,~N,~N,~S,~B,~S");e(c$,"processAtom2",function(a,b,c,d,f,g){a.atomSerial=b;b>this.maxSerial&&(this.maxSerial=b);if(null==a.group3)null!=this.currentGroup3&&(this.currentGroup3=null,this.currentResno=-2147483648,this.htElementsInCurrentGroup=null);else if(!a.group3.equals(this.currentGroup3)||a.sequenceNumber!=this.currentResno)this.currentGroup3=
a.group3,this.currentResno=a.sequenceNumber,this.htElementsInCurrentGroup=this.htFormul.get(a.group3),this.nRes++,a.group3.equals("UNK")&&this.nUNK++;this.setAtomCoordXYZ(a,c,d,f);a.formalCharge=g;this.setAdditionalAtomParameters(a);this.haveMappedSerials?this.asc.addAtomWithMappedSerialNumber(a):this.asc.addAtom(a);0==this.ac++&&!this.isCourseGrained&&this.setModelPDB(!0);a.isHetero&&null!=this.htHetero&&(this.asc.setCurrentModelInfo("hetNames",this.htHetero),this.htHetero=null)},"J.adapter.smarter.Atom,~N,~N,~N,~N,~N");
e(c$,"atom",function(){var a=this.line.startsWith("HETATM"),a=this.processAtom(new J.adapter.smarter.Atom,this.line.substring(12,16).trim(),this.line.charAt(16),this.parseTokenRange(this.line,17,20),this.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 b=this.line.substring(this.atomTypePt0,this.atomTypePt0+this.atomTypeLen).trim();0<b.length&&(a.atomName+="\x00"+b)}if(this.filterPDBAtom(a,this.fileAtomIndex++)){var b=
0,c,d,f;if(this.gromacsWideFormat)c=this.parseFloatRange(this.line,30,40),d=this.parseFloatRange(this.line,40,50),f=this.parseFloatRange(this.line,50,60);else{if(80<=this.lineLength&&(c=this.line.charAt(78),d=this.line.charAt(79),"0"<=d&&"7">=d&&(f=d,d=c,c=f),("+"==d||"-"==d||" "==d)&&"0"<=c&&"7">=c))b=c.charCodeAt(0)-48,"-"==d&&(b=-b);c=this.parseFloatRange(this.line,30,38);d=this.parseFloatRange(this.line,38,46);f=this.parseFloatRange(this.line,46,54)}this.processAtom2(a,this.serial,c,d,f,b)}});
e(c$,"filterPDBAtom",function(a,b){if(!this.filterAtom(a,b))return!1;if(0<this.configurationPtr){if(a.sequenceNumber!=this.lastGroup||a.insertionCode!=this.lastInsertion)this.conformationIndex=this.configurationPtr-1,this.lastGroup=a.sequenceNumber,this.lastInsertion=a.insertionCode,this.lastAltLoc="\x00";if("\x00"!=a.altLoc){var c=" atom ["+a.group3+"]"+a.sequenceNumber+("\x00"==a.insertionCode?"":"^"+a.insertionCode)+(0==a.chainID?"":":"+this.vwr.getChainIDStr(a.chainID))+"."+a.atomName+"%"+a.altLoc+
"\n";0<=this.conformationIndex&&a.altLoc!=this.lastAltLoc&&(this.lastAltLoc=a.altLoc,this.conformationIndex--);if(0>this.conformationIndex&&a.altLoc!=this.lastAltLoc)return this.sbIgnored.append("ignoring").append(c),!1;this.sbSelected.append("loading").append(c)}}return!0},"J.adapter.smarter.Atom,~N");e(c$,"setAdditionalAtomParameters",function(a){var b;this.gromacsWideFormat?(b=this.parseFloatRange(this.line,60,68),a.bfactor=J.adapter.readers.pdb.PdbReader.fixRadius(this.parseFloatRange(this.line,
68,76))):(b=this.parseFloatRange(this.line,54,60),a.bfactor=this.parseFloatRange(this.line,60,66));a.foccupancy=Float.isNaN(b)?1:b},"J.adapter.smarter.Atom");e(c$,"deduceElementSymbol",function(a){if(78<=this.lineLength){var b=this.line.charAt(76),c=this.line.charAt(77);if(" "==b&&J.adapter.smarter.Atom.isValidSym1(c))return""+c;if(J.adapter.smarter.Atom.isValidSymNoCase(b,c))return""+b+c}b=this.line.charAt(12);c=this.line.charAt(13);if((null==this.htElementsInCurrentGroup||null!=this.htElementsInCurrentGroup.get(this.line.substring(12,
14)))&&J.adapter.smarter.Atom.isValidSymNoCase(b,c))return a||"H"!=b?""+b+c:"H";if("H"==b)return"H";if((null==this.htElementsInCurrentGroup||null!=this.htElementsInCurrentGroup.get(""+c))&&J.adapter.smarter.Atom.isValidSym1(c))return""+c;if(" "!=b&&(null==this.htElementsInCurrentGroup||null!=this.htElementsInCurrentGroup.get(""+b))&&J.adapter.smarter.Atom.isValidSym1(b))return""+b;a=this.line.charAt(14);return" "==b&&"X"!=c&&(null==this.htElementsInCurrentGroup||null!=this.htElementsInCurrentGroup.get(this.line.substring(13,
15)))&&J.adapter.smarter.Atom.isValidSymNoCase(c,a)?""+c+a:"Xx"},"~B");e(c$,"conect",function(){null==this.sbConect?(this.sbConect=new JU.SB,this.sb=new JU.SB):this.sb.setLength(0);var a=this.getSerial(6,11);if(!(0>a)){var b=1,c=this.line.trim().length;56<c&&(c=this.line.substring(0,56).trim().length);for(var d=11;d<c;d+=5){switch(d){case 31:b=2048;break;case 41:continue}var f=this.getSerial(d,d+5);if(!(0>f)){var g=a==this.lastSourceSerial&&f==this.lastTargetSerial;g&&(this.haveDoubleBonds=!0);this.lastSourceSerial=
a;this.lastTargetSerial=f;var k;f<a?(k=f,f=a):k=a;var e=";"+k+" "+f+";";if(!(0<=this.sbConect.indexOf(e))||g){if(this.haveDoubleBonds){g="--"+e;if(0<=this.sbConect.indexOf(g))continue;this.sb.append(g)}this.sbConect.append(e);this.addConnection(y(-1,[k,f,b]))}}}this.sbConect.appendSB(this.sb)}});e(c$,"structure",function(){var a=J.c.STR.NONE,b=J.c.STR.NONE,c,d,f,g,k=0;if(this.line.startsWith("HELIX "))a=J.c.STR.HELIX,c=19,d=21,f=31,g=33,40<=this.line.length&&(b=J.adapter.smarter.Structure.getHelixType(this.parseIntRange(this.line,
38,40)));else if(this.line.startsWith("SHEET "))a=J.c.STR.SHEET,c=21,d=22,f=32,g=33,k=this.parseIntRange(this.line,14,16);else if(this.line.startsWith("TURN  "))a=J.c.STR.TURN,c=19,d=20,f=30,g=31;else return;if(!(this.lineLength<g+4)){var e=this.line.substring(11,15).trim(),j=this.parseIntRange(this.line,7,10);c=this.vwr.getChainID(this.line.substring(c,c+1),!0);var n=this.parseIntRange(this.line,d,d+4);d=this.line.charAt(d+4);f=this.vwr.getChainID(this.line.substring(f,f+1),!0);var l=this.parseIntRange(this.line,
g,g+4),h=" ";this.lineLength>g+4&&(h=this.line.charAt(g+4));b===J.c.STR.NONE&&(b=a);a=new J.adapter.smarter.Structure(-1,a,b,e,j,k);a.set(c,n,d,f,l,h,-2147483648,2147483647);this.asc.addStructure(a)}});e(c$,"getModelNumber",function(){var a=14;a>this.lineLength&&(a=this.lineLength);a=this.parseIntRange(this.line,6,a);return-2147483648==a?0:a});e(c$,"model",function(a){this.checkNotPDB();this.haveMappedSerials=!1;this.sbConect=null;this.asc.newAtomSet();this.checkUnitCellParams();this.isCourseGrained||
this.setModelPDB(!0);this.asc.setCurrentAtomSetNumber(a);this.isCourseGrained&&this.asc.setCurrentModelInfo("courseGrained",Boolean.TRUE)},"~N");e(c$,"checkNotPDB",function(){var a=!this.isCourseGrained&&(0==this.nRes||this.nUNK!=this.nRes);this.asc.checkSpecial=!a;this.setModelPDB(a);this.nUNK=this.nRes=0;this.currentGroup3=null;null!=this.pdbID&&this.asc.setAtomSetName(this.pdbID)});e(c$,"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));(null==this.sgName||this.sgName.equals("unspecified!"))&&this.setSpaceGroupName(JU.PT.parseTrimmedRange(this.line,55,66))});e(c$,"getFloat",function(a,b){return this.parseFloatRange(this.line,a,a+b)},"~N,~N");e(c$,"scale",function(a){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)))},"~N");e(c$,"expdta",function(){0<=this.line.toUpperCase().indexOf("NMR")&&this.asc.setInfo("isNMRdata","true")});e(c$,"formul",function(){var a=this.parseTokenRange(this.line,12,15),b=JU.PT.parseTrimmedRange(this.line,19,70),c=b.indexOf("(");if(0<=c){var d=b.indexOf(")");if(0>d||c>=d||c+1==d)return;b=JU.PT.parseTrimmedRange(b,c+1,d)}c=this.htFormul.get(a);null==c&&this.htFormul.put(a,c=new java.util.Hashtable);for(this.next[0]=
0;null!=(d=this.parseTokenNext(b));)2>d.length||(a=d.charAt(0),d=d.charAt(1),J.adapter.smarter.Atom.isValidSymNoCase(a,d)?c.put(""+a+d,Boolean.TRUE):J.adapter.smarter.Atom.isValidSym1(a)&&c.put(""+a,Boolean.TRUE))});e(c$,"het",function(){if(!(30>this.line.length)){null==this.htHetero&&(this.htHetero=new java.util.Hashtable);var a=this.parseTokenRange(this.line,7,10);if(!this.htHetero.containsKey(a)){var b=JU.PT.parseTrimmedRange(this.line,30,70);this.htHetero.put(a,b)}}});e(c$,"hetnam",function(){null==
this.htHetero&&(this.htHetero=new java.util.Hashtable);var a=this.parseTokenRange(this.line,11,14),b=JU.PT.parseTrimmedRange(this.line,15,70);if(null==a)JU.Logger.error("ERROR: HETNAM record does not contain a group name: "+this.line);else{var c=this.htHetero.get(a);null!=c&&(b=c+b);this.htHetero.put(a,b)}});e(c$,"anisou",function(){var a=I(8,0);a[6]=1;var b=this.line.substring(6,11).trim();if(!this.haveMappedSerials&&0<this.asc.ac){for(var c=this.asc.getAtomSetAtomIndex(this.asc.iSet);c<this.asc.ac;c++){var d=
this.asc.atoms[c].atomSerial;-2147483648!=d&&this.asc.atomSymbolicMap.put(""+d,this.asc.atoms[c])}this.haveMappedSerials=!0}b=this.asc.getAtomFromName(b);if(null!=b){c=28;for(d=0;70>c;c+=7,d++)a[d]=this.parseFloatRange(this.line,c,c+7);for(c=0;6>c;c++){if(Float.isNaN(a[c])){JU.Logger.error("Bad ANISOU record: "+this.line);return}a[c]/=1E4}this.asc.setAnisoBorU(b,a,12)}});e(c$,"site",function(){null==this.htSites&&(this.htSites=new java.util.Hashtable);var a=this.parseIntRange(this.line,15,17),b=JU.PT.parseTrimmedRange(this.line,
11,14),c=this.htSites.get(b);null==c&&(c=new java.util.Hashtable,c.put("nResidues",Integer.$valueOf(a)),c.put("groups",""),this.htSites.put(b,c));a=c.get("groups");for(b=0;4>b;b++){var d=18+11*b,f=JU.PT.parseTrimmedRange(this.line,d,d+3);if(0==f.length)break;var g=JU.PT.parseTrimmedRange(this.line,d+4,d+5),k=JU.PT.parseTrimmedRange(this.line,d+5,d+9),d=JU.PT.parseTrimmedRange(this.line,d+9,d+10),a=a+((0==a.length?"":",")+"["+f+"]"+k);0<d.length&&(a+="^"+d);0<g.length&&(a+=":"+g);c.put("groups",a)}});
e(c$,"remarkTls",function(){for(var a=0,b=0,c=null,d=null,f=null,g=null,k=null,e=this.line.substring(0,11);null!=this.readHeader(!0)&&this.line.startsWith(e);)try{var j=JU.PT.getTokens(this.line.substring(10).$replace(":"," "));if(!(2>j.length))if(JU.Logger.info(this.line),j[1].equalsIgnoreCase("GROUP"))f=new java.util.Hashtable,g=new JU.Lst,f.put("ranges",g),d.addLast(f),this.tlsGroupID=this.parseIntStr(j[j.length-1]),f.put("id",Integer.$valueOf(this.tlsGroupID));else if(j[0].equalsIgnoreCase("NUMBER")){if(!j[2].equalsIgnoreCase("COMPONENTS")){a=
this.parseIntStr(j[j.length-1]);if(1>a)break;null==this.vTlsModels&&(this.vTlsModels=new JU.Lst);d=new JU.Lst;this.appendLoadNote(this.line.substring(11).trim())}}else if(j[0].equalsIgnoreCase("COMPONENTS"))c=this.line;else if(j[0].equalsIgnoreCase("RESIDUE")){var k=new java.util.Hashtable,n,h,m,q;if(6==j.length)n=j[2].charAt(0),h=j[4].charAt(0),m=this.parseIntStr(j[3]),q=this.parseIntStr(j[5]);else{var x=c.indexOf(" C "),Q=c.indexOf(" C ",x+4);n=this.line.charAt(Q);h=this.line.charAt(x);m=this.parseIntRange(this.line,
Q+1,x);q=this.parseIntStr(this.line.substring(x+1))}n==h?(k.put("chains",""+n+h),m<=q?(k.put("residues",y(-1,[m,q])),g.addLast(k)):this.tlsAddError(" TLS group residues are not in order (range ignored)")):this.tlsAddError(" TLS group chains are different (range ignored)")}else if(j[0].equalsIgnoreCase("SELECTION"))for(var r="\x00",t=1;t<j.length;t++)if(0<=j[t].toUpperCase().indexOf("CHAIN"))r=j[++t].charAt(0);else{var p=this.parseIntStr(j[t]);-2147483648!=p&&(k=new java.util.Hashtable,k.put("residues",
y(-1,[p,this.parseIntStr(j[++t])])),"\x00"!=r&&k.put("chains",""+r+r),g.addLast(k))}else if(j[0].equalsIgnoreCase("ORIGIN")){var s=new JU.P3;f.put("origin",s);if(8==j.length)s.set(this.parseFloatStr(j[5]),this.parseFloatStr(j[6]),this.parseFloatStr(j[7]));else{var u=this.line.length;s.set(this.parseFloatRange(this.line,u-27,u-18),this.parseFloatRange(this.line,u-18,u-9),this.parseFloatRange(this.line,u-9,u))}if(Float.isNaN(s.x)||Float.isNaN(s.y)||Float.isNaN(s.z))s.set(NaN,NaN,NaN),this.tlsAddError("invalid origin: "+
this.line)}else if(j[1].equalsIgnoreCase("TENSOR")){var U=j[0].charAt(0),z=(this.readHeader(!0).substring(10)+this.readHeader(!0).substring(10)+this.readHeader(!0).substring(10)).$replace(U," ").$replace(":"," "),j=JU.PT.getTokens(z),v=I(3,3,0);f.put("t"+U,v);for(t=0;t<j.length;t++){var w=j[t].charCodeAt(0)-49,A=j[t].charCodeAt(1)-49;v[w][A]=this.parseFloatStr(j[++t]);w<A&&(v[A][w]=v[w][A])}for(t=0;3>t;t++)for(r=0;3>r;r++)Float.isNaN(v[t][r])&&this.tlsAddError("invalid tensor: "+JU.Escape.escapeFloatAA(v,
!1));if("S"==U&&++b==a){JU.Logger.info(a+" TLS groups read");this.readHeader(!0);break}}}catch(B){if(H(B,Exception)){JU.Logger.error(this.line+"\nError in TLS parser: ");System.out.println(B.getMessage());d=null;break}else throw B;}null!=d&&(b=new java.util.Hashtable,b.put("groupCount",Integer.$valueOf(a)),b.put("groups",d),this.vTlsModels.addLast(b));return 1>a});e(c$,"handleTlsMissingModels",function(){this.vTlsModels=null});e(c$,"setTlsGroups",function(a,b,c){JU.Logger.info("TLS model "+(b+1)+
" set "+(a+1));a=this.vTlsModels.get(a);for(var d=a.get("groups"),f=this.asc.getAtomSetAtomIndex(b),g=I(this.asc.getAtomSetAtomCount(b),0),k=f+g.length,e=this.asc.atoms,j=d.size(),n=0;n<j;n++){var h=d.get(n),m=h.get("ranges");this.tlsGroupID=h.get("id").intValue();for(var q=m.size();0<=--q;){var x=m.get(q).get("chains"),p=m.get(q).get("residues"),r=0+x.charCodeAt(0),x=0+x.charCodeAt(1),t=p[0],p=p[1],s=this.findAtomForRange(f,k,r,t,!1),u=0<=s?this.findAtomForRange(s,k,x,p,!1):-1;if(0>u){JU.Logger.info("TLS processing terminated");
return}JU.Logger.info("TLS ID="+this.tlsGroupID+" model atom index range "+s+"-"+u);s=r==x;for(u=f;u<k;u++){var v=e[u];if(s?v.sequenceNumber>=t&&v.sequenceNumber<=p:v.chainID>r&&v.chainID<x||v.chainID==r&&v.sequenceNumber>=t||v.chainID==x&&v.sequenceNumber<=p)g[u-f]=this.tlsGroupID,this.setTlsTensor(v,h,c)}}}this.asc.setAtomProperties("tlsGroup",g,b,!0);this.asc.setModelInfoForSet("TLS",a,b);this.asc.setTensors()},"~N,~N,J.api.SymmetryInterface");e(c$,"findAtomForRange",function(a,b,c,d,f){a=this.findAtom(a,
b,c,d,!0);return f&&0<=a?this.findAtom(a,b,c,d,!1):a},"~N,~N,~N,~N,~B");e(c$,"findAtom",function(a,b,c,d,f){for(var g=this.asc.atoms;a<b;a++){var k=g[a];if((k.chainID==c&&k.sequenceNumber==d)==f)return a}f&&(JU.Logger.warn("PdbReader findAtom chain="+c+" resno="+d+" not found"),this.tlsAddError("atom not found: chain="+c+" resno="+d));return f?-1:b},"~N,~N,~N,~N,~B");e(c$,"setTlsTensor",function(a,b,c){var d=b.get("origin");if(!Float.isNaN(d.x)){var f=b.get("tT"),g=b.get("tL");b=b.get("tS");if(!(null==
f||null==g||null==b)){var k=0.017453292*(a.x-d.x),e=0.017453292*(a.y-d.y),d=0.017453292*(a.z-d.z),j=k*k,n=e*e,h=d*d,m=k*e,q=k*d,x=e*d;this.dataT[0]=f[0][0];this.dataT[1]=f[1][1];this.dataT[2]=f[2][2];this.dataT[3]=f[0][1];this.dataT[4]=f[0][2];this.dataT[5]=f[1][2];this.dataT[6]=12;var f=I(8,0),p=Float.isNaN(a.bfactor)?0:a.bfactor/78.95683;f[0]=this.dataT[0]+g[1][1]*h+g[2][2]*n-2*g[1][2]*x+2*b[1][0]*d-2*b[2][0]*e;f[1]=this.dataT[1]+g[0][0]*h+g[2][2]*j-2*g[2][0]*q-2*b[0][1]*d+2*b[2][1]*k;f[2]=this.dataT[2]+
g[0][0]*n+g[1][1]*j-2*g[0][1]*m-2*b[1][2]*k+2*b[0][2]*e;f[3]=this.dataT[3]-g[2][2]*m+g[1][2]*q+g[2][0]*x-g[0][1]*h-b[0][0]*d+b[1][1]*d+b[2][0]*k-b[2][1]*e;f[4]=this.dataT[4]-g[1][1]*q+g[1][2]*m-g[2][0]*n+g[0][1]*x+b[0][0]*e-b[2][2]*e+b[1][2]*d-b[1][0]*k;f[5]=this.dataT[5]-g[0][0]*x-g[1][2]*j+g[2][0]*m+g[0][1]*q-b[1][1]*k+b[2][2]*k+b[0][1]*e-b[0][2]*d;f[6]=12;f[7]=p;null==this.tlsU&&(this.tlsU=new java.util.Hashtable);this.tlsU.put(a,f);a.addTensor(c.getTensor(this.vwr,this.dataT).setType(null),"TLS-U",
!1)}}},"J.adapter.smarter.Atom,java.util.Map,J.api.SymmetryInterface");e(c$,"tlsAddError",function(a){null==this.sbTlsErrors&&(this.sbTlsErrors=new JU.SB);this.sbTlsErrors.append(this.fileName).appendC("\t").append("TLS group ").appendI(this.tlsGroupID).appendC("\t").append(a).appendC("\n")},"~S");c$.fixRadius=e(c$,"fixRadius",function(a){return 0.9>a?1:a},"~N");e(c$,"addConnection",function(a){null==this.vConnect&&(this.connectLast=null,this.vConnect=new JU.Lst);null!=this.connectLast&&a[0]==this.connectLast[0]&&
a[1]==this.connectLast[1]&&2048!=a[2]?this.connectLast[2]++:this.vConnect.addLast(this.connectLast=a)},"~A");e(c$,"connectAllBad",function(a){for(var b=this.connectNextAtomIndex,c=this.connectNextAtomSet;c<this.asc.atomSetCount;c++){var d=this.asc.getAtomSetAtomCount(c);this.asc.setModelInfoForSet("PDB_CONECT_firstAtom_count_max",y(-1,[b,d,a]),c);null!=this.vConnect&&(this.asc.setModelInfoForSet("PDB_CONECT_bonds",this.vConnect,c),this.asc.setGlobalBoolean(3));b+=d}this.vConnect=null;this.connectNextAtomSet=
this.asc.iSet+1;this.connectNextAtomIndex=b},"~N");e(c$,"connectAll",function(a,b){var c=this.asc,d=c.iSet;if(!(0>d))if(b)this.connectAllBad(a);else if(c.setCurrentModelInfo("PDB_CONECT_firstAtom_count_max",y(-1,[c.getAtomSetAtomIndex(d),c.getAtomSetAtomCount(d),a])),null!=this.vConnect){for(var f=this.connectNextAtomIndex,g=c.atomSetCount;--g>=this.connectNextAtomSet;)c.setModelInfoForSet("PDB_CONECT_bonds",this.vConnect,g),c.setGlobalBoolean(3),f+=c.getAtomSetAtomCount(g);this.vConnect=null;this.connectNextAtomSet=
d+1;this.connectNextAtomIndex=f}},"~N,~B");B(c$,"MODE_PDB",0,"MODE_HEX",1,"MODE_HYBRID36",2,"lineOptions","ATOM    HETATM  MODEL   CONECT  HELIX   SHEET   TURN    HET     HETNAM  ANISOU  SITE    CRYST1  SCALE1  SCALE2  SCALE3  EXPDTA  FORMUL  REMARK  HEADER  COMPND  SOURCE  TITLE   SEQADV  ","RAD_PER_DEG",0.017453292519943295,"_8PI2_",78.95683520871486)});p("J.adapter.smarter");s(null,"J.adapter.smarter.Structure",["J.c.STR"],function(){c$=w(function(){this.structureID=this.substructureType=this.structureType=
null;this.startChainID=this.startSequenceNumber=this.strandCount=this.serialID=0;this.startChainStr=null;this.startInsertionCode="\x00";this.endChainID=this.endSequenceNumber=0;this.endChainStr=null;this.endInsertionCode="\x00";this.modelStartEnd=this.atomStartEnd=null;v(this,arguments)},J.adapter.smarter,"Structure");O(c$,function(){this.atomStartEnd=y(2,0);this.modelStartEnd=y(-1,[-1,-1])});c$.getHelixType=e(c$,"getHelixType",function(a){switch(a){case 1:return J.c.STR.HELIXALPHA;case 3:return J.c.STR.HELIXPI;
case 5:return J.c.STR.HELIX310}return J.c.STR.HELIX},"~N");D(c$,function(a,b,c,d,f,g){this.structureType=b;this.substructureType=c;null!=d&&(this.setModels(a,0),this.structureID=d,this.strandCount=g,this.serialID=f)},"~N,J.c.STR,J.c.STR,~S,~N,~N");e(c$,"set",function(a,b,c,d,f,g,k,e){this.startChainID=a;this.startSequenceNumber=b;this.startInsertionCode=c;this.endChainID=d;this.endSequenceNumber=f;this.endInsertionCode=g;this.atomStartEnd[0]=k;this.atomStartEnd[1]=e},"~N,~N,~S,~N,~N,~S,~N,~N");e(c$,
"setModels",function(a,b){this.modelStartEnd[0]=a;this.modelStartEnd[1]=0==b?a:b},"~N,~N")});p("J.api");R(J.api,"JmolBioResolver");p("JM");R(JM,"JmolBioModel");p("JM");R(JM,"JmolBioModelSet");p("JM");s(["J.api.JmolBioResolver","java.util.Hashtable"],"JM.Resolver","java.lang.Boolean $.Byte $.NullPointerException $.Short java.util.Arrays JU.AU $.BS $.Measure $.P3 $.P4 $.PT $.SB $.V3 J.c.STR JM.Group JM.AlphaMonomer $.AlphaPolymer $.AminoMonomer $.AminoPolymer $.BioModel $.CarbohydrateMonomer $.CarbohydratePolymer $.Monomer $.NucleicMonomer $.NucleicPolymer $.PhosphorusMonomer $.PhosphorusPolymer JU.BSUtil $.Logger".split(" "),
function(){c$=w(function(){this.bsAddedMask=this.ms=this.ml=this.plane=this.vNorm=this.vAB=this.vwr=null;this.lastSetH=-2147483648;this.maxSerial=0;this.haveHsAlready=!1;this.hNames=this.htGroupBonds=this.htBondMap=this.bsAtomsForHs=this.bsAddedHydrogens=null;this.baseBondIndex=0;this.bsAssigned=null;v(this,arguments)},JM,"Resolver",null,[J.api.JmolBioResolver,java.util.Comparator]);D(c$,function(){});h(c$,"setLoader",function(a){this.ml=a;this.bsAddedMask=null;this.lastSetH=-2147483648;this.maxSerial=
0;this.haveHsAlready=!1;null==a?this.hNames=this.htGroupBonds=this.htBondMap=this.bsAddedHydrogens=this.bsAtomsForHs=this.bsAssigned=this.ms=null:(JM.Group.specialAtomNames=JM.Resolver.specialAtomNames,this.ms=a.ms,this.vwr=a.ms.vwr,a.specialAtomIndexes=y(JM.Resolver.ATOMID_MAX,0));return this},"JM.ModelLoader");h(c$,"setViewer",function(a){this.vwr=a;if(null==JM.Group.standardGroupList){var b=new JU.SB;for(a=1;42>a;a++)b.append(",[").append(JM.Resolver.predefinedGroup3Names[a]).append("]");b.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.Resolver.group3Count=A(b.length()/6);JM.Group.standardGroupList=b.toString();a=0;for(b=JM.Resolver.predefinedGroup3Names.length;a<b;++a)JM.Resolver.addGroup3Name(JM.Resolver.predefinedGroup3Names[a].trim())}return this},"JV.Viewer");h(c$,"getBioModel",function(a,b,c,d,f){return new JM.BioModel(this.ms,a,b,c,d,f)},"~N,~N,~S,java.util.Properties,java.util.Map");h(c$,"distinguishAndPropagateGroup",function(a,b,c,d,f,g,k,e){g=0;for(var j=JM.Resolver.ATOMID_MAX;0<=--j;)k[j]=-2147483648;for(j=f;j>=d;--j){var h=
e[j].atomID;0>=h||(14>h&&(g|=1<<h),k[h]=j)}j=null;14==(g&14)?j=JM.AminoMonomer.validateAndAllocate(a,b,c,d,f,k,e):4==g?j=JM.AlphaMonomer.validateAndAllocateA(a,b,c,d,f,k):8128==(g&8128)?j=JM.NucleicMonomer.validateAndAllocate(a,b,c,d,f,k):8192==g?j=JM.PhosphorusMonomer.validateAndAllocateP(a,b,c,d,f,k):JM.Resolver.checkCarbohydrate(b)&&(j=JM.CarbohydrateMonomer.validateAndAllocate(a,b,c,d,f));return null!=j&&0<=j.leadAtomIndex?j:null},"JM.Chain,~S,~N,~N,~N,~N,~A,~A");h(c$,"setHaveHsAlready",function(a){this.haveHsAlready=
a},"~B");h(c$,"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});h(c$,"addImplicitHydrogenAtoms",function(a,b,c){var d=this.ml.getGroup3(b),f;if(!this.haveHsAlready&&!(null==d||0==(f=JM.Resolver.getStandardPdbHydrogenCount(d)))){c=0>f?-1:f+c;f=null;b=
this.ml.getFirstAtomIndex(b);var g=this.ms.ac;if(0>c){if(1==g-b)return;f=this.vwr.getLigandModel(d,"ligand_","_data",null);if(null==f)return;c=a.getHydrogenAtomCount(f);if(1>c)return}this.getBondInfo(a,d,f);this.ms.am[this.ms.at[b].mi].isPdbWithMultipleBonds=!0;this.bsAtomsForHs.setBits(b,g);this.bsAddedHydrogens.setBits(g,g+c);a=this.ms.at[b].isHetero();d=JU.P3.new3(NaN,NaN,NaN);b=this.ms.at[b];for(f=0;f<c;f++)this.ms.addAtom(b.mi,b.group,1,"H",null,0,b.getSeqID(),0,d,NaN,null,0,0,1,0,null,a,0,null).$delete(null)}},
"J.api.JmolAdapter,~N,~N");e(c$,"getBondInfo",function(a,b,c){if(null==this.htGroupBonds.get(b)&&(a=null==c?this.getPdbBondInfo(b,this.vwr.g.legacyHAddition):this.getLigandBondInfo(a,c,b),null!=a)){this.htGroupBonds.put(b,Boolean.TRUE);for(c=0;c<a.length;c++)null!=a[c]&&("H"==a[c][1].charAt(0)?this.htBondMap.put(b+"."+a[c][0],a[c][1]):this.htBondMap.put(b+":"+a[c][0]+":"+a[c][1],a[c][2]))}},"J.api.JmolAdapter,~S,~O");e(c$,"getLigandBondInfo",function(a,b,c){var d=a.getBondList(b),f=new java.util.Hashtable;
for(a=a.getAtomIterator(b);a.hasNext();)f.put(a.getAtomName(),a.getXYZ());a=Array(2*d.length);for(var g=b=0;g<d.length;g++){var k=d[g];"H"!=k[0].charAt(0)&&(a[b++]=G(-1,[k[0],k[1],k[2],k[1].startsWith("H")?"0":"1"]));"H"!=k[1].charAt(0)&&(a[b++]=G(-1,[k[1],k[0],k[2],k[0].startsWith("H")?"0":"1"]))}java.util.Arrays.sort(a,this);for(var e,g=0;g<b;){e=a[g];for(var d=e[0],j=k=0;g<b&&(e=a[g])[0].equals(d);g++)e[3].equals("0")?k++:e[3].equals("1")&&j++;d=g-k-j;if(1!=k)switch(j){case 1:for(var j=2==k?"@":
"|",h=1;h<k;h++)a[d][1]+=j+a[d+h][1],a[d+h]=null;continue;case 2:if(2!=k)continue;var j=a[d][0],h=a[d+k][1],k=a[d+k+1][1],l=h.compareTo(k);JU.Measure.getPlaneThroughPoints(f.get(h),f.get(j),f.get(k),this.vNorm,this.vAB,this.plane);k=JU.Measure.distanceToPlane(this.plane,f.get(a[d][1]))*l;a[d][1]=0<k?a[d][1]+"@"+a[d+1][1]:a[d+1][1]+"@"+a[d][1];a[d+1]=null}}for(g=0;g<b;g++)null!=(e=a[g])&&"H"!=e[1].charAt(0)&&0<e[0].compareTo(e[1])?a[g]=null:null!=e&&JU.Logger.info(" ligand "+c+": "+a[g][0]+" - "+a[g][1]+
" order "+a[g][2]);return a},"J.api.JmolAdapter,~O,~S");h(c$,"compare",function(a,b){return null==b?null==a?0:-1:null==a?1:0>a[0].compareTo(b[0])?-1:0<a[0].compareTo(b[0])?1:0>a[3].compareTo(b[3])?-1:0<a[3].compareTo(b[3])?1:0>a[1].compareTo(b[1])?-1:0<a[1].compareTo(b[1])?1:0},"~A,~A");h(c$,"finalizeHydrogens",function(){this.vwr.getLigandModel(null,null,null,null);this.finalizePdbMultipleBonds();this.addHydrogens()});e(c$,"addHydrogens",function(){if(!(0>this.bsAddedHydrogens.nextSetBit(0))){this.bsAddedMask=
JU.BSUtil.copy(this.bsAddedHydrogens);this.finalizePdbCharges();for(var a=y(1,0),a=this.ms.calculateHydrogens(this.bsAtomsForHs,a,!0,!1,null),b=null,c=0,d=0;d<a.length;d++)if(null!=a[d]){var f=this.ms.at[d],g=f.group;if(g!==b){b=g;for(c=g.lastAtomIndex;this.bsAddedHydrogens.get(c);)c--}var k=f.getGroup3(!1),e=f.getAtomName(),j=this.htBondMap.get(k+"."+e);if(null!=j){var h=j.contains("@"),l=j.endsWith("?")||0<=j.indexOf("|"),m=a[d].length;3==m&&(!l&&j.equals("H@H2"))&&(j="H|H2|H3",l=!0,h=!1);if(h&&
3==m||l!=(3==m))JU.Logger.info("Error adding H atoms to "+k+g.getResno()+": "+a[d].length+" atoms should not be added to "+e);else switch(e=j.indexOf("@"),a[d].length){case 1:0<e&&(j=j.substring(0,e));this.setHydrogen(d,++c,j,a[d][0]);break;case 2:h=-1;l=f.bonds;if(null!=l)switch(l.length){case 2:h=l[0].getOtherAtom(f),l=l[1].getOtherAtom(f),m=h.getAtomName().compareTo(l.getAtomName()),h=JU.Measure.distanceToPlane(JU.Measure.getPlaneThroughPoints(h,f,l,this.vNorm,this.vAB,this.plane),a[d][0])*m}0>
e?(JU.Logger.info("Error adding H atoms to "+k+g.getResno()+": expected to only need 1 H but needed 2"),f=g="H"):0>h?(g=j.substring(0,e),f=j.substring(e+1)):(f=j.substring(0,e),g=j.substring(e+1));this.setHydrogen(d,++c,f,a[d][0]);this.setHydrogen(d,++c,g,a[d][1]);break;case 3:f=j.indexOf("|"),0<=f?(g=j.lastIndexOf("|"),this.hNames[0]=j.substring(0,f),this.hNames[1]=j.substring(f+1,g),this.hNames[2]=j.substring(g+1)):(this.hNames[0]=j.$replace("?","1"),this.hNames[1]=j.$replace("?","2"),this.hNames[2]=
j.$replace("?","3")),this.setHydrogen(d,++c,this.hNames[0],a[d][0]),this.setHydrogen(d,++c,this.hNames[1],a[d][2]),this.setHydrogen(d,++c,this.hNames[2],a[d][1])}}}this.deleteUnneededAtoms();this.ms.fixFormalCharges(JU.BSUtil.newBitSet2(this.ml.baseAtomIndex,this.ml.ms.ac))}});e(c$,"deleteUnneededAtoms",function(){for(var a=new JU.BS,b=this.bsAtomsForHs.nextSetBit(0);0<=b;b=this.bsAtomsForHs.nextSetBit(b+1)){var c=this.ms.at[b];if(c.isHetero()&&!(8!=c.getElementNumber()||0!=c.getFormalCharge()||2!=
c.getCovalentBondCount())){var d=c.bonds,f=d[0].getOtherAtom(c),c=d[1].getOtherAtom(c);1==f.getElementNumber()&&(d=f,f=c,c=d);if(1==c.getElementNumber())for(var d=f.bonds,g=0;g<d.length;g++)if(2==d[g].order&&8==d[g].getOtherAtom(f).getElementNumber()){this.bsAddedHydrogens.set(c.i);c.$delete(a);break}}}this.ms.deleteBonds(a,!0);this.deleteAtoms(this.bsAddedHydrogens)});e(c$,"deleteAtoms",function(a){for(var b=y(this.ms.ac,0),c=y(this.ms.ac-a.cardinality(),0),d=this.ml.baseAtomIndex,f=this.ms.am,g=
this.ms.at,k=this.ml.baseAtomIndex;k<this.ms.ac;k++)f[g[k].mi].bsAtoms.clear(k),f[g[k].mi].bsAtomsDeleted.clear(k),a.get(k)?(b[k]=d-1,f[g[k].mi].act--):(c[d]=k,b[k]=d++);this.ms.msInfo.put("bsDeletedAtoms",a);for(k=this.ml.baseGroupIndex;k<this.ml.groups.length;k++)f=this.ml.groups[k],f.firstAtomIndex>=this.ml.baseAtomIndex&&(f.firstAtomIndex=b[f.firstAtomIndex],f.lastAtomIndex=b[f.lastAtomIndex],0<=f.leadAtomIndex&&(f.leadAtomIndex=b[f.leadAtomIndex]));this.ms.adjustAtomArrays(c,this.ml.baseAtomIndex,
d);this.ms.calcBoundBoxDimensions(null,1);this.ms.resetMolecules();this.ms.validateBspf(!1);this.bsAddedMask=JU.BSUtil.deleteBits(this.bsAddedMask,a);for(k=this.ml.baseModelIndex;k<this.ms.mc;k++)this.fixAnnotations(k,"domains",1073741925),this.fixAnnotations(k,"validation",1073742189)},"JU.BS");e(c$,"fixAnnotations",function(a,b,c){var d=this.ml.ms.getInfo(a,b);null!=d&&(b=this.ml.ms.bioModelset.getCachedAnnotationMap(b,d),null!=b&&this.vwr.getAnnotationParser(!1).fixAtoms(a,b,this.bsAddedMask,c,
20))},"~N,~S,~N");e(c$,"finalizePdbCharges",function(){for(var a=this.ms.at,b=this.bsAtomsForHs.nextSetBit(0);0<=b;b=this.bsAtomsForHs.nextSetBit(b+1)){var c=a[b];c.group.getNitrogenAtom()===c&&1==c.getCovalentBondCount()&&c.setFormalCharge(1);if(0>(b=this.bsAtomsForHs.nextClearBit(b+1)))break}});e(c$,"finalizePdbMultipleBonds",function(){for(var a=new java.util.Hashtable,b=this.ms.bondCount,c=this.ms.bo,d=this.baseBondIndex;d<b;d++){var f=c[d].atom1,g=c[d].atom2,k=f.group;if(k===g.group){var e=(new JU.SB).append(k.getGroup3());
e.append(":");f=f.getAtomName();g=g.getAtomName();0<f.compareTo(g)?e.append(g).append(":").append(f):e.append(f).append(":").append(g);g=e.toString();f=this.htBondMap.get(g);null!=f&&(a.put(g,Boolean.TRUE),c[d].setOrder(JU.PT.parseInt(f)))}}for(d=this.htBondMap.keySet().iterator();d.hasNext()&&((e=d.next())||1);)if(null==a.get(e))if(0>e.indexOf(":"))a.put(e,Boolean.TRUE);else{var j=this.htBondMap.get(e);JU.Logger.info("bond "+e+" was not used; order="+j);this.htBondMap.get(e).equals("1")&&a.put(e,
Boolean.TRUE)}k=new java.util.Hashtable;for(d=this.htBondMap.keySet().iterator();d.hasNext()&&((e=d.next())||1);)null==a.get(e)&&k.put(e.substring(0,e.lastIndexOf(":")),this.htBondMap.get(e));if(!k.isEmpty())for(d=0;d<b;d++)if(f=c[d].atom1,g=c[d].atom2,f.group!==g.group&&!(null==(j=k.get(f.getGroup3(!1)+":"+f.getAtomName()))&&null==(j=k.get(g.getGroup3(!1)+":"+g.getAtomName()))))c[d].setOrder(JU.PT.parseInt(j)),JU.Logger.info("assigning order "+c[d].order+" to bond "+c[d])});e(c$,"setHydrogen",function(a,
b,c,d){if(this.bsAddedHydrogens.get(b)){var f=this.ms.at;if(-2147483648==this.lastSetH||f[b].mi!=f[this.lastSetH].mi)this.maxSerial=this.ms.getInfo(f[this.lastSetH=b].mi,"PDB_CONECT_firstAtom_count_max")[2];this.bsAddedHydrogens.clear(b);this.ms.setAtomName(b,c);f[b].setT(d);this.ms.setAtomNumber(b,++this.maxSerial);f[b].atomSymmetry=f[a].atomSymmetry;this.ml.undeleteAtom(b);this.ms.bondAtoms(f[a],f[b],1,this.ms.getDefaultMadFromOrder(1),null,0,!0,!1)}},"~N,~N,~S,JU.P3");h(c$,"fixPropertyValue",function(a,
b,c){for(var d=this.ms.at,f=I(a.cardinality(),0),g=0,k=0,e=0,j=a.nextSetBit(0);0<=j;j=a.nextSetBit(j+1),e++){if(1==d[j].getElementNumber()){if(!c)continue}else g=b[k++];f[e]=g}return f},"JU.BS,~O,~B");c$.allocateBioPolymer=e(c$,"allocateBioPolymer",function(a,b,c){for(var d=null,f=0,g=b;g<a.length;++g){var k=a[g],e;if(!u(k,JM.Monomer)||null!=(e=k).bioPolymer||null!=d&&d.getClass()!==e.getClass()||c&&!e.isConnectedAfter(d))break;d=e;f++}if(2>f)return null;c=Array(f);for(g=0;g<f;++g)c[g]=a[b+g];if(u(d,
JM.AminoMonomer))return new JM.AminoPolymer(c);if(u(d,JM.AlphaMonomer))return new JM.AlphaPolymer(c);if(u(d,JM.NucleicMonomer))return new JM.NucleicPolymer(c);if(u(d,JM.PhosphorusMonomer))return new JM.PhosphorusPolymer(c);if(u(d,JM.CarbohydrateMonomer))return new JM.CarbohydratePolymer(c);JU.Logger.error("Polymer.allocatePolymer() ... no matching polymer for monomor "+d);throw new NullPointerException;},"~A,~N,~B");h(c$,"iterateOverAllNewStructures",function(a,b){var c=a.getStructureIterator(b);
if(null!=c){var d=c.getStructuredModels();if(null!=d)for(var f=d.nextSetBit(0);0<=f;f=d.nextSetBit(f+1))this.ml.structuresDefinedInFile.set(this.ml.baseModelIndex+f);for(;c.hasNext();)c.getStructureType()!==J.c.STR.TURN&&this.setStructure(c);for(c=a.getStructureIterator(b);c.hasNext();)c.getStructureType()===J.c.STR.TURN&&this.setStructure(c)}},"J.api.JmolAdapter,~O");e(c$,"setStructure",function(a){var b=a.getSubstructureType(),c=a.getStructureID(),d=a.getSerialID(),f=a.getStrandCount(),g=a.getAtomIndices(),
k=a.getModelIndices();null==this.bsAssigned&&(this.bsAssigned=new JU.BS);this.defineStructure(b,c,d,f,a.getStartChainID(),a.getStartSequenceNumber(),a.getStartInsertionCode(),a.getEndChainID(),a.getEndSequenceNumber(),a.getEndInsertionCode(),g,k,this.bsAssigned)},"J.api.JmolAdapterStructureIterator");e(c$,"defineStructure",function(a,b,c,d,f,g,k,e,j,h,l,m,q){a=a===J.c.STR.NOT?J.c.STR.NONE:a;g=JM.Group.getSeqcodeFor(g,k);j=JM.Group.getSeqcodeFor(j,h);h=this.ms.am;this.ml.isTrajectory?m[1]=m[0]:(m[0]+=
this.ml.baseModelIndex,m[1]+=this.ml.baseModelIndex);this.ml.structuresDefinedInFile.setBits(m[0],m[1]+1);for(k=m[0];k<=m[1];k++){var x=h[k].firstAtomIndex;u(h[k],JM.BioModel)&&h[k].addSecondaryStructure(a,b,c,d,f,g,e,j,x+l[0],x+l[1],q)}},"J.c.STR,~S,~N,~N,~N,~N,~S,~N,~N,~S,~A,~A,JU.BS");h(c$,"setGroupLists",function(a){this.ml.group3Lists[a+1]=JM.Group.standardGroupList;this.ml.group3Counts[a+1]=y(JM.Resolver.group3Count+10,0);null==this.ml.group3Lists[0]&&(this.ml.group3Lists[0]=JM.Group.standardGroupList,
this.ml.group3Counts[0]=y(JM.Resolver.group3Count+10,0))},"~N");h(c$,"isKnownPDBGroup",function(a,b){var c=JM.Resolver.knownGroupID(a);return 0<c?c<b:2147483647==b&&JM.Resolver.checkCarbohydrate(a)},"~S,~N");h(c$,"lookupSpecialAtomID",function(a){if(null==JM.Resolver.htSpecialAtoms){JM.Resolver.htSpecialAtoms=new java.util.Hashtable;for(var b=JM.Resolver.specialAtomNames.length;0<=--b;){var c=JM.Resolver.specialAtomNames[b];null!=c&&JM.Resolver.htSpecialAtoms.put(c,Byte.$valueOf(b))}}a=JM.Resolver.htSpecialAtoms.get(a);
return null==a?0:a.byteValue()},"~S");e(c$,"getPdbBondInfo",function(a,b){null==JM.Resolver.htPdbBondInfo&&(JM.Resolver.htPdbBondInfo=new java.util.Hashtable);var c=JM.Resolver.htPdbBondInfo.get(a);if(null!=c)return c;c=JM.Resolver.knownGroupID(a);if(0>c||c>JM.Resolver.pdbBondInfo.length)return null;var d=JM.Resolver.pdbBondInfo[c];if(b&&0<=(c=d.indexOf("O3'")))d=d.substring(0,c);for(var f=JU.PT.getTokens(d),c=Array(A(f.length/2)),g=0,k=0;g<c.length;g++){var e=f[k++],j=f[k++];if(1==j.length)switch(j.charAt(0)){case "N":j=
"H@H2";break;case "B":j="HB3@HB2";break;case "D":j="HD3@HD2";break;case "G":j="HG3@HG2";break;case "2":j="H2'@H2''";break;case "5":j="H5''@H5'"}"H"!=j.charAt(0)&&0<e.compareTo(j)&&(d=j,j=e,e=d);c[g]=G(-1,[e,j,j.startsWith("H")?"1":"2"])}JM.Resolver.htPdbBondInfo.put(a,c);return c},"~S,~B");c$.knownGroupID=e(c$,"knownGroupID",function(a){if(null==a||0==a.length)return 0;a=JM.Resolver.htGroup.get(a);return null==a?-1:a.shortValue()},"~S");c$.checkCarbohydrate=e(c$,"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");h(c$,"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<=A(a/6)+1},"~S");h(c$,"toStdAmino3",function(a){if(0==a.length)return"";var b=new JU.SB,c=JM.Resolver.knownGroupID("==A");if(0>c)for(var d=1;20>=d;d++)c=JM.Resolver.knownGroupID(JM.Resolver.predefinedGroup3Names[d]),JM.Resolver.htGroup.put("=="+JM.Resolver.predefinedGroup1Names[d],Short.$valueOf(c));for(var d=0,f=a.length;d<f;d++)c=a.charAt(d),c=JM.Resolver.knownGroupID("=="+c),0>c&&(c=23),b.append(" ").append(JM.Resolver.predefinedGroup3Names[c]);
return b.toString().substring(1)},"~S");h(c$,"getGroupID",function(a){return JM.Resolver.getGroupIdFor(a)},"~S");c$.getGroupIdFor=e(c$,"getGroupIdFor",function(a){null!=a&&(a=a.trim());var b=JM.Resolver.knownGroupID(a);return-1==b?JM.Resolver.addGroup3Name(a):b},"~S");c$.addGroup3Name=e(c$,"addGroup3Name",function(a){JM.Resolver.group3NameCount==JM.Group.group3Names.length&&(JM.Group.group3Names=JU.AU.doubleLengthS(JM.Group.group3Names));var b=JM.Resolver.group3NameCount++;JM.Group.group3Names[b]=
a;JM.Resolver.htGroup.put(a,Short.$valueOf(b));return b},"~S");c$.getStandardPdbHydrogenCount=e(c$,"getStandardPdbHydrogenCount",function(a){a=JM.Resolver.knownGroupID(a);return 0>a||a>=JM.Resolver.pdbHydrogenCount.length?-1:JM.Resolver.pdbHydrogenCount[a]},"~S");h(c$,"getAminoAcidValenceAndCharge",function(a,b,c){if(null==a||0==a.length||3<a.length||b.equals("CA")||b.equals("CB"))return!1;var d=b.charAt(0),f=1==b.length?"\x00":b.charAt(1),g=!1,k=c[3];switch(a.length){case 3:if(1==b.length)switch(d){case "N":if(1<
k)return!1;c[1]=1;break;case "O":g=0>"HOH;DOD;WAT".indexOf(a);break;default:g=!0}else a+=d,g=0<="ARGN;ASNN;ASNO;ASPO;GLNN;GLNO;GLUO;HISN;HISC;PHECTRPC;TRPN;TYRC".indexOf(a),0<="LYSN".indexOf(a)?c[1]=1:"O"==d&&"X"==f&&(c[1]=-1);break;case 1:case 2:if(2<b.length&&"'"==b.charAt(2))return!1;switch(d){case "C":if("7"==f)return!1;break;case "N":switch(f){case "1":case "3":0<="A3;A1;C3;G3;I3".indexOf(""+a.charAt(a.length-1)+f)&&c[0]--;break;case "7":c[0]--}}g=!0}if(g)switch(d){case "N":c[2]=2;break;case "C":c[2]=
2;c[0]--;break;case "O":c[0]--}return!0},"~S,~S,~A");c$.getSpecialAtomName=e(c$,"getSpecialAtomName",function(a){return JM.Resolver.specialAtomNames[a]},"~N");h(c$,"getArgbs",function(a){switch(a){case 2097154:return JM.Resolver.argbsAmino;case 1073742144:return JM.Resolver.argbsShapely;case 1140850689:return JM.Resolver.argbsChainAtom;case 1612709894:return JM.Resolver.argbsChainHetero}return null},"~N");c$.htGroup=c$.prototype.htGroup=new java.util.Hashtable;B(c$,"htPdbBondInfo",null,"pdbBondInfo",
G(-1,";N N CA HA C O CB HB?;N N CA HA C O CB B CG G CD D NE HE CZ NH1 NH1 HH11@HH12 NH2 HH22@HH21;N N CA HA C O CB B CG OD1 ND2 HD21@HD22;N N CA HA C O CB B CG OD1;N N CA HA C O CB B SG HG;N N CA HA C O CB B CG G CD OE1 NE2 HE22@HE21;N N CA HA C O CB B CG G CD OE1;N N CA HA2@HA3 C O;N N CA HA C O CB B CG CD2 ND1 CE1 ND1 HD1 CD2 HD2 CE1 HE1 NE2 HE2;N N CA HA C O CB HB CG1 HG13@HG12 CG2 HG2? CD1 HD1?;N N CA HA C O CB B CG HG CD1 HD1? CD2 HD2?;N N CA HA C O CB B CG G CD HD2@HD3 CE HE3@HE2 NZ HZ?;N N CA HA C O CB B CG G CE HE?;N N CA HA C O CB B CG CD1 CD1 HD1 CD2 CE2 CD2 HD2 CE1 CZ CE1 HE1 CE2 HE2 CZ HZ;N H CA HA C O CB B CG G CD D;N N CA HA C O CB B OG HG;N N CA HA C O CB HB OG1 HG1 CG2 HG2?;N N CA HA C O CB B CG CD1 CD1 HD1 CD2 CE2 NE1 HE1 CE3 CZ3 CE3 HE3 CZ2 CH2 CZ2 HZ2 CZ3 HZ3 CH2 HH2;N N CA HA C O CB B CG CD1 CD1 HD1 CD2 CE2 CD2 HD2 CE1 CZ CE1 HE1 CE2 HE2 OH HH;N N CA HA C O CB HB CG1 HG1? CG2 HG2?;N N CA HA C O CB B;N N CA HA C O CB B CG G;;P OP1 C5' 5 C4' H4' C3' H3' C2' H2' O2' HO2' C1' H1' C8 N7 C8 H8 C5 C4 C6 O6 N1 H1 C2 N3 N2 H22@H21 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' H2' O2' HO2' C1' H1' C2 O2 N3 C4 N4 H41@H42 C5 C6 C5 H5 C6 H6 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' H2' O2' HO2' C1' H1' C8 N7 C8 H8 C5 C4 C6 N1 N6 H61@H62 C2 N3 C2 H2 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' 2 C1' H1' C2 O2 N3 H3 C4 O4 C5 C6 C7 H7? C6 H6 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' H2' O2' HO2' C1' H1' C2 O2 N3 H3 C4 O4 C5 C6 C5 H5 C6 H6 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' H2' O2' HO2' C1' H1' C8 N7 C8 H8 C5 C4 C6 O6 N1 H1 C2 N3 C2 H2 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' 2 C1' H1' C8 N7 C8 H8 C5 C4 C6 O6 N1 H1 C2 N3 N2 H22@H21 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' 2 C1' H1' C2 O2 N3 C4 N4 H41@H42 C5 C6 C5 H5 C6 H6 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' 2 C1' H1' C8 N7 C8 H8 C5 C4 C6 N1 N6 H61@H62 C2 N3 C2 H2 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' 2 C1' H1' C2 O2 N3 H3 C4 O4 C5 C6 C7 H7? C6 H6 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' 2 C1' H1' C2 O2 N3 H3 C4 O4 C5 C6 C5 H5 C6 H6 O3' HO3' O5' HO5';P OP1 C5' 5 C4' H4' C3' H3' C2' 2 C1' H1' C8 N7 C8 H8 C5 C4 C6 O6 N1 H1 C2 N3 C2 H2 O3' HO3' O5' HO5'".split(";")),
"pdbHydrogenCount",y(-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]),"allCarbohydrates",",[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]","group3Count",0,"predefinedGroup1Names",
N(-1,"\x00ARNDCQEGHILKMFPSTWYVAG?GCATUIGCATUIGCATUI".split("")),"group3NameCount",0,"predefinedGroup3Names",G(-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(";")),"naNoH","A3;A1;C3;G3;I3","aaSp2","ARGN;ASNN;ASNO;ASPO;GLNN;GLNO;GLUO;HISN;HISC;PHECTRPC;TRPN;TYRC","aaPlus","LYSN","specialAtomNames",G(-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"]));c$.ATOMID_MAX=c$.prototype.ATOMID_MAX=JM.Resolver.specialAtomNames.length;B(c$,"htSpecialAtoms",null,"argbsAmino",y(-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]),"argbsChainAtom",y(-1,[4294967295,4290826495,4289789872,4294951112,4294967168,4294951167,4289786096,
4294955120,4293951616,4294303411,4278239231,4291648604,4284927402,4288335154,4293821166,4278243025,4278255487,4282168177,4278190219,4290623339,4278215680,4286578688,4286611456,4286578816,4278222976,4290283019,4289864226]),"argbsChainHetero",y(-1,[4294967295,-7298865,-8335464,-3174224,-3158160,-3174193,-8339264,-3170208,-4173712,-3821949,-16734257,-4895668,-11094638,-7686870,-4296002,-16730463,-16724113,-13329567,-16777029,-5922981,-16739328,-5242880,-5197824,-5242704,-16731984,-1526253,-4050382]),
"argbsShapely",y(-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]))});p("JM");s(["JM.Group"],
"JM.Monomer","java.lang.Float JU.Measure $.P3 $.Quat J.c.STR JM.ProteinStructure $.Resolver JU.Escape $.Logger JV.JC".split(" "),function(){c$=w(function(){this.offsets=this.bioPolymer=null;this.monomerIndex=-1;this.theta=this.mu=this.straightness=this.omega=this.psi=this.phi=NaN;v(this,arguments)},JM,"Monomer",JM.Group);D(c$,function(){K(this,JM.Monomer,[])});c$.have=e(c$,"have",function(a,b){return 255!=(a[b]&255)},"~A,~N");e(c$,"set2",function(a,b,c,d,f,g){this.setGroup(a,b,c,d,f);this.offsets=
g;this.setLeadAtomIndex();return this},"JM.Chain,~S,~N,~N,~N,~A");e(c$,"setLeadAtomIndex",function(){var a=this.offsets[0]&255;255!=a&&(this.leadAtomIndex=this.firstAtomIndex+a)});e(c$,"setBioPolymer",function(a,b){this.bioPolymer=a;this.monomerIndex=b},"JM.BioPolymer,~N");h(c$,"getSelectedMonomerCount",function(){return null==this.bioPolymer?0:this.bioPolymer.getSelectedMonomerCount()});h(c$,"getSelectedMonomerIndex",function(){return null==this.bioPolymer||!this.bioPolymer.isMonomerSelected(this.monomerIndex)?
-1:this.monomerIndex});h(c$,"getBioPolymerLength",function(){return null==this.bioPolymer?0:this.bioPolymer.monomerCount});e(c$,"getMonomerIndex",function(){return this.monomerIndex});h(c$,"getAtomIndex",function(a,b){if(null!=this.bioPolymer){var c=this.bioPolymer.monomers,d=this.monomerIndex+b;if(0<=d&&d<c.length){c=c[d];if(1==b&&!c.isConnectedPrevious())return-1;if("\x00".equals(a))return c.leadAtomIndex;for(var d=this.chain.model.ms.at,f=c.firstAtomIndex;f<=c.lastAtomIndex;f++)if(null==a||a.equalsIgnoreCase(d[f].getAtomName()))return f}}return-1},
"~S,~N");e(c$,"getBioPolymerIndexInModel",function(){return null==this.bioPolymer?-1:this.bioPolymer.bioPolymerIndexInModel});c$.scanForOffsets=e(c$,"scanForOffsets",function(a,b,c){for(var d=c.length,f=F(d,0);0<=--d;){var g,k=c[d];if(0>k)g=b[~k];else if(g=b[k],0>g)return null;var e;if(0>g)e=255;else if(e=g-a,0>e||254<e)JU.Logger.warn("Monomer.scanForOffsets i="+d+" atomID="+k+" atomIndex:"+g+" firstAtomIndex:"+a+" offset out of 0-254 range. Groups aren't organized correctly. Is this really a protein?: "+
e),0>k&&(e=255);f[d]=e}return f},"~N,~A,~A");h(c$,"getProteinStructureType",function(){return J.c.STR.NONE});e(c$,"isHelix",function(){return!1});e(c$,"isSheet",function(){return!1});h(c$,"setStrucNo",function(){},"~N");e(c$,"getAtomFromOffsetIndex",function(a){if(a>this.offsets.length)return null;a=this.offsets[a]&255;return 255==a?null:this.chain.model.ms.at[this.firstAtomIndex+a]},"~N");e(c$,"getSpecialAtom",function(a,b){for(var c=a.length;0<=--c;){var d=a[c];0>d&&(d=-d);if(b==d)return c=this.offsets[c]&
255,255==c?null:this.chain.model.ms.at[this.firstAtomIndex+c]}return null},"~A,~N");e(c$,"getSpecialAtomPoint",function(a,b){for(var c=a.length;0<=--c;){var d=a[c];0>d&&(d=-d);if(b==d)return c=this.offsets[c]&255,255==c?null:this.chain.model.ms.at[this.firstAtomIndex+c]}return null},"~A,~N");h(c$,"isLeadAtom",function(a){return a==this.leadAtomIndex},"~N");h(c$,"getLeadAtom",function(){return this.getAtomFromOffsetIndex(0)});e(c$,"getWingAtom",function(){return this.getAtomFromOffsetIndex(1)});e(c$,
"getInitiatorAtom",function(){return this.getLeadAtom()});e(c$,"getTerminatorAtom",function(){return this.getLeadAtom()});e(c$,"findNearestAtomIndex",function(){},"~N,~N,~A,~N,~N");e(c$,"getMyInfo",function(a){a=this.getGroupInfo(this.groupIndex,a);a.put("chain",this.chain.getIDStr());var b=this.getResno();0<b&&a.put("sequenceNumber",Integer.$valueOf(b));b=this.getInsertionCode();0!=b.charCodeAt(0)&&a.put("insertionCode",""+b);b=this.getGroupParameter(1111490569);Float.isNaN(b)||a.put("phi",Float.$valueOf(b));
b=this.getGroupParameter(1111490570);Float.isNaN(b)||a.put("psi",Float.$valueOf(b));b=this.getGroupParameter(1111490565);Float.isNaN(b)||a.put("mu",Float.$valueOf(b));b=this.getGroupParameter(1111490576);Float.isNaN(b)||a.put("theta",Float.$valueOf(b));b=this.getStructure();u(b,JM.ProteinStructure)&&(a.put("structureId",Integer.$valueOf(b.strucNo)),a.put("structureType",b.type.getBioStructureTypeName(!1)));a.put("shapeVisibilityFlags",Integer.$valueOf(this.shapeVisibilityFlags));return a},"JU.P3");
h(c$,"getStructureId",function(){var a=this.getStructure();return u(a,JM.ProteinStructure)?a.type.getBioStructureTypeName(!1):""});e(c$,"updateOffsetsForAlternativeLocations",function(a,b){for(var c=this.offsets.length;0<=--c;){var d=this.offsets[c]&255;if(255!=d){var d=this.firstAtomIndex+d,f=a[d],g=f.atomID;if(0!=f.altloc.charCodeAt(0))for(var k=this.lastAtomIndex-this.firstAtomIndex,e=1;e<=k;e++){var j=d+e;j>this.lastAtomIndex&&(j-=k+1);var h=j-this.firstAtomIndex;if(!(0>h||255<h||j==d||!b.get(j))){var l=
a[j].atomID;if(!(l!=g||0==l&&!a[j].getAtomName().equals(f.getAtomName()))){this.offsets[c]=h;a[j].nBackbonesDisplayed=f.nBackbonesDisplayed;break}}}}}this.setLeadAtomIndex()},"~A,JU.BS");e(c$,"getMonomerSequenceAtoms",function(a,b){this.setAtomBits(b);b.and(a)},"JU.BS,JU.BS");c$.checkOptional=e(c$,"checkOptional",function(a,b,c,d){if(JM.Monomer.have(a,b))return!0;if(0>d)return!1;a[b]=d-c;return!0},"~A,~N,~N,~N");e(c$,"getQuaternionFrameCenter",function(){return null},"~S");e(c$,"getHelixData2",function(a,
b,c){if(0>this.monomerIndex)return null;var d=this.monomerIndex-c,f=1>c||0>=this.monomerIndex?null:this.bioPolymer.monomers[d],d=this.getQuaternion(b),g=1>c?JU.Quat.getQuaternionFrameV(JV.JC.axisX,JV.JC.axisY,JV.JC.axisZ,!1):null==f?null:f.getQuaternion(b);if(null==g||null==d)return this.getHelixData(a,b,c);var f=1>c?JU.P3.new3(0,0,0):f.getQuaternionFrameCenter(b),k=this.getQuaternionFrameCenter(b);return null==f||null==k?this.getHelixData(a,b,c):JU.Escape.escapeHelical(135176==a?"helixaxis"+this.getUniqueID():
null,a,f,k,JU.Measure.computeHelicalAxis(f,k,d.div(g)))},"~N,~S,~N");e(c$,"getUniqueID",function(){var a=this.chain.chainID,b=this.getLeadAtom(),a=(null==b?"":"_"+b.mi)+"_"+this.getResno()+(0==a?"":"_"+a),b=null==b?"\x00":this.getLeadAtom().altloc;"\x00"!=b&&(a+="_"+b);return a});h(c$,"isCrossLinked",function(a){for(var b=this.firstAtomIndex;b<=this.lastAtomIndex;b++)if(this.getCrossLinkGroup(b,null,a,!0,!0,!1))return!0;return!1},"JM.Group");h(c$,"getCrossLinkVector",function(a,b,c){for(var d=null==
a,f=this.firstAtomIndex;f<=this.lastAtomIndex;f++)if(this.getCrossLinkGroup(f,a,null,b,c,d)&&d)return!0;return!d&&0<a.size()},"JU.Lst,~B,~B");e(c$,"getCrossLinkGroup",function(a,b,c,d,f,g){var k=this.chain.model.ms.at[a],e=k.bonds,j=this.getBioPolymerIndexInModel();if(0>j||null==e)return!1;var h=!1;g=!g&&null==b&&null==c;for(var l=0;l<e.length;l++){var m=e[l];if(!(m.isCovalent()?!d:!f)){var m=m.getOtherAtom(k),q=m.group;if(!(null!=c&&q!==c)){var x=q.getBioPolymerIndexInModel(),p=q.getMonomerIndex();
if(g){if(x==j&&p==this.monomerIndex-1)return!0}else if(0<=x&&0<=p&&(x!=j||p<this.monomerIndex-1||p>this.monomerIndex+1)){h=!0;if(null!=c||null==b)break;b.addLast(Integer.$valueOf(a));b.addLast(Integer.$valueOf(m.i));b.addLast(Integer.$valueOf(q.leadAtomIndex))}}}}return h},"~N,JU.Lst,JM.Group,~B,~B,~B");e(c$,"isConnectedPrevious",function(){return!0});e(c$,"setGroupParameter",function(a,b){switch(a){case 1111490569:this.phi=b;break;case 1111490570:this.psi=b;break;case 1111490568:this.omega=b;break;
case 1111490565:this.mu=b;break;case 1111490576:this.theta=b;break;case 1111490574:this.straightness=b}},"~N,~N");h(c$,"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(c$,"getGroup1",function(){return this.groupID<JM.Resolver.predefinedGroup1Names.length?JM.Resolver.predefinedGroup1Names[this.groupID]:1<this.group1.charCodeAt(0)?this.group1:1==this.group1.charCodeAt(0)?"?":this.group1=this.getGroup1b()});e(c$,"getGroup1b",function(){return"?"});h(c$,"setGroupID",function(a){this.groupID=JM.Resolver.getGroupIdFor(a)},"~S")});p("JM");s(["JM.Monomer"],"JM.AlphaMonomer","JU.Quat $.V3 J.c.STR JM.Helix $.Sheet $.Turn".split(" "),function(){c$=w(function(){this.nitrogenHydrogenPoint=
this.proteinStructure=null;v(this,arguments)},JM,"AlphaMonomer",JM.Monomer);h(c$,"isProtein",function(){return!0});c$.validateAndAllocateA=e(c$,"validateAndAllocateA",function(a,b,c,d,f,g){return d!=f||g[2]!=d?null:(new JM.AlphaMonomer).set2(a,b,c,d,f,JM.AlphaMonomer.alphaOffsets)},"JM.Chain,~S,~N,~N,~N,~A");L(c$,function(){});e(c$,"isAlphaMonomer",function(){return!0});h(c$,"getStructure",function(){return this.proteinStructure});e(c$,"setStructure",function(a){if(null==(this.proteinStructure=a))this.nitrogenHydrogenPoint=
null},"JM.ProteinStructure");h(c$,"setStrucNo",function(a){null!=this.proteinStructure&&(this.proteinStructure.strucNo=a)},"~N");h(c$,"getProteinStructureType",function(){return null==this.proteinStructure?J.c.STR.NONE:this.proteinStructure.type});h(c$,"getProteinStructureSubType",function(){return null==this.proteinStructure?J.c.STR.NONE:this.proteinStructure.subtype});h(c$,"getStrucNo",function(){return null!=this.proteinStructure?this.proteinStructure.strucNo:0});h(c$,"isHelix",function(){return null!=
this.proteinStructure&&this.proteinStructure.type===J.c.STR.HELIX});h(c$,"isSheet",function(){return null!=this.proteinStructure&&this.proteinStructure.type===J.c.STR.SHEET});h(c$,"setProteinStructureType",function(a,b){null!=this.proteinStructure&&this.proteinStructure.removeMonomer(this.monomerIndex);if(0>b||0<b&&0==this.monomerIndex)switch(a){case J.c.STR.HELIX:case J.c.STR.HELIXALPHA:case J.c.STR.HELIX310:case J.c.STR.HELIXPI:this.setStructure(new JM.Helix(this.bioPolymer,this.monomerIndex,1,
a));break;case J.c.STR.SHEET:this.setStructure(new JM.Sheet(this.bioPolymer,this.monomerIndex,1,a));break;case J.c.STR.TURN:this.setStructure(new JM.Turn(this.bioPolymer,this.monomerIndex,1));break;case J.c.STR.NONE:this.setStructure(null)}else this.setStructure(this.bioPolymer.getProteinStructure(b)),null!=this.proteinStructure&&this.proteinStructure.addMonomer(this.monomerIndex);return this.monomerIndex},"J.c.STR,~N");e(c$,"getAtom",function(a){return 2==a?this.getLeadAtom():null},"~N");e(c$,"getAtomPoint",
function(a){return 2==a?this.getLeadAtom():null},"~N");h(c$,"isConnectedAfter",function(a){if(null==a)return!0;var b=this.getLeadAtom();a=a.getLeadAtom();return b.isBonded(a)||4.2>=b.distance(a)},"JM.Monomer");h(c$,"getQuaternionFrameCenter",function(a){return this.getQuaternionFrameCenterAlpha(a)},"~S");h(c$,"isWithinStructure",function(a){return null!=this.proteinStructure&&this.proteinStructure.type===a&&this.proteinStructure.isWithin(this.monomerIndex)},"J.c.STR");e(c$,"getQuaternionFrameCenterAlpha",
function(a){switch(a){case "b":case "c":case "C":case "x":return this.getLeadAtom();default:case "a":case "n":case "p":case "P":case "q":return null}},"~S");h(c$,"getHelixData",function(a,b,c){return this.getHelixData2(a,b,c)},"~N,~S,~N");h(c$,"getQuaternion",function(a){return this.getQuaternionAlpha(a)},"~S");e(c$,"getQuaternionAlpha",function(a){if(0>this.monomerIndex)return null;var b=new JU.V3,c=new JU.V3;switch(a){default:case "a":case "n":case "p":case "q":return null;case "b":case "c":case "x":if(0==
this.monomerIndex||this.monomerIndex==this.bioPolymer.monomerCount-1)return null;a=this.getLeadAtom();var d=this.bioPolymer.getLeadPoint(this.monomerIndex+1),f=this.bioPolymer.getLeadPoint(this.monomerIndex-1);b.sub2(d,a);c.sub2(f,a)}return JU.Quat.getQuaternionFrameV(b,c,null,!1)},"~S");B(c$,"alphaOffsets",F(-1,[0]))});p("JM");s(["JM.Structure"],"JM.ProteinStructure",["java.util.Hashtable","JU.P3","$.V3","JU.Logger"],function(){c$=w(function(){this.structureID=this.subtype=this.type=null;this.nRes=
this.strandCount=this.serialID=this.strucNo=0;this.apolymer=null;this.monomerIndexLast=this.monomerIndexFirst=0;this.resMap=this.segments=this.vectorProjection=this.axisUnitVector=this.axisB=this.axisA=null;v(this,arguments)},JM,"ProteinStructure",null,JM.Structure);e(c$,"setupPS",function(a,b,c,d){this.strucNo=++JM.ProteinStructure.globalStrucNo;this.apolymer=a;this.type=b;this.vectorProjection=new JU.V3;this.monomerIndexFirst=c;this.addMonomer(c+d-1);JU.Logger.debugging&&JU.Logger.info("Creating ProteinStructure "+
this.strucNo+" "+b.getBioStructureTypeName(!1)+" from "+this.monomerIndexFirst+" through "+this.monomerIndexLast+" in polymer "+a)},"JM.AlphaPolymer,J.c.STR,~N,~N");e(c$,"addMonomer",function(a){this.resMap=null;this.resetAxes();this.monomerIndexFirst=Math.min(this.monomerIndexFirst,a);this.monomerIndexLast=Math.max(this.monomerIndexLast,a);this.nRes=this.monomerIndexLast-this.monomerIndexFirst+1},"~N");e(c$,"removeMonomer",function(a){this.resMap=null;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 b=this.monomerIndexLast-a;this.monomerIndexLast=a-1;this.nRes=a-this.monomerIndexFirst;for(var c=this.apolymer.monomers,d=c[++a].getProteinStructureType(),f=-1,g=0;g<b;g++,a++)c[a].setStructure(null),f=c[a].setProteinStructureType(d,f)}},"~N");e(c$,"calcAxis",function(){});e(c$,"isWithin",function(a){return a>this.monomerIndexFirst&&
a<this.monomerIndexLast},"~N");e(c$,"getIndex",function(a){if(null==this.resMap){this.resMap=new java.util.Hashtable;for(var b=this.nRes;0<=--b;)this.resMap.put(this.apolymer.monomers[this.monomerIndexFirst+b],Integer.$valueOf(b))}a=this.resMap.get(a);return null==a?-1:a.intValue()},"JM.Monomer");e(c$,"getSegments",function(){null==this.segments&&this.calcSegments();return this.segments});e(c$,"getStructureMidPoint",function(a){null==this.segments&&this.calcSegments();return this.segments[a]},"~N");
e(c$,"calcSegments",function(){if(null==this.segments){this.calcAxis();this.segments=Array(this.nRes+1);this.segments[this.nRes]=this.axisB;this.segments[0]=this.axisA;var a=JU.V3.newV(this.axisUnitVector);a.scale(this.axisB.distance(this.axisA)/this.nRes);for(var b=1;b<this.nRes;b++)(this.segments[b]=new JU.P3).add2(this.segments[b-1],a)}});e(c$,"getAxisStartPoint",function(){this.calcAxis();return this.axisA});e(c$,"getAxisEndPoint",function(){this.calcAxis();return this.axisB});e(c$,"resetAxes",
function(){this.segments=this.axisA=null});h(c$,"setAtomBits",function(a){for(var b=this.apolymer.monomers,c=this.monomerIndexFirst;c<=this.monomerIndexLast;c++)b[c].setAtomBits(a)},"JU.BS");h(c$,"setAtomBitsAndClear",function(a,b){for(var c=this.apolymer.monomers,d=this.monomerIndexFirst;d<=this.monomerIndexLast;d++)c[d].setAtomBitsAndClear(a,b)},"JU.BS,JU.BS");e(c$,"findMonomer",function(a,b){var c=this.apolymer.monomers;if(b)for(var d=this.monomerIndexFirst;d<=this.monomerIndexLast;d++){if(null==
a||a.get(c[d].leadAtomIndex))return c[d]}else for(d=this.monomerIndexLast;d>=this.monomerIndexFirst;--d)if(null==a||a.get(c[d].leadAtomIndex))return c[d];return null},"JU.BS,~B");B(c$,"globalStrucNo",1E3)});p("JM");s(["JM.ProteinStructure"],"JM.Helix",["JU.Measure","$.P3","$.V3","J.c.STR"],function(){c$=C(JM,"Helix",JM.ProteinStructure);L(c$,function(a,b,c,d){this.setupPS(a,J.c.STR.HELIX,b,c);this.subtype=d},"JM.AlphaPolymer,~N,~N,J.c.STR");h(c$,"calcAxis",function(){if(null==this.axisA){for(var a=
Array(this.nRes+1),b=0;b<=this.nRes;b++)this.apolymer.getLeadMidPoint(this.monomerIndexFirst+b,a[b]=new JU.P3);this.axisA=new JU.P3;this.axisUnitVector=new JU.V3;JU.Measure.calcBestAxisThroughPoints(a,this.axisA,this.axisUnitVector,this.vectorProjection,4);this.axisB=JU.P3.newP(a[this.nRes]);JU.Measure.projectOntoAxis(this.axisB,this.axisA,this.axisUnitVector,this.vectorProjection)}})});p("JM");s(["JM.ProteinStructure"],"JM.Sheet",["JU.Measure","$.P3","$.V3","J.c.STR","JM.AminoPolymer"],function(){c$=
w(function(){this.heightUnitVector=this.widthUnitVector=null;v(this,arguments)},JM,"Sheet",JM.ProteinStructure);L(c$,function(a,b,c,d){this.setupPS(a,J.c.STR.SHEET,b,c);this.subtype=d},"JM.AlphaPolymer,~N,~N,J.c.STR");h(c$,"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 b=new JU.P3;this.apolymer.getLeadMidPoint(this.monomerIndexFirst+this.nRes,b);this.notHelixOrSheet(this.monomerIndexFirst+
this.nRes)&&JU.Measure.projectOntoAxis(b,this.axisA,this.axisUnitVector,this.vectorProjection);this.axisA=a;this.axisB=b}});e(c$,"notHelixOrSheet",function(a){return 0>a||a>=this.apolymer.monomerCount||!this.apolymer.monomers[a].isHelix()&&!this.apolymer.monomers[a].isSheet()},"~N");e(c$,"calcSheetUnitVectors",function(){if(u(this.apolymer,JM.AminoPolymer)&&null==this.widthUnitVector){var a=new JU.V3,b=new JU.V3,c=this.apolymer.monomers[this.monomerIndexFirst];b.sub2(c.getCarbonylOxygenAtom(),c.getCarbonylCarbonAtom());
for(var d=this.nRes;--d>this.monomerIndexFirst;)c=this.apolymer.monomers[d],a.sub2(c.getCarbonylOxygenAtom(),c.getCarbonylCarbonAtom()),1.5707964>b.angle(a)?b.add(a):b.sub(a);this.heightUnitVector=a;this.heightUnitVector.cross(this.axisUnitVector,b);this.heightUnitVector.normalize();this.widthUnitVector=b;this.widthUnitVector.cross(this.axisUnitVector,this.heightUnitVector)}});e(c$,"setBox",function(a,b,c,d,f,g,k){null==this.heightUnitVector&&this.calcSheetUnitVectors();d.setT(this.widthUnitVector);
d.scale(k*a);f.setT(this.heightUnitVector);f.scale(k*b);g.ave(d,f);g.sub2(c,g)},"~N,~N,JU.P3,JU.V3,JU.V3,JU.P3,~N")});p("JM");s(["JM.ProteinStructure"],"JM.Turn",["J.c.STR"],function(){c$=C(JM,"Turn",JM.ProteinStructure);L(c$,function(a,b,c){this.setupPS(a,J.c.STR.TURN,b,c);this.subtype=J.c.STR.TURN},"JM.AlphaPolymer,~N,~N")});p("JM");s(["JM.Structure","JU.V3"],"JM.BioPolymer",["java.lang.Float","JU.BS","$.P3"],function(){c$=w(function(){this.monomers=this.model=null;this.hasStructure=!1;this.leadAtomIndices=
this.wingVectors=this.controlPoints=this.leadPoints=this.leadMidpoints=null;this.monomerCount=this.bioPolymerIndexInModel=this.type=0;this.invalidControl=this.invalidLead=!1;this.sheetSmoothing=0;this.hasWingPoints=!1;this.reversed=null;this.twistedSheets=!1;this.unitVectorX=null;this.selectedMonomerCount=0;this.bsSelectedMonomers=null;this.haveParameters=!1;v(this,arguments)},JM,"BioPolymer",null,JM.Structure);O(c$,function(){this.unitVectorX=JU.V3.new3(1,0,0)});D(c$,function(){});e(c$,"set",function(a){this.monomers=
a;for(var b=this.monomerCount=a.length;0<=--b;)a[b].setBioPolymer(this,b);this.model=a[0].getModel()},"~A");h(c$,"setAtomBits",function(a){this.getRange(a,!0)},"JU.BS");h(c$,"setAtomBitsAndClear",function(a,b){for(var c=this.monomerCount;0<=--c;)this.monomers[c].setAtomBitsAndClear(a,b)},"JU.BS,JU.BS");e(c$,"getRange",function(a,b){if(0!=this.monomerCount)if(b)for(var c=this.monomerCount;0<=--c;)this.monomers[c].setAtomBits(a);else a.setBits(this.monomers[0].firstAtomIndex,this.monomers[this.monomerCount-
1].lastAtomIndex+1)},"JU.BS,~B");e(c$,"clearStructures",function(){});e(c$,"getLeadAtomIndices",function(){null==this.leadAtomIndices&&(this.leadAtomIndices=y(this.monomerCount,0),this.invalidLead=!0);if(this.invalidLead){for(var a=this.monomerCount;0<=--a;)this.leadAtomIndices[a]=this.monomers[a].leadAtomIndex;this.invalidLead=!1}return this.leadAtomIndices});e(c$,"getIndex",function(a,b,c,d){var f;for(f=this.monomerCount;0<=--f;){var g=this.monomers[f];if(g.chain.chainID==a&&g.seqcode==b&&(0>c||
c==g.firstAtomIndex||d==g.lastAtomIndex))break}return f},"~N,~N,~N,~N");e(c$,"getLeadPoint",function(a){return this.monomers[a].getLeadAtom()},"~N");e(c$,"getInitiatorPoint",function(){return this.monomers[0].getInitiatorAtom()});e(c$,"getTerminatorPoint",function(){return this.monomers[this.monomerCount-1].getTerminatorAtom()});e(c$,"getLeadMidPoint",function(a,b){if(a==this.monomerCount)--a;else if(0<a){b.ave(this.getLeadPoint(a),this.getLeadPoint(a-1));return}b.setT(this.getLeadPoint(a))},"~N,JU.P3");
e(c$,"getWingPoint",function(a){return this.monomers[a].getWingAtom()},"~N");e(c$,"setConformation",function(a){for(var b=this.model.ms.at,c=this.monomerCount;0<=--c;)this.monomers[c].updateOffsetsForAlternativeLocations(b,a);this.recalculateLeadMidpointsAndWingVectors()},"JU.BS");e(c$,"recalculateLeadMidpointsAndWingVectors",function(){this.invalidLead=this.invalidControl=!0;this.getLeadAtomIndices();this.resetHydrogenPoints();this.calcLeadMidpointsAndWingVectors()});e(c$,"resetHydrogenPoints",function(){});
e(c$,"getLeadMidpoints",function(){null==this.leadMidpoints&&this.calcLeadMidpointsAndWingVectors();return this.leadMidpoints});e(c$,"getLeadPoints",function(){null==this.leadPoints&&this.calcLeadMidpointsAndWingVectors();return this.leadPoints});e(c$,"getControlPoints",function(a,b,c){c&&(this.invalidControl=!0);return!a?this.leadMidpoints:0==b?this.leadPoints:this.getControlPoints2(b)},"~B,~N,~B");e(c$,"getControlPoints2",function(a){if(!this.invalidControl&&a==this.sheetSmoothing)return this.controlPoints;
this.getLeadPoints();var b=new JU.V3;null==this.controlPoints&&(this.controlPoints=Array(this.monomerCount+1));Float.isNaN(a)||(this.sheetSmoothing=a);for(a=0;a<this.monomerCount;a++)this.controlPoints[a]=this.getControlPoint(a,b);this.controlPoints[this.monomerCount]=this.getTerminatorPoint();this.invalidControl=!1;return this.controlPoints},"~N");e(c$,"getControlPoint",function(a){return this.leadPoints[a]},"~N,JU.V3");e(c$,"getWingVectors",function(){null==this.leadMidpoints&&this.calcLeadMidpointsAndWingVectors();
return this.wingVectors});e(c$,"calcLeadMidpointsAndWingVectors",function(){null==this.leadMidpoints&&(this.leadMidpoints=Array(this.monomerCount+1),this.leadPoints=Array(this.monomerCount+1),this.wingVectors=Array(this.monomerCount+1),this.sheetSmoothing=1.4E-45);null==this.reversed?this.reversed=JU.BS.newN(this.monomerCount):this.reversed.clearAll();this.twistedSheets=this.model.ms.vwr.getBoolean(603979968);var a=new JU.V3,b=new JU.V3,c=new JU.V3,d=new JU.V3,f,g;this.leadMidpoints[0]=this.getInitiatorPoint();
this.leadPoints[0]=g=this.getLeadPoint(0);for(var k=null,e=1;e<this.monomerCount;++e){f=g;this.leadPoints[e]=g=this.getLeadPoint(e);var j=new JU.P3;j.ave(g,f);this.leadMidpoints[e]=j;this.hasWingPoints&&(a.sub2(g,f),b.sub2(f,this.getWingPoint(e-1)),c.cross(a,b),d.cross(a,c),d.normalize(),!this.twistedSheets&&(null!=k&&1.5707963267948966<k.angle(d))&&(this.reversed.set(e),d.scale(-1)),k=this.wingVectors[e]=JU.V3.newV(d))}this.leadPoints[this.monomerCount]=this.leadMidpoints[this.monomerCount]=this.getTerminatorPoint();
if(!this.hasWingPoints)if(3>this.monomerCount)this.wingVectors[1]=this.unitVectorX;else{d=null;for(e=1;e<this.monomerCount;++e)a.sub2(this.leadMidpoints[e],this.leadPoints[e]),b.sub2(this.leadPoints[e],this.leadMidpoints[e+1]),c.cross(a,b),c.normalize(),null!=d&&1.5707963267948966<d.angle(c)&&c.scale(-1),d=this.wingVectors[e]=JU.V3.newV(c)}this.wingVectors[0]=this.wingVectors[1];this.wingVectors[this.monomerCount]=this.wingVectors[this.monomerCount-1]});e(c$,"findNearestAtomIndex",function(a,b,c,
d,f,g){for(var k=this.monomerCount;0<=--k;)if(0!=(this.monomers[k].shapeVisibilityFlags&f)){var e=this.monomers[k].getLeadAtom();e.checkVisible()&&!(null!=g&&g.get(e.i))&&(0<d[k]||0<d[k+1])&&this.monomers[k].findNearestAtomIndex(a,b,c,d[k],d[k+1])}},"~N,~N,~A,~A,~N,JU.BS");e(c$,"getSelectedMonomerCount",function(){return this.selectedMonomerCount});e(c$,"calcSelectedMonomersCount",function(a){this.selectedMonomerCount=0;null==this.bsSelectedMonomers&&(this.bsSelectedMonomers=new JU.BS);this.bsSelectedMonomers.clearAll();
for(var b=0;b<this.monomerCount;b++)this.monomers[b].isSelected(a)&&(++this.selectedMonomerCount,this.bsSelectedMonomers.set(b))},"JU.BS");e(c$,"isMonomerSelected",function(a){return 0<=a&&this.bsSelectedMonomers.get(a)},"~N");e(c$,"getPolymerPointsAndVectors",function(a,b,c,d,f){d=this.getControlPoints(d,f,!1);f=this.getWingVectors();for(var g=this.monomerCount,k=0;k<g;k++)b.get(this.monomers[k].leadAtomIndex)?(c.addLast(G(-1,[d[k],JU.P3.newP(f[k])])),a=k):2147483646!=a&&(c.addLast(G(-1,[d[k],JU.P3.newP(f[k])])),
a=2147483646);a+1<g&&c.addLast(G(-1,[d[a+1],JU.P3.newP(f[a+1])]));return a},"~N,JU.BS,JU.Lst,~B,~N");e(c$,"getSequence",function(){for(var a=N(this.monomerCount,"\x00"),b=0;b<this.monomerCount;b++)a[b]=this.monomers[b].getGroup1();return String.valueOf(a)});e(c$,"getPolymerSequenceAtoms",function(a,b,c,d){for(b=Math.min(this.monomerCount,a+b);--b>=a;)this.monomers[b].getMonomerSequenceAtoms(c,d)},"~N,~N,JU.BS,JU.BS");e(c$,"getProteinStructure",function(){return null},"~N");e(c$,"calcParameters",function(){this.haveParameters=
!0;return this.calcEtaThetaAngles()||this.calcPhiPsiAngles()});e(c$,"calcEtaThetaAngles",function(){return!1});e(c$,"calcPhiPsiAngles",function(){return!1});e(c$,"calculateRamachandranHelixAngle",function(){return NaN},"~N,~S");e(c$,"isNucleic",function(){return 0<this.monomerCount&&u(this,JM.NucleicPolymer)});e(c$,"getRangeGroups",function(a,b,c){for(var d=new JU.BS,f=0;f<this.monomerCount;f++)this.monomers[f].isSelected(b)&&(d.setBits(Math.max(0,f-a),f+a+1),f+=a-1);for(f=d.nextSetBit(0);0<=f&&f<
this.monomerCount;f=d.nextSetBit(f+1))this.monomers[f].setAtomBits(c)},"~N,JU.BS,JU.BS");e(c$,"calcRasmolHydrogenBonds",function(){},"JM.BioPolymer,JU.BS,JU.BS,JU.Lst,~N,~A,~B,~B");e(c$,"getType",function(){return this.type});B(c$,"TYPE_NOBONDING",0,"TYPE_AMINO",1,"TYPE_NUCLEIC",2,"TYPE_CARBOHYDRATE",3)});p("JM");s(["java.lang.Enum","JM.BioPolymer"],"JM.AlphaPolymer","JU.Measure $.P3 J.c.STR JM.Helix $.Sheet $.Turn JU.Logger".split(" "),function(){c$=C(JM,"AlphaPolymer",JM.BioPolymer);D(c$,function(a){K(this,
JM.AlphaPolymer,[]);this.set(a);this.hasStructure=!0},"~A");h(c$,"getProteinStructure",function(a){return this.monomers[a].getStructure()},"~N");h(c$,"getControlPoint",function(a,b){if(!this.monomers[a].isSheet())return this.leadPoints[a];b.sub2(this.leadMidpoints[a],this.leadPoints[a]);b.scale(this.sheetSmoothing);var c=JU.P3.newP(this.leadPoints[a]);c.add(b);return c},"~N,JU.V3");e(c$,"addStructure",function(a,b,c,d,f,g,k,e,j,h,l){var m=-1,q=-1;if(j<h){if(this.monomers[0].firstAtomIndex>h||this.monomers[this.monomerCount-
1].lastAtomIndex<j)return;m=j;q=h}var x;if(!(-1==(f=this.getIndex(f,g,m,q))||-1==(x=this.getIndex(k,e,m,q)))){if(0<=j&&null!=l&&(k=l.nextSetBit(this.monomers[f].firstAtomIndex),0<=k&&k<this.monomers[x].lastAtomIndex))return;this.addStructureProtected(a,b,c,d,f,x)&&0<=j&&l.setBits(j,h+1)}},"J.c.STR,~S,~N,~N,~N,~N,~N,~N,~N,~N,JU.BS");e(c$,"addStructureProtected",function(a,b,c,d,f,g){if(g<f)return JU.Logger.error("AlphaPolymer:addSecondaryStructure error:  indexStart:"+f+" indexEnd:"+g),!1;var k=g-
f+1,e=null;switch(a){case J.c.STR.HELIX:case J.c.STR.HELIXALPHA:case J.c.STR.HELIX310:case J.c.STR.HELIXPI:e=new JM.Helix(this,f,k,a);break;case J.c.STR.SHEET:e=new JM.Sheet(this,f,k,a);break;case J.c.STR.TURN:e=new JM.Turn(this,f,k);break;default:return JU.Logger.error("unrecognized secondary structure type"),!1}e.structureID=b;e.serialID=c;e.strandCount=d;for(a=f;a<=g;++a)this.monomers[a].setStructure(e);return!0},"J.c.STR,~S,~N,~N,~N,~N");h(c$,"clearStructures",function(){for(var a=0;a<this.monomerCount;a++)this.monomers[a].setStructure(null)});
e(c$,"calculateStructures",function(){if(!(4>this.monomerCount)){var a=this.calculateAnglesInDegrees(),b=this.calculateCodes(a);this.checkBetaSheetAlphaHelixOverlap(b,a);var c=this.calculateRunsFourOrMore(b);this.extendRuns(c);this.searchForTurns(b,a,c);this.addStructuresFromTags(c)}},"~B");e(c$,"calculateAnglesInDegrees",function(){for(var a=I(this.monomerCount,0),b=this.monomerCount-1;2<=--b;)a[b]=JU.Measure.computeTorsion(this.monomers[b-2].getLeadAtom(),this.monomers[b-1].getLeadAtom(),this.monomers[b].getLeadAtom(),
this.monomers[b+1].getLeadAtom(),!0);return a});e(c$,"calculateCodes",function(a){for(var b=Array(this.monomerCount),c=this.monomerCount-1;2<=--c;){var d=a[c];b[c]=10<=d&&120>d?JM.AlphaPolymer.Code.RIGHT_HELIX:120<=d||-90>d?JM.AlphaPolymer.Code.BETA_SHEET:-90<=d&&0>d?JM.AlphaPolymer.Code.LEFT_HELIX:JM.AlphaPolymer.Code.NADA}return b},"~A");e(c$,"checkBetaSheetAlphaHelixOverlap",function(a,b){for(var c=this.monomerCount-2;2<=--c;)a[c]===JM.AlphaPolymer.Code.BETA_SHEET&&(140>=b[c]&&a[c-2]===JM.AlphaPolymer.Code.RIGHT_HELIX&&
a[c-1]===JM.AlphaPolymer.Code.RIGHT_HELIX&&a[c+1]===JM.AlphaPolymer.Code.RIGHT_HELIX&&a[c+2]===JM.AlphaPolymer.Code.RIGHT_HELIX)&&(a[c]=JM.AlphaPolymer.Code.RIGHT_HELIX)},"~A,~A");e(c$,"calculateRunsFourOrMore",function(a){for(var b=Array(this.monomerCount),c=J.c.STR.NONE,d=JM.AlphaPolymer.Code.NADA,f=0,g=0;g<this.monomerCount;++g)if(a[g]===d&&d!==JM.AlphaPolymer.Code.NADA&&d!==JM.AlphaPolymer.Code.BETA_SHEET)if(++f,4==f)for(var c=d===JM.AlphaPolymer.Code.BETA_SHEET?J.c.STR.SHEET:J.c.STR.HELIX,k=
4;0<=--k;)b[g-k]=c;else 4<f&&(b[g]=c);else f=1,d=a[g];return b},"~A");e(c$,"extendRuns",function(a){for(var b=1;b<this.monomerCount-4;++b)a[b]===J.c.STR.NONE&&a[b+1]!==J.c.STR.NONE&&(a[b]=a[b+1]);a[0]=a[1];a[this.monomerCount-1]=a[this.monomerCount-2]},"~A");e(c$,"searchForTurns",function(a,b,c){for(var d=this.monomerCount-1;2<=--d;)if(a[d]=JM.AlphaPolymer.Code.NADA,null==c[d]||c[d]===J.c.STR.NONE){var f=b[d];-90<=f&&0>f?a[d]=JM.AlphaPolymer.Code.LEFT_TURN:0<=f&&90>f&&(a[d]=JM.AlphaPolymer.Code.RIGHT_TURN)}for(d=
this.monomerCount-1;0<=--d;)a[d]!==JM.AlphaPolymer.Code.NADA&&(a[d+1]===a[d]&&c[d]===J.c.STR.NONE)&&(c[d]=J.c.STR.TURN)},"~A,~A,~A");e(c$,"addStructuresFromTags",function(a){for(var b=0;b<this.monomerCount;){var c=a[b];if(null==c||c===J.c.STR.NONE)++b;else{var d;for(d=b+1;d<this.monomerCount&&a[d]===c;++d);this.addStructureProtected(c,null,0,0,b,d-1);b=d}}},"~A");W(self.c$);c$=C(JM.AlphaPolymer,"Code",Enum);M(c$,"NADA",0,[]);M(c$,"RIGHT_HELIX",1,[]);M(c$,"BETA_SHEET",2,[]);M(c$,"LEFT_HELIX",3,[]);
M(c$,"LEFT_TURN",4,[]);M(c$,"RIGHT_TURN",5,[]);c$=V()});p("JM");s(["JM.AlphaMonomer"],"JM.AminoMonomer","JU.A4 $.BS $.M3 $.P3 $.PT $.Quat $.V3 J.c.STR JU.Escape $.Logger".split(" "),function(){c$=w(function(){this.nhChecked=!1;this.ptTemp=null;v(this,arguments)},JM,"AminoMonomer",JM.AlphaMonomer);L(c$,function(){});c$.validateAndAllocate=e(c$,"validateAndAllocate",function(a,b,c,d,f,g,k){var e=JM.Monomer.scanForOffsets(d,g,JM.AminoMonomer.interestingAminoAtomIDs);if(null==e)return null;JM.Monomer.checkOptional(e,
1,d,g[5]);return k[d].isHetero()&&!JM.AminoMonomer.isBondedCorrectly(d,e,k)?null:(new JM.AminoMonomer).set2(a,b,c,d,f,e)},"JM.Chain,~S,~N,~N,~N,~A,~A");c$.isBondedCorrectlyRange=e(c$,"isBondedCorrectlyRange",function(a,b,c,d,f){a=c+(d[a]&255);b=c+(d[b]&255);return a!=b&&f[a].isBonded(f[b])},"~N,~N,~N,~A,~A");c$.isBondedCorrectly=e(c$,"isBondedCorrectly",function(a,b,c){return JM.AminoMonomer.isBondedCorrectlyRange(2,0,a,b,c)&&JM.AminoMonomer.isBondedCorrectlyRange(0,3,a,b,c)&&(!JM.Monomer.have(b,
1)||JM.AminoMonomer.isBondedCorrectlyRange(3,1,a,b,c))},"~N,~A,~A");e(c$,"isAminoMonomer",function(){return!0});h(c$,"getNitrogenAtom",function(){return this.getAtomFromOffsetIndex(2)});e(c$,"getCarbonylCarbonAtom",function(){return this.getAtomFromOffsetIndex(3)});h(c$,"getCarbonylOxygenAtom",function(){return this.getWingAtom()});h(c$,"getInitiatorAtom",function(){return this.getNitrogenAtom()});h(c$,"getTerminatorAtom",function(){return this.getAtomFromOffsetIndex(JM.Monomer.have(this.offsets,
4)?4:3)});e(c$,"hasOAtom",function(){return JM.Monomer.have(this.offsets,1)});h(c$,"isConnectedAfter",function(a){return null==a?!0:a.getCarbonylCarbonAtom().isBonded(this.getNitrogenAtom())},"JM.Monomer");h(c$,"findNearestAtomIndex",function(a,b,c,d,f){var g=c[0],k=this.getNitrogenAtom();d=A(d/2);1200>d&&(d=1200);if(0!=k.sZ){d=E(this.scaleToScreen(k.sZ,d));4>d&&(d=4);var e=this.getCarbonylCarbonAtom();f=A(f/2);1200>f&&(f=1200);f=E(this.scaleToScreen(k.sZ,f));4>f&&(f=4);var j=this.getLeadAtom();if(this.isCursorOnTopOf(j,
a,b,A((d+f)/2),g)||this.isCursorOnTopOf(k,a,b,d,g)||this.isCursorOnTopOf(e,a,b,f,g))c[0]=j}},"~N,~N,~A,~N,~N");e(c$,"resetHydrogenPoint",function(){this.nhChecked=!1;this.nitrogenHydrogenPoint=null});e(c$,"getNitrogenHydrogenPoint",function(){null==this.nitrogenHydrogenPoint&&!this.nhChecked&&(this.nhChecked=!0,this.nitrogenHydrogenPoint=this.getExplicitNH());return this.nitrogenHydrogenPoint});e(c$,"getExplicitNH",function(){var a=this.getNitrogenAtom(),b=null,c=a.bonds;if(null!=c)for(var d=0;d<
c.length;d++)if(1==(b=c[d].getOtherAtom(a)).getElementNumber())return b;return null});e(c$,"getNHPoint",function(a,b,c,d){if(0>=this.monomerIndex||15==this.groupID)return!1;var f=this.getNitrogenAtom(),g=this.getNitrogenHydrogenPoint();if(null!=g&&!d)return b.sub2(g,f),a.setT(g),!0;d=this.bioPolymer.monomers[this.monomerIndex-1];if(c)b.sub2(f,this.getLeadAtom()),b.normalize(),c=JU.V3.newVsub(f,d.getCarbonylCarbonAtom()),c.normalize(),b.add(c);else{c=d.getCarbonylOxygenAtom();if(null==c)return!1;b.sub2(d.getCarbonylCarbonAtom(),
c)}b.normalize();a.add2(f,b);this.nitrogenHydrogenPoint=JU.P3.newP(a);JU.Logger.debugging&&JU.Logger.debug('draw ID "pta'+this.monomerIndex+"_"+f.i+'" '+JU.Escape.eP(f)+JU.Escape.eP(a)+" # "+f);return!0},"JU.P3,JU.V3,~B,~B");h(c$,"getQuaternionFrameCenter",function(a){if(0>this.monomerIndex)return null;switch(a){default:case "a":case "b":case "c":case "C":return this.getQuaternionFrameCenterAlpha(a);case "n":return this.getNitrogenAtom();case "p":case "P":return this.getCarbonylCarbonAtom();case "q":if(this.monomerIndex==
this.bioPolymer.monomerCount-1)return null;a=this.bioPolymer.monomers[this.monomerIndex+1];var b=new JU.P3;b.ave(this.getCarbonylCarbonAtom(),a.getNitrogenAtom());return b}},"~S");h(c$,"getQuaternion",function(a){if(0>this.monomerIndex)return null;var b=this.getCarbonylCarbonAtom(),c=this.getLeadAtom(),d=new JU.V3,f=new JU.V3,g=null;switch(a){case "a":case "n":if(0==this.monomerIndex||15==this.groupID)return null;g=new JU.V3;null==this.ptTemp&&(this.ptTemp=new JU.P3);this.getNHPoint(this.ptTemp,g,
!0,!1);f.sub2(c,this.getNitrogenAtom());f.cross(g,f);(new JU.M3).setAA(JU.A4.newVA(f,-0.29670596)).rotate(g);d.cross(f,g);break;case "b":return this.getQuaternionAlpha("b");case "c":d.sub2(b,c);f.sub2(this.getNitrogenAtom(),c);break;case "p":case "x":if(this.monomerIndex==this.bioPolymer.monomerCount-1)return null;d.sub2(c,b);f.sub2(this.bioPolymer.monomers[this.monomerIndex+1].getNitrogenAtom(),b);break;case "q":if(this.monomerIndex==this.bioPolymer.monomerCount-1)return null;a=this.bioPolymer.monomers[this.monomerIndex+
1];f.sub2(a.getLeadAtom(),a.getNitrogenAtom());d.sub2(c,b);break;default:return null}return JU.Quat.getQuaternionFrameV(d,f,g,!1)},"~S");h(c$,"getStructureId",function(){return null==this.proteinStructure||null==this.proteinStructure.structureID?"":this.proteinStructure.structureID});h(c$,"getProteinStructureTag",function(){if(null==this.proteinStructure||null==this.proteinStructure.structureID)return null;var a;a=JU.PT.formatStringI("%3N %3ID","N",this.proteinStructure.serialID);a=JU.PT.formatStringS(a,
"ID",this.proteinStructure.structureID);this.proteinStructure.type===J.c.STR.SHEET&&(a+=JU.PT.formatStringI("%2SC","SC",this.proteinStructure.strandCount));return a});h(c$,"getBSSideChain",function(){var a=new JU.BS;this.setAtomBits(a);this.clear(a,this.getLeadAtom(),!0);this.clear(a,this.getCarbonylCarbonAtom(),!1);this.clear(a,this.getCarbonylOxygenAtom(),!1);this.clear(a,this.getNitrogenAtom(),!0);return a});e(c$,"clear",function(a,b,c){if(null!=b&&(a.clear(b.i),c)){c=b.bonds;for(var d,f=c.length;0<=
--f;)1==(d=c[f].getOtherAtom(b)).getElementNumber()&&a.clear(d.i)}},"JU.BS,JM.Atom,~B");B(c$,"CA",0,"O",1,"N",2,"C",3,"OT",4,"interestingAminoAtomIDs",F(-1,[2,-5,1,3,-65]),"beta",0.29670597283903605)});p("JM");s(["JM.AlphaPolymer"],"JM.AminoPolymer","JU.Measure $.P3 $.V3 J.c.STR JM.HBond JU.Logger".split(" "),function(){c$=w(function(){this.structureList=null;v(this,arguments)},JM,"AminoPolymer",JM.AlphaPolymer);D(c$,function(a){K(this,JM.AminoPolymer,[a]);this.type=1;for(var b=0;b<this.monomerCount;++b)if(!a[b].hasOAtom())return;
this.hasWingPoints=!0},"~A");h(c$,"resetHydrogenPoints",function(){for(var a,b=null,c=0;c<this.monomerCount;c++){if(null!=(a=this.getProteinStructure(c))&&a!==b)(b=a).resetAxes();this.monomers[c].resetHydrogenPoint()}});h(c$,"calcPhiPsiAngles",function(){for(var a=0;a<this.monomerCount-1;++a)this.calcPhiPsiAngles2(this.monomers[a],this.monomers[a+1]);return!0});e(c$,"calcPhiPsiAngles2",function(a,b){var c=a.getNitrogenAtom(),d=a.getLeadAtom(),f=a.getCarbonylCarbonAtom(),g=b.getNitrogenAtom(),k=b.getLeadAtom(),
e=b.getCarbonylCarbonAtom();b.setGroupParameter(1111490569,JU.Measure.computeTorsion(f,g,k,e,!0));a.setGroupParameter(1111490570,JU.Measure.computeTorsion(c,d,f,g,!0));a.setGroupParameter(1111490568,JU.Measure.computeTorsion(d,f,g,k,!0))},"JM.AminoMonomer,JM.AminoMonomer");h(c$,"calculateRamachandranHelixAngle",function(a,b){var c=0==a?NaN:this.monomers[a-1].getGroupParameter(1111490570),d=this.monomers[a].getGroupParameter(1111490570),f=this.monomers[a].getGroupParameter(1111490569),g=a==this.monomerCount-
1?NaN:this.monomers[a+1].getGroupParameter(1111490569),k=a==this.monomerCount-1?NaN:this.monomers[a+1].getGroupParameter(1111490570);switch(b){default:case "p":case "r":case "P":return c=3.141592653589793*((g-f)/2)/180,d=3.141592653589793*((k-d)/2)/180,114.59155902616465*Math.acos(Math.cos(d)*Math.cos(c)-Math.sin(d)*Math.sin(c)/3);case "c":case "C":return d-c+g-f}},"~N,~S");h(c$,"calcRasmolHydrogenBonds",function(a,b,c,d,f,g,k,e){null==a&&(a=this);if(u(a,JM.AminoPolymer)){f=new JU.P3;for(var j=new JU.V3,
h,l=null==g?y(2,3,0):null,m=1;m<this.monomerCount;++m)if(null==g?(l[0][0]=l[1][0]=this.bioPolymerIndexInModel,l[0][1]=l[1][1]=-2147483648,l[0][2]=l[1][2]=0):l=g[m],(h=this.monomers[m]).getNHPoint(f,j,k,e)){var q=null==b||b.get(h.getNitrogenAtom().i);if(q&&(k||null!=h.getCarbonylOxygenAtom()))this.checkRasmolHydrogenBond(h,a,m,f,q?c:b,d,l,k)}}},"JM.BioPolymer,JU.BS,JU.BS,JU.Lst,~N,~A,~B,~B");e(c$,"checkRasmolHydrogenBond",function(a,b,c,d,f,g,k,e){var j=a.getLeadAtom(),h=a.getNitrogenAtom();a=a.getNitrogenAtom();
for(var l,m=b.monomerCount;0<=--m;)if(!(b===this&&(m==c||m+1==c))){l=b.monomers[m];var q=l.getCarbonylOxygenAtom();if(!(null==q||null!=f&&!f.get(q.i)))if(q=l.getLeadAtom(),!(81<=j.distanceSquared(q))){q=this.calcHbondEnergy(h,d,l,e);if(q<k[0][2])l=k[1],k[1]=k[0],k[0]=l;else if(q<k[1][2])l=k[1];else continue;l[0]=b.bioPolymerIndexInModel;l[1]=-500>q?m:-1-m;l[2]=q}}if(null!=g)for(m=0;2>m;m++)0<=k[m][1]&&this.addResidueHydrogenBond(a,b.monomers[k[m][1]].getCarbonylOxygenAtom(),b===this?c:-99,k[m][1],
k[m][2]/1E3,g)},"JM.AminoMonomer,JM.BioPolymer,~N,JU.P3,JU.BS,JU.Lst,~A,~B");e(c$,"calcHbondEnergy",function(a,b,c,d){var f=c.getCarbonylOxygenAtom();if(null==f)return 0;var g=f.distanceSquared(a);if(0.25>g)return 0;f=f.distanceSquared(b);if(0.25>f)return 0;c=c.getCarbonylCarbonAtom();b=c.distanceSquared(b);if(0.25>b)return 0;c=c.distanceSquared(a);if(0.25>c)return 0;a=Math.sqrt(f);f=Math.sqrt(b);b=Math.sqrt(c);g=Math.sqrt(g);g=JM.HBond.getEnergy(a,f,b,g);return!(-500>g&&(!d||b>f&&3>=a))&&d||-9900>
g?0:g},"JU.P3,JU.P3,JM.AminoMonomer,~B");e(c$,"addResidueHydrogenBond",function(a,b,c,d,f,g){switch(c-d){case 2:c=6144;break;case 3:c=8192;break;case 4:c=10240;break;case 5:c=12288;break;case -3:c=14336;break;case -4:c=16384;break;default:c=4096}g.addLast(new JM.HBond(a,b,c,1,0,f))},"JM.Atom,JM.Atom,~N,~N,~N,JU.Lst");h(c$,"calculateStructures",function(a){if(!a){null==this.structureList&&(this.structureList=this.model.ms.getStructureList());a=N(this.monomerCount,"\x00");for(var b=0;b<this.monomerCount-
1;++b){var c=this.monomers[b],d=this.monomers[b+1],f=d.getGroupParameter(1111490569),g=c.getGroupParameter(1111490570);a[b]=this.isHelix(g,f)?0>f&&25>g?"4":"3":this.isSheet(g,f)?"s":this.isTurn(g,f)?"t":"n";JU.Logger.debugging&&JU.Logger.debug(0+this.monomers[0].chain.chainID+" aminopolymer:"+b+" "+d.getGroupParameter(1111490569)+","+c.getGroupParameter(1111490570)+" "+a[b])}for(b=0;b<this.monomerCount;++b)if("4"==a[b]){for(c=b+1;c<this.monomerCount&&"4"==a[c];++c);c--;c>=b+3&&this.addStructureProtected(J.c.STR.HELIX,
null,0,0,b,c);b=c}for(b=0;b<this.monomerCount;++b)if("3"==a[b]){for(c=b+1;c<this.monomerCount&&"3"==a[c];++c);c--;c>=b+3&&this.addStructureProtected(J.c.STR.HELIX,null,0,0,b,c);b=c}for(b=0;b<this.monomerCount;++b)if("s"==a[b]){for(c=b+1;c<this.monomerCount&&"s"==a[c];++c);c--;c>=b+2&&this.addStructureProtected(J.c.STR.SHEET,null,0,0,b,c);b=c}for(b=0;b<this.monomerCount;++b)if("t"==a[b]){for(c=b+1;c<this.monomerCount&&"t"==a[c];++c);c--;c>=b+2&&this.addStructureProtected(J.c.STR.TURN,null,0,0,b,c);
b=c}}},"~B");e(c$,"isTurn",function(a,b){return JM.AminoPolymer.checkPhiPsi(this.structureList.get(J.c.STR.TURN),a,b)},"~N,~N");e(c$,"isSheet",function(a,b){return JM.AminoPolymer.checkPhiPsi(this.structureList.get(J.c.STR.SHEET),a,b)},"~N,~N");e(c$,"isHelix",function(a,b){return JM.AminoPolymer.checkPhiPsi(this.structureList.get(J.c.STR.HELIX),a,b)},"~N,~N");c$.checkPhiPsi=e(c$,"checkPhiPsi",function(a,b,c){for(var d=0;d<a.length;d+=4)if(c>=a[d]&&c<=a[d+1]&&b>=a[d+2]&&b<=a[d+3])return!0;return!1},
"~A,~N,~N");e(c$,"setStructureList",function(a){this.structureList=a},"java.util.Map");B(c$,"maxHbondAlphaDistance",9,"maxHbondAlphaDistance2",81,"minimumHbondDistance2",0.25)});p("JM");s(["JM.JmolBioModel","$.JmolBioModelSet","$.Model"],"JM.BioModel","java.lang.Boolean $.Character $.Float java.util.Hashtable JU.AU $.BS $.Lst $.PT $.SB J.api.Interface J.c.STR JM.Group JM.AlphaMonomer $.AlphaPolymer $.AminoPolymer $.Monomer $.Resolver JS.SV $.T JU.BSUtil $.Escape $.Logger JV.JC".split(" "),function(){c$=
w(function(){this.bioPolymerCount=0;this.bioPolymers=null;this.isMutated=!1;this.bx=this.unitIdSets=this.vwr=this.defaultStructure=null;v(this,arguments)},JM,"BioModel",JM.Model,[JM.JmolBioModelSet,JM.JmolBioModel]);h(c$,"getAllHeteroList",function(a){for(var b=new java.util.Hashtable,c=!1,d=this.ms.mc;0<=--d;)if(0>a||d==a){var f=this.ms.getInfo(d,"hetNames");if(null!=f)for(var c=!0,g,f=f.entrySet().iterator();f.hasNext()&&((g=f.next())||1);){var k=g.getKey();b.put(k,g.getValue())}}return c?b:null},
"~N");h(c$,"setAllProteinType",function(a,b){var c=-1,d=-1,f=this.ms.getModelBS(a,!1);this.setAllDefaultStructure(f);for(var g=this.ms.at,k=this.ms.am,e=a.nextSetBit(0);0<=e;e=a.nextSetBit(e+1)){d!=e-1&&(c=-1);var c=g[e].group.setProteinStructureType(b,c),j=g[e].mi;this.ms.proteinStructureTainted=k[j].structureTainted=!0;d=e=g[e].group.lastAtomIndex}c=y(this.ms.mc,0);for(e=0;e<this.ms.ac;)j=g[e].mi,f.get(j)?(d=g[e].group.getStrucNo(),1E3>d&&d>c[j]&&(c[j]=d),e=g[e].group.lastAtomIndex+1):e=k[j].firstAtomIndex+
k[j].act;for(e=0;e<this.ms.ac;)j=g[e].mi,f.get(j)?(1E3<g[e].group.getStrucNo()&&g[e].group.setStrucNo(++c[j]),e=g[e].group.lastAtomIndex+1):e=k[j].firstAtomIndex+k[j].act},"JU.BS,J.c.STR");e(c$,"modelsOf",function(a,b){for(var c=JU.BS.newN(this.ms.mc),d=null==a,f=d?this.ms.ac-1:a.nextSetBit(0);0<=f;f=d?f-1:a.nextSetBit(f+1)){var g=this.ms.am[this.ms.at[f].mi].trajectoryBaseIndex;this.ms.isJmolDataFrameForModel(g)||(c.set(g),b.set(f))}return c},"JU.BS,JU.BS");h(c$,"getAllDefaultStructures",function(a,
b){for(var c=this.modelsOf(a,b),d=new JU.SB,f=c.nextSetBit(0);0<=f;f=c.nextSetBit(f+1))this.ms.am[f].isBioModel&&null!=this.ms.am[f].defaultStructure&&d.append(this.ms.am[f].defaultStructure);return d.toString()},"JU.BS,JU.BS");h(c$,"calculateAllStuctures",function(a,b,c,d,f){var g=new JU.BS;a=JU.BSUtil.copyInvert(this.modelsOf(a,g),this.ms.mc);if(!f)return this.ms.calculateStructuresAllExcept(a,b,c,d,!1,!1);this.ms.recalculatePolymers(a);b=this.ms.calculateStructuresAllExcept(a,b,c,d,!0,!1);this.vwr.shm.resetBioshapes(g);
this.ms.setStructureIndexes();return b},"JU.BS,~B,~B,~B,~B");h(c$,"calculateAllStructuresExcept",function(a,b,c,d,f,g){var e="";a=JU.BSUtil.copyInvert(a,this.ms.mc);f&&this.setAllDefaultStructure(a);for(var h=a.nextSetBit(0);0<=h;h=a.nextSetBit(h+1))this.ms.am[h].isBioModel&&(e+=this.ms.am[h].calculateStructures(b,c,d,f,g));f&&this.ms.setStructureIndexes();return e},"JU.BS,~B,~B,~B,~B,~B");e(c$,"setAllDefaultStructure",function(a){for(var b=a.nextSetBit(0);0<=b;b=a.nextSetBit(b+1))if(this.ms.am[b].isBioModel){var c=
this.ms.am[b];null==c.defaultStructure&&(c.defaultStructure=this.getFullProteinStructureState(c.bsAtoms,1073742158))}},"JU.BS");h(c$,"setAllStructureList",function(a){for(var b=this.ms.mc;0<=--b;)if(this.ms.am[b].isBioModel){var c=this.ms.am[b];c.bioPolymers=JU.AU.arrayCopyObject(c.bioPolymers,c.bioPolymerCount);for(var d=c.bioPolymerCount;0<=--d;){var f=c.bioPolymers[d];u(f,JM.AminoPolymer)&&f.setStructureList(a)}}},"java.util.Map");h(c$,"setAllConformation",function(a){for(var b=this.ms.getModelBS(a,
!1),c=b.nextSetBit(0);0<=c;c=b.nextSetBit(c+1))if(this.ms.am[c].isBioModel){var d=this.ms.am[c];if(0<d.altLocCount)for(var f=d.bioPolymerCount;0<=--f;)d.bioPolymers[f].setConformation(a)}},"JU.BS");h(c$,"getAllPolymerPointsAndVectors",function(a,b,c,d){for(var f=0;f<this.ms.mc;++f)if(this.ms.am[f].isBioModel)for(var g=this.ms.am[f],e=2147483646,h=0;h<g.bioPolymerCount;h++)e=g.bioPolymers[h].getPolymerPointsAndVectors(e,a,b,c,d)},"JU.BS,JU.Lst,~B,~N");h(c$,"calcSelectedMonomersCount",function(){for(var a=
this.vwr.bsA(),b=this.ms.mc;0<=--b;)if(this.ms.am[b].isBioModel)for(var c=this.ms.am[b],d=c.bioPolymerCount;0<=--d;)c.bioPolymers[d].calcSelectedMonomersCount(a)});h(c$,"getBioPolymerCountInModel",function(a){if(0>a){a=0;for(var b=this.ms.mc;0<=--b;)!this.ms.isTrajectorySubFrame(b)&&this.ms.am[b].isBioModel&&(a+=this.ms.am[b].getBioPolymerCount());return a}return this.ms.isTrajectorySubFrame(a)||!this.ms.am[a].isBioModel?0:this.ms.am[a].getBioPolymerCount()},"~N");h(c$,"calculateAllPolymers",function(a,
b,c,d){var f=!this.vwr.getBoolean(603979894);0>b&&(b=a.length);if(null!=d)for(var g=0;g<b;++g){var e=a[g];u(e,JM.Monomer)&&null!=e.bioPolymer&&!d.get(e.chain.model.modelIndex)&&e.setBioPolymer(null,-1)}for(var e=0,h=this.ms.mc;e<h;e++)if((null==d||!d.get(e))&&this.ms.am[e].isBioModel)for(g=c;g<b;++g){var j=a[g],n=j.getModel();if(n.isBioModel&&u(j,JM.Monomer)){var l=f&&!this.ms.isJmolDataFrameForModel(this.ms.at[j.firstAtomIndex].mi),j=null==j.bioPolymer?JM.Resolver.allocateBioPolymer(a,g,l):null;
null==j||0==j.monomerCount||(n.addBioPolymer(j),g+=j.monomerCount-1)}}},"~A,~N,~N,JU.BS");h(c$,"recalculateAllPolymers",function(a,b){for(var c=0;c<this.ms.mc;c++)this.ms.am[c].isBioModel&&!a.get(c)&&this.ms.am[c].clearBioPolymers();this.calculateAllPolymers(b,-1,0,a)},"JU.BS,~A");h(c$,"getGroupsWithinAll",function(a,b){for(var c=new JU.BS,d=this.ms.getIterativeModels(!1),f=this.ms.mc;0<=--f;)if(d.get(f)&&this.ms.am[f].isBioModel)for(var g=this.ms.am[f],e=g.bioPolymerCount;0<=--e;)g.bioPolymers[e].getRangeGroups(a,
b,c);return c},"~N,JU.BS");h(c$,"calculateStruts",function(a,b){return this.getBioExt().calculateAllstruts(this.vwr,this.ms,a,b)},"JU.BS,JU.BS");h(c$,"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");h(c$,"getFullProteinStructureState",function(a,
b){var c=1073742327==b;if(c&&!this.ms.proteinStructureTainted)return"";var d=1073742158==b||1073742327==b,f=this.ms.at,g=null==a?0:a.nextSetBit(0);if(0>g)return"";if(null!=a&&4138==b){a=JU.BSUtil.copy(a);for(var e=this.ms.ac;0<=--e;)(Float.isNaN(f[e].group.getGroupParameter(1111490569))||Float.isNaN(f[e].group.getGroupParameter(1111490570)))&&a.clear(e)}for(var h=(null==a?this.ms.ac:a.length())-1,j=f[g].mi,g=f[h].mi,h=new JU.Lst,n=new java.util.Hashtable,l=new JU.SB;j<=g;j++)if(this.ms.am[j].isBioModel&&
(e=this.ms.am[j],!c||e.structureTainted)){var m=new JU.BS;m.or(e.bsAtoms);m.andNot(e.bsAtomsDeleted);e=m.nextSetBit(0);if(!(0>e)){d&&l.append("  structure none ").append(JU.Escape.eBS(this.ms.getModelAtomBitSetIncludingDeleted(j,!1))).append("    \t# model="+this.ms.getModelNumberDotted(j)).append(";\n");for(var q;0<=e;e=m.nextSetBit(e+1)){var x=f[e];if(u(x.group,JM.AlphaMonomer)&&!(null==(q=x.group.proteinStructure)||n.containsKey(q)))h.addLast(q),n.put(q,Boolean.TRUE)}}}this.getStructureLines(a,
l,h,J.c.STR.HELIX,d,b);this.getStructureLines(a,l,h,J.c.STR.SHEET,d,b);this.getStructureLines(a,l,h,J.c.STR.TURN,d,b);return l.toString()},"JU.BS,~N");e(c$,"getStructureLines",function(a,b,c,d,f,g){g=134222350==g;for(var e=0,h=0,j=0,n=null,l=new JU.BS,m=0,q=0,x=c.size();q<x;q++){var p=c.get(q);if(p.type===d){var r=p.findMonomer(a,!0),t=p.findMonomer(a,!1);if(!(null==r||null==t)){var s=p.apolymer.model.modelIndex,n=f?"    \t# model="+this.ms.getModelNumberDotted(s):null,s=r.getResno(),u=t.getResno(),
v=p.subtype;switch(d){case J.c.STR.HELIX:case J.c.STR.TURN:case J.c.STR.SHEET:if(m++,f){l.clearAll();p.setAtomBits(l);var w=v.getBioStructureTypeName(!1);b.append("  structure ").append(w).append(" ").append(JU.Escape.eBS(l)).append(n).append(" & ("+s+" - "+u+")").append(";\n")}else{var z;switch(d){case J.c.STR.HELIX:w=++e;n=JU.PT.formatStringI("%3N %3N","N",w);z="HELIX  %ID %3GROUPA %1CA %4RESA  %3GROUPB %1CB %4RESB";w=null;switch(v){case J.c.STR.HELIX:case J.c.STR.HELIXALPHA:w="  1";break;case J.c.STR.HELIX310:w=
"  5";break;case J.c.STR.HELIXPI:w="  3"}null!=w&&(z+=w);break;case J.c.STR.SHEET:w=++h;n=JU.PT.formatStringI("%3N %3A 0","N",w);n=JU.PT.formatStringS(n,"A","S"+w);z="SHEET  %ID %3GROUPA %1CA%4RESA  %3GROUPB %1CB%4RESB";break;default:w=++j,n=JU.PT.formatStringI("%3N %3N","N",w),z="TURN   %ID %3GROUPA %1CA%4RESA  %3GROUPB %1CB%4RESB"}z=JU.PT.formatStringS(z,"ID",n);z=JU.PT.formatStringS(z,"GROUPA",r.getGroup3());z=JU.PT.formatStringS(z,"CA",r.getLeadAtom().getChainIDStr());z=JU.PT.formatStringI(z,
"RESA",s);z=JU.PT.formatStringS(z,"GROUPB",t.getGroup3());z=JU.PT.formatStringS(z,"CB",t.getLeadAtom().getChainIDStr());z=JU.PT.formatStringI(z,"RESB",u);b.append(z);g&&b.append(" strucno= ").appendI(p.strucNo);b.append("\n")}}}}}0<m&&b.append("\n");return m},"JU.BS,JU.SB,JU.Lst,J.c.STR,~B,~N");h(c$,"getAllSequenceBits",function(a,b,c){if(0<a.length){null==b&&(b=this.vwr.getAllAtoms());if(a.indexOf("|")<a.lastIndexOf("|"))return this.getAllUnitIds(a,b,c);for(var d=this.ms.am,f=this.ms.mc;0<=--f;)if(d[f].isBioModel)for(var g=
d[f],e=a.length,h=0;h<g.bioPolymerCount;h++)for(var j=g.bioPolymers[h].getSequence(),n=-1;0<=(n=j.indexOf(a,++n));)g.bioPolymers[h].getPolymerSequenceAtoms(n,e,b,c)}return c},"~S,JU.BS,JU.BS");e(c$,"getAllUnitIds",function(a,b,c){var d=this.unitIdSets;if(null==d){for(var d=this.unitIdSets=Array(7),f=0;7>f;f++)d[f]=new java.util.Hashtable;for(f=this.ms.mc;0<=--f;){var g=this.ms.am[f];if(g.isBioModel){this.ms.isTrajectory(f)&&(g=this.ms.am[f=g.trajectoryBaseIndex]);var e="|"+this.ms.getInfo(f,"modelNumber");
this.checkMap(d[0],this.ms.getInfo(f,"modelName")+e,g.bsAtoms);this.checkMap(d[0],e,g.bsAtoms)}}}var e=g=null,h=new JU.BS;a=JU.PT.getTokens(JU.PT.replaceAllCharacters(a,', \t\n[]"'," "));for(var j=y(8,0),f=a.length;0<=--f;){var n=a[f]+"|";if(!(5>n.length)){for(var l=0,m=0,q=0,x=n.lastIndexOf("|")+1;m<x&&8>q;m++)"|"==n.charAt(m)?j[q++]=m:l|=1<<q;if(22==(l&22)){h.clearAll();h.or(b);m=n.substring(0,j[2]);if(null!=e&&e.equals(m))h.or(g);else{if(!this.addUnit(1094717454,n.substring(0,j[1]).toUpperCase(),
h,d[0])||!this.addUnit(1073742357,n.substring(j[1]+1,j[2]),h,d[1]))continue;g=JU.BSUtil.copy(h);e=m}m=0!=(l&32);q=0!=(l&64);this.addUnit(1094715412,n.substring(j[3]+1,j[4]),h,d[2])&&(this.addUnit(5,0==(l&128)?"\x00":n.substring(j[6]+1,j[7]),h,d[3])&&!(m?!this.addUnit(1086326786,n.substring(j[4]+1,j[5]).toUpperCase(),h,d[4])||!this.addUnit(1073742355,n.substring(j[5]+1,j[6]),h,d[5]):q&&!this.addUnit(1094717448,n.substring(j[5]+1,j[6]),h,d[6])))&&c.or(h)}}}return c},"~S,JU.BS,JU.BS");e(c$,"checkMap",
function(a,b,c){c=JU.BSUtil.copy(c);var d=a.get(b);null==d?a.put(b,d=c):d.or(c);return d},"java.util.Map,~S,JU.BS");e(c$,"addUnit",function(a,b,c,d){var f=d.get(b);if(null==f){var g;switch(a){default:return!1;case 1073742357:g=Integer.$valueOf(this.vwr.getChainID(b,!1));break;case 1094715412:g=Integer.$valueOf(JU.PT.parseInt(b));break;case 5:g=Integer.$valueOf(b.charCodeAt(0));break;case 1094717448:f=this.ms.getAtomBitsMDa(a=1073742355,null,new JU.BS);case 1086326786:g=b;break;case 1073742355:g=0==
b.length?null:b}d.put(b,f=this.ms.getAtomBitsMDa(a,g,null==f?new JU.BS:f))}c.and(f);return 0<=c.nextSetBit(0)},"~N,~S,JU.BS,java.util.Map");e(c$,"getAllBasePairBits",function(a){var b=null,c=null,d=new JU.Lst;if(0==a.length)b=c=this.vwr.getAllAtoms(),this.calcAllRasmolHydrogenBonds(b,c,d,!0,1,!1,null);else for(var f=0;f<a.length;)b=this.ms.getSequenceBits(a.substring(f,++f),null,new JU.BS),0>b.nextSetBit(0)||(c=this.ms.getSequenceBits(a.substring(f,++f),null,new JU.BS),0>c.nextSetBit(0)||this.calcAllRasmolHydrogenBonds(b,
c,d,!0,1,!1,null));a=new JU.BS;for(f=d.size();0<=--f;)b=d.get(f),a.set(b.atom1.i),a.set(b.atom2.i);return a},"~S");h(c$,"calcAllRasmolHydrogenBonds",function(a,b,c,d,f,g,e){var h=this.ms.am;if(null==c){var j=a;null!=b&&!a.equals(b)&&(j=JU.BSUtil.copy(a)).or(b);for(var n=new JU.BS,l=new JU.BS,m=this.ms.am,q=this.ms.bo,x=this.ms.bondCount;0<=--x;){var p=q[x];0!=(p.order&28672)&&(j.get(p.atom1.i)?n.set(x):l.set(m[p.atom1.mi].trajectoryBaseIndex))}for(x=this.ms.mc;0<=--x;)m[x].isBioModel&&(m[x].hasRasmolHBonds=
l.get(x));0<=n.nextSetBit(0)&&this.ms.deleteBonds(n,!1)}for(x=this.ms.mc;0<=--x;)h[x].isBioModel&&!this.ms.isTrajectorySubFrame(x)&&h[x].getRasmolHydrogenBonds(a,b,c,d,f,g,e)},"JU.BS,JU.BS,JU.Lst,~B,~N,~B,JU.BS");e(c$,"getRasmolHydrogenBonds",function(a,b,c,d,f,g,e){var h=null==c;h&&(c=new JU.Lst);0>f&&(f=2147483647);var j,n;if(null==b&&0<this.bioPolymerCount)this.calculateDssx(c,!1,g,!1);else for(g=this.bioPolymerCount;0<=--g;)if(j=this.bioPolymers[g],0!=j.monomerCount){var l=j.getType(),m=!1;switch(l){case 1:if(d)continue;
j.calcRasmolHydrogenBonds(null,a,b,c,f,null,!0,!1);break;case 2:m=j.monomers[0].isRna();break;default:continue}for(var q=this.bioPolymerCount;0<=--q;)null!=(n=this.bioPolymers[q])&&((m||g!=q)&&l==n.getType())&&n.calcRasmolHydrogenBonds(j,a,b,c,f,null,!0,!1)}if(0!=c.size()&&h){this.hasRasmolHBonds=!0;for(g=0;g<c.size();g++)a=c.get(g),b=a.atom1,d=a.atom2,b.isBonded(d)||(a=this.ms.addHBond(b,d,a.order,a.getEnergy()),null!=e&&e.set(a))}},"JU.BS,JU.BS,JU.Lst,~B,~N,~B,JU.BS");h(c$,"calculateStraightnessAll",
function(){this.getBioExt().calculateStraightnessAll(this.vwr,this.ms)});h(c$,"mutate",function(a,b,c){return this.getBioExt().mutate(this.vwr,a,b,c)},"JU.BS,~S,~A");D(c$,function(a,b,c,d,f,g){K(this,JM.BioModel,[]);this.vwr=a.vwr;this.set(a,b,c,d,f,g);this.isBioModel=!0;a.bioModelset=this;this.clearBioPolymers();a.am[b]=this;this.pdbID=g.get("name")},"JM.ModelSet,~N,~N,~S,java.util.Properties,java.util.Map");e(c$,"clearBioPolymers",function(){this.bioPolymers=Array(8);this.bioPolymerCount=0});h(c$,
"getBioPolymerCount",function(){return this.bioPolymerCount});h(c$,"fixIndices",function(a,b,c){this.fixIndicesM(a,b,c);this.recalculateLeadMidpointsAndWingVectors();this.unitIdSets=null},"~N,~N,JU.BS");e(c$,"recalculateLeadMidpointsAndWingVectors",function(){for(var a=0;a<this.bioPolymerCount;a++)this.bioPolymers[a].recalculateLeadMidpointsAndWingVectors()});h(c$,"freeze",function(){this.freezeM();this.bioPolymers=JU.AU.arrayCopyObject(this.bioPolymers,this.bioPolymerCount);return!0});e(c$,"addSecondaryStructure",
function(a,b,c,d,f,g,e,h,j,n,l){for(var m=this.bioPolymerCount;0<=--m;)u(this.bioPolymers[m],JM.AlphaPolymer)&&this.bioPolymers[m].addStructure(a,b,c,d,f,g,e,h,j,n,l)},"J.c.STR,~S,~N,~N,~N,~N,~N,~N,~N,~N,JU.BS");e(c$,"calculateStructures",function(a,b,c,d,f){if(0==this.bioPolymerCount||!d&&!a)return"";this.ms.proteinStructureTainted=this.structureTainted=!0;if(d)for(var g=this.bioPolymerCount;0<=--g;)(!a||null!=this.bioPolymers[g].monomers[0].getNitrogenAtom())&&this.bioPolymers[g].clearStructures();
if(!a||f)for(g=this.bioPolymerCount;0<=--g;)u(this.bioPolymers[g],JM.AlphaPolymer)&&this.bioPolymers[g].calculateStructures(f);return a?this.calculateDssx(null,b,c,d):""},"~B,~B,~B,~B,~B");e(c$,"calculateDssx",function(a,b,c,d){for(var f=!1,g=!1,e=0;e<this.bioPolymerCount&&(!f||!g);e++)this.bioPolymers[e].isNucleic()?g=!0:u(this.bioPolymers[e],JM.AminoPolymer)&&(f=!0);e="";f&&(e+=J.api.Interface.getOption("dssx.DSSP",this.vwr,"ms").calculateDssp(this.bioPolymers,this.bioPolymerCount,a,b,c,d));g&&
(this.auxiliaryInfo.containsKey("dssr")&&null!=a)&&(e+=this.vwr.getAnnotationParser(!0).getHBonds(this.ms,this.modelIndex,a,b));return e},"JU.Lst,~B,~B,~B");e(c$,"getConformation",function(a,b,c,d){if(0<=a&&0<this.altLocCount)for(var f=this.ms.at,g=null,e="\x00",h=a,j=new JU.BS,n=c.nextSetBit(0);0<=n;n=c.nextSetBit(n+1)){var l=f[n],m=l.altloc;"\x00"!=m&&(l.group!==g&&(g=l.group,e="\x00",h=a,j.clearAll()),0<=h&&(m!=e&&!j.get(m.charCodeAt(0)))&&(e=m,h--,j.set(m.charCodeAt(0))),(0<=h||m!=e)&&c.clear(n))}if(0<=
c.nextSetBit(0)&&(d.or(c),b))for(a=this.bioPolymerCount;0<=--a;)this.bioPolymers[a].setConformation(c);return!0},"~N,~B,JU.BS,JU.BS");e(c$,"addBioPolymer",function(a){0==this.bioPolymers.length&&this.clearBioPolymers();this.bioPolymerCount==this.bioPolymers.length&&(this.bioPolymers=JU.AU.doubleLength(this.bioPolymers));a.bioPolymerIndexInModel=this.bioPolymerCount;this.bioPolymers[this.bioPolymerCount++]=a},"JM.BioPolymer");h(c$,"getBioBranches",function(a){for(var b,c=0;c<this.bioPolymerCount;c++)b=
new JU.BS,this.bioPolymers[c].getRange(b,this.isMutated),0<=b.nextSetBit(0)&&(null==a&&(a=new JU.Lst),a.addLast(b));return a},"JU.Lst");h(c$,"getAllPolymerInfo",function(a,b){this.getBioExt().getAllPolymerInfo(this.ms,a,b)},"JU.BS,java.util.Map");e(c$,"getBioExt",function(){return null==this.bx?this.bx=J.api.Interface.getInterface("JM.BioExt",this.vwr,"script"):this.bx});h(c$,"getFullPDBHeader",function(){if(0>this.modelIndex)return"";var a=this.auxiliaryInfo.get("fileHeader");if(null!=a)return a;
for(var a=this.vwr.getCurrentFileAsString("biomodel"),b=a.length,c=JM.BioModel.pdbRecords.length;0<=--c;){var d;d=JM.BioModel.pdbRecords[c];switch(d=a.startsWith(d)?0:a.indexOf("\n"+d)){case -1:continue;case 0:return this.auxiliaryInfo.put("fileHeader",""),"";default:d<b&&(b=++d)}}a=a.substring(0,b);this.auxiliaryInfo.put("fileHeader",a);return a});h(c$,"getPdbData",function(a,b,c,d,f,g,e,h){this.getBioExt().getPdbDataM(this,this.vwr,a,b,c,d,f,g,e,h)},"~S,~S,~B,JU.BS,JU.OC,~A,JU.SB,JU.BS");h(c$,"resetRasmolBonds",
function(a){var b=new JU.BS;this.hasRasmolHBonds=!1;for(var c=this.ms.am,d=this.ms.bo,f=this.ms.bondCount;0<=--f;){var g=d[f];0!=(g.order&28672)&&c[g.atom1.mi].trajectoryBaseIndex==this.modelIndex&&b.set(f)}0<=b.nextSetBit(0)&&this.ms.deleteBonds(b,!1);this.getRasmolHydrogenBonds(a,a,null,!1,2147483647,!1,null)},"JU.BS");h(c$,"getDefaultLargePDBRendering",function(a,b){var c=new JU.BS;0==this.getBondCount()&&(c=this.bsAtoms);if(c!==this.bsAtoms)for(var d=0;d<this.bioPolymerCount;d++)this.bioPolymers[d].getRange(c,
this.isMutated);if(!(0>c.nextSetBit(0))){var f=new JU.BS;if(c===this.bsAtoms)f=c;else for(d=0;d<this.bioPolymerCount;d++)0==this.bioPolymers[d].getType()&&this.bioPolymers[d].getRange(f,this.isMutated);0<=f.nextSetBit(0)&&a.append("select ").append(JU.Escape.eBS(f)).append(";backbone only;");this.act<=b||(a.append("select ").append(JU.Escape.eBS(c)).append(" & connected; wireframe only;"),c!==this.bsAtoms&&(f.clearAll(),f.or(this.bsAtoms),f.andNot(c),0<=f.nextSetBit(0)&&a.append("select "+JU.Escape.eBS(f)+
" & !connected;stars 0.5;spacefill off;")))}},"JU.SB,~N");h(c$,"getAtomBitsStr",function(a,b,c){switch(a){default:return new JU.BS;case 1073741925:return this.getAnnotationBits("domains",1073741925,b);case 1073742189:return this.getAnnotationBits("validation",1073742189,b);case 1073742128:return this.getAnnotationBits("rna3d",1073742128,b);case 1073741864:return c=new JU.BS,0!=b.length%2?c:this.ms.getAtomBitsMDa(1086324742,this.getAllBasePairBits(b),c);case 1073741916:return this.getAnnotationBits("dssr",
1073741916,b);case 1086324744:return this.getAllSequenceBits(b,null,c)}},"~N,~S,JU.BS");h(c$,"getAtomBitsBS",function(a,b,c){var d=this.ms.at,f=this.ms.ac,g=0,e;switch(a){case 136314895:case 2097184:for(var h=136314895==a?J.c.STR.HELIX:J.c.STR.SHEET,g=f;0<=--g;)(e=d[g].group).isWithinStructure(h)&&e.setAtomBits(c),g=e.firstAtomIndex;break;case 2097188:for(g=f;0<=--g;)(e=d[g].group).isCarbohydrate()&&e.setAtomBits(c),g=e.firstAtomIndex;break;case 2097156:for(g=f;0<=--g;)(e=d[g].group).isDna()&&e.setAtomBits(c),
g=e.firstAtomIndex;break;case 2097166:for(g=f;0<=--g;)(e=d[g].group).isNucleic()&&e.setAtomBits(c),g=e.firstAtomIndex;break;case 2097168:for(g=f;0<=--g;)(e=d[g].group).isProtein()&&e.setAtomBits(c),g=e.firstAtomIndex;break;case 2097170:for(g=f;0<=--g;)(e=d[g].group).isPurine()&&e.setAtomBits(c),g=e.firstAtomIndex;break;case 2097172:for(g=f;0<=--g;)(e=d[g].group).isPyrimidine()&&e.setAtomBits(c),g=e.firstAtomIndex;break;case 2097174:for(g=f;0<=--g;)(e=d[g].group).isRna()&&e.setAtomBits(c),g=e.firstAtomIndex}if(0>
g)return c;f=b.nextSetBit(0);if(0>f)return c;g=0;switch(a){case 1094713362:for(g=f;0<=g;g=b.nextSetBit(g+1))0<=d[g].group.getBioPolymerIndexInModel()&&d[g].group.bioPolymer.setAtomBitsAndClear(c,b);break;case 1639976963:for(g=f;0<=g;g=b.nextSetBit(g+1))f=d[g].group.getStructure(),null!=f&&f.setAtomBitsAndClear(c,b)}0==g&&JU.Logger.error("MISSING getAtomBits entry for "+JS.T.nameOf(a));return c},"~N,JU.BS,JU.BS");e(c$,"getAnnotationBits",function(a,b,c){for(var d=new JU.BS,f=this.vwr.getAnnotationParser(a.equals("dssr")),
g,e=this.ms.mc;0<=--e;)null!=(g=this.ms.getInfo(e,a))&&d.or(f.getAtomBits(this.vwr,c,this.ms.am[e].getCachedAnnotationMap(a+" V ",g),this.ms.am[e].dssrCache,b,e,this.ms.am[e].bsAtoms));return d},"~S,~N,~S");e(c$,"getCachedAnnotationMap",function(a,b){var c=null==this.dssrCache&&null!=b?this.dssrCache=new java.util.Hashtable:this.dssrCache;if(null==c)return null;var d=c.get(a);null==d&&null!=b&&(d=u(b,JS.SV)||u(b,java.util.Hashtable)?b:this.vwr.parseJSON(b),c.put(a,d));return u(d,JS.SV)||u(d,java.util.Hashtable)?
d:null},"~S,~O");h(c$,"getIdentifierOrNull",function(a){for(var b=a.length,c=0;c<b&&JU.PT.isLetter(a.charAt(c));)++c;var d=this.ms.getSpecNameOrNull(a.substring(0,c),!1);if(c==b)return d;null==d&&(d=new JU.BS);for(var f=c;c<b&&JU.PT.isDigit(a.charAt(c));)++c;var g=0;try{g=Integer.parseInt(a.substring(f,c))}catch(e){if(H(e,NumberFormatException))return null;throw e;}f=" ";c<b&&"^"==a.charAt(c)&&++c<b&&(f=a.charAt(c));g=JM.Group.getSeqcodeFor(g,f);g=this.ms.getSeqcodeBits(g,!1);if(null==g){" "!=f&&
(g=this.ms.getSeqcodeBits(Character.toUpperCase(a.charAt(c)).charCodeAt(0),!1));if(null==g)return null;c++}d.and(g);if(c>=b)return d;if(c!=b-1)return null;d.and(this.ms.getChainBits(a.charCodeAt(c)));return d},"~S");e(c$,"getUnitID",function(a,b){var c=new JU.SB,d=a.group,f=!JV.JC.checkFlag(b,16),g=JV.JC.checkFlag(b,8)?d.getInsertionCode():"\x00",e="\x00"!=g;JV.JC.checkFlag(b,1)&&null!=this.pdbID&&c.append(this.pdbID);c.append("|").appendO(this.ms.getInfo(this.modelIndex,"modelNumber")).append("|").append(this.vwr.getChainIDStr(d.chain.chainID)).append("|").append(d.getGroup3()).append("|").appendI(d.getResno());
JV.JC.checkFlag(b,4)?(c.append("|").append(a.getAtomName()),"\x00"!=a.altloc?c.append("|").appendC(a.altloc):(f||e)&&c.append("|")):(f||e)&&c.append("||");e?c.append("|").appendC(g):f&&c.append("|");f&&c.append("|");return c.toString()},"JM.Atom,~N");B(c$,"pdbRecords",G(-1,["ATOM  ","MODEL ","HETATM"]))});p("JM");s(["JM.Monomer"],"JM.CarbohydrateMonomer",["J.c.STR"],function(){c$=C(JM,"CarbohydrateMonomer",JM.Monomer);L(c$,function(){});c$.validateAndAllocate=e(c$,"validateAndAllocate",function(a,
b,c,d,f){return(new JM.CarbohydrateMonomer).set2(a,b,c,d,f,JM.CarbohydrateMonomer.alphaOffsets)},"JM.Chain,~S,~N,~N,~N");h(c$,"isCarbohydrate",function(){return!0});h(c$,"getProteinStructureType",function(){return J.c.STR.CARBOHYDRATE});h(c$,"isConnectedAfter",function(a){if(null==a)return!0;for(var b=this.firstAtomIndex;b<=this.lastAtomIndex;b++)for(var c=a.firstAtomIndex;c<=a.lastAtomIndex;c++){var d=this.chain.model.ms.at[b],f=this.chain.model.ms.at[c];if(14==d.getElementNumber()+f.getElementNumber()&&
3.24>d.distanceSquared(f))return!0}return!1},"JM.Monomer");h(c$,"findNearestAtomIndex",function(a,b,c,d){var f=c[0],g=this.getLeadAtom();d=A(d/2);1200>d&&(d=1200);0!=g.sZ&&(d=E(this.scaleToScreen(g.sZ,d)),4>d&&(d=4),this.isCursorOnTopOf(g,a,b,d,f)&&(c[0]=g))},"~N,~N,~A,~N,~N");h(c$,"isConnectedPrevious",function(){if(0>=this.monomerIndex)return!1;for(var a=this.firstAtomIndex;a<=this.lastAtomIndex;a++)if(this.getCrossLinkGroup(a,null,null,!0,!1,!1))return!0;return!1});B(c$,"alphaOffsets",F(-1,[0]))});
p("JM");s(["JM.BioPolymer"],"JM.CarbohydratePolymer",null,function(){c$=C(JM,"CarbohydratePolymer",JM.BioPolymer);D(c$,function(a){K(this,JM.CarbohydratePolymer,[]);this.set(a);this.type=3},"~A")});p("JM");s(["JM.Monomer"],"JM.PhosphorusMonomer",["JU.Quat","$.V3","J.c.STR"],function(){c$=C(JM,"PhosphorusMonomer",JM.Monomer);h(c$,"isNucleic",function(){return!0});L(c$,function(){});c$.validateAndAllocateP=e(c$,"validateAndAllocateP",function(a,b,c,d,f,g){return d!=f||g[13]!=d?null:(new JM.PhosphorusMonomer).set2(a,
b,c,d,f,JM.PhosphorusMonomer.phosphorusOffsets)},"JM.Chain,~S,~N,~N,~N,~A");h(c$,"isDna",function(){return this.isDnaByID()});h(c$,"isRna",function(){return this.isRnaByID()});h(c$,"isPurine",function(){return this.isPurineByID()});h(c$,"isPyrimidine",function(){return this.isPyrimidineByID()});h(c$,"getStructure",function(){return this.chain});h(c$,"getProteinStructureType",function(){return J.c.STR.NONE});h(c$,"isConnectedAfter",function(a){return this.isCA2(a)},"JM.Monomer");e(c$,"isCA2",function(a){return null==
a?!0:this.getLeadAtom().distance(a.getLeadAtom())<=JM.PhosphorusMonomer.MAX_ADJACENT_PHOSPHORUS_DISTANCE},"JM.Monomer");h(c$,"getQuaternion",function(){return this.getQuaternionP()},"~S");e(c$,"getQuaternionP",function(){var a=this.monomerIndex;if(0>=a||a>=this.bioPolymer.monomerCount-1)return null;var b=this.bioPolymer.monomers[a].getAtomFromOffsetIndex(0),c;c=this.bioPolymer.monomers[a+1].getAtomFromOffsetIndex(0);a=this.bioPolymer.monomers[a-1].getAtomFromOffsetIndex(0);if(null==b||null==c||null==
a)return null;var d=new JU.V3,f=new JU.V3;d.sub2(c,b);f.sub2(a,b);return JU.Quat.getQuaternionFrameV(d,f,null,!1)});h(c$,"getQuaternionFrameCenter",function(){return this.getAtomFromOffsetIndex(0)},"~S");h(c$,"getHelixData",function(a,b,c){return this.getHelixData2(a,b,c)},"~N,~S,~N");B(c$,"P",0,"phosphorusOffsets",F(-1,[0]),"MAX_ADJACENT_PHOSPHORUS_DISTANCE",8)});p("JM");c$=w(function(){this.g2=this.g1=this.info=null;v(this,arguments)},JM,"BasePair");D(c$,function(){});c$.add=e(c$,"add",function(a,
b,c){var d=new JM.BasePair;d.info=a;(d.g1=b).addBasePair(d);(d.g2=c).addBasePair(d);return d},"java.util.Map,JM.NucleicMonomer,JM.NucleicMonomer");e(c$,"getPartnerAtom",function(a){return(a===this.g1?this.g2:this.g1).getLeadAtom().i},"JM.NucleicMonomer");e(c$,"toString",function(){return this.info.toString()});p("JM");s(["JM.PhosphorusMonomer"],"JM.NucleicMonomer","java.lang.Character JU.Lst $.P3 $.Quat $.V3 J.c.STR JM.Group JM.NucleicPolymer".split(" "),function(){c$=w(function(){this.hasRnaO2Prime=
this.$isPyrimidine=this.$isPurine=!1;this.bps=this.baseCenter=null;v(this,arguments)},JM,"NucleicMonomer",JM.PhosphorusMonomer);L(c$,function(){});c$.validateAndAllocate=e(c$,"validateAndAllocate",function(a,b,c,d,f,g){var e=JM.Monomer.scanForOffsets(d,g,JM.NucleicMonomer.interestingNucleicAtomIDs);if(null==e||!JM.Monomer.checkOptional(e,19,d,g[73]))return null;JM.Monomer.checkOptional(e,20,d,g[89]);JM.Monomer.checkOptional(e,18,d,g[90]);JM.Monomer.checkOptional(e,23,d,g[75]);JM.Monomer.checkOptional(e,
24,d,g[77]);return(new JM.NucleicMonomer).set4(a,b,c,d,f,e)},"JM.Chain,~S,~N,~N,~N,~A");e(c$,"set4",function(a,b,c,d,f,g){this.set2(a,b,c,d,f,g);JM.Monomer.have(g,15)||(g[0]=g[19],this.setLeadAtomIndex());this.hasRnaO2Prime=JM.Monomer.have(g,2);this.$isPyrimidine=JM.Monomer.have(g,8);this.$isPurine=JM.Monomer.have(g,9)&&JM.Monomer.have(g,10)&&JM.Monomer.have(g,11);return this},"JM.Chain,~S,~N,~N,~N,~A");e(c$,"isNucleicMonomer",function(){return!0});h(c$,"isDna",function(){return!this.hasRnaO2Prime});
h(c$,"isRna",function(){return this.hasRnaO2Prime});h(c$,"isPurine",function(){return this.$isPurine||!this.$isPyrimidine&&this.isPurineByID()});h(c$,"isPyrimidine",function(){return this.$isPyrimidine||!this.$isPurine&&this.isPyrimidineByID()});e(c$,"isGuanine",function(){return JM.Monomer.have(this.offsets,17)});h(c$,"getProteinStructureType",function(){return this.hasRnaO2Prime?J.c.STR.RNA:J.c.STR.DNA});e(c$,"getP",function(){return this.getAtomFromOffsetIndex(0)});e(c$,"getC1P",function(){return this.getAtomFromOffsetIndex(25)});
e(c$,"getC2",function(){return this.getAtomFromOffsetIndex(5)});e(c$,"getC4P",function(){return this.getAtomFromOffsetIndex(27)});e(c$,"getN1",function(){return this.getAtomFromOffsetIndex(4)});e(c$,"getN3",function(){return this.getAtomFromOffsetIndex(6)});e(c$,"getN2",function(){return this.getAtomFromOffsetIndex(17)});e(c$,"getN4",function(){return this.getAtomFromOffsetIndex(14)});e(c$,"getN6",function(){return this.getAtomFromOffsetIndex(16)});e(c$,"getO2",function(){return this.getAtomFromOffsetIndex(8)});
e(c$,"getO4",function(){return this.getAtomFromOffsetIndex(12)});e(c$,"getO6",function(){return this.getAtomFromOffsetIndex(13)});h(c$,"getTerminatorAtom",function(){return this.getAtomFromOffsetIndex(JM.Monomer.have(this.offsets,20)?20:21)});e(c$,"getBaseRing6Points",function(a){this.getPoints(JM.NucleicMonomer.ring6OffsetIndexes,a)},"~A");e(c$,"getPoints",function(a,b){for(var c=a.length;0<=--c;)b[c]=this.getAtomFromOffsetIndex(a[c])},"~A,~A");e(c$,"maybeGetBaseRing5Points",function(a){this.$isPurine&&
this.getPoints(JM.NucleicMonomer.ring5OffsetIndexes,a);return this.$isPurine},"~A");e(c$,"getRiboseRing5Points",function(a){this.getPoints(JM.NucleicMonomer.riboseOffsetIndexes,a)},"~A");h(c$,"isConnectedAfter",function(a){if(null==a)return!0;var b=this.getAtomFromOffsetIndex(15);return null==b?!1:a.getAtomFromOffsetIndex(21).isBonded(b)||this.isCA2(a)},"JM.Monomer");h(c$,"findNearestAtomIndex",function(a,b,c,d){var f=c[0],g=this.getLeadAtom(),e=this.getAtomFromOffsetIndex(19),h=this.getAtomFromOffsetIndex(22);
d=A(d/2);1900>d&&(d=1900);d=E(this.scaleToScreen(g.sZ,d));4>d&&(d=4);if(this.isCursorOnTopOf(g,a,b,d,f)||this.isCursorOnTopOf(e,a,b,d,f)||this.isCursorOnTopOf(h,a,b,d,f))c[0]=g},"~N,~N,~A,~N,~N");e(c$,"setRingsVisible",function(a){for(var b=6;0<=--b;)this.getAtomFromOffsetIndex(JM.NucleicMonomer.ring6OffsetIndexes[b]).setShapeVisibility(32768,a);if(this.$isPurine)for(b=4;1<=--b;)this.getAtomFromOffsetIndex(JM.NucleicMonomer.ring5OffsetIndexes[b]).setShapeVisibility(32768,a)},"~B");e(c$,"setRingsClickable",
function(){for(var a=6;0<=--a;)this.getAtomFromOffsetIndex(JM.NucleicMonomer.ring6OffsetIndexes[a]).setClickable(32768);if(this.$isPurine)for(a=4;1<=--a;)this.getAtomFromOffsetIndex(JM.NucleicMonomer.ring5OffsetIndexes[a]).setClickable(32768)});e(c$,"getN0",function(){return this.getAtomFromOffsetIndex(this.$isPurine?11:4)});h(c$,"getHelixData",function(a,b,c){return this.getHelixData2(a,b,c)},"~N,~S,~N");h(c$,"getQuaternionFrameCenter",function(a){switch(a){case "x":case "a":case "b":case "p":return this.getP();
case "c":if(null==this.baseCenter){a=0;this.baseCenter=new JU.P3;for(var b=0;b<JM.NucleicMonomer.heavyAtomIndexes.length;b++){var c=this.getAtomFromOffsetIndex(JM.NucleicMonomer.heavyAtomIndexes[b]);null!=c&&(this.baseCenter.add(c),a++)}this.baseCenter.scale(1/a)}return this.baseCenter;default:return this.getN0()}},"~S");h(c$,"getQuaternion",function(a){if(null==this.bioPolymer)return null;var b=null,c=null,d=!1,f=!1;switch(a){case "a":a=this.getP();if(0==this.monomerIndex||null==a)return null;d=
!0;b=this.bioPolymer.monomers[this.monomerIndex-1].getC4P();c=this.getC4P();break;case "x":a=this.getP();if(this.monomerIndex==this.bioPolymer.monomerCount-1||null==a)return null;b=this.bioPolymer.monomers[this.monomerIndex+1].getP();c=this.getC4P();break;case "b":return this.getQuaternionP();case "c":case "n":a=this.getN0();if(null==a)return null;f=d=!0;b=this.getAtomFromOffsetIndex(5);c=this.getAtomFromOffsetIndex(25);break;case "p":a=this.getP();if(null==a)return null;var g=this.getAtomFromOffsetIndex(23),
e=this.getAtomFromOffsetIndex(24),h=a.bonds;if(null==h)return null;for(var j=a.group,n=0;n<h.length;n++){var l=h[n].getOtherAtom(a);null!=g&&l.i==g.i||null!=e&&l.i==e.i||(l.group===j?c=l:b=l)}break;case "q":return null;default:a=this.getN0();if(null==a)return null;this.$isPurine?(b=this.getAtomFromOffsetIndex(5),c=this.getAtomFromOffsetIndex(9)):(b=this.getAtomFromOffsetIndex(6),c=this.getAtomFromOffsetIndex(1))}if(null==b||null==c)return null;b=JU.V3.newVsub(b,a);c=JU.V3.newVsub(c,a);f&&c.scale(-1);
return JU.Quat.getQuaternionFrameV(b,c,null,d)},"~S");h(c$,"isCrossLinked",function(a){if(!u(a,JM.NucleicMonomer)||this.$isPurine==a.isPurine())return!1;var b=this.$isPurine?a:this;a=(this.$isPurine?this:a).getN1();b=b.getN3();return a.isBonded(b)},"JM.Group");h(c$,"getCrossLinkVector",function(a,b,c){if(!c)return!1;b=this.$isPurine?this.getN1():this.getN3();c=b.bonds;if(null==c)return!1;for(var d=0;d<c.length;d++)if(c[d].isHydrogen()){var f=c[d].getOtherAtom(b),g=f.group;if(u(g,JM.NucleicMonomer)&&
(this.$isPurine?g.getN3():g.getN1())===f){if(null==a)return!0;a.addLast(Integer.$valueOf(b.i));a.addLast(Integer.$valueOf(f.i));a.addLast(Integer.$valueOf(g.leadAtomIndex))}}return null!=a&&0<a.size()},"JU.Lst,~B,~B");e(c$,"getEdgePoints",function(a){a[0]=this.getLeadAtom();a[1]=this.getC4P();a[2]=a[5]=this.getC1P();switch(this.getGroup1()){case "C":return a[3]=this.getO2(),a[4]=this.getN4(),!0;case "A":return a[3]=this.getC2(),a[4]=this.getN6(),!0;case "G":case "I":return a[3]=this.getC2(),a[4]=
this.getO6(),!0;case "T":case "U":return a[3]=this.getO2(),a[4]=this.getO4(),!0;default:return!1}},"~A");e(c$,"addBasePair",function(a){null==this.bps&&(this.bps=new JU.Lst);this.bps.addLast(a)},"JM.BasePair");e(c$,"setGroup1",function(a){"\x00"==this.group1&&(this.group1=a)},"~S");e(c$,"getBasePairs",function(){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(c$,"getGroup1b",function(){var a=JM.Group.group3Names[this.groupID],b=null==JM.NucleicPolymer.htGroup1?null:JM.NucleicPolymer.htGroup1.get(a);return null==b?Character.toLowerCase(a.charAt(a.length-1)):b.charAt(0)});B(c$,"C6",1,"O2Pr",2,"C5",3,"N1",4,"C2",5,"N3",6,"C4",7,"O2",8,"N7",9,"C8",10,"N9",11,"O4",12,"O6",13,"N4",14,"NP",15,"N6",16,"N2",17,"H5T",18,"O5P",19,"H3T",20,"O3P",21,"C3P",22,"O1P",23,"O2P",24,"C1P",25,"C2P",26,"C4P",27,"O4P",28,"C5P",29,"interestingNucleicAtomIDs",F(-1,[-14,37,-80,
36,32,33,34,35,-39,-40,-41,-42,-48,-47,-43,-14,-45,-44,-73,-7,-89,10,9,-75,-77,-13,-12,-9,-79,-8]),"ring6OffsetIndexes",F(-1,[3,1,4,5,6,7]),"ring5OffsetIndexes",F(-1,[3,9,10,11,7]),"riboseOffsetIndexes",F(-1,[25,26,22,27,28,21,29,19,0]),"heavyAtomIndexes",F(-1,[3,1,4,5,6,7,11,10,9,16,14,8,12,17,13]))});p("JM");s(["JM.PhosphorusPolymer"],"JM.NucleicPolymer",["JU.Measure","$.P4","$.V3","JM.HBond"],function(){c$=w(function(){this.isDssrSet=!1;v(this,arguments)},JM,"NucleicPolymer",JM.PhosphorusPolymer);
D(c$,function(a){K(this,JM.NucleicPolymer,[a]);this.type=2;this.hasWingPoints=!0},"~A");e(c$,"getNucleicPhosphorusAtom",function(a){return this.monomers[a].getLeadAtom()},"~N");h(c$,"calcEtaThetaAngles",function(){for(var a=NaN,b=0;b<this.monomerCount-2;++b){var c=this.monomers[b],d=this.monomers[b+1],f=c.getP(),g=c.getC4P(),e=d.getP(),d=d.getC4P();0<b&&(a=this.monomers[b-1].getC4P(),a=JU.Measure.computeTorsion(a,f,g,e,!0));f=JU.Measure.computeTorsion(f,g,e,d,!0);0>a&&(a+=360);0>f&&(f+=360);c.setGroupParameter(1111490565,
a);c.setGroupParameter(1111490576,f)}return!0});h(c$,"calcRasmolHydrogenBonds",function(a,b,c,d,f){for(var g=new JU.V3,e=new JU.V3,h=this.monomerCount;0<=--h;){var j=this.monomers[h];if(j.isPurine()){var n=j.getN3(),l=b.get(n.i);if(l||c.get(n.i)){for(var m=j.getN1(),q=j.getN0(),p=JU.Measure.getPlaneThroughPoints(n,m,q,g,e,new JU.P4),n=null,s=25,r=null,t=a.monomerCount;0<=--t;){var u=a.monomers[t];if(u.$isPyrimidine){var v=u.getN3();if(!(l?!c.get(v.i):!b.get(v.i))){var w=u.getN0(),y=m.distanceSquared(v);
y<s&&(50<q.distanceSquared(w)&&1>Math.abs(JU.Measure.distanceToPlane(p,v)))&&(r=u,n=v,s=y)}}}l=0;null!=n&&(l+=JM.NucleicPolymer.addHydrogenBond(d,m,n),l>=f||(j.isGuanine()?(l+=JM.NucleicPolymer.addHydrogenBond(d,j.getN2(),r.getO2()),l>=f||JM.NucleicPolymer.addHydrogenBond(d,j.getO6(),r.getN4())):JM.NucleicPolymer.addHydrogenBond(d,j.getN6(),r.getO4())))}}}},"JM.BioPolymer,JU.BS,JU.BS,JU.Lst,~N,~A,~B,~B");c$.addHydrogenBond=e(c$,"addHydrogenBond",function(a,b,c){if(null==b||null==c)return 0;a.addLast(new JM.HBond(b,
c,18432,1,0,0));return 1},"JU.Lst,JM.Atom,JM.Atom");B(c$,"htGroup1",null)});p("JM");c$=w(function(){this.g2=this.g1=this.info=null;v(this,arguments)},JM,"BasePair");D(c$,function(){});c$.add=e(c$,"add",function(a,b,c){var d=new JM.BasePair;d.info=a;(d.g1=b).addBasePair(d);(d.g2=c).addBasePair(d);return d},"java.util.Map,JM.NucleicMonomer,JM.NucleicMonomer");e(c$,"getPartnerAtom",function(a){return(a===this.g1?this.g2:this.g1).getLeadAtom().i},"JM.NucleicMonomer");e(c$,"toString",function(){return this.info.toString()});
p("JM");s(["JM.BioPolymer"],"JM.PhosphorusPolymer",null,function(){c$=C(JM,"PhosphorusPolymer",JM.BioPolymer);D(c$,function(a){K(this,JM.PhosphorusPolymer,[]);this.setP(a)},"~A");e(c$,"setP",function(a){this.set(a);this.hasStructure=!0},"~A")});p("J.dssx");s(null,"J.dssx.Bridge",["java.lang.Boolean","JU.Escape"],function(){c$=w(function(){this.ladder=this.b=this.a=null;this.isAntiparallel=!1;v(this,arguments)},J.dssx,"Bridge");D(c$,function(a,b,c){this.a=a;this.b=b;this.ladder=y(2,2,0);this.ladder[0][0]=
this.ladder[0][1]=Math.min(a.i,b.i);this.ladder[1][0]=this.ladder[1][1]=Math.max(a.i,b.i);this.addLadder(c)},"JM.Atom,JM.Atom,java.util.Map");e(c$,"addBridge",function(a,b){if(a.isAntiparallel!=this.isAntiparallel||!this.canAdd(a)||!a.canAdd(this))return!1;this.extendLadder(a.ladder[0][0],a.ladder[1][0]);this.extendLadder(a.ladder[0][1],a.ladder[1][1]);a.ladder=this.ladder;a.ladder!==this.ladder&&(b.remove(a.ladder),this.addLadder(b));return!0},"J.dssx.Bridge,java.util.Map");e(c$,"addLadder",function(a){a.put(this.ladder,
this.isAntiparallel?Boolean.TRUE:Boolean.FALSE)},"java.util.Map");e(c$,"canAdd",function(a){var b=a.a.i;a=a.b.i;return this.isAntiparallel?b>=this.ladder[0][1]&&a<=this.ladder[1][0]||b<=this.ladder[0][0]&&a>=this.ladder[1][1]:b<=this.ladder[0][0]&&a<=this.ladder[1][0]||b>=this.ladder[0][1]&&a>=this.ladder[1][1]},"J.dssx.Bridge");e(c$,"extendLadder",function(a,b){this.ladder[0][0]>a&&(this.ladder[0][0]=a);this.ladder[0][1]<a&&(this.ladder[0][1]=a);this.ladder[1][0]>b&&(this.ladder[1][0]=b);this.ladder[1][1]<
b&&(this.ladder[1][1]=b)},"~N,~N");h(c$,"toString",function(){return(this.isAntiparallel?"a ":"p ")+this.a+" - "+this.b+"\t"+JU.Escape.e(this.ladder)})});p("J.api");R(J.api,"DSSPInterface");p("J.dssx");s(["J.api.DSSPInterface"],"J.dssx.DSSP","java.lang.Boolean java.util.Hashtable JU.AU $.BS $.Lst $.PT $.SB J.c.STR J.dssx.Bridge J.i18n.GT JM.HBond JM.AminoPolymer JU.Escape $.Logger JV.Viewer".split(" "),function(){c$=w(function(){this.done=this.vHBonds=this.bioPolymers=null;this.$setStructure=this.dsspIgnoreHydrogens=
this.doReport=!1;this.bsBad=this.labels=null;this.bioPolymerCount=0;this.sheetOffsets=this.bridgesP=this.bridgesA=this.htLadders=this.htBridges=null;v(this,arguments)},J.dssx,"DSSP",null,J.api.DSSPInterface);O(c$,function(){this.sheetOffsets=G(-1,[y(-1,[0,-1,1,0,1,0,0,-1]),y(-1,[0,0,0,0,1,-1,1,-1])])});D(c$,function(){});h(c$,"calculateDssp",function(a,b,c,d,f,g){this.bioPolymers=a;this.bioPolymerCount=b;this.vHBonds=c;this.doReport=d;this.dsspIgnoreHydrogens=f;this.$setStructure=g;a=new JU.BS;for(var e=
0;e<b;e++)u(this.bioPolymers[e],JM.AminoPolymer)&&a.set(e);if(a.isEmpty())return"";e=this.bioPolymers[0].model;c=new JU.SB;c.append("Jmol ").append(JV.Viewer.getJmolVersion()).append(" DSSP analysis for model ").append(e.ms.getModelNumberDotted(e.modelIndex)).append(" - ").append(e.ms.getModelTitle(e.modelIndex)).append("\n");0==e.modelIndex&&c.append("\nW. Kabsch and C. Sander, Biopolymers, vol 22, 1983, pp 2577-2637\n").append("\nWe thank Wolfgang Kabsch and Chris Sander for writing the DSSP software,\n").append("and we thank the CMBI for maintaining it to the extent that it was easy to\n").append("re-engineer for our purposes. At this point in time, we make no guarantee\n").append("that this code gives precisely the same analysis as the code available via license\n").append("from CMBI at http://swift.cmbi.ru.nl/gv/dssp\n");
g&&0==e.modelIndex&&c.append("\nAll bioshapes have been deleted and must be regenerated.\n");0<e.altLocCount&&c.append("\nNote: This model contains alternative locations. Use  'CONFIGURATION 1' to be consistent with CMBI DSSP.\n");this.labels=N(b,"\x00");this.done=Array(b);this.bsBad=new JU.BS;for(var h=!1,e=a.nextSetBit(0);0<=e;e=a.nextSetBit(e+1)){g=this.bioPolymers[e];!h&&null!=g.monomers[0].getExplicitNH()&&(f?c.append(J.i18n.GT.o(J.i18n.GT._("NOTE: Backbone amide hydrogen positions are present and will be ignored. Their positions will be approximated, as in standard DSSP analysis.\nUse {0} to not use this approximation.\n\n"),
"SET dsspCalculateHydrogenAlways FALSE")):c.append(J.i18n.GT.o(J.i18n.GT._("NOTE: Backbone amide hydrogen positions are present and will be used. Results may differ significantly from standard DSSP analysis.\nUse {0} to ignore these hydrogen positions.\n\n"),"SET dsspCalculateHydrogenAlways TRUE")),h=!0);g.recalculateLeadMidpointsAndWingVectors();var j=g.monomerCount;this.labels[e]=N(j,"\x00");this.done[e]=new JU.BS;for(var n=0;n<j;n++)null==g.monomers[n].getCarbonylOxygenAtom()&&this.bsBad.set(g.monomers[n].leadAtomIndex)}f=
this.getDualHydrogenBondArray();this.bridgesA=new JU.Lst;this.bridgesP=new JU.Lst;this.htBridges=new java.util.Hashtable;this.htLadders=new java.util.Hashtable;this.getBridges(f);this.getSheetStructures();b=Array(b);for(e=a.nextSetBit(0);0<=e;e=a.nextSetBit(e+1))null!=f[e]&&(b[e]=this.findHelixes(e,f[e]));if(d){d=new JU.SB;c.append("\n------------------------------\n");for(e=a.nextSetBit(0);0<=e;e=a.nextSetBit(e+1))null!=this.labels[e]&&(g=this.bioPolymers[e],d.append(this.dumpSummary(g,this.labels[e])),
c.append(b[e]).append(this.dumpTags(g,"$.1: "+String.valueOf(this.labels[e]),this.bsBad,2)));0<=this.bsBad.nextSetBit(0)&&c.append("\nNOTE: '!' indicates a residue that is missing a backbone carbonyl oxygen atom.\n");c.append("\n").append("SUMMARY:"+d)}return c.toString()},"~A,~N,~O,~B,~B,~B");e(c$,"getDualHydrogenBondArray",function(){for(var a=JU.AU.newInt4(this.bioPolymerCount),b=0;b<this.bioPolymerCount;b++)if(u(this.bioPolymers[b],JM.AminoPolymer)){var c=this.bioPolymers[b].monomerCount;a[b]=
y(c,2,3,0);for(var d=0;d<c;++d)a[b][d][0][1]=a[b][d][1][1]=-2147483648,a[b][d][0][2]=a[b][d][1][2]=0}for(b=0;b<this.bioPolymerCount;b++)if(null!=a[b])for(d=0;d<this.bioPolymerCount;d++)null!=a[d]&&this.bioPolymers[b].calcRasmolHydrogenBonds(this.bioPolymers[d],null,null,null,2,a[b],!1,this.dsspIgnoreHydrogens);return a});e(c$,"getBridges",function(a){for(var b=this.bioPolymers[0].model.ms.at,c=null,d=new java.util.Hashtable,f=0;f<a.length;f++)if(u(this.bioPolymers[f],JM.AminoPolymer))for(var e=this.bioPolymers[f],
k=a[f].length-1,h=1;h<k;h++){var j=e.monomers[h].leadAtomIndex;if(!this.bsBad.get(j))for(var n=f;n<a.length;n++)if(u(this.bioPolymers[n],JM.AminoPolymer))for(var l=f==n?h+3:1;l<a[n].length-1;l++){var m=this.bioPolymers[n],q=m.monomers[l].leadAtomIndex;if(!this.bsBad.get(q)){if(null==(c=this.getBridge(a,f,h,n,l,this.bridgesP,b[j],b[q],e,m,d,!1)))if(null!=(c=this.getBridge(a,f,h,n,l,this.bridgesA,b[j],b[q],e,m,d,!0)))c.isAntiparallel=!0;else continue;JU.Logger.debugging&&JU.Logger.debug("Bridge found "+
c);this.done[f].set(h);this.done[n].set(l);this.htBridges.put(j+"-"+q,c)}}}},"~A");e(c$,"getBridge",function(a,b,c,d,f,e,k,h,j,n,l,m){var q=null,p=null,s=0,r=m?this.sheetOffsets[1]:this.sheetOffsets[0];return null!=(q=this.isHbonded(c+r[0],f+r[1],b,d,a))&&null!=(p=this.isHbonded(f+r[2],c+r[3],d,b,a))||null!=(q=this.isHbonded(c+r[s=4],f+r[5],b,d,a))&&null!=(p=this.isHbonded(f+r[6],c+r[7],d,b,a))?(a=new J.dssx.Bridge(k,h,this.htLadders),e.addLast(a),null!=this.vHBonds&&(e=m?14336:6144,this.addHbond(j.monomers[c+
r[s]],n.monomers[f+r[++s]],q[2],e,l),this.addHbond(n.monomers[f+r[++s]],j.monomers[c+r[++s]],p[2],e,l)),a):null},"~A,~N,~N,~N,~N,JU.Lst,JM.Atom,JM.Atom,JM.AminoPolymer,JM.AminoPolymer,java.util.Map,~B");e(c$,"addHbond",function(a,b,c,d,f){a=a.getNitrogenAtom();b=b.getCarbonylOxygenAtom();if(null!=f){var e=a.i+" "+b.i;if(f.containsKey(e))return;f.put(e,Boolean.TRUE)}this.vHBonds.addLast(new JM.HBond(a,b,d,1,0,c/1E3))},"JM.Monomer,JM.Monomer,~N,~N,java.util.Map");e(c$,"getSheetStructures",function(){if(!(0==
this.bridgesA.size()&&0==this.bridgesP.size())){this.createLadders(this.bridgesA,!0);this.createLadders(this.bridgesP,!1);for(var a=new JU.BS,b=new JU.BS,c,d=this.htLadders.keySet().iterator();d.hasNext()&&((c=d.next())||1);)c[0][0]==c[0][1]&&c[1][0]==c[1][1]?(b.set(c[0][0]),b.set(c[1][0])):(a.setBits(c[0][0],c[0][1]+1),a.setBits(c[1][0],c[1][1]+1));c=new JU.BS;for(var d=new JU.BS,f=this.bioPolymers.length;0<=--f;)if(u(this.bioPolymers[f],JM.AminoPolymer)){c.clearAll();d.clearAll();for(var e=this.bioPolymers[f],
k=0;k<e.monomerCount;){var h=e.monomers[k].leadAtomIndex;if(a.get(h)){for(h=k+1;h<e.monomerCount&&a.get(e.monomers[h].leadAtomIndex);)h++;c.setBits(k,h);k=h}else b.get(h)&&d.set(k),++k}this.doReport&&(this.setTag(this.labels[f],d,"B"),this.setTag(this.labels[f],c,"E"));this.$setStructure&&this.setStructure(e,c,J.c.STR.SHEET);this.done[f].or(c);this.done[f].or(d)}}});e(c$,"createLadders",function(a,b){for(var c=b?-1:1,d=a.size(),f=0;f<d;f++)this.checkBridge(a.get(f),b,1,c);for(f=0;f<d;f++)this.checkBulge(a.get(f),
b,1)},"JU.Lst,~B");e(c$,"checkBridge",function(a,b,c,d){b=this.htBridges.get(a.a.getOffsetResidueAtom("\x00",c)+"-"+a.b.getOffsetResidueAtom("\x00",d));return null!=b&&a.addBridge(b,this.htLadders)},"J.dssx.Bridge,~B,~N,~N");e(c$,"checkBulge",function(a,b,c){for(var d=b?-1:1,f=0;3>f;f++)for(var e=0==f?1:0;6>e;e++)this.checkBridge(a,b,f*c,e*d),e>f&&this.checkBridge(a,b,e*c,f*d)},"J.dssx.Bridge,~B,~N");e(c$,"dumpSummary",function(a,b){for(var c=a.monomers[0].getLeadAtom(),c=0==c.getChainID()?"":c.getChainIDStr()+
":",d=new JU.SB,f="\x00",e="\x00",h="\x00",p=-1,j=-1,n=a.monomerCount,l=a.monomers,m=0;m<=n;m++){if(m==n||b[m]!=f){"\x00"!=f&&d.appendC("\n").appendC(f).append(" : ").append(c).appendI(p).append("\x00"==e?"":String.valueOf(e)).append("_").append(c).appendI(j).append("\x00"==h?"":String.valueOf(h));if(m==n)break;f=b[m];p=l[m].getResno();e=l[m].getInsertionCode()}j=l[m].getResno();h=l[m].getInsertionCode()}return d.toString()},"JM.AminoPolymer,~A");e(c$,"dumpTags",function(a,b,c,d){var f=a.monomers[0].getLeadAtom().getChainID()+
"."+(a.bioPolymerIndexInModel+1);b=JU.PT.rep(b,"$",f);for(var e=a.monomers[0].getResno(),h="\n"+f,f=new JU.SB,p=(new JU.SB).append(h+".8: "),j=(new JU.SB).append(h+".7: "),n=(new JU.SB).append(h+".6: "),h=(new JU.SB).append(h+".0: "),l=a.monomerCount,m=0;m<l;m++)e=a.monomers[m].getResno(),p.append(0==e%100?""+A(e/100)%100:" "),j.append(0==e%10?""+A(e/10)%10:" "),n.appendI(e%10),h.appendC(c.get(a.monomers[m].leadAtomIndex)?"!":a.monomers[m].getGroup1());1==(d&1)&&f.appendSB(p).appendSB(j).appendSB(n);
f.append("\n");f.append(b);2==(d&2)&&(f.appendSB(h),f.append("\n\n"));return f.toString().$replace("\x00",".")},"JM.AminoPolymer,~S,JU.BS,~N");e(c$,"isHbonded",function(a,b,c,d,f){if(0>a||0>b)return null;c=f[c];f=f[d];return a>=c.length||b>=f.length?null:c[a][0][0]==d&&c[a][0][1]==b?c[a][0]:c[a][1][0]==d&&c[a][1][1]==b?c[a][1]:null},"~N,~N,~N,~N,~A");e(c$,"findHelixes",function(a,b){var c=this.bioPolymers[a];if(JU.Logger.debugging)for(var d=0;d<c.monomerCount;d++)JU.Logger.debug(a+"."+c.monomers[d].getResno()+
"\t"+JU.Escape.e(b[d]));var d=new JU.BS,f=this.findHelixes2(a,4,b,J.c.STR.HELIXALPHA,10240,d),e=this.findHelixes2(a,3,b,J.c.STR.HELIX310,8192,d),h=this.findHelixes2(a,5,b,J.c.STR.HELIXPI,12288,d);this.$setStructure&&this.setStructure(c,d,J.c.STR.TURN);return this.doReport?(this.setTag(this.labels[a],d,"T"),this.dumpTags(c,"$.5: "+h+"\n$.4: "+f+"\n$.3: "+e,this.bsBad,1)):""},"~N,~A");e(c$,"findHelixes2",function(a,b,c,d,f,e){for(var h=this.bioPolymers[a],p=new JU.BS,j=new JU.BS,n=new JU.BS,l=new JU.BS,
m=new JU.BS,q=this.done[a],s="",u=h.monomerCount,r=b;r<u;++r){var t=r-b,v=0;if(c[r][0][0]==a&&c[r][0][1]==t||c[r][v=1][0]==a&&c[r][1][1]==t){var w=h.monomers[t].leadAtomIndex,y=this.bsBad.nextSetBit(w),A=h.monomers[r];if(!(y>=w&&y<=A.leadAtomIndex)){p.set(t);j.setBits(t+1,r);l.set(r);var y=q.nextSetBit(t),w=0>y||y>=r,z=!1;if(0<t&&p.get(t-1)&&(4==b||w))m.setBits(t,r),w||(s+="  WARNING! Bridge to helix at "+h.monomers[y]),z=!0;else if(w||q.nextClearBit(y)<r)z=!0;l.get(t)&&n.set(t);z&&null!=this.vHBonds&&
this.addHbond(A,h.monomers[t],c[r][v][2],f,null)}}}this.doReport?(c=N(u,"\x00"),this.setTag(c,j,String.fromCharCode(48+b)),this.setTag(c,p,">"),this.setTag(c,l,"<"),this.setTag(c,n,"X")):c=null;q.or(m);j.andNot(q);e.or(j);e.andNot(m);this.$setStructure&&this.setStructure(h,m,d);return this.doReport?(this.setTag(this.labels[a],m,String.fromCharCode(68+b)),String.valueOf(c)+s):""},"~N,~N,~A,J.c.STR,~N,JU.BS");e(c$,"setTag",function(a,b,c){for(var d=b.nextSetBit(0);0<=d;d=b.nextSetBit(d+1))a[d]=c},"~A,JU.BS,~S");
e(c$,"setStructure",function(a,b,c){for(var d=b.nextSetBit(0);0<=d;d=b.nextSetBit(d+1)){var f=b.nextClearBit(d);0>f&&(f=a.monomerCount);a.addStructureProtected(c,null,0,0,d,f-1);d=f}},"JM.AminoPolymer,JU.BS,J.c.STR")});p("J.shapebio");s(["J.shape.AtomShape"],"J.shapebio.BioShape","java.lang.Float JU.AU $.BS J.c.PAL $.STR JM.AlphaPolymer $.NucleicPolymer JU.C $.Logger".split(" "),function(){c$=w(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;v(this,arguments)},J.shapebio,"BioShape",J.shape.AtomShape);h(c$,"setProperty",function(a,b,c){this.setPropAS(a,b,c)},"~S,~O,JU.BS");h(c$,"getMonomers",function(){return this.monomers});D(c$,function(a,b,c){K(this,J.shapebio.BioShape,[]);this.shape=a;this.modelIndex=b;this.bioPolymer=c;this.isActive=a.isActive;this.bsSizeDefault=new JU.BS;
this.monomerCount=c.monomerCount;0<this.monomerCount&&(this.colixes=S(this.monomerCount,0),this.paletteIDs=F(this.monomerCount,0),this.mads=S(this.monomerCount+1,0),this.monomers=c.monomers,this.meshReady=X(this.monomerCount,!1),this.meshes=Array(this.monomerCount),this.wingVectors=c.getWingVectors(),this.leadAtomIndices=c.getLeadAtomIndices())},"J.shapebio.BioShapeCollection,~N,JM.BioPolymer");e(c$,"calcBfactorRange",function(){this.bfactorMin=this.bfactorMax=this.monomers[0].getLeadAtom().getBfactor100();
for(var a=this.monomerCount;0<--a;){var b=this.monomers[a].getLeadAtom().getBfactor100();b<this.bfactorMin?this.bfactorMin=b:b>this.bfactorMax&&(this.bfactorMax=b)}this.floatRange=this.range=this.bfactorMax-this.bfactorMin;this.hasBfactorRange=!0});e(c$,"calcMeanPositionalDisplacement",function(a){return Y(1E3*Math.sqrt(a/7895.6835208714865))},"~N");h(c$,"findNearestAtomIndex",function(a,b,c,d){this.bioPolymer.findNearestAtomIndex(a,b,c,this.mads,this.shape.vf,d)},"~N,~N,~A,JU.BS");e(c$,"setMad",
function(a,b,c){if(!(2>this.monomerCount)){this.isActive=!0;null==this.bsSizeSet&&(this.bsSizeSet=new JU.BS);for(var d=this.shape.vf,f=32768==d&&u(this.bioPolymer,JM.NucleicPolymer),e=this.monomerCount;0<=--e;){var h=this.leadAtomIndices[e];if(b.get(h)){if(null!=c&&h<c.length){if(Float.isNaN(c[h]))continue;a=T(2E3*c[h])}var p=0<(this.mads[e]=this.getMad(e,a));this.bsSizeSet.setBitTo(e,p);this.monomers[e].setShapeVisibility(d,p);this.shape.atoms[h].setShapeVisibility(d,p);f&&this.monomers[e].setRingsVisible(p);
this.falsifyNearbyMesh(e)}}1<this.monomerCount&&(this.mads[this.monomerCount]=this.mads[this.monomerCount-1])}},"~N,JU.BS,~A");e(c$,"getMad",function(a,b){this.bsSizeDefault.setBitTo(a,-1==b||-2==b);if(0<=b)return b;switch(b){case -1:case -2:if(-1==b&&0<=this.shape.madOn)return this.shape.madOn;switch(this.monomers[a].getProteinStructureType()){case J.c.STR.SHEET:case J.c.STR.HELIX:return this.shape.madHelixSheet;case J.c.STR.DNA:case J.c.STR.RNA:return this.shape.madDnaRna;default:return this.shape.madTurnRandom}case -3:this.hasBfactorRange||
this.calcBfactorRange();var c=this.monomers[a].getLeadAtom(),c=c.getBfactor100()-this.bfactorMin;if(0==this.range)return 0;c/=this.floatRange;(0>c||1<c)&&JU.Logger.error("Que ha ocurrido? "+c);return T(1750*c+250);case -4:return c=this.monomers[a].getLeadAtom(),2*this.calcMeanPositionalDisplacement(c.getBfactor100())}JU.Logger.error("unrecognized setMad("+b+")");return 0},"~N,~N");e(c$,"falsifyMesh",function(){if(null!=this.meshReady)for(var a=0;a<this.monomerCount;a++)this.meshReady[a]=!1});e(c$,
"falsifyNearbyMesh",function(a){null!=this.meshReady&&(this.meshReady[a]=!1,0<a&&(this.meshReady[a-1]=!1),a<this.monomerCount-1&&(this.meshReady[a+1]=!1))},"~N");e(c$,"setColixBS",function(a,b,c){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=new JU.BS);for(var d=this.monomerCount;0<=--d;){var f=this.leadAtomIndices[d];c.get(f)&&(this.colixes[d]=this.shape.getColixI(a,b,f),null!=this.colixesBack&&this.colixesBack.length>d&&(this.colixesBack[d]=0),this.paletteIDs[d]=b,this.bsColixSet.setBitTo(d,
0!=this.colixes[d]))}},"~N,~N,JU.BS");e(c$,"setColixes",function(a,b){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=new JU.BS);for(var c=this.monomerCount;0<=--c;){var d=this.leadAtomIndices[c];b.get(d)&&(c<this.colixes.length&&d<a.length)&&(this.colixes[c]=this.shape.getColixI(a[d],J.c.PAL.UNKNOWN.id,d),null!=this.colixesBack&&c<this.colixesBack.length&&(this.colixesBack[c]=0),this.paletteIDs[c]=J.c.PAL.UNKNOWN.id,this.bsColixSet.set(c))}},"~A,JU.BS");e(c$,"setParams",function(a,b,c){if(0!=
this.monomerCount){var d=a[0];a=a[1];this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=new JU.BS);for(var f=b.length,e=this.monomerCount;0<=--e;){var h=this.leadAtomIndices[e];if(c.get(h)&&e<this.colixes.length&&h<f){var p=b[h],j=null==d?0:d[p],p=null==a?0:a[p];0.01<p&&(j=JU.C.getColixTranslucent3(j,!0,p));this.colixes[e]=this.shape.getColixI(j,J.c.PAL.UNKNOWN.id,h);null!=this.colixesBack&&e<this.colixesBack.length&&(this.colixesBack[e]=0);this.paletteIDs[e]=J.c.PAL.UNKNOWN.id;this.bsColixSet.set(e)}}}},
"~A,~A,JU.BS");e(c$,"setColixBack",function(a,b){for(var c=this.monomerCount;0<=--c;)b.get(this.leadAtomIndices[c])&&(null==this.colixesBack&&(this.colixesBack=S(this.colixes.length,0)),this.colixesBack.length<this.colixes.length&&(this.colixesBack=JU.AU.ensureLengthShort(this.colixesBack,this.colixes.length)),this.colixesBack[c]=a)},"~N,JU.BS");e(c$,"setTranslucent",function(a,b,c){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=new JU.BS);for(var d=this.monomerCount;0<=--d;)b.get(this.leadAtomIndices[d])&&
(this.colixes[d]=JU.C.getColixTranslucent3(this.colixes[d],a,c),null!=this.colixesBack&&this.colixesBack.length>d&&(this.colixesBack[d]=JU.C.getColixTranslucent3(this.colixesBack[d],a,c)),this.bsColixSet.setBitTo(d,0!=this.colixes[d]))},"~B,JU.BS,~N");h(c$,"setAtomClickability",function(){if(this.isActive&&!(null==this.wingVectors||0==this.monomerCount))for(var a=u(this.bioPolymer,JM.NucleicPolymer)&&11==this.shape.shapeID,b=u(this.bioPolymer,JM.AlphaPolymer)||15!=this.shape.shapeID,c=this.monomers[0].chain.model.ms,
d=this.monomerCount;0<=--d;)if(!(0>=this.mads[d])){var f=this.leadAtomIndices[d];c.isAtomHidden(f)||(b&&c.at[f].setClickable(1040384),a&&this.monomers[d].setRingsClickable())}});B(c$,"eightPiSquared100",7895.6835208714865)});p("J.shapebio");s(["J.shape.Shape"],"J.shapebio.BioShapeCollection",["JU.AU","J.c.PAL","J.shapebio.BioShape","JU.BSUtil","$.C"],function(){c$=w(function(){this.atoms=null;this.madOn=-2;this.madHelixSheet=3E3;this.madTurnRandom=800;this.madDnaRna=5E3;this.isActive=!1;this.bioShapes=
null;v(this,arguments)},J.shapebio,"BioShapeCollection",J.shape.Shape);h(c$,"initModelSet",function(){this.isBioShape=!0;this.atoms=this.ms.at;this.initialize()});h(c$,"getSizeG",function(a){var b=a.groupIndex;a=a.getLeadAtom().i;for(var c=this.bioShapes.length;0<=--c;)for(var d=this.bioShapes[c],f=0;f<d.monomerCount;f++)if(d.monomers[f].groupIndex==b&&d.monomers[f].getLeadAtom().i==a)return d.mads[f];return 0},"JM.Group");h(c$,"replaceGroup",function(a,b){for(var c=this.bioShapes.length;0<=--c;)for(var d=
this.bioShapes[c],f=0;f<d.monomerCount;f++)if(d.monomers[f]===a){d.monomers[f]=b;break}},"JM.Group,JM.Group");h(c$,"setShapeSizeRD",function(a,b,c){this.initialize();for(var d=this.bioShapes.length;0<=--d;){var f=this.bioShapes[d];0<f.monomerCount&&f.setMad(a,c,null==b?null:b.values)}},"~N,J.atomdata.RadiusData,JU.BS");h(c$,"setProperty",function(a,b,c){this.setPropBSC(a,b,c)},"~S,~O,JU.BS");e(c$,"setPropBSC",function(a,b,c){if("refreshTrajectories"===a){c=b[0].intValue();for(a=this.bioShapes.length;0<=
--a;)b=this.bioShapes[a],b.modelIndex==c&&b.falsifyMesh()}else if("deleteModelAtoms"===a){this.atoms=b[1];c=b[2][0];for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],b.modelIndex>c?(b.modelIndex--,b.leadAtomIndices=b.bioPolymer.getLeadAtomIndices()):b.modelIndex==c&&(this.bioShapes=JU.AU.deleteElements(this.bioShapes,a,1))}else if(this.initialize(),"color"===a){var d=J.c.PAL.pidOf(b),f=JU.C.getColixO(b);for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],0<b.monomerCount&&b.setColixBS(f,
d,c)}else if("params"===a){a=c.length();d=y(a,0);f=0;for(a=c.nextSetBit(0);0<=a;a=c.nextSetBit(a+1),f++)d[a]=f;for(a=this.bioShapes.length;0<=--a;)this.bioShapes[a].setParams(b,d,c)}else if("colorPhase"===a){d=JU.C.getColixO(b[0]);f=JU.C.getColixO(b[1]);for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],0<b.monomerCount&&(b.setColixBS(f,0,c),b.setColixBack(d,c))}else if("translucency"===a){d="translucent".equals(b);for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],0<b.monomerCount&&b.setTranslucent(d,
c,this.translucentLevel)}else this.setPropS(a,b,c)},"~S,~O,JU.BS");h(c$,"getShapeState",function(){return this.vwr.getAtomShapeSetState(this,this.bioShapes)});e(c$,"initialize",function(){for(var a=this.ms.mc,b=this.ms.am,c=this.ms.getBioPolymerCountInModel(-1),d=Array(c--);0<=--a;)for(var f=this.ms.getBioPolymerCountInModel(a);0<=--f;c--){var e=b[a].bioPolymers[f];d[c]=null==this.bioShapes||this.bioShapes.length<=c||null==this.bioShapes[c]||this.bioShapes[c].bioPolymer!==e?new J.shapebio.BioShape(this,
a,e):this.bioShapes[c]}this.bioShapes=d});h(c$,"findNearestAtomIndex",function(a,b,c,d){for(var f=this.bioShapes.length;0<=--f;)this.bioShapes[f].findNearestAtomIndex(a,b,c,d)},"~N,~N,~A,JU.BS");h(c$,"setModelVisibilityFlags",function(a){if(null!=this.bioShapes){a=JU.BSUtil.copy(a);null!=this.ms.trajectory&&this.ms.trajectory.setBaseModels(a);for(var b=this.bioShapes.length;0<=--b;){var c=this.bioShapes[b];c.modelVisibilityFlags=a.get(c.modelIndex)?this.vf:0}}},"JU.BS");h(c$,"setAtomClickability",
function(){if(null!=this.bioShapes)for(var a=this.bioShapes.length;0<=--a;)this.bioShapes[a].setAtomClickability()});e(c$,"getMpsShapeCount",function(){return this.bioShapes.length});e(c$,"getBioShape",function(a){return this.bioShapes[a]},"~N")});p("J.shapebio");s(["J.shapebio.BioShapeCollection"],"J.shapebio.Rockets",null,function(){c$=C(J.shapebio,"Rockets",J.shapebio.BioShapeCollection);e(c$,"initShape",function(){P(this,J.shapebio.Rockets,"initShape",[]);this.madTurnRandom=500})});p("J.shapebio");
s(["J.shapebio.Rockets"],"J.shapebio.Cartoon",null,function(){c$=C(J.shapebio,"Cartoon",J.shapebio.Rockets);e(c$,"initShape",function(){P(this,J.shapebio.Cartoon,"initShape",[]);this.madDnaRna=1E3})});p("J.shapebio");s(["J.shapebio.BioShapeCollection"],"J.shapebio.Backbone",["java.lang.Float","JU.BS"],function(){c$=w(function(){this.bsSelected=null;v(this,arguments)},J.shapebio,"Backbone",J.shapebio.BioShapeCollection);e(c$,"initShape",function(){P(this,J.shapebio.Backbone,"initShape",[]);this.madOn=
1;this.madHelixSheet=1500;this.madTurnRandom=500;this.madDnaRna=2E3;this.isActive=!0});h(c$,"setProperty",function(a,b,c){"bitset"===a?this.bsSelected=b:this.setPropBSC(a,b,c)},"~S,~O,JU.BS");h(c$,"setShapeSizeRD",function(a,b,c){this.initialize();var d=null!=this.bsSelected;d&&(c=this.bsSelected);for(var f=this.bioShapes.length;0<=--f;){var e=this.bioShapes[f];if(0!=e.monomerCount){var h=this.vwr.getBoolean(603979812),p=e.bioPolymer.getLeadAtomIndices(),j=0!=a;null==e.bsSizeSet&&(e.bsSizeSet=new JU.BS);
e.isActive=!0;for(var n=e.monomerCount-1;0<=--n;){var l=p[n],m=p[n+1],q=c.get(l),s=c.get(m);if(q&&s||d&&q||h&&(q||s)){e.monomers[n].setShapeVisibility(this.vf,j);q=this.ms.at[l];if(null!=b){if(Float.isNaN(b.values[l])||Float.isNaN(b.values[m]))continue;a=T(1E3*(b.values[l]+b.values[m]));j=0!=a}l=this.ms.at[m];0!=e.mads[n]!=j&&(this.addDisplayedBackbone(q,j),this.addDisplayedBackbone(l,j));e.mads[n]=a;e.bsSizeSet.setBitTo(n,j);e.bsSizeDefault.setBitTo(n,-1==a)}}}}d&&(this.bsSelected=null)},"~N,J.atomdata.RadiusData,JU.BS");
e(c$,"addDisplayedBackbone",function(a,b){a.nBackbonesDisplayed+=b?1:-1;this.setShapeVisibility(a,b)},"JM.Atom,~B");h(c$,"setAtomClickability",function(){if(null!=this.bioShapes)for(var a=this.bioShapes.length;0<=--a;)for(var b=this.bioShapes[a],c=b.bioPolymer.getLeadAtomIndices(),b=b.monomerCount;0<=--b;){var d=this.ms.at[c[b]];0<d.nBackbonesDisplayed&&!this.ms.isAtomHidden(b)&&d.setClickable(this.vf)}})});p("J.shapebio");s(["J.shapebio.BioShapeCollection"],"J.shapebio.Strands",null,function(){c$=
w(function(){this.isMesh=!1;v(this,arguments)},J.shapebio,"Strands",J.shapebio.BioShapeCollection)});p("J.shapebio");s(["J.shapebio.BioShapeCollection"],"J.shapebio.Ribbons",null,function(){c$=C(J.shapebio,"Ribbons",J.shapebio.BioShapeCollection)});p("J.shapebio");s(["J.shapebio.Strands"],"J.shapebio.MeshRibbon",null,function(){c$=C(J.shapebio,"MeshRibbon",J.shapebio.Strands);e(c$,"initShape",function(){P(this,J.shapebio.MeshRibbon,"initShape",[]);this.isMesh=!0})});p("J.shapebio");s(["J.shapebio.BioShapeCollection"],
"J.shapebio.Trace",["J.atomdata.RadiusData","J.c.VDW"],function(){c$=C(J.shapebio,"Trace",J.shapebio.BioShapeCollection);e(c$,"initShape",function(){P(this,J.shapebio.Trace,"initShape",[]);this.madOn=600;this.madHelixSheet=1500;this.madTurnRandom=500;this.madDnaRna=1500});h(c$,"setProperty",function(a,b,c){"putty"===a?this.setPutty(b,c):this.setPropBSC(a,b,c)},"~S,~O,JU.BS");e(c$,"setPutty",function(a,b){var c=b.cardinality();if(0!=c){for(var d=I(b.length(),0),f=0,e=0,h=3.4028235E38,p=0,j=b.nextSetBit(0);0<=
j;j=b.nextSetBit(j+1)){var n=this.atoms[j].atomPropertyFloat(null,1111492620,null),f=f+n,e=e+n*n;n<h&&(h=n);n>p&&(p=n)}var n=f/c,c=Math.sqrt((e-f*f/c)/c),f=a[1],e=a[2],l=a[3],m=a[4],q=a[5],s=E(a[6]),p=p-h,u=!1;switch(s){case 0:case 1:case 2:case 3:u=!0}for(j=b.nextSetBit(0);0<=j;j=b.nextSetBit(j+1)){var r=this.atoms[j].atomPropertyFloat(null,1111492620,null);switch(s){case 0:case 4:r=1+(r-n)/e/c;break;case 1:case 5:r=(r-h)/p/e;break;case 2:case 6:r/=e;break;case 8:0>r&&(r=0),r=Math.sqrt(r/8)/3.141592653589793}0>
r&&(r=0);u&&(r=Math.pow(r,q));r<l&&0<=l&&(r=l);r>m&&0<=m&&(r=m);d[j]=r*f}d=new J.atomdata.RadiusData(d,0,J.atomdata.RadiusData.EnumType.ABSOLUTE,J.c.VDW.AUTO);this.setShapeSizeRD(0,d,b)}},"~A,JU.BS");B(c$,"PUTTY_NormalizedNonlinear",0,"PUTTY_RelativeNonlinear",1,"PUTTY_ScaledNonlinear",2,"PUTTY_AbsoluteNonlinear",3,"PUTTY_NormalizedLinear",4,"PUTTY_RelativeLinear",5,"PUTTY_ScaledLinear",6,"PUTTY_AbsoluteLinear",7,"PUTTY_ImpliedRMS",8)});p("J.renderbio");s("J.render.MeshRenderer JU.A4 $.BS $.M3 $.P3 $.V3".split(" "),
"J.renderbio.BioShapeRenderer","J.c.STR JM.CarbohydratePolymer $.NucleicPolymer J.shape.Mesh JU.C $.GData $.Logger $.Normix".split(" "),function(){c$=w(function(){this.haveControlPointScreens=this.ribbonBorder=this.isTraceAlpha=this.isHighRes=this.invalidateSheets=this.invalidateMesh=!1;this.sheetSmoothing=this.hermiteLevel=this.aspectRatio=0;this.cartoonsFancy=!1;this.bsRenderMesh=this.meshReady=this.meshes=null;this.monomerCount=0;this.monomers=null;this.isCarbohydrate=this.isNucleic=!1;this.structureTypes=
this.colixesBack=this.colixes=this.mads=this.wingVectors=this.leadAtomIndices=this.controlPointScreens=this.controlPoints=this.ribbonBottomScreens=this.ribbonTopScreens=this.bsVisible=null;this.wireframeOnly=!1;this.pointT=null;this.diameterEnd=this.diameterMid=this.diameterBeg=this.iNext3=this.iNext2=this.iNext=this.iPrev=0;this.doCap1=this.doCap0=!1;this.colixBack=0;this.norml=this.bsTemp=this.mat=this.ptNext=this.ptPrev=this.pt1=this.pt=this.aa=this.wingT=this.wing1=this.wing=this.norm=this.radiusHermites=
this.wingHermites=this.controlHermites=this.screenArrowBotPrev=this.screenArrowBot=this.screenArrowTopPrev=this.screenArrowTop=this.reversed=null;v(this,arguments)},J.renderbio,"BioShapeRenderer",J.render.MeshRenderer);O(c$,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;this.norm=new JU.V3;this.wing=new JU.V3;this.wing1=new JU.V3;this.wingT=new JU.V3;this.aa=new JU.A4;
this.pt=new JU.P3;this.pt1=new JU.P3;this.ptPrev=new JU.P3;this.ptNext=new JU.P3;this.mat=new JU.M3;this.norml=new JU.V3});h(c$,"render",function(){if(null==this.shape)return!1;this.setGlobals();this.renderShapes();return this.needTranslucent});e(c$,"setGlobals",function(){this.needTranslucent=this.invalidateMesh=!1;this.isPrecision=!0;this.g3d.addRenderer(553648147);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(603979817)||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;a=this.vwr.getBoolean(603979966);a!=this.isTraceAlpha&&(this.invalidateMesh=!0);this.isTraceAlpha=a;this.invalidateSheets=!1;a=this.vwr.getFloat(570425392);a!=this.sheetSmoothing&&this.isTraceAlpha&&(this.sheetSmoothing=a,this.invalidateSheets=this.invalidateMesh=!0)});e(c$,"renderShapes",function(){for(var a=this.shape,
b=a.bioShapes.length;0<=--b;){var c=a.getBioShape(b);0!=(c.modelVisibilityFlags&this.myVisibilityFlag)&&(2<=c.monomerCount&&this.initializePolymer(c))&&(this.bsRenderMesh.clearAll(),this.renderBioShape(c),this.renderMeshes(),this.freeTempArrays())}});e(c$,"setBioColix",function(a){if(this.g3d.setC(a))return!0;this.needTranslucent=!0;return!1},"~N");e(c$,"freeTempArrays",function(){this.haveControlPointScreens&&this.vwr.freeTempPoints(this.controlPointScreens);this.vwr.freeTempEnum(this.structureTypes)});
e(c$,"initializePolymer",function(a){var b=this.vwr.slm.bsDeleted;this.controlPoints=this.vwr.ms.isJmolDataFrameForModel(a.modelIndex)?a.bioPolymer.getControlPoints(!0,0,!1):a.bioPolymer.getControlPoints(this.isTraceAlpha,this.sheetSmoothing,this.invalidateSheets);this.monomerCount=a.monomerCount;this.bsRenderMesh=JU.BS.newN(this.monomerCount);this.monomers=a.monomers;this.reversed=a.bioPolymer.reversed;this.leadAtomIndices=a.bioPolymer.getLeadAtomIndices();this.bsVisible.clearAll();var c=!1;this.invalidateMesh&&
a.falsifyMesh();for(var d=this.monomerCount;0<=--d;)if(!(0==(this.monomers[d].shapeVisibilityFlags&this.myVisibilityFlag)||this.ms.isAtomHidden(this.leadAtomIndices[d])||null!=b&&b.get(this.leadAtomIndices[d]))){var f=this.ms.at[this.leadAtomIndices[d]];this.g3d.isInDisplayRange(f.sX,f.sY)&&(this.bsVisible.set(d),c=!0)}if(!c)return!1;this.ribbonBorder=this.vwr.getBoolean(603979899);this.isNucleic=u(a.bioPolymer,JM.NucleicPolymer);this.isCarbohydrate=u(a.bioPolymer,JM.CarbohydratePolymer);this.haveControlPointScreens=
!1;this.wingVectors=a.wingVectors;this.meshReady=a.meshReady;this.meshes=a.meshes;this.mads=a.mads;this.colixes=a.colixes;this.colixesBack=a.colixesBack;this.setStructureTypes();return!0},"J.shapebio.BioShape");e(c$,"setStructureTypes",function(){for(var a=this.structureTypes=this.vwr.allocTempEnum(this.monomerCount+1),b=this.monomerCount;0<=--b;)if((a[b]=this.monomers[b].getProteinStructureType())===J.c.STR.TURN)a[b]=J.c.STR.NONE;a[this.monomerCount]=a[this.monomerCount-1]});e(c$,"calcScreenControlPoints",
function(){for(var a=this.monomerCount+1,b=this.controlPointScreens=this.vwr.allocTempPoints(a),c=this.controlPoints;0<=--a;)this.tm.transformPtScrT3(c[a],b[a]);this.haveControlPointScreens=!0});e(c$,"calcScreens",function(a,b){var c=this.controlPoints.length,d=this.vwr.allocTempPoints(c);if(0==a)for(;0<=--c;)this.tm.transformPtScrT3(this.controlPoints[c],d[c]);else for(var f=a/1E3;0<=--c;)this.calc1Screen(this.controlPoints[c],this.wingVectors[c],0==b[c]&&0<c?b[c-1]:b[c],f,d[c]);return d},"~N,~A");
e(c$,"calc1Screen",function(a,b,c,d,f){this.pointT.scaleAdd2(c*d,b,a);this.tm.transformPtScrT3(this.pointT,f)},"JU.P3,JU.V3,~N,~N,JU.P3");e(c$,"getLeadColix",function(a){return JU.C.getColixInherited(this.colixes[a],this.monomers[a].getLeadAtom().colixAtom)},"~N");e(c$,"getLeadColixBack",function(a){return null==this.colixesBack||this.colixesBack.length<=a?0:this.colixesBack[a]},"~N");e(c$,"setNeighbors",function(a){this.iPrev=Math.max(a-1,0);this.iNext=Math.min(a+1,this.monomerCount);this.iNext2=
Math.min(a+2,this.monomerCount);this.iNext3=Math.min(a+3,this.monomerCount)},"~N");e(c$,"setMads",function(a,b){this.madMid=this.madBeg=this.madEnd=this.mads[a];if(this.isTraceAlpha){if(!b||this.structureTypes[a]===this.structureTypes[this.iNext])this.madEnd=this.mads[this.iNext],0==this.madEnd&&(u(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=E(this.vwr.tm.scaleToScreen(E(this.controlPointScreens[a].z),this.madBeg));this.diameterMid=E(this.vwr.tm.scaleToScreen(this.monomers[a].getLeadAtom().sZ,this.madMid));this.diameterEnd=E(this.vwr.tm.scaleToScreen(E(this.controlPointScreens[this.iNext].z),this.madEnd));this.doCap0=a==
this.iPrev||b&&this.structureTypes[a]!==this.structureTypes[this.iPrev];this.doCap1=this.iNext==this.iNext2||b&&this.structureTypes[a]!==this.structureTypes[this.iNext];return 0<this.aspectRatio&&(1==this.exportType||this.checkDiameter(this.diameterBeg)||this.checkDiameter(this.diameterMid)||this.checkDiameter(this.diameterEnd))},"~N,~B");e(c$,"checkDiameter",function(a){return(new Boolean((new Boolean(this.isHighRes&3<a)).valueOf()||8<=a)).valueOf()},"~N");e(c$,"renderHermiteCylinder",function(a,
b){this.colix=this.getLeadColix(b);this.setBioColix(this.colix)&&(this.setNeighbors(b),this.g3d.drawHermite4(this.isNucleic?4:7,a[this.iPrev],a[b],a[this.iNext],a[this.iNext2]))},"~A,~N");e(c$,"renderHermiteConic",function(a,b,c){this.setNeighbors(a);this.colix=this.getLeadColix(a);if(this.setBioColix(this.colix)){if(this.setMads(a,b)||this.isExport)try{if((null==this.meshes[a]||!this.meshReady[a])&&!this.createMesh(a,this.madBeg,this.madMid,this.madEnd,1,c))return;this.meshes[a].setColix(this.colix);
this.bsRenderMesh.set(a);return}catch(d){if(H(d,Exception))this.bsRenderMesh.clear(a),this.meshes[a]=null,JU.Logger.error("render mesh error hermiteConic: "+d.toString());else throw d;}0==this.diameterBeg&&0==this.diameterEnd||this.wireframeOnly?this.g3d.drawLineAB(this.controlPointScreens[a],this.controlPointScreens[this.iNext]):this.g3d.fillHermite(this.isNucleic?4:7,this.diameterBeg,this.diameterMid,this.diameterEnd,this.controlPointScreens[this.iPrev],this.controlPointScreens[a],this.controlPointScreens[this.iNext],
this.controlPointScreens[this.iNext2])}},"~N,~B,~N");e(c$,"renderHermiteRibbon",function(a,b,c){this.setNeighbors(b);this.colix=this.getLeadColix(b);if(this.setBioColix(this.colix)){this.colixBack=this.getLeadColixBack(b);if(a&&(0!=this.aspectRatio||this.isExport))if(this.setMads(b,c)||this.isExport)try{if((null==this.meshes[b]||!this.meshReady[b])&&!this.createMesh(b,this.madBeg,this.madMid,this.madEnd,this.aspectRatio,this.isNucleic?4:7))return;this.meshes[b].setColix(this.colix);this.meshes[b].setColixBack(this.colixBack);
this.bsRenderMesh.set(b);return}catch(d){if(H(d,Exception))this.bsRenderMesh.clear(b),this.meshes[b]=null,JU.Logger.error("render mesh error hermiteRibbon: "+d.toString());else throw d;}this.g3d.drawHermite7(a,this.ribbonBorder,(this.reversed.get(b)?-1:1)*(this.isNucleic?4:7),this.ribbonTopScreens[this.iPrev],this.ribbonTopScreens[b],this.ribbonTopScreens[this.iNext],this.ribbonTopScreens[this.iNext2],this.ribbonBottomScreens[this.iPrev],this.ribbonBottomScreens[b],this.ribbonBottomScreens[this.iNext],
this.ribbonBottomScreens[this.iNext2],E(this.aspectRatio),this.colixBack)}},"~B,~N,~B");e(c$,"renderHermiteArrowHead",function(a){this.colix=this.getLeadColix(a);if(this.setBioColix(this.colix)){this.colixBack=this.getLeadColixBack(a);this.setNeighbors(a);if(this.setMads(a,!1)||this.isExport)try{this.doCap0=!0;this.doCap1=!1;if((null==this.meshes[a]||!this.meshReady[a])&&!this.createMesh(a,A(Math.floor(1.2*this.madBeg)),A(Math.floor(0.6*this.madBeg)),0,1==this.aspectRatio?this.aspectRatio:this.aspectRatio/
2,7))return;this.meshes[a].setColix(this.colix);this.bsRenderMesh.set(a);return}catch(b){if(H(b,Exception))this.bsRenderMesh.clear(a),this.meshes[a]=null,JU.Logger.error("render mesh error hermiteArrowHead: "+b.toString());else throw b;}var c=this.controlPoints[a];a=this.wingVectors[a];this.calc1Screen(c,a,this.madBeg,7E-4,this.screenArrowTop);this.calc1Screen(c,a,this.madBeg,-7E-4,this.screenArrowBot);this.calc1Screen(c,a,this.madBeg,0.001,this.screenArrowTopPrev);this.calc1Screen(c,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],E(this.aspectRatio),this.colixBack);this.g3d.setC(this.colix);this.ribbonBorder&&0==this.aspectRatio&&this.g3d.fillCylinderBits(3,3,this.screenArrowTop,this.screenArrowBot)}},
"~N");e(c$,"createMesh",function(a,b,c,d,f,e){this.setNeighbors(a);if(0==this.controlPoints[a].distanceSquared(this.controlPoints[this.iNext]))return!1;var h=1!=f&&null!=this.wingVectors,p=0==f,j=this.cartoonsFancy||6<=this.hermiteLevel,n=2*(this.hermiteLevel+1)+1,l=p?4:4*(this.hermiteLevel+1)-2,m=p?3.141592653589793/(l-1):6.283185307179586/l,q=this.meshes[a]=(new J.shape.Mesh).mesh1(this.vwr,"mesh_"+this.shapeID+"_"+a,0,a),s=b!=c||c!=d;if(null==this.controlHermites||this.controlHermites.length<n+
1)this.controlHermites=Array(n+1);JU.GData.getHermiteList(e,this.controlPoints[this.iPrev],this.controlPoints[a],this.controlPoints[this.iNext],this.controlPoints[this.iNext2],this.controlPoints[this.iNext3],this.controlHermites,0,n,!0);if(null==this.wingHermites||this.wingHermites.length<n+1)this.wingHermites=Array(n+1);this.wing.setT(this.wingVectors[this.iPrev]);0==d&&this.wing.scale(2);JU.GData.getHermiteList(e,this.wing,this.wingVectors[a],this.wingVectors[this.iNext],this.wingVectors[this.iNext2],
this.wingVectors[this.iNext3],this.wingHermites,0,n,!1);b/=2E3;c/=2E3;d/=2E3;if(s){if(null==this.radiusHermites||this.radiusHermites.length<(n+1>>1)+1)this.radiusHermites=Array((n+1>>1)+1);this.ptPrev.set(b,b,0);this.pt.set(b,c,0);this.pt1.set(c,d,0);this.ptNext.set(d,d,0);JU.GData.getHermiteList(4,this.ptPrev,this.pt,this.pt1,this.ptNext,this.ptNext,this.radiusHermites,0,n+1>>1,!0)}d=0;c=n>>1;e=A((l+2)/4);for(var u=A((3*l+2)/4),h=!h?0:p?1:j?2:3,j=0==h||3==h,r=0;r<n;r++){this.norm.sub2(this.controlHermites[r+
1],this.controlHermites[r]);var t=!s?b:r<c?this.radiusHermites[r].x:this.radiusHermites[r-c].y;this.wing.setT(this.wingHermites[r]);this.wing1.setT(this.wing);switch(h){case 2:this.wing1.cross(this.norm,this.wing);this.wing1.normalize();this.wing1.scale(this.wing.length()/f);break;case 3:this.wing.scale(2/f);this.wing1.sub(this.wing);break;case 0:this.wing.cross(this.wing,this.norm),this.wing.normalize()}this.wing.scale(t);this.wing1.scale(t);j&&(this.aa.setVA(this.norm,m),this.mat.setAA(this.aa));
this.pt1.setT(this.controlHermites[r]);for(var v=p?0:m,t=0;t<l;t++,v+=m){j&&0<t&&this.mat.rotate(this.wing);switch(h){case 1:this.wingT.setT(this.wing1);this.wingT.scale(Math.cos(v));break;case 2:this.wingT.setT(this.wing1);this.wingT.scale(Math.sin(v));this.wingT.scaleAdd2(Math.cos(v),this.wing,this.wingT);break;case 3:this.wingT.setT(this.wing);(t==e||t==u)&&this.wing1.scale(-1);this.wingT.add(this.wing1);break;case 0:this.wingT.setT(this.wing)}this.pt.add2(this.pt1,this.wingT);q.addV(this.pt,!0)}if(0<
r){v=p?l-1:l;for(t=0;t<v;t++){var w=d-l+t,y=d-l+(t+1)%l,B=d+(t+1)%l,z=d+t;t<A(v/2)?q.addQuad(w,y,B,z):q.addQuad(y,B,z,w)}}d+=l}if(!p){f=d;if(this.doCap0){for(p=0;p<l;p++)q.addV(q.vs[p],!0);d+=l;for(t=2*this.hermiteLevel;0<=--t;)q.addQuad(d-l+t+2,d-l+t+1,d-l+(l-t)%l,d-t-1)}if(this.doCap1){for(p=0;p<l;p++)q.addV(q.vs[f-l+p],!0);d+=l;for(t=2*this.hermiteLevel;0<=--t;)q.addQuad(d-t-1,d-l+(l-t)%l,d-l+t+1,d-l+t+2)}}this.meshReady[a]=!0;this.adjustCartoonSeamNormals(a,l);q.setVisibilityFlags(1);return!0},
"~N,~N,~N,~N,~N,~N");e(c$,"adjustCartoonSeamNormals",function(a,b){null==this.bsTemp&&(this.bsTemp=JU.Normix.newVertexBitSet());if(a==this.iNext-1&&this.iNext<this.monomerCount&&this.monomers[a].getStrucNo()==this.monomers[this.iNext].getStrucNo()&&this.meshReady[a]&&this.meshReady[this.iNext])try{var c=this.meshes[this.iNext].getNormalsTemp(),d=this.meshes[a].getNormalsTemp(),f=d.length;this.doCap0&&(f-=b);for(var e=1;e<=b;++e)this.norml.add2(d[f-e],c[b-e]),this.norml.normalize(),this.meshes[a].normalsTemp[f-
e].setT(this.norml),this.meshes[this.iNext].normalsTemp[b-e].setT(this.norml)}catch(h){if(!H(h,Exception))throw h;}},"~N,~N");e(c$,"renderMeshes",function(){for(var a=this.bsRenderMesh.nextSetBit(0);0<=a;a=this.bsRenderMesh.nextSetBit(a+1))null!=this.meshes[a].normalsTemp?(this.meshes[a].setNormixes(this.meshes[a].normalsTemp),this.meshes[a].normalsTemp=null):null==this.meshes[a].normixes&&this.meshes[a].initialize(1073741958,null,null),this.renderMesh2(this.meshes[a])});B(c$,"ABSOLUTE_MIN_MESH_SIZE",
3,"MIN_MESH_RENDER_SIZE",8,"MODE_TUBE",0,"MODE_FLAT",1,"MODE_ELLIPTICAL",2,"MODE_NONELLIPTICAL",3)});p("J.renderbio");s(["J.renderbio.BioShapeRenderer"],"J.renderbio.StrandsRenderer",["J.shapebio.Strands"],function(){c$=w(function(){this.strandCount=1;this.baseStrandOffset=this.strandSeparation=0;v(this,arguments)},J.renderbio,"StrandsRenderer",J.renderbio.BioShapeRenderer);h(c$,"renderBioShape",function(){this.renderStrandShape()},"J.shapebio.BioShape");e(c$,"renderStrandShape",function(){this.setStrandCount()&&
this.renderStrands()});e(c$,"setStrandCount",function(){if(null==this.wingVectors)return!1;this.strandCount=u(this.shape,J.shapebio.Strands)?this.vwr.getStrandCount(this.shape.shapeID):10;this.strandSeparation=1>=this.strandCount?0:1/(this.strandCount-1);this.baseStrandOffset=0==(this.strandCount&1)?this.strandSeparation/2:this.strandSeparation;return!0});e(c$,"renderStrands",function(){for(var a,b=this.strandCount>>1;0<=--b;){var c=b*this.strandSeparation+this.baseStrandOffset;a=this.calcScreens(c,
this.mads);this.renderStrand(a);this.vwr.freeTempPoints(a);a=this.calcScreens(-c,this.mads);this.renderStrand(a);this.vwr.freeTempPoints(a)}1==this.strandCount%2&&(a=this.calcScreens(0,this.mads),this.renderStrand(a),this.vwr.freeTempPoints(a))});e(c$,"renderStrand",function(a){for(var b=this.bsVisible.nextSetBit(0);0<=b;b=this.bsVisible.nextSetBit(b+1))this.renderHermiteCylinder(a,b)},"~A")});p("J.renderbio");s(["J.renderbio.MeshRibbonRenderer"],"J.renderbio.RibbonsRenderer",null,function(){c$=C(J.renderbio,
"RibbonsRenderer",J.renderbio.MeshRibbonRenderer);h(c$,"renderBioShape",function(){null!=this.wingVectors&&(this.wireframeOnly?this.renderStrands():this.render2Strand(!0,this.isNucleic?1:0.5,this.isNucleic?0:0.5))},"J.shapebio.BioShape")});p("J.renderbio");s(["J.renderbio.StrandsRenderer"],"J.renderbio.MeshRibbonRenderer",null,function(){c$=C(J.renderbio,"MeshRibbonRenderer",J.renderbio.StrandsRenderer);h(c$,"renderBioShape",function(){this.wireframeOnly?this.renderStrands():this.renderMeshRibbon()},
"J.shapebio.BioShape");e(c$,"renderMeshRibbon",function(){if(this.setStrandCount()){var a=(this.strandCount>>1)*this.strandSeparation+this.baseStrandOffset;this.render2Strand(!1,a,a);this.renderStrands()}});e(c$,"render2Strand",function(a,b,c){this.calcScreenControlPoints();this.ribbonTopScreens=this.calcScreens(b,this.mads);this.ribbonBottomScreens=this.calcScreens(-c,this.mads);for(b=this.bsVisible.nextSetBit(0);0<=b;b=this.bsVisible.nextSetBit(b+1))this.renderHermiteRibbon(a,b,!1);this.vwr.freeTempPoints(this.ribbonTopScreens);
this.vwr.freeTempPoints(this.ribbonBottomScreens)},"~B,~N,~N")});p("J.renderbio");s(["J.renderbio.StrandsRenderer"],"J.renderbio.RocketsRenderer",["javajs.api.Interface","JU.P3","J.c.STR"],function(){c$=w(function(){this.isRockets=!1;this.helixRockets=!0;this.renderArrowHeads=!1;this.rr=this.cordMidPoints=null;v(this,arguments)},J.renderbio,"RocketsRenderer",J.renderbio.StrandsRenderer);h(c$,"renderBioShape",function(a){this.setupRR(a,!0)&&(this.calcRopeMidPoints(),this.renderRockets(),this.vwr.freeTempPoints(this.cordMidPoints))},
"J.shapebio.BioShape");e(c$,"renderRockets",function(){null==this.rr&&(this.rr=javajs.api.Interface.getInterface("J.renderbio.RocketRenderer").set(this));this.rr.renderRockets()});e(c$,"setupRR",function(a,b){this.isRockets=b;if(this.wireframeOnly)this.renderStrands();else if(null!=this.wingVectors&&!this.isCarbohydrate&&(!b||!this.isNucleic)){var c=!this.vwr.getBoolean(603979900);!this.isNucleic&&this.renderArrowHeads!=c&&(a.falsifyMesh(),this.renderArrowHeads=c);return!0}return!1},"J.shapebio.BioShape,~B");
e(c$,"calcRopeMidPoints",function(){this.cordMidPoints=this.vwr.allocTempPoints(this.monomerCount+1);for(var a=null,b,c=-10,d=new JU.P3,f=new JU.P3,e=0;e<=this.monomerCount;++e)if(b=this.cordMidPoints[e],e<this.monomerCount&&(this.helixRockets&&this.structureTypes[e]===J.c.STR.HELIX||this.isRockets&&this.structureTypes[e]===J.c.STR.SHEET)){var h=this.monomers[e].getStructure();h===a?(d.add(f),c=e):(a=h,d.setT(h.getAxisStartPoint()),f.sub2(h.getAxisEndPoint(),d),f.scale(1/(h.nRes-1)),c==e-3&&this.cordMidPoints[e-
1].ave(this.cordMidPoints[e-2],d));b.setT(d)}else c==e-1&&1<e&&this.cordMidPoints[e-1].setT(this.cordMidPoints[2<e?e-3:e-2]),b.setT(null==a?this.controlPoints[e]:a.getAxisEndPoint()),a=null;this.controlPoints=this.cordMidPoints;this.calcScreenControlPoints()})});p("J.renderbio");s(["J.renderbio.RocketsRenderer"],"J.renderbio.CartoonRenderer",["J.api.Interface","J.c.STR"],function(){c$=w(function(){this.nucleicRenderer=null;v(this,arguments)},J.renderbio,"CartoonRenderer",J.renderbio.RocketsRenderer);
h(c$,"renderBioShape",function(a){if(this.setupRR(a,!1))if(this.isNucleic)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(603979820);this.helixRockets!=b&&(a.falsifyMesh(),this.helixRockets=b);this.ribbonTopScreens=this.calcScreens(0.5,this.mads);this.ribbonBottomScreens=this.calcScreens(-0.5,this.mads);this.calcRopeMidPoints();
this.renderProtein();this.vwr.freeTempPoints(this.cordMidPoints);this.vwr.freeTempPoints(this.ribbonTopScreens);this.vwr.freeTempPoints(this.ribbonBottomScreens)}},"J.shapebio.BioShape");e(c$,"renderProtein",function(){for(var a=!1,b=!1,c=null,d,e=this.helixRockets||!this.renderArrowHeads,g=!1,h=this.monomerCount;0<=--h;){d=this.monomers[h].getStructure();d!==c&&(a=!1);c=d;d=this.structureTypes[h]===J.c.STR.HELIX;var p=this.structureTypes[h]===J.c.STR.SHEET;this.bsVisible.get(h)&&(d&&e?g=!0:p||d?
a&&p||b&&d?this.renderHermiteRibbon(!0,h,!0):this.renderHermiteArrowHead(h):this.renderHermiteConic(h,!0,7));a=p;b=d&&!this.helixRockets}g&&this.renderRockets()})});p("J.renderbio");s(["J.renderbio.BioShapeRenderer"],"J.renderbio.BackboneRenderer",["JU.C"],function(){c$=w(function(){this.isDataFrame=!1;v(this,arguments)},J.renderbio,"BackboneRenderer",J.renderbio.BioShapeRenderer);h(c$,"renderBioShape",function(a){var b=!this.isExport&&!this.vwr.gdata.isPass2,c=this.vwr.getBoolean(603979811)&&a.bioPolymer.isNucleic();
this.isDataFrame=this.vwr.ms.isJmolDataFrameForModel(a.modelIndex);for(a=this.bsVisible.nextSetBit(0);0<=a;a=this.bsVisible.nextSetBit(a+1)){var d=this.ms.at[this.leadAtomIndices[a]],e=this.colixes[a];this.mad=this.mads[a];this.drawSegment(d,this.ms.at[this.leadAtomIndices[a+1]],e,this.colixes[a+1],100,b);if(c){var g=this.monomers[a],h=g.getBasePairs();if(null!=h)for(var p=h.size();0<=--p;){var j=h.get(p).getPartnerAtom(g);j>a&&this.drawSegment(d,this.ms.at[j],e,e,1E3,b)}}}},"J.shapebio.BioShape");
e(c$,"drawSegment",function(a,b,c,d,e,g){if(!(0==a.nBackbonesDisplayed||0==b.nBackbonesDisplayed||this.ms.isAtomHidden(b.i)||!this.isDataFrame&&a.distanceSquared(b)>e))if(c=JU.C.getColixInherited(c,a.colixAtom),d=JU.C.getColixInherited(d,b.colixAtom),!g||this.setBioColix(c)||this.setBioColix(d)){g=a.sX;var h=a.sY;a=a.sZ;var p=b.sX,j=b.sY;b=b.sZ;var n=this.mad;1E3==e&&(n>>=1);0>n?this.g3d.drawLine(c,d,g,h,a,p,j,b):(e=E(this.isExport?n:this.vwr.tm.scaleToScreen(A((a+b)/2),n)),this.g3d.fillCylinderXYZ(c,
d,3,e,g,h,a,p,j,b))}},"JM.Atom,JM.Atom,~N,~N,~N,~B")});p("J.renderbio");s(["J.renderbio.StrandsRenderer"],"J.renderbio.TraceRenderer",null,function(){c$=C(J.renderbio,"TraceRenderer",J.renderbio.StrandsRenderer);h(c$,"renderBioShape",function(){this.wireframeOnly?this.renderStrands():this.renderTrace()},"J.shapebio.BioShape");e(c$,"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.newLongArray,Clazz.doubleToByte,Clazz.doubleToInt,Clazz.doubleToLong,Clazz.declarePackage,Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,Clazz.floatToInt,Clazz.floatToLong,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.defineStatics,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.p0p,Clazz.pu$h,Clazz.newShortArray,Clazz.innerTypeInstance,Clazz.isClassDefined,
Clazz.prepareCallback,Clazz.newArray,Clazz.castNullAs,Clazz.floatToShort,Clazz.superCall,Clazz.decorateAsType,Clazz.newBooleanArray,Clazz.newCharArray,Clazz.implementOf,Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.clone,Clazz.doubleToShort,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.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);
