Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

nearestTSS

Find Nearest Transcriptional Start Site


Description

Find nearest TSS and distance to nearest TSS for a vector of chromosome loci.

Usage

nearestTSS(chr, locus, species="Hs")

Arguments

chr

character vector of chromosome names.

locus

integer or numeric vector of genomic loci, of same length as chr.

species

character string specifying the species. Possible values include "Hs" (human), "Mm" (mouse), "Rn" (rat), "Dm" (fly) or "Pt" (chimpanzee), but other values are possible if the corresponding organism package is available. See alias2Symbol for other possible values.

Details

This function takes a series of genomic loci, defined by a vector of chromosome names and a vector of genomic positions within the chromosomes, and finds the nearest transcriptional start site (TSS) for each locus. The chromosome names can be in the format "1","2","X" or can be "chr1","chr2","chrX".

This function uses the Bioconductor organism package named "org.XX.eg.db" where XX is species.

Value

A data.frame with components:

gene_id

character vector giving the Entrez Gene ID of the nearest TSS for each element of chr and locus.

symbol

character vector of gene symbols.

strand

character vector with "+" for positive strand genes and "-" for negative strand genes.

tss

integer vector giving TSS.

width

integer vector giving genomic width of the gene.

distance

integer vector giving distance to nearest TSS. Positive values means that the TSS is downstream of the locus, negative values means that it is upstream. Gene body loci will therefore have negative distances and promotor loci will have positive.

Author(s)

Gordon Smyth

See Also

Examples

nearestTSS(chr = c("1","1"), locus = c(1000000,2000000))

edgeR

Empirical Analysis of Digital Gene Expression Data in R

v3.32.1
GPL (>=2)
Authors
Yunshun Chen, Aaron TL Lun, Davis J McCarthy, Matthew E Ritchie, Belinda Phipson, Yifang Hu, Xiaobei Zhou, Mark D Robinson, Gordon K Smyth
Initial release
2021-01-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.