scripting integration workshop - knime · 2017-05-23 · 2. i want to write my own r-scripts 3. i...

Post on 27-Apr-2020

5 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

KNIMESUMMIT2016

Antje Janosch – Technology Development Studio MPI-CBG Dresden

Scripting Integration Workshop

History

Antje Janosch, MPI-CBG, Dresden, Germany 2

2009 2016? R-Scrip4ng,PythonScrip4ng,

MatlabScrip4ng2010?

2013/2014

General Features

•  Server/Clientbasedsolu4on•  Parallelexecu4on•  Centralizedsetup

•  Remotetemplaterepositories•  Templateconfigura4onvia“KNIME-like”GUI

•  DeploymentofKNIME-nodeswithscrip4ngbehind

Antje Janosch, MPI-CBG, Dresden, Germany 3

Short news

R•  RowIDsupport(bothdirec4ons)•  Domainvalues•  Color/Size/Shapemodelsupport•  Flowvariablesupport•  Chunkedtransfer•  ‘Openexternal’•  R-workspaceasgenericRport

Antje Janosch, MPI-CBG, Dresden, Germany 4

Client-(server) model

Antje Janosch, MPI-CBG, Dresden, Germany 5

RServe

remoteorlocal

Matlab-Server

local

remoteorlocal

local

Python

-Server

remoteorlocal

Getting started (Client)

•  InstallScrip4ngpluginsfrom“TrustedCommunityContribu4ons”updatesite(KNIME>=3.0recommended)

Antje Janosch, MPI-CBG, Dresden, Germany 6

Preferences

Antje Janosch, MPI-CBG, Dresden, Germany 7

Node Types

•  Plot•  Snippet•  (OpenIn…)•  Genericnodes(R)

Antje Janosch, MPI-CBG, Dresden, Germany 8

Plot / Snippet – Script editor tab

Antje Janosch, MPI-CBG, Dresden, Germany 9

Column namesScripting area

Plot / Snippet – Template tab

10

Plot / Snippet – Template tab

11

Template Repository

Plot / Snippet – Template tab

12

Template Repository

Plot / Snippet – Template tab

13

Template Repository

Plot / Snippet – Template tab

14

Template Repository

Template Description / Source

Plot / Snippet – Template tab

15

Template Repository

Template Description / Source

Script editor tab – template view

Antje Janosch, MPI-CBG, Dresden, Germany 16

Script editor tab – template view

Antje Janosch, MPI-CBG, Dresden, Germany 17

RGG interface of the selected template

Script editor tab – template view

Antje Janosch, MPI-CBG, Dresden, Germany 18

RGG interface of the selected template

modify final script

Script editor tab – template view

Antje Janosch, MPI-CBG, Dresden, Germany 19

RGG interface of the selected template

modify final script

Script editor tab – template view

Antje Janosch, MPI-CBG, Dresden, Germany 20

RGG interface of the selected template

modify final script

Script editor tab – template view

Antje Janosch, MPI-CBG, Dresden, Germany 21

Script editor tab – template view

Antje Janosch, MPI-CBG, Dresden, Germany 22

modify template (dev)

Script editor tab – template view

Antje Janosch, MPI-CBG, Dresden, Germany 23

modify template (dev)

RGG (XML)

Tips and Tricks for Editing (R)

•  Mouseclick=”Columnname”•  Alt+Mouseclick=kIn$”Columnname”•  Ctrl+Mouseclick=Displayspossibledomainvaluesofthe

columnandofferstoinsertaselec4on(commaseparated•  PressApple/Windowskey

andselectmul4ple=assoonasyoureleasethekey,theselectedcolumnnameswillbeinserted“column1”,”column2”,...

•  FLOWVAR(currentColumnName)placeholdertoenabletheuseofflowvariables

Antje Janosch, MPI-CBG, Dresden, Germany 24

Plot – Output Options tab

Antje Janosch, MPI-CBG, Dresden, Germany 25

Placeholders for filename $$DATE$$ - yymmdd $$USER$$ - user name $$WS$$ - knime.workspace FLOWVAR(varName) – flow variable

Plot - View options (R)

•  Dynamicrepain4ngacermouseclick

Antje Janosch, MPI-CBG, Dresden, Germany 26

KNIME tables in R

•  Inputports(kInorkIn1,kIn2,…)•  Rdata.frame•  RowIDsasrownames•  Domainvaluesasfactorlevels

•  Colormodel(kIn.color.model)•  Rdata.frame•  Colorsashex-values

•  Shapemodel(kIn.shape.model)•  Rdata.frame•  ShapesaspchandtheirKNIMEname

Antje Janosch, MPI-CBG, Dresden, Germany 27

KNIME tables in R

•  Sizemodel(kIn.size.model+kIn.size.model.fun)•  Nameofthecolumnhavingasizemodel•  Func4ontocalculatethesizebasedontheKNIMEsizemodel

•  Flowvariables(knime.flow.in)

•  Rlist

Antje Janosch, MPI-CBG, Dresden, Germany 28

KNIME tables in R

•  Sizemodel(kIn.size.model+kIn.size.model.fun)•  Nameofthecolumnhavingasizemodel•  Func4ontocalculatethesizebasedontheKNIMEsizemodel

•  Flowvariables(knime.flow.in)

•  Rlist

Antje Janosch, MPI-CBG, Dresden, Germany 29

KNIME tables in R

•  Sizemodel(kIn.size.model+kIn.size.model.fun)•  Nameofthecolumnhavingasizemodel•  Func4ontocalculatethesizebasedontheKNIMEsizemodel

•  Flowvariables(knime.flow.in)

•  Rlist

Antje Janosch, MPI-CBG, Dresden, Germany 30

Template repositories Template.txt

Antje Janosch, MPI-CBG, Dresden, Germany 31

##################################################!# name: !A very cool method!# author: !Antje Janosch!# category: !KNIME-UGM/!# preview: !niceImage.png! !(optional)!!This is my template description.!######!!R/Python/Matlab code !Optionally emmbedded in RGG!!##################################################!# name: !Another very cool method!# author: !Antje Janosch!...!!

RGG

•  RGUIGenerator

•  Addi4onalelement<panellistbox label="Label" items="item1,item2,item3" span="full"/>

Antje Janosch, MPI-CBG, Dresden, Germany 32

http://rgg.r-forge.r-project.org/ RGG: a general GUI Framework for R scripts.BMC Bioinformatics. 2009 Mar 2 ; 10:74. doi: 10.1186/1471-2105-10-74.

<rgg>!some interface elements definitions!<![CDATA[!R-script!]]>! </rgg>!!

RGG

•  Placeholders$$$NUM_ATTRIBUTES$$$ - for all numeric columns $$$STR_ATTRIBUTES$$$ - for all string columns $$$ALL_ATTRIBUTES$$$ - for all columns !

Antje Janosch, MPI-CBG, Dresden, Germany 33

Demos (R)

1.  Iwanttousetemplates

2.  IwanttowritemyownR-scripts

3.  IwanttocreateknimeR-workflows(genericnodes)

4.  Iwanttocreatetemplates

5.  IwanttocreateaKNIMEnodewithRbehind

Antje Janosch, MPI-CBG, Dresden, Germany 34

Outlook

•  SupportofrowIDsforPython/Matlabandforbothdirec4ons

•  ConsoleoutputviewforRnodes•  Keepofflinecopyoftemplatefiles•  …

Antje Janosch, MPI-CBG, Dresden, Germany 35

Contact us!

antje.janosch@mpi-cbg.destoeter@mpi-cbg.de

Antje Janosch, MPI-CBG, Dresden, Germany 36

top related