Commit f0ecb33f authored by Jacob Durrant's avatar Jacob Durrant
Browse files

Update to version 1.0.2.

parent dfe05910
Changes Changes
======= =======
1.0.2
-----
* Renamed the `docs/` directory to `technical_docs/` so end users won't
confuse it with the user manual found in the `README.md` file.
* Improved Webina's ability to convert large PDB files to PDBQT. PDBQTConvert
cannot convert large PDB files, so Webina reduces the input file size if it
encounters an error. In addition to the previous steps, it now does the
following:
* keeps only the first frame of multi-frame PDB files
* removes existing hydrogen atoms
* removes beta/occupancy/element columns
1.0.1 1.0.1
----- -----
......
# Webina 1.0.1 # # Webina 1.0.2 #
## Introduction ## ## Introduction ##
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Webina</title> <title>Webina</title>
<link rel="shortcut icon" href="favicon.ico"><link href="vendors.3c93c288707c624dc76d.css" rel="stylesheet"><link href="styles.3c93c288707c624dc76d.css" rel="stylesheet"></head> <link rel="shortcut icon" href="favicon.ico"><link href="vendors.9f3da2d658e5da75f658.css" rel="stylesheet"><link href="styles.9f3da2d658e5da75f658.css" rel="stylesheet"></head>
<body> <body>
<div id="app"></div> <div id="app"></div>
...@@ -24,6 +24,6 @@ ...@@ -24,6 +24,6 @@
<script src="vue.min.js"></script> <script src="vue.min.js"></script>
<script src="vuex.min.js"></script> <script src="vuex.min.js"></script>
<script src="bootstrap-vue.min.js"></script> <script src="bootstrap-vue.min.js"></script>
<script type="text/javascript" src="runtime.3c93c288707c624dc76d.js"></script><script type="text/javascript" src="vendors.3c93c288707c624dc76d.js"></script><script type="text/javascript" src="app.3c93c288707c624dc76d.js"></script><script type="text/javascript" src="styles.3c93c288707c624dc76d.js"></script><script type="text/javascript" src="styles.css.3c93c288707c624dc76d.js"></script></body> <script type="text/javascript" src="runtime.9f3da2d658e5da75f658.js"></script><script type="text/javascript" src="vendors.9f3da2d658e5da75f658.js"></script><script type="text/javascript" src="app.9f3da2d658e5da75f658.js"></script><script type="text/javascript" src="styles.9f3da2d658e5da75f658.js"></script><script type="text/javascript" src="styles.css.9f3da2d658e5da75f658.js"></script></body>
</html> </html>
{ {
"name": "webina", "name": "webina",
"version": "1.0.1", "version": "1.0.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
......
{ {
"name": "webina", "name": "webina",
"version": "1.0.1", "version": "1.0.2",
"description": "", "description": "",
"private": true, "private": true,
"scripts": { "scripts": {
......
...@@ -66,12 +66,12 @@ let methodsFunctions = { ...@@ -66,12 +66,12 @@ let methodsFunctions = {
* file should be * file should be
* optimized (to keep size * optimized (to keep size
* low for converting). * low for converting).
* @param {string=""} successMsg The message to display * @param {string[]} successMsgs The messages to display
* to the user on success * to the user on success
* (if any). * (if any).
* @returns void * @returns void
*/ */
"beginConvert"(e, currentPDBOptimizationLevel=1, successMsg=""): void { "beginConvert"(e, currentPDBOptimizationLevel=1, successMsgs=[]): void {
let frameWindow = document.getElementById("convert-frame")["contentWindow"]; let frameWindow = document.getElementById("convert-frame")["contentWindow"];
frameWindow["startSpinner"](); frameWindow["startSpinner"]();
let content: string = this.$store.state["convertFile"]; let content: string = this.$store.state["convertFile"];
...@@ -80,7 +80,10 @@ let methodsFunctions = { ...@@ -80,7 +80,10 @@ let methodsFunctions = {
} }
if (this["currentExt"].toUpperCase() === "PDB") { if (this["currentExt"].toUpperCase() === "PDB") {
successMsg += this.pdbOptimization(currentPDBOptimizationLevel); let msg = this.pdbOptimization(currentPDBOptimizationLevel);
if (msg !== "") {
successMsgs.push(msg);
}
} }
if (this["currentType"]!=="ligand") { if (this["currentType"]!=="ligand") {
...@@ -121,16 +124,17 @@ let methodsFunctions = { ...@@ -121,16 +124,17 @@ let methodsFunctions = {
let newFilename = Utils.replaceExt(this.$store.state[this["currentType"] + "FileName"], "converted.pdbqt"); let newFilename = Utils.replaceExt(this.$store.state[this["currentType"] + "FileName"], "converted.pdbqt");
this.$store.commit("updateFileName", { type: this["currentType"], filename: newFilename }); this.$store.commit("updateFileName", { type: this["currentType"], filename: newFilename });
if (successMsg !== "") { if (successMsgs.length !== 0) {
this["$bvModal"]["msgBoxOk"]("To convert your file to PDBQT, Webina had to make the following modifications: " + successMsg, { 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, {
"title": "Warning: File Too Big!", "title": "Warning: File Too Big!",
}); });
} }
}).catch((msg) => { }).catch((msg) => {
// The conversion failed. But if it's a PDB file, it might be // The conversion failed. But if it's a PDB file, it might be
// worth trying to optimize it further. // worth trying to optimize it further.
if (currentPDBOptimizationLevel <= 3) { if (currentPDBOptimizationLevel <= 4) { // one less than max number in pdbOptimization.
this["beginConvert"](e, currentPDBOptimizationLevel + 1, successMsg); this["beginConvert"](e, currentPDBOptimizationLevel + 1, successMsgs);
return; return;
} }
...@@ -166,22 +170,42 @@ let methodsFunctions = { ...@@ -166,22 +170,42 @@ let methodsFunctions = {
switch (level) { switch (level) {
case 1: case 1:
// Always run this optimization. Just removes lines that don't // Always run this optimization. Just removes lines that don't
// start with ATOM and HETATM. // start with ATOM and HETATM. Also keeps only the first frame
// if it's a multi-frame PDB.
if (pdbTxt.indexOf("\nEND") !== -1) {
// Perhaps a multi-frame PDB.
pdbTxt = pdbTxt.split("\nEND")[0];
msg = "Keep only the first frame."
}
pdbTxt = pdbTxt.split("\n").filter(l => l.slice(0, 5) === "ATOM " || l.slice(0, 7) === "HETATM ").join("\n"); pdbTxt = pdbTxt.split("\n").filter(l => l.slice(0, 5) === "ATOM " || l.slice(0, 7) === "HETATM ").join("\n");
break; break;
case 2: case 2:
// Try removing everything but protein atoms. // Try removing everything but protein atoms.
pdbTxt = Utils.keepOnlyProteinAtoms(pdbTxt); pdbTxt = Utils.keepOnlyProteinAtoms(pdbTxt);
msg += " (1) Discard non-protein atoms." msg = "Discard non-protein atoms."
break; break;
case 3: case 3:
// Keep only the first chain. // Keep only the first chain.
let chain = pdbTxt.slice(21,22); let chain = pdbTxt.slice(21,22); // first chain
pdbTxt = pdbTxt.split("\n").filter(l => l.slice(21,22) === chain).join("\n"); pdbTxt = pdbTxt.split("\n").filter(l => l.slice(21,22) === chain).join("\n");
msg += " (2) Keep only the first chain (chain " + chain + ")."; msg = "Keep only the first chain (chain " + chain + ").";
break;
case 4:
// Remove existing hydrogen atoms.
pdbTxt = pdbTxt.split("\n").filter(l => l.substr(12,4).replace(/ /g, "").substr(0, 1) !== "H").join("\n");
msg = "Remove original hydrogen atoms.";
break;
case 5:
// Remove beta, occupancy, etc. columns.
pdbTxt = pdbTxt.split("\n").map(l => l.substr(0,54)).join("\n");
msg = "Remove original occupancy, beta, and element columns.";
break; break;
} }
// console.log("HHHHH>>> " + msg + " >>>> " + pdbTxt.length.toString());
this.$store.commit("setVar", { this.$store.commit("setVar", {
name: "convertFile", name: "convertFile",
val: pdbTxt val: pdbTxt
......
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
// LICENSE.md or go to https://opensource.org/licenses/Apache-2.0 for full // LICENSE.md or go to https://opensource.org/licenses/Apache-2.0 for full
// details. Copyright 2020 Jacob D. Durrant. // details. Copyright 2020 Jacob D. Durrant.
export let VERSION = "1.0.1"; export let VERSION = "1.0.2";
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment