Skip to main content

Python build and test

pyigd

PyIGD is a Python-only parser the Indexable Genotype Data (IGD) format. See our short paper (or the preprint) that describes the format and some of its advantages.

For tools to manipulate IGD files (and convert VCF to IGD), use igdtools (pip install igdtools).

For a C++ library that supports creating and parsing IGD, see picovcf (which supports VCF to IGD conversion).

Installation

You can install the latest release of PyIGD from pypi, via pip install pyigd.

For development, you can clone the code and install it directly from the directory (this will automatically reflect any code changes you make):

pip install -e pyigd/

or build and install via the wheel:

cd pyigd/ && python setup.py bdist_wheel
pip install --force-reinstall dist/*.whl

Usage

The pyigd.IGDReader class reads IGD data from a buffer. See the example script that loads an IGD file, prints out some meta-data, and then iterates the genotype data for all variants. Generally the usage pattern is:

with open(filename, "rb") as f:
  igd_reader = pyigd.IGDReader(f)

There is also the pyigd.IGDWriter class to construct IGD files. Related is pyigd.IGDTransformer, which is a way to create a copy of an IGD while modifying its contents. See the IGDTransformer sample list example and bitvector example.

IGD can be highly performant for a few reasons:

  1. It stores sparse data sparsely. Low-frequency variants are stored as sample lists. Medium/high frequency variants are stored as bit vectors.
  2. It is indexable (you can jump directly to data for the ith variant). Since the index is stored in its own section of the file, scanning the index is extremely fast. So only looking at variants for a particular range of the genome is very fast (in this case you would use pyigd.IGDFile.get_position_and_flags() to find the first variant index within the range, and then use pyigd.IGDFile.get_samples() after that).
  3. The genotype data is stored in one of two very simple binary formats. This makes parsing fast, and the compact nature of the file makes reading from disk/memory fast as well.

How do I use IGD in my project?

  • Install igdtools. The easiest way is via pip install igdtools.
    • igdtools can convert from VCF to IGD, among other things (such as filtering IGD files).
  • Do one of the following:

Metadata

Release files for pyigd 1.4

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

Source distribution (sdist)

Source distribution for pyigd 1.4
File Size Uploaded Provenance Actions
pyigd-1.4.tar.gz 34.5 kB Without provenance Details for pyigd-1.4.tar.gz

Built distribution (wheel)

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

Total release size: 49.1 kB

Release files / pyigd-1.4.tar.gz

Download URL pyigd-1.4.tar.gz
Size 34.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3c7c1a13af13e16d4b4b6a8930a22cf032e3751ce98d18d2126e93eb2b3f60e4
BLAKE2b-256 checksum
How to use checksums
0fbdfcf0f8e2cec62b8d4b8b4f9c9b662d762452244ef040491861bcc5276d5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release files / pyigd-1.4-py3-none-any.whl

Download URL pyigd-1.4-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2dde251264b5d8e9dcff256b313f63be028e06e0f338366084e62d8b4ccb99d1
BLAKE2b-256 checksum
How to use checksums
04f283f740b742c39d3bfc50d1b23fd22560c8bccff44a658c58ac651e8aa315
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Security for pyigd 1.4

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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