RSBio-Seq is a fast and light-weight sequence reading library (built on top of rust bio crate).
Project description
RSBio-Seq
RSBio-Seq intends to provide just reading facility on common sequence formats (FASTA/FASTQ) in both raw and compressed formats.
Installation
1. From PyPI (Recommended)
Simple use the following command
pip install rsbio-seq
2. 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 for installation
maturin build --release
You will find the whl
file inside the target/wheels
directory. Your whl
file will have a name depicting your python environment and CPU architecture.
Usage
Once installed you can import the library and use as follows.
Reading
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
# 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.2-cp39-abi3-win_amd64.whl
.
File metadata
- Download URL: rsbio_seq-0.1.2-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 216.4 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 | 18aeb296ccc8e628bc3756ff344ecbb2d503d14bb7872d75ad4feb6a86a6d3c6 |
|
MD5 | 97647009f97dfacec3ce036f2858f6c0 |
|
BLAKE2b-256 | f07c6c60c8cfb0b485f2dc638e010ba9b85e3ed965dad96ee65b481ebdf5c4b6 |
File details
Details for the file rsbio_seq-0.1.2-cp39-abi3-musllinux_1_2_x86_64.whl
.
File metadata
- Download URL: rsbio_seq-0.1.2-cp39-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 517.9 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 | 2e74ef070d4d1b26f946dd93078ea5e045ac39ec421f3e09955aa56c12a02a42 |
|
MD5 | 9f9adba58b4a3e74eb1979b24aa46c74 |
|
BLAKE2b-256 | e78263ca5c8106630e9284b12d154df1b8f6409b1bcbdc009cd6968cdd440529 |
File details
Details for the file rsbio_seq-0.1.2-cp39-abi3-musllinux_1_2_aarch64.whl
.
File metadata
- Download URL: rsbio_seq-0.1.2-cp39-abi3-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 534.8 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 | 08eaa43748c91e5b0a19bb27bc83fee7acbeaca805b32e18b7f7e08ae571c095 |
|
MD5 | 650c6b92cbfa7128bebdfced83a5388d |
|
BLAKE2b-256 | 767ac87449bc5d33a9946c494c1b74cea3e8ca4aa0978867a06fbb0e13accee1 |
File details
Details for the file rsbio_seq-0.1.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: rsbio_seq-0.1.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 346.9 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 | 35a23a80097f0554bdc971f53da73350ad05cbc5a595d436cec9dd87ec3e9ddf |
|
MD5 | 317421a0266b05b8b5446842fd7279ff |
|
BLAKE2b-256 | 1fe8806475a4c099836c28245ed39394cbbc3ec355da6184f964e3053fa9bf19 |
File details
Details for the file rsbio_seq-0.1.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: rsbio_seq-0.1.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 354.8 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 | 42bdf0f13177f8187db05ffa6b000d726cc9532f4c8985b599c39de3cf08e505 |
|
MD5 | 57b78f32612358f2097abf6fbd9cebcc |
|
BLAKE2b-256 | dfa98c09a4b27498b9cb066c555257acc3d81cccc98868d955c72fbbcc8da021 |
File details
Details for the file rsbio_seq-0.1.2-cp39-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: rsbio_seq-0.1.2-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 306.9 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 | 3904622306920473dcf43ced5f413777f22b87dee45b097a37e48bc07e73227c |
|
MD5 | 40223ec7674aeaac73688b626627b25c |
|
BLAKE2b-256 | 33102f7ce665019d568b5a041ef042e58b5c5d45ba633627166d35a577dd0660 |
File details
Details for the file rsbio_seq-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: rsbio_seq-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 311.2 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 | 17001617317034b4c840f86eb00a962dc3052d72e5b467acdff193d74eef612d |
|
MD5 | 9dee759720e501756b1bc5c42064d697 |
|
BLAKE2b-256 | 9c7171234f189fba77f08a2944265695bbb405fa3eb9f0f8f1a4859964a08fe5 |