Description Usage Arguments Value Examples
This plots gene expression in groups of cells and a curve representing its mean expression (generated using a smoothing algorithm). It takes output from multiple runs of geneSmoothFit
(i.e. for different trajectories or different segments of the same trajectory). The individual results from geneSmoothFit
should be combined into a list, and the names of the elements will be used to define the names of the segments in the plot. If multiple genes are provided, a grid of plots is produced.
1 2 3 4 5 6 7 8 9 10 11 | plotSmoothFitMultiCascade(
smoothed.fits,
genes,
colors = NULL,
scaled = T,
plot.data = T,
alpha.data = 0.2,
alpha.smooth = 1,
lwd.smooth = 1,
ncol = NULL
)
|
genes |
(Character vector) Genes to include in the plot(s) |
colors |
(Character vector) Colors to use for each segment (names are matched against the names of elements in |
scaled |
(Logical) Plot actual expression values ( |
plot.data |
(Logical) Plot data points? |
alpha.data |
(Numeric: 0-1) Transparency of data points |
alpha.smooth |
(Numeric: 0-1) Transparency of curve |
lwd.smooth |
(Numeric) Line width of curve |
ncol |
(Numeric) Number of columns to use if several plots are produced (i.e. if several |
smoothed.fit |
(List of lists) A list containing several lists that are the output of |
A ggplot2 object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # Identify the pseudotime of the branchpoint
pt.crop <- as.numeric(unlist(hydra.en.tree@tree$segment.pseudotime.limits)[1])
# Crop according to the pseudotime of the branchpoint
foot.only.spline <- cropSmoothFit(tentacle.spline, pt.max = pt.crop)
hypostome.only.spline <- cropSmoothFit(hypo.spline, pt.min = pt.crop)
tentacle.only.spline <- cropSmoothFit(tentacle.spline, pt.min = pt.crop)
# Combine into a list
# Names in the plots are determined by names of the smooth objects in the list
splines <- list(foot.only.spline, tentacle.only.spline, hypostome.only.spline)
names(splines) <- c("Foot/Body", "Tentacle", "Hypostome")
# Plot expression of genes on the curves
endoderm.genes.plot <- c("t14194aep|WNT3_MOUSE", "t20768aep|BRAC_CANLF",
"t25396aep|NKX26_HUMAN", "t18735aep|FOXA2_ORYLA")
plotSmoothFitMultiCascade(smoothed.fits = splines,
genes = endoderm.genes.plot, scaled = F,
colors = c(`Foot/Body` = "#FF8C00", Hypostome = "#1E90FF",
Tentacle = "#32CD32"
)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.