Skip to main content

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/*

Metadata

Release files for pori-python 1.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pori-python 1.6.0
File Size Uploaded Provenance Actions
pori_python-1.6.0.tar.gz 117.1 kB Without provenance Details for pori_python-1.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pori-python 1.6.0
File Interpreter ABI Platform Actions
pori_python-1.6.0-py3-none-any.whl Python 3 none any Details for pori_python-1.6.0-py3-none-any.whl

Total release size: 249.5 kB

Release files / pori_python-1.6.0.tar.gz

Download URL pori_python-1.6.0.tar.gz
Size 117.1 kB
Tags Source
SHA-256 checksum
How to use checksums
da1016aa365366917f4fc14d13bcfb36a2c16115e99b39d69b6cdc4d702b53f4
BLAKE2b-256 checksum
How to use checksums
b98c65c97a7f446015819fd06a9c8b52697d6d8927e97d8fd4e8611b76d48111
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / pori_python-1.6.0-py3-none-any.whl

Download URL pori_python-1.6.0-py3-none-any.whl
Size 132.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00e29b3beef303a0bb967f682fd70072d3a774d7f7c558616e6bd8a8311293ca
BLAKE2b-256 checksum
How to use checksums
22193a26ef3a8f11a695d969609d8205d1c178f6dd7b4386a990c06acd5edc42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for pori-python 1.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page