computeMedianCV: Compute the median coefficient of variation (CV) per cell

Description Usage Arguments Details Value Examples

View source: R/compute_metrics.R

Description

The function computes for each cell the median CV. The expression data is normalized twice. First, cell median expression is used as normalization factor, then, the mean for each batch and peptide. The CV is then computed for each protein in each cell. CV is the standard deviation divided by the mean expression. The CV is computed only if there are more than 5 observations per protein per cell.

Usage

1
computeMedianCV(object, i, peptideCol, proteinCol, batchCol)

Arguments

object

A QFeatures object

i

A numeric() or character() vector indicating from which assays the rowData should be taken.

peptideCol

A character(1) indicating the variable name in the rowData that contains the peptide grouping.

proteinCol

A character(1) indicating the variable name in the rowData that contains the protein grouping.

batchCol

A character(1) indicating the variable name in the colData of object that contains the batch names.

Details

A new columns, .medianCV, is added to the colData of the assay i and contains the computed median CVs.

Watch out that peptideCol and proteinCol are feature variables and hence taken from the rowData. batchCol is a sample variable and is taken from the colData of the QFeatures object.

Value

A QFeatures object.

Examples

1
2
3
4
5
6
7
8
data("scp1")
scp1 <- computeMedianCV(scp1, 
                        i = "peptides", 
                        proteinCol = "protein", 
                        peptideCol = "peptide", 
                        batchCol = "Set")
## Check results
hist(scp1[["peptides"]]$.MedianCV)

scp documentation built on Nov. 8, 2020, 8:20 p.m.