Skip to main content

SideLocus

Struct SideLocus 

Source
pub struct SideLocus {
    pub side_byte_off: u64,
    pub side_num: u64,
    pub char_off: u32,
    pub by: i32,
    pub bp: i32,
}
Expand description

Position within the FM-index

This corresponds to the SideLocus struct in the C++ code. The FM-index is organized into “sides” of fixed size for efficient cache access.

Fields§

§side_byte_off: u64

Offset of side within ebwt[] (in bytes)

§side_num: u64

Index of side

§char_off: u32

Character offset within side (0 to sideBwtLen-1)

§by: i32

Byte within side (0 to sideBwtSz-1)

§bp: i32

Bit-pair within byte (0-3)

Implementations§

Source§

impl SideLocus

Source

pub fn new() -> Self

Create a new invalid SideLocus (default state)

Source

pub fn init_from_row(&mut self, row: u64, ep: &EbwtParams, ebwt: &[u8])

Initialize from a BWT row position

§Arguments
  • row - BWT row position
  • ep - Ebwt parameters
  • ebwt - Pointer to ebwt data (for prefetching)
§Safety

The ebwt pointer must be valid for the lifetime of this SideLocus.

Source

pub fn init_from_top_bot( top: u64, bot: u64, ep: &EbwtParams, ebwt: &[u8], ) -> (Self, Self)

Initialize two SideLocus objects from a top/bot pair

This is an optimized version that uses the result from one call to initFromRow to possibly avoid a second call.

Source

pub fn prefetch_from_row(row: u64, ep: &EbwtParams, ebwt: &[u8])

Prefetch cache lines for a given row

Source

pub fn prefetch(&self, ebwt: &[u8])

Prefetch cache lines for this SideLocus

Source

pub fn next_side(&mut self, ep: &EbwtParams)

Transform this SideLocus to refer to the next side

Source

pub fn valid(&self) -> bool

Check if this is a valid (initialized) SideLocus

Source

pub fn is_valid(&self, _ep: &EbwtParams) -> bool

Check if this SideLocus is valid with respect to given parameters

Source

pub fn to_bw_row(&self) -> u64

Convert locus to BW row it corresponds to

Source

pub fn invalidate(&mut self)

Invalidate this SideLocus (make it look like an invalid one)

Source

pub fn side<'a>(&self, ebwt: &'a [u8]) -> &'a [u8]

Get a read-only pointer to the beginning of the top side

Source

pub fn byte_offset(&self) -> u64

Get the actual byte offset in the mmapped data

Source

pub fn mask(&self) -> u8

Get the mask for extracting the bit-pair at this position

Source

pub fn extract(&self, data: &[u8]) -> u8

Extract the nucleotide pair at this locus from data

Trait Implementations§

Source§

impl Clone for SideLocus

Source§

fn clone(&self) -> SideLocus

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SideLocus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SideLocus

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for SideLocus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SideLocus

Source§

fn eq(&self, other: &SideLocus) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for SideLocus

Source§

impl Eq for SideLocus

Source§

impl StructuralPartialEq for SideLocus

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.