Skip to content

Commit

Permalink
Merge pull request #18 from 3D-e-Chem/knime51
Browse files Browse the repository at this point in the history
Support KNIME 5.1
  • Loading branch information
sverhoeven authored Nov 23, 2023
2 parents c82f4f2 + b797682 commit d646995
Show file tree
Hide file tree
Showing 108 changed files with 3,139 additions and 6,361 deletions.
56 changes: 18 additions & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ name: Java CI with Maven

on:
push:
branches:
- master
pull_request:
types:
- "opened"
- "reopened"
types: [opened, synchronize, reopened]

jobs:
build:
Expand All @@ -17,47 +17,27 @@ jobs:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v3
with:
java-version: 1.8
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v2
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
auto-update-conda: true
activate-environment: test
python-version: 3.8
- name: Cache Maven packages
uses: actions/cache@v2
java-version: 17
distribution: 'temurin'
cache: maven
- uses: mamba-org/setup-micromamba@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml', '**/MANIFEST.MF', 'targetplatform/*.target') }}
restore-keys: ${{ runner.os }}-m2
- name: Cache conda deps
uses: actions/cache@v2
with:
path: |
~/conda_pkgs_dir
~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('.github/workflows/build.yml') }}
restore-keys: ${{ runner.os }}-pip
- name: OS dependencies
run: sudo apt-get install xvfb
- name: Conda dependencies
run: conda install -y -q -c conda-forge pip wheel rdkit pandas protobuf
environment-name: test-env
create-args: >-
python=3.10
rdkit
- name: Python dependencies
run: pip install sygma
- name: Build with Maven
run: mvn -B package
- name: Run tests
run: xvfb-run mvn verify -B
- name: Set up JDK 11 for SonarCloud analysis
uses: actions/setup-java@v1
with:
java-version: 11
- name: SonarCloud analysis
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn sonar:sonar
run: xvfb-run mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=3D-e-Chem_knime-sygma
8 changes: 8 additions & 0 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<extensions>
<extension>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-build</artifactId>
<version>2.7.5</version>
</extension>
</extensions>
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ The file is formatted as described on http://keepachangelog.com/.

## [Unreleased]

## [3.0.0] - 2023-11-23

### Changed

- Support KNIME 5.1
- Replaced `knime-python-wrapper` dependency with calling `sygma` executable.

## [2.0.0] - 2021-02-12

### Fixed
Expand Down
1 change: 0 additions & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ authors:
- given-names: Albert
family-names: J. Kooistra
affiliation: UMC Nijmegen
date-released: 2021-02-12
repository-code: https://github.com/3D-e-Chem/knime-sygma
license: GPL-3.0
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
The [SyGMa](https://github.com/3D-e-Chem/sygma) [KNIME](https://www.knime.org) nodes for the **Sy**stematic **G**eneration of potential **M**et**a**bolites.

[![Java CI with Maven](https://github.com/3D-e-Chem/knime-sygma/workflows/Java%20CI%20with%20Maven/badge.svg)](https://github.com/3D-e-Chem/knime-sygma/actions?query=workflow%3A%22Java+CI+with+Maven%22)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=nl.esciencecenter.e3dchem.sygma%3Anl.esciencecenter.e3dchem.sygma&metric=alert_status)](https://sonarcloud.io/dashboard?id=nl.esciencecenter.e3dchem.sygma%3Anl.esciencecenter.e3dchem.sygma)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=nl.esciencecenter.e3dchem.sygma%3Anl.esciencecenter.e3dchem.sygma&metric=coverage)](https://sonarcloud.io/dashboard?id=nl.esciencecenter.e3dchem.sygma%3Anl.esciencecenter.e3dchem.sygma)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=3D-e-Chem_knime-sygma&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=3D-e-Chem_knime-sygma)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=3D-e-Chem_knime-sygma&metric=coverage)](https://sonarcloud.io/summary/new_code?id=3D-e-Chem_knime-sygma)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4537282.svg)](https://doi.org/10.5281/zenodo.4537282)

# Installation

Requirements:

- KNIME, https://www.knime.org, version 4.0 or higher
- SyGMa Python library, https://github.com/3D-e-Chem/sygma
- KNIME, https://www.knime.org, version 5.1 or higher
- SyGMa Python executable, https://github.com/3D-e-Chem/sygma

Steps to get the SyGMa KNIME nodes inside KNIME:

1. Goto Help > Install new software ... menu
2. Press add button
3. Fill text fields with the `https://3d-e-chem.github.io/updates` update site url.
3. Fill text fields with the `https://3d-e-chem.github.io/updates/5.1` update site url.
4. Select --all sites-- in `work with` pulldown
5. Select the node
6. Install software
Expand All @@ -45,11 +45,11 @@ The update site can be used to perform a local installation.

Steps to get development environment setup based on https://github.com/knime/knime-sdk-setup#sdk-setup:

1. Install Java 8
2. Install Eclipse for [RCP and RAP developers](https://www.eclipse.org/downloads/packages/release/2018-12/r/eclipse-ide-rcp-and-rap-developers)
3. Configure Java 8 inside Eclipse Window > Preferences > Java > Installed JREs
1. Install Java 17
2. Install Eclipse for [RCP and RAP developers](https://www.eclipse.org/downloads/packages/installer)
3. Configure Java 17 inside Eclipse Window > Preferences > Java > Installed JREs
4. Import this repo as an Existing Maven project
5. Activate target platform by going to Window > Preferences > Plug-in Development > Target Platform and check the `KNIME Analytics Platform (4.0) - nl.esciencecenter.e3dchem.sygma.targetplatform/KNIME-AP-4.0.target` target definition.
5. Activate target platform by going to Window > Preferences > Plug-in Development > Target Platform and check the `KNIME Analytics Platform (5.1) - nl.esciencecenter.e3dchem.sygma.targetplatform/KNIME-AP-5.1.target` target definition.
6. A KNIME Analytics Platform instance can be started by right clicking on the `targetplatform/KNIME\ Analytics\ Platform.launch` file and selecting `Run As → KNIME Analytics Platform`. The KNIME instance will contain the target platform together with all extensions defined in the workspace.

During import the Tycho Eclipse providers must be installed.
Expand Down Expand Up @@ -88,4 +88,4 @@ This can be skipped by running maven offline using `mvn -o`.
10. Update Zenodo entry
11. Correct authors
12. Make nodes available to 3D-e-Chem KNIME feature by following steps at https://github.com/3D-e-Chem/knime-node-collection#new-release
13. Update CITIATION.cff with new DOI
13. Update CITATION.cff with new DOI
Binary file modified examples/SyGMa-example.knwf
Binary file not shown.
2 changes: 1 addition & 1 deletion feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="nl.esciencecenter.e3dchem.sygma.feature"
label="Sygma KNIME nodes"
version="2.0.0.qualifier"
version="3.0.0.qualifier"
provider-name="Netherlands eScience Center">

<description url="https://github.com/3D-e-Chem/knime-sygma">
Expand Down
2 changes: 1 addition & 1 deletion feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>nl.esciencecenter.e3dchem.sygma</groupId>
<artifactId>nl.esciencecenter.e3dchem.sygma</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>

<artifactId>nl.esciencecenter.e3dchem.sygma.feature</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion p2/category.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature id="nl.esciencecenter.e3dchem.sygma.feature" version="2.0.0.qualifier">
<feature id="nl.esciencecenter.e3dchem.sygma.feature" version="3.0.0.qualifier">
<category name="nl.esciencecenter.3D-e-Chem"/>
</feature>
<category-def name="nl.esciencecenter.3D-e-Chem" label="KNIME 3D-e-Chem Contributions">
Expand Down
2 changes: 1 addition & 1 deletion p2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>nl.esciencecenter.e3dchem.sygma</artifactId>
<groupId>nl.esciencecenter.e3dchem.sygma</groupId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>nl.esciencecenter.e3dchem.sygma.p2</artifactId>
<packaging>eclipse-repository</packaging>
Expand Down
14 changes: 5 additions & 9 deletions plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Sygma KNIME nodes
Bundle-SymbolicName: nl.esciencecenter.e3dchem.sygma.plugin;singleton:=true
Bundle-Version: 2.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Version: 3.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-Activator: nl.esciencecenter.e3dchem.sygma.Activator
Bundle-Vendor: Netherlands eScience Center
Require-Bundle: org.eclipse.core.runtime,
org.knime.workbench.core;bundle-version="[4.3.0,5.0.0)",
org.knime.workbench.repository;bundle-version="[4.3.0,5.0.0)",
org.knime.base;bundle-version="[4.3.0,5.0.0)",
org.rdkit.knime.types,
org.knime.chem.types;bundle-version="[4.3.0,5.0.0)",
nl.esciencecenter.e3dchem.python.plugin;bundle-version="[2.0.4,3.0.0)",
org.knime.workbench.core;bundle-version="[4.3.0,6.0.0)",
org.knime.workbench.repository;bundle-version="[4.3.0,6.0.0)",
org.knime.base;bundle-version="[4.3.0,6.0.0)",
nl.esciencecenter.e3dchem.plugin;bundle-version="[1.0.0,2.0.0)"
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Export-Package: nl.esciencecenter.e3dchem.sygma
Import-Package: org.knime.python2.config
4 changes: 2 additions & 2 deletions plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<parent>
<groupId>nl.esciencecenter.e3dchem.sygma</groupId>
<artifactId>nl.esciencecenter.e3dchem.sygma</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>
<artifactId>nl.esciencecenter.e3dchem.sygma.plugin</artifactId>
<packaging>eclipse-plugin</packaging>
<properties>
<sonar.jacoco.reportPaths>../tests/target/jacoco.exec</sonar.jacoco.reportPaths>
<sonar.coverage.jacoco.xmlReportPaths>../tests/target/jacoco/report/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
<sonar.junit.reportsPath>../tests/target/surefire-reports</sonar.junit.reportsPath>
</properties>
</project>
Original file line number Diff line number Diff line change
@@ -1,64 +1,38 @@
package nl.esciencecenter.e3dchem.sygma;

import java.util.Set;

import org.knime.core.node.InvalidSettingsException;
import org.knime.core.node.NodeSettingsRO;
import org.knime.core.node.NodeSettingsWO;
import org.knime.core.node.defaultnodesettings.SettingsModelIntegerBounded;
import org.knime.core.node.defaultnodesettings.SettingsModelString;
import org.knime.core.node.workflow.FlowVariable;

import nl.esciencecenter.e3dchem.python.PythonWrapperNodeConfig;

public class PredictMetabolitesConfig extends PythonWrapperNodeConfig {
private static final String CFGKEY_PHASE1CYCLES = "phase1_cycles";
private static final int DEFAULT_PHASE1CYCLES = 2;
private static final String CFGKEY_PHASE2CYCLES = "phase2_cycles";
private static final int DEFAULT_PHASE2CYCLES = 1;
private static final String CFG_PARENTSCOLNAME = "parents_column_name";

private final SettingsModelString parentsColumnName = new SettingsModelString(CFG_PARENTSCOLNAME, null);
public class PredictMetabolitesConfig {
private SettingsModelString sygmaPath = new SettingsModelString("sygmaPath", "sygma");
private SettingsModelString parentsColumnName = new SettingsModelString("parents_column_name", null);
private SettingsModelIntegerBounded phase1cycles = new SettingsModelIntegerBounded("phase1_cycles",
2, 0, 100);
private SettingsModelIntegerBounded phase2cycles = new SettingsModelIntegerBounded("phase2_cycles",
1, 0, 100);

private final SettingsModelIntegerBounded phase1cycles = new SettingsModelIntegerBounded(CFGKEY_PHASE1CYCLES,
DEFAULT_PHASE1CYCLES, 0, 100);

private final SettingsModelIntegerBounded phase2cycles = new SettingsModelIntegerBounded(CFGKEY_PHASE2CYCLES,
DEFAULT_PHASE2CYCLES, 0, 100);

public PredictMetabolitesConfig(String[] inputTables, String[] outputTables) {
super(inputTables, outputTables);
addRequiredModule("sygma");
}

public PredictMetabolitesConfig() {
super();
addRequiredModule("sygma");
}

@Override
public void saveTo(final NodeSettingsWO settings) {
super.saveTo(settings);
public void saveSettingsTo(NodeSettingsWO settings) {
phase1cycles.saveSettingsTo(settings);
phase2cycles.saveSettingsTo(settings);
parentsColumnName.saveSettingsTo(settings);
sygmaPath.saveSettingsTo(settings);
}

@Override
public void loadFrom(final NodeSettingsRO settings) throws InvalidSettingsException {
public void loadValidatedSettingsFrom(NodeSettingsRO settings) throws InvalidSettingsException {
phase1cycles.loadSettingsFrom(settings);
phase2cycles.loadSettingsFrom(settings);
parentsColumnName.loadSettingsFrom(settings);
super.loadFrom(settings);
sygmaPath.loadSettingsFrom(settings);
}

@Override
public Set<FlowVariable> getOptionsValues() {
Set<FlowVariable> variables = super.getOptionsValues();
variables.add(new FlowVariable(CFGKEY_PHASE1CYCLES, phase1cycles.getIntValue()));
variables.add(new FlowVariable(CFGKEY_PHASE2CYCLES, phase2cycles.getIntValue()));
variables.add(new FlowVariable(CFG_PARENTSCOLNAME, parentsColumnName.getStringValue()));
return variables;
public void validateSettings(NodeSettingsRO settings) throws InvalidSettingsException {
phase1cycles.validateSettings(settings);
phase2cycles.validateSettings(settings);
parentsColumnName.validateSettings(settings);
sygmaPath.validateSettings(settings);
}

public SettingsModelIntegerBounded getPhase1cycles() {
Expand All @@ -72,4 +46,8 @@ public SettingsModelIntegerBounded getPhase2cycles() {
public SettingsModelString getParentsColumnName() {
return parentsColumnName;
}

public SettingsModelString getSygmaPath() {
return sygmaPath;
}
}
Loading

0 comments on commit d646995

Please sign in to comment.