runPseudotime: Calculation of Pseudotime

Description Usage Arguments Value Examples

View source: R/pseudotime.R

Description

calculation of Pseudotime based on KNN

Usage

1
2
3
4
5
6
7
8
runPseudotime(
  object,
  mode = "undirected",
  dim.type = c("raw", "pca", "tsne", "dc", "umap"),
  dim.use = 1:2,
  verbose = FALSE,
  ...
)

Arguments

object

An FSPY object

mode

character. Specifies how igraph should interpret the supplied matrix. Possible values are: directed, undirected, upper, lower, max, min, plus.

dim.type

character. Type of dimensionality reduction method used to calculate pseudotime: raw, umap, tsne, dc and pca. By default is raw.

dim.use

numeric. Dimensions used to calculate pseudotime

verbose

logical. Whether to print calculation progress.

...

Parameters passing to calculation function.

Value

An FSPY object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
if (FALSE) {

fspy <- runPseudotime(fspy, verbose = TRUE, dim.type = "raw")
fspy <- runPseudotime(fspy, verbose = TRUE, dim.type = "umap", dim.use = 1:2)
fspy <- runPseudotime(fspy, verbose = TRUE, dim.type = "tsne", dim.use = 1:2)
fspy <- runPseudotime(fspy, verbose = TRUE, dim.type = "dc", dim.use = 1:3)
fspy <- runPseudotime(fspy, verbose = TRUE, dim.type = "pca", dim.use = 1:3)

# tSNE plot colored by pseudotime
plot2D(fspy, item.use = c("tSNE_1", "tSNE_2"), category = "numeric",
       size = 1, color.by = "pseudotime") +
       scale_colour_gradientn(colors = c("#F4D31D", "#FF3222","#7A06A0"))
# UMAP plot colored by pseudotime
plot2D(fspy, item.use = c("UMAP_1", "UMAP_2"), category = "numeric",
       size = 1, color.by = "pseudotime") +
       scale_colour_gradientn(colors = c("#F4D31D", "#FF3222","#7A06A0"))
}

JhuangLab/flowSpy documentation built on July 15, 2020, 8:31 a.m.