Commit f0ecb33f authored by Jacob Durrant's avatar Jacob Durrant

Update to version 1.0.2.

parent dfe05910
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
-----
......
# Webina 1.0.1 #
# Webina 1.0.2 #
## Introduction ##
......
......@@ -10,7 +10,7 @@
<meta charset="utf-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<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>
<div id="app"></div>
......@@ -24,6 +24,6 @@
<script src="vue.min.js"></script>
<script src="vuex.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>
{
"name": "webina",
"version": "1.0.1",
"version": "1.0.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
{
"name": "webina",
"version": "1.0.1",
"version": "1.0.2",
"description": "",
"private": true,
"scripts": {
......
......@@ -66,12 +66,12 @@ let methodsFunctions = {
* file should be
* optimized (to keep size
* low for converting).
* @param {string=""} successMsg The message to display
* @param {string[]} successMsgs The messages to display
* to the user on success
* (if any).
* @returns void
*/
"beginConvert"(e, currentPDBOptimizationLevel=1, successMsg=""): void {
"beginConvert"(e, currentPDBOptimizationLevel=1, successMsgs=[]): void {
let frameWindow = document.getElementById("convert-frame")["contentWindow"];
frameWindow["startSpinner"]();
let content: string = this.$store.state["convertFile"];
......@@ -80,7 +80,10 @@ let methodsFunctions = {
}
if (this["currentExt"].toUpperCase() === "PDB") {
successMsg += this.pdbOptimization(currentPDBOptimizationLevel);
let msg = this.pdbOptimization(currentPDBOptimizationLevel);
if (msg !== "") {
successMsgs.push(msg);
}
}
if (this["currentType"]!=="ligand") {
......@@ -121,16 +124,17 @@ let methodsFunctions = {
let newFilename = Utils.replaceExt(this.$store.state[this["currentType"] + "FileName"], "converted.pdbqt");
this.$store.commit("updateFileName", { type: this["currentType"], filename: newFilename });
if (successMsg !== "") {
this["$bvModal"]["msgBoxOk"]("To convert your file to PDBQT, Webina had to make the following modifications: " + successMsg, {
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, {
"title": "Warning: File Too Big!",
});
}
}).catch((msg) => {
// The conversion failed. But if it's a PDB file, it might be
// worth trying to optimize it further.
if (currentPDBOptimizationLevel <= 3) {
this["beginConvert"](e, currentPDBOptimizationLevel + 1, successMsg);
if (currentPDBOptimizationLevel <= 4) { // one less than max number in pdbOptimization.
this["beginConvert"](e, currentPDBOptimizationLevel + 1, successMsgs);
return;
}
......@@ -166,22 +170,42 @@ let methodsFunctions = {
switch (level) {
case 1:
// 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");
break;
case 2:
// Try removing everything but protein atoms.
pdbTxt = Utils.keepOnlyProteinAtoms(pdbTxt);
msg += " (1) Discard non-protein atoms."
msg = "Discard non-protein atoms."
break;
case 3:
// 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");
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;
}
// console.log("HHHHH>>> " + msg + " >>>> " + pdbTxt.length.toString());
this.$store.commit("setVar", {
name: "convertFile",
val: pdbTxt
......
......@@ -2,4 +2,4 @@
// LICENSE.md or go to https://opensource.org/licenses/Apache-2.0 for full
// details. Copyright 2020 Jacob D. Durrant.
export let VERSION = "1.0.1";
export let VERSION = "1.0.2";
......@@ -64,8 +64,8 @@
<div class="row">
<div class="col-8 col-content">
<div class="tsd-panel tsd-typography">
<a href="#webina-101" id="webina-101" style="color: inherit; text-decoration: none;">
<h1>Webina 1.0.1</h1>
<a href="#webina-102" id="webina-102" style="color: inherit; text-decoration: none;">
<h1>Webina 1.0.2</h1>
</a>
<a href="#introduction" id="introduction" style="color: inherit; text-decoration: none;">
<h2>Introduction</h2>
......
......@@ -117,7 +117,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in UI/Modal/ConvertFileModal.ts:226</li>
<li>Defined in UI/Modal/ConvertFileModal.ts:250</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
......@@ -294,7 +294,7 @@
<a name="methodsfunctions.beginconvert" class="tsd-anchor"></a>
<h3>begin<wbr>Convert</h3>
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-object-literal tsd-is-not-exported">
<li class="tsd-signature tsd-kind-icon">begin<wbr>Convert<span class="tsd-signature-symbol">(</span>e<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, currentPDBOptimizationLevel<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, successMsg<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
<li class="tsd-signature tsd-kind-icon">begin<wbr>Convert<span class="tsd-signature-symbol">(</span>e<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, currentPDBOptimizationLevel<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, successMsgs<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
......@@ -326,9 +326,9 @@
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> successMsg: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;&quot;</span></h5>
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> successMsgs: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = []</span></h5>
<div class="tsd-comment tsd-typography">
<p>The message to display
<p>The messages to display
to the user on success
(if any).</p>
</div>
......@@ -349,7 +349,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in UI/Modal/ConvertFileModal.ts:197</li>
<li>Defined in UI/Modal/ConvertFileModal.ts:221</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
......@@ -372,7 +372,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in UI/Modal/ConvertFileModal.ts:161</li>
<li>Defined in UI/Modal/ConvertFileModal.ts:165</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
......@@ -407,7 +407,7 @@
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in UI/Modal/ConvertFileModal.ts:217</li>
<li>Defined in UI/Modal/ConvertFileModal.ts:241</li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
......
......@@ -84,7 +84,7 @@
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-module">
<a name="version" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagLet">Let</span> VERSION</h3>
<div class="tsd-signature tsd-kind-icon">VERSION<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;1.0.1&quot;</span></div>
<div class="tsd-signature tsd-kind-icon">VERSION<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = &quot;1.0.2&quot;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in Version.ts:5</li>
......
rm -rf docs
typedoc --out docs --exclude "**/*.js" --ignoreCompilerErrors --mode modules --hideGenerator src
rm -rf technical_docs
typedoc --out technical_docs --exclude "**/*.js" --ignoreCompilerErrors --mode modules --hideGenerator src
No preview for this file type
Markdown is supported
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