Clazz.declarePackage("J.adapter.readers.pdb");
Clazz.load(["J.adapter.smarter.AtomSetCollectionReader","java.util.Hashtable"],"J.adapter.readers.pdb.PdbReader","java.lang.Boolean $.Character $.Float JU.List $.M4 $.P3 $.ParserJS $.SB J.adapter.smarter.Atom $.Structure J.api.Interface $.JmolAdapter J.constant.EnumStructure J.util.Escape $.Logger $.Txt".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.pdb,"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 JU.SB:null;this.applySymmetry=!this.checkFilterKey("NOSYMMETRY");this.getTlsGroups=this.checkFilterKey("TLS");this.checkFilterKey("ASSEMBLY")&&(this.filter=J.util.Txt.simpleReplace(this.filter,"ASSEMBLY","BIOMOLECULE"));this.htParams.containsKey("vTlsModels")&&(this.vTlsModels=this.htParams.remove("vTlsModels"));var a=this.getFilter("TYPE ");
if(null!=a){a=JU.ParserJS.getTokens(a.$replace(","," "));this.atomTypePt0=Integer.parseInt(a[0])-1;var b=a[1].indexOf("=");0<=b?this.setFilterAtomTypeStr(a[1].substring(b+1).toUpperCase()):b=a[1].length;this.atomTypeLen=Integer.parseInt(a[1].substring(0,b))}a=this.getFilter("CONF ");null!=a&&(this.configurationPtr=this.parseIntStr(a),this.sbIgnored=new JU.SB,this.sbSelected=new JU.SB);this.isLegacyModelType=12E4>this.stateScriptVersionInt;this.isConnectStateBug=120151<=this.stateScriptVersionInt&&
120220>=this.stateScriptVersionInt||120300<=this.stateScriptVersionInt&&120320>=this.stateScriptVersionInt});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});Clazz.overrideMethod(c$,"finalizeReader",
function(){this.finalizeReaderPDB()});$_M(c$,"finalizeReaderPDB",function(){this.checkNotPDB();this.atomSetCollection.connectAll(this.maxSerial,this.isConnectStateBug);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()));this.finalizeReaderASCR();null!=this.vCompnds&&this.atomSetCollection.setAtomSetCollectionAuxiliaryInfo("compoundSource",this.vCompnds);null!=this.htSites&&this.addSites(this.htSites);null!=this.pdbHeader&&this.atomSetCollection.setAtomSetCollectionAuxiliaryInfo("fileHeader",this.pdbHeader.toString());0<this.configurationPtr&&(J.util.Logger.info(this.sbSelected.toString()),
J.util.Logger.info(this.sbIgnored.toString()))});$_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().addTensor(a.getTensor(e).setType(null),"TLS-R",!1),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 JU.List;this.htMolIds=new java.util.Hashtable;this.currentCompnd=new java.util.Hashtable;this.currentCompnd.put("select","(*)");this.currentKey="MOLECULE";this.htMolIds.put("",this.currentCompnd)}a&&this.resetKey&&(this.resetKey=!1,this.currentKey="SOURCE",this.currentCompnd=this.htMolIds.get(""));
this.line=this.line.substring(10,Math.min(this.lineLength,72)).trim();var c=this.line.indexOf(":");if(0>c||0<c&&"\\"==this.line.charAt(c-1))c=this.line.length;b=this.line.substring(0,c).trim();c=c<this.line.length?this.line.substring(c+1):null;if(b.equals("MOL_ID")){if(null==c)return;if(a){this.currentCompnd=this.htMolIds.remove(c);return}this.currentCompnd=new java.util.Hashtable;this.vCompnds.addLast(this.currentCompnd);this.htMolIds.put(c,this.currentCompnd)}null!=this.currentCompnd&&(null==c?
(c=this.currentCompnd.get(this.currentKey),null==c&&(c=""),c+=b,0==this.vCompnds.size()&&this.vCompnds.addLast(this.currentCompnd)):this.currentKey=b,c.endsWith(";")&&(c=c.substring(0,c.length-1)),this.currentCompnd.put(this.currentKey,c),this.currentKey.equals("CHAIN")&&this.currentCompnd.put("select","(:"+J.util.Txt.simpleReplace(J.util.Txt.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 JU.List;this.chainAtomCounts=Clazz.newIntArray(255,0);var b="",c="",d=0,e=!0,f=null,g=0,h=new JU.M4;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 JU.List,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 JU.M4;m.setA(j,0);m.equals(h)?a.add(0,m):a.addLast(m)}}catch(p){if(Clazz.exceptionOf(p,Exception)){this.vBiomolecules=this.vBiomts=null;return}throw p;}}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):JU.ParserJS.parseIntRadix(this.line.substring(a,b),36)+(Character.isUpperCase(c)?-16696160:26973856);case 1:if(!d)return this.serial=JU.ParserJS.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):JU.ParserJS.parseIntRadix(this.line.substring(a,b),36)+(Character.isUpperCase(c)?-456560:756496);case 1:if(!d)return JU.ParserJS.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=256>e?String.fromCharCode(e):0;null!=this.chainAtomCounts&&this.chainAtomCounts[b.charCodeAt(0)]++;this.setChainID(a,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,~N,~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.charCodeAt(21),
this.getSeqNo(22,26),this.line.charAt(26),a,this.deduceElementSymbol(a));if(0<this.atomTypeLen){var b=this.line.substring(this.atomTypePt0,this.atomTypePt0+this.atomTypeLen).trim();0<b.length&&(a.atomName+="\x00"+b)}if(this.filterPDBAtom(a,this.fileAtomIndex++)){var b=0,c,d,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)+(0==a.chainID?"":":"+this.viewer.getChainIDStr(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.pdb.PdbReader.fixRadius(this.parseFloatRange(this.line,68,76));else{var b=this.getTokens(),c=b.length-2-(75<this.line.length?1:0);a.partialCharge=this.parseFloatStr(b[c++]);a.radius=
J.adapter.readers.pdb.PdbReader.fixRadius(this.parseFloatStr(b[c]))}else this.gromacsWideFormat?(b=this.parseFloatRange(this.line,60,68),a.bfactor=J.adapter.readers.pdb.PdbReader.fixRadius(this.parseFloatRange(this.line,68,76))):(b=this.parseFloatRange(this.line,54,60),a.bfactor=this.parseFloatRange(this.line,60,66)),a.foccupancy=Float.isNaN(b)?1:b},"J.adapter.smarter.Atom");$_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 JU.SB,this.sb=new JU.SB):this.sb.setLength(0);var a=-1,a=this.getSerial(6,11);if(!(0>a)){for(var b=0;9>b;b+=5==b?2:1){var c=5*b+11,d=c+5,c=d<=this.lineLength?this.getSerial(c,d):-1;if(!(0>c)){var 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.charCodeAt(0),k,d,e.charCodeAt(0),l,m,-2147483648,2147483647);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 JU.List,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 JU.List);d=new JU.List;this.appendLoadNote(this.line.substring(11).trim())}}else if(j[0].equalsIgnoreCase("COMPONENTS"))c=this.line;else if(j[0].equalsIgnoreCase("RESIDUE")){var g=new java.util.Hashtable,k,l,m,p;if(6==j.length)k=j[2].charAt(0),l=j[4].charAt(0),m=this.parseIntStr(j[3]),
p=this.parseIntStr(j[5]);else{var r=c.indexOf(" C "),v=c.indexOf(" C ",r+4);k=this.line.charAt(v);l=this.line.charAt(r);m=this.parseIntRange(this.line,v+1,r);p=this.parseIntStr(this.line.substring(r+1))}k==l?(g.put("chains",""+k+l),m<=p?(g.put("residues",[m,p]),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 u="\x00",n=1;n<j.length;n++)if(0<=
j[n].toUpperCase().indexOf("CHAIN"))u=j[++n].charAt(0);else{var w=this.parseIntStr(j[n]);-2147483648!=w&&(g=new java.util.Hashtable,g.put("residues",[w,this.parseIntStr(j[++n])]),"\x00"!=u&&g.put("chains",""+u+u),f.addLast(g))}else if(j[0].equalsIgnoreCase("ORIGIN")){var s=new JU.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 D=j[0].charAt(0),E=(this.readLine().substring(10)+this.readLine().substring(10)+this.readLine().substring(10)).$replace(D," ").$replace(":"," "),j=J.adapter.smarter.AtomSetCollectionReader.getTokensStr(E),t=Clazz.newFloatArray(3,3,0);e.put("t"+D,t);for(n=0;n<j.length;n++){var F=j[n].charCodeAt(0)-
49,H=j[n].charCodeAt(1)-49;t[F][H]=this.parseFloatStr(j[++n]);F<H&&(t[H][F]=t[F][H])}for(n=0;3>n;n++)for(u=0;3>u;u++)Float.isNaN(t[n][u])&&this.tlsAddError("invalid tensor: "+J.util.Escape.escapeFloatAA(t,!1));if("S"==D&&++b==a){J.util.Logger.info(a+" TLS groups read");this.readLine();break}}}catch(A){if(Clazz.exceptionOf(A,Exception)){J.util.Logger.error(this.line+"\nError in TLS parser: ");System.out.println(A.getMessage());d=null;break}else throw A;}null!=d&&(b=new java.util.Hashtable,b.put("groupCount",
Integer.$valueOf(a)),b.put("groups",d),this.vTlsModels.addLast(b));return 1>a},$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 p=m.size();0<=--p;){var r=m.get(p).get("chains"),v=m.get(p).get("residues"),u=0+r.charCodeAt(0),r=0+r.charCodeAt(1),n=v[0],v=v[1],w=this.findAtomForRange(e,g,u,n,!1),s=0<=w?this.findAtomForRange(w,g,r,v,!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 "+w+"-"+s);w=u==r;for(s=e;s<g;s++){var q=h[s];if(w?q.sequenceNumber>=
n&&q.sequenceNumber<=v:q.chainID>u&&q.chainID<r||q.chainID==u&&q.sequenceNumber>=n||q.chainID==r&&q.sequenceNumber<=v)f[s-e]=this.tlsGroupID,this.setTlsTensor(q,l,c)}}}c=new JU.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.setTensors()},$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,~N,~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,~N,~N,~B");$_M(c$,"setTlsTensor",($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,p=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),v=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]*p-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]*p+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]*p+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]*p-b[1][1]*g+b[2][2]*g+b[0][1]*h-b[0][2]*d;e[6]=12;e[7]=v;null==
this.tlsU&&(this.tlsU=new java.util.Hashtable);this.tlsU.put(a,e);a.addTensor(c.getTensor(this.dataT).setType(null),"TLS-U",!1)}}},$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 JU.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(null,"J.adapter.smarter.Structure",["J.constant.EnumStructure"],function(){c$=Clazz.decorateAsClass(function(){this.structureID=this.substructureType=this.structureType=null;this.startChainID=this.strandCount=this.serialID=0;this.startChainStr=null;this.startInsertionCode="\x00";this.endChainID=0;this.endChainStr=null;this.endInsertionCode="\x00";this.endSequenceNumber=this.startSequenceNumber=0;this.modelStartEnd=this.atomStartEnd=null;Clazz.instantialize(this,arguments)},J.adapter.smarter,
"Structure");Clazz.prepareFields(c$,function(){this.atomStartEnd=Clazz.newIntArray(2,0);this.modelStartEnd=[-1,-1]});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){this.structureType=b;this.substructureType=c;null!=d&&(this.setModels(a,0),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.atomStartEnd[0]=g;this.atomStartEnd[1]=h},"~N,~N,~S,~N,~N,~S,~N,~N");$_M(c$,"setModels",function(a,b){this.modelStartEnd[0]=a;this.modelStartEnd[1]=0==b?a:b},"~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 JU.BS $.P3 $.P4 $.ParserJS $.SB $.V3 J.constant.EnumStructure J.modelset.Group J.modelsetbio.AlphaMonomer $.AlphaPolymer $.AminoMonomer $.AminoPolymer $.BioModel $.CarbohydrateMonomer $.CarbohydratePolymer $.NucleicMonomer $.NucleicPolymer $.PhosphorusMonomer $.PhosphorusPolymer J.util.BSUtil $.Logger $.Measure $.Txt 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$();this.bsAssigned=null;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){return new J.modelsetbio.BioModel(this.modelSet,a,b,c,d,e)},"~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.modelLoader=
a;this.modelSet=a.modelSet},"J.modelset.ModelLoader");Clazz.overrideMethod(c$,"initializeHydrogenAddition",function(){this.baseBondIndex=this.modelLoader.modelSet.bondCount;this.bsAddedHydrogens=new JU.BS;this.bsAtomsForHs=new JU.BS;this.htBondMap=new java.util.Hashtable;this.htGroupBonds=new java.util.Hashtable;this.hNames=Array(3);this.vAB=new JU.V3;this.vAC=new JU.V3;this.vNorm=new JU.V3;this.plane=new JU.P4});Clazz.overrideMethod(c$,"addImplicitHydrogenAtoms",function(a,b,c){var d=this.modelLoader.getGroup3(b),
e;if(!this.haveHsAlready&&!(null==d||0==(e=J.viewer.JC.getStandardPdbHydrogenCount(J.modelset.Group.lookupGroupID(d))))){c=0>e?-1:e+c;e=null;b=this.modelLoader.getFirstAtomIndex(b);var f=this.modelSet.getAtomCount();if(0>c){if(1==f-b)return;e=this.modelSet.viewer.getLigandModel(d,"ligand_","_data",null);if(null==e)return;c=a.getHydrogenAtomCount(e);if(1>c)return}this.getBondInfo(a,d,e);this.modelSet.models[this.modelSet.atoms[b].modelIndex].isPdbWithMultipleBonds=!0;this.bsAtomsForHs.setBits(b,f);
this.bsAddedHydrogens.setBits(f,f+c);a=this.modelSet.atoms[b].isHetero();d=JU.P3.new3(NaN,NaN,NaN);for(e=0;e<c;e++)this.modelSet.addAtom(this.modelSet.atoms[b].modelIndex,this.modelSet.atoms[b].getGroup(),1,"H",0,0,d,NaN,null,0,0,1,0,null,a,0,null).deleteBonds(null)}},"J.api.JmolAdapter,~N,~N");$_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,
null,null,null);this.finalizePdbMultipleBonds();this.addHydrogens()});$_M(c$,"addHydrogens",($fz=function(){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();this.modelSet.fixFormalCharges(J.util.BSUtil.newBitSet2(this.modelLoader.baseAtomIndex,this.modelLoader.modelSet.atomCount))}},
$fz.isPrivate=!0,$fz));$_M(c$,"deleteUnneededAtoms",($fz=function(){for(var a=new JU.BS,b=this.bsAtomsForHs.nextSetBit(0);0<=b;b=this.bsAtomsForHs.nextSetBit(b+1)){var c=this.modelSet.atoms[b];if(c.isHetero()&&!(8!=c.getElementNumber()||0!=c.getFormalCharge()||2!=c.getCovalentBondCount())){var d=c.getBonds(),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.deleteBonds(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;b=this.bsAtomsForHs.nextSetBit(b+1)){var c=a[b];c.getGroup().getNitrogenAtom()===c&&1==c.getCovalentBondCount()&&c.setFormalCharge(1);if(0>(b=this.bsAtomsForHs.nextClearBit(b+1)))break}},$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 JU.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(JU.ParserJS.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(JU.ParserJS.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,JU.P3");Clazz.overrideMethod(c$,"fixPropertyValue",function(a,b){for(var c=J.util.Txt.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.Txt.join(e,"\n",0)},"JU.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");Clazz.overrideMethod(c$,"iterateOverAllNewStructures",function(a,b){var c=a.getStructureIterator(b);if(null!=c){var d=c.getStructuredModels();if(null!=d)for(var e=d.nextSetBit(0);0<=e;e=d.nextSetBit(e+1))this.modelLoader.structuresDefinedInFile.set(this.modelLoader.baseModelIndex+e);for(;c.hasNext();)c.getStructureType()!==J.constant.EnumStructure.TURN&&this.setStructure(c);for(c=a.getStructureIterator(b);c.hasNext();)c.getStructureType()===J.constant.EnumStructure.TURN&&this.setStructure(c)}},
"J.api.JmolAdapter,~O");$_M(c$,"setStructure",($fz=function(a){var b=a.getSubstructureType(),c=a.getStructureID(),d=a.getSerialID(),e=a.getStrandCount(),f=a.getAtomIndices(),g=a.getModelIndices();null==this.bsAssigned&&(this.bsAssigned=new JU.BS);this.defineStructure(b,c,d,e,a.getStartChainID(),a.getStartSequenceNumber(),a.getStartInsertionCode(),a.getEndChainID(),a.getEndSequenceNumber(),a.getEndInsertionCode(),f,g,this.bsAssigned)},$fz.isPrivate=!0,$fz),"J.api.JmolAdapterStructureIterator");$_M(c$,
"defineStructure",($fz=function(a,b,c,d,e,f,g,h,j,k,l,m,p){a=a===J.constant.EnumStructure.NOT?J.constant.EnumStructure.NONE:a;f=J.modelset.Group.getSeqcodeFor(f,g);j=J.modelset.Group.getSeqcodeFor(j,k);k=this.modelSet.models;this.modelLoader.isTrajectory?m[1]=m[0]:(m[0]+=this.modelLoader.baseModelIndex,m[1]+=this.modelLoader.baseModelIndex);this.modelLoader.structuresDefinedInFile.setBits(m[0],m[1]+1);for(g=m[0];g<=m[1];g++){var r=k[g].firstAtomIndex;Clazz.instanceOf(k[g],J.modelsetbio.BioModel)&&
k[g].addSecondaryStructure(a,b,c,d,e,f,h,j,r+l[0],r+l[1],p)}},$fz.isPrivate=!0,$fz),"J.constant.EnumStructure,~S,~N,~N,~N,~N,~S,~N,~N,~S,~A,~A,JU.BS");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 JU.P3 J.constant.EnumStructure J.util.Logger $.Measure $.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);a.put("chain",this.chain.getIDStr());var b=this.getResno();0<b&&a.put("sequenceNumber",
Integer.$valueOf(b));b=this.getInsertionCode();0!=b.charCodeAt(0)&&a.put("insertionCode",""+b);b=this.getGroupParameter(1112539145);Float.isNaN(b)||a.put("phi",Float.$valueOf(b));b=this.getGroupParameter(1112539146);Float.isNaN(b)||a.put("psi",Float.$valueOf(b));b=this.getGroupParameter(1112539141);Float.isNaN(b)||a.put("mu",Float.$valueOf(b));b=this.getGroupParameter(1112539152);Float.isNaN(b)||a.put("theta",Float.$valueOf(b));b=this.getProteinStructure();null!=b&&(a.put("structureId",Integer.$valueOf(b.strucNo)),
a.put("structureType",b.type.getBioStructureTypeName(!1)));a.put("shapeVisibilityFlags",Integer.$valueOf(this.shapeVisibilityFlags));return a});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,JU.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,JU.BS");$_M(c$,"getMonomerSequenceAtoms",function(a,b){this.selectAtoms(b);b.and(a)},"JU.BS,JU.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?JU.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(),a=(null==b?"":"_"+b.getModelIndex())+"_"+this.getResno()+(0==a?"":"_"+a),b=null==b?"\x00":this.getLeadAtom().getAlternateLocationID();"\x00"!=b&&(a+="_"+b);return a});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},"JU.List");$_M(c$,"getCrossLink",function(a,b){return this.getCrossLinkGroup(a,b,null)},"~N,JU.List");$_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,JU.List,J.modelset.Group");Clazz.overrideMethod(c$,"isConnectedPrevious",function(){return!0})});Clazz.declarePackage("J.modelsetbio");
Clazz.load(["J.modelsetbio.Monomer"],"J.modelsetbio.AlphaMonomer","JU.V3 J.constant.EnumStructure J.modelsetbio.Helix $.Sheet $.Turn J.util.Quaternion".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 JU.V3,c=new JU.V3;switch(a){default:case "a":case "n":case "p":case "q":return null;case "b":case "c":case "x":if(0==this.monomerIndex||this.monomerIndex==this.bioPolymer.monomerCount-1)return null;a=this.getLeadAtom();var d=this.bioPolymer.getLeadPoint(this.monomerIndex+
1),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(["JU.V3"],"J.modelsetbio.ProteinStructure",["JU.ArrayUtil","$.P3","J.util.Logger"],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 JU.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=JU.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 JU.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=JU.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",["JU.P3","$.V3","J.constant.EnumStructure","J.util.Measure"],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 JU.P3,this.apolymer.getLeadMidPoint(this.monomerIndexFirst+b,a[b]);this.axisA=new JU.P3;this.axisUnitVector=new JU.V3;J.util.Measure.calcBestAxisThroughPoints(a,this.axisA,this.axisUnitVector,this.vectorProjection,4);this.axisB=JU.P3.newP(a[this.monomerCount]);J.util.Measure.projectOntoAxis(this.axisB,this.axisA,this.axisUnitVector,this.vectorProjection)}})});Clazz.declarePackage("J.modelsetbio");
Clazz.load(["J.modelsetbio.ProteinStructure"],"J.modelsetbio.Sheet",["JU.P3","$.V3","J.constant.EnumStructure","J.util.Measure"],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 JU.P3,this.alphaPolymer.getLeadMidPoint(this.monomerIndexFirst+1,this.axisA),this.axisB=new JU.P3,this.alphaPolymer.getLeadMidPoint(this.monomerIndexFirst+this.monomerCount-1,this.axisB));this.axisUnitVector=
new JU.V3;this.axisUnitVector.sub2(this.axisB,this.axisA);this.axisUnitVector.normalize();var a=new JU.P3;this.alphaPolymer.getLeadMidPoint(this.monomerIndexFirst,a);this.lowerNeighborIsHelixOrSheet()||J.util.Measure.projectOntoAxis(a,this.axisA,this.axisUnitVector,this.vectorProjection);var b=new JU.P3;this.alphaPolymer.getLeadMidPoint(this.monomerIndexFirst+this.monomerCount,b);this.upperNeighborIsHelixOrSheet()||J.util.Measure.projectOntoAxis(b,this.axisA,this.axisUnitVector,this.vectorProjection);
this.axisA=a;this.axisB=b}});$_M(c$,"calcSheetUnitVectors",function(){if(Clazz.instanceOf(this.alphaPolymer,J.modelsetbio.AminoPolymer)&&null==this.widthUnitVector){var a=new JU.V3,b=new JU.V3,c=this.alphaPolymer.monomers[this.monomerIndexFirst];b.sub2(c.getCarbonylOxygenAtom(),c.getCarbonylCarbonAtom());for(var d=this.monomerCount;--d>this.monomerIndexFirst;)c=this.alphaPolymer.monomers[d],a.sub2(c.getCarbonylOxygenAtom(),c.getCarbonylCarbonAtom()),1.5707964>b.angle(a)?b.add(a):b.sub(a);this.heightUnitVector=
a;this.heightUnitVector.cross(this.axisUnitVector,b);this.heightUnitVector.normalize();this.widthUnitVector=b;this.widthUnitVector.cross(this.axisUnitVector,this.heightUnitVector)}});$_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(["JU.V3"],"J.modelsetbio.BioPolymer","java.lang.Float java.util.Hashtable JU.BS $.List $.P3 J.util.Escape $.Logger $.Quaternion $.Txt".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=JU.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)},"JU.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,c,d){var e;for(e=this.monomerCount;0<=--e;){var f=this.monomers[e];if(f.chain.chainID==a&&f.seqcode==b&&(0>c||c==f.firstAtomIndex||d==f.lastAtomIndex))break}return e},"~N,~N,~N,~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,JU.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()},"JU.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()},"JU.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 JU.V3;null==this.controlPoints&&(this.controlPoints=Array(this.monomerCount+1));Float.isNaN(a)||(this.sheetSmoothing=a);for(a=0;a<this.monomerCount;a++)this.controlPoints[a]=this.getControlPoint(a,b);this.controlPoints[this.monomerCount]=this.getTerminatorPoint();this.invalidControl=!1;return this.controlPoints},
$fz.isPrivate=!0,$fz),"~N");$_M(c$,"getControlPoint",function(a){return this.leadPoints[a]},"~N,JU.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=
JU.BS.newN(this.monomerCount):this.reversed.clearAll();this.twistedSheets=this.model.modelSet.viewer.getBoolean(603979968);var a=new JU.V3,b=new JU.V3,c=new JU.V3,d=new JU.V3,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=JU.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]=JU.V3.newV(d))}this.leadPoints[this.monomerCount]=this.leadMidpoints[this.monomerCount]=this.getTerminatorPoint();if(!this.hasWingPoints)if(3>this.monomerCount)this.wingVectors[1]=this.unitVectorX;else{d=null;for(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]=JU.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,JU.BS");$_M(c$,"getSelectedMonomerCount",function(){return this.selectedMonomerCount});$_M(c$,"calcSelectedMonomersCount",function(a){this.selectedMonomerCount=0;null==this.bsSelectedMonomers&&(this.bsSelectedMonomers=new JU.BS);this.bsSelectedMonomers.clearAll();for(var b=0;b<this.monomerCount;b++)this.monomers[b].isSelected(a)&&(++this.selectedMonomerCount,this.bsSelectedMonomers.set(b))},"JU.BS");$_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],JU.P3.newP(e[g])]),a=g):2147483646!=a&&(c.addLast([d[g],JU.P3.newP(e[g])]),a=2147483646);a+1<f&&c.addLast([d[a+1],JU.P3.newP(e[a+1])]);return a},"~N,JU.BS,JU.List,~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 JU.List,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 JU.List),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},"JU.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,JU.BS,JU.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,p,r,v){var u="C"==d||"P"==d,n="R"==c||"S"==c&&u;if(!n||b.calcPhiPsiAngles()){var w=Clazz.instanceOf(b,J.modelsetbio.AminoPolymer),s="r"==c,q=!n&&"S"==c;2==f&&s&&(c="w");q&&(f=2);var D="S"==c,E=0<="rcpCP".indexOf(d);J.util.Logger.debugging&&(q||u)&&J.util.Logger.debug("For straightness calculation: useQuaternionStraightness = "+D+" and quaternionFrame = "+d);if(l&&!k){p.append("REMARK   6    AT GRP CH RESNO  ");
switch(c){default:case "w":p.append("x*10___ y*10___ z*10___      w*10__       ");break;case "x":p.append("y*10___ z*10___ w*10___      x*10__       ");break;case "y":p.append("z*10___ w*10___ x*10___      y*10__       ");break;case "z":p.append("w*10___ x*10___ y*10___      z*10__       ");break;case "R":E?p.append("phi____ psi____ theta         Straightness"):p.append("phi____ psi____ omega-180    PartialCharge")}p.append("    Sym   q0_______ q1_______ q2_______ q3_______");p.append("  theta_  aaX_______ aaY_______ aaZ_______");
"R"!=c&&p.append("  centerX___ centerY___ centerZ___");"n"==d&&p.append("  NHX_______ NHY_______ NHZ_______");p.append("\n\n")}l="R"==c?1:10;j=!1;for(var t=0;t<(j?2:1);t++,l*=-1)for(var F=0;F<(1>e?1:e);F++)J.modelsetbio.BioPolymer.getData(a,F,e,b,c,d,f,g,h,k,n,u,D,E,q,l,w,s,m,p,r,v)}},"J.viewer.Viewer,J.modelsetbio.BioPolymer,~S,~S,~N,~N,JU.BS,JU.BS,~B,~B,~B,~A,J.io.JmolOutputChannel,JU.SB,JU.BS");c$.getData=$_M(c$,"getData",($fz=function(a,b,c,d,e,f,g,h,j,k,l,m,p,r,v,u,n,w,s,q,D,E){v=0<g?"dq"+(2==
g?"2":""):"q";for(var t,F=null,H=null,A=null,M=null,O=null,K=null,z=A=0,B=0,x=0,y="",I=NaN,P=NaN,N=k?new JU.P3:null,R=1>=c?1:c;b<d.monomerCount;b+=R){var C=d.monomers[b];if(null==h||h.get(C.leadAtomIndex)){var G=C.getLeadAtom(),y=C.getUniqueID();if(l){"S"==e&&C.setGroupParameter(1112539150,NaN);A=C.getGroupParameter(1112539145);z=C.getGroupParameter(1112539146);B=C.getGroupParameter(1112539144);-90>B&&(B+=360);B-=180;if(Float.isNaN(A)||Float.isNaN(z)||Float.isNaN(B)){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){C.setGroupParameter(1112539150,Q);continue}if(k){if(null!=j&&!j.get(G.getIndex()))continue;N.set(-A,A,0.5);q.append('draw ID "phi').append(y).append('" ARROW ARC ').append(J.util.Escape.eP(C.getNitrogenAtom())).append(J.util.Escape.eP(G)).append(J.util.Escape.eP(C.getCarbonylCarbonAtom())).append(J.util.Escape.eP(N)).append(' "phi = ').append(String.valueOf(Math.round(A))).append('" color ').append(J.modelsetbio.BioPolymer.qColor[2]).append("\n");
N.set(0,z,0.5);q.append('draw ID "psi').append(y).append('" ARROW ARC ').append(J.util.Escape.eP(G)).append(J.util.Escape.eP(C.getCarbonylCarbonAtom())).append(J.util.Escape.eP(C.getNitrogenAtom())).append(J.util.Escape.eP(N)).append(' "psi = ').append(String.valueOf(Math.round(z))).append('" color ').append(J.modelsetbio.BioPolymer.qColor[1]).append("\n");q.append('draw ID "planeNCC').append(y).append('" ').append(J.util.Escape.eP(C.getNitrogenAtom())).append(J.util.Escape.eP(G)).append(J.util.Escape.eP(C.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(C.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(C.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 t=J.util.Quaternion.newVA(JU.P3.new3(1,0,0),L),y=t.getInfo(),r?(B=L,x=Q):x=G.getPartialCharge()}else{t=C.getQuaternion(f);null!=t&&(t.setRef(O),O=J.util.Quaternion.newQ(t));2==g&&C.setGroupParameter(1112539150,NaN);null==t?O=H=null:0<g&&(z=G,B=t,null==H?M=t=null:(A=w?H.leftDifference(t):t.rightDifference(H),1==g?t=A:null==M?t=null:(t=A.rightDifference(M),I=J.modelsetbio.BioPolymer.getQuaternionStraightness(y,M,A),P=J.modelsetbio.BioPolymer.get3DStraightness(y,
M,A),F.getGroup().setGroupParameter(1112539150,p?I:P)),M=A),F=z,H=B);if(null==t){K=null;continue}switch(e){default:A=t.q1;z=t.q2;B=t.q3;x=t.q0;break;case "x":A=t.q0;z=t.q1;B=t.q2;x=t.q3;break;case "y":A=t.q3;z=t.q0;B=t.q1;x=t.q2;break;case "z":A=t.q2,z=t.q3,B=t.q0,x=t.q1}L=C.getQuaternionFrameCenter(f);null==L&&(L=new JU.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(t.draw(v,y,L,1)),"n"==f&&n&&(t=C.getNitrogenHydrogenPoint(),
null!=t&&q.append('draw ID "').append(v).append("nh").append(y).append('" width 0.1 ').append(J.util.Escape.eP(t)).append("\n")));if(1==g){q.append(C.getHelixData(135176,f,c)).append("\n");continue}N.set(2*A,2*z,2*B);q.append('draw ID "').append(v).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=t.getInfo()+J.util.Txt.sprintf("  %10.5p %10.5p %10.5p",
"p",[L]);"n"==f&&n?y+=J.util.Txt.sprintf("  %10.5p %10.5p %10.5p","p",[C.getNitrogenHydrogenPoint()]):2==g&&!Float.isNaN(I)&&(y+=J.util.Txt.sprintf(" %10.5f %10.5f","F",[[I,P]]))}null!=q&&(E.set(G.getGroup().leadAtomIndex),q.append(a.modelSet.getLabeler().formatLabelAtomArray(a,G,s,"\x00",null)),q.append(J.util.Txt.sprintf("%8.2f%8.2f%8.2f      %6.3f          %2s    %s\n","ssF",[G.getElementSymbolIso(!1).toUpperCase(),y,[A*u,z*u,B*u,x*u]])),null!=K&&K.getPolymerIndexInModel()==G.getPolymerIndexInModel()&&
D.append("CONECT").append(J.util.Txt.formatStringI("%5i","i",K.getAtomNumber())).append(J.util.Txt.formatStringI("%5i","i",G.getAtomNumber())).appendC("\n"),K=G)}}},$fz.isPrivate=!0,$fz),"J.viewer.Viewer,~N,~N,J.modelsetbio.BioPolymer,~S,~S,~N,JU.BS,JU.BS,~B,~B,~B,~B,~B,~B,~N,~B,~B,~A,J.io.JmolOutputChannel,JU.SB,JU.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 JU.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,JU.BS,JU.BS");$_M(c$,"calcRasmolHydrogenBonds",function(){},"J.modelsetbio.BioPolymer,JU.BS,JU.BS,JU.List,~N,~A,~B,~B");$_M(c$,"setStructureList",function(){},"java.util.Map");
$_M(c$,"getPdbData",function(){},"J.viewer.Viewer,~S,~S,~N,~N,JU.BS,JU.BS,~B,~B,~B,~A,J.io.JmolOutputChannel,JU.SB,JU.BS");$_M(c$,"getType",function(){return this.type});$_M(c$,"calculateStruts",function(){return null},"J.modelset.ModelSet,JU.BS,JU.BS,JU.List,~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","JU.BS $.List $.P3 J.constant.EnumStructure J.modelsetbio.Helix $.Sheet $.Turn J.util.Logger $.Measure".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=JU.P3.newP(this.leadPoints[a]);
c.add(b);return c},"~N,JU.V3");$_M(c$,"getPdbData",function(a,b,c,d,e,f,g,h,j,k,l,m,p,r){J.modelsetbio.BioPolymer.getPdbData(a,this,b,c,d,e,f,g,h,j,k,l,m,p,r)},"J.viewer.Viewer,~S,~S,~N,~N,JU.BS,JU.BS,~B,~B,~B,~A,J.io.JmolOutputChannel,JU.SB,JU.BS");$_M(c$,"addStructure",function(a,b,c,d,e,f,g,h,j,k,l){var m=-1,p=-1;if(j<k){if(this.monomers[0].firstAtomIndex>k||this.monomers[this.monomerCount-1].lastAtomIndex<j)return;m=j;p=k}var r;if(!(-1==(e=this.getIndex(e,f,m,p))||-1==(r=this.getIndex(g,h,m,p)))){if(0<=
j&&null!=l&&(g=l.nextSetBit(this.monomers[e].firstAtomIndex),0<=g&&g<this.monomers[r].lastAtomIndex))return;this.addStructureProtected(a,b,c,d,e,r);0<=j&&l.setBits(j,k+1)}},"J.constant.EnumStructure,~S,~N,~N,~N,~N,~N,~N,~N,~N,JU.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,JU.BS,JU.BS,JU.List,~N,~N,~B");$_M(c$,"calculateStrutsStatic",($fz=function(a,b,c,d,e,f,g){var h=new JU.List,j=e*e,k=d.size(),l=new JU.BS,m=new JU.BS,p=new JU.BS,r=d.get(0),v;a=a.getBioPolymerCountInModel(r.modelIndex);for(var u=Clazz.newIntArray(a,6,0),n=0;n<k;n++){var r=d.get(n),w=r.getPolymerIndexInModel(),s=r.getMonomerIndex(),q=s;3>q&&(u[w][q]=n+1);q=r.getGroup().getBioPolymerLength()-s-1;3>q&&(u[w][3+q]=n+1)}w=Clazz.newFloatArray(Clazz.doubleToInt(k*(k-1)/
2),0);for(n=0;n<k;n++){r=d.get(n);for(s=n+1;s<k;s++){q=J.modelsetbio.AlphaPolymer.strutPoint(n,s,k);v=d.get(s);var D=r.getResno(),E=r.getPolymerIndexInModel(),t=v.getResno(),F=v.getPolymerIndexInModel();E==F&&Math.abs(t-D)<f&&p.set(q);(w[q]=r.distanceSquared(v))>=j&&m.set(q)}}for(r=5;0<=--r;){j=(e-r)*(e-r);for(n=0;n<k;n++)if(g||!l.get(n))for(s=n+1;s<k;s++)q=J.modelsetbio.AlphaPolymer.strutPoint(n,s,k),!m.get(q)&&(!p.get(q)&&(g||!l.get(s))&&w[q]<=j)&&J.modelsetbio.AlphaPolymer.setStrut(n,s,k,d,b,c,
h,l,m,p,f)}for(e=0;e<a;e++){for(g=0;6>g;g++)if(n=u[e][g]-1,0<=n&&l.get(n))for(s=0;3>s;s++)q=3*Clazz.doubleToInt(g/3)+s,0<=(n=u[e][q]-1)&&l.set(n),u[e][q]=-1;if(!(-1==u[e][0]&&-1==u[e][3])){for(var r=j=!1,t=E=D=v=0,H=F=3.4028235E38,s=0;s<k;s++)for(g=0;6>g;g++)if(n=u[e][g]-1,-2==n)g=3*(Clazz.doubleToInt(g/3)+1)-1;else if(!(s==n||-1==n))if(q=J.modelsetbio.AlphaPolymer.strutPoint(n,s,k),!(p.get(q)||w[q]>(3>g?F:H)))3>g?(m.get(q)&&(j=!0),D=s,v=n,F=w[q]):(m.get(q)&&(r=!0),t=s,E=n,H=w[q]);j&&J.modelsetbio.AlphaPolymer.setStrut(v,
D,k,d,b,c,h,l,m,p,f);r&&J.modelsetbio.AlphaPolymer.setStrut(E,t,k,d,b,c,h,l,m,p,f)}}return h},$fz.isPrivate=!0,$fz),"J.modelset.ModelSet,JU.BS,JU.BS,JU.List,~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,JU.List,JU.BS,JU.BS,JU.List,JU.BS,JU.BS,JU.BS,~N");$_M(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","JU.A4 $.M3 $.P3 $.V3 J.constant.EnumStructure J.util.Escape $.Logger $.Quaternion $.Txt".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 JU.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=JU.P3.newP(a);J.util.Logger.debugging&&J.util.Logger.debug('draw ID "pta'+this.monomerIndex+"_"+e.index+'" '+J.util.Escape.eP(e)+J.util.Escape.eP(a)+" # "+e);return!0},"JU.P3,JU.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=JU.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 JU.V3,e=new JU.V3,f=null;switch(a){case "a":case "n":if(0==this.monomerIndex||15==this.groupID)return null;f=new JU.V3;null==this.ptTemp&&(this.ptTemp=new JU.P3);this.getNHPoint(this.ptTemp,
f,!0,!1);e.sub2(c,this.getNitrogenAtom());e.cross(f,e);b=new JU.M3;b.setAA(JU.A4.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.Txt.formatStringI("%3N %3ID","N",this.proteinStructure.serialID);a=J.util.Txt.formatStringS(a,"ID",this.proteinStructure.structureID);this.proteinStructure.type===J.constant.EnumStructure.SHEET&&(a+=J.util.Txt.formatStringI("%2SC","SC",this.proteinStructure.strandCount));return a});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","JU.P3 $.V3 J.constant.EnumStructure J.modelset.HBond J.util.Logger $.Measure".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(1112539145,J.util.Measure.computeTorsion(e,f,g,h,!0));a.setGroupParameter(1112539146,J.util.Measure.computeTorsion(c,d,e,f,!0));a.setGroupParameter(1112539144,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(1112539146),
d=this.monomers[a].getGroupParameter(1112539146),e=this.monomers[a].getGroupParameter(1112539145),f=a==this.monomerCount-1?NaN:this.monomers[a+1].getGroupParameter(1112539145),g=a==this.monomerCount-1?NaN:this.monomers[a+1].getGroupParameter(1112539146);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");Clazz.overrideMethod(c$,
"calcRasmolHydrogenBonds",function(a,b,c,d,e,f,g,h){null==a&&(a=this);if(Clazz.instanceOf(a,J.modelsetbio.AminoPolymer)){e=new JU.P3;for(var j=new JU.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 p=null==b||b.get(k.getNitrogenAtom().index);if(p&&(g||null!=k.getCarbonylOxygenAtom()))this.checkRasmolHydrogenBond(k,a,m,
e,p?c:b,d,l,g)}}},"J.modelsetbio.BioPolymer,JU.BS,JU.BS,JU.List,~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 p=l.getCarbonylOxygenAtom();if(!(null==p||null!=e&&!e.get(p.index)))if(p=l.getLeadAtom(),!(81<=j.distanceSquared(p))){p=this.calcHbondEnergy(k,d,l,h);if(p<g[0][2])l=g[1],g[1]=g[0],g[0]=l;else if(p<g[1][2])l=
g[1];else continue;l[0]=b.bioPolymerIndexInModel;l[1]=-500>p?m:-1-m;l[2]=p}}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,JU.P3,JU.BS,JU.List,~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),"JU.P3,JU.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,JU.List");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(1112539145),f=c.getGroupParameter(1112539146);
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()+" aminopolymer:"+b+" "+d.getGroupParameter(1112539145)+","+c.getGroupParameter(1112539146)+" "+a[b])}for(b=0;b<this.monomerCount;++b)if("4"==a[b]){for(c=b+1;c<this.monomerCount&&"4"==a[c];++c);c--;c>=b+3&&this.addStructureProtected(J.constant.EnumStructure.HELIX,null,0,0,b,c);b=c}for(b=0;b<this.monomerCount;++b)if("3"==a[b]){for(c=b+1;c<
this.monomerCount&&"3"==a[c];++c);c--;c>=b+3&&this.addStructureProtected(J.constant.EnumStructure.HELIX,null,0,0,b,c);b=c}for(b=0;b<this.monomerCount;++b)if("s"==a[b]){for(c=b+1;c<this.monomerCount&&"s"==a[c];++c);c--;c>=b+2&&this.addStructureProtected(J.constant.EnumStructure.SHEET,null,0,0,b,c);b=c}for(b=0;b<this.monomerCount;++b)if("t"==a[b]){for(c=b+1;c<this.monomerCount&&"t"==a[c];++c);c--;c>=b+2&&this.addStructureProtected(J.constant.EnumStructure.TURN,null,0,0,b,c);b=c}}},"~B");$_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)});Clazz.declarePackage("J.modelsetbio");
Clazz.load(["J.modelset.Model"],"J.modelsetbio.BioModel","java.lang.Float java.util.Hashtable JU.ArrayUtil $.BS $.List $.SB J.api.Interface J.constant.EnumStructure J.modelset.AtomCollection J.modelsetbio.Resolver J.util.BSUtil $.Escape $.Txt 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");Clazz.overrideMethod(c$,"freeze",function(){this.freezeM();this.bioPolymers=JU.ArrayUtil.arrayCopyObject(this.bioPolymers,this.bioPolymerCount)});$_M(c$,"addSecondaryStructure",function(a,b,c,d,e,f,g,h,j,k,l){for(var m=this.bioPolymerCount;0<=--m;)Clazz.instanceOf(this.bioPolymers[m],J.modelsetbio.AlphaPolymer)&&this.bioPolymers[m].addStructure(a,b,c,
d,e,f,g,h,j,k,l)},"J.constant.EnumStructure,~S,~N,~N,~N,~N,~N,~N,~N,~N,JU.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;)Clazz.instanceOf(this.bioPolymers[f],J.modelsetbio.AlphaPolymer)&&
this.bioPolymers[f].calculateStructures(e);return a?this.calculateDssp(null,b,c,d):""},"~B,~B,~B,~B,~B");$_M(c$,"calculateDssp",($fz=function(a,b,c,d){return J.api.Interface.getOptionInterface("dssx.DSSP").calculateDssp(this.bioPolymers,this.bioPolymerCount,a,b,c,d)},$fz.isPrivate=!0,$fz),"JU.List,~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)},"JU.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},"JU.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)},"JU.BS");$_M(c$,"getBioPolymer",function(a){return this.bioPolymers[a]},"~N");Clazz.overrideMethod(c$,"getDefaultLargePDBRendering",
function(a,b){var c=new JU.BS;0==this.getBondCount()&&(c=this.bsAtoms);if(c!==this.bsAtoms)for(var d=0;d<this.bioPolymerCount;d++)this.bioPolymers[d].getRange(c);if(!(0>c.nextSetBit(0))){var e=new JU.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;")))}},"JU.SB,~N");Clazz.overrideMethod(c$,"fixIndices",function(a,b,c){this.fixIndicesM(a,b,c);for(a=0;a<this.bioPolymerCount;a++)this.bioPolymers[a].recalculateLeadMidpointsAndWingVectors()},"~N,~N,JU.BS");Clazz.overrideMethod(c$,"calculateStruts",function(a,b,c){var d=new JU.List,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,JU.BS,JU.BS");Clazz.overrideMethod(c$,"setStructureList",function(a){this.bioPolymers=JU.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 JU.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)},"JU.BS,JU.List,~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 JU.BS,this.bioPolymers[c].getRange(b),0<=b.nextSetBit(0)&&(null==a&&(a=new JU.List),a.addLast(b));return a},"JU.List");Clazz.overrideMethod(c$,"getGroupsWithin",function(a,b,c){for(var d=this.bioPolymerCount;0<=--d;)this.bioPolymers[d].getRangeGroups(a,b,c)},"~N,JU.BS,JU.BS");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,JU.BS,JU.BS");Clazz.overrideMethod(c$,"selectSeqcodeRange",function(a,b,c,d,e){for(var f,g=this.chainCount;0<=--g;){var h=this.chains[g];if(-1==c||c==(f=h.chainID)||!e&&256>f&&c==J.modelset.AtomCollection.chainToUpper(f))for(h=0;0<=h;)h=this.chains[g].selectSeqcodeRange(h,a,b,d)}},"~N,~N,~N,JU.BS,~B");Clazz.overrideMethod(c$,"getRasmolHydrogenBonds",function(a,b,c,d,e,f,g){var h=null==c;h&&(c=new JU.List);0>e&&(e=2147483647);var j,k;
if(null==b&&0<this.bioPolymerCount)this.calculateDssp(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 p=this.bioPolymerCount;0<=--p;)null!=(k=this.bioPolymers[p])&&((m||f!=p)&&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))}},"JU.BS,JU.BS,JU.List,~B,~N,~B,JU.BS");Clazz.overrideMethod(c$,"clearRasmolHydrogenBonds",function(a){var b=new JU.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)},"JU.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,JU.BS,~B");$_M(c$,"addBioPolymer",($fz=function(a){0==this.bioPolymers.length&&this.clearBioPolymers();this.bioPolymerCount==this.bioPolymers.length&&(this.bioPolymers=JU.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 JU.List,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))},"JU.BS,java.util.Map,JU.List");Clazz.overrideMethod(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++;this.getChimeInfoM(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)},"JU.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 JU.SB,j=new JU.SB,k=new JU.SB,l=new JU.SB,m=J.constant.EnumStructure.NONE,p=J.constant.EnumStructure.NONE,r=0,v=0,u=-1,n=-1,w=0,s=0,q="",D="",E="",t="",F="",H=0,A=0,M=0,O=0,K=null,r=this.modelSet.models,z=this.modelSet.atoms,B=this.modelSet.getAtomCount();if(b){if(!this.modelSet.proteinStructureTainted)return"";for(var K=new JU.BS,x=this.firstAtomIndex;x<B;x++)r[z[x].modelIndex].isStructureTainted()&&
K.set(x);K.set(B)}for(x=0;x<=B;x++)if((x==B||null==a||a.get(x))&&(!b||K.get(x))){r=0;if(x==B||(r=z[x].getStrucNo())!=n){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=z[v].modelIndex,I="    \t# model="+this.modelSet.getModelNumberDotted(y);u!=y&&(u=y,h.append("  structure none ").append(J.util.Escape.eBS(this.modelSet.getModelAtomBitSetIncludingDeleted(y,!1))).append(I).append(";\n"));I+=" & ("+w+" - "+
s+")";y=p.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=++A;if(null==q||f)q=J.util.Txt.formatStringI("%3N %3N","N",g);g="HELIX  %ID %3GROUPA %1CA %4RESA  %3GROUPB %1CB %4RESB";I=k;y=null;switch(p){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.Txt.formatStringI("%3N %3A 0","N",g),q=J.util.Txt.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.Txt.formatStringI("%3N %3N","N",g);g="TURN   %ID %3GROUPA %1CA%4RESA  %3GROUPB %1CB%4RESB";I=j}g=J.util.Txt.formatStringS(g,"ID",q);g=J.util.Txt.formatStringS(g,"GROUPA",D);g=J.util.Txt.formatStringS(g,"CA",t);g=J.util.Txt.formatStringI(g,
"RESA",w);g=J.util.Txt.formatStringS(g,"GROUPB",E);g=J.util.Txt.formatStringS(g,"CB",F);g=J.util.Txt.formatStringI(g,"RESB",s);I.append(g);e&&I.append(" strucno= ").appendI(n);I.append("\n")}}g=null}if(0==r||null!=a&&c&&(Float.isNaN(z[x].getGroupParameter(1112539145))||Float.isNaN(z[x].getGroupParameter(1112539146))))continue}v=z[x].getChainIDStr();null==g&&(g=new JU.BS,w=z[x].getResno(),D=z[x].getGroup3(!1),t=v);m=z[x].getProteinStructureType();p=z[x].getProteinStructureSubType();q=z[x].getProteinStructureTag();
g.set(x);n=r;s=z[x].getResno();E=z[x].getGroup3(!1);F=v;v=x}0<H&&h.append("\n");return d?h.toString():k.appendSB(l).appendSB(j).appendSB(h).toString()},"JU.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),p=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,p,this.bsAtoms,e,k,d,0==b,g,f,h,j)},"J.viewer.Viewer,~S,~S,~B,JU.BS,J.io.JmolOutputChannel,~A,JU.SB,JU.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",["JU.V3","J.constant.EnumStructure","J.util.Quaternion"],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 JU.V3,e=new JU.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",["JU.P3","$.V3","J.constant.EnumStructure","J.util.Quaternion"],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 JU.P3;for(var b=0;b<J.modelsetbio.NucleicMonomer.heavyAtomIndexes.length;b++){var c=
this.getAtomFromOffsetIndex(J.modelsetbio.NucleicMonomer.heavyAtomIndexes[b]);null!=c&&(this.baseCenter.add(c),a++)}this.baseCenter.scale(1/a)}return this.baseCenter;default:return this.getN0()}},"~S");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=JU.V3.newVsub(b,a);c=JU.V3.newVsub(c,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},"JU.List");$_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",["JU.P4","$.V3","J.modelset.HBond","J.util.Measure"],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(1112539141,a);c.setGroupParameter(1112539152,e)}return!0});Clazz.overrideMethod(c$,"calcRasmolHydrogenBonds",function(a,b,c,d,e){for(var f=new JU.V3,g=new JU.V3,h=new JU.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 p=k.getN1(),r=k.getN0(),v=new JU.P4;J.util.Measure.getPlaneThroughPoints(l,p,r,f,g,h,v);for(var l=null,u=25,n=null,w=a.monomerCount;0<=--w;){var s=a.monomers[w];if(s.isPyrimidine()){var q=s.getN3();if(!(m?!c.get(q.index):!b.get(q.index))){var D=s.getN0(),E=p.distanceSquared(q);E<u&&(50<r.distanceSquared(D)&&1>Math.abs(J.util.Measure.distanceToPlane(v,q)))&&(n=s,l=q,u=E)}}}m=0;null!=l&&(m+=J.modelsetbio.NucleicPolymer.addHydrogenBond(d,
p,l),m>=e||(k.isGuanine()?(m+=J.modelsetbio.NucleicPolymer.addHydrogenBond(d,k.getN2(),n.getO2()),m>=e||J.modelsetbio.NucleicPolymer.addHydrogenBond(d,k.getO6(),n.getN4())):J.modelsetbio.NucleicPolymer.addHydrogenBond(d,k.getN6(),n.getO4())))}}}},"J.modelsetbio.BioPolymer,JU.BS,JU.BS,JU.List,~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},"JU.List,J.modelset.Atom,J.modelset.Atom");$_M(c$,
"getPdbData",function(a,b,c,d,e,f,g,h,j,k,l,m,p,r){J.modelsetbio.BioPolymer.getPdbData(a,this,b,c,d,e,f,g,h,j,k,l,m,p,r)},"J.viewer.Viewer,~S,~S,~N,~N,JU.BS,JU.BS,~B,~B,~B,~A,J.io.JmolOutputChannel,JU.SB,JU.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,p,r){J.modelsetbio.BioPolymer.getPdbData(a,this,b,c,d,e,f,g,h,j,k,l,m,p,r)},"J.viewer.Viewer,~S,~S,~N,~N,JU.BS,JU.BS,~B,~B,~B,~A,J.io.JmolOutputChannel,JU.SB,JU.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 JU.ArrayUtil $.BS J.constant.EnumPalette $.EnumStructure J.util.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,JU.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 JU.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,JU.BS");$_M(c$,"setMad",function(a,b,c){if(!(2>this.monomerCount)){this.isActive=!0;null==this.bsSizeSet&&(this.bsSizeSet=new JU.BS);for(var d=this.shape.myVisibilityFlag,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,JU.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 JU.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,JU.BS");$_M(c$,"setColixes",function(a,b){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=new JU.BS);for(var c=this.monomerCount;0<=--c;){var d=this.leadAtomIndices[c];b.get(d)&&(c<this.colixes.length&&d<a.length)&&(this.colixes[c]=this.shape.getColixI(a[d],J.constant.EnumPalette.UNKNOWN.id,d),null!=this.colixesBack&&
c<this.colixesBack.length&&(this.colixesBack[c]=0),this.paletteIDs[c]=J.constant.EnumPalette.UNKNOWN.id,this.bsColixSet.set(c))}},"~A,JU.BS");$_M(c$,"setParams",function(a,b,c){if(0!=this.monomerCount){var d=a[0];a=a[1];this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=new JU.BS);for(var e=b.length,f=this.monomerCount;0<=--f;){var g=this.leadAtomIndices[f];if(c.get(g)&&f<this.colixes.length&&g<e){var h=b[g],j=null==d?0:d[h],h=null==a?0:a[h];0.01<h&&(j=J.util.C.getColixTranslucent3(j,!0,h));
this.colixes[f]=this.shape.getColixI(j,J.constant.EnumPalette.UNKNOWN.id,g);null!=this.colixesBack&&f<this.colixesBack.length&&(this.colixesBack[f]=0);this.paletteIDs[f]=J.constant.EnumPalette.UNKNOWN.id;this.bsColixSet.set(f)}}}},"~A,~A,JU.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=JU.ArrayUtil.ensureLengthShort(this.colixesBack,
this.colixes.length)),this.colixesBack[c]=a)},"~N,JU.BS");$_M(c$,"setTranslucent",function(a,b,c){this.isActive=!0;null==this.bsColixSet&&(this.bsColixSet=new JU.BS);for(var d=this.monomerCount;0<=--d;)b.get(this.leadAtomIndices[d])&&(this.colixes[d]=J.util.C.getColixTranslucent3(this.colixes[d],a,c),null!=this.colixesBack&&this.colixesBack.length>d&&(this.colixesBack[d]=J.util.C.getColixTranslucent3(this.colixesBack[d],a,c)),this.bsColixSet.setBitTo(d,0!=this.colixes[d]))},"~B,JU.BS,~N");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",["JU.ArrayUtil","J.constant.EnumPalette","J.shapebio.BioShape","J.util.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,JU.BS");Clazz.overrideMethod(c$,"setProperty",function(a,b,c){this.setPropBSC(a,b,c)},"~S,~O,JU.BS");$_M(c$,"setPropBSC",function(a,b,c){if("refreshTrajectories"===a){c=b[0].intValue();for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],b.modelIndex==c&&b.falsifyMesh()}else if("deleteModelAtoms"===a){this.atoms=b[1];c=b[2][0];for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],b.modelIndex>c?(b.modelIndex--,b.leadAtomIndices=b.bioPolymer.getLeadAtomIndices()):
b.modelIndex==c&&(this.bioShapes=JU.ArrayUtil.deleteElements(this.bioShapes,a,1))}else if(this.initialize(),"color"===a){var d=J.constant.EnumPalette.pidOf(b),e=J.util.C.getColixO(b);for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],0<b.monomerCount&&b.setColixBS(e,d,c)}else if("params"===a){a=c.length();d=Clazz.newIntArray(a,0);e=0;for(a=c.nextSetBit(0);0<=a;a=c.nextSetBit(a+1),e++)d[a]=e;for(a=this.bioShapes.length;0<=--a;)this.bioShapes[a].setParams(b,d,c)}else if("colorPhase"===a){d=J.util.C.getColixO(b[0]);
e=J.util.C.getColixO(b[1]);for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],0<b.monomerCount&&(b.setColixBS(e,0,c),b.setColixBack(d,c))}else if("translucency"===a){d="translucent".equals(b);for(a=this.bioShapes.length;0<=--a;)b=this.bioShapes[a],0<b.monomerCount&&b.setTranslucent(d,c,this.translucentLevel)}else this.setPropS(a,b,c)},"~S,~O,JU.BS");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,JU.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}}},"JU.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","JU.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,JU.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 JU.BS);f.isActive=!0;for(var k=f.monomerCount-1;0<=--k;){var l=h[k],m=h[k+1],p=c.get(l),r=c.get(m);if(p&&r||d&&
p||g&&(p||r)){f.monomers[k].setShapeVisibility(this.myVisibilityFlag,j);p=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&&(p.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,JU.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.Strands",null,function(){c$=Clazz.decorateAsClass(function(){this.isMesh=!1;Clazz.instantialize(this,arguments)},J.shapebio,"Strands",J.shapebio.BioShapeCollection)});Clazz.declarePackage("J.shapebio");Clazz.load(["J.shapebio.BioShapeCollection"],"J.shapebio.Ribbons",null,function(){c$=Clazz.declareType(J.shapebio,"Ribbons",J.shapebio.BioShapeCollection)});Clazz.declarePackage("J.shapebio");
Clazz.load(["J.shapebio.Strands"],"J.shapebio.MeshRibbon",null,function(){c$=Clazz.declareType(J.shapebio,"MeshRibbon",J.shapebio.Strands);$_M(c$,"initShape",function(){Clazz.superCall(this,J.shapebio.MeshRibbon,"initShape",[]);this.isMesh=!0})});Clazz.declarePackage("J.shapebio");
Clazz.load(["J.shapebio.BioShapeCollection"],"J.shapebio.Trace",["J.atomdata.RadiusData","J.constant.EnumVdw","J.modelset.Atom"],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.overrideMethod(c$,"setProperty",function(a,b,c){"putty"===a?this.setPutty(b,c):this.setPropBSC(a,b,c)},"~S,~O,JU.BS");
$_M(c$,"setPutty",($fz=function(a,b){var c=b.cardinality();if(0!=c){for(var d=Clazz.newFloatArray(b.length(),0),e=0,f=0,g=3.4028235E38,h=0,j=b.nextSetBit(0);0<=j;j=b.nextSetBit(j+1)){var k=J.modelset.Atom.atomPropertyFloat(null,this.atoms[j],1112541199),e=e+k,f=f+k*k;k<g&&(g=k);k>h&&(h=k)}var k=e/c,c=Math.sqrt((f-e*e/c)/c),e=a[1],f=a[2],l=a[3],m=a[4],p=a[5],r=Clazz.floatToInt(a[6]),h=h-g,v=!1;switch(r){case 0:case 1:case 2:case 3:v=!0}for(var j=b.nextSetBit(0),u=0;0<=j;j=b.nextSetBit(j+1),u++){var n=
J.modelset.Atom.atomPropertyFloat(null,this.atoms[j],1112541199);switch(r){case 0:case 4:n=1+(n-k)/f/c;break;case 1:case 5:n=(n-g)/h/f;break;case 2:case 6:n/=f;break;case 8:0>n&&(n=0),n=Math.sqrt(n/8)/3.141592653589793}0>n&&(n=0);v&&(n=Math.pow(n,p));n<l&&0<=l&&(n=l);n>m&&0<=m&&(n=m);d[j]=n*e}d=new J.atomdata.RadiusData(d,0,J.atomdata.RadiusData.EnumType.ABSOLUTE,J.constant.EnumVdw.AUTO);this.setShapeSizeRD(0,d,b)}},$fz.isPrivate=!0,$fz),"~A,JU.BS");Clazz.defineStatics(c$,"PUTTY_NormalizedNonlinear",
0,"PUTTY_RelativeNonlinear",1,"PUTTY_ScaledNonlinear",2,"PUTTY_AbsoluteNonlinear",3,"PUTTY_NormalizedLinear",4,"PUTTY_RelativeLinear",5,"PUTTY_ScaledLinear",6,"PUTTY_AbsoluteLinear",7,"PUTTY_ImpliedRMS",8)});Clazz.declarePackage("J.renderbio");
Clazz.load("J.render.MeshRenderer JU.A4 $.BS $.M3 $.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.wireframeOnly=this.isPass2=!1;this.pointT=null;this.diameterEnd=this.diameterMid=this.diameterBeg=this.iNext3=this.iNext2=this.iNext=this.iPrev=0;this.doCap1=this.doCap0=!1;this.colixBack=0;this.norml=this.bsTemp=this.mat=this.ptNext=
this.ptPrev=this.pt1=this.pt=this.aa=this.wingT=this.wing1=this.wing=this.norm=this.radiusHermites=this.wingHermites=this.controlHermites=this.screenArrowBotPrev=this.screenArrowBot=this.screenArrowTopPrev=this.screenArrowTop=this.reversed=null;Clazz.instantialize(this,arguments)},J.renderbio,"BioShapeRenderer",J.render.MeshRenderer);Clazz.prepareFields(c$,function(){this.bsVisible=new JU.BS;this.pointT=new JU.P3;this.screenArrowTop=new JU.P3i;this.screenArrowTopPrev=new JU.P3i;this.screenArrowBot=
new JU.P3i;this.screenArrowBotPrev=new JU.P3i;this.norm=new JU.V3;this.wing=new JU.V3;this.wing1=new JU.V3;this.wingT=new JU.V3;this.aa=new JU.A4;this.pt=new JU.P3;this.pt1=new JU.P3;this.ptPrev=new JU.P3;this.ptNext=new JU.P3;this.mat=new JU.M3;this.norml=new JU.V3});Clazz.overrideMethod(c$,"render",function(){if(null==this.shape)return!1;this.setGlobals();this.renderShapes();return this.needTranslucent});$_M(c$,"setGlobals",($fz=function(){this.isPass2=this.g3d.isPass2();this.needTranslucent=this.invalidateMesh=
!1;this.g3d.addRenderer(553648147);var a=!this.isExport&&!this.viewer.checkMotionRendering(1113200642);a!=this.wireframeOnly&&(this.invalidateMesh=!0);this.wireframeOnly=a;a=this.isExport||!this.wireframeOnly&&this.viewer.getBoolean(603979864);a!=this.isHighRes&&(this.invalidateMesh=!0);this.isHighRes=a;a=!this.wireframeOnly&&this.viewer.getBoolean(603979819);this.cartoonsFancy!=a&&(this.invalidateMesh=!0,this.cartoonsFancy=a);a=this.viewer.getHermiteLevel();a=0>=a?-a:this.viewer.getInMotion(!0)?
0:a;this.cartoonsFancy&&!this.wireframeOnly&&(a=Math.max(a,3));a!=this.hermiteLevel&&(this.invalidateMesh=!0);this.hermiteLevel=Math.min(a,8);var b=this.viewer.getInt(553648166),b=Math.min(Math.max(0,b),20);this.cartoonsFancy&&16<=b&&(b=4);if(this.wireframeOnly||0==this.hermiteLevel)b=0;b!=this.aspectRatio&&(0!=b&&0!=a)&&(this.invalidateMesh=!0);this.aspectRatio=b;a=this.viewer.getBoolean(603979966);a!=this.isTraceAlpha&&(this.invalidateMesh=!0);this.isTraceAlpha=a;this.invalidateSheets=!1;a=this.viewer.getFloat(570425392);
a!=this.sheetSmoothing&&this.isTraceAlpha&&(this.sheetSmoothing=a,this.invalidateSheets=this.invalidateMesh=!0)},$fz.isPrivate=!0,$fz));$_M(c$,"renderShapes",($fz=function(){for(var a=this.shape,b=a.bioShapes.length;0<=--b;){var c=a.getBioShape(b);0!=(c.modelVisibilityFlags&this.myVisibilityFlag)&&(2<=c.monomerCount&&this.initializePolymer(c))&&(this.bsRenderMesh.clearAll(),this.renderBioShape(c),this.renderMeshes(),this.freeTempArrays())}},$fz.isPrivate=!0,$fz));$_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=JU.BS.newN(this.monomerCount);this.monomers=a.monomers;this.reversed=a.bioPolymer.reversed;this.leadAtomIndices=a.bioPolymer.getLeadAtomIndices();this.bsVisible.clearAll();var c=!1;this.invalidateMesh&&a.falsifyMesh();for(var d=this.monomerCount;0<=--d;)if(!(0==(this.monomers[d].shapeVisibilityFlags&this.myVisibilityFlag)||this.modelSet.isAtomHidden(this.leadAtomIndices[d])||null!=b&&b.get(this.leadAtomIndices[d]))){var e=this.modelSet.atoms[this.leadAtomIndices[d]];
this.g3d.isInDisplayRange(e.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),"JU.P3,JU.V3,~N,~N,JU.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;}0==this.diameterBeg&&
0==this.diameterEnd||this.wireframeOnly?this.g3d.drawLineAB(this.controlPointScreens[a],this.controlPointScreens[this.iNext]):this.g3d.fillHermite(this.isNucleic?4:7,this.diameterBeg,this.diameterMid,this.diameterEnd,this.controlPointScreens[this.iPrev],this.controlPointScreens[a],this.controlPointScreens[this.iNext],this.controlPointScreens[this.iNext2])}},"~N,~B");$_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),p=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(p){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),v=Clazz.doubleToInt((3*k+2)/4),f=!f?0:g?1:h?2:3,h=0==f||3==f,u=0;u<j;u++){this.norm.sub2(this.controlHermites[u+1],this.controlHermites[u]);var n=!p?b:u<c?this.radiusHermites[u].x:this.radiusHermites[u-c].y;this.wing.setT(this.wingHermites[u]);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(n);this.wing1.scale(n);h&&(this.aa.setVA(this.norm,l),this.mat.setAA(this.aa));this.pt1.setT(this.controlHermites[u]);for(var w=g?0:l,n=0;n<k;n++,w+=l){h&&0<n&&this.mat.transform(this.wing);switch(f){case 1:this.wingT.setT(this.wing1);this.wingT.scale(Math.cos(w));break;case 2:this.wingT.setT(this.wing1);this.wingT.scale(Math.sin(w));this.wingT.scaleAdd2(Math.cos(w),this.wing,this.wingT);break;case 3:this.wingT.setT(this.wing);(n==r||n==v)&&this.wing1.scale(-1);
this.wingT.add(this.wing1);break;case 0:this.wingT.setT(this.wing)}this.pt.add2(this.pt1,this.wingT);m.addV(this.pt)}if(0<u){w=g?k-1:k;for(n=0;n<w;n++){var s=d-k+n,q=d-k+(n+1)%k,D=d+(n+1)%k,E=d+n;n<Clazz.doubleToInt(w/2)?m.addQuad(s,q,D,E):m.addQuad(q,D,E,s)}}d+=k}if(!g){e=d;if(this.doCap0){for(g=0;g<k;g++)m.addV(m.vertices[g]);d+=k;for(n=2*this.hermiteLevel;0<=--n;)m.addQuad(d-k+n+2,d-k+n+1,d-k+(k-n)%k,d-n-1)}if(this.doCap1){for(g=0;g<k;g++)m.addV(m.vertices[e-k+g]);d+=k;for(n=2*this.hermiteLevel;0<=
--n;)m.addQuad(d-n-1,d-k+(k-n)%k,d-k+n+1,d-k+n+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.renderbio.StrandsRenderer",null,function(){c$=Clazz.decorateAsClass(function(){this.strandCount=1;this.baseStrandOffset=this.strandSeparation=0;Clazz.instantialize(this,arguments)},J.renderbio,"StrandsRenderer",J.renderbio.BioShapeRenderer);Clazz.overrideMethod(c$,"renderBioShape",function(){this.renderStrandShape()},"J.shapebio.BioShape");$_M(c$,"renderStrandShape",function(){this.setStrandCount()&&this.renderStrands()});$_M(c$,"setStrandCount",function(){if(null==
this.wingVectors)return!1;this.strandCount=Clazz.instanceOf(this.shape,J.shapebio.Strands)?this.viewer.getStrandCount(this.shape.shapeID):10;this.strandSeparation=1>=this.strandCount?0:1/(this.strandCount-1);this.baseStrandOffset=0==(this.strandCount&1)?this.strandSeparation/2:this.strandSeparation;return!0});$_M(c$,"renderStrands",function(){for(var a,b=this.strandCount>>1;0<=--b;){var c=b*this.strandSeparation+this.baseStrandOffset;a=this.calcScreens(c);this.renderStrand(a);this.viewer.freeTempScreens(a);
a=this.calcScreens(-c);this.renderStrand(a);this.viewer.freeTempScreens(a)}1==this.strandCount%2&&(a=this.calcScreens(0),this.renderStrand(a),this.viewer.freeTempScreens(a))});$_M(c$,"renderStrand",($fz=function(a){for(var b=this.bsVisible.nextSetBit(0);0<=b;b=this.bsVisible.nextSetBit(b+1))this.renderHermiteCylinder(a,b)},$fz.isPrivate=!0,$fz),"~A")});Clazz.declarePackage("J.renderbio");
Clazz.load(["J.renderbio.MeshRibbonRenderer"],"J.renderbio.RibbonsRenderer",null,function(){c$=Clazz.declareType(J.renderbio,"RibbonsRenderer",J.renderbio.MeshRibbonRenderer);Clazz.overrideMethod(c$,"renderBioShape",function(){null!=this.wingVectors&&(this.wireframeOnly?this.renderStrands():this.render2Strand(!0,this.isNucleic?1:0.5,this.isNucleic?0:0.5))},"J.shapebio.BioShape")});Clazz.declarePackage("J.renderbio");
Clazz.load(["J.renderbio.StrandsRenderer"],"J.renderbio.MeshRibbonRenderer",null,function(){c$=Clazz.declareType(J.renderbio,"MeshRibbonRenderer",J.renderbio.StrandsRenderer);Clazz.overrideMethod(c$,"renderBioShape",function(){this.wireframeOnly?this.renderStrands():this.renderMeshRibbon()},"J.shapebio.BioShape");$_M(c$,"renderMeshRibbon",function(){if(this.setStrandCount()){var a=(this.strandCount>>1)*this.strandSeparation+this.baseStrandOffset;this.render2Strand(!1,a,a);this.renderStrands()}});
$_M(c$,"render2Strand",function(a,b,c){this.getScreenControlPoints();this.ribbonTopScreens=this.calcScreens(b);this.ribbonBottomScreens=this.calcScreens(-c);for(b=this.bsVisible.nextSetBit(0);0<=b;b=this.bsVisible.nextSetBit(b+1))this.renderHermiteRibbon(a,b,!1);this.viewer.freeTempScreens(this.ribbonTopScreens);this.viewer.freeTempScreens(this.ribbonBottomScreens)},"~B,~N,~N")});Clazz.declarePackage("J.renderbio");
Clazz.load(["J.renderbio.StrandsRenderer","JU.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.StrandsRenderer);Clazz.prepareFields(c$,function(){this.screenA=new JU.P3;this.screenB=new JU.P3;this.screenC=new JU.P3;this.vtemp=new JU.V3;this.corners=Array(8);this.screenCorners=Array(8);for(var a=8;0<=--a;)this.screenCorners[a]=new JU.P3,this.corners[a]=new JU.P3;this.pointTipOffset=new JU.P3;this.scaledWidthVector=new JU.V3;this.scaledHeightVector=new JU.V3;this.lengthVector=new JU.V3;this.pointCorner=new JU.P3});
Clazz.overrideMethod(c$,"renderBioShape",function(a){if(Clazz.instanceOf(a.bioPolymer,J.modelsetbio.AlphaPolymer))if(this.wireframeOnly)this.renderStrands();else{var b=!this.viewer.getBoolean(603979900);this.renderArrowHeads!=b&&(a.falsifyMesh(),this.renderArrowHeads=b);this.calcRopeMidPoints(this.newRockets);this.calcScreenControlPoints(this.cordMidPoints);this.controlPoints=this.cordMidPoints;this.renderRockets();this.viewer.freeTempPoints(this.cordMidPoints)}},"J.shapebio.BioShape");$_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$,"renderRockets",function(){this.tPending=!1;for(var a=this.bsVisible.nextSetBit(0);0<=a;a=this.bsVisible.nextSetBit(a+1)){var b=this.monomers[a];this.isHelix(a)||this.isSheet(a)?this.renderSpecialSegment(b,this.getLeadColix(a),this.mads[a]):(this.renderPending(),this.renderHermiteConic(a,!0))}this.renderPending()});$_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.setColix(this.colix)&&(this.g3d.fillCylinderBits(2,c,this.screenA,this.screenB),e&&this.renderArrowHeads&&(this.vtemp.sub2(d,b),this.vtemp.normalize(),this.screenA.scaleAdd2(4,this.vtemp,d),this.viewer.transformPt3f(this.screenA,this.screenC),this.renderCone(a,d,this.screenA,this.screenB,this.screenC)),this.startIndexPending!=
this.endIndexPending&&(a=this.screenB,this.screenB=this.screenC,this.screenC=a))},$fz.isPrivate=!0,$fz),"~N,JU.P3,JU.P3,JU.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,JU.P3,JU.P3,JU.P3,JU.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),"JU.P3,JU.P3,JU.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])}},"JU.P3,JU.V3,JU.V3,JU.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])},"JU.P3,JU.V3,JU.V3,JU.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]])},"JU.P3,JU.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]])},"JU.P3,JU.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","JU.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 JU.P3i;this.ptConnect=new JU.P3;this.ring6Points=
Array(6);this.ring6Screens=Array(6);this.ring5Points=Array(5);this.ring5Screens=Array(5);this.ring6Screens[5]=new JU.P3i;for(var a=5;0<=--a;)this.ring5Screens[a]=new JU.P3i,this.ring6Screens[a]=new JU.P3i});Clazz.overrideMethod(c$,"renderBioShape",function(a){if(this.wireframeOnly)this.renderStrands();else if(this.newRockets=!0,!(null==this.wingVectors||this.isCarbohydrate))if(this.getScreenControlPoints(),this.isNucleic)this.renderNucleic();else{var b=this.viewer.getBoolean(603979818);this.renderAsRockets!=
b&&(a.falsifyMesh(),this.renderAsRockets=b);b=!this.viewer.getBoolean(603979900);this.renderArrowHeads!=b&&(a.falsifyMesh(),this.renderArrowHeads=b);this.ribbonTopScreens=this.calcScreens(0.5);this.ribbonBottomScreens=this.calcScreens(-0.5);this.calcRopeMidPoints(this.newRockets);this.renderArrowHeads||(this.calcScreenControlPoints(this.cordMidPoints),this.controlPoints=this.cordMidPoints);this.renderRockets();this.viewer.freeTempPoints(this.cordMidPoints);this.viewer.freeTempScreens(this.ribbonTopScreens);
this.viewer.freeTempScreens(this.ribbonBottomScreens)}},"J.shapebio.BioShape");$_M(c$,"renderNucleic",function(){this.renderEdges=this.viewer.getBoolean(603979817);this.ladderOnly=this.viewer.getBoolean(603979820);for(var a=this.viewer.getBoolean(603979966),b=this.bsVisible.nextSetBit(0);0<=b;b=this.bsVisible.nextSetBit(b+1))a?(this.ptConnectScr.set(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$,"renderRockets",function(){for(var a=!1,b=!1,c=null,d,e=this.monomerCount;0<=--e;){d=this.monomers[e].getProteinStructure();d!==c&&(this.renderAsRockets&&(b=!1),a=!1);c=d;d=this.isHelix(e);var 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.renderCartoonRockets()});$_M(c$,"renderCartoonRockets",($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,JU.P3i,JU.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.StrandsRenderer"],"J.renderbio.TraceRenderer",null,function(){c$=Clazz.declareType(J.renderbio,"TraceRenderer",J.renderbio.StrandsRenderer);Clazz.overrideMethod(c$,"renderBioShape",function(){this.wireframeOnly?this.renderStrands():this.renderTrace()},"J.shapebio.BioShape");$_M(c$,"renderTrace",function(){this.getScreenControlPoints();for(var a=this.bsVisible.nextSetBit(0);0<=a;a=this.bsVisible.nextSetBit(a+1))this.renderHermiteConic(a,!1)})});
