/// Calculate semiglobal alignment of x against y (x is global, y is local).
/// This function accepts the hash map of the kmers of y. This is useful
/// in cases where we are interested in repeated alignment of different
/// queries against the same reference. The user can precompute the HashMap
/// using sparse::hash_kmers and invoke this function to speed up the
/// alignment computation.
Calculate semiglobal alignment of x against y (x is global, y is local).
This function accepts the hash map of the kmers of y. This is useful
in cases where we are interested in repeated alignment of different
queries against the same reference. The user can precompute the HashMap
using sparse::hash_kmers and invoke this function to speed up the
alignment computation.
Calculate semiglobal alignment of x against y ( x is global y is local ) . This function accepts the hash map of the kmers of y . This is useful in cases where we are interested in repeated alignment of different queries against the same reference . The user can precompute the HashMap using sparse :: hash_kmers and invoke this function to speed up the alignment computation .
pub fn semiglobal_with_prehash(
        &mut self,
        x: TextSlice<'_>,
        y: TextSlice<'_>,
        y_kmer_hash: &HashMapFx<&[u8], Vec<u32>>,
    ) -> Alignment {
        // Store the current clip penalties
        let clip_penalties = [
            self.scoring.xclip_prefix,
            self.scoring.xclip_suffix,
            self.scoring.yclip_prefix,
            self.scoring.yclip_suffix,
        ];
        // Temporarily Over-write the clip penalties
        self.scoring.xclip_prefix = MIN_SCORE;
        self.scoring.xclip_suffix = MIN_SCORE;
        self.scoring.yclip_prefix = 0;
        self.scoring.yclip_suffix = 0;
        // Compute the alignment
        let mut alignment = self.custom_with_prehash(x, y, y_kmer_hash);
        alignment.mode = AlignmentMode::Semiglobal;
        // Filter out Xclip and Yclip from alignment.operations
        alignment.filter_clip_operations();
        // Set the clip penalties to the original values
        self.scoring.xclip_prefix = clip_penalties[0];
        self.scoring.xclip_suffix = clip_penalties[1];
        self.scoring.yclip_prefix = clip_penalties[2];
        self.scoring.yclip_suffix = clip_penalties[3];
        alignment
    }
pub fn semiglobal_with_prehash ( & mut self , x : TextSlice < ' _ > , y : TextSlice < ' _ > , y_kmer_hash : & HashMapFx < & [ u8 ] , Vec < u32 > > , ) -> Alignment { // Store the current clip penalties let clip_penalties = [ self . scoring . xclip_prefix , self . scoring . xclip_suffix , self . scoring . yclip_prefix , self . scoring . yclip_suffix , ] ; // Temporarily Over-write the clip penalties self . scoring . xclip_prefix = MIN_SCORE ; self . scoring . xclip_suffix = MIN_SCORE ; self . scoring . yclip_prefix = 0 ; self . scoring . yclip_suffix = 0 ; // Compute the alignment let mut alignment = self . custom_with_prehash ( x , y , y_kmer_hash ) ; alignment . mode = AlignmentMode :: Semiglobal ; // Filter out Xclip and Yclip from alignment.operations alignment . filter_clip_operations ( ) ; // Set the clip penalties to the original values self . scoring . xclip_prefix = clip_penalties [ 0 ] ; self . scoring . xclip_suffix = clip_penalties [ 1 ] ; self . scoring . yclip_prefix = clip_penalties [ 2 ] ; self . scoring . yclip_suffix = clip_penalties [ 3 ] ; alignment }
Calculate semiglobal alignment of x against y (x is global, y is local).
Calculate semiglobal alignment of x against y ( x is global y is local ) .
&mut self
x
TextSlice<'_>
y
TextSlice<'_>
y_kmer_hash
&HashMapFx<&[u8], Vec<u32>>