Skip to content

Commit

Permalink
update load script
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachel Partridge committed Jul 29, 2016
1 parent 34708bd commit e21623a
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions src/main/webapp/resources/js/pv/load.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@

(function() {

if(document.getElementById('data-pdb') != null) {
var pdbid = window.frameElement.getAttribute('data-pdb');
}
else {
var pdbid = "5ddk";
}
// if(document.getElementById('data-pdb') != null) {
// var pdbid = window.frameElement.getAttribute('data-pdb');
// }
// else {
// var pdbid = "5ddk";
// }

// usually just use this
//var pdbid = window.frameElement.getAttribute('data-pdb');

var folder = pdbid.charAt(1).concat(pdbid.charAt(2));
var url = 'pdb/' + folder + '/pdb' + pdbid + '.ent.gz';
// var folder = pdbid.charAt(1).concat(pdbid.charAt(2));
// var url = 'pdb/' + folder + '/pdb' + pdbid + '.ent.gz';

// var element = document.getElementById('gl');
// var viewer = pv.Viewer(element,
// { quality : 'high', width: 'auto', height : 'auto',
// antialias : true, outline : true});
var options = {
width: 50,
height: 50,
antialias: true,
quality : 'medium'
};
proteinViewer = pv.Viewer(document.getElementById('viewer'), options);
// var options = {
// width: 50,
// height: 50,
// antialias: true,
// quality : 'medium'
// };
// proteinViewer = pv.Viewer(document.getElementById('viewer'), options);
console.log("script entered");

function load(pdbid) {
console.log("load funct entered");
//document.getElementById('status').innerHTML ='loading ' + pdbid;
pv.io.fetchPdb(url, function(structure) {
window.structure = structure;
preset();
proteinViewer.centerOn(structure);
});
document.getElementById('status').innerHTML = '';
}
// function load(pdbid) {
// console.log("load funct entered");
// //document.getElementById('status').innerHTML ='loading ' + pdbid;
// pv.io.fetchPdb(url, function(structure) {
// window.structure = structure;
// preset();
// proteinViewer.centerOn(structure);
// });
// document.getElementById('status').innerHTML = '';
// }

function loadProtein() {
console.log("loadProtein");
Expand Down Expand Up @@ -67,13 +67,13 @@
proteinViewer.clear();
proteinViewer.trace('structure', structure);
}
function preset() {
proteinViewer.clear();
var ligand = structure.select({rnames : ['RVP', 'SAH']});
proteinViewer.ballsAndSticks('ligand', ligand);
proteinViewer.cartoon('protein', structure);
proteinViewer.autoZoom();
}
// function preset() {
// proteinViewer.clear();
// var ligand = structure.select({rnames : ['RVP', 'SAH']});
// proteinViewer.ballsAndSticks('ligand', ligand);
// proteinViewer.cartoon('protein', structure);
// proteinViewer.autoZoom();
// }

document.getElementById('cartoon').onclick = cartoon;
document.getElementById('line-trace').onclick = lineTrace;
Expand Down

0 comments on commit e21623a

Please sign in to comment.