coordinate-mapping-method: Map range coordinates between transcripts and genome space

mapToTranscriptsR Documentation

Map range coordinates between transcripts and genome space

Description

Map range coordinates between features in the transcriptome and genome (reference) space.

See mapToAlignments in the GenomicAlignments package for mapping coordinates between reads (local) and genome (reference) space using a CIGAR alignment.

Usage

## S4 method for signature 'ANY,MultiDb'
mapToTranscripts(x, transcripts,
          ignore.strand = TRUE,
          extractor.fun = GenomicFeatures::transcripts, ...)

Arguments

x

GRanges-class object of positions to be mapped. x must have names when mapping to the genome.

transcripts

The OrganismDb object that will be used to extract features using the extractor.fun.

ignore.strand

When TRUE, strand is ignored in overlap operations.

extractor.fun

Function to extract genomic features from a TxDb object.

Valid extractor functions:

  • transcripts ## default

  • exons

  • cds

  • genes

  • promoters

  • microRNAs

  • tRNAs

  • transcriptsBy

  • exonsBy

  • cdsBy

  • intronsByTranscript

  • fiveUTRsByTranscript

  • threeUTRsByTranscript

...

Additional arguments passed to extractor.fun functions.

Details

  • mapToTranscripts The genomic range in x is mapped to the local position in the transcripts ranges. A successful mapping occurs when x is completely within the transcripts range, equivalent to:

          findOverlaps(..., type="within")
          

    Transcriptome-based coordinates start counting at 1 at the beginning of the transcripts range and return positions where x was aligned. The seqlevels of the return object are taken from the transcripts object and should be transcript names. In this direction, mapping is attempted between all elements of x and all elements of transcripts.

Value

An object the same class as x.

Parallel methods return an object the same shape as x. Ranges that cannot be mapped (out of bounds or strand mismatch) are returned as zero-width ranges starting at 0 with a seqname of "UNMAPPED".

Non-parallel methods return an object that varies in length similar to a Hits object. The result only contains mapped records, strand mismatch and out of bound ranges are not returned. xHits and transcriptsHits metadata columns indicate the elements of x and transcripts used in the mapping.

When present, names from x are propagated to the output. When mapping to transcript coordinates, seqlevels of the output are the names on the transcripts object; most often these will be transcript names. When mapping to the genome, seqlevels of the output are the seqlevels of transcripts which are usually chromosome names.

Author(s)

V. Obenchain, M. Lawrence and H. Pagès; ported to work with OrganismDbi by Marc Carlson

See Also

  • mapToTranscripts.

Examples


## ---------------------------------------------------------------------
## A. Basic Use
## ---------------------------------------------------------------------

library(Homo.sapiens)
x <- GRanges("chr5",
             IRanges(c(173315331,174151575), width=400,
                     names=LETTERS[1:2]))

## Map to transcript coordinates:
mapToTranscripts(x, Homo.sapiens)

Bioconductor/OrganismDbi documentation built on Nov. 2, 2024, 7:20 a.m.