Skip to content

Commit

Permalink
Merge pull request #22 from 3D-e-Chem/ws-only-nodes
Browse files Browse the repository at this point in the history
Create Python and Swagger based implementation of nodes
  • Loading branch information
sverhoeven authored Mar 5, 2017
2 parents 9d5525a + de8b252 commit 68b8f77
Show file tree
Hide file tree
Showing 172 changed files with 11,788 additions and 2,816 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ target
.classpath

swagger-codegen-cli-*.jar
/client
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ Formatted as described on http://keepachangelog.com/

## Unreleased

## [2.2.0] - 2017-03-05

### Added

- Pure Java nodes to fetch fragment information and similarites from web service (#17)

## Changed

- Python nodes only work for local files, no longer for web service urls

## [2.1.5] - 2017-03-01

Requires KripoDB v2.2.0 or higher.
Expand Down
66 changes: 55 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# KripoDB KNIME nodes

KRIPO stands for [Key Representation of Interaction in POckets](http://dx.doi.org/10.1186/1758-2946-6-S1-O26).

[KNIME](http://www.knime.org) nodes for KripoDB (https://github.com/3D-e-Chem/kripodb).

[![Build Status](https://travis-ci.org/3D-e-Chem/knime-kripodb.svg?branch=master)](https://travis-ci.org/3D-e-Chem/knime-kripodb)
Expand All @@ -13,7 +15,12 @@
Requirements:

* KNIME, https://www.knime.org
* KripoDB Python package & optional data files, https://github.com/3D-e-Chem/kripodb

Optionally:

* KripoDB Python package & data files, https://github.com/3D-e-Chem/kripodb,
required when nodes which use local Kripo files are used.
Nodes which talk to web service work without the KripoDB Python package.

Steps to get KripoDB nodes inside KNIME:

Expand Down Expand Up @@ -80,23 +87,60 @@ Tests in `tests` module will have been run with results in `test/target/surefire
There are unit tests and workflow tests both are executed in the KNIME eclipse application.
See https://github.com/3D-e-Chem/knime-testflow for more information about workflow tests.

# Create web service client

The web service client is generated using [Swagger Code Generator](https://github.com/swagger-api/swagger-codegen) and stored inside `plugin/src/java/nl/esciencecenter/e3dchem/kripodb/ws/client/` directory.

1. Start KripoDB webservice
```
kripodb serve data/similarities.frozen.h5 data/fragments.sqlite
```

2. Download swagger code generator
```
wget http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.2/swagger-codegen-cli-2.2.2.jar
```

3. Generate a client for KripoDB web service
```
java -jar swagger-codegen-cli-2.2.2.jar generate \
--input-spec http://localhost:8084/kripo/swagger.json \
--output client \
--lang java \
--config swagger-codegen.config.json
```

4. Compile client
```
cd client
mvn package
```

5. Populate plugin with client source code and dependencies
```
mkdir ../plugin/lib
cp target/lib/gson-* target/lib/logging-interceptor-* target/lib/ok* target/lib/swagger-annotations-* ../plugin/lib/
cp -r src/main/java/nl/esciencecenter/e3dchem/kripodb/ws/client ../plugin/src/java/nl/esciencecenter/e3dchem/kripodb/ws/
```

6. Update plugin/META-INF/MANIFEST.MF, plugin/build.properties files to reflect contents of lib/

## New release

1. Update versions in pom files with `mvn org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=<version>` command.
2. Manually update version of "source" feature in `p2/category.xml` file.
3. Commit and push changes
4. Create package with `mvn package`, will create update site in `p2/target/repository`
5. Test node by installing it from local update site
4. Append new release to 3D-e-Chem update site
1. Update versions in pom files with `mvn org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=<version>-SNAPSHOT` command.
2. Commit and push changes
3. Create package with `mvn package`, will create update site in `p2/target/repository`
4. Test node by installing it from local update site
5. Append new release to 3D-e-Chem update site
1. Make clone of https://github.com/3D-e-Chem/3D-e-Chem.github.io repo
2. Append release to 3D-e-Chem update site with `mvn install -Dtarget.update.site=<3D-e-Chem repo/updates>`
5. Commit and push changes in this repo and 3D-e-Chem.github.io repo
6. Create a Github release
7. Update Zenodo entry
6. Commit and push changes in this repo and 3D-e-Chem.github.io repo
7. Create a Github release
8. Update Zenodo entry
1. Fix authors
2. Fix license
3. To Related/alternate identifiers section add http://dx.doi.org/10.1186/1758-2946-6-S1-O26 as `is cited by this upload` entry.
8. Make nodes available to 3D-e-Chem KNIME feature by following steps at https://github.com/3D-e-Chem/knime-node-collection#new-release
9. Make nodes available to 3D-e-Chem KNIME feature by following steps at https://github.com/3D-e-Chem/knime-node-collection#new-release

# Create stub recordings for integration tests

Expand Down
Binary file modified examples/Knime-KripoDB-example.zip
Binary file not shown.
6 changes: 3 additions & 3 deletions feature/feature.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="nl.esciencecenter.e3dchem.kripodb.feature"
label="KripoDB nodes for Knime"
version="2.1.5"
label="KripoDB nodes for KNIME"
version="2.2.0.qualifier"
provider-name="Netherlands eScience Center">

<description url="https://github.com/3D-e-Chem/knime-kripodb">
Knimes nodes for interacting with Kripo data files.
KNIME nodes for interacting with Kripo data files.
</description>

<copyright url="https://www.esciencecenter.nl">
Expand Down
2 changes: 1 addition & 1 deletion feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>nl.esciencecenter.e3dchem.kripodb</groupId>
<artifactId>nl.esciencecenter.e3dchem.kripodb</artifactId>
<version>2.1.5</version>
<version>2.2.0-SNAPSHOT</version>
</parent>

<artifactId>nl.esciencecenter.e3dchem.kripodb.feature</artifactId>
Expand Down
10 changes: 1 addition & 9 deletions p2/category.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature url="features/nl.esciencecenter.e3dchem.kripodb.feature-2.1.5.jar" id="nl.esciencecenter.e3dchem.kripodb.feature" version="2.1.5">
<feature url="features/nl.esciencecenter.e3dchem.kripodb.feature-2.2.0.qualifier.jar" id="nl.esciencecenter.e3dchem.kripodb.feature" version="2.2.0.qualifier">
<category name="nl.esciencecenter.3D-e-Chem"/>
</feature>
<feature url="features/nl.esciencecenter.e3dchem.kripodb.feature.source_2.1.5.jar" id="nl.esciencecenter.e3dchem.kripodb.feature.source" version="2.1.5">
<category name="nl.esciencecenter.3D-e-Chem.sources"/>
</feature>
<category-def name="nl.esciencecenter.3D-e-Chem" label="KNIME 3D-e-Chem Contributions">
<description>
3D-e-Chem: Collection KNIME nodes &amp; Extensions for the NLeSC 3d-e-Chem project
</description>
</category-def>
<category-def name="nl.esciencecenter.3D-e-Chem.sources" label="KNIME 3D-e-Chem Contributions Sources">
<description>
3D-e-Chem Sources: Sources of KNIME nodes &amp; Extensions for the NLeSC 3d-e-Chem project
</description>
</category-def>
</site>
2 changes: 1 addition & 1 deletion p2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>nl.esciencecenter.e3dchem.kripodb</artifactId>
<groupId>nl.esciencecenter.e3dchem.kripodb</groupId>
<version>2.1.5</version>
<version>2.2.0-SNAPSHOT</version>
</parent>
<artifactId>nl.esciencecenter.e3dchem.kripodb.p2</artifactId>
<packaging>eclipse-repository</packaging>
Expand Down
10 changes: 8 additions & 2 deletions plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: 3D-e-Chem KNIME KripoDB nodes
Bundle-SymbolicName: nl.esciencecenter.e3dchem.kripodb.plugin;singleton:=true
Bundle-Version: 2.1.5
Bundle-Version: 2.2.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Activator: nl.esciencecenter.e3dchem.kripodb.Activator
Require-Bundle: org.knime.core;bundle-version="[3.1.0,4.0.0)",
org.knime.base;bundle-version="[3.1.0,4.0.0)",
org.knime.python;bundle-version="[3.1.0,4.0.0)",
org.knime.chem.types;bundle-version="[3.1.0,4.0.0)",
org.rdkit.knime.types;bundle-version="[3.0.0,4.0.0)",
nl.esciencecenter.e3dchem.python.plugin;bundle-version="[1.1.0,2.0.0)",
nl.esciencecenter.e3dchem.plugin;bundle-version="[1.0.0,2.0.0)"
Bundle-Vendor: Netherlands eScience Center
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Bundle-ClassPath: lib/gson-2.6.2.jar,
lib/logging-interceptor-2.7.5.jar,
lib/okhttp-2.7.5.jar,
lib/okio-1.6.0.jar,
lib/swagger-annotations-1.5.12.jar,
.
Export-Package: nl.esciencecenter.e3dchem.kripodb,
nl.esciencecenter.e3dchem.kripodb.fragments,
nl.esciencecenter.e3dchem.kripodb.fragmentsbysimilarity
7 changes: 6 additions & 1 deletion plugin/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ source.. = src/java/
output.. = target/classes/
bin.includes = META-INF/,\
.,\
plugin.xml
plugin.xml,\
lib/gson-2.6.2.jar,\
lib/logging-interceptor-2.7.5.jar,\
lib/okhttp-2.7.5.jar,\
lib/okio-1.6.0.jar,\
lib/swagger-annotations-1.5.12.jar
Binary file added plugin/lib/gson-2.6.2.jar
Binary file not shown.
Binary file added plugin/lib/logging-interceptor-2.7.5.jar
Binary file not shown.
Binary file added plugin/lib/okhttp-2.7.5.jar
Binary file not shown.
Binary file added plugin/lib/okio-1.6.0.jar
Binary file not shown.
Binary file added plugin/lib/swagger-annotations-1.5.12.jar
Binary file not shown.
25 changes: 20 additions & 5 deletions plugin/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,35 @@
locked="false"
name="KripoDB"
path="/community/3d-e-chem"/>
</extension>
<category
description="Category containing Kripo nodes for using local files"
icon="nl/esciencecenter/e3dchem/kripodb/kripo.png"
level-id="local"
locked="false"
name="For local files"
path="/community/3d-e-chem/kripodb"/>
</extension>

<extension point="org.knime.workbench.repository.nodes">
<node
category-path="/community/3d-e-chem/kripodb"
deprecated="false"
factory-class="nl.esciencecenter.e3dchem.kripodb.fragmentsbysimilarity.FragmentBySimilarityFactory"
id="nl.esciencecenter.e3dchem.kripodb.fragmentsbysimilarity.FragmentBySimilarityFactory">
factory-class="nl.esciencecenter.e3dchem.kripodb.ws.fragmentsbysimilarity.FragmentBySimilarityFactory">
</node>
<node
category-path="/community/3d-e-chem/kripodb"
deprecated="false"
factory-class="nl.esciencecenter.e3dchem.kripodb.fragments.FragmentByIdFactory"
id="nl.esciencecenter.e3dchem.kripodb.fragments.FragmentByIdFactory">
factory-class="nl.esciencecenter.e3dchem.kripodb.ws.fragments.FragmentByIdFactory">
</node>
<node
category-path="/community/3d-e-chem/kripodb/local"
deprecated="false"
factory-class="nl.esciencecenter.e3dchem.kripodb.fragmentsbysimilarity.FragmentBySimilarityFactory">
</node>
<node
category-path="/community/3d-e-chem/kripodb/local"
deprecated="false"
factory-class="nl.esciencecenter.e3dchem.kripodb.fragments.FragmentByIdFactory">
</node>
</extension>
</plugin>
2 changes: 1 addition & 1 deletion plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>nl.esciencecenter.e3dchem.kripodb</groupId>
<artifactId>nl.esciencecenter.e3dchem.kripodb</artifactId>
<version>2.1.5</version>
<version>2.2.0-SNAPSHOT</version>
</parent>
<artifactId>nl.esciencecenter.e3dchem.kripodb.plugin</artifactId>
<packaging>eclipse-plugin</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,60 @@
<knimeNode icon="./default.png" type="Manipulator"
xmlns="http://knime.org/node/v2.8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://knime.org/node/v2.10 http://knime.org/node/v2.10.xsd">
<name>Fragment information</name>
<name>Fragment information (local files)</name>

<shortDescription>
Find Kripo fragment information by their identifier.
</shortDescription>

<fullDescription>
<intro>Find Kripo fragment information by their identifier.
<p>
Information includes the fragment molecule and it's associated protein identifiers.
</p>
<h2>Resolving "'kripodb' Python package not found" error</h2>
<p>This node requires the <a href="https://github.com/3D-e-Chem/kripodb">kripodb</a> Python package.</p>
<p>
If the kripodb Python package was not installed then go to <a href="https://github.com/3D-e-Chem/kripodb#install">https://github.com/3D-e-Chem/kripodb#install</a> and follow the installation instructions.
To test if the package is installed run <i>kripodb --version</i> on the command line, it should print a version number if installed.
</p>
<p>
If the kripodb Python package was already installed then make sure that KNIME is using the same Python executable.
In the File menu > Preferences > KNIME > Python make sure the path to the Python executable is the same Python which has the kripodb package installed.
</p>
<intro>
<p>
KRIPO stands for
<a href="http://dx.doi.org/10.1186/1758-2946-6-S1-O26">Key Representation of Interaction in POckets</a>
.
</p>
<p>
Find Kripo fragment information by their identifier.
</p>
<p>
Information includes the fragment molecule and it's associated protein
identifiers.
</p>
<h2>Resolving "'kripodb' Python package not found" error</h2>
<p>
This node requires the
<a href="https://github.com/3D-e-Chem/kripodb">kripodb</a>
Python package.
</p>
<p>
If the kripodb Python package was not installed then go to
<a href="https://github.com/3D-e-Chem/kripodb#install">https://github.com/3D-e-Chem/kripodb#install</a>
and follow the installation instructions.
To test if the package is installed run
<i>kripodb --version</i>
on the command line, it should print a version number if installed.
</p>
<p>
If the kripodb Python package was already installed then make sure
that KNIME is using the same Python executable.
In the File menu > Preferences > KNIME > Python make sure the path to
the Python executable is the same Python which has the kripodb
package installed.
</p>
</intro>

<option name="Identifiers">The column containing the Kripo identifiers
</option>
<option name="Fragments database (Selected File)">
Location of Kripo fragments database, can be the base url of kripodb webservice or a local SQLite file.
Location of Kripo fragments database, can be the base url of kripodb
webservice or a local SQLite file.
<p>
Available datasets:
<ul>
<li>
Protein Data Bank, use web service at <a href="http://3d-e-chem.vu-compmedchem.nl/kripodb">http://3d-e-chem.vu-compmedchem.nl/kripodb</a>
Protein Data Bank, use web service at
<a href="http://3d-e-chem.vu-compmedchem.nl/kripodb">http://3d-e-chem.vu-compmedchem.nl/kripodb</a>
or download from
<a href="http://3d-e-chem.vu-compmedchem.nl/kripodb/fragments.sqlite">here</a>
, in 3D-e-Chem VM available at '/data/kripo/pdb/fragments.sqlite'
Expand All @@ -55,7 +77,13 @@
<p>When combining this node with other Kripo nodes make sure the
files are from the same dataset.
</p>
<p>For example getting a <b>KeyError: '&lt;fragment id&gt;' not found</b> error most likely means the '/data/kripo/pdb/fragments.sqlite' file is out of sync and must be re-downloaded from <a href="http://3d-e-chem.vu-compmedchem.nl/kripodb/fragments.sqlite">here</a></p>
<p>
For example getting a
<b>KeyError: '&lt;fragment id&gt;' not found</b>
error most likely means the '/data/kripo/pdb/fragments.sqlite' file
is out of sync and must be re-downloaded from
<a href="http://3d-e-chem.vu-compmedchem.nl/kripodb/fragments.sqlite">here</a>
</p>
</option>
<option name="Type of identifier">Can be fragment or PDB code.</option>
</fullDescription>
Expand Down
Loading

0 comments on commit 68b8f77

Please sign in to comment.