extract_coef_features: Extract coefficient features

.extract_p_featuresR Documentation

Extract coefficient features

Description

Extract coefficient features

Usage

.extract_p_features(
  object,
  coefs,
  p = 0.05,
  fit = fits(object),
  combiner = "|",
  verbose = TRUE
)

.extract_fdr_features(
  object,
  coefs,
  fdr = 0.05,
  fit = fits(object),
  combiner = "|",
  verbose = TRUE
)

.extract_effectsize_features(
  object,
  coefs,
  effectsize = 1,
  fit = fits(object),
  combiner = "|",
  verbose = TRUE
)

.extract_sign_features(
  object,
  coefs,
  sign,
  fit = fits(object)[1],
  combiner = "|",
  verbose = TRUE
)

.extract_n_features(
  object,
  coefs,
  combiner = "|",
  n,
  fit = fits(object)[1],
  verbose = TRUE
)

extract_coef_features(
  object,
  fit = fits(object)[1],
  coefs = default_coefs(object, fit = fit),
  combiner = "|",
  p = 1,
  fdr = 1,
  effectsize = 0,
  sign = c(-1, +1),
  n = 4,
  verbose = TRUE
)

Arguments

object

SummarizedXExperiment

coefs

subset of coefs(object)

p

p threshold

fit

subset of fits(object)

combiner

'|' or '&': how to combine multiple fits/coefs

verbose

TRUE or FALSE

fdr

fdr threshold

effectsize

effectsize threshold

sign

effect sign

n

number of top features (Inf means all)

Value

SummarizedExperiment

Examples

# Read and Fit
    file <- system.file('extdata/atkin.metabolon.xlsx', package = 'autonomics')
    object <- read_metabolon(file)
    object %<>% fit_limma()
    fdt(object) %<>% add_adjusted_pvalues('fdr')
# Single coef
    object0 <- object
    object %<>% .extract_p_features(         coefs = 't1-t0', p = 0.05)
    object %<>% .extract_fdr_features(       coefs = 't1-t0', fdr = 0.05)
    object %<>% .extract_effectsize_features(coefs = 't1-t0', effectsize = 1)
    object %<>% .extract_sign_features(      coefs = 't1-t0', sign = -1)
    object %<>% .extract_n_features(         coefs = 't1-t0', n = 1)
    object <- object0
    object %<>%  extract_coef_features(
                   coefs = 't1-t0', p = 0.05, fdr = 0.05, effectsize = 1, sign = -1, n = 1)
# Multiple coefs
    object <- object0
    object %<>% .extract_p_features(         coefs = c('t1-t0', 't2-t0'), p = 0.05)
    object %<>% .extract_fdr_features(       coefs = c('t1-t0', 't2-t0'), fdr = 0.01)
    object %<>% .extract_effectsize_features(coefs = c('t1-t0', 't2-t0'), effectsize = 1)
    object %<>% .extract_sign_features(      coefs = c('t1-t0', 't2-t0'), sign = -1)
    object %<>% .extract_n_features(         coefs = c('t1-t0', 't2-t0'), n = 1)
    object <- object0
    object %<>%  extract_coef_features(
                   coefs = c('t1-t0', 't2-t0'), p = 0.05, fdr = 0.01, effectsize = 1, sign = -1, n = 1)

bhagwataditya/importomics documentation built on Oct. 29, 2024, 3:19 p.m.