Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Utilities for working with human genome build hg19

Project description

pyhg19

Get the coordinates of a variant from its RSID, or an RSID from its coordinates

Installation

First make sure you have followed the installation procedure for pydbsnp. Then install pyhg19 with pip3:

pip3 install pyhg19

or

pip3 install --user pyhg19

For full functionality, you should appropriately set environment variables PYHG19_PATH, PYHG19_MASKED, PYHG19_BOWTIE2_INDEX. For example, you could add this to your .bash_profile:

export PYHG19_PATH=<path of your choice>
export PYHG19_MASKED=<path of your choice>
export PYHG19_BOWTIE2_INDEX=<path of your choice>

Examples

import pyhg19
rs10_coord = pyhg19.coord('rs10')
print(f'rs10 is on chromosome {rs10_coord.chr} at position {rs10_coord.pos}')

rs10_coord_tuple = pyhg19.coord_tuple('rs10')
print(
    'rs10 is on chromosome {} at position {}'
    .format(rs10_coord_tuple[0], rs10_coord_tuple[1])
)

rs_something = pyhg19.rsid(chr=1, pos=10019)
print(
    'The RSID of the variant on chromosome 1 at position 10019 is {}.'
    .format(rs_something)
)

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 pyhg19, version 1.0.2
Filename, size File type Python version Upload date Hashes
Filename, size pyhg19-1.0.2-py3-none-any.whl (9.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pyhg19-1.0.2.tar.gz (8.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page