multi_deg: multi_deg

View source: R/4_multi_deg.R

multi_degR Documentation

multi_deg

Description

Do differential analysis according to an expression set and group information.

Usage

multi_deg(
  exp,
  group_list,
  ids = NULL,
  logFC_cutoff = 1,
  pvalue_cutoff = 0.05,
  adjust = TRUE,
  species = "human",
  entriz = TRUE
)

Arguments

exp

A numeric matrix

group_list

A character or factor vector with one label per sample; character input will be converted to factor and unused levels will be dropped.

ids

optional probe-to-symbol annotation table. If 'NULL', 'exp' is treated as a gene-level matrix and no ID conversion is performed.

logFC_cutoff

Cutoff value of logFC,1 by default.

pvalue_cutoff

Cutoff value of pvalue,0.05 by default.

adjust

a logical value; if TRUE, use padj and plot -log10(padj); otherwise use P.value and plot -log10(P.value).

species

choose human, mouse, or rat; default is human

entriz

whether to convert symbols to Entrez IDs

Value

a deg data.frame with one element per contrast

Author(s)

Xiaojie Sun

See Also

get_deg;multi_deg_all

Examples

## Not run: 
if(requireNamespace("Biobase",quietly = TRUE)&
   requireNamespace("AnnoProbe",quietly = TRUE)){
  gse = "GSE474"
  geo = geo_download(gse,destdir=tempdir())
  geo$exp[1:4,1:4]
  geo$exp=log2(geo$exp+1)
  group_list=ifelse(stringr::str_detect(geo$pd$title,"MObese"),
  "MObese",ifelse(stringr::str_detect(geo$pd$title,"NonObese"),
  "NonObese","Obese"))
  group_list=factor(group_list,levels = c("NonObese","Obese","MObese"))
  find_anno(geo$gpl)
  ids <- AnnoProbe::idmap(geo$gpl,destdir = tempdir())
  deg = multi_deg(geo$exp,group_list,ids,adjust = FALSE,entriz = FALSE)
  names(deg)
  head(deg[[1]])
  head(deg[[2]])
  head(deg[[3]])
}else{
  if(!requireNamespace("AnnoProbe",quietly = TRUE)) {
    warning("Package 'AnnoProbe' needed for this function to work.
         Please install it by install.packages('AnnoProbe')",call. = FALSE)
  }
  if(!requireNamespace("Biobase",quietly = TRUE)) {
    warning("Package 'Biobase' needed for this function to work.
         Please install it by BiocManager::install('Biobase')",call. = FALSE)
  }
}

## End(Not run)

tinyarray documentation built on Aug. 2, 2026, 9:07 a.m.