calculateFitnessScore: Calculate fitness scores.

View source: R/calculateFitnessScore.R

calculateFitnessScoreR Documentation

Calculate fitness scores.

Description

Using sequence counts before and after selection, calculate fitness scores as described by Diss and Lehner (2018).

Usage

calculateFitnessScore(
  se,
  pairingCol,
  ODCols,
  comparison,
  WTrows,
  selAssay = "counts"
)

Arguments

se

SummarizedExperiment object as returned by summarizeExperiment.

pairingCol

Name of column in colData(se) with replicate/pairing information. Samples with the same value in this column will be paired.

ODCols

Name(s) of column(s) in colData(se) with OD values (numeric), used to normalize for different numbers of cells.

comparison

3-element character vector of the form (column, numerator, denominator). column is the name of the column in colData(se) with experimental conditions. numerator and denominator define the comparison, e.g. c("cond", "output", "input") will look in the "cond" column and calculate fitness for the ratio of "output" over "input" counts.

WTrows

Vector of row names that will be used as the reference when calculating fitness scores. If more than one value is provided, the average of the corresponding fitness scores is used as a reference. If NULL, no division by WT scores will be done.

selAssay

Assay to select from se for the analysis.

Value

A numeric vector with fitness scores.

Author(s)

Michael Stadler and Charlotte Soneson

References

"The genetic landscape of a physical interaction." Diss G and Lehner B. Elife. 2018;7:e32472. doi: 10.7554/eLife.32472.

Examples

se <- readRDS(system.file("extdata", "GSE102901_cis_se.rds", 
                          package = "mutscan"))
## Check that the wildtype sequence is present in the data
stopifnot("f.0.WT" %in% rownames(se))
## Calculate PPI scores as defined in Diss & Lehner (2018)
ppis <- calculateFitnessScore(
    se = se, pairingCol = "Replicate", 
    ODCols = c("OD1", "OD2"),
    comparison = c("Condition", "cis_output", "cis_input"),
    WTrows = "f.0.WT")
## Matrix with PPI scores for each replicate
head(ppis)


fmicompbio/mutscan documentation built on Nov. 18, 2024, 11:42 p.m.