pub struct Table<'a> { /* private fields */ }Expand description
A view into a score table from an alignment result.
§Layout
- Rows represent positions in the query sequence (0..query_len)
- Columns represent positions in the reference sequence (0..ref_len)
- Data is stored as a flattened 1D array:
data[row * cols + col]
§Example
use parasail_rs::prelude::Aligner;
let query = b"ACGT";
let reference = b"ACGT";
let aligner = Aligner::new().use_table().build();
let result = aligner.align(Some(query), reference)?;
let table = result.get_score_table()?;
println!("Table dimensions: {} rows x {} cols", table.rows(), table.cols());
// Access specific cell
if let Some(score) = table.get(0, 0) {
println!("Score at (0, 0): {}", score);
}
// Get final alignment score
println!("Final score: {}", table.last());Implementations§
Source§impl<'a> Table<'a>
impl<'a> Table<'a>
Sourcepub fn get(&self, row: usize, col: usize) -> Option<i32>
pub fn get(&self, row: usize, col: usize) -> Option<i32>
Get the value at the given row and column index.
Returns None if indices are out of bounds.
§Example
let table = result.get_score_table()?;
if let Some(score) = table.get(2, 3) {
println!("Score at (2, 3): {}", score);
}Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Table<'a>
impl<'a> RefUnwindSafe for Table<'a>
impl<'a> Send for Table<'a>
impl<'a> Sync for Table<'a>
impl<'a> Unpin for Table<'a>
impl<'a> UnsafeUnpin for Table<'a>
impl<'a> UnwindSafe for Table<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more