distTests: Statistical tests for intergenic distance data

Description Usage Arguments Value DETAILS Author(s) See Also Examples

View source: R/distTests.R

Description

Statistical tests for intergenic distance data

Usage

1
distTests(GeneSetDistances, Universe = NULL, MedianResample = TRUE, R = 10000)

Arguments

GeneSetDistances

A tibble with intergenic distances for the different gene sets, as generated by the dist2Neighbors function.

Universe

Character string indicating which set should be considered as the universe (or control set)

MedianResample

Logical. Should the resample test of the median be performed (defaults to TRUE)

R

integer giving the number of resampling to perform for the resampling test (Default to 1e4)

Value

A tibble with the following columns:

if MedianResample is TRUE the tibble will also contain this additional column:

DETAILS

The following tests are possible:

Author(s)

Pascal GP Martin

See Also

ks.test, wilcox.test, independence_test

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#' ## Obtain gene neighborhood information:
  GeneNeighbors <- getGeneNeighborhood(Genegr)
## Get a (random) set of (100) genes:
  set.seed(123)
  randGenes <- sample(names(Genegr), 100)
## Create a set enriched for close upstream genes:
  GenePool <- GeneNeighbors[!is.na(GeneNeighbors$UpstreamDistance),]
  Proba <- (max(GenePool$UpstreamDistance)-GenePool$UpstreamDistance) /
             sum(max(GenePool$UpstreamDistance)-GenePool$UpstreamDistance)
  Proba <- (1/(GenePool$UpstreamDistance+1)) / sum(1/(GenePool$UpstreamDistance+1))
  CloseUpstream <- sample(GenePool$GeneName, size = 100, prob = Proba)
## Extract distances for this set of genes and for all genes :
  myGeneSets <- list("RandomGenes" = randGenes,
                     "CloseUpstream" = CloseUpstream,
                     "AllGenes" = GeneNeighbors$GeneName)
  distForGeneSets <- dist2Neighbors(GeneNeighbors,
                                    myGeneSets)
## Compare distances for genesets to a control set (here "AllGene")
## (using only 1K permutations fo speed purposes here, prefer using > 1e4)
  distTests(distForGeneSets,
            Universe="AllGenes",
            MedianResample = TRUE,
            R=1e3)

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