Plot a FC matrix.
plot_FC_gg(
mat,
colFUN = NULL,
title = "FC Matrix",
legTitle = "",
group_divs = NULL,
group_cols = RColorBrewer::brewer.pal(8, "Set2"),
labs = NULL,
uppertri_means = TRUE,
divColor = "black",
lim = 0.5,
diagVal = 1,
labs_margin_y = NULL,
labs_margin_x = 0
)The plot
The FC matrix
A scale_fill function. If NULL, use a red-blue
diverging palette if there are negative values in mat, and viridis'
inferno sequential palette otherwise.
The plot title. Default: "FC Matrix".
The legend title. Default: "".
Split the FC matrix into groups of contiguous
rows/columns? Use group_divs to indicate the index of the first
element in each group. For example, if the groups are 1-8, 9-15, and 16 to
25, set group_divs=c(1, 9, 16). Groups will be indicated by a color
bar along the left and top sides of the plot. Use group_cols to
change the colors. By default, group_divs is NULL (no groups).
Labels to place along the y-axis? If is.null(group_divs),
this should be a character vector labeling each row of mat, or a
dot dot dot. If !is.null(group_divs), this may alternatively be a
character vector labeling each group.
Use the upper triangle of the FC matrix to show the
mean of each group indicated by group_divs? Default: TRUE.
Has no effect if group_divs is NULL.
Color of group dividers and outline of the FC matrix.
Default: "black".
Length-two numeric vector indicating the limits for the color bar.
Values beyond lim will be clipped. If NULL, the
limits will be set based on the largest magnitude value in mat (no
clipping). If length-one, the left limit will be 0 if there are no
negative values, or -lim if there are. Default: .5.
On-diagonal values will be set to this value.
(uppertri_means are calculated before diagVal is used.)
Margin value for labels. For the y-axis,
a value of NULL (default) will set the margin value adaptively
depending on the size of the FC matrix such that the labels are almost flush
with the y-axis. The default for the x-axis is 0, which also results
in labels almost flush with the x-axis.