Webgl and HTML5 Interactive Protein Structure Tutorial WHIPST

Total Page:16

File Type:pdf, Size:1020Kb

Webgl and HTML5 Interactive Protein Structure Tutorial WHIPST Generating Interactive Protein Structure Tutorial Using WebGL and HTML5 _______________________________________ ________________________________________________________________________ Elizabeth Montes April 25, 2014 CS 698 – Master’s Project in Computer Science California State University San Marcos (CSUSM) Master’s Project Committee Members: Dr. Xiaoyu Zhang, CSUSM Department of Computer Science Dr. Ahmad Hadaegh, CSUSM Department of Computer Science Dr. Sajith Jayasinghe, CSUSM Department of Chemistry and Biochemistry ii DEDICATIONS I dedicate this project to the memory of my mother who has been an inspirational human being and a great example of strength, courage, passion and love; to my father who is a great example of hard work and loyalty to his family; and to my siblings who are always there for me and who have become my strength in these past years; and to my nieces and nephews who always fill me with joy. iii ACKNOWLEDGEMENTS I would like to thank each and every committee member for their dedication of time, advice, supervision, feedback and encouragement required for the completion of this project. This project would not be possible if not were for their guidance, encouragement and expertise. iv ABSTRACT Proteins are large biological molecules of long polymers of amino acid residues, typically containing thousands of atoms and consisting of a uniform repetitive backbone and variable side chains attached to each residue. They fold into complex 3D structures to perform a vast array of functions within living organisms. In order to help students to better understand the protein structures, it is important that the student can visualize the details of 3D structures, and manipulate them interactively to focus on aspects of interest. Recent developments in web technologies such as WebGL and HTML5, available in a wide range of browser on different platforms, made them the perfect choice to build cross-platform interactive tutorials for learning protein structures. This project, WebGL and HTML5 Interactive Protein Structure Tutorial Generator (WHIPSTG: http://montes.co.nf/whipst.html), made it possible for biochemistry or biology professors to easily generate web tutorials that can facilitate students’ learning of protein structures. The generated tutorials allow the user to interact with protein visualization in 3D, answer true/false questions and multiple- choice questions, and read text. WHIPSTG uses GLmol – a 3D molecular viewer based on WebGL and JavaScript – to visualize and interactively manipulate the 3D protein. For the scope of this project, GLmol has been modified to include functionality for highlighting amino acids and highlighting a part of a protein sequence. I developed a web interface that provides the user with a short introduction about the project, the ability to easily generate an interactive tutorial and various examples of generated tutorials. v Table of Contents DEDICATIONS .................................................................................................................iii ACKNOWLEDGEMENTS .............................................................................................. iv ABSTRACT ......................................................................................................................... v 1. INTRODUCTION........................................................................................................ 1 2. BACKGROUND .......................................................................................................... 3 2.1 WebGL ............................................................................................................................ 3 2.2 HTML5 ........................................................................................................................... 3 2.3 JavaScript ....................................................................................................................... 4 2.3.1 Three.js ........................................................................................................................ 4 2.3.2 jQuery .......................................................................................................................... 4 2.3.3 jQuery UI ..................................................................................................................... 5 2.4 Related Work ................................................................................................................. 6 3. DESIGN ........................................................................................................................ 7 3.1 Web Interface Description ............................................................................................ 7 3.2 Tutorial Description ....................................................................................................... 8 3.3 Web Interface View ..................................................................................................... 11 3.3.1 Web Interface Mapping Diagram .............................................................................. 11 3.3.2 Web Interface Website Flow ..................................................................................... 12 3.3.3 WHIPSTG Interaction with the User ......................................................................... 25 3.3.4 WHIPSTG Data Flow ................................................................................................ 29 3.3.5 Widget Information ................................................................................................... 31 3.4 Tutorial View ................................................................................................................ 36 3.4.1 Tutorial Mapping Diagram ........................................................................................ 36 3.4.2 Tutorial Website Flow ............................................................................................... 37 4. IMPLEMENTATION ............................................................................................... 39 4.1 Web Interface Implementation ................................................................................... 39 4.2 Tutorial Implementation ............................................................................................. 50 5. TEST CASES ............................................................................................................. 65 5.1 Test Case Create a WHIPSTG Tutorial .................................................................... 65 5.2 Test Case GLmol Highlight Amino Acids PDB ID 2POR ........................................ 74 5.3 Test Case GLmol Highlight Sequence PDB ID 2POR .............................................. 79 5.4 Negative Test Case WHIPSTG Missing Information ............................................... 82 5.5 Negative Test Case GLmol Highlight Amino acids PDB ID 1111 ........................... 85 6. CONCLUSION AND FUTURE WORK ................................................................. 88 7. REFERENCES ........................................................................................................... 89 APPENDICES.................................................................................................................... 92 1. whipst.html ................................................................................................................. 92 2. file.html ....................................................................................................................... 99 3. whipst.js .................................................................................................................... 103 4. GLmol.js ................................................................................................................... 118 5. widgetFunctionality.js ............................................................................................. 131 vi 6. whipst.css .................................................................................................................. 133 7. simple.css................................................................................................................... 141 8. left.css ........................................................................................................................ 145 9. right.css ..................................................................................................................... 151 vii List of Figures Figure 1 Web Interface ......................................................................................................... 8 Figure 2 WHIPSTG Simple Layout ...................................................................................... 9 Figure 3 WHIPSTG Left Layout ........................................................................................ 10 Figure 4 WHIPSTG Right Layout ...................................................................................... 11 Figure 5 WHIPSTG Web Interface Mapping Diagram ...................................................... 12 Figure 6 Web Interface Welcome Tab ................................................................................ 13 Figure 7 WHIPSTG Tab ..................................................................................................... 14 Figure 8 Fill Out True False Question Widget ................................................................... 16 Figure 9 Adding GLmol Widgets ......................................................................................
Recommended publications
  • Avid Marquee Title Tool User's Guide
    Avid® Marquee® Title Tool User’s Guide ™ make manage move | media Avid ® Copyright and Disclaimer Product specifications are subject to change without notice and do not represent a commitment on the part of Avid Technology, Inc. The software described in this document is furnished under a license agreement. You can obtain a copy of that license by visiting Avid's Web site at www.avid.com. The terms of that license are also available in the product in the same directory as the software. The software may not be reverse assembled and may be used or copied only in accordance with the terms of the license agreement. It is against the law to copy the software on any medium except as specifically allowed in the license agreement. Avid products or portions thereof are protected by one or more of the following United States Patents: 4,746,994; 4,970,663; 5,045,940; 5,267,351; 5,309,528; 5,355,450; 5,396,594; 5,440,348; 5,452,378; 5,467,288; 5,513,375; 5,528,310; 5,557,423; 5,577,190; 5,583,496; 5,584,006; 5,627,765; 5,634,020; 5,640,601; 5,644,364; 5,654,737; 5,719,570; 5,724,605; 5,726,717; 5,729,673; 5,745,637; 5,752,029; 5,754,180; 5,754,851; 5,799,150; 5,812,216; 5,828,678; 5,842,014; 5,852,435; 5,995,115; 6,016,152; 6,061,758; 6,130,676; 6,532,043; 6,546,190; 6,636,869; 6,747,705; 6,813,622; D352,278; D392,267; D392,268; D392,269; D395,291; D396,853; D398,912.
    [Show full text]
  • HTML5 Favorite Twitter Searches App Browser-Based Mobile Apps with HTML5, CSS3, Javascript and Web Storage
    Androidfp_19.fm Page 1 Friday, May 18, 2012 10:32 AM 19 HTML5 Favorite Twitter Searches App Browser-Based Mobile Apps with HTML5, CSS3, JavaScript and Web Storage Objectives In this chapter you’ll: ■ Implement a web-based version of the Favorite Twitter Searches app from Chapter 5. ■ Use HTML5 and CSS3 to implement the interface of a web app. ■ Use JavaScript to implement the logic of a web app. ■ Use HTML5’s Web Storage APIs to store key-value pairs of data that persist between executions of a web app. ■ Use a CSS reset to remove all browser specific HTML- element formatting before styling an HTML document’s elements. ■ Save a shortcut for a web app to your device’s home screen so you can easily launch a web app. = DRAFT: © Copyright 1992–2012 by Deitel & Associates, Inc. All Rights Reserved. Androidfp_19.fm Page 2 Friday, May 18, 2012 10:32 AM 2 Chapter 19 HTML5 Favorite Twitter Searches App 19.1 Introduction 19.5 Building the App 19.2 Test-Driving the Favorite Twitter 19.5.1 HTML5 Document Searches App 19.5.2 CSS 19.5.3 JavaScript 19.3 Technologies Overview Outline 19.6 Wrap-Up 19.1 Introduction The Favorite Twitter Searches app from Chapter 5 allowed users to save their favorite Twit- ter search strings with easy-to-remember, user-chosen, short tag names. Users could then conveniently follow tweets on their favorite topics. In this chapter, we reimplement the Fa- vorite Twitter Searches app as a web app, using HTML5, CSS3 and JavaScript.
    [Show full text]
  • DHTML Effects in HTML Generated from DITA
    DHTML Effects in HTML Generated from DITA XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/ 2 | OpenTopic | TOC Contents DHTML Effects in HTML Generated from DITA............................................................3 XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/ OpenTopic | DHTML Effects in HTML Generated from DITA | 3 DHTML Effects in HTML Generated from DITA This topic describes an approach to creating expanding text and other DHTML effects in HTML-based output generated from DITA content. It is common for Help systems to use layering techniques to limit the amount of information presented to the reader. The reader chooses to view the information by clicking on a link. Most layering techniques, including expanding text, dropdown text and popup text, are implemented using Dynamic HTML. Overview The DITA Open Toolkit HTML transformations do not provide for layering effects. However, some changes to the XSL-T files, and the use of outputclassmetadata in the DITA topic content, along with some judicious use of JavaScript and CSS, can deliver these layering effects. Authoring Example In the following example illustrating the technique, a note element is to output as dropdown text, where the note label is used to toggle the display of the note text. The note element is simply marked up with an outputclass distinct attribute value (in this case, hw_expansion). < note outputclass="hw_expansion" type="note">Text of the note</note> Without any modification, the DITA OT will transform the note element to a paragraph element with a CSS class of the outputclass value.
    [Show full text]
  • Introduction to Scalable Vector Graphics
    Introduction to Scalable Vector Graphics Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Table of Contents If you're viewing this document online, you can click any of the topics below to link directly to that section. 1. Introduction.............................................................. 2 2. What is SVG?........................................................... 4 3. Basic shapes............................................................ 10 4. Definitions and groups................................................. 16 5. Painting .................................................................. 21 6. Coordinates and transformations.................................... 32 7. Paths ..................................................................... 38 8. Text ....................................................................... 46 9. Animation and interactivity............................................ 51 10. Summary............................................................... 55 Introduction to Scalable Vector Graphics Page 1 of 56 ibm.com/developerWorks Presented by developerWorks, your source for great tutorials Section 1. Introduction Should I take this tutorial? This tutorial assists developers who want to understand the concepts behind Scalable Vector Graphics (SVG) in order to build them, either as static documents, or as dynamically generated content. XML experience is not required, but a familiarity with at least one tagging language (such as HTML) will be useful. For basic XML
    [Show full text]
  • COMP 2145 Web Programming
    South Central College COMP 2145 Web Programming Common Course Outline Course Information Description This course covers the popular server-side language PHP and Drupal, a popular CMS (Content Management System). It includes important language concepts such as data types, control statements, debugging techniques, the use of SQL (Standard Query Language). PHP will give the student experience with LAMP (Linux, Apache, MySQL, and PHP) . Prerequisites: COMP1140 - Web Development with a C or higher, or a working knowledge of HTML, CSS, and FTP. COMP1130 - Programming Fundamentals with a C or higher, or a working knowledge of at least one programming language. It is strongly recommended that you have a minimum typing speed of at least 35 wpm as well as a working knowledge of Microsoft Access (COMP1125). Instructional Associate Degree Level Total Credits 4.00 Total Hours 64.00 Types of Instruction Instruction Type Credits/Hours Online/lecture Pre/Corequisites C or better in COMP1140 C or better in COMP1130 or equivalent programming experience Course Competencies 1 Install and use PHP on a local server. Learning Objectives Describe Open Source software and why it is effective for improved software development. Draw a picture describing the relationship between client/server objects used by PHP and mySQL. Common Course Outline September, 2016 Install PHP and mySQL and an Apache web server. Write a simple test program using PHP on the local server (http://localhost/ ) Establish a working environment for PHP web page development. Use variables, constants, and environment variables in a PHP program. 2 Utilize HTML forms and PHP to get information from the user.
    [Show full text]
  • AJAX and Jquery L Raw AJAX Handling in JS Is Very Tedious L Jquery Provides Flexible and Strong Support to Handle AJAX Interactions Through a Set of Jquery Functions
    AJAX Asynchronous Design in Web Apps IT 4403 Advanced Web and Mobile Applications Jack G. Zheng Fall 2019 Topics l AJAX concepts and technical elements l AJAX implications and impacts l jQuery AJAX l Basic and shorthand methods l Error handling 2 AJAX l AJAX (Asynchronous JavaScript and XML) is a group of interrelated web development techniques used on the client-side to create interactive web applications. l Despite the name, the use of XML is not actually required, nor do the requests need to be asynchronous. 3 First Impression l https://www.google.com Use Chrome’s developer tools to view network communications while typing the search terms. A set of requests have been made to get JSON data from the server as I type in the search term box. Observe the “q” parameter in all URLs. 4 AJAX Model Difference With Ajax, web applications can communicate with servers in the background without a complete page loading after every request/response cycle. http://www.adaptivepath.com /ideas/ajax-new-approach- web-applications/ 5 Traditional Model The client does not generate views/presentations (HTML/CSS). Synchronous communications feature sequential request/response cycles, one after another The server prepares the whole page. http://www.websiteoptimization.com/secrets/ajax/8-1-ajax-pattern.html 6 Ajax Model l With Ajax, web applications can communicate with servers in the background without a complete page loading after every request/response cycle. The client generates views/presentations and update content (partial page) by manipulating DOM. Asynchronous communications feature independent request/response cycles The server prepares partial pages (partial HTML) or just data (XML or JSON).
    [Show full text]
  • EMERGING TECHNOLOGIES Dymamic Web Page Creation
    Language Learning & Technology January 1998, Volume 1, Number 2 http://llt.msu.edu/vol1num2/emerging/ pp. 9-15 (page numbers in PDF differ and should not be used for reference) EMERGING TECHNOLOGIES Dymamic Web Page Creation Robert Godwin-Jones Virginia Comonwealth University Contents: • Plug-ins and Applets • JavaScript • Dynamic HTML and Style Sheets • Instructional Uses • Resource List While remaining a powerful repository of information, the Web is being transformed into a medium for creating truly interactive learning environments, leading toward a convergence of Internet connectivity with the functionality of traditional multimedia authoring tools like HyperCard, Toolbook, and Authorware. Certainly it is not fully interactive yet, but that is undeniably the trend as manifested in the latest (version 4) Web browsers. "Dynamic HTML," incorporated into the new browsers, joins plug-ins, Web forms, Java applets, and JavaScript as options for Web interactivity. Plug-ins and Applets While Web pages are beginning to behave more like interactive applications, traditional authoring tools are themselves becoming Internet-savvy, primarily through the use of "plug-in" versions of players which integrate with Web browsers. The most commonly used plug-in today is Macromedia's "Shockwave," used to Web-enable such applications as Director, Authorware, and Flash. "Shocked" Web pages can be very interactive and provide a visually appealing means of interacting with users (as in some sample ESL exercises from Jim Duber). Plug-ins are easy to use -- they just need to be downloaded and installed. Some come bundled with Netscape and Microsoft's browsers, which simplifies considerably the installation process (and gives developers the confidence that most users will actually have the plug-in installed).
    [Show full text]
  • Webgl™ Optimizations for Mobile
    WebGL™ Optimizations for Mobile Lorenzo Dal Col Senior Software Engineer, ARM 1 Agenda 1. Introduction to WebGL™ on mobile . Rendering Pipeline . Locate the bottleneck 2. Performance analysis and debugging tools for WebGL . Generic optimization tips 3. PlayCanvas experience . WebGL Inspector 4. Use case: PlayCanvas Swooop . ARM® DS-5 Streamline . ARM Mali™ Graphics Debugger 5. Q & A 2 Bring the Power of OpenGL® ES to Mobile Browsers What is WebGL™? Why WebGL? . A cross-platform, royalty free web . It brings plug-in free 3D to the web, standard implemented right into the browser. Low-level 3D graphics API . Major browser vendors are members of . Based on OpenGL® ES 2.0 the WebGL Working Group: . A shader based API using GLSL . Apple (Safari® browser) . Mozilla (Firefox® browser) (OpenGL Shading Language) . Google (Chrome™ browser) . Opera (Opera™ browser) . Some concessions made to JavaScript™ (memory management) 3 Introduction to WebGL™ . How does it fit in a web browser? . You use JavaScript™ to control it. Your JavaScript is embedded in HTML5 and uses its Canvas element to draw on. What do you need to start creating graphics? . Obtain WebGLrenderingContext object for a given HTMLCanvasElement. It creates a drawing buffer into which the API calls are rendered. For example: var canvas = document.getElementById('canvas1'); var gl = canvas.getContext('webgl'); canvas.width = newWidth; canvas.height = newHeight; gl.viewport(0, 0, canvas.width, canvas.height); 4 WebGL™ Stack What is happening when a WebGL page is loaded . User enters URL . HTTP stack requests the HTML page Browser . Additional requests will be necessary to get Space User JavaScript™ code and other resources WebKit JavaScript Engine .
    [Show full text]
  • Chapter 10 Document Object Model and Dynamic HTML
    Chapter 10 Document Object Model and Dynamic HTML The term Dynamic HTML, often abbreviated as DHTML, refers to the technique of making Web pages dynamic by client-side scripting to manipulate the document content and presen- tation. Web pages can be made more lively, dynamic, or interactive by DHTML techniques. With DHTML you can prescribe actions triggered by browser events to make the page more lively and responsive. Such actions may alter the content and appearance of any parts of the page. The changes are fast and e±cient because they are made by the browser without having to network with any servers. Typically the client-side scripting is written in Javascript which is being standardized. Chapter 9 already introduced Javascript and basic techniques for making Web pages dynamic. Contrary to what the name may suggest, DHTML is not a markup language or a software tool. It is a technique to make dynamic Web pages via client-side programming. In the past, DHTML relies on browser/vendor speci¯c features to work. Making such pages work for all browsers requires much e®ort, testing, and unnecessarily long programs. Standardization e®orts at W3C and elsewhere are making it possible to write standard- based DHTML that work for all compliant browsers. Standard-based DHTML involves three aspects: 447 448 CHAPTER 10. DOCUMENT OBJECT MODEL AND DYNAMIC HTML Figure 10.1: DOM Compliant Browser Browser Javascript DOM API XHTML Document 1. Javascript|for cross-browser scripting (Chapter 9) 2. Cascading Style Sheets (CSS)|for style and presentation control (Chapter 6) 3. Document Object Model (DOM)|for a uniform programming interface to access and manipulate the Web page as a document When these three aspects are combined, you get the ability to program changes in Web pages in reaction to user or browser generated events, and therefore to make HTML pages more dynamic.
    [Show full text]
  • Framework for Developing Offline HTML5 Applications
    MASARYK UNIVERSITY FACULTY}w¡¢£¤¥¦§¨ OF I !"#$%&'()+,-./012345<yA|NFORMATICS Framework for Developing Offline HTML5 Applications DIPLOMA THESIS Petr Kunc Brno, 2013 Declaration Hereby I declare, that this paper is my original authorial work, which I have worked out by my own. All sources, references and literature used or excerpted during elaboration of this work are properly cited and listed in complete reference to the due source. Advisor: doc. RNDr. Tomás Pitner, PhD. ii Acknowledgement Above all, I would like to thank my advisor doc. RNDr. Tomáš Pitner, PhD. for leading not only this diploma thesis but also for leading me during my studies. I would also like to thank my colleagues in Laboratory of Software Architectures and Information Systems, especially Mgr. Filip Nguyen and Mgr. Daniel Tovarˇnákfor priceless advice on implementation and for providing their knowledge. Nevertheless, I would like to thank my colleagues in Celebrio Software company. iii Abstract The aim of this thesis is to provide detailed information about developing offline web ap- plications. The thesis presents important technologies in the development and mostly deals with Application cache technology. It summarizes advantages and also disadvantages and problems of the technology. Then, it offers solutions to some of the problems and introduces framework for build- ing offline web applications more sophisticatedly. At last, demonstration application is pre- sented which shows the benefits of proposed technology. iv Keywords HTML5, offline, web applications, application
    [Show full text]
  • Webgl: the Standard, the Practice and the Opportunity Web3d Conference August 2012
    WebGL: The Standard, the Practice and the Opportunity Web3D Conference August 2012 © Copyright Khronos Group 2012 | Page 1 Agenda and Speakers • 3D on the Web and the Khronos Ecosystem - Neil Trevett, NVIDIA and Khronos Group President • Hands On With WebGL - Ken Russell, Google and WebGL Working Group Chair © Copyright Khronos Group 2012 | Page 2 Khronos Connects Software to Silicon • Khronos APIs define processor acceleration capabilities - Graphics, video, audio, compute, vision and sensor processing APIs developed today define the functionality of platforms and devices tomorrow © Copyright Khronos Group 2012 | Page 3 APIs BY the Industry FOR the Industry • Khronos standards have strong industry momentum - 100s of man years invested by industry leading experts - Shipping on billions of devices and multiple operating systems • Khronos is OPEN for any company to join and participate - Standards are truly open – one company, one vote - Solid legal and Intellectual Property framework for industry cooperation - Khronos membership fees to cover expenses • Khronos APIs define core device acceleration functionality - Low-level “Foundation” functionality needed on every platform - Rigorous conformance tests for cross-vendor consistency • They are FREE - Members agree to not request royalties Silicon Software © Copyright Khronos Group 2012 | Page 4 Apple Over 100 members – any company worldwide is welcome to join Board of Promoters © Copyright Khronos Group 2012 | Page 5 API Standards Evolution WEB INTEROP, VISION MOBILE AND SENSORS DESKTOP OpenVL New API technology first evolves on high- Mobile is the new platform for Apps embrace mobility’s end platforms apps innovation. Mobile unique strengths and need Diverse platforms – mobile, TV, APIs unlock hardware and complex, interoperating APIs embedded – mean HTML5 will conserve battery life with rich sensory inputs become increasingly important e.g.
    [Show full text]
  • Document Object Model
    Document Object Model Copyright © 1999 - 2020 Ellis Horowitz DOM 1 What is DOM • The Document Object Model (DOM) is a programming interface for XML documents. – It defines the way an XML document can be accessed and manipulated – this includes HTML documents • The XML DOM is designed to be used with any programming language and any operating system. • The DOM represents an XML file as a tree – The documentElement is the top-level of the tree. This element has one or many childNodes that represent the branches of the tree. Copyright © 1999 - 2020 Ellis Horowitz DOM 2 Version History • DOM Level 1 concentrates on HTML and XML document models. It contains functionality for document navigation and manipulation. See: – http://www.w3.org/DOM/ • DOM Level 2 adds a stylesheet object model to DOM Level 1, defines functionality for manipulating the style information attached to a document, and defines an event model and provides support for XML namespaces. The DOM Level 2 specification is a set of 6 released W3C Recommendations, see: – https://www.w3.org/DOM/DOMTR#dom2 • DOM Level 3 consists of 3 different specifications (Recommendations) – DOM Level 3 Core, Load and Save, Validation, http://www.w3.org/TR/DOM-Level-3/ • DOM Level 4 (aka DOM4) consists of 1 specification (Recommendation) – W3C DOM4, http://www.w3.org/TR/domcore/ • Consolidates previous specifications, and moves some to HTML5 • See All DOM Technical Reports at: – https://www.w3.org/DOM/DOMTR • Now DOM specification is DOM Living Standard (WHATWG), see: – https://dom.spec.whatwg.org
    [Show full text]