Description Usage Arguments Value Author(s) See Also Examples
View source: R/transcriptToX.R
transcriptToGenome
maps transcript-relative coordinates to genomic
coordinates. Provided coordinates are expected to be relative to the first
nucleotide of the transcript, not the CDS. CDS-relative coordinates
have to be converted to transcript-relative positions first with the
cdsToTranscript()
function.
1 | transcriptToGenome(x, db, id = "name")
|
x |
|
db |
|
id |
|
GRangesList
with the same length (and order) than the input IRanges
x
. Each GRanges
in the GRangesList
provides the genomic coordinates
corresponding to the provided within-transcript coordinates. The
original transcript ID and the transcript-relative coordinates are provided
as metadata columns as well as the ID of the individual exon(s). An empty
GRanges
is returned for transcripts that can not be found in the database.
Johannes Rainer
cdsToTranscript()
and transcriptToCds()
for the mapping between
CDS- and transcript-relative coordinates.
Other coordinate mapping functions:
cdsToTranscript()
,
genomeToProtein()
,
genomeToTranscript()
,
proteinToGenome()
,
proteinToTranscript()
,
transcriptToCds()
,
transcriptToProtein()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | library(EnsDb.Hsapiens.v86)
## Restrict all further queries to chromosome x to speed up the examples
edbx <- filter(EnsDb.Hsapiens.v86, filter = ~ seq_name == "X")
## Below we map positions 1 to 5 within the transcript ENST00000381578 to
## the genome. The ID of the transcript has to be provided either as names
## or in one of the IRanges' metadata columns
txpos <- IRanges(start = 1, end = 5, names = "ENST00000381578")
transcriptToGenome(txpos, edbx)
## The object returns a GRangesList with the genomic coordinates, in this
## example the coordinates are within the same exon and map to a single
## genomic region.
## Next we map nucleotides 501 to 505 of ENST00000486554 to the genome
txpos <- IRanges(start = 501, end = 505, names = "ENST00000486554")
transcriptToGenome(txpos, edbx)
## The positions within the transcript are located within two of the
## transcripts exons and thus a `GRanges` of length 2 is returned.
## Next we map multiple regions, two within the same transcript and one
## in a transcript that does not exist.
txpos <- IRanges(start = c(501, 1, 5), end = c(505, 10, 6),
names = c("ENST00000486554", "ENST00000486554", "some"))
res <- transcriptToGenome(txpos, edbx)
## The length of the result GRangesList has the same length than the
## input IRanges
length(res)
## The result for the last region is an empty GRanges, because the
## transcript could not be found in the database
res[[3]]
res
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.