Skip to contents

add_tree() performs a multiple sequence alignment on the ASV sequences in the taxa table and then constructs a phylogenetic tree. The tree is added to the tidytacos object under a variable called tree.

Usage

add_tree(
  ta,
  sequence_var = sequence,
  aln_args = list(),
  tree_fit_args = list()
)

Arguments

ta

A tidytacos object.

sequence_var

The name of the column in the taxa table that contains the ASV sequences

aln_args

An optional list of arguments to pass to the DECIPHER::AlignSeqs() function

tree_fit_args

An optional list of arguments to pass to the phangorn::optim.pml() function

Value

A tidytacos object with a phylotree slot

See also

Other unifrac-distance-functions: calculate_unifrac_distances()

Examples

if (FALSE) { # \dontrun{
# filter taxa to speed up calculation time
urt_sub <- urt %>% filter_taxa(taxon_id %in% head(urt$taxa$taxon_id))
# infer tree
urt_sub_tree <- add_tree(urt_sub,
                         sequence_var="sequence",
                         aln_args=list(verbose=FALSE)
                        )
# inspect tree
urt_sub_tree$tree
} # }