Learn R Programming

Pbase (version 0.12.2)

mapToGenome-methods: Map range coordinates between proteins and genome space

Description

Map range coordinates between peptide features along proteins and genome (reference) space.

Usage

"mapToGenome"(x, genome, drop.empty.ranges = TRUE, ...) "pmapToGenome"(x, genome, drop.empty.ranges = TRUE, ...)

Arguments

x
Proteins object containing peptides pranges to be mapped.
genome
A GRangesList object used to map between x and the result. The ranges are typically created by the etrid2grl function.
drop.empty.ranges
TRUE (default) or FALSE. Should empty ranges be dropped?
...
Additional parameters passed to inner functions. Currently ignored.

Value

A named GRangesList object, with names matching names(genome). For pmapToGenome, the return value will have the same length as the inputs.

Details

  • mapToGenome maps the pranges(x) to the ranges of genome. Unless x and genome are of length 1, both must be named and items of x are matched to items of genome using their respective names. Names that do not co-occur in x and genome are ignored. If we have

seqnames(x): "A", "B" and "C"

and

names(genome): "C", "A", "a", "z", "A" and "A". the names of the output will be

"A", "A", "A" and "C".

The output is ordered by (1) seqnames(x) and (2) the order of the elements in genome. In case less than length(x) are mapped, as for p["B"] above, a message informs the user.

  • pmapToGenome is the element-wise (aka 'parallel') version of mapToGenome. The i-th pranges(x) is mapped to the i-th range in genome. x and genome must have the same length and do not need to be named (names are ignored).
  • See Also

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

    • See ?mapToTranscripts in the GenomicRanges package for mapping coordinates between features in the transcriptome and genome space.

    • The proteinCoding function to remove non-protein coding ranges before mapping peptides to their genomic coordinates.

    • The mapping vignette for examples and visualisations.

    See plotAsAnnotationTrack and plotAsAnnotationTrack for more details about the two plotting functions.

    Examples

    Run this code
    
    data(p)
    
    grl <- etrid2grl(acols(p)$ENST)
    pcgrl <- proteinCoding(grl)
    
    plotAsGeneRegionTrack(grl[[1]],
                          pcgrl[[1]])
    
    mp <- mapToGenome(p[4], pcgrl[4])
    
    plotAsAnnotationTrack(mp[[1]], pcgrl[[4]])
    
    pmapToGenome(p, pcgrl)
    
    

    Run the code above in your browser using DataLab