Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/plotBinaryHeat.R
Plot a heatmap binarized values for a select set of genes or peaks across all cells. Optionally also cluster those genes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
exp |
A matrix of *binary* (0s and 1s) expression values. For example, the one
found in |
classes |
A vector or factor of cell classes, whose length is equal to
|
markers |
A character vector of gene or peak names to plot in the heatmap. |
colors |
Color palette used for the heatmap. |
newOrder |
Reorder the clusters in the heatmap? See Examples. |
clusterGenes |
Cluster genes before plotting? |
clusterGenesK |
How many clusters should genes by clustered into? See Details. |
averageCells |
Plot averages of cells instead of individual cells. You can use this when you have a large number of cells. See Details. |
outs |
Should gene cluster output and pheatmap object be returned? FALSE by default. |
plotheat |
Should the heatmap be drawn? TRUE by default. |
gaps |
Should the heatmap have gaps between cell types and gene clusters? TRUE by default. |
seed |
Randomization seed used for gene clustering initialization. |
plotBinaryHeat
is similar to plotMarkerHeat
but works on
the binarized matrix, plotting only 0s and 1s (for scRNA-Seq, this means ignoring
expression values and just plotting whether the gene is expressed or not).
If averageCells
is > 1, the fraction of the averaged cells where the gene
or peak was detected will be plotted (a number between 0 and 1).
clusterGenesK
parameter controls the number of gene clusters when
clusterGenes
is TRUE
. By default, it is equal to the number of
cell types/clusters.
By default, the heatmap plots every single cell in one column, this might
take forever if you have a lot of cells (would say >10k) or it can crash when
you do not have enough RAM. If so, it might be good to set averageCells
to n
where n
is the number of cells you
want to average. For example, if averageCells = 10
, every 10 cells will
be averaged (without averaging across cell clusters) before plotting the heatmap.
if averageCells =< 1
, no averaging happens. Hints: (1) If you want one column
per cell cluster, set averageCells
to a very high number (larger than the
number of cells in the largest cluster). (2) Gene clustering occurs after cell
averaging, so averaging will be useful in this case to prevent running k-means on
binary values.
If outs
is TRUE, plotMarkerHeat
returns a list
containing:
p |
The pheatmap object corresponding to the plot. |
gene_class_info |
Gene cluster assignments if gene clustering was requested. See Details. |
new_class_info |
The new order of cell clusters. See Examples. |
Mahmoud M Ibrahim <mmibrahim@pm.me>
plotMarkerHeat
1 2 3 4 5 6 | data(kidneyTabulaMuris)
gs = sortGenes(kidneyTabulaMuris$exp, kidneyTabulaMuris$cellType)
mm = getMarkers(gs, quant = 0.999)
#this plots a heatmap without reordering genes
plotBinaryHeat(gs$binary, gs$inputClass, mm$markers)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.