compute_FDR_from_asymmetry: Compute the FDR from the asymmetry of the volcano plot

View source: R/Main_functions.R

compute_FDR_from_asymmetryR Documentation

Compute the FDR from the asymmetry of the volcano plot

Description

Compute the FDR (False Discovery Rate) using the asymmetry of the volcano plot. It uses the fonction f(x) = c / (|x|-x0) with x = log10(fold_change), y=-log10(p_value) by default. Otherwise, custom x and y vectors can be provided. Points with x>x0 and y>f(x) are taken as true positive (TP) Points with x<x0 and y>f(x) are taken as false positive (FP) For a given set of parameters (c,x0), the FDR is given by TP/(TP+FP)

Usage

compute_FDR_from_asymmetry(
  df = NULL,
  x = NULL,
  y = NULL,
  c = seq(from = 0, to = 10, by = 0.1),
  x0 = seq(from = 0, to = 10, by = 0.1)
)

Arguments

df

: a data.frame containing columns p_val and fold_change

x

: numeric vector of x values. Only used if df is NULL.

y

: numeric vector of y values. Only used if df is NULL.

c

: numeric vector

x0

: numeric vector

Value

a data.frame with a extra column FDR if df is not NULL. A vector of FDR values otherwise.

If parameters c and x0 are vectors, FDR is taken as the minimum FDR value across all sets of parameters

Examples

#' #load data :
data("proteinGroups_Cbl")
#Run InteRact with default parameters
res <- InteRact(proteinGroups_Cbl, bait_gene_name = "Cbl")
df_merge <- merge_conditions(res)
df_FDR <- compute_FDR_from_asymmetry(df_merge)
Interactome <- append_FDR(res, cbind(df_merge, FDR = df_FDR$FDR) )

VoisinneG/InteRact documentation built on May 17, 2022, 11:40 p.m.