Learn R Programming

VariantAnnotation (version 1.12.9)

refLocsToLocalLocs: refLocsToLocalLocs

Description

refLocsToLocalLocs is deprecated. See ?mapCoords methods in the GenomicRanges and GenomicAlignments packages.

Converts reference locations (aka chromosome-based or genomic) to coding regions, and protein based locations

Usage

refLocsToLocalLocs(ranges, txdb, cdsbytx, ...) "refLocsToLocalLocs"(ranges, txdb, cdsbytx, ...) "refLocsToLocalLocs"(ranges, txdb, cdsbytx, ...)

Arguments

ranges
A GRanges object containing the variants in reference-based coordinates.
txdb
A TxDb object that serves as the annotation reference.
cdsbytx
A GRangesList object with transcripts as the outer list elements and coding regions as the inner.
...
Additional arguments passed to methods

Value

A GRanges with the following elementMetadata columns,
CDSLOC
Location in coding region coordinates
PROTEINLOC
Location in protein (codon triplet) coordinates
QUERYID
Character vector mapping to the of rows of the original query
TXID
Character vector of internal transcript ids from the TxDb or the names of the outer list elements of the cdsbytx object.
CDSID
Character vector of internal coding region ids from the TxDb or the names of the outer list elements of the cdsbytx object.

Details

This function translates the reference-based coordinates in ranges to ‘local’ coordinates in the coding region (CDS) and protein sequences.

When a txdb is suplied the cdsbytx is created with cdsBy(). If cdsbytx is provided the outer list elements must be transcripts and the inner list elements represent coding regions. The GRangesList objects must have names on the outer list elements (i.e., transcript names).

Only ranges that fall ‘within’ coding sequences are reported in the result. Output is a modified GRanges of the ranges input where each row represents a range-transcript match making multiple rows per range posible. The elementMetadata columns include tx_id, cdsLoc and proteinLoc. When a txdb is provided the txId is the internal transcript id from the annotation. When cdsbytx is provided tx_id are the names on the outer list elements.

If ranges is unstranded the strand of the return value reflects the strand of the subject the ranges overlapped with.

See Also

map predictCoding getTranscriptSeqs transcriptLocs2refLocs extractTranscriptSeqs

Examples

Run this code
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
ranges <- GRanges(c("chr12", "chr1", "chr5"), 
                 IRanges(c(1017956, 881906, 140532), 
                         c(1017956, 881907, 140532)))
refLocsToLocalLocs(ranges, TxDb.Hsapiens.UCSC.hg19.knownGene)

Run the code above in your browser using DataLab