ggheat: A heatmap summary for showing log2 fold changes. Built with...

Description Usage Arguments Examples

View source: R/ggheat.R

Description

A heatmap summary for showing log2 fold changes. Built with ggplot2 using geom_tile and geom_tile.

Usage

1
2
3
4
ggheat(stats, x = tx, y = target, cluster = "spearman",
  labels = label, label_size = NULL, label_alpha = 1,
  samples = NULL, sample_var = cq, title = "", subtitle = "",
  axis_text_x_angle = 0)

Arguments

stats

A data.frame object from assayr2::makeStats or other source with columns named log2_fc and label. If a contrast is missing for a condition, the log2_fc is set to 0 for clustering.

x

A bare column name from stats to be plotted on the x-axis.

y

A bare column name from stats to be plotted on the y-axis.

cluster

A character for the distance method or correlation method to be used. Must be one of "euclidean", "maximum", "manhattan", "canberra", "binary" "minkowski", "pearson", "spearman" (deault) or "kendall", abbreviations are acceptable. Pass "none" if clustering is not desired, will result in alphabetical ordering.

labels

A bare column name from samples specifying the values for the tile text. Pass NULL for no-labels. If the maximum number of characters for all labels is < 3 geom_text is used, ie adding '*'. If longer geom_label is called for readability.

label_size

Numeric. Value passed to geom_lable(size = ). Default is NULL, which automatically adjusts based on heatmap size.

label_alpha

Numeric between 0 and 1 controls geom_label(alpha = ).

samples

Optional data.frame with the samples used to build stats. If provided, will add a strip of tiles showing the average abundance of each analyte in the heatmap.

sample_var

A bare column name from samples specifying the values for the abundance tiles.

title

A character passed as the title to the heatmap. Default if to p_title, because Nate wrote this.

subtitle

A character passed as the subtitle to the heatmap. Default is empty character for consistant alignment.

axis_text_x_angle

Numeric value representing the angle at which the x-axes text should be plotted

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
# magpix assay

stats <- samps %>%
group_by(tx_id, target) %>%
nest() %>%
mutate(mod = map(data, ~ lmer(log10(conc) ~ 0 + treatment + (1|device), data = .)),
       stat = par_stats(mod)) %>%
unnest(stat) %>% 
select_if(~ !is.list(.))

ggheat(stats)

## End(Not run)

hemoshear/assayr2 documentation built on Nov. 8, 2019, 6:13 p.m.