Skip to main content

No project description provided

Project description

pygv

a minimal, scriptable genome browser for python

installation

pip install pygv

usage

import pygv

# set the reference genome
pygv.ref("mm10")

# set the locus
pygv.locus("chr17:31,531,100-31,531,259")

# create a browser instance
pygv.browse("fragments.bed", "10x_cov.bw")

igv.js in Jupyter Notebook

That's it. By default, pygv infers the track and data-types by file extension. If a file format has an index file, it must be specified as a tuple (remote URLs also work):

pygv.browse(
  (
    "https://example.com/example.bam",     # data file
    "https://example.com/example.bam.bai"  # index file
  )
)

You can use track to adjust track properties beyond the defaults:

pygv.browse(
  pygv.track("10x_cov.bw", name="10x coverage", autoscale=True),
)

Multiple tracks are supported by adding to the browse call:

pygv.browse(
  # track 1
  (
      "https://example.com/example.bam",
      "https://example.com/example.bam.bai"
  ),
  # track 2
  pygv.track("10x_cov.bw", name="10x coverage", autoscale=True),
  # track 3
  pygv.track("genes.bed", name="Genes", color="blue"),
)

development

create a virtual environment and and install pygv in editable mode with the optional development dependencies:

python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

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

pygv-0.0.0.tar.gz (7.9 kB view hashes)

Uploaded Source

Built Distribution

pygv-0.0.0-py2.py3-none-any.whl (8.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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