diff --git a/lightmotif/src/pli/platform/avx2.rs b/lightmotif/src/pli/platform/avx2.rs index 4baa3d89fb13f1d18793226043386456d6b57136..7fddb079cf81dceec27846ddebe3425564b1848a 100644 --- a/lightmotif/src/pli/platform/avx2.rs +++ b/lightmotif/src/pli/platform/avx2.rs @@ -151,7 +151,7 @@ unsafe fn score_avx2_permute<A>( let x3 = _mm256_shuffle_epi8(x, m3); let x4 = _mm256_shuffle_epi8(x, m4); // load row for current weight matrix position - let t = _mm256_load_ps(pssmptr); + let t = _mm256_loadu_ps(pssmptr); // index A/T/G/C/N lookup table with the bases let b1 = _mm256_permutevar8x32_ps(t, x1); let b2 = _mm256_permutevar8x32_ps(t, x2); diff --git a/lightmotif/src/pwm.rs b/lightmotif/src/pwm.rs index a56cabb7d1fbf68fe956be36977c8bdec1512c8b..b1f6fc1f6f33e4627929f1c56bfabda97336cb8d 100644 --- a/lightmotif/src/pwm.rs +++ b/lightmotif/src/pwm.rs @@ -93,6 +93,12 @@ impl<A: Alphabet> CountMatrix<A> { // } } + /// The length of the motif encoded in this count matrix. + #[inline] + pub const fn len(&self) -> usize { + self.data.rows() + } + /// Create a new count matrix from the given sequences. /// /// # Errors @@ -233,6 +239,12 @@ impl<A: Alphabet> FrequencyMatrix<A> { } } + /// The length of the motif encoded in this frequency matrix. + #[inline] + pub const fn len(&self) -> usize { + self.data.rows() + } + /// Create a new frequency matrix. /// /// The matrix must contain frequency data, i.e. rows should all sum to 1 @@ -331,7 +343,7 @@ impl<A: Alphabet> WeightMatrix<A> { /// The length of the motif encoded in this weight matrix. #[inline] - pub fn len(&self) -> usize { + pub const fn len(&self) -> usize { self.data.rows() } @@ -445,7 +457,7 @@ impl<A: Alphabet> ScoringMatrix<A> { /// The length of the motif encoded in this scoring matrix. #[inline] - pub fn len(&self) -> usize { + pub const fn len(&self) -> usize { self.data.rows() }