Description Usage Arguments Details Value Methods (by class) Grouping variables Grouped data frames (dplyr package)
View source: R/fun-percentage.R
Calculate normalized percent inhibition (NPI) or activation (NPA) for variable(s) in a data frame.
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")
)
|
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 |
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.
a modified data.frame
data.frame
: uses positive
and negative
to calculate mean reference values,
runs function for NPI or NPA over desired variables with lapply
,
then cbind
s the result to x
grouped_df
: see data.frame__to__grouped_df
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.
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.