Package 'stepdownfdp'

Title: A Step-Down Procedure to Control the False Discovery Proportion
Description: Provides a step-down procedure for controlling the False Discovery Proportion (FDP) in a competition-based setup, implementing Dong et al. (2020) <arXiv:2011.11939>. Such setups include target-decoy competition (TDC) in computational mass spectrometry and the knockoff construction in linear regression.
Authors: Arya Ebadi [aut, cre], Dong Luo [aut], Kristen Emery [aut], Yilun He [aut], William Stafford Noble [aut], Uri Keich [aut]
Maintainer: Arya Ebadi <[email protected]>
License: MIT + file LICENSE
Version: 1.0.0
Built: 2024-10-26 03:09:08 UTC
Source: https://github.com/uni-arya/stepdownfdp

Help Index


Convert winning scores and labels into discoveries

Description

fdp_sd takes the output of mirandom and additional statistical parameters to return the indices and winning scores of hypotheses that were rejected.

Usage

fdp_sd(
  scores_and_labels,
  alpha,
  conf,
  c = 0.5,
  lambda = 0.5,
  procedure = "standard"
)

Arguments

scores_and_labels

An m x 2 matrix obtained via mirandom.

alpha

An FDP threshold.

conf

To control the FDP with 1 - conf confidence.

c

Determines the ranks of the target score that are considered winning. Defaults to c = 0.5 for single-decoy FDP-SD.

lambda

Determines the ranks of the target score that are considered losing. Defaults to lambda = 0.5 for single-decoy FDP-SD.

procedure

Takes a value of "standard" (for non-randomised FDP-SD) or "coinflip" (for randomised FDP-SD).

Value

A list of 2 objects: the winning scores (discoveries) and indices (discoveries_ind) of rejected hypotheses.

Examples

set.seed(123)
target_scores <- rnorm(200, mean = 1.5)
decoy_scores <- matrix(rnorm(600, mean = 0), ncol = 3)
scores <- cbind(target_scores, decoy_scores)
scores_and_labels <- mirandom(scores)
fdp_sd(scores_and_labels, alpha = 0.1, conf = 0.1)

Convert target/decoy scores into winning scores and labels

Description

mirandom takes a collection of target and decoy scores for m hypotheses and returns a winning score and label attached to each. The argument scores must be organised in an m x (d + 1) matrix, where d is the number of decoy scores. The first column of scores must contain the target scores.

Usage

mirandom(scores, c = 0.5, lambda = 0.5)

Arguments

scores

An m x (d + 1) matrix where m is the number of hypothesis and d is the number of decoy scores for each hypothesis. The first column of scores are target scores and subsequent columns are decoy scores.

c

Determines the ranks of the target score that are considered winning. Defaults to c = 0.5 for single-decoy FDP-SD.

lambda

Determines the ranks of the target score that are considered losing. Defaults to lambda = 0.5 for single-decoy FDP-SD.

Value

A m x 2 matrix where m is the number of hypotheses. The first column contains the winning scores and the second column contains the corresponding labels.

Examples

target_scores <- rnorm(200, mean = 1.5)
decoy_scores <- matrix(rnorm(600, mean = 0), ncol = 3)
scores <- cbind(target_scores, decoy_scores)
mirandom(scores)