Crates.io | nafcodec-py |
lib.rs | nafcodec-py |
version | 0.2.0 |
source | src |
created_at | 2023-10-08 19:03:27.649918 |
updated_at | 2024-04-10 09:45:48.732994 |
description | PyO3 bindings and Python interface to the nafcodec crate. |
homepage | https://github.com/althonos/nafcodec |
repository | https://github.com/althonos/nafcodec |
max_upload_size | |
id | 997381 |
size | 95,158 |
nafcodec
Rust coder/decoder for Nucleotide Archive Format (NAF) files.
Nucleotide Archive Format is a file format proposed in Kryukov et al.[1] in 2019 for storing compressed nucleotide or protein sequences combining 4-bit encoding and Zstandard compression. NAF files can be compressed and decompressed using the original C implementation.
This library provides PyO3 bindings to the nafcodec
crate,
a Rust implementation of a NAF decoder using nom
for parsing the binary format, and zstd
for
handling Zstandard decompression. It provides a complete API that allows
iterating over the contents of a NAF file.
This is the Python version, there is a Rust crate available as well.
The following features are planned:
Use a nafcodec.Decoder
to iterate over the contents of a Nucleotide Archive
Format, reading from the given path-like
or file-like object:
import nafcodec
decoder = nafcodec.Decoder("../data/LuxC.naf")
for record in decoder:
print(record.id)
All fields of the obtained Record
are optional, and actually depend on the
kind of data that was compressed.
Found a bug ? Have an enhancement request ? Head over to the GitHub issue tracker if you need to report or ask something. If you are filing in on a bug, please include as much information as you can about the issue, and try to recreate the same bug in a simple, easily reproducible situation.
This project adheres to Semantic Versioning and provides a changelog in the Keep a Changelog format.
This library is provided under the open-source MIT license. The NAF specification is in the public domain.
This project is in no way not affiliated, sponsored, or otherwise endorsed by the original NAF authors. It was developed by Martin Larralde during his PhD project at the European Molecular Biology Laboratory in the Zeller team.