bootstrapTrees - Create a bootstrap distribution for clone sequence alignments, and estimate trees for each bootstrap replicate.

Description

bootstrapTrees Phylogenetic bootstrap function.

Usage

bootstrapTrees(
clones,
bootstraps,
nproc = 1,
trait = NULL,
dir = NULL,
id = NULL,
modelfile = NULL,
build = "pratchet",
exec = NULL,
igphyml = NULL,
fixtrees = FALSE,
quiet = 0,
rm_temp = TRUE,
palette = NULL,
resolve = 2,
rep = NULL,
keeptrees = TRUE,
lfile = NULL,
seq = "sequence",
downsample = FALSE,
tip_switch = 20,
...
)

Arguments

clones
tibble airrClone objects, the output of formatClones
bootstraps
number of bootstrap replicates to perform
nproc
number of cores to parallelize computations
trait
trait to use for parsimony models (required if igphyml specified)
dir
directory where temporary files will be placed (required if igphyml or dnapars specified)
id
unique identifer for this analysis (required if igphyml or dnapars specified)
modelfile
file specifying parsimony model to use
build
program to use for tree building (phangorn, dnapars)
exec
location of desired phylogenetic executable
igphyml
location of igphyml executible if trait models desired
fixtrees
keep tree topologies fixed? (bootstrapping will not be perfomed)
quiet
amount of rubbish to print to console
rm_temp
remove temporary files (default=TRUE)
palette
a named vector specifying colors for each state
resolve
how should polytomies be resolved?
rep
current bootstrap replicate (experimental)
keeptrees
keep trees estimated from bootstrap replicates? (TRUE)
lfile
lineage file input to igphyml if desired (experimental)
seq
column name containing sequence information
downsample
downsample clones to have a maximum specified tip/switch ratio?
tip_switch
maximum allowed tip/switch ratio if downsample=TRUE
additional arguments to be passed to tree building program

Value

A list of trees and/or switch counts for each bootstrap replicate.

Details

Tree building details are the same as getTrees. If keeptrees=TRUE (default) the returned object will contain a list named “trees” which contains a list of estimated tree objects for each bootstrap replicate. The object is structured like: trees[[]][[]]. If igphyml is specified (as well as trait), the returned object will contain a tibble named “switches” containing switch count information. This object can be passed to testSP and other functions to perform parsimony based trait value tests.

Examples

### Not run:
data(ExampleAirr)
# ExampleAirr$sample_id <- sample(ExampleAirr$sample_id)
# clones <- formatClones(ExampleAirr, trait="sample_id")
# 
# igphyml <- "~/apps/igphyml/src/igphyml"
# btrees <- bootstrapTrees(clones[1:2], bootstraps=10, nproc=1,
# igphyml=igphyml, trait="sample_id")
# plotTrees(btrees$trees[[4]])[[1]]
# testPS(btrees$switches)

See also

Uses output from formatClones with similar arguments to getTrees. Output can be visualized with plotTrees, and tested with testPS, testSC, and testSP.