onelib
A Rust implementation of the ONEcode file format by Gene Myers and Richard Durbin.
ONEcode is a general-purpose scientific data format supporting dual ASCII/binary representation, per-field compression (2-bit DNA, Huffman strings, delta-encoded integer lists), built-in indexing, and self-describing schemas. It was originally designed for the Vertebrate Genomes Project.
Status
Early release — not yet intended for production use. The API may change without notice.
Version 0.1.0 — feature-complete for single-threaded read/write of ASCII and binary ONEcode files, fully cross-compatible with the C reference library.
Usage
use Cursor;
use OneReader;
use Schema;
use OneWriter;
// Define a schema.
let schema = from_text
.expect;
let entry = &schema.entries;
// Write a binary ONEcode file.
let mut buf = new;
let mut writer = new.unwrap;
writer.write_dna_line.unwrap;
writer.write_string_line.unwrap;
writer.close.unwrap;
// Read it back.
buf.set_position;
let mut reader = open.unwrap;
assert!;
let line = reader.read_line.unwrap;
assert_eq!;
assert_eq!;
Building
Licence
BSD 3-Clause. See LICENCE for details.