Learn R Programming

refGenome (version 1.7.7)

unifyRanges: Unification of Exonic ranges.

Description

Unified ranges are intended to be used as preparation of exonic coordinates for counting of alignments (reads) inside these regions. In order to prevent ambiguities, overlaps between exons are removed.

Usage

unifyRanges(object)

Arguments

object

refExons object. Contains exonic coordinates data.

Value

The unifyRanges function returns a refExons object. The data table contains the following columns:

id Numeric index retained from the incoming refExons object.
seqid Chromosome identifier
begin begin of range
end end of range
strand strand for exon (+ or -)
gene_id Fene identifier
transcript_id Transcript identifier
gene_name Gene name
exon_number Exon numbe
ubs Unification begin shift. Number by which begin has been increased during the unification process

Details

Removal of overlaps works as follows: Ranges are sorted according to their seqid and begin value. Ranges which are contained in a precedent range are removed. For ranges with partial overlap with a precedent range, the start position is shifted to one position after the end of the precedent range. The size of the shift is contained in the 'ubs' value. An overview over the size and the number (begin-) shifts can be obtained using the plotUbs function.

Examples

Run this code
# NOT RUN {
##-------------------------------------##
## A) Ensembl
##-------------------------------------##
ensfile <- system.file("extdata",
                        "hs.ensembl.62.small.RData", package="refGenome")
ens <- loadGenome(ensfile)
enex <- refExons(ens)
# }
# NOT RUN {
saveGenome(enex,"enex.RData", useBasedir=FALSE)
er <- loadGenome("enex.RData")
# }
# NOT RUN {
# Unify exons
uex <- unifyRanges(enex)
plotUbs(uex, xlim=c(0,400), ylim=c(0,5))

##-------------------------------------##
## B) UCSC
##-------------------------------------##
ucfile <- system.file("extdata", "hs.ucsc.small.RData", package="refGenome")
uc <- loadGenome(ucfile)
ucex <- refExons(uc)
# Unify exons
uex <- unifyRanges(enex)
plotUbs(uex, xlim=c(0,400), ylim=c(0,5))
# }

Run the code above in your browser using DataLab