Description Usage Arguments Use cases Examples
Construct phylogenetically based query
1 | pd_query(x, query)
|
x |
an object of class 'phylodiv' |
query |
query statement |
Taxonomy based queries (leverages taxa), e.g: - taxa A vs. taxa B (bypass the tree in this case, but do make sure the taxa are in the tree?) - taxa A, taxa B, taxa C, etc. (bypass the tree in this case, but do make sure the taxa are in the tree?)
Phylogeny based queries (no solution for this yet): - all taxa downstream from A (use tree to get clade from A) - all taxa upstream from A (use tree to get higher taxa above A) - all taxa not in genus B (use tree to get all tips not in genus B; in other words, drop clade B)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ## Not run:
library(ape)
data(chiroptera)
st <- ape::subtrees(chiroptera)[[393]]
st <- ape::subtrees(chiroptera)[[2]]
x <- pd_read(st)
res <- pd_taxa(x)
# with a taxmap
res
res$hierarchies
res$taxmap
pd_query(res, startsWith(taxon_names, "Pteropus"))
# with metacoder::parse_phylo()
library(ape)
data(bird.orders)
x <- pd_read(bird.orders)
x <- pd_tax(x)
res <- pd_taxa2(x)
res$taxmap
res <- pd_query(res, startsWith(taxon_names, "C"))
# A compared to sister clade
spp <- c("Eptesicus serotinus", "Eptesicus fuscus",
"Eptesicus furinalis", "Eptesicus brasiliensis")
pd_query(res, spp)
# pd_query(res, "Eptesicus bobrinskoi", "Eptesicus bar")
# A compared to B
# pd_query(res, A ~ B)
# A compared to B
# pd_query(res, A ~ B)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.