pub struct PeConstraints {
pub min_insert: u32,
pub max_insert: u32,
pub policy: PePolicy,
pub allow_overlap: bool,
pub allow_dovetail: bool,
pub allow_contain: bool,
}Expand description
Paired-end constraints
Defines the constraints for valid paired-end alignments.
Fields§
§min_insert: u32Minimum fragment/insert size (outer distance between mates)
max_insert: u32Maximum fragment/insert size
policy: PePolicyOrientation policy
allow_overlap: boolWhether to allow overlapping mates
allow_dovetail: boolWhether to allow dovetailing (one mate extends past the other)
allow_contain: boolWhether to allow one mate containing the other
Implementations§
Source§impl PeConstraints
impl PeConstraints
Sourcepub fn new(min_insert: u32, max_insert: u32, policy: PePolicy) -> Self
pub fn new(min_insert: u32, max_insert: u32, policy: PePolicy) -> Self
Create new paired-end constraints
Sourcepub fn is_concordant(
&self,
pos1: u64,
len1: u32,
strand1: bool,
chr1: u32,
pos2: u64,
len2: u32,
strand2: bool,
chr2: u32,
) -> Option<i32>
pub fn is_concordant( &self, pos1: u64, len1: u32, strand1: bool, chr1: u32, pos2: u64, len2: u32, strand2: bool, chr2: u32, ) -> Option<i32>
Check if a pair of alignments is concordant (properly paired)
§Arguments
pos1- Position of mate 1 (0-based)len1- Length of mate 1strand1- Strand of mate 1 (true = forward, false = reverse)chr1- Chromosome of mate 1pos2- Position of mate 2 (0-based)len2- Length of mate 2strand2- Strand of mate 2chr2- Chromosome of mate 2
§Returns
Some(insert_size) if concordant, None if discordant
Sourcepub fn mate_search_range(
&self,
anchor_pos: u64,
anchor_len: u32,
anchor_is_r1: bool,
anchor_strand: bool,
) -> (u64, u64, bool)
pub fn mate_search_range( &self, anchor_pos: u64, anchor_len: u32, anchor_is_r1: bool, anchor_strand: bool, ) -> (u64, u64, bool)
Calculate the expected position range for the opposite mate
Given an anchor alignment, calculate where the opposite mate should align based on insert size constraints.
§Arguments
anchor_pos- Position of the anchor mate (0-based)anchor_len- Length of the anchor mateanchor_is_r1- True if anchor is read 1, false if read 2anchor_strand- True if anchor is forward strand
§Returns
(start_pos, end_pos, expected_strand) for the opposite mate search
Trait Implementations§
Source§impl Clone for PeConstraints
impl Clone for PeConstraints
Source§fn clone(&self) -> PeConstraints
fn clone(&self) -> PeConstraints
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PeConstraints
impl Debug for PeConstraints
Source§impl Default for PeConstraints
impl Default for PeConstraints
impl Copy for PeConstraints
Auto Trait Implementations§
impl Freeze for PeConstraints
impl RefUnwindSafe for PeConstraints
impl Send for PeConstraints
impl Sync for PeConstraints
impl Unpin for PeConstraints
impl UnsafeUnpin for PeConstraints
impl UnwindSafe for PeConstraints
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