bio-seq-derive
bio-seq-derive is a procedural macro crate that provides the Codec derive macro for the bio-seq library. It allows users to define custom bit-packed alphabets from an enum. The bit representation of the symbols is derived from the enum discriminants.
This crate also provides the dna!() and iupac!() macros that are reexported by bio-seq for declaring static sequences at compile time.
You probably don't want to directly include this crate as a dependency.
Please refer to the bio-seq documentation for a complete guide on defining custom alphabets.
Features
widthattribute: Specify the number of bits required to represent each variant in the custom alphabet. Default is optimal.altattribute: Define alternate bit representations for the same variant.displayattribute: Set a custom character representation for a variant.
Usage
To derive a custom encoding, use the Codec derive macro as reexported in the bio-seq prelude:
use *;
Codecs can be annotated with #[repr(u8)] for convenient casting.