pub struct Pedigree(/* private fields */);
Expand description
A pedigree describes the divergence bewteen any two samples in a population. It’s a matrix with four columns, containing the following information:
t0: The generation of the last common ancestor between two samples (Can be one of the samples if direct heritage).
t1: The generation of the first sample.
t2: The generation of the second sample.
d: The divergence between the two samples.
The length of the pedigree is the number of possible pairs of samples, for which methlyation data is available => n * (n - 1) / 2
Implementations§
Source§impl Pedigree
impl Pedigree
Sourcepub fn from_file(filename: &str) -> Self
pub fn from_file(filename: &str) -> Self
Read a pedigree from a file.
The file must be a tab-separated file with four columns:
t0
: The generation of the last common ancestor between two samples (Can be one of the samples if direct heritage).
t1
: The generation of the first sample.
t2
: The generation of the second sample.
d
: The divergence between the two samples.
The first line of the file is ignored. I chose not to return a result, as this function is meant to statically read a file and therefore it is preferable to panic if the file is not found or parsing errors occur.
pub fn to_file<P>(&self, path: P) -> Result<()>
pub fn build<P>( nodelist: P, edgelist: P, posterior_max_filter: f64, ) -> Return<(Self, f64)>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pedigree
impl RefUnwindSafe for Pedigree
impl Send for Pedigree
impl Sync for Pedigree
impl Unpin for Pedigree
impl UnwindSafe for Pedigree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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