Commit 67b47c67 authored by Jacob Durrant's avatar Jacob Durrant

Update.

parent 37f7e6d8
......@@ -17,8 +17,8 @@
<body>
<h2>Protein PDB:</h2>
<div>
<label for="pdbFile">Upload Receptor PDB</label>
<input type="file" onchange="uploadPdb('receptor-txt');" id="pdbFile">
<label for="receptorPdbFile">Upload Receptor PDB</label>
<input type="file" onchange="uploadPdb('receptor-txt', 'receptorPdbFile');" id="receptorPdbFile">
</div>
<textarea id="receptor-txt">ATOM 1 N GLN A 52 42.237 16.800 35.823 1.00 12.04 -0.066 N
ATOM 2 HN1 GLN A 52 41.862 17.501 36.462 1.00 0.00 0.275 HD
......@@ -2599,8 +2599,8 @@ ATOM 2576 CD2 LEU A 316 53.762 19.249 1.167 1.00 22.88 0.009 C
TER 2577 LEU A 316 </textarea>
<h2>Ligand PDB:</h2>
<div>
<label for="pdbFile">Upload Ligand PDB</label>
<input type="file" onchange="uploadPdb('ligand-txt');" id="pdbFile">
<label for="ligandPdbFile">Upload Ligand PDB</label>
<input type="file" onchange="uploadPdb('ligand-txt', 'ligandPdbFile');" id="ligandPdbFile">
</div>
<textarea id="ligand-txt">REMARK 11 active torsions:
REMARK status: ('A' for Active; 'I' for Inactive)
......@@ -2702,24 +2702,39 @@ TORSDOF 11</textarea>
position: relative;
}
</style>
<script type="module">
<!-- <script type="module">
import * as JsZip from './node_modules/jszip/dist/jszip.js';
</script>
</script> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.3.0/jszip.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/file-saver@2.0.2/dist/FileSaver.min.js"></script>
<script>
//import JSZip from 'jszip';
function downloadFiles(){
var zip = new JSZip();
zip.folder("binana_files").file("receptor.txt", document.getElementById("receptor-txt").value).file("ligand.txt", document.getElementById("ligand-txt").value).file("binana.json", document.getElementById("output-txt").value);
zip.generateAsync({type:"download"}).then(function (download) {saveAs(dowload, "binana.zip")});
zip.folder("binana_files").file(
"receptor.txt",
document.getElementById("receptor-txt").value
).file(
"ligand.txt",
document.getElementById("ligand-txt").value
).file(
"binana.json",
document.getElementById("output-txt").value
);
zip.generateAsync({type:"string"}).then( // TODO: uint8array blob
function (download) {
saveAs(dowload, "binana.zip");
}
);
}
function uploadPdb(box){
function uploadPdb(box, id){
var textBox = document.getElementById(box);
pdbFile = document.querySelector('input[type=file]').files[0];
pdbFile = document.querySelector('#' + id).files[0];
var reader = new FileReader();
reader.onload = function (event) {
textBox.innerHTML = event.target.result;
textBox.value = event.target.result;
}
reader.readAsText(pdbFile);
}
......@@ -2771,12 +2786,12 @@ TORSDOF 11</textarea>
viewer.zoom(1.2,1000);
//highlight(json_obj, viewer, receptor, ligand);
}
// sets the atoms involved in the interaction to a different color
function highlight(obj, v, r, l, choice) {
// make an array for the interactions
var interactions = Object.keys(obj);
// loop through the interactions
for (var i = 0; i < obj[interactions[choice]].length; i++){
// loop through the ligand atoms
......
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