dist2Neighbors: Extract distances to the upstream and downstream neighbors

Description Usage Arguments Value Author(s) See Also Examples

View source: R/dist2Neighbors.R

Description

Extract distances to the upstream and downstream neighbors. This is essentially a wrapper around getDistSide with the possibility to use several gene sets and with extra checks on the gene set(s)

Usage

1
2
3
4
5
dist2Neighbors(
  GeneNeighborhood = NULL,
  geneset = NULL,
  genesetName = "GeneSet"
)

Arguments

GeneNeighborhood

A tibble obtained with the getGeneNeighborhood function. Can also be any data.frame with the relevant information.

geneset

Either a character vector of identifiers defining the genes of interest or a (named) list of such character vectors.

genesetName

Character string. Name of the gene set (only used if geneset is a character vector). If geneset is a list, the names of its elements are used as names of the gene sets.

Value

A tibble with the following columns:

Author(s)

Pascal GM Martin

See Also

getGeneNeighborhood getDistSide

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Obtain gene neighborhood information:
  GeneNeighbors <- getGeneNeighborhood(Genegr)
## Get a (random) set of (100) genes:
  set.seed(123)
  randGenes <- sample(names(Genegr), 100)
## Extract distances to the upstream/downstream neighbors for this set:
  distForRandGenes <- dist2Neighbors(GeneNeighborhood = GeneNeighbors,
                                     geneset = randGenes,
                                     genesetName = "RandomGenes")
## Or for this set of genes and for all genes (the 'gene universe'):
 myGeneSets <- list("RandomGenes" = randGenes,
                    "AllGenes" = GeneNeighbors$GeneName)
 distForGeneSets <- dist2Neighbors(GeneNeighbors,
                                   myGeneSets)

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