addModuleScore: Add Module Scores to an ArchRProject

View source: R/ModuleScore.R

addModuleScoreR Documentation

Add Module Scores to an ArchRProject

Description

This function calculates a module score from a set of features across all cells. This allows for grouping of multiple features together into a single quantitative measurement. Currently, this function only works for modules derived from the GeneScoreMatrix. Each module is added as a new column in cellColData

Usage

addModuleScore(
  ArchRProj = NULL,
  useMatrix = NULL,
  name = "Module",
  features = NULL,
  nBin = 25,
  nBgd = 100,
  seed = 1,
  threads = getArchRThreads(),
  logFile = createLogFile("addModuleScore")
)

Arguments

ArchRProj

An ArchRProject object.

useMatrix

The name of the matrix to be used for calculation of the module score. See getAvailableMatrices() to view available options.

name

The name to be given to the designated module. If features is a list, this name will be prepended to the feature set names given in the list as shown below.

features

A list of feature names to be grouped into modules. For example, list(BScore = c("MS4A1", "CD79A", "CD74"), TScore = c("CD3D", "CD8A", "GZMB", "CCR7", "LEF1")). Each named element in this list will be stored as a separate module. The examples given in these parameters would yield two modules called Module.Bscore and Module.Tscore. If the elements of this list are not named, they will be numbered in order, i.e. Module1, Module2.

nBin

The number of bins to use to divide all features for identification of signal-matched features for background calculation

nBgd

The number of background features to use for signal normalization.

seed

A number to be used as the seed for random number generation required when sampling cells for the background set. It is recommended to keep track of the seed used so that you can reproduce results downstream.

threads

The number of threads to be used for parallel computing.

logFile

The path to a file to be used for logging ArchR output.


GreenleafLab/ArchR documentation built on Feb. 28, 2024, 4:17 p.m.