pub struct ClipStat { /* private fields */ }
Expand description

An object to store statistics for base clipping on an alignment

Implementations

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);

Return the fraction of 3’ clipped base relative to the sequence length

Argument
  • seq_len: sequence length of the alignment
Return:
  • f64 fraction 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);

Return the fraction of 5’ clipped base relative to the sequence length

Argument
  • seq_len: sequence length of the alignment
Return:
  • f64 fraction 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);

Return the fraction of total clipped base relative to the sequence length

Argument
  • seq_len: sequence length of the alignment
Return:
  • f64 fraction 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);

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);

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);

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

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.