This produces a barplot of the dichotomized gene expression counts into two or three categories based on custom defined percentiles.
draw_barplot(
object,
assay_name,
x_spec,
facet_var = NULL,
fill_var = NULL,
percentiles = c(1/3, 2/3)
)(AnyHermesData)
input.
(string)
selects assay from input.
(GeneSpec)
gene specification for the x-axis.
(string or NULL)
optional faceting variable, taken
from input sample variables.
(string or NULL)
optional fill variable, taken
from input sample variables.
(vector)
lower and upper percentiles to dichotomize
the gene counts into two or three categories.
The ggplot barplot.
object <- hermes_data
g <- genes(object)
draw_barplot(
object,
assay_name = "counts",
x_spec = gene_spec(g[1]),
facet_var = "SEX",
fill_var = "AGE18"
)
draw_barplot(
object,
assay_name = "counts",
x_spec = gene_spec(g[1:3], colMedians, "Median"),
facet_var = "SEX",
fill_var = "AGE18"
)
draw_barplot(
object,
assay_name = "counts",
x_spec = gene_spec(g[1:3], colMeans, "Mean"),
facet_var = "SEX",
fill_var = "AGE18",
percentiles = c(0.1, 0.9)
)