Skip to content

PathwayCommons/sifgraph-server

Repository files navigation

Pathway Commons SIF Graph Query Server

gradle

A Spring Boot RESTful web service built around sifgraph java library that executes neighborhood, pathsbetween, etc., graph queries on the Pathway Commons' Extended SIF data.

Clone the repository.

Build:

./gradlew build

Get data:

See comments in: src/main/resources/config/application.properties;

Download a Pathway Commons Extended SIF data archive and save it as data.gz in current dir:

wget -O data.gz "https://www.pathwaycommons.org/archives/PC2/v14/PC14.All.hgnc.txt.gz"

Alternatively, can use the remote URL in the --sifgraph.data=https://... option
for the java command below, or set via SIFGRAPH_DATA system/environment property instead.

Run:

$JAVA_HOME/bin/java -Xmx8g -jar build/libs/sifgraph-server*.jar --sifgraph.data=file:data.gz

Note: override the default list of SIF patterns using --sifgraph.relationships=... if needed (depends on the data).

If you want to run different instances of the graph server, e.g., for different species, then
copy src/main/resources/config/application.properties to the work directory, rename (e.g., my.properties), modify (e.g., set another server.port, sifgraph.relationships and sifgraph.data file), and run as:

java -Xmx8g -jar build/libs/sifgraph-server*.jar --spring.config.name=my

or simply provide all the different options via the args or env properties:

java -Xmx8g  -jar build/libs/sifgraph-server*.jar --sifgraph.data="file:<other.file>" --server.port=<otherPort>

RESTful API (Swagger docs):

Once the app is built and running, the auto-generated documentation is available at http://localhost:8080/sifgraph/

Docker

You can also build and run the docker image as follows

You need to pass SIFGRAPH_DATA URL and (if file:) mount a local file to the container FS as read-only volume (otherwise, it loads test/demo data from classpath, which e.g. contains interactions of "BMP2").

./gradlew build
docker build . -t pathwaycommons/sifgraph-server 
docker run -it --rm --name sifgraph-server -p <PORT>:8080 pathwaycommons/sifgraph-server 

Optionally, a member of 'pathwaycommons' group can now push the latest Docker image to hub.docker.com:

docker login
docker push pathwaycommons/sifgraph-server

So, other users could skip building from sources and simply run the app:

docker pull
docker run --rm --name sifg -p 8080:8080 -it pathwaycommons/sifgraph-server

(you can Ctrl-c and quit the console; the container is still there running; check with docker ps)