KNIME plugin for retrieving data from https://gpcrdb.org, GPCRdb website contains data, web tools and diagrams for G protein-coupled receptors (GPCRs).
Requirements:
Steps to get GPCRDB nodes inside KNIME:
https://3d-e-chem.github.io/updates/5.1
See example workflow in examples
folder.
Requires Maven and JDK 8.
mvn verify
Jar has been made in plugin/target
folder.
An Eclipse update site will be made in p2/target/repository
repository.
Steps to get development environment setup based on https://github.com/knime/knime-sdk-setup#sdk-setup:
KNIME Analytics Platform (5.1) - nl.esciencecenter.e3dchem.knime.molviewer.targetplatform/KNIME-AP-5.1.target
target definition.During import the Tycho Eclipse providers must be installed.
mvn org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=<version>-SNAPSHOT
command.mvn package
, will create update site in p2/target/repository
mvn install -Dtarget.update.site=<3D-e-Chem repo/updates>
Download swagger code generator
wget http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.3.0/swagger-codegen-cli-2.3.0.jar
Download and unpack the swagger rewriter
Generate a Swagger spec for the client
Install the swagger rewriter from https://github.com/3D-e-Chem/swagger-rewriter
swagger-rewriter/bin/swagger-rewriter \
https://gpcrdb.org/services/reference/api-docs/ \
client-config/swagger-rewriter.config.yml \
client-config/gpcrdb.swagger-spec.json
3.1 Optionally, make manual changes to client-config/gpcrdb.swagger-spec.json
Generate a client for GPCRDB web service using the rewritten spec
java -jar swagger-codegen-cli-2.3.0.jar generate \
--input-spec client-config/gpcrdb.swagger-spec.json \
--output client \
--lang java \
--config client-config/swagger-codegen.config.json
Compile client
cd client
mvn package
Make client jar and it's dependencies available in plugin
cp -r target/lib/* target/*jar ../plugin/lib/
Remove test dependencies
rm plugin/lib/*-tests.jar plugin/lib/junit* plugin/lib/hamcrest*
Update plugin/META-INF/MANIFEST.MF
, plugin/build.properties
files to reflect contents of lib/
The test workflow are tested against a mocked web server and not the actual https://gpcrdb.org site.
The mock server is called WireMock and normally gives empty responses.
To have WireMock server return filled responses, stubs stored in tests/src/test/resources/
directory must be provided.
The stubs can be recorded by starting a WireMock server in recording mode by:
java -jar tests/lib/wiremock-standalone-2.5.0.jar --proxy-all="https://gpcrdb.org/" \
--port=8089 --record-mappings --verbose --root-dir=tests/src/test/resources/
Then in a KNIME workflow in the GPCRDB nodes set the base path to http://localhost:8089.
Executing the workflow will fetch data from https://gpcrdb.org/ via the WireMock server and cause new stubs to be recorded in the tests/src/test/resources/
directory.
To run the test workflows from inside KNIME desktop environment start the WireMock server in mock mode by:
java -jar tests/lib/wiremock-standalone-2.5.0.jar --port=8089 --verbose --root-dir=tests/src/test/resources/
Then import the test workflows in tests/src/knime/
directory, select the workflow in the KNIME explorer and in the context menu (right-click) select Run as workflow test
.