plotSingleSite: Color the tree by a single site

Description Usage Arguments Value See Also Examples

View source: R/plotSingleSite.R

Description

Plot and color the tree according to amino acid/nucleotide of the selected site. The color scheme depends on the seqType set in addMSA function.

For lineagePath, the tree will be colored according to the amino acid of the site. The color scheme tries to assign distinguishable color for each amino acid.

For parallelSites, the tree will be colored according to the amino acid of the site if the mutation is not fixed.

For fixationSites, it will color the ancestral tips in red, descendant tips in blue and excluded tips in grey.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
plotSingleSite(x, site, ...)

## S3 method for class 'lineagePath'
plotSingleSite(x, site, showPath = TRUE, showTips = FALSE, ...)

## S3 method for class 'parallelSites'
plotSingleSite(x, site, showPath = TRUE, ...)

## S3 method for class 'fixationSites'
plotSingleSite(x, site, select = NULL, ...)

Arguments

x

The object to plot.

site

For lineagePath, it can be any site within sequence length. For fixationSites and parallelSites, it is restrained to a predicted fixation site. The numbering is consistent with the reference defined by setSiteNumbering.

...

Other arguments. Since 1.5.4, the function uses ggtree as the base function to make plots so the arguments in plot.phylo will no longer work.

showPath

If plot the lineage result from lineagePath. The default is TRUE.

showTips

Whether to plot the tip labels. The default is FALSE.

select

Select which fixation path in to plot. The default is NULL which will plot all the fixations.

Value

Since 1.5.4, the function returns a ggplot object so on longer behaviors like the generic plot function.

See Also

plot.sitePath

Examples

1
2
3
4
5
6
7
data(zikv_tree)
data(zikv_align)
tree <- addMSA(zikv_tree, alignment = zikv_align)
paths <- lineagePath(tree)
plotSingleSite(paths, 139)
fixations <- fixationSites(paths)
plotSingleSite(fixations, 139)

sitePath documentation built on April 17, 2021, 6:05 p.m.