Giter VIP home page Giter VIP logo

knime-mpicbg / knime-scripting Goto Github PK

View Code? Open in Web Editor NEW
43.0 18.0 25.0 19.46 MB

knime-scripting includes scripting extensions for KNIME to integrate R, Matlab, Python and Groovy scripts. These extensions include a collection of nodes to develop and deploy templates in the respective languages.

Home Page: https://github.com/knime-mpicbg/knime-scripting/wiki

License: Other

Java 96.94% MATLAB 0.80% Shell 0.08% Python 1.32% R 0.23% Jupyter Notebook 0.62%

knime-scripting's Introduction

KNIME provides powerful and flexible means to mine data. However, as many methods are implemented just for data modeling languages like R or MATLAB, it is crucial to integrate these languages into KNIME. To some extent this is already possible. However, from our daily work we have learned that many users need to use scripts without having any background in scripting. Thus we implemented a new open source scripting integration framework for KNIME, which is based on RGG templates 1. Its main purpose is to hide the script complexity behind a user-friendly graphical interface. Furthermore, our approach goes beyond the existing integration of R as it provides better and more flexible graphics support, flow variable support and an easy-to-extend server-based script template repository.

Useful Links

Development

Since KNIME is an Eclipse application it is easiest to use that IDE. Follow the instruction on KNIME SDK repository to install and confige Eclipse for KNIME development.

To work on this project use File → Import → Git → Projects from Git File → Clone URI and enter this repositorie's URL.

Debug Configuration:

In the main menu of Eclipse go to Run → Debug Configurations... → Eclipas Application → KNIME Analytics Platform and hit Debug.

You might want to change the memory settings in the Arguments tab of the debug configuration by adding:

-XX:MaxPermSize=256m

Installation

Once KNIME is installed you have the following possibilities:

  1. The easiest is to use the p2 update mechanism of KNIME (Help > Install new Software). Find the detailed instructions on the Scripting Integration page of the KNIME Community Contributions website.
  2. Use eclipse to build the plugins yourself and add them to the plugin directory of the KNIME installation.



1: RGG: A general GUI Framework for R scripts; Ilhami Visne, Bioinformatics, 2009, 10:74

knime-scripting's People

Contributors

bernd-wiswedel avatar damoser avatar fmeyenhofer avatar gab1one avatar haux avatar niederle avatar steffen-fissler avatar steveash avatar thorsten-meinl-knime avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

knime-scripting's Issues

open in python fails on MacOS

executing the node leads to a terminal window with such a message:

/var/folders/aT/aT-JBgnUFAa41sIiC1a8DE+++TQ/-Tmp-/analyze6790496198141459805.py ; exit;
-bash: /var/folders/aT/aT-JBgnUFAa41sIiC1a8DE+++TQ/-Tmp-/analyze6790496198141459805.py: python: bad interpreter: No such file or directory

More detailed error messages for R templates

If a R script (or template) has a syntax or evaluation error, the message is always the same.
It would be helpful to wrap the script in a try catch clause before sending it to Rserve and get the variabel storing the error in case of a failure.

Histogram_Density plot

The density is plotted as probability between 0 and 1, whereas the histogram shows counts. Often the density is not visible for this reason. A second axis would make it more useful.

python nodes do not work with python 3.x but with pyhton 2.x

Error message:

ERROR PythonSnippetNodeModel Traceback (most recent call last):
ERROR PythonSnippetNodeModel File "/var/folders/aT/aT-JBgnUFAa41sIiC1a8DE+++TQ/-Tmp-/analyze2520056644575458498.py", line 214, in
ERROR PythonSnippetNodeModel kIn = read_csv(r"/var/folders/aT/aT-JBgnUFAa41sIiC1a8DE+++TQ/-Tmp-/knime2python2543081995884595474.csv", True)
ERROR PythonSnippetNodeModel File "/var/folders/aT/aT-JBgnUFAa41sIiC1a8DE+++TQ/-Tmp-/analyze2520056644575458498.py", line 143, in read_csv
ERROR PythonSnippetNodeModel types = get_column_types(csv_filename)
ERROR PythonSnippetNodeModel File "/var/folders/aT/aT-JBgnUFAa41sIiC1a8DE+++TQ/-Tmp-/analyze2520056644575458498.py", line 68, in get_column_types
ERROR PythonSnippetNodeModel for row in csv_reader:
ERROR PythonSnippetNodeModel _csv.Error: iterator should return strings, not bytes (did you open the file in text mode?)
ERROR Python Snippet Execute failed: No python output table found, check script output

Reason:
csv.reader(open(csv_filename, 'rb'), delimiter=',', quotechar='"')

is correct for 2.x but not for 3.x

Checkbox for localhost

It would be nice to have a checkbox to automatically use the local r-server. Unchecking it would then use the one in the field.

If generally the localhost is 127.0.0.1 I would suggest to use this IP address instead of the word localhost. I recently had the problem that it only worked with the IP address but not with the word localhost.

(martin)

Template tree should show source

It would be nice to build up the template tree by template file sources first. At least as a view option.
And the template description should also show the source.

Python Plot nodes do not keep result images

In contrast to the MatlabPlotNodeModel and RPlotNodeModel, the PythonPlotNodeModel does not implement saveInternals and loadInternals to de/serialize the generated plots. So plots are lost after closing and reopening a workflow.

Improve rgg parse errors

If an RGG-script has a parser error it just tells that the document is not a valid RGG which is not very helpful.

This might be an rgg-related-issue. needs closer investigation.

Bug in Fix column names

The fix column names node throws a syntax error when using strict mode and the input table contains a column with '
for example "pKi'max"

Support additional data types in scripting nodes

Requested by George Papadatos (Lilly UK):

... another thing that can be
sometime annoying: the python snippet node throws an error when the input
KNIME table contains cell types other than the usual string, int or double,
such as molecule or bitvector types. I guess this is because in the python
code there is a function that tries to figure out the column type. Would it
be possible to work around this problem?

'edit templates' is read only in KNIME 2.10

from KNIME forum (Andrew):

Since upgrading to 2.10 on Friday, I am not able to edit templates. Clicking 'Edit Templates' opens the editor window, but it's read-only. I'm running Mavericks.

Rgg-panel issues

The panel which shows the RGG-GUI does not use full width/height of the window.

Rserver hangs

The KNIME image processing plugin has a "bitmask" cell type (result of object segmentation). if for instance a Rplot tries to send this data to the server it's getting stuck. Unfortunatly the server does not respond afterwards anymore. The only work around I know about until now is to restart the server.

Stop support of old R variable names

Up to now, the naming scheme from KNIMEs old R-nodes has been supported.
This makes source code rather complicated and as these KNIME nodes are deprecated anyway, we can stop supporting them.

Include Open in R funcionality into R plot node and R snippet node

It would be nice to have a check box or a tab+button or something similar in a R plot node and R snippet node to use Open in R functionality from these nodes directly. Then the configured R code could be pushed to clipboard or even to a new R document where it is ready to be executed and debugged.

This would make "search Open in R node", "drag to workflow", "connect", "execute", "open R node", "unlink form template", "copy", "new R documant" ,"paste" much faster for debugging.

(Martin)

redefined categories in template files override existing ones

Original user report (from Oliver Gathman from Cenix Bioscience):
Mir ist zudem aufgefallen, daß wenn zwei template files die gleiche template category verwenden die category aus dem zweiten template file die aus dem ersten template file überschreibt (ich hatte versucht, in einem eigenen template file definierte snippets der in Ihrem default template file definierten category "screenmining" hinzuzufügen). Kein Drama, natürlich, aber vielleicht gut zu wissen :-) .

To reproduce the problem

  1. Create two template definition files and change the knime-prefs to use both as r-template resources
  2. Create a template in each file with the same category but a different knime
  3. Open the node, switch to template repository --> ERROR: Just one template appears.

Density Plots fails on too few data

The R density histogram fails with too few elements. It would be more appropriate to produce a plot with a mention that too few data points are given.

Plot node with optional data or color model input port

this would allow to use the KNIME colour manager to assign color to subsets. Then in the future the plot templates could provide the option to use the KNIME color model.

ps:
Maybe this would be possible with shapes as well but then a dictonary has to be implemented in the background that turns the KNIME shape model values (e.g. "open circle" into R shape pch values "1")

Python plot fails under windows

It raises this error message:
IOError: [Errno 22] invalid mode ('wb') or filename: 'C:.....\Local\Temp\pyplot5587704929876224604.png

RGG line break bug after Edit Template

I noticed that the description of template gets additional line breaks in the Script Editor after edition the template using Edit Template. Each edit/apply(ok) results in an additional line break, e.g. like this:

  1. Select numerical variables for ROC curves (parameter).

"here are many line breaks"

  1. Template expects a column named "treatment" as category column. Enter the name of the negative control class as plain text. Select several classes as positive controls (cases) that will be plotted against the single negative control class (controls).

I noticed that also copy/paste line breaks in the editior then make these additional line breaks.

Currently seen in tds-cruncher-1 (windows/OS-specific problem?)

Plot Overwrite - Warning instead of Error

  1. check "Don't Overwrite" option in the plot-node configuration
  2. Execute -> fine, file is written
    Now:
  3. Execute -> error, file exists, no plot view created

This is fine, but there should be an option to disable the output file without removing the file path.
The idea is to create another checkbox to enable or disable writing the plot to file.

Python nodes fail with python 2.6 since pandas integration

From forum:

Dear Knime community,

Since I have updated the Python Snippet node, it failes even with:

kIn=pyOut

It returns this error:

ERROR PythonSnippetNodeModel File "/tmp/analyze8046917519877201488.py", line 136
ERROR PythonSnippetNodeModel d = {k: d[k].values() for k in d} # convert to dict of lists (as used by the python snippet)
ERROR PythonSnippetNodeModel ^
ERROR PythonSnippetNodeModel SyntaxError: invalid syntax
ERROR Python Snippet Execute failed: No python output table found, check script output

The Knime Python Scripting extension version is 2.0.0.201410070829

https-template files cause problems

If an https file is given in the preferences, a new node will not be configurable anymore

ERROR Node Error while creating node dialog for 'R Plot': R-templates must start with a line with the scheme # name: blabla

Open in R, wrong error message?

If Rserve is not running (tds-rserver-2 or localhost) this error is thrown by the R plot node and R snippet node:

ERROR R Plot Execute failed: Could not connect to R. Probably, the R-Server is not running.
Here's what you need to do:

  1. Check what R-server-host is configured in your Knime preferences.
  2. If your host is set to be 'localhost' start R and run the following command
    library(Rserve); Rserve(args = "--vanilla")

That's fine, but in case of the Open in R node this error is thrown?
ERROR Open in R Execute failed: spawning of R-process failed

Shouldn't it be the same? ...and wouldnt it be nice to have Open in R be executable without any server running???? It is just local anyway!!?

(martin)

Add the possibility to choose different Matlab variable classes

For convenience the KNIME table is currently parsed into a Statistical Arrays in Matlab. This requires the Statistics Toolbox!
Even though this is a fairly standard toolbox that most Matlab users choose to purchase, I would be nice to reactivate the following code
https://github.com/knime-mpicbg/knime-scripting/blob/development_2.9/matlab4knime/src/de/mpicbg/tds/knime/scripting/matlab/MatlabSnippetNodeModel.java#L63-71

And integrate the option into the configuration dialog

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.