BO Product Marketecture

Transcription

BO Product Marketecture
Click
____ to
__edit
____Master
_____text
____
styles
______
Second
_____ _____
level
Third
____ level
_____
Enhancing Spotfire with the Power of R
Charles Roosen (Mango Solutions)
Difei Luo (TIBCO Software)
1
© 2008 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
© 2005
2006 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
Overview
Click
____ to
__edit
____Master
_____text
____
styles
______
Second
_____ _____
level
 What is Spotfire?
Third
____ level
_____
 The Spotfire Platform
 The Spotfire SDK
 R Extensions for Spotfire
 Motivation
 Extension Types
 Implementation Details
2
© 2008 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
© 2005
2006 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
Click
____ to
__edit
____Master
_____text
____
styles
______
Second
_____ _____
level
Third
____ level
_____
The Spotfire Platform
3
© 2008 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
© 2005
2006 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
TIBCO Spotfire Enterprise Analytics overview
Click
____ to
__edit
____Master
_____text
____
styles
______
Second
_____ _____
level
Third
____ level
_____
Analysts
Business Users
Data
Integration
IT &
Developers
Platform
Extensibility
Security
Integration
4
© 2008 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
App
Integration
© 2005
2006 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
TIBCO Spotfire
Professional – In-memory interactive analytics
Explore
data styles
with______
multiple, linked visualizations
Click
____ to
__edit
____Master
_____
____
Fromtext
simple
Bar charts
to powerful statistics at the
tip of your fingers
Second
_____ _____
level
Intuitive, user-driven interface
Completely
interactive
Third
____
level
_____user
experience
Auto-generated
dynamic filters
Real-time, in-memory
filtering on any field
Instantly share any
analysis
No separate
publishing step
Load data from multiple sources
ODBC/OleDB access, TS As
Information Links, Excel
Spreadsheets, flat data files, …
5
© 2008 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
© 2005
2006 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
TS Enterprise Analytics – Platform Overview
Analysts
Power Users
Statisticians
Analysts
Power Users
Statisticians
Click
____ to
__edit
____Master
_____text
____
styles
______
Second
_____ _____
level
Third
____ level
_____
Managers, Consumers,
Executives
SERVERS
Developer
CLIENTS
Developer
Web Player
Managers, Consumers,
Executives
Enterprise Player
Zero Install
Prof essional
Statisticians
Miner
In-Memory Engine
S+
Computation Engine
Event
Processing
Server
Web Player
Server
Spotf ire Server
S+ Server
In-Memory Engine
Administration & Integration
Computation Engine
Real-Time
Connectivity
IT / DBA
DATA
SOURCES
Development,
Solutions,
Integration,
Statistical Programming
*.csv
*.txt
…etc
Web
Services
*.xls*
*.mdb
…etc
SAP ERP
SAP R/3
SAP BI
SAP BW
Relational
Databases
*.xml ,
custom
sources
Siebel
Oracle
eBusiness
Salesforce
Data at rest
6
© 2008 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
© 2005
2006 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
Data
Streams
Data in motion
Click
____ to
__edit
____Master
_____text
____
styles
______
Second
_____ _____
level
Third
____ level
_____
Demo: Spotfire
7
© 2008 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
© 2005
2006 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
Click
____ to
__edit
____Master
_____text
____
styles
______
Second
_____ _____
level
Third
____ level
_____
The Spotfire SDK
8
© 2008 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
© 2005
2006 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
What is the Spotfire SDK?
Click
____ to
__edit
____Master
_____text
____
styles
______
 Second
The
TIBCO
Spotfire platform has a software development kit
_____
_____
level
(SDK)
for configuring, automating, and extending the platform.
Third
____ level
_____
 The SDK is used to create custom TIBCO Spotfire Extensions.
 Extensions add features that from the end users perspective are virtually
indistinguishable from the built-in features.
 Extensions are implemented in C# using Visual Studio
 Well documented API’s
 Well designed architecture
 Good examples on the Spotfire Technology Network
9
© 2008 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
© 2005
2006 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
Extension Types
Click
____ to
__edit
____Master
_____text
____
styles
______
 Second
TIBCO Spotfire
_____
_____
level Extension types include:
 Data
Reader: Import data from custom file, database, and web services data
Third
____
level
_____
sources
 Data Writer: Export data to custom file, database, and web services data sources
 Calculation: Add custom aggregation, expression function, and statistical
methods that automatically re-execute on data update events
 Dialog Tool: Prompt users for input into custom application and document-level
automation jobs
 Control Panel: Collect user input from and display feedback to an always
available custom control panel
 Visualization Panel: Display custom charts, plots and other forms of
presentation based on the current set of filtered and marked data
 Automation Interface: Send and receive properties, events, and commands to
and from an external application
10
© 2008 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
© 2005
2006 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
Click
____ to
__edit
____Master
_____text
____
styles
______
Second
_____ _____
level
Third
____ level
_____
R Extensions for Spotfire
11
© 2008 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
© 2005
2006 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
Motivation
Click
____ to
__edit
____Master
_____text
____
styles
______
Second
_____ _____
level
 R has a wealth of statistical techniques of value to Spotfire
Third
____ level
_____
users
 R core features
 Bioconductor
 PK modeling
 Focus is on using R for statistical computation
 R does the computation
 Spotfire does the user interface, graphics, reporting, and automation
 Why not just use S+?
 R has functionality not available for S+, e.g. Bioconductor
12
© 2008 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
© 2005
2006 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
Extensions Implemented
Click
____ to
__edit
____Master
_____text
____
styles
______
Second
_____ _____
level
 Open R Data File
Third
____
level
_____
 Load the first object in an “RData” file as a data.frame
 Open R Script File
 Execute an R script file creating a data.frame
 Open From R Expression
 Execute a one-liner expression creating a data.frame
 R Column Calculation
 Execute an R expression that creates a column
 R Custom Expression
 Execute an R expression computing a summary such as “mean()” or “mad()”
 Create and Manage General R Calculations
 Execute a block of R code creating a table
13
© 2008 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
© 2005
2006 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
Click
____ to
__edit
____Master
_____text
____
styles
______
Second
_____ _____
level
Third
____ level
_____
Demo: R Extensions
14
© 2008 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
© 2005
2006 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
Implementation Details
 Click
General
____ to
__approach
edit
____Master
_____text
____
styles
______
Second
_____
_____
level
 Spotfire
writes data to a tab-delimited file
Third
____
level
_____
 R reads
the data, does some processing, and writes results to a tab-delimited file
 Spotfire reads the tab-delimited file
 The C# code
 On the C# side, most of the code is somewhat generic code for invoking some
general process and communicating to it via text files
 The only R-specific code is that related to what “Process” is invoked
 The R code
 A general R template script handles the data exchange and errors
 Each type of extension has an R script, e.g. “Create Column”
 Varying values such as file names or R expressions are inserted into the script as
“spotfire.parameters”
15
© 2008 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
© 2005
2006 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
C# Process Code
File.WriteAllText(generatedScriptFile, masterScript);
Click
____
to
__edit
____Master
_____text
____
styles
______
string args = string.Format("CMD BATCH {0} {1}
Second
_____
_____
level stdoutFileName);
scriptFileName,
Third
____ level
_____
{2}", batchOptions,
string rExecPath = RCalculationUtilities.GetRExecutableFilePath();
ProcessStartInfo info = new ProcessStartInfo(rExecPath, args);
info.WorkingDirectory = sessionDir;
info.WindowStyle = ProcessWindowStyle.Hidden;
try {
using (Process rProc = Process.Start(info)) {
rProc.WaitForExit();
if (rProc.ExitCode > 1) {
string errorMsgFileName = Path.Combine(sessionDir,
"errormsg.txt");
if (File.Exists(errorMsgFileName)) {
errorMsg = File.ReadAllText(errorMsgFileName);
}
}
}
}
16
© 2008 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
© 2005
2006 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
R Master Template
# If an error occurs, quit with a non-zero status code
Click
____ to
__edit
____Master
_____text
____
styles
______
Second
_____ _____
level
Third
____ level
_____
options(error = expression({{cat(geterrmessage(),
file="errormsg.txt");q(status=100)}}))
# Parameters for passing settings other than data to R.
spotfire.parameters <- {1}
# Load data
spotfire.inputFilename <- "{2}"
spotfire.data <- read.delim(spotfire.inputFilename, check.names = FALSE)
# BEGIN User defined script
{0}
# END User defined script
# Save results
spotfire.outputFilename <- "{3}"
write.table(spotfire.results, file = spotfire.outputFilename, sep = "\t",
na = "", row.names = FALSE)
17
© 2008 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
© 2005
2006 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
R Extension Scripts
## R objects used:
Click
____ to
__edit
____Master
_____text
____
styles
______
Second
_____
_____
level
##
spotfire.data: data.frame passed from Spotfire
____
level
_____
## Third
spotfire.parameters:
named character vector of
##
##
to R
parameters
spotfire.results: data.frame passed from R to Spotfire
##
## Note: Error and special-case handling code left out for space reasons
# Example 1: Load the data from an Rdata file
spotfire.results <- get(load(file = spotfire.parameters["FilePath"])[1])
# Example 2: Execute an expression creating a data.frame
expr <- spotfire.parameters["DataFrameCreationExpression"]
spotfire.results <- eval(parse(text=expr))
# Example 3: Execute an expression creating a column
expr <- spotfire.parameters["CreateColumnExpression"]
spotfire.results <- with(spotfire.data, eval(parse(text=expr)))
18
© 2008 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
© 2005
2006 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
Summary
Click
____ to
__edit
____Master
_____text
____
styles
______
Second
_____ _____
level
 Spotfire is a useful tool for interactive data visualization
Third
____ level
_____
 R provides rich computational capabilities for Spotfire users
 The Spotfire SDK makes it easy to integrate the two
 Simple communication via text files and a child process works
pretty well
19
© 2008 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.
© 2005
2006 TIBCO Software Inc. All Rights Reserved. Confidential and Proprietary.