Skip to content

manzt/pygv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pygv

a minimal, scriptable genome browser for python built with anywidget

installation

Here be dragons 🐉

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]"

About

a minimal, scriptable genome browser for python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages