View source: R/transcriptToX.R
transcriptToCds | R Documentation |
Converts transcript-relative coordinates to positions within the CDS (if the transcript encodes a protein).
transcriptToCds(x, db, id = "name", exons = NA, transcripts = NA)
x |
|
db |
|
id |
|
exons |
|
transcripts |
|
IRanges
with the same length (and order) than the input IRanges
x
. Each element in IRanges
provides the coordinates within the
transcripts CDS. The transcript-relative coordinates are provided
as metadata columns.
IRanges
with a start coordinate of -1
is returned for transcripts
that are not known in the database, non-coding transcripts or if the
provided start and/or end coordinates are not within the coding region.
Johannes Rainer
Other coordinate mapping functions:
cdsToTranscript()
,
genomeToProtein()
,
genomeToTranscript()
,
proteinToGenome()
,
proteinToTranscript()
,
transcriptToGenome()
,
transcriptToProtein()
library(EnsDb.Hsapiens.v86)
## Defining transcript-relative coordinates for 4 transcripts of the gene
## BCL2
txcoords <- IRanges(start = c(1463, 3, 143, 147), width = 1,
names = c("ENST00000398117", "ENST00000333681",
"ENST00000590515", "ENST00000589955"))
## Map the coordinates.
transcriptToCds(txcoords, EnsDb.Hsapiens.v86)
## ENST00000590515 does not encode a protein and thus -1 is returned
## The coordinates within ENST00000333681 are outside the CDS and thus also
## -1 is reported.
## Meanwhile, this function can be called in parallel processes if you preload
## the exons and transcripts database.
exons <- exonsBy(EnsDb.Hsapiens.v86)
transcripts <- transcripts(EnsDb.Hsapiens.v86)
transcriptToCds(txcoords, EnsDb.Hsapiens.v86, exons = exons,transcripts = transcripts)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.