Description Usage Arguments Details Value Examples
Plot explanatory variables ordered by percentage of phenotypic variance explained
1 2 3 | plotExplanatoryVariables(object, method = "density", exprs_values = "exprs",
nvars_to_plot = 10, min_marginal_r2 = 0, variables = NULL,
return_object = FALSE, theme_size = 10, ...)
|
object |
an SCESet object containing expression values and experimental information. Must have been appropriately prepared. |
method |
character scalar indicating the type of plot to produce. If "density", the function produces a density plot of R-squared values for each variable when fitted as the only explanatory variable in a linear model. If "pairs", then the function produces a pairs plot of the explanatory variables ordered by the percentage of feature expression variance (as measured by R-squared in a marginal linear model) explained. |
exprs_values |
which slot of the |
nvars_to_plot |
integer, the number of variables to plot in the pairs plot. Default value is 10. |
min_marginal_r2 |
numeric scalar giving the minimal value required for median marginal R-squared for a variable to be plotted. Only variables with a median marginal R-squared strictly larger than this value will be plotted. |
variables |
optional character vector giving the variables to be plotted.
Default is |
return_object |
logical, should an |
theme_size |
numeric scalar giving font size to use for the plotting theme |
... |
parameters to be passed to |
If the method
argument is "pairs", then the function produces
a pairs plot of the explanatory variables ordered by the percentage of
feature expression variance (as measured by R-squared in a marginal linear
model) explained by variable. Median percentage R-squared is reported on the
plot for each variable. Discrete variables are coerced to a factor and
plotted as integers with jittering. Variables with only one unique value are
quietly ignored.
A ggplot object
1 2 3 4 5 6 7 8 9 10 | data("sc_example_counts")
data("sc_example_cell_info")
pd <- new("AnnotatedDataFrame", data = sc_example_cell_info)
rownames(pd) <- pd$Cell
example_sceset <- newSCESet(countData = sc_example_counts, phenoData = pd)
drop_genes <- apply(exprs(example_sceset), 1, function(x) {var(x) == 0})
example_sceset <- example_sceset[!drop_genes, ]
example_sceset <- calculateQCMetrics(example_sceset)
vars <- names(pData(example_sceset))[c(2:3, 5:14)]
plotExplanatoryVariables(example_sceset, variables=vars)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.