Skip to main content

Read and write the PLINK BED format, simply and efficiently.

Project description

PyPI version PyPI version Build Status PyPI

Read and write the PLINK BED format, simply and efficiently.

This is the Python README. For Rust, see README-rust.md.

Features:

  • Fast multi-threaded Rust engine.
  • Supports all Python indexing methods. Slice data by individuals (samples) and/or SNPs (variants).
  • Used by PySnpTools, FaST-LMM, and PyStatGen.
  • Supports PLINK 1.9.

Install

Full version: With all optional dependencies:

pip install bed-reader[samples,sparse]

Minimal version: Depends only on numpy:

pip install bed-reader

Usage

Read genomic data from a .bed file.

>>> import numpy as np
>>> from bed_reader import open_bed, sample_file
>>>
>>> file_name = sample_file("small.bed")
>>> bed = open_bed(file_name)
>>> val = bed.read()
>>> print(val)
[[ 1.  0. nan  0.]
 [ 2.  0. nan  2.]
 [ 0.  1.  2.  0.]]
>>> del bed

Read every second individual and SNPs (variants) from 20 to 30.

>>> file_name2 = sample_file("some_missing.bed")
>>> bed2 = open_bed(file_name2)
>>> val2 = bed2.read(index=np.s_[::2,20:30])
>>> print(val2.shape)
(50, 10)
>>> del bed2

List the first 5 individual (sample) ids, the first 5 SNP (variant) ids, and every unique chromosome. Then, read every genomic value in chromosome 5.

>>> with open_bed(file_name2) as bed3:
...     print(bed3.iid[:5])
...     print(bed3.sid[:5])
...     print(np.unique(bed3.chromosome))
...     val3 = bed3.read(index=np.s_[:,bed3.chromosome=='5'])
...     print(val3.shape)
['iid_0' 'iid_1' 'iid_2' 'iid_3' 'iid_4']
['sid_0' 'sid_1' 'sid_2' 'sid_3' 'sid_4']
['1' '10' '11' '12' '13' '14' '15' '16' '17' '18' '19' '2' '20' '21' '22'
 '3' '4' '5' '6' '7' '8' '9']
(100, 6)

Project Links

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

bed_reader-1.0.0b1.tar.gz (2.4 MB view details)

Uploaded Source

Built Distributions

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

bed_reader-1.0.0b1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

bed_reader-1.0.0b1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

bed_reader-1.0.0b1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

bed_reader-1.0.0b1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

bed_reader-1.0.0b1-cp312-none-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.12Windows x86-64

bed_reader-1.0.0b1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

bed_reader-1.0.0b1-cp312-cp312-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

bed_reader-1.0.0b1-cp312-cp312-macosx_10_7_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.12macOS 10.7+ x86-64

bed_reader-1.0.0b1-cp311-none-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.11Windows x86-64

bed_reader-1.0.0b1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

bed_reader-1.0.0b1-cp311-cp311-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

bed_reader-1.0.0b1-cp311-cp311-macosx_10_7_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.11macOS 10.7+ x86-64

bed_reader-1.0.0b1-cp310-none-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.10Windows x86-64

bed_reader-1.0.0b1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

bed_reader-1.0.0b1-cp310-cp310-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

bed_reader-1.0.0b1-cp310-cp310-macosx_10_7_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.10macOS 10.7+ x86-64

bed_reader-1.0.0b1-cp39-none-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.9Windows x86-64

bed_reader-1.0.0b1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

bed_reader-1.0.0b1-cp39-cp39-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

bed_reader-1.0.0b1-cp39-cp39-macosx_10_7_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.9macOS 10.7+ x86-64

bed_reader-1.0.0b1-cp38-none-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.8Windows x86-64

bed_reader-1.0.0b1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

bed_reader-1.0.0b1-cp38-cp38-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

bed_reader-1.0.0b1-cp38-cp38-macosx_10_7_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.8macOS 10.7+ x86-64

bed_reader-1.0.0b1-cp37-none-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.7Windows x86-64

bed_reader-1.0.0b1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

File details

Details for the file bed_reader-1.0.0b1.tar.gz.

File metadata

  • Download URL: bed_reader-1.0.0b1.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for bed_reader-1.0.0b1.tar.gz
Algorithm Hash digest
SHA256 adf84439c8db34c4f815444e5976593abd9a1323cdaf0dff6e169363587a6d1b
MD5 6d3e7ba138c929b41eb2c2c2dfad773a
BLAKE2b-256 3bd4f25e6352d20e1ed7694e5debe65392c80697013f11b17dccf155801d3407

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7765657e160c04334bcc19b52adbd06f7e2524dc94eab6a18f8f6a7faa3c4ab6
MD5 eb8f07d50bc1d0896d67e7830bab1359
BLAKE2b-256 4a2b478004766a5eed033fb55275c6980b9b8be42f3cee9e4af598728bff1b6b

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d6a679491b8fc3d9f6cc7fe4025ccbd03aa09abd55049db6d1a42568d4006be5
MD5 a81b473f1ea15677c272b679019daa34
BLAKE2b-256 a4c884c607db94063c029ca90bc2161ccf847d2bb5b22ad7194bacf77b0bf751

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c3a54d023ed14391486ec7620c22d3118158a92ed843d99a33217ecce885ee60
MD5 e09aa244660f4e1e1b169e6eeef93cb6
BLAKE2b-256 ddbe224cb363cbc9eb6bf877b6ee45af6820e405ba5919c181708daf9d8efe8f

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cc0b2c4b4f2b79a2429371c3ddba8aa80fc86d9c8bcb45da68d137860ed183ec
MD5 dd85ba041eef2cbebd1410f515ea0940
BLAKE2b-256 d6cfef1a0f3ff1c51acc71b078fcb2be3a5f32576313b810f07334c67ed80406

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp312-none-win_amd64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 008e597e464746ca5760f9313ba0a95676fbf2f144929db7616149925bb9cc04
MD5 778cb70c2f12ca6fa62f2332ce58208d
BLAKE2b-256 dd8a22673d3fcc4223b3940f14c779b183cc11f366419b8d12d30929bcd2a53d

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 43cb3142edfad7fd2a08e706785860f8df127d5ca59b3eb59702b57710189264
MD5 63cc038e731a533b7f11e0e5b7328d0d
BLAKE2b-256 b3eeeffc10fee2f7aaa544ef84ad74de94ba33e8ec932c79e559a54e9cd35ef7

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7ce0c8b7ba5568b58bec1ce6f5015983469da5333480fa380280d9b507413c80
MD5 891d3088c1f6c27d70104bc8273c039a
BLAKE2b-256 9f7db8ab7cc2bf6cee5f04ffce33e926725cf35659d6e77f72b11f853301ff88

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp312-cp312-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp312-cp312-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 6c3280e6773d0c5056b3362d695819de2645595c1cc42b61841ec15f5ecc9148
MD5 9f5f805914cac1e772003141b41c5403
BLAKE2b-256 ce68aee2665f5b9dd9f0f5b3b75d0affd2d5fcf1643ec000c92b25d5caedb5d4

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp311-none-win_amd64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 ad711908b2b0ba9ae5b9634c1e7a52a106e32bbdd9b740af7fe81611cde9661f
MD5 13baf09784c0b1ad9ecfbd70ddd6ff09
BLAKE2b-256 9a2e1c7669644482eee48190399fdc0bcf67e4b1f622536efd2235b178f09b6a

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2c784598979d70d96f5378f55a77fa555c54c6b7f7d2d2810a026f286f4d5581
MD5 2a0f5228fa9099fdd58f11518b73da4f
BLAKE2b-256 1d405853aee0be5847067142fb46264ca425ce00aac46feb5363910c8c1b3bb8

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 694ccd3aa82660851d13fe1b5fc21620d007d1857905a4092d111fdb70a7fa02
MD5 d4c9ec1c82b9c61c06e241508d7075b5
BLAKE2b-256 a45a3baa8d2e832e09167bcad5e554f38ca6c2990ed76a4d70549fb819f7bd9c

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp311-cp311-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 4e026c5162a1a35cc1331bdb903e2e8633aae71197585e418042bcc4eed990c3
MD5 3b720df2175a65394264c0fecd178980
BLAKE2b-256 d326e8f10905b77ad7f5fc83851478f7e754166e45c071389af2dee29e42215a

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 56d603dd3a30f2f7f48fa501f2962aa25b8f06593d26f1d4dba6ed75b0fa30dc
MD5 867ed2f8b57157cf7d67f0ef26654eda
BLAKE2b-256 b7c1bd98c15250faf8a6e46f6cc0e191c929bde9bdfe804c24c193d2c5e21d07

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6eceb9e29e0fff83fc26a78ee425f0d2e20b9533bad61e1e35a5fd4eeb9e18a4
MD5 5735afd8f393cf0fa1d60dde02fce1fd
BLAKE2b-256 58d7116bebbd8557c1133dcf1a69596d29cd31ac81f4f1b6da1b29f7c760c8e4

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f1d3b7d93506f637ee6aca94e30f5005c3ad4bc2d6ffc508dce844ea0c417230
MD5 30cbb6d8a4caf161e60bcee92cdf4887
BLAKE2b-256 db8d56ad720086fd3e110fde25c13c216dadc2575a207e39437db24d97aa9ebf

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp310-cp310-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 48c17e713ffd3d5659114b8d8ecfc02a009f15fbe545f9d2dc89eeb03ecaf757
MD5 a51bd9e6ee9bb8aedcd6e12a0ca4fa84
BLAKE2b-256 ad43f6e6bb3bbe89321adfeb8de774877dfc433c491d53fad9879761b8024707

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp39-none-win_amd64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 49216af953552b72dac59ca7565e368db1cd9d122161ba2280d3812d1ca66b32
MD5 21d7fa640aa9d7df74c79d5fc4028063
BLAKE2b-256 2df040620c4766a79a0e6945e92bb78d423214865e7cc800bbe68e38a995ce9b

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6a556d6e60a6853b1c106c4fd53f07fcc7d096f1d634f877006d64a043843aff
MD5 70307a43b3e2cb67bac46be1ffe0eda5
BLAKE2b-256 cd42b9bfe0a68c8ca415edcf2bfc7d0eaba6687d880a7dd3797c15a86620b3d8

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0d5d600bd8da141b759841c55ba437a91a69cd014dee50c0323c24a433965390
MD5 a70d92d54789ade23092839d75526cf7
BLAKE2b-256 12a89a994a2f496bcde09de9ce9743db8467d8d14b95c3565a7c28d6f95f955a

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp39-cp39-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 94c3e89b67ac4ff901a080eb7c1b9092be018a991c296bc5902d7d1ae9090b51
MD5 82fabd9951f38674002bb17d61507b7f
BLAKE2b-256 8405c6cabe1c316aa4d152037049bd7251aa1baa4bf31db7f38b06d6d1adeebb

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp38-none-win_amd64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 a6a9db0ed2bd1811b0dd29d64d5aa30346573f35e44f04912273f508577f0cc0
MD5 b16fd9cadda519057d843be9bb3c41fd
BLAKE2b-256 41a2aab087c9e4c07646e9341eee459e09ca6615aeeaac9d0dc25059d650666a

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a167c5d29c4325fd2d682ecd1411f781f060321ed67f83be441f1f1ac082e9b9
MD5 308eb134165bdb4e65efd6119d8e8131
BLAKE2b-256 eebbe37cd4f41ce7daa8c7b1a34a9d97a8f888ff1bc5cc36e7760a58032f5eaa

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f213133fde54222e35d7cf45febb7bfa565b4a8ee33a00c4a88db4956ca02b85
MD5 162a93520d4bbf4992b96976827e860b
BLAKE2b-256 22496812f67bbae722f30998af2eef3517cf77f03b400357f2d5a9e270147b53

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp38-cp38-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 c25dd68cbc775f334de4c5d3f0e5d9c36c89a0277691c8c697ce01a9a9b42018
MD5 00e9aefa1b711ff74be779b54dfa15f8
BLAKE2b-256 9be7a27c3281017eb3b702b915cba5b702b808ce0aba5921779450b3e486f14c

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp37-none-win_amd64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 b3fee6f534c895fc97341eecc6e749a61b22f7e5cf758e1b4fa978f870ddf9b5
MD5 43d21517087cf1b38a348c7eb77c568d
BLAKE2b-256 8c9794c9a794837c599a44d0b09746570d6ce9c1770a2cc529ded03c5c55f33c

See more details on using hashes here.

File details

Details for the file bed_reader-1.0.0b1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for bed_reader-1.0.0b1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 02ad314a8e29ddf7b235e67306e9d65b12519f64f91495258fe27cefd638c3fe
MD5 460966d9aa0e4cdd3d678144c82b3d81
BLAKE2b-256 690b01d94abda2155ab201ed7d4548daac0823e68a76349bea209ceb049e6715

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