CompareValues.Exp {MARVEL}R Documentation

Differential gene expression analysis

Description

Performs differential gene expression analysis between 2 groups of cells.

Usage

CompareValues.Exp(
  MarvelObject,
  cell.group.g1 = NULL,
  cell.group.g2 = NULL,
  downsample = FALSE,
  seed = 1,
  min.cells = 25,
  pct.cells = NULL,
  method,
  method.adjust,
  show.progress = TRUE,
  nboots = 1000,
  custom.gene_ids = NULL,
  mast.method = "bayesglm",
  mast.ebayes = TRUE
)

Arguments

MarvelObject

Marvel object. S3 object generated from TransformExpValues function.

cell.group.g1

Vector of character strings. Cell IDs corresponding to Group 1 (reference group).

cell.group.g2

Vector of character strings. Cell IDs corresponding to Group 2.

downsample

Logical value. If set to TRUE, the number of cells in each cell group will be downsampled to the sample size of the smaller cell group so that both cell groups will have the sample size prior to differential expression analysis. Default is FALSE.

seed

Numeric value. The seed number for the random number generator to ensure reproducibility during during down-sampling of cells when downsample set to TRUE.

min.cells

Numeric value. The minimum no. of cells expressing the gene for the gene to be included for differential splicing analysis.

pct.cells

Numeric value. The minimum no. of cells expressing the gene for the gene to be included for differential splicing analysis. If pct.cells is specified, then pct.cells will be used as threshold instead of min.cells.

method

Character string. Statistical test to compare the 2 groups of cells. "ks", "kuiper", "ad", "dts", "wilcox", and "t.test" for Kolmogorov-Smirnov, Kuiper, Anderson-Darling, DTS, Wilcox, and t-test, respectively. Additional option is "mast". If set to "mast" is specified, the log2fc and p-values will be corrected using the gene detection rate as per the MAST package tutorial.

method.adjust

Character string. Adjust p-values for multiple testing. Options available as per p.adjust function.

show.progress

Logical value. If set to TRUE, progress bar will be displayed so that users can estimate the time needed for differential analysis. Default value is TRUE.

nboots

Numeric value. When method set to "dts", the number of bootstrap iterations for computing the p-value.

custom.gene_ids

Character string. Instead of specified the genes to include for DE analysis with min.cells, users may input a custom vector of gene IDs to include for DE analysis.

mast.method

Character string. As per the method option of the zlm function from the MAST package. Default is "bayesglm", other options are "glm" and "glmer".

mast.ebayes

Logical value. As per the ebayes option of the zlm function from the MAST package. Default is TRUE.

Value

An object of class S3 new slot MarvelObject$DE$Exp$Table.

Examples

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

# Define cell groups for analysis
df.pheno <- marvel.demo$SplicePheno
cell.group.g1 <- df.pheno[which(df.pheno$cell.type=="iPSC"), "sample.id"]
cell.group.g2 <- df.pheno[which(df.pheno$cell.type=="Endoderm"), "sample.id"]

# DE
marvel.demo <- CompareValues.Exp(MarvelObject=marvel.demo,
                                 cell.group.g1=cell.group.g1,
                                 cell.group.g2=cell.group.g2,
                                 min.cells=5,
                                 method="t.test",
                                 method.adjust="fdr",
                                 show.progress=FALSE
                                 )

# Check output
head(marvel.demo$DE$Exp$Table)

[Package MARVEL version 1.4.0 Index]