| Title: | Matches Tip and Trait Data |
|---|---|
| Description: | Use topological or taxonomic information to maximize the overlap of phylogenetic and comparative data. |
| Authors: | Rich FitzJohn, Matt Pennell and Will Cornwell |
| Maintainer: | Matt Pennell <[email protected]> |
| License: | BSD_2_clause + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-05-07 05:50:39 UTC |
| Source: | https://github.com/traitecoevo/phyndr |
Generate all distinct sets of tip labels from a phyndr tree
phyndr_combn(phy, max_n = 1000)phyndr_combn(phy, max_n = 1000)
phy |
A phyndr tree |
max_n |
Maximum number of trees to generate; if the number of distinct trees is larger than this, we'll throw an error instead. |
Number of possible distinct trees that can be generated from a phyndr set.
phyndr_n_distinct(phy)phyndr_n_distinct(phy)
phy |
A phyndr phylogeny |
Sample distinct set of tip labels from a phyndr tree.
phyndr_sample returns a tree (phylo object) while
phyndr_sample_n generates a list of trees.
phyndr_sample(phy) phyndr_sample_n(phy, n)phyndr_sample(phy) phyndr_sample_n(phy, n)
phy |
A phyndr tree |
n |
Number of trees to generate |
Taxonomic method of phyndr that works with generalised sets of
taxonomic information. Requires a nested set of taxonomic classes
(e.g, genus, family, order, etc) but does not assume that these
classes are necessarily monophyletic. phyndr_genus does
this for the genus level only but attempts to automatically detect
genera from the tree (assuming that tips are all genus/species
pairs, with genus and species separated by either an underscore or
space).
phyndr_taxonomy(phy, data_species, taxonomy) phyndr_genus(phy, data_species)phyndr_taxonomy(phy, data_species, taxonomy) phyndr_genus(phy, data_species)
phy |
An ape phylogeny |
data_species |
A vector of species names for which we have trait data. Species names in both the tree and in this vector must be separated with underscores, not with spaces. |
taxonomy |
A data.frame with taxonomic information. Row
names must be present and must list every species in |
The algorithm (not including recursion and substitute whatever taxonomic level for genus).
1: drop genera if there is a species match for that genus, but don't drop the actual matches.
2: work out which genera can be collapsed to a single tip due to monophyly.
2a. For each genus, determine if they are monophyletic
2b. Then, for genera that are not monophyletic determine which can be made monophyletic by dropping groups that are not represented in the data set.
2c. Collapse each genus down, dropping only genera that are required to achieve monophyly.
3. For each collapsed node we'll mangle the name to "genus::name"
and then make a list of suitable species in the tree and data set;
for now stored as clades.
phyndr for topo trees
phyndr_topology(phy, data_species, topology)phyndr_topology(phy, data_species, topology)
phy |
An ape phylogeny. The tree must be ultrametric and this is enforced on entry. |
data_species |
A vector of species names for which we have trait data. Species names in both the tree and in this vector must be separated with underscores, not with spaces. |
topology |
A topological tree used to determine patterns of
relatedness among species in |