Struct noodles_bam::io::indexed_reader::Builder
source · pub struct Builder { /* private fields */ }
Expand description
An indexed BAM reader builder.
Implementations§
source§impl Builder
impl Builder
sourcepub fn set_index<I>(self, index: I) -> Selfwhere
I: BinningIndex + 'static,
pub fn set_index<I>(self, index: I) -> Selfwhere
I: BinningIndex + 'static,
Sets an index.
§Examples
use noodles_bam::{bai, io::indexed_reader::Builder};
let index = bai::Index::default();
let builder = Builder::default().set_index(index);
sourcepub fn build_from_path<P>(self, src: P) -> Result<IndexedReader<Reader<File>>>
pub fn build_from_path<P>(self, src: P) -> Result<IndexedReader<Reader<File>>>
Builds an indexed BAM reader from a path.
If no index is set, this will attempt to read an associated index at <src>.bai
or
<src>.csi
, in that order.
§Examples
use noodles_bam::io::indexed_reader::Builder;
let reader = Builder::default().build_from_path("sample.bam")?;
sourcepub fn build_from_reader<R>(self, reader: R) -> Result<IndexedReader<Reader<R>>>where
R: Read,
pub fn build_from_reader<R>(self, reader: R) -> Result<IndexedReader<Reader<R>>>where
R: Read,
Builds an indexed BAM reader from a reader.
§Examples
use noodles_bam::{bai, io::indexed_reader::Builder};
let index = bai::Index::default();
let data = [];
let reader = Builder::default().set_index(index).build_from_reader(&data[..])?;
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl !RefUnwindSafe for Builder
impl !Send for Builder
impl !Sync for Builder
impl Unpin for Builder
impl !UnwindSafe for Builder
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