pub struct Alignment<A, B> { /* private fields */ }Expand description
An alignment of two reads. It has either a reference to the two sequences to prevent overzealous use of memory, or if needed use Self::to_owned to get a variant that clones the sequences and so can be used in more places.
Implementations§
Source§impl<'lifetime, A, B> Alignment<&'lifetime A, &'lifetime B>
impl<'lifetime, A, B> Alignment<&'lifetime A, &'lifetime B>
Sourcepub fn create_from_path(
seq_a: &'lifetime A,
seq_b: &'lifetime B,
start_a: usize,
start_b: usize,
path: &str,
scoring: AlignScoring<'_>,
align_type: AlignType,
maximal_step: u16,
) -> Option<Self>
pub fn create_from_path( seq_a: &'lifetime A, seq_b: &'lifetime B, start_a: usize, start_b: usize, path: &str, scoring: AlignScoring<'_>, align_type: AlignType, maximal_step: u16, ) -> Option<Self>
Recreate an alignment from a path, the path is Self::short.
Source§impl<A, B> Alignment<A, B>
impl<A, B> Alignment<A, B>
Sourcepub const fn normalised_score(&self) -> f64
pub const fn normalised_score(&self) -> f64
The normalised score, normalised for the alignment length and for the used alphabet.
The normalisation is calculated as follows absolute_score / max_score.
Sourcepub const fn start(&self) -> (usize, usize)
pub const fn start(&self) -> (usize, usize)
The position in the sequences where the alignment starts (a, b)
Sourcepub const fn start_a(&self) -> usize
pub const fn start_a(&self) -> usize
The position in the first sequence where the alignment starts
Sourcepub const fn start_b(&self) -> usize
pub const fn start_b(&self) -> usize
The position in the second sequence where the alignment starts
Sourcepub const fn align_type(&self) -> AlignType
pub const fn align_type(&self) -> AlignType
The alignment type
Source§impl<A: HasPeptidoform<Linear>, B: HasPeptidoform<Linear>> Alignment<A, B>
impl<A: HasPeptidoform<Linear>, B: HasPeptidoform<Linear>> Alignment<A, B>
Sourcepub fn mass_a(&self) -> Multi<MolecularFormula>
pub fn mass_a(&self) -> Multi<MolecularFormula>
The mass(es) for the matched portion of the first sequence TODO: this assumes no terminal mods
Sourcepub fn mass_b(&self) -> Multi<MolecularFormula>
pub fn mass_b(&self) -> Multi<MolecularFormula>
The mass(es) for the matched portion of the second sequence
Sourcepub fn mass_difference(&self) -> Mass
pub fn mass_difference(&self) -> Mass
Get the mass delta for this match, if it is a (partial) local match it will only take the matched amino acids into account. If there are multiple possible masses for any of the stretches it returns the smallest difference.
Sourcepub fn ppm(&self) -> Ratio
pub fn ppm(&self) -> Ratio
Get the error in ppm for this match, if it is a (partial) local match it will only take the matched amino acids into account. If there are multiple possible masses for any of the stretches it returns the smallest difference.
Sourcepub fn short(&self) -> String
pub fn short(&self) -> String
Get a short representation of the alignment in CIGAR like format.
It has three additional classes {a}(:{b})?(r|i) and {a}m denoting any special step with the given a and b step size, if b is not given it is the same as a.
r is rotation, i is isobaric, and m is identity but mass mismatch (modification).
Trait Implementations§
Source§impl<'de, A, B> Deserialize<'de> for Alignment<A, B>where
A: Deserialize<'de>,
B: Deserialize<'de>,
impl<'de, A, B> Deserialize<'de> for Alignment<A, B>where
A: Deserialize<'de>,
B: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<A: Eq, B: Eq> Ord for Alignment<A, B>
impl<A: Eq, B: Eq> Ord for Alignment<A, B>
Source§impl<A: Eq, B: Eq> PartialOrd for Alignment<A, B>
impl<A: Eq, B: Eq> PartialOrd for Alignment<A, B>
impl<A: PartialEq + Eq, B: PartialEq + Eq> Eq for Alignment<A, B>
Auto Trait Implementations§
impl<A, B> Freeze for Alignment<A, B>
impl<A, B> RefUnwindSafe for Alignment<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for Alignment<A, B>
impl<A, B> Sync for Alignment<A, B>
impl<A, B> Unpin for Alignment<A, B>
impl<A, B> UnwindSafe for Alignment<A, B>where
A: UnwindSafe,
B: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> HighestOf<T> for T
impl<T> HighestOf<T> for T
Source§type HighestLevel = T
type HighestLevel = T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more