synchronizeAssays: Synchronize assay colormaps to match those in a...

Description Usage Arguments Details Value Author(s) Examples

View source: R/ExperimentColorMap.R

Description

This function returns an updated ExperimentColorMap in which colormaps in the assays slot are ordered to match the position of their corresponding assay in the SingleCellExperiment object. Assays in the SingleCellExperiment that do not have a match in the ExperimentColorMap are assigned the appropriate default colormap.

Usage

1

Arguments

ecm

An ExperimentColorMap.

se

A SingleCellExperiment.

Details

It is highly recommended to name all assays in both ExperimentColorMap and SummarizedExperiment prior to calling this function, as this will facilitate the identification of matching assays between the two objects. In most cases, unnamed colormaps will be dropped from the new ExperimentColorMap object.

The function supports three main situations:

Value

An ExperimentColorMap with colormaps in the assay slot synchronized to match the position of the corresponding assay in the SingleCellExperiment.

Author(s)

Kevin Rue-Albrecht

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Example ExperimentColorMap ----

count_colors <- function(n){
  c("black","brown","red","orange","yellow")
}
fpkm_colors <- viridis::inferno

ecm <- ExperimentColorMap(
    assays = list(
        counts = count_colors,
        tophat_counts = count_colors,
        cufflinks_fpkm = fpkm_colors,
        rsem_counts = count_colors,
        orphan = count_colors,
        orphan2 = count_colors,
        count_colors,
        fpkm_colors
    )
)

# Example SingleCellExperiment ----

library(scRNAseq)
sce <- ReprocessedAllenData(assays="tophat_counts")
library(scater)
sce <- logNormCounts(sce, exprs_values="tophat_counts")
sce <- runPCA(sce)
sce <- runTSNE(sce)

# Example ----

ecm_sync <- synchronizeAssays(ecm, sce)

iSEE documentation built on Feb. 3, 2021, 2:01 a.m.