plotEmb_rgb: plotEmb_rgb

plotEmb_rgbR Documentation

plotEmb_rgb

Description

Colors the embeddings (t-SNE/Umap) based on the activity of 3 (groups of) regulons

Usage

plotEmb_rgb(
  object,
  regulonNames,
  aucType = "AUC",
  aucMaxContrast = 0.8,
  offColor = "#c0c0c030",
  showPlot = TRUE,
  showLegend = TRUE,
  tSNE_fileName = NULL,
  ...
)

## S4 method for signature 'list'
plotEmb_rgb(
  object,
  regulonNames,
  aucType = "AUC",
  aucMaxContrast = 0.8,
  offColor = "#c0c0c030",
  showPlot = TRUE,
  showLegend = TRUE,
  tSNE_fileName = NULL,
  ...
)

## S4 method for signature 'ScenicOptions'
plotEmb_rgb(
  object,
  regulonNames,
  aucType = "AUC",
  aucMaxContrast = 0.8,
  offColor = "#c0c0c030",
  showPlot = TRUE,
  showLegend = TRUE,
  tSNE_fileName = NULL,
  ...
)

Arguments

object

If 'scenicOptions' it will use the fields: AUC matrix (continuous or binary), and default t-SNE. If 'list', provide list(mat4col=.., emb=...)

regulonNames

Regulons to plot

aucType

"AUC" or "Binary"

aucMaxContrast

To increase the AUC contrast decrease the value.

offColor

Color por the cells completelly off. To deactivate (color as black), set to NULL.

showPlot

Whether to plot the coloured embeddings.

showLegend

Whether to plot add a legend to the plot.

tSNE_fileName

tSNE file name. If null, the default t-SNE is used.

...

Other arguments to pass to the plot function.

Value

The cell colors (invisible)

Examples

par(mfrow=c(1,2))

regulonNames <- c("Dlx1", "Sox8")
cellCol <- plotEmb_rgb(scenicOptions, regulonNames, aucType="AUC", aucMaxContrast=0.6)
text(-5,-23, attr(cellCol,"red"), col="red", cex=.7)
text(-10,-18, attr(cellCol,"green"), col="green", cex=.7)

regulonNames <- list(red=c("Dlx1","Dlx5"),
                     green=c("Neurod1"),
                     blue=c("Sox8"))
cellCol <- plotEmb_rgb(scenicOptions, regulonNames, aucType="Binary")

#OR if already loaded:
mat2col <- readRDS("int/2.2_motifs_AUC.Rds")
emb <- readRDS("int/tSNE_AUC_05pcs_05perpl.Rds")
cellCol <- plotEmb_rgb(list(mat2col=mat2col, emb=emb), regulonNames, aucType="Binary")


aertslab/SCENIC documentation built on April 7, 2024, 10 a.m.