Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I...
Transcript of Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I...
![Page 1: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/1.jpg)
KNIMESUMMIT2016
Antje Janosch – Technology Development Studio MPI-CBG Dresden
Scripting Integration Workshop
![Page 2: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/2.jpg)
History
Antje Janosch, MPI-CBG, Dresden, Germany 2
2009 2016? R-Scrip4ng,PythonScrip4ng,
MatlabScrip4ng2010?
2013/2014
![Page 3: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/3.jpg)
General Features
• Server/Clientbasedsolu4on• Parallelexecu4on• Centralizedsetup
• Remotetemplaterepositories• Templateconfigura4onvia“KNIME-like”GUI
• DeploymentofKNIME-nodeswithscrip4ngbehind
Antje Janosch, MPI-CBG, Dresden, Germany 3
![Page 4: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/4.jpg)
Short news
R• RowIDsupport(bothdirec4ons)• Domainvalues• Color/Size/Shapemodelsupport• Flowvariablesupport• Chunkedtransfer• ‘Openexternal’• R-workspaceasgenericRport
Antje Janosch, MPI-CBG, Dresden, Germany 4
![Page 5: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/5.jpg)
Client-(server) model
Antje Janosch, MPI-CBG, Dresden, Germany 5
RServe
remoteorlocal
Matlab-Server
local
remoteorlocal
local
Python
-Server
remoteorlocal
![Page 6: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/6.jpg)
Getting started (Client)
• InstallScrip4ngpluginsfrom“TrustedCommunityContribu4ons”updatesite(KNIME>=3.0recommended)
Antje Janosch, MPI-CBG, Dresden, Germany 6
![Page 7: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/7.jpg)
Preferences
Antje Janosch, MPI-CBG, Dresden, Germany 7
![Page 8: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/8.jpg)
Node Types
• Plot• Snippet• (OpenIn…)• Genericnodes(R)
Antje Janosch, MPI-CBG, Dresden, Germany 8
![Page 9: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/9.jpg)
Plot / Snippet – Script editor tab
Antje Janosch, MPI-CBG, Dresden, Germany 9
Column namesScripting area
![Page 10: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/10.jpg)
Plot / Snippet – Template tab
10
![Page 11: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/11.jpg)
Plot / Snippet – Template tab
11
Template Repository
![Page 12: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/12.jpg)
Plot / Snippet – Template tab
12
Template Repository
![Page 13: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/13.jpg)
Plot / Snippet – Template tab
13
Template Repository
![Page 14: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/14.jpg)
Plot / Snippet – Template tab
14
Template Repository
Template Description / Source
![Page 15: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/15.jpg)
Plot / Snippet – Template tab
15
Template Repository
Template Description / Source
![Page 16: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/16.jpg)
Script editor tab – template view
Antje Janosch, MPI-CBG, Dresden, Germany 16
![Page 17: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/17.jpg)
Script editor tab – template view
Antje Janosch, MPI-CBG, Dresden, Germany 17
RGG interface of the selected template
![Page 18: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/18.jpg)
Script editor tab – template view
Antje Janosch, MPI-CBG, Dresden, Germany 18
RGG interface of the selected template
modify final script
![Page 19: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/19.jpg)
Script editor tab – template view
Antje Janosch, MPI-CBG, Dresden, Germany 19
RGG interface of the selected template
modify final script
![Page 20: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/20.jpg)
Script editor tab – template view
Antje Janosch, MPI-CBG, Dresden, Germany 20
RGG interface of the selected template
modify final script
![Page 21: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/21.jpg)
Script editor tab – template view
Antje Janosch, MPI-CBG, Dresden, Germany 21
![Page 22: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/22.jpg)
Script editor tab – template view
Antje Janosch, MPI-CBG, Dresden, Germany 22
modify template (dev)
![Page 23: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/23.jpg)
Script editor tab – template view
Antje Janosch, MPI-CBG, Dresden, Germany 23
modify template (dev)
RGG (XML)
![Page 24: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/24.jpg)
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
![Page 25: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/25.jpg)
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
![Page 26: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/26.jpg)
Plot - View options (R)
• Dynamicrepain4ngacermouseclick
Antje Janosch, MPI-CBG, Dresden, Germany 26
![Page 27: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/27.jpg)
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
![Page 28: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/28.jpg)
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
![Page 29: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/29.jpg)
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
![Page 30: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/30.jpg)
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
![Page 31: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/31.jpg)
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!...!!
![Page 32: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/32.jpg)
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>!!
![Page 33: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/33.jpg)
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
![Page 34: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/34.jpg)
Demos (R)
1. Iwanttousetemplates
2. IwanttowritemyownR-scripts
3. IwanttocreateknimeR-workflows(genericnodes)
4. Iwanttocreatetemplates
5. IwanttocreateaKNIMEnodewithRbehind
Antje Janosch, MPI-CBG, Dresden, Germany 34
![Page 35: Scripting Integration Workshop - KNIME · 2017-05-23 · 2. I want to write my own R-scripts 3. I want to create knimeR-workflows (generic nodes) 4. I want to create templates 5.](https://reader034.fdocuments.net/reader034/viewer/2022042207/5eaa1a080e9a1477d55b1561/html5/thumbnails/35.jpg)
Outlook
• SupportofrowIDsforPython/Matlabandforbothdirec4ons
• ConsoleoutputviewforRnodes• Keepofflinecopyoftemplatefiles• …
Antje Janosch, MPI-CBG, Dresden, Germany 35