[][src]Function seqalign::needleman_wunsch

pub fn needleman_wunsch(x: &str, y: &str) -> u16

Performs global sequence alignment of two &str using the Needleman-Wunsch classic algorithm. The returning value is the distances between the 2 samples, computed considering a MATCH a value of distance 0, a GAP distance of 2 and a MISMATCH distance of 1.

Examples

    let s = String::from("HELLO");
    let s1 = String::from("HHELLO");
 
    let result = needleman_wunsch(&s, &s1); // The alignment would produce
                                            // the sequences 'HHELLO' and '-HELLO'.
                                            // so result is equal to 0*5 + 2