pub struct SimplificationOptions(/* private fields */);Expand description
Control the behavior of table simplification.
Inclusion of values sets an option to true.
The default behavior is to perform the algorithm
as described in Kelleher et al. (2018), 10.1371/journal.pcbi.1006581.
The documentation for each field is taken from the tskit primary
docs.
§Examples
§Building up flags
§Default flags
let flags = SimplificationOptions::default();§Using a “builder” API
let flags =
SimplificationOptions::default().keep_unary().filter_populations().filter_sites();
assert!(flags.contains(SimplificationOptions::KEEP_UNARY));
assert!(flags.contains(SimplificationOptions::FILTER_POPULATIONS));
assert!(flags.contains(SimplificationOptions::FILTER_SITES));Implementations§
Source§impl SimplificationOptions
impl SimplificationOptions
pub const FILTER_SITES: Self
Sourcepub const FILTER_POPULATIONS: Self
pub const FILTER_POPULATIONS: Self
If True, remove any populations that are not referenced by nodes after simplification; new population IDs are allocated sequentially from zero. If False, the population table will not be altered in any way.
Sourcepub const FILTER_INDIVIDUALS: Self
pub const FILTER_INDIVIDUALS: Self
If True, remove any individuals that are not referenced by nodes after simplification; new individual IDs are allocated sequentially from zero. If False, the individual table will not be altered in any way.
Sourcepub const REDUCE_TO_SITE_TOPOLOGY: Self
pub const REDUCE_TO_SITE_TOPOLOGY: Self
Whether to reduce the topology down to the trees that are present at sites.
Sourcepub const KEEP_UNARY: Self
pub const KEEP_UNARY: Self
If True, preserve unary nodes (i.e. nodes with exactly one child) that exist on the path from samples to root.
Sourcepub const KEEP_INPUT_ROOTS: Self
pub const KEEP_INPUT_ROOTS: Self
Whether to retain history ancestral to the MRCA of the samples.
Sourcepub const KEEP_UNARY_IN_INDIVIDUALS: Self
pub const KEEP_UNARY_IN_INDIVIDUALS: Self
If True, preserve unary nodes that exist on the path from samples
to root, but only if they are associated with an individual
in the individuals table.
Cannot be specified at the same time as KEEP_UNARY.
Sourcepub fn keep_input_roots(self) -> Self
pub fn keep_input_roots(self) -> Self
Update to set KEEP_INPUT_ROOTS.
§Examples
let f = SimplificationOptions::default().keep_input_roots();
assert!(f.contains(SimplificationOptions::KEEP_INPUT_ROOTS));Sourcepub fn keep_unary(self) -> Self
pub fn keep_unary(self) -> Self
Update to set KEEP_UNARY.
§Examples
let f = SimplificationOptions::default().keep_unary();
assert!(f.contains(SimplificationOptions::KEEP_UNARY));Sourcepub fn keep_unary_in_individuals(self) -> Self
pub fn keep_unary_in_individuals(self) -> Self
Update to set KEEP_UNARY_IN_INDIVIDUALS.
§Examples
let f = SimplificationOptions::default().keep_unary_in_individuals();
assert!(f.contains(SimplificationOptions::KEEP_UNARY_IN_INDIVIDUALS));Sourcepub fn filter_populations(self) -> Self
pub fn filter_populations(self) -> Self
Update to set FILTER_POPULATIONS.
§Examples
let f = SimplificationOptions::default().filter_populations();
assert!(f.contains(SimplificationOptions::FILTER_POPULATIONS));Sourcepub fn filter_sites(self) -> Self
pub fn filter_sites(self) -> Self
Update to set FILTER_SITES.
§Examples
let f = SimplificationOptions::default().filter_sites();
assert!(f.contains(SimplificationOptions::FILTER_SITES));Sourcepub fn reduce_to_site_topology(self) -> Self
pub fn reduce_to_site_topology(self) -> Self
Update to set REDUCE_TO_SITE_TOPOLOGY.
§Examples
let f = SimplificationOptions::default().reduce_to_site_topology();
assert!(f.contains(SimplificationOptions::REDUCE_TO_SITE_TOPOLOGY));Sourcepub fn filter_individuals(self) -> Self
pub fn filter_individuals(self) -> Self
Update to set FILTER_INDIVIDUALS.
§Examples
let f = SimplificationOptions::default().filter_individuals();
assert!(f.contains(SimplificationOptions::FILTER_INDIVIDUALS));pub fn bits(&self) -> RawFlags
pub fn all() -> Self
pub fn contains<I>(&self, bit: I) -> bool
Trait Implementations§
Source§impl BitAnd for SimplificationOptions
impl BitAnd for SimplificationOptions
Source§impl BitAndAssign for SimplificationOptions
impl BitAndAssign for SimplificationOptions
Source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
&= operation. Read moreSource§impl BitOr for SimplificationOptions
impl BitOr for SimplificationOptions
Source§impl BitOrAssign for SimplificationOptions
impl BitOrAssign for SimplificationOptions
Source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
|= operation. Read moreSource§impl BitXor for SimplificationOptions
impl BitXor for SimplificationOptions
Source§impl BitXorAssign for SimplificationOptions
impl BitXorAssign for SimplificationOptions
Source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
^= operation. Read moreSource§impl Clone for SimplificationOptions
impl Clone for SimplificationOptions
Source§fn clone(&self) -> SimplificationOptions
fn clone(&self) -> SimplificationOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more