Struct ContinuousAlleleFreqs

Source
pub struct ContinuousAlleleFreqs {
    pub left_exclusive: bool,
    pub right_exclusive: bool,
    /* private fields */
}
Expand description

An allele frequency range

Fields§

§left_exclusive: bool§right_exclusive: bool

Implementations§

Source§

impl ContinuousAlleleFreqs

Source

pub fn inclusive(range: Range<f64>) -> Self

create a left- and right-inclusive allele frequency range

Source

pub fn exclusive(range: Range<f64>) -> Self

create a left- and right-exclusive allele frequency range

Source

pub fn left_exclusive(range: Range<f64>) -> Self

create a left-exclusive allele frequency range

Source

pub fn right_exclusive(range: Range<f64>) -> Self

create a right-exclusive allele frequency range

Methods from Deref<Target = Range<AlleleFreq>>§

1.35.0 · Source

pub fn contains<U>(&self, item: &U) -> bool
where Idx: PartialOrd<U>, U: PartialOrd<Idx> + ?Sized,

Returns true if item is contained in the range.

§Examples
assert!(!(3..5).contains(&2));
assert!( (3..5).contains(&3));
assert!( (3..5).contains(&4));
assert!(!(3..5).contains(&5));

assert!(!(3..3).contains(&3));
assert!(!(3..2).contains(&3));

assert!( (0.0..1.0).contains(&0.5));
assert!(!(0.0..1.0).contains(&f32::NAN));
assert!(!(0.0..f32::NAN).contains(&0.5));
assert!(!(f32::NAN..1.0).contains(&0.5));
1.47.0 · Source

pub fn is_empty(&self) -> bool

Returns true if the range contains no items.

§Examples
assert!(!(3..5).is_empty());
assert!( (3..3).is_empty());
assert!( (3..2).is_empty());

The range is empty if either side is incomparable:

assert!(!(3.0..5.0).is_empty());
assert!( (3.0..f32::NAN).is_empty());
assert!( (f32::NAN..5.0).is_empty());

Trait Implementations§

Source§

impl Debug for ContinuousAlleleFreqs

Source§

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

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

impl PairModel<ContinuousAlleleFreqs, DiscreteAlleleFreqs> for FlatTumorNormalModel

Source§

fn prior_prob(&self, _: AlleleFreq, _: AlleleFreq, _: &Variant) -> LogProb

Calculate prior probability of given combination of allele frequencies.
Source§

fn joint_prob( &self, af_tumor: &ContinuousAlleleFreqs, af_normal: &DiscreteAlleleFreqs, pileup: &mut PairPileup<'_, ContinuousAlleleFreqs, DiscreteAlleleFreqs, Self>, ) -> LogProb

Calculate joint probability of prior with likelihoods for given allele frequency ranges.
Source§

fn marginal_prob( &self, pileup: &mut PairPileup<'_, ContinuousAlleleFreqs, DiscreteAlleleFreqs, Self>, ) -> LogProb

Calculate marginal probability.
Source§

fn map( &self, pileup: &mut PairPileup<'_, ContinuousAlleleFreqs, DiscreteAlleleFreqs, Self>, ) -> (AlleleFreq, AlleleFreq)

Calculate maximum a posteriori probability estimate of allele frequencies.
Source§

fn allele_freqs(&self) -> (&ContinuousAlleleFreqs, &DiscreteAlleleFreqs)

Return allele frequency spectra.
Source§

impl PairModel<ContinuousAlleleFreqs, DiscreteAlleleFreqs> for TumorNormalModel

Source§

fn prior_prob( &self, af_tumor: AlleleFreq, af_normal: AlleleFreq, variant: &Variant, ) -> LogProb

Calculate prior probability of given combination of allele frequencies.
Source§

fn joint_prob( &self, af_tumor: &ContinuousAlleleFreqs, af_normal: &DiscreteAlleleFreqs, pileup: &mut PairPileup<'_, ContinuousAlleleFreqs, DiscreteAlleleFreqs, Self>, ) -> LogProb

Calculate joint probability of prior with likelihoods for given allele frequency ranges.
Source§

fn marginal_prob( &self, pileup: &mut PairPileup<'_, ContinuousAlleleFreqs, DiscreteAlleleFreqs, Self>, ) -> LogProb

Calculate marginal probability.
Source§

fn map( &self, pileup: &mut PairPileup<'_, ContinuousAlleleFreqs, DiscreteAlleleFreqs, Self>, ) -> (AlleleFreq, AlleleFreq)

Calculate maximum a posteriori probability estimate of allele frequencies.
Source§

fn allele_freqs(&self) -> (&ContinuousAlleleFreqs, &DiscreteAlleleFreqs)

Return allele frequency spectra.
Source§

impl PairModel<DiscreteAlleleFreqs, ContinuousAlleleFreqs> for SingleCellBulkModel

Source§

fn prior_prob( &self, af_single: AlleleFreq, af_bulk: AlleleFreq, variant: &Variant, ) -> LogProb

Calculate prior probability of given combination of allele frequencies.
Source§

fn joint_prob( &self, af_single: &DiscreteAlleleFreqs, af_bulk: &ContinuousAlleleFreqs, pileup: &mut PairPileup<'_, DiscreteAlleleFreqs, ContinuousAlleleFreqs, Self>, ) -> LogProb

Calculate joint probability of prior with likelihoods for given allele frequency ranges.
Source§

fn marginal_prob( &self, pileup: &mut PairPileup<'_, DiscreteAlleleFreqs, ContinuousAlleleFreqs, Self>, ) -> LogProb

Calculate marginal probability.
Source§

fn map( &self, pileup: &mut PairPileup<'_, DiscreteAlleleFreqs, ContinuousAlleleFreqs, Self>, ) -> (AlleleFreq, AlleleFreq)

Calculate maximum a posteriori probability estimate of allele frequencies.
Source§

fn allele_freqs(&self) -> (&DiscreteAlleleFreqs, &ContinuousAlleleFreqs)

Return allele frequency spectra.
Source§

impl Deref for ContinuousAlleleFreqs

Source§

type Target = Range<NotNan<f64>>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Range<AlleleFreq>

Dereferences the value.
Source§

impl AlleleFreqs for ContinuousAlleleFreqs

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.