pub struct Fasta { /* private fields */ }Expand description
A loaded FASTA reference with random-access sequence retrieval.
Wraps a noodles IndexedReader for efficient seek-based access. Contig
metadata (names, lengths) is pre-computed from the .fai index at
construction time.
Implementations§
Source§impl Fasta
impl Fasta
Sourcepub fn from_path(path: &Path) -> Result<Self>
pub fn from_path(path: &Path) -> Result<Self>
Open a FASTA file and its .fai index.
The .fai file must exist alongside the FASTA (e.g. ref.fa.fai).
§Errors
Returns an error if the FASTA or its index cannot be read.
Sourcepub fn dict(&self) -> &SequenceDictionary
pub fn dict(&self) -> &SequenceDictionary
Return a reference to the underlying sequence dictionary.
Sourcepub fn load_contig(&mut self, contig_name: &str) -> Result<Vec<u8>>
pub fn load_contig(&mut self, contig_name: &str) -> Result<Vec<u8>>
Load and return the full sequence of contig_name as uppercase bytes.
Uses seek-based access via the FAI index for efficiency, avoiding the
intermediate Record allocation that query() performs.
§Errors
Returns an error if the contig is unknown or the FASTA cannot be read.
Sourcepub fn contig_names(&self) -> Vec<&str>
pub fn contig_names(&self) -> Vec<&str>
Return contig names in index order.
Auto Trait Implementations§
impl Freeze for Fasta
impl RefUnwindSafe for Fasta
impl Send for Fasta
impl Sync for Fasta
impl Unpin for Fasta
impl UnsafeUnpin for Fasta
impl UnwindSafe for Fasta
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