colors_scExp: Adding colors to cells & features

View source: R/plotting_functions.R

colors_scExpR Documentation

Adding colors to cells & features

Description

Adding colors to cells & features

Usage

colors_scExp(
  scExp,
  annotCol = "sample_id",
  color_by = "sample_id",
  color_df = NULL
)

Arguments

scExp

A SingleCellExperiment Object

annotCol

Column names to color

color_by

If specifying color_df, column names to color

color_df

Color data.frame to specify which color for which condition

Value

A SingleCellExperiment with additionnal "color" columns in colData

Examples

data("scExp")
scExp = colors_scExp(scExp,annotCol = c("sample_id",
"total_counts"),
 color_by =  c("sample_id","total_counts"))

#Specific colors using a manually created data.frame :
color_df = data.frame(sample_id=unique(scExp$sample_id),
 sample_id_color=c("red","blue","green","yellow"))
scExp = colors_scExp(scExp,annotCol="sample_id",
color_by="sample_id",color_df=color_df)


vallotlab/ChromSCape documentation built on Oct. 15, 2023, 1:47 p.m.