Learn R Programming

BIEN (version 1.2.7)

BIEN_phylogeny_label_nodes: Label nodes on a phylogeny

Description

BIEN_phylogeny_label_nodes will label the nodes on a phylogeny based on either the BIEN taxonomy or user-supplied taxa.

Usage

BIEN_phylogeny_label_nodes(
  phylogeny,
  family = TRUE,
  genus = FALSE,
  other_taxa = NULL,
  ...
)

Value

Input phylogeny with labeled nodes.

Arguments

phylogeny

A single phylogeny.

family

Should family-level nodes be labeled? Default is TRUE.

genus

Should genus-level nodes be labeled? Default is FALSE. Overwrites family-level nodes where a family contains a single genera.

other_taxa

A dataframe containing two columns: 1) the taxa to be labelled; 2) the species associated with each taxon.

...

Additional arguments passed to internal functions.

See Also

Other phylogeny functions: BIEN_phylogeny_complete(), BIEN_phylogeny_conservative()

Examples

Run this code
if (FALSE) {
phylogeny<-BIEN_phylogeny_conservative()

phylogeny<-drop.tip(phy = phylogeny,tip = 101:length(phylogeny$tip.label))
plot.phylo(x = phylogeny,show.tip.label = FALSE)

fam_nodes<-BIEN_phylogeny_label_nodes(phylogeny = phylogeny,family = TRUE)
plot.phylo(x = fam_nodes,show.tip.label = FALSE, show.node.label = TRUE)

gen_nodes<-BIEN_phylogeny_label_nodes(phylogeny = phylogeny, family = FALSE, genus = TRUE)
plot.phylo(x = gen_nodes, show.tip.label = FALSE, show.node.label = TRUE)

other_taxa <- as.data.frame(matrix(nrow = 10,ncol = 2))
colnames(other_taxa)<-c("taxon","species")
other_taxa$taxon[1:5]<-"A" #Randomly assign a few species to taxon A
other_taxa$taxon[6:10]<-"B" #Randomly assign a few species to taxon B
tax_nodes <- 
 BIEN_phylogeny_label_nodes(phylogeny = phylogeny,
                            family = FALSE, genus = FALSE, other_taxa = other_taxa)
plot.phylo(x = tax_nodes,show.tip.label = FALSE,show.node.label = TRUE)}

Run the code above in your browser using DataLab