Description Usage Arguments Value DETAILS Author(s) See Also Examples
View source: R/analyzeNeighborsOrientation.R
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.
1 2 3 4 5 6 7 | analyzeNeighborsOrientation(
GeneList,
GeneNeighborhood = NULL,
keepOther = TRUE,
EnrichTest = TRUE,
GeneUniverse = NULL
)
|
GeneList |
A character vector of focus genes to analyze |
GeneNeighborhood |
A
|
keepOther |
A logical (default to |
EnrichTest |
A logical (default to |
GeneUniverse |
An optional character vector of genes in the universe. By default all genes in GeneNeighborhood are considered in the gene universe. |
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.
The function is intended to analyze the following orientations:
SameStrand. The upstream/downstream gene is on the same strand as the focus gene
OppositeStrand. The upstream/downstream gene is on the opposite strand of the focus gene
OppositeOverlap. The upstream/downstream gene is on the opposite strand of the focus gene and overlaps with the focus gene
SameOverlap. The upstream/downstream gene is on the same strand of the focus gene and overlaps with the focus gene
other. (only if keepOther is TRUE) Any other, more complex situation (e.g. multiple overlaps, focus gene contained within another gene, etc.)
but should work with different class values too (except 'other' when keepOther is TRUE)
Pascal GP Martin
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.