Skip to main content

PeConstraints

Struct PeConstraints 

Source
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: u32

Minimum fragment/insert size (outer distance between mates)

§max_insert: u32

Maximum fragment/insert size

§policy: PePolicy

Orientation policy

§allow_overlap: bool

Whether to allow overlapping mates

§allow_dovetail: bool

Whether to allow dovetailing (one mate extends past the other)

§allow_contain: bool

Whether to allow one mate containing the other

Implementations§

Source§

impl PeConstraints

Source

pub fn new(min_insert: u32, max_insert: u32, policy: PePolicy) -> Self

Create new paired-end constraints

Source

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 1
  • strand1 - Strand of mate 1 (true = forward, false = reverse)
  • chr1 - Chromosome of mate 1
  • pos2 - Position of mate 2 (0-based)
  • len2 - Length of mate 2
  • strand2 - Strand of mate 2
  • chr2 - Chromosome of mate 2
§Returns

Some(insert_size) if concordant, None if discordant

Source

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 mate
  • anchor_is_r1 - True if anchor is read 1, false if read 2
  • anchor_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

Source§

fn clone(&self) -> PeConstraints

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PeConstraints

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PeConstraints

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Copy for PeConstraints

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.