(function(ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,Aa,Ba,Ca,Da,Ea,Fa,e,Ga,Ha,Ia,Ja,Ka,La,Ma,Na,Oa,h,Pa,Qa,Ra,Sa,B,p,z,v,x,A,H,M,V,F,P,I,R,E,Q,U,ba,ca,da,ea,aa,fa,ga,ha,Ta,Ua,Z,W,Va,ia,X,Wa,Xa,Y,Ya,Za,$a,ab,ja){p("J.adapter.readers.pdb");v(["J.adapter.smarter.AtomSetCollectionReader","java.util.Hashtable"],"J.adapter.readers.pdb.PdbReader","java.lang.Boolean $.Character $.Float JU.List $.M4 $.P3 $.PT $.SB J.adapter.smarter.Atom $.Structure J.api.Interface $.JmolAdapter J.constant.EnumStructure J.util.Escape $.Logger".split(" "),
function(){c$=A(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.chainAtomCounts=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.atomCount=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.lastAtomData=null;this.lastAtomIndex=0;this.lastGroup=-2147483648;this.lastInsertion="\x00";this.lastTargetSerial=this.lastSourceSerial=-2147483648;this.atomTypeLen=this.atomTypePt0=this.tlsGroupID=0;this.haveDoubleBonds=this.isCourseGrained=
!1;this.tlsU=this.dataT=null;x(this,arguments)},J.adapter.readers.pdb,"PdbReader",J.adapter.smarter.AtomSetCollectionReader);Q(c$,function(){this.htFormul=new java.util.Hashtable;this.dataT=R(8,0)});h(c$,"initializeReader",function(){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.simpleReplace(this.filter,"ASSEMBLY","BIOMOLECULE"));var a=this.checkFilterKey("BIOMOLECULE"),
b=a&&this.checkFilterKey("BYCHAIN"),a=a&&this.checkFilterKey("BYSYMOP");(this.isCourseGrained=b||a)||this.setIsPDB();this.htParams.containsKey("vTlsModels")&&(this.vTlsModels=this.htParams.remove("vTlsModels"));b=this.getFilter("TYPE ");null!=b&&(b=JU.PT.getTokens(b.$replace(","," ")),this.atomTypePt0=Integer.parseInt(b[0])-1,a=b[1].indexOf("="),0<=a?this.setFilterAtomTypeStr(b[1].substring(a+1).toUpperCase()):a=b[1].length,this.atomTypeLen=Integer.parseInt(b[1].substring(0,a)));b=this.getFilter("CONF ");
null!=b&&(this.configurationPtr=this.parseIntStr(b),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   ".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.pdbHeader.append(this.line).appendC("\n"));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(),this.checkLastModel();this.isCourseGrained||
this.atomSetCollection.connectAll(this.maxSerial,this.isConnectStateBug);0<this.atomCount&&this.applySymmetryAndSetTrajectory();this.model(c);if(this.isLegacyModelType||!b)return!0}if(this.isMultiModel&&!this.doProcessLines)return!0;if(b)return this.getHeader=!1,this.atom(),!0;switch(a){case 3:this.conect();break;case 4:case 5:case 6:this.structure();break;case 7:this.het();break;case 8:this.hetnam();break;case 9:this.anisou();break;case 10:this.site();break;case 11:this.cryst1();break;case 12:case 13:case 14:this.scale(a-
11);break;case 15:this.expdta();break;case 16:this.formul();break;case 17:if(this.line.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()}return!0});h(c$,"finalizeReader",function(){this.finalizeReaderPDB()});e(c$,"finalizeReaderPDB",function(){this.checkNotPDB();this.isCourseGrained||this.atomSetCollection.connectAll(this.maxSerial,this.isConnectStateBug);var a;null!=this.vBiomolecules&&(0<this.vBiomolecules.size()&&0<this.atomSetCollection.getAtomCount())&&(this.atomSetCollection.setAtomSetAuxiliaryInfo("biomolecules",this.vBiomolecules),
this.setBiomoleculeAtomCounts(),null!=this.thisBiomolecule&&this.applySymmetry&&(this.atomSetCollection.applySymmetryBio(this.thisBiomolecule,this.notionalUnitCell,this.applySymmetryToBonds,this.filter),this.vTlsModels=null));if(null!=this.vTlsModels){a=J.api.Interface.getOptionInterface("symmetry.Symmetry");var b=this.atomSetCollection.getAtomSetCount();if(b==this.vTlsModels.size())for(;0<=--b;)this.setTlsGroups(b,b,a);else if(J.util.Logger.info(b+" models but "+this.vTlsModels.size()+" TLS descriptions"),
1==this.vTlsModels.size())for(J.util.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.atomSetCollection.setAtomSetCollectionAuxiliaryInfo("tlsErrors",this.sbTlsErrors.toString()),this.appendLoadNote(this.sbTlsErrors.toString()));this.finalizeReaderASCR();null!=this.vCompnds&&this.atomSetCollection.setAtomSetCollectionAuxiliaryInfo("compoundSource",this.vCompnds);
null!=this.htSites&&this.addSites(this.htSites);null!=this.pdbHeader&&this.atomSetCollection.setAtomSetCollectionAuxiliaryInfo("fileHeader",this.pdbHeader.toString());0<this.configurationPtr&&(J.util.Logger.info(this.sbSelected.toString()),J.util.Logger.info(this.sbIgnored.toString()))});e(c$,"checkForResidualBFactors",function(a){for(var b=this.atomSetCollection.getAtoms(),c=!1,d=this.atomSetCollection.getAtomCount();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}}}J.util.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(f).setType(null),"TLS-R",!1),System.out.println("TLS-U:  "+J.util.Escape.eAF(f)),f=k.getKey().anisoBorU,null!=f&&System.out.println("ANISOU: "+J.util.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.atomSetCollection.setCollectionName(a),this.atomSetCollection.setAtomSetCollectionAuxiliaryInfo("havePDBHeaderName",Boolean.TRUE));50<this.lineLength&&(this.line=this.line.substring(0,50));this.atomSetCollection.setAtomSetCollectionAuxiliaryInfo("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.atomSetCollection.setAtomSetCollectionAuxiliaryInfo("COMPND",this.$compnd)}if(null==this.vCompnds){if(a)return;this.vCompnds=new JU.List;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):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.simpleReplace(JU.PT.simpleReplace(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.chainAtomCounts[c.charCodeAt(g+1)]);b.put("atomCount",Integer.$valueOf(f*d))}});e(c$,"remark350",function(){var a=null;this.vBiomolecules=new JU.List;this.chainAtomCounts=P(255,0);for(var b="",c="",d="",f=!0,g=null,k=0,e=JU.M4.newM(null);;){f?this.readLine():
f=!0;if(null==this.line||!this.line.startsWith("REMARK 350"))break;try{if(this.line.startsWith("REMARK 350 BIOMOLECULE:")&&(0<k&&J.util.Logger.info("biomolecule "+d+": number of transforms: "+k),g=new java.util.Hashtable,a=new JU.List,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.readLine()&&0>this.line.indexOf("BIOMT")&&7==this.line.indexOf("350");)c+=":"+this.line.substring(11).trim().$replace(" ",":");this.checkFilterKey("BIOMOLECULE "+d+";")&&(this.setFilter(this.filter.$replace(":","_")+c),J.util.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=R(16,0),n=0;12>n;){var m=this.getTokens();l[n++]=this.parseFloatStr(m[4]);l[n++]=this.parseFloatStr(m[5]);l[n++]=this.parseFloatStr(m[6]);l[n++]=this.parseFloatStr(m[7]);(4==n||8==n)&&this.readLine()}l[15]=1;var h=new JU.M4;h.setA(l,0);h.equals(e)?a.add(0,h):a.addLast(h)}}catch(u){if(F(u,Exception)){this.vBiomolecules=this.thisBiomolecule=null;return}throw u;}}0<k&&J.util.Logger.info("biomolecule "+
d+": number of transforms: "+k)});e(c$,"remark290",function(){for(;null!=this.readLine()&&this.line.startsWith("REMARK 290");)if(0<=this.line.indexOf("NNNMMM   OPERATOR"))for(;null!=this.readLine();){var a=this.getTokens();if(4>a.length)break;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(F(f,Exception))return this.serMode=Character.isDigit(c)?1:2,this.getSerial(a,b);throw f;}case 2:return d||Character.isDigit(c)?this.parseIntRange(this.line,a,b):JU.PT.parseIntRadix(this.line.substring(a,b),36)+(Character.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(F(f,Exception))return this.seqMode=Character.isDigit(c)?1:2,this.getSeqNo(a,b);throw f;}case 2:return d||Character.isDigit(c)?this.parseIntRange(this.line,a,b):JU.PT.parseIntRadix(this.line.substring(a,b),36)+(Character.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;b=c;" "!=b&&(a.altLoc=b);a.group3=d;b=256>f?String.fromCharCode(f):0;null!=this.chainAtomCounts&&this.chainAtomCounts[b.charCodeAt(0)]++;this.setChainID(a,b);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.atomSetCollection.addAtomWithMappedSerialNumber(a):this.atomSetCollection.addAtom(a);0==this.atomCount++&&
!this.isCourseGrained&&this.atomSetCollection.setAtomSetAuxiliaryInfo("isPDB",Boolean.TRUE);a.isHetero&&null!=this.htHetero&&(this.atomSetCollection.setAtomSetAuxiliaryInfo("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.line.charCodeAt(21),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.viewer.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.isValidElementSymbol(c))return""+c;if(J.adapter.smarter.Atom.isValidElementSymbolNoCaseSecondChar2(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.isValidElementSymbolNoCaseSecondChar2(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.isValidElementSymbol(c))return""+c;if(" "!=b&&(null==this.htElementsInCurrentGroup||null!=this.htElementsInCurrentGroup.get(""+
b))&&J.adapter.smarter.Atom.isValidElementSymbol(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.isValidElementSymbolNoCaseSecondChar2(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=-1,a=this.getSerial(6,11);if(!(0>a)){for(var b=0;9>b;b+=5==b?2:1){var c=5*b+11,d=c+5,
c=d<=this.lineLength?this.getSerial(c,d):-1;if(!(0>c)){var f=a==this.lastSourceSerial&&c==this.lastTargetSerial;f&&(this.haveDoubleBonds=!0);this.lastSourceSerial=a;this.lastTargetSerial=c;c<a?(d=c,c=a):d=a;var g=";"+d+" "+c+";";if(!(0<=this.sbConect.indexOf(g))||f){if(this.haveDoubleBonds){f="--"+g;if(0<=this.sbConect.indexOf(f))continue;this.sbConect.append(g);this.sb.append(f)}else this.sbConect.append(g);this.atomSetCollection.addConnection([d,c,4>b?1:2048])}}}this.sbConect.appendSB(this.sb)}});
e(c$,"structure",function(){var a=J.constant.EnumStructure.NONE,b=J.constant.EnumStructure.NONE,c,d,f,g,k=0;if(this.line.startsWith("HELIX "))a=J.constant.EnumStructure.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.constant.EnumStructure.SHEET,c=21,d=22,f=32,g=33,k=this.parseIntRange(this.line,14,16);else if(this.line.startsWith("TURN  "))a=J.constant.EnumStructure.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.line.charAt(c);var l=this.parseIntRange(this.line,d,d+4);d=this.line.charAt(d+4);f=this.line.charAt(f);var n=this.parseIntRange(this.line,g,g+4),m=" ";this.lineLength>g+4&&(m=this.line.charAt(g+4));b===J.constant.EnumStructure.NONE&&(b=a);a=new J.adapter.smarter.Structure(-1,a,b,e,j,k);a.set(c.charCodeAt(0),l,d,f.charCodeAt(0),n,m,-2147483648,2147483647);this.atomSetCollection.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.atomSetCollection.newAtomSet();this.isCourseGrained||this.atomSetCollection.setAtomSetAuxiliaryInfo("isPDB",Boolean.TRUE);this.atomSetCollection.setCurrentAtomSetNumber(a);this.isCourseGrained&&this.atomSetCollection.setAtomSetAuxiliaryInfo("courseGrained",Boolean.TRUE)},
"~N");e(c$,"checkNotPDB",function(){var a=!this.isCourseGrained&&(0==this.nRes||this.nUNK!=this.nRes);this.atomSetCollection.setCheckSpecial(!a);this.atomSetCollection.setAtomSetAuxiliaryInfo("isPDB",a?Boolean.TRUE:Boolean.FALSE);this.nUNK=this.nRes=0;this.currentGroup3=null});e(c$,"cryst1",function(){var a=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.spaceGroup&&this.setSpaceGroupName(J.adapter.smarter.AtomSetCollectionReader.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){a=4*a+2;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.atomSetCollection.setAtomSetCollectionAuxiliaryInfo("isNMRdata","true")});e(c$,"formul",function(){var a=
this.parseTokenRange(this.line,12,15),b=J.adapter.smarter.AtomSetCollectionReader.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=J.adapter.smarter.AtomSetCollectionReader.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.isValidElementSymbolNoCaseSecondChar2(a,d)?
c.put(""+a+d,Boolean.TRUE):J.adapter.smarter.Atom.isValidElementSymbol(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=J.adapter.smarter.AtomSetCollectionReader.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=J.adapter.smarter.AtomSetCollectionReader.parseTrimmedRange(this.line,15,70);if(null==a)J.util.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=R(8,0);a[6]=1;var b=this.parseIntRange(this.line,6,11);this.line.substring(6,26).equals(this.lastAtomData)?b=this.lastAtomIndex:(this.haveMappedSerials||this.atomSetCollection.createAtomSerialMap(),b=this.atomSetCollection.getAtomIndexFromSerial(b),
this.haveMappedSerials=!0);if(!(0>b)){for(var b=this.atomSetCollection.getAtom(b),c=28,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])){J.util.Logger.error("Bad ANISOU record: "+this.line);return}a[c]/=1E4}this.atomSetCollection.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=J.adapter.smarter.AtomSetCollectionReader.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=J.adapter.smarter.AtomSetCollectionReader.parseTrimmedRange(this.line,d,d+3);if(0==f.length)break;var g=J.adapter.smarter.AtomSetCollectionReader.parseTrimmedRange(this.line,d+4,d+5),k=J.adapter.smarter.AtomSetCollectionReader.parseTrimmedRange(this.line,d+5,d+9),d=J.adapter.smarter.AtomSetCollectionReader.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.readLine()&&this.line.startsWith(e);)try{var j=J.adapter.smarter.AtomSetCollectionReader.getTokensStr(this.line.substring(10).$replace(":"," "));if(!(2>j.length))if(J.util.Logger.info(this.line),j[1].equalsIgnoreCase("GROUP"))f=new java.util.Hashtable,g=new JU.List,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.List);d=new JU.List;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,n,m,h;if(6==
j.length)l=j[2].charAt(0),n=j[4].charAt(0),m=this.parseIntStr(j[3]),h=this.parseIntStr(j[5]);else{var u=c.indexOf(" C "),T=c.indexOf(" C ",u+4);l=this.line.charAt(T);n=this.line.charAt(u);m=this.parseIntRange(this.line,T+1,u);h=this.parseIntStr(this.line.substring(u+1))}l==n?(k.put("chains",""+l+n),m<=h?(k.put("residues",[m,h]),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 p=this.parseIntStr(j[q]);-2147483648!=p&&(k=new java.util.Hashtable,k.put("residues",[p,this.parseIntStr(j[++q])]),"\x00"!=r&&k.put("chains",""+r+r),g.addLast(k))}else if(j[0].equalsIgnoreCase("ORIGIN")){var w=new JU.P3;f.put("origin",w);if(8==j.length)w.set(this.parseFloatStr(j[5]),this.parseFloatStr(j[6]),this.parseFloatStr(j[7]));else{var t=this.line.length;w.set(this.parseFloatRange(this.line,t-27,
t-18),this.parseFloatRange(this.line,t-18,t-9),this.parseFloatRange(this.line,t-9,t))}if(Float.isNaN(w.x)||Float.isNaN(w.y)||Float.isNaN(w.z))w.set(NaN,NaN,NaN),this.tlsAddError("invalid origin: "+this.line)}else if(j[1].equalsIgnoreCase("TENSOR")){var v=j[0].charAt(0),z=(this.readLine().substring(10)+this.readLine().substring(10)+this.readLine().substring(10)).$replace(v," ").$replace(":"," "),j=J.adapter.smarter.AtomSetCollectionReader.getTokensStr(z),y=R(3,3,0);f.put("t"+v,y);for(q=0;q<j.length;q++){var B=
j[q].charCodeAt(0)-49,x=j[q].charCodeAt(1)-49;y[B][x]=this.parseFloatStr(j[++q]);B<x&&(y[x][B]=y[B][x])}for(q=0;3>q;q++)for(r=0;3>r;r++)Float.isNaN(y[q][r])&&this.tlsAddError("invalid tensor: "+J.util.Escape.escapeFloatAA(y,!1));if("S"==v&&++b==a){J.util.Logger.info(a+" TLS groups read");this.readLine();break}}}catch(A){if(F(A,Exception)){J.util.Logger.error(this.line+"\nError in TLS parser: ");System.out.println(A.getMessage());d=null;break}else throw A;}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){J.util.Logger.info("TLS model "+(b+1)+" set "+(a+1));a=this.vTlsModels.get(a);for(var d=a.get("groups"),f=this.atomSetCollection.getAtomSetAtomIndex(b),g=P(this.atomSetCollection.getAtomSetAtomCount(b),0),k=f+g.length,e=this.atomSetCollection.getAtoms(),j=d.size(),l=0;l<j;l++){var n=d.get(l),h=n.get("ranges");this.tlsGroupID=
n.get("id").intValue();for(var s=h.size();0<=--s;){var u=h.get(s).get("chains"),T=h.get(s).get("residues"),r=0+u.charCodeAt(0),u=0+u.charCodeAt(1),q=T[0],T=T[1],p=this.findAtomForRange(f,k,r,q,!1),w=0<=p?this.findAtomForRange(p,k,u,T,!1):-1;if(0>w){J.util.Logger.info("TLS processing terminated");return}J.util.Logger.info("TLS ID="+this.tlsGroupID+" model atom index range "+p+"-"+w);p=r==u;for(w=f;w<k;w++){var t=e[w];if(p?t.sequenceNumber>=q&&t.sequenceNumber<=T:t.chainID>r&&t.chainID<u||t.chainID==
r&&t.sequenceNumber>=q||t.chainID==u&&t.sequenceNumber<=T)g[w-f]=this.tlsGroupID,this.setTlsTensor(t,n,c)}}}c=new JU.SB;for(l=0;l<g.length;l++)c.appendI(g[l]).appendC("\n");this.atomSetCollection.setAtomSetAtomProperty("tlsGroup",c.toString(),b);this.atomSetCollection.setAtomSetAuxiliaryInfoForSet("TLS",a,b);this.atomSetCollection.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.atomSetCollection.getAtoms();a<b;a++){var k=g[a];if((k.chainID==c&&k.sequenceNumber==d)==f)return a}f&&(J.util.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,n=d*d,h=k*e,s=k*d,u=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=R(8,0),p=Float.isNaN(a.bfactor)?0:a.bfactor/78.95683;f[0]=this.dataT[0]+g[1][1]*n+g[2][2]*l-2*g[1][2]*u+2*b[1][0]*d-2*b[2][0]*e;f[1]=this.dataT[1]+g[0][0]*n+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]*u-g[0][1]*n-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]*u+b[0][0]*e-b[2][2]*e+b[1][2]*d-b[1][0]*k;f[5]=this.dataT[5]-g[0][0]*u-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]=p;null==this.tlsU&&(this.tlsU=new java.util.Hashtable);this.tlsU.put(a,f);a.addTensor(c.getTensor(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");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   ",
"RAD_PER_DEG",0.017453292519943295,"_8PI2_",78.95683520871486)});p("J.adapter.smarter");v(null,"J.adapter.smarter.Structure",["J.constant.EnumStructure"],function(){c$=A(function(){this.structureID=this.substructureType=this.structureType=null;this.startChainID=this.strandCount=this.serialID=0;this.startChainStr=null;this.startInsertionCode="\x00";this.endChainID=0;this.endChainStr=null;this.endInsertionCode="\x00";this.endSequenceNumber=this.startSequenceNumber=0;this.modelStartEnd=this.atomStartEnd=
null;x(this,arguments)},J.adapter.smarter,"Structure");Q(c$,function(){this.atomStartEnd=P(2,0);this.modelStartEnd=[-1,-1]});c$.getHelixType=e(c$,"getHelixType",function(a){switch(a){case 1:return J.constant.EnumStructure.HELIXALPHA;case 3:return J.constant.EnumStructure.HELIXPI;case 5:return J.constant.EnumStructure.HELIX310}return J.constant.EnumStructure.HELIX},"~N");M(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.constant.EnumStructure,J.constant.EnumStructure,~S,~N,~N");e(c$,"set",function(a,b,c,d,f,g,k,e){this.startChainID=a;this.startSequenceNumber=b;this.startInsertionCode=c;this.endChainID=d;this.endSequenceNumber=f;this.endInsertionCode=g;this.atomStartEnd[0]=k;this.atomStartEnd[1]=e},"~N,~N,~S,~N,~N,~S,~N,~N");e(c$,"setModels",function(a,b){this.modelStartEnd[0]=a;this.modelStartEnd[1]=0==b?a:b},"~N,~N")});p("J.api");ca(J.api,"JmolBioResolver");p("J.modelsetbio");v(["J.api.JmolBioResolver"],
"J.modelsetbio.Resolver","java.lang.Boolean $.NullPointerException java.util.Arrays $.Hashtable JU.BS $.P3 $.P4 $.PT $.SB $.V3 J.constant.EnumStructure J.modelset.Group J.modelsetbio.AlphaMonomer $.AlphaPolymer $.AminoMonomer $.AminoPolymer $.BioModel $.CarbohydrateMonomer $.CarbohydratePolymer $.Monomer $.NucleicMonomer $.NucleicPolymer $.PhosphorusMonomer $.PhosphorusPolymer J.util.BSUtil $.Logger $.Measure $.Txt J.viewer.JC".split(" "),function(){c$=A(function(){this.hNames=this.htGroupBonds=this.htBondMap=
this.bsAtomsForHs=this.bsAddedHydrogens=this.modelSet=this.modelLoader=null;this.lastSetH=-2147483648;this.baseBondIndex=this.maxSerial=0;this.haveHsAlready=!1;this.plane=this.vNorm=this.vAC=this.vAB=null;ga("J.modelsetbio.Resolver.BondSorter")||J.modelsetbio.Resolver.$Resolver$BondSorter$();this.bsAssigned=null;x(this,arguments)},J.modelsetbio,"Resolver",null,J.api.JmolBioResolver);M(c$,function(){});h(c$,"getBioModel",function(a,b,c,d,f){return new J.modelsetbio.BioModel(this.modelSet,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=J.viewer.JC.ATOMID_MAX;0<=--l;)k[l]=-2147483648;for(l=f;--l>=d;)f=e[l].getAtomID(),0>=f||(14>f&&(j|=1<<f),k[f]=l);if(g<d)throw new NullPointerException;f=null;14==(j&14)?f=J.modelsetbio.AminoMonomer.validateAndAllocate(a,b,c,d,g,k,e):4==j?f=J.modelsetbio.AlphaMonomer.validateAndAllocateA(a,b,c,d,g,k):8128==(j&8128)?f=J.modelsetbio.NucleicMonomer.validateAndAllocate(a,b,
c,d,g,k):8192==j?f=J.modelsetbio.PhosphorusMonomer.validateAndAllocateP(a,b,c,d,g,k):J.viewer.JC.checkCarbohydrate(b)&&(f=J.modelsetbio.CarbohydrateMonomer.validateAndAllocate(a,b,c,d,g));return null!=f&&0<=f.leadAtomIndex?f:null},"J.modelset.Chain,~S,~N,~N,~N,~N,~A,~A");h(c$,"setHaveHsAlready",function(a){this.haveHsAlready=a},"~B");h(c$,"initialize",function(a){this.modelLoader=a;this.modelSet=a.modelSet},"J.modelset.ModelLoader");h(c$,"initializeHydrogenAddition",function(){this.baseBondIndex=
this.modelLoader.modelSet.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.vAC=new JU.V3;this.vNorm=new JU.V3;this.plane=new JU.P4});h(c$,"addImplicitHydrogenAtoms",function(a,b,c){var d=this.modelLoader.getGroup3(b),f;if(!this.haveHsAlready&&!(null==d||0==(f=J.viewer.JC.getStandardPdbHydrogenCount(J.modelset.Group.lookupGroupID(d))))){c=0>f?-1:f+c;f=null;
b=this.modelLoader.getFirstAtomIndex(b);var g=this.modelSet.getAtomCount();if(0>c){if(1==g-b)return;f=this.modelSet.viewer.getLigandModel(d,"ligand_","_data",null);if(null==f)return;c=a.getHydrogenAtomCount(f);if(1>c)return}this.getBondInfo(a,d,f);this.modelSet.models[this.modelSet.atoms[b].modelIndex].isPdbWithMultipleBonds=!0;this.bsAtomsForHs.setBits(b,g);this.bsAddedHydrogens.setBits(g,g+c);a=this.modelSet.atoms[b].isHetero();d=JU.P3.new3(NaN,NaN,NaN);for(f=0;f<c;f++)this.modelSet.addAtom(this.modelSet.atoms[b].modelIndex,
this.modelSet.atoms[b].getGroup(),1,"H",0,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.modelSet.viewer.getPdbBondInfo(b):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(J.modelsetbio.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],h=l.compareTo(k);J.util.Measure.getPlaneThroughPoints(f.get(l),f.get(j),f.get(k),this.vNorm,this.vAB,this.vAC,this.plane);k=J.util.Measure.distanceToPlane(this.plane,f.get(a[d][1]))*h;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&&J.util.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.modelSet.viewer.getLigandModel(null,null,null,null);this.finalizePdbMultipleBonds();this.addHydrogens()});e(c$,"addHydrogens",function(){if(!(0>this.bsAddedHydrogens.nextSetBit(0))){this.finalizePdbCharges();for(var a=P(1,0),a=this.modelSet.calculateHydrogens(this.bsAtomsForHs,
a,!0,!1,null),b=null,c=0,d=0;d<a.length;d++)if(null!=a[d]){var f=this.modelSet.atoms[d],g=f.getGroup();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("@"),h=j.endsWith("?")||0<=j.indexOf("|"),m=a[d].length;3==m&&(!h&&j.equals("H@H2"))&&(j="H|H2|H3",h=!0,l=!1);if(l&&3==m||h!=(3==m))J.util.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;h=f.getBonds();if(null!=h)switch(h.length){case 2:l=h[0].getOtherAtom(f),h=h[1].getOtherAtom(f),m=l.getAtomName().compareTo(h.getAtomName()),J.util.Measure.getPlaneThroughPoints(l,f,h,this.vNorm,this.vAB,this.vAC,this.plane),l=J.util.Measure.distanceToPlane(this.plane,a[d][0])*m}0>e?(J.util.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.modelSet.fixFormalCharges(J.util.BSUtil.newBitSet2(this.modelLoader.baseAtomIndex,this.modelLoader.modelSet.atomCount))}});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.modelSet.atoms[b];if(c.isHetero()&&!(8!=c.getElementNumber()||0!=c.getFormalCharge()||2!=c.getCovalentBondCount())){var d=c.getBonds(),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.getBonds(),g=0;g<d.length;g++)if(2==d[g].order&&8==d[g].getOtherAtom(f).getElementNumber()){this.bsAddedHydrogens.set(c.index);c.deleteBonds(a);break}}}this.modelSet.deleteBonds(a,!0);this.modelLoader.deleteAtoms(this.bsAddedHydrogens)});e(c$,"finalizePdbCharges",function(){for(var a=this.modelSet.atoms,b=this.bsAtomsForHs.nextSetBit(0);0<=b;b=this.bsAtomsForHs.nextSetBit(b+1)){var c=a[b];c.getGroup().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.modelSet.bondCount,c=this.modelSet.bonds,d=this.baseBondIndex;d<b;d++){var f=c[d].getAtom1(),g=c[d].getAtom2(),k=f.getGroup();if(k===g.getGroup()){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);J.util.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].getAtom1(),g=c[d].getAtom2(),f.getGroup()!==g.getGroup()&&!(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)),J.util.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.modelSet.atoms;if(-2147483648==this.lastSetH||f[b].modelIndex!=f[this.lastSetH].modelIndex)this.maxSerial=
this.modelSet.getModelAuxiliaryInfoValue(f[this.lastSetH=b].modelIndex,"PDB_CONECT_firstAtom_count_max")[2];this.bsAddedHydrogens.clear(b);this.modelSet.setAtomName(b,c);f[b].setT(d);this.modelSet.setAtomNumber(b,++this.maxSerial);f[b].setAtomSymmetry(f[a].getAtomSymmetry());this.modelLoader.undeleteAtom(b);this.modelSet.bondAtoms(f[a],f[b],1,this.modelSet.getDefaultMadFromOrder(1),null,0,!0,!1)}},"~N,~N,~S,JU.P3");h(c$,"fixPropertyValue",function(a,b){for(var c=JU.PT.split(b,"\n"),d=this.modelSet.atoms,
f=Array(a.cardinality()),g="",k=0,e=0,j=a.nextSetBit(0);0<=j;j=a.nextSetBit(j),e++)1!=d[j].getElementNumber()&&(g=c[k++]),f[e]=g;return J.util.Txt.join(f,"\n",0)},"JU.BS,~S");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(!z(k,J.modelsetbio.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(z(d,J.modelsetbio.AminoMonomer))return new J.modelsetbio.AminoPolymer(c);
if(z(d,J.modelsetbio.AlphaMonomer))return new J.modelsetbio.AlphaPolymer(c);if(z(d,J.modelsetbio.NucleicMonomer))return new J.modelsetbio.NucleicPolymer(c);if(z(d,J.modelsetbio.PhosphorusMonomer))return new J.modelsetbio.PhosphorusPolymer(c);if(z(d,J.modelsetbio.CarbohydrateMonomer))return new J.modelsetbio.CarbohydratePolymer(c);J.util.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.modelLoader.structuresDefinedInFile.set(this.modelLoader.baseModelIndex+f);for(;c.hasNext();)c.getStructureType()!==J.constant.EnumStructure.TURN&&this.setStructure(c);for(c=a.getStructureIterator(b);c.hasNext();)c.getStructureType()===J.constant.EnumStructure.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,h,m,s){a=a===J.constant.EnumStructure.NOT?J.constant.EnumStructure.NONE:
a;g=J.modelset.Group.getSeqcodeFor(g,k);j=J.modelset.Group.getSeqcodeFor(j,l);l=this.modelSet.models;this.modelLoader.isTrajectory?m[1]=m[0]:(m[0]+=this.modelLoader.baseModelIndex,m[1]+=this.modelLoader.baseModelIndex);this.modelLoader.structuresDefinedInFile.setBits(m[0],m[1]+1);for(k=m[0];k<=m[1];k++){var u=l[k].firstAtomIndex;z(l[k],J.modelsetbio.BioModel)&&l[k].addSecondaryStructure(a,b,c,d,f,g,e,j,u+h[0],u+h[1],s)}},"J.constant.EnumStructure,~S,~N,~N,~N,~N,~S,~N,~N,~S,~A,~A,JU.BS");c$.$Resolver$BondSorter$=
function(){ea();c$=A(function(){ha(this,arguments);x(this,arguments)},J.modelsetbio.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()}});p("J.modelsetbio");v(["J.modelset.Group"],"J.modelsetbio.Monomer","java.lang.Float JU.P3 J.constant.EnumStructure J.util.Logger $.Measure $.Quaternion J.viewer.JC".split(" "),
function(){c$=A(function(){this.offsets=this.bioPolymer=null;this.monomerIndex=0;x(this,arguments)},J.modelsetbio,"Monomer",J.modelset.Group);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},"J.modelset.Chain,~S,~N,~N,~N,~A");h(c$,"getGroups",function(){return this.bioPolymer.getGroups()});e(c$,"setBioPolymer",function(a,b){this.bioPolymer=
a;this.monomerIndex=b},"J.modelsetbio.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});e(c$,"getBioPolymer",function(){return this.bioPolymer});h(c$,"getBioPolymerLength",function(){return null==this.bioPolymer?0:this.bioPolymer.monomerCount});e(c$,"getMonomerIndex",function(){return this.monomerIndex});
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)J.util.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");e(c$,"setStructure",function(){},"J.modelsetbio.ProteinStructure");e(c$,"getProteinStructure",function(){return null});h(c$,"getProteinStructureType",function(){return J.constant.EnumStructure.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");h(c$,"calcBioParameters",function(){return this.bioPolymer.calcParameters()});h(c$,"haveParameters",function(){return this.bioPolymer.haveParameters});e(c$,"getMyInfo",function(){var a=this.getGroupInfo(this.groupIndex);
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.getProteinStructure();null!=b&&(a.put("structureId",Integer.$valueOf(b.strucNo)),a.put("structureType",b.type.getBioStructureTypeName(!1)));a.put("shapeVisibilityFlags",Integer.$valueOf(this.shapeVisibilityFlags));return a});h(c$,"getStructureId",function(){var a=this.getProteinStructure();return null==a?"":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].getAlternateLocationID();"\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.getAtomID();if(0!=f.getAlternateLocationID().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].getAtomID();if(!(h!=g||0==
h&&!a[j].getAtomName().equals(f.getAtomName()))){J.util.Logger.debugging&&J.util.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(J.modelsetbio.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?J.util.Quaternion.getQuaternionFrameV(J.viewer.JC.axisX,J.viewer.JC.axisY,J.viewer.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):J.util.Measure.computeHelicalAxis(135176==
a?"helixaxis"+this.getUniqueID():null,a,f,k,d.div(g))},"~N,~S,~N");e(c$,"getUniqueID",function(){var a=this.getChainID(),b=this.getLeadAtom(),a=(null==b?"":"_"+b.getModelIndex())+"_"+this.getResno()+(0==a?"":"_"+a),b=null==b?"\x00":this.getLeadAtom().getAlternateLocationID();"\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},"J.modelset.Group");h(c$,"getCrossLinkLead",function(a){for(var b=
this.firstAtomIndex;b<=this.lastAtomIndex;b++)if(this.getCrossLink(b,a)&&null==a)return!0;return!1},"JU.List");e(c$,"getCrossLink",function(a,b){return this.getCrossLinkGroup(a,b,null)},"~N,JU.List");e(c$,"getCrossLinkGroup",function(a,b,c){a=this.chain.getAtom(a);var d=a.getBonds(),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).getGroup();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.List,J.modelset.Group");h(c$,"isConnectedPrevious",function(){return!0})});p("J.modelsetbio");v(["J.modelsetbio.Monomer"],"J.modelsetbio.AlphaMonomer","JU.V3 J.constant.EnumStructure J.modelsetbio.Helix $.Sheet $.Turn J.util.Quaternion".split(" "),function(){c$=A(function(){this.nitrogenHydrogenPoint=
this.proteinStructure=null;x(this,arguments)},J.modelsetbio,"AlphaMonomer",J.modelsetbio.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 J.modelsetbio.AlphaMonomer).set2(a,b,c,d,f,J.modelsetbio.AlphaMonomer.alphaOffsets)},"J.modelset.Chain,~S,~N,~N,~N,~A");Y(c$,function(){});e(c$,"isAlphaMonomer",function(){return!0});h(c$,"getProteinStructure",function(){return this.proteinStructure});h(c$,"getStructure",
function(){return this.getProteinStructure()});h(c$,"setStructure",function(a){this.proteinStructure=a;null==a&&(this.nitrogenHydrogenPoint=null)},"J.modelsetbio.ProteinStructure");h(c$,"setStrucNo",function(a){null!=this.proteinStructure&&(this.proteinStructure.strucNo=a)},"~N");h(c$,"getProteinStructureType",function(){return null==this.proteinStructure?J.constant.EnumStructure.NONE:this.proteinStructure.type});h(c$,"getProteinStructureSubType",function(){return null==this.proteinStructure?J.constant.EnumStructure.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.constant.EnumStructure.HELIX});h(c$,"isSheet",function(){return null!=this.proteinStructure&&this.proteinStructure.type===J.constant.EnumStructure.SHEET});h(c$,"setProteinStructureType",function(a,b){if(0>b||0<b&&0==this.monomerIndex){if(null!=this.proteinStructure){var c=this.proteinStructure.removeMonomer(this.monomerIndex);
0<c&&this.getBioPolymer().removeProteinStructure(this.monomerIndex+1,c)}switch(a){case J.constant.EnumStructure.HELIX:case J.constant.EnumStructure.HELIXALPHA:case J.constant.EnumStructure.HELIX310:case J.constant.EnumStructure.HELIXPI:this.setStructure(new J.modelsetbio.Helix(this.bioPolymer,this.monomerIndex,1,a));break;case J.constant.EnumStructure.SHEET:this.setStructure(new J.modelsetbio.Sheet(this.bioPolymer,this.monomerIndex,1,a));break;case J.constant.EnumStructure.TURN:this.setStructure(new J.modelsetbio.Turn(this.bioPolymer,
this.monomerIndex,1));break;case J.constant.EnumStructure.NONE:this.setStructure(null)}}else this.setStructure(this.getBioPolymer().getProteinStructure(b)),null!=this.proteinStructure&&this.proteinStructure.addMonomer(this.monomerIndex);return this.monomerIndex},"J.constant.EnumStructure,~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)},"J.modelsetbio.Monomer");h(c$,"getQuaternionFrameCenter",function(a){return this.getQuaternionFrameCenterAlpha(a)},"~S");h(c$,"isWithinStructure",function(a){var b=this.getStructure();return null!=b&&b.type===a&&b.isWithin(this.monomerIndex)},"J.constant.EnumStructure");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 J.util.Quaternion.getQuaternionFrameV(b,c,null,!1)},"~S");I(c$,"alphaOffsets",[0])});p("J.modelsetbio");v(["JU.V3"],"J.modelsetbio.ProteinStructure",["JU.AU","$.P3","J.util.Logger"],function(){c$=A(function(){this.structureID=this.subtype=this.type=null;this.strandCount=this.serialID=this.strucNo=0;this.apolymer=null;this.monomerCount=this.monomerIndexFirst=0;this.vectorProjection=this.axisUnitVector=this.axisB=this.axisA=null;this.monomerIndexLast=0;this.segments=
null;x(this,arguments)},J.modelsetbio,"ProteinStructure");Q(c$,function(){this.vectorProjection=new JU.V3});e(c$,"setupPS",function(a,b,c,d){this.strucNo=++J.modelsetbio.ProteinStructure.globalStrucNo;this.apolymer=a;this.type=b;this.monomerIndexFirst=c;this.addMonomer(c+d-1);J.util.Logger.debugging&&J.util.Logger.debug("Creating ProteinStructure "+this.strucNo+" "+b.getBioStructureTypeName(!1)+" from "+this.monomerIndexFirst+" through "+this.monomerIndexLast+" in polymer "+a)},"J.modelsetbio.AlphaPolymer,J.constant.EnumStructure,~N,~N");
e(c$,"addMonomer",function(a){this.monomerIndexFirst=Math.min(this.monomerIndexFirst,a);this.monomerIndexLast=Math.max(this.monomerIndexLast,a);this.monomerCount=this.monomerIndexLast-this.monomerIndexFirst+1},"~N");e(c$,"removeMonomer",function(a){if(a>this.monomerIndexLast||a<this.monomerIndexFirst)return 0;var b=this.monomerIndexLast-a;this.monomerIndexLast=Math.max(this.monomerIndexFirst,a)-1;this.monomerCount=this.monomerIndexLast-this.monomerIndexFirst+1;return b},"~N");e(c$,"calcAxis",function(){});
e(c$,"calcSegments",function(){if(null==this.segments){this.calcAxis();this.segments=Array(this.monomerCount+1);this.segments[this.monomerCount]=this.axisB;this.segments[0]=this.axisA;var a=JU.V3.newV(this.axisUnitVector);a.scale(this.axisB.distance(this.axisA)/this.monomerCount);for(var b=1;b<this.monomerCount;b++)(this.segments[b]=new JU.P3).add2(this.segments[b-1],a)}});e(c$,"lowerNeighborIsHelixOrSheet",function(){return 0==this.monomerIndexFirst?!1:this.apolymer.monomers[this.monomerIndexFirst-
1].isHelix()||this.apolymer.monomers[this.monomerIndexFirst-1].isSheet()});e(c$,"upperNeighborIsHelixOrSheet",function(){var a=this.monomerIndexFirst+this.monomerCount;return a==this.apolymer.monomerCount?!1:this.apolymer.monomers[a].isHelix()||this.apolymer.monomers[a].isSheet()});e(c$,"getMonomerCount",function(){return this.monomerCount});e(c$,"isWithin",function(a){return a>this.monomerIndexFirst&&a<this.monomerIndexLast},"~N");e(c$,"getMonomerIndex",function(){return this.monomerIndexFirst});
e(c$,"getIndex",function(a){var b=this.apolymer.monomers,c;for(c=this.monomerCount;0<=--c&&b[this.monomerIndexFirst+c]!==a;);return c},"J.modelsetbio.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.monomerCount);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)});p("J.modelsetbio");
v(["J.modelsetbio.ProteinStructure"],"J.modelsetbio.Helix",["JU.P3","$.V3","J.constant.EnumStructure","J.util.Measure"],function(){c$=E(J.modelsetbio,"Helix",J.modelsetbio.ProteinStructure);M(c$,function(a,b,c,d){U(this,J.modelsetbio.Helix,[]);this.setupPS(a,J.constant.EnumStructure.HELIX,b,c);this.subtype=d},"J.modelsetbio.AlphaPolymer,~N,~N,J.constant.EnumStructure");h(c$,"calcAxis",function(){if(null==this.axisA){for(var a=Array(this.monomerCount+1),b=0;b<=this.monomerCount;b++)a[b]=new JU.P3,
this.apolymer.getLeadMidPoint(this.monomerIndexFirst+b,a[b]);this.axisA=new JU.P3;this.axisUnitVector=new JU.V3;J.util.Measure.calcBestAxisThroughPoints(a,this.axisA,this.axisUnitVector,this.vectorProjection,4);this.axisB=JU.P3.newP(a[this.monomerCount]);J.util.Measure.projectOntoAxis(this.axisB,this.axisA,this.axisUnitVector,this.vectorProjection)}})});p("J.modelsetbio");v(["J.modelsetbio.ProteinStructure"],"J.modelsetbio.Sheet",["JU.P3","$.V3","J.constant.EnumStructure","J.modelsetbio.AminoPolymer",
"J.util.Measure"],function(){c$=A(function(){this.heightUnitVector=this.widthUnitVector=this.alphaPolymer=null;x(this,arguments)},J.modelsetbio,"Sheet",J.modelsetbio.ProteinStructure);M(c$,function(a,b,c,d){U(this,J.modelsetbio.Sheet,[]);this.setupPS(a,J.constant.EnumStructure.SHEET,b,c);this.alphaPolymer=a;this.subtype=d},"J.modelsetbio.AlphaPolymer,~N,~N,J.constant.EnumStructure");h(c$,"calcAxis",function(){if(null==this.axisA){2==this.monomerCount?(this.axisA=this.alphaPolymer.getLeadPoint(this.monomerIndexFirst),
this.axisB=this.alphaPolymer.getLeadPoint(this.monomerIndexFirst+1)):(this.axisA=new JU.P3,this.alphaPolymer.getLeadMidPoint(this.monomerIndexFirst+1,this.axisA),this.axisB=new JU.P3,this.alphaPolymer.getLeadMidPoint(this.monomerIndexFirst+this.monomerCount-1,this.axisB));this.axisUnitVector=new JU.V3;this.axisUnitVector.sub2(this.axisB,this.axisA);this.axisUnitVector.normalize();var a=new JU.P3;this.alphaPolymer.getLeadMidPoint(this.monomerIndexFirst,a);this.lowerNeighborIsHelixOrSheet()||J.util.Measure.projectOntoAxis(a,
this.axisA,this.axisUnitVector,this.vectorProjection);var b=new JU.P3;this.alphaPolymer.getLeadMidPoint(this.monomerIndexFirst+this.monomerCount,b);this.upperNeighborIsHelixOrSheet()||J.util.Measure.projectOntoAxis(b,this.axisA,this.axisUnitVector,this.vectorProjection);this.axisA=a;this.axisB=b}});e(c$,"calcSheetUnitVectors",function(){if(z(this.alphaPolymer,J.modelsetbio.AminoPolymer)&&null==this.widthUnitVector){var a=new JU.V3,b=new JU.V3,c=this.alphaPolymer.monomers[this.monomerIndexFirst];b.sub2(c.getCarbonylOxygenAtom(),
c.getCarbonylCarbonAtom());for(var d=this.monomerCount;--d>this.monomerIndexFirst;)c=this.alphaPolymer.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$,"getWidthUnitVector",function(){null==this.widthUnitVector&&this.calcSheetUnitVectors();
return this.widthUnitVector});e(c$,"getHeightUnitVector",function(){null==this.heightUnitVector&&this.calcSheetUnitVectors();return this.heightUnitVector})});p("J.modelsetbio");v(["J.modelsetbio.ProteinStructure"],"J.modelsetbio.Turn",["J.constant.EnumStructure"],function(){c$=E(J.modelsetbio,"Turn",J.modelsetbio.ProteinStructure);M(c$,function(a,b,c){U(this,J.modelsetbio.Turn,[]);this.setupPS(a,J.constant.EnumStructure.TURN,b,c);this.subtype=J.constant.EnumStructure.TURN},"J.modelsetbio.AlphaPolymer,~N,~N")});
p("J.modelsetbio");v(["JU.V3"],"J.modelsetbio.BioPolymer","java.lang.Float java.util.Hashtable JU.BS $.List $.P3 J.util.Escape $.Logger $.Quaternion $.Txt".split(" "),function(){c$=A(function(){this.leadAtomIndices=this.wingVectors=this.controlPoints=this.leadPoints=this.leadMidpoints=this.model=this.monomers=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;x(this,arguments)},J.modelsetbio,"BioPolymer");Q(c$,function(){this.unitVectorX=JU.V3.new3(1,0,0)});e(c$,"getGroups",function(){return this.monomers});M(c$,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(){for(var a=0;a<this.monomerCount;a++)this.monomers[a].setStructure(null)});e(c$,"removeProteinStructure",function(a,b){for(var c=this.monomers[a].getProteinStructureType(),d=-1,f=0,g=a;f<b&&g<this.monomerCount;f++,g++)this.monomers[g].setStructure(null),d=this.monomers[g].setProteinStructureType(c,d)},"~N,~N");e(c$,"getLeadAtomIndices",function(){null==this.leadAtomIndices&&(this.leadAtomIndices=P(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().atoms,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().atoms,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.modelSet.viewer.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.isVisible(0)&&!(null!=g&&g.get(e.index))&&(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.List,~B,~N");e(c$,"getSequence",function(){for(var a=X(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.List,d=null,f,g=null,k=0,e=0;e<this.monomerCount;e++)if(a.get(this.monomers[e].leadAtomIndex)){var j=this.monomers[e].getMyInfo();j.put("monomerIndex",Integer.$valueOf(e));
c.addLast(j);if(null!=(f=this.getProteinStructure(e))&&f!==g)j=new java.util.Hashtable,(g=f).getInfo(j),null==d&&(d=new JU.List),j.put("index",Integer.$valueOf(k++)),d.addLast(j)}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(a){return this.monomers[a].getProteinStructure()},
"~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});c$.getPdbData=e(c$,"getPdbData",function(a,b,c,d,f,g,k,e,j,l,h,m,s,u,p){var r="C"==d||"P"==d,q="R"==c||"S"==c&&r;if(!q||b.calcPhiPsiAngles()){var v=z(b,J.modelsetbio.AminoPolymer),w="r"==c,t=!q&&"S"==c;2==g&&w&&(c="w");t&&(g=2);var B="S"==c,x=0<="rcpCP".indexOf(d);J.util.Logger.debugging&&
(t||r)&&J.util.Logger.debug("For straightness calculation: useQuaternionStraightness = "+B+" and quaternionFrame = "+d);if(h&&!l){s.append("REMARK   6    AT GRP CH RESNO  ");switch(c){default:case "w":s.append("x*10___ y*10___ z*10___      w*10__       ");break;case "x":s.append("y*10___ z*10___ w*10___      x*10__       ");break;case "y":s.append("z*10___ w*10___ x*10___      y*10__       ");break;case "z":s.append("w*10___ x*10___ y*10___      z*10__       ");break;case "R":x?s.append("phi____ psi____ theta         Straightness"):
s.append("phi____ psi____ omega-180    PartialCharge")}s.append("    Sym   q0_______ q1_______ q2_______ q3_______");s.append("  theta_  aaX_______ aaY_______ aaZ_______");"R"!=c&&s.append("  centerX___ centerY___ centerZ___");"n"==d&&s.append("  NHX_______ NHY_______ NHZ_______");s.append("\n\n")}h="R"==c?1:10;j=!1;for(var y=0;y<(j?2:1);y++,h*=-1)for(var A=0;A<(1>f?1:f);A++)J.modelsetbio.BioPolymer.getData(a,A,f,b,c,d,g,k,e,l,q,r,B,x,t,h,v,w,m,s,u,p)}},"J.viewer.Viewer,J.modelsetbio.BioPolymer,~S,~S,~N,~N,JU.BS,JU.BS,~B,~B,~B,~A,JU.OC,JU.SB,JU.BS");
c$.getData=e(c$,"getData",function(a,b,c,d,f,g,k,e,j,l,h,m,s,u,p,r,q,v,w,t,x,A){p=0<k?"dq"+(2==k?"2":""):"q";for(var y,z=null,E=null,N=null,H=null,I=null,M=null,G=N=0,K=0,C=0,D="",$=NaN,P=NaN,F=l?new JU.P3:null,R=1>=c?1:c;b<d.monomerCount;b+=R){var L=d.monomers[b];if(null==e||e.get(L.leadAtomIndex)){var O=L.getLeadAtom(),D=L.getUniqueID();if(h){"S"==f&&L.setGroupParameter(1112539150,NaN);N=L.getGroupParameter(1112539145);G=L.getGroupParameter(1112539146);K=L.getGroupParameter(1112539144);-90>K&&(K+=
360);K-=180;if(Float.isNaN(N)||Float.isNaN(G)||Float.isNaN(K)){null!=e&&e.clear(O.getIndex());continue}var S=u?d.calculateRamachandranHelixAngle(b,g):0,Q=m||u?J.modelsetbio.BioPolymer.getStraightness(Math.cos(3.141592653589793*(S/2/180))):0;if("S"==f){L.setGroupParameter(1112539150,Q);continue}if(l){if(null!=j&&!j.get(O.getIndex()))continue;F.set(-N,N,0.5);t.append('draw ID "phi').append(D).append('" ARROW ARC ').append(J.util.Escape.eP(L.getNitrogenAtom())).append(J.util.Escape.eP(O)).append(J.util.Escape.eP(L.getCarbonylCarbonAtom())).append(J.util.Escape.eP(F)).append(' "phi = ').append(String.valueOf(Math.round(N))).append('" color ').append(J.modelsetbio.BioPolymer.qColor[2]).append("\n");
F.set(0,G,0.5);t.append('draw ID "psi').append(D).append('" ARROW ARC ').append(J.util.Escape.eP(O)).append(J.util.Escape.eP(L.getCarbonylCarbonAtom())).append(J.util.Escape.eP(L.getNitrogenAtom())).append(J.util.Escape.eP(F)).append(' "psi = ').append(String.valueOf(Math.round(G))).append('" color ').append(J.modelsetbio.BioPolymer.qColor[1]).append("\n");t.append('draw ID "planeNCC').append(D).append('" ').append(J.util.Escape.eP(L.getNitrogenAtom())).append(J.util.Escape.eP(O)).append(J.util.Escape.eP(L.getCarbonylCarbonAtom())).append(" color ").append(J.modelsetbio.BioPolymer.qColor[0]).append("\n");
t.append('draw ID "planeCNC').append(D).append('" ').append(J.util.Escape.eP(d.monomers[b-1].getCarbonylCarbonAtom())).append(J.util.Escape.eP(L.getNitrogenAtom())).append(J.util.Escape.eP(O)).append(" color ").append(J.modelsetbio.BioPolymer.qColor[1]).append("\n");t.append('draw ID "planeCCN').append(D).append('" ').append(J.util.Escape.eP(O)).append(J.util.Escape.eP(L.getCarbonylCarbonAtom())).append(J.util.Escape.eP(d.monomers[b+1].getNitrogenAtom())).append(" color ").append(J.modelsetbio.BioPolymer.qColor[2]).append("\n");
continue}if(Float.isNaN(S)){if(D="",u)continue}else y=J.util.Quaternion.newVA(JU.P3.new3(1,0,0),S),D=y.getInfo(),u?(K=S,C=Q):C=O.getPartialCharge()}else{y=L.getQuaternion(g);null!=y&&(y.setRef(I),I=J.util.Quaternion.newQ(y));2==k&&L.setGroupParameter(1112539150,NaN);null==y?I=E=null:0<k&&(G=O,K=y,null==E?H=y=null:(N=v?E.leftDifference(y):y.rightDifference(E),1==k?y=N:null==H?y=null:(y=N.rightDifference(H),$=J.modelsetbio.BioPolymer.getQuaternionStraightness(D,H,N),P=J.modelsetbio.BioPolymer.get3DStraightness(D,
H,N),z.getGroup().setGroupParameter(1112539150,s?$:P)),H=N),z=G,E=K);if(null==y){M=null;continue}switch(f){default:N=y.q1;G=y.q2;K=y.q3;C=y.q0;break;case "x":N=y.q0;G=y.q1;K=y.q2;C=y.q3;break;case "y":N=y.q3;G=y.q0;K=y.q1;C=y.q2;break;case "z":N=y.q2,G=y.q3,K=y.q0,C=y.q1}S=L.getQuaternionFrameCenter(g);null==S&&(S=new JU.P3);if(l){if(null!=j&&!j.get(O.getIndex()))continue;O=B(Math.floor(360*Math.acos(C)/3.141592653589793));0==k&&(t.append(y.draw(p,D,S,1)),"n"==g&&q&&(y=L.getNitrogenHydrogenPoint(),
null!=y&&t.append('draw ID "').append(p).append("nh").append(D).append('" width 0.1 ').append(J.util.Escape.eP(y)).append("\n")));if(1==k){t.append(L.getHelixData(135176,g,c)).append("\n");continue}F.set(2*N,2*G,2*K);t.append('draw ID "').append(p).append("a").append(D).append('" VECTOR ').append(J.util.Escape.eP(S)).append(J.util.Escape.eP(F)).append(' ">').append(String.valueOf(O)).append('" color ').append(J.modelsetbio.BioPolymer.qColor[k]).append("\n");continue}D=y.getInfo()+J.util.Txt.sprintf("  %10.5p %10.5p %10.5p",
"p",[S]);"n"==g&&q?D+=J.util.Txt.sprintf("  %10.5p %10.5p %10.5p","p",[L.getNitrogenHydrogenPoint()]):2==k&&!Float.isNaN($)&&(D+=J.util.Txt.sprintf(" %10.5f %10.5f","F",[[$,P]]))}null!=t&&(A.set(O.getGroup().leadAtomIndex),t.append(a.modelSet.getLabeler().formatLabelAtomArray(a,O,w,"\x00",null)),t.append(J.util.Txt.sprintf("%8.2f%8.2f%8.2f      %6.3f          %2s    %s\n","ssF",[O.getElementSymbolIso(!1).toUpperCase(),D,[N*r,G*r,K*r,C*r]])),null!=M&&M.getPolymerIndexInModel()==O.getPolymerIndexInModel()&&
x.append("CONECT").append(J.util.Txt.formatStringI("%5i","i",M.getAtomNumber())).append(J.util.Txt.formatStringI("%5i","i",O.getAtomNumber())).appendC("\n"),M=O)}}},"J.viewer.Viewer,~N,~N,J.modelsetbio.BioPolymer,~S,~S,~N,JU.BS,JU.BS,~B,~B,~B,~B,~B,~B,~N,~B,~B,~A,JU.OC,JU.SB,JU.BS");e(c$,"calculateRamachandranHelixAngle",function(){return NaN},"~N,~S");c$.get3DStraightness=e(c$,"get3DStraightness",function(a,b,c){return b.getNormal().dot(c.getNormal())},"~S,J.util.Quaternion,J.util.Quaternion");c$.getQuaternionStraightness=
e(c$,"getQuaternionStraightness",function(a,b,c){return J.modelsetbio.BioPolymer.getStraightness(b.dot(c))},"~S,J.util.Quaternion,J.util.Quaternion");c$.getStraightness=e(c$,"getStraightness",function(a){return 1-2*Math.acos(Math.abs(a))/3.141592653589793},"~N");e(c$,"isDna",function(){return 0<this.monomerCount&&this.monomers[0].isDna()});e(c$,"isRna",function(){return 0<this.monomerCount&&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(){},"J.modelsetbio.BioPolymer,JU.BS,JU.BS,JU.List,~N,~A,~B,~B");e(c$,"setStructureList",function(){},"java.util.Map");e(c$,"getPdbData",function(){},"J.viewer.Viewer,~S,~S,~N,~N,JU.BS,JU.BS,~B,~B,~B,~A,JU.OC,JU.SB,JU.BS");e(c$,"getType",function(){return this.type});e(c$,"calculateStruts",function(){return null},
"J.modelset.ModelSet,JU.BS,JU.BS,JU.List,~N,~N,~B");I(c$,"TYPE_NOBONDING",0,"TYPE_AMINO",1,"TYPE_NUCLEIC",2,"TYPE_CARBOHYDRATE",3,"qColor",["yellow","orange","purple"])});p("J.modelsetbio");v(["java.lang.Enum","J.modelsetbio.BioPolymer"],"J.modelsetbio.AlphaPolymer","JU.BS $.List $.P3 J.constant.EnumStructure J.modelsetbio.Helix $.Sheet $.Turn J.util.Logger $.Measure".split(" "),function(){c$=E(J.modelsetbio,"AlphaPolymer",J.modelsetbio.BioPolymer);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$,"getPdbData",function(a,b,c,d,f,g,k,e,j,l,h,m,s,u){J.modelsetbio.BioPolymer.getPdbData(a,this,b,c,d,f,g,k,e,j,l,h,m,s,u)},"J.viewer.Viewer,~S,~S,~N,~N,JU.BS,JU.BS,~B,~B,~B,~A,JU.OC,JU.SB,JU.BS");e(c$,"addStructure",function(a,b,c,d,f,g,e,h,j,l,n){var m=-1,s=-1;if(j<l){if(this.monomers[0].firstAtomIndex>l||this.monomers[this.monomerCount-1].lastAtomIndex<
j)return;m=j;s=l}var u;if(!(-1==(f=this.getIndex(f,g,m,s))||-1==(u=this.getIndex(e,h,m,s)))){if(0<=j&&null!=n&&(e=n.nextSetBit(this.monomers[f].firstAtomIndex),0<=e&&e<this.monomers[u].lastAtomIndex))return;this.addStructureProtected(a,b,c,d,f,u);0<=j&&n.setBits(j,l+1)}},"J.constant.EnumStructure,~S,~N,~N,~N,~N,~N,~N,~N,~N,JU.BS");e(c$,"addStructureProtected",function(a,b,c,d,f,g){if(g<f)J.util.Logger.error("AlphaPolymer:addSecondaryStructure error:  indexStart:"+f+" indexEnd:"+g);else{var e=g-f+
1,h=null;switch(a){case J.constant.EnumStructure.HELIX:case J.constant.EnumStructure.HELIXALPHA:case J.constant.EnumStructure.HELIX310:case J.constant.EnumStructure.HELIXPI:h=new J.modelsetbio.Helix(this,f,e,a);break;case J.constant.EnumStructure.SHEET:h=new J.modelsetbio.Sheet(this,f,e,a);break;case J.constant.EnumStructure.TURN:h=new J.modelsetbio.Turn(this,f,e);break;default:J.util.Logger.error("unrecognized secondary structure type");return}h.structureID=b;h.serialID=c;h.strandCount=d;for(a=f;a<=
g;++a)this.monomers[a].setStructure(h)}},"J.constant.EnumStructure,~S,~N,~N,~N,~N");h(c$,"calculateStruts",function(a,b,c,d,f,g,e){return this.calculateStrutsStatic(a,b,c,d,f,g,e)},"J.modelset.ModelSet,JU.BS,JU.BS,JU.List,~N,~N,~B");e(c$,"calculateStrutsStatic",function(a,b,c,d,f,g,e){var h=new JU.List,j=f*f,l=d.size(),n=new JU.BS,m=new JU.BS,s=new JU.BS,u=d.get(0),p;a=a.getBioPolymerCountInModel(u.modelIndex);for(var r=P(a,6,0),q=0;q<l;q++){var u=d.get(q),v=u.getPolymerIndexInModel(),w=u.getMonomerIndex(),
t=w;3>t&&(r[v][t]=q+1);t=u.getGroup().getBioPolymerLength()-w-1;3>t&&(r[v][3+t]=q+1)}v=R(B(l*(l-1)/2),0);for(q=0;q<l;q++){u=d.get(q);for(w=q+1;w<l;w++){t=J.modelsetbio.AlphaPolymer.strutPoint(q,w,l);p=d.get(w);var z=u.getResno(),x=u.getPolymerIndexInModel(),y=p.getResno(),A=p.getPolymerIndexInModel();x==A&&Math.abs(y-z)<g&&s.set(t);(v[t]=u.distanceSquared(p))>=j&&m.set(t)}}for(u=5;0<=--u;){j=(f-u)*(f-u);for(q=0;q<l;q++)if(e||!n.get(q))for(w=q+1;w<l;w++)t=J.modelsetbio.AlphaPolymer.strutPoint(q,w,
l),!m.get(t)&&(!s.get(t)&&(e||!n.get(w))&&v[t]<=j)&&J.modelsetbio.AlphaPolymer.setStrut(q,w,l,d,b,c,h,n,m,s,g)}for(f=0;f<a;f++){for(e=0;6>e;e++)if(q=r[f][e]-1,0<=q&&n.get(q))for(w=0;3>w;w++)t=3*B(e/3)+w,0<=(q=r[f][t]-1)&&n.set(q),r[f][t]=-1;if(!(-1==r[f][0]&&-1==r[f][3])){for(var u=j=!1,y=x=z=p=0,E=A=3.4028235E38,w=0;w<l;w++)for(e=0;6>e;e++)if(q=r[f][e]-1,-2==q)e=3*(B(e/3)+1)-1;else if(!(w==q||-1==q))if(t=J.modelsetbio.AlphaPolymer.strutPoint(q,w,l),!(s.get(t)||v[t]>(3>e?A:E)))3>e?(m.get(t)&&(j=!0),
z=w,p=q,A=v[t]):(m.get(t)&&(u=!0),y=w,x=q,E=v[t]);j&&J.modelsetbio.AlphaPolymer.setStrut(p,z,l,d,b,c,h,n,m,s,g);u&&J.modelsetbio.AlphaPolymer.setStrut(x,y,l,d,b,c,h,n,m,s,g)}}return h},"J.modelset.ModelSet,JU.BS,JU.BS,JU.List,~N,~N,~B");c$.strutPoint=e(c$,"strutPoint",function(a,b,c){return b<a?B(b*(2*c-b-1)/2)+a-b-1:B(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,n){var m=d.get(a);d=d.get(b);if(f.get(m.index)&&g.get(d.index)){e.addLast([m,d]);h.set(a);
h.set(b);for(f=Math.max(0,a-n);f<=a+n&&f<c;f++)for(g=Math.max(0,b-n);g<=b+n&&g<c;g++)f!=g&&(e=J.modelsetbio.AlphaPolymer.strutPoint(f,g,c),l.get(e)||j.set(e))}},"~N,~N,~N,JU.List,JU.BS,JU.BS,JU.List,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=R(this.monomerCount,0),b=this.monomerCount-1;2<=--b;)a[b]=J.util.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?J.modelsetbio.AlphaPolymer.Code.RIGHT_HELIX:120<=d||-90>d?J.modelsetbio.AlphaPolymer.Code.BETA_SHEET:
-90<=d&&0>d?J.modelsetbio.AlphaPolymer.Code.LEFT_HELIX:J.modelsetbio.AlphaPolymer.Code.NADA}return b},"~A");e(c$,"checkBetaSheetAlphaHelixOverlap",function(a,b){for(var c=this.monomerCount-2;2<=--c;)a[c]===J.modelsetbio.AlphaPolymer.Code.BETA_SHEET&&(140>=b[c]&&a[c-2]===J.modelsetbio.AlphaPolymer.Code.RIGHT_HELIX&&a[c-1]===J.modelsetbio.AlphaPolymer.Code.RIGHT_HELIX&&a[c+1]===J.modelsetbio.AlphaPolymer.Code.RIGHT_HELIX&&a[c+2]===J.modelsetbio.AlphaPolymer.Code.RIGHT_HELIX)&&(a[c]=J.modelsetbio.AlphaPolymer.Code.RIGHT_HELIX)},
"~A,~A");e(c$,"calculateRunsFourOrMore",function(a){for(var b=Array(this.monomerCount),c=J.constant.EnumStructure.NONE,d=J.modelsetbio.AlphaPolymer.Code.NADA,f=0,g=0;g<this.monomerCount;++g)if(a[g]===d&&d!==J.modelsetbio.AlphaPolymer.Code.NADA&&d!==J.modelsetbio.AlphaPolymer.Code.BETA_SHEET)if(++f,4==f)for(var c=d===J.modelsetbio.AlphaPolymer.Code.BETA_SHEET?J.constant.EnumStructure.SHEET:J.constant.EnumStructure.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.constant.EnumStructure.NONE&&a[b+1]!==J.constant.EnumStructure.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]=J.modelsetbio.AlphaPolymer.Code.NADA,null==c[d]||c[d]===J.constant.EnumStructure.NONE){var f=b[d];-90<=f&&0>f?a[d]=J.modelsetbio.AlphaPolymer.Code.LEFT_TURN:0<=f&&90>f&&(a[d]=J.modelsetbio.AlphaPolymer.Code.RIGHT_TURN)}for(d=
this.monomerCount-1;0<=--d;)a[d]!==J.modelsetbio.AlphaPolymer.Code.NADA&&(a[d+1]===a[d]&&c[d]===J.constant.EnumStructure.NONE)&&(c[d]=J.constant.EnumStructure.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.constant.EnumStructure.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();c$=E(J.modelsetbio.AlphaPolymer,"Code",Enum);V(c$,"NADA",0,[]);V(c$,
"RIGHT_HELIX",1,[]);V(c$,"BETA_SHEET",2,[]);V(c$,"LEFT_HELIX",3,[]);V(c$,"LEFT_TURN",4,[]);V(c$,"RIGHT_TURN",5,[]);c$=da()});p("J.modelsetbio");v(["J.modelsetbio.AlphaMonomer"],"J.modelsetbio.AminoMonomer","JU.A4 $.M3 $.P3 $.V3 J.constant.EnumStructure J.util.Escape $.Logger $.Quaternion $.Txt".split(" "),function(){c$=A(function(){this.nhChecked=!1;this.ptTemp=null;x(this,arguments)},J.modelsetbio,"AminoMonomer",J.modelsetbio.AlphaMonomer);Y(c$,function(){});c$.validateAndAllocate=e(c$,"validateAndAllocate",
function(a,b,c,d,f,g,e){var h=J.modelsetbio.Monomer.scanForOffsets(d,g,J.modelsetbio.AminoMonomer.interestingAminoAtomIDs);if(null==h)return null;J.modelsetbio.Monomer.checkOptional(h,1,d,g[5]);return e[d].isHetero()&&!J.modelsetbio.AminoMonomer.isBondedCorrectly(d,h,e)?null:(new J.modelsetbio.AminoMonomer).set2(a,b,c,d,f,h)},"J.modelset.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 J.modelsetbio.AminoMonomer.isBondedCorrectlyRange(2,0,a,b,c)&&J.modelsetbio.AminoMonomer.isBondedCorrectlyRange(0,3,a,b,c)&&(!J.modelsetbio.Monomer.have(b,1)||J.modelsetbio.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(J.modelsetbio.Monomer.have(this.offsets,4)?4:3)});e(c$,"hasOAtom",function(){return J.modelsetbio.Monomer.have(this.offsets,1)});h(c$,"isConnectedAfter",function(a){return null==a?!0:a.getCarbonylCarbonAtom().isBonded(this.getNitrogenAtom())},"J.modelsetbio.Monomer");h(c$,"findNearestAtomIndex",
function(a,b,c,d,f){var g=c[0],e=this.getNitrogenAtom();d=B(d/2);1200>d&&(d=1200);if(0!=e.sZ){d=H(this.scaleToScreen(e.sZ,d));4>d&&(d=4);var h=this.getCarbonylCarbonAtom();f=B(f/2);1200>f&&(f=1200);f=H(this.scaleToScreen(e.sZ,f));4>f&&(f=4);var j=this.getLeadAtom();if(this.isCursorOnTopOf(j,a,b,B((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.getBonds();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);J.util.Logger.debugging&&J.util.Logger.debug('draw ID "pta'+this.monomerIndex+"_"+f.index+'" '+J.util.Escape.eP(f)+J.util.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.getGroups()[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);b=new JU.M3;b.setAA(JU.A4.newVA(f,-0.29670596));b.transform(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.getGroups()[this.monomerIndex+1].getNitrogenAtom(),b);break;case "q":if(this.monomerIndex==this.bioPolymer.monomerCount-1)return null;a=this.bioPolymer.getGroups()[this.monomerIndex+1];f.sub2(a.getLeadAtom(),a.getNitrogenAtom());d.sub2(c,b);break;default:return null}return J.util.Quaternion.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=J.util.Txt.formatStringI("%3N %3ID","N",this.proteinStructure.serialID);a=J.util.Txt.formatStringS(a,"ID",this.proteinStructure.structureID);this.proteinStructure.type===J.constant.EnumStructure.SHEET&&(a+=J.util.Txt.formatStringI("%2SC","SC",this.proteinStructure.strandCount));return a});
I(c$,"CA",0,"O",1,"N",2,"C",3,"OT",4,"interestingAminoAtomIDs",[2,-5,1,3,-65],"beta",0.29670597283903605)});p("J.modelsetbio");v(["J.modelsetbio.AlphaPolymer"],"J.modelsetbio.AminoPolymer","JU.P3 $.V3 J.constant.EnumStructure J.modelset.HBond J.util.Logger $.Measure".split(" "),function(){c$=A(function(){this.structureList=null;x(this,arguments)},J.modelsetbio,"AminoPolymer",J.modelsetbio.AlphaPolymer);M(c$,function(a){U(this,J.modelsetbio.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,J.util.Measure.computeTorsion(f,g,e,h,!0));a.setGroupParameter(1112539146,J.util.Measure.computeTorsion(c,d,f,g,!0));a.setGroupParameter(1112539144,J.util.Measure.computeTorsion(d,f,g,e,!0))},"J.modelsetbio.AminoMonomer,J.modelsetbio.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(z(a,J.modelsetbio.AminoPolymer)){f=
new JU.P3;for(var j=new JU.V3,l,n=null==g?P(2,3,0):null,m=1;m<this.monomerCount;++m)if(null==g?(n[0][0]=n[1][0]=this.bioPolymerIndexInModel,n[0][1]=n[1][1]=-2147483648,n[0][2]=n[1][2]=0):n=g[m],(l=this.monomers[m]).getNHPoint(f,j,e,h)){var s=null==b||b.get(l.getNitrogenAtom().index);if(s&&(e||null!=l.getCarbonylOxygenAtom()))this.checkRasmolHydrogenBond(l,a,m,f,s?c:b,d,n,e)}}},"J.modelsetbio.BioPolymer,JU.BS,JU.BS,JU.List,~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 n,m=b.monomerCount;0<=--m;)if(!(b===this&&(m==c||m+1==c))){n=b.monomers[m];var s=n.getCarbonylOxygenAtom();if(!(null==s||null!=f&&!f.get(s.index)))if(s=n.getLeadAtom(),!(81<=j.distanceSquared(s))){s=this.calcHbondEnergy(l,d,n,h);if(s<e[0][2])n=e[1],e[1]=e[0],e[0]=n;else if(s<e[1][2])n=e[1];else continue;n[0]=b.bioPolymerIndexInModel;n[1]=-500>s?m:-1-m;n[2]=s}}if(null!=g)for(m=0;2>m;m++)0<=e[m][1]&&this.addResidueHydrogenBond(a,b.monomers[e[m][1]].getCarbonylOxygenAtom(),
b===this?c:-99,e[m][1],e[m][2]/1E3,g)},"J.modelsetbio.AminoMonomer,J.modelsetbio.BioPolymer,~N,JU.P3,JU.BS,JU.List,~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=J.modelset.HBond.getEnergy(a,
f,b,g);return!(-500>g&&(!d||b>f&&3>=a))&&d||-9900>g?0:g},"JU.P3,JU.P3,J.modelsetbio.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 J.modelset.HBond(a,b,c,1,0,f))},"J.modelset.Atom,J.modelset.Atom,~N,~N,~N,JU.List");h(c$,"calculateStructures",function(a){if(!a){null==this.structureList&&(this.structureList=this.model.getModelSet().getStructureList());
a=X(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";J.util.Logger.debugging&&J.util.Logger.debug(0+this.monomers[0].getChainID()+" 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.constant.EnumStructure.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.constant.EnumStructure.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.constant.EnumStructure.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.constant.EnumStructure.TURN,null,0,0,b,c);b=c}}},"~B");e(c$,"isTurn",function(a,b){return J.modelsetbio.AminoPolymer.checkPhiPsi(this.structureList.get(J.constant.EnumStructure.TURN),a,b)},"~N,~N");e(c$,"isSheet",function(a,b){return J.modelsetbio.AminoPolymer.checkPhiPsi(this.structureList.get(J.constant.EnumStructure.SHEET),a,b)},"~N,~N");e(c$,"isHelix",function(a,b){return J.modelsetbio.AminoPolymer.checkPhiPsi(this.structureList.get(J.constant.EnumStructure.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)});p("J.modelsetbio");v(["J.modelset.Model"],"J.modelsetbio.BioModel","java.lang.Float java.util.Hashtable JU.AU $.BS $.List $.SB J.api.Interface J.constant.EnumStructure J.modelset.AtomCollection J.modelsetbio.AlphaPolymer $.Monomer $.Resolver J.util.BSUtil $.Escape $.Txt J.viewer.Viewer".split(" "),
function(){c$=A(function(){this.bioPolymerCount=0;this.bioPolymers=null;x(this,arguments)},J.modelsetbio,"BioModel",J.modelset.Model);M(c$,function(a,b,c,d,f,g){U(this,J.modelsetbio.BioModel,[a,b,c,d,f,g]);this.isBioModel=!0;this.clearBioPolymers()},"J.modelset.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,n){for(var m=
this.bioPolymerCount;0<=--m;)z(this.bioPolymers[m],J.modelsetbio.AlphaPolymer)&&this.bioPolymers[m].addStructure(a,b,c,d,f,g,e,h,j,l,n)},"J.constant.EnumStructure,~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.modelSet.proteinStructureTainted=this.structureTainted=!0;if(d)for(var g=this.bioPolymerCount;0<=--g;)(!a||null!=this.bioPolymers[g].getGroups()[0].getNitrogenAtom())&&this.bioPolymers[g].clearStructures();if(!a||
f)for(g=this.bioPolymerCount;0<=--g;)z(this.bioPolymers[g],J.modelsetbio.AlphaPolymer)&&this.bioPolymers[g].calculateStructures(f);return a?this.calculateDssp(null,b,c,d):""},"~B,~B,~B,~B,~B");e(c$,"calculateDssp",function(a,b,c,d){return J.api.Interface.getOptionInterface("dssx.DSSP").calculateDssp(this.bioPolymers,this.bioPolymerCount,a,b,c,d)},"JU.List,~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");h(c$,"getBioPolymerCount",function(){return this.bioPolymerCount});h(c$,"calcSelectedMonomersCount",function(a){for(var b=this.bioPolymerCount;0<=--b;)this.bioPolymers[b].calcSelectedMonomersCount(a)},"JU.BS");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(J.util.Escape.eBS(f)).append(";backbone only;");this.atomCount<=b||(a.append("select ").append(J.util.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 "+J.util.Escape.eBS(f)+" & !connected;stars 0.5;")))}},"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$,"calculateStruts",function(a,b,c){var d=new JU.List,f=null,g;b.equals(c)?g=b:(g=J.util.BSUtil.copy(b),g.or(c));var e=a.atoms,h=a.viewer;g.and(h.getModelUndeletedAtomsBitSet(this.modelIndex));
for(var j=g.nextSetBit(0);0<=j;j=g.nextSetBit(j+1))e[j].isVisible(0)&&(2==e[j].atomID&&5!=e[j].getGroupID())&&d.addLast(f=e[j]);if(0==d.size())return 0;j=h.getFloat(570425408);g=Z(2E3*h.getFloat(570425406));e=h.getInt(553648184);h=h.getBoolean(603979955);b=this.getBioPolymer(f.getPolymerIndexInModel()).calculateStruts(a,b,c,d,j,e,h);for(j=0;j<b.size();j++)c=b.get(j),a.bondAtoms(c[0],c[1],32768,g,null,0,!1,!0);return b.size()},"J.modelset.ModelSet,JU.BS,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$,"calculateStraightness",function(a,b,c,d){for(var f=0;f<this.bioPolymerCount;f++)this.bioPolymers[f].getPdbData(a,b,c,d,2,null,null,!1,!1,!1,null,null,null,new JU.BS)},"J.viewer.Viewer,~S,~S,~N");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.List,~B,~N");h(c$,"getPolymerLeadMidPoints",function(a){return this.bioPolymers[a].getLeadMidpoints()},"~N");h(c$,"recalculateLeadMidpointsAndWingVectors",function(){for(var a=0;a<this.bioPolymerCount;a++)this.bioPolymers[a].recalculateLeadMidpointsAndWingVectors()});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.List),a.addLast(b));return a},"JU.List");h(c$,"getGroupsWithin",
function(a,b,c){for(var d=this.bioPolymerCount;0<=--d;)this.bioPolymers[d].getRangeGroups(a,b,c)},"~N,JU.BS,JU.BS");h(c$,"getSequenceBits",function(a,b,c){for(var d=a.length,f=0;f<this.bioPolymerCount;f++)for(var g=this.bioPolymers[f].getSequence(),e=-1;0<=(e=g.indexOf(a,++e));)this.bioPolymers[f].getPolymerSequenceAtoms(e,d,b,c)},"~S,JU.BS,JU.BS");h(c$,"selectSeqcodeRange",function(a,b,c,d,f){for(var g,e=this.chainCount;0<=--e;){var h=this.chains[e];if(-1==c||c==(g=h.chainID)||!f&&256>g&&c==J.modelset.AtomCollection.chainToUpper(g))for(h=
0;0<=h;)h=this.chains[e].selectSeqcodeRange(h,a,b,d)}},"~N,~N,~N,JU.BS,~B");h(c$,"getRasmolHydrogenBonds",function(a,b,c,d,f,g,e){var h=null==c;h&&(c=new JU.List);0>f&&(f=2147483647);var j,l;if(null==b&&0<this.bioPolymerCount)this.calculateDssp(c,!1,g,!1);else for(g=this.bioPolymerCount;0<=--g;){j=this.bioPolymers[g];var n=j.getType();if(!((d||1!=n)&&2!=n)){var m=j.isRna();1==n&&j.calcRasmolHydrogenBonds(null,a,b,c,f,null,!0,!1);for(var s=this.bioPolymerCount;0<=--s;)null!=(l=this.bioPolymers[s])&&
((m||g!=s)&&n==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.getAtom1(),d=a.getAtom2(),b.isBonded(d)||(a=this.modelSet.addHBond(b,d,a.order,a.getEnergy()),null!=e&&e.set(a))}},"JU.BS,JU.BS,JU.List,~B,~N,~B,JU.BS");h(c$,"clearRasmolHydrogenBonds",function(a){var b=new JU.BS;this.hasRasmolHBonds=!1;for(var c=this.modelSet.models,d=this.modelSet.bonds,f=this.modelSet.bondCount;0<=--f;){var g=d[f],e=g.getAtom1(),
h=c[e.modelIndex];if(h.isBioModel&&!(h.trajectoryBaseIndex!=this.modelIndex||0==(g.order&28672)))null!=a&&!a.get(e.index)?this.hasRasmolHBonds=!0:b.set(f)}0<=b.nextSetBit(0)&&this.modelSet.deleteBonds(b,!1)},"JU.BS");h(c$,"calculatePolymers",function(a,b,c,d,f){null==a&&(a=this.modelSet.getGroups(),b=a.length);if(null!=d)for(var g=0;g<b;++g){var e=a[g];z(e,J.modelsetbio.Monomer)&&null!=e.getBioPolymer()&&!d.get(e.getModelIndex())&&e.setBioPolymer(null,-1)}for(g=c;g<b;++g)d=a[g],c=d.getModel(),c.isBioModel&&
z(d,J.modelsetbio.Monomer)&&(e=f&&!this.modelSet.isJmolDataFrameForModel(this.modelSet.atoms[d.firstAtomIndex].modelIndex),d=null==d.getBioPolymer()?J.modelsetbio.Resolver.allocateBioPolymer(a,g,e):null,null==d||0==d.monomerCount||(c.addBioPolymer(d),g+=d.monomerCount-1))},"~A,~N,~N,JU.BS,~B");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},"J.modelsetbio.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.List,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.List");
h(c$,"getChimeInfo",function(a,b){var c=0,d=this.modelSet.models,f=this.modelSet.modelCount,g=this.modelSet.getAtomCount(),e=this.modelSet.atoms;a.append("\nMolecule name ....... "+this.modelSet.getModelSetAuxiliaryInfoValue("COMPND"));a.append("\nSecondary Structure . PDB Data Records");a.append("\nBrookhaven Code ..... "+this.modelSet.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].modelIndex;h++)if((j=e[h].getStrucNo())!=l&&0!=j)switch(l=j,e[h].getProteinStructureType()){case J.constant.EnumStructure.HELIX:c++;break;case J.constant.EnumStructure.SHEET:d++;break;case J.constant.EnumStructure.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$,"getProteinStructureState",function(a,b,c,d){var f=3==d,g=1==d;d=0==d;var e=null,h=new JU.SB,j=new JU.SB,l=new JU.SB,n=new JU.SB,m=J.constant.EnumStructure.NONE,s=J.constant.EnumStructure.NONE,u=0,p=0,r=-1,q=-1,v=0,w=0,t="",z="",x="",y="",A="",B=0,E=0,H=0,M=0,I=null,u=this.modelSet.models,G=this.modelSet.atoms,K=this.modelSet.getAtomCount();if(b){if(!this.modelSet.proteinStructureTainted)return"";for(var I=new JU.BS,C=this.firstAtomIndex;C<
K;C++)u[G[C].modelIndex].isStructureTainted()&&I.set(C);I.set(K)}for(C=0;C<=K;C++)if((C==K||null==a||a.get(C))&&(!b||I.get(C))){u=0;if(C==K||(u=G[C].getStrucNo())!=q){if(null!=e){switch(m){case J.constant.EnumStructure.HELIX:case J.constant.EnumStructure.TURN:case J.constant.EnumStructure.SHEET:if(B++,d){var D=G[p].modelIndex,F="    \t# model="+this.modelSet.getModelNumberDotted(D);r!=D&&(r=D,h.append("  structure none ").append(J.util.Escape.eBS(this.modelSet.getModelAtomBitSetIncludingDeleted(D,
!1))).append(F).append(";\n"));F+=" & ("+v+" - "+w+")";D=s.getBioStructureTypeName(!1);h.append("  structure ").append(D).append(" ").append(J.util.Escape.eBS(e)).append(F).append(";\n")}else{switch(m){case J.constant.EnumStructure.HELIX:e=++E;if(null==t||g)t=J.util.Txt.formatStringI("%3N %3N","N",e);e="HELIX  %ID %3GROUPA %1CA %4RESA  %3GROUPB %1CB %4RESB";F=l;D=null;switch(s){case J.constant.EnumStructure.HELIX:case J.constant.EnumStructure.HELIXALPHA:D="  1";break;case J.constant.EnumStructure.HELIX310:D=
"  5";break;case J.constant.EnumStructure.HELIXPI:D="  3"}null!=D&&(e+=D);break;case J.constant.EnumStructure.SHEET:e=++M;if(null==t||g)t=J.util.Txt.formatStringI("%3N %3A 0","N",e),t=J.util.Txt.formatStringS(t,"A","S"+e);e="SHEET  %ID %3GROUPA %1CA%4RESA  %3GROUPB %1CB%4RESB";F=n;break;default:e=++H;if(null==t||g)t=J.util.Txt.formatStringI("%3N %3N","N",e);e="TURN   %ID %3GROUPA %1CA%4RESA  %3GROUPB %1CB%4RESB";F=j}e=J.util.Txt.formatStringS(e,"ID",t);e=J.util.Txt.formatStringS(e,"GROUPA",z);e=J.util.Txt.formatStringS(e,
"CA",y);e=J.util.Txt.formatStringI(e,"RESA",v);e=J.util.Txt.formatStringS(e,"GROUPB",x);e=J.util.Txt.formatStringS(e,"CB",A);e=J.util.Txt.formatStringI(e,"RESB",w);F.append(e);f&&F.append(" strucno= ").appendI(q);F.append("\n")}}e=null}if(0==u||null!=a&&c&&(Float.isNaN(G[C].getGroupParameter(1112539145))||Float.isNaN(G[C].getGroupParameter(1112539146))))continue}p=G[C].getChainIDStr();null==e&&(e=new JU.BS,v=G[C].getResno(),z=G[C].getGroup3(!1),y=p);m=G[C].getProteinStructureType();s=G[C].getProteinStructureSubType();
t=G[C].getProteinStructureTag();e.set(C);q=u;w=G[C].getResno();x=G[C].getGroup3(!1);A=p;p=C}0<B&&h.append("\n");return d?h.toString():l.appendSB(n).appendSB(j).appendSB(h).toString()},"JU.BS,~B,~B,~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.modelSet.viewer.getCurrentFileAsString(),b=a.length,c=J.modelsetbio.BioModel.pdbRecords.length;0<=--c;){var d;d=J.modelsetbio.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,e,k,h,j){var l=!1,n="R"!=c?"r":13<b.length&&0<=b.indexOf("ramachandran ")?b.charAt(13):"R";"r"==n&&(n=a.getQuaternionFrame());var m=a.getInt(553648146),s=0>b.indexOf("diff")?0:0>b.indexOf("2")?1:2;d||(e.append("REMARK   6 Jmol PDB-encoded data: "+b+";"),"R"!=c&&
(e.append('  quaternionFrame = "'+n+'"'),l=!0),e.append("\nREMARK   6 Jmol Version ").append(J.viewer.Viewer.getJmolVersion()).append("\n"),"R"==c?e.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"):e.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"));for(b=0;b<this.bioPolymerCount;b++)this.bioPolymers[b].getPdbData(a,c,n,m,s,
this.bsAtoms,f,l,d,0==b,k,e,h,j)},"J.viewer.Viewer,~S,~S,~B,JU.BS,JU.OC,~A,JU.SB,JU.BS");I(c$,"pdbRecords",["ATOM  ","MODEL ","HETATM"])});p("J.modelsetbio");v(["J.modelsetbio.Monomer"],"J.modelsetbio.CarbohydrateMonomer",["J.constant.EnumStructure"],function(){c$=E(J.modelsetbio,"CarbohydrateMonomer",J.modelsetbio.Monomer);Y(c$,function(){});c$.validateAndAllocate=e(c$,"validateAndAllocate",function(a,b,c,d,f){return(new J.modelsetbio.CarbohydrateMonomer).set2(a,b,c,d,f,J.modelsetbio.CarbohydrateMonomer.alphaOffsets)},
"J.modelset.Chain,~S,~N,~N,~N");h(c$,"isCarbohydrate",function(){return!0});h(c$,"getProteinStructureType",function(){return J.constant.EnumStructure.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},"J.modelsetbio.Monomer");h(c$,
"findNearestAtomIndex",function(a,b,c,d){var f=c[0],e=this.getLeadAtom();d=B(d/2);1200>d&&(d=1200);0!=e.sZ&&(d=H(this.scaleToScreen(e.sZ,d)),4>d&&(d=4),this.isCursorOnTopOf(e,a,b,d,f)&&(c[0]=e))},"~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.getCrossLink(a,null))return!0;return!1});I(c$,"alphaOffsets",[0])});p("J.modelsetbio");v(["J.modelsetbio.BioPolymer"],"J.modelsetbio.CarbohydratePolymer",
null,function(){c$=E(J.modelsetbio,"CarbohydratePolymer",J.modelsetbio.BioPolymer);M(c$,function(a){U(this,J.modelsetbio.CarbohydratePolymer,[a]);this.type=3},"~A")});p("J.modelsetbio");v(["J.modelsetbio.Monomer"],"J.modelsetbio.PhosphorusMonomer",["JU.V3","J.constant.EnumStructure","J.util.Quaternion"],function(){c$=A(function(){this.$isPyrimidine=this.$isPurine=!1;x(this,arguments)},J.modelsetbio,"PhosphorusMonomer",J.modelsetbio.Monomer);h(c$,"isNucleic",function(){return!0});Y(c$,function(){});
c$.validateAndAllocateP=e(c$,"validateAndAllocateP",function(a,b,c,d,f,e){return d!=f||e[13]!=d?null:(new J.modelsetbio.PhosphorusMonomer).set3(a,b,c,d,f,J.modelsetbio.PhosphorusMonomer.phosphorusOffsets)},"J.modelset.Chain,~S,~N,~N,~N,~A");e(c$,"set3",function(a,b,c,d,f,e){this.set2(a,b,c,d,f,e);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},"J.modelset.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.constant.EnumStructure.NONE});
h(c$,"isConnectedAfter",function(a){return this.isCA2(a)},"J.modelsetbio.Monomer");e(c$,"isCA2",function(a){return null==a?!0:this.getLeadAtom().distance(a.getLeadAtom())<=J.modelsetbio.PhosphorusMonomer.MAX_ADJACENT_PHOSPHORUS_DISTANCE},"J.modelsetbio.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 J.util.Quaternion.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)});p("J.modelsetbio");v(["J.modelsetbio.PhosphorusMonomer","J.viewer.JC"],"J.modelsetbio.NucleicMonomer",["JU.P3","$.V3","J.constant.EnumStructure","J.util.Quaternion"],function(){c$=A(function(){this.hasRnaO2Prime=!1;this.baseCenter=null;x(this,arguments)},J.modelsetbio,"NucleicMonomer",J.modelsetbio.PhosphorusMonomer);Y(c$,function(){});c$.validateAndAllocate=e(c$,"validateAndAllocate",function(a,b,c,d,f,e){var k=J.modelsetbio.Monomer.scanForOffsets(d,e,J.modelsetbio.NucleicMonomer.interestingNucleicAtomIDs);
if(null==k||!J.modelsetbio.Monomer.checkOptional(k,19,d,e[73]))return null;J.modelsetbio.Monomer.checkOptional(k,20,d,e[89]);J.modelsetbio.Monomer.checkOptional(k,18,d,e[90]);J.modelsetbio.Monomer.checkOptional(k,23,d,e[75]);J.modelsetbio.Monomer.checkOptional(k,24,d,e[77]);return(new J.modelsetbio.NucleicMonomer).set4(a,b,c,d,f,k)},"J.modelset.Chain,~S,~N,~N,~N,~A");e(c$,"set4",function(a,b,c,d,f,e){this.set3(a,b,c,d,f,e);J.modelsetbio.Monomer.have(e,15)||(e[0]=e[19],a=e[0]&255,255!=a&&(this.leadAtomIndex=
d+a));this.hasRnaO2Prime=J.modelsetbio.Monomer.have(e,2);this.$isPyrimidine=J.modelsetbio.Monomer.have(e,8);this.$isPurine=J.modelsetbio.Monomer.have(e,9)&&J.modelsetbio.Monomer.have(e,10)&&J.modelsetbio.Monomer.have(e,11);return this},"J.modelset.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 J.modelsetbio.Monomer.have(this.offsets,17)});h(c$,"getProteinStructureType",function(){return this.hasRnaO2Prime?J.constant.EnumStructure.RNA:J.constant.EnumStructure.DNA});e(c$,"getC1P",function(){return this.getAtomFromOffsetIndex(25)});e(c$,"getC2",function(){return this.getAtomFromOffsetIndex(5)});e(c$,"getC4P",function(){return this.getAtomFromOffsetIndex(26)});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(J.modelsetbio.Monomer.have(this.offsets,20)?
20:21)});e(c$,"getBaseRing6Points",function(a){for(var b=6;0<=--b;)a[b]=this.getAtomFromOffsetIndex(J.modelsetbio.NucleicMonomer.ring6OffsetIndexes[b])},"~A");e(c$,"maybeGetBaseRing5Points",function(a){if(this.$isPurine)for(var b=5;0<=--b;)a[b]=this.getAtomFromOffsetIndex(J.modelsetbio.NucleicMonomer.ring5OffsetIndexes[b]);return this.$isPurine},"~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)},"J.modelsetbio.Monomer");h(c$,"findNearestAtomIndex",function(a,b,c,d){var f=c[0],e=this.getLeadAtom(),k=this.getAtomFromOffsetIndex(19),h=this.getAtomFromOffsetIndex(22);d=B(d/2);1900>d&&(d=1900);d=H(this.scaleToScreen(e.sZ,d));4>d&&(d=4);if(this.isCursorOnTopOf(e,a,b,d,f)||this.isCursorOnTopOf(k,a,b,d,f)||this.isCursorOnTopOf(h,a,b,d,f))c[0]=e},"~N,~N,~A,~N,~N");e(c$,"setModelClickability",function(){var a;if(!this.isAtomHidden(this.leadAtomIndex)){for(var b=6;0<=--b;)a=this.getAtomFromOffsetIndex(J.modelsetbio.NucleicMonomer.ring6OffsetIndexes[b]),
a.setClickable(J.modelsetbio.NucleicMonomer.CARTOON_VISIBILITY_FLAG);if(this.$isPurine)for(b=4;1<=--b;)a=this.getAtomFromOffsetIndex(J.modelsetbio.NucleicMonomer.ring5OffsetIndexes[b]),a.setClickable(J.modelsetbio.NucleicMonomer.CARTOON_VISIBILITY_FLAG)}});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<J.modelsetbio.NucleicMonomer.heavyAtomIndexes.length;b++){var c=this.getAtomFromOffsetIndex(J.modelsetbio.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.getBonds();if(null==h)return null;for(var j=a.getGroup(),l=0;l<h.length;l++){var n=h[l].getOtherAtom(a);null!=e&&n.index==e.index||null!=k&&n.index==k.index||(n.getGroup()===j?c=n:b=n)}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 J.util.Quaternion.getQuaternionFrameV(b,
c,null,d)},"~S");h(c$,"isCrossLinked",function(a){if(!z(a,J.modelsetbio.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)},"J.modelset.Group");h(c$,"getCrossLinkLead",function(a){var b=this.$isPurine?this.getN1():this.getN3(),c=b.getBonds();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.getGroup();if(z(k,J.modelsetbio.NucleicMonomer)&&(this.$isPurine?
k.getN3():k.getN1())===e){if(null==a)return!0;a.addLast(Integer.$valueOf(k.leadAtomIndex));d=!0}}return d},"JU.List");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");
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,"O5Pr",19,"H3T",20,"O3Pr",21,"C3Pr",22,"O1P",23,"O2P",24,"C1P",25,"C4P",26,"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,-9],"ring6OffsetIndexes",[3,1,4,5,6,7],"ring5OffsetIndexes",[3,9,10,11,7],"heavyAtomIndexes",[3,1,4,5,6,7,11,10,9,16,14,8,12,17,13]);c$.CARTOON_VISIBILITY_FLAG=
c$.prototype.CARTOON_VISIBILITY_FLAG=J.viewer.JC.getShapeVisibilityFlag(11)});p("J.modelsetbio");v(["J.modelsetbio.BioPolymer"],"J.modelsetbio.NucleicPolymer",["JU.P4","$.V3","J.modelset.HBond","J.util.Measure"],function(){c$=E(J.modelsetbio,"NucleicPolymer",J.modelsetbio.BioPolymer);M(c$,function(a){U(this,J.modelsetbio.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=J.util.Measure.computeTorsion(a,f,e,k,!0));f=J.util.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=new JU.V3,j=this.monomerCount;0<=--j;){var l=this.monomers[j];
if(l.isPurine()){var n=l.getN3(),m=b.get(n.index);if(m||c.get(n.index)){var s=l.getN1(),u=l.getN0(),p=new JU.P4;J.util.Measure.getPlaneThroughPoints(n,s,u,e,k,h,p);for(var n=null,r=25,q=null,v=a.monomerCount;0<=--v;){var w=a.monomers[v];if(w.isPyrimidine()){var t=w.getN3();if(!(m?!c.get(t.index):!b.get(t.index))){var z=w.getN0(),x=s.distanceSquared(t);x<r&&(50<u.distanceSquared(z)&&1>Math.abs(J.util.Measure.distanceToPlane(p,t)))&&(q=w,n=t,r=x)}}}m=0;null!=n&&(m+=J.modelsetbio.NucleicPolymer.addHydrogenBond(d,
s,n),m>=f||(l.isGuanine()?(m+=J.modelsetbio.NucleicPolymer.addHydrogenBond(d,l.getN2(),q.getO2()),m>=f||J.modelsetbio.NucleicPolymer.addHydrogenBond(d,l.getO6(),q.getN4())):J.modelsetbio.NucleicPolymer.addHydrogenBond(d,l.getN6(),q.getO4())))}}}},"J.modelsetbio.BioPolymer,JU.BS,JU.BS,JU.List,~N,~A,~B,~B");c$.addHydrogenBond=e(c$,"addHydrogenBond",function(a,b,c){if(null==b||null==c)return 0;a.addLast(new J.modelset.HBond(b,c,18432,1,0,0));return 1},"JU.List,J.modelset.Atom,J.modelset.Atom");e(c$,
"getPdbData",function(a,b,c,d,f,e,k,h,j,l,n,m,s,u){J.modelsetbio.BioPolymer.getPdbData(a,this,b,c,d,f,e,k,h,j,l,n,m,s,u)},"J.viewer.Viewer,~S,~S,~N,~N,JU.BS,JU.BS,~B,~B,~B,~A,JU.OC,JU.SB,JU.BS")});p("J.modelsetbio");v(["J.modelsetbio.BioPolymer"],"J.modelsetbio.PhosphorusPolymer",null,function(){c$=E(J.modelsetbio,"PhosphorusPolymer",J.modelsetbio.BioPolymer);e(c$,"getPdbData",function(a,b,c,d,f,e,k,h,j,l,n,m,s,u){J.modelsetbio.BioPolymer.getPdbData(a,this,b,c,d,f,e,k,h,j,l,n,m,s,u)},"J.viewer.Viewer,~S,~S,~N,~N,JU.BS,JU.BS,~B,~B,~B,~A,JU.OC,JU.SB,JU.BS")});
p("J.dssx");v(null,"J.dssx.Bridge",["java.lang.Boolean","J.util.Escape"],function(){c$=A(function(){this.ladder=this.b=this.a=null;this.isAntiparallel=!1;x(this,arguments)},J.dssx,"Bridge");M(c$,function(a,b,c){this.a=a;this.b=b;this.ladder=P(2,2,0);this.ladder[0][0]=this.ladder[0][1]=Math.min(a.index,b.index);this.ladder[1][0]=this.ladder[1][1]=Math.max(a.index,b.index);this.addLadder(c)},"J.modelset.Atom,J.modelset.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.index;a=a.b.index;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"+J.util.Escape.e(this.ladder)})});p("J.api");ca(J.api,
"DSSPInterface");p("J.dssx");v(["J.api.DSSPInterface"],"J.dssx.DSSP","java.lang.Boolean java.util.Hashtable JU.AU $.BS $.List $.PT $.SB J.constant.EnumStructure J.dssx.Bridge J.i18n.GT J.modelset.HBond J.modelsetbio.AminoPolymer J.util.Escape $.Logger J.viewer.Viewer".split(" "),function(){c$=A(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;x(this,arguments)},J.dssx,"DSSP",null,J.api.DSSPInterface);Q(c$,function(){this.sheetOffsets=[[0,-1,1,0,1,0,0,-1],[0,0,0,0,1,-1,1,-1]]});M(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++)z(this.bioPolymers[k],J.modelsetbio.AminoPolymer)&&a.set(k);if(a.isEmpty())return"";k=this.bioPolymers[0].model;c=
new JU.SB;c.append("Jmol ").append(J.viewer.Viewer.getJmolVersion()).append(" DSSP analysis for model ").append(k.getModelNumberDotted()).append(" - ").append(k.getModelTitle()).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=X(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]=X(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.List;this.bridgesP=new JU.List;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(z(this.bioPolymers[b],J.modelsetbio.AminoPolymer)){var c=this.bioPolymers[b].monomerCount;
a[b]=P(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().atoms,c=null,d=new java.util.Hashtable,f=0;f<a.length;f++)if(z(this.bioPolymers[f],J.modelsetbio.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(z(this.bioPolymers[l],J.modelsetbio.AminoPolymer))for(var n=f==l?h+3:1;n<a[l].length-1;n++){var m=this.bioPolymers[l],s=m.monomers[n].leadAtomIndex;if(!this.bsBad.get(s)){if(null==(c=this.getBridge(a,f,h,l,n,this.bridgesP,b[j],b[s],e,m,d,!1)))if(null!=(c=this.getBridge(a,f,h,l,n,this.bridgesA,b[j],b[s],e,m,d,!0)))c.isAntiparallel=!0;else continue;J.util.Logger.debugging&&
J.util.Logger.debug("Bridge found "+c);this.done[f].set(h);this.done[l].set(n);this.htBridges.put(j+"-"+s,c)}}}},"~A");e(c$,"getBridge",function(a,b,c,d,f,e,h,p,j,l,n,m){var s=null,u=null,v=0,r=m?this.sheetOffsets[1]:this.sheetOffsets[0];return null!=(s=this.isHbonded(c+r[0],f+r[1],b,d,a))&&null!=(u=this.isHbonded(f+r[2],c+r[3],d,b,a))||null!=(s=this.isHbonded(c+r[v=4],f+r[5],b,d,a))&&null!=(u=this.isHbonded(f+r[6],c+r[7],d,b,a))?(a=new J.dssx.Bridge(h,p,this.htLadders),e.addLast(a),null!=this.vHBonds&&
(e=m?14336:6144,this.addHbond(j.monomers[c+r[v]],l.monomers[f+r[++v]],s[2],e,n),this.addHbond(l.monomers[f+r[++v]],j.monomers[c+r[++v]],u[2],e,n)),a):null},"~A,~N,~N,~N,~N,JU.List,J.modelset.Atom,J.modelset.Atom,J.modelsetbio.AminoPolymer,J.modelsetbio.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.index+" "+b.index;if(f.containsKey(e))return;f.put(e,Boolean.TRUE)}this.vHBonds.addLast(new J.modelset.HBond(a,
b,d,1,0,c/1E3))},"J.modelsetbio.Monomer,J.modelsetbio.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(z(this.bioPolymers[f],J.modelsetbio.AminoPolymer)){c.clearAll();d.clearAll();for(var e=this.bioPolymers[f],h=0;h<e.monomerCount;){var p=e.monomers[h].leadAtomIndex;if(a.get(p)){for(p=h+1;p<e.monomerCount&&a.get(e.monomers[p].leadAtomIndex);)p++;c.setBits(h,p);h=p}else b.get(p)&&d.set(h),++h}this.doReport&&(this.setTag(this.labels[f],d,"B"),this.setTag(this.labels[f],c,"E"));this.$setStructure&&this.setStructure(e,c,J.constant.EnumStructure.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.List,~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",h="\x00",p=-1,j=-1,l=a.monomerCount,n=a.monomers,m=0;m<=l;m++){if(m==l||b[m]!=f){"\x00"!=f&&d.appendC("\n").appendC(f).append(" : ").append(c).appendI(p).append("\x00"==e?"":String.valueOf(e)).append("_").append(c).appendI(j).append("\x00"==h?"":String.valueOf(h));if(m==l)break;f=b[m];
p=n[m].getResno();e=n[m].getInsertionCode()}j=n[m].getResno();h=n[m].getInsertionCode()}return d.toString()},"J.modelsetbio.AminoPolymer,~A");e(c$,"dumpTags",function(a,b,c,d){var f=a.monomers[0].getLeadAtom().getChainID()+"."+(a.bioPolymerIndexInModel+1);b=JU.PT.simpleReplace(b,"$",f);for(var e=a.monomers[0].getResno(),h="\n"+f,f=new JU.SB,p=(new JU.SB).append(h+".8: "),j=(new JU.SB).append(h+".7: "),l=(new JU.SB).append(h+".6: "),h=(new JU.SB).append(h+".0: "),n=a.monomerCount,m=0;m<n;m++)e=a.monomers[m].getResno(),
p.append(0==e%100?""+B(e/100)%100:" "),j.append(0==e%10?""+B(e/10)%10:" "),l.appendI(e%10),h.appendC(c.get(a.monomers[m].leadAtomIndex)?"!":a.monomers[m].getGroup1());1==(d&1)&&f.appendSB(p).appendSB(j).appendSB(l);f.append("\n");f.append(b);2==(d&2)&&(f.appendSB(h),f.append("\n\n"));return f.toString().$replace("\x00",".")},"J.modelsetbio.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(J.util.Logger.debugging)for(var d=0;d<c.monomerCount;d++)J.util.Logger.debug(a+"."+c.monomers[d].getResno()+"\t"+J.util.Escape.e(b[d]));var d=new JU.BS,f=this.findHelixes2(a,4,b,J.constant.EnumStructure.HELIXALPHA,10240,d),e=this.findHelixes2(a,3,b,J.constant.EnumStructure.HELIX310,8192,d),h=this.findHelixes2(a,5,b,J.constant.EnumStructure.HELIXPI,12288,d);this.$setStructure&&
this.setStructure(c,d,J.constant.EnumStructure.TURN);return this.doReport?(this.setTag(this.labels[a],d,"T"),this.dumpTags(c,"$.5: "+h+"\n$.4: "+f+"\n$.3: "+e,this.bsBad,1)):""},"~N,~A");e(c$,"findHelixes2",function(a,b,c,d,f,e){for(var h=this.bioPolymers[a],p=new JU.BS,j=new JU.BS,l=new JU.BS,n=new JU.BS,m=new JU.BS,s=this.done[a],u="",v=h.monomerCount,r=b;r<v;++r){var q=r-b,x=0;if(c[r][0][0]==a&&c[r][0][1]==q||c[r][x=1][0]==a&&c[r][1][1]==q){var w=h.monomers[q].leadAtomIndex,t=this.bsBad.nextSetBit(w),
z=h.monomers[r];if(!(t>=w&&t<=z.leadAtomIndex)){p.set(q);j.setBits(q+1,r);n.set(r);var t=s.nextSetBit(q),w=0>t||t>=r,A=!1;if(0<q&&p.get(q-1)&&(4==b||w))m.setBits(q,r),w||(u+="  WARNING! Bridge to helix at "+h.monomers[t]),A=!0;else if(w||s.nextClearBit(t)<r)A=!0;n.get(q)&&l.set(q);A&&null!=this.vHBonds&&this.addHbond(z,h.monomers[q],c[r][x][2],f,null)}}}this.doReport?(c=X(v,"\x00"),this.setTag(c,j,String.fromCharCode(48+b)),this.setTag(c,p,">"),this.setTag(c,n,"<"),this.setTag(c,l,"X")):c=null;s.or(m);
j.andNot(s);e.or(j);e.andNot(m);this.$setStructure&&this.setStructure(h,m,d);return this.doReport?(this.setTag(this.labels[a],m,String.fromCharCode(68+b)),String.valueOf(c)+u):""},"~N,~N,~A,J.constant.EnumStructure,~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}},"J.modelsetbio.AminoPolymer,JU.BS,J.constant.EnumStructure")});p("J.shapebio");v(["J.shape.AtomShape","J.modelset.Atom","J.modelsetbio.NucleicMonomer","J.viewer.JC"],"J.shapebio.BioShape","java.lang.Float JU.AU $.BS J.constant.EnumPalette $.EnumStructure J.modelsetbio.NucleicPolymer J.util.C $.Logger".split(" "),function(){c$=A(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;x(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});M(c$,function(a,b,c){U(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.getGroups(),this.meshReady=ia(this.monomerCount,!1),this.meshes=Array(this.monomerCount),this.wingVectors=c.getWingVectors(),this.leadAtomIndices=c.getLeadAtomIndices())},"J.shapebio.BioShapeCollection,~N,J.modelsetbio.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.myVisibilityFlag,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.myVisibilityFlag,f=this.monomerCount;0<=--f;){var e=this.leadAtomIndices[f];if(b.get(e)){if(null!=c&&e<c.length){if(Float.isNaN(c[e]))continue;a=Z(2E3*c[e])}var h=0<(this.mads[f]=this.getMad(f,a));this.bsSizeSet.setBitTo(f,h);this.monomers[f].setShapeVisibility(d,h);this.shape.atoms[e].setShapeVisibility(d,h);this.falsifyNearbyMesh(f)}}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.constant.EnumStructure.SHEET:case J.constant.EnumStructure.HELIX:return this.shape.madHelixSheet;case J.constant.EnumStructure.DNA:case J.constant.EnumStructure.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)&&J.util.Logger.error("Que ha ocurrido? "+c);return Z(1750*c+250);case -4:return c=this.monomers[a].getLeadAtom(),2*this.calcMeanPositionalDisplacement(c.getBfactor100())}J.util.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.constant.EnumPalette.UNKNOWN.id,d),null!=this.colixesBack&&c<this.colixesBack.length&&(this.colixesBack[c]=0),this.paletteIDs[c]=J.constant.EnumPalette.UNKNOWN.id,this.bsColixSet.set(c))}},"~A,JU.BS");e(c$,"setParams",function(a,
b,c){if(0!=this.monomerCount){var d=a[0];a=a[1];this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=new JU.BS);for(var f=b.length,e=this.monomerCount;0<=--e;){var h=this.leadAtomIndices[e];if(c.get(h)&&e<this.colixes.length&&h<f){var p=b[h],j=null==d?0:d[p],p=null==a?0:a[p];0.01<p&&(j=J.util.C.getColixTranslucent3(j,!0,p));this.colixes[e]=this.shape.getColixI(j,J.constant.EnumPalette.UNKNOWN.id,h);null!=this.colixesBack&&e<this.colixesBack.length&&(this.colixesBack[e]=0);this.paletteIDs[e]=J.constant.EnumPalette.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]=J.util.C.getColixTranslucent3(this.colixes[d],a,c),null!=this.colixesBack&&this.colixesBack.length>d&&(this.colixesBack[d]=J.util.C.getColixTranslucent3(this.colixesBack[d],a,c)),this.bsColixSet.setBitTo(d,0!=this.colixes[d]))},"~B,JU.BS,~N");h(c$,"setModelClickability",function(){if(this.isActive&&null!=this.wingVectors)for(var a=z(this.bioPolymer,J.modelsetbio.NucleicPolymer),b=this.monomerCount;0<=--b;)if(!(0>=this.mads[b])){var c=this.leadAtomIndices[b];
this.monomers[b].chain.model.modelSet.isAtomHidden(c)||(this.shape.atoms[c].setClickable(J.shapebio.BioShape.ALPHA_CARBON_VISIBILITY_FLAG),a&&this.monomers[b].setModelClickability())}});c$.ALPHA_CARBON_VISIBILITY_FLAG=c$.prototype.ALPHA_CARBON_VISIBILITY_FLAG=J.modelsetbio.NucleicMonomer.CARTOON_VISIBILITY_FLAG|J.modelset.Atom.BACKBONE_VISIBILITY_FLAG|J.viewer.JC.getShapeVisibilityFlag(10)|J.viewer.JC.getShapeVisibilityFlag(12)|J.viewer.JC.getShapeVisibilityFlag(13)|J.viewer.JC.getShapeVisibilityFlag(14);
I(c$,"eightPiSquared100",7895.6835208714865)});p("J.shapebio");v(["J.shape.Shape"],"J.shapebio.BioShapeCollection",["JU.AU","J.constant.EnumPalette","J.shapebio.BioShape","J.util.BSUtil","$.C"],function(){c$=A(function(){this.atoms=null;this.madOn=-2;this.madHelixSheet=3E3;this.madTurnRandom=800;this.madDnaRna=5E3;this.isActive=!1;this.bioShapes=null;x(this,arguments)},J.shapebio,"BioShapeCollection",J.shape.Shape);h(c$,"initModelSet",function(){this.isBioShape=!0;this.atoms=this.modelSet.atoms;this.initialize()});
h(c$,"getSizeG",function(a){var b=a.getGroupIndex();a=a.getLeadAtom().getIndex();for(var c=this.bioShapes.length;0<=--c;)for(var d=this.bioShapes[c],f=0;f<d.monomerCount;f++)if(d.monomers[f].getGroupIndex()==b&&d.monomers[f].getLeadAtom().getIndex()==a)return d.mads[f];return 0},"J.modelset.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.constant.EnumPalette.pidOf(b),f=J.util.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=P(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=J.util.C.getColixO(b[0]);f=J.util.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.viewer.getAtomShapeSetState(this,this.bioShapes)});e(c$,"initialize",function(){for(var a=this.modelSet.modelCount,b=this.modelSet.models,c=this.modelSet.getBioPolymerCount(),d=Array(c--);0<=
--a;)for(var f=this.modelSet.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$,"setVisibilityFlags",function(a){if(null!=this.bioShapes){a=J.util.BSUtil.copy(a);
for(var b=this.modelSet.modelCount;0<=--b;)a.get(b)&&this.modelSet.isTrajectory(b)&&a.set(this.modelSet.getTrajectoryIndex(b));for(b=this.bioShapes.length;0<=--b;){var c=this.bioShapes[b];c.modelVisibilityFlags=a.get(c.modelIndex)?this.myVisibilityFlag:0}}},"JU.BS");h(c$,"setModelClickability",function(){if(null!=this.bioShapes)for(var a=this.bioShapes.length;0<=--a;)this.bioShapes[a].setModelClickability()});e(c$,"getMpsShapeCount",function(){return this.bioShapes.length});e(c$,"getBioShape",function(a){return this.bioShapes[a]},
"~N")});p("J.shapebio");v(["J.shapebio.BioShapeCollection"],"J.shapebio.Rockets",null,function(){c$=E(J.shapebio,"Rockets",J.shapebio.BioShapeCollection);e(c$,"initShape",function(){W(this,J.shapebio.Rockets,"initShape",[]);this.madTurnRandom=500})});p("J.shapebio");v(["J.shapebio.Rockets"],"J.shapebio.Cartoon",null,function(){c$=E(J.shapebio,"Cartoon",J.shapebio.Rockets);e(c$,"initShape",function(){W(this,J.shapebio.Cartoon,"initShape",[]);this.madDnaRna=1E3})});p("J.shapebio");v(["J.shapebio.BioShapeCollection"],
"J.shapebio.Backbone",["java.lang.Float","JU.BS"],function(){c$=A(function(){this.bsSelected=null;x(this,arguments)},J.shapebio,"Backbone",J.shapebio.BioShapeCollection);e(c$,"initShape",function(){W(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.viewer.getBoolean(603979812),p=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 n=p[l],m=p[l+1],s=c.get(n),u=c.get(m);if(s&&u||d&&s||h&&(s||u)){e.monomers[l].setShapeVisibility(this.myVisibilityFlag,j);s=this.modelSet.atoms[n];if(null!=b){if(Float.isNaN(b.values[n])||Float.isNaN(b.values[m]))continue;
a=Z(1E3*(b.values[n]+b.values[m]));j=0!=a}n=this.modelSet.atoms[m];0!=e.mads[l]!=j&&(s.addDisplayedBackbone(this.myVisibilityFlag,j),n.addDisplayedBackbone(this.myVisibilityFlag,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$,"setModelClickability",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.modelSet.atoms[c[b]];0<d.getNBackbonesDisplayed()&&!this.modelSet.isAtomHidden(b)&&d.setClickable(this.myVisibilityFlag)}})});p("J.shapebio");v(["J.shapebio.BioShapeCollection"],"J.shapebio.Strands",null,function(){c$=A(function(){this.isMesh=!1;x(this,arguments)},J.shapebio,"Strands",J.shapebio.BioShapeCollection)});p("J.shapebio");v(["J.shapebio.BioShapeCollection"],"J.shapebio.Ribbons",null,function(){c$=E(J.shapebio,"Ribbons",J.shapebio.BioShapeCollection)});p("J.shapebio");v(["J.shapebio.Strands"],
"J.shapebio.MeshRibbon",null,function(){c$=E(J.shapebio,"MeshRibbon",J.shapebio.Strands);e(c$,"initShape",function(){W(this,J.shapebio.MeshRibbon,"initShape",[]);this.isMesh=!0})});p("J.shapebio");v(["J.shapebio.BioShapeCollection"],"J.shapebio.Trace",["J.atomdata.RadiusData","J.constant.EnumVdw","J.modelset.Atom"],function(){c$=E(J.shapebio,"Trace",J.shapebio.BioShapeCollection);e(c$,"initShape",function(){W(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=R(b.length(),0),f=0,e=0,h=3.4028235E38,p=0,j=b.nextSetBit(0);0<=j;j=b.nextSetBit(j+1)){var l=J.modelset.Atom.atomPropertyFloat(null,this.atoms[j],1112541199),f=f+l,e=e+l*l;l<h&&(h=l);l>p&&(p=l)}var l=f/c,c=Math.sqrt((e-f*f/c)/c),f=a[1],e=a[2],n=a[3],m=a[4],s=a[5],u=H(a[6]),p=p-h,v=!1;switch(u){case 0:case 1:case 2:case 3:v=
!0}for(j=b.nextSetBit(0);0<=j;j=b.nextSetBit(j+1)){var r=J.modelset.Atom.atomPropertyFloat(null,this.atoms[j],1112541199);switch(u){case 0:case 4:r=1+(r-l)/e/c;break;case 1:case 5:r=(r-h)/p/e;break;case 2:case 6:r/=e;break;case 8:0>r&&(r=0),r=Math.sqrt(r/8)/3.141592653589793}0>r&&(r=0);v&&(r=Math.pow(r,s));r<n&&0<=n&&(r=n);r>m&&0<=m&&(r=m);d[j]=r*f}d=new J.atomdata.RadiusData(d,0,J.atomdata.RadiusData.EnumType.ABSOLUTE,J.constant.EnumVdw.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)});p("J.renderbio");v("J.render.MeshRenderer JU.A4 $.BS $.M3 $.P3 $.P3i $.V3".split(" "),"J.renderbio.BioShapeRenderer","J.constant.EnumStructure J.modelsetbio.CarbohydratePolymer $.NucleicPolymer J.shape.Mesh J.util.C $.Hermite $.Logger $.Normix".split(" "),function(){c$=A(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;x(this,arguments)},
J.renderbio,"BioShapeRenderer",J.render.MeshRenderer);Q(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.g3d.isPass2();this.needTranslucent=this.invalidateMesh=!1;this.g3d.addRenderer(553648147);var a=!this.isExport&&!this.viewer.checkMotionRendering(1113200642);a!=this.wireframeOnly&&(this.invalidateMesh=!0);this.wireframeOnly=a;a=this.isExport||!this.wireframeOnly&&this.viewer.getBoolean(603979864);a!=this.isHighRes&&(this.invalidateMesh=!0);this.isHighRes=a;a=!this.wireframeOnly&&
this.viewer.getBoolean(603979819);this.cartoonsFancy!=a&&(this.invalidateMesh=!0,this.cartoonsFancy=a);a=this.viewer.getHermiteLevel();a=0>=a?-a:this.viewer.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.viewer.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.viewer.getBoolean(603979966);a!=this.isTraceAlpha&&(this.invalidateMesh=!0);this.isTraceAlpha=a;this.invalidateSheets=!1;a=this.viewer.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.setColix(a))return!0;this.needTranslucent=!0;return!1},"~N");e(c$,"freeTempArrays",function(){this.haveControlPointScreens&&this.viewer.freeTempScreens(this.controlPointScreens);this.viewer.freeTempEnum(this.structureTypes)});e(c$,"initializePolymer",function(a){var b=this.viewer.getDeletedAtoms();this.controlPoints=this.viewer.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.modelSet.isAtomHidden(this.leadAtomIndices[d])||null!=b&&b.get(this.leadAtomIndices[d]))){var e=this.modelSet.atoms[this.leadAtomIndices[d]];this.g3d.isInDisplayRange(e.sX,e.sY)&&(this.bsVisible.set(d),c=!0)}if(!c)return!1;this.ribbonBorder=this.viewer.getBoolean(603979898);this.isNucleic=z(a.bioPolymer,J.modelsetbio.NucleicPolymer);this.isCarbohydrate=z(a.bioPolymer,J.modelsetbio.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(){this.structureTypes=this.viewer.allocTempEnum(this.monomerCount+1);for(var a=this.monomerCount;0<=--a;)this.structureTypes[a]=this.monomers[a].getProteinStructureType(),this.structureTypes[a]===J.constant.EnumStructure.TURN&&(this.structureTypes[a]=J.constant.EnumStructure.NONE);this.structureTypes[this.monomerCount]=this.structureTypes[this.monomerCount-
1]});e(c$,"isHelix",function(a){return this.structureTypes[a]===J.constant.EnumStructure.HELIX},"~N");e(c$,"getScreenControlPoints",function(){this.calcScreenControlPoints(this.controlPoints)});e(c$,"calcScreenControlPoints",function(a){var b=this.monomerCount+1;for(this.controlPointScreens=this.viewer.allocTempScreens(b);0<=--b;)this.viewer.transformPtScr(a[b],this.controlPointScreens[b]);this.haveControlPointScreens=!0},"~A");e(c$,"calcScreens",function(a){var b=this.controlPoints.length,c=this.viewer.allocTempScreens(b);
if(0==a)for(;0<=--b;)this.viewer.transformPtScr(this.controlPoints[b],c[b]);else for(a/=1E3;0<=--b;)this.calc1Screen(this.controlPoints[b],this.wingVectors[b],0==this.mads[b]&&0<b?this.mads[b-1]:this.mads[b],a,c[b]);return c},"~N");e(c$,"calc1Screen",function(a,b,c,d,e){this.pointT.scaleAdd2(c*d,b,a);this.viewer.transformPtScr(this.pointT,e)},"JU.P3,JU.V3,~N,~N,JU.P3i");e(c$,"getLeadColix",function(a){return J.util.C.getColixInherited(this.colixes[a],this.monomers[a].getLeadAtom().getColix())},"~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&&(z(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=H(this.viewer.scaleToScreen(this.controlPointScreens[a].z,this.madBeg));
this.diameterMid=H(this.viewer.scaleToScreen(this.monomers[a].getLeadAtom().sZ,this.madMid));this.diameterEnd=H(this.viewer.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){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))return;this.meshes[a].setColix(this.colix);this.bsRenderMesh.set(a);return}catch(c){if(F(c,Exception))this.bsRenderMesh.clear(a),this.meshes[a]=null,J.util.Logger.error("render mesh error hermiteConic: "+c.toString());else throw c;}0==this.diameterBeg&&0==this.diameterEnd||this.wireframeOnly?this.g3d.drawLineAB(this.controlPointScreens[a],this.controlPointScreens[this.iNext]):
this.g3d.fillHermite(this.isNucleic?4:7,this.diameterBeg,this.diameterMid,this.diameterEnd,this.controlPointScreens[this.iPrev],this.controlPointScreens[a],this.controlPointScreens[this.iNext],this.controlPointScreens[this.iNext2])}},"~N,~B");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))return;this.meshes[b].setColix(this.colix);this.meshes[b].setColixBack(this.colixBack);this.bsRenderMesh.set(b);return}catch(d){if(F(d,Exception))this.bsRenderMesh.clear(b),this.meshes[b]=null,J.util.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],H(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,B(Math.floor(1.2*this.madBeg)),B(Math.floor(0.6*this.madBeg)),0,1==this.aspectRatio?this.aspectRatio:this.aspectRatio/2))return;this.meshes[a].setColix(this.colix);this.bsRenderMesh.set(a);return}catch(b){if(F(b,Exception))this.bsRenderMesh.clear(a),this.meshes[a]=null,J.util.Logger.error("render mesh error hermiteArrowHead: "+b.toString());else throw b;}this.calc1Screen(this.controlPoints[a],this.wingVectors[a],this.madBeg,
7E-4,this.screenArrowTop);this.calc1Screen(this.controlPoints[a],this.wingVectors[a],this.madBeg,-7E-4,this.screenArrowBot);this.calc1Screen(this.controlPoints[a],this.wingVectors[a],this.madBeg,0.001,this.screenArrowTopPrev);this.calc1Screen(this.controlPoints[a],this.wingVectors[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],H(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,e){this.setNeighbors(a);if(0==this.controlPoints[a].distance(this.controlPoints[this.iNext]))return!1;
var g=1!=e&&null!=this.wingVectors,h=0==e,p=this.cartoonsFancy||6<=this.hermiteLevel,j=2*(this.hermiteLevel+1)+1,l=h?4:4*(this.hermiteLevel+1)-2,n=h?3.141592653589793/(l-1):6.283185307179586/l,m=this.meshes[a]=(new J.shape.Mesh).mesh1("mesh_"+this.shapeID+"_"+a,0,a),s=b!=c||c!=d;if(null==this.controlHermites||this.controlHermites.length<j+1)this.controlHermites=Array(j+1);J.util.Hermite.getHermiteList(this.isNucleic?4:7,this.controlPoints[this.iPrev],this.controlPoints[a],this.controlPoints[this.iNext],
this.controlPoints[this.iNext2],this.controlPoints[this.iNext3],this.controlHermites,0,j,!0);if(null==this.wingHermites||this.wingHermites.length<j+1)this.wingHermites=Array(j+1);this.wing.setT(this.wingVectors[this.iPrev]);0==d&&this.wing.scale(2);J.util.Hermite.getHermiteList(this.isNucleic?4:7,this.wing,this.wingVectors[a],this.wingVectors[this.iNext],this.wingVectors[this.iNext2],this.wingVectors[this.iNext3],this.wingHermites,0,j,!1);b/=2E3;c/=2E3;d/=2E3;if(s){if(null==this.radiusHermites||this.radiusHermites.length<
(j+1>>1)+1)this.radiusHermites=Array((j+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);J.util.Hermite.getHermiteList(4,this.ptPrev,this.pt,this.pt1,this.ptNext,this.ptNext,this.radiusHermites,0,j+1>>1,!0)}d=0;c=j>>1;for(var u=B((l+2)/4),v=B((3*l+2)/4),g=!g?0:h?1:p?2:3,p=0==g||3==g,r=0;r<j;r++){this.norm.sub2(this.controlHermites[r+1],this.controlHermites[r]);var q=!s?b:r<c?this.radiusHermites[r].x:this.radiusHermites[r-c].y;this.wing.setT(this.wingHermites[r]);
this.wing1.setT(this.wing);switch(g){case 2:this.wing1.cross(this.norm,this.wing);this.wing1.normalize();this.wing1.scale(this.wing.length()/e);break;case 3:this.wing.scale(2/e);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);p&&(this.aa.setVA(this.norm,n),this.mat.setAA(this.aa));this.pt1.setT(this.controlHermites[r]);for(var x=h?0:n,q=0;q<l;q++,x+=n){p&&0<q&&this.mat.transform(this.wing);switch(g){case 1:this.wingT.setT(this.wing1);
this.wingT.scale(Math.cos(x));break;case 2:this.wingT.setT(this.wing1);this.wingT.scale(Math.sin(x));this.wingT.scaleAdd2(Math.cos(x),this.wing,this.wingT);break;case 3:this.wingT.setT(this.wing);(q==u||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);m.addV(this.pt)}if(0<r){x=h?l-1:l;for(q=0;q<x;q++){var w=d-l+q,t=d-l+(q+1)%l,z=d+(q+1)%l,A=d+q;q<B(x/2)?m.addQuad(w,t,z,A):m.addQuad(t,z,A,w)}}d+=l}if(!h){e=d;if(this.doCap0){for(h=
0;h<l;h++)m.addV(m.vertices[h]);d+=l;for(q=2*this.hermiteLevel;0<=--q;)m.addQuad(d-l+q+2,d-l+q+1,d-l+(l-q)%l,d-q-1)}if(this.doCap1){for(h=0;h<l;h++)m.addV(m.vertices[e-l+h]);d+=l;for(q=2*this.hermiteLevel;0<=--q;)m.addQuad(d-q-1,d-l+(l-q)%l,d-l+q+1,d-l+q+2)}}this.meshReady[a]=!0;this.adjustCartoonSeamNormals(a,l);m.setVisibilityFlags(1);return!0},"~N,~N,~N,~N,~N");e(c$,"adjustCartoonSeamNormals",function(a,b){null==this.bsTemp&&(this.bsTemp=J.util.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(),e=d.length;this.doCap0&&(e-=b);for(var g=1;g<=b;++g)this.norml.add2(d[e-g],c[b-g]),this.norml.normalize(),this.meshes[a].normalsTemp[e-g].setT(this.norml),this.meshes[this.iNext].normalsTemp[b-g].setT(this.norml)}catch(h){if(!F(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)});p("J.renderbio");v(["J.renderbio.BioShapeRenderer"],
"J.renderbio.StrandsRenderer",["J.shapebio.Strands"],function(){c$=A(function(){this.strandCount=1;this.baseStrandOffset=this.strandSeparation=0;x(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=z(this.shape,J.shapebio.Strands)?
this.viewer.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.renderStrand(a);this.viewer.freeTempScreens(a);a=this.calcScreens(-c);this.renderStrand(a);this.viewer.freeTempScreens(a)}1==this.strandCount%
2&&(a=this.calcScreens(0),this.renderStrand(a),this.viewer.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")});p("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")});p("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.getScreenControlPoints();this.ribbonTopScreens=this.calcScreens(b);this.ribbonBottomScreens=this.calcScreens(-c);for(b=this.bsVisible.nextSetBit(0);0<=b;b=this.bsVisible.nextSetBit(b+1))this.renderHermiteRibbon(a,b,!1);this.viewer.freeTempScreens(this.ribbonTopScreens);this.viewer.freeTempScreens(this.ribbonBottomScreens)},"~B,~N,~N")});p("J.renderbio");v(["J.renderbio.StrandsRenderer","JU.P3","$.V3"],"J.renderbio.RocketsRenderer",
["J.constant.EnumStructure","J.modelsetbio.AlphaPolymer","$.Helix","$.Sheet"],function(){c$=A(function(){this.renderArrowHeads=this.newRockets=!1;this.cordMidPoints=null;this.tPending=!1;this.proteinstructurePending=null;this.endIndexPending=this.startIndexPending=0;this.screenCorners=this.corners=this.vH=this.vW=this.ptTip=this.ptC=this.vTemp=this.vtemp=this.screenC=this.screenB=this.screenA=null;x(this,arguments)},J.renderbio,"RocketsRenderer",J.renderbio.StrandsRenderer);Q(c$,function(){this.screenA=
new JU.P3;this.screenB=new JU.P3;this.screenC=new JU.P3;this.vtemp=new JU.V3;this.vTemp=new JU.V3;this.ptC=new JU.P3;this.ptTip=new JU.P3;this.vW=new JU.V3;this.vH=new JU.V3;this.corners=Array(8);this.screenCorners=Array(8)});h(c$,"renderBioShape",function(a){if(z(a.bioPolymer,J.modelsetbio.AlphaPolymer))if(this.wireframeOnly)this.renderStrands();else{var b=!this.viewer.getBoolean(603979900);this.renderArrowHeads!=b&&(a.falsifyMesh(),this.renderArrowHeads=b);this.calcRopeMidPoints(this.newRockets);
this.calcScreenControlPoints(this.cordMidPoints);this.controlPoints=this.cordMidPoints;this.renderRockets();this.viewer.freeTempPoints(this.cordMidPoints)}},"J.shapebio.BioShape");e(c$,"isSheet",function(a){return this.structureTypes[a]===J.constant.EnumStructure.SHEET},"~N");e(c$,"calcRopeMidPoints",function(a){this.cordMidPoints=this.viewer.allocTempPoints(this.monomerCount+1);for(var b=null,c,d=0;d<this.monomerCount;++d){c=this.cordMidPoints[d];var e=this.monomers[d];a&&this.renderArrowHeads?c.setT(this.controlPoints[d]):
this.isHelix(d)||!a&&this.isSheet(d)?(b=e.getProteinStructure(),c.setT(d-1!=b.getMonomerIndex()?b.getAxisStartPoint():b.getAxisEndPoint())):(null!=b?c.setT(b.getAxisEndPoint()):c.setT(this.controlPoints[d]),b=null)}c=this.cordMidPoints[this.monomerCount];null!=b?c.setT(b.getAxisEndPoint()):c.setT(this.controlPoints[this.monomerCount])},"~B");e(c$,"renderRockets",function(){this.tPending=!1;for(var a=this.bsVisible.nextSetBit(0);0<=a;a=this.bsVisible.nextSetBit(a+1)){var b=this.monomers[a];this.isHelix(a)||
this.isSheet(a)?this.renderSpecialSegment(b,this.getLeadColix(a),this.mads[a]):(this.renderPending(),this.renderHermiteConic(a,!0))}this.renderPending()});e(c$,"renderSpecialSegment",function(a,b,c){var d=a.getProteinStructure();if(this.tPending){if(d===this.proteinstructurePending&&c==this.mad&&b==this.colix&&d.getIndex(a)==this.endIndexPending+1){++this.endIndexPending;return}this.renderPending()}this.proteinstructurePending=d;this.startIndexPending=this.endIndexPending=d.getIndex(a);this.colix=
b;this.mad=c;this.tPending=!0},"J.modelsetbio.Monomer,~N,~N");e(c$,"renderPending",function(){if(this.tPending){var a=this.proteinstructurePending.getSegments(),b=this.endIndexPending==this.proteinstructurePending.getMonomerCount()-1;z(this.proteinstructurePending,J.modelsetbio.Helix)?this.renderPendingRocketSegment(this.endIndexPending,a[this.startIndexPending],a[this.endIndexPending],a[this.endIndexPending+1],b):z(this.proteinstructurePending,J.modelsetbio.Sheet)&&this.renderPendingSheet(a[this.startIndexPending],
a[this.endIndexPending],a[this.endIndexPending+1],b);this.tPending=!1}});e(c$,"renderPendingRocketSegment",function(a,b,c,d,e){this.viewer.transformPt3f(b,this.screenA);this.viewer.transformPt3f(d,this.screenB);c=B(Math.floor((this.screenA.z+this.screenB.z)/2));c=H(this.viewer.scaleToScreen(c,this.mad));this.g3d.setColix(this.colix)&&(this.g3d.fillCylinderBits(2,c,this.screenA,this.screenB),e&&this.renderArrowHeads&&(this.vtemp.sub2(d,b),this.vtemp.normalize(),this.screenA.scaleAdd2(4,this.vtemp,
d),this.viewer.transformPt3f(this.screenA,this.screenC),this.renderCone(a,d,this.screenA,this.screenB,this.screenC)),this.startIndexPending!=this.endIndexPending&&(a=this.screenB,this.screenB=this.screenC,this.screenC=a))},"~N,JU.P3,JU.P3,JU.P3,~B");e(c$,"renderCone",function(a,b,c,d,e){a=(this.mad<<1)-(this.mad>>1);a=H(this.viewer.scaleToScreen(B(Math.floor(d.z)),a));this.g3d.fillConeSceen3f(2,a,d,e)},"~N,JU.P3,JU.P3,JU.P3,JU.P3");e(c$,"renderPendingSheet",function(a,b,c,d){if(this.g3d.setColix(this.colix)){if(null==
this.corners[0])for(var e=8;0<=--e;)this.corners[e]=new JU.P3,this.screenCorners[e]=new JU.P3;if(d&&this.renderArrowHeads){this.setBox(1.25,0.333,b);this.ptTip.scaleAdd2(-0.5,this.vH,c);for(e=4;0<=--e;)c=this.corners[e],c.setT(this.ptC),0!=(e&1)&&c.add(this.vW),0!=(e&2)&&c.add(this.vH),this.viewer.transformPt3f(c,this.screenCorners[e]);this.corners[4].setT(this.ptTip);this.viewer.transformPt3f(this.ptTip,this.screenCorners[4]);this.corners[5].add2(this.ptTip,this.vH);this.viewer.transformPt3f(this.corners[5],
this.screenCorners[5]);this.g3d.fillTriangle3f(this.screenCorners[0],this.screenCorners[1],this.screenCorners[4],!0);this.g3d.fillTriangle3f(this.screenCorners[2],this.screenCorners[3],this.screenCorners[5],!0);for(e=0;12>e;e+=4){c=J.renderbio.RocketsRenderer.arrowHeadFaces[e];d=J.renderbio.RocketsRenderer.arrowHeadFaces[e+1];var g=J.renderbio.RocketsRenderer.arrowHeadFaces[e+2],h=J.renderbio.RocketsRenderer.arrowHeadFaces[e+3];this.g3d.fillQuadrilateral(this.screenCorners[c],this.screenCorners[d],
this.screenCorners[g],this.screenCorners[h])}c=b}this.setBox(1,0.25,a);this.vTemp.sub2(c,a);this.buildBox(this.ptC,this.vW,this.vH,this.vTemp);for(e=0;6>e;++e)c=J.renderbio.RocketsRenderer.boxFaces[4*e],d=J.renderbio.RocketsRenderer.boxFaces[4*e+1],g=J.renderbio.RocketsRenderer.boxFaces[4*e+2],h=J.renderbio.RocketsRenderer.boxFaces[4*e+3],this.g3d.fillQuadrilateral(this.screenCorners[c],this.screenCorners[d],this.screenCorners[g],this.screenCorners[h])}},"JU.P3,JU.P3,JU.P3,~B");e(c$,"setBox",function(a,
b,c){var d=this.proteinstructurePending,e=this.mad/1E3;this.vW.setT(d.getWidthUnitVector());this.vW.scale(e*a);this.vH.setT(d.getHeightUnitVector());this.vH.scale(e*b);this.ptC.ave(this.vW,this.vH);this.ptC.sub2(c,this.ptC)},"~N,~N,JU.P3");e(c$,"buildBox",function(a,b,c,d){for(var e=8;0<=--e;){var g=this.corners[e];g.setT(a);0!=(e&1)&&g.add(b);0!=(e&2)&&g.add(c);0!=(e&4)&&g.add(d);this.viewer.transformPt3f(g,this.screenCorners[e])}},"JU.P3,JU.V3,JU.V3,JU.V3");I(c$,"boxFaces",[0,1,3,2,0,2,6,4,0,4,
5,1,7,5,4,6,7,6,2,3,7,3,1,5],"arrowHeadFaces",[0,1,3,2,0,4,5,2,1,4,5,3])});p("J.renderbio");v(["J.renderbio.RocketsRenderer","JU.P3","$.P3i"],"J.renderbio.CartoonRenderer",["J.util.C"],function(){c$=A(function(){this.ladderOnly=this.renderEdges=this.renderAsRockets=!1;this.ring5Screens=this.ring5Points=this.ring6Screens=this.ring6Points=this.ptConnect=this.ptConnectScr=null;x(this,arguments)},J.renderbio,"CartoonRenderer",J.renderbio.RocketsRenderer);Q(c$,function(){this.ptConnectScr=new JU.P3i;this.ptConnect=
new JU.P3;this.ring6Points=Array(6);this.ring6Screens=Array(6);this.ring5Points=Array(5);this.ring5Screens=Array(5);this.ring6Screens[5]=new JU.P3i;for(var a=5;0<=--a;)this.ring5Screens[a]=new JU.P3i,this.ring6Screens[a]=new JU.P3i});h(c$,"renderBioShape",function(a){if(this.wireframeOnly)this.renderStrands();else if(this.newRockets=!0,!(null==this.wingVectors||this.isCarbohydrate))if(this.getScreenControlPoints(),this.isNucleic)this.renderNucleic();else{var b=this.viewer.getBoolean(603979818);this.renderAsRockets!=
b&&(a.falsifyMesh(),this.renderAsRockets=b);b=!this.viewer.getBoolean(603979900);this.renderArrowHeads!=b&&(a.falsifyMesh(),this.renderArrowHeads=b);this.ribbonTopScreens=this.calcScreens(0.5);this.ribbonBottomScreens=this.calcScreens(-0.5);this.calcRopeMidPoints(this.newRockets);this.renderArrowHeads||(this.calcScreenControlPoints(this.cordMidPoints),this.controlPoints=this.cordMidPoints);this.renderRockets();this.viewer.freeTempPoints(this.cordMidPoints);this.viewer.freeTempScreens(this.ribbonTopScreens);
this.viewer.freeTempScreens(this.ribbonBottomScreens)}},"J.shapebio.BioShape");e(c$,"renderNucleic",function(){this.renderEdges=this.viewer.getBoolean(603979817);this.ladderOnly=this.viewer.getBoolean(603979820);for(var a=this.viewer.getBoolean(603979966),b=this.bsVisible.nextSetBit(0);0<=b;b=this.bsVisible.nextSetBit(b+1))a?(this.ptConnectScr.set(B((this.controlPointScreens[b].x+this.controlPointScreens[b+1].x)/2),B((this.controlPointScreens[b].y+this.controlPointScreens[b+1].y)/2),B((this.controlPointScreens[b].z+
this.controlPointScreens[b+1].z)/2)),this.ptConnect.ave(this.controlPoints[b],this.controlPoints[b+1])):(this.ptConnectScr.setT(this.controlPointScreens[b+1]),this.ptConnect.setT(this.controlPoints[b+1])),this.renderHermiteConic(b,!1),this.colix=this.getLeadColix(b),this.setBioColix(this.colix)&&this.renderNucleicBaseStep(this.monomers[b],this.mads[b],this.ptConnectScr,this.ptConnect)});h(c$,"renderRockets",function(){for(var a=!1,b=!1,c=null,d,e=this.monomerCount;0<=--e;){d=this.monomers[e].getProteinStructure();
d!==c&&(this.renderAsRockets&&(b=!1),a=!1);c=d;d=this.isHelix(e);var g=this.isSheet(e),h=this.renderAsRockets||!this.renderArrowHeads?d:!1;this.bsVisible.get(e)&&!h&&(g||d?a&&g||b&&d?this.renderHermiteRibbon(!0,e,!0):this.renderHermiteArrowHead(e):this.renderHermiteConic(e,!0));a=g;b=d}(this.renderAsRockets||!this.renderArrowHeads)&&this.renderCartoonRockets()});e(c$,"renderCartoonRockets",function(){this.tPending=!1;for(var a=this.bsVisible.nextSetBit(0);0<=a;a=this.bsVisible.nextSetBit(a+1))this.isHelix(a)&&
this.renderSpecialSegment(this.monomers[a],this.getLeadColix(a),this.mads[a]);this.renderPending()});e(c$,"renderNucleicBaseStep",function(a,b,c,d){if(this.renderEdges)this.renderLeontisWesthofEdges(a,b);else{a.getBaseRing6Points(this.ring6Points);this.viewer.transformPoints(this.ring6Points,this.ring6Screens);this.renderRing6();a=a.maybeGetBaseRing5Points(this.ring5Points);var e,g;a?(this.viewer.transformPoints(this.ring5Points,this.ring5Screens),this.renderRing5(),this.ladderOnly?(e=this.ring6Screens[2],
g=this.ring6Points[2]):(e=this.ring5Screens[3],g=this.ring5Points[3])):(g=this.ladderOnly?4:2,e=this.ring6Screens[g],g=this.ring6Points[g]);this.mad=1<b?B(b/2):b;this.g3d.fillCylinderScreen3I(3,H(this.viewer.scaleToScreen(c.z,this.mad)),c,e,d,g,this.mad/2E3);if(!this.ladderOnly){--this.ring6Screens[5].z;for(b=5;0<=--b;)--this.ring6Screens[b].z,a&&--this.ring5Screens[b].z;for(b=6;0<--b;)this.g3d.fillCylinderScreen3I(3,3,this.ring6Screens[b],this.ring6Screens[b-1],this.ring6Points[b],this.ring6Points[b-
1],0.005);if(a)for(b=5;0<--b;)this.g3d.fillCylinderScreen3I(3,3,this.ring5Screens[b],this.ring5Screens[b-1],this.ring5Points[b],this.ring5Points[b-1],0.005);else this.g3d.fillCylinderScreen3I(3,3,this.ring6Screens[5],this.ring6Screens[0],this.ring6Points[5],this.ring6Points[0],0.005)}}},"J.modelsetbio.NucleicMonomer,~N,JU.P3i,JU.P3");e(c$,"renderLeontisWesthofEdges",function(a,b){if(a.getEdgePoints(this.ring6Points)){this.viewer.transformPoints(this.ring6Points,this.ring6Screens);this.renderTriangle();
this.mad=1<b?B(b/2):b;this.g3d.fillCylinderScreen3I(3,3,this.ring6Screens[0],this.ring6Screens[1],this.ring6Points[0],this.ring6Points[1],0.005);this.g3d.fillCylinderScreen3I(3,3,this.ring6Screens[1],this.ring6Screens[2],this.ring6Points[1],this.ring6Points[2],0.005);var c=J.util.C.isColixTranslucent(this.colix),d=J.util.C.getColixTranslucencyLevel(this.colix),e=J.util.C.getColixTranslucent3(10,c,d),g=J.util.C.getColixTranslucent3(11,c,d),c=J.util.C.getColixTranslucent3(7,c,d);this.g3d.setColix(e);
this.g3d.fillCylinderScreen3I(3,3,this.ring6Screens[2],this.ring6Screens[3],this.ring6Points[2],this.ring6Points[3],0.005);this.g3d.setColix(g);this.g3d.fillCylinderScreen3I(3,3,this.ring6Screens[3],this.ring6Screens[4],this.ring6Points[3],this.ring6Points[4],0.005);this.g3d.setColix(c);this.g3d.fillCylinderScreen3I(3,3,this.ring6Screens[4],this.ring6Screens[5],this.ring6Points[4],this.ring6Points[5],0.005)}},"J.modelsetbio.NucleicMonomer,~N");e(c$,"renderTriangle",function(){this.g3d.setNoisySurfaceShade(this.ring6Screens[2],
this.ring6Screens[3],this.ring6Screens[4]);this.g3d.fillTriangle3i(this.ring6Screens[2],this.ring6Screens[3],this.ring6Screens[4],this.ring6Points[2],this.ring6Points[3],this.ring6Points[4])});e(c$,"renderRing6",function(){this.ladderOnly||(this.g3d.setNoisySurfaceShade(this.ring6Screens[0],this.ring6Screens[2],this.ring6Screens[4]),this.g3d.fillTriangle3i(this.ring6Screens[0],this.ring6Screens[2],this.ring6Screens[4],this.ring6Points[0],this.ring6Points[2],this.ring6Points[4]),this.g3d.fillTriangle3i(this.ring6Screens[0],
this.ring6Screens[1],this.ring6Screens[2],this.ring6Points[0],this.ring6Points[1],this.ring6Points[2]),this.g3d.fillTriangle3i(this.ring6Screens[0],this.ring6Screens[4],this.ring6Screens[5],this.ring6Points[0],this.ring6Points[4],this.ring6Points[5]),this.g3d.fillTriangle3i(this.ring6Screens[2],this.ring6Screens[3],this.ring6Screens[4],this.ring6Points[2],this.ring6Points[3],this.ring6Points[4]))});e(c$,"renderRing5",function(){this.ladderOnly||(this.g3d.fillTriangle3i(this.ring5Screens[0],this.ring5Screens[2],
this.ring5Screens[3],this.ring5Points[0],this.ring5Points[2],this.ring5Points[3]),this.g3d.fillTriangle3i(this.ring5Screens[0],this.ring5Screens[1],this.ring5Screens[2],this.ring5Points[0],this.ring5Points[1],this.ring5Points[2]),this.g3d.fillTriangle3i(this.ring5Screens[0],this.ring5Screens[3],this.ring5Screens[4],this.ring5Points[0],this.ring5Points[3],this.ring5Points[4]))})});p("J.renderbio");v(["J.renderbio.BioShapeRenderer"],"J.renderbio.BackboneRenderer",["J.util.C"],function(){c$=E(J.renderbio,
"BackboneRenderer",J.renderbio.BioShapeRenderer);h(c$,"renderBioShape",function(a){a=this.viewer.isJmolDataFrameForModel(a.modelIndex);for(var b=this.bsVisible.nextSetBit(0);0<=b;b=this.bsVisible.nextSetBit(b+1)){var c=this.modelSet.atoms[this.leadAtomIndices[b]],d=this.modelSet.atoms[this.leadAtomIndices[b+1]];if(!(0==c.getNBackbonesDisplayed()||0==d.getNBackbonesDisplayed()||this.modelSet.isAtomHidden(d.getIndex())))if(a||!(10<c.distance(d))){var e=J.util.C.getColixInherited(this.colixes[b],c.getColix()),
g=J.util.C.getColixInherited(this.colixes[b+1],d.getColix());if(!this.isExport&&!this.isPass2){var h=!J.util.C.isColixTranslucent(e),p=!J.util.C.isColixTranslucent(g);if(!h||!p){if(!h&&!p)continue;this.needTranslucent=!0}}var h=c.sX,p=c.sY,c=c.sZ,j=d.sX,l=d.sY,d=d.sZ;this.mad=this.mads[b];if(0>this.mad)this.g3d.drawLine(e,g,h,p,c,j,l,d);else{var n=H(1==this.exportType?this.mad:this.viewer.scaleToScreen(B((c+d)/2),this.mad));this.g3d.fillCylinderXYZ(e,g,3,n,h,p,c,j,l,d)}}}},"J.shapebio.BioShape")});
p("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.getScreenControlPoints();for(var a=this.bsVisible.nextSetBit(0);0<=a;a=this.bsVisible.nextSetBit(a+1))this.renderHermiteConic(a,!1)})})})(Clazz,Clazz.newArray,Clazz.newBooleanArray,Clazz.newByteArray,
Clazz.newCharArray,Clazz.newDoubleArray,Clazz.newFloatArray,Clazz.newIntArray,Clazz.newLongArray,Clazz.newShortArray,Clazz.prepareCallback,Clazz.decorateAsClass,Clazz.isClassDefined,Clazz.defineEnumConstant,Clazz.cloneFinals,Clazz.inheritArgs,Clazz.pu$h,Clazz.declareInterface,Clazz.declarePackage,Clazz.makeConstructor,Clazz.overrideConstructor,Clazz.load,Clazz.defineMethod,Clazz.innerTypeInstance,Clazz.instanceOf,Clazz.p0p,Clazz.makeFunction,Clazz.superConstructor,Clazz.defineStatics,Clazz.registerSerializableFields,
Clazz.declareType,Clazz.superCall,Clazz.overrideMethod,Clazz.declareAnonymous,Clazz.checkPrivateMethod,Clazz.prepareFields,Clazz.instantialize,Clazz.doubleToInt,Clazz.declarePackage,Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,Clazz.floatToInt,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.supportsNativeObject,Clazz.extendedObjectMethods,Clazz.callingStackTraces,Clazz.clone,Clazz.doubleToShort,Clazz.innerFunctions,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);
