percentage: normalized percent inhibition/activation

Description Usage Arguments Details Value Methods (by class) Grouping variables Grouped data frames (dplyr package)

View source: R/fun-percentage.R

Description

Calculate normalized percent inhibition (NPI) or activation (NPA) for variable(s) in a data frame.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
percentage(
  x,
  variables,
  positive,
  negative,
  mode = c("inhibition", "activation")
)

## S3 method for class 'data.frame'
percentage(
  x,
  variables,
  positive,
  negative,
  mode = c("inhibition", "activation")
)

## S3 method for class 'grouped_df'
percentage(
  x,
  variables,
  positive,
  negative,
  mode = c("inhibition", "activation")
)

Arguments

x

a data frame

variables

column to process

positive

logical predicate to define positive control observations (max inhibition); bare or string

negative

logical predicate to define negative control observations (no inhibition); bare or string

mode

character that decides whether to calculate normalized percent inhibition or normalized percent activation

Details

NPI is the extent to which the signal of interest is diminished compared to a positive control:

NPI = (Neg - x) / (Neg - Pos) * 100%

NPA is the extent to which the signal is activated compared to a positive control:

NPA = (x - Neg) / (Pos - Neg) * 100%

This is a method of data normalization in a high throughput screening campaign.

Value

a modified data.frame

Methods (by class)

Grouping variables

Grouped data frames (class grouped_df) may cause problems if grouping variables are used to define positive and negative controls. It is best to create a separate variable to base the positive and negative predicates on.

Grouped data frames (dplyr package)

The method for class grouped_df is home made because the native behavior of grouped data frames does not readily support functions that return data frames.


olobiolo/siscreenr documentation built on Nov. 26, 2021, 3:08 p.m.