draw_heatmap2: draw heatmap plots

View source: R/6_multi_deg_all.R

draw_heatmap2R Documentation

draw heatmap plots

Description

print heatmap plots for expression matrix and group by group_list paramter

Usage

draw_heatmap2(exp, group_list, deg, my_genes = NULL, heat_union = TRUE, ...)

Arguments

exp

A numeric matrix

group_list

A factor with duplicated character or factor

deg

a data.frame created by Differential analysis

my_genes

genes for pheatmap

heat_union

logical ,use union or intersect DEGs for heatmap

...

other parameters from draw_heatmap

Value

a heatmap plot according to exp and grouped by group.

Author(s)

Xiaojie Sun

See Also

draw_pca;draw_volcano;draw_venn

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)
  draw_heatmap2(geo$exp,group_list,deg)
}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 June 22, 2024, 9:58 a.m.