OnOff: On/off score

View source: R/OnOff.R

OnOffR Documentation

On/off score

Description

This function calculates the on/off score for cell transitions. The score takes into account the cell type spcefific and most variable portion of the detected transcriptome. It can be calculated for a sample or group of samples representing specific (standard or engineered) cell type.

Usage

OnOff(
  eset,
  cell.change,
  out.put = c("marker.list", "individual"),
  min.diff.cutoff = 0.8,
  test.cutoff = 0.95
)

Arguments

eset

an ExpressionSet containing data matrices of normalized expression data, present/absent calls, a gene annotation data frame and a phenotype data frame.

cell.change

a data frame containing three columns, one for the start (donor) test and target cell type. Each row of the data frame describes one transition from the start to a target cell type.

out.put

a character flag with two possible values, "marker.list" and "individual". The former means the on/off scores will be aggregated accross cell groups and also the marker genes for each cell transition (in cell.change) will be calculated, while the latter will generate the on/off scores for all individual samples.

min.diff.cutoff

a real number that represents the minimum difference between the fraction of present calls in donor vs target (in the standards), in order to define the markers for a given cell transition. Default is 0.8.

test.cutoff

a real number in (0, 1] that is the minimum fraction of present calls in a test sample/group to decide if a gene is present in a test sample/group. Default is stringently set at 0.95.

Value

This function returns a list of two objects, as follows:

scores

a data.frame of on/off scores for each cell group given in cell.change(out.put="marker.list") or for each individual sample (out.put="idividual")

markers

a list of marker genes for the selected cell transitions in cell.change (out.put="marker.list") or NULL (out.put="individual")

See Also

hgu133plus2CellScore for details on the specific ExpressionSet object that shoud be provided as an input.

Examples

## Load the expression set for the standard cell types
library(Biobase)
library(hgu133plus2CellScore) # eset.std

## Locate the external data files in the CellScore package
rdata.path <- system.file("extdata", "eset48.RData", package = "CellScore")
tsvdata.path <- system.file("extdata", "cell_change_test.tsv",
                            package = "CellScore")

if (file.exists(rdata.path) && file.exists(tsvdata.path)) {

   ## Load the expression set with normalized expressions of 48 test samples
   load(rdata.path)

   ## Import the cell change info for the loaded test samples
   cell.change <- read.delim(file= tsvdata.path, sep="\t",
                             header=TRUE, stringsAsFactors=FALSE)

   ## Combine the standards and the test data
   eset <- combine(eset.std, eset48)

   ## Generate a marker list
   group.OnOff <- OnOff(eset, cell.change, out.put="marker.list")

   ## Calculate the on/off scores for individual samples
   individ.OnOff <- OnOff(eset, cell.change, out.put="individual")
}

nmah/CellScore documentation built on May 4, 2023, 2:52 p.m.