heatmap_generation: Generate Heatmap

View source: R/heatmap_generation.R

heatmap_generationR Documentation

Generate Heatmap

Description

This function takes an inputted signature matrix as well as a list of genes and overlaps them. Then, if there is overlap, it prints a heatmap or barplot (depending on the number of overlapping genes). Then, for every cell-type, genes considered over-represented are saved in a list.

Usage

heatmap_generation(
  genesIn,
  comp,
  reference,
  cex = 0.8,
  rd_path = "",
  cellTypes = "ALL",
  pVal = 0.01,
  isPval = TRUE,
  isMax = FALSE,
  isBackground = FALSE,
  which_species = "human",
  toSave = FALSE,
  path = NULL
)

Arguments

genesIn

A list of gene symbols (all caps) to have their cell type enrichment.

comp

The name of the comparison.

reference

Path to signature matrix or the signature matrix itself.

cex

The size of the genes in the column label for the heatmap.

rd_path

The directory to RData files – if they are not in this directory, then the files will be downloaded.

cellTypes

Colnames of the cell-types you will extract (passed to extract_genes_cell).

pVal

The level of association a gene has within a cell type (passed to extract_genes_cell).

isPval

If the signature matrix is raw p-value (T/F) – TRUE not recommended

isMax

If you are taking the single best CT marker (T/F) – TRUE not recommended

isBackground

If the heatmap is from the entire signature matrix or just the inputted gene list (T/F). isBackground == TRUE is used for internal.

which_species

Species of gene symbols – "human" or "mouse" .

toSave

Allow scMappR to write files in the path directory (T/F).

path

If toSave == TRUE, path to the directory where files will be saved.

Value

List with the following elements:

genesIn

Vector of genes intersecting gene list and signature matrix.

genesNoIn

Vector of inputted genes not in signature matrix.

geneHeat

Signature matrix subsetted by inputted gene list

preferences

Cell-markers mapping to cell-types.

Examples



# load in signature matrices
data(POA_example)
POA_generes <- POA_example$POA_generes
POA_OR_signature <- POA_example$POA_OR_signature
POA_Rank_signature <- POA_example$POA_Rank_signature
Signature <- POA_Rank_signature
rowname <- get_gene_symbol(Signature)
rownames(Signature) <- rowname$rowname
genes <- rownames(Signature)[1:100]
heatmap_test <- heatmap_generation(genesIn = genes, "scMappR_test",
                                   reference = Signature, which_species = "mouse")

 


scMappR documentation built on July 9, 2023, 6:26 p.m.