Sendplot Lori Shepherd April 06, 2009. sendplot The Problem: The Approach: How can we quickly generate useful data and get it back to scientists/collaborators.

Slides:



Advertisements
Similar presentations
B2PDF b2pdf is the new and innovative release of our powerful command line tool for PDF customization b2pdf is a robust stand alone PDF file generation.
Advertisements

Working with Profiles in IX1D v 3 – A Tutorial © 2006 Interpex Limited All rights reserved Version 1.0.
The Web Warrior Guide to Web Design Technologies
Chapter 6 Photoshop and ImageReady: Part II The Web Warrior Guide to Web Design Technologies.
MATLAB’s extensive, device-independent plotting capabilities are one of its most powerful features. They make it very easy to plot any data at any time.
1 Chapter 12 Working With Access 2000 on the Internet.
Create slices and hotspots Create links in Web pages Create rollovers from slices Create basic animation Add tweening symbol instances to create animation.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Java Applets What is an Applet? How do you create.
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Introduction to Java A lab course by Dr. Junaid Ahmed Zubairi SUNY Fredonia.
The Power of Tables They aren't just for sitting stuff on anymore...
Digimap Carto is an advanced version of classic but with many more options. You need to return to the Digimap home page and this time select the “Digimap.
Create a Web Site with Frames
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2006 Microsoft Corporation.
ArcGIS Extensions Expanding the Use of ArcGIS
Creating Web Page Forms
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
CST JavaScript Validating Form Data with JavaScript.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
LGC Website and Customer On-line Tools LGC RESOURCE 2014.
XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
1 Creating Web Forms in HTML Web forms collect information from customers Web forms include different control elements including: –Input boxes –Selection.
Forms and Form Controls Chapter What is a Form?
Chapter 5 Review: Plotting Introduction to MATLAB 7 Engineering 161.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
Server-side Scripting Powering the webs favourite services.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
© Ms. Masihi.  The Dreamweaver Welcome Screen first opens when you start Dreamweaver.  This screen gives you quick access to previously opened files,
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
HTML II. Factors to consider in designing a website. Organizing your files. HTML Tables. Unordered Lists. Ordered Lists. HTML Forms. Learning Objectives.
R-Graphics Day 2 Stephen Opiyo. Basic Graphs One of the main reasons data analysts turn to R is for its strong graphic capabilities. R generates publication-ready.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
CSCE Chapter 5 (Links, Images, & Multimedia) CSCE General Applications Programming Benito Mendoza 1 By Benito Mendoza Department.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
Introduction to Matlab & Data Analysis
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
Lecture # 6 Forms, Widgets and Event Handling. Today Questions: From notes/reading/life? Share Personal Web Page (if not too personal) 1.Introduce: How.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
An Introduction to R graphics Cody Chiuzan Division of Biostatistics and Epidemiology Computing for Research I, 2012.
Pasewark & Pasewark 1 Access Lesson 5 Creating and Modifying Reports Microsoft Office 2007: Introductory.
1 NORMA Lab. 7 Generating Reports More Display Options File: NORMA_Lab6.ppt. Author: T. Halpin. Last updated: 2009 June 9.
Week 11 Creating Framed Layouts Objectives Understand the benefits and drawbacks of frames Understand and use frame syntax Customize frame characteristics.
Damian Tamayo Tutorial DTM Data Generator Fall 2008 CIS 764.
Utah’s Indicator-Based Information System for Public Health (IBIS-PH) Utah Department of Health Office of Public Health Assessment Lois M. Haggard, Ph.D.,
Basic Editing Lesson 2.
Chapter 2 Web Page Design Mr. Gironda. Elements of a Web Page These are things that most web pages use.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Adding Graphical Elements Essentials for.
1 HTML Forms
1 HTML Forms
HTML Form Widgets. Review: HTML Forms HTML forms are used to create web pages that accept user input Forms allow the user to communicate information back.
R-Graphics Stephen Opiyo. Basic Graphs One of the main reasons data analysts turn to R is for its strong graphic capabilities. R generates publication-ready.
Web Design (8) Images (2). My Holiday Photos An exercise in adding and linking images. Create a new website folder calling it ‘My Holiday Photos’. In.
Pasewark & Pasewark 1 Access Lesson 5 Creating and Modifying Reports Microsoft Office 2007: Introductory.
Jan 2001C.Watters1 World Wide Web and E-Commerce Client Side Processing.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
Creating Web Page Forms COE 201- Computer Proficiency.
Introducing Dreamweaver. Dreamweaver The web development application used to create web pages Part of the Adobe creative suite.
LESSON 15 – UNIT 0 ADAPTING YOUR WEB SITE FOR MOBILE DEVICES.
1 HTML Forms
1 HTML forms (cont.)
Adding Interactivity Comp 140 Fall Web 2.0 Major change in internet usage –From mostly static pages Text Graphics Simple links –To new paradigm.
Introduction to plotting data Fish 552: Lecture 4.
ITIS 1210 Introduction to Web-Based Information Systems Chapter 22 Image Maps and Interactive Forms.
Section 17.1 Section 17.2 Add an audio file using HTML
PHP Introduction.
WEB PROGRAMMING JavaScript.
Presentation transcript:

sendplot Lori Shepherd April 06, 2009

sendplot The Problem: The Approach: How can we quickly generate useful data and get it back to scientists/collaborators with minimal requirements/effort on their end? We have developed an R package called sendplot based on Dr. Sucheston’s visualization demo given on September 4, 2007

What is sendplot? sendplot generates an interactive layout of plots. each plot may be interactive or static What is meant by interactivity is that information specific to a point or image region is displayed when the mouse scrolls over the area A png file and an html file are sent to end user; it can be sent to and run on any machine with a web browser that has javascript capabilities

End Result Result is two files: 1. png file 2. html file The researcher/collaborator need only to open the html file in order to have an interactive graph to view data. It can be customized on the programmers end to show any data the researcher requests or would find useful

System Requirements for Programmer 1.R 2.libtiff All system requirements are free for download A version of this software that will no longer need system requirements, except R, is being created. Please check future releases. Previous versions of this software, available on CRAN, do not require system requirements except for R. The functionality is limited to only one plot in the layout being interactive, while the other plots of the layout are static. It also may require more steps for the user.

Main sendplot functions initSplot : this function creates an object of the type ’Splot’ which holds all information to generate a static layout of plots. makeImap : this function adds image mapping information to the Splot object to allow for figure interactivity. makeSplot : this function produces an interactive (or static) layout of plots.

Wrappers Functions xy.send : this function produces an interactive xy plot without any additional plots (i.e., just a single scatter-plot). imagesend : this function produces an interactive image plot without any additional plots (i.e., just a single image plot). heatmap.send : this function is a wrapper for the R stats package heatmap. This will create an interactive heatmap image. NOTE: The majority of the code for this function is verbatim from the R package stats heatmap function. This function was designed to work as a wrapper to utilize the same functionality and plotting as the heatmap function with sendplot’s interactive functionality.

Object Oriented Approach sendplot takes on an object oriented feel: creating an object (initSplot) manipulating the object (makeImap) acting on the object to display contents (makeSplot) Let’s look at sendplot functions a little more closely...

initSplot: initializing object initSplot( mat, plot.calls, Iflag=NA, figTypes=NA, mai.mat=NA, mai.prc=FALSE, plot.extras = NA, source.plot=NA, image.size="800x1100", pointsize=12, res=NA, ps.paper="letter",ps.width=8,ps.height=11, returnVl=T, saveFlag=F,saveName="Splot.RData")

initSplot: initializing object initSplot( mat, plot.calls, Iflag=NA, figTypes=NA, mai.mat=NA, mai.prc=FALSE, plot.extras = NA, source.plot=NA, image.size="800x1100", pointsize=12, res=NA, ps.paper="letter",ps.width=8,ps.height=11, returnVl=T, saveFlag=F,saveName="Splot.RData")

How it works: initSplot argument mat determines the layout of the plots using R’s layout function. mat is a numeric matrix with numbers 1:number of desired plots. 0 indicates area with no plot

How it works: plot.calls is a character vector with the plot call that will be executed plot.calls = c( "boxplot(count ~ spray, data = InsectSprays, col = 'lightgray')", "plot(1:3,1:3, col='blue', xlab='', ylab=''); points(1:2, 2:3, col='red')", "image(1:2,1:3, z=matrix(myX,ncol=3,nrow=2), xlab='', ylab='')", "plot(cos, xlim = c(-pi,3*pi), n = 1001, col = 'blue', xlab='', ylab='')" you can combined calls with a semicolon “ plot(1:3,1:3, col='blue', xlab='', ylab=''); points(1:2, 2:3, col='red')"

initSplot: initializing object initSplot( mat, plot.calls, Iflag=NA, figTypes=NA, mai.mat=NA, mai.prc=FALSE, plot.extras = NA, source.plot=NA, image.size="800x1100", pointsize=12, res=NA, ps.paper="letter",ps.width=8,ps.height=11, returnVl=T, saveFlag=F,saveName="Splot.RData") Let’s look at an example...

plot.extras argument Based on previous plot.calls, the rectangles in the box plot, the polygon in the scatterplot, and all plot titles (A,B,C,D) have not been drawn. How are these added? plot.extras=list( figure1= "rect(xleft=c(3,1), ytop=c(25,5),xright=c(4,2), ybottom=c(20,0)); title(main='A', cex=3)", figure2=list(c("polygon(x=c(2,2.5,3,2.5), y=c(1,2.5,1,1.5))"), c("title(main='B', cex=3)")), figure3 ="title(main='C', cex=3)", figure4="title(main='D', cex=3)“)

initSplot: initializing object initSplot( mat, plot.calls, Iflag=NA, figTypes=NA, mai.mat=NA, mai.prc=FALSE, plot.extras = NA, source.plot=NA, image.size="800x1100", pointsize=12, res=NA, ps.paper="letter",ps.width=8,ps.height=11, returnVl=T, saveFlag=F,saveName="Splot.RData")

Now what... Now we have initialized an object, ‘Splot’. The object, at this point, contains information to make a static layout of plots. If the user wishes to add interactive capabilities, data needs to be added to the Splot object through makeImap If the user just wants a static layout of plots, the user may use the makeSplot function on the Splot object.

makeImap: adding interactivity makeImap( Splot, x.pos, y.pos, figure=1, xy.type=NA, x.right.pos=NA, y.bottom.pos=NA, spot.radius = 5, x.labels=NA,y.labels=NA,xy.labels=NA, x.links=NA, y.links=NA,xy.links=NA, asLinks=NA, x.images=NA, y.images=NA, xy.images=NA, font.type="Helvetica",font.color="black", font.size="12",bg.color='#D6E3F6', fname.root="Splot",dir="./", automap=TRUE,automap.method="mode", bb.clr=NA,bb.cex=2, returnVl=T,saveFlag=F,saveName="Splot.RData“, cleanDir=T)

makeImap: adding interactivity makeImap( Splot, x.pos, y.pos, figure=1, xy.type=NA, x.right.pos=NA, y.bottom.pos=NA, spot.radius = 5, x.labels=NA,y.labels=NA,xy.labels=NA, x.links=NA, y.links=NA,xy.links=NA, asLinks=NA x.images=NA, y.images=NA, xy.images=NA, font.type="Helvetica",font.color="black", font.size="12",bg.color='#D6E3F6', fname.root="Splot",dir="./", automap=TRUE,automap.method="mode", bb.clr=NA,bb.cex=2, returnVl=T,saveFlag=F,saveName="Splot.RData“, cleanDir=T)

How it works: x.labels, ylabels, xy.labels stores information that will be displayed interactively x values specific data x.labels/y.lables – data.frames xy.labels – list of matricies y values x values This data will be mapped based on x and y values, and some internal calculations of the up left and lower right boundary points of the figure.

How it works: x.links, y.links, xy.links work the same as x.lables, ylables, xy.labels storeing information that will be displayed interactively x values specific data x.links/y.links – data.frames xy.lbls – list of matricies y values x values The difference between the labels and the links sets are the links contain complete web links/hyperlinks to include in the tool tip; Similarly x.images, y.images, and xy.images behave the same but add images to the tool-tip

How it works: It is also possible for the interactive points to be links themselves. This is controlled with the asLinks argument.

makeImap: adding interactivity makeImap( Splot, x.pos, y.pos, figure=1, xy.type=NA, x.right.pos=NA, y.bottom.pos=NA, spot.radius = 5, x.labels=NA,y.labels=NA,xy.labels=NA, x.links=NA, y.links=NA,xy.links=NA, asLinks=NA, x.images=NA, y.images=NA, xy.images=NA, font.type="Helvetica",font.color="black", font.size="12",bg.color='#D6E3F6', fname.root="Splot",dir="./", automap=TRUE,automap.method="mode", bb.clr=NA,bb.cex=2, returnVl=T,saveFlag=F,saveName="Splot.RData“, cleanDir=T)

The following need to be taken into account when determining the upper left and low right boundary coordinates 1.Operating System (windows, linux) 2.Graph type (scatter, image) 3.File type (ps, png) a.ps width and height b.resize All calculations are made within the function. Programmer does not have to be concerned Inner workings:

makeImap: adding interactivity makeImap( Splot, x.pos, y.pos, figure=1, xy.type=NA, x.right.pos=NA, y.bottom.pos=NA, spot.radius = 5, x.labels=NA,y.labels=NA,xy.labels=NA, x.links=NA, y.links=NA,xy.links=NA, asLinks=NA, x.images=NA, y.images=NA, xy.images=NA font.type="Helvetica",font.color="black", font.size="12",bg.color='#D6E3F6', fname.root="Splot",dir="./", automap=TRUE,automap.method="mode", bb.clr=NA,bb.cex=2, returnVl=T,saveFlag=F,saveName="Splot.RData“, cleanDir=T)

Some example tool-tips... these are the same tool-tips that are generated in the vignette example and utilized in the example that can be downloaded from the sendplot home page off the University at Buffalo Biostatistics research software page This is default setting. font.type="Helvetica“ font.color="black“ font.size="12“ bg.color='#D6E3F6' font.type=“arial“ font.color=“hotpink“ font.size=“20“ bg.color=“blue” font.type="Helvetica“ font.color=“cyan“ font.size="15“ bg.color=‘black'

Some example tool-tips... these are the same tool-tips that are generated in the vignette example and utilized in the example that can be downloaded from the sendplot home page off the University at Buffalo Biostatistics research software page Notice the transparency by using empty string font.type=“arial“ font.color=“green“ font.size=“14“ bg.color=“” font.type=“sans-serif“ font.color=“purple“ font.size=“30“ bg.color='#D6E3F6'

makeImap: adding interactivity makeImap( Splot, x.pos, y.pos, figure=1, xy.type=NA, x.right.pos=NA, y.bottom.pos=NA, spot.radius = 5, x.labels=NA,y.labels=NA,xy.labels=NA, x.links=NA, y.links=NA,xy.links=NA, asLinks=NA, x.images=NA, y.images=NA, xy.images=NA, font.type="Helvetica",font.color="black", font.size="12",bg.color='#D6E3F6', fname.root="Splot", dir="./", automap=TRUE,automap.method="mode", bb.clr=NA,bb.cex=2, returnVl=T, saveFlag=F, saveName="Splot.RData“, cleanDir=T)

Now what... Now we have initialized an object, ‘Splot’. Added data to the Splot object for interactivity through makeImap Now it time to make the files that will be send to end user

makeSplot makeSplot( Splot, fname.root="Splot", dir="./", overwriteSourcePlot = NA, makeInteractive=TRUE, overrideInteractive=NA, Default=TRUE, header="v3", window.size = "800x1100", returnObj = FALSE, getLims=FALSE)

makeSplot makeSplot( Splot, fname.root="Splot", dir="./", overwriteSourcePlot = NA, makeInteractive=TRUE, overrideInteractive=NA, Default=TRUE, header="v3", window.size = "800x1100", returnObj = FALSE, getLims=FALSE)

makeSplot makeSplot( Splot, fname.root="Splot", dir="./", overwriteSourcePlot = NA, makeInteractive=TRUE, overrideInteractive=NA, Default=TRUE, header="v3", window.size = "800x1100", returnObj = FALSE, getLims=FALSE)

Screenshot of HTML

Wrappers Functions xy.send : this function produces an interactive xy plot without any additional plots (i.e., just a single scatter-plot). imagesend : this function produces an interactive image plot without any additional plots (i.e., just a single image plot). heatmap.send : this function is a wrapper for the R stats package heatmap. This will create an interactive heatmap image. NOTE: The majority of the code for this function is verbatim from the R package stats heatmap function. This function was designed to work as a wrapper to utilize the same functionality and plotting as the heatmap function with sendplot’s interactive functionality.

See vignette for some additional functions and other examples

So... Result is two files: 1. png file 2. html file The researcher/collaborator need only to open the html file in order to have an interactive graph to view data. It can be customized on the programmers end to show any data the researcher requests or would find useful Additional files may have been created, however only the main html file and png file are needed

Download 1.UB Biostatistics website 2. CRAN:

Up and Coming Improvements we are implementing in future version releases: add option for multiple tool-tip display

See Also A Bioinformatics wrapper has been created : iGenomicViewer available for download from the University at Buffalo Biostatistics research software page creates an interactive layout of plots for ANY genomic data

Acknowledgments Andrew Bruno Lara Sucheston Kenneth Manly Dan Gaile