analyzeNeighborsOrientation: Analyze the orientation of gene neighbors for a set of...

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

View source: R/analyzeNeighborsOrientation.R

Description

Analyze the orientation of gene neighbors (upstream/downstream genes) for a set of pre-defined focus genes. Gives the number and percentage of genes in each orientation. Evaluate the enrichment of the different orientations when using a reference gene universe.

Usage

1
2
3
4
5
6
7
analyzeNeighborsOrientation(
  GeneList,
  GeneNeighborhood = NULL,
  keepOther = TRUE,
  EnrichTest = TRUE,
  GeneUniverse = NULL
)

Arguments

GeneList

A character vector of focus genes to analyze

GeneNeighborhood

A tibble obtained with the getGeneNeighborhood function or any data frame containing the following columns:

  • GeneName. Name of the focus gene

  • Upstream. Name of the gene located upstream of the focus gene

  • Downstream. Name of the gene located downstream of the focus gene

  • UpstreamClass. Class of the Upstream gene

  • DownstreamClass. Class of the Downstream gene

keepOther

A logical (default to TRUE) indicating if the class "other" should be analyzed or not

EnrichTest

A logical (default to TRUE) indicating if Enrichment test should be performed

GeneUniverse

An optional character vector of genes in the universe. By default all genes in GeneNeighborhood are considered in the gene universe.

Value

A tibble with orientation and distance for upstream/downstream gene. If EnrichTest is TRUE, the tibble also contains data for the universe and a p-value from a Fisher exact test evaluating the enrichment for each orientation in GeneList.

DETAILS

The function is intended to analyze the following orientations:

but should work with different class values too (except 'other' when keepOther is TRUE)

Author(s)

Pascal GP Martin

See Also

fisher.test

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Obtain gene neighborhood information:
  GeneNeighbors <- getGeneNeighborhood(Genegr)
## get a random set of 100 genes:
  set.seed(123)
  randGenes <- sample(names(Genegr), 100)
## Analyze the orientation of their neighbors
  analyzeNeighborsOrientation(randGenes,
                              GeneNeighborhood = GeneNeighbors)
## Select a less random set of genes:
  isOpposite <- grepl("Opposite",GeneNeighbors$UpstreamClass)
  probs <- ifelse(isOpposite, 0.6/sum(isOpposite), 0.4/sum(!isOpposite))
  set.seed(123)
  lessrandGenes <- GeneNeighbors$GeneName[sample.int(nrow(GeneNeighbors), 100, prob=probs)]
  analyzeNeighborsOrientation(lessrandGenes,
                              GeneNeighborhood = GeneNeighbors)
## Get statistics for the gene universe only
  analyzeNeighborsOrientation(names(Genegr),
                              GeneNeighborhood = GeneNeighbors,
                              EnrichTest = FALSE)

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