View source: R/plot_hexbin_fc.R
plot_hexbin_fc | R Documentation |
Plot of fold change of selected gene in single cell data using bivariate hexagon cells.
plot_hexbin_fc(
sce,
col,
mod = "RNA",
type,
feature,
title = NULL,
xlab = NULL,
ylab = NULL,
colors
)
sce |
A |
col |
A string referring to the name of one column in the meta data of sce by which to compare. Note this factor can only contain two levels. |
mod |
A string referring to the name of one column in the meta data of sce by which to compare. Note this factor can only contain two levels. |
type |
A string referring to the name of one column in the meta data of sce by which to compare. Note this factor can only contain two levels. |
feature |
A string referring to the name of one feature. |
title |
A string containing the title of the plot. |
xlab |
A string containing the title of the x axis. |
ylab |
A string containing the title of the y axis. |
colors |
A vector of strings specifying which colors to use for plotting the different levels in the selected column of the meta data. |
This function plots fold change within each
hexagon, which are calculated with make_hexbin
.
Note that the fold change is only accurate if the condition
investigated is within the same individual. For conditions across
different individuals different methods that account for
individual-specific effects are required.
A ggplot2{ggplot}
object.
# For SingleCellExperiment
library(TENxPBMCData)
library(scater)
tenx_pbmc3k <- TENxPBMCData(dataset = "pbmc3k")
rm_ind <- calculateAverage(tenx_pbmc3k) < 0.1
tenx_pbmc3k <- tenx_pbmc3k[!rm_ind, ]
colData(tenx_pbmc3k) <- cbind(colData(tenx_pbmc3k), perCellQCMetrics(tenx_pbmc3k))
tenx_pbmc3k <- logNormCounts(tenx_pbmc3k)
tenx_pbmc3k <- runPCA(tenx_pbmc3k)
tenx_pbmc3k <- make_hexbin(tenx_pbmc3k, 20, dimension_reduction = "PCA")
tenx_pbmc3k$random <- factor(sample(1:2, ncol(tenx_pbmc3k), replace = TRUE))
plot_hexbin_fc(tenx_pbmc3k, col = "random", feature = "ENSG00000187608", type = "counts")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.