calculateScore: Calculate a signature Z-score for a set of genes in a single...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/calculateScore.R

Description

Given a gene set of interest, it is often desirable to summarize the expression of that gene set using a single integrated score. The calculateScore method calculates the geometric mean of the expression level of all positive genes, minus the geometric mean of the expression level of all negative genes. The resulting scores are then standardized within the given dataset, such that the output Z-score has mean=0 and std. dev=1. Such a Z-score can then be used for classification, etc.

Usage

1
calculateScore(filterObject, datasetObject, suppressMessages=FALSE)

Arguments

filterObject

a MetaFilter object generated with filterGenes() containing the signature genes that will be used for Z-score calculation.

datasetObject

A Dataset object for which the signature score (Z-score) will be calculated. This vector would typically be added as $score column in datasetObject$pheno.

suppressMessages

Boolean value (TRUE/FALSE) about whether to display verbose output. Default: FALSE.

Details

The Z-score is based off of the geometric mean of expression. As such, negative expression values are not allowed. A dataset is thus always scaled by its minimum value + 1, such that the lowest value = 1. Any individual NANs or NAs are also set to 1. If a dataset does not have any information on a given gene, the entire gene is simply left out of the score. When run, the function will print to command line the number of genes used, and the number passed in. Although mostly used internally, the function has been exported in case users want to compare multiple classes, etc., using the same Z-score as is used for producing two-class comparisons.

Value

A vector of Z-scores, of length ncols(datasetObject$expr) (and in the same order).

Author(s)

Timothy E. Sweeney, Winston A. Haynes

See Also

filterGenes

Examples

1
calculateScore(tinyMetaObject$filterResults[[1]], tinyMetaObject$originalData[[1]]) 

Example output

Setting options('download.file.method.GEOquery'='auto')
Setting options('GEOquery.inmemory.gpl'=FALSE)
Used  12 of  12  pos genes, and  12  of  12  neg genes 
 [1] -0.0368751851 -0.6020044097 -0.5513565075 -0.5866201321 -0.9698476606
 [6] -2.0804966564 -1.2054913468 -1.1558144628 -1.3442181996 -1.4135823116
[11] -0.7198300541 -0.6000205779 -0.5161248696 -0.2802112616 -0.4599396160
[16] -0.4787587074 -0.5268244844 -0.0144851211  2.4176491798 -0.0239641426
[21]  0.7098962683  0.5779776234  0.2399580189  1.8610497218  0.1528021159
[26]  0.9723652371 -0.7925246052  0.7637159735 -0.4897106073 -0.8781241583
[31] -0.0007219094  0.3010696103  0.8591636322  0.1048576615  1.5419799314
[36]  0.8892775276  0.8679666895  1.2223086284  1.4420809948  0.9479959323
[41]  0.3282847141 -0.3322445439 -1.4406960839 -1.0353251021  2.1235120881
[46]  0.4669703921 -0.6445100889 -0.7975279672  1.1869688320

MetaIntegrator documentation built on March 26, 2020, 6:29 p.m.