Skip to main content

BamConfig

Struct BamConfig 

Source
pub struct BamConfig {
    pub min_mapq: u8,
    pub include_secondary: bool,
    pub include_supplementary: bool,
    pub partial: bool,
    pub min_partial_coverage: f64,
    pub min_region_quality: f64,
}
Expand description

Filter and extraction settings for BAM reads.

This is the library equivalent of the CLI Opts fields that affect BAM extraction. Construct with BamConfig::default for permissive defaults (no filters, spanning reads only), then override individual fields as needed.

Fields§

§min_mapq: u8

Minimum mapping quality (MAPQ) a read must have to be included. Reads whose MAPQ is below this threshold are skipped. Default: 0 (no filter).

§include_secondary: bool

Whether to include secondary alignments (SAM flag 0x100). Default: false (secondary alignments are skipped).

§include_supplementary: bool

Whether to include supplementary alignments (SAM flag 0x800). Default: false (supplementary alignments are skipped).

§partial: bool

Whether to include reads that only partially overlap the BED region. When false (the default), only reads whose alignment spans the entire region — from region_start to region_end — are returned. When true, reads that overlap any part of the region are included; the extracted subsequence is clipped to whatever portion the read covers.

§min_partial_coverage: f64

Minimum fraction (0.0-1.0) of the requested (region ± flanks) window a partial read must cover to be included. Reads/alignments below this threshold are discarded, similar to liftOver’s -minMatch. Default: 0.0 (no filter — any overlap is accepted). Only meaningful when partial is true; non-partial reads always cover the full window by construction, so this is a no-op otherwise.

§min_region_quality: f64

Minimum mean Phred quality of the extracted subsequence. After the CIGAR walk, the quality string of the extracted slice is scored with crate::utils::calculate_qscore; reads below this threshold are discarded. Default: 0.0 (no filter). Applies to BAM/CRAM input regardless of output format — the read’s quality scores are always present, whether or not --fastq is used for output.

Trait Implementations§

Source§

impl Clone for BamConfig

Source§

fn clone(&self) -> BamConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for BamConfig

Source§

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

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

impl Default for BamConfig

Source§

fn default() -> Self

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

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> Same for T

Source§

type Output = T

Should always be Self
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.