View source: R/function_plot_heatmap.R
ggplot_heatmap | R Documentation |
For a DTD.model the 'ggplot_heatmap' function visualizes
diag(g) * X
on a subset of features as a clustered heatmap.
Feature subsetting can either be done by a vector of strings,
that match the feature names of X.
Alternatively, via 'explained correlation':
In order to assess the importance of a feature in the deconvolution process,
we can exclude the feature from a trained model, and observe the change of
correlaion on a test set. If the correlation e.g. decreases by 1
explains 1
The 'ggplot_heatmap' function iteratively excludes each feature from the
trained model, resulting in a ranking for the genes.
ggplot_heatmap( DTD.model, X.matrix = NA, test.data = NULL, estimate.c.type = "decide.on.model", title = "", feature.subset = 100, log2.expression = TRUE )
DTD.model |
either a numeric vector with length of nrow(X), or a list
returned by |
X.matrix |
numeric matrix, with features/genes as rows, and cell types as column. Each column of X.matrix is a reference expression profile. A trained DTD model includes X.matrix, it has been trained on. Therefore, X.matrix should only be set, if the 'DTD.model' is not a DTD model. |
test.data |
list, with two entries, a numeric matrix each,
named 'mixtures' and 'quantities' For examples see |
estimate.c.type |
string, either "non_negative", or "direct". Indicates how the algorithm finds the solution of arg min_C ||diag(g)(Y - XC)||_2.
|
title |
string, additionally title |
feature.subset |
numeric or a vector of strings. If it is a numeric, "subset" features will be picked from the explained correlation' ranking (if 'feature.subset' <= 1, this is the fraction of feature, if 'feature.subset' > 1 it is the total amount). If it is a vector of strings, these features will be used (if they intersect with rownames(X.matrix)) |
log2.expression |
logical, in the heatmap, should the values be log transformed? |
For an example see section "Explained correlation" in the package vignette 'browseVignettes("DTD")'
ggplot object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.