Commit 6c93c406 authored by jdurrant's avatar jdurrant
Browse files

Updating with new file management system.

parent c735bc5d
......@@ -10,5 +10,5 @@ src/Webina/src/new/
src/Webina/src/orig/
src/example/small/
src/example/src/
dist
./dist
webina.zip
Changes
=======
1.0.4 WIP
---------
Need to update README.md explaining webina.zip now in releases.
Need to add grant info, and to update citation.
add Grant number and citation to all web apps. Also licenses?
Good to mmention that all errors interpreted as file not found. For exampmle, when ligand was B (from commmand line):
Output will be ligand_final_out.pdbqt
WARNING: at low exhaustiveness, it may be impossible to utilize all CPUs
Reading input ...
Parse error on line 45 in file "ligand_final.pdbqt": ATOM syntax incorrect: "B" is not a valid AutoDock type. Note that AutoDock atom types are case-sensitive.
But in browser:
No such file or directory.
Would be good to be able to catch errors better:
Uncaught 5347440 - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch.
1.0.3
-----
......
......@@ -101,13 +101,23 @@ let methodsFunctions = {
this["gen3D"],
parseFloat(this["phVal"])
).then((out) => {
this.$store.commit("setVar", {
name: this["currentType"] + "Contents",
val: out
});
this["$refs"]["convert-modal"].hide();
// Update the filename to end in pdbqt.
let newFilename = Utils.replaceExt(
this.$store.state[this["currentType"] + "FileName"],
"converted.pdbqt"
);
// this.$store.commit("updateFileName", { type: this["currentType"], filename: newFilename });
let onConvertDone = this.$store.state["onConvertDone"];
onConvertDone(newFilename, out);
// this.$store.commit("setVar", {
// name: this["currentType"] + "Contents",
// val: out
// });
// This makes it look like it validated.
this.$store.commit("setVar", {
name: this["currentType"] + "ForceValidate",
......@@ -120,10 +130,6 @@ let methodsFunctions = {
val: true
});
// Update the filename to end in pdbqt.
let newFilename = Utils.replaceExt(this.$store.state[this["currentType"] + "FileName"], "converted.pdbqt");
this.$store.commit("updateFileName", { type: this["currentType"], filename: newFilename });
if (successMsgs.length !== 0) {
let overallMsg = successMsgs.map((m, i) => { return "(" + (i + 1).toString() + ") " + m; }).join(" ");
this["$bvModal"]["msgBoxOk"]("To convert your file to PDBQT, Webina had to make the following modifications: " + overallMsg, {
......@@ -138,6 +144,8 @@ let methodsFunctions = {
return;
}
// All attempts have failed...
this["$refs"]["convert-modal"].hide();
this["$bvModal"]["msgBoxOk"]("Could not convert your file. Are you sure it is a properly formatted " + this["currentExt"] + " file? If so, it may be too large to convert in the browser.", {
"title": "Error Converting File!",
......@@ -146,7 +154,7 @@ let methodsFunctions = {
name: this["currentType"] + "ForceValidate",
val: false
});
this.$store.commit("updateFileName", { type: this["currentType"], filename: "" });
// this.$store.commit("updateFileName", { type: this["currentType"], filename: "" });
console.log("ERROR: " + msg);
});
......@@ -221,17 +229,20 @@ let methodsFunctions = {
"cancelPressed"(): void {
// Not sure the below is really necessary, but let's just make
// sure.
this.$store.commit("setVar", {
name: this["currentType"] + "FileName",
val: undefined
});
// this.$store.commit("setVar", {
// name: this["currentType"] + "FileName",
// val: undefined
// });
this.$store.commit("setValidationParam", {
name: this["currentType"],
val: false
});
this.$store.commit("updateFileName", { type: this["currentType"], filename: "" });
// this.$store.commit("updateFileName", { type: this["currentType"], filename: "" });
let onConvertCancel = this.$store.state["onConvertCancel"];
onConvertCancel();
},
/**
......@@ -262,7 +273,7 @@ export function setup(): void {
},
"computed": computedFunctions,
"methods": methodsFunctions,
"template": `
"template": /* html */ `
<b-modal
ref="convert-modal"
@shown="reloadIFrame"
......
......@@ -118,7 +118,7 @@ let methodsFunctions = {
*/
export function setup(): void {
Vue.component('vina-existing-output', {
"template": `
"template": /* html */ `
<b-form>
<b-card
class="mb-2 text-center"
......@@ -131,27 +131,49 @@ export function setup(): void {
</b-card>
<sub-section title="Existing Output Files">
<file-input
<!-- TODO: attention here -->
<file-loader-main
label="Receptor"
id="receptor"
description="The rigid part of the receptor (PDBQT or PDB)."
accept=".pdbqt, .pdb"
></file-input>
></file-loader-main>
<!-- <file-input
label="Receptor"
id="receptor"
description="The rigid part of the receptor (PDBQT or PDB)."
accept=".pdbqt, .pdb"
></file-input> -->
<file-input
<!-- TODO: attention here -->
<file-loader-main
label="Docked Output"
id="output"
description="The Webina/Vina output file (PDBQT, OUT, VINA, or TXT) containing docked ligand poses."
accept=".pdbqt, .out, .vina, .txt"
></file-input>
></file-loader-main>
<!-- <file-input
label="Docked Output"
id="output"
description="The Webina/Vina output file (PDBQT, OUT, VINA, or TXT) containing docked ligand poses."
accept=".pdbqt, .out, .vina, .txt"
></file-input> -->
<file-input
<!-- TODO: attention here -->
<file-loader-main
label="Correct Pose"
id="crystal"
:required="false"
description="The correct ligand pose, if known from experiment. This PDBQT or PDB file is optional."
accept=".pdbqt, .pdb"
></file-loader-main>
<!-- <file-input
label="Correct Pose"
id="crystal"
:required="false"
description="The correct ligand pose, if known from experiment. This PDBQT or PDB file is optional."
accept=".pdbqt, .pdb"
></file-input>
></file-input> -->
</sub-section>
<form-button cls="float-right mb-4" @click.native="onSubmitClick" variant="primary">Load Files</form-button>
......
......@@ -4,6 +4,8 @@
import * as Utils from "../../Utils";
import { IConvert, IFileLoaded, IFileLoadError } from "../Forms/FileLoader/Common/Interfaces";
import { getExt } from "../Forms/FileLoader/Common/Utils";
declare var Vue;
declare var Webina;
......@@ -238,10 +240,12 @@ let methodsFunctions = {
if (pass === false) {
if (modalWarning === true) {
this.$store.commit("openModal", {
title: "Invalid Parameters!",
body: "<p>Please correct the following parameter(s) before continuing: <code>" + badParams.join(" ") + "</code></p>"
});
this.onError(
"Invalid Parameters!",
"Please correct the following parameter(s) before continuing: <code>"
+ badParams.join(" ")
+ "</code>"
);
}
}
......@@ -253,6 +257,61 @@ let methodsFunctions = {
return pass;
},
onError(title: string, msg: string): void {
this.$store.commit("openModal", {
title: title,
body: `<p>${msg}</p>`
});
},
"onFileLoaded"(fileInfo: IFileLoaded): void {
this.$store.commit("updateFileName", {
type: this["id"],
filename: fileInfo.filename,
});
// this.getModelFileContents(this["file"]).then((text: string) => {
this.$store.commit("setVar", {
name: fileInfo.id + "Contents",
val: fileInfo.fileContents,
});
// Reset the show non-protein atom's link.
if (fileInfo.id === "receptor") {
this.$store.commit("setVar", {
name: "showKeepProteinOnlyLink",
val: true,
});
}
// });
},
"onConvertNeeded"(convertInfo: IConvert): void {
// Set the filename.
this.$store.commit("updateFileName", {
type: convertInfo.id,
filename: convertInfo.filename,
});
let ext = getExt(convertInfo.filename);
// this.getModelFileContents(val).then((text: string) => {
this.$store.commit("openConvertFileModal", {
ext: ext,
type: convertInfo.id,
file: convertInfo.fileContents,
onConvertCancel: convertInfo.onConvertCancel,
onConvertDone: convertInfo.onConvertDone,
});
// });
alert("");
// Handle below!!!
// convertInfo.onConvertCancel
// convertInfo.onConvertDone
},
/**
* Runs after the Vina WASM file is complete.
* @param {string} outPdbqtFileTxt The contents of the Vina output pdbqt file.
......@@ -302,10 +361,17 @@ let methodsFunctions = {
* @returns void
*/
showWebinaError(message: string): void {
this.$store.commit("openModal", {
title: "Webina Error!",
body: "<p>Webina returned the following error: <code>" + message + "</code></p>"
});
this.onError(
"Webina Error!",
"Webina returned the following error: <code>" + message + "</code>"
);
},
"showFileLoaderError"(error: IFileLoadError): void {
this.onError(
error.title,
error.body
);
}
}
......@@ -323,7 +389,7 @@ function mountedFunction(): void {
*/
export function setup(): void {
Vue.component('vina-params', {
"template": `
"template": /* html */ `
<div>
<b-form v-if="webAssemblyAvaialble">
<b-card
......@@ -337,12 +403,23 @@ export function setup(): void {
</b-card>
<sub-section title="Input (PDBQT) Files" v-if="showFileInputs">
<file-input
<!-- TODO: Attention here -->
<file-loader
label="Receptor"
id="receptor"
description="Formats: PDBQT (best), PDB, ENT, XYZ, PQR, MCIF, MMCIF. If PDB, be sure to add polar hydrogen atoms."
accept=".pdbqt" convert=".pdb, .ent, .xyz, .pqr, .mcif, .mmcif"
:required="true"
:allowUrlInput="false"
:multipleFiles="false"
:countDownToNextInput="-1"
@onError="showFileLoaderError"
@onFileLoaded="onFileLoaded"
@onConvertNeeded="onConvertNeeded"
>
<!--
@onFileNameChange="fileNameChanged"
@onTimeUp="timeUp" -->
<template v-slot:extraDescription>
<span v-if="showKeepProteinOnlyLink">
<a href='' @click="onShowKeepProteinOnlyClick($event);">Automatically remove all non-protein atoms?</a>
......@@ -351,24 +428,46 @@ export function setup(): void {
<b>(Removed all non-protein atoms!)</b>
</span>
</template>
</file-input>
</file-loader>
<file-input
label="Ligand"
<!-- TODO: Attention here -->
<file-loader
label="Ligand(s)"
id="ligand"
description="Formats: PDBQT (best), CAN, MDL, MOL, MOL2, PDB, SD, SDF, SMI, SMILES, XYZ,"
accept=".pdbqt" convert=".can, .mdl, .mol, .mol2, .pdb, .sd, .sdf, .smi, .smiles, .xyz"
:required="true"
:allowUrlInput="false"
:multipleFiles="true"
:countDownToNextInput="-1"
@onError="showFileLoaderError"
@onFileLoaded="onFileLoaded"
>
<!--
@onFileNameChange="fileNameChanged"
@onConvertNeeded="convertNeeded"
@onTimeUp="timeUp" -->
<template v-slot:extraDescription>or <a href='' @click="onDrawLigClick($event);">draw your ligand</a>. We recommend preparing ligand files separately with <a target='_blank' href='https://git.durrantlab.pitt.edu/jdurrant/gypsum_dl'>Gypsum-DL</a>.</template>
</file-input>
</file-loader>
<file-input
<!-- TODO: Attention here -->
<file-loader
label="Correct Pose"
id="crystal"
:required="false"
description="The correct ligand pose, if known from experiment. This PDBQT or PDB file is optional."
accept=".pdbqt, .pdb"
></file-input>
:required="false"
:allowUrlInput="false"
:multipleFiles="false"
:countDownToNextInput="-1"
@onError="showFileLoaderError"
@onFileLoaded="onFileLoaded"
>
<!--
@onFileNameChange="fileNameChanged"
@onConvertNeeded="convertNeeded"
@onTimeUp="timeUp" -->
</file-loader>
<form-button @click.native="useExampleVinaInputFiles" cls="float-right">Use Example Files</form-button> <!-- variant="default" -->
</sub-section>
......
......@@ -17,7 +17,7 @@ export function setup(): void {
new Vue({
"el": '#app',
"store": Store.store,
"template": `
"template": /* html */ `
<div class="container-fluid">
<open-modal></open-modal>
<convert-file-modal></convert-file-modal>
......
......@@ -5,7 +5,8 @@
import * as NumericInput from "../UI/Forms/NumericInput";
import * as CheckBox from "../UI/Forms/CheckBox";
import * as FileInput from "../UI/Forms/FileInput";
import * as FileInputSetup from "../UI/Forms/FileLoader/Setup";
import * as FileInputMain from "../UI/Forms/FileLoaderMain.Vue";
import * as VinaParams from "../UI/Tabs/VinaParams";
import * as VinaRunning from "../UI/Tabs/VinaRunning";
import * as VinaOutput from "../UI/Tabs/VinaOutput";
......@@ -46,7 +47,8 @@ export function setup(): void {
NumericInput.setup();
TripleNumeric.setup();
CheckBox.setup();
FileInput.setup();
FileInputSetup.setupFileLoader();
FileInputMain.setup();
ResultsTable.setup();
VinaParams.setup();
VinaRunning.setup();
......
......@@ -42,6 +42,8 @@ interface IFileConvertModal {
ext: string;
type: string;
file: string;
onConvertCancel: Function;
onConvertDone: Function;
}
interface IInputFileNames {
......@@ -78,6 +80,8 @@ export const store = new Vuex.Store({
"convertFileExt": "PDB",
"convertFileType": "receptor",
"convertFile": null,
"onConvertCancel": undefined,
"onConvertDone": undefined,
"receptorForceValidate": false,
"ligandForceValidate": false,
"drawSmilesModalShow": false,
......@@ -225,6 +229,8 @@ export const store = new Vuex.Store({
state["convertFileExt"] = payload.ext;
state["convertFileType"] = payload.type;
state["convertFile"] = payload.file;
state["onConvertCancel"] = payload.onConvertCancel;
state["onConvertDone"] = payload.onConvertDone;
jQuery("body").removeClass("waiting");
},
......
......@@ -18,7 +18,7 @@
// details. Copyright 2020 Jacob D. Durrant.
// There are a few variables and functions from vina.js that I want to easily
// access from here.
var VERSION = "1.0.2"; // Replaced by compile script.
var VERSION = "1.0.3"; // Replaced by compile script.
console.log("Webina Library " + VERSION);
console.log(" Compiled from Vina 1.1.2 codebase:");
console.log(" http://vina.scripps.edu/");
......
......@@ -13,20 +13,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var c=0;return function(){return c<a.length?{done:!1,value:a[c++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,b){a!=Array.prototype&&a!=Object.prototype&&(a[c]=b.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};
$jscomp.SymbolClass=function(a,c){this.$jscomp$symbol$id_=a;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:c})};$jscomp.SymbolClass.prototype.toString=function(){return this.$jscomp$symbol$id_};$jscomp.Symbol=function(){function a(b){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return new $jscomp.SymbolClass($jscomp.SYMBOL_PREFIX+(b||"")+"_"+c++,b)}var c=0;return a}();
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("Symbol.iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}});$jscomp.initSymbolIterator=function(){}};
$jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.asyncIterator;a||(a=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("Symbol.asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.iteratorPrototype=function(a){$jscomp.initSymbolIterator();a={next:a};a[$jscomp.global.Symbol.iterator]=function(){return this};return a};
$jscomp.iteratorFromArray=function(a,c){$jscomp.initSymbolIterator();a instanceof String&&(a+="");var b=0,d={next:function(){if(b<a.length){var e=b++;return{value:c(e,a[e]),done:!1}}d.next=function(){return{done:!0,value:void 0}};return d.next()}};d[Symbol.iterator]=function(){return d};return d};
$jscomp.polyfill=function(a,c,b,d){if(c){b=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in b||(b[e]={});b=b[e]}a=a[a.length-1];d=b[a];c=c(d);c!=d&&null!=c&&$jscomp.defineProperty(b,a,{configurable:!0,writable:!0,value:c})}};$jscomp.polyfill("Array.prototype.keys",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(a){return a})}},"es6","es3");var VERSION="1.0.2";console.log("Webina Library "+VERSION);console.log(" Compiled from Vina 1.1.2 codebase:");
console.log(" http://vina.scripps.edu/");
var WEBINA_Module,decodeBase64="function"==typeof atob?atob:function(a){var c,b,d,e,f,m,g="",h=0;for(a=a.replace(/[^A-Za-z0-9\+\/=]/g,"");c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++))<<2|(e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)))>>4,b=(15&e)<<4|(f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)))>>2,d=(3&f)<<6|(m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++))),g+=
String.fromCharCode(c),64!==f&&(g+=String.fromCharCode(b)),64!==m&&(g+=String.fromCharCode(d)),h<a.length;)return g},Webina=function(){return{WEBINA_ENVIRONMENT_IS_NODE:window.WEBINA_ENVIRONMENT_IS_NODE,WEBINA_lengthBytesUTF8:window.WEBINA_lengthBytesUTF8,WEBINA_stringToUTF8Array:window.WEBINA_stringToUTF8Array,WEBINA_assert:window.WEBINA_assert,WEBINA_ASSERTIONS:1,WEBINA_DATA_URI_PREFIX:"data:application/octet-stream;base64,",WEBINA_BASE_URL:"./",FS:window.FS,start:function(a,c,b,d,e,f){var m=this,
g="\nWEBINA\n======\n\n";void 0!==f?("/"!==f.slice(f.length-1)&&(f+="/"),this.WEBINA_BASE_URL=f,g+="User specified baseUrl: "+f+"\n"):g+="No baseUrl specified, so using ./\n\nUse Webina.start() to specify the baseUrl:\n function start(vinaParams, receptorPDBQTTxt, \n ligandPDBQTTxt, onDone, \n onError, baseUrl)\n";g+="\nExpecting files at the following locations:\n";for(var h=0;5>h;h++)g+=" "+(void 0===f?"./":f)+["Webina.min.min.js","vina.html.mem","vina.min.min.js",
"vina.worker.min.min.js","vina.wasm"][h]+"\n";g+="\n";void 0!==f?console.log(g):console.warn(g);void 0===e&&(e=function(){console.log("Webina encountered an error! Does your browser support WebAssembly?")});WEBINA_Module={preRun:[],postRun:[],stdOut:"",stdErr:"",print:function(){return function(a){1<arguments.length&&(a=Array.prototype.slice.call(arguments).join(" "));window.WEBINA_Module.stdOut+=a+"\n"}}(),printErr:function(a){1<arguments.length&&(a=Array.prototype.slice.call(arguments).join(" "));window.WEBINA_Module.stdErr+=
a+"\n"},setStatus:function(a){""===a&&void 0!==d&&(a=(new TextDecoder("utf-8")).decode(window.FS.readFile("ligand_out.pdbqt")),d(a,window.WEBINA_Module.stdOut,window.WEBINA_Module.stdErr))},onError:e,catchError:function(a){e(a)},receptorPDBQTTxt:c,ligandPDBQTTxt:b};void 0!==a.receptor&&console.warn("Webina does not support Vina's --receptor parameter. Instead, pass the content of the receptor file as a string to the webina.start() function.");void 0!==a.receptor&&console.warn("Webina does not support Vina's --ligand parameter. Instead, pass the content of the ligand file as a string to the webina.start() function.");
WEBINA_Module.arguments=["--receptor","/receptor.pdbqt","--ligand","/ligand.pdbqt"];c=Object.keys(a);b=c.length;for(h=0;h<b;h++)f=c[h],g=a[f],WEBINA_Module.arguments.push("--"+f),"boolean"!==typeof g&&WEBINA_Module.arguments.push(String(g));window.WEBINA_Module=WEBINA_Module;var k=this.WEBINA_BASE_URL+"vina.html.mem";k=WEBINA_Module.locateFile?WEBINA_Module.locateFile(k,""):k;WEBINA_Module.memoryInitializerRequestURL=k;var l=WEBINA_Module.memoryInitializerRequest=new XMLHttpRequest;l.onloadend=function(){if(404===
l.status){var a="Unable to access "+k+'. See JavaScript console for warnings. The "baseUrl" variable passed to Webina is likely incorrect.';WEBINA_Module.catchError({message:a});console.warn(a)}else a=document.createElement("script"),a.src=m.WEBINA_BASE_URL+"vina.min.js",document.body.appendChild(a)};l.open("GET",k,!0);l.responseType="arraybuffer";l.send(null)},isDataURI:function(a){return String.prototype.startsWith?a.startsWith(this.WEBINA_DATA_URI_PREFIX):0===a.indexOf(this.WEBINA_DATA_URI_PREFIX)},
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var c=0;return function(){return c<a.length?{done:!1,value:a[c++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,b){if(a==Array.prototype||a==Object.prototype)return a;a[c]=b.value;return a};$jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var c=0;c<a.length;++c){var b=a[c];if(b&&b.Math==Math)return b}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(a,c){var b=$jscomp.propertyToPolyfillSymbol[c];if(null==b)return a[c];b=a[b];return void 0!==b?b:a[c]};
$jscomp.polyfill=function(a,c,b,d){c&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(a,c,b,d):$jscomp.polyfillUnisolated(a,c,b,d))};$jscomp.polyfillUnisolated=function(a,c,b,d){b=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];if(!(e in b))return;b=b[e]}a=a[a.length-1];d=b[a];c=c(d);c!=d&&null!=c&&$jscomp.defineProperty(b,a,{configurable:!0,writable:!0,value:c})};
$jscomp.polyfillIsolated=function(a,c,b,d){var e=a.split(".");a=1===e.length;d=e[0];d=!a&&d in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var f=0;f<e.length-1;f++){var l=e[f];if(!(l in d))return;d=d[l]}e=e[e.length-1];b=$jscomp.IS_SYMBOL_NATIVE&&"es6"===b?d[e]:null;c=c(b);null!=c&&(a?$jscomp.defineProperty($jscomp.polyfills,e,{configurable:!0,writable:!0,value:c}):c!==b&&(void 0===$jscomp.propertyToPolyfillSymbol[e]&&(b=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[e]=$jscomp.IS_SYMBOL_NATIVE?
$jscomp.global.Symbol(e):$jscomp.POLYFILL_PREFIX+b+"$"+e),$jscomp.defineProperty(d,$jscomp.propertyToPolyfillSymbol[e],{configurable:!0,writable:!0,value:c})))};$jscomp.initSymbol=function(){};
$jscomp.polyfill("Symbol",function(a){if(a)return a;var c=function(f,l){this.$jscomp$symbol$id_=f;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:l})};c.prototype.toString=function(){return this.$jscomp$symbol$id_};var b="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",d=0,e=function(f){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new c(b+(f||"")+"_"+d++,f)};return e},"es6","es3");
$jscomp.polyfill("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var c="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),b=0;b<c.length;b++){var d=$jscomp.global[c[b]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&$jscomp.defineProperty(d.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return a},"es6",
"es3");$jscomp.iteratorPrototype=function(a){a={next:a};a[Symbol.iterator]=function(){return this};return a};$jscomp.iteratorFromArray=function(a,c){a instanceof String&&(a+="");var b=0,d=!1,e={next:function(){if(!d&&b<a.length){var f=b++;return{value:c(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e};$jscomp.polyfill("Array.prototype.keys",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(c){return c})}},"es6","es3");
var VERSION="1.0.3";console.log("Webina Library "+VERSION);console.log(" Compiled from Vina 1.1.2 codebase:");console.log(" http://vina.scripps.edu/");
var WEBINA_Module,decodeBase64="function"==typeof atob?atob:function(a){var c,b,d,e,f,l,h="",k=0;for(a=a.replace(/[^A-Za-z0-9\+\/=]/g,"");c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(k++))<<2|(e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(k++)))>>4,b=(15&e)<<4|(f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(k++)))>>2,d=(3&f)<<6|(l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(k++))),
h+=String.fromCharCode(c),64!==f&&(h+=String.fromCharCode(b)),64!==l&&(h+=String.fromCharCode(d)),k<a.length;)return h},Webina=function(){return{WEBINA_ENVIRONMENT_IS_NODE:window.WEBINA_ENVIRONMENT_IS_NODE,WEBINA_lengthBytesUTF8:window.WEBINA_lengthBytesUTF8,WEBINA_stringToUTF8Array:window.WEBINA_stringToUTF8Array,WEBINA_assert:window.WEBINA_assert,WEBINA_ASSERTIONS:1,WEBINA_DATA_URI_PREFIX:"data:application/octet-stream;base64,",WEBINA_BASE_URL:"./",FS:window.FS,start:function(a,c,b,d,e,f){var l=
this,h="\nWEBINA\n======\n\n";void 0!==f?("/"!==f.slice(f.length-1)&&(f+="/"),this.WEBINA_BASE_URL=f,h+="User specified baseUrl: "+f+"\n"):h+="No baseUrl specified, so using ./\n\nUse Webina.start() to specify the baseUrl:\n function start(vinaParams, receptorPDBQTTxt, \n ligandPDBQTTxt, onDone, \n onError, baseUrl)\n";h+="\nExpecting files at the following locations:\n";for(var k=0;5>k;k++)h+=" "+(void 0===f?"./":f)+["Webina.min.min.js","vina.html.mem","vina.min.min.js",
"vina.worker.min.min.js","vina.wasm"][k]+"\n";h+="\n";void 0!==f?console.log(h):console.warn(h);void 0===e&&(e=function(){console.log("Webina encountered an error! Does your browser support WebAssembly?")});WEBINA_Module={preRun:[],postRun:[],stdOut:"",stdErr:"",print:function(){return function(g){1<arguments.length&&(g=Array.prototype.slice.call(arguments).join(" "));window.WEBINA_Module.stdOut+=g+"\n"}}(),printErr:function(g){1<arguments.length&&(g=Array.prototype.slice.call(arguments).join(" "));window.WEBINA_Module.stdErr+=
g+"\n"},setStatus:function(g){""===g&&void 0!==d&&(g=(new TextDecoder("utf-8")).decode(window.FS.readFile("ligand_out.pdbqt")),d(g,window.WEBINA_Module.stdOut,window.WEBINA_Module.stdErr))},onError:e,catchError:function(g){e(g)},receptorPDBQTTxt:c,ligandPDBQTTxt:b};void 0!==a.receptor&&console.warn("Webina does not support Vina's --receptor parameter. Instead, pass the content of the receptor file as a string to the webina.start() function.");void 0!==a.receptor&&console.warn("Webina does not support Vina's --ligand parameter. Instead, pass the content of the ligand file as a string to the webina.start() function.");
WEBINA_Module.arguments=["--receptor","/receptor.pdbqt","--ligand","/ligand.pdbqt"];c=Object.keys(a);b=c.length;for(k=0;k<b;k++)f=c[k],h=a[f],WEBINA_Module.arguments.push("--"+f),"boolean"!==typeof h&&WEBINA_Module.arguments.push(String(h));window.WEBINA_Module=WEBINA_Module;var m=this.WEBINA_BASE_URL+"vina.html.mem";m=WEBINA_Module.locateFile?WEBINA_Module.locateFile(m,""):m;WEBINA_Module.memoryInitializerRequestURL=m;var n=WEBINA_Module.memoryInitializerRequest=new XMLHttpRequest;n.onloadend=function(){if(404===
n.status){var g="Unable to access "+m+'. See JavaScript console for warnings. The "baseUrl" variable passed to Webina is likely incorrect.';WEBINA_Module.catchError({message:g});console.warn(g)}else g=document.createElement("script"),g.src=l.WEBINA_BASE_URL+"vina.min.js",document.body.appendChild(g)};n.open("GET",m,!0);n.responseType="arraybuffer";n.send(null)},isDataURI:function(a){return String.prototype.startsWith?a.startsWith(this.WEBINA_DATA_URI_PREFIX):0===a.indexOf(this.WEBINA_DATA_URI_PREFIX)},
intArrayFromBase64:function(a){if("boolean"==typeof this.WEBINA_ENVIRONMENT_IS_NODE&&this.WEBINA_ENVIRONMENT_IS_NODE){try{var c=Buffer.from(a,"base64")}catch(e){c=new Buffer(a,"base64")}return new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}try{var b=decodeBase64(a),d=new Uint8Array(b.length);for(a=0;a<b.length;++a)d[a]=b.charCodeAt(a);return d}catch(e){throw Error("Converting base64 string to bytes failed.");}},tryParseAsDataURI:function(a){if(this.isDataURI(a))return this.intArrayFromBase64(a.slice(this.WEBINA_DATA_URI_PREFIX.length))},
intArrayFromString:function(a,c,b){b=0<b?b:this.WEBINA_lengthBytesUTF8(a)+1;b=Array(b);a=this.WEBINA_stringToUTF8Array(a,b,0,b.length);return c&&(b.length=a),b},intArrayToString:function(a){for(var c=[],b=0;b<a.length;b++){var d=a[b];255<d&&(this.WEBINA_ASSERTIONS&&this.WEBINA_assert(!1,"Character code "+d+" ("+String.fromCharCode(d)+") at offset "+b+" not in 0x00-0xFF."),d&=255);c.push(String.fromCharCode(d))}return c.join("")}}}();
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(a,b,c,d){if(b){c=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})}};$jscomp.polyfill("Math.imul",function(a){return a?a:function(a,c){a=Number(a);c=Number(c);var b=a&65535,e=c&65535;return b*e+((a>>>16&65535)*e+b*(c>>>16&65535)<<16>>>0)|0}},"es6","es3");
$jscomp.polyfill("Math.fround",function(a){if(a)return a;if($jscomp.SIMPLE_FROUND_POLYFILL||"function"!==typeof Float32Array)return function(a){return a};var b=new Float32Array(1);return function(a){b[0]=a;return b[0]}},"es6","es3");
$jscomp.polyfill("Math.clz32",function(a){return a?a:function(a){a=Number(a)>>>0;if(0===a)return 32;var b=0;0===(a&4294901760)&&(a<<=16,b+=16);0===(a&4278190080)&&(a<<=8,b+=8);0===(a&4026531840)&&(a<<=4,b+=4);0===(a&3221225472)&&(a<<=2,b+=2);0===(a&2147483648)&&b++;return b}},"es6","es3");$jscomp.polyfill("Math.trunc",function(a){return a?a:function(a){a=Number(a);if(isNaN(a)||Infinity===a||-Infinity===a||0===a)return a;var b=Math.floor(Math.abs(a));return 0>a?-b:b}},"es6","es3");
$jscomp.arrayIteratorImpl=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):$jscomp.arrayIterator(a)};$jscomp.FORCE_POLYFILL_PROMISE=!1;
$jscomp.polyfill("Promise",function(a){function b(){this.batch_=null}function c(a){return a instanceof e?a:new e(function(b,c){b(a)})}if(a&&!$jscomp.FORCE_POLYFILL_PROMISE)return a;b.prototype.asyncExecute=function(a){if(null==this.batch_){this.batch_=[];var b=this;this.asyncExecuteFunction(function(){b.executeBatch_()})}this.batch_.push(a)};var d=$jscomp.global.setTimeout;b.prototype.asyncExecuteFunction=function(a){d(a,0)};b.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var a=
this.batch_;this.batch_=[];for(var b=0;b<a.length;++b){var c=a[b];a[b]=null;try{c()}catch(h){this.asyncThrow_(h)}}}this.batch_=null};b.prototype.asyncThrow_=function(a){this.asyncExecuteFunction(function(){throw a;})};var e=function(a){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var b=this.createResolveAndReject_();try{a(b.resolve,b.reject)}catch(l){b.reject(l)}};e.prototype.createResolveAndReject_=function(){function a(a){return function(d){c||(c=!0,a.call(b,d))}}var b=this,c=!1;
return{resolve:a(this.resolveTo_),reject:a(this.reject_)}};e.prototype.resolveTo_=function(a){if(a===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(a instanceof e)this.settleSameAsPromise_(a);else{a:switch(typeof a){case "object":var b=null!=a;break a;case "function":b=!0;break a;default:b=!1}b?this.resolveToNonPromiseObj_(a):this.fulfill_(a)}};e.prototype.resolveToNonPromiseObj_=function(a){var b=void 0;try{b=a.then}catch(l){this.reject_(l);return}"function"==typeof b?
this.settleSameAsThenable_(b,a):this.fulfill_(a)};e.prototype.reject_=function(a){this.settle_(2,a)};e.prototype.fulfill_=function(a){this.settle_(1,a)};e.prototype.settle_=function(a,b){if(0!=this.state_)throw Error("Cannot settle("+a+", "+b+"): Promise already settled in state"+this.state_);this.state_=a;this.result_=b;this.executeOnSettledCallbacks_()};e.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var a=0;a<this.onSettledCallbacks_.length;++a)f.asyncExecute(this.onSettledCallbacks_[a]);
this.onSettledCallbacks_=null}};var f=new b;e.prototype.settleSameAsPromise_=function(a){var b=this.createResolveAndReject_();a.callWhenSettled_(b.resolve,b.reject)};e.prototype.settleSameAsThenable_=function(a,b){var c=this.createResolveAndReject_();try{a.call(b,c.resolve,c.reject)}catch(h){c.reject(h)}};e.prototype.then=function(a,b){function c(a,b){return"function"==typeof a?function(b){try{d(a(b))}catch(r){f(r)}}:b}var d,f,g=new e(function(a,b){d=a;f=b});this.callWhenSettled_(c(a,d),c(b,f));return g};
e.prototype.catch=function(a){return this.then(void 0,a)};e.prototype.callWhenSettled_=function(a,b){function c(){switch(d.state_){case 1:a(d.result_);break;case 2:b(d.result_);break;default:throw Error("Unexpected state: "+d.state_);}}var d=this;null==this.onSettledCallbacks_?f.asyncExecute(c):this.onSettledCallbacks_.push(c)};e.resolve=c;e.reject=function(a){return new e(function(b,c){c(a)})};e.race=function(a){return new e(function(b,d){for(var e=$jscomp.makeIterator(a),f=e.next();!f.done;f=e.next())c(f.value).callWhenSettled_(b,
d)})};e.all=function(a){var b=$jscomp.makeIterator(a),d=b.next();return d.done?c([]):new e(function(a,e){function f(b){return function(c){g[b]=c;p--;0==p&&a(g)}}var g=[],p=0;do g.push(void 0),p++,c(d.value).callWhenSettled_(f(g.length-1),e),d=b.next();while(!d.done)})};return e},"es6","es3");$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};
$jscomp.SymbolClass=function(a,b){this.$jscomp$symbol$id_=a;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:b})};$jscomp.SymbolClass.prototype.toString=function(){return this.$jscomp$symbol$id_};$jscomp.Symbol=function(){function a(c){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return new $jscomp.SymbolClass($jscomp.SYMBOL_PREFIX+(c||"")+"_"+b++,c)}var b=0;return a}();
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("Symbol.iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}});$jscomp.initSymbolIterator=function(){}};