testEnrichment: testEnrichment

View source: R/enrichMiR.R

testEnrichmentR Documentation

testEnrichment

Description

Creates an enrich.results object and performs enrichment analysis

Usage

testEnrichment(
  x,
  sets,
  background = NULL,
  tests = NULL,
  sets.properties = NULL,
  th.abs.logFC = 0,
  th.FDR = 0.05,
  minSize = 5,
  maxSize = Inf,
  gsea.maxSize = 3000,
  gsea.permutations = 4000,
  testOnlyAnnotated = FALSE,
  keepAnnotation = FALSE,
  field = NULL,
  BPPARAM = NULL,
  familyRound = NULL,
  checkSynonyms = TRUE,
  doCheck = TRUE,
  ...
)

Arguments

x

The signature in which to look for a signal. This can be either:

  • A data.frame of the results of a differential expression analysis, with features (e.g. genes) as row names and with at least the following columns: 'logFC', 'FDR';

  • A numeric vector of the signal with feature (e.g. genes) as names, in which case only tests based on a continuous signal will be possible;

  • A logical vector of membership to the geneset of interest, with feature (e.g. genes) as names, in which case only tests based on a binary signal will be available.

  • A vector of feature names; in this case the background argument will also be required, and only tests based on a binary signal will be available.

sets

Either a named list (or SimpleList) of features, or a data.frame (or DataFrame) with at least the columns 'set' and 'feature' (if the columns 'score' and 'sites' are also present, they will be used by the appropriate tests).

background

A character vector of background; ignored if 'x' is not a character vector.

tests

Character vector of the tests to perform. See enrichMiR::availableTests for the options.

sets.properties

Any further information about the sets; this can either be a data.frame (or DataFrame), with row.names corresponding to names of 'sets' (or to alternative names), or a named vector (e.g. miRNA expression values). If this is given, sets not included within this object will be discarded.

th.abs.logFC

The minimum absolute log2-foldchange threshold for a feature to be considered differentially-expressed (default 0). Ignored if 'x' is not a DEA data.frame.

th.FDR

The maximum FDR for a feature to be considered differentially- expressed (default 0.05). Ignored if 'x' is not a DEA data.frame.

minSize

The minimum size of a set to be tested (default 5).

maxSize

The maximum size of a set to be tested (default Inf).

gsea.maxSize

The maximum number of targets for a miRNA family to be tested using GSEA (default 300).

gsea.permutations

The number of permutations for GSEA (default 2000). See '?fgsea' for more information.

testOnlyAnnotated

Whether to excluded features that are no set from the background (default FALSE).

field

The field of 'x' to use as continuous signal. If omitted, defaults to 'sign(x$logFC)*-log10(x$FDR)'. Ignored if 'x' is not a data.frame.

BPPARAM

BiocParallel multithreading parameters. Used to multithread tests, and also within the 'gsea' test.

doCheck

Whether to check the inputs. This argument is for internal use and should not be disabled!

Value

an enrich.results object.


ETHZ-INS/enrichMiR documentation built on July 20, 2024, 12:03 a.m.