plot2D {flowSpy} | R Documentation

## Visualization of 2D data of FSPY

### Description

Visualization of 2D data of FSPY

### Usage

    plot2D(
      object,
      item.use = c("PC_1", "PC_2"),
      color.by = "stage",
      order.by = NULL,
      size = 1,
      alpha = 1,
      category = "categorical",
      show.cluser.id = FALSE,
      show.cluser.id.size = 4,
      main = "2D plot of FSPY",
      plot.theme = theme_bw()
    )

### Arguments

`object` | An FSPY object
`item.use` | character. Items use to 2D plot, axes x and y must be numeric.
`color.by` | character. Dot or mesh color by which character. It can be one of the column of plot.meta, or it can be just "density" (the default value).
`order.by` | vector. Order of color theme.
`size` | numeric. Size of the dot
`alpha` | numberic. Transparency (0-1) of the dot, default is 1.
`category` | character. numeric or categorical
`show.cluser.id` | logical. Whether to show cluster id in the plot.
`show.cluser.id.size` | numeric. Size of the cluster id.
`main` | character. Title of the plot.
`plot.theme` | themes from `ggplot2`

### Value

ggplot2 figure

### Examples

    if (FALSE) {

    # Default plot
    plot2D(fspy)

    # PCA plot
    plot2D(fspy, item.use = c("PC_1", "PC_2"))
    plot2D(fspy, item.use = c("PC_1", "PC_2"), color.by = "cluster.id")
    plot2D(fspy, item.use = c("PC_1", "PC_2"), color.by = "stage")
    plot2D(fspy, item.use = c("PC_2", "PC_3"), color.by = "stage") +
      scale_color_manual(values = c("#00599F","#009900","#FF9933",
                                    "#FF99FF","#7A06A0","#FF3222"))
    plot2D(fspy, item.use = c("PC_2", "PC_3"), color.by = "CD43",
           category = "numeric")
    plot2D(fspy, item.use = c("PC_2", "PC_3"), color.by = "CD43",
           category = "numeric") +
           scale_colour_gradientn(colors = c("blue","white","red"))

    # tSNE plot
    plot2D(fspy, item.use = c("tSNE_1", "tSNE_2"))
    plot2D(fspy, item.use = c("tSNE_1", "tSNE_2"), color.by = "stage")
    plot2D(fspy, item.use = c("tSNE_1", "tSNE_2"), color.by = "cluster.id",
           alpha = 0.5, main = "tSNE Plot")
    plot2D(fspy, item.use = c("tSNE_1", "tSNE_2"), color.by = "cluster.id",
           alpha = 1, main = "tSNE Plot", show.cluser.id = T)
    plot2D(fspy, item.use = c("tSNE_1", "tSNE_2"), color.by = "CD43",
           category = "numeric", size = 3) +
           scale_colour_gradientn(colors = c("blue","white","red"))
    plot2D(fspy, item.use = c("tSNE_1", "tSNE_2"), color.by = "stage") +
      scale_color_manual(values = c("#00599F","#009900","#FF9933",
                                    "#FF99FF","#7A06A0","#FF3222"))

    # Diffusion Map plot
    plot2D(fspy, item.use = c("DC_1", "DC_2"))
    plot2D(fspy, item.use = c("DC_1", "DC_2"), color.by = "stage")
    plot2D(fspy, item.use = c("DC_2", "DC_3"), color.by = "cluster.id",
           alpha = 0.5, main = "Diffusion Map Plot")
    plot2D(fspy, item.use = c("DC_2", "DC_3"), color.by = "cluster.id",
           alpha = 1, main = "Diffusion Map Plot", show.cluser.id = T)
    plot2D(fspy, item.use = c("DC_1", "DC_2"), color.by = "CD43",
           category = "numeric", size = 3) +
           scale_colour_gradientn(colors = c("blue","white","red"))

    # UMAP plot
    plot2D(fspy, item.use = c("UMAP_1", "UMAP_2"))
    plot2D(fspy, item.use = c("UMAP_1", "UMAP_2"), color.by = "stage")
    plot2D(fspy, item.use = c("UMAP_1", "UMAP_2"), color.by = "cluster.id",
           alpha = 0.5, main = "UMAP Plot")
    plot2D(fspy, item.use = c("UMAP_1", "UMAP_2"), color.by = "cluster.id",
           alpha = 1, main = "UMAP Plot", show.cluser.id = T)
    plot2D(fspy, item.use = c("UMAP_1", "UMAP_2"), color.by = "CD43",
           category = "numeric", size = 3) +
           scale_colour_gradientn(colors = c("blue","white","red"))
    plot2D(fspy, item.use = c("UMAP_1", "UMAP_2"), color.by = "stage") +
      scale_color_manual(values = c("#00599F","#009900","#FF9933",
                                    "#FF99FF","#7A06A0","#FF3222"))

    # Marker Plot
    plot2D(fspy, item.use = c("CD43", "CD90"), color.by = "cluster.id")
    plot2D(fspy, item.use = c("CD34", "CD90"), color.by = "CD43",
           category = "numeric", size = 3) +
           scale_colour_gradientn(colors = c("blue","white","red"))

    # Pseudotime
    plot2D(fspy, item.use = c("pseudotime", "CD43"), color.by = "stage")

    }

[Package flowSpy version 1.4.0 Index]