Learn R Programming

SimRVSequences (version 0.2.7)

combine_exons: Combine overlapping exons

Description

Combine overlapping exons into a single observation

Usage

combine_exons(exon_data)

Arguments

exon_data

data.frame. This data frame must include named variables: chrom, a chromosome identifer; exonStart, the first position of the exon in base pairs; and exonEnd, the last position of the exon in base pairs.

Value

A data frame of combined exon segments. This data frame includes the variables: chrom, a chromosome identifier; exonStart, the first position of the combined exon segment in base pairs; and exonEnd, the last position of the combined exon segment in base pairs.

Examples

Run this code
# NOT RUN {
# create a data frame that contains the
# the variables: chrom, exonStart, and exonEnd
exDat <- data.frame(chrom     = c(1, 1, 1, 2, 2, 2),
                    exonStart = c(1, 2, 5, 1, 3, 3),
                    exonEnd   = c(3, 4, 7, 4, 5, 6))

exDat

# supply exDat to combine_exons to combine
# overlapping exon segments
combine_exons(exDat)

# }

Run the code above in your browser using DataLab