A knowledge graph system with graph neural network for drug repurposing, disease mechanism.
NOTE: NOT READY FOR PRODUCTION YET.
- Knowledge graph studio for graph query, visualization and analysis.
- Graph neural network for drug discovery, disease mechanism, biomarker screening and discovering response to toxicant exposure.
- Support customized knowledge graph schema and data source.
- Support customized graph neural network model.
- Support customized omics datasets.
- Integrated large language models (such as vicuna, rwkv, chatgpt etc. more details on chat-publications) for answering questions.
Name | Language | Description |
---|---|---|
BioMedGPS Data | Python | For building the knowledge graph of BioMedGPS and training the graph neural network models. |
Chat Publications | Python | Ask questions and get answers from publications. |
BioMedical Knowledgebases | Markdown | A collection of biomedical knowledgebases, ontologies, datasets and publications etc. |
R Omics Utility | R | Utilities for omics data with R. It will be part of biomedgps system and provide visulization and analysis functions of multi-omics data. |
If you want to use the platform, please follow the instructions below. You can also join us to develop the platform, see here.
Step 1
: You will need to install PostgreSQL and Neo4j. You can also use docker to launch the database, see here. After that, you can run the following command to launch the database server.
mkdir biomedgps && cd biomedgps
wget -O docker-compose.yml https://raw.githubusercontent.com/biomedgps/biomedgps/master/docker-compose.yml
docker-compose up -d
Step 2
: Download the latest release from here. You can also build the platform from source code, see here.
Step 3
: Init Database, Check and Import Data
# Init database
export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && biomedgps-cli initdb
# Check and import data, -t is the table name, -f is the data file path, -D is the delete flag
# Import entity data
export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && biomedgps-cli importdb -f /data/entity.tsv -t entity -D
# Import relation data
export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && biomedgps-cli importdb -f /data/relation.tsv -t relation -D --dataset drkg
# Generate metadata for entity
export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && biomedgps-cli importdb -f /data/entity.tsv -t entity_metadata -D
# Generate metadata for relation
export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && biomedgps-cli importdb -f /data/relation_types.tsv -t relation_metadata -D
# Import entity2d data
export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && biomedgps-cli importdb -f /data/entity2d.tsv -t entity2d -D
# Import entity embeddings
export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && biomedgps-cli importdb -f /data/entity_embeddings.tsv -t entity_embedding -D
# Import relation embeddings
export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && biomedgps-cli importdb -f /data/relation_embeddings.tsv -t relation_embedding -D
# Import entity data to graph database
export NEO4J_URL=neo4j://neo4j:password@localhost:7687 && biomedgps-cli importgraph -f /data/entities.tsv -t entity -b 1000
# Import relation data to graph database
export NEO4J_URL=neo4j://neo4j:password@localhost:7687 && biomedgps-cli importgraph -f /data/relations.tsv -t relation -b 1000
Step 4
: Launch the platform, see more details on usage here.
export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && export NEO4J_URL=neo4j://neo4j:password@localhost:7687/test_biomedgps && biomedgps -H
Run the following command to see the usage.
$ biomedgps --help
biomedgps 0.1.0
Jingcheng Yang <[email protected]>
BioMedGPS backend server
USAGE:
biomedgps [FLAGS] [OPTIONS]
FLAGS:
--debug Activate debug mode short and long flags (--debug) will be deduced from the field's name
-h, --help Prints help information
-o, --openapi Activate openapi mode
-u, --ui Activate ui mode
-V, --version Prints version information
OPTIONS:
-d, --database-url <database-url> Database url, such as postgres://user:pass@host:port/dbname. You can also set
it with env var: DATABASE_URL
-H, --host <host> 127.0.0.1 or 0.0.0.0 [default: 127.0.0.1] [possible values: 127.0.0.1,
0.0.0.0]
-g, --neo4j-url <neo4j-url> Graph Database url, such as neo4j://user:pass@host:port/dbname. You can also
set it with env var: NEO4J_URL
-p, --port <port> Which port [default: 3000]
If you want to launch the server with openapi and ui mode, run the following command.
export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && biomedgps -H 0.0.0.0 -p 8888 --openapi --ui
# You need to place the binary file in /opt/local/bin/biomedgps and all data files in /opt/local/data/biomedgps.
# Or you can change the path in the service file.
sudo cp build/biomedgps.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable biomedgps
sudo systemctl start biomedgps
# For MacOSx
brew install docker docker-compose
# For Linux [https://docs.docker.com/engine/install/debian/]
git clone https://github.com/yjcyxky/biomedgps
cd biomedgps
bash build-docker.sh
If you want to build the platform from source code, please follow the instructions below. You can also join us to develop the platform, see here.
- Rust
- Cargo
- PostgreSQL
- Neo4j
- nodejs == 16.13.1
- yarn
- Reactjs
- Ant Design
- Plotly.js
- G6 - Graph Visualization Engine
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
make test-db
export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && cargo run --bin biomedgps -- -H 0.0.0.0 -p 8888 --openapi --debug
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
npm install -g yarn
# Check the version. Make sure the nodejs version is 16.x.x. Other versions may not work.
node -v
cd studio
git submodule update --init --recursive
Change the auth0_config
in studio/src/app.tsx
to your own auth0 config. Replace '' and '' with your own auth0 client id and domain.
yarn start:local-dev
Change the auth0_config
in studio/package.json
to your own auth0 config. Replace UMI_APP_AUTH0_CLIENT_ID=Y08FauV1dAEiocNIZt5LiOifzNgXr6Uo and UMI_APP_AUTH0_DOMAIN=biomedgps.jp.auth0.com with your own auth0 client id and domain.
After installing the dependencies, run the following command to build the frontend and backend. The output will be in target/release
folder. You will get a binary file named biomedgps
.
# For MacOSx
make build-mac
# For Linux
make build-linux
# For MacOSx
brew install docker docker-compose
# For Linux [https://docs.docker.com/engine/install/debian/]
-
Download docker directory
-
Run
docker-compose up -d
to launch the databasecd docker && docker-compose up -d
-
Upload
biomedgps
andbiomedgps-cli
binaries to the server./opt/local/bin/biomedgps
and/opt/local/bin/biomedgps-cli
are the default paths. -
Run the following command to initialize the database
export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && /opt/local/bin/biomedgps-cli initdb
-
Run the following command to upload the data
Assume all data files are in
/data
folder. You need to ensure that the data directory is mounted to the docker container.# Upload entity data export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && /opt/local/bin/biomedgps-cli importdb -f /data/entity -t entity -D # Upload entity2d data export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && /opt/local/bin/biomedgps-cli importdb -f /data/entity2d.tsv -t entity2d -D # Upload relation data export DATABASE_URL=postgres://postgres:password@localhost:5432/test_biomedgps && /opt/local/bin/biomedgps-cli importdb -f /data/relation -t relation -D ...
-
Configure a nginx server to serve the frontend and backend
-
Download biomedgps_nginx.conf and modify it to fit your environment
-
Upload the modified biomedgps_nginx.conf to
/etc/nginx/config.d/biomedgps_nginx.conf
-
Restart nginx
systemctl restart nginx
-
docker pull messense/rust-musl-cross:x86_64-musl
alias rust-musl-builder='docker run --rm -it -v "$(pwd)":/home/rust/src messense/rust-musl-cross:x86_64-musl'
rust-musl-builder cargo build --release
make build-studio && rust-musl-builder cargo build --release
Comming soon...
Copyright © 2022 Jingcheng Yang
Distributed under the terms of the GNU Affero General Public License v3.0.