Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Library of Python utilities for PacBio Genomes Analysis

Project description

PBGA

PacBio Genome Analysis Python toolkit.

Install

The code is available at PyPi, therefore you can install it with pip.

pip install pbga

Connect to PBGA database

The PBGA database is a H2 database, therefore primarily meant to be used with Java. We can connect to the database from Python, if:

  • Java is installed on the local machine
  • the local machine runs UNIX-like OS (sorry, Windows users)

Then:

from pbga import H2DbManager

with H2DbManager("path/to/sv_database.mv.db", 
                 user="sa", 
                 password="sa") as h2:
    with h2.get_connection() as conn:
        with conn.cursor() as cur:
            # do whatever you want
            cur.execute('SELECT * FROM PBGA.CLINGEN_TRIPLOSENSITIVITY;')
            for i, x in zip(range(5), cur.fetchall()):
                # print first 5 lines 
                print(x)

Use Jannovar VariantEffects

We can access values of Jannovar VariantEffect enum:

import pbga.effects as pe 

ve = pe.VARIANT_EFFECTS #  get tuple with all variant effects

p = pe.get_priority('MISSENSE_VARIANT') # returns 21

Quick setup of Python logging framework

Setting up of Python logging framework might be tedious. Here's a small helper function:

from pbga.utils import setup_logging

# set level to INFO, create a `main.log` file use nice log message format  
setup_logging()  

Limitations

  • tested with python>=3.6.8

Project details


Download files

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

Files for pbga, version 0.0.6
Filename, size File type Python version Upload date Hashes
Filename, size pbga-0.0.6-py3.6.egg (2.1 MB) File type Egg Python version 3.6 Upload date Hashes View
Filename, size pbga-0.0.6-py3-none-any.whl (2.1 MB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pbga-0.0.6.tar.gz (2.1 MB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page