tissue_scMappR_internal: Gene List Visualization and Enrichment (Internal)

Description Usage Arguments Details Value Examples

View source: R/tissue_scMappR_internal.R

Description

This function loops through every signature matrix in a particular tissue and generates heatmaps, cell-type preferences, and co-enrichment.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
tissue_scMappR_internal(
  gene_list,
  species,
  output_directory,
  tissue,
  rda_path = "",
  cluster = "Pval",
  genecex = 0.01,
  raw_pval = FALSE,
  path = NULL,
  toSave = FALSE,
  drop_unkown_celltype = FALSE
)

Arguments

gene_list

A list of gene symbols, mouse or human.

species

"mouse", "human" or "-9" if using a precomputed signature matrix.

output_directory

If toSave = TRUE, the name of the output directory that would be built.

tissue

Name of the tissue in "get_tissues".

rda_path

Path to the .rda file containing all of the signature matrices.

cluster

'Pval' or 'OR' depending on if you wantto cluster odds ratios or pvalues of CT preferences.

genecex

The size of the gene names of the rows in the heatmap.

raw_pval

If the inputted signature matrix are raw (untransformed) p-values – recommended to generate rank first (T/F).

path

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

toSave

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

drop_unkown_celltype

Whether or not to remove "unknown" cell-types from the signature matrix (T/F).

Details

This function takes a list of genes and a tissue that is contained in current signature matrices before and generating heatmaps of cell-type preferences. It then completes cell-type enrichment of each individual cell-type, then, if more than two cell-types are signficiantly enriched, co-enrichemnt of those enriched cell-types is then computed.

Value

List with the following elements:

background_heatmap

Data frame of the entire gene by cell-type signature matrix inputted.

gene_list_heatmap

Data frame of inputted signature matrix subsetted by input genes.

single_celltype_preferences

Data frame of enriched cell-types.

group_celtype_preference

Data frame of groups of cell-types enriched by the same genes.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(POA_example) # region to preoptic area
Signature <- POA_example$POA_Rank_signature # signature matrix
rowname <- get_gene_symbol(Signature) # get signature
rownames(Signature) <- rowname$rowname
genes <- rownames(Signature)[1:60]
rda_path1 = "" # data directory (if it exists)

# set toSave = TRUE and path = output directory of your choice
internal <- tissue_scMappR_internal(genes, "mouse", output_directory = "scMappR_TesInternal",
                                   tissue = "hypothalamus", toSave = FALSE) 

 

DustinSokolowski/scMappR documentation built on July 7, 2020, 5:44 p.m.