mp_plot_diff_cladogram: Visualizing the result of mp_diff_analysis with cladogram.

mp_plot_diff_cladogramR Documentation

Visualizing the result of mp_diff_analysis with cladogram.

Description

Visualizing the result of mp_diff_analysis with cladogram.

Usage

mp_plot_diff_cladogram(
  .data,
  .group,
  .size = "pvalue",
  taxa.class,
  removeUnknown = FALSE,
  layout = "radial",
  hilight.alpha = 0.3,
  hilight.size = 0.2,
  bg.tree.size = 0.15,
  bg.tree.color = "#bed0d1",
  bg.point.color = "#bed0d1",
  bg.point.fill = "white",
  bg.point.stroke = 0.2,
  bg.point.size = 2,
  label.size = 2.6,
  tip.annot = TRUE,
  as.tiplab = TRUE,
  ...
)

Arguments

.data

MPSE object or treedata which was from the taxatree slot after running the 'mp_diff_analysis'.

.group

the column name for mapping the different color.

.size

the column name for mapping the size of points, default is 'pvalue'.

taxa.class

the taxonomy class name will be replaced shorthand, default is the one level above ‘OTU’.

removeUnknown

logical, whether mask the unknown taxonomy information but differential species, default is FALSE.

layout

character, the layout of tree, default is 'radial', see also the 'layout' of 'ggtree'.

hilight.alpha

numeric, the transparency of high light clade, default is 0.3.

hilight.size

numeric, the margin thickness of high light clade, default is 0.2.

bg.tree.size

numeric, the line size (width) of tree, default is 0.15.

bg.tree.color

character, the line color of tree, default is '#bed0d1'.

bg.point.color

character, the color of margin of background node points of tree, default is '#bed0d1'.

bg.point.fill

character, the point fill (since point shape is 21) of background nodes of tree, default is 'white'.

bg.point.stroke

numeric, the margin thickness of point of background nodes of tree, default is 0.2 .

bg.point.size

numeric, the point size of background nodes of tree, default is 2.

label.size

numeric, the label size of differential taxa, default is 2.6.

tip.annot

logcial whether to replace the differential tip labels with shorthand, default is TRUE.

as.tiplab

logical, whether to display the differential tip labels with 'geom_tiplab' of 'ggtree', default is TRUE, if it is FALSE, it will use 'geom_text_repel' of 'ggrepel'.

...

additional parameters, meaningless now.

Details

The color scale of differential group can be designed by 'scale_fill_diff_cladogram'

Examples

## Not run: 
  data(mouse.time.mpse)
  mouse.time.mpse %<>%
    mp_rrarefy()
  mouse.time.mpse
  mouse.time.mpse %<>%
    mp_diff_analysis(.abundance=RareAbundance,
                     .group=time,
                     first.test.alpha=0.01,
                     action="add")
  #' ### visualizing the differential taxa with cladogram
  library(ggplot2)
  f <- mouse.time.mpse %>%
       mp_plot_diff_cladogram(
         label.size = 2.5,
         hilight.alpha = .3,
         bg.tree.size = .5,
         bg.point.size = 2,
         bg.point.stroke = .25
       ) +
       scale_fill_diff_cladogram(
         values = c('skyblue', 'orange')
       ) +
       scale_size_continuous(range = c(1, 4))
  f

## End(Not run)

xiangpin/MicrobitaProcess documentation built on Nov. 6, 2024, 1:15 a.m.