(function(ka,la,ma,D,na,n,A,v,y,w,L,oa,F,W,H,K,I,Q,E,X,S,ba,ca,da,ea,aa,fa,ga,ha,pa,qa,$,Y,ra,ia,Z,sa,ta,R,ua,ja,va,wa,xa,ya,za,Aa,Ba,Ca,Da,Ea,Fa,Ga,Ha,Ia,Ja,e,h){n("J.adapter.readers.pdb");v(["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.isPQR=this.gromacsWideFormat=this.isLegacyModelType=this.isConnectStateBug=this.haveMappedSerials=this.isMultiModel=this.getTlsGroups=this.applySymmetry=!1;this.sb=this.sbConect=this.sbSelected=this.sbIgnored=this.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.haveDoubleBonds=!1;this.$cryst1=0;this.vConnect=this.tlsU=this.dataT=null;this.connectNextAtomSet=
this.connectNextAtomIndex=0;this.connectLast=null;y(this,arguments)},J.adapter.readers.pdb,"PdbReader",J.adapter.smarter.AtomSetCollectionReader);X(c$,function(){this.htFormul=new java.util.Hashtable;this.dataT=Q(8,0)});h(c$,"initializeReader",function(){this.allowPDBFilter=!0;this.pdbHeader=this.getHeader?new JU.SB:null;this.applySymmetry=!this.checkFilterKey("NOSYMMETRY");this.getTlsGroups=this.checkFilterKey("TLS");this.checkFilterKey("ASSEMBLY")&&(this.filter=JU.PT.rep(this.filter,"ASSEMBLY",
"BIOMOLECULE"));var a=(this.isbiomol=this.checkFilterKey("BIOMOLECULE"))&&this.checkFilterKey("BYCHAIN"),b=this.isbiomol&&this.checkFilterKey("BYSYMOP");(this.isCourseGrained=a||b)||this.setIsPDB();this.isConcatenated=(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=null==this.bsModels?c:this.modelNumber+1;if(!this.doGetModel(this.modelNumber,null))return this.handleTlsMissingModels(),a=this.checkLastModel(),!a&&this.isConcatenated&&(a=this.continuing=!0),a;this.isCourseGrained||this.connectAll(this.maxSerial,this.isConnectStateBug);0<this.ac&&this.applySymmetryAndSetTrajectory();this.model(c);if(this.isLegacyModelType||!b)return!0}if(this.isMultiModel&&
!this.doProcessLines)return this.isConcatenated&&this.checkDSSR(),!0;if(b)return this.getHeader=!1,this.atom(),!0;switch(a){case 3:this.conect();break;case 4:case 5:case 6:this.structure();break;case 7:this.het();break;case 8:this.hetnam();break;case 9:this.anisou();break;case 10:this.site();break;case 11:this.cryst1();break;case 12:case 13:case 14:this.scale(a-11);break;case 15:this.expdta();break;case 16:this.formul();break;case 17:if(this.line.contains("The B-factors in this file hold atomic radii")){this.isPQR=
!0;break}if(this.line.contains("This file does not adhere to the PDB standard")){this.gromacsWideFormat=!0;break}if(this.line.startsWith("REMARK 350"))return this.remark350(),!1;if(this.line.startsWith("REMARK 290"))return this.remark290(),!1;if(this.getTlsGroups&&0<this.line.indexOf("TLS DETAILS"))return this.remarkTls();this.checkCurrentLineForScript();break;case 18:this.header();break;case 19:case 20:this.compnd(20==a);break;case 21:this.title();break;case 22:this.seqAdv();break;default:this.checkDSSR()}return!0});
e(c$,"checkDSSR",function(){this.line.trim().startsWith("DSSR:")&&0<this.asc.ac&&this.processDSSR(this,this.htGroup1)});e(c$,"seqAdv",function(){var a=this.line.substring(39,42).trim().toLowerCase();if(1==a.length){null==this.htGroup1&&this.asc.setInfo("htGroup1",this.htGroup1=new java.util.Hashtable);var b=this.line.substring(12,15).trim();this.htGroup1.put(b,a)}});e(c$,"readHeader",function(a){if(a&&(this.rd(),!this.getHeader))return this.line;this.pdbHeader.append(this.line).appendC("\n");return this.line},
"~B");h(c$,"finalizeSubclassReader",function(){this.finalizeReaderPDB()});e(c$,"finalizeReaderPDB",function(){this.checkNotPDB();this.isCourseGrained||this.connectAll(this.maxSerial,this.isConnectStateBug);var a;null!=this.vBiomolecules&&(0<this.vBiomolecules.size()&&0<this.asc.ac)&&(this.asc.setCurrentModelInfo("biomolecules",this.vBiomolecules),this.setBiomoleculeAtomCounts(),null!=this.thisBiomolecule&&this.applySymmetry&&(this.asc.getXSymmetry().applySymmetryBio(this.thisBiomolecule,this.notionalUnitCell,
this.applySymmetryToBonds,this.filter),this.vTlsModels=null,this.asc.xtalSymmetry=null));if(null!=this.vTlsModels){a=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$,"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(){if(!(8>this.lineLength)){this.appendLoadNote(this.line.substring(7).trim());var a=66<=this.lineLength?this.line.substring(62,66).trim():"";4==
a.length&&(this.asc.setCollectionName(a),this.asc.setInfo("havePDBHeaderName",Boolean.TRUE));50<this.lineLength&&(this.line=this.line.substring(0,50));this.asc.setInfo("CLASSIFICATION",this.line.substring(7).trim())}});e(c$,"title",function(){10>this.lineLength||this.appendLoadNote(this.line.substring(10).trim())});e(c$,"compnd",function(a){if(!a){this.$compnd=null==this.$compnd?"":this.$compnd+" ";var b=this.line;62<this.lineLength&&(b=b.substring(0,62));this.$compnd+=b.substring(10).trim();this.asc.setInfo("COMPND",
this.$compnd)}if(null==this.vCompnds){if(a)return;this.vCompnds=new JU.Lst;this.htMolIds=new java.util.Hashtable;this.currentCompnd=new java.util.Hashtable;this.currentCompnd.put("select","(*)");this.currentKey="MOLECULE";this.htMolIds.put("",this.currentCompnd)}a&&this.resetKey&&(this.resetKey=!1,this.currentKey="SOURCE",this.currentCompnd=this.htMolIds.get(""));this.line=this.line.substring(10,Math.min(this.lineLength,72)).trim();var c=this.line.indexOf(":");if(0>c||0<c&&"\\"==this.line.charAt(c-
1))c=this.line.length;b=this.line.substring(0,c).trim();c=c<this.line.length?this.line.substring(c+1).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("chains"),d=b.get("biomts").size(),f=0,g=c.length-1;0<=--g;)":"==c.charAt(g)&&(f+=this.biomtChainAtomCounts[0+c.charCodeAt(g+1)]);b.put("atomCount",
Integer.$valueOf(f*d))}});e(c$,"remark350",function(){var a=null;this.vBiomolecules=new JU.Lst;this.biomtChainAtomCounts=K(255,0);for(var b="",c="",d="",f=!0,g=null,k=0,e=JU.M4.newM4(null);;){f?this.readHeader(!0):f=!0;if(null==this.line||!this.line.startsWith("REMARK 350"))break;try{if(this.line.startsWith("REMARK 350 BIOMOLECULE:")&&(0<k&&JU.Logger.info("biomolecule "+d+": number of transforms: "+k),g=new java.util.Hashtable,a=new JU.Lst,d=this.line.substring(this.line.indexOf(":")+1).trim(),b=
this.line.trim(),g.put("name","biomolecule "+d),g.put("molecule",3==d.length?d:Integer.$valueOf(this.parseIntStr(d))),g.put("title",b),g.put("chains",""),g.put("biomts",a),this.vBiomolecules.addLast(g),k=0),0<=this.line.indexOf("APPLY THE FOLLOWING TO CHAINS:"))if(null==g)f=!1,this.line="REMARK 350 BIOMOLECULE: 1  APPLY THE FOLLOWING TO CHAINS:";else{var j=this.line.substring(41).trim();this.appendLoadNote("found biomolecule "+d+": "+j);c=":"+j.$replace(" ",":");for(f=!1;null!=this.readHeader(!0)&&
0>this.line.indexOf("BIOMT")&&7==this.line.indexOf("350");)c+=":"+this.line.substring(11).trim().$replace(" ",":");if(this.checkFilterKey("BIOMOLECULE "+d+";")||this.checkFilterKey("BIOMOLECULE="+d+";"))this.setFilter(this.filter.$replace(":","_")+c),JU.Logger.info('filter set to "'+this.filter+'"'),this.thisBiomolecule=g;g.put("chains",c)}else if(this.line.startsWith("REMARK 350   BIOMT1 ")){k++;for(var l=Q(16,0),m=0;12>m;){var h=this.getTokens();l[m++]=this.parseFloatStr(h[4]);l[m++]=this.parseFloatStr(h[5]);
l[m++]=this.parseFloatStr(h[6]);l[m++]=this.parseFloatStr(h[7]);(4==m||8==m)&&this.readHeader(!0)}l[15]=1;var s=new JU.M4;s.setA(l);s.equals(e)?a.add(0,s):a.addLast(s)}}catch(t){if(H(t,Exception)){this.vBiomolecules=this.thisBiomolecule=null;return}throw t;}}0<k&&JU.Logger.info("biomolecule "+d+": number of transforms: "+k)});e(c$,"remark290",function(){for(;null!=this.readHeader(!0)&&this.line.startsWith("REMARK 290");)if(0<=this.line.indexOf("NNNMMM   OPERATOR"))for(;null!=this.readHeader(!0);){var a=
this.getTokens();if(4>a.length)break;(this.doApplySymmetry||this.isbiomol)&&this.setSymmetryOperator(a[3])}});e(c$,"getSerial",function(a,b){var c=this.line.charAt(a),d=" "==c||" "==this.line.charAt(b-1);switch(this.serMode){default:case 0:if(d)return this.parseIntRange(this.line,a,b);try{return this.serial=Integer.parseInt(this.line.substring(a,b))}catch(f){if(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=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){if(this.isPQR)if(this.gromacsWideFormat)a.partialCharge=this.parseFloatRange(this.line,60,68),a.radius=J.adapter.readers.pdb.PdbReader.fixRadius(this.parseFloatRange(this.line,
68,76));else{var b=this.getTokens(),c=b.length-2-(75<this.line.length?1:0);a.partialCharge=this.parseFloatStr(b[c++]);a.radius=J.adapter.readers.pdb.PdbReader.fixRadius(this.parseFloatStr(b[c]))}else this.gromacsWideFormat?(b=this.parseFloatRange(this.line,60,68),a.bfactor=J.adapter.readers.pdb.PdbReader.fixRadius(this.parseFloatRange(this.line,68,76))):(b=this.parseFloatRange(this.line,54,60),a.bfactor=this.parseFloatRange(this.line,60,66)),a.foccupancy=Float.isNaN(b)?1:b},"J.adapter.smarter.Atom");
e(c$,"deduceElementSymbol",function(a){if(78<=this.lineLength){var b=this.line.charAt(76),c=this.line.charAt(77);if(" "==b&&J.adapter.smarter.Atom.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([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 l=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 m=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,l,d,f,m,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.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});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.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.notionalUnitCell&&(a=4*a+2,this.notionalUnitCell[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=Q(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,l,m,h,s;if(6==j.length)l=j[2].charAt(0),m=j[4].charAt(0),h=this.parseIntStr(j[3]),s=this.parseIntStr(j[5]);else{var t=c.indexOf(" C "),U=c.indexOf(" C ",t+4);l=this.line.charAt(U);m=this.line.charAt(t);h=this.parseIntRange(this.line,U+1,t);s=this.parseIntStr(this.line.substring(t+1))}l==m?(k.put("chains",""+l+m),h<=s?(k.put("residues",[h,s]),g.addLast(k)):this.tlsAddError(" TLS group residues are not in order (range ignored)")):
this.tlsAddError(" TLS group chains are different (range ignored)")}else if(j[0].equalsIgnoreCase("SELECTION"))for(var r="\x00",q=1;q<j.length;q++)if(0<=j[q].toUpperCase().indexOf("CHAIN"))r=j[++q].charAt(0);else{var n=this.parseIntStr(j[q]);-2147483648!=n&&(k=new java.util.Hashtable,k.put("residues",[n,this.parseIntStr(j[++q])]),"\x00"!=r&&k.put("chains",""+r+r),g.addLast(k))}else if(j[0].equalsIgnoreCase("ORIGIN")){var x=new JU.P3;f.put("origin",x);if(8==j.length)x.set(this.parseFloatStr(j[5]),
this.parseFloatStr(j[6]),this.parseFloatStr(j[7]));else{var u=this.line.length;x.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(x.x)||Float.isNaN(x.y)||Float.isNaN(x.z))x.set(NaN,NaN,NaN),this.tlsAddError("invalid origin: "+this.line)}else if(j[1].equalsIgnoreCase("TENSOR")){var v=j[0].charAt(0),A=(this.readHeader(!0).substring(10)+this.readHeader(!0).substring(10)+this.readHeader(!0).substring(10)).$replace(v,
" ").$replace(":"," "),j=JU.PT.getTokens(A),y=Q(3,3,0);f.put("t"+v,y);for(q=0;q<j.length;q++){var z=j[q].charCodeAt(0)-49,w=j[q].charCodeAt(1)-49;y[z][w]=this.parseFloatStr(j[++q]);z<w&&(y[w][z]=y[z][w])}for(q=0;3>q;q++)for(r=0;3>r;r++)Float.isNaN(y[q][r])&&this.tlsAddError("invalid tensor: "+JU.Escape.escapeFloatAA(y,!1));if("S"==v&&++b==a){JU.Logger.info(a+" TLS groups read");this.readHeader(!0);break}}}catch(D){if(H(D,Exception)){JU.Logger.error(this.line+"\nError in TLS parser: ");System.out.println(D.getMessage());
d=null;break}else throw D;}null!=d&&(b=new java.util.Hashtable,b.put("groupCount",Integer.$valueOf(a)),b.put("groups",d),this.vTlsModels.addLast(b));return 1>a});e(c$,"handleTlsMissingModels",function(){this.vTlsModels=null});e(c$,"setTlsGroups",function(a,b,c){JU.Logger.info("TLS model "+(b+1)+" set "+(a+1));a=this.vTlsModels.get(a);for(var d=a.get("groups"),f=this.asc.getAtomSetAtomIndex(b),g=Q(this.asc.getAtomSetAtomCount(b),0),k=f+g.length,e=this.asc.atoms,j=d.size(),l=0;l<j;l++){var m=d.get(l),
h=m.get("ranges");this.tlsGroupID=m.get("id").intValue();for(var s=h.size();0<=--s;){var t=h.get(s).get("chains"),U=h.get(s).get("residues"),r=0+t.charCodeAt(0),t=0+t.charCodeAt(1),q=U[0],U=U[1],n=this.findAtomForRange(f,k,r,q,!1),x=0<=n?this.findAtomForRange(n,k,t,U,!1):-1;if(0>x){JU.Logger.info("TLS processing terminated");return}JU.Logger.info("TLS ID="+this.tlsGroupID+" model atom index range "+n+"-"+x);n=r==t;for(x=f;x<k;x++){var u=e[x];if(n?u.sequenceNumber>=q&&u.sequenceNumber<=U:u.chainID>
r&&u.chainID<t||u.chainID==r&&u.sequenceNumber>=q||u.chainID==t&&u.sequenceNumber<=U)g[x-f]=this.tlsGroupID,this.setTlsTensor(u,m,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,l=e*e,m=d*d,h=k*e,s=k*d,t=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=Q(8,0),n=Float.isNaN(a.bfactor)?0:a.bfactor/78.95683;f[0]=this.dataT[0]+g[1][1]*m+g[2][2]*l-2*g[1][2]*t+2*b[1][0]*d-2*b[2][0]*e;f[1]=this.dataT[1]+g[0][0]*m+g[2][2]*j-2*g[2][0]*s-2*b[0][1]*d+2*b[2][1]*k;f[2]=this.dataT[2]+g[0][0]*l+g[1][1]*j-2*g[0][1]*h-2*b[1][2]*k+2*b[0][2]*e;f[3]=this.dataT[3]-g[2][2]*h+g[1][2]*s+g[2][0]*t-g[0][1]*m-b[0][0]*d+b[1][1]*d+b[2][0]*k-b[2][1]*e;f[4]=
this.dataT[4]-g[1][1]*s+g[1][2]*h-g[2][0]*l+g[0][1]*t+b[0][0]*e-b[2][2]*e+b[1][2]*d-b[1][0]*k;f[5]=this.dataT[5]-g[0][0]*t-g[1][2]*j+g[2][0]*h+g[0][1]*s-b[1][1]*k+b[2][2]*k+b[0][1]*e-b[0][2]*d;f[6]=12;f[7]=n;null==this.tlsU&&(this.tlsU=new java.util.Hashtable);this.tlsU.put(a,f);a.addTensor(c.getTensor(this.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",[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",
[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");I(c$,"MODE_PDB",0,"MODE_HEX",1,"MODE_HYBRID36",2,"lineOptions","ATOM    HETATM  MODEL   CONECT  HELIX   SHEET   TURN    HET     HETNAM  ANISOU  SITE    CRYST1  SCALE1  SCALE2  SCALE3  EXPDTA  FORMUL  REMARK  HEADER  COMPND  SOURCE  TITLE   SEQADV  ",
"RAD_PER_DEG",0.017453292519943295,"_8PI2_",78.95683520871486)});n("J.adapter.smarter");v(null,"J.adapter.smarter.Structure",["J.c.STR"],function(){c$=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;y(this,arguments)},
J.adapter.smarter,"Structure");X(c$,function(){this.atomStartEnd=K(2,0);this.modelStartEnd=[-1,-1]});c$.getHelixType=e(c$,"getHelixType",function(a){switch(a){case 1:return J.c.STR.HELIXALPHA;case 3:return J.c.STR.HELIXPI;case 5:return J.c.STR.HELIX310}return J.c.STR.HELIX},"~N");F(c$,function(a,b,c,d,f,g){this.structureType=b;this.substructureType=c;null!=d&&(this.setModels(a,0),this.structureID=d,this.strandCount=g,this.serialID=f)},"~N,J.c.STR,J.c.STR,~S,~N,~N");e(c$,"set",function(a,b,c,d,f,g,
k,e){this.startChainID=a;this.startSequenceNumber=b;this.startInsertionCode=c;this.endChainID=d;this.endSequenceNumber=f;this.endInsertionCode=g;this.atomStartEnd[0]=k;this.atomStartEnd[1]=e},"~N,~N,~S,~N,~N,~S,~N,~N");e(c$,"setModels",function(a,b){this.modelStartEnd[0]=a;this.modelStartEnd[1]=0==b?a:b},"~N,~N")});n("J.api");ca(J.api,"JmolBioResolver");n("JM");v(["J.api.JmolBioResolver"],"JM.Resolver","java.lang.Boolean $.Byte $.NullPointerException $.Short java.util.Arrays $.Hashtable 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;ga("JM.Resolver.BondSorter")||JM.Resolver.$Resolver$BondSorter$();this.bsAssigned=null;y(this,arguments)},JM,"Resolver",null,J.api.JmolBioResolver);F(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.ms=null:(JM.Group.specialAtomNames=JM.Resolver.specialAtomNames,this.ms=a.ms,this.vwr=a.ms.vwr,a.specialAtomIndexes=K(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=D(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])}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=f-1;for(var j=0,l=JM.Resolver.ATOMID_MAX;0<=--l;)k[l]=-2147483648;for(l=f;--l>=d;)f=e[l].atomID,0>=f||(14>f&&(j|=1<<f),k[f]=l);if(g<d)throw new NullPointerException;f=null;14==(j&14)?f=JM.AminoMonomer.validateAndAllocate(a,b,c,d,g,k,e):4==j?f=JM.AlphaMonomer.validateAndAllocateA(a,b,c,d,g,k):8128==
(j&8128)?f=JM.NucleicMonomer.validateAndAllocate(a,b,c,d,g,k):8192==j?f=JM.PhosphorusMonomer.validateAndAllocateP(a,b,c,d,g,k):JM.Resolver.checkCarbohydrate(b)&&(f=JM.CarbohydrateMonomer.validateAndAllocate(a,b,c,d,g));return null!=f&&0<=f.leadAtomIndex?f:null},"JM.Chain,~S,~N,~N,~N,~N,~A,~A");h(c$,"setHaveHsAlready",function(a){this.haveHsAlready=a},"~B");h(c$,"initializeHydrogenAddition",function(){this.baseBondIndex=this.ml.ms.bondCount;this.bsAddedHydrogens=new JU.BS;this.bsAtomsForHs=new JU.BS;
this.htBondMap=new java.util.Hashtable;this.htGroupBonds=new java.util.Hashtable;this.hNames=Array(3);this.vAB=new JU.V3;this.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).deleteBonds(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++]=[k[0],k[1],k[2],k[1].startsWith("H")?"0":"1"]);"H"!=k[1].charAt(0)&&(a[b++]=[k[1],k[0],k[2],k[0].startsWith("H")?"0":"1"])}java.util.Arrays.sort(a,fa(JM.Resolver.BondSorter,this,null));for(var e,g=0;g<b;){e=a[g];for(var d=e[0],j=k=0;g<b&&(e=a[g])[0].equals(d);g++)e[3].equals("0")?k++:e[3].equals("1")&&j++;d=g-k-j;if(1!=k)switch(j){case 1:for(var j=2==k?"@":"|",l=1;l<k;l++)a[d][1]+=j+a[d+l][1],a[d+l]=null;continue;case 2:if(2!=k)continue;var j=a[d][0],l=a[d+k][1],k=a[d+k+1][1],m=l.compareTo(k);
JU.Measure.getPlaneThroughPoints(f.get(l),f.get(j),f.get(k),this.vNorm,this.vAB,this.plane);k=JU.Measure.distanceToPlane(this.plane,f.get(a[d][1]))*m;a[d][1]=0<k?a[d][1]+"@"+a[d+1][1]:a[d+1][1]+"@"+a[d][1];a[d+1]=null}}for(g=0;g<b;g++)null!=(e=a[g])&&"H"!=e[1].charAt(0)&&0<e[0].compareTo(e[1])?a[g]=null:null!=e&&JU.Logger.info(" ligand "+c+": "+a[g][0]+" - "+a[g][1]+" order "+a[g][2]);return a},"J.api.JmolAdapter,~O,~S");h(c$,"finalizeHydrogens",function(){this.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=K(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 l=j.contains("@"),m=j.endsWith("?")||0<=j.indexOf("|"),h=a[d].length;3==h&&(!m&&j.equals("H@H2"))&&(j="H|H2|H3",m=!0,l=!1);if(l&&3==h||m!=(3==h))JU.Logger.info("Error adding H atoms to "+k+g.getResno()+": "+a[d].length+" atoms should not be added to "+e);else switch(e=j.indexOf("@"),a[d].length){case 1:0<e&&(j=j.substring(0,e));this.setHydrogen(d,++c,j,a[d][0]);break;case 2:l=-1;m=f.bonds;if(null!=m)switch(m.length){case 2:l=m[0].getOtherAtom(f),m=m[1].getOtherAtom(f),h=l.getAtomName().compareTo(m.getAtomName()),
l=JU.Measure.distanceToPlane(JU.Measure.getPlaneThroughPoints(l,f,m,this.vNorm,this.vAB,this.plane),a[d][0])*h}0>e?(JU.Logger.info("Error adding H atoms to "+k+g.getResno()+": expected to only need 1 H but needed 2"),f=g="H"):0>l?(g=j.substring(0,e),f=j.substring(e+1)):(f=j.substring(0,e),g=j.substring(e+1));this.setHydrogen(d,++c,f,a[d][0]);this.setHydrogen(d,++c,g,a[d][1]);break;case 3:f=j.indexOf("|"),0<=f?(g=j.lastIndexOf("|"),this.hNames[0]=j.substring(0,f),this.hNames[1]=j.substring(f+1,g),
this.hNames[2]=j.substring(g+1)):(this.hNames[0]=j.$replace("?","1"),this.hNames[1]=j.$replace("?","2"),this.hNames[2]=j.$replace("?","3")),this.setHydrogen(d,++c,this.hNames[0],a[d][0]),this.setHydrogen(d,++c,this.hNames[1],a[d][2]),this.setHydrogen(d,++c,this.hNames[2],a[d][1])}}}this.deleteUnneededAtoms();this.ms.fixFormalCharges(JU.BSUtil.newBitSet2(this.ml.baseAtomIndex,this.ml.ms.ac))}});e(c$,"deleteUnneededAtoms",function(){for(var a=new JU.BS,b=this.bsAtomsForHs.nextSetBit(0);0<=b;b=this.bsAtomsForHs.nextSetBit(b+
1)){var c=this.ms.at[b];if(c.isHetero()&&!(8!=c.getElementNumber()||0!=c.getFormalCharge()||2!=c.getCovalentBondCount())){var d=c.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.deleteBonds(a);break}}}this.ms.deleteBonds(a,!0);this.deleteAtoms(this.bsAddedHydrogens)});e(c$,"deleteAtoms",function(a){for(var b=
K(this.ms.ac,0),c=K(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].ac--):(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);System.out.println("res bsAddedMask = "+this.bsAddedMask);for(k=this.ml.baseModelIndex;k<this.ml.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.getCachedAnnotationMap(a,b,d),null!=b&&this.vwr.getAnnotationParser().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=Q(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(!A(k,JM.Monomer)||null!=
(e=k).bioPolymer||null!=d&&d.getClass()!==e.getClass()||c&&!e.isConnectedAfter(d))break;d=e;f++}if(0==f)return null;c=Array(f);for(g=0;g<f;++g)c[g]=a[b+g];if(A(d,JM.AminoMonomer))return new JM.AminoPolymer(c);if(A(d,JM.AlphaMonomer))return new JM.AlphaPolymer(c);if(A(d,JM.NucleicMonomer))return new JM.NucleicPolymer(c);if(A(d,JM.PhosphorusMonomer))return new JM.PhosphorusPolymer(c);if(A(d,JM.CarbohydrateMonomer))return new JM.CarbohydratePolymer(c);JU.Logger.error("Polymer.allocatePolymer() ... no matching polymer for monomor "+
d);throw new NullPointerException;},"~A,~N,~B");h(c$,"iterateOverAllNewStructures",function(a,b){var c=a.getStructureIterator(b);if(null!=c){var d=c.getStructuredModels();if(null!=d)for(var f=d.nextSetBit(0);0<=f;f=d.nextSetBit(f+1))this.ml.structuresDefinedInFile.set(this.ml.baseModelIndex+f);for(;c.hasNext();)c.getStructureType()!==J.c.STR.TURN&&this.setStructure(c);for(c=a.getStructureIterator(b);c.hasNext();)c.getStructureType()===J.c.STR.TURN&&this.setStructure(c)}},"J.api.JmolAdapter,~O");e(c$,
"setStructure",function(a){var b=a.getSubstructureType(),c=a.getStructureID(),d=a.getSerialID(),f=a.getStrandCount(),g=a.getAtomIndices(),k=a.getModelIndices();null==this.bsAssigned&&(this.bsAssigned=new JU.BS);this.defineStructure(b,c,d,f,a.getStartChainID(),a.getStartSequenceNumber(),a.getStartInsertionCode(),a.getEndChainID(),a.getEndSequenceNumber(),a.getEndInsertionCode(),g,k,this.bsAssigned)},"J.api.JmolAdapterStructureIterator");e(c$,"defineStructure",function(a,b,c,d,f,g,k,e,j,l,m,h,s){a=
a===J.c.STR.NOT?J.c.STR.NONE:a;g=JM.Group.getSeqcodeFor(g,k);j=JM.Group.getSeqcodeFor(j,l);l=this.ms.am;this.ml.isTrajectory?h[1]=h[0]:(h[0]+=this.ml.baseModelIndex,h[1]+=this.ml.baseModelIndex);this.ml.structuresDefinedInFile.setBits(h[0],h[1]+1);for(k=h[0];k<=h[1];k++){var t=l[k].firstAtomIndex;A(l[k],JM.BioModel)&&l[k].addSecondaryStructure(a,b,c,d,f,g,e,j,t+m[0],t+m[1],s)}},"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]=K(JM.Resolver.group3Count+10,0);null==this.ml.group3Lists[0]&&(this.ml.group3Lists[0]=JM.Group.standardGroupList,this.ml.group3Counts[0]=K(JM.Resolver.group3Count+10,0))},"~N");h(c$,"isKnownPDBGroup",function(a){return 0<=JM.Resolver.knownGroupID(a)||JM.Resolver.checkCarbohydrate(a)},"~S");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(D(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="HD2@HD3";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]=[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.Group.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<=D(a/6)+1},"~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 3145730:return JM.Resolver.argbsAmino;case 1073742144:return JM.Resolver.argbsShapely;case 1141899265:return JM.Resolver.argbsChainAtom;case 1613758470:return JM.Resolver.argbsChainHetero}return null},
"~N");h(c$,"getGroupID",function(a){return JM.Resolver.getGroupIdFor(a)},"~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.Group.htGroup.put(a,Short.$valueOf(b));return b},"~S");c$.getGroupIdFor=e(c$,"getGroupIdFor",function(a){var b=JM.Resolver.knownGroupID(a);return-1==b?JM.Resolver.addGroup3Name(a):b},"~S");
c$.$Resolver$BondSorter$=function(){ea(self.c$);c$=w(function(){ha(this,arguments);y(this,arguments)},JM.Resolver,"BondSorter",null,java.util.Comparator);h(c$,"compare",function(a,b){return null==b?null==a?0:-1:null==a?1:0>a[0].compareTo(b[0])?-1:0<a[0].compareTo(b[0])?1:0>a[3].compareTo(b[3])?-1:0<a[3].compareTo(b[3])?1:0>a[1].compareTo(b[1])?-1:0<a[1].compareTo(b[1])?1:0},"~A,~A");c$=da()};I(c$,"htPdbBondInfo",null,"pdbBondInfo",";N N CA HA C O CB HB?;N N CA HA C O CB HB2@HB3 CG HG2@HG3 CD D NE HE CZ NH1 NH1 HH11@HH12 NH2 HH21@HH22;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 HE21@HE22;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 HG12@HG13 CG2 HG2? CD1 HD1?;N N CA HA C O CB HB2@HB3 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 HB2@HB3 CG HG2@HG3 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 HD2@HD3;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?;CA HA C O CB HB2@HB1 C H;CA HA C O CB HB1 CB HB2 CG HG1 CG HG2;;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 H21@H22 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 H21@H22 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' H5'@H5'' C4' H4' C3' H3' C2' H2'@H2'' 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'@H2'' 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",[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",
"\x00ARNDCQEGHILKMFPSTWYVAG?GCATUIGCATUIGCATUI".split(""),"group3NameCount",0,"predefinedGroup3Names","   ;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",[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;I(c$,"htSpecialAtoms",null,"argbsAmino",[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",[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",[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",[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])});n("JM");v(["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=0;this.theta=this.mu=this.straightness=this.omega=this.psi=this.phi=NaN;y(this,arguments)},JM,"Monomer",JM.Group);F(c$,function(){S(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;a=this.offsets[0]&255;255!=a&&(this.leadAtomIndex=d+a);return this},"JM.Chain,~S,~N,~N,~N,~A");h(c$,"getGroups",function(){return this.bioPolymer.monomers});
e(c$,"setBioPolymer",function(a,b){this.bioPolymer=a;this.monomerIndex=b},"JM.BioPolymer,~N");h(c$,"getSelectedMonomerCount",function(){return this.bioPolymer.getSelectedMonomerCount()});h(c$,"getSelectedMonomerIndex",function(){return 0<=this.monomerIndex&&this.bioPolymer.isMonomerSelected(this.monomerIndex)?this.monomerIndex:-1});h(c$,"getBioPolymerLength",function(){return null==this.bioPolymer?0:this.bioPolymer.monomerCount});e(c$,"getMonomerIndex",function(){return this.monomerIndex});h(c$,"getAtomIndex",
function(a,b){var c=this.getGroups(),d=this.monomerIndex+b;if(0<=d&&d<c.length){c=c[d];if(1==b&&!c.isConnectedPrevious())return-1;if("0".equals(a))return c.leadAtomIndex;for(var d=this.chain.model.ms.at,f=c.firstAtomIndex;f<=c.lastAtomIndex;f++)if(null==a||a.equalsIgnoreCase(d[f].getAtomName()))return f}return-1},"~S,~N");e(c$,"getBioPolymerIndexInModel",function(){return null==this.bioPolymer?-1:this.bioPolymer.bioPolymerIndexInModel});c$.scanForOffsets=e(c$,"scanForOffsets",function(a,b,c){for(var d=
c.length,f=ba(d,0);0<=--d;){var g,k=c[d];if(0>k)g=b[~k];else if(g=b[k],0>g)return null;var e;if(0>g)e=255;else if(e=g-a,0>e||254<e)JU.Logger.warn("Monomer.scanForOffsets i="+d+" atomID="+k+" atomIndex:"+g+" firstAtomIndex:"+a+" offset out of 0-254 range. Groups aren't organized correctly. Is this really a protein?: "+e),0>k&&(e=255);f[d]=e}return f},"~N,~A,~A");h(c$,"getProteinStructureType",function(){return J.c.STR.NONE});e(c$,"isHelix",function(){return!1});e(c$,"isSheet",function(){return!1});
h(c$,"setStrucNo",function(){},"~N");e(c$,"getAtomFromOffsetIndex",function(a){if(a>this.offsets.length)return null;a=this.offsets[a]&255;return 255==a?null:this.chain.getAtom(this.firstAtomIndex+a)},"~N");e(c$,"getSpecialAtom",function(a,b){for(var c=a.length;0<=--c;){var d=a[c];0>d&&(d=-d);if(b==d){c=this.offsets[c]&255;if(255==c)break;return this.chain.getAtom(this.firstAtomIndex+c)}}return null},"~A,~N");e(c$,"getSpecialAtomPoint",function(a,b){for(var c=a.length;0<=--c;){var d=a[c];0>d&&(d=-d);
if(b==d){c=this.offsets[c]&255;if(255==c)break;return this.chain.getAtom(this.firstAtomIndex+c)}}return null},"~A,~N");h(c$,"isLeadAtom",function(a){return a==this.leadAtomIndex},"~N");h(c$,"getLeadAtom",function(){return this.getAtomFromOffsetIndex(0)});e(c$,"getWingAtom",function(){return this.getAtomFromOffsetIndex(1)});e(c$,"getInitiatorAtom",function(){return this.getLeadAtom()});e(c$,"getTerminatorAtom",function(){return this.getLeadAtom()});e(c$,"findNearestAtomIndex",function(){},"~N,~N,~A,~N,~N");
e(c$,"calcBioParameters",function(){return this.bioPolymer.calcParameters()});e(c$,"haveParameters",function(){return this.bioPolymer.haveParameters});e(c$,"getMyInfo",function(a){a=this.getGroupInfo(this.groupIndex,a);a.put("chain",this.chain.getIDStr());var b=this.getResno();0<b&&a.put("sequenceNumber",Integer.$valueOf(b));b=this.getInsertionCode();0!=b.charCodeAt(0)&&a.put("insertionCode",""+b);b=this.getGroupParameter(1112539145);Float.isNaN(b)||a.put("phi",Float.$valueOf(b));b=this.getGroupParameter(1112539146);
Float.isNaN(b)||a.put("psi",Float.$valueOf(b));b=this.getGroupParameter(1112539141);Float.isNaN(b)||a.put("mu",Float.$valueOf(b));b=this.getGroupParameter(1112539152);Float.isNaN(b)||a.put("theta",Float.$valueOf(b));b=this.getStructure();A(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 A(a,JM.ProteinStructure)?a.type.getBioStructureTypeName(!1):""});e(c$,"getConformation",function(a,b,c){for(var d="\x00",f=this.firstAtomIndex;f<=this.lastAtomIndex;f++){var g=a[f].altloc;"\x00"!=g&&(0<=c&&g!=d&&(d=g,c--),0>c&&g!=d&&b.clear(f))}},"~A,JU.BS,~N");e(c$,"updateOffsetsForAlternativeLocations",function(a,b){for(var c=this.offsets.length;0<=--c;){var d=this.offsets[c]&255;if(255!=d){var d=this.firstAtomIndex+d,f=a[d],g=f.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 l=j-this.firstAtomIndex;if(!(0>l||255<l||j==d||!b.get(j))){var h=a[j].atomID;if(!(h!=g||0==h&&!a[j].getAtomName().equals(f.getAtomName()))){JU.Logger.debugging&&JU.Logger.debug("Chain.udateOffsetsForAlternativeLocation "+a[j]+" was "+f);this.offsets[c]=l;break}}}}}},"~A,JU.BS");e(c$,"getMonomerSequenceAtoms",function(a,b){this.selectAtoms(b);b.and(a)},"JU.BS,JU.BS");c$.checkOptional=e(c$,"checkOptional",
function(a,b,c,d){if(JM.Monomer.have(a,b))return!0;if(0>d)return!1;a[b]=d-c;return!0},"~A,~N,~N,~N");e(c$,"getQuaternionFrameCenter",function(){return null},"~S");e(c$,"getHelixData2",function(a,b,c){var d=this.monomerIndex-c,f=1>c||0>=this.monomerIndex?null:this.bioPolymer.monomers[d],d=this.getQuaternion(b),g=1>c?JU.Quat.getQuaternionFrameV(JV.JC.axisX,JV.JC.axisY,JV.JC.axisZ,!1):null==f?null:f.getQuaternion(b);if(null==g||null==d)return this.getHelixData(a,b,c);var f=1>c?JU.P3.new3(0,0,0):f.getQuaternionFrameCenter(b),
k=this.getQuaternionFrameCenter(b);return null==f||null==k?this.getHelixData(a,b,c):JU.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))return!0;return!1},"JM.Group");h(c$,"getCrossLinkLead",function(a){for(var b=this.firstAtomIndex;b<=this.lastAtomIndex;b++)if(this.getCrossLinkGroup(b,a,null)&&null==a)return!0;return!1},"JU.Lst");e(c$,"getCrossLinkGroup",function(a,b,c){a=this.chain.getAtom(a);var d=a.bonds,f=this.getBioPolymerIndexInModel();if(0>f||null==d)return!1;for(var g=!1,k=null==b&&null==c,e=0;e<d.length;e++){var j=d[e].getOtherAtom(a).group;if(!(null!=c&&j!==c)){var l=j.getBioPolymerIndexInModel(),h=j.getMonomerIndex();
if(k){if(l==f&&h==this.monomerIndex-1)return!0}else if(0<=l&&0<=h&&(l!=f||h<this.monomerIndex-1||h>this.monomerIndex+1)){g=!0;if(null!=c)break;b.addLast(Integer.$valueOf(j.leadAtomIndex))}}}return g},"~N,JU.Lst,JM.Group");e(c$,"isConnectedPrevious",function(){return!0});e(c$,"setGroupParameter",function(a,b){switch(a){case 1112539145:this.phi=b;break;case 1112539146:this.psi=b;break;case 1112539144:this.omega=b;break;case 1112539141:this.mu=b;break;case 1112539152:this.theta=b;break;case 1112539150:this.straightness=
b}},"~N,~N");h(c$,"getGroupParameter",function(a){this.haveParameters()||this.calcBioParameters();switch(a){case 1073742029:return 1;case 1112539144:return this.omega;case 1112539145:return this.phi;case 1112539146:return this.psi;case 1112539141:return this.mu;case 1112539152:return this.theta;case 1112539150:return this.straightness}return NaN},"~N");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")});n("JM");v(["JM.Monomer"],"JM.AlphaMonomer","JU.Quat $.V3 J.c.STR JM.Helix $.Sheet $.Turn".split(" "),function(){c$=w(function(){this.nitrogenHydrogenPoint=this.proteinStructure=null;y(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");R(c$,function(){});e(c$,"isAlphaMonomer",function(){return!0});h(c$,"getStructure",function(){return this.proteinStructure});e(c$,"setStructure",function(a){if(null==(this.proteinStructure=a))this.nitrogenHydrogenPoint=null},"JM.ProteinStructure");h(c$,"setStrucNo",function(a){null!=this.proteinStructure&&(this.proteinStructure.strucNo=a)},"~N");h(c$,"getProteinStructureType",
function(){return null==this.proteinStructure?J.c.STR.NONE:this.proteinStructure.type});h(c$,"getProteinStructureSubType",function(){return null==this.proteinStructure?J.c.STR.NONE:this.proteinStructure.subtype});h(c$,"getStrucNo",function(){return null!=this.proteinStructure?this.proteinStructure.strucNo:0});h(c$,"isHelix",function(){return null!=this.proteinStructure&&this.proteinStructure.type===J.c.STR.HELIX});h(c$,"isSheet",function(){return null!=this.proteinStructure&&this.proteinStructure.type===
J.c.STR.SHEET});h(c$,"setProteinStructureType",function(a,b){null!=this.proteinStructure&&this.proteinStructure.removeMonomer(this.monomerIndex);if(0>b||0<b&&0==this.monomerIndex)switch(a){case J.c.STR.HELIX:case J.c.STR.HELIXALPHA:case J.c.STR.HELIX310:case J.c.STR.HELIXPI:this.setStructure(new JM.Helix(this.bioPolymer,this.monomerIndex,1,a));break;case J.c.STR.SHEET:this.setStructure(new JM.Sheet(this.bioPolymer,this.monomerIndex,1,a));break;case J.c.STR.TURN:this.setStructure(new JM.Turn(this.bioPolymer,
this.monomerIndex,1));break;case J.c.STR.NONE:this.setStructure(null)}else this.setStructure(this.bioPolymer.getProteinStructure(b)),null!=this.proteinStructure&&this.proteinStructure.addMonomer(this.monomerIndex);return this.monomerIndex},"J.c.STR,~N");e(c$,"getAtom",function(a){return 2==a?this.getLeadAtom():null},"~N");e(c$,"getAtomPoint",function(a){return 2==a?this.getLeadAtom():null},"~N");h(c$,"isConnectedAfter",function(a){if(null==a)return!0;var b=this.getLeadAtom();a=a.getLeadAtom();return b.isBonded(a)||
4.2>=b.distance(a)},"JM.Monomer");h(c$,"getQuaternionFrameCenter",function(a){return this.getQuaternionFrameCenterAlpha(a)},"~S");h(c$,"isWithinStructure",function(a){return null!=this.proteinStructure&&this.proteinStructure.type===a&&this.proteinStructure.isWithin(this.monomerIndex)},"J.c.STR");e(c$,"getQuaternionFrameCenterAlpha",function(a){switch(a){case "b":case "c":case "C":case "x":return this.getLeadAtom();default:case "a":case "n":case "p":case "P":case "q":return null}},"~S");h(c$,"getHelixData",
function(a,b,c){return this.getHelixData2(a,b,c)},"~N,~S,~N");h(c$,"getQuaternion",function(a){return this.getQuaternionAlpha(a)},"~S");e(c$,"getQuaternionAlpha",function(a){var b=new JU.V3,c=new JU.V3;switch(a){default:case "a":case "n":case "p":case "q":return null;case "b":case "c":case "x":if(0==this.monomerIndex||this.monomerIndex==this.bioPolymer.monomerCount-1)return null;a=this.getLeadAtom();var d=this.bioPolymer.getLeadPoint(this.monomerIndex+1),f=this.bioPolymer.getLeadPoint(this.monomerIndex-
1);b.sub2(d,a);c.sub2(f,a)}return JU.Quat.getQuaternionFrameV(b,c,null,!1)},"~S");I(c$,"alphaOffsets",[0])});n("JM");v(null,"JM.ProteinStructure",["java.util.Hashtable","JU.AU","$.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.monomerIndexFirst=0;this.vectorProjection=this.axisUnitVector=this.axisB=this.axisA=null;this.monomerIndexLast=0;this.resMap=this.segments=null;y(this,
arguments)},JM,"ProteinStructure");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$,"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$,"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$,"getAxisStartPoint",
function(){this.calcAxis();return this.axisA});e(c$,"getAxisEndPoint",function(){this.calcAxis();return this.axisB});e(c$,"getStructureMidPoint",function(a){null==this.segments&&this.calcSegments();return this.segments[a]},"~N");e(c$,"getInfo",function(a){a.put("type",this.type.getBioStructureTypeName(!1));var b=this.apolymer.getLeadAtomIndices(),b=JU.AU.arrayCopyRangeI(b,this.monomerIndexFirst,this.monomerIndexFirst+this.nRes);a.put("leadAtomIndices",b);this.calcAxis();null!=this.axisA&&(a.put("axisA",
this.axisA),a.put("axisB",this.axisB),a.put("axisUnitVector",this.axisUnitVector))},"java.util.Map");e(c$,"resetAxes",function(){this.segments=this.axisA=null});I(c$,"globalStrucNo",1E3)});n("JM");v(["JM.ProteinStructure"],"JM.Helix",["JU.Measure","$.P3","$.V3","J.c.STR"],function(){c$=E(JM,"Helix",JM.ProteinStructure);R(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)}})});n("JM");v(["JM.ProteinStructure"],"JM.Sheet",["JU.Measure","$.P3","$.V3","J.c.STR","JM.AminoPolymer"],function(){c$=w(function(){this.heightUnitVector=
this.widthUnitVector=null;y(this,arguments)},JM,"Sheet",JM.ProteinStructure);R(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(A(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")});n("JM");v(["JM.ProteinStructure"],"JM.Turn",["J.c.STR"],function(){c$=E(JM,"Turn",JM.ProteinStructure);R(c$,function(a,b,c){this.setupPS(a,J.c.STR.TURN,b,c);this.subtype=J.c.STR.TURN},"JM.AlphaPolymer,~N,~N")});n("JM");v(["JU.V3"],"JM.BioPolymer","java.lang.Float java.util.Hashtable JU.BS $.Lst $.P3 $.PT $.Quat JU.Escape $.Logger".split(" "),function(){c$=w(function(){this.monomers=null;this.hasStructure=!1;this.leadAtomIndices=
this.wingVectors=this.controlPoints=this.leadPoints=this.leadMidpoints=this.model=null;this.monomerCount=this.bioPolymerIndexInModel=this.type=0;this.invalidControl=this.invalidLead=!1;this.sheetSmoothing=0;this.hasWingPoints=!1;this.reversed=null;this.twistedSheets=!1;this.unitVectorX=null;this.selectedMonomerCount=0;this.bsSelectedMonomers=null;this.haveParameters=!1;y(this,arguments)},JM,"BioPolymer");X(c$,function(){this.unitVectorX=JU.V3.new3(1,0,0)});F(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");e(c$,"getRange",function(a){0!=this.monomerCount&&a.setBits(this.monomers[0].firstAtomIndex,this.monomers[this.monomerCount-1].lastAtomIndex+1)},"JU.BS");e(c$,"clearStructures",function(){});e(c$,"getLeadAtomIndices",function(){null==this.leadAtomIndices&&(this.leadAtomIndices=K(this.monomerCount,0),this.invalidLead=!0);if(this.invalidLead){for(var a=this.monomerCount;0<=--a;)this.leadAtomIndices[a]=
this.monomers[a].leadAtomIndex;this.invalidLead=!1}return this.leadAtomIndices});e(c$,"getIndex",function(a,b,c,d){var f;for(f=this.monomerCount;0<=--f;){var g=this.monomers[f];if(g.chain.chainID==a&&g.seqcode==b&&(0>c||c==g.firstAtomIndex||d==g.lastAtomIndex))break}return f},"~N,~N,~N,~N");e(c$,"getLeadPoint",function(a){return this.monomers[a].getLeadAtom()},"~N");e(c$,"getInitiatorPoint",function(){return this.monomers[0].getInitiatorAtom()});e(c$,"getTerminatorPoint",function(){return this.monomers[this.monomerCount-
1].getTerminatorAtom()});e(c$,"getLeadMidPoint",function(a,b){if(a==this.monomerCount)--a;else if(0<a){b.ave(this.getLeadPoint(a),this.getLeadPoint(a-1));return}b.setT(this.getLeadPoint(a))},"~N,JU.P3");e(c$,"getWingPoint",function(a){return this.monomers[a].getWingAtom()},"~N");e(c$,"getConformation",function(a,b){for(var c=this.model.getModelSet().at,d=this.monomerCount;0<=--d;)this.monomers[d].getConformation(c,a,b);this.recalculateLeadMidpointsAndWingVectors()},"JU.BS,~N");e(c$,"setConformation",
function(a){for(var b=this.model.getModelSet().at,c=this.monomerCount;0<=--c;)this.monomers[c].updateOffsetsForAlternativeLocations(b,a);this.recalculateLeadMidpointsAndWingVectors()},"JU.BS");e(c$,"recalculateLeadMidpointsAndWingVectors",function(){this.invalidLead=this.invalidControl=!0;this.getLeadAtomIndices();this.resetHydrogenPoints();this.calcLeadMidpointsAndWingVectors()});e(c$,"resetHydrogenPoints",function(){});e(c$,"getLeadMidpoints",function(){null==this.leadMidpoints&&this.calcLeadMidpointsAndWingVectors();
return this.leadMidpoints});e(c$,"getLeadPoints",function(){null==this.leadPoints&&this.calcLeadMidpointsAndWingVectors();return this.leadPoints});e(c$,"getControlPoints",function(a,b,c){c&&(this.invalidControl=!0);return!a?this.leadMidpoints:0==b?this.leadPoints:this.getControlPoints2(b)},"~B,~N,~B");e(c$,"getControlPoints2",function(a){if(!this.invalidControl&&a==this.sheetSmoothing)return this.controlPoints;this.getLeadPoints();var b=new JU.V3;null==this.controlPoints&&(this.controlPoints=Array(this.monomerCount+
1));Float.isNaN(a)||(this.sheetSmoothing=a);for(a=0;a<this.monomerCount;a++)this.controlPoints[a]=this.getControlPoint(a,b);this.controlPoints[this.monomerCount]=this.getTerminatorPoint();this.invalidControl=!1;return this.controlPoints},"~N");e(c$,"getControlPoint",function(a){return this.leadPoints[a]},"~N,JU.V3");e(c$,"getWingVectors",function(){null==this.leadMidpoints&&this.calcLeadMidpointsAndWingVectors();return this.wingVectors});e(c$,"calcLeadMidpointsAndWingVectors",function(){null==this.leadMidpoints&&
(this.leadMidpoints=Array(this.monomerCount+1),this.leadPoints=Array(this.monomerCount+1),this.wingVectors=Array(this.monomerCount+1),this.sheetSmoothing=1.4E-45);null==this.reversed?this.reversed=JU.BS.newN(this.monomerCount):this.reversed.clearAll();this.twistedSheets=this.model.ms.vwr.getBoolean(603979968);var a=new JU.V3,b=new JU.V3,c=new JU.V3,d=new JU.V3,f,g;this.leadMidpoints[0]=this.getInitiatorPoint();this.leadPoints[0]=g=this.getLeadPoint(0);for(var k=null,e=1;e<this.monomerCount;++e){f=
g;this.leadPoints[e]=g=this.getLeadPoint(e);var j=new JU.P3;j.ave(g,f);this.leadMidpoints[e]=j;this.hasWingPoints&&(a.sub2(g,f),b.sub2(f,this.getWingPoint(e-1)),c.cross(a,b),d.cross(a,c),d.normalize(),!this.twistedSheets&&(null!=k&&1.5707963267948966<k.angle(d))&&(this.reversed.set(e),d.scale(-1)),k=this.wingVectors[e]=JU.V3.newV(d))}this.leadPoints[this.monomerCount]=this.leadMidpoints[this.monomerCount]=this.getTerminatorPoint();if(!this.hasWingPoints)if(3>this.monomerCount)this.wingVectors[1]=
this.unitVectorX;else{d=null;for(e=1;e<this.monomerCount;++e)a.sub2(this.leadMidpoints[e],this.leadPoints[e]),b.sub2(this.leadPoints[e],this.leadMidpoints[e+1]),c.cross(a,b),c.normalize(),null!=d&&1.5707963267948966<d.angle(c)&&c.scale(-1),d=this.wingVectors[e]=JU.V3.newV(c)}this.wingVectors[0]=this.wingVectors[1];this.wingVectors[this.monomerCount]=this.wingVectors[this.monomerCount-1]});e(c$,"findNearestAtomIndex",function(a,b,c,d,f,g){for(var k=this.monomerCount;0<=--k;)if(0!=(this.monomers[k].shapeVisibilityFlags&
f)){var e=this.monomers[k].getLeadAtom();e.checkVisible()&&!(null!=g&&g.get(e.i))&&(0<d[k]||0<d[k+1])&&this.monomers[k].findNearestAtomIndex(a,b,c,d[k],d[k+1])}},"~N,~N,~A,~A,~N,JU.BS");e(c$,"getSelectedMonomerCount",function(){return this.selectedMonomerCount});e(c$,"calcSelectedMonomersCount",function(a){this.selectedMonomerCount=0;null==this.bsSelectedMonomers&&(this.bsSelectedMonomers=new JU.BS);this.bsSelectedMonomers.clearAll();for(var b=0;b<this.monomerCount;b++)this.monomers[b].isSelected(a)&&
(++this.selectedMonomerCount,this.bsSelectedMonomers.set(b))},"JU.BS");e(c$,"isMonomerSelected",function(a){return 0<=a&&this.bsSelectedMonomers.get(a)},"~N");e(c$,"getPolymerPointsAndVectors",function(a,b,c,d,f){d=this.getControlPoints(d,f,!1);f=this.getWingVectors();for(var g=this.monomerCount,k=0;k<g;k++)b.get(this.monomers[k].leadAtomIndex)?(c.addLast([d[k],JU.P3.newP(f[k])]),a=k):2147483646!=a&&(c.addLast([d[k],JU.P3.newP(f[k])]),a=2147483646);a+1<g&&c.addLast([d[a+1],JU.P3.newP(f[a+1])]);return a},
"~N,JU.BS,JU.Lst,~B,~N");e(c$,"getSequence",function(){for(var a=Z(this.monomerCount,"\x00"),b=0;b<this.monomerCount;b++)a[b]=this.monomers[b].getGroup1();return String.valueOf(a)});e(c$,"getPolymerInfo",function(a){for(var b=new java.util.Hashtable,c=new JU.Lst,d=null,f,g=null,k=0,e=new JU.P3,j=0;j<this.monomerCount;j++)if(a.get(this.monomers[j].leadAtomIndex)){var l=this.monomers[j].getMyInfo(e);l.put("monomerIndex",Integer.$valueOf(j));c.addLast(l);if(null!=(f=this.getProteinStructure(j))&&f!==
g)l=new java.util.Hashtable,(g=f).getInfo(l),null==d&&(d=new JU.Lst),l.put("index",Integer.$valueOf(k++)),d.addLast(l)}0<c.size()&&(b.put("sequence",this.getSequence()),b.put("monomers",c),null!=d&&b.put("structures",d));return b},"JU.BS");e(c$,"getPolymerSequenceAtoms",function(a,b,c,d){for(b=Math.min(this.monomerCount,a+b);--b>=a;)this.monomers[b].getMonomerSequenceAtoms(c,d)},"~N,~N,JU.BS,JU.BS");e(c$,"getProteinStructure",function(){return null},"~N");e(c$,"calcParameters",function(){this.haveParameters=
!0;return this.calcEtaThetaAngles()||this.calcPhiPsiAngles()});e(c$,"calcEtaThetaAngles",function(){return!1});e(c$,"calcPhiPsiAngles",function(){return!1});e(c$,"getPdbData",function(a,b,c,d,f,g,k,e,j,l,h,p,s,t,n){var r="C"==c||"P"==c,q="R"==b||"S"==b&&r;if(!q||this.calcPhiPsiAngles()){var v=1==this.type,x="r"==b,u=!q&&"S"==b;2==f&&x&&(b="w");u&&(f=2);var y="S"==b,w=0<="rcpCP".indexOf(c);JU.Logger.debugging&&(u||r)&&JU.Logger.debug("For straightness calculation: useQuaternionStraightness = "+y+" and quaternionFrame = "+
c);if(l&&!j){p.append("REMARK   6    AT GRP CH RESNO  ");switch(b){default:case "w":p.append("x*10___ y*10___ z*10___      w*10__       ");break;case "x":p.append("y*10___ z*10___ w*10___      x*10__       ");break;case "y":p.append("z*10___ w*10___ x*10___      y*10__       ");break;case "z":p.append("w*10___ x*10___ y*10___      z*10__       ");break;case "R":w?p.append("phi____ psi____ theta         Straightness"):p.append("phi____ psi____ omega-180    PartialCharge")}p.append("    Sym   q0_______ q1_______ q2_______ q3_______");
p.append("  theta_  aaX_______ aaY_______ aaZ_______");"R"!=b&&p.append("  centerX___ centerY___ centerZ___");"n"==c&&p.append("  NHX_______ NHY_______ NHZ_______");p.append("\n\n")}l="R"==b?1:10;e=!1;for(var A=0;A<(e?2:1);A++,l*=-1)for(var z=0;z<(1>d?1:d);z++)this.getData(a,z,d,this,b,c,f,g,k,j,q,r,y,w,u,l,v,x,h,p,s,t,n)}},"JV.Viewer,~S,~S,~N,~N,JU.BS,JU.BS,~B,~B,~B,~A,JU.OC,JU.SB,JU.BS,JU.P3");e(c$,"getData",function(a,b,c,d,f,g,k,e,j,l,h,p,s,t,n,r,q,v,x,u,y,w,A){if(this.hasStructure){n=0<k?"dq"+
(2==k?"2":""):"q";for(var z,I=null,F=null,M=null,E=null,K=null,L=null,O=M=0,C=0,V=0,B="",P=NaN,Q=NaN,H=l?new JU.P3:null,S=1>=c?1:c;b<d.monomerCount;b+=S){var G=d.monomers[b];if(null==e||e.get(G.leadAtomIndex)){var N=G.getLeadAtom(),B=G.getUniqueID();if(h){"S"==f&&G.setGroupParameter(1112539150,NaN);M=G.getGroupParameter(1112539145);O=G.getGroupParameter(1112539146);C=G.getGroupParameter(1112539144);-90>C&&(C+=360);C-=180;if(Float.isNaN(M)||Float.isNaN(O)||Float.isNaN(C)){null!=e&&e.clear(N.i);continue}var T=
t?d.calculateRamachandranHelixAngle(b,g):0,R=p||t?JM.BioPolymer.getStraightness(Math.cos(3.141592653589793*(T/2/180))):0;if("S"==f){G.setGroupParameter(1112539150,R);continue}if(l){if(null!=j&&!j.get(N.getIndex()))continue;H.set(-M,M,0.5);u.append('draw ID "phi').append(B).append('" ARROW ARC ').append(JU.Escape.eP(G.getNitrogenAtom())).append(JU.Escape.eP(N)).append(JU.Escape.eP(G.getCarbonylCarbonAtom())).append(JU.Escape.eP(H)).append(' "phi = ').append(String.valueOf(Math.round(M))).append('" color ').append(JM.BioPolymer.qColor[2]).append("\n");
H.set(0,O,0.5);u.append('draw ID "psi').append(B).append('" ARROW ARC ').append(JU.Escape.eP(N)).append(JU.Escape.eP(G.getCarbonylCarbonAtom())).append(JU.Escape.eP(G.getNitrogenAtom())).append(JU.Escape.eP(H)).append(' "psi = ').append(String.valueOf(Math.round(O))).append('" color ').append(JM.BioPolymer.qColor[1]).append("\n");u.append('draw ID "planeNCC').append(B).append('" ').append(JU.Escape.eP(G.getNitrogenAtom())).append(JU.Escape.eP(N)).append(JU.Escape.eP(G.getCarbonylCarbonAtom())).append(" color ").append(JM.BioPolymer.qColor[0]).append("\n");
u.append('draw ID "planeCNC').append(B).append('" ').append(JU.Escape.eP(d.monomers[b-1].getCarbonylCarbonAtom())).append(JU.Escape.eP(G.getNitrogenAtom())).append(JU.Escape.eP(N)).append(" color ").append(JM.BioPolymer.qColor[1]).append("\n");u.append('draw ID "planeCCN').append(B).append('" ').append(JU.Escape.eP(N)).append(JU.Escape.eP(G.getCarbonylCarbonAtom())).append(JU.Escape.eP(d.monomers[b+1].getNitrogenAtom())).append(" color ").append(JM.BioPolymer.qColor[2]).append("\n");continue}if(Float.isNaN(T)){if(B=
"",t)continue}else z=JU.Quat.newVA(JU.P3.new3(1,0,0),T),B=JM.BioPolymer.getQInfo(z),t?(C=T,V=R):V=N.getPartialCharge()}else{z=G.getQuaternion(g);null!=z&&(z.setRef(K),K=JU.Quat.newQ(z));2==k&&G.setGroupParameter(1112539150,NaN);null==z?K=F=null:0<k&&(O=N,C=z,null==F?E=z=null:(M=v?F.leftDifference(z):z.rightDifference(F),1==k?z=M:null==E?z=null:(z=M.rightDifference(E),P=JM.BioPolymer.getQuaternionStraightness(B,E,M),Q=JM.BioPolymer.get3DStraightness(B,E,M),I.group.setGroupParameter(1112539150,s?P:
Q)),E=M),I=O,F=C);if(null==z){L=null;continue}switch(f){default:M=z.q1;O=z.q2;C=z.q3;V=z.q0;break;case "x":M=z.q0;O=z.q1;C=z.q2;V=z.q3;break;case "y":M=z.q3;O=z.q0;C=z.q1;V=z.q2;break;case "z":M=z.q2,O=z.q3,C=z.q0,V=z.q1}T=G.getQuaternionFrameCenter(g);null==T&&(T=new JU.P3);if(l){if(null!=j&&!j.get(N.getIndex()))continue;N=D(Math.floor(360*Math.acos(V)/3.141592653589793));0==k&&(u.append(JU.Escape.drawQuat(z,n,B,T,1)),"n"==g&&q&&(z=G.getNitrogenHydrogenPoint(),null!=z&&u.append('draw ID "').append(n).append("nh").append(B).append('" width 0.1 ').append(JU.Escape.eP(z)).append("\n")));
if(1==k){u.append(G.getHelixData(135176,g,c)).append("\n");continue}H.set(2*M,2*O,2*C);u.append('draw ID "').append(n).append("a").append(B).append('" VECTOR ').append(JU.Escape.eP(T)).append(JU.Escape.eP(H)).append(' ">').append(String.valueOf(N)).append('" color ').append(JM.BioPolymer.qColor[k]).append("\n");continue}B=JM.BioPolymer.getQInfo(z)+JU.PT.sprintf("  %10.5p %10.5p %10.5p","p",[T]);"n"==g&&q?B+=JU.PT.sprintf("  %10.5p %10.5p %10.5p","p",[G.getNitrogenHydrogenPoint()]):2==k&&!Float.isNaN(P)&&
(B+=JU.PT.sprintf(" %10.5f %10.5f","F",[[P,Q]]))}null!=u&&(w.set(N.group.leadAtomIndex),u.append(a.ms.getLabeler().formatLabelAtomArray(a,N,x,"\x00",null,A)),u.append(JU.PT.sprintf("%8.2f%8.2f%8.2f      %6.3f          %2s    %s\n","ssF",[N.getElementSymbolIso(!1).toUpperCase(),B,[M*r,O*r,C*r,V*r]])),null!=L&&L.getPolymerIndexInModel()==N.getPolymerIndexInModel()&&y.append("CONECT").append(JU.PT.formatStringI("%5i","i",L.getAtomNumber())).append(JU.PT.formatStringI("%5i","i",N.getAtomNumber())).appendC("\n"),
L=N)}}}},"JV.Viewer,~N,~N,JM.BioPolymer,~S,~S,~N,JU.BS,JU.BS,~B,~B,~B,~B,~B,~B,~N,~B,~B,~A,JU.OC,JU.SB,JU.BS,JU.P3");e(c$,"drawQuat",function(a,b,c,d,f){d=" VECTOR "+JU.Escape.eP(d)+" ";0==f&&(f=1);return"draw "+b+"x"+c+d+JU.Escape.eP(a.getVectorScaled(0,f))+" color red\ndraw "+b+"y"+c+d+JU.Escape.eP(a.getVectorScaled(1,f))+" color green\ndraw "+b+"z"+c+d+JU.Escape.eP(a.getVectorScaled(2,f))+" color blue\n"},"JU.Quat,~S,~S,JU.P3,~N");c$.getQInfo=e(c$,"getQInfo",function(a){var b=a.toAxisAngle4f();
return JU.PT.sprintf("%10.6f%10.6f%10.6f%10.6f  %6.2f  %10.5f %10.5f %10.5f","F",[[a.q0,a.q1,a.q2,a.q3,180*b.angle/3.141592653589793,b.x,b.y,b.z]])},"JU.Quat");e(c$,"calculateRamachandranHelixAngle",function(){return NaN},"~N,~S");c$.get3DStraightness=e(c$,"get3DStraightness",function(a,b,c){return b.getNormal().dot(c.getNormal())},"~S,JU.Quat,JU.Quat");c$.getQuaternionStraightness=e(c$,"getQuaternionStraightness",function(a,b,c){return JM.BioPolymer.getStraightness(b.dot(c))},"~S,JU.Quat,JU.Quat");
c$.getStraightness=e(c$,"getStraightness",function(a){return 1-2*Math.acos(Math.abs(a))/3.141592653589793},"~N");e(c$,"isRna",function(){return 0<this.monomerCount&&this.monomers[0].isRna()});e(c$,"isNucleic",function(){return 0<this.monomerCount&&(this.monomers[0].isDna()||this.monomers[0].isRna())});e(c$,"getRangeGroups",function(a,b,c){for(var d=new JU.BS,f=0;f<this.monomerCount;f++)this.monomers[f].isSelected(b)&&(d.setBits(Math.max(0,f-a),f+a+1),f+=a-1);for(f=d.nextSetBit(0);0<=f&&f<this.monomerCount;f=
d.nextSetBit(f+1))this.monomers[f].selectAtoms(c)},"~N,JU.BS,JU.BS");e(c$,"calcRasmolHydrogenBonds",function(){},"JM.BioPolymer,JU.BS,JU.BS,JU.Lst,~N,~A,~B,~B");e(c$,"setStructureList",function(){},"java.util.Map");e(c$,"getType",function(){return this.type});e(c$,"calculateStruts",function(){return null},"JM.ModelSet,JU.BS,JU.BS,JU.Lst,~N,~N,~B");I(c$,"TYPE_NOBONDING",0,"TYPE_AMINO",1,"TYPE_NUCLEIC",2,"TYPE_CARBOHYDRATE",3,"qColor",["yellow","orange","purple"])});n("JM");v(["java.lang.Enum","JM.BioPolymer"],
"JM.AlphaPolymer","JU.BS $.Lst $.Measure $.P3 J.c.STR JM.Helix $.Sheet $.Turn JU.Logger".split(" "),function(){c$=E(JM,"AlphaPolymer",JM.BioPolymer);F(c$,function(a){S(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,l,h){var p=-1,s=-1;if(j<l){if(this.monomers[0].firstAtomIndex>l||this.monomers[this.monomerCount-1].lastAtomIndex<j)return;p=j;s=l}var t;if(!(-1==(f=this.getIndex(f,g,p,s))||-1==(t=this.getIndex(k,e,p,s)))){if(0<=j&&null!=h&&(k=h.nextSetBit(this.monomers[f].firstAtomIndex),0<=k&&k<this.monomers[t].lastAtomIndex))return;this.addStructureProtected(a,b,c,d,f,t)&&0<=j&&h.setBits(j,l+1)}},"J.c.STR,~S,~N,~N,~N,~N,~N,~N,~N,~N,JU.BS");
e(c$,"addStructureProtected",function(a,b,c,d,f,g){if(g<f)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)});h(c$,"calculateStruts",function(a,b,c,d,f,g,e){return this.calculateStrutsStatic(a,b,c,d,f,g,e)},"JM.ModelSet,JU.BS,JU.BS,JU.Lst,~N,~N,~B");e(c$,"calculateStrutsStatic",function(a,b,c,d,f,g,e){var h=new JU.Lst,j=f*f,l=d.size(),m=new JU.BS,p=new JU.BS,s=new JU.BS,t=d.get(0),n;a=a.getBioPolymerCountInModel(t.mi);
for(var r=K(a,6,0),q=0;q<l;q++){var t=d.get(q),v=t.getPolymerIndexInModel(),x=t.getMonomerIndex(),u=x;3>u&&(r[v][u]=q+1);u=t.group.getBioPolymerLength()-x-1;3>u&&(r[v][3+u]=q+1)}v=Q(D(l*(l-1)/2),0);for(q=0;q<l;q++){t=d.get(q);for(x=q+1;x<l;x++){u=JM.AlphaPolymer.strutPoint(q,x,l);n=d.get(x);var y=t.getResno(),w=t.getPolymerIndexInModel(),A=n.getResno(),z=n.getPolymerIndexInModel();w==z&&Math.abs(A-y)<g&&s.set(u);(v[u]=t.distanceSquared(n))>=j&&p.set(u)}}for(t=5;0<=--t;){j=(f-t)*(f-t);for(q=0;q<l;q++)if(e||
!m.get(q))for(x=q+1;x<l;x++)u=JM.AlphaPolymer.strutPoint(q,x,l),!p.get(u)&&(!s.get(u)&&(e||!m.get(x))&&v[u]<=j)&&JM.AlphaPolymer.setStrut(q,x,l,d,b,c,h,m,p,s,g)}for(f=0;f<a;f++){for(e=0;6>e;e++)if(q=r[f][e]-1,0<=q&&m.get(q))for(x=0;3>x;x++)u=3*D(e/3)+x,0<=(q=r[f][u]-1)&&m.set(q),r[f][u]=-1;if(!(-1==r[f][0]&&-1==r[f][3])){for(var t=j=!1,A=w=y=n=0,E=z=3.4028235E38,x=0;x<l;x++)for(e=0;6>e;e++)if(q=r[f][e]-1,-2==q)e=3*(D(e/3)+1)-1;else if(!(x==q||-1==q))if(u=JM.AlphaPolymer.strutPoint(q,x,l),!(s.get(u)||
v[u]>(3>e?z:E)))3>e?(p.get(u)&&(j=!0),y=x,n=q,z=v[u]):(p.get(u)&&(t=!0),A=x,w=q,E=v[u]);j&&JM.AlphaPolymer.setStrut(n,y,l,d,b,c,h,m,p,s,g);t&&JM.AlphaPolymer.setStrut(w,A,l,d,b,c,h,m,p,s,g)}}return h},"JM.ModelSet,JU.BS,JU.BS,JU.Lst,~N,~N,~B");c$.strutPoint=e(c$,"strutPoint",function(a,b,c){return b<a?D(b*(2*c-b-1)/2)+a-b-1:D(a*(2*c-a-1)/2)+b-a-1},"~N,~N,~N");c$.setStrut=e(c$,"setStrut",function(a,b,c,d,f,g,e,h,j,l,m){var p=d.get(a);d=d.get(b);if(f.get(p.i)&&g.get(d.i)){e.addLast([p,d]);h.set(a);
h.set(b);for(f=Math.max(0,a-m);f<=a+m&&f<c;f++)for(g=Math.max(0,b-m);g<=b+m&&g<c;g++)f!=g&&(e=JM.AlphaPolymer.strutPoint(f,g,c),l.get(e)||j.set(e))}},"~N,~N,~N,JU.Lst,JU.BS,JU.BS,JU.Lst,JU.BS,JU.BS,JU.BS,~N");e(c$,"calculateStructures",function(){if(!(4>this.monomerCount)){var a=this.calculateAnglesInDegrees(),b=this.calculateCodes(a);this.checkBetaSheetAlphaHelixOverlap(b,a);var c=this.calculateRunsFourOrMore(b);this.extendRuns(c);this.searchForTurns(b,a,c);this.addStructuresFromTags(c)}},"~B");
e(c$,"calculateAnglesInDegrees",function(){for(var a=Q(this.monomerCount,0),b=this.monomerCount-1;2<=--b;)a[b]=JU.Measure.computeTorsion(this.monomers[b-2].getLeadAtom(),this.monomers[b-1].getLeadAtom(),this.monomers[b].getLeadAtom(),this.monomers[b+1].getLeadAtom(),!0);return a});e(c$,"calculateCodes",function(a){for(var b=Array(this.monomerCount),c=this.monomerCount-1;2<=--c;){var d=a[c];b[c]=10<=d&&120>d?JM.AlphaPolymer.Code.RIGHT_HELIX:120<=d||-90>d?JM.AlphaPolymer.Code.BETA_SHEET:-90<=d&&0>d?
JM.AlphaPolymer.Code.LEFT_HELIX:JM.AlphaPolymer.Code.NADA}return b},"~A");e(c$,"checkBetaSheetAlphaHelixOverlap",function(a,b){for(var c=this.monomerCount-2;2<=--c;)a[c]===JM.AlphaPolymer.Code.BETA_SHEET&&(140>=b[c]&&a[c-2]===JM.AlphaPolymer.Code.RIGHT_HELIX&&a[c-1]===JM.AlphaPolymer.Code.RIGHT_HELIX&&a[c+1]===JM.AlphaPolymer.Code.RIGHT_HELIX&&a[c+2]===JM.AlphaPolymer.Code.RIGHT_HELIX)&&(a[c]=JM.AlphaPolymer.Code.RIGHT_HELIX)},"~A,~A");e(c$,"calculateRunsFourOrMore",function(a){for(var b=Array(this.monomerCount),
c=J.c.STR.NONE,d=JM.AlphaPolymer.Code.NADA,f=0,g=0;g<this.monomerCount;++g)if(a[g]===d&&d!==JM.AlphaPolymer.Code.NADA&&d!==JM.AlphaPolymer.Code.BETA_SHEET)if(++f,4==f)for(var c=d===JM.AlphaPolymer.Code.BETA_SHEET?J.c.STR.SHEET:J.c.STR.HELIX,e=4;0<=--e;)b[g-e]=c;else 4<f&&(b[g]=c);else f=1,d=a[g];return b},"~A");e(c$,"extendRuns",function(a){for(var b=1;b<this.monomerCount-4;++b)a[b]===J.c.STR.NONE&&a[b+1]!==J.c.STR.NONE&&(a[b]=a[b+1]);a[0]=a[1];a[this.monomerCount-1]=a[this.monomerCount-2]},"~A");
e(c$,"searchForTurns",function(a,b,c){for(var d=this.monomerCount-1;2<=--d;)if(a[d]=JM.AlphaPolymer.Code.NADA,null==c[d]||c[d]===J.c.STR.NONE){var f=b[d];-90<=f&&0>f?a[d]=JM.AlphaPolymer.Code.LEFT_TURN:0<=f&&90>f&&(a[d]=JM.AlphaPolymer.Code.RIGHT_TURN)}for(d=this.monomerCount-1;0<=--d;)a[d]!==JM.AlphaPolymer.Code.NADA&&(a[d+1]===a[d]&&c[d]===J.c.STR.NONE)&&(c[d]=J.c.STR.TURN)},"~A,~A,~A");e(c$,"addStructuresFromTags",function(a){for(var b=0;b<this.monomerCount;){var c=a[b];if(null==c||c===J.c.STR.NONE)++b;
else{var d;for(d=b+1;d<this.monomerCount&&a[d]===c;++d);this.addStructureProtected(c,null,0,0,b,d-1);b=d}}},"~A");ea(self.c$);c$=E(JM.AlphaPolymer,"Code",Enum);W(c$,"NADA",0,[]);W(c$,"RIGHT_HELIX",1,[]);W(c$,"BETA_SHEET",2,[]);W(c$,"LEFT_HELIX",3,[]);W(c$,"LEFT_TURN",4,[]);W(c$,"RIGHT_TURN",5,[]);c$=da()});n("JM");v(["JM.AlphaMonomer"],"JM.AminoMonomer","JU.A4 $.BS $.M3 $.P3 $.PT $.Quat $.V3 J.c.STR JU.Escape $.Logger".split(" "),function(){c$=w(function(){this.nhChecked=!1;this.ptTemp=null;y(this,
arguments)},JM,"AminoMonomer",JM.AlphaMonomer);R(c$,function(){});c$.validateAndAllocate=e(c$,"validateAndAllocate",function(a,b,c,d,f,g,e){var h=JM.Monomer.scanForOffsets(d,g,JM.AminoMonomer.interestingAminoAtomIDs);if(null==h)return null;JM.Monomer.checkOptional(h,1,d,g[5]);return e[d].isHetero()&&!JM.AminoMonomer.isBondedCorrectly(d,h,e)?null:(new JM.AminoMonomer).set2(a,b,c,d,f,h)},"JM.Chain,~S,~N,~N,~N,~A,~A");c$.isBondedCorrectlyRange=e(c$,"isBondedCorrectlyRange",function(a,b,c,d,f){a=c+(d[a]&
255);b=c+(d[b]&255);return a!=b&&f[a].isBonded(f[b])},"~N,~N,~N,~A,~A");c$.isBondedCorrectly=e(c$,"isBondedCorrectly",function(a,b,c){return JM.AminoMonomer.isBondedCorrectlyRange(2,0,a,b,c)&&JM.AminoMonomer.isBondedCorrectlyRange(0,3,a,b,c)&&(!JM.Monomer.have(b,1)||JM.AminoMonomer.isBondedCorrectlyRange(3,1,a,b,c))},"~N,~A,~A");e(c$,"isAminoMonomer",function(){return!0});h(c$,"getNitrogenAtom",function(){return this.getAtomFromOffsetIndex(2)});e(c$,"getCarbonylCarbonAtom",function(){return this.getAtomFromOffsetIndex(3)});
h(c$,"getCarbonylOxygenAtom",function(){return this.getWingAtom()});h(c$,"getInitiatorAtom",function(){return this.getNitrogenAtom()});h(c$,"getTerminatorAtom",function(){return this.getAtomFromOffsetIndex(JM.Monomer.have(this.offsets,4)?4:3)});e(c$,"hasOAtom",function(){return JM.Monomer.have(this.offsets,1)});h(c$,"isConnectedAfter",function(a){return null==a?!0:a.getCarbonylCarbonAtom().isBonded(this.getNitrogenAtom())},"JM.Monomer");h(c$,"findNearestAtomIndex",function(a,b,c,d,f){var g=c[0],e=
this.getNitrogenAtom();d=D(d/2);1200>d&&(d=1200);if(0!=e.sZ){d=L(this.scaleToScreen(e.sZ,d));4>d&&(d=4);var h=this.getCarbonylCarbonAtom();f=D(f/2);1200>f&&(f=1200);f=L(this.scaleToScreen(e.sZ,f));4>f&&(f=4);var j=this.getLeadAtom();if(this.isCursorOnTopOf(j,a,b,D((d+f)/2),g)||this.isCursorOnTopOf(e,a,b,d,g)||this.isCursorOnTopOf(h,a,b,f,g))c[0]=j}},"~N,~N,~A,~N,~N");e(c$,"resetHydrogenPoint",function(){this.nhChecked=!1;this.nitrogenHydrogenPoint=null});e(c$,"getNitrogenHydrogenPoint",function(){null==
this.nitrogenHydrogenPoint&&!this.nhChecked&&(this.nhChecked=!0,this.nitrogenHydrogenPoint=this.getExplicitNH());return this.nitrogenHydrogenPoint});e(c$,"getExplicitNH",function(){var a=this.getNitrogenAtom(),b=null,c=a.bonds;if(null==c)return null;for(var d=0;d<c.length;d++)if(1==(b=c[d].getOtherAtom(a)).getElementNumber())return b;return null});e(c$,"getNHPoint",function(a,b,c,d){if(0==this.monomerIndex||15==this.groupID)return!1;var f=this.getNitrogenAtom(),g=this.getNitrogenHydrogenPoint();if(null!=
g&&!d)return b.sub2(g,f),a.setT(g),!0;d=this.bioPolymer.monomers[this.monomerIndex-1];if(c)b.sub2(f,this.getLeadAtom()),b.normalize(),c=JU.V3.newVsub(f,d.getCarbonylCarbonAtom()),c.normalize(),b.add(c);else{c=d.getCarbonylOxygenAtom();if(null==c)return!1;b.sub2(d.getCarbonylCarbonAtom(),c)}b.normalize();a.add2(f,b);this.nitrogenHydrogenPoint=JU.P3.newP(a);JU.Logger.debugging&&JU.Logger.debug('draw ID "pta'+this.monomerIndex+"_"+f.i+'" '+JU.Escape.eP(f)+JU.Escape.eP(a)+" # "+f);return!0},"JU.P3,JU.V3,~B,~B");
h(c$,"getQuaternionFrameCenter",function(a){switch(a){default:case "a":case "b":case "c":case "C":return this.getQuaternionFrameCenterAlpha(a);case "n":return this.getNitrogenAtom();case "p":case "P":return this.getCarbonylCarbonAtom();case "q":if(this.monomerIndex==this.bioPolymer.monomerCount-1)return null;a=this.bioPolymer.monomers[this.monomerIndex+1];var b=new JU.P3;b.ave(this.getCarbonylCarbonAtom(),a.getNitrogenAtom());return b}},"~S");h(c$,"getQuaternion",function(a){var b=this.getCarbonylCarbonAtom(),
c=this.getLeadAtom(),d=new JU.V3,f=new JU.V3,g=null;switch(a){case "a":case "n":if(0==this.monomerIndex||15==this.groupID)return null;g=new JU.V3;null==this.ptTemp&&(this.ptTemp=new JU.P3);this.getNHPoint(this.ptTemp,g,!0,!1);f.sub2(c,this.getNitrogenAtom());f.cross(g,f);(new JU.M3).setAA(JU.A4.newVA(f,-0.29670596)).rotate(g);d.cross(f,g);break;case "b":return this.getQuaternionAlpha("b");case "c":d.sub2(b,c);f.sub2(this.getNitrogenAtom(),c);break;case "p":case "x":if(this.monomerIndex==this.bioPolymer.monomerCount-
1)return null;d.sub2(c,b);f.sub2(this.bioPolymer.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.selectAtoms(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");I(c$,"CA",0,"O",1,"N",2,"C",3,"OT",4,"interestingAminoAtomIDs",[2,-5,1,3,-65],"beta",0.29670597283903605)});n("JM");v(["JM.AlphaPolymer"],"JM.AminoPolymer","JU.Measure $.P3 $.V3 J.c.STR JM.HBond JU.Logger".split(" "),
function(){c$=w(function(){this.structureList=null;y(this,arguments)},JM,"AminoPolymer",JM.AlphaPolymer);F(c$,function(a){S(this,JM.AminoPolymer,[a]);this.type=1;for(var b=0;b<this.monomerCount;++b)if(!a[b].hasOAtom())return;this.hasWingPoints=!0},"~A");h(c$,"resetHydrogenPoints",function(){for(var a,b=null,c=0;c<this.monomerCount;c++){if(null!=(a=this.getProteinStructure(c))&&a!==b)(b=a).resetAxes();this.monomers[c].resetHydrogenPoint()}});h(c$,"calcPhiPsiAngles",function(){for(var a=0;a<this.monomerCount-
1;++a)this.calcPhiPsiAngles2(this.monomers[a],this.monomers[a+1]);return!0});e(c$,"calcPhiPsiAngles2",function(a,b){var c=a.getNitrogenAtom(),d=a.getLeadAtom(),f=a.getCarbonylCarbonAtom(),g=b.getNitrogenAtom(),e=b.getLeadAtom(),h=b.getCarbonylCarbonAtom();b.setGroupParameter(1112539145,JU.Measure.computeTorsion(f,g,e,h,!0));a.setGroupParameter(1112539146,JU.Measure.computeTorsion(c,d,f,g,!0));a.setGroupParameter(1112539144,JU.Measure.computeTorsion(d,f,g,e,!0))},"JM.AminoMonomer,JM.AminoMonomer");
h(c$,"calculateRamachandranHelixAngle",function(a,b){var c=0==a?NaN:this.monomers[a-1].getGroupParameter(1112539146),d=this.monomers[a].getGroupParameter(1112539146),f=this.monomers[a].getGroupParameter(1112539145),g=a==this.monomerCount-1?NaN:this.monomers[a+1].getGroupParameter(1112539145),e=a==this.monomerCount-1?NaN:this.monomers[a+1].getGroupParameter(1112539146);switch(b){default:case "p":case "r":case "P":return c=3.141592653589793*((g-f)/2)/180,d=3.141592653589793*((e-d)/2)/180,114.59155902616465*
Math.acos(Math.cos(d)*Math.cos(c)-Math.sin(d)*Math.sin(c)/3);case "c":case "C":return d-c+g-f}},"~N,~S");h(c$,"calcRasmolHydrogenBonds",function(a,b,c,d,f,g,e,h){null==a&&(a=this);if(A(a,JM.AminoPolymer)){f=new JU.P3;for(var j=new JU.V3,l,m=null==g?K(2,3,0):null,p=1;p<this.monomerCount;++p)if(null==g?(m[0][0]=m[1][0]=this.bioPolymerIndexInModel,m[0][1]=m[1][1]=-2147483648,m[0][2]=m[1][2]=0):m=g[p],(l=this.monomers[p]).getNHPoint(f,j,e,h)){var s=null==b||b.get(l.getNitrogenAtom().i);if(s&&(e||null!=
l.getCarbonylOxygenAtom()))this.checkRasmolHydrogenBond(l,a,p,f,s?c:b,d,m,e)}}},"JM.BioPolymer,JU.BS,JU.BS,JU.Lst,~N,~A,~B,~B");e(c$,"checkRasmolHydrogenBond",function(a,b,c,d,f,g,e,h){var j=a.getLeadAtom(),l=a.getNitrogenAtom();a=a.getNitrogenAtom();for(var m,p=b.monomerCount;0<=--p;)if(!(b===this&&(p==c||p+1==c))){m=b.monomers[p];var s=m.getCarbonylOxygenAtom();if(!(null==s||null!=f&&!f.get(s.i)))if(s=m.getLeadAtom(),!(81<=j.distanceSquared(s))){s=this.calcHbondEnergy(l,d,m,h);if(s<e[0][2])m=e[1],
e[1]=e[0],e[0]=m;else if(s<e[1][2])m=e[1];else continue;m[0]=b.bioPolymerIndexInModel;m[1]=-500>s?p:-1-p;m[2]=s}}if(null!=g)for(p=0;2>p;p++)0<=e[p][1]&&this.addResidueHydrogenBond(a,b.monomers[e[p][1]].getCarbonylOxygenAtom(),b===this?c:-99,e[p][1],e[p][2]/1E3,g)},"JM.AminoMonomer,JM.BioPolymer,~N,JU.P3,JU.BS,JU.Lst,~A,~B");e(c$,"calcHbondEnergy",function(a,b,c,d){var f=c.getCarbonylOxygenAtom();if(null==f)return 0;var g=f.distanceSquared(a);if(0.25>g)return 0;f=f.distanceSquared(b);if(0.25>f)return 0;
c=c.getCarbonylCarbonAtom();b=c.distanceSquared(b);if(0.25>b)return 0;c=c.distanceSquared(a);if(0.25>c)return 0;a=Math.sqrt(f);f=Math.sqrt(b);b=Math.sqrt(c);g=Math.sqrt(g);g=JM.HBond.getEnergy(a,f,b,g);return!(-500>g&&(!d||b>f&&3>=a))&&d||-9900>g?0:g},"JU.P3,JU.P3,JM.AminoMonomer,~B");e(c$,"addResidueHydrogenBond",function(a,b,c,d,f,g){switch(c-d){case 2:c=6144;break;case 3:c=8192;break;case 4:c=10240;break;case 5:c=12288;break;case -3:c=14336;break;case -4:c=16384;break;default:c=4096}g.addLast(new JM.HBond(a,
b,c,1,0,f))},"JM.Atom,JM.Atom,~N,~N,~N,JU.Lst");h(c$,"calculateStructures",function(a){if(!a){null==this.structureList&&(this.structureList=this.model.getModelSet().getStructureList());a=Z(this.monomerCount,"\x00");for(var b=0;b<this.monomerCount-1;++b){var c=this.monomers[b],d=this.monomers[b+1],f=d.getGroupParameter(1112539145),g=c.getGroupParameter(1112539146);a[b]=this.isHelix(g,f)?0>f&&25>g?"4":"3":this.isSheet(g,f)?"s":this.isTurn(g,f)?"t":"n";JU.Logger.debugging&&JU.Logger.debug(0+this.monomers[0].chain.chainID+
" aminopolymer:"+b+" "+d.getGroupParameter(1112539145)+","+c.getGroupParameter(1112539146)+" "+a[b])}for(b=0;b<this.monomerCount;++b)if("4"==a[b]){for(c=b+1;c<this.monomerCount&&"4"==a[c];++c);c--;c>=b+3&&this.addStructureProtected(J.c.STR.HELIX,null,0,0,b,c);b=c}for(b=0;b<this.monomerCount;++b)if("3"==a[b]){for(c=b+1;c<this.monomerCount&&"3"==a[c];++c);c--;c>=b+3&&this.addStructureProtected(J.c.STR.HELIX,null,0,0,b,c);b=c}for(b=0;b<this.monomerCount;++b)if("s"==a[b]){for(c=b+1;c<this.monomerCount&&
"s"==a[c];++c);c--;c>=b+2&&this.addStructureProtected(J.c.STR.SHEET,null,0,0,b,c);b=c}for(b=0;b<this.monomerCount;++b)if("t"==a[b]){for(c=b+1;c<this.monomerCount&&"t"==a[c];++c);c--;c>=b+2&&this.addStructureProtected(J.c.STR.TURN,null,0,0,b,c);b=c}}},"~B");e(c$,"isTurn",function(a,b){return JM.AminoPolymer.checkPhiPsi(this.structureList.get(J.c.STR.TURN),a,b)},"~N,~N");e(c$,"isSheet",function(a,b){return JM.AminoPolymer.checkPhiPsi(this.structureList.get(J.c.STR.SHEET),a,b)},"~N,~N");e(c$,"isHelix",
function(a,b){return JM.AminoPolymer.checkPhiPsi(this.structureList.get(J.c.STR.HELIX),a,b)},"~N,~N");c$.checkPhiPsi=e(c$,"checkPhiPsi",function(a,b,c){for(var d=0;d<a.length;d+=4)if(c>=a[d]&&c<=a[d+1]&&b>=a[d+2]&&b<=a[d+3])return!0;return!1},"~A,~N,~N");h(c$,"setStructureList",function(a){this.structureList=a},"java.util.Map");I(c$,"maxHbondAlphaDistance",9,"maxHbondAlphaDistance2",81,"minimumHbondDistance2",0.25)});n("JM");v(["JM.Model"],"JM.BioModel","java.lang.Float java.util.Hashtable JU.AU $.BS $.Lst $.P3 $.PT $.SB J.api.Interface J.c.STR JM.AtomCollection JM.AlphaPolymer $.AminoPolymer $.Monomer $.Resolver JU.BSUtil $.Escape JV.Viewer".split(" "),
function(){c$=w(function(){this.bioPolymerCount=0;this.bioPolymers=null;y(this,arguments)},JM,"BioModel",JM.Model);F(c$,function(a,b,c,d,f,g){S(this,JM.BioModel,[]);this.set(a,b,c,d,f,g);this.isBioModel=!0;a.bioModel=this;this.clearBioPolymers()},"JM.ModelSet,~N,~N,~S,java.util.Properties,java.util.Map");h(c$,"freeze",function(){this.freezeM();this.bioPolymers=JU.AU.arrayCopyObject(this.bioPolymers,this.bioPolymerCount)});e(c$,"addSecondaryStructure",function(a,b,c,d,f,g,e,h,j,l,m){for(var p=this.bioPolymerCount;0<=
--p;)A(this.bioPolymers[p],JM.AlphaPolymer)&&this.bioPolymers[p].addStructure(a,b,c,d,f,g,e,h,j,l,m)},"J.c.STR,~S,~N,~N,~N,~N,~N,~N,~N,~N,JU.BS");h(c$,"calculateStructures",function(a,b,c,d,f){if(0==this.bioPolymerCount||!d&&!a)return"";this.ms.proteinStructureTainted=this.structureTainted=!0;if(d)for(var g=this.bioPolymerCount;0<=--g;)(!a||null!=this.bioPolymers[g].monomers[0].getNitrogenAtom())&&this.bioPolymers[g].clearStructures();if(!a||f)for(g=this.bioPolymerCount;0<=--g;)A(this.bioPolymers[g],
JM.AlphaPolymer)&&this.bioPolymers[g].calculateStructures(f);return a?this.calculateDssx(null,b,c,d):""},"~B,~B,~B,~B,~B");e(c$,"calculateDssx",function(a,b,c,d){for(var f=!1,g=!1,e=0;e<this.bioPolymerCount&&(!f||!g);e++)this.bioPolymers[e].isNucleic()?g=!0:A(this.bioPolymers[e],JM.AminoPolymer)&&(f=!0);e="";f&&(e+=J.api.Interface.getOption("dssx.DSSP",this.ms.vwr,"ms").calculateDssp(this.bioPolymers,this.bioPolymerCount,a,b,c,d));g&&(this.auxiliaryInfo.containsKey("dssr")&&null!=a)&&(e+=this.ms.vwr.getAnnotationParser().getHBonds(this.ms,
this.modelIndex,a,b));return e},"JU.Lst,~B,~B,~B");h(c$,"setConformation",function(a){if(0<this.nAltLocs)for(var b=this.bioPolymerCount;0<=--b;)this.bioPolymers[b].setConformation(a)},"JU.BS");h(c$,"getPdbConformation",function(a,b){if(0<this.nAltLocs)for(var c=this.bioPolymerCount;0<=--c;)this.bioPolymers[c].getConformation(a,b);return!0},"JU.BS,~N");e(c$,"getBioPolymerCount",function(){return this.bioPolymerCount});e(c$,"getBioPolymer",function(a){return this.bioPolymers[a]},"~N");h(c$,"getDefaultLargePDBRendering",
function(a,b){var c=new JU.BS;0==this.getBondCount()&&(c=this.bsAtoms);if(c!==this.bsAtoms)for(var d=0;d<this.bioPolymerCount;d++)this.bioPolymers[d].getRange(c);if(!(0>c.nextSetBit(0))){var f=new JU.BS;if(c===this.bsAtoms)f=c;else for(d=0;d<this.bioPolymerCount;d++)0==this.bioPolymers[d].getType()&&this.bioPolymers[d].getRange(f);0<=f.nextSetBit(0)&&a.append("select ").append(JU.Escape.eBS(f)).append(";backbone only;");this.ac<=b||(a.append("select ").append(JU.Escape.eBS(c)).append(" & connected; wireframe only;"),
c!==this.bsAtoms&&(f.clearAll(),f.or(this.bsAtoms),f.andNot(c),0<=f.nextSetBit(0)&&a.append("select "+JU.Escape.eBS(f)+" & !connected;stars 0.5;spacefill off;")))}},"JU.SB,~N");h(c$,"fixIndices",function(a,b,c){this.fixIndicesM(a,b,c);for(a=0;a<this.bioPolymerCount;a++)this.bioPolymers[a].recalculateLeadMidpointsAndWingVectors()},"~N,~N,JU.BS");h(c$,"setStructureList",function(a){this.bioPolymers=JU.AU.arrayCopyObject(this.bioPolymers,this.bioPolymerCount);for(var b=this.bioPolymerCount;0<=--b;)this.bioPolymers[b].setStructureList(a)},
"java.util.Map");h(c$,"getPolymerPointsAndVectors",function(a,b,c,d){for(var f=2147483646,g=0;g<this.bioPolymerCount;g++)f=this.bioPolymers[g].getPolymerPointsAndVectors(f,a,b,c,d)},"JU.BS,JU.Lst,~B,~N");h(c$,"getBioBranches",function(a){for(var b,c=0;c<this.bioPolymerCount;c++)b=new JU.BS,this.bioPolymers[c].getRange(b),0<=b.nextSetBit(0)&&(null==a&&(a=new JU.Lst),a.addLast(b));return a},"JU.Lst");e(c$,"addBioPolymer",function(a){0==this.bioPolymers.length&&this.clearBioPolymers();this.bioPolymerCount==
this.bioPolymers.length&&(this.bioPolymers=JU.AU.doubleLength(this.bioPolymers));a.bioPolymerIndexInModel=this.bioPolymerCount;this.bioPolymers[this.bioPolymerCount++]=a},"JM.BioPolymer");h(c$,"clearBioPolymers",function(){this.bioPolymers=Array(8);this.bioPolymerCount=0});h(c$,"getAllPolymerInfo",function(a,b,c){b=new java.util.Hashtable;for(var d=new JU.Lst,f=0;f<this.bioPolymerCount;f++){var g=this.bioPolymers[f].getPolymerInfo(a);g.isEmpty()||d.addLast(g)}0<d.size()&&(b.put("modelIndex",Integer.$valueOf(this.modelIndex)),
b.put("polymers",d),c.addLast(b))},"JU.BS,java.util.Map,JU.Lst");h(c$,"getChimeInfo",function(a,b){var c=0,d=this.ms.am,f=this.ms.mc,g=this.ms.ac,e=this.ms.at;a.append("\nMolecule name ....... "+this.ms.getInfoM("COMPND"));a.append("\nSecondary Structure . PDB Data Records");a.append("\nBrookhaven Code ..... "+this.ms.modelSetName);for(var h=f;0<=--h;)c+=d[h].getChainCount(!1);a.append("\nNumber of Chains .... "+c);c=0;for(h=f;0<=--h;)c+=d[h].getGroupCountHetero(!1);b=0;for(h=f;0<=--h;)b+=d[h].getGroupCountHetero(!0);
a.append("\nNumber of Groups .... "+c);0<b&&a.append(" ("+b+")");for(h=g;0<=--h;)e[h].isHetero()&&b++;this.getChimeInfoM(a,b);for(var f=d=c=0,j,l=-1,h=0;h<g&&0==e[h].mi;h++)if((j=e[h].getStrucNo())!=l&&0!=j)switch(l=j,e[h].getProteinStructureType()){case J.c.STR.HELIX:c++;break;case J.c.STR.SHEET:d++;break;case J.c.STR.TURN:f++}a.append("\nNumber of Helices ... "+c);a.append("\nNumber of Strands ... "+d);a.append("\nNumber of Turns ..... "+f)},"JU.SB,~N");h(c$,"getFullPDBHeader",function(){if(0>this.modelIndex)return"";
var a=this.auxiliaryInfo.get("fileHeader");if(null!=a)return a;for(var a=this.ms.vwr.getCurrentFileAsString("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,j){var l=!1,m="R"!=c?"r":13<b.length&&0<=
b.indexOf("ramachandran ")?b.charAt(13):"R";"r"==m&&(m=a.getQuaternionFrame());var p=a.getInt(553648146),s=0>b.indexOf("diff")?0:0>b.indexOf("2")?1:2;d||(g.append("REMARK   6 Jmol PDB-encoded data: "+b+";"),"R"!=c&&(g.append('  quaternionFrame = "'+m+'"'),l=!0),g.append("\nREMARK   6 Jmol Version ").append(JV.Viewer.getJmolVersion()).append("\n"),"R"==c?g.append("REMARK   6 Jmol data min = {-180 -180 -180} max = {180 180 180} unScaledXyz = xyz * {1 1 1} + {0 0 0} plotScale = {100 100 100}\n"):g.append("REMARK   6 Jmol data min = {-1 -1 -1} max = {1 1 1} unScaledXyz = xyz * {0.1 0.1 0.1} + {0 0 0} plotScale = {100 100 100}\n"));
b=new JU.P3;for(var t=0;t<this.bioPolymerCount;t++)this.bioPolymers[t].getPdbData(a,c,m,p,s,this.bsAtoms,f,l,d,0==t,e,g,h,j,b)},"JV.Viewer,~S,~S,~B,JU.BS,JU.OC,~A,JU.SB,JU.BS");h(c$,"getSequenceBits",function(a,b,c){var d=new JU.BS;null==c&&(c=a.vwr.getAllAtoms());var f=a.am;for(a=a.mc;0<=--a;)if(f[a].isBioModel)for(var g=f[a],e=b.length,h=0;h<g.bioPolymerCount;h++)for(var j=g.bioPolymers[h].getSequence(),l=-1;0<=(l=j.indexOf(b,++l));)g.bioPolymers[h].getPolymerSequenceAtoms(l,e,c,d);return d},"JM.ModelSet,~S,JU.BS");
h(c$,"getBasePairBits",function(a,b){var c=null,d=null,f=new JU.Lst;if(0==b.length)c=d=a.vwr.getAllAtoms(),a.calcRasmolHydrogenBonds(c,d,f,!0,1,!1,null);else for(var g=0;g<b.length;)c=a.getSequenceBits(b.substring(g,++g),null),0!=c.cardinality()&&(d=a.getSequenceBits(b.substring(g,++g),null),0!=d.cardinality()&&a.calcRasmolHydrogenBonds(c,d,f,!0,1,!1,null));c=new JU.BS;for(g=f.size();0<=--g;)d=f.get(g),c.set(d.atom1.i),c.set(d.atom2.i);return c},"JM.ModelSet,~S");h(c$,"resetRasmolBonds",function(a,
b){JM.BioModel.clearRasmolHydrogenBonds(a.ms,a,null);a.getRasmolHydrogenBonds(b,b,null,!1,2147483647,!1,null)},"JM.Model,JU.BS");h(c$,"calcRasmolHydrogenBonds",function(a,b,c,d,f,g,e,h){for(var j=null==c||b.equals(c),l=a.am,m=a.mc;0<=--m;)if(l[m].isBioModel&&l[m].trajectoryBaseIndex==m){var p=l[m];null==d&&(JM.BioModel.clearRasmolHydrogenBonds(a,p,b),j||JM.BioModel.clearRasmolHydrogenBonds(a,p,c));p.getRasmolHydrogenBonds(b,c,d,f,g,e,h)}},"JM.ModelSet,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,l;if(null==b&&0<this.bioPolymerCount)this.calculateDssx(c,!1,g,!1);else for(g=this.bioPolymerCount;0<=--g;){j=this.bioPolymers[g];var m=j.getType();if(!((d||1!=m)&&2!=m)){var p=j.isRna();1==m&&j.calcRasmolHydrogenBonds(null,a,b,c,f,null,!0,!1);for(var s=this.bioPolymerCount;0<=--s;)null!=(l=this.bioPolymers[s])&&((p||g!=s)&&m==l.getType())&&l.calcRasmolHydrogenBonds(j,a,b,c,f,null,!0,!1)}}if(0!=c.size()&&h){this.hasRasmolHBonds=
!0;for(g=0;g<c.size();g++)a=c.get(g),b=a.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");c$.clearRasmolHydrogenBonds=e(c$,"clearRasmolHydrogenBonds",function(a,b,c){var d=new JU.BS;b.hasRasmolHBonds=!1;b=a.am;for(var f=a.bo,g=a.bondCount;0<=--g;){var e=f[g],h=e.atom1,j=b[h.mi];if(j.isBioModel&&!(j.trajectoryBaseIndex!=j.modelIndex||0==(e.order&28672)))null!=c&&!c.get(h.i)?j.hasRasmolHBonds=!0:d.set(g)}0<=d.nextSetBit(0)&&
a.deleteBonds(d,!1)},"JM.ModelSet,JM.BioModel,JU.BS");h(c$,"getFullProteinStructureState",function(a,b,c,d,f){b=0;for(var g=a.mc;b<g;b++)if(a.am[b].isBioModel)return JM.BioModel.getProteinStructureState(a,a.am[b],this.bsAtoms,c,d,f);return""},"JM.ModelSet,JU.BS,~B,~B,~N");c$.getProteinStructureState=e(c$,"getProteinStructureState",function(a,b,c,d,f,g){var e=3==g,h=1==g;g=0==g;var j=null,l=new JU.SB,m=new JU.SB,p=new JU.SB,s=new JU.SB,t=J.c.STR.NONE,n=J.c.STR.NONE,r=0,q=0,v=-1,x=-1,u=0,y=0,w="",A=
"",z="",D="",E="",F=0,I=0,K=0,L=0,O=null,r=a.am,C=a.at,H=a.ac;if(d){if(!a.proteinStructureTainted)return"";O=new JU.BS;for(b=b.firstAtomIndex;b<H;b++)r[C[b].mi].structureTainted&&O.set(b);O.set(H)}for(b=0;b<=H;b++)if((b==H||null==c||c.get(b))&&(!d||O.get(b))){r=0;if(b==H||(r=C[b].getStrucNo())!=x){if(null!=j){switch(t){case J.c.STR.HELIX:case J.c.STR.TURN:case J.c.STR.SHEET:if(F++,g){var B=C[q].mi,P="    \t# model="+a.getModelNumberDotted(B);v!=B&&(v=B,l.append("  structure none ").append(JU.Escape.eBS(a.getModelAtomBitSetIncludingDeleted(B,
!1))).append(P).append(";\n"));P+=" & ("+u+" - "+y+")";B=n.getBioStructureTypeName(!1);l.append("  structure ").append(B).append(" ").append(JU.Escape.eBS(j)).append(P).append(";\n")}else{switch(t){case J.c.STR.HELIX:j=++I;if(null==w||h)w=JU.PT.formatStringI("%3N %3N","N",j);j="HELIX  %ID %3GROUPA %1CA %4RESA  %3GROUPB %1CB %4RESB";P=p;B=null;switch(n){case J.c.STR.HELIX:case J.c.STR.HELIXALPHA:B="  1";break;case J.c.STR.HELIX310:B="  5";break;case J.c.STR.HELIXPI:B="  3"}null!=B&&(j+=B);break;case J.c.STR.SHEET:j=
++L;if(null==w||h)w=JU.PT.formatStringI("%3N %3A 0","N",j),w=JU.PT.formatStringS(w,"A","S"+j);j="SHEET  %ID %3GROUPA %1CA%4RESA  %3GROUPB %1CB%4RESB";P=s;break;default:j=++K;if(null==w||h)w=JU.PT.formatStringI("%3N %3N","N",j);j="TURN   %ID %3GROUPA %1CA%4RESA  %3GROUPB %1CB%4RESB";P=m}j=JU.PT.formatStringS(j,"ID",w);j=JU.PT.formatStringS(j,"GROUPA",A);j=JU.PT.formatStringS(j,"CA",D);j=JU.PT.formatStringI(j,"RESA",u);j=JU.PT.formatStringS(j,"GROUPB",z);j=JU.PT.formatStringS(j,"CB",E);j=JU.PT.formatStringI(j,
"RESB",y);P.append(j);e&&P.append(" strucno= ").appendI(x);P.append("\n")}}j=null}if(0==r||null!=c&&f&&(Float.isNaN(C[b].getGroupParameter(1112539145))||Float.isNaN(C[b].getGroupParameter(1112539146))))continue}q=C[b].getChainIDStr();null==j&&(j=new JU.BS,u=C[b].getResno(),A=C[b].getGroup3(!1),D=q);t=C[b].getProteinStructureType();n=C[b].getProteinStructureSubType();w=C[b].getProteinStructureTag();j.set(b);x=r;y=C[b].getResno();z=C[b].getGroup3(!1);E=q;q=b}0<F&&l.append("\n");return g?l.toString():
p.appendSB(s).appendSB(m).appendSB(l).toString()},"JM.ModelSet,JM.BioModel,JU.BS,~B,~B,~N");h(c$,"calculateAllPolymers",function(a,b,c,d,f){for(var g=0,e=a.mc;g<e;g++)if((null==f||!f.get(g))&&a.am[g].isBioModel){JM.BioModel.calculatePolymers(a,b,c,d,f);break}},"JM.ModelSet,~A,~N,~N,JU.BS");c$.calculatePolymers=e(c$,"calculatePolymers",function(a,b,c,d,f){var g=!a.vwr.getBoolean(603979892);null==b&&(b=a.getGroups(),c=b.length);if(null!=f)for(var e=0;e<c;++e){var h=b[e];A(h,JM.Monomer)&&null!=h.bioPolymer&&
!f.get(h.getModelIndex())&&h.setBioPolymer(null,-1)}for(e=d;e<c;++e)f=b[e],d=f.getModel(),d.isBioModel&&A(f,JM.Monomer)&&(h=g&&!a.isJmolDataFrameForModel(a.at[f.firstAtomIndex].mi),f=null==f.bioPolymer?JM.Resolver.allocateBioPolymer(b,e,h):null,null==f||0==f.monomerCount||(d.addBioPolymer(f),e+=f.monomerCount-1))},"JM.ModelSet,~A,~N,~N,JU.BS");h(c$,"getGroupsWithinAll",function(a,b,c){for(var d=new JU.BS,f=a.getIterativeModels(!1),g=a.mc;0<=--g;)if(f.get(g)&&a.am[g].isBioModel)for(var e=a.am[g],h=
e.bioPolymerCount;0<=--h;)e.bioPolymers[h].getRangeGroups(b,c,d);return d},"JM.ModelSet,~N,JU.BS");h(c$,"getSelectCodeRange",function(a,b){var c=new JU.BS,d=b[0],f=b[1],g=b[2],e=a.vwr.getBoolean(603979823);0<=g&&(300>g&&!e)&&(g=JM.AtomCollection.chainToUpper(g));for(var h=a.mc;0<=--h;)if(a.am[h].isBioModel)for(var j=a.am[h],l,m=j.chainCount;0<=--m;){var p=j.chains[m];if(-1==g||g==(l=p.chainID)||!e&&0<l&&300>l&&g==JM.AtomCollection.chainToUpper(l))for(var s=0;0<=s;)s=p.selectSeqcodeRange(s,d,f,c)}return c},
"JM.ModelSet,~A");h(c$,"calculateStruts",function(a,b,c){a.vwr.setModelVisibility();a.makeConnections2(0,3.4028235E38,32768,12291,b,c,null,!1,!1,0);var d=b.nextSetBit(0);if(0>d)return 0;d=a.am[a.at[d].mi];if(!d.isBioModel)return 0;var f=new JU.Lst,g=null,e;b.equals(c)?e=b:(e=JU.BSUtil.copy(b),e.or(c));var h=a.at,j=a.vwr;e.and(j.getModelUndeletedAtomsBitSet(d.modelIndex));for(var l=e.nextSetBit(0);0<=l;l=e.nextSetBit(l+1))h[l].checkVisible()&&(2==h[l].atomID&&5!=h[l].getGroupID())&&f.addLast(g=h[l]);
if(0==f.size())return 0;l=j.getFloat(570425408);e=$(2E3*j.getFloat(570425406));h=j.getInt(553648184);j=j.getBoolean(603979955);b=d.getBioPolymer(g.getPolymerIndexInModel()).calculateStruts(a,b,c,f,l,h,j);for(l=0;l<b.size();l++)c=b.get(l),a.bondAtoms(c[0],c[1],32768,e,null,0,!1,!0);return b.size()},"JM.ModelSet,JU.BS,JU.BS");h(c$,"recalculatePoints",function(a,b){if(0>b)for(var c=a.mc;0<=--c;)!a.isTrajectorySubFrame(c)&&a.am[c].isBioModel&&a.am[c].recalculateLeadMidpointsAndWingVectors();else!a.isTrajectorySubFrame(b)&&
a.am[b].isBioModel&&a.am[b].recalculateLeadMidpointsAndWingVectors()},"JM.ModelSet,~N");e(c$,"recalculateLeadMidpointsAndWingVectors",function(){for(var a=0;a<this.bioPolymerCount;a++)this.bioPolymers[a].recalculateLeadMidpointsAndWingVectors()});h(c$,"calcSelectedMonomersCount",function(a){for(var b=this.bioPolymerCount;0<=--b;)this.bioPolymers[b].calcSelectedMonomersCount(a)},"JU.BS");h(c$,"getBioPolymerCountInModel",function(a,b){if(0>b){for(var c=0,d=a.mc;0<=--d;)a.isTrajectorySubFrame(d)||(c+=
a.am[d].getBioPolymerCount());return c}return a.isTrajectorySubFrame(b)?0:a.am[b].getBioPolymerCount()},"JM.ModelSet,~N");h(c$,"calculateStraightnessAll",function(a){for(var b=a.vwr.getQuaternionFrame(),c=a.vwr.getInt(553648146),d=a.mc;0<=--d;)if(a.am[d].isBioModel)for(var f=a.am[d],g=new JU.P3,e=0;e<f.bioPolymerCount;e++)f.bioPolymers[e].getPdbData(a.vwr,"S",b,c,2,null,null,!1,!1,!1,null,null,null,new JU.BS,g);a.haveStraightness=!0},"JM.ModelSet");I(c$,"pdbRecords",["ATOM  ","MODEL ","HETATM"])});
n("JM");v(["JM.Monomer"],"JM.CarbohydrateMonomer",["J.c.STR"],function(){c$=E(JM,"CarbohydrateMonomer",JM.Monomer);R(c$,function(){});c$.validateAndAllocate=e(c$,"validateAndAllocate",function(a,b,c,d,f){return(new JM.CarbohydrateMonomer).set2(a,b,c,d,f,JM.CarbohydrateMonomer.alphaOffsets)},"JM.Chain,~S,~N,~N,~N");h(c$,"isCarbohydrate",function(){return!0});h(c$,"getProteinStructureType",function(){return J.c.STR.CARBOHYDRATE});h(c$,"isConnectedAfter",function(a){if(null==a)return!0;for(var b=this.firstAtomIndex;b<=
this.lastAtomIndex;b++)for(var c=a.firstAtomIndex;c<=a.lastAtomIndex;c++){var d=this.chain.getAtom(b),f=this.chain.getAtom(c);if(14==d.getElementNumber()+f.getElementNumber()&&3.24>d.distanceSquared(f))return!0}return!1},"JM.Monomer");h(c$,"findNearestAtomIndex",function(a,b,c,d){var f=c[0],g=this.getLeadAtom();d=D(d/2);1200>d&&(d=1200);0!=g.sZ&&(d=L(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))return!0;return!1});I(c$,"alphaOffsets",[0])});n("JM");v(["JM.BioPolymer"],"JM.CarbohydratePolymer",null,function(){c$=E(JM,"CarbohydratePolymer",JM.BioPolymer);F(c$,function(a){S(this,JM.CarbohydratePolymer,[]);this.set(a);this.type=3},"~A")});n("JM");v(["JM.Monomer"],"JM.PhosphorusMonomer",["JU.Quat","$.V3","J.c.STR"],function(){c$=w(function(){this.$isPyrimidine=this.$isPurine=!1;y(this,arguments)},JM,
"PhosphorusMonomer",JM.Monomer);h(c$,"isNucleic",function(){return!0});R(c$,function(){});c$.validateAndAllocateP=e(c$,"validateAndAllocateP",function(a,b,c,d,f,g){return d!=f||g[13]!=d?null:(new JM.PhosphorusMonomer).set3(a,b,c,d,f,JM.PhosphorusMonomer.phosphorusOffsets)},"JM.Chain,~S,~N,~N,~N,~A");e(c$,"set3",function(a,b,c,d,f,g){this.set2(a,b,c,d,f,g);0<=b.indexOf("T")&&(a.isDna=!0);-2<b.indexOf("U")+b.indexOf("I")&&(a.isRna=!0);this.$isPurine=-3<b.indexOf("A")+b.indexOf("G")+b.indexOf("I");this.$isPyrimidine=
-3<b.indexOf("T")+b.indexOf("C")+b.indexOf("U");return this},"JM.Chain,~S,~N,~N,~N,~A");e(c$,"getP",function(){return this.getAtomFromOffsetIndex(0)});e(c$,"isPhosphorusMonomer",function(){return!0});h(c$,"isDna",function(){return this.chain.isDna});h(c$,"isRna",function(){return this.chain.isRna});h(c$,"isPurine",function(){return this.$isPurine});h(c$,"isPyrimidine",function(){return this.$isPyrimidine});h(c$,"getStructure",function(){return this.chain});h(c$,"getProteinStructureType",function(){return J.c.STR.NONE});
h(c$,"isConnectedAfter",function(a){return this.isCA2(a)},"JM.Monomer");e(c$,"isCA2",function(a){return null==a?!0:this.getLeadAtom().distance(a.getLeadAtom())<=JM.PhosphorusMonomer.MAX_ADJACENT_PHOSPHORUS_DISTANCE},"JM.Monomer");h(c$,"getQuaternion",function(){return this.getQuaternionP()},"~S");e(c$,"getQuaternionP",function(){var a=this.monomerIndex;if(0==a||a>=this.bioPolymer.monomerCount-1)return null;var b=this.bioPolymer.monomers[a].getAtomFromOffsetIndex(0),c;c=this.bioPolymer.monomers[a+
1].getAtomFromOffsetIndex(0);a=this.bioPolymer.monomers[a-1].getAtomFromOffsetIndex(0);if(null==b||null==c||null==a)return null;var d=new JU.V3,f=new JU.V3;d.sub2(c,b);f.sub2(a,b);return JU.Quat.getQuaternionFrameV(d,f,null,!1)});h(c$,"getQuaternionFrameCenter",function(){return this.getAtomFromOffsetIndex(0)},"~S");h(c$,"getHelixData",function(a,b,c){return this.getHelixData2(a,b,c)},"~N,~S,~N");I(c$,"P",0,"phosphorusOffsets",[0],"MAX_ADJACENT_PHOSPHORUS_DISTANCE",8)});n("JM");c$=w(function(){this.g2=
this.g1=this.info=null;y(this,arguments)},JM,"BasePair");F(c$,function(){});c$.add=e(c$,"add",function(a,b,c){var d=new JM.BasePair;d.info=a;(d.g1=b).addBasePair(d);(d.g2=c).addBasePair(d);return d},"java.util.Map,JM.NucleicMonomer,JM.NucleicMonomer");e(c$,"getPartnerAtom",function(a){return(a===this.g1?this.g2:this.g1).getLeadAtom().i},"JM.NucleicMonomer");e(c$,"toString",function(){return this.info.toString()});n("JM");v(["JM.PhosphorusMonomer"],"JM.NucleicMonomer","java.lang.Character JU.Lst $.P3 $.Quat $.V3 J.c.STR JM.Group JM.NucleicPolymer".split(" "),
function(){c$=w(function(){this.hasRnaO2Prime=!1;this.bps=this.baseCenter=null;y(this,arguments)},JM,"NucleicMonomer",JM.PhosphorusMonomer);R(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.set3(a,b,c,d,f,g);JM.Monomer.have(g,15)||(g[0]=g[19],a=g[0]&255,255!=a&&(this.leadAtomIndex=d+a));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});h(c$,"isPyrimidine",function(){return this.$isPyrimidine});e(c$,"isGuanine",function(){return JM.Monomer.have(this.offsets,17)});h(c$,"getProteinStructureType",function(){return this.hasRnaO2Prime?J.c.STR.RNA:J.c.STR.DNA});e(c$,"getC1P",function(){return this.getAtomFromOffsetIndex(25)});e(c$,"getC2",function(){return this.getAtomFromOffsetIndex(5)});e(c$,"getC4P",function(){return this.getAtomFromOffsetIndex(27)});
e(c$,"getN1",function(){return this.getAtomFromOffsetIndex(4)});e(c$,"getN3",function(){return this.getAtomFromOffsetIndex(6)});e(c$,"getN2",function(){return this.getAtomFromOffsetIndex(17)});e(c$,"getN4",function(){return this.getAtomFromOffsetIndex(14)});e(c$,"getN6",function(){return this.getAtomFromOffsetIndex(16)});e(c$,"getO2",function(){return this.getAtomFromOffsetIndex(8)});e(c$,"getO4",function(){return this.getAtomFromOffsetIndex(12)});e(c$,"getO6",function(){return this.getAtomFromOffsetIndex(13)});
h(c$,"getTerminatorAtom",function(){return this.getAtomFromOffsetIndex(JM.Monomer.have(this.offsets,20)?20:21)});e(c$,"getBaseRing6Points",function(a){this.getPoints(JM.NucleicMonomer.ring6OffsetIndexes,a)},"~A");e(c$,"getPoints",function(a,b){for(var c=a.length;0<=--c;)b[c]=this.getAtomFromOffsetIndex(a[c])},"~A,~A");e(c$,"maybeGetBaseRing5Points",function(a){this.$isPurine&&this.getPoints(JM.NucleicMonomer.ring5OffsetIndexes,a);return this.$isPurine},"~A");e(c$,"getRiboseRing5Points",function(a){this.getPoints(JM.NucleicMonomer.riboseOffsetIndexes,
a)},"~A");h(c$,"isConnectedAfter",function(a){if(null==a)return!0;var b=this.getAtomFromOffsetIndex(15);return null==b?!1:a.getAtomFromOffsetIndex(21).isBonded(b)||this.isCA2(a)},"JM.Monomer");h(c$,"findNearestAtomIndex",function(a,b,c,d){var f=c[0],g=this.getLeadAtom(),e=this.getAtomFromOffsetIndex(19),h=this.getAtomFromOffsetIndex(22);d=D(d/2);1900>d&&(d=1900);d=L(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){var b=null,c=null,d=!1,f=!1;switch(a){case "a":a=this.getP();if(0==this.monomerIndex||null==a)return null;d=!0;b=this.bioPolymer.monomers[this.monomerIndex-1].getC4P();c=this.getC4P();break;case "x":a=this.getP();if(this.monomerIndex==this.bioPolymer.monomerCount-1||null==a)return null;b=this.bioPolymer.monomers[this.monomerIndex+1].getP();c=this.getC4P();break;case "b":return this.getQuaternionP();
case "c":case "n":a=this.getN0();if(null==a)return null;f=d=!0;b=this.getAtomFromOffsetIndex(5);c=this.getAtomFromOffsetIndex(25);break;case "p":a=this.getP();if(null==a)return null;var e=this.getAtomFromOffsetIndex(23),k=this.getAtomFromOffsetIndex(24),h=a.bonds;if(null==h)return null;for(var j=a.group,l=0;l<h.length;l++){var m=h[l].getOtherAtom(a);null!=e&&m.i==e.i||null!=k&&m.i==k.i||(m.group===j?c=m:b=m)}break;case "q":return null;default:a=this.getN0();if(null==a)return null;this.$isPurine?(b=
this.getAtomFromOffsetIndex(5),c=this.getAtomFromOffsetIndex(9)):(b=this.getAtomFromOffsetIndex(6),c=this.getAtomFromOffsetIndex(1))}if(null==b||null==c)return null;b=JU.V3.newVsub(b,a);c=JU.V3.newVsub(c,a);f&&c.scale(-1);return JU.Quat.getQuaternionFrameV(b,c,null,d)},"~S");h(c$,"isCrossLinked",function(a){if(!A(a,JM.NucleicMonomer)||this.$isPurine==a.isPurine())return!1;var b=this.$isPurine?a:this;a=(this.$isPurine?this:a).getN1();b=b.getN3();return a.isBonded(b)},"JM.Group");h(c$,"getCrossLinkLead",
function(a){var b=this.$isPurine?this.getN1():this.getN3(),c=b.bonds;if(null==c)return!1;for(var d=!1,f=0;f<c.length;f++)if(c[f].isHydrogen()){var e=c[f].getOtherAtom(b),k=e.group;if(A(k,JM.NucleicMonomer)&&(this.$isPurine?k.getN3():k.getN1())===e){if(null==a)return!0;a.addLast(Integer.$valueOf(k.leadAtomIndex));d=!0}}return d},"JU.Lst");e(c$,"getEdgePoints",function(a){a[0]=this.getLeadAtom();a[1]=this.getC4P();a[2]=a[5]=this.getC1P();switch(this.getGroup1()){case "C":return a[3]=this.getO2(),a[4]=
this.getN4(),!0;case "A":return a[3]=this.getC2(),a[4]=this.getN6(),!0;case "G":case "I":return a[3]=this.getC2(),a[4]=this.getO6(),!0;case "T":case "U":return a[3]=this.getO2(),a[4]=this.getO4(),!0;default:return!1}},"~A");e(c$,"addBasePair",function(a){null==this.bps&&(this.bps=new JU.Lst);this.bps.addLast(a)},"JM.BasePair");e(c$,"setGroup1",function(a){"\x00"==this.group1&&(this.group1=a)},"~S");e(c$,"getBasePairs",function(){this.bioPolymer.isDssrSet||this.bioPolymer.model.ms.vwr.getAnnotationParser().setAllDSSRParametersForModel(this.bioPolymer.model.ms.vwr,
this.bioPolymer.model.modelIndex);return this.bps});h(c$,"getGroup1b",function(){var a=JM.Group.group3Names[this.groupID],b=null==JM.NucleicPolymer.htGroup1?null:JM.NucleicPolymer.htGroup1.get(a);return null==b?Character.toLowerCase(a.charAt(a.length-1)):b.charAt(0)});I(c$,"C6",1,"O2Pr",2,"C5",3,"N1",4,"C2",5,"N3",6,"C4",7,"O2",8,"N7",9,"C8",10,"N9",11,"O4",12,"O6",13,"N4",14,"NP",15,"N6",16,"N2",17,"H5T",18,"O5P",19,"H3T",20,"O3P",21,"C3P",22,"O1P",23,"O2P",24,"C1P",25,"C2P",26,"C4P",27,"O4P",28,
"C5P",29,"interestingNucleicAtomIDs",[-14,37,-80,36,32,33,34,35,-39,-40,-41,-42,-48,-47,-43,-14,-45,-44,-73,-7,-89,10,9,-75,-77,-13,-12,-9,-79,-8],"ring6OffsetIndexes",[3,1,4,5,6,7],"ring5OffsetIndexes",[3,9,10,11,7],"riboseOffsetIndexes",[25,26,22,27,28,21,29,19,0],"heavyAtomIndexes",[3,1,4,5,6,7,11,10,9,16,14,8,12,17,13])});n("JM");v(["JM.PhosphorusPolymer"],"JM.NucleicPolymer",["JU.Measure","$.P4","$.V3","JM.HBond"],function(){c$=w(function(){this.isDssrSet=!1;y(this,arguments)},JM,"NucleicPolymer",
JM.PhosphorusPolymer);F(c$,function(a){S(this,JM.NucleicPolymer,[a]);this.type=2;this.hasWingPoints=!0},"~A");e(c$,"getNucleicPhosphorusAtom",function(a){return this.monomers[a].getLeadAtom()},"~N");h(c$,"calcEtaThetaAngles",function(){for(var a=NaN,b=0;b<this.monomerCount-2;++b){var c=this.monomers[b],d=this.monomers[b+1],f=c.getP(),e=c.getC4P(),k=d.getP(),d=d.getC4P();0<b&&(a=this.monomers[b-1].getC4P(),a=JU.Measure.computeTorsion(a,f,e,k,!0));f=JU.Measure.computeTorsion(f,e,k,d,!0);0>a&&(a+=360);
0>f&&(f+=360);c.setGroupParameter(1112539141,a);c.setGroupParameter(1112539152,f)}return!0});h(c$,"calcRasmolHydrogenBonds",function(a,b,c,d,f){for(var e=new JU.V3,k=new JU.V3,h=this.monomerCount;0<=--h;){var j=this.monomers[h];if(j.isPurine()){var l=j.getN3(),m=b.get(l.i);if(m||c.get(l.i)){for(var p=j.getN1(),s=j.getN0(),t=JU.Measure.getPlaneThroughPoints(l,p,s,e,k,new JU.P4),l=null,n=25,r=null,q=a.monomerCount;0<=--q;){var v=a.monomers[q];if(v.isPyrimidine()){var x=v.getN3();if(!(m?!c.get(x.i):
!b.get(x.i))){var u=v.getN0(),w=p.distanceSquared(x);w<n&&(50<s.distanceSquared(u)&&1>Math.abs(JU.Measure.distanceToPlane(t,x)))&&(r=v,l=x,n=w)}}}m=0;null!=l&&(m+=JM.NucleicPolymer.addHydrogenBond(d,p,l),m>=f||(j.isGuanine()?(m+=JM.NucleicPolymer.addHydrogenBond(d,j.getN2(),r.getO2()),m>=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");I(c$,"htGroup1",null)});n("JM");c$=w(function(){this.g2=this.g1=this.info=null;y(this,arguments)},JM,"BasePair");F(c$,function(){});c$.add=e(c$,"add",function(a,b,c){var d=new JM.BasePair;d.info=a;(d.g1=b).addBasePair(d);(d.g2=c).addBasePair(d);return d},"java.util.Map,JM.NucleicMonomer,JM.NucleicMonomer");e(c$,"getPartnerAtom",function(a){return(a===this.g1?this.g2:this.g1).getLeadAtom().i},
"JM.NucleicMonomer");e(c$,"toString",function(){return this.info.toString()});n("JM");v(["JM.BioPolymer"],"JM.PhosphorusPolymer",null,function(){c$=E(JM,"PhosphorusPolymer",JM.BioPolymer);F(c$,function(a){S(this,JM.PhosphorusPolymer,[]);this.setP(a)},"~A");e(c$,"setP",function(a){this.set(a);this.hasStructure=!0},"~A")});n("J.dssx");v(null,"J.dssx.Bridge",["java.lang.Boolean","JU.Escape"],function(){c$=w(function(){this.ladder=this.b=this.a=null;this.isAntiparallel=!1;y(this,arguments)},J.dssx,"Bridge");
F(c$,function(a,b,c){this.a=a;this.b=b;this.ladder=K(2,2,0);this.ladder[0][0]=this.ladder[0][1]=Math.min(a.i,b.i);this.ladder[1][0]=this.ladder[1][1]=Math.max(a.i,b.i);this.addLadder(c)},"JM.Atom,JM.Atom,java.util.Map");e(c$,"addBridge",function(a,b){if(a.isAntiparallel!=this.isAntiparallel||!this.canAdd(a)||!a.canAdd(this))return!1;this.extendLadder(a.ladder[0][0],a.ladder[1][0]);this.extendLadder(a.ladder[0][1],a.ladder[1][1]);a.ladder=this.ladder;a.ladder!==this.ladder&&(b.remove(a.ladder),this.addLadder(b));
return!0},"J.dssx.Bridge,java.util.Map");e(c$,"addLadder",function(a){a.put(this.ladder,this.isAntiparallel?Boolean.TRUE:Boolean.FALSE)},"java.util.Map");e(c$,"canAdd",function(a){var b=a.a.i;a=a.b.i;return this.isAntiparallel?b>=this.ladder[0][1]&&a<=this.ladder[1][0]||b<=this.ladder[0][0]&&a>=this.ladder[1][1]:b<=this.ladder[0][0]&&a<=this.ladder[1][0]||b>=this.ladder[0][1]&&a>=this.ladder[1][1]},"J.dssx.Bridge");e(c$,"extendLadder",function(a,b){this.ladder[0][0]>a&&(this.ladder[0][0]=a);this.ladder[0][1]<
a&&(this.ladder[0][1]=a);this.ladder[1][0]>b&&(this.ladder[1][0]=b);this.ladder[1][1]<b&&(this.ladder[1][1]=b)},"~N,~N");h(c$,"toString",function(){return(this.isAntiparallel?"a ":"p ")+this.a+" - "+this.b+"\t"+JU.Escape.e(this.ladder)})});n("J.api");ca(J.api,"DSSPInterface");n("J.dssx");v(["J.api.DSSPInterface"],"J.dssx.DSSP","java.lang.Boolean java.util.Hashtable JU.AU $.BS $.Lst $.PT $.SB J.c.STR J.dssx.Bridge J.i18n.GT JM.HBond JM.AminoPolymer JU.Escape $.Logger JV.Viewer".split(" "),function(){c$=
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;y(this,arguments)},J.dssx,"DSSP",null,J.api.DSSPInterface);X(c$,function(){this.sheetOffsets=[[0,-1,1,0,1,0,0,-1],[0,0,0,0,1,-1,1,-1]]});F(c$,function(){});h(c$,"calculateDssp",function(a,b,c,d,f,e){this.bioPolymers=a;this.bioPolymerCount=b;this.vHBonds=
c;this.doReport=d;this.dsspIgnoreHydrogens=f;this.$setStructure=e;a=new JU.BS;for(var k=0;k<b;k++)A(this.bioPolymers[k],JM.AminoPolymer)&&a.set(k);if(a.isEmpty())return"";k=this.bioPolymers[0].model;c=new JU.SB;c.append("Jmol ").append(JV.Viewer.getJmolVersion()).append(" DSSP analysis for model ").append(k.ms.getModelNumberDotted(k.modelIndex)).append(" - ").append(k.ms.getModelTitle(k.modelIndex)).append("\n");0==k.modelIndex&&c.append("\nW. Kabsch and C. Sander, Biopolymers, vol 22, 1983, pp 2577-2637\n").append("\nWe thank Wolfgang Kabsch and Chris Sander for writing the DSSP software,\n").append("and we thank the CMBI for maintaining it to the extent that it was easy to\n").append("re-engineer for our purposes. At this point in time, we make no guarantee\n").append("that this code gives precisely the same analysis as the code available via license\n").append("from CMBI at http://swift.cmbi.ru.nl/gv/dssp\n");
e&&0==k.modelIndex&&c.append("\nAll bioshapes have been deleted and must be regenerated.\n");0<k.nAltLocs&&c.append("\nNote: This model contains alternative locations. Use  'CONFIGURATION 1' to be consistent with CMBI DSSP.\n");this.labels=Z(b,"\x00");this.done=Array(b);this.bsBad=new JU.BS;for(var h=!1,k=a.nextSetBit(0);0<=k;k=a.nextSetBit(k+1)){e=this.bioPolymers[k];!h&&null!=e.monomers[0].getExplicitNH()&&(f?c.append(J.i18n.GT.o(J.i18n.GT._("NOTE: Backbone amide hydrogen positions are present and will be ignored. Their positions will be approximated, as in standard DSSP analysis.\nUse {0} to not use this approximation.\n\n"),
"SET dsspCalculateHydrogenAlways FALSE")):c.append(J.i18n.GT.o(J.i18n.GT._("NOTE: Backbone amide hydrogen positions are present and will be used. Results may differ significantly from standard DSSP analysis.\nUse {0} to ignore these hydrogen positions.\n\n"),"SET dsspCalculateHydrogenAlways TRUE")),h=!0);e.recalculateLeadMidpointsAndWingVectors();var j=e.monomerCount;this.labels[k]=Z(j,"\x00");this.done[k]=new JU.BS;for(var l=0;l<j;l++)null==e.monomers[l].getCarbonylOxygenAtom()&&this.bsBad.set(e.monomers[l].leadAtomIndex)}f=
this.getDualHydrogenBondArray();this.bridgesA=new JU.Lst;this.bridgesP=new JU.Lst;this.htBridges=new java.util.Hashtable;this.htLadders=new java.util.Hashtable;this.getBridges(f);this.getSheetStructures();b=Array(b);for(k=a.nextSetBit(0);0<=k;k=a.nextSetBit(k+1))null!=f[k]&&(b[k]=this.findHelixes(k,f[k]));if(d){d=new JU.SB;c.append("\n------------------------------\n");for(k=a.nextSetBit(0);0<=k;k=a.nextSetBit(k+1))null!=this.labels[k]&&(e=this.bioPolymers[k],d.append(this.dumpSummary(e,this.labels[k])),
c.append(b[k]).append(this.dumpTags(e,"$.1: "+String.valueOf(this.labels[k]),this.bsBad,2)));0<=this.bsBad.nextSetBit(0)&&c.append("\nNOTE: '!' indicates a residue that is missing a backbone carbonyl oxygen atom.\n");c.append("\n").append("SUMMARY:"+d)}return c.toString()},"~A,~N,~O,~B,~B,~B");e(c$,"getDualHydrogenBondArray",function(){for(var a=JU.AU.newInt4(this.bioPolymerCount),b=0;b<this.bioPolymerCount;b++)if(A(this.bioPolymers[b],JM.AminoPolymer)){var c=this.bioPolymers[b].monomerCount;a[b]=
K(c,2,3,0);for(var d=0;d<c;++d)a[b][d][0][1]=a[b][d][1][1]=-2147483648,a[b][d][0][2]=a[b][d][1][2]=0}for(b=0;b<this.bioPolymerCount;b++)if(null!=a[b])for(d=0;d<this.bioPolymerCount;d++)null!=a[d]&&this.bioPolymers[b].calcRasmolHydrogenBonds(this.bioPolymers[d],null,null,null,2,a[b],!1,this.dsspIgnoreHydrogens);return a});e(c$,"getBridges",function(a){for(var b=this.bioPolymers[0].model.getModelSet().at,c=null,d=new java.util.Hashtable,f=0;f<a.length;f++)if(A(this.bioPolymers[f],JM.AminoPolymer))for(var e=
this.bioPolymers[f],k=a[f].length-1,h=1;h<k;h++){var j=e.monomers[h].leadAtomIndex;if(!this.bsBad.get(j))for(var l=f;l<a.length;l++)if(A(this.bioPolymers[l],JM.AminoPolymer))for(var m=f==l?h+3:1;m<a[l].length-1;m++){var p=this.bioPolymers[l],s=p.monomers[m].leadAtomIndex;if(!this.bsBad.get(s)){if(null==(c=this.getBridge(a,f,h,l,m,this.bridgesP,b[j],b[s],e,p,d,!1)))if(null!=(c=this.getBridge(a,f,h,l,m,this.bridgesA,b[j],b[s],e,p,d,!0)))c.isAntiparallel=!0;else continue;JU.Logger.debugging&&JU.Logger.debug("Bridge found "+
c);this.done[f].set(h);this.done[l].set(m);this.htBridges.put(j+"-"+s,c)}}}},"~A");e(c$,"getBridge",function(a,b,c,d,f,e,k,h,j,l,m,p){var s=null,t=null,n=0,r=p?this.sheetOffsets[1]:this.sheetOffsets[0];return null!=(s=this.isHbonded(c+r[0],f+r[1],b,d,a))&&null!=(t=this.isHbonded(f+r[2],c+r[3],d,b,a))||null!=(s=this.isHbonded(c+r[n=4],f+r[5],b,d,a))&&null!=(t=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=p?14336:6144,this.addHbond(j.monomers[c+
r[n]],l.monomers[f+r[++n]],s[2],e,m),this.addHbond(l.monomers[f+r[++n]],j.monomers[c+r[++n]],t[2],e,m)),a):null},"~A,~N,~N,~N,~N,JU.Lst,JM.Atom,JM.Atom,JM.AminoPolymer,JM.AminoPolymer,java.util.Map,~B");e(c$,"addHbond",function(a,b,c,d,f){a=a.getNitrogenAtom();b=b.getCarbonylOxygenAtom();if(null!=f){var e=a.i+" "+b.i;if(f.containsKey(e))return;f.put(e,Boolean.TRUE)}this.vHBonds.addLast(new JM.HBond(a,b,d,1,0,c/1E3))},"JM.Monomer,JM.Monomer,~N,~N,java.util.Map");e(c$,"getSheetStructures",function(){if(!(0==
this.bridgesA.size()&&0==this.bridgesP.size())){this.createLadders(this.bridgesA,!0);this.createLadders(this.bridgesP,!1);for(var a=new JU.BS,b=new JU.BS,c,d=this.htLadders.keySet().iterator();d.hasNext()&&((c=d.next())||1);)c[0][0]==c[0][1]&&c[1][0]==c[1][1]?(b.set(c[0][0]),b.set(c[1][0])):(a.setBits(c[0][0],c[0][1]+1),a.setBits(c[1][0],c[1][1]+1));c=new JU.BS;for(var d=new JU.BS,f=this.bioPolymers.length;0<=--f;)if(A(this.bioPolymers[f],JM.AminoPolymer)){c.clearAll();d.clearAll();for(var e=this.bioPolymers[f],
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("0",c)+"-"+a.b.getOffsetResidueAtom("0",d));return null!=b&&a.addBridge(b,this.htLadders)},"J.dssx.Bridge,~B,~N,~N");e(c$,"checkBulge",function(a,b,c){for(var d=b?-1:1,f=0;3>f;f++)for(var e=0==f?1:0;6>e;e++)this.checkBridge(a,b,f*c,e*d),e>f&&this.checkBridge(a,b,e*c,f*d)},"J.dssx.Bridge,~B,~N");e(c$,"dumpSummary",function(a,b){for(var c=a.monomers[0].getLeadAtom(),c=0==c.getChainID()?"":c.getChainIDStr()+
":",d=new JU.SB,f="\x00",e="\x00",k="\x00",h=-1,j=-1,l=a.monomerCount,m=a.monomers,p=0;p<=l;p++){if(p==l||b[p]!=f){"\x00"!=f&&d.appendC("\n").appendC(f).append(" : ").append(c).appendI(h).append("\x00"==e?"":String.valueOf(e)).append("_").append(c).appendI(j).append("\x00"==k?"":String.valueOf(k));if(p==l)break;f=b[p];h=m[p].getResno();e=m[p].getInsertionCode()}j=m[p].getResno();k=m[p].getInsertionCode()}return d.toString()},"JM.AminoPolymer,~A");e(c$,"dumpTags",function(a,b,c,d){var f=a.monomers[0].getLeadAtom().getChainID()+
"."+(a.bioPolymerIndexInModel+1);b=JU.PT.rep(b,"$",f);for(var e=a.monomers[0].getResno(),k="\n"+f,f=new JU.SB,h=(new JU.SB).append(k+".8: "),j=(new JU.SB).append(k+".7: "),l=(new JU.SB).append(k+".6: "),k=(new JU.SB).append(k+".0: "),m=a.monomerCount,p=0;p<m;p++)e=a.monomers[p].getResno(),h.append(0==e%100?""+D(e/100)%100:" "),j.append(0==e%10?""+D(e/10)%10:" "),l.appendI(e%10),k.appendC(c.get(a.monomers[p].leadAtomIndex)?"!":a.monomers[p].getGroup1());1==(d&1)&&f.appendSB(h).appendSB(j).appendSB(l);
f.append("\n");f.append(b);2==(d&2)&&(f.appendSB(k),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),k=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: "+k+"\n$.4: "+f+"\n$.3: "+e,this.bsBad,1)):""},"~N,~A");e(c$,"findHelixes2",function(a,b,c,d,f,e){for(var k=this.bioPolymers[a],h=new JU.BS,j=new JU.BS,l=new JU.BS,m=new JU.BS,
p=new JU.BS,s=this.done[a],n="",v=k.monomerCount,r=b;r<v;++r){var q=r-b,w=0;if(c[r][0][0]==a&&c[r][0][1]==q||c[r][w=1][0]==a&&c[r][1][1]==q){var x=k.monomers[q].leadAtomIndex,u=this.bsBad.nextSetBit(x),y=k.monomers[r];if(!(u>=x&&u<=y.leadAtomIndex)){h.set(q);j.setBits(q+1,r);m.set(r);var u=s.nextSetBit(q),x=0>u||u>=r,A=!1;if(0<q&&h.get(q-1)&&(4==b||x))p.setBits(q,r),x||(n+="  WARNING! Bridge to helix at "+k.monomers[u]),A=!0;else if(x||s.nextClearBit(u)<r)A=!0;m.get(q)&&l.set(q);A&&null!=this.vHBonds&&
this.addHbond(y,k.monomers[q],c[r][w][2],f,null)}}}this.doReport?(c=Z(v,"\x00"),this.setTag(c,j,String.fromCharCode(48+b)),this.setTag(c,h,">"),this.setTag(c,m,"<"),this.setTag(c,l,"X")):c=null;s.or(p);j.andNot(s);e.or(j);e.andNot(p);this.$setStructure&&this.setStructure(k,p,d);return this.doReport?(this.setTag(this.labels[a],p,String.fromCharCode(68+b)),String.valueOf(c)+n):""},"~N,~N,~A,J.c.STR,~N,JU.BS");e(c$,"setTag",function(a,b,c){for(var d=b.nextSetBit(0);0<=d;d=b.nextSetBit(d+1))a[d]=c},"~A,JU.BS,~S");
e(c$,"setStructure",function(a,b,c){for(var d=b.nextSetBit(0);0<=d;d=b.nextSetBit(d+1)){var f=b.nextClearBit(d);0>f&&(f=a.monomerCount);a.addStructureProtected(c,null,0,0,d,f-1);d=f}},"JM.AminoPolymer,JU.BS,J.c.STR")});n("J.shapebio");v(["J.shape.AtomShape"],"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;y(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});F(c$,function(a,b,c){S(this,J.shapebio.BioShape,[]);this.shape=a;this.modelIndex=b;this.bioPolymer=c;this.isActive=a.isActive;this.bsSizeDefault=new JU.BS;
this.monomerCount=c.monomerCount;0<this.monomerCount&&(this.colixes=aa(this.monomerCount,0),this.paletteIDs=ba(this.monomerCount,0),this.mads=aa(this.monomerCount+1,0),this.monomers=c.monomers,this.meshReady=ia(this.monomerCount,!1),this.meshes=Array(this.monomerCount),this.wingVectors=c.getWingVectors(),this.leadAtomIndices=c.getLeadAtomIndices())},"J.shapebio.BioShapeCollection,~N,JM.BioPolymer");e(c$,"calcBfactorRange",function(){this.bfactorMin=this.bfactorMax=this.monomers[0].getLeadAtom().getBfactor100();
for(var a=this.monomerCount;0<--a;){var b=this.monomers[a].getLeadAtom().getBfactor100();b<this.bfactorMin?this.bfactorMin=b:b>this.bfactorMax&&(this.bfactorMax=b)}this.floatRange=this.range=this.bfactorMax-this.bfactorMin;this.hasBfactorRange=!0});e(c$,"calcMeanPositionalDisplacement",function(a){return ja(1E3*Math.sqrt(a/7895.6835208714865))},"~N");h(c$,"findNearestAtomIndex",function(a,b,c,d){this.bioPolymer.findNearestAtomIndex(a,b,c,this.mads,this.shape.vf,d)},"~N,~N,~A,JU.BS");e(c$,"setMad",
function(a,b,c){if(!(2>this.monomerCount)){this.isActive=!0;null==this.bsSizeSet&&(this.bsSizeSet=new JU.BS);for(var d=this.shape.vf,f=32768==d&&A(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=$(2E3*c[h])}var n=0<(this.mads[e]=this.getMad(e,a));this.bsSizeSet.setBitTo(e,n);this.monomers[e].setShapeVisibility(d,n);this.shape.atoms[h].setShapeVisibility(d,n);f&&this.monomers[e].setRingsVisible(n);
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 $(1750*c+250);case -4:return c=this.monomers[a].getLeadAtom(),2*this.calcMeanPositionalDisplacement(c.getBfactor100())}JU.Logger.error("unrecognized setMad("+b+")");return 0},"~N,~N");e(c$,"falsifyMesh",function(){if(null!=this.meshReady)for(var a=0;a<this.monomerCount;a++)this.meshReady[a]=!1});e(c$,
"falsifyNearbyMesh",function(a){null!=this.meshReady&&(this.meshReady[a]=!1,0<a&&(this.meshReady[a-1]=!1),a<this.monomerCount-1&&(this.meshReady[a+1]=!1))},"~N");e(c$,"setColixBS",function(a,b,c){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=new JU.BS);for(var d=this.monomerCount;0<=--d;){var f=this.leadAtomIndices[d];c.get(f)&&(this.colixes[d]=this.shape.getColixI(a,b,f),null!=this.colixesBack&&this.colixesBack.length>d&&(this.colixesBack[d]=0),this.paletteIDs[d]=b,this.bsColixSet.setBitTo(d,
0!=this.colixes[d]))}},"~N,~N,JU.BS");e(c$,"setColixes",function(a,b){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=new JU.BS);for(var c=this.monomerCount;0<=--c;){var d=this.leadAtomIndices[c];b.get(d)&&(c<this.colixes.length&&d<a.length)&&(this.colixes[c]=this.shape.getColixI(a[d],J.c.PAL.UNKNOWN.id,d),null!=this.colixesBack&&c<this.colixesBack.length&&(this.colixesBack[c]=0),this.paletteIDs[c]=J.c.PAL.UNKNOWN.id,this.bsColixSet.set(c))}},"~A,JU.BS");e(c$,"setParams",function(a,b,c){if(0!=
this.monomerCount){var d=a[0];a=a[1];this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=new JU.BS);for(var f=b.length,e=this.monomerCount;0<=--e;){var h=this.leadAtomIndices[e];if(c.get(h)&&e<this.colixes.length&&h<f){var n=b[h],j=null==d?0:d[n],n=null==a?0:a[n];0.01<n&&(j=JU.C.getColixTranslucent3(j,!0,n));this.colixes[e]=this.shape.getColixI(j,J.c.PAL.UNKNOWN.id,h);null!=this.colixesBack&&e<this.colixesBack.length&&(this.colixesBack[e]=0);this.paletteIDs[e]=J.c.PAL.UNKNOWN.id;this.bsColixSet.set(e)}}}},
"~A,~A,JU.BS");e(c$,"setColixBack",function(a,b){for(var c=this.monomerCount;0<=--c;)b.get(this.leadAtomIndices[c])&&(null==this.colixesBack&&(this.colixesBack=aa(this.colixes.length,0)),this.colixesBack.length<this.colixes.length&&(this.colixesBack=JU.AU.ensureLengthShort(this.colixesBack,this.colixes.length)),this.colixesBack[c]=a)},"~N,JU.BS");e(c$,"setTranslucent",function(a,b,c){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=new JU.BS);for(var d=this.monomerCount;0<=--d;)b.get(this.leadAtomIndices[d])&&
(this.colixes[d]=JU.C.getColixTranslucent3(this.colixes[d],a,c),null!=this.colixesBack&&this.colixesBack.length>d&&(this.colixesBack[d]=JU.C.getColixTranslucent3(this.colixesBack[d],a,c)),this.bsColixSet.setBitTo(d,0!=this.colixes[d]))},"~B,JU.BS,~N");h(c$,"setAtomClickability",function(){if(this.isActive&&!(null==this.wingVectors||0==this.monomerCount))for(var a=A(this.bioPolymer,JM.NucleicPolymer)&&11==this.shape.shapeID,b=A(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())}});I(c$,"eightPiSquared100",7895.6835208714865)});n("J.shapebio");v(["J.shape.Shape"],"J.shapebio.BioShapeCollection",["JU.AU","J.c.PAL","J.shapebio.BioShape","JU.BSUtil","$.C"],function(){c$=w(function(){this.atoms=null;this.madOn=-2;this.madHelixSheet=3E3;this.madTurnRandom=800;this.madDnaRna=5E3;this.isActive=!1;this.bioShapes=
null;y(this,arguments)},J.shapebio,"BioShapeCollection",J.shape.Shape);h(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$,"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=K(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].getBioPolymer(f);d[c]=null==this.bioShapes||this.bioShapes.length<=c||null==this.bioShapes[c]||this.bioShapes[c].bioPolymer!==e?new J.shapebio.BioShape(this,a,e):this.bioShapes[c]}this.bioShapes=d});h(c$,"findNearestAtomIndex",function(a,b,c,d){for(var f=this.bioShapes.length;0<=--f;)this.bioShapes[f].findNearestAtomIndex(a,b,c,d)},"~N,~N,~A,JU.BS");
h(c$,"setModelVisibilityFlags",function(a){if(null!=this.bioShapes){a=JU.BSUtil.copy(a);for(var b=this.ms.mc;0<=--b;)a.get(b)&&this.ms.isTrajectory(b)&&a.set(this.ms.getTrajectoryIndex(b));for(b=this.bioShapes.length;0<=--b;){var c=this.bioShapes[b];c.modelVisibilityFlags=a.get(c.modelIndex)?this.vf:0}}},"JU.BS");h(c$,"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")});n("J.shapebio");v(["J.shapebio.BioShapeCollection"],"J.shapebio.Rockets",null,function(){c$=E(J.shapebio,"Rockets",J.shapebio.BioShapeCollection);e(c$,"initShape",function(){Y(this,J.shapebio.Rockets,"initShape",[]);this.madTurnRandom=500})});n("J.shapebio");v(["J.shapebio.Rockets"],"J.shapebio.Cartoon",null,function(){c$=E(J.shapebio,"Cartoon",J.shapebio.Rockets);e(c$,"initShape",function(){Y(this,J.shapebio.Cartoon,"initShape",[]);
this.madDnaRna=1E3})});n("J.shapebio");v(["J.shapebio.BioShapeCollection"],"J.shapebio.Backbone",["java.lang.Float","JU.BS"],function(){c$=w(function(){this.bsSelected=null;y(this,arguments)},J.shapebio,"Backbone",J.shapebio.BioShapeCollection);e(c$,"initShape",function(){Y(this,J.shapebio.Backbone,"initShape",[]);this.madOn=1;this.madHelixSheet=1500;this.madTurnRandom=500;this.madDnaRna=2E3;this.isActive=!0});h(c$,"setProperty",function(a,b,c){"bitset"===a?this.bsSelected=b:this.setPropBSC(a,b,c)},
"~S,~O,JU.BS");h(c$,"setShapeSizeRD",function(a,b,c){this.initialize();var d=null!=this.bsSelected;d&&(c=this.bsSelected);for(var f=this.bioShapes.length;0<=--f;){var e=this.bioShapes[f];if(0!=e.monomerCount){var h=this.vwr.getBoolean(603979812),n=e.bioPolymer.getLeadAtomIndices(),j=0!=a;null==e.bsSizeSet&&(e.bsSizeSet=new JU.BS);e.isActive=!0;for(var l=e.monomerCount-1;0<=--l;){var m=n[l],p=n[l+1],s=c.get(m),t=c.get(p);if(s&&t||d&&s||h&&(s||t)){e.monomers[l].setShapeVisibility(this.vf,j);s=this.ms.at[m];
if(null!=b){if(Float.isNaN(b.values[m])||Float.isNaN(b.values[p]))continue;a=$(1E3*(b.values[m]+b.values[p]));j=0!=a}m=this.ms.at[p];0!=e.mads[l]!=j&&(s.addDisplayedBackbone(this.vf,j),m.addDisplayedBackbone(this.vf,j));e.mads[l]=a;e.bsSizeSet.setBitTo(l,j);e.bsSizeDefault.setBitTo(l,-1==a)}}}}d&&(this.bsSelected=null)},"~N,J.atomdata.RadiusData,JU.BS");h(c$,"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)}})});n("J.shapebio");v(["J.shapebio.BioShapeCollection"],"J.shapebio.Strands",null,function(){c$=w(function(){this.isMesh=!1;y(this,arguments)},J.shapebio,"Strands",J.shapebio.BioShapeCollection)});n("J.shapebio");v(["J.shapebio.BioShapeCollection"],"J.shapebio.Ribbons",null,function(){c$=E(J.shapebio,"Ribbons",J.shapebio.BioShapeCollection)});n("J.shapebio");v(["J.shapebio.Strands"],
"J.shapebio.MeshRibbon",null,function(){c$=E(J.shapebio,"MeshRibbon",J.shapebio.Strands);e(c$,"initShape",function(){Y(this,J.shapebio.MeshRibbon,"initShape",[]);this.isMesh=!0})});n("J.shapebio");v(["J.shapebio.BioShapeCollection"],"J.shapebio.Trace",["J.atomdata.RadiusData","J.c.VDW"],function(){c$=E(J.shapebio,"Trace",J.shapebio.BioShapeCollection);e(c$,"initShape",function(){Y(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=Q(b.length(),0),f=0,e=0,h=3.4028235E38,n=0,j=b.nextSetBit(0);0<=j;j=b.nextSetBit(j+1)){var l=this.atoms[j].atomPropertyFloat(null,1112541196,null),f=f+l,e=e+l*l;l<h&&(h=l);l>n&&(n=l)}var l=f/c,c=Math.sqrt((e-f*f/c)/c),f=a[1],e=a[2],m=a[3],p=a[4],s=a[5],t=L(a[6]),n=n-h,v=!1;switch(t){case 0:case 1:case 2:case 3:v=!0}for(j=b.nextSetBit(0);0<=
j;j=b.nextSetBit(j+1)){var r=this.atoms[j].atomPropertyFloat(null,1112541196,null);switch(t){case 0:case 4:r=1+(r-l)/e/c;break;case 1:case 5:r=(r-h)/n/e;break;case 2:case 6:r/=e;break;case 8:0>r&&(r=0),r=Math.sqrt(r/8)/3.141592653589793}0>r&&(r=0);v&&(r=Math.pow(r,s));r<m&&0<=m&&(r=m);r>p&&0<=p&&(r=p);d[j]=r*f}d=new J.atomdata.RadiusData(d,0,J.atomdata.RadiusData.EnumType.ABSOLUTE,J.c.VDW.AUTO);this.setShapeSizeRD(0,d,b)}},"~A,JU.BS");I(c$,"PUTTY_NormalizedNonlinear",0,"PUTTY_RelativeNonlinear",1,
"PUTTY_ScaledNonlinear",2,"PUTTY_AbsoluteNonlinear",3,"PUTTY_NormalizedLinear",4,"PUTTY_RelativeLinear",5,"PUTTY_ScaledLinear",6,"PUTTY_AbsoluteLinear",7,"PUTTY_ImpliedRMS",8)});n("J.renderbio");v("J.render.MeshRenderer JU.A4 $.BS $.M3 $.P3 $.P3i $.V3".split(" "),"J.renderbio.BioShapeRenderer","J.c.STR JM.CarbohydratePolymer $.NucleicPolymer J.shape.Mesh JU.C $.GData $.Logger $.Normix".split(" "),function(){c$=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=this.isPass2=!1;this.pointT=
null;this.diameterEnd=this.diameterMid=this.diameterBeg=this.iNext3=this.iNext2=this.iNext=this.iPrev=0;this.doCap1=this.doCap0=!1;this.colixBack=0;this.norml=this.bsTemp=this.mat=this.ptNext=this.ptPrev=this.pt1=this.pt=this.aa=this.wingT=this.wing1=this.wing=this.norm=this.radiusHermites=this.wingHermites=this.controlHermites=this.screenArrowBotPrev=this.screenArrowBot=this.screenArrowTopPrev=this.screenArrowTop=this.reversed=null;y(this,arguments)},J.renderbio,"BioShapeRenderer",J.render.MeshRenderer);
X(c$,function(){this.bsVisible=new JU.BS;this.pointT=new JU.P3;this.screenArrowTop=new JU.P3i;this.screenArrowTopPrev=new JU.P3i;this.screenArrowBot=new JU.P3i;this.screenArrowBotPrev=new JU.P3i;this.norm=new JU.V3;this.wing=new JU.V3;this.wing1=new JU.V3;this.wingT=new JU.V3;this.aa=new JU.A4;this.pt=new JU.P3;this.pt1=new JU.P3;this.ptPrev=new JU.P3;this.ptNext=new JU.P3;this.mat=new JU.M3;this.norml=new JU.V3});h(c$,"render",function(){if(null==this.shape)return!1;this.setGlobals();this.renderShapes();
return this.needTranslucent});e(c$,"setGlobals",function(){this.isPass2=this.vwr.gdata.isPass2;this.needTranslucent=this.invalidateMesh=!1;this.g3d.addRenderer(553648147);var a=!this.isExport&&!this.vwr.checkMotionRendering(1113200642);a!=this.wireframeOnly&&(this.invalidateMesh=!0);this.wireframeOnly=a;a=this.isExport||!this.wireframeOnly&&this.vwr.getBoolean(603979864);a!=this.isHighRes&&(this.invalidateMesh=!0);this.isHighRes=a;a=!this.wireframeOnly&&this.vwr.getBoolean(603979817);this.cartoonsFancy!=
a&&(this.invalidateMesh=!0,this.cartoonsFancy=a);a=this.vwr.getHermiteLevel();a=0>=a?-a:this.vwr.getInMotion(!0)?0:a;this.cartoonsFancy&&!this.wireframeOnly&&(a=Math.max(a,3));a!=this.hermiteLevel&&(this.invalidateMesh=!0);this.hermiteLevel=Math.min(a,8);var b=this.vwr.getInt(553648166),b=Math.min(Math.max(0,b),20);this.cartoonsFancy&&16<=b&&(b=4);if(this.wireframeOnly||0==this.hermiteLevel)b=0;b!=this.aspectRatio&&(0!=b&&0!=a)&&(this.invalidateMesh=!0);this.aspectRatio=b;a=this.vwr.getBoolean(603979966);
a!=this.isTraceAlpha&&(this.invalidateMesh=!0);this.isTraceAlpha=a;this.invalidateSheets=!1;a=this.vwr.getFloat(570425392);a!=this.sheetSmoothing&&this.isTraceAlpha&&(this.sheetSmoothing=a,this.invalidateSheets=this.invalidateMesh=!0)});e(c$,"renderShapes",function(){for(var a=this.shape,b=a.bioShapes.length;0<=--b;){var c=a.getBioShape(b);0!=(c.modelVisibilityFlags&this.myVisibilityFlag)&&(2<=c.monomerCount&&this.initializePolymer(c))&&(this.bsRenderMesh.clearAll(),this.renderBioShape(c),this.renderMeshes(),
this.freeTempArrays())}});e(c$,"setBioColix",function(a){if(this.g3d.setC(a))return!0;this.needTranslucent=!0;return!1},"~N");e(c$,"freeTempArrays",function(){this.haveControlPointScreens&&this.vwr.freeTempScreens(this.controlPointScreens);this.vwr.freeTempEnum(this.structureTypes)});e(c$,"initializePolymer",function(a){var b=this.vwr.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(603979898);this.isNucleic=A(a.bioPolymer,JM.NucleicPolymer);this.isCarbohydrate=A(a.bioPolymer,JM.CarbohydratePolymer);this.haveControlPointScreens=!1;this.wingVectors=a.wingVectors;this.meshReady=a.meshReady;this.meshes=a.meshes;this.mads=a.mads;this.colixes=a.colixes;this.colixesBack=a.colixesBack;this.setStructureTypes();return!0},"J.shapebio.BioShape");
e(c$,"setStructureTypes",function(){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.allocTempScreens(a),c=this.controlPoints;0<=--a;)this.tm.transformPtScr(c[a],b[a]);this.haveControlPointScreens=!0});e(c$,"calcScreens",
function(a,b){var c=this.controlPoints.length,d=this.vwr.allocTempScreens(c);if(0==a)for(;0<=--c;)this.tm.transformPtScr(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.transformPtScr(this.pointT,f)},"JU.P3,JU.V3,~N,~N,JU.P3i");e(c$,"getLeadColix",function(a){return JU.C.getColixInherited(this.colixes[a],
this.monomers[a].getLeadAtom().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&&(A(this,J.renderbio.TraceRenderer),this.madEnd=this.madBeg),this.madMid=this.madBeg+this.madEnd>>1}else{if(!b||this.structureTypes[a]===this.structureTypes[this.iPrev])this.madBeg=(0==this.mads[this.iPrev]?this.madMid:this.mads[this.iPrev])+this.madMid>>1;if(!b||this.structureTypes[a]===this.structureTypes[this.iNext])this.madEnd=(0==this.mads[this.iNext]?this.madMid:this.mads[this.iNext])+this.madMid>>1}this.diameterBeg=
L(this.vwr.tm.scaleToScreen(this.controlPointScreens[a].z,this.madBeg));this.diameterMid=L(this.vwr.tm.scaleToScreen(this.monomers[a].getLeadAtom().sZ,this.madMid));this.diameterEnd=L(this.vwr.tm.scaleToScreen(this.controlPointScreens[this.iNext].z,this.madEnd));this.doCap0=a==this.iPrev||b&&this.structureTypes[a]!==this.structureTypes[this.iPrev];this.doCap1=this.iNext==this.iNext2||b&&this.structureTypes[a]!==this.structureTypes[this.iNext];return 0<this.aspectRatio&&(1==this.exportType||this.checkDiameter(this.diameterBeg)||
this.checkDiameter(this.diameterMid)||this.checkDiameter(this.diameterEnd))},"~N,~B");e(c$,"checkDiameter",function(a){return(new Boolean((new Boolean(this.isHighRes&3<a)).valueOf()||8<=a)).valueOf()},"~N");e(c$,"renderHermiteCylinder",function(a,b){this.colix=this.getLeadColix(b);this.setBioColix(this.colix)&&(this.setNeighbors(b),this.g3d.drawHermite4(this.isNucleic?4:7,a[this.iPrev],a[b],a[this.iNext],a[this.iNext2]))},"~A,~N");e(c$,"renderHermiteConic",function(a,b,c){this.setNeighbors(a);this.colix=
this.getLeadColix(a);if(this.setBioColix(this.colix)){if(this.setMads(a,b)||this.isExport)try{if((null==this.meshes[a]||!this.meshReady[a])&&!this.createMesh(a,this.madBeg,this.madMid,this.madEnd,1,c))return;this.meshes[a].setColix(this.colix);this.bsRenderMesh.set(a);return}catch(d){if(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],L(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,D(Math.floor(1.2*this.madBeg)),D(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],L(this.aspectRatio),this.colixBack);this.ribbonBorder&&0==this.aspectRatio&&this.g3d.fillCylinderXYZ(this.colix,this.colix,3,1==this.exportType?50:3,this.screenArrowTop.x,this.screenArrowTop.y,this.screenArrowTop.z,this.screenArrowBot.x,this.screenArrowBot.y,this.screenArrowBot.z)}},"~N");e(c$,"createMesh",function(a,b,c,d,f,e){this.setNeighbors(a);if(0==this.controlPoints[a].distanceSquared(this.controlPoints[this.iNext]))return!1;var h=1!=f&&null!=this.wingVectors,
n=0==f,j=this.cartoonsFancy||6<=this.hermiteLevel,l=2*(this.hermiteLevel+1)+1,m=n?4:4*(this.hermiteLevel+1)-2,p=n?3.141592653589793/(m-1):6.283185307179586/m,s=this.meshes[a]=(new J.shape.Mesh).mesh1(this.vwr,"mesh_"+this.shapeID+"_"+a,0,a),t=b!=c||c!=d;if(null==this.controlHermites||this.controlHermites.length<l+1)this.controlHermites=Array(l+1);JU.GData.getHermiteList(e,this.controlPoints[this.iPrev],this.controlPoints[a],this.controlPoints[this.iNext],this.controlPoints[this.iNext2],this.controlPoints[this.iNext3],
this.controlHermites,0,l,!0);if(null==this.wingHermites||this.wingHermites.length<l+1)this.wingHermites=Array(l+1);this.wing.setT(this.wingVectors[this.iPrev]);0==d&&this.wing.scale(2);JU.GData.getHermiteList(e,this.wing,this.wingVectors[a],this.wingVectors[this.iNext],this.wingVectors[this.iNext2],this.wingVectors[this.iNext3],this.wingHermites,0,l,!1);b/=2E3;c/=2E3;d/=2E3;if(t){if(null==this.radiusHermites||this.radiusHermites.length<(l+1>>1)+1)this.radiusHermites=Array((l+1>>1)+1);this.ptPrev.set(b,
b,0);this.pt.set(b,c,0);this.pt1.set(c,d,0);this.ptNext.set(d,d,0);JU.GData.getHermiteList(4,this.ptPrev,this.pt,this.pt1,this.ptNext,this.ptNext,this.radiusHermites,0,l+1>>1,!0)}d=0;c=l>>1;e=D((m+2)/4);for(var v=D((3*m+2)/4),h=!h?0:n?1:j?2:3,j=0==h||3==h,r=0;r<l;r++){this.norm.sub2(this.controlHermites[r+1],this.controlHermites[r]);var q=!t?b:r<c?this.radiusHermites[r].x:this.radiusHermites[r-c].y;this.wing.setT(this.wingHermites[r]);this.wing1.setT(this.wing);switch(h){case 2:this.wing1.cross(this.norm,
this.wing);this.wing1.normalize();this.wing1.scale(this.wing.length()/f);break;case 3:this.wing.scale(2/f);this.wing1.sub(this.wing);break;case 0:this.wing.cross(this.wing,this.norm),this.wing.normalize()}this.wing.scale(q);this.wing1.scale(q);j&&(this.aa.setVA(this.norm,p),this.mat.setAA(this.aa));this.pt1.setT(this.controlHermites[r]);for(var w=n?0:p,q=0;q<m;q++,w+=p){j&&0<q&&this.mat.rotate(this.wing);switch(h){case 1:this.wingT.setT(this.wing1);this.wingT.scale(Math.cos(w));break;case 2:this.wingT.setT(this.wing1);
this.wingT.scale(Math.sin(w));this.wingT.scaleAdd2(Math.cos(w),this.wing,this.wingT);break;case 3:this.wingT.setT(this.wing);(q==e||q==v)&&this.wing1.scale(-1);this.wingT.add(this.wing1);break;case 0:this.wingT.setT(this.wing)}this.pt.add2(this.pt1,this.wingT);s.addV(this.pt,!0)}if(0<r){w=n?m-1:m;for(q=0;q<w;q++){var x=d-m+q,u=d-m+(q+1)%m,y=d+(q+1)%m,A=d+q;q<D(w/2)?s.addQuad(x,u,y,A):s.addQuad(u,y,A,x)}}d+=m}if(!n){f=d;if(this.doCap0){for(n=0;n<m;n++)s.addV(s.vs[n],!0);d+=m;for(q=2*this.hermiteLevel;0<=
--q;)s.addQuad(d-m+q+2,d-m+q+1,d-m+(m-q)%m,d-q-1)}if(this.doCap1){for(n=0;n<m;n++)s.addV(s.vs[f-m+n],!0);d+=m;for(q=2*this.hermiteLevel;0<=--q;)s.addQuad(d-q-1,d-m+(m-q)%m,d-m+q+1,d-m+q+2)}}this.meshReady[a]=!0;this.adjustCartoonSeamNormals(a,m);s.setVisibilityFlags(1);return!0},"~N,~N,~N,~N,~N,~N");e(c$,"adjustCartoonSeamNormals",function(a,b){null==this.bsTemp&&(this.bsTemp=JU.Normix.newVertexBitSet());if(a==this.iNext-1&&this.iNext<this.monomerCount&&this.monomers[a].getStrucNo()==this.monomers[this.iNext].getStrucNo()&&
this.meshReady[a]&&this.meshReady[this.iNext])try{var c=this.meshes[this.iNext].getNormalsTemp(),d=this.meshes[a].getNormalsTemp(),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.renderMesh(this.meshes[a])});I(c$,"ABSOLUTE_MIN_MESH_SIZE",3,"MIN_MESH_RENDER_SIZE",8,"MODE_TUBE",0,"MODE_FLAT",1,"MODE_ELLIPTICAL",2,"MODE_NONELLIPTICAL",3)});n("J.renderbio");v(["J.renderbio.BioShapeRenderer"],"J.renderbio.StrandsRenderer",["J.shapebio.Strands"],function(){c$=w(function(){this.strandCount=
1;this.baseStrandOffset=this.strandSeparation=0;y(this,arguments)},J.renderbio,"StrandsRenderer",J.renderbio.BioShapeRenderer);h(c$,"renderBioShape",function(){this.renderStrandShape()},"J.shapebio.BioShape");e(c$,"renderStrandShape",function(){this.setStrandCount()&&this.renderStrands()});e(c$,"setStrandCount",function(){if(null==this.wingVectors)return!1;this.strandCount=A(this.shape,J.shapebio.Strands)?this.vwr.getStrandCount(this.shape.shapeID):10;this.strandSeparation=1>=this.strandCount?0:1/
(this.strandCount-1);this.baseStrandOffset=0==(this.strandCount&1)?this.strandSeparation/2:this.strandSeparation;return!0});e(c$,"renderStrands",function(){for(var a,b=this.strandCount>>1;0<=--b;){var c=b*this.strandSeparation+this.baseStrandOffset;a=this.calcScreens(c,this.mads);this.renderStrand(a);this.vwr.freeTempScreens(a);a=this.calcScreens(-c,this.mads);this.renderStrand(a);this.vwr.freeTempScreens(a)}1==this.strandCount%2&&(a=this.calcScreens(0,this.mads),this.renderStrand(a),this.vwr.freeTempScreens(a))});
e(c$,"renderStrand",function(a){for(var b=this.bsVisible.nextSetBit(0);0<=b;b=this.bsVisible.nextSetBit(b+1))this.renderHermiteCylinder(a,b)},"~A")});n("J.renderbio");v(["J.renderbio.MeshRibbonRenderer"],"J.renderbio.RibbonsRenderer",null,function(){c$=E(J.renderbio,"RibbonsRenderer",J.renderbio.MeshRibbonRenderer);h(c$,"renderBioShape",function(){null!=this.wingVectors&&(this.wireframeOnly?this.renderStrands():this.render2Strand(!0,this.isNucleic?1:0.5,this.isNucleic?0:0.5))},"J.shapebio.BioShape")});
n("J.renderbio");v(["J.renderbio.StrandsRenderer"],"J.renderbio.MeshRibbonRenderer",null,function(){c$=E(J.renderbio,"MeshRibbonRenderer",J.renderbio.StrandsRenderer);h(c$,"renderBioShape",function(){this.wireframeOnly?this.renderStrands():this.renderMeshRibbon()},"J.shapebio.BioShape");e(c$,"renderMeshRibbon",function(){if(this.setStrandCount()){var a=(this.strandCount>>1)*this.strandSeparation+this.baseStrandOffset;this.render2Strand(!1,a,a);this.renderStrands()}});e(c$,"render2Strand",function(a,
b,c){this.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.freeTempScreens(this.ribbonTopScreens);this.vwr.freeTempScreens(this.ribbonBottomScreens)},"~B,~N,~N")});n("J.renderbio");v(["J.renderbio.StrandsRenderer"],"J.renderbio.RocketsRenderer",["JU.P3","J.c.STR","J.renderbio.RocketRenderer"],function(){c$=
w(function(){this.isRockets=!1;this.helixRockets=!0;this.renderArrowHeads=!1;this.rr=this.cordMidPoints=null;y(this,arguments)},J.renderbio,"RocketsRenderer",J.renderbio.StrandsRenderer);h(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=new J.renderbio.RocketRenderer(this,this.isRockets));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()})});n("J.renderbio");v(["J.renderbio.RocketsRenderer"],"J.renderbio.CartoonRenderer",["J.api.Interface","J.c.STR"],function(){c$=w(function(){this.nucleicRenderer=null;y(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.freeTempScreens(this.ribbonTopScreens);this.vwr.freeTempScreens(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 n=this.structureTypes[h]===J.c.STR.SHEET;this.bsVisible.get(h)&&(d&&e?g=!0:n||d?a&&n||b&&d?this.renderHermiteRibbon(!0,h,!0):this.renderHermiteArrowHead(h):this.renderHermiteConic(h,!0,7));a=n;b=d&&!this.helixRockets}g&&this.renderRockets()})});n("J.renderbio");v(["J.renderbio.BioShapeRenderer"],
"J.renderbio.BackboneRenderer",["JU.C"],function(){c$=w(function(){this.isDataFrame=!1;y(this,arguments)},J.renderbio,"BackboneRenderer",J.renderbio.BioShapeRenderer);h(c$,"renderBioShape",function(a){var b=this.vwr.getBoolean(603979811)&&a.bioPolymer.isNucleic();this.isDataFrame=this.vwr.ms.isJmolDataFrameForModel(a.modelIndex);for(a=this.bsVisible.nextSetBit(0);0<=a;a=this.bsVisible.nextSetBit(a+1)){var c=this.ms.at[this.leadAtomIndices[a]],d=this.colixes[a];this.mad=this.mads[a];this.drawSegment(c,
this.ms.at[this.leadAtomIndices[a+1]],d,this.colixes[a+1],100);if(b){var e=this.monomers[a],g=e.getBasePairs();if(null!=g)for(var h=g.size();0<=--h;){var n=g.get(h).getPartnerAtom(e);n>a&&this.drawSegment(c,this.ms.at[n],d,d,1E3)}}}},"J.shapebio.BioShape");e(c$,"drawSegment",function(a,b,c,d,e){if(!(0==a.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),
this.isExport||this.isPass2||this.setBioColix(c)||this.setBioColix(d)){var g=a.sX,h=a.sY;a=a.sZ;var n=b.sX,j=b.sY;b=b.sZ;var l=this.mad;1E3==e&&(l>>=1);0>l?this.g3d.drawLine(c,d,g,h,a,n,j,b):(e=L(1==this.exportType?l:this.vwr.tm.scaleToScreen(D((a+b)/2),l)),this.g3d.fillCylinderXYZ(c,d,3,e,g,h,a,n,j,b))}},"JM.Atom,JM.Atom,~N,~N,~N")});n("J.renderbio");v(["J.renderbio.StrandsRenderer"],"J.renderbio.TraceRenderer",null,function(){c$=E(J.renderbio,"TraceRenderer",J.renderbio.StrandsRenderer);h(c$,"renderBioShape",
function(){this.wireframeOnly?this.renderStrands():this.renderTrace()},"J.shapebio.BioShape");e(c$,"renderTrace",function(){this.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);
