vizTopic | R Documentation |
Visualize the pixel proportions of a single topic.
vizTopic(
theta,
pos,
topic,
groups = NA,
group_cols = NA,
size = 2,
stroke = 0.3,
alpha = 1,
low = "white",
high = "red",
plotTitle = NA,
showLegend = TRUE
)
theta |
document (pixel) x cell-type proportion matrix |
pos |
position of pixels, as data.frame with |
topic |
the index of the topic |
groups |
colors the pixel border lines based on a group or cell layer they belong to. Needs to be a character or named vector of assigned groups for each pixel Ex: c("0", "1", "0", ...) |
group_cols |
color labels for the groups. Ex: c("0" = "gray", "1" = "red") |
size |
size of the geom_points to plot (default: 2) |
stroke |
thickness of the geom_point lines to help in emphasizing groups (default: 0.5) |
alpha |
alpha value of colored pixels (default: 1) |
low |
sets the color for the low end of the topic proportion color scale (default: "white") |
high |
sets the color the the high end of the topic proportion color scale (default: "red") |
plotTitle |
option to add a title to the plot (character) |
showLegend |
Boolean to show the plot legend |
a plot where each point is a pixel colored by the proportion of the selected cell-type
data(mOB)
pos <- mOB$pos
cd <- mOB$counts
counts <- cleanCounts(cd, min.lib.size = 100)
corpus <- restrictCorpus(counts, removeAbove=1.0, removeBelow = 0.05)
ldas <- fitLDA(t(as.matrix(corpus)), Ks = 3)
optLDA <- optimalModel(models = ldas, opt = 3)
results <- getBetaTheta(optLDA, perc.filt = 0.05, betaScale = 1000)
deconProp <- results$theta
vizTopic(theta = deconProp, pos = pos, topic = "3", plotTitle = "X3",
size = 5, stroke = 1, alpha = 0.5, low = "white", high = "red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.