micro_rocky_mtn: Create Rocky Mountain plots from negative binomial taxa...

Description Usage Arguments Value Author(s) Examples

View source: R/micro_rocky_mtn.R

Description

Display the magnitude of log p-values for each of the taxa in nb_mods as vertical bars next to each other along the x-axis. The direction of the bars will be determined by the direction of the estimated relationship. The taxa will be color coded by the phylum they belong to, and taxa that have FRD adjusted p-values below your desired significance cutoff for the specified covariate will be labeled

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
micro_rocky_mtn(
  modsum,
  ...,
  main = NULL,
  ylab = NULL,
  subtitle = NULL,
  pval_lines = TRUE,
  pval_text = TRUE,
  sig_text = TRUE,
  facet_labels = NULL,
  alpha = 0.05,
  lwd = 2,
  lty = 1
)

Arguments

modsum

The output from nb_mods

...

The covariate you'd like to plot. Must be in the models created by nb_mods

main

Plot title

ylab

y-axis labels

subtitle

Plot subtitle

pval_lines

Logical; include horizonal dashed lines at corresponding p-values

pval_text

Logical; label the y-axis with corresponding p-values

sig_text

Logical; label the taxa with p-values below specified alpha

facet_labels

Labels for different facets if covariate has more than 1 beta coefficient

alpha

Significance cutoff

lwd

Line width for pval_lines

lty

Line type for pval_lines

Value

A ggplot you can add geoms to if you'd like

Author(s)

Charlie Carpenter, Rachel Johnson, Dan Frank

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(bpd_phy); data(bpd_cla); data(bpd_ord); data(bpd_fam); data(bpd_clin)
otu_tabs = list(Phylum = bpd_phy, Class = bpd_cla,
Order = bpd_ord, Family = bpd_fam)

set <- tidy_micro(otu_tabs = otu_tabs, clinical = bpd_clin) %>%
filter(day == 7) ## Only including the first week

## Creating negative binomial models on filtered tidy_micro set
nb_fam <- set %>%
otu_filter(ra_cutoff = 0.1, exclude_taxa = c("Unclassified", "Bacteria")) %>%
nb_mods(table = "Family", bpd1)

nb_fam %>% micro_rocky_mtn(bpd1)

CharlieCarpenter/tidyMicro documentation built on April 25, 2021, 4:09 p.m.