Skip to main content

SharedProfiles

Struct SharedProfiles 

Source
pub struct SharedProfiles<'a, const M: usize, const N: usize, const O: usize, const S: usize> { /* private fields */ }
Expand description

A lazily-evaluated set of striped alignment profiles which can be shared across threads.

This is an abstraction around StripedProfile, providing convenience methods for automatically increasing the integer width and rerunning the alignment when overflow occurs. This only supports the unsigned version of the algorithm.

When sharing between threads is not needed, consider using LocalProfiles instead.

§Parameters

  • 'a: The lifetime of the stored sequence, the WeightMatrix, and the alphabet (ByteIndexMap). An owned sequence can also be stored.
  • M: The number of SIMD lanes for i8 profiles
  • N: The number of SIMD lanes for i16 profiles
  • O: The number of SIMD lanes for i32 profiles
  • S: The size of the alphabet (usually 5 for DNA including N)

Implementations§

Source§

impl<'a, const M: usize, const N: usize, const O: usize, const S: usize> SharedProfiles<'a, M, N, O, S>

Source

pub fn new( seq: impl Into<Cow<'a, [u8]>>, matrix: &'a WeightMatrix<'a, i8, S>, gap_open: i8, gap_extend: i8, ) -> Result<Self, ProfileError>

Creates an empty SharedProfiles.

Usually you instead want to use new_with_w128, new_with_w256, or new_with_w512, based on the SIMD register width of your target. See Picking the Register Width for more details.

§Errors
Source§

impl<'a, const S: usize> SharedProfiles<'a, 16, 8, 4, S>

Source

pub fn new_with_w128( seq: impl Into<Cow<'a, [u8]>>, matrix: &'a WeightMatrix<'_, i8, S>, gap_open: i8, gap_extend: i8, ) -> Result<SharedProfiles<'a, 16, 8, 4, S>, ProfileError>

Creates an empty SharedProfiles optimized for 128-bit SIMD width.

This sets M=16, N=8, and O=4 for i8, i16, and i32 profiles respectively.

§Errors

Same as SharedProfiles::new.

Source§

impl<'a, const S: usize> SharedProfiles<'a, 32, 16, 8, S>

Source

pub fn new_with_w256( seq: impl Into<Cow<'a, [u8]>>, matrix: &'a WeightMatrix<'_, i8, S>, gap_open: i8, gap_extend: i8, ) -> Result<SharedProfiles<'a, 32, 16, 8, S>, ProfileError>

Creates an empty SharedProfiles optimized for 256-bit SIMD width.

This sets M=32, N=16, and O=8 for i8, i16, and i32 profiles respectively.

§Errors

Same as SharedProfiles::new.

Source§

impl<'a, const S: usize> SharedProfiles<'a, 64, 32, 16, S>

Source

pub fn new_with_w512( seq: impl Into<Cow<'a, [u8]>>, matrix: &'a WeightMatrix<'_, i8, S>, gap_open: i8, gap_extend: i8, ) -> Result<SharedProfiles<'a, 64, 32, 16, S>, ProfileError>

Creates an empty SharedProfiles optimized for 512-bit SIMD width.

This sets M=64, N=32, and O=16 for i8, i16, and i32 profiles respectively.

§Errors

Same as SharedProfiles::new.

Trait Implementations§

Source§

impl<'a, const M: usize, const N: usize, const O: usize, const S: usize> Clone for SharedProfiles<'a, M, N, O, S>

Source§

fn clone(&self) -> SharedProfiles<'a, M, N, O, S>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a, const M: usize, const N: usize, const O: usize, const S: usize> Debug for SharedProfiles<'a, M, N, O, S>

Source§

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

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

impl<const M: usize, const N: usize, const O: usize, const S: usize> Eq for SharedProfiles<'_, M, N, O, S>

Source§

impl<const M: usize, const N: usize, const O: usize, const S: usize> Hash for SharedProfiles<'_, M, N, O, S>

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<const M: usize, const N: usize, const O: usize, const S: usize> PartialEq for SharedProfiles<'_, M, N, O, S>

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<'a, const M: usize, const N: usize, const O: usize, const S: usize> ProfileSets<'a, M, N, O, S> for SharedProfiles<'a, M, N, O, S>

Source§

fn get_i8(&self) -> &StripedProfile<'a, i8, M, S>

Gets or initializes StripedProfile with elements of i8 and M SIMD lanes and returns a reference to the field.
Source§

fn get_i16(&self) -> &StripedProfile<'a, i16, N, S>

Gets or initializes StripedProfile with elements of i16 and N SIMD lanes and returns a reference to the field.
Source§

fn get_i32(&self) -> &StripedProfile<'a, i32, O, S>

Gets or initializes StripedProfile with elements of i32 and O SIMD lanes and returns a reference to the field.
Source§

fn sequence(&self) -> &[u8]

Retrieves the sequence from which the profiles are built.
Source§

fn gap_open(&self) -> i8

Retrieves the gap open score being used.
Source§

fn gap_extend(&self) -> i8

Retrieves the gap extend score being used.
Source§

fn matrix(&self) -> &WeightMatrix<'a, i8, S>

Retrieves the weight matrix being used.
Source§

fn sw_score_from_i8<T>(&self, seq: &T) -> MaybeAligned<u32>
where T: AsRef<[u8]> + ?Sized,

Lazily execute StripedProfile::sw_score starting with the i8 profile. Read more
Source§

fn sw_score_from_i16<T>(&self, seq: &T) -> MaybeAligned<u32>
where T: AsRef<[u8]> + ?Sized,

Lazily execute StripedProfile::sw_score starting with the i16 profile, skipping the i8 profile. Read more
Source§

fn sw_score_from_i32<T>(&self, seq: &T) -> MaybeAligned<u32>
where T: AsRef<[u8]> + ?Sized,

Execute StripedProfile::sw_score with the i32 profile, skipping the i8 and i16 profiles. Read more
Source§

fn sw_align_from_i8<T>(&self, seq: SeqSrc<&T>) -> MaybeAligned<Alignment<u32>>
where T: AsRef<[u8]> + ?Sized,

Lazily execute StripedProfile::sw_align starting with the i8 profile. Read more
Source§

fn sw_align_from_i16<T>(&self, seq: SeqSrc<&T>) -> MaybeAligned<Alignment<u32>>
where T: AsRef<[u8]> + ?Sized,

Lazily execute StripedProfile::sw_align starting with the i16 profile, skipping the i8 profile. Read more
Source§

fn sw_align_from_i32<T>(&self, seq: SeqSrc<&T>) -> MaybeAligned<Alignment<u32>>
where T: AsRef<[u8]> + ?Sized,

Execute StripedProfile::sw_align with the i32 profile, skipping the i8 and i16 profiles. Read more
Source§

fn sw_align_from_i8_3pass<T>( &self, seq: SeqSrc<&T>, ) -> MaybeAligned<Alignment<u32>>
where T: AsRef<[u8]> + ?Sized,

Lazily executes a 3-pass version of Smith-Waterman local alignment, starting with an i8 profile. Read more
Source§

fn sw_align_from_i16_3pass<T>( &self, seq: SeqSrc<&T>, ) -> MaybeAligned<Alignment<u32>>
where T: AsRef<[u8]> + ?Sized,

Lazily executes a 3-pass version of Smith-Waterman local alignment, starting with an i16 profile. Read more
Source§

fn sw_align_from_i32_3pass<T>( &self, seq: SeqSrc<&T>, ) -> MaybeAligned<Alignment<u32>>
where T: AsRef<[u8]> + ?Sized,

Lazily executes a 3-pass version of Smith-Waterman local alignment using an i32 profile. Read more
Source§

fn sw_score_ranges_from_i8<T>( &self, seq: SeqSrc<&T>, ) -> MaybeAligned<ScoreAndRanges<u32>>
where T: AsRef<[u8]> + ?Sized,

Lazily execute StripedProfile::sw_score_ranges starting with the i8 profile. Read more
Source§

fn sw_score_ranges_from_i16<T>( &self, seq: SeqSrc<&T>, ) -> MaybeAligned<ScoreAndRanges<u32>>
where T: AsRef<[u8]> + ?Sized,

Lazily execute StripedProfile::sw_score_ranges starting with the i16 profile, skipping the i8 profile. Read more
Source§

fn sw_score_ranges_from_i32<T>( &self, seq: SeqSrc<&T>, ) -> MaybeAligned<ScoreAndRanges<u32>>
where T: AsRef<[u8]> + ?Sized,

Execute StripedProfile::sw_score_ranges with the i32 profile, skipping the i8 and i16 profiles. Read more
Source§

impl<const M: usize, const N: usize, const O: usize, const S: usize> SequenceReadable for SharedProfiles<'_, M, N, O, S>

Source§

fn sequence_bytes(&self) -> &[u8]

Get the sequence from the struct as a byte slice.

Auto Trait Implementations§

§

impl<'a, const M: usize, const N: usize, const O: usize, const S: usize> !Freeze for SharedProfiles<'a, M, N, O, S>

§

impl<'a, const M: usize, const N: usize, const O: usize, const S: usize> RefUnwindSafe for SharedProfiles<'a, M, N, O, S>

§

impl<'a, const M: usize, const N: usize, const O: usize, const S: usize> Send for SharedProfiles<'a, M, N, O, S>

§

impl<'a, const M: usize, const N: usize, const O: usize, const S: usize> Sync for SharedProfiles<'a, M, N, O, S>

§

impl<'a, const M: usize, const N: usize, const O: usize, const S: usize> Unpin for SharedProfiles<'a, M, N, O, S>

§

impl<'a, const M: usize, const N: usize, const O: usize, const S: usize> UnsafeUnpin for SharedProfiles<'a, M, N, O, S>

§

impl<'a, const M: usize, const N: usize, const O: usize, const S: usize> UnwindSafe for SharedProfiles<'a, M, N, O, S>

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, 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.