Struct filter_clipped::clipping::ClipStat
source · [−]pub struct ClipStat { /* private fields */ }Expand description
An object to store statistics for base clipping on an alignment
Implementations
sourceimpl ClipStat
impl ClipStat
sourcepub fn new(leading_clipped: Vec<i64>, tailing_clipped: Vec<i64>) -> Self
pub fn new(leading_clipped: Vec<i64>, tailing_clipped: Vec<i64>) -> Self
Creat a new ClipStat object for an alignment
Arguments
leading_clipped: a list of [number of 5’ soft clipped bases, number of 5’ hard clipped bases]trailing_clipped: a list of [number of 3’ soft clipped bases, number of 3’ hard clipped bases]
Return:
A ClipStat object
Example
use filter_clipped::clipping::ClipStat;
let clip_stat = ClipStat::new(
vec![0,1],
vec![0,2],
);
assert_eq!(clip_stat.left(), 1);
assert_eq!(clip_stat.right(), 2);
assert_eq!(clip_stat.total_clipped(), 3);sourcepub fn right_fraction(&self, seq_len: f64) -> Result<f64, String>
pub fn right_fraction(&self, seq_len: f64) -> Result<f64, String>
Return the fraction of 3’ clipped base relative to the sequence length
Argument
seq_len: sequence length of the alignment
Return:
f64fraction of 3’ clipped base
Example
use filter_clipped::clipping::ClipStat;
let clip_stat = ClipStat::new(
vec![0,1],
vec![0,2],
);
assert_eq!(clip_stat.right_fraction(10.0).unwrap(), 0.2);sourcepub fn left_fraction(&self, seq_len: f64) -> Result<f64, String>
pub fn left_fraction(&self, seq_len: f64) -> Result<f64, String>
Return the fraction of 5’ clipped base relative to the sequence length
Argument
seq_len: sequence length of the alignment
Return:
f64fraction of 5’ clipped base
Example
use filter_clipped::clipping::ClipStat;
let clip_stat = ClipStat::new(
vec![0,1],
vec![0,2],
);
assert_eq!(clip_stat.left_fraction(10.0).unwrap(), 0.1);sourcepub fn total_fraction(&self, seq_len: f64) -> Result<f64, String>
pub fn total_fraction(&self, seq_len: f64) -> Result<f64, String>
Return the fraction of total clipped base relative to the sequence length
Argument
seq_len: sequence length of the alignment
Return:
f64fraction of 5’ clipped base
Example
use filter_clipped::clipping::ClipStat;
let clip_stat = ClipStat::new(
vec![0,1],
vec![0,2],
);
assert_eq!(clip_stat.total_fraction(10.0).unwrap(), 0.3);sourcepub fn left(&self) -> i64
pub fn left(&self) -> i64
Expose left
Example
use filter_clipped::clipping::ClipStat;
let clip_stat = ClipStat::new(
vec![0,1],
vec![0,2],
);
assert_eq!(clip_stat.left(), 1);sourcepub fn right(&self) -> i64
pub fn right(&self) -> i64
Expose right
Example
use filter_clipped::clipping::ClipStat;
let clip_stat = ClipStat::new(
vec![0,1],
vec![0,2],
);
assert_eq!(clip_stat.right(), 2);sourcepub fn total_clipped(&self) -> i64
pub fn total_clipped(&self) -> i64
Expose total_clipped
Example
use filter_clipped::clipping::ClipStat;
let clip_stat = ClipStat::new(
vec![0,1],
vec![0,2],
);
assert_eq!(clip_stat.total_clipped(), 3);Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ClipStat
impl Send for ClipStat
impl Sync for ClipStat
impl Unpin for ClipStat
impl UnwindSafe for ClipStat
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more