PlotValues.PCA.Gene.10x {MARVEL}R Documentation

Annotate reduced dimension space with gene expression values

Description

Annotates reduced dimension space, e.g., UMAP and tSNE, with gene expression values. Values will be automatically be log2-transformed prior to plotting.

Usage

PlotValues.PCA.Gene.10x(
  MarvelObject,
  cell.ids = NULL,
  gene_short_name,
  log2.transform = TRUE,
  point.size = 0.1,
  color.gradient = c("grey90", "blue", "red"),
  type
)

Arguments

MarvelObject

Marvel object. S3 object generated from CheckAlignment.10x function.

cell.ids

Vector of character strings. Specify specific cells to plot.

gene_short_name

Character string. Gene name whose expression will be plotting.

log2.transform

Logical value. If set to TRUE (default), normalised gene expression values will be off-set by 1 and then log2-transformed prior to analysis.

point.size

Numeric value. Size of data points. Default is 1.

color.gradient

Vector of character strings. Colors to indicate low, moderate, and high expression. Default is c("grey90","blue","red").

type

Character string. Type of reduced dimension space. Options are "umap" and "tsne".

Value

An object of class S3 with new slot MarvelObject$adhocPlot$PCA$Gene.

Examples


marvel.demo.10x <- readRDS(system.file("extdata/data",
                               "marvel.demo.10x.rds",
                               package="MARVEL")
                               )

# Define cell groups
    # Retrieve sample metadata
    sample.metadata <- marvel.demo.10x$sample.metadata

    # iPSC
    index <- which(sample.metadata$cell.type=="iPSC")
    cell.ids.1 <- sample.metadata[index, "cell.id"]
    length(cell.ids.1)

    # Cardio day 10
    index <- which(sample.metadata$cell.type=="Cardio day 10")
    cell.ids.2 <- sample.metadata[index, "cell.id"]
    length(cell.ids.2)

    # Save into list
    cell.group.list <- list("iPSC"=cell.ids.1,
                            "Cardio d10"=cell.ids.2
                            )

# Plot expression
marvel.demo.10x <- PlotValues.PCA.Gene.10x(
                      MarvelObject=marvel.demo.10x,
                      gene_short_name="TPM2",
                      color.gradient=c("grey","cyan","green","yellow","red"),
                      type="tsne"
                      )

# Check output
marvel.demo.10x$adhocPlot$PCA$Gene

[Package MARVEL version 1.4.0 Index]