process_dgTMatrix_lists: Count Matrix To Signature Matrix

Description Usage Arguments Details Value Examples

View source: R/process_dgTMatrix_lists.R

Description

This function takes a list of count matrices, processes them, calls cell-types, and generates signature matrices.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
process_dgTMatrix_lists(
  dgTMatrix_list,
  name,
  species_name,
  naming_preference = -9,
  rda_path = "",
  panglao_set = FALSE,
  haveUMAP = FALSE,
  saveSCObject = FALSE,
  internal = FALSE,
  toSave = FALSE,
  path = NULL,
  use_sctransform = FALSE,
  test_ctname = "wilcox",
  genes_integrate = 2000,
  genes_include = FALSE
)

Arguments

dgTMatrix_list

A list of matrices in the class of dgTMatrix object – sparce object – compatible with Seurat rownames should be of the same species for each.

name

The name of the outputted signature matrices, cell-type preferences, and seurat objects if you choose to save them.

species_name

Mouse or human symbols, -9 if internal as panglao objects have gene symbol and ensembl strapped together.

naming_preference

For cell-type naming, see if cell-types given the inputted tissues are more likely to be named within one of the categories of get_naming_preference_options().

rda_path

If saved, directory to where data from scMappR_data is downloaded.

panglao_set

If the inputted matrices are from Panglao (i.e. if they're internal).

haveUMAP

Save the UMAPs – only use if the package is downloaded with pip.

saveSCObject

Save the Seurat object as an RData object (T/F).

internal

Was this used as part of the internal processing of Panglao datasets (T/F).

toSave

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

path

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

use_sctransform

If you should use sctransform or the Normalize/VariableFeatures/ScaleData pipeline (T/F).

test_ctname

statistical test for calling CT markers – must be in Seurat

genes_integrate

The number of genes to include in the integration anchors feature when combining datasets – passed into process_from_count

genes_include

TRUE or FALSE – include 2000 genes in signature matrix or all matrix.

Details

This function is a one line wrapper to process count matrices into a signature matrix. It combines process_from_count, two methods of identifying cell-type identities (GSVA and Fisher's test). Then, it takes the output of cell-type markers and converts it into a signature matrix of p-value ranks and odds ratios. Along the way, it saves the Seurat object (if chosen with saveSCObject), cell-type identites from GSVA (its own obect), and the signature matrices. Cell-type marker outputs are also saved in the generes.RData list. Names of the generes objects and the signature matrices are kept.

Value

List with the following elements:

wilcoxon_rank_mat_t

A dataframe containing the signature matrix of ranks (-log10(Padj) * sign(fold-change)).

wilcoxon_rank_mat_or

A dataframe containing the signature matrix of odds-ratios.

generes

All cell-type markers for each cell-type with p-value and fold changes.

Examples

1
2
3
4
data(sm)
toProcess <- list(example = sm)
tst1 <- process_dgTMatrix_lists(toProcess, name = "testPropcess", species_name = -9,
 naming_preference = "eye", rda_path = "")

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