Learn R Programming

MEAL (version 1.2.3)

createRanges: Create GenomicRanges from data.frame

Description

Convert a data.frame with chromosomes in the first column, starting positions in the second one and ending position in the third one to GenomicRanges. Names of the data.frame are preserved in the output GenomicRanges.

Usage

createRanges(ranges)

Arguments

ranges
Data.frame or matrix

Value

GenomicRanges

Examples

Run this code
dfranges <- data.frame(chr = c("chr1", "chr2", "chr1"), start = c(1290, 1250, 4758),
end = c(64389, 632409, 16430), stringsAsFactors = FALSE)
names(dfranges) <- c("range1", "range2", "range3")
ranges <- createRanges(dfranges)
ranges

Run the code above in your browser using DataLab