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
score: i32
ystart: usize
xstart: usize
yend: usize
xend: usize
xlen: usize
operations: Vec<AlignmentOperation>
Methods
impl Alignment
[src]
fn cigar(&self, hard_clip: bool) -> String
Calculate the cigar string.
fn pretty(&self, x: TextSlice, y: TextSlice) -> 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));