pub struct FlankingDatabase { /* private fields */ }Expand description
Reader for compressed flanking database (.fdb) files.
The FDB format stores flanking sequences grouped by gene, with zstd compression for each gene block.
§File Format
[Header: 8 bytes magic + 4 bytes version + 4 bytes gene_count + 8 bytes index_offset]
[Gene blocks: zstd compressed TSV data]
[Index: gene name -> (offset, compressed_len, record_count)]Implementations§
Source§impl FlankingDatabase
impl FlankingDatabase
Sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self>
Opens a flanking database file.
Reads and validates the header, then loads the gene index into memory.
§Arguments
path- Path to the .fdb file
Sourcepub fn has_gene(&self, gene: &str) -> bool
pub fn has_gene(&self, gene: &str) -> bool
Checks if a gene exists in the database. First tries direct key lookup, then falls back to gene name mapping.
Sourcepub fn get_gene_records(&mut self, gene: &str) -> Result<Vec<FlankingRecord>>
pub fn get_gene_records(&mut self, gene: &str) -> Result<Vec<FlankingRecord>>
Retrieves all flanking records for a specific gene.
Decompresses the gene block on demand. Supports both direct key lookup and gene name mapping (e.g., “mexQ” -> “mexQ|DRUG|CLASS|CODE”).
Auto Trait Implementations§
impl Freeze for FlankingDatabase
impl RefUnwindSafe for FlankingDatabase
impl Send for FlankingDatabase
impl Sync for FlankingDatabase
impl Unpin for FlankingDatabase
impl UnsafeUnpin for FlankingDatabase
impl UnwindSafe for FlankingDatabase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more