Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update to version 1.0.2.
  • Loading branch information
jacobdurrant committed Apr 22, 2020
1 parent dfe0591 commit f0ecb33
Show file tree
Hide file tree
Showing 57 changed files with 81 additions and 43 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,19 @@
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
-----

Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
# Webina 1.0.1 #
# Webina 1.0.2 #

## Introduction ##

Expand Down

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/index.html
Expand Up @@ -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>
Expand All @@ -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>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "webina",
"version": "1.0.1",
"version": "1.0.2",
"description": "",
"private": true,
"scripts": {
Expand Down
46 changes: 35 additions & 11 deletions src/UI/Modal/ConvertFileModal.ts
Expand Up @@ -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"];
Expand All @@ -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") {
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Version.ts
Expand Up @@ -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";
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/index.html → technical_docs/index.html
Expand Up @@ -64,8 +64,8 @@ <h1>webina</h1>
<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>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -117,7 +117,7 @@ <h3>setup</h3>
<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">
Expand Down Expand Up @@ -294,7 +294,7 @@ <h3><span class="tsd-flag ts-flagLet">Let</span> methods<wbr>Functions</h3>
<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">
Expand Down Expand Up @@ -326,9 +326,9 @@ <h5><span class="tsd-flag ts-flagDefault value">Default value</span> currentPDBO
</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>
Expand All @@ -349,7 +349,7 @@ <h3>cancel<wbr>Pressed</h3>
<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">
Expand All @@ -372,7 +372,7 @@ <h3>pdb<wbr>Optimization</h3>
<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">
Expand Down Expand Up @@ -407,7 +407,7 @@ <h3>reloadIFrame</h3>
<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">
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -84,7 +84,7 @@ <h2>Variables</h2>
<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>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions utils/build/make_docs.sh
@@ -1,2 +1,2 @@
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
Binary file modified webina.zip
Binary file not shown.

0 comments on commit f0ecb33

Please sign in to comment.