[−][src]Struct bio_types::alignment::Alignment
We consider alignment between two sequences x and y. x is the query or read sequence and y is the reference or template sequence. An alignment, consisting of a score, the start and end position of the alignment on sequence x and sequence y, the lengths of sequences x and y, and the alignment edit operations. The start position and end position of the alignment does not include the clipped regions. The length of clipped regions are already encapsulated in the Alignment Operation.
Fields
score: i32
Smith-Waterman alignment score
ystart: usize
Start position of alignment in reference
xstart: usize
Start position of alignment in query
yend: usize
End position of alignment in reference
xend: usize
End position of alignment in query
ylen: usize
Length of the reference sequence
xlen: usize
Length of the query sequence
operations: Vec<AlignmentOperation>
Vector of alignment operations
mode: AlignmentMode
Methods
impl Alignment
[src]
pub fn cigar(&self, hard_clip: bool) -> String
[src]
Calculate the cigar string from the alignment struct. x is the target string
Example
use bio_types::alignment::{Alignment,AlignmentMode}; use bio_types::alignment::AlignmentOperation::{Match, Subst, Ins, Del}; let alignment = Alignment { score: 5, xstart: 3, ystart: 0, xend: 9, yend: 10, ylen: 10, xlen: 10, operations: vec![Match, Match, Match, Subst, Ins, Ins, Del, Del], mode: AlignmentMode::Semiglobal }; assert_eq!(alignment.cigar(false), "3S3=1X2I2D1S");
pub fn pretty(&self, x: TextSlice, y: TextSlice) -> String
[src]
Return the pretty formatted alignment as a String. The string contains sets of 3 lines of length 100. First line is for the sequence x, second line is for the alignment operation and the the third line is for the sequence y. A '-' in the sequence indicates a blank (insertion/deletion). The operations follow the following convention: '|' for a match, '' for a mismatch, '+' for an insertion, 'x' for a deletion and ' ' for clipping
Example
If we align the strings "CCGTCCGGCAAGGG" and "AAAAACCGTTGACGGCCAA" in various modes, we will get the following output:
Semiglobal:
CCGTCCGGCAAGGG
||||++++\\|\||
AAAAACCGT----TGACGGCCAA
Local:
CCGTCCGGCAAGGG
||||
AAAAACCGT TGACGGCCAA
Global:
-----CCGT--CCGGCAAGGG
xxxxx||||xx\||||\|++\
AAAAACCGTTGACGGCCA--A
pub fn path(&self) -> Vec<(usize, usize, AlignmentOperation)>
[src]
Returns the optimal path in the alignment matrix
pub fn filter_clip_operations(&mut self)
[src]
Filter out Xclip and Yclip operations from the list of operations. Useful when invoking the standard modes.
pub fn y_aln_len(&self) -> usize
[src]
Number of bases in reference sequence that are aligned
pub fn x_aln_len(&self) -> usize
[src]
Number of bases in query sequence that are aigned
Trait Implementations
impl Clone for Alignment
[src]
fn clone(&self) -> Alignment
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for Alignment
[src]
impl Default for Alignment
[src]
impl PartialEq<Alignment> for Alignment
[src]
impl Debug for Alignment
[src]
impl Serialize for Alignment
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for Alignment
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,