Skip to main content

Lightweight and memory efficient reader for PLINK BED files. It supports both SNP-major and individual-major formats. Written in pure Python.

Project description

PLINK BED reader

Lightweight and memory efficient reader for PLINK BED files. It supports both SNP-major and individual-major formats. Written in Python 3. Check the available documentation for more information.

Table of contents

Getting started

Installation

plink-bed-reader is available on PyPI and can be installed using pip:

pip install plink-bed-reader

Usage

# Import the package
from plink_bed_reader import PLINKBEDReader, BEDMode

# Load the PLINK BED file (we include the mode for sanity check, but it is optional)
bed = PLINKBEDReader('./input_test_data/test.bed', mode=BEDMode.SNP_MAJOR)

# Print the number of SNPs and samples
print('Number of SNPs:', bed.snp_count)
print('Number of samples:', bed.sample_count)
# Print the first SNP
first_snp = bed[0]
print('First SNP:', first_snp, first_snp.dtype)
# Print the first 3 SNPs
print('First 3 SNPs:', bed[:3])

Dependencies

The dependencies are covered by their own respective licenses as follows:

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

plink_bed_reader-1.0.2.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

plink_bed_reader-1.0.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

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