RSBio-Seq is a python wrapper for rust bio crate to provide fast sequence reading.
Project description
RSBio-Seq
RSBio intends to provide just reading facility on common sequence formats (FASTA/FASTQ) in both raw and compressed formats.
Build and install from source
To build you need to have the following installed.
- Rust - https://www.rust-lang.org/tools/install
- Maturin - https://www.maturin.rs/installation
- Python environment with Python >=3.9
maturin develop # this installs the development version in the env
maturin develop --rust # this installs a release version in the env
To build a wheel
maturin build --release
You will find the whl
file inside the target/wheels
directory.
Install from PyPI
Simple use the following command
pip install rsbio-seq
Usage
Once installed you can import the library and use as follows.
from rsbio_seq import SeqReader, SeqWriter, Sequence
# reading
for seq in SeqReader("path/to/seq.fasta.gz"):
print(seq.id)
print(seq.seq)
# for fastq quality line
print(seq.qual)
# optional description attribute
print(seq.desc)
# writing fasta
seq = Sequence("id", "desc", "ACGT") # id, description, sequence
writer = SeqWriter("out.fasta")
writer.write(seq)
writer.close()
# writing fastq
seq = Sequence("id", "desc", "ACGT") # id, description, sequence
writer = SeqWriter("out.fastq")
writer.write(seq)
writer.close()
# writing gzipped
seq = Sequence("id", "desc", "ACGT", "IIII") # id, description, sequence, quality
writer = SeqWriter("out.fq.gz")
writer.write(seq)
writer.close()
Note: close()
is needed if you want to read within the same program scope. Otherwise, rust will automatically do this for you.
Authors
- Anuradha Wickramarachchi https://anuradhawick.com
- Vijini Mallawaarachchi https://vijinimallawaarachchi.com
Support and contributions
Please get in touch via author websites or GitHub issues. Thanks!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file rsbio_seq-0.1.1-cp39-abi3-win_amd64.whl
.
File metadata
- Download URL: rsbio_seq-0.1.1-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 216.7 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97c8efe5534ec0180383adb8ff03fe4a7852d58bf061ff942386cf1689bc9145 |
|
MD5 | bcc970344a65ccf7ed129d19d85c4e64 |
|
BLAKE2b-256 | 33ad103b0b2c191e9c79fb06c50ed3d38bb2ea3f19c9dca01e2e75256fffde28 |
File details
Details for the file rsbio_seq-0.1.1-cp39-abi3-musllinux_1_2_x86_64.whl
.
File metadata
- Download URL: rsbio_seq-0.1.1-cp39-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 518.4 kB
- Tags: CPython 3.9+, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 243ed5d264b6a2c594346a0a55a8332d75e26f344a23c52ed893a2599136ab25 |
|
MD5 | b42e7ab67f7bc865842c34c3c068776b |
|
BLAKE2b-256 | 0e507bcd6246dbe0cc70cf9142a8b7b1cbd3142d6ab15cbcbc634bc42f6c96df |
File details
Details for the file rsbio_seq-0.1.1-cp39-abi3-musllinux_1_2_aarch64.whl
.
File metadata
- Download URL: rsbio_seq-0.1.1-cp39-abi3-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 534.9 kB
- Tags: CPython 3.9+, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 339cae7e52e4f1ddc930934f8807f736df8c30d03087174bd1276b018d105092 |
|
MD5 | 06027d5c58a2f4b50b7087a43e4ee52c |
|
BLAKE2b-256 | e8ca149f24e408a53e09e1903c5e90c0999f5ca3ef348e0daa866a685242ca77 |
File details
Details for the file rsbio_seq-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: rsbio_seq-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 347.4 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a98574817a7d82f07f14a29f1dfe5a2fb7fa815c3010cd362408a62482cb36d |
|
MD5 | fb2caeb04e2fba52e83f76cb67204069 |
|
BLAKE2b-256 | fca4913b216a5e2ae6510b22b94dee8118a9fccbb9ab0ad1f889305f71865187 |
File details
Details for the file rsbio_seq-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: rsbio_seq-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 354.9 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd9b07b46b5eba4ebd17a5b6de5d512375ddca64b1f3b6fe2941abfc6adef653 |
|
MD5 | 99c944bebcb5b3a5234b38ec7025468f |
|
BLAKE2b-256 | 69fa1ad5d6ba9ce30b9a4b74e36ec99996a5af37a4628838c77e93b7b0733f85 |
File details
Details for the file rsbio_seq-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: rsbio_seq-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 307.4 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d3f01f3ad2d373d7a083552c51b02333bf6586424864b01c37c14ab27744ce6 |
|
MD5 | 1f3fdd9ef43d1ee2c84d79b27087a5cf |
|
BLAKE2b-256 | f8ae5b372e3fd389a875a0d2804c68af1019730fe61e42a1af2719d60ca3cd1e |
File details
Details for the file rsbio_seq-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: rsbio_seq-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 311.8 kB
- Tags: CPython 3.9+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af442142a1bc72c3ebe7b340de6807d0e2082e3c2d97df04256555b6603144ff |
|
MD5 | 5b2a5506810c2a90b8e1a6330bf21a34 |
|
BLAKE2b-256 | 7c3ecfa563e6d8411abaa1a9cd758332dadb073961661079b407fe0d330d048c |