FSK-Lab

FSK-Lab Logo

Food Safety Knowledge Lab (FSK-Lab) is an open-source extension plugin to the Konstanz Information Miner (KNIME). FSK-Lab enables KNIME users to work with FSK models within KNIME.

Source code: https://github.com/SiLeBAT/FSK-Lab

Food Safety Knowledge Markup Language (FSK-ML) Software Developer Guide: Download

Guidelines for writing R code on FSK-Lab: Link

Installation

Attention!

FSK-Lab does not support the newest KNIME version 4.0 yet! We are working on it. As for now, we kindly ask you to use KNIME version 3.7.2 which you can download here: https://www.knime.com/download-previous-versions

Example files

In order to test the FSK-Lab nodes in KNIME, there is a zip-file provided here. It contains the needed files to create FSKX-model-files by using the FSKX-Creator-node in KNIME. Please, make sure to assign the corresponding files in the configuration dialogue of the Creator-node.

Details on FSK-Lab

FSK port object

Fsk-Lab provides an additional port object called FskPortObject that expresses in deep detail an FSK model. It is composed of:

  • Model script
  • Visualization script (Optional)
  • Libraries used
  • List of simulations
  • ReadMe file (optional)
  • R-workspace
  • Model metadata

Model metadata

The model metadata involved in the FSK models includes but is not limited to the table below. The complete and currently used metadata schema can be found here.

Property Description
Model name Free text
Model id Free text
Model link URL
Organism Hazard name.
Organism details Hazard details
Matrix Compartment name
Matrix details Compartment details
Creator Person contributed to the encoding of the model in its present form by implementing the model in the software solution.
Family name Model family
Contact Contact information
Software R or Matlab
Reference description Free text
Reference description link URL
Created date Date upon which the model was created. Format: MM/dd/yyyy.
Modified date Date of last modification to the model. Format: MM/dd/yyyy.
Rights Information about rights held in and over the resource. Typically, rights information includes a statement about various property rights associated with the resource, including intellectual property rights.
Notes Model notes
Curated Boolean
Model type Experimental data, Primary model with data, Primary model without data, Two step seconday model, One step secondary model, Manual secondary model, Two step tertiary model, One step tertiary model or Manual tertiary model
Model subject unknown, growth, inactivation, survival, growth/inactivation, inactivation/survival, growth/survival, growth/inactivation/survival, T, pH, aw, T/pH, T/aw, pH/aw or T/pH/aw
Food process Free text

Included nodes

FSK Creator

Creates an FSK object with the script and metadata provided by the user. The variables defined in the parameters script are ensembled in a default simulation called defaultSimulation.

Dialog Options


  • R model script. File path of the model script (mandatory)
  • Selected R visualization script. File path of the visualization script (optional)
  • README. README file (optional)
  • Working directory. Directory with resource files used by the model: plaintext, CSV and R workspace (optional).
  • Selected XLSX spreadsheet. File path of the XLSX spreadsheet with meta data (optional). In unspecified or error occurs the table will be empty.
  • Selected sheet. Name of the selected sheet in the spreadsheet.

Ports


  • Inputs: data table (optional)
  • Outputs: FSK object

FSKX Writer

Creates an FSKX file with the scripts, metadata, model encoded in SBML, workspace, working directory, simulations SedML and R packages in the FSK object.

Supported images


Images generated in the model script are saved into the archive. The supported image files are: bmp, jpeg, png and tiff.

Allowed image names


The plot generated with the visualization script is named plot.png, so any other image generated in the model script with this name will be overwritten.

Dialog Options

  • Output path. Location to file. May be an absolute URL, a mount relative URL or a local path.

Ports


  • Inputs: Input FSK model.

FSKX Reader

Creates an FSK object with the scripts, meta data, simulations, resources and R packages in the referred FSKX file.

Dialog options


  • Selected file. Location to file. May be an absolute URL, a mount-point relative URL or local path. Examples:
    • Absolute URL: knime://LOCAL/my_resource.txt
    • Mount-point relative path: knime://knime.mountpoint/my_resource.txt
    • Local path: C:/workspace/my_resource.txt

Ports


  • Outputs: FSK object

FSK Runner

Runs the input model and updates its workspace with the model results.

Visualization scripts with interactive output such as Plotly are not supported.

Dialog Options


  • Width. Width of the plot.
  • Height. Height of the plot.
  • Resolution. Resolution of the plot in PPI.
  • Text size. Default point-size of plotted text, interpreted as big points (1/72 inch) at the given resolution.
  • Simulation. The name of the selected simulation to run. If no simulation is selected then the default simulation will be selected.

Ports


  • Inputs: FSK model
  • Outputs:
    • FSK model with results stored in R workspace
    • Plot generated with the provided visualization script. If the input FSK model has no visualization script then this port will hold no image (optional).

FSK Editor

Edit the scripts and the model Meta data in an FSK object. In case there is no input model connected then it will create a new model from the user interface.

When a new model is created, a default simulation called defaultSimulation will be created with the parameters defined in the metadata (the model math part).

Ports


  • Inputs: FSK object (optional)
  • Outputs: FSK object

FSK to R

Extracts the R workspace out of an FSK object. The R workspace may be used with KNIME R nodes. If the R workspace is null or non-existent (as when the model has not been run), the generated RPortObject would be null.

Ports


  • Inputs: FSK object
  • Output: RPortObject

FSK to metadata

Extracts the metadata from an FSK object into a KNIME table.

Ports


  • Inputs: FSK object
  • Outputs: KNIME table with metadata

Behaviour: Extracts the metadata from an FSK object into a KNIME table.

FSK Simulation Configurator JS

Creates simulations for a FSK model.

The defaultSimulation settings created by the FSK creator and Editor are disabled by default. The simulation selected in the view is set as simulation to run in the runner node.

Simulation names

The simulation names only take unique identifiers of type SId. The SId type follows the pattern:

  • letter ::= ’a’..’z’,’A’..’Z’
  • digit ::= ’0’..’9’
  • nameChar ::= letter | digit | ’_’
  • name ::= ( letter | ’_’ ) nameChar*

Simulation parameters

Values for all the parameters in the FSK model. Currently only real numbers are supported.

Ports

  • Inputs: FSK object
  • Output: FSK object

FSK Joiner

Joiner of FSK objects. Joins two FSK objects and produces a combined FSK object which keeps both of the provided objects.

Ports

  • Inputs: Two FSK objects
  • Outputs:
    • Combined FSK object
    • Joining diagram

Workflow writer

Writes the current workflow to a FSKX file.

This node can be used to save the current workflow with all its nodes and connections except the workflow reader itself in an FSKX file. This workflow will be copied and saved in a meta node. The output ports of the selected node will be exported using the output ports of the meta node.

Output path

Location to file. May be an absolute URL, a mount-point relative URL or a local path.

Output node

The user must select which of the present nodes should be used to export the output ports to the meta node.

Workflow reader

Reads the workflow stored in an FSKX file.

Output path

Location of the FSKX file, as an absolute URL, a mount-point relative URL or a local path.

Load the workflow as meta node

If checked, the workflow stored in an FSKX file will be loaded into the host workflow as metanode and can be edited before execution. Otherwise the Workflow Reader will execute the workflow from the file in headless mode and expose the output.

Ports

Outputs:

  • Port object
  • BufferedDataTable object

Tutorials

These tutorials were published with the article FSK-Lab – An open source food safety model integration tool at https://doi.org/10.1016/j.mran.2018.09.001.