Skip to main content

Parser for IGD files

Project description

Python build and test

pyigd

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

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

Installation

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

For development, you can clone the code 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?

  • Clone picovcf and follow the instructions in its README to build the tools for that library.
    • If you want to be able to convert .vcf.gz (compressed VCF) to IGD, make sure you build with -DENABLE_VCF_GZ=ON
  • One of the built tools will be igdtools, which can converts from VCF to IGD, among other things (such as filtering IGD files).
  • Do one of the following:

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

pyigd-1.3.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyigd-1.3-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file pyigd-1.3.tar.gz.

File metadata

  • Download URL: pyigd-1.3.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for pyigd-1.3.tar.gz
Algorithm Hash digest
SHA256 82c317b7e193b186ae640bd8f1645724a219f9abbd2ac318d38e34872ccaf14d
MD5 bca4e61a52d06ccccd45e677a5ec9e96
BLAKE2b-256 40bfd03a8067a5e2c0fafce00351716a850d503906b3f3903dc0a403f1679a12

See more details on using hashes here.

File details

Details for the file pyigd-1.3-py3-none-any.whl.

File metadata

  • Download URL: pyigd-1.3-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for pyigd-1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3711d8b1832ecbed7d67c83865fba26bf1c3e0974bde8d7ae1ccf695c862c4cb
MD5 4cdc83b7f48dd2dd746b94c72b612e92
BLAKE2b-256 e27bd253e8b4a55508a7438d47b39fe083b3f4ebce178913fd982c688f32c433

See more details on using hashes here.

Supported by

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