Struct noodles_csi::binning_index::Indexer
source · pub struct Indexer<I> { /* private fields */ }
Expand description
A binning index indexer.
Implementations§
source§impl<I> Indexer<I>
impl<I> Indexer<I>
sourcepub fn new(min_shift: u8, depth: u8) -> Self
pub fn new(min_shift: u8, depth: u8) -> Self
Creates a binning index indexer.
§Examples
use noodles_csi::binning_index::{index::reference_sequence::index::BinnedIndex, Indexer};
let indexer = Indexer::<BinnedIndex>::new(14, 5);
sourcepub fn set_header(self, header: Header) -> Self
pub fn set_header(self, header: Header) -> Self
Sets a tabix header.
§Examples
use noodles_csi::binning_index::{
index::{reference_sequence::index::BinnedIndex, Header},
Indexer,
};
let header = Header::default();
let indexer = Indexer::<BinnedIndex>::new(14, 5).set_header(header);
sourcepub fn add_record(
&mut self,
alignment_context: Option<(usize, Position, Position, bool)>,
chunk: Chunk
) -> Result<()>
pub fn add_record( &mut self, alignment_context: Option<(usize, Position, Position, bool)>, chunk: Chunk ) -> Result<()>
Adds a record.
§Examples
use noodles_bgzf as bgzf;
use noodles_core::Position;
use noodles_csi::binning_index::{
index::reference_sequence::{bin::Chunk, index::BinnedIndex},
Indexer,
};
let mut indexer = Indexer::<BinnedIndex>::new(14, 5);
let reference_sequence_id = 0;
let start = Position::try_from(8)?;
let end = Position::try_from(13)?;
let is_mapped = true;
let chunk = Chunk::new(
bgzf::VirtualPosition::from(144),
bgzf::VirtualPosition::from(233),
);
indexer.add_record(Some((reference_sequence_id, start, end, is_mapped)), chunk)?;
Trait Implementations§
Auto Trait Implementations§
impl<I> Freeze for Indexer<I>
impl<I> RefUnwindSafe for Indexer<I>where
I: RefUnwindSafe,
impl<I> Send for Indexer<I>where
I: Send,
impl<I> Sync for Indexer<I>where
I: Sync,
impl<I> Unpin for Indexer<I>where
I: Unpin,
impl<I> UnwindSafe for Indexer<I>where
I: UnwindSafe,
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