toDataframe: toDataframe

View source: R/toDataframe.R

toDataframeR Documentation

toDataframe

Description

Transforms a GRanges object or a data.framecontaining a region set into a data.frame.

Usage

toDataframe(A, stranded=FALSE)

Arguments

A

a GRanges object.

stranded

(only used when A is a GRanges object) a logical indicating whether a column with the strand information have to be added to the result (Defaults to FALSE)

Details

If the oject is of class data.frame, it will be returned untouched.

Value

A data.frame with the regions in A. If A was a GRanges object, the output will include any metadata present in A.

See Also

toGRanges

Examples

A <- data.frame(chr=1, start=c(1, 15, 24), end=c(10, 20, 30), x=c(1,2,3), y=c("a", "b", "c"))

A2 <- toGRanges(A)

toDataframe(A2)


bernatgel/regioneR documentation built on Sept. 10, 2023, 12:03 a.m.