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, theWeightMatrix, and the alphabet (ByteIndexMap). An owned sequence can also be stored.M: The number of SIMD lanes fori8profilesN: The number of SIMD lanes fori16profilesO: The number of SIMD lanes fori32profilesS: The size of the alphabet (usually 5 for DNA including N)
Implementations§
Sourcepub fn new(
seq: impl Into<Cow<'a, [u8]>>,
matrix: &'a WeightMatrix<'a, i8, S>,
gap_open: i8,
gap_extend: i8,
) -> Result<Self, ProfileError>
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
ProfileError::EmptySequenceifseqis emptyProfileError::GapOpenOutOfRangeifgap_openis not between -127 and 0, inclusiveProfileError::GapExtendOutOfRangeifgap_extendis not between -127 and 0, inclusiveProfileError::BadGapWeightsifgap_extendis less thangap_open
Sourcepub 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>
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.
Sourcepub 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>
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.
Sourcepub 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>
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§fn clone(&self) -> SharedProfiles<'a, M, N, O, S>
fn clone(&self) -> SharedProfiles<'a, M, N, O, S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§fn get_i8(&self) -> &StripedProfile<'a, i8, M, S>
fn get_i8(&self) -> &StripedProfile<'a, i8, M, S>
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>
fn get_i16(&self) -> &StripedProfile<'a, i16, N, S>
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>
fn get_i32(&self) -> &StripedProfile<'a, i32, O, S>
StripedProfile with elements of i32 and O
SIMD lanes and returns a reference to the field.Source§fn gap_extend(&self) -> i8
fn gap_extend(&self) -> i8
Source§fn matrix(&self) -> &WeightMatrix<'a, i8, S>
fn matrix(&self) -> &WeightMatrix<'a, i8, S>
Source§fn sw_score_from_i8<T>(&self, seq: &T) -> MaybeAligned<u32>
fn sw_score_from_i8<T>(&self, seq: &T) -> MaybeAligned<u32>
Source§fn sw_score_from_i16<T>(&self, seq: &T) -> MaybeAligned<u32>
fn sw_score_from_i16<T>(&self, seq: &T) -> MaybeAligned<u32>
StripedProfile::sw_score starting with
the i16 profile, skipping the i8 profile. Read moreSource§fn sw_score_from_i32<T>(&self, seq: &T) -> MaybeAligned<u32>
fn sw_score_from_i32<T>(&self, seq: &T) -> MaybeAligned<u32>
Source§fn sw_align_from_i8<T>(&self, seq: SeqSrc<&T>) -> MaybeAligned<Alignment<u32>>
fn sw_align_from_i8<T>(&self, seq: SeqSrc<&T>) -> MaybeAligned<Alignment<u32>>
Source§fn sw_align_from_i16<T>(&self, seq: SeqSrc<&T>) -> MaybeAligned<Alignment<u32>>
fn sw_align_from_i16<T>(&self, seq: SeqSrc<&T>) -> MaybeAligned<Alignment<u32>>
StripedProfile::sw_align starting
with the i16 profile, skipping the i8 profile. Read moreSource§fn sw_align_from_i32<T>(&self, seq: SeqSrc<&T>) -> MaybeAligned<Alignment<u32>>
fn sw_align_from_i32<T>(&self, seq: SeqSrc<&T>) -> MaybeAligned<Alignment<u32>>
Source§fn sw_align_from_i8_3pass<T>(
&self,
seq: SeqSrc<&T>,
) -> MaybeAligned<Alignment<u32>>
fn sw_align_from_i8_3pass<T>( &self, seq: SeqSrc<&T>, ) -> MaybeAligned<Alignment<u32>>
i8 profile. Read moreSource§fn sw_align_from_i16_3pass<T>(
&self,
seq: SeqSrc<&T>,
) -> MaybeAligned<Alignment<u32>>
fn sw_align_from_i16_3pass<T>( &self, seq: SeqSrc<&T>, ) -> MaybeAligned<Alignment<u32>>
i16 profile. Read moreSource§fn sw_align_from_i32_3pass<T>(
&self,
seq: SeqSrc<&T>,
) -> MaybeAligned<Alignment<u32>>
fn sw_align_from_i32_3pass<T>( &self, seq: SeqSrc<&T>, ) -> MaybeAligned<Alignment<u32>>
i32 profile. Read moreSource§fn sw_score_ranges_from_i8<T>(
&self,
seq: SeqSrc<&T>,
) -> MaybeAligned<ScoreAndRanges<u32>>
fn sw_score_ranges_from_i8<T>( &self, seq: SeqSrc<&T>, ) -> MaybeAligned<ScoreAndRanges<u32>>
Source§fn sw_score_ranges_from_i16<T>(
&self,
seq: SeqSrc<&T>,
) -> MaybeAligned<ScoreAndRanges<u32>>
fn sw_score_ranges_from_i16<T>( &self, seq: SeqSrc<&T>, ) -> MaybeAligned<ScoreAndRanges<u32>>
StripedProfile::sw_score_ranges starting
with the i16 profile, skipping the i8 profile. Read moreSource§fn sw_score_ranges_from_i32<T>(
&self,
seq: SeqSrc<&T>,
) -> MaybeAligned<ScoreAndRanges<u32>>
fn sw_score_ranges_from_i32<T>( &self, seq: SeqSrc<&T>, ) -> MaybeAligned<ScoreAndRanges<u32>>
StripedProfile::sw_score_ranges with the i32
profile, skipping the i8 and i16 profiles. Read more