You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Lightweight and memory efficient reader for PLINK BED files**. It supports both SNP-major and individual-major formats. Written in pure Python. Check the [available documentation](https://computational-genomics-bsc.github.io/plink-bed-reader/) for more information.
3
+
4
+
## Table of contents<!-- omit in toc -->
5
+
-[Getting started](#getting-started)
6
+
-[Installation](#installation)
7
+
-[Usage](#usage)
8
+
-[Dependencies](#dependencies)
9
+
10
+
11
+
## Getting started
12
+
### Installation
13
+
VariantExtractor is available on PyPI and can be installed using `pip`:
14
+
```bash
15
+
pip install plink-bed-reader
16
+
```
17
+
18
+
## Usage
19
+
```python
20
+
# Import the package
21
+
from plink_bed_reader import PLINKBEDReader, BEDMode
22
+
23
+
# Load the PLINK BED file (we include the mode for sanity check, but it is optional)
24
+
bed = PLINKBEDReader('./input_test_data/test.bed', mode=BEDMode.SNP_MAJOR)
25
+
26
+
# Print the number of SNPs and samples
27
+
print('Number of SNPs:', bed.snp_count)
28
+
print('Number of samples:', bed.sample_count)
29
+
# Print the first SNP
30
+
first_snp = bed[0]
31
+
print('First SNP:', first_snp, first_snp.dtype)
32
+
# Print the first 3 SNPs
33
+
print('First 3 SNPs:', bed[:3])
34
+
```
35
+
36
+
## Dependencies
37
+
38
+
The dependencies are covered by their own respective licenses as follows:
0 commit comments