Skip to main content

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

development requires uv

uv run jupyter lab # open notebook with editable install
uv run pytest      # testing
uv run ruff check  # linting
uv run ruff format # formatting

Metadata

Release files for pygv 0.2.2

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

Source distribution (sdist)

Source distribution for pygv 0.2.2
File Size Uploaded
pygv-0.2.2.tar.gz 97.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pygv 0.2.2
File Interpreter ABI Platform
pygv-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 115.9 kB

Release files / pygv-0.2.2.tar.gz

Download URL pygv-0.2.2.tar.gz
Size 97.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e1e5f0c96600055c61ea1a3475b1f9406c5c5b294970d01748f55d8a4544caf4
BLAKE2b-256 checksum
How to use checksums
e00f9f33345fe0c1f10a81691c247fab75f02349864c918e83b91fd7475f9e71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 20, 2024.

Transparency log

Release files / pygv-0.2.2-py3-none-any.whl

Download URL pygv-0.2.2-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
917057493d6b8df3b232e6e9969e85146f07ea64baf60c9196bb5a115021dd6d
BLAKE2b-256 checksum
How to use checksums
7556aa9d4f6b29b02c539c1525836f717a2f8bc0a20654a9118ebe5a362c709c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 20, 2024.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.0

2 release files

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