Struct smith_waterman::SmithWaterman
[−]
[src]
pub struct SmithWaterman { pub genome_sequence: Vec<char>, pub read_sequence: Vec<char>, pub matrix: DMat<isize>, pub matched: isize, pub missed: isize, }
The SmithWaterman
struct
genome_sequence: String
read_sequence: String
matrix: DMat
Fields
genome_sequence | Genome |
read_sequence | Compared Genome |
matrix | Matrix used to store data |
matched | |
missed |
Methods
impl SmithWaterman
fn new(genome_sequence: String, read_sequence: String) -> SmithWaterman
Constructs a new SmithWaterman
.
Examples
use smith_waterman; let mut smitty = smith_waterman::SmithWaterman::new("ab".to_string(), "cb".to_string());
fn new_chars(genome_sequence: Vec<char>, read_sequence: Vec<char>) -> SmithWaterman
Constructs a new SmithWaterman
.
Examples
use smith_waterman; let mut smitty = smith_waterman::SmithWaterman::new_chars("ab".chars().collect(), "cb".chars().collect());
fn align(&mut self) -> (String, String)
Runs the matrix to obtain the optimum local alignment. Uses the set_matrix_loops function. returns a tuple of strings. The fist is the genome sequence the second is the read sequence. Faster in smaller sets: https://gist.github.com/sbeckeriv/d9d2c03b19178a888c32
Examples
let mut smitty = smith_waterman::SmithWaterman::new("ab".to_string(), "cb".to_string()); let alignment = smitty.align();
fn align_fn(&mut self) -> (String, String)
Runs the matrix to obtain the optimum local alignment. Uses the set_matrix_fn function. returns a tuple of strings. The fist is the genome sequence the second is the read sequence.
In benchmarks this function can be 2x faster. Tested with a 70k and 7k string.
Examples
let mut smitty = smith_waterman::SmithWaterman::new("ab".to_string(), "cb".to_string()); let alignment = smitty.align_fn();
fn set_matrix_fn(&mut self) -> (usize, usize)
Fills the matrix with values.
This uses a single loop and calculates the correct col and row on the fly.
returns a tuple of usize. The fist is the row and the second is the column of the largest
value in the matrix.
This value can also be calculated out from smitty.matrix
In benchmarks this function can be 2x faster. Tested with a 70k and 7k string.
Examples
let mut smitty = smith_waterman::SmithWaterman::new("ab".to_string(), "cb".to_string()); let max_point = smitty.set_matrix_fn();
fn set_matrix_loops(&mut self) -> (usize, usize)
Fills the matrix with values. This uses a naïve double loop to fill the matrix.
returns a tuple of usize. The fist is the row and the second is the column of the largest
value in the matrix.
This value can also be calculated out from smitty.matrix
Faster in smaller sets: https://gist.github.com/sbeckeriv/d9d2c03b19178a888c32
Examples
let mut smitty = smith_waterman::SmithWaterman::new("ab".to_string(), "cb".to_string()); let max_point = smitty.set_matrix_loops();