toDataframe: toDataframe

Description Usage Arguments Details Value See Also Examples

View source: R/toDataframe.R

Description

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

Usage

1
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

1
2
3
4
5
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)

regioneR documentation built on Nov. 8, 2020, 5 p.m.