Struct bio::alignment::Alignment [] [src]

pub struct Alignment {
    pub score: i32,
    pub ystart: usize,
    pub xstart: usize,
    pub yend: usize,
    pub xend: usize,
    pub xlen: usize,
    pub operations: Vec<AlignmentOperation>,
}

An alignment, consisting of a score, the start and end position of the alignment on sequence x and sequence y, the length of sequence x, and the alignment edit operations (see alignment::pairwise for meaning of x and y).

Fields

Methods

impl Alignment
[src]

Calculate the cigar string.

Return the pretty formatted alignment as a String.

Example

use bio::alignment::pairwise::*;

let x = b"CCGTCCGGCAA";
let y = b"AAAAACCGTTGACGCAA";
let score = |a: u8, b: u8| if a == b {1i32} else {-1i32};

// ------CCGTCCGGCAA
//       |  |   ||||
// AAAAACCGTTGACGCAA
let mut aligner = Aligner::with_capacity(x.len(), y.len(), -5, -1, &score);
let alignment = aligner.semiglobal(x, y);
println!("Semiglobal: \n{}\n", alignment.pretty(x, y));

// -----CCGTCCGGCAA-
//      ||||
// AAAAACCGTTGACGCAA
let alignment = aligner.local(x, y);
println!("Local: \n{}\n", alignment.pretty(x, y));

// ------CCGTCCGGCAA
//       |  |   ||||
// AAAAACCGTTGACGCAA
let alignment = aligner.global(x, y);
println!("Global: \n{}\n", alignment.pretty(x, y));

Trait Implementations

impl Debug for Alignment
[src]

Formats the value using the given formatter.