A search interface for cancer variant interpretations assembled by aggregating and harmonizing across multiple cancer variant interpretation knowledgebases.
Project description
metakb
The intent of the project is to leverage the collective knowledge of the disparate existing resources of the VICC to improve the comprehensiveness of clinical interpretation of genomic variation. An ongoing goal will be to provide and improve upon standards and guidelines by which other groups with clinical interpretation data may make it accessible and visible to the public. We have released a preprint discussing our initial harmonization effort and observed disparities in the structure and content of variant interpretations.
Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Prerequisites
- A newer version of Python 3, preferably 3.8 or greater. To confirm on your system, run:
python3 --version
- Pipenv, for package management.
pip3 install --user pipenv
Installing
Once Pipenv is installed, clone the repo and install the package requirements into a Pipenv environment:
git clone https://github.com/cancervariants/metakb
cd metakb
pipenv lock
pipenv sync
If you intend to provide development support, install the development dependencies:
pipenv lock --dev
pipenv sync
Setting up Neo4j
The MetaKB uses Neo4j for its database backend. To run a local MetaKB instance, you'll need to run a Neo4j database instance as well. The easiest way to do this is from Neo4j Desktop.
First, follow the desktop setup instructions to download, install, and open Neo4j Desktop for the first time.
Once you have opened Neo4j desktop, use the "New" button in the upper-left region of the window to create a new project. Within that project, click the "Add" button in the upper-right region of the window and select "Local DBMS". The name of the DBMS doesn't matter, but the password will be used later to connect the database to MetaKB (we have been using "admin" by default). Click "Create". Then, click the row within the project screen corresponding to your newly-created DBMS, and click the green "Start" button to start the database service.
The graph will initially be empty, but once you have successfully loaded data, Neo4j Desktop provides an interface for exploring and visualizing relationships within the graph. To access it, click the blue "Open" button. The prompt at the top of this window processes Cypher queries; to start, try MATCH (n:Statement {id:"civic.eid:5818"}) RETURN n
. Buttons on the left-hand edge of the results pane let you select graph, tabular, or textual output.
Setting up normalizers
The MetaKB calls a number of normalizer libraries to transform resource data and resolve incoming search queries. These will be installed as part of the package requirements, but require additional setup.
First, download and install Amazon's DynamoDB. Once installed, in a separate terminal instance, navigate to its source directory and run the following to start the database instance:
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb
Next, navigate to the site-packages
directory of your virtual environment. Assuming Pipenv is installed to your user directory, this should be something like:
cd ~/.local/share/virtualenvs/metakb-<various characters>/python3.7/site-packages/ # replace <various characters>
Next, initialize the Variation Normalizer by following the instructions in the README.
The MetaKB can acquire all other needed normalizer data, except for that of OMIM, which must be manually placed:
cd disease/ # starting from the site-packages dir of your virtual environment's Python instance
mkdir -p data/omim
cp ~/YOUR/PATH/TO/mimTitles.txt data/omim/omim_<date>.tsv # replace <date> with date of data acquisition formatted as YYYYMMDD
Loading data
Once Neo4j and DynamoDB instances are both active, and necessary normalizer data has been placed, run the MetaKB CLI with the --initialize_normalizers
flag to acquire all other necessary normalizer source data, and execute harvest, transform, and load operations into the graph datastore.
In the MetaKB project root, run the following:
pipenv shell
python3 -m metakb.cli --db_url=bolt://localhost:7687 --db_username=neo4j --db_password=<neo4j-password-here> --load_normalizers_db
Starting the server
Once data has been loaded successfully, use the following to start service on localhost port 8000:
uvicorn metakb.main:app --reload
Navigate to http://localhost:8000/api/v2 in your browser to enter queries.
Running tests
Unit tests
Explain how to run the automated tests for this system
python3 -m pytest
And coding style tests
Code style is managed by flake8 and checked prior to commit.
see .flake8
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Committing
We use pre-commit to run conformance tests.
This ensures:
- Check code style
- Check for added large files
- Detect AWS Credentials
- Detect Private Key
Before first commit run:
pre-commit install
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
License
This project is licensed under the MIT License - see the LICENSE file for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file metakb-1.1.0a1.tar.gz
.
File metadata
- Download URL: metakb-1.1.0a1.tar.gz
- Upload date:
- Size: 50.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c14da6857e5221b6a096c3ac907e4a086d3a76ea41d520a19a51a25d88dfd80 |
|
MD5 | 22bb244cb58b8179dea4bc01c6ef1ece |
|
BLAKE2b-256 | ee8a03c39fd2cb9ded12ec197dd2f2462404ab413562b08892d963123fabbef5 |
File details
Details for the file metakb-1.1.0a1-py3-none-any.whl
.
File metadata
- Download URL: metakb-1.1.0a1-py3-none-any.whl
- Upload date:
- Size: 53.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fa804868451ce22b491f7f2ddf09f7599ae97db55912b0fba453268581446e8 |
|
MD5 | 70c86c3b650fb867ee3f159e0801207d |
|
BLAKE2b-256 | c047d3da2903fff08bad9ec3f2dc385117f7c55b5e138521fb09b537b00b1229 |