alifestd_estimate_triplet_distance_asexual
- alifestd_estimate_triplet_distance_asexual(first_df: ~pandas.core.frame.DataFrame, second_df: ~pandas.core.frame.DataFrame, taxon_label_key: str, confidence: float = 0.99, precision: float = 0.01, strict: bool | ~typing.Tuple[bool, bool] = True, detail: bool = False, progress_wrap: ~typing.Callable = <function <lambda>>, mutate: bool = False) float | Tuple[float, Tuple[float, float, int]]
Estimate the triplet distance between two asexual phylogenetic trees in alife sampling sets of three leaf taxa and counting the fraction whose phylogenetic connectivity mismatch between trees.
Parameters
- first_dfpd.DataFrame
The DataFrame representing the first phylogenetic tree.
- second_dfpd.DataFrame
The DataFrame representing the second phylogenetic tree.
- taxon_label_keystr
The key in the DataFrame to identify the taxon labels.
- confidencefloat, default 0.99
The confidence level for the estimation.
See estimate_binomial_p for details.
- precisionfloat, default 0.01
The precision of the estimation.
See estimate_binomial_p for details.
- strictbool or Tuple[bool, bool], default True
A flag or a tuple of flags indicating how to treat tuples.
If False, triplets that form a polytomy in either tree are not counted as mismatching. If True, they are counted as mismatching. If a tuple is given, polytomies in the first and second trees are treated according to the first and second elements of the tuple, respectively.
- detailbool, default False
If True, returns a detailed result including the estimated distance, confidence interval, and sample size.
- progress_wraptyping.Callable, optional
Pass tqdm or equivalent to display a progress bar.
- mutatebool, default False
If True, allows mutation of input DataFrames.
Returns
- float or Tuple[float, Tuple[float, float, int]]
The estimated distance between the two trees.
If detail is True, returns a tuple containing the estimated distance, the confidence interval, and the sample size.
Notes
The core comparison is done by sampling triplets of taxa, categorizing them, and comparing these categorizations across the two trees, taking into account the strict and lax parameters for handling polytomies. See alifestd_categorize_triplet_asexual for details.
See Also
alifestd_categorize_triplet_asexual alifestd_sample_triplet_comparisons_asexual