pub struct AlignAlgorithm {
pub name: String,
pub gap_open: i32,
pub gap_extend: i32,
pub mismatch_score: i32,
pub match_score: i32,
pub mode: AlignMode,
pub backend: AlignBackend,
}Expand description
Contains parameters to run the alignment algorithm with
Fields§
§name: StringA name for displaying the algorithm in settings etc.
gap_open: i32The penalty for opening a gap (negative)
gap_extend: i32The penalty for extending a gap by one character (negative)
mismatch_score: i32The penalty for a mismatch (negative)
match_score: i32The score for a match (non-negative)
mode: AlignModeWhether to align globally, semiglobally or blockwise
backend: AlignBackendThe backend used for alignment
Implementations§
Source§impl AlignAlgorithm
impl AlignAlgorithm
Sourcepub fn check_parameters(&self, filesizes: [usize; 2]) -> CheckStatus
pub fn check_parameters(&self, filesizes: [usize; 2]) -> CheckStatus
Checks whether aligning the files could use a lot of memory whether the backend is available, and whether the parameters are valid. The filesizes are the sizes of the two files to be aligned, or zero if they are not known.
Sourcepub fn default_semiglobal() -> Self
pub fn default_semiglobal() -> Self
The normal default() implementation gives the default global algorithm. This one gives the default semiglobal algorithm.
Sourcepub fn align_whole<FileContent: AsRef<[u8]>>(
&self,
files: [Arc<FileContent>; 2],
) -> Vec<AlignElement>
pub fn align_whole<FileContent: AsRef<[u8]>>( &self, files: [Arc<FileContent>; 2], ) -> Vec<AlignElement>
Aligns x to y as a whole, starting at address 0 in both files.
Sourcepub fn start_align<FileContent: AsRef<[u8]> + Send + Sync + 'static>(
&self,
files: [Arc<FileContent>; 2],
addr: [usize; 2],
sender: impl FnMut(AlignedMessage) -> bool + Clone + Send + 'static,
)
pub fn start_align<FileContent: AsRef<[u8]> + Send + Sync + 'static>( &self, files: [Arc<FileContent>; 2], addr: [usize; 2], sender: impl FnMut(AlignedMessage) -> bool + Clone + Send + 'static, )
This function starts the threads for the alignment, which send the data over the sender.
It should then immediately return.
Cannot be used for semiglobal alignment.
sender should return false if the alignment should be stopped.
Sourcepub fn align_initial_block<FileContent: AsRef<[u8]> + Send + Sync>(
&self,
files: [Arc<FileContent>; 2],
addresses: [usize; 2],
sender: impl FnMut(AlignedMessage) -> bool + Clone + Send,
)
pub fn align_initial_block<FileContent: AsRef<[u8]> + Send + Sync>( &self, files: [Arc<FileContent>; 2], addresses: [usize; 2], sender: impl FnMut(AlignedMessage) -> bool + Clone + Send, )
Aligns the initial block centered around the given addresses, then aligns the rest of the files in both directions.
sender should return false if the alignment should be stopped.
Sourcepub fn align_end(
&self,
files: [&[u8]; 2],
start_addresses: [usize; 2],
sender: impl FnMut(AlignedMessage) -> bool,
)
pub fn align_end( &self, files: [&[u8]; 2], start_addresses: [usize; 2], sender: impl FnMut(AlignedMessage) -> bool, )
Blockwise alignment in the ascending address direction.
Sourcepub fn align_front(
&self,
files: [&[u8]; 2],
end_addresses: [usize; 2],
sender: impl FnMut(AlignedMessage) -> bool,
)
pub fn align_front( &self, files: [&[u8]; 2], end_addresses: [usize; 2], sender: impl FnMut(AlignedMessage) -> bool, )
Blockwise alignment in the descending address direction.
Trait Implementations§
Source§impl Clone for AlignAlgorithm
impl Clone for AlignAlgorithm
Source§fn clone(&self) -> AlignAlgorithm
fn clone(&self) -> AlignAlgorithm
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AlignAlgorithm
impl Debug for AlignAlgorithm
Source§impl Default for AlignAlgorithm
impl Default for AlignAlgorithm
Source§impl<'de> Deserialize<'de> for AlignAlgorithmwhere
AlignAlgorithm: Default,
impl<'de> Deserialize<'de> for AlignAlgorithmwhere
AlignAlgorithm: Default,
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>,
Auto Trait Implementations§
impl Freeze for AlignAlgorithm
impl RefUnwindSafe for AlignAlgorithm
impl Send for AlignAlgorithm
impl Sync for AlignAlgorithm
impl Unpin for AlignAlgorithm
impl UnwindSafe for AlignAlgorithm
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> 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 moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.