pub struct Mapping { /* private fields */ }Expand description
An alignment between a substring of a query sequence and a single node using a single edit operation.
This can also represent unaligned insertions.
Implementations§
Source§impl Mapping
impl Mapping
Sourcepub fn new(
seq_offset: usize,
handle: usize,
node_len: usize,
node_offset: usize,
edit: Difference,
) -> Self
pub fn new( seq_offset: usize, handle: usize, node_len: usize, node_offset: usize, edit: Difference, ) -> Self
Creates a new mapping starting at the given position.
§Panics
Will panic if the edit extends past the end of the node.
Will panic if handle is gbz::ENDMARKER.
Sourcepub fn unaligned(seq_offset: usize, edit: Difference) -> Self
pub fn unaligned(seq_offset: usize, edit: Difference) -> Self
Sourcepub fn seq_interval(&self) -> &Range<usize>
pub fn seq_interval(&self) -> &Range<usize>
Returns the aligned interval of the query sequence.
Sourcepub fn handle(&self) -> usize
pub fn handle(&self) -> usize
Returns the handle of the target node.
Returns gbz::ENDMARKER for an unaligned insertion.
Sourcepub fn is_unaligned(&self) -> bool
pub fn is_unaligned(&self) -> bool
Returns true if this mapping is an unaligned insertion.
Sourcepub fn node_interval(&self) -> &Range<usize>
pub fn node_interval(&self) -> &Range<usize>
Returns the aligned interval of the target node.
Sourcepub fn target_len(&self) -> usize
pub fn target_len(&self) -> usize
Returns the length of the target interval.
Sourcepub fn edit(&self) -> &Difference
pub fn edit(&self) -> &Difference
Returns the edit operation.
Sourcepub fn follows(&self, other: &Self) -> bool
pub fn follows(&self, other: &Self) -> bool
Returns true this mapping follows the given one in the same node.
Sourcepub fn is_at_start(&self) -> bool
pub fn is_at_start(&self) -> bool
Returns true if this mapping is at the start of the target node.
Trait Implementations§
impl Eq for Mapping
impl StructuralPartialEq for Mapping
Auto Trait Implementations§
impl Freeze for Mapping
impl RefUnwindSafe for Mapping
impl Send for Mapping
impl Sync for Mapping
impl Unpin for Mapping
impl UnsafeUnpin for Mapping
impl UnwindSafe for Mapping
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