ca_3Dplot: Plot of the first 3 CA dimensions.

Description Usage Arguments Details Value Examples

Description

Plots the first 3 dimensions of the rows and columns in the same plot.

Usage

 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
ca_3Dplot(
  obj,
  xdim = 1,
  ydim = 2,
  zdim = 3,
  princ_coords = 1,
  row_labels = NULL,
  col_labels = NULL,
  ...
)

## S4 method for signature 'cacomp'
ca_3Dplot(
  obj,
  xdim = 1,
  ydim = 2,
  zdim = 3,
  princ_coords = 1,
  row_labels = NULL,
  col_labels = NULL,
  ...
)

## S4 method for signature 'Seurat'
ca_3Dplot(
  obj,
  xdim = 1,
  ydim = 2,
  zdim = 3,
  princ_coords = 1,
  row_labels = NULL,
  col_labels = NULL,
  ...,
  assay = Seurat::DefaultAssay(obj),
  slot = "counts"
)

## S4 method for signature 'SingleCellExperiment'
ca_3Dplot(
  obj,
  xdim = 1,
  ydim = 2,
  zdim = 3,
  princ_coords = 1,
  row_labels = NULL,
  col_labels = NULL,
  ...,
  assay = "counts"
)

Arguments

obj

An object of class "cacomp", or alternatively an object of class "Seurat" or "SingleCellExperiment" with a dim. reduction named "CA" saved.

xdim

Integer. The dimension for the x-axis. Default 1.

ydim

Integer. The dimension for the y-axis. Default 2.

zdim

Integer. The dimension for the z-axis. Default 3.

princ_coords

Integer. If 1 then principal coordinates are used for the rows, if 2 for the columns. Default 1 (rows).

row_labels

Numeric vector. Indices for the rows for which a label should be added (label should be stored in rownames). Default NULL.

col_labels

Numeric vector. Indices for the columns for which a label should be added (label should be stored in colnames). Default NULL (no columns).

...

Further arguments.

assay

SingleCellExperiment assay to obtain counts from.

slot

Seurat slot from assay to get count matrix from.

Details

Depending on whether 'princ_coords' is set to 1 or 2 either the principal coordinates of either the rows (1) or the columns (2) are chosen. For the other the standard coordinates are plotted (assymetric biplot). Labels for rows and columns should be stored in the row- and columnnames respectively.

Value

Plot of class "plotly".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Simulate counts
cnts <- mapply(function(x){rpois(n = 500, lambda = x)},
               x = sample(1:100, 50, replace = TRUE))
rownames(cnts) <- paste0("gene_", 1:nrow(cnts))
colnames(cnts) <- paste0("cell_", 1:ncol(cnts))

# Run correspondence analysis
ca <- cacomp(obj = cnts, princ_coords = 3)

ca_3Dplot(ca)

elagralinska/APLpackage documentation built on Dec. 20, 2021, 4:15 a.m.