pub struct FileHeader { /* private fields */ }Expand description
Parsed Jellyfish file header.
Contains all metadata from the JSON header of a Jellyfish output file. The header includes k-mer parameters, hash table configuration, and provenance information.
§Examples
use std::fs::File;
use std::io::BufReader;
use jellyfish_reader::FileHeader;
let file = File::open("output.jf").unwrap();
let mut reader = BufReader::new(file);
let header = FileHeader::read(&mut reader).unwrap();
println!("k = {}", header.k().unwrap());
println!("format: {}", header.format());Implementations§
Source§impl FileHeader
impl FileHeader
Sourcepub fn read<R: Read>(reader: &mut R) -> Result<Self>
pub fn read<R: Read>(reader: &mut R) -> Result<Self>
Read and parse a Jellyfish file header from the given reader.
This reads the 9-digit length prefix, then the JSON header content. After this call, the reader is positioned at the start of the data section.
Sourcepub fn counter_len(&self) -> Option<u64>
pub fn counter_len(&self) -> Option<u64>
Counter length in the data section (may differ from val_len).
Sourcepub fn max_reprobe(&self) -> Option<u64>
pub fn max_reprobe(&self) -> Option<u64>
Maximum reprobing distance.
Sourcepub fn exe_path(&self) -> Option<&str>
pub fn exe_path(&self) -> Option<&str>
The path to the jellyfish executable that created this file.
Sourcepub fn cmdline(&self) -> Option<Vec<&str>>
pub fn cmdline(&self) -> Option<Vec<&str>>
The command line arguments used to create this file.
Sourcepub fn matrix(&self, index: usize) -> Result<RectangularBinaryMatrix>
pub fn matrix(&self, index: usize) -> Result<RectangularBinaryMatrix>
Parse the hash matrix at the given index from the header.
Sourcepub fn data_val_len(&self) -> Option<usize>
pub fn data_val_len(&self) -> Option<usize>
Compute the counter length in bytes for the data section.
Trait Implementations§
Source§impl Clone for FileHeader
impl Clone for FileHeader
Source§fn clone(&self) -> FileHeader
fn clone(&self) -> FileHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FileHeader
impl RefUnwindSafe for FileHeader
impl Send for FileHeader
impl Sync for FileHeader
impl Unpin for FileHeader
impl UnsafeUnpin for FileHeader
impl UnwindSafe for FileHeader
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