julien vanwinsberghe , clinbay , france francois vandenhende, clinbay , belgium

22
Decimaker: Decimaker: A statistical software A statistical software using R, Microsoft .NET, R using R, Microsoft .NET, R (D)COM (D)COM Server and graphical Server and graphical libraries libraries Julien Vanwinsberghe, ClinBAY, France Francois Vandenhende, ClinBAY, Belgium

Upload: adler

Post on 06-Jan-2016

27 views

Category:

Documents


0 download

DESCRIPTION

Decimaker: A statistical software using R, Microsoft .NET, R (D)COM Server and graphical libraries. Julien Vanwinsberghe , ClinBAY , France Francois Vandenhende, ClinBAY , Belgium. Presentation outline. Decimaker software highlight Build a software using R: Why & How? - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Decimaker: Decimaker: A statistical software using A statistical software using R, Microsoft .NET, R (D)COM R, Microsoft .NET, R (D)COM Server and graphical Server and graphical libraries libraries

Julien Vanwinsberghe, ClinBAY, France Francois Vandenhende, ClinBAY, Belgium

Page 2: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Presentation outlinePresentation outlineDecimaker software highlightBuild a software using R: Why & How?Open Source components that can be

usefulDecimaker demonstrationInstallation & required componentsSome tools used during developmentConclusion

Page 3: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Decimaker software highlightDecimaker software highlight Decimaker: software for Adaptive

Dose-Response Trials and Bayesian Decision Analysis◦ Designed to assist clinical

development teams ◦ protocol design, trial simulations and

analysis

User-friendly graphical interface

Components◦ Statistics: R and Open Bugs◦ GUI: C# and .NET Framework 2.0◦ Connection to R: R(D)COM Server

Page 4: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Build a software using R:Build a software using R:Why & How?Why & How?

Page 5: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Build a software using R:Build a software using R:Part 1 - Why?Part 1 - Why?R is command-line statistical software widely

used by researchersA lot of statistical methods have been developed

in R R is open-source

◦ Number of packages steadily increasing◦ Fast and robust

lack of an intuitive graphical interface for novices -> develop an interface easily understandable around the R programs

Decimaker: kernel is a set of R programs, enhanced by a graphical interface

Page 6: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Build a software using R:Build a software using R:Part 2 - How?Part 2 - How?R (D)COM Server: COM server used to connect

a client application (e.g. Microsoft Excel) with R◦ Environment: MS Windows◦ Methods to transfer data to/from R

Add the COM references to the C# .NET projectUse the methods of the StatConnector object to

evaluate R commandsSTATCONNECTORSRVLib.StatConnector R = new STATCONNECTORSRVLib.StatConnector(); R.Init("R"); R.EvaluateNoReturn("a<-12"); object ret = R.Evaluate("a");

Page 7: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Graphical open source components Graphical open source components that can be usefulthat can be useful

Because adding a professional and pleasant Because adding a professional and pleasant interface to an application can be the most interface to an application can be the most time-consuming part of the developmenttime-consuming part of the development

Page 8: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Open Source components that can be Open Source components that can be useful:useful:Part 1 – Part 1 – R Server ActiveX componentsR Server ActiveX componentsR (D)COM Server includes two ActiveX

controls

• Easy to implement

• To show R graphical output

• To Show R text output

Display plots Transmit text outputs

Page 9: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Open Source components that can be Open Source components that can be useful:useful:Part 1 – Part 1 – R Server ActiveX componentsR Server ActiveX componentsR (D)COM Server includes two ActiveX

controls public void TestAxStatConnectors() { // Create an instance of the StatConnector STATCONNECTORSRVLib.StatConnector R = new STATCONNECTORSRVLib.StatConnector(); // Initialize R R.Init("R"); // Connect graphical and text devices R.AddGraphicsDevice("gfx", axStatConnectorGraphicsDevice.GetGFX()); R.SetCharacterOutputDevice((StatConnectorCommonLib.IStatConnectorCharacterDevice)axStatConnectorCharacterDevice.GetOcx()); // Test with R commands R.EvaluateNoReturn("print(\"plot(sin(1:100))\")"); R.EvaluateNoReturn("plot(sin(1:100))"); R.EvaluateNoReturn("print(\"Done.\")"); }

Page 10: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Open Source components that can be Open Source components that can be useful:useful:Part 2 – Part 2 – Charting and Gauge controlsCharting and Gauge controls• ZedGraph and A.J. Bauer Gauge are open-source charting and

gauge libraries

ZedGraph 2D line

and bar charts of arbitrary datasets

High degree of flexibility

A.J. Bauer gauge

Fast and performing

Several themes

Fully customizable

• Necessitates more code, but as a result, the quality of the graphical outputs is significantly improved

Page 11: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Open Source components that can be Open Source components that can be useful:useful:Part 3 – IconsPart 3 – IconsFAMFAMFAM Silk icon library

• To add a final polish

• Smooth, colourful icons for any purpose

• > 700 16x16 px icons

Page 12: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Decimaker Demonstration

Website : www.decimaker.com

Page 13: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Decimaker installation & Decimaker installation & required componentsrequired components

Page 14: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Decimaker required componentsDecimaker required components

Platform: Microsoft Windows

Required components:◦ R and required

packages◦ R (D)COM Server◦ .NET Framework 2.0

Very complicated◦ Errors in the first

attempt to execute the application

Page 15: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Decimaker required componentsDecimaker required components

Test the proper installation of required external components

string Rpath; // Variable that will contain R install path Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\R-core\R"); if (key != null) { Rpath = key.GetValue("InstallPath", "").ToString(); // Can be in DOS format if (System.IO.Directory.Exists(Rpath)) // Transform to complete path Rpath = (new System.IO.DirectoryInfo(installedPath)).FullName; }

Page 16: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Some tools used during Some tools used during software developmentsoftware development

Page 17: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Some tools used during Some tools used during developmentdevelopment Subversion: version control system

◦ used on many open source projects (Apache, KDE, Pyton, …) ◦ manages current and historical versions of files

BugTracker .NET: open-source, web-based bug tracker ◦ particularly easy to handle◦ permits to keep track of reported software bugs◦ supports integration with Subversion

FxCop: Microsoft application that analyzes managed code ◦ to find possible improvements that can be made

Testlink: test tool◦ web based interface ◦ create, manage and plan tests

Page 18: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

ConclusionConclusionSignificant time was spent on searching,

assessing and in integrating existing componentsAccurate results, fast computations and very nice

and usable graphical outputs. The open source community provides key

productsThe power of R

◦ Quality of results, speed up development◦ Decimaker is not a black-box: import statistical models,

define R formulas and queries, export results as R objects

A downside: users are bound to install all required R components

Page 19: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Thank you!Thank you!

Julien VanwinsbergheJulien Vanwinsberghe [email protected]@clinbay.com

Page 20: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

LicensesLicensesR (D)COM ServerR

ZedGraph

FamFamFam Silk Icons

A.J. Bauer Gauge

Krypton Toolkit

Not included in Decimaker

Lesser General Public License (LGPL)

Creative Commons Attribution 2.5 License

No license (just keep included code header)

Free to use runtime

Page 21: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Another tool to access R from and Another tool to access R from and application: R Serveapplication: R Serve

Rserve is a TCP/IP server

supports remote connection, authentication and file transfer

Easy integration:Rconnection c = new Rconnection();double d[]=c.eval("rnorm(10)").asDoubleArray();

Not advised for windows servers

http://www.rforge.net/Rserve/

Page 22: Julien  Vanwinsberghe ,  ClinBAY , France  Francois Vandenhende,  ClinBAY ,  Belgium

Open Source components that can be Open Source components that can be useful:useful:Part 3 – Windows Form ControlsPart 3 – Windows Form ControlsComponent Factory Toolkit library

• Improved versions of common used form controls

• Pretty design

• More functionalities

• Often updated