Skip to main content

No project description provided

Project description

PORI Python Adaptor

build codecov

This repository is part of the Platform for Oncogenomic Reporting and Interpretation (PORI).

This is a python adaptor package for querying the GraphKB API and IPR API.

This python tool takes in variant inputs as tab-delimited files and annotates them using GraphKB. The resulting output is uploaded to IPR as a report. Additional report content such as images and metadata can be passed to be included in the report upload.

For documentation on how to create reports using the IPR adaptor, see the main documentation site for the platform. For the GraphKB adaptor, see the user manual.

Getting Started

Install (For developers)

clone this repository

git clone https://github.com/bcgsc/pori_python.git
cd pori_python

create a virtual environment

python3 -m venv venv
source venv/bin/activate

install the package and its development dependencies

pip install -U pip setuptools
pip install -e .[dev]

Run the tests:

Export usernames, passwords, and test options.

IPR_URL and GRAPHKB_URL values must also be set.

Set EXCLUDE vars to 1 if you don't want to run these tests. ONCOKB and BCGSC tests are enabled by default.

export IPR_USER='pori_admin'
export IPR_PASS='pori_admin'
export IPR_URL='http://localhost:8081/api'
export GRAPHKB_USER='pori_admin'
export GRAPHKB_PASS='pori_admin'
export GRAPHKB_URL='http://localhost:8080/api'
export EXCLUDE_BCGSC_TESTS=1
export EXCLUDE_ONCOKB_TESTS=1

If you want to run tests that upload reports to a live IPR instance, specify the url of the IPR API you want to use and set the test var INCLUDE_UPLOAD_TESTS to 1. These tests are disabled by default.

The created reports are deleted by default. If you want to keep them, set DELETE_UPLOAD_TEST_REPORTS to 0.

export IPR_TEST_URL='http://localhost:8081/api'
export INCLUDE_UPLOAD_TESTS=1
export DELETE_UPLOAD_TEST_REPORTS=0
pytest tests

JSON Validate and Upload to IPR

An IPR_URL must be provided either as an environment variable or an arg.

If you only want to validate the json content, use

ipr --password $IPR_PASS -c 'path/to/content.json' --validate_json --ipr_url $IPR_URL

If you only want to upload the json directly to ipr and skip all the preprocessing, use

ipr --password $IPR_PASS -c 'path/to/content.json' --upload_json --ipr_url $IPR_URL

Documentation

The user documentation for this tool is hosted with the main documentation site.

Developers: Any updates to this tool should be edited and reflected in the main site documentation as well.

Deployment (Publishing)

Install the deployment dependencies

pip install .[deploy]

Build the distribution files

python setup.py install sdist bdist_wheel

Upload the distibutions to the package server (-r is defined in your pypirc)

twine upload -r bcgsc dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pori_python-1.3.0.tar.gz (103.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pori_python-1.3.0-py3-none-any.whl (118.7 kB view details)

Uploaded Python 3

File details

Details for the file pori_python-1.3.0.tar.gz.

File metadata

  • Download URL: pori_python-1.3.0.tar.gz
  • Upload date:
  • Size: 103.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pori_python-1.3.0.tar.gz
Algorithm Hash digest
SHA256 6387e74ceb045946f44c00af7659ff1c46f3a658d78b23a274319112a7e8d203
MD5 20abd0aca13824f8e2996c0c95cb3592
BLAKE2b-256 cd62c29bb39fbf87eb2c6482ccaa2e1b5887ba607e1c5db9b523401115c654b7

See more details on using hashes here.

File details

Details for the file pori_python-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: pori_python-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 118.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pori_python-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 55cbcd856539421e7072deff7e4f09b4e035755e756fb3de1b61b48a7a8f40f2
MD5 bdc3e6dc5b0c054c2bd31223fa9af091
BLAKE2b-256 6cb1d2ac15b769254300978ab3345b461b61030613b9e1466bcdaa7128aa9bbe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page