adhocGene.TabulateExpression.Gene.10x {MARVEL}R Documentation

Dotplot of gene expression values for a specified gene

Description

Creates a dotplot of average expression value of a specified gene across different cell groups.

Usage

adhocGene.TabulateExpression.Gene.10x(
  MarvelObject,
  cell.group.list,
  gene_short_name,
  log2.transform = TRUE,
  min.pct.cells = 10,
  downsample = FALSE,
  seed = 1
)

Arguments

MarvelObject

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

cell.group.list

List of character strings. Each element of the list is a vector of cell IDs corresponding to a cell group.

gene_short_name

Character string. Gene names whose expression will be plotted.

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 plotting.

min.pct.cells

Numeric value. Percentage of cell expressing the gene in a cell group, below which, the value be re-coded as missing and appear will be omitted from the plot. A gene is considered to be expressed in a given cell if it has non-zero normalised count.

downsample

Logical value. If set to TRUE, the number of cells in each cell group will be down-sampled so that all cell groups will have the same number of cells. The number of cells to down-sample will be based on the smallest cell group. Default is FALSE.

seed

Numeric value. Random number generator to be fixed for down-sampling.

Value

An object of class S3 with new slots MarvelObject$adhocGene$Expression$Gene$Table, MarvelObject$adhocGene$Expression$Gene$Plot, MarvelObject$adhocGene$cell.group.list, and MarvelObject$adhocGene$gene_short_name.

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
                            )

# Gene expression profiling
marvel.demo.10x <- adhocGene.TabulateExpression.Gene.10x(
                        MarvelObject=marvel.demo.10x,
                        cell.group.list=cell.group.list,
                        gene_short_name="TPM2",
                        min.pct.cells=10,
                        downsample=TRUE
                        )

# Check output
marvel.demo.10x$adhocGene$Expression$Gene$Plot
marvel.demo.10x$adhocGene$Expression$Gene$Table

[Package MARVEL version 1.4.0 Index]