Clazz.declarePackage("J.adapter.readers.cifpdb");
Clazz.load(["J.adapter.smarter.AtomSetCollectionReader","java.util.Hashtable"],"J.adapter.readers.cifpdb.PdbReader","java.lang.Boolean $.Character $.Float J.adapter.smarter.Atom $.Structure J.api.Interface $.JmolAdapter J.constant.EnumStructure J.util.Escape $.JmolList $.Logger $.Matrix4f $.P3 $.Parser $.SB $.TextFormat".split(" "),function(){c$=Clazz.decorateAsClass(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.vBiomts=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=!1;this.tlsU=this.dataT=null;Clazz.instantialize(this,arguments)},J.adapter.readers.cifpdb,"PdbReader",J.adapter.smarter.AtomSetCollectionReader);Clazz.prepareFields(c$,function(){this.htFormul=
new java.util.Hashtable;this.dataT=Clazz.newFloatArray(8,0)});Clazz.overrideMethod(c$,"initializeReader",function(){this.setIsPDB();this.pdbHeader=this.getHeader?new J.util.SB:null;this.applySymmetry=!this.checkFilterKey("NOSYMMETRY");this.getTlsGroups=this.checkFilterKey("TLS");this.htParams.containsKey("vTlsModels")&&(this.vTlsModels=this.htParams.remove("vTlsModels"));if(this.checkFilterKey("TYPE ")){var a=this.filter.substring(this.filter.indexOf("TYPE ")+5).$replace(","," ").$replace(";"," "),
a=J.util.Parser.getTokens(a);this.atomTypePt0=Integer.parseInt(a[0])-1;var b=a[1].indexOf("=");0<=b?this.filterAtomTypeStr=a[1].substring(b+1).toUpperCase():b=a[1].length;this.atomTypeLen=Integer.parseInt(a[1].substring(0,b))}this.checkFilterKey("CONF ")&&(this.configurationPtr=this.parseIntAt(this.filter,this.filter.indexOf("CONF ")+5),this.sbIgnored=new J.util.SB,this.sbSelected=new J.util.SB);this.isLegacyModelType=12E4>this.stateScriptVersionInt;this.isConnectStateBug=120151<=this.stateScriptVersionInt&&
120220>=this.stateScriptVersionInt||120300<=this.stateScriptVersionInt&&120320>=this.stateScriptVersionInt});Clazz.overrideMethod(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.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});$_M(c$,"finalizeReader",function(){this.checkNotPDB();
this.atomSetCollection.connectAll(this.maxSerial,this.isConnectStateBug);0<this.atomSetCollection.getStructureCount()&&this.atomSetCollection.bsStructuredModels.setBits(0,this.atomSetCollection.getAtomSetCount());null!=this.vBiomolecules&&(0<this.vBiomolecules.size()&&0<this.atomSetCollection.getAtomCount())&&(this.atomSetCollection.setAtomSetAuxiliaryInfo("biomolecules",this.vBiomolecules),this.setBiomoleculeAtomCounts(),null!=this.vBiomts&&this.applySymmetry&&(this.atomSetCollection.applySymmetryBio(this.vBiomts,
this.notionalUnitCell,this.applySymmetryToBonds,this.filter),this.vTlsModels=null));if(null!=this.vTlsModels){var a=J.api.Interface.getOptionInterface("symmetry.Symmetry"),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()));Clazz.superCall(this,J.adapter.readers.cifpdb.PdbReader,"finalizeReader",[]);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()))});$_M(c$,"checkForResidualBFactors",($fz=function(a){for(var b=this.atomSetCollection.getAtoms(),c=!1,d=this.atomSetCollection.getAtomCount();0<=--d;){var e=this.tlsU.get(b[d]);if(null!=e){var f=e[7]-(e[0]+e[1]+e[2])/3;if(0>f||Float.isNaN(f)){c=!0;break}}}J.util.Logger.info("TLS analysis suggests Bfactors are "+(c?"":"NOT")+" residuals");for(var g,b=this.tlsU.entrySet().iterator();b.hasNext()&&
((g=b.next())||1);)e=g.getValue(),f=e[7],0!=f&&(c||(f-=(e[0]+e[1]+e[2])/3),e[0]+=f,e[1]+=f,e[2]+=f,g.getKey().ellipsoid[1]=a.getEllipsoid(e),System.out.println("TLS-U:  "+J.util.Escape.eAF(e)),e=g.getKey().anisoBorU,null!=e&&System.out.println("ANISOU: "+J.util.Escape.eAF(e)));this.tlsU=null},$fz.isPrivate=!0,$fz),"J.api.SymmetryInterface");$_M(c$,"header",($fz=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())}},$fz.isPrivate=!0,$fz));$_M(c$,"title",($fz=function(){10>this.lineLength||this.appendLoadNote(this.line.substring(10).trim())},$fz.isPrivate=!0,$fz));$_M(c$,"compnd",($fz=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 J.util.JmolList;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","(:"+J.util.TextFormat.simpleReplace(J.util.TextFormat.simpleReplace(c,", ",",:")," ","")+")"))},$fz.isPrivate=!0,$fz),"~B");$_M(c$,"setBiomoleculeAtomCounts",
($fz=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(),e=0,f=c.length-1;0<=--f;)":"==c.charAt(f)&&(e+=this.chainAtomCounts[c.charCodeAt(f+1)]);b.put("atomCount",Integer.$valueOf(e*d))}},$fz.isPrivate=!0,$fz));$_M(c$,"remark350",($fz=function(){var a=null;this.vBiomolecules=new J.util.JmolList;this.chainAtomCounts=Clazz.newIntArray(255,0);var b="",c="",d=0,e=!0,f=null,g=0,h=new J.util.Matrix4f;for(h.setIdentity();;){e?
this.readLine():e=!0;if(null==this.line||!this.line.startsWith("REMARK 350"))break;try{if(this.line.startsWith("REMARK 350 BIOMOLECULE:")&&(0<g&&J.util.Logger.info("biomolecule "+d+": number of transforms: "+g),f=new java.util.Hashtable,a=new J.util.JmolList,d=this.parseIntStr(this.line.substring(this.line.indexOf(":")+1)),b=this.line.trim(),f.put("molecule",Integer.$valueOf(d)),f.put("title",b),f.put("chains",""),f.put("biomts",a),this.vBiomolecules.addLast(f),g=0),0<=this.line.indexOf("APPLY THE FOLLOWING TO CHAINS:"))if(null==
f)e=!1,this.line="REMARK 350 BIOMOLECULE: 1  APPLY THE FOLLOWING TO CHAINS:";else{c=":"+this.line.substring(41).trim().$replace(" ",":");for(e=!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.vBiomts=a);f.put("chains",c)}else if(this.line.startsWith("REMARK 350   BIOMT1 ")){g++;
for(var j=Clazz.newFloatArray(16,0),k=0;12>k;){var l=this.getTokens();j[k++]=this.parseFloatStr(l[4]);j[k++]=this.parseFloatStr(l[5]);j[k++]=this.parseFloatStr(l[6]);j[k++]=this.parseFloatStr(l[7]);(4==k||8==k)&&this.readLine()}j[15]=1;var m=new J.util.Matrix4f;m.setA(j);m.equals(h)?a.add(0,m):a.addLast(m)}}catch(n){if(Clazz.exceptionOf(n,Exception)){this.vBiomolecules=this.vBiomts=null;return}throw n;}}0<g&&J.util.Logger.info("biomolecule "+d+": number of transforms: "+g)},$fz.isPrivate=!0,$fz));
$_M(c$,"remark290",($fz=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])}},$fz.isPrivate=!0,$fz));$_M(c$,"getSerial",($fz=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(e){if(Clazz.exceptionOf(e,Exception))return this.serMode=Character.isDigit(c)?1:2,this.getSerial(a,b);throw e;}case 2:return d||Character.isDigit(c)?this.parseIntRange(this.line,a,b):J.util.Parser.parseIntRadix(this.line.substring(a,b),36)+(Character.isUpperCase(c)?-16696160:26973856);case 1:if(!d)return this.serial=J.util.Parser.parseIntRadix(this.line.substring(a,b),16);this.serMode=0;return this.getSerial(a,b)}},$fz.isPrivate=!0,$fz),"~N,~N");$_M(c$,"getSeqNo",($fz=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(e){if(Clazz.exceptionOf(e,Exception))return this.seqMode=Character.isDigit(c)?1:2,this.getSeqNo(a,b);throw e;}case 2:return d||Character.isDigit(c)?this.parseIntRange(this.line,a,b):J.util.Parser.parseIntRadix(this.line.substring(a,b),36)+(Character.isUpperCase(c)?-456560:756496);case 1:if(!d)return J.util.Parser.parseIntRadix(this.line.substring(a,
b),16);this.seqMode=0;return this.getSeqNo(a,b)}},$fz.isPrivate=!0,$fz),"~N,~N");$_M(c$,"processAtom",function(a,b,c,d,e,f,g,h,j){a.atomName=b;b=c;" "!=b&&(a.alternateLocationID=b);a.group3=d;b=e;null!=this.chainAtomCounts&&this.chainAtomCounts[b.charCodeAt(0)]++;a.chainID=b;a.sequenceNumber=f;a.insertionCode=J.api.JmolAdapter.canonizeInsertionCode(g);a.isHetero=h;a.elementSymbol=j;return a},"J.adapter.smarter.Atom,~S,~S,~S,~S,~N,~S,~B,~S");$_M(c$,"processAtom2",function(a,b,c,d,e,f){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,e);a.formalCharge=f;this.setAdditionalAtomParameters(a);
this.haveMappedSerials?this.atomSetCollection.addAtomWithMappedSerialNumber(a):this.atomSetCollection.addAtom(a);0==this.atomCount++&&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");$_M(c$,"atom",($fz=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.charAt(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,e;if(this.gromacsWideFormat)c=this.parseFloatRange(this.line,30,40),d=this.parseFloatRange(this.line,40,50),e=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&&(e=d,d=c,c=e),("+"==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);e=this.parseFloatRange(this.line,46,54)}this.processAtom2(a,this.serial,c,d,e,b)}},$fz.isPrivate=!0,$fz));$_M(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.alternateLocationID){var c=" atom ["+a.group3+"]"+a.sequenceNumber+("\x00"==a.insertionCode?"":"^"+a.insertionCode)+("\x00"==a.chainID?"":":"+a.chainID)+"."+a.atomName+"%"+a.alternateLocationID+"\n";0<=this.conformationIndex&&a.alternateLocationID!=this.lastAltLoc&&(this.lastAltLoc=a.alternateLocationID,this.conformationIndex--);
if(0>this.conformationIndex&&a.alternateLocationID!=this.lastAltLoc)return this.sbIgnored.append("ignoring").append(c),!1;this.sbSelected.append("loading").append(c)}}return!0},"J.adapter.smarter.Atom,~N");$_M(c$,"setAdditionalAtomParameters",function(a){if(this.isPQR)if(this.gromacsWideFormat)a.partialCharge=this.parseFloatRange(this.line,60,68),a.radius=J.adapter.readers.cifpdb.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.cifpdb.PdbReader.fixRadius(this.parseFloatStr(b[c]))}else this.gromacsWideFormat?(b=this.parseFloatRange(this.line,60,68),a.bfactor=J.adapter.readers.cifpdb.PdbReader.fixRadius(this.parseFloatRange(this.line,68,76))):(b=this.parseFloatRange(this.line,54,60),a.bfactor=this.parseFloatRange(this.line,60,66)),a.occupancy=Float.isNaN(b)?100:Clazz.floatToInt(100*b)},"J.adapter.smarter.Atom");$_M(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");$_M(c$,
"conect",($fz=function(){null==this.sbConect?(this.sbConect=new J.util.SB,this.sb=new J.util.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 e=a==this.lastSourceSerial&&c==this.lastTargetSerial;e&&(this.haveDoubleBonds=!0);this.lastSourceSerial=a;this.lastTargetSerial=c;c<a?(d=c,c=a):d=a;var f=";"+d+" "+c+";";if(!(0<=this.sbConect.indexOf(f))||e){if(this.haveDoubleBonds){e=
"--"+f;if(0<=this.sbConect.indexOf(e))continue;this.sbConect.append(f);this.sb.append(e)}else this.sbConect.append(f);this.atomSetCollection.addConnection([d,c,4>b?1:2048])}}}this.sbConect.appendSB(this.sb)}},$fz.isPrivate=!0,$fz));$_M(c$,"structure",($fz=function(){var a=J.constant.EnumStructure.NONE,b=J.constant.EnumStructure.NONE,c,d,e,f,g=0;if(this.line.startsWith("HELIX "))a=J.constant.EnumStructure.HELIX,c=19,d=21,e=31,f=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,e=32,f=33,g=this.parseIntRange(this.line,14,16);else if(this.line.startsWith("TURN  "))a=J.constant.EnumStructure.TURN,c=19,d=20,e=30,f=31;else return;if(!(this.lineLength<f+4)){var h=this.line.substring(11,15).trim(),j=this.parseIntRange(this.line,7,10);c=this.line.charAt(c);var k=this.parseIntRange(this.line,d,d+4);d=this.line.charAt(d+4);e=this.line.charAt(e);var l=this.parseIntRange(this.line,f,f+4),m=" ";
this.lineLength>f+4&&(m=this.line.charAt(f+4));b===J.constant.EnumStructure.NONE&&(b=a);a=new J.adapter.smarter.Structure(-1,a,b,h,j,g);a.set(c,k,d,e,l,m,-1,-1);this.atomSetCollection.addStructure(a)}},$fz.isPrivate=!0,$fz));$_M(c$,"getModelNumber",($fz=function(){var a=14;a>this.lineLength&&(a=this.lineLength);a=this.parseIntRange(this.line,6,a);return-2147483648==a?0:a},$fz.isPrivate=!0,$fz));$_M(c$,"model",function(a){this.checkNotPDB();this.haveMappedSerials=!1;this.sbConect=null;this.atomSetCollection.newAtomSet();
this.atomSetCollection.setAtomSetAuxiliaryInfo("isPDB",Boolean.TRUE);this.atomSetCollection.setCurrentAtomSetNumber(a)},"~N");$_M(c$,"checkNotPDB",($fz=function(){var a=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},$fz.isPrivate=!0,$fz));$_M(c$,"cryst1",($fz=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));this.setSpaceGroupName(J.adapter.smarter.AtomSetCollectionReader.parseTrimmedRange(this.line,55,66))},$fz.isPrivate=!0,$fz));$_M(c$,"getFloat",($fz=function(a,b){return this.parseFloatRange(this.line,a,a+b)},$fz.isPrivate=!0,$fz),"~N,~N");$_M(c$,"scale",($fz=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))},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"expdta",($fz=function(){0<=this.line.toUpperCase().indexOf("NMR")&&this.atomSetCollection.setAtomSetCollectionAuxiliaryInfo("isNMRdata","true")},$fz.isPrivate=!0,$fz));$_M(c$,"formul",($fz=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))},$fz.isPrivate=!0,$fz));$_M(c$,"het",($fz=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)}}},$fz.isPrivate=!0,$fz));$_M(c$,"hetnam",($fz=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)}},$fz.isPrivate=!0,$fz));$_M(c$,"anisou",($fz=function(){var a=Clazz.newFloatArray(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)}},$fz.isPrivate=!0,$fz));$_M(c$,"site",($fz=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,e=J.adapter.smarter.AtomSetCollectionReader.parseTrimmedRange(this.line,d,d+3);if(0==e.length)break;var f=J.adapter.smarter.AtomSetCollectionReader.parseTrimmedRange(this.line,d+4,d+5),g=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?"":",")+"["+e+"]"+g);0<d.length&&(a+="^"+d);0<f.length&&(a+=
":"+f);c.put("groups",a)}},$fz.isPrivate=!0,$fz));$_M(c$,"remarkTls",($fz=function(){for(var a=0,b=0,c=null,d=null,e=null,f=null,g=null,h=this.line.substring(0,11);null!=this.readLine()&&this.line.startsWith(h);)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"))e=new java.util.Hashtable,f=new J.util.JmolList,e.put("ranges",f),d.addLast(e),this.tlsGroupID=this.parseIntStr(j[j.length-
1]),e.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 J.util.JmolList);d=new J.util.JmolList;this.appendLoadNote(this.line.substring(11).trim())}}else if(j[0].equalsIgnoreCase("COMPONENTS"))c=this.line;else if(j[0].equalsIgnoreCase("RESIDUE")){var g=new java.util.Hashtable,k,l,m,n;if(6==j.length)k=j[2].charAt(0),l=j[4].charAt(0),m=
this.parseIntStr(j[3]),n=this.parseIntStr(j[5]);else{var r=c.indexOf(" C "),w=c.indexOf(" C ",r+4);k=this.line.charAt(w);l=this.line.charAt(r);m=this.parseIntRange(this.line,w+1,r);n=this.parseIntStr(this.line.substring(r+1))}k==l?(g.put("chains",""+k+l),m<=n?(g.put("residues",[m,n]),f.addLast(g)):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 t="\x00",
p=1;p<j.length;p++)if(0<=j[p].toUpperCase().indexOf("CHAIN"))t=j[++p].charAt(0);else{var u=this.parseIntStr(j[p]);-2147483648!=u&&(g=new java.util.Hashtable,g.put("residues",[u,this.parseIntStr(j[++p])]),"\x00"!=t&&g.put("chains",""+t+t),f.addLast(g))}else if(j[0].equalsIgnoreCase("ORIGIN")){var s=new J.util.P3;e.put("origin",s);if(8==j.length)s.set(this.parseFloatStr(j[5]),this.parseFloatStr(j[6]),this.parseFloatStr(j[7]));else{var q=this.line.length;s.set(this.parseFloatRange(this.line,q-27,q-18),
this.parseFloatRange(this.line,q-18,q-9),this.parseFloatRange(this.line,q-9,q))}if(Float.isNaN(s.x)||Float.isNaN(s.y)||Float.isNaN(s.z))s.set(NaN,NaN,NaN),this.tlsAddError("invalid origin: "+this.line)}else if(j[1].equalsIgnoreCase("TENSOR")){var z=j[0].charAt(0),A=(this.readLine().substring(10)+this.readLine().substring(10)+this.readLine().substring(10)).$replace(z," ").$replace(":"," "),j=J.adapter.smarter.AtomSetCollectionReader.getTokensStr(A),v=Clazz.newFloatArray(3,3,0);e.put("t"+z,v);for(p=
0;p<j.length;p++){var D=j[p].charCodeAt(0)-49,H=j[p].charCodeAt(1)-49;v[D][H]=this.parseFloatStr(j[++p]);D<H&&(v[H][D]=v[D][H])}for(p=0;3>p;p++)for(t=0;3>t;t++)Float.isNaN(v[p][t])&&this.tlsAddError("invalid tensor: "+J.util.Escape.escapeFloatAA(v,!1));if("S"==z&&++b==a){J.util.Logger.info(a+" TLS groups read");this.readLine();break}}}catch(C){if(Clazz.exceptionOf(C,Exception)){J.util.Logger.error(this.line+"\nError in TLS parser: ");System.out.println(C.getMessage());d=null;break}else throw C;}null!=
d&&(b=new java.util.Hashtable,b.put("groupCount",Integer.$valueOf(a)),b.put("groups",d),this.vTlsModels.addLast(b));return 1>a},$fz.isPrivate=!0,$fz));$_M(c$,"handleTlsMissingModels",($fz=function(){this.vTlsModels=null},$fz.isPrivate=!0,$fz));$_M(c$,"setTlsGroups",($fz=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"),e=this.atomSetCollection.getAtomSetAtomIndex(b),f=Clazz.newIntArray(this.atomSetCollection.getAtomSetAtomCount(b),
0),g=e+f.length,h=this.atomSetCollection.getAtoms(),j=d.size(),k=0;k<j;k++){var l=d.get(k),m=l.get("ranges");this.tlsGroupID=l.get("id").intValue();for(var n=m.size();0<=--n;){var r=m.get(n).get("chains"),w=m.get(n).get("residues"),t=r.charAt(0),r=r.charAt(1),p=w[0],w=w[1],u=this.findAtomForRange(e,g,t,p,!1),s=0<=u?this.findAtomForRange(u,g,r,w,!1):-1;if(0>s){J.util.Logger.info("TLS processing terminated");return}J.util.Logger.info("TLS ID="+this.tlsGroupID+" model atom index range "+u+"-"+s);u=t==
r;for(s=e;s<g;s++){var q=h[s];if(u?q.sequenceNumber>=p&&q.sequenceNumber<=w:q.chainID>t&&q.chainID<r||q.chainID==t&&q.sequenceNumber>=p||q.chainID==r&&q.sequenceNumber<=w)f[s-e]=this.tlsGroupID,this.setTlsEllipsoid(q,l,c)}}}c=new J.util.SB;for(k=0;k<f.length;k++)c.appendI(f[k]).appendC("\n");this.atomSetCollection.setAtomSetAtomProperty("tlsGroup",c.toString(),b);this.atomSetCollection.setAtomSetAuxiliaryInfoForSet("TLS",a,b);this.atomSetCollection.setEllipsoids()},$fz.isPrivate=!0,$fz),"~N,~N,J.api.SymmetryInterface");
$_M(c$,"findAtomForRange",($fz=function(a,b,c,d,e){a=this.findAtom(a,b,c,d,!0);return e&&0<=a?this.findAtom(a,b,c,d,!1):a},$fz.isPrivate=!0,$fz),"~N,~N,~S,~N,~B");$_M(c$,"findAtom",($fz=function(a,b,c,d,e){for(var f=this.atomSetCollection.getAtoms();a<b;a++){var g=f[a];if((g.chainID==c&&g.sequenceNumber==d)==e)return a}e&&(J.util.Logger.warn("PdbReader findAtom chain="+c+" resno="+d+" not found"),this.tlsAddError("atom not found: chain="+c+" resno="+d));return e?-1:b},$fz.isPrivate=!0,$fz),"~N,~N,~S,~N,~B");
$_M(c$,"setTlsEllipsoid",($fz=function(a,b,c){var d=b.get("origin");if(!Float.isNaN(d.x)){var e=b.get("tT"),f=b.get("tL");b=b.get("tS");if(!(null==e||null==f||null==b)){var g=0.017453292*(a.x-d.x),h=0.017453292*(a.y-d.y),d=0.017453292*(a.z-d.z),j=g*g,k=h*h,l=d*d,m=g*h,n=g*d,r=h*d;this.dataT[0]=e[0][0];this.dataT[1]=e[1][1];this.dataT[2]=e[2][2];this.dataT[3]=e[0][1];this.dataT[4]=e[0][2];this.dataT[5]=e[1][2];this.dataT[6]=12;var e=Clazz.newFloatArray(8,0),w=Float.isNaN(a.bfactor)?0:a.bfactor/78.95683;
e[0]=this.dataT[0]+f[1][1]*l+f[2][2]*k-2*f[1][2]*r+2*b[1][0]*d-2*b[2][0]*h;e[1]=this.dataT[1]+f[0][0]*l+f[2][2]*j-2*f[2][0]*n-2*b[0][1]*d+2*b[2][1]*g;e[2]=this.dataT[2]+f[0][0]*k+f[1][1]*j-2*f[0][1]*m-2*b[1][2]*g+2*b[0][2]*h;e[3]=this.dataT[3]-f[2][2]*m+f[1][2]*n+f[2][0]*r-f[0][1]*l-b[0][0]*d+b[1][1]*d+b[2][0]*g-b[2][1]*h;e[4]=this.dataT[4]-f[1][1]*n+f[1][2]*m-f[2][0]*k+f[0][1]*r+b[0][0]*h-b[2][2]*h+b[1][2]*d-b[1][0]*g;e[5]=this.dataT[5]-f[0][0]*r-f[1][2]*j+f[2][0]*m+f[0][1]*n-b[1][1]*g+b[2][2]*g+
b[0][1]*h-b[0][2]*d;e[6]=12;e[7]=w;Float.isNaN(w)&&System.out.println("hmm");null==this.tlsU&&(this.tlsU=new java.util.Hashtable);this.tlsU.put(a,e);a.ellipsoid=[null,null,c.getEllipsoid(this.dataT)]}}},$fz.isPrivate=!0,$fz),"J.adapter.smarter.Atom,java.util.Map,J.api.SymmetryInterface");$_M(c$,"tlsAddError",($fz=function(a){null==this.sbTlsErrors&&(this.sbTlsErrors=new J.util.SB);this.sbTlsErrors.append(this.fileName).appendC("\t").append("TLS group ").appendI(this.tlsGroupID).appendC("\t").append(a).appendC("\n")},
$fz.isPrivate=!0,$fz),"~S");c$.fixRadius=$_M(c$,"fixRadius",function(a){return 0.9>a?1:a},"~N");Clazz.defineStatics(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)});Clazz.declarePackage("J.adapter.smarter");
Clazz.load(["J.adapter.smarter.AtomSetObject"],"J.adapter.smarter.Structure",["J.constant.EnumStructure"],function(){c$=Clazz.decorateAsClass(function(){this.structureID=this.substructureType=this.structureType=null;this.strandCount=this.serialID=0;this.endInsertionCode=this.endChainID=this.startInsertionCode=this.startChainID="\x00";this.endSequenceNumber=this.startSequenceNumber=0;this.iend=this.istart=-2147483648;Clazz.instantialize(this,arguments)},J.adapter.smarter,"Structure",J.adapter.smarter.AtomSetObject);
c$.getHelixType=$_M(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");Clazz.makeConstructor(c$,function(a,b,c,d,e,f){Clazz.superConstructor(this,J.adapter.smarter.Structure,[]);this.structureType=b;this.substructureType=c;null!=d&&(this.atomSetIndex=a,this.structureID=d,this.strandCount=f,this.serialID=e)},"~N,J.constant.EnumStructure,J.constant.EnumStructure,~S,~N,~N");
$_M(c$,"set",function(a,b,c,d,e,f,g,h){this.startChainID=a;this.startSequenceNumber=b;this.startInsertionCode=c;this.endChainID=d;this.endSequenceNumber=e;this.endInsertionCode=f;this.istart=g;this.iend=h},"~S,~N,~S,~S,~N,~S,~N,~N")});Clazz.declarePackage("J.api");Clazz.declareInterface(J.api,"JmolBioResolver");Clazz.declarePackage("J.modelsetbio");
Clazz.load(["J.api.JmolBioResolver"],"J.modelsetbio.Resolver","java.lang.Boolean $.NullPointerException java.util.Arrays $.Hashtable J.modelset.Group J.modelsetbio.AlphaMonomer $.AlphaPolymer $.AminoMonomer $.AminoPolymer $.BioModel $.CarbohydrateMonomer $.CarbohydratePolymer $.NucleicMonomer $.NucleicPolymer $.PhosphorusMonomer $.PhosphorusPolymer J.util.BS $.Logger $.Measure $.P4 $.Parser $.SB $.TextFormat $.V3 J.viewer.JC".split(" "),function(){c$=Clazz.decorateAsClass(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;Clazz.isClassDefined("J.modelsetbio.Resolver.BondSorter")||J.modelsetbio.Resolver.$Resolver$BondSorter$();Clazz.instantialize(this,arguments)},J.modelsetbio,"Resolver",null,J.api.JmolBioResolver);Clazz.makeConstructor(c$,function(){});Clazz.overrideMethod(c$,"getBioModel",function(a,
b,c,d,e,f){return new J.modelsetbio.BioModel(a,b,c,d,e,f)},"J.modelset.ModelSet,~N,~N,~S,java.util.Properties,java.util.Map");Clazz.overrideMethod(c$,"distinguishAndPropagateGroup",function(a,b,c,d,e,f,g,h){f=e-1;for(var j=0,k=J.viewer.JC.ATOMID_MAX;0<=--k;)g[k]=-2147483648;for(k=e;--k>=d;)e=h[k].getAtomID(),0>=e||(14>e&&(j|=1<<e),g[e]=k);if(f<d)throw new NullPointerException;e=null;14==(j&14)?e=J.modelsetbio.AminoMonomer.validateAndAllocate(a,b,c,d,f,g,h):4==j?e=J.modelsetbio.AlphaMonomer.validateAndAllocateA(a,
b,c,d,f,g):8128==(j&8128)?e=J.modelsetbio.NucleicMonomer.validateAndAllocate(a,b,c,d,f,g):8192==j?e=J.modelsetbio.PhosphorusMonomer.validateAndAllocateP(a,b,c,d,f,g):J.viewer.JC.checkCarbohydrate(b)&&(e=J.modelsetbio.CarbohydrateMonomer.validateAndAllocate(a,b,c,d,f));return null!=e&&0<=e.leadAtomIndex?e:null},"J.modelset.Chain,~S,~N,~N,~N,~N,~A,~A");Clazz.overrideMethod(c$,"setHaveHsAlready",function(a){this.haveHsAlready=a},"~B");Clazz.overrideMethod(c$,"initialize",function(a){this.modelSet=a},
"J.modelset.ModelSet");Clazz.overrideMethod(c$,"initializeHydrogenAddition",function(a,b){this.modelLoader=a;this.baseBondIndex=b;this.bsAddedHydrogens=new J.util.BS;this.bsAtomsForHs=new J.util.BS;this.htBondMap=new java.util.Hashtable;this.htGroupBonds=new java.util.Hashtable;this.hNames=Array(3);this.vAB=new J.util.V3;this.vAC=new J.util.V3;this.vNorm=new J.util.V3;this.plane=new J.util.P4},"J.modelset.ModelLoader,~N");Clazz.overrideMethod(c$,"addImplicitHydrogenAtoms",function(a,b){var c=this.modelLoader.getGroup3(b),
d;if(!this.haveHsAlready&&!(null==c||0==(d=J.viewer.JC.getStandardPdbHydrogenCount(J.modelset.Group.lookupGroupID(c))))){var e=null,f=this.modelLoader.getFirstAtomIndex(b),g=this.modelSet.getAtomCount();if(0>d){if(1==g-f)return;e=this.modelSet.viewer.getLigandModel(c);if(null==e)return;d=a.getHydrogenAtomCount(e);if(1>d)return}this.getBondInfo(a,c,e);this.modelSet.models[this.modelSet.atoms[f].modelIndex].isPdbWithMultipleBonds=!0;this.bsAtomsForHs.setBits(f,g);this.bsAddedHydrogens.setBits(g,g+d);
c=this.modelSet.atoms[f].isHetero();for(e=0;e<d;e++)this.modelSet.addAtom(this.modelSet.atoms[f].modelIndex,this.modelSet.atoms[f].getGroup(),1,"H",0,0,NaN,NaN,NaN,NaN,NaN,NaN,NaN,0,0,1,0,null,c,0,null).$delete(null)}},"J.api.JmolAdapter,~N");$_M(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");$_M(c$,"getLigandBondInfo",($fz=function(a,b,c){var d=a.getBondList(b),e=new java.util.Hashtable;for(a=a.getAtomIterator(b);a.hasNext();)e.put(a.getAtomName(),a.getXYZ());a=Array(2*d.length);for(var f=b=0;f<d.length;f++){var g=d[f];"H"!=g[0].charAt(0)&&(a[b++]=[g[0],g[1],g[2],g[1].startsWith("H")?"0":"1"]);"H"!=g[1].charAt(0)&&(a[b++]=[g[1],g[0],g[2],g[0].startsWith("H")?"0":
"1"])}java.util.Arrays.sort(a,Clazz.innerTypeInstance(J.modelsetbio.Resolver.BondSorter,this,null));for(var h,f=0;f<b;){h=a[f];for(var d=h[0],j=g=0;f<b&&(h=a[f])[0].equals(d);f++)h[3].equals("0")?g++:h[3].equals("1")&&j++;d=f-g-j;if(1!=g)switch(j){case 1:for(var j=2==g?"@":"|",k=1;k<g;k++)a[d][1]+=j+a[d+k][1],a[d+k]=null;continue;case 2:if(2!=g)continue;var j=a[d][0],k=a[d+g][1],g=a[d+g+1][1],l=k.compareTo(g);J.util.Measure.getPlaneThroughPoints(e.get(k),e.get(j),e.get(g),this.vNorm,this.vAB,this.vAC,
this.plane);g=J.util.Measure.distanceToPlane(this.plane,e.get(a[d][1]))*l;a[d][1]=0<g?a[d][1]+"@"+a[d+1][1]:a[d+1][1]+"@"+a[d][1];a[d+1]=null}}for(f=0;f<b;f++)null!=(h=a[f])&&"H"!=h[1].charAt(0)&&0<h[0].compareTo(h[1])?a[f]=null:null!=h&&J.util.Logger.info(" ligand "+c+": "+a[f][0]+" - "+a[f][1]+" order "+a[f][2]);return a},$fz.isPrivate=!0,$fz),"J.api.JmolAdapter,~O,~S");Clazz.overrideMethod(c$,"finalizeHydrogens",function(){this.modelSet.viewer.getLigandModel(null);this.finalizePdbMultipleBonds();
if(0<=this.bsAddedHydrogens.nextSetBit(0)){this.finalizePdbCharges();for(var a=Clazz.newIntArray(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 e=this.modelSet.atoms[d],f=e.getGroup();if(f!==b){b=f;for(c=f.lastAtomIndex;this.bsAddedHydrogens.get(c);)c--}var g=e.getGroup3(!1),h=e.getAtomName(),j=this.htBondMap.get(g+"."+h);if(null!=j){var k=j.contains("@"),l=j.endsWith("?")||0<=j.indexOf("|"),m=a[d].length;3==m&&(!l&&j.equals("H@H2"))&&
(j="H|H2|H3",l=!0,k=!1);if(k&&3==m||l!=(3==m))J.util.Logger.info("Error adding H atoms to "+g+f.getResno()+": "+a[d].length+" atoms should not be added to "+h);else switch(h=j.indexOf("@"),a[d].length){case 1:0<h&&(j=j.substring(0,h));this.setHydrogen(d,++c,j,a[d][0]);break;case 2:k=-1;l=e.getBonds();if(null!=l)switch(l.length){case 2:k=l[0].getOtherAtom(e),l=l[1].getOtherAtom(e),m=k.getAtomName().compareTo(l.getAtomName()),J.util.Measure.getPlaneThroughPoints(k,e,l,this.vNorm,this.vAB,this.vAC,this.plane),
k=J.util.Measure.distanceToPlane(this.plane,a[d][0])*m}0>h?(J.util.Logger.info("Error adding H atoms to "+g+f.getResno()+": expected to only need 1 H but needed 2"),e=f="H"):0>k?(f=j.substring(0,h),e=j.substring(h+1)):(e=j.substring(0,h),f=j.substring(h+1));this.setHydrogen(d,++c,e,a[d][0]);this.setHydrogen(d,++c,f,a[d][1]);break;case 3:e=j.indexOf("|"),0<=e?(f=j.lastIndexOf("|"),this.hNames[0]=j.substring(0,e),this.hNames[1]=j.substring(e+1,f),this.hNames[2]=j.substring(f+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()}});$_M(c$,"deleteUnneededAtoms",($fz=function(){for(var a=new J.util.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(),e=d[0].getOtherAtom(c),c=d[1].getOtherAtom(c);1==e.getElementNumber()&&(d=e,e=c,c=d);if(1==c.getElementNumber())for(var d=e.getBonds(),f=0;f<d.length;f++)if(2==d[f].order&&8==d[f].getOtherAtom(e).getElementNumber()){this.bsAddedHydrogens.set(c.index);c.$delete(a);break}}}this.modelSet.deleteBonds(a,!0);this.modelLoader.deleteAtoms(this.bsAddedHydrogens)},$fz.isPrivate=!0,$fz));$_M(c$,"finalizePdbCharges",($fz=function(){for(var a=this.modelSet.atoms,b=this.bsAtomsForHs.nextSetBit(0);0<=
b&&!(a[b].getGroup().getNitrogenAtom()===a[b]&&1==a[b].getCovalentBondCount()&&a[b].setFormalCharge(1),0>(b=this.bsAtomsForHs.nextClearBit(b+1)));b=this.bsAtomsForHs.nextSetBit(b+1));},$fz.isPrivate=!0,$fz));$_M(c$,"finalizePdbMultipleBonds",($fz=function(){for(var a=new java.util.Hashtable,b=this.modelSet.bondCount,c=this.modelSet.bonds,d=this.baseBondIndex;d<b;d++){var e=c[d].getAtom1(),f=c[d].getAtom2(),g=e.getGroup();if(g===f.getGroup()){var h=(new J.util.SB).append(g.getGroup3());h.append(":");
e=e.getAtomName();f=f.getAtomName();0<e.compareTo(f)?h.append(f).append(":").append(e):h.append(e).append(":").append(f);f=h.toString();e=this.htBondMap.get(f);null!=e&&(a.put(f,Boolean.TRUE),c[d].setOrder(J.util.Parser.parseInt(e)))}}for(d=this.htBondMap.keySet().iterator();d.hasNext()&&((h=d.next())||1);)if(null==a.get(h))if(0>h.indexOf(":"))a.put(h,Boolean.TRUE);else{var j=this.htBondMap.get(h);J.util.Logger.info("bond "+h+" was not used; order="+j);this.htBondMap.get(h).equals("1")&&a.put(h,Boolean.TRUE)}g=
new java.util.Hashtable;for(d=this.htBondMap.keySet().iterator();d.hasNext()&&((h=d.next())||1);)null==a.get(h)&&g.put(h.substring(0,h.lastIndexOf(":")),this.htBondMap.get(h));if(!g.isEmpty())for(d=0;d<b;d++)if(e=c[d].getAtom1(),f=c[d].getAtom2(),e.getGroup()!==f.getGroup()&&!(null==(j=g.get(e.getGroup3(!1)+":"+e.getAtomName()))&&null==(j=g.get(f.getGroup3(!1)+":"+f.getAtomName()))))c[d].setOrder(J.util.Parser.parseInt(j)),J.util.Logger.info("assigning order "+c[d].order+" to bond "+c[d])},$fz.isPrivate=
!0,$fz));$_M(c$,"setHydrogen",($fz=function(a,b,c,d){if(this.bsAddedHydrogens.get(b)){var e=this.modelSet.atoms;if(-2147483648==this.lastSetH||e[b].modelIndex!=e[this.lastSetH].modelIndex)this.maxSerial=this.modelSet.getModelAuxiliaryInfoValue(e[this.lastSetH=b].modelIndex,"PDB_CONECT_firstAtom_count_max")[2];this.bsAddedHydrogens.clear(b);this.modelSet.setAtomName(b,c);e[b].setT(d);this.modelSet.setAtomNumber(b,++this.maxSerial);e[b].setAtomSymmetry(e[a].getAtomSymmetry());this.modelLoader.undeleteAtom(b);
this.modelSet.bondAtoms(e[a],e[b],1,this.modelSet.getDefaultMadFromOrder(1),null,0,!0,!1)}},$fz.isPrivate=!0,$fz),"~N,~N,~S,J.util.P3");Clazz.overrideMethod(c$,"fixPropertyValue",function(a,b){for(var c=J.util.TextFormat.split(b,"\n"),d=this.modelSet.atoms,e=Array(a.cardinality()),f="",g=0,h=0,j=a.nextSetBit(0);0<=j;j=a.nextSetBit(j),h++)1!=d[j].getElementNumber()&&(f=c[g++]),e[h]=f;return J.util.TextFormat.join(e,"\n",0)},"J.util.BS,~S");c$.allocateBioPolymer=$_M(c$,"allocateBioPolymer",function(a,
b,c){for(var d=null,e=0,f=b;f<a.length;++f){var g=a[f],h;if(!Clazz.instanceOf(g,J.modelsetbio.Monomer)||null!=(h=g).bioPolymer||null!=d&&d.getClass()!==h.getClass()||c&&!h.isConnectedAfter(d))break;d=h;e++}if(0==e)return null;c=Array(e);for(f=0;f<e;++f)c[f]=a[b+f];if(Clazz.instanceOf(d,J.modelsetbio.AminoMonomer))return new J.modelsetbio.AminoPolymer(c);if(Clazz.instanceOf(d,J.modelsetbio.AlphaMonomer))return new J.modelsetbio.AlphaPolymer(c);if(Clazz.instanceOf(d,J.modelsetbio.NucleicMonomer))return new J.modelsetbio.NucleicPolymer(c);
if(Clazz.instanceOf(d,J.modelsetbio.PhosphorusMonomer))return new J.modelsetbio.PhosphorusPolymer(c);if(Clazz.instanceOf(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");c$.$Resolver$BondSorter$=function(){Clazz.pu$h();c$=Clazz.decorateAsClass(function(){Clazz.prepareCallback(this,arguments);Clazz.instantialize(this,arguments)},J.modelsetbio.Resolver,
"BondSorter",null,java.util.Comparator);Clazz.overrideMethod(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$=Clazz.p0p()}});Clazz.declarePackage("J.modelsetbio");
Clazz.load(["J.modelset.Group"],"J.modelsetbio.Monomer","java.lang.Float J.constant.EnumStructure J.util.Logger $.Measure $.P3 $.Quaternion J.viewer.JC".split(" "),function(){c$=Clazz.decorateAsClass(function(){this.offsets=this.bioPolymer=null;this.monomerIndex=0;Clazz.instantialize(this,arguments)},J.modelsetbio,"Monomer",J.modelset.Group);c$.have=$_M(c$,"have",function(a,b){return 255!=(a[b]&255)},"~A,~N");$_M(c$,"set2",function(a,b,c,d,e,f){this.setGroup(a,b,c,d,e);this.offsets=f;a=this.offsets[0]&
255;255!=a&&(this.leadAtomIndex=d+a);return this},"J.modelset.Chain,~S,~N,~N,~N,~A");Clazz.overrideMethod(c$,"getGroups",function(){return this.bioPolymer.getGroups()});$_M(c$,"setBioPolymer",function(a,b){this.bioPolymer=a;this.monomerIndex=b},"J.modelsetbio.BioPolymer,~N");Clazz.overrideMethod(c$,"getSelectedMonomerCount",function(){return this.bioPolymer.getSelectedMonomerCount()});Clazz.overrideMethod(c$,"getSelectedMonomerIndex",function(){return 0<=this.monomerIndex&&this.bioPolymer.isMonomerSelected(this.monomerIndex)?
this.monomerIndex:-1});$_M(c$,"getBioPolymer",function(){return this.bioPolymer});Clazz.overrideMethod(c$,"getBioPolymerLength",function(){return null==this.bioPolymer?0:this.bioPolymer.monomerCount});$_M(c$,"getMonomerIndex",function(){return this.monomerIndex});$_M(c$,"getBioPolymerIndexInModel",function(){return null==this.bioPolymer?-1:this.bioPolymer.bioPolymerIndexInModel});c$.scanForOffsets=$_M(c$,"scanForOffsets",function(a,b,c){for(var d=c.length,e=Clazz.newByteArray(d,0);0<=--d;){var f,
g=c[d];if(0>g)f=b[~g];else if(f=b[g],0>f)return null;var h;if(0>f)h=255;else if(h=f-a,0>h||254<h)J.util.Logger.warn("Monomer.scanForOffsets i="+d+" atomID="+g+" atomIndex:"+f+" firstAtomIndex:"+a+" offset out of 0-254 range. Groups aren't organized correctly. Is this really a protein?: "+h),0>g&&(h=255);e[d]=h}return e},"~N,~A,~A");$_M(c$,"setStructure",function(){},"J.modelsetbio.ProteinStructure");$_M(c$,"getProteinStructure",function(){return null});Clazz.overrideMethod(c$,"getProteinStructureType",
function(){return J.constant.EnumStructure.NONE});$_M(c$,"isHelix",function(){return!1});$_M(c$,"isSheet",function(){return!1});Clazz.overrideMethod(c$,"setStrucNo",function(){},"~N");$_M(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");$_M(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");$_M(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");Clazz.overrideMethod(c$,"isLeadAtom",function(a){return a==this.leadAtomIndex},"~N");Clazz.overrideMethod(c$,"getLeadAtom",function(){return this.getAtomFromOffsetIndex(0)});$_M(c$,"getWingAtom",function(){return this.getAtomFromOffsetIndex(1)});$_M(c$,"getInitiatorAtom",
function(){return this.getLeadAtom()});$_M(c$,"getTerminatorAtom",function(){return this.getLeadAtom()});$_M(c$,"findNearestAtomIndex",function(){},"~N,~N,~A,~N,~N");Clazz.overrideMethod(c$,"calcBioParameters",function(){return this.bioPolymer.calcParameters()});Clazz.overrideMethod(c$,"haveParameters",function(){return this.bioPolymer.haveParameters});$_M(c$,"getMyInfo",function(){var a=this.getGroupInfo(this.groupIndex),b=this.chain.chainID;a.put("chain","\x00"==b?"":""+b);var b=this.getSeqNumber(),
c=this.getInsertionCode();0<b&&a.put("sequenceNumber",Integer.$valueOf(b));0!=c.charCodeAt(0)&&a.put("insertionCode",""+c);b=this.getGroupParameter(1112539143);Float.isNaN(b)||a.put("phi",Float.$valueOf(b));b=this.getGroupParameter(1112539144);Float.isNaN(b)||a.put("psi",Float.$valueOf(b));b=this.getGroupParameter(1112539140);Float.isNaN(b)||a.put("mu",Float.$valueOf(b));b=this.getGroupParameter(1112539150);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});Clazz.overrideMethod(c$,"getStructureId",function(){var a=this.getProteinStructure();return null==a?"":a.type.getBioStructureTypeName(!1)});$_M(c$,"getConformation",function(a,b,c){for(var d="\x00",e=this.firstAtomIndex;e<=this.lastAtomIndex;e++){var f=a[e].getAlternateLocationID();"\x00"!=f&&(0<=c&&f!=d&&(d=f,c--),0>c&&f!=d&&
b.clear(e))}},"~A,J.util.BS,~N");$_M(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,e=a[d],f=e.getAtomID();if(0!=e.getAlternateLocationID().charCodeAt(0))for(var g=this.lastAtomIndex-this.firstAtomIndex,h=1;h<=g;h++){var j=d+h;j>this.lastAtomIndex&&(j-=g+1);var k=j-this.firstAtomIndex;if(!(0>k||255<k||j==d||!b.get(j))){var l=a[j].getAtomID();if(!(l!=f||0==l&&!a[j].getAtomName().equals(e.getAtomName()))){J.util.Logger.debugging&&
J.util.Logger.debug("Chain.udateOffsetsForAlternativeLocation "+a[j]+" was "+e);this.offsets[c]=k;break}}}}}},"~A,J.util.BS");$_M(c$,"getMonomerSequenceAtoms",function(a,b){this.selectAtoms(b);b.and(a)},"J.util.BS,J.util.BS");c$.checkOptional=$_M(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");$_M(c$,"getQuaternionFrameCenter",function(){return null},"~S");$_M(c$,"getHelixData2",function(a,b,c){var d=this.monomerIndex-
c,e=1>c||0>=this.monomerIndex?null:this.bioPolymer.monomers[d],d=this.getQuaternion(b),f=1>c?J.util.Quaternion.getQuaternionFrameV(J.viewer.JC.axisX,J.viewer.JC.axisY,J.viewer.JC.axisZ,!1):null==e?null:e.getQuaternion(b);if(null==f||null==d)return this.getHelixData(a,b,c);var e=1>c?J.util.P3.new3(0,0,0):e.getQuaternionFrameCenter(b),g=this.getQuaternionFrameCenter(b);return null==e||null==g?this.getHelixData(a,b,c):J.util.Measure.computeHelicalAxis(135176==a?"helixaxis"+this.getUniqueID():null,a,
e,g,d.div(f))},"~N,~S,~N");$_M(c$,"getUniqueID",function(){var a=this.getChainID(),b=this.getLeadAtom(),c=(null==b?"":"_"+b.getModelIndex())+"_"+this.getResno()+("\x00"==a?"":""+a),a=null==b?"\x00":this.getLeadAtom().getAlternateLocationID();"\x00"!=a&&(c+=a);return c});Clazz.overrideMethod(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");Clazz.overrideMethod(c$,"getCrossLinkLead",function(a){for(var b=
this.firstAtomIndex;b<=this.lastAtomIndex;b++)if(this.getCrossLink(b,a)&&null==a)return!0;return!1},"J.util.JmolList");$_M(c$,"getCrossLink",function(a,b){return this.getCrossLinkGroup(a,b,null)},"~N,J.util.JmolList");$_M(c$,"getCrossLinkGroup",($fz=function(a,b,c){a=this.chain.getAtom(a);var d=a.getBonds(),e=this.getBioPolymerIndexInModel();if(0>e||null==d)return!1;for(var f=!1,g=null==b&&null==c,h=0;h<d.length;h++){var j=d[h].getOtherAtom(a).getGroup();if(!(null!=c&&j!==c)){var k=j.getBioPolymerIndexInModel(),
l=j.getMonomerIndex();if(g){if(k==e&&l==this.monomerIndex-1)return!0}else if(0<=k&&0<=l&&(k!=e||l<this.monomerIndex-1||l>this.monomerIndex+1)){f=!0;if(null!=c)break;b.addLast(Integer.$valueOf(j.leadAtomIndex))}}}return f},$fz.isPrivate=!0,$fz),"~N,J.util.JmolList,J.modelset.Group");Clazz.overrideMethod(c$,"isConnectedPrevious",function(){return!0})});Clazz.declarePackage("J.modelsetbio");
Clazz.load(["J.modelsetbio.Monomer"],"J.modelsetbio.AlphaMonomer","J.constant.EnumStructure J.modelsetbio.Helix $.Sheet $.Turn J.util.Quaternion $.V3".split(" "),function(){c$=Clazz.decorateAsClass(function(){this.nitrogenHydrogenPoint=this.proteinStructure=null;Clazz.instantialize(this,arguments)},J.modelsetbio,"AlphaMonomer",J.modelsetbio.Monomer);Clazz.overrideMethod(c$,"isProtein",function(){return!0});c$.validateAndAllocateA=$_M(c$,"validateAndAllocateA",function(a,b,c,d,e,f){return d!=e||f[2]!=
d?null:(new J.modelsetbio.AlphaMonomer).set2(a,b,c,d,e,J.modelsetbio.AlphaMonomer.alphaOffsets)},"J.modelset.Chain,~S,~N,~N,~N,~A");Clazz.overrideConstructor(c$,function(){});$_M(c$,"isAlphaMonomer",function(){return!0});Clazz.overrideMethod(c$,"getProteinStructure",function(){return this.proteinStructure});Clazz.overrideMethod(c$,"getStructure",function(){return this.getProteinStructure()});Clazz.overrideMethod(c$,"setStructure",function(a){this.proteinStructure=a;null==a&&(this.nitrogenHydrogenPoint=
null)},"J.modelsetbio.ProteinStructure");Clazz.overrideMethod(c$,"setStrucNo",function(a){null!=this.proteinStructure&&(this.proteinStructure.strucNo=a)},"~N");Clazz.overrideMethod(c$,"getProteinStructureType",function(){return null==this.proteinStructure?J.constant.EnumStructure.NONE:this.proteinStructure.type});Clazz.overrideMethod(c$,"getProteinStructureSubType",function(){return null==this.proteinStructure?J.constant.EnumStructure.NONE:this.proteinStructure.subtype});Clazz.overrideMethod(c$,"getStrucNo",
function(){return null!=this.proteinStructure?this.proteinStructure.strucNo:0});Clazz.overrideMethod(c$,"isHelix",function(){return null!=this.proteinStructure&&this.proteinStructure.type===J.constant.EnumStructure.HELIX});Clazz.overrideMethod(c$,"isSheet",function(){return null!=this.proteinStructure&&this.proteinStructure.type===J.constant.EnumStructure.SHEET});Clazz.overrideMethod(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");$_M(c$,"getAtom",function(a){return 2==a?this.getLeadAtom():null},"~N");$_M(c$,"getAtomPoint",function(a){return 2==
a?this.getLeadAtom():null},"~N");Clazz.overrideMethod(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");Clazz.overrideMethod(c$,"getQuaternionFrameCenter",function(a){return this.getQuaternionFrameCenterAlpha(a)},"~S");$_M(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");Clazz.overrideMethod(c$,"getHelixData",function(a,b,c){return this.getHelixData2(a,b,c)},"~N,~S,~N");Clazz.overrideMethod(c$,"getQuaternion",function(a){return this.getQuaternionAlpha(a)},"~S");$_M(c$,"getQuaternionAlpha",function(a){var b=new J.util.V3,c=new J.util.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),e=this.bioPolymer.getLeadPoint(this.monomerIndex-1);b.sub2(d,a);c.sub2(e,a)}return J.util.Quaternion.getQuaternionFrameV(b,c,null,!1)},"~S");Clazz.defineStatics(c$,"alphaOffsets",[0])});Clazz.declarePackage("J.modelsetbio");
Clazz.load(["J.util.V3"],"J.modelsetbio.ProteinStructure",["J.util.ArrayUtil","$.Logger","$.P3"],function(){c$=Clazz.decorateAsClass(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;Clazz.instantialize(this,arguments)},J.modelsetbio,"ProteinStructure");Clazz.prepareFields(c$,
function(){this.vectorProjection=new J.util.V3});$_M(c$,"setupPS",function(a,b,c,d){this.strucNo=($t$=++J.modelsetbio.ProteinStructure.globalStrucNo,J.modelsetbio.ProteinStructure.prototype.globalStrucNo=J.modelsetbio.ProteinStructure.globalStrucNo,$t$);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");$_M(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");$_M(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");$_M(c$,"calcAxis",function(){});$_M(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=J.util.V3.newV(this.axisUnitVector);a.scale(this.axisB.distance(this.axisA)/this.monomerCount);for(var b=1;b<this.monomerCount;b++){var c=this.segments[b]=new J.util.P3;c.setT(this.segments[b-1]);c.add(a)}}});$_M(c$,
"lowerNeighborIsHelixOrSheet",function(){return 0==this.monomerIndexFirst?!1:this.apolymer.monomers[this.monomerIndexFirst-1].isHelix()||this.apolymer.monomers[this.monomerIndexFirst-1].isSheet()});$_M(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()});$_M(c$,"getMonomerCount",function(){return this.monomerCount});$_M(c$,"isWithin",function(a){return a>
this.monomerIndexFirst&&a<this.monomerIndexLast},"~N");$_M(c$,"getMonomerIndex",function(){return this.monomerIndexFirst});$_M(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");$_M(c$,"getSegments",function(){null==this.segments&&this.calcSegments();return this.segments});$_M(c$,"getAxisStartPoint",function(){this.calcAxis();return this.axisA});$_M(c$,"getAxisEndPoint",function(){this.calcAxis();
return this.axisB});$_M(c$,"getStructureMidPoint",function(a){null==this.segments&&this.calcSegments();return this.segments[a]},"~N");$_M(c$,"getInfo",function(a){a.put("type",this.type.getBioStructureTypeName(!1));var b=this.apolymer.getLeadAtomIndices(),b=J.util.ArrayUtil.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");$_M(c$,"resetAxes",function(){this.segments=this.axisA=null});Clazz.defineStatics(c$,"globalStrucNo",1E3)});Clazz.declarePackage("J.modelsetbio");
Clazz.load(["J.modelsetbio.ProteinStructure"],"J.modelsetbio.Helix",["J.constant.EnumStructure","J.util.Measure","$.P3","$.V3"],function(){c$=Clazz.declareType(J.modelsetbio,"Helix",J.modelsetbio.ProteinStructure);Clazz.makeConstructor(c$,function(a,b,c,d){Clazz.superConstructor(this,J.modelsetbio.Helix,[]);this.setupPS(a,J.constant.EnumStructure.HELIX,b,c);this.subtype=d},"J.modelsetbio.AlphaPolymer,~N,~N,J.constant.EnumStructure");Clazz.overrideMethod(c$,"calcAxis",function(){if(null==this.axisA){for(var a=
Array(this.monomerCount+1),b=0;b<=this.monomerCount;b++)a[b]=new J.util.P3,this.apolymer.getLeadMidPoint(this.monomerIndexFirst+b,a[b]);this.axisA=new J.util.P3;this.axisUnitVector=new J.util.V3;J.util.Measure.calcBestAxisThroughPoints(a,this.axisA,this.axisUnitVector,this.vectorProjection,4);this.axisB=J.util.P3.newP(a[this.monomerCount]);J.util.Measure.projectOntoAxis(this.axisB,this.axisA,this.axisUnitVector,this.vectorProjection)}})});Clazz.declarePackage("J.modelsetbio");
Clazz.load(["J.modelsetbio.ProteinStructure"],"J.modelsetbio.Sheet",["J.constant.EnumStructure","J.util.Measure","$.P3","$.V3"],function(){c$=Clazz.decorateAsClass(function(){this.heightUnitVector=this.widthUnitVector=this.alphaPolymer=null;Clazz.instantialize(this,arguments)},J.modelsetbio,"Sheet",J.modelsetbio.ProteinStructure);Clazz.makeConstructor(c$,function(a,b,c,d){Clazz.superConstructor(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");Clazz.overrideMethod(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 J.util.P3,this.alphaPolymer.getLeadMidPoint(this.monomerIndexFirst+1,this.axisA),this.axisB=new J.util.P3,this.alphaPolymer.getLeadMidPoint(this.monomerIndexFirst+this.monomerCount-1,this.axisB));this.axisUnitVector=
new J.util.V3;this.axisUnitVector.sub2(this.axisB,this.axisA);this.axisUnitVector.normalize();var a=new J.util.P3;this.alphaPolymer.getLeadMidPoint(this.monomerIndexFirst,a);this.lowerNeighborIsHelixOrSheet()||J.util.Measure.projectOntoAxis(a,this.axisA,this.axisUnitVector,this.vectorProjection);var b=new J.util.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}});$_M(c$,"calcSheetUnitVectors",function(){if(Clazz.instanceOf(this.alphaPolymer,J.modelsetbio.AminoPolymer)&&null==this.widthUnitVector){var a=new J.util.V3,b=new J.util.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)}});$_M(c$,"getWidthUnitVector",function(){null==this.widthUnitVector&&this.calcSheetUnitVectors();return this.widthUnitVector});$_M(c$,"getHeightUnitVector",function(){null==this.heightUnitVector&&this.calcSheetUnitVectors();return this.heightUnitVector})});Clazz.declarePackage("J.modelsetbio");
Clazz.load(["J.modelsetbio.ProteinStructure"],"J.modelsetbio.Turn",["J.constant.EnumStructure"],function(){c$=Clazz.declareType(J.modelsetbio,"Turn",J.modelsetbio.ProteinStructure);Clazz.makeConstructor(c$,function(a,b,c){Clazz.superConstructor(this,J.modelsetbio.Turn,[]);this.setupPS(a,J.constant.EnumStructure.TURN,b,c);this.subtype=J.constant.EnumStructure.TURN},"J.modelsetbio.AlphaPolymer,~N,~N")});Clazz.declarePackage("J.modelsetbio");
Clazz.load(["J.util.V3"],"J.modelsetbio.BioPolymer","java.lang.Float java.util.Hashtable J.modelset.LabelToken J.util.BS $.Escape $.JmolList $.Logger $.P3 $.Quaternion $.TextFormat".split(" "),function(){c$=Clazz.decorateAsClass(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;Clazz.instantialize(this,arguments)},J.modelsetbio,"BioPolymer");Clazz.prepareFields(c$,function(){this.unitVectorX=J.util.V3.new3(1,0,0)});$_M(c$,"getGroups",function(){return this.monomers});Clazz.makeConstructor(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");$_M(c$,
"getRange",function(a){0!=this.monomerCount&&a.setBits(this.monomers[0].firstAtomIndex,this.monomers[this.monomerCount-1].lastAtomIndex+1)},"J.util.BS");$_M(c$,"clearStructures",function(){for(var a=0;a<this.monomerCount;a++)this.monomers[a].setStructure(null)});$_M(c$,"removeProteinStructure",function(a,b){for(var c=this.monomers[a].getProteinStructureType(),d=-1,e=0,f=a;e<b&&f<this.monomerCount;e++,f++)this.monomers[f].setStructure(null),d=this.monomers[f].setProteinStructureType(c,d)},"~N,~N");
$_M(c$,"getLeadAtomIndices",function(){null==this.leadAtomIndices&&(this.leadAtomIndices=Clazz.newIntArray(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});$_M(c$,"getIndex",function(a,b){var c;for(c=this.monomerCount;0<=--c&&!(this.monomers[c].getChainID()==a&&this.monomers[c].getSeqcode()==b););return c},"~S,~N");$_M(c$,"getLeadPoint",function(a){return this.monomers[a].getLeadAtom()},
"~N");$_M(c$,"getInitiatorPoint",($fz=function(){return this.monomers[0].getInitiatorAtom()},$fz.isPrivate=!0,$fz));$_M(c$,"getTerminatorPoint",($fz=function(){return this.monomers[this.monomerCount-1].getTerminatorAtom()},$fz.isPrivate=!0,$fz));$_M(c$,"getLeadMidPoint",function(a,b){if(a==this.monomerCount)--a;else if(0<a){b.setT(this.getLeadPoint(a));b.add(this.getLeadPoint(a-1));b.scale(0.5);return}b.setT(this.getLeadPoint(a))},"~N,J.util.P3");$_M(c$,"getWingPoint",function(a){return this.monomers[a].getWingAtom()},
"~N");$_M(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()},"J.util.BS,~N");$_M(c$,"setConformation",function(a){for(var b=this.model.getModelSet().atoms,c=this.monomerCount;0<=--c;)this.monomers[c].updateOffsetsForAlternativeLocations(b,a);this.recalculateLeadMidpointsAndWingVectors()},"J.util.BS");$_M(c$,"recalculateLeadMidpointsAndWingVectors",function(){this.invalidLead=
this.invalidControl=!0;this.getLeadAtomIndices();this.resetHydrogenPoints();this.calcLeadMidpointsAndWingVectors()});$_M(c$,"resetHydrogenPoints",function(){});$_M(c$,"getLeadMidpoints",function(){null==this.leadMidpoints&&this.calcLeadMidpointsAndWingVectors();return this.leadMidpoints});$_M(c$,"getLeadPoints",function(){null==this.leadPoints&&this.calcLeadMidpointsAndWingVectors();return this.leadPoints});$_M(c$,"getControlPoints",function(a,b,c){c&&(this.invalidControl=!0);return!a?this.leadMidpoints:
0==b?this.leadPoints:this.getControlPoints2(b)},"~B,~N,~B");$_M(c$,"getControlPoints2",($fz=function(a){if(!this.invalidControl&&a==this.sheetSmoothing)return this.controlPoints;this.getLeadPoints();var b=new J.util.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},
$fz.isPrivate=!0,$fz),"~N");$_M(c$,"getControlPoint",function(a){return this.leadPoints[a]},"~N,J.util.V3");$_M(c$,"getWingVectors",function(){null==this.leadMidpoints&&this.calcLeadMidpointsAndWingVectors();return this.wingVectors});$_M(c$,"calcLeadMidpointsAndWingVectors",($fz=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=
J.util.BS.newN(this.monomerCount):this.reversed.clearAll();this.twistedSheets=this.model.modelSet.viewer.getBoolean(603979968);var a=new J.util.V3,b=new J.util.V3,c=new J.util.V3,d=new J.util.V3,e,f;this.leadMidpoints[0]=this.getInitiatorPoint();this.leadPoints[0]=f=this.getLeadPoint(0);for(var g=null,h=1;h<this.monomerCount;++h){e=f;this.leadPoints[h]=f=this.getLeadPoint(h);var j=J.util.P3.newP(f);j.add(e);j.scale(0.5);this.leadMidpoints[h]=j;this.hasWingPoints&&(a.sub2(f,e),b.sub2(e,this.getWingPoint(h-
1)),c.cross(a,b),d.cross(a,c),d.normalize(),!this.twistedSheets&&(null!=g&&1.5707963267948966<g.angle(d))&&(this.reversed.set(h),d.scale(-1)),g=this.wingVectors[h]=J.util.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(h=1;h<this.monomerCount;++h)a.sub2(this.leadMidpoints[h],this.leadPoints[h]),b.sub2(this.leadPoints[h],this.leadMidpoints[h+
1]),c.cross(a,b),c.normalize(),null!=d&&1.5707963267948966<d.angle(c)&&c.scale(-1),d=this.wingVectors[h]=J.util.V3.newV(c)}this.wingVectors[0]=this.wingVectors[1];this.wingVectors[this.monomerCount]=this.wingVectors[this.monomerCount-1]},$fz.isPrivate=!0,$fz));$_M(c$,"findNearestAtomIndex",function(a,b,c,d,e,f){for(var g=this.monomerCount;0<=--g;)if(0!=(this.monomers[g].shapeVisibilityFlags&e)){var h=this.monomers[g].getLeadAtom();h.isVisible(0)&&!(null!=f&&f.get(h.index))&&(0<d[g]||0<d[g+1])&&this.monomers[g].findNearestAtomIndex(a,
b,c,d[g],d[g+1])}},"~N,~N,~A,~A,~N,J.util.BS");$_M(c$,"getSelectedMonomerCount",function(){return this.selectedMonomerCount});$_M(c$,"calcSelectedMonomersCount",function(a){this.selectedMonomerCount=0;null==this.bsSelectedMonomers&&(this.bsSelectedMonomers=new J.util.BS);this.bsSelectedMonomers.clearAll();for(var b=0;b<this.monomerCount;b++)this.monomers[b].isSelected(a)&&(++this.selectedMonomerCount,this.bsSelectedMonomers.set(b))},"J.util.BS");$_M(c$,"isMonomerSelected",function(a){return 0<=a&&
this.bsSelectedMonomers.get(a)},"~N");$_M(c$,"getPolymerPointsAndVectors",function(a,b,c,d,e){d=this.getControlPoints(d,e,!1);e=this.getWingVectors();for(var f=this.monomerCount,g=0;g<f;g++)b.get(this.monomers[g].leadAtomIndex)?(c.addLast([d[g],J.util.P3.newP(e[g])]),a=g):2147483646!=a&&(c.addLast([d[g],J.util.P3.newP(e[g])]),a=2147483646);a+1<f&&c.addLast([d[a+1],J.util.P3.newP(e[a+1])]);return a},"~N,J.util.BS,J.util.JmolList,~B,~N");$_M(c$,"getSequence",function(){for(var a=Clazz.newCharArray(this.monomerCount,
"\x00"),b=0;b<this.monomerCount;b++)a[b]=this.monomers[b].getGroup1();return String.valueOf(a)});$_M(c$,"getPolymerInfo",function(a){for(var b=new java.util.Hashtable,c=new J.util.JmolList,d=null,e,f=null,g=0,h=0;h<this.monomerCount;h++)if(a.get(this.monomers[h].leadAtomIndex)){var j=this.monomers[h].getMyInfo();j.put("monomerIndex",Integer.$valueOf(h));c.addLast(j);if(null!=(e=this.getProteinStructure(h))&&e!==f)j=new java.util.Hashtable,(f=e).getInfo(j),null==d&&(d=new J.util.JmolList),j.put("index",
Integer.$valueOf(g++)),d.addLast(j)}0<c.size()&&(b.put("sequence",this.getSequence()),b.put("monomers",c),null!=d&&b.put("structures",d));return b},"J.util.BS");$_M(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,J.util.BS,J.util.BS");$_M(c$,"getProteinStructure",function(a){return this.monomers[a].getProteinStructure()},"~N");$_M(c$,"calcParameters",function(){this.haveParameters=!0;return this.calcEtaThetaAngles()||
this.calcPhiPsiAngles()});$_M(c$,"calcEtaThetaAngles",function(){return!1});$_M(c$,"calcPhiPsiAngles",function(){return!1});c$.getPdbData=$_M(c$,"getPdbData",function(a,b,c,d,e,f,g,h,j,k,l,m,n,r,w){var t="C"==d||"P"==d,p="R"==c||"S"==c&&t;if(!p||b.calcPhiPsiAngles()){var u=Clazz.instanceOf(b,J.modelsetbio.AminoPolymer),s="r"==c,q=!p&&"S"==c;2==f&&s&&(c="w");q&&(f=2);var z="S"==c,A=0<="rcpCP".indexOf(d);J.util.Logger.debugging&&(q||t)&&J.util.Logger.debug("For straightness calculation: useQuaternionStraightness = "+
z+" and quaternionFrame = "+d);if(l&&!k){n.append("REMARK   6    AT GRP CH RESNO  ");switch(c){default:case "w":n.append("x*10___ y*10___ z*10___      w*10__       ");break;case "x":n.append("y*10___ z*10___ w*10___      x*10__       ");break;case "y":n.append("z*10___ w*10___ x*10___      y*10__       ");break;case "z":n.append("w*10___ x*10___ y*10___      z*10__       ");break;case "R":A?n.append("phi____ psi____ theta         Straightness"):n.append("phi____ psi____ omega-180    PartialCharge")}n.append("    Sym   q0_______ q1_______ q2_______ q3_______");
n.append("  theta_  aaX_______ aaY_______ aaZ_______");"R"!=c&&n.append("  centerX___ centerY___ centerZ___");"n"==d&&n.append("  NHX_______ NHY_______ NHZ_______");n.append("\n\n")}l="R"==c?1:10;j=!1;for(var v=0;v<(j?2:1);v++,l*=-1)for(var D=0;D<(1>e?1:e);D++)J.modelsetbio.BioPolymer.getData(a,D,e,b,c,d,f,g,h,k,p,t,z,A,q,l,u,s,m,n,r,w)}},"J.viewer.Viewer,J.modelsetbio.BioPolymer,~S,~S,~N,~N,J.util.BS,J.util.BS,~B,~B,~B,~A,J.io.OutputStringBuilder,J.util.SB,J.util.BS");c$.getData=$_M(c$,"getData",
($fz=function(a,b,c,d,e,f,g,h,j,k,l,m,n,r,w,t,p,u,s,q,z,A){w=0<g?"dq"+(2==g?"2":""):"q";for(var v,D=null,H=null,C=null,M=null,O=null,K=null,B=C=0,E=0,x=0,y="",I=NaN,P=NaN,N=k?new J.util.P3:null,R=1>=c?1:c;b<d.monomerCount;b+=R){var F=d.monomers[b];if(null==h||h.get(F.leadAtomIndex)){var G=F.getLeadAtom(),y=F.getUniqueID();if(l){"S"==e&&F.setGroupParameter(1112539148,NaN);C=F.getGroupParameter(1112539143);B=F.getGroupParameter(1112539144);E=F.getGroupParameter(1112539142);-90>E&&(E+=360);E-=180;if(Float.isNaN(C)||
Float.isNaN(B)||Float.isNaN(E)){null!=h&&h.clear(G.getIndex());continue}var L=r?d.calculateRamachandranHelixAngle(b,f):0,Q=m||r?J.modelsetbio.BioPolymer.getStraightness(Math.cos(3.141592653589793*(L/2/180))):0;if("S"==e){F.setGroupParameter(1112539148,Q);continue}if(k){if(null!=j&&!j.get(G.getIndex()))continue;N.set(-C,C,0.5);q.append('draw ID "phi').append(y).append('" ARROW ARC ').append(J.util.Escape.eP(F.getNitrogenAtom())).append(J.util.Escape.eP(G)).append(J.util.Escape.eP(F.getCarbonylCarbonAtom())).append(J.util.Escape.eP(N)).append(' "phi = ').append(String.valueOf(Math.round(C))).append('" color ').append(J.modelsetbio.BioPolymer.qColor[2]).append("\n");
N.set(0,B,0.5);q.append('draw ID "psi').append(y).append('" ARROW ARC ').append(J.util.Escape.eP(G)).append(J.util.Escape.eP(F.getCarbonylCarbonAtom())).append(J.util.Escape.eP(F.getNitrogenAtom())).append(J.util.Escape.eP(N)).append(' "psi = ').append(String.valueOf(Math.round(B))).append('" color ').append(J.modelsetbio.BioPolymer.qColor[1]).append("\n");q.append('draw ID "planeNCC').append(y).append('" ').append(J.util.Escape.eP(F.getNitrogenAtom())).append(J.util.Escape.eP(G)).append(J.util.Escape.eP(F.getCarbonylCarbonAtom())).append(" color ").append(J.modelsetbio.BioPolymer.qColor[0]).append("\n");
q.append('draw ID "planeCNC').append(y).append('" ').append(J.util.Escape.eP(d.monomers[b-1].getCarbonylCarbonAtom())).append(J.util.Escape.eP(F.getNitrogenAtom())).append(J.util.Escape.eP(G)).append(" color ").append(J.modelsetbio.BioPolymer.qColor[1]).append("\n");q.append('draw ID "planeCCN').append(y).append('" ').append(J.util.Escape.eP(G)).append(J.util.Escape.eP(F.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(L)){if(y="",r)continue}else v=J.util.Quaternion.newVA(J.util.P3.new3(1,0,0),L),y=v.getInfo(),r?(E=L,x=Q):x=G.getPartialCharge()}else{v=F.getQuaternion(f);null!=v&&(v.setRef(O),O=J.util.Quaternion.newQ(v));2==g&&F.setGroupParameter(1112539148,NaN);null==v?O=H=null:0<g&&(B=G,E=v,null==H?M=v=null:(C=u?H.leftDifference(v):v.rightDifference(H),1==g?v=C:null==M?v=null:(v=C.rightDifference(M),I=J.modelsetbio.BioPolymer.getQuaternionStraightness(y,M,C),P=J.modelsetbio.BioPolymer.get3DStraightness(y,
M,C),D.getGroup().setGroupParameter(1112539148,n?I:P)),M=C),D=B,H=E);if(null==v){K=null;continue}switch(e){default:C=v.q1;B=v.q2;E=v.q3;x=v.q0;break;case "x":C=v.q0;B=v.q1;E=v.q2;x=v.q3;break;case "y":C=v.q3;B=v.q0;E=v.q1;x=v.q2;break;case "z":C=v.q2,B=v.q3,E=v.q0,x=v.q1}L=F.getQuaternionFrameCenter(f);null==L&&(L=new J.util.P3);if(k){if(null!=j&&!j.get(G.getIndex()))continue;G=Clazz.doubleToInt(Math.floor(360*Math.acos(x)/3.141592653589793));0==g&&(q.append(v.draw(w,y,L,1)),"n"==f&&p&&(v=F.getNitrogenHydrogenPoint(),
null!=v&&q.append('draw ID "').append(w).append("nh").append(y).append('" width 0.1 ').append(J.util.Escape.eP(v)).append("\n")));if(1==g){q.append(F.getHelixData(135176,f,c)).append("\n");continue}N.set(2*C,2*B,2*E);q.append('draw ID "').append(w).append("a").append(y).append('" VECTOR ').append(J.util.Escape.eP(L)).append(J.util.Escape.eP(N)).append(' ">').append(String.valueOf(G)).append('" color ').append(J.modelsetbio.BioPolymer.qColor[g]).append("\n");continue}y=v.getInfo()+J.util.TextFormat.sprintf("  %10.5p %10.5p %10.5p",
"p",[L]);"n"==f&&p?y+=J.util.TextFormat.sprintf("  %10.5p %10.5p %10.5p","p",[F.getNitrogenHydrogenPoint()]):2==g&&!Float.isNaN(I)&&(y+=J.util.TextFormat.sprintf(" %10.5f %10.5f","F",[[I,P]]))}null!=q&&(A.set(G.getGroup().leadAtomIndex),q.append(J.modelset.LabelToken.formatLabelAtomArray(a,G,s,"\x00",null)),q.append(J.util.TextFormat.sprintf("%8.2f%8.2f%8.2f      %6.3f          %2s    %s\n","ssF",[G.getElementSymbolIso(!1).toUpperCase(),y,[C*t,B*t,E*t,x*t]])),null!=K&&K.getPolymerIndexInModel()==
G.getPolymerIndexInModel()&&z.append("CONECT").append(J.util.TextFormat.formatStringI("%5i","i",K.getAtomNumber())).append(J.util.TextFormat.formatStringI("%5i","i",G.getAtomNumber())).appendC("\n"),K=G)}}},$fz.isPrivate=!0,$fz),"J.viewer.Viewer,~N,~N,J.modelsetbio.BioPolymer,~S,~S,~N,J.util.BS,J.util.BS,~B,~B,~B,~B,~B,~B,~N,~B,~B,~A,J.io.OutputStringBuilder,J.util.SB,J.util.BS");$_M(c$,"calculateRamachandranHelixAngle",function(){return NaN},"~N,~S");c$.get3DStraightness=$_M(c$,"get3DStraightness",
($fz=function(a,b,c){return b.getNormal().dot(c.getNormal())},$fz.isPrivate=!0,$fz),"~S,J.util.Quaternion,J.util.Quaternion");c$.getQuaternionStraightness=$_M(c$,"getQuaternionStraightness",($fz=function(a,b,c){return J.modelsetbio.BioPolymer.getStraightness(b.dot(c))},$fz.isPrivate=!0,$fz),"~S,J.util.Quaternion,J.util.Quaternion");c$.getStraightness=$_M(c$,"getStraightness",($fz=function(a){return 1-2*Math.acos(Math.abs(a))/3.141592653589793},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"isDna",function(){return 0<
this.monomerCount&&this.monomers[0].isDna()});$_M(c$,"isRna",function(){return 0<this.monomerCount&&this.monomers[0].isRna()});$_M(c$,"getRangeGroups",function(a,b,c){for(var d=new J.util.BS,e=0;e<this.monomerCount;e++)this.monomers[e].isSelected(b)&&(d.setBits(Math.max(0,e-a),e+a+1),e+=a-1);for(e=d.nextSetBit(0);0<=e&&e<this.monomerCount;e=d.nextSetBit(e+1))this.monomers[e].selectAtoms(c)},"~N,J.util.BS,J.util.BS");$_M(c$,"calculateDssp",function(a,b,c,d,e,f){return J.modelsetbio.AminoPolymer.calculateStructuresDssp(a,
b,c,d,e,f)},"~A,~N,J.util.JmolList,~B,~B,~B");$_M(c$,"addStructure",function(){},"J.constant.EnumStructure,~S,~N,~N,~S,~N,~S,~N,~N,~N,J.util.BS");$_M(c$,"calculateStructures",function(){},"~B");$_M(c$,"calcRasmolHydrogenBonds",function(){},"J.modelsetbio.BioPolymer,J.util.BS,J.util.BS,J.util.JmolList,~N,~A,~B,~B");$_M(c$,"setStructureList",function(){},"java.util.Map");$_M(c$,"getPdbData",function(){},"J.viewer.Viewer,~S,~S,~N,~N,J.util.BS,J.util.BS,~B,~B,~B,~A,J.io.OutputStringBuilder,J.util.SB,J.util.BS");
$_M(c$,"getType",function(){return this.type});$_M(c$,"calculateStruts",function(){return null},"J.modelset.ModelSet,J.util.BS,J.util.BS,J.util.JmolList,~N,~N,~B");Clazz.defineStatics(c$,"TYPE_NOBONDING",0,"TYPE_AMINO",1,"TYPE_NUCLEIC",2,"TYPE_CARBOHYDRATE",3,"qColor",["yellow","orange","purple"])});Clazz.declarePackage("J.modelsetbio");
Clazz.load(["java.lang.Enum","J.modelsetbio.BioPolymer"],"J.modelsetbio.AlphaPolymer","J.constant.EnumStructure J.modelsetbio.Helix $.Sheet $.Turn J.util.BS $.JmolList $.Logger $.Measure $.P3".split(" "),function(){c$=Clazz.declareType(J.modelsetbio,"AlphaPolymer",J.modelsetbio.BioPolymer);Clazz.overrideMethod(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=J.util.P3.newP(this.leadPoints[a]);
c.add(b);return c},"~N,J.util.V3");$_M(c$,"getPdbData",function(a,b,c,d,e,f,g,h,j,k,l,m,n,r){J.modelsetbio.BioPolymer.getPdbData(a,this,b,c,d,e,f,g,h,j,k,l,m,n,r)},"J.viewer.Viewer,~S,~S,~N,~N,J.util.BS,J.util.BS,~B,~B,~B,~A,J.io.OutputStringBuilder,J.util.SB,J.util.BS");Clazz.overrideMethod(c$,"addStructure",function(a,b,c,d,e,f,g,h,j,k,l){if(!(0<=j&&(this.monomers[0].firstAtomIndex>k||this.monomers[this.monomerCount-1].lastAtomIndex<j))){var m;if(!(-1==(e=this.getIndex(e,f))||-1==(m=this.getIndex(g,
h)))){if(0<=j&&null!=l&&(g=l.nextSetBit(this.monomers[e].firstAtomIndex),0<=g&&g<this.monomers[m].lastAtomIndex))return;this.addStructureProtected(a,b,c,d,e,m);0<=j&&l.setBits(j,k+1)}}},"J.constant.EnumStructure,~S,~N,~N,~S,~N,~S,~N,~N,~N,J.util.BS");$_M(c$,"addStructureProtected",function(a,b,c,d,e,f){if(f<e)J.util.Logger.error("AlphaPolymer:addSecondaryStructure error:  indexStart:"+e+" indexEnd:"+f);else{var g=f-e+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,e,g,a);break;case J.constant.EnumStructure.SHEET:h=new J.modelsetbio.Sheet(this,e,g,a);break;case J.constant.EnumStructure.TURN:h=new J.modelsetbio.Turn(this,e,g);break;default:J.util.Logger.error("unrecognized secondary structure type");return}h.structureID=b;h.serialID=c;h.strandCount=d;for(a=e;a<=f;++a)this.monomers[a].setStructure(h)}},"J.constant.EnumStructure,~S,~N,~N,~N,~N");Clazz.overrideMethod(c$,"calculateStruts",function(a,b,c,d,e,f,g){return this.calculateStrutsStatic(a,
b,c,d,e,f,g)},"J.modelset.ModelSet,J.util.BS,J.util.BS,J.util.JmolList,~N,~N,~B");$_M(c$,"calculateStrutsStatic",($fz=function(a,b,c,d,e,f,g){var h=new J.util.JmolList,j=e*e,k=d.size(),l=new J.util.BS,m=new J.util.BS,n=new J.util.BS,r=d.get(0),w;a=a.getBioPolymerCountInModel(r.modelIndex);for(var t=Clazz.newIntArray(a,6,0),p=0;p<k;p++){var r=d.get(p),u=r.getPolymerIndexInModel(),s=r.getMonomerIndex(),q=s;3>q&&(t[u][q]=p+1);q=r.getGroup().getBioPolymerLength()-s-1;3>q&&(t[u][3+q]=p+1)}u=Clazz.newFloatArray(Clazz.doubleToInt(k*
(k-1)/2),0);for(p=0;p<k;p++){r=d.get(p);for(s=p+1;s<k;s++){q=J.modelsetbio.AlphaPolymer.strutPoint(p,s,k);w=d.get(s);var z=r.getResno(),A=r.getPolymerIndexInModel(),v=w.getResno(),D=w.getPolymerIndexInModel();A==D&&Math.abs(v-z)<f&&n.set(q);(u[q]=r.distanceSquared(w))>=j&&m.set(q)}}for(r=5;0<=--r;){j=(e-r)*(e-r);for(p=0;p<k;p++)if(g||!l.get(p))for(s=p+1;s<k;s++)q=J.modelsetbio.AlphaPolymer.strutPoint(p,s,k),!m.get(q)&&(!n.get(q)&&(g||!l.get(s))&&u[q]<=j)&&J.modelsetbio.AlphaPolymer.setStrut(p,s,k,
d,b,c,h,l,m,n,f)}for(e=0;e<a;e++){for(g=0;6>g;g++)if(p=t[e][g]-1,0<=p&&l.get(p))for(s=0;3>s;s++)q=3*Clazz.doubleToInt(g/3)+s,0<=(p=t[e][q]-1)&&l.set(p),t[e][q]=-1;if(!(-1==t[e][0]&&-1==t[e][3])){for(var r=j=!1,v=A=z=w=0,H=D=3.4028235E38,s=0;s<k;s++)for(g=0;6>g;g++)if(p=t[e][g]-1,-2==p)g=3*(Clazz.doubleToInt(g/3)+1)-1;else if(!(s==p||-1==p))if(q=J.modelsetbio.AlphaPolymer.strutPoint(p,s,k),!(n.get(q)||u[q]>(3>g?D:H)))3>g?(m.get(q)&&(j=!0),z=s,w=p,D=u[q]):(m.get(q)&&(r=!0),v=s,A=p,H=u[q]);j&&J.modelsetbio.AlphaPolymer.setStrut(w,
z,k,d,b,c,h,l,m,n,f);r&&J.modelsetbio.AlphaPolymer.setStrut(A,v,k,d,b,c,h,l,m,n,f)}}return h},$fz.isPrivate=!0,$fz),"J.modelset.ModelSet,J.util.BS,J.util.BS,J.util.JmolList,~N,~N,~B");c$.strutPoint=$_M(c$,"strutPoint",($fz=function(a,b,c){return b<a?Clazz.doubleToInt(b*(2*c-b-1)/2)+a-b-1:Clazz.doubleToInt(a*(2*c-a-1)/2)+b-a-1},$fz.isPrivate=!0,$fz),"~N,~N,~N");c$.setStrut=$_M(c$,"setStrut",($fz=function(a,b,c,d,e,f,g,h,j,k,l){var m=d.get(a);d=d.get(b);if(e.get(m.index)&&f.get(d.index)){g.addLast([m,
d]);h.set(a);h.set(b);for(e=Math.max(0,a-l);e<=a+l&&e<c;e++)for(f=Math.max(0,b-l);f<=b+l&&f<c;f++)e!=f&&(g=J.modelsetbio.AlphaPolymer.strutPoint(e,f,c),k.get(g)||j.set(g))}},$fz.isPrivate=!0,$fz),"~N,~N,~N,J.util.JmolList,J.util.BS,J.util.BS,J.util.JmolList,J.util.BS,J.util.BS,J.util.BS,~N");Clazz.overrideMethod(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");$_M(c$,"calculateAnglesInDegrees",($fz=function(){for(var a=Clazz.newFloatArray(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},$fz.isPrivate=!0,$fz));$_M(c$,"calculateCodes",($fz=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},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"checkBetaSheetAlphaHelixOverlap",($fz=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)},$fz.isPrivate=!0,$fz),"~A,~A");$_M(c$,"calculateRunsFourOrMore",($fz=function(a){for(var b=Array(this.monomerCount),c=J.constant.EnumStructure.NONE,d=J.modelsetbio.AlphaPolymer.Code.NADA,e=0,f=0;f<this.monomerCount;++f)if(a[f]===d&&d!==J.modelsetbio.AlphaPolymer.Code.NADA&&d!==J.modelsetbio.AlphaPolymer.Code.BETA_SHEET)if(++e,4==e)for(var c=
d===J.modelsetbio.AlphaPolymer.Code.BETA_SHEET?J.constant.EnumStructure.SHEET:J.constant.EnumStructure.HELIX,g=4;0<=--g;)b[f-g]=c;else 4<e&&(b[f]=c);else e=1,d=a[f];return b},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"extendRuns",($fz=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]},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"searchForTurns",($fz=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 e=b[d];-90<=e&&0>e?a[d]=J.modelsetbio.AlphaPolymer.Code.LEFT_TURN:0<=e&&90>e&&(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)},$fz.isPrivate=!0,$fz),"~A,~A,~A");$_M(c$,"addStructuresFromTags",($fz=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}}},$fz.isPrivate=!0,$fz),"~A");Clazz.pu$h();c$=Clazz.declareType(J.modelsetbio.AlphaPolymer,"Code",Enum);Clazz.defineEnumConstant(c$,"NADA",0,[]);Clazz.defineEnumConstant(c$,"RIGHT_HELIX",1,[]);Clazz.defineEnumConstant(c$,"BETA_SHEET",2,[]);Clazz.defineEnumConstant(c$,"LEFT_HELIX",3,[]);Clazz.defineEnumConstant(c$,
"LEFT_TURN",4,[]);Clazz.defineEnumConstant(c$,"RIGHT_TURN",5,[]);c$=Clazz.p0p()});Clazz.declarePackage("J.modelsetbio");
Clazz.load(["J.modelsetbio.AlphaMonomer"],"J.modelsetbio.AminoMonomer","J.constant.EnumStructure J.util.AxisAngle4f $.Escape $.Logger $.Matrix3f $.P3 $.Quaternion $.TextFormat $.V3".split(" "),function(){c$=Clazz.decorateAsClass(function(){this.nhChecked=!1;this.ptTemp=null;Clazz.instantialize(this,arguments)},J.modelsetbio,"AminoMonomer",J.modelsetbio.AlphaMonomer);Clazz.overrideConstructor(c$,function(){});c$.validateAndAllocate=$_M(c$,"validateAndAllocate",function(a,b,c,d,e,f,g){var h=J.modelsetbio.Monomer.scanForOffsets(d,
f,J.modelsetbio.AminoMonomer.interestingAminoAtomIDs);if(null==h)return null;J.modelsetbio.Monomer.checkOptional(h,1,d,f[5]);return g[d].isHetero()&&!J.modelsetbio.AminoMonomer.isBondedCorrectly(d,h,g)?null:(new J.modelsetbio.AminoMonomer).set2(a,b,c,d,e,h)},"J.modelset.Chain,~S,~N,~N,~N,~A,~A");c$.isBondedCorrectlyRange=$_M(c$,"isBondedCorrectlyRange",($fz=function(a,b,c,d,e){a=c+(d[a]&255);b=c+(d[b]&255);return a!=b&&e[a].isBonded(e[b])},$fz.isPrivate=!0,$fz),"~N,~N,~N,~A,~A");c$.isBondedCorrectly=
$_M(c$,"isBondedCorrectly",($fz=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))},$fz.isPrivate=!0,$fz),"~N,~A,~A");$_M(c$,"isAminoMonomer",function(){return!0});Clazz.overrideMethod(c$,"getNitrogenAtom",function(){return this.getAtomFromOffsetIndex(2)});$_M(c$,"getCarbonylCarbonAtom",function(){return this.getAtomFromOffsetIndex(3)});
Clazz.overrideMethod(c$,"getCarbonylOxygenAtom",function(){return this.getWingAtom()});Clazz.overrideMethod(c$,"getInitiatorAtom",function(){return this.getNitrogenAtom()});Clazz.overrideMethod(c$,"getTerminatorAtom",function(){return this.getAtomFromOffsetIndex(J.modelsetbio.Monomer.have(this.offsets,4)?4:3)});$_M(c$,"hasOAtom",function(){return J.modelsetbio.Monomer.have(this.offsets,1)});Clazz.overrideMethod(c$,"isConnectedAfter",function(a){return null==a?!0:a.getCarbonylCarbonAtom().isBonded(this.getNitrogenAtom())},
"J.modelsetbio.Monomer");Clazz.overrideMethod(c$,"findNearestAtomIndex",function(a,b,c,d,e){var f=c[0],g=this.getNitrogenAtom();d=Clazz.doubleToInt(d/2);1200>d&&(d=1200);if(0!=g.screenZ){d=Clazz.floatToInt(this.scaleToScreen(g.screenZ,d));4>d&&(d=4);var h=this.getCarbonylCarbonAtom();e=Clazz.doubleToInt(e/2);1200>e&&(e=1200);e=Clazz.floatToInt(this.scaleToScreen(g.screenZ,e));4>e&&(e=4);var j=this.getLeadAtom();if(this.isCursorOnTopOf(j,a,b,Clazz.doubleToInt((d+e)/2),f)||this.isCursorOnTopOf(g,a,
b,d,f)||this.isCursorOnTopOf(h,a,b,e,f))c[0]=j}},"~N,~N,~A,~N,~N");$_M(c$,"resetHydrogenPoint",function(){this.nhChecked=!1;this.nitrogenHydrogenPoint=null});$_M(c$,"getNitrogenHydrogenPoint",function(){null==this.nitrogenHydrogenPoint&&!this.nhChecked&&(this.nhChecked=!0,this.nitrogenHydrogenPoint=this.getExplicitNH());return this.nitrogenHydrogenPoint});$_M(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});$_M(c$,"getNHPoint",function(a,b,c,d){if(0==this.monomerIndex||15==this.groupID)return!1;var e=this.getNitrogenAtom(),f=this.getNitrogenHydrogenPoint();if(null!=f&&!d)return b.sub2(f,e),a.setT(f),!0;d=this.bioPolymer.monomers[this.monomerIndex-1];if(c)b.sub2(e,this.getLeadAtom()),b.normalize(),c=new J.util.V3,c.sub2(e,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(e,b);this.nitrogenHydrogenPoint=J.util.P3.newP(a);J.util.Logger.debugging&&J.util.Logger.info('draw ID "pta'+this.monomerIndex+"_"+e.index+'" '+J.util.Escape.eP(e)+J.util.Escape.eP(a)+" # "+e);return!0},"J.util.P3,J.util.V3,~B,~B");Clazz.overrideMethod(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=J.util.P3.newP(this.getCarbonylCarbonAtom());b.add(a.getNitrogenAtom());b.scale(0.5);return b}},"~S");Clazz.overrideMethod(c$,"getQuaternion",function(a){var b=this.getCarbonylCarbonAtom(),c=this.getLeadAtom(),d=new J.util.V3,e=new J.util.V3,f=null;switch(a){case "a":case "n":if(0==this.monomerIndex||15==this.groupID)return null;f=new J.util.V3;null==this.ptTemp&&(this.ptTemp=
new J.util.P3);this.getNHPoint(this.ptTemp,f,!0,!1);e.sub2(c,this.getNitrogenAtom());e.cross(f,e);b=new J.util.Matrix3f;b.setAA(J.util.AxisAngle4f.newVA(e,-0.29670596));b.transform(f);d.cross(e,f);break;case "b":return this.getQuaternionAlpha("b");case "c":d.sub2(b,c);e.sub2(this.getNitrogenAtom(),c);break;case "p":case "x":if(this.monomerIndex==this.bioPolymer.monomerCount-1)return null;d.sub2(c,b);e.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];e.sub2(a.getLeadAtom(),a.getNitrogenAtom());d.sub2(c,b);break;default:return null}return J.util.Quaternion.getQuaternionFrameV(d,e,f,!1)},"~S");Clazz.overrideMethod(c$,"isWithinStructure",function(a){var b=this.getStructure();return null!=b&&b.isWithin(this.monomerIndex)&&b.type===a},"J.constant.EnumStructure");Clazz.overrideMethod(c$,"getStructureId",function(){return null==this.proteinStructure||null==
this.proteinStructure.structureID?"":this.proteinStructure.structureID});Clazz.overrideMethod(c$,"getProteinStructureTag",function(){if(null==this.proteinStructure||null==this.proteinStructure.structureID)return null;var a;a=J.util.TextFormat.formatStringI("%3N %3ID","N",this.proteinStructure.serialID);a=J.util.TextFormat.formatStringS(a,"ID",this.proteinStructure.structureID);this.proteinStructure.type===J.constant.EnumStructure.SHEET&&(a+=J.util.TextFormat.formatStringI("%2SC","SC",this.proteinStructure.strandCount));
return a});Clazz.defineStatics(c$,"CA",0,"O",1,"N",2,"C",3,"OT",4,"interestingAminoAtomIDs",[2,-5,1,3,-65],"beta",0.29670597283903605)});Clazz.declarePackage("J.modelsetbio");
Clazz.load(["J.modelsetbio.AlphaPolymer"],"J.modelsetbio.AminoPolymer","java.lang.Boolean java.util.Hashtable J.constant.EnumStructure J.i18n.GT J.modelset.HBond J.modelsetbio.APBridge J.util.ArrayUtil $.BS $.Escape $.JmolList $.Logger $.Measure $.P3 $.SB $.TextFormat $.V3 J.viewer.Viewer".split(" "),function(){c$=Clazz.decorateAsClass(function(){this.structureList=null;Clazz.instantialize(this,arguments)},J.modelsetbio,"AminoPolymer",J.modelsetbio.AlphaPolymer);Clazz.makeConstructor(c$,function(a){Clazz.superConstructor(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");Clazz.overrideMethod(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()}});Clazz.overrideMethod(c$,"calcPhiPsiAngles",function(){for(var a=0;a<this.monomerCount-1;++a)this.calcPhiPsiAngles2(this.monomers[a],this.monomers[a+1]);return!0});
$_M(c$,"calcPhiPsiAngles2",($fz=function(a,b){var c=a.getNitrogenAtom(),d=a.getLeadAtom(),e=a.getCarbonylCarbonAtom(),f=b.getNitrogenAtom(),g=b.getLeadAtom(),h=b.getCarbonylCarbonAtom();b.setGroupParameter(1112539143,J.util.Measure.computeTorsion(e,f,g,h,!0));a.setGroupParameter(1112539144,J.util.Measure.computeTorsion(c,d,e,f,!0));a.setGroupParameter(1112539142,J.util.Measure.computeTorsion(d,e,f,g,!0))},$fz.isPrivate=!0,$fz),"J.modelsetbio.AminoMonomer,J.modelsetbio.AminoMonomer");Clazz.overrideMethod(c$,
"calculateRamachandranHelixAngle",function(a,b){var c=0==a?NaN:this.monomers[a-1].getGroupParameter(1112539144),d=this.monomers[a].getGroupParameter(1112539144),e=this.monomers[a].getGroupParameter(1112539143),f=a==this.monomerCount-1?NaN:this.monomers[a+1].getGroupParameter(1112539143),g=a==this.monomerCount-1?NaN:this.monomers[a+1].getGroupParameter(1112539144);switch(b){default:case "p":case "r":case "P":return c=3.141592653589793*((f-e)/2)/180,d=3.141592653589793*((g-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+f-e}},"~N,~S");$_M(c$,"calcRasmolHydrogenBonds",function(a,b,c,d,e,f,g,h){null==a&&(a=this);if(Clazz.instanceOf(a,J.modelsetbio.AminoPolymer)){e=new J.util.P3;for(var j=new J.util.V3,k,l=null==f?Clazz.newIntArray(2,3,0):null,m=1;m<this.monomerCount;++m)if(null==f?(l[0][0]=l[1][0]=this.bioPolymerIndexInModel,l[0][1]=l[1][1]=-2147483648,l[0][2]=l[1][2]=0):l=f[m],(k=this.monomers[m]).getNHPoint(e,j,g,h)){var n=
null==b||b.get(k.getNitrogenAtom().index);if(n&&(g||null!=k.getCarbonylOxygenAtom()))this.checkRasmolHydrogenBond(k,a,m,e,n?c:b,d,l,g)}}},"J.modelsetbio.BioPolymer,J.util.BS,J.util.BS,J.util.JmolList,~N,~A,~B,~B");$_M(c$,"checkRasmolHydrogenBond",($fz=function(a,b,c,d,e,f,g,h){var j=a.getLeadAtom(),k=a.getNitrogenAtom();a=a.getNitrogenAtom();for(var l,m=b.monomerCount;0<=--m;)if(!(b===this&&(m==c||m+1==c))){l=b.monomers[m];var n=l.getCarbonylOxygenAtom();if(!(null==n||null!=e&&!e.get(n.index)))if(n=
l.getLeadAtom(),!(81<=j.distanceSquared(n))){n=this.calcHbondEnergy(k,d,l,h);if(n<g[0][2])l=g[1],g[1]=g[0],g[0]=l;else if(n<g[1][2])l=g[1];else continue;l[0]=b.bioPolymerIndexInModel;l[1]=-500>n?m:-1-m;l[2]=n}}if(null!=f)for(m=0;2>m;m++)0<=g[m][1]&&this.addResidueHydrogenBond(a,b.monomers[g[m][1]].getCarbonylOxygenAtom(),b===this?c:-99,g[m][1],g[m][2]/1E3,f)},$fz.isPrivate=!0,$fz),"J.modelsetbio.AminoMonomer,J.modelsetbio.BioPolymer,~N,J.util.P3,J.util.BS,J.util.JmolList,~A,~B");$_M(c$,"calcHbondEnergy",
($fz=function(a,b,c,d){var e=c.getCarbonylOxygenAtom();if(null==e)return 0;var f=e.distanceSquared(a);if(0.25>f)return 0;e=e.distanceSquared(b);if(0.25>e)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(e);e=Math.sqrt(b);b=Math.sqrt(c);f=Math.sqrt(f);f=J.modelset.HBond.getEnergy(a,e,b,f);return!(-500>f&&(!d||b>e&&3>=a))&&d||-9900>f?0:f},$fz.isPrivate=!0,$fz),"J.util.P3,J.util.P3,J.modelsetbio.AminoMonomer,~B");$_M(c$,
"addResidueHydrogenBond",($fz=function(a,b,c,d,e,f){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}f.addLast(new J.modelset.HBond(a,b,c,1,0,e))},$fz.isPrivate=!0,$fz),"J.modelset.Atom,J.modelset.Atom,~N,~N,~N,J.util.JmolList");c$.calculateStructuresDssp=$_M(c$,"calculateStructuresDssp",function(a,b,c,d,e,f){for(var g=new J.util.BS,h=0;h<b;h++)Clazz.instanceOf(a[h],J.modelsetbio.AminoPolymer)&&
g.set(h);if(g.isEmpty())return"";var j=a[0].model,k=new J.util.SB;k.append("Jmol ").append(J.viewer.Viewer.getJmolVersion()).append(" DSSP analysis for model ").append(j.getModelNumberDotted()).append(" - ").append(j.getModelTitle()).append("\n");0==j.modelIndex&&k.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");
f&&0==j.modelIndex&&k.append("\nAll bioshapes have been deleted and must be regenerated.\n");0<j.nAltLocs&&k.append("\nNote: This model contains alternative locations. Use  'CONFIGURATION 1' to be consistent with CMBI DSSP.\n");for(var j=Clazz.newCharArray(b,"\x00"),l=Array(b),m=new J.util.BS,n=!1,h=g.nextSetBit(0);0<=h;h=g.nextSetBit(h+1)){var r=a[h];!n&&null!=r.monomers[0].getExplicitNH()&&(e?k.append(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")):k.append(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")),n=!0);a[h].recalculateLeadMidpointsAndWingVectors();j[h]=Clazz.newCharArray(a[h].monomerCount,"\x00");l[h]=new J.util.BS;for(var w=0;w<r.monomerCount;w++)null==r.monomers[w].getCarbonylOxygenAtom()&&m.set(r.monomers[w].leadAtomIndex)}r=
J.modelsetbio.AminoPolymer.getDualHydrogenBondArray(a,b,e);h=new J.util.JmolList;e=new J.util.JmolList;n=new java.util.Hashtable;w=new java.util.Hashtable;J.modelsetbio.AminoPolymer.getBridges(a,r,h,e,n,w,m,c,l);J.modelsetbio.AminoPolymer.getSheetStructures(a,h,e,n,w,j,l,d,f);b=Array(b);for(h=g.nextSetBit(0);0<=h;h=g.nextSetBit(h+1))null!=r[h]&&(b[h]=a[h].findHelixes(r[h],h,l[h],j[h],d,f,c,m));if(d){c=new J.util.SB;k.append("\n------------------------------\n");for(h=g.nextSetBit(0);0<=h;h=g.nextSetBit(h+
1))null!=j[h]&&(r=a[h],c.append(r.dumpSummary(j[h])),k.append(b[h]).append(r.dumpTags("$.1: "+String.valueOf(j[h]),m,2)));0<=m.nextSetBit(0)&&k.append("\nNOTE: '!' indicates a residue that is missing a backbone carbonyl oxygen atom.\n");k.append("\n").append("SUMMARY:"+c)}return k.toString()},"~A,~N,J.util.JmolList,~B,~B,~B");c$.getDualHydrogenBondArray=$_M(c$,"getDualHydrogenBondArray",($fz=function(a,b,c){for(var d=J.util.ArrayUtil.newInt4(b),e=0;e<b;e++)if(Clazz.instanceOf(a[e],J.modelsetbio.AminoPolymer)){var f=
a[e].monomerCount;d[e]=Clazz.newIntArray(f,2,3,0);for(var g=0;g<f;++g)d[e][g][0][1]=d[e][g][1][1]=-2147483648,d[e][g][0][2]=d[e][g][1][2]=0}for(e=0;e<b;e++)if(null!=d[e])for(g=0;g<b;g++)null!=d[g]&&a[e].calcRasmolHydrogenBonds(a[g],null,null,null,2,d[e],!1,c);return d},$fz.isPrivate=!0,$fz),"~A,~N,~B");$_M(c$,"findHelixes",($fz=function(a,b,c,d,e,f,g,h){if(J.util.Logger.debugging)for(var j=0;j<this.monomerCount;j++)J.util.Logger.debug(b+"."+this.monomers[j].getResno()+"\t"+J.util.Escape.e(a[j]));
var j=new J.util.BS,k=this.findHelixes2(4,a,b,J.constant.EnumStructure.HELIXALPHA,10240,c,j,d,e,f,g,h),l=this.findHelixes2(3,a,b,J.constant.EnumStructure.HELIX310,8192,c,j,d,e,f,g,h);a=this.findHelixes2(5,a,b,J.constant.EnumStructure.HELIXPI,12288,c,j,d,e,f,g,h);f&&this.setStructure(j,J.constant.EnumStructure.TURN);return e?(this.setTag(d,j,"T"),this.dumpTags("$.5: "+a+"\n$.4: "+k+"\n$.3: "+l,h,1)):""},$fz.isPrivate=!0,$fz),"~A,~N,J.util.BS,~A,~B,~B,J.util.JmolList,J.util.BS");$_M(c$,"findHelixes2",
($fz=function(a,b,c,d,e,f,g,h,j,k,l,m){for(var n=new J.util.BS,r=new J.util.BS,w=new J.util.BS,t=new J.util.BS,p=new J.util.BS,u="",s=a;s<this.monomerCount;++s){var q=s-a,z=0;if(b[s][0][0]==c&&b[s][0][1]==q||b[s][z=1][0]==c&&b[s][1][1]==q){var A=this.monomers[q].leadAtomIndex,v=m.nextSetBit(A);if(!(v>=A&&v<=this.monomers[s].leadAtomIndex)){n.set(q);r.setBits(q+1,s);t.set(s);var v=f.nextSetBit(q),A=0>v||v>=s,D=!1;if(0<q&&n.get(q-1)&&(4==a||A))p.setBits(q,s),A||(u+="  WARNING! Bridge to helix at "+
this.monomers[v]),D=!0;else if(A||f.nextClearBit(v)<s)D=!0;t.get(q)&&w.set(q);D&&null!=l&&J.modelsetbio.AminoPolymer.addHbond(l,this.monomers[s],this.monomers[q],b[s][z][2],e,null)}}}j?(b=Clazz.newCharArray(this.monomerCount,"\x00"),this.setTag(b,r,String.fromCharCode(48+a)),this.setTag(b,n,">"),this.setTag(b,t,"<"),this.setTag(b,w,"X")):b=null;f.or(p);r.andNot(f);g.or(r);g.andNot(p);k&&this.setStructure(p,d);return j?(this.setTag(h,p,String.fromCharCode(68+a)),String.valueOf(b)+u):""},$fz.isPrivate=
!0,$fz),"~N,~A,~N,J.constant.EnumStructure,~N,J.util.BS,J.util.BS,~A,~B,~B,J.util.JmolList,J.util.BS");c$.getBridges=$_M(c$,"getBridges",($fz=function(a,b,c,d,e,f,g,h,j){for(var k=a[0].model.getModelSet().atoms,l=null,m=new java.util.Hashtable,n=0;n<b.length;n++)if(Clazz.instanceOf(a[n],J.modelsetbio.AminoPolymer))for(var r=a[n],w=b[n].length-1,t=1;t<w;t++){var p=r.monomers[t].leadAtomIndex;if(!g.get(p))for(var u=n;u<b.length;u++)if(Clazz.instanceOf(a[u],J.modelsetbio.AminoPolymer))for(var s=n==u?
t+3:1;s<b[u].length-1;s++){var q=a[u],z=q.monomers[s].leadAtomIndex;if(!g.get(z)){if(null==(l=J.modelsetbio.AminoPolymer.getBridge(b,n,t,u,s,d,k[p],k[z],r,q,h,m,!1,f)))if(null!=(l=J.modelsetbio.AminoPolymer.getBridge(b,n,t,u,s,c,k[p],k[z],r,q,h,m,!0,f)))l.isAntiparallel=!0;else continue;J.util.Logger.debugging&&J.util.Logger.debug("Bridge found "+l);j[n].set(t);j[u].set(s);e.put(p+"-"+z,l)}}}},$fz.isPrivate=!0,$fz),"~A,~A,J.util.JmolList,J.util.JmolList,java.util.Map,java.util.Map,J.util.BS,J.util.JmolList,~A");
c$.getBridge=$_M(c$,"getBridge",($fz=function(a,b,c,d,e,f,g,h,j,k,l,m,n,r){var w=null,t=null,p=0,u=n?J.modelsetbio.AminoPolymer.sheetOffsets[1]:J.modelsetbio.AminoPolymer.sheetOffsets[0];return null!=(w=J.modelsetbio.AminoPolymer.isHbonded(c+u[0],e+u[1],b,d,a))&&null!=(t=J.modelsetbio.AminoPolymer.isHbonded(e+u[2],c+u[3],d,b,a))||null!=(w=J.modelsetbio.AminoPolymer.isHbonded(c+u[p=4],e+u[5],b,d,a))&&null!=(t=J.modelsetbio.AminoPolymer.isHbonded(e+u[6],c+u[7],d,b,a))?(a=new J.modelsetbio.APBridge(g,
h,r),f.addLast(a),null!=l&&(f=n?14336:6144,J.modelsetbio.AminoPolymer.addHbond(l,j.monomers[c+u[p]],k.monomers[e+u[++p]],w[2],f,m),J.modelsetbio.AminoPolymer.addHbond(l,k.monomers[e+u[++p]],j.monomers[c+u[++p]],t[2],f,m)),a):null},$fz.isPrivate=!0,$fz),"~A,~N,~N,~N,~N,J.util.JmolList,J.modelset.Atom,J.modelset.Atom,J.modelsetbio.AminoPolymer,J.modelsetbio.AminoPolymer,J.util.JmolList,java.util.Map,~B,java.util.Map");c$.addHbond=$_M(c$,"addHbond",($fz=function(a,b,c,d,e,f){b=b.getNitrogenAtom();c=
c.getCarbonylOxygenAtom();if(null!=f){var g=b.index+" "+c.index;if(f.containsKey(g))return;f.put(g,Boolean.TRUE)}a.addLast(new J.modelset.HBond(b,c,e,1,0,d/1E3))},$fz.isPrivate=!0,$fz),"J.util.JmolList,J.modelsetbio.Monomer,J.modelsetbio.Monomer,~N,~N,java.util.Map");c$.getSheetStructures=$_M(c$,"getSheetStructures",($fz=function(a,b,c,d,e,f,g,h,j){if(!(0==b.size()&&0==c.size())){J.modelsetbio.AminoPolymer.createLadders(b,d,e,!0);J.modelsetbio.AminoPolymer.createLadders(c,d,e,!1);b=new J.util.BS;
c=new J.util.BS;for(e=e.keySet().iterator();e.hasNext();)d=e.next(),d[0][0]==d[0][1]&&d[1][0]==d[1][1]?(c.set(d[0][0]),c.set(d[1][0])):(b.setBits(d[0][0],d[0][1]+1),b.setBits(d[1][0],d[1][1]+1));e=new J.util.BS;d=new J.util.BS;for(var k=a.length;0<=--k;)if(Clazz.instanceOf(a[k],J.modelsetbio.AminoPolymer)){e.clearAll();d.clearAll();for(var l=a[k],m=0;m<l.monomerCount;){var n=l.monomers[m].leadAtomIndex;if(b.get(n)){for(n=m+1;n<l.monomerCount&&b.get(l.monomers[n].leadAtomIndex);)n++;e.setBits(m,n);
m=n}else c.get(n)&&d.set(m),++m}h&&(l.setTag(f[k],d,"B"),l.setTag(f[k],e,"E"));j&&l.setStructure(e,J.constant.EnumStructure.SHEET);g[k].or(e);g[k].or(d)}}},$fz.isPrivate=!0,$fz),"~A,J.util.JmolList,J.util.JmolList,java.util.Map,java.util.Map,~A,~A,~B,~B");c$.createLadders=$_M(c$,"createLadders",($fz=function(a,b,c,d){for(var e=d?-1:1,f=a.size(),g=0;g<f;g++)J.modelsetbio.AminoPolymer.checkBridge(a.get(g),b,c,d,1,e);for(g=0;g<f;g++)J.modelsetbio.AminoPolymer.checkBulge(a.get(g),b,c,d,1)},$fz.isPrivate=
!0,$fz),"J.util.JmolList,java.util.Map,java.util.Map,~B");c$.checkBridge=$_M(c$,"checkBridge",($fz=function(a,b,c,d,e,f){b=b.get(a.a.getOffsetResidueAtom("0",e)+"-"+a.b.getOffsetResidueAtom("0",f));return null!=b&&a.addBridge(b,c)},$fz.isPrivate=!0,$fz),"J.modelsetbio.APBridge,java.util.Map,java.util.Map,~B,~N,~N");c$.checkBulge=$_M(c$,"checkBulge",($fz=function(a,b,c,d,e){for(var f=d?-1:1,g=0;3>g;g++)for(var h=0==g?1:0;6>h;h++)J.modelsetbio.AminoPolymer.checkBridge(a,b,c,d,g*e,h*f),h>g&&J.modelsetbio.AminoPolymer.checkBridge(a,
b,c,d,h*e,g*f)},$fz.isPrivate=!0,$fz),"J.modelsetbio.APBridge,java.util.Map,java.util.Map,~B,~N");$_M(c$,"setStructure",($fz=function(a,b){for(var c=a.nextSetBit(0);0<=c;c=a.nextSetBit(c+1)){var d=a.nextClearBit(c);0>d&&(d=this.monomerCount);this.addStructureProtected(b,null,0,0,c,d-1);c=d}},$fz.isPrivate=!0,$fz),"J.util.BS,J.constant.EnumStructure");c$.isHbonded=$_M(c$,"isHbonded",($fz=function(a,b,c,d,e){if(0>a||0>b)return null;c=e[c];e=e[d];return a>=c.length||b>=e.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},$fz.isPrivate=!0,$fz),"~N,~N,~N,~N,~A");$_M(c$,"setTag",($fz=function(a,b,c){for(var d=b.nextSetBit(0);0<=d;d=b.nextSetBit(d+1))a[d]=c},$fz.isPrivate=!0,$fz),"~A,J.util.BS,~S");$_M(c$,"dumpSummary",($fz=function(a){for(var b=this.monomers[0].getLeadAtom().getChainID(),b="\x00"==b?"":String.valueOf(b)+":",c=new J.util.SB,d="\x00",e="\x00",f="\x00",g=-1,h=-1,j=0;j<=this.monomerCount;j++){if(j==this.monomerCount||a[j]!=d){"\x00"!=d&&c.appendC("\n").appendC(d).append(" : ").append(b).appendI(g).append("\x00"==
e?"":String.valueOf(e)).append("_").append(b).appendI(h).append("\x00"==f?"":String.valueOf(f));if(j==this.monomerCount)break;d=a[j];g=this.monomers[j].getResno();e=this.monomers[j].getInsertionCode()}h=this.monomers[j].getResno();f=this.monomers[j].getInsertionCode()}return c.toString()},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"dumpTags",($fz=function(a,b,c){var d=this.monomers[0].getLeadAtom().getChainID()+"."+(this.bioPolymerIndexInModel+1);a=J.util.TextFormat.simpleReplace(a,"$",d);for(var e=this.monomers[0].getResno(),
f="\n"+d,d=new J.util.SB,g=(new J.util.SB).append(f+".8: "),h=(new J.util.SB).append(f+".7: "),j=(new J.util.SB).append(f+".6: "),f=(new J.util.SB).append(f+".0: "),k=0;k<this.monomerCount;k++)e=this.monomers[k].getResno(),g.append(0==e%100?""+Clazz.doubleToInt(e/100)%100:" "),h.append(0==e%10?""+Clazz.doubleToInt(e/10)%10:" "),j.appendI(e%10),f.appendC(b.get(this.monomers[k].leadAtomIndex)?"!":this.monomers[k].getGroup1());1==(c&1)&&d.appendSB(g).appendSB(h).appendSB(j);d.append("\n");d.append(a);
2==(c&2)&&(d.appendSB(f),d.append("\n\n"));return d.toString().$replace("\x00",".")},$fz.isPrivate=!0,$fz),"~S,J.util.BS,~N");Clazz.overrideMethod(c$,"calculateStructures",function(a){if(!a){null==this.structureList&&(this.structureList=this.model.getModelSet().getStructureList());a=Clazz.newCharArray(this.monomerCount,"\x00");for(var b=0;b<this.monomerCount-1;++b){var c=this.monomers[b],d=this.monomers[b+1],e=d.getGroupParameter(1112539143),f=c.getGroupParameter(1112539144);a[b]=this.isHelix(f,e)?
0>e&&25>f?"4":"3":this.isSheet(f,e)?"s":this.isTurn(f,e)?"t":"n";J.util.Logger.debugging&&J.util.Logger.debug(0+this.monomers[0].getChainID().charCodeAt(0)+" aminopolymer:"+b+" "+d.getGroupParameter(1112539143)+","+c.getGroupParameter(1112539144)+" "+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");$_M(c$,"isTurn",($fz=function(a,
b){return J.modelsetbio.AminoPolymer.checkPhiPsi(this.structureList.get(J.constant.EnumStructure.TURN),a,b)},$fz.isPrivate=!0,$fz),"~N,~N");$_M(c$,"isSheet",($fz=function(a,b){return J.modelsetbio.AminoPolymer.checkPhiPsi(this.structureList.get(J.constant.EnumStructure.SHEET),a,b)},$fz.isPrivate=!0,$fz),"~N,~N");$_M(c$,"isHelix",($fz=function(a,b){return J.modelsetbio.AminoPolymer.checkPhiPsi(this.structureList.get(J.constant.EnumStructure.HELIX),a,b)},$fz.isPrivate=!0,$fz),"~N,~N");c$.checkPhiPsi=
$_M(c$,"checkPhiPsi",($fz=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},$fz.isPrivate=!0,$fz),"~A,~N,~N");Clazz.overrideMethod(c$,"setStructureList",function(a){this.structureList=a},"java.util.Map");Clazz.defineStatics(c$,"maxHbondAlphaDistance",9,"maxHbondAlphaDistance2",81,"minimumHbondDistance2",0.25,"sheetOffsets",[[0,-1,1,0,1,0,0,-1],[0,0,0,0,1,-1,1,-1]])});Clazz.declarePackage("J.modelsetbio");
Clazz.load(null,"J.modelsetbio.APBridge",["java.lang.Boolean","J.util.Escape"],function(){c$=Clazz.decorateAsClass(function(){this.ladder=this.b=this.a=null;this.isAntiparallel=!1;Clazz.instantialize(this,arguments)},J.modelsetbio,"APBridge");Clazz.makeConstructor(c$,function(a,b,c){this.a=a;this.b=b;this.ladder=Clazz.newIntArray(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");
$_M(c$,"addLadder",($fz=function(a){a.put(this.ladder,this.isAntiparallel?Boolean.TRUE:Boolean.FALSE)},$fz.isPrivate=!0,$fz),"java.util.Map");Clazz.overrideMethod(c$,"toString",function(){return(this.isAntiparallel?"a ":"p ")+this.a+" - "+this.b+"\t"+J.util.Escape.e(this.ladder)});$_M(c$,"addBridge",function(a,b){if(null==a||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.modelsetbio.APBridge,java.util.Map");$_M(c$,"canAdd",($fz=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]},$fz.isPrivate=!0,$fz),"J.modelsetbio.APBridge");$_M(c$,"extendLadder",($fz=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)},$fz.isPrivate=!0,$fz),"~N,~N")});Clazz.declarePackage("J.modelsetbio");
Clazz.load(["J.modelset.Model"],"J.modelsetbio.BioModel","java.lang.Character $.Float java.util.Hashtable J.constant.EnumStructure J.modelsetbio.Resolver J.util.ArrayUtil $.BS $.BSUtil $.Escape $.JmolList $.SB $.TextFormat J.viewer.Viewer".split(" "),function(){c$=Clazz.decorateAsClass(function(){this.bioPolymerCount=0;this.bioPolymers=null;Clazz.instantialize(this,arguments)},J.modelsetbio,"BioModel",J.modelset.Model);Clazz.makeConstructor(c$,function(a,b,c,d,e,f){Clazz.superConstructor(this,J.modelsetbio.BioModel,
[a,b,c,d,e,f]);this.isBioModel=!0;this.clearBioPolymers()},"J.modelset.ModelSet,~N,~N,~S,java.util.Properties,java.util.Map");$_M(c$,"freeze",function(){Clazz.superCall(this,J.modelsetbio.BioModel,"freeze",[]);this.bioPolymers=J.util.ArrayUtil.arrayCopyObject(this.bioPolymers,this.bioPolymerCount)});Clazz.overrideMethod(c$,"addSecondaryStructure",function(a,b,c,d,e,f,g,h,j,k,l){for(var m=this.bioPolymerCount;0<=--m;)this.bioPolymers[m].addStructure(a,b,c,d,e,f,g,h,j,k,l)},"J.constant.EnumStructure,~S,~N,~N,~S,~N,~S,~N,~N,~N,J.util.BS");
Clazz.overrideMethod(c$,"calculateStructures",function(a,b,c,d,e){if(0==this.bioPolymerCount||!d&&!a)return"";this.modelSet.proteinStructureTainted=this.structureTainted=!0;if(d)for(var f=this.bioPolymerCount;0<=--f;)(!a||null!=this.bioPolymers[f].getGroups()[0].getNitrogenAtom())&&this.bioPolymers[f].clearStructures();if(!a||e)for(f=this.bioPolymerCount;0<=--f;)this.bioPolymers[f].calculateStructures(e);return a?this.bioPolymers[0].calculateDssp(this.bioPolymers,this.bioPolymerCount,null,b,c,d):
""},"~B,~B,~B,~B,~B");Clazz.overrideMethod(c$,"setConformation",function(a){if(0<this.nAltLocs)for(var b=this.bioPolymerCount;0<=--b;)this.bioPolymers[b].setConformation(a)},"J.util.BS");Clazz.overrideMethod(c$,"getPdbConformation",function(a,b){if(0<this.nAltLocs)for(var c=this.bioPolymerCount;0<=--c;)this.bioPolymers[c].getConformation(a,b);return!0},"J.util.BS,~N");Clazz.overrideMethod(c$,"getBioPolymerCount",function(){return this.bioPolymerCount});Clazz.overrideMethod(c$,"calcSelectedMonomersCount",
function(a){for(var b=this.bioPolymerCount;0<=--b;)this.bioPolymers[b].calcSelectedMonomersCount(a)},"J.util.BS");$_M(c$,"getBioPolymer",function(a){return this.bioPolymers[a]},"~N");Clazz.overrideMethod(c$,"getDefaultLargePDBRendering",function(a,b){var c=new J.util.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 e=new J.util.BS;if(c===this.bsAtoms)e=c;else for(d=0;d<this.bioPolymerCount;d++)0==
this.bioPolymers[d].getType()&&this.bioPolymers[d].getRange(e);0<=e.nextSetBit(0)&&a.append("select ").append(J.util.Escape.eBS(e)).append(";backbone only;");this.atomCount<=b||(a.append("select ").append(J.util.Escape.eBS(c)).append(" & connected; wireframe only;"),c!==this.bsAtoms&&(e.clearAll(),e.or(this.bsAtoms),e.andNot(c),0<=e.nextSetBit(0)&&a.append("select "+J.util.Escape.eBS(e)+" & !connected;stars 0.5;")))}},"J.util.SB,~N");$_M(c$,"fixIndices",function(a,b,c){Clazz.superCall(this,J.modelsetbio.BioModel,
"fixIndices",[a,b,c]);for(a=0;a<this.bioPolymerCount;a++)this.bioPolymers[a].recalculateLeadMidpointsAndWingVectors()},"~N,~N,J.util.BS");Clazz.overrideMethod(c$,"calculateStruts",function(a,b,c){var d=new J.util.JmolList,e=null,f;b.equals(c)?f=b:(f=J.util.BSUtil.copy(b),f.or(c));var g=a.atoms,h=a.viewer;f.and(h.getModelUndeletedAtomsBitSet(this.modelIndex));for(var j=f.nextSetBit(0);0<=j;j=f.nextSetBit(j+1))g[j].isVisible(0)&&(2==g[j].atomID&&5!=g[j].getGroupID())&&d.addLast(e=g[j]);if(0==d.size())return 0;
j=h.getFloat(570425408);f=Clazz.floatToShort(2E3*h.getFloat(570425406));g=h.getInt(553648184);h=h.getBoolean(603979955);b=this.getBioPolymer(e.getPolymerIndexInModel()).calculateStruts(a,b,c,d,j,g,h);for(j=0;j<b.size();j++)c=b.get(j),a.bondAtoms(c[0],c[1],32768,f,null,0,!1,!0);return b.size()},"J.modelset.ModelSet,J.util.BS,J.util.BS");Clazz.overrideMethod(c$,"setStructureList",function(a){this.bioPolymers=J.util.ArrayUtil.arrayCopyObject(this.bioPolymers,this.bioPolymerCount);for(var b=this.bioPolymerCount;0<=
--b;)this.bioPolymers[b].setStructureList(a)},"java.util.Map");Clazz.overrideMethod(c$,"calculateStraightness",function(a,b,c,d){for(var e=0;e<this.bioPolymerCount;e++)this.bioPolymers[e].getPdbData(a,b,c,d,2,null,null,!1,!1,!1,null,null,null,new J.util.BS)},"J.viewer.Viewer,~S,~S,~N");Clazz.overrideMethod(c$,"getPolymerPointsAndVectors",function(a,b,c,d){for(var e=2147483646,f=0;f<this.bioPolymerCount;f++)e=this.bioPolymers[f].getPolymerPointsAndVectors(e,a,b,c,d)},"J.util.BS,J.util.JmolList,~B,~N");
Clazz.overrideMethod(c$,"getPolymerLeadMidPoints",function(a){return this.bioPolymers[a].getLeadMidpoints()},"~N");Clazz.overrideMethod(c$,"recalculateLeadMidpointsAndWingVectors",function(){for(var a=0;a<this.bioPolymerCount;a++)this.bioPolymers[a].recalculateLeadMidpointsAndWingVectors()});Clazz.overrideMethod(c$,"getBioBranches",function(a){for(var b,c=0;c<this.bioPolymerCount;c++)b=new J.util.BS,this.bioPolymers[c].getRange(b),0<=b.nextSetBit(0)&&(null==a&&(a=new J.util.JmolList),a.addLast(b));
return a},"J.util.JmolList");Clazz.overrideMethod(c$,"getGroupsWithin",function(a,b,c){for(var d=this.bioPolymerCount;0<=--d;)this.bioPolymers[d].getRangeGroups(a,b,c)},"~N,J.util.BS,J.util.BS");Clazz.overrideMethod(c$,"getSequenceBits",function(a,b,c){for(var d=a.length,e=0;e<this.bioPolymerCount;e++)for(var f=this.bioPolymers[e].getSequence(),g=-1;0<=(g=f.indexOf(a,++g));)this.bioPolymers[e].getPolymerSequenceAtoms(g,d,b,c)},"~S,J.util.BS,J.util.BS");Clazz.overrideMethod(c$,"selectSeqcodeRange",
function(a,b,c,d,e){for(var f,g=this.chainCount;0<=--g;)if(c==(f=this.chains[g].chainID)||"\t"==c||!e&&c==Character.toUpperCase(f))for(var h=0;0<=h;)h=this.chains[g].selectSeqcodeRange(h,a,b,d)},"~N,~N,~S,J.util.BS,~B");Clazz.overrideMethod(c$,"getRasmolHydrogenBonds",function(a,b,c,d,e,f,g){var h=null==c;h&&(c=new J.util.JmolList);0>e&&(e=2147483647);var j,k;if(null==b&&0<this.bioPolymerCount)this.bioPolymers[0].calculateDssp(this.bioPolymers,this.bioPolymerCount,c,!1,f,!1);else for(f=this.bioPolymerCount;0<=
--f;){j=this.bioPolymers[f];var l=j.getType();if(!((d||1!=l)&&2!=l)){var m=j.isRna();1==l&&j.calcRasmolHydrogenBonds(null,a,b,c,e,null,!0,!1);for(var n=this.bioPolymerCount;0<=--n;)null!=(k=this.bioPolymers[n])&&((m||f!=n)&&l==k.getType())&&k.calcRasmolHydrogenBonds(j,a,b,c,e,null,!0,!1)}}if(0!=c.size()&&h){this.hasRasmolHBonds=!0;for(f=0;f<c.size();f++)a=c.get(f),b=a.getAtom1(),d=a.getAtom2(),b.isBonded(d)||(a=this.modelSet.addHBond(b,d,a.order,a.getEnergy()),null!=g&&g.set(a))}},"J.util.BS,J.util.BS,J.util.JmolList,~B,~N,~B,J.util.BS");
Clazz.overrideMethod(c$,"clearRasmolHydrogenBonds",function(a){var b=new J.util.BS;this.hasRasmolHBonds=!1;for(var c=this.modelSet.models,d=this.modelSet.bonds,e=this.modelSet.bondCount;0<=--e;){var f=d[e],g=f.getAtom1(),h=c[g.modelIndex];if(h.isBioModel&&!(h.trajectoryBaseIndex!=this.modelIndex||0==(f.order&28672)))null!=a&&!a.get(g.index)?this.hasRasmolHBonds=!0:b.set(e)}0<=b.nextSetBit(0)&&this.modelSet.deleteBonds(b,!1)},"J.util.BS");Clazz.overrideMethod(c$,"calculatePolymers",function(a,b,c,
d,e){null==a&&(a=this.modelSet.getGroups(),b=a.length);if(null!=d)for(var f=0;f<b;++f){var g=a[f];Clazz.instanceOf(g,J.modelsetbio.Monomer)&&null!=g.getBioPolymer()&&!d.get(g.getModelIndex())&&g.setBioPolymer(null,-1)}for(f=c;f<b;++f)d=a[f],c=d.getModel(),c.isBioModel&&Clazz.instanceOf(d,J.modelsetbio.Monomer)&&(g=e&&!this.modelSet.isJmolDataFrameForModel(this.modelSet.atoms[d.firstAtomIndex].modelIndex),d=null==d.getBioPolymer()?J.modelsetbio.Resolver.allocateBioPolymer(a,f,g):null,null==d||0==d.monomerCount||
(c.addBioPolymer(d),f+=d.monomerCount-1))},"~A,~N,~N,J.util.BS,~B");$_M(c$,"addBioPolymer",($fz=function(a){0==this.bioPolymers.length&&this.clearBioPolymers();this.bioPolymerCount==this.bioPolymers.length&&(this.bioPolymers=J.util.ArrayUtil.doubleLength(this.bioPolymers));a.bioPolymerIndexInModel=this.bioPolymerCount;this.bioPolymers[this.bioPolymerCount++]=a},$fz.isPrivate=!0,$fz),"J.modelsetbio.BioPolymer");Clazz.overrideMethod(c$,"clearBioPolymers",function(){this.bioPolymers=Array(8);this.bioPolymerCount=
0});Clazz.overrideMethod(c$,"getAllPolymerInfo",function(a,b,c){b=new java.util.Hashtable;for(var d=new J.util.JmolList,e=0;e<this.bioPolymerCount;e++){var f=this.bioPolymers[e].getPolymerInfo(a);f.isEmpty()||d.addLast(f)}0<d.size()&&(b.put("modelIndex",Integer.$valueOf(this.modelIndex)),b.put("polymers",d),c.addLast(b))},"J.util.BS,java.util.Map,J.util.JmolList");$_M(c$,"getChimeInfo",function(a,b){var c=0,d=this.modelSet.models,e=this.modelSet.modelCount,f=this.modelSet.getAtomCount(),g=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=e;0<=--h;)c+=d[h].getChainCount(!1);a.append("\nNumber of Chains .... "+c);c=0;for(h=e;0<=--h;)c+=d[h].getGroupCountHetero(!1);b=0;for(h=e;0<=--h;)b+=d[h].getGroupCountHetero(!0);a.append("\nNumber of Groups .... "+c);0<b&&a.append(" ("+b+")");for(h=f;0<=--h;)g[h].isHetero()&&b++;Clazz.superCall(this,
J.modelsetbio.BioModel,"getChimeInfo",[a,b]);for(var e=d=c=0,j,k=-1,h=0;h<f&&0==g[h].modelIndex;h++)if((j=g[h].getStrucNo())!=k&&0!=j)switch(k=j,g[h].getProteinStructureType()){case J.constant.EnumStructure.HELIX:c++;break;case J.constant.EnumStructure.SHEET:d++;break;case J.constant.EnumStructure.TURN:e++}a.append("\nNumber of Helices ... "+c);a.append("\nNumber of Strands ... "+d);a.append("\nNumber of Turns ..... "+e)},"J.util.SB,~N");Clazz.overrideMethod(c$,"getProteinStructureState",function(a,
b,c,d){var e=3==d,f=1==d;d=0==d;var g=null,h=new J.util.SB,j=new J.util.SB,k=new J.util.SB,l=new J.util.SB,m=J.constant.EnumStructure.NONE,n=J.constant.EnumStructure.NONE,r=0,w=0,t=-1,p=-1,u=0,s=0,q="",z="",A="",v="",D="",H=0,C=0,M=0,O=0,K=null,r=this.modelSet.models,B=this.modelSet.atoms,E=this.modelSet.getAtomCount();if(b){if(!this.modelSet.proteinStructureTainted)return"";for(var K=new J.util.BS,x=this.firstAtomIndex;x<E;x++)r[B[x].modelIndex].isStructureTainted()&&K.set(x);K.set(E)}for(x=0;x<=
E;x++)if((x==E||null==a||a.get(x))&&(!b||K.get(x))){r=0;if(x==E||(r=B[x].getStrucNo())!=p){if(null!=g){switch(m){case J.constant.EnumStructure.HELIX:case J.constant.EnumStructure.TURN:case J.constant.EnumStructure.SHEET:if(H++,d){var y=B[w].modelIndex,I="    \t# model="+this.modelSet.getModelNumberDotted(y);t!=y&&(t=y,h.append("  structure none ").append(J.util.Escape.eBS(this.modelSet.getModelAtomBitSetIncludingDeleted(y,!1))).append(I).append(";\n"));I+=" & ("+u+" - "+s+")";y=n.getBioStructureTypeName(!1);
h.append("  structure ").append(y).append(" ").append(J.util.Escape.eBS(g)).append(I).append(";\n")}else{switch(m){case J.constant.EnumStructure.HELIX:g=++C;if(null==q||f)q=J.util.TextFormat.formatStringI("%3N %3N","N",g);g="HELIX  %ID %3GROUPA %1CA %4RESA  %3GROUPB %1CB %4RESB";I=k;y=null;switch(n){case J.constant.EnumStructure.HELIX:case J.constant.EnumStructure.HELIXALPHA:y="  1";break;case J.constant.EnumStructure.HELIX310:y="  5";break;case J.constant.EnumStructure.HELIXPI:y="  3"}null!=y&&(g+=
y);break;case J.constant.EnumStructure.SHEET:g=++O;if(null==q||f)q=J.util.TextFormat.formatStringI("%3N %3A 0","N",g),q=J.util.TextFormat.formatStringS(q,"A","S"+g);g="SHEET  %ID %3GROUPA %1CA%4RESA  %3GROUPB %1CB%4RESB";I=l;break;default:g=++M;if(null==q||f)q=J.util.TextFormat.formatStringI("%3N %3N","N",g);g="TURN   %ID %3GROUPA %1CA%4RESA  %3GROUPB %1CB%4RESB";I=j}g=J.util.TextFormat.formatStringS(g,"ID",q);g=J.util.TextFormat.formatStringS(g,"GROUPA",z);g=J.util.TextFormat.formatStringS(g,"CA",
v);g=J.util.TextFormat.formatStringI(g,"RESA",u);g=J.util.TextFormat.formatStringS(g,"GROUPB",A);g=J.util.TextFormat.formatStringS(g,"CB",D);g=J.util.TextFormat.formatStringI(g,"RESB",s);I.append(g);e&&I.append(" strucno= ").appendI(p);I.append("\n")}}g=null}if(0==r||null!=a&&c&&(Float.isNaN(B[x].getGroupParameter(1112539143))||Float.isNaN(B[x].getGroupParameter(1112539144))))continue}w=B[x].getChainID();0==w.charCodeAt(0)&&(w=" ");null==g&&(g=new J.util.BS,u=B[x].getResno(),z=B[x].getGroup3(!1),
v=""+w);m=B[x].getProteinStructureType();n=B[x].getProteinStructureSubType();q=B[x].getProteinStructureTag();g.set(x);p=r;s=B[x].getResno();A=B[x].getGroup3(!1);D=""+w;w=x}0<H&&h.append("\n");return d?h.toString():k.appendSB(l).appendSB(j).appendSB(h).toString()},"J.util.BS,~B,~B,~N");Clazz.overrideMethod(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});Clazz.overrideMethod(c$,"getPdbData",function(a,b,c,d,e,f,g,h,j){var k=!1,l="R"!=c?"r":13<b.length&&0<=b.indexOf("ramachandran ")?b.charAt(13):"R";"r"==l&&(l=a.getQuaternionFrame());var m=a.getInt(553648146),
n=0>b.indexOf("diff")?0:0>b.indexOf("2")?1:2;d||(f.append("REMARK   6 Jmol PDB-encoded data: "+b+";"),"R"!=c&&(f.append('  quaternionFrame = "'+l+'"'),k=!0),f.append("\nREMARK   6 Jmol Version ").append(J.viewer.Viewer.getJmolVersion()).append("\n"),"R"==c?f.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"):f.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,l,m,n,this.bsAtoms,e,k,d,0==b,g,f,h,j)},"J.viewer.Viewer,~S,~S,~B,J.util.BS,J.io.OutputStringBuilder,~A,J.util.SB,J.util.BS");Clazz.defineStatics(c$,"pdbRecords",["ATOM  ","MODEL ","HETATM"])});Clazz.declarePackage("J.modelsetbio");
Clazz.load(["J.modelsetbio.Monomer"],"J.modelsetbio.CarbohydrateMonomer",["J.constant.EnumStructure"],function(){c$=Clazz.declareType(J.modelsetbio,"CarbohydrateMonomer",J.modelsetbio.Monomer);Clazz.overrideConstructor(c$,($fz=function(){},$fz.isPrivate=!0,$fz));c$.validateAndAllocate=$_M(c$,"validateAndAllocate",function(a,b,c,d,e){return(new J.modelsetbio.CarbohydrateMonomer).set2(a,b,c,d,e,J.modelsetbio.CarbohydrateMonomer.alphaOffsets)},"J.modelset.Chain,~S,~N,~N,~N");Clazz.overrideMethod(c$,
"isCarbohydrate",function(){return!0});Clazz.overrideMethod(c$,"getProteinStructureType",function(){return J.constant.EnumStructure.CARBOHYDRATE});Clazz.overrideMethod(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),e=this.chain.getAtom(c);if(14==d.getElementNumber()+e.getElementNumber()&&3.24>d.distanceSquared(e))return!0}return!1},"J.modelsetbio.Monomer");
Clazz.overrideMethod(c$,"findNearestAtomIndex",function(a,b,c,d){var e=c[0],f=this.getLeadAtom();d=Clazz.doubleToInt(d/2);1200>d&&(d=1200);0!=f.screenZ&&(d=Clazz.floatToInt(this.scaleToScreen(f.screenZ,d)),4>d&&(d=4),this.isCursorOnTopOf(f,a,b,d,e)&&(c[0]=f))},"~N,~N,~A,~N,~N");Clazz.overrideMethod(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});Clazz.defineStatics(c$,"alphaOffsets",
[0])});Clazz.declarePackage("J.modelsetbio");Clazz.load(["J.modelsetbio.BioPolymer"],"J.modelsetbio.CarbohydratePolymer",null,function(){c$=Clazz.declareType(J.modelsetbio,"CarbohydratePolymer",J.modelsetbio.BioPolymer);Clazz.makeConstructor(c$,function(a){Clazz.superConstructor(this,J.modelsetbio.CarbohydratePolymer,[a]);this.type=3},"~A")});Clazz.declarePackage("J.modelsetbio");
Clazz.load(["J.modelsetbio.Monomer"],"J.modelsetbio.PhosphorusMonomer",["J.constant.EnumStructure","J.util.Quaternion","$.V3"],function(){c$=Clazz.decorateAsClass(function(){this.$isPyrimidine=this.$isPurine=!1;Clazz.instantialize(this,arguments)},J.modelsetbio,"PhosphorusMonomer",J.modelsetbio.Monomer);Clazz.overrideMethod(c$,"isNucleic",function(){return!0});Clazz.overrideConstructor(c$,function(){});c$.validateAndAllocateP=$_M(c$,"validateAndAllocateP",function(a,b,c,d,e,f){return d!=e||f[13]!=
d?null:(new J.modelsetbio.PhosphorusMonomer).set3(a,b,c,d,e,J.modelsetbio.PhosphorusMonomer.phosphorusOffsets)},"J.modelset.Chain,~S,~N,~N,~N,~A");$_M(c$,"set3",function(a,b,c,d,e,f){this.set2(a,b,c,d,e,f);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");$_M(c$,"getP",function(){return this.getAtomFromOffsetIndex(0)});
$_M(c$,"isPhosphorusMonomer",function(){return!0});Clazz.overrideMethod(c$,"isDna",function(){return this.chain.isDna});Clazz.overrideMethod(c$,"isRna",function(){return this.chain.isRna});Clazz.overrideMethod(c$,"isPurine",function(){return this.$isPurine});Clazz.overrideMethod(c$,"isPyrimidine",function(){return this.$isPyrimidine});Clazz.overrideMethod(c$,"getStructure",function(){return this.chain});Clazz.overrideMethod(c$,"getProteinStructureType",function(){return J.constant.EnumStructure.NONE});
Clazz.overrideMethod(c$,"isConnectedAfter",function(a){return this.isCA2(a)},"J.modelsetbio.Monomer");$_M(c$,"isCA2",function(a){return null==a?!0:this.getLeadAtom().distance(a.getLeadAtom())<=J.modelsetbio.PhosphorusMonomer.MAX_ADJACENT_PHOSPHORUS_DISTANCE},"J.modelsetbio.Monomer");Clazz.overrideMethod(c$,"getQuaternion",function(){return this.getQuaternionP()},"~S");$_M(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 J.util.V3,e=new J.util.V3;d.sub2(c,b);e.sub2(a,b);return J.util.Quaternion.getQuaternionFrameV(d,e,null,!1)});Clazz.overrideMethod(c$,"getQuaternionFrameCenter",function(){return this.getAtomFromOffsetIndex(0)},"~S");Clazz.overrideMethod(c$,"getHelixData",function(a,b,c){return this.getHelixData2(a,b,c)},"~N,~S,~N");Clazz.defineStatics(c$,
"P",0,"phosphorusOffsets",[0],"MAX_ADJACENT_PHOSPHORUS_DISTANCE",8)});Clazz.declarePackage("J.modelsetbio");
Clazz.load(["J.modelsetbio.PhosphorusMonomer","J.viewer.JC"],"J.modelsetbio.NucleicMonomer",["J.constant.EnumStructure","J.util.P3","$.Quaternion","$.V3"],function(){c$=Clazz.decorateAsClass(function(){this.hasRnaO2Prime=!1;this.baseCenter=null;Clazz.instantialize(this,arguments)},J.modelsetbio,"NucleicMonomer",J.modelsetbio.PhosphorusMonomer);Clazz.overrideConstructor(c$,($fz=function(){},$fz.isPrivate=!0,$fz));c$.validateAndAllocate=$_M(c$,"validateAndAllocate",function(a,b,c,d,e,f){var g=J.modelsetbio.Monomer.scanForOffsets(d,
f,J.modelsetbio.NucleicMonomer.interestingNucleicAtomIDs);if(null==g||!J.modelsetbio.Monomer.checkOptional(g,19,d,f[73]))return null;J.modelsetbio.Monomer.checkOptional(g,20,d,f[89]);J.modelsetbio.Monomer.checkOptional(g,18,d,f[90]);J.modelsetbio.Monomer.checkOptional(g,23,d,f[75]);J.modelsetbio.Monomer.checkOptional(g,24,d,f[77]);return(new J.modelsetbio.NucleicMonomer).set4(a,b,c,d,e,g)},"J.modelset.Chain,~S,~N,~N,~N,~A");$_M(c$,"set4",($fz=function(a,b,c,d,e,f){this.set3(a,b,c,d,e,f);J.modelsetbio.Monomer.have(f,
15)||(f[0]=f[19],a=f[0]&255,255!=a&&(this.leadAtomIndex=d+a));this.hasRnaO2Prime=J.modelsetbio.Monomer.have(f,2);this.$isPyrimidine=J.modelsetbio.Monomer.have(f,8);this.$isPurine=J.modelsetbio.Monomer.have(f,9)&&J.modelsetbio.Monomer.have(f,10)&&J.modelsetbio.Monomer.have(f,11);return this},$fz.isPrivate=!0,$fz),"J.modelset.Chain,~S,~N,~N,~N,~A");$_M(c$,"isNucleicMonomer",function(){return!0});Clazz.overrideMethod(c$,"isDna",function(){return!this.hasRnaO2Prime});Clazz.overrideMethod(c$,"isRna",function(){return this.hasRnaO2Prime});
Clazz.overrideMethod(c$,"isPurine",function(){return this.$isPurine});Clazz.overrideMethod(c$,"isPyrimidine",function(){return this.$isPyrimidine});$_M(c$,"isGuanine",function(){return J.modelsetbio.Monomer.have(this.offsets,17)});Clazz.overrideMethod(c$,"getProteinStructureType",function(){return this.hasRnaO2Prime?J.constant.EnumStructure.RNA:J.constant.EnumStructure.DNA});$_M(c$,"getC1P",function(){return this.getAtomFromOffsetIndex(25)});$_M(c$,"getC2",function(){return this.getAtomFromOffsetIndex(5)});
$_M(c$,"getC4P",function(){return this.getAtomFromOffsetIndex(26)});$_M(c$,"getN1",function(){return this.getAtomFromOffsetIndex(4)});$_M(c$,"getN3",function(){return this.getAtomFromOffsetIndex(6)});$_M(c$,"getN2",function(){return this.getAtomFromOffsetIndex(17)});$_M(c$,"getN4",function(){return this.getAtomFromOffsetIndex(14)});$_M(c$,"getN6",function(){return this.getAtomFromOffsetIndex(16)});$_M(c$,"getO2",function(){return this.getAtomFromOffsetIndex(8)});$_M(c$,"getO4",function(){return this.getAtomFromOffsetIndex(12)});
$_M(c$,"getO6",function(){return this.getAtomFromOffsetIndex(13)});Clazz.overrideMethod(c$,"getTerminatorAtom",function(){return this.getAtomFromOffsetIndex(J.modelsetbio.Monomer.have(this.offsets,20)?20:21)});$_M(c$,"getBaseRing6Points",function(a){for(var b=6;0<=--b;)a[b]=this.getAtomFromOffsetIndex(J.modelsetbio.NucleicMonomer.ring6OffsetIndexes[b])},"~A");$_M(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");Clazz.overrideMethod(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");Clazz.overrideMethod(c$,"findNearestAtomIndex",function(a,b,c,d){var e=c[0],f=this.getLeadAtom(),g=this.getAtomFromOffsetIndex(19),h=this.getAtomFromOffsetIndex(22);d=Clazz.doubleToInt(d/2);1900>d&&(d=1900);d=Clazz.floatToInt(this.scaleToScreen(f.screenZ,d));
4>d&&(d=4);if(this.isCursorOnTopOf(f,a,b,d,e)||this.isCursorOnTopOf(g,a,b,d,e)||this.isCursorOnTopOf(h,a,b,d,e))c[0]=f},"~N,~N,~A,~N,~N");$_M(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)}});$_M(c$,"getN0",function(){return this.getAtomFromOffsetIndex(this.$isPurine?11:4)});Clazz.overrideMethod(c$,"getHelixData",function(a,b,c){return this.getHelixData2(a,b,c)},"~N,~S,~N");Clazz.overrideMethod(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 J.util.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");Clazz.overrideMethod(c$,"getQuaternion",function(a){var b=null,c=null,d=!1,e=!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;e=d=!0;b=this.getAtomFromOffsetIndex(5);c=this.getAtomFromOffsetIndex(25);break;case "p":a=this.getP();if(null==a)return null;var f=this.getAtomFromOffsetIndex(23),g=this.getAtomFromOffsetIndex(24),h=a.getBonds();if(null==h)return null;for(var j=a.getGroup(),k=0;k<h.length;k++){var l=h[k].getOtherAtom(a);null!=
f&&l.index==f.index||null!=g&&l.index==g.index||(l.getGroup()===j?c=l:b=l)}break;case "q":return null;default:a=this.getN0();if(null==a)return null;this.$isPurine?(b=this.getAtomFromOffsetIndex(5),c=this.getAtomFromOffsetIndex(9)):(b=this.getAtomFromOffsetIndex(6),c=this.getAtomFromOffsetIndex(1))}if(null==b||null==c)return null;b=J.util.V3.newV(b);b.sub(a);c=J.util.V3.newV(c);c.sub(a);e&&c.scale(-1);return J.util.Quaternion.getQuaternionFrameV(b,c,null,d)},"~S");Clazz.overrideMethod(c$,"isCrossLinked",
function(a){if(!Clazz.instanceOf(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");Clazz.overrideMethod(c$,"getCrossLinkLead",function(a){var b=this.$isPurine?this.getN1():this.getN3(),c=b.getBonds();if(null==c)return!1;for(var d=!1,e=0;e<c.length;e++)if(c[e].isHydrogen()){var f=c[e].getOtherAtom(b),g=f.getGroup();if(Clazz.instanceOf(g,J.modelsetbio.NucleicMonomer)&&
(this.$isPurine?g.getN3():g.getN1())===f){if(null==a)return!0;a.addLast(Integer.$valueOf(g.leadAtomIndex));d=!0}}return d},"J.util.JmolList");$_M(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");Clazz.defineStatics(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)});Clazz.declarePackage("J.modelsetbio");
Clazz.load(["J.modelsetbio.BioPolymer"],"J.modelsetbio.NucleicPolymer",["J.modelset.HBond","J.util.Measure","$.P4","$.V3"],function(){c$=Clazz.declareType(J.modelsetbio,"NucleicPolymer",J.modelsetbio.BioPolymer);Clazz.makeConstructor(c$,function(a){Clazz.superConstructor(this,J.modelsetbio.NucleicPolymer,[a]);this.type=2;this.hasWingPoints=!0},"~A");$_M(c$,"getNucleicPhosphorusAtom",function(a){return this.monomers[a].getLeadAtom()},"~N");Clazz.overrideMethod(c$,"calcEtaThetaAngles",function(){for(var a=
NaN,b=0;b<this.monomerCount-2;++b){var c=this.monomers[b],d=this.monomers[b+1],e=c.getP(),f=c.getC4P(),g=d.getP(),d=d.getC4P();0<b&&(a=this.monomers[b-1].getC4P(),a=J.util.Measure.computeTorsion(a,e,f,g,!0));e=J.util.Measure.computeTorsion(e,f,g,d,!0);0>a&&(a+=360);0>e&&(e+=360);c.setGroupParameter(1112539140,a);c.setGroupParameter(1112539150,e)}return!0});Clazz.overrideMethod(c$,"calcRasmolHydrogenBonds",function(a,b,c,d,e){for(var f=new J.util.V3,g=new J.util.V3,h=new J.util.V3,j=this.monomerCount;0<=
--j;){var k=this.monomers[j];if(k.isPurine()){var l=k.getN3(),m=b.get(l.index);if(m||c.get(l.index)){var n=k.getN1(),r=k.getN0(),w=new J.util.P4;J.util.Measure.getPlaneThroughPoints(l,n,r,f,g,h,w);for(var l=null,t=25,p=null,u=a.monomerCount;0<=--u;){var s=a.monomers[u];if(s.isPyrimidine()){var q=s.getN3();if(!(m?!c.get(q.index):!b.get(q.index))){var z=s.getN0(),A=n.distanceSquared(q);A<t&&(50<r.distanceSquared(z)&&1>Math.abs(J.util.Measure.distanceToPlane(w,q)))&&(p=s,l=q,t=A)}}}m=0;null!=l&&(m+=
J.modelsetbio.NucleicPolymer.addHydrogenBond(d,n,l),m>=e||(k.isGuanine()?(m+=J.modelsetbio.NucleicPolymer.addHydrogenBond(d,k.getN2(),p.getO2()),m>=e||J.modelsetbio.NucleicPolymer.addHydrogenBond(d,k.getO6(),p.getN4())):J.modelsetbio.NucleicPolymer.addHydrogenBond(d,k.getN6(),p.getO4())))}}}},"J.modelsetbio.BioPolymer,J.util.BS,J.util.BS,J.util.JmolList,~N,~A,~B,~B");c$.addHydrogenBond=$_M(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},"J.util.JmolList,J.modelset.Atom,J.modelset.Atom");$_M(c$,"getPdbData",function(a,b,c,d,e,f,g,h,j,k,l,m,n,r){J.modelsetbio.BioPolymer.getPdbData(a,this,b,c,d,e,f,g,h,j,k,l,m,n,r)},"J.viewer.Viewer,~S,~S,~N,~N,J.util.BS,J.util.BS,~B,~B,~B,~A,J.io.OutputStringBuilder,J.util.SB,J.util.BS")});Clazz.declarePackage("J.modelsetbio");
Clazz.load(["J.modelsetbio.BioPolymer"],"J.modelsetbio.PhosphorusPolymer",null,function(){c$=Clazz.declareType(J.modelsetbio,"PhosphorusPolymer",J.modelsetbio.BioPolymer);$_M(c$,"getPdbData",function(a,b,c,d,e,f,g,h,j,k,l,m,n,r){J.modelsetbio.BioPolymer.getPdbData(a,this,b,c,d,e,f,g,h,j,k,l,m,n,r)},"J.viewer.Viewer,~S,~S,~N,~N,J.util.BS,J.util.BS,~B,~B,~B,~A,J.io.OutputStringBuilder,J.util.SB,J.util.BS")});Clazz.declarePackage("J.shapebio");
Clazz.load(["J.shape.AtomShape","J.modelset.Atom","J.modelsetbio.NucleicMonomer","J.viewer.JC"],"J.shapebio.BioShape","java.lang.Float J.constant.EnumPalette $.EnumStructure J.util.ArrayUtil $.BS $.C $.Logger".split(" "),function(){c$=Clazz.decorateAsClass(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;Clazz.instantialize(this,arguments)},J.shapebio,"BioShape",J.shape.AtomShape);Clazz.overrideMethod(c$,"setProperty",function(a,b,c){this.setPropAS(a,b,c)},"~S,~O,J.util.BS");Clazz.overrideMethod(c$,"getMonomers",function(){return this.monomers});Clazz.makeConstructor(c$,function(a,b,c){Clazz.superConstructor(this,J.shapebio.BioShape,[]);this.shape=a;this.modelIndex=b;this.bioPolymer=c;this.isActive=a.isActive;this.bsSizeDefault=new J.util.BS;this.monomerCount=c.monomerCount;0<this.monomerCount&&
(this.colixes=Clazz.newShortArray(this.monomerCount,0),this.paletteIDs=Clazz.newByteArray(this.monomerCount,0),this.mads=Clazz.newShortArray(this.monomerCount+1,0),this.monomers=c.getGroups(),this.meshReady=Clazz.newBooleanArray(this.monomerCount,!1),this.meshes=Array(this.monomerCount),this.wingVectors=c.getWingVectors(),this.leadAtomIndices=c.getLeadAtomIndices())},"J.shapebio.BioShapeCollection,~N,J.modelsetbio.BioPolymer");$_M(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});$_M(c$,"calcMeanPositionalDisplacement",function(a){return Clazz.doubleToShort(1E3*Math.sqrt(a/7895.6835208714865))},"~N");Clazz.overrideMethod(c$,"findNearestAtomIndex",function(a,b,c,d){this.bioPolymer.findNearestAtomIndex(a,b,c,this.mads,this.shape.myVisibilityFlag,
d)},"~N,~N,~A,J.util.BS");$_M(c$,"setMad",function(a,b,c){if(!(2>this.monomerCount)){this.isActive=!0;null==this.bsSizeSet&&(this.bsSizeSet=new J.util.BS);for(var d=this.shape.myVisibilityFlag,e=this.monomerCount;0<=--e;){var f=this.leadAtomIndices[e];if(b.get(f)){if(null!=c&&f<c.length){if(Float.isNaN(c[f]))continue;a=Clazz.floatToShort(2E3*c[f])}var g=0<(this.mads[e]=this.getMad(e,a));this.bsSizeSet.setBitTo(e,g);this.monomers[e].setShapeVisibility(d,g);this.shape.atoms[f].setShapeVisibility(d,
g);this.falsifyNearbyMesh(e)}}1<this.monomerCount&&(this.mads[this.monomerCount]=this.mads[this.monomerCount-1])}},"~N,J.util.BS,~A");$_M(c$,"getMad",($fz=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 Clazz.floatToShort(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},$fz.isPrivate=!0,$fz),"~N,~N");
$_M(c$,"falsifyMesh",function(){if(null!=this.meshReady)for(var a=0;a<this.monomerCount;a++)this.meshReady[a]=!1});$_M(c$,"falsifyNearbyMesh",($fz=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))},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"setColixBS",function(a,b,c){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=new J.util.BS);for(var d=this.monomerCount;0<=--d;){var e=this.leadAtomIndices[d];c.get(e)&&(this.colixes[d]=
this.shape.getColixI(a,b,e),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,J.util.BS");$_M(c$,"setColixes",function(a,b){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=new J.util.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,J.util.BS");$_M(c$,"setColixBack",function(a,b){for(var c=this.monomerCount;0<=--c;)b.get(this.leadAtomIndices[c])&&(null==this.colixesBack&&(this.colixesBack=Clazz.newShortArray(this.colixes.length,0)),this.colixesBack.length<this.colixes.length&&(this.colixesBack=J.util.ArrayUtil.ensureLengthShort(this.colixesBack,this.colixes.length)),this.colixesBack[c]=a)},"~N,J.util.BS");
$_M(c$,"setTranslucent",function(a,b,c){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=new J.util.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,J.util.BS,~N");Clazz.overrideMethod(c$,"setModelClickability",function(){if(this.isActive&&
null!=this.wingVectors)for(var a=Clazz.instanceOf(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);Clazz.defineStatics(c$,"eightPiSquared100",7895.6835208714865)});Clazz.declarePackage("J.shapebio");
Clazz.load(["J.shape.Shape"],"J.shapebio.BioShapeCollection",["J.constant.EnumPalette","J.shapebio.BioShape","J.util.ArrayUtil","$.BSUtil","$.C"],function(){c$=Clazz.decorateAsClass(function(){this.atoms=null;this.madOn=-2;this.madHelixSheet=3E3;this.madTurnRandom=800;this.madDnaRna=5E3;this.isActive=!1;this.bioShapes=null;Clazz.instantialize(this,arguments)},J.shapebio,"BioShapeCollection",J.shape.Shape);Clazz.overrideMethod(c$,"initModelSet",function(){this.isBioShape=!0;this.atoms=this.modelSet.atoms;
this.initialize()});Clazz.overrideMethod(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],e=0;e<d.monomerCount;e++)if(d.monomers[e].getGroupIndex()==b&&d.monomers[e].getLeadAtom().getIndex()==a)return d.mads[e];return 0},"J.modelset.Group");Clazz.overrideMethod(c$,"setShapeSizeRD",function(a,b,c){this.initialize();for(var d=this.bioShapes.length;0<=--d;){var e=this.bioShapes[d];0<e.monomerCount&&e.setMad(a,
c,null==b?null:b.values)}},"~N,J.atomdata.RadiusData,J.util.BS");Clazz.overrideMethod(c$,"setProperty",function(a,b,c){this.setPropBSC(a,b,c)},"~S,~O,J.util.BS");$_M(c$,"setPropBSC",function(a,b,c){if("refreshTrajectories"===a){c=b[0].intValue();for(b=this.bioShapes.length;0<=--b;)a=this.bioShapes[b],a.modelIndex==c&&a.falsifyMesh()}else if("deleteModelAtoms"===a){this.atoms=b[1];c=b[2][0];for(b=this.bioShapes.length;0<=--b;)a=this.bioShapes[b],a.modelIndex>c?(a.modelIndex--,a.leadAtomIndices=a.bioPolymer.getLeadAtomIndices()):
a.modelIndex==c&&(this.bioShapes=J.util.ArrayUtil.deleteElements(this.bioShapes,b,1))}else if(this.initialize(),"color"===a){var d=J.constant.EnumPalette.pidOf(b),e=J.util.C.getColixO(b);for(b=this.bioShapes.length;0<=--b;)a=this.bioShapes[b],0<a.monomerCount&&a.setColixBS(e,d,c)}else if("colors"===a){var d=b[0],e=b[1].floatValue(),f=0<e;for(b=this.bioShapes.length;0<=--b;)a=this.bioShapes[b],0<a.monomerCount&&(a.setColixes(d,c),f&&a.setTranslucent(f,c,e))}else if("colorPhase"===a){d=J.util.C.getColixO(b[0]);
e=J.util.C.getColixO(b[1]);for(b=this.bioShapes.length;0<=--b;)a=this.bioShapes[b],0<a.monomerCount&&(a.setColixBS(e,0,c),a.setColixBack(d,c))}else if("translucency"===a){f="translucent".equals(b);for(b=this.bioShapes.length;0<=--b;)a=this.bioShapes[b],0<a.monomerCount&&a.setTranslucent(f,c,this.translucentLevel)}else this.setPropS(a,b,c)},"~S,~O,J.util.BS");Clazz.overrideMethod(c$,"getShapeState",function(){return this.viewer.getAtomShapeSetState(this,this.bioShapes)});$_M(c$,"initialize",function(){for(var a=
this.modelSet.modelCount,b=this.modelSet.models,c=this.modelSet.getBioPolymerCount(),d=Array(c--);0<=--a;)for(var e=this.modelSet.getBioPolymerCountInModel(a);0<=--e;c--){var f=b[a].getBioPolymer(e);d[c]=null==this.bioShapes||this.bioShapes.length<=c||null==this.bioShapes[c]||this.bioShapes[c].bioPolymer!==f?new J.shapebio.BioShape(this,a,f):this.bioShapes[c]}this.bioShapes=d});Clazz.overrideMethod(c$,"findNearestAtomIndex",function(a,b,c,d){for(var e=this.bioShapes.length;0<=--e;)this.bioShapes[e].findNearestAtomIndex(a,
b,c,d)},"~N,~N,~A,J.util.BS");Clazz.overrideMethod(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}}},"J.util.BS");Clazz.overrideMethod(c$,"setModelClickability",function(){if(null!=this.bioShapes)for(var a=this.bioShapes.length;0<=
--a;)this.bioShapes[a].setModelClickability()});$_M(c$,"getMpsShapeCount",function(){return this.bioShapes.length});$_M(c$,"getBioShape",function(a){return this.bioShapes[a]},"~N")});Clazz.declarePackage("J.shapebio");Clazz.load(["J.shapebio.BioShapeCollection"],"J.shapebio.Rockets",null,function(){c$=Clazz.declareType(J.shapebio,"Rockets",J.shapebio.BioShapeCollection);$_M(c$,"initShape",function(){Clazz.superCall(this,J.shapebio.Rockets,"initShape",[]);this.madTurnRandom=500})});Clazz.declarePackage("J.shapebio");
Clazz.load(["J.shapebio.Rockets"],"J.shapebio.Cartoon",null,function(){c$=Clazz.declareType(J.shapebio,"Cartoon",J.shapebio.Rockets);$_M(c$,"initShape",function(){Clazz.superCall(this,J.shapebio.Cartoon,"initShape",[]);this.madDnaRna=1E3})});Clazz.declarePackage("J.shapebio");
Clazz.load(["J.shapebio.BioShapeCollection"],"J.shapebio.Backbone",["java.lang.Float","J.util.BS"],function(){c$=Clazz.decorateAsClass(function(){this.bsSelected=null;Clazz.instantialize(this,arguments)},J.shapebio,"Backbone",J.shapebio.BioShapeCollection);$_M(c$,"initShape",function(){Clazz.superCall(this,J.shapebio.Backbone,"initShape",[]);this.madOn=1;this.madHelixSheet=1500;this.madTurnRandom=500;this.madDnaRna=2E3;this.isActive=!0});Clazz.overrideMethod(c$,"setProperty",function(a,b,c){"bitset"===
a?this.bsSelected=b:this.setPropBSC(a,b,c)},"~S,~O,J.util.BS");Clazz.overrideMethod(c$,"setShapeSizeRD",function(a,b,c){this.initialize();var d=null!=this.bsSelected;d&&(c=this.bsSelected);for(var e=this.bioShapes.length;0<=--e;){var f=this.bioShapes[e];if(0!=f.monomerCount){var g=this.viewer.getBoolean(603979812),h=f.bioPolymer.getLeadAtomIndices(),j=0!=a;null==f.bsSizeSet&&(f.bsSizeSet=new J.util.BS);f.isActive=!0;for(var k=f.monomerCount-1;0<=--k;){var l=h[k],m=h[k+1],n=c.get(l),r=c.get(m);if(n&&
r||d&&n||g&&(n||r)){f.monomers[k].setShapeVisibility(this.myVisibilityFlag,j);n=this.modelSet.atoms[l];if(null!=b){if(Float.isNaN(b.values[l])||Float.isNaN(b.values[m]))continue;a=Clazz.floatToShort(1E3*(b.values[l]+b.values[m]));j=0!=a}l=this.modelSet.atoms[m];0!=f.mads[k]!=j&&(n.addDisplayedBackbone(this.myVisibilityFlag,j),l.addDisplayedBackbone(this.myVisibilityFlag,j));f.mads[k]=a;f.bsSizeSet.setBitTo(k,j);f.bsSizeDefault.setBitTo(k,-1==a)}}}}d&&(this.bsSelected=null)},"~N,J.atomdata.RadiusData,J.util.BS");
Clazz.overrideMethod(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)}})});Clazz.declarePackage("J.shapebio");
Clazz.load(["J.shapebio.BioShapeCollection"],"J.shapebio.Trace",null,function(){c$=Clazz.declareType(J.shapebio,"Trace",J.shapebio.BioShapeCollection);$_M(c$,"initShape",function(){Clazz.superCall(this,J.shapebio.Trace,"initShape",[]);this.madOn=600;this.madHelixSheet=1500;this.madTurnRandom=500;this.madDnaRna=1500})});Clazz.declarePackage("J.renderbio");
Clazz.load("J.render.MeshRenderer J.util.AxisAngle4f $.BS $.Matrix3f $.P3 $.P3i $.V3".split(" "),"J.renderbio.BioShapeRenderer","J.constant.EnumStructure J.shape.Mesh J.util.C $.Hermite $.Logger $.Normix".split(" "),function(){c$=Clazz.decorateAsClass(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.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;Clazz.instantialize(this,arguments)},J.renderbio,"BioShapeRenderer",J.render.MeshRenderer);Clazz.prepareFields(c$,function(){this.bsVisible=new J.util.BS;this.pointT=new J.util.P3;this.screenArrowTop=new J.util.P3i;this.screenArrowTopPrev=new J.util.P3i;this.screenArrowBot=
new J.util.P3i;this.screenArrowBotPrev=new J.util.P3i;this.norm=new J.util.V3;this.wing=new J.util.V3;this.wing1=new J.util.V3;this.wingT=new J.util.V3;this.aa=new J.util.AxisAngle4f;this.pt=new J.util.P3;this.pt1=new J.util.P3;this.ptPrev=new J.util.P3;this.ptNext=new J.util.P3;this.mat=new J.util.Matrix3f;this.norml=new J.util.V3});Clazz.overrideMethod(c$,"render",function(){if(null==this.shape)return!1;this.isPass2=this.g3d.isPass2();this.needTranslucent=this.invalidateMesh=!1;var a=this.isExport||
this.viewer.getBoolean(603979864);a!=this.isHighRes&&(this.invalidateMesh=!0);this.isHighRes=a;a=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:a;this.cartoonsFancy&&(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);0==this.hermiteLevel&&
(b=0);b!=this.aspectRatio&&(0!=b&&0!=a)&&(this.invalidateMesh=!0);this.aspectRatio=b;a=this.viewer.getBoolean(603979967);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);a=this.shape;for(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())}return this.needTranslucent});$_M(c$,"setBioColix",function(a){if(this.g3d.setColix(a))return!0;this.needTranslucent=!0;return!1},"~N");$_M(c$,"freeTempArrays",($fz=function(){this.haveControlPointScreens&&this.viewer.freeTempScreens(this.controlPointScreens);this.viewer.freeTempEnum(this.structureTypes)},$fz.isPrivate=!0,$fz));$_M(c$,"initializePolymer",($fz=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=J.util.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.screenX,e.screenY)&&(this.bsVisible.set(d),c=!0)}if(!c)return!1;this.ribbonBorder=this.viewer.getBoolean(603979898);this.isNucleic=Clazz.instanceOf(a.bioPolymer,J.modelsetbio.NucleicPolymer);this.isCarbohydrate=Clazz.instanceOf(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},$fz.isPrivate=!0,$fz),"J.shapebio.BioShape");$_M(c$,"setStructureTypes",($fz=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]},$fz.isPrivate=!0,$fz));$_M(c$,"isHelix",function(a){return this.structureTypes[a]===J.constant.EnumStructure.HELIX},"~N");$_M(c$,"getScreenControlPoints",function(){this.calcScreenControlPoints(this.controlPoints)});$_M(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");$_M(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");$_M(c$,"calc1Screen",($fz=function(a,b,c,d,e){this.pointT.setT(b);this.pointT.scaleAdd(c*d,a);this.viewer.transformPtScr(this.pointT,
e)},$fz.isPrivate=!0,$fz),"J.util.P3,J.util.V3,~N,~N,J.util.P3i");$_M(c$,"getLeadColix",function(a){return J.util.C.getColixInherited(this.colixes[a],this.monomers[a].getLeadAtom().getColix())},"~N");$_M(c$,"getLeadColixBack",function(a){return null==this.colixesBack||this.colixesBack.length<=a?0:this.colixesBack[a]},"~N");$_M(c$,"setNeighbors",($fz=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)},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"setMads",($fz=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&&(Clazz.instanceOf(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=Clazz.floatToInt(this.viewer.scaleToScreen(this.controlPointScreens[a].z,this.madBeg));this.diameterMid=Clazz.floatToInt(this.viewer.scaleToScreen(this.monomers[a].getLeadAtom().screenZ,this.madMid));this.diameterEnd=Clazz.floatToInt(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))},$fz.isPrivate=!0,$fz),"~N,~B");$_M(c$,"checkDiameter",($fz=function(a){return(new Boolean((new Boolean(this.isHighRes&3<a)).valueOf()||8<=a)).valueOf()},
$fz.isPrivate=!0,$fz),"~N");$_M(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");$_M(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(Clazz.exceptionOf(c,Exception))this.bsRenderMesh.clear(a),this.meshes[a]=null,J.util.Logger.error("render mesh error hermiteConic: "+c.toString());else throw c;}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");$_M(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(Clazz.exceptionOf(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],
Clazz.floatToInt(this.aspectRatio),this.colixBack)}},"~B,~N,~B");$_M(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,Clazz.doubleToInt(Math.floor(1.2*this.madBeg)),Clazz.doubleToInt(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(Clazz.exceptionOf(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],Clazz.floatToInt(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");$_M(c$,"createMesh",($fz=function(a,b,c,d,e){this.setNeighbors(a);if(0==this.controlPoints[a].distance(this.controlPoints[this.iNext]))return!1;var f=1!=e&&null!=this.wingVectors,g=0==e,h=this.cartoonsFancy||6<=this.hermiteLevel,j=
2*(this.hermiteLevel+1)+1,k=g?4:4*(this.hermiteLevel+1)-2,l=g?3.141592653589793/(k-1):6.283185307179586/k,m=this.meshes[a]=(new J.shape.Mesh).mesh1("mesh_"+this.shapeID+"_"+a,0,a),n=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(n){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 r=Clazz.doubleToInt((k+2)/4),w=Clazz.doubleToInt((3*k+2)/4),f=!f?0:g?1:h?2:3,h=0==f||3==f,t=0;t<j;t++){this.norm.sub2(this.controlHermites[t+1],this.controlHermites[t]);var p=!n?b:t<c?this.radiusHermites[t].x:this.radiusHermites[t-c].y;this.wing.setT(this.wingHermites[t]);this.wing1.setT(this.wing);
switch(f){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(p);this.wing1.scale(p);h&&(this.aa.setVA(this.norm,l),this.mat.setAA(this.aa));this.pt1.setT(this.controlHermites[t]);for(var u=g?0:l,p=0;p<k;p++,u+=l){h&&0<p&&this.mat.transform(this.wing);switch(f){case 1:this.wingT.setT(this.wing1);this.wingT.scale(Math.cos(u));
break;case 2:this.wingT.setT(this.wing1);this.wingT.scale(Math.sin(u));this.wingT.scaleAdd2(Math.cos(u),this.wing,this.wingT);break;case 3:this.wingT.setT(this.wing);(p==r||p==w)&&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<t){u=g?k-1:k;for(p=0;p<u;p++){var s=d-k+p,q=d-k+(p+1)%k,z=d+(p+1)%k,A=d+p;p<Clazz.doubleToInt(u/2)?m.addQuad(s,q,z,A):m.addQuad(q,z,A,s)}}d+=k}if(!g){e=d;if(this.doCap0){for(g=0;g<
k;g++)m.addV(m.vertices[g]);d+=k;for(p=2*this.hermiteLevel;0<=--p;)m.addQuad(d-k+p+2,d-k+p+1,d-k+(k-p)%k,d-p-1)}if(this.doCap1){for(g=0;g<k;g++)m.addV(m.vertices[e-k+g]);d+=k;for(p=2*this.hermiteLevel;0<=--p;)m.addQuad(d-p-1,d-k+(k-p)%k,d-k+p+1,d-k+p+2)}}this.meshReady[a]=!0;this.adjustCartoonSeamNormals(a,k);m.setVisibilityFlags(1);return!0},$fz.isPrivate=!0,$fz),"~N,~N,~N,~N,~N");$_M(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 f=1;f<=b;++f)this.norml.add2(d[e-f],c[b-f]),this.norml.normalize(),this.meshes[a].normalsTemp[e-f].setT(this.norml),this.meshes[this.iNext].normalsTemp[b-f].setT(this.norml)}catch(g){if(!Clazz.exceptionOf(g,Exception))throw g;
}},"~N,~N");$_M(c$,"renderMeshes",($fz=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])},$fz.isPrivate=!0,$fz));Clazz.defineStatics(c$,"ABSOLUTE_MIN_MESH_SIZE",3,"MIN_MESH_RENDER_SIZE",8,"MODE_TUBE",0,"MODE_FLAT",1,"MODE_ELLIPTICAL",
2,"MODE_NONELLIPTICAL",3)});Clazz.declarePackage("J.renderbio");
Clazz.load(["J.renderbio.BioShapeRenderer","J.util.P3","$.V3"],"J.renderbio.RocketsRenderer",["J.constant.EnumStructure"],function(){c$=Clazz.decorateAsClass(function(){this.renderArrowHeads=this.newRockets=!1;this.cordMidPoints=null;this.tPending=!1;this.proteinstructurePending=null;this.endIndexPending=this.startIndexPending=0;this.pointCorner=this.lengthVector=this.scaledHeightVector=this.scaledWidthVector=this.pointTipOffset=this.screenCorners=this.corners=this.vtemp=this.screenC=this.screenB=
this.screenA=null;Clazz.instantialize(this,arguments)},J.renderbio,"RocketsRenderer",J.renderbio.BioShapeRenderer);Clazz.prepareFields(c$,function(){this.screenA=new J.util.P3;this.screenB=new J.util.P3;this.screenC=new J.util.P3;this.vtemp=new J.util.V3;this.corners=Array(8);this.screenCorners=Array(8);for(var a=8;0<=--a;)this.screenCorners[a]=new J.util.P3,this.corners[a]=new J.util.P3;this.pointTipOffset=new J.util.P3;this.scaledWidthVector=new J.util.V3;this.scaledHeightVector=new J.util.V3;this.lengthVector=
new J.util.V3;this.pointCorner=new J.util.P3});Clazz.overrideMethod(c$,"renderBioShape",function(a){if(Clazz.instanceOf(a.bioPolymer,J.modelsetbio.AminoPolymer)){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.render1();this.viewer.freeTempPoints(this.cordMidPoints)}},"J.shapebio.BioShape");$_M(c$,"isSheet",
function(a){return this.structureTypes[a]===J.constant.EnumStructure.SHEET},"~N");$_M(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");$_M(c$,"render1",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()});$_M(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");$_M(c$,"renderPending",function(){if(this.tPending){var a=this.proteinstructurePending.getSegments(),b=this.endIndexPending==
this.proteinstructurePending.getMonomerCount()-1;Clazz.instanceOf(this.proteinstructurePending,J.modelsetbio.Helix)?this.renderPendingRocketSegment(this.endIndexPending,a[this.startIndexPending],a[this.endIndexPending],a[this.endIndexPending+1],b):Clazz.instanceOf(this.proteinstructurePending,J.modelsetbio.Sheet)&&this.renderPendingSheet(a[this.startIndexPending],a[this.endIndexPending],a[this.endIndexPending+1],b);this.tPending=!1}});$_M(c$,"renderPendingRocketSegment",($fz=function(a,b,c,d,e){this.viewer.transformPt3f(b,
this.screenA);this.viewer.transformPt3f(d,this.screenB);c=Clazz.doubleToInt(Math.floor((this.screenA.z+this.screenB.z)/2));c=Clazz.floatToInt(this.viewer.scaleToScreen(c,this.mad));this.g3d.fillCylinderBits(2,c,this.screenA,this.screenB);this.g3d.setColix(this.colix)&&(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))},$fz.isPrivate=!0,$fz),"~N,J.util.P3,J.util.P3,J.util.P3,~B");$_M(c$,"renderCone",function(a,b,c,d,e){a=(this.mad<<1)-(this.mad>>1);a=Clazz.floatToInt(this.viewer.scaleToScreen(Clazz.doubleToInt(Math.floor(d.z)),a));this.g3d.fillConeSceen3f(2,a,d,e)},"~N,J.util.P3,J.util.P3,J.util.P3,J.util.P3");$_M(c$,"renderPendingSheet",($fz=function(a,b,c,d){this.g3d.setColix(this.colix)&&(d&&this.renderArrowHeads?(this.drawArrowHeadBox(b,
c),this.drawBox(a,b)):this.drawBox(a,c))},$fz.isPrivate=!0,$fz),"J.util.P3,J.util.P3,J.util.P3,~B");$_M(c$,"buildBox",function(a,b,c,d){for(var e=8;0<=--e;){var f=this.corners[e];f.setT(a);0!=(e&1)&&f.add(b);0!=(e&2)&&f.add(c);0!=(e&4)&&f.add(d);this.viewer.transformPt3f(f,this.screenCorners[e])}},"J.util.P3,J.util.V3,J.util.V3,J.util.V3");$_M(c$,"buildArrowHeadBox",function(a,b,c,d){for(var e=4;0<=--e;){var f=this.corners[e];f.setT(a);0!=(e&1)&&f.add(b);0!=(e&2)&&f.add(c);this.viewer.transformPt3f(f,
this.screenCorners[e])}this.corners[4].setT(d);this.viewer.transformPt3f(d,this.screenCorners[4]);this.corners[5].add2(d,c);this.viewer.transformPt3f(this.corners[5],this.screenCorners[5])},"J.util.P3,J.util.V3,J.util.V3,J.util.P3");$_M(c$,"drawBox",function(a,b){var c=this.proteinstructurePending,d=this.mad/1E3;this.scaledWidthVector.setT(c.getWidthUnitVector());this.scaledWidthVector.scale(d);this.scaledHeightVector.setT(c.getHeightUnitVector());this.scaledHeightVector.scale(d/4);this.pointCorner.add2(this.scaledWidthVector,
this.scaledHeightVector);this.pointCorner.scaleAdd(-0.5,a);this.lengthVector.sub2(b,a);this.buildBox(this.pointCorner,this.scaledWidthVector,this.scaledHeightVector,this.lengthVector);for(c=0;6>c;++c)this.g3d.fillQuadrilateral(this.screenCorners[J.renderbio.RocketsRenderer.boxFaces[4*c]],this.screenCorners[J.renderbio.RocketsRenderer.boxFaces[4*c+1]],this.screenCorners[J.renderbio.RocketsRenderer.boxFaces[4*c+2]],this.screenCorners[J.renderbio.RocketsRenderer.boxFaces[4*c+3]])},"J.util.P3,J.util.P3");
$_M(c$,"drawArrowHeadBox",function(a,b){var c=this.proteinstructurePending,d=this.mad/1E3;this.scaledWidthVector.setT(c.getWidthUnitVector());this.scaledWidthVector.scale(1.25*d);this.scaledHeightVector.setT(c.getHeightUnitVector());this.scaledHeightVector.scale(d/3);this.pointCorner.add2(this.scaledWidthVector,this.scaledHeightVector);this.pointCorner.scaleAdd(-0.5,a);this.pointTipOffset.setT(this.scaledHeightVector);this.pointTipOffset.scaleAdd(-0.5,b);this.buildArrowHeadBox(this.pointCorner,this.scaledWidthVector,
this.scaledHeightVector,this.pointTipOffset);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(c=0;12>c;c+=4)this.g3d.fillQuadrilateral(this.screenCorners[J.renderbio.RocketsRenderer.arrowHeadFaces[c]],this.screenCorners[J.renderbio.RocketsRenderer.arrowHeadFaces[c+1]],this.screenCorners[J.renderbio.RocketsRenderer.arrowHeadFaces[c+2]],this.screenCorners[J.renderbio.RocketsRenderer.arrowHeadFaces[c+
3]])},"J.util.P3,J.util.P3");Clazz.defineStatics(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]);Clazz.defineStatics(c$,"arrowHeadFaces",[0,1,3,2,0,4,5,2,1,4,5,3])});Clazz.declarePackage("J.renderbio");
Clazz.load(["J.renderbio.RocketsRenderer","J.util.P3","$.P3i"],"J.renderbio.CartoonRenderer",["J.util.C"],function(){c$=Clazz.decorateAsClass(function(){this.ladderOnly=this.renderEdges=this.renderAsRockets=!1;this.ring5Screens=this.ring5Points=this.ring6Screens=this.ring6Points=this.ptConnect=this.ptConnectScr=null;Clazz.instantialize(this,arguments)},J.renderbio,"CartoonRenderer",J.renderbio.RocketsRenderer);Clazz.prepareFields(c$,function(){this.ptConnectScr=new J.util.P3i;this.ptConnect=new J.util.P3;
this.ring6Points=Array(6);this.ring6Screens=Array(6);this.ring5Points=Array(5);this.ring5Screens=Array(5);this.ring6Screens[5]=new J.util.P3i;for(var a=5;0<=--a;)this.ring5Screens[a]=new J.util.P3i,this.ring6Screens[a]=new J.util.P3i});Clazz.overrideMethod(c$,"renderBioShape",function(a){this.newRockets=!0;if(!(null==a.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.render1();this.viewer.freeTempPoints(this.cordMidPoints);this.viewer.freeTempScreens(this.ribbonTopScreens);this.viewer.freeTempScreens(this.ribbonBottomScreens)}},
"J.shapebio.BioShape");$_M(c$,"renderNucleic",function(){this.renderEdges=this.viewer.getBoolean(603979817);this.ladderOnly=this.viewer.getBoolean(603979820);for(var a=this.viewer.getBoolean(603979967),b=this.bsVisible.nextSetBit(0);0<=b;b=this.bsVisible.nextSetBit(b+1))a?(this.ptConnectScr.set(Clazz.doubleToInt((this.controlPointScreens[b].x+this.controlPointScreens[b+1].x)/2),Clazz.doubleToInt((this.controlPointScreens[b].y+this.controlPointScreens[b+1].y)/2),Clazz.doubleToInt((this.controlPointScreens[b].z+
this.controlPointScreens[b+1].z)/2)),this.ptConnect.setT(this.controlPoints[b]),this.ptConnect.scale(0.5),this.ptConnect.scaleAdd2(0.5,this.controlPoints[b+1],this.ptConnect)):(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)});Clazz.overrideMethod(c$,"render1",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 f=this.isSheet(e),g=this.renderAsRockets||!this.renderArrowHeads?d:!1;this.bsVisible.get(e)&&!g&&(f||d?a&&f||b&&d?this.renderHermiteRibbon(!0,e,!0):this.renderHermiteArrowHead(e):this.renderHermiteConic(e,!0));a=f;b=d}(this.renderAsRockets||!this.renderArrowHeads)&&this.renderRockets()});$_M(c$,"renderRockets",($fz=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()},$fz.isPrivate=!0,$fz));$_M(c$,"renderNucleicBaseStep",($fz=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,
f;a?(this.viewer.transformPoints(this.ring5Points,this.ring5Screens),this.renderRing5(),this.ladderOnly?(e=this.ring6Screens[2],f=this.ring6Points[2]):(e=this.ring5Screens[3],f=this.ring5Points[3])):(f=this.ladderOnly?4:2,e=this.ring6Screens[f],f=this.ring6Points[f]);this.mad=1<b?Clazz.doubleToInt(b/2):b;this.g3d.fillCylinderScreen3I(3,Clazz.floatToInt(this.viewer.scaleToScreen(c.z,this.mad)),c,e,d,f,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)}}},$fz.isPrivate=!0,$fz),"J.modelsetbio.NucleicMonomer,~N,J.util.P3i,J.util.P3");
$_M(c$,"renderLeontisWesthofEdges",($fz=function(a,b){if(a.getEdgePoints(this.ring6Points)){this.viewer.transformPoints(this.ring6Points,this.ring6Screens);this.renderTriangle();this.mad=1<b?Clazz.doubleToInt(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),f=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(f);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)}},$fz.isPrivate=!0,$fz),"J.modelsetbio.NucleicMonomer,~N");$_M(c$,"renderTriangle",($fz=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])},$fz.isPrivate=!0,$fz));$_M(c$,"renderRing6",($fz=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]))},$fz.isPrivate=!0,$fz));$_M(c$,"renderRing5",($fz=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]))},$fz.isPrivate=!0,$fz))});Clazz.declarePackage("J.renderbio");
Clazz.load(["J.renderbio.BioShapeRenderer"],"J.renderbio.BackboneRenderer",["J.util.C"],function(){c$=Clazz.declareType(J.renderbio,"BackboneRenderer",J.renderbio.BioShapeRenderer);Clazz.overrideMethod(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()),f=J.util.C.getColixInherited(this.colixes[b+1],d.getColix());if(!this.isExport&&!this.isPass2){var g=!J.util.C.isColixTranslucent(e),h=!J.util.C.isColixTranslucent(f);if(!g||!h){if(!g&&!h)continue;this.needTranslucent=!0}}var g=c.screenX,h=c.screenY,c=c.screenZ,j=d.screenX,k=d.screenY,d=d.screenZ;this.mad=this.mads[b];if(0>this.mad)this.g3d.drawLine(e,
f,g,h,c,j,k,d);else{var l=Clazz.floatToInt(1==this.exportType?this.mad:this.viewer.scaleToScreen(Clazz.doubleToInt((c+d)/2),this.mad));this.g3d.fillCylinderXYZ(e,f,3,l,g,h,c,j,k,d)}}}},"J.shapebio.BioShape")});Clazz.declarePackage("J.renderbio");
Clazz.load(["J.renderbio.BioShapeRenderer"],"J.renderbio.TraceRenderer",null,function(){c$=Clazz.declareType(J.renderbio,"TraceRenderer",J.renderbio.BioShapeRenderer);Clazz.overrideMethod(c$,"renderBioShape",function(){this.getScreenControlPoints();for(var a=this.bsVisible.nextSetBit(0);0<=a;a=this.bsVisible.nextSetBit(a+1))this.renderHermiteConic(a,!1)},"J.shapebio.BioShape")});
