pvalByGeneSet: Apply a test to different genesets using the same...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/distTests.R

Description

Apply a test to different genesets using the same reference/control set

Usage

1
pvalByGeneSet(tbdist, univ = "Universe", FUN, ...)

Arguments

tbdist

A data frame with the following columns:

  • Distance. Distance in bp.

  • GeneName. Name of the focus gene.

  • GeneSet. Name of the Gene Set

univ

Character string giving the name of the control set (should be in the GeneSet column).

FUN

A function returning a single pvalue and that takes at least 2 arguments: the data frame .x and .y, of the same form as tbdist, containing the distances for the test set and for the control/reference set. and returns a single p-value.

...

further arguments passed to FUN

Value

A tibble with 2 columns: GeneSet and pvalue

Author(s)

Pascal GP Martin

See Also

replicate colMedians

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Create some random distance data
  set.seed(123)
  mydistData <- data.frame(GeneName = stringi::stri_rand_strings(600, 5),
                           Distance = sample(1:5000, 600, replace=TRUE),
                           GeneSet = sample(c("TestSet1", "TestSet2", "RefSet"),
                                            600, replace= TRUE))
## Apply Kolmogorov-Smirnov test to the different test sets
  pvalByGeneSet(tbdist = mydistData,
                univ = "RefSet",
                FUN = ksfun)

pgpmartin/GeneNeighborhood documentation built on Sept. 2, 2021, 6:37 a.m.