Description Usage Arguments Value See Also Examples
Convert a RangedData/GRanges object to a data.frame with columns chr, start and end. Default is to only translate the chromosome and position information, which is faster. Using 'include.cols'=TRUE allows all the columns from 'ranged' to be taken across to the resulting data.frame.
1 | ranged.to.data.frame(ranged, include.cols = FALSE, use.names = TRUE)
|
ranged |
A RangedData or GRanges object |
include.cols |
logical, whether to also bring across non-positional columns to the resulting data.frame |
use.names |
logical, whether to keep the rownames from the original object for the output. Only has an effect when include.cols=FALSE, otherwise original rownames are always kept. |
A data.frame with columns chr, start and end, and depending on chosen parameters, the same rownames as the input, and optionally the same additional columns.
1 2 3 4 5 6 7 | rd <- rranges(9,GRanges=FALSE, fakeids=TRUE)
rd[["fakecol"]] <- sample(nrow(rd))
rd[["rs.id"]] <- paste0("rs",sample(10000,9))
ranged.to.data.frame(rd)
ranged.to.data.frame(rd,,FALSE)
ranged.to.data.frame(rd,TRUE) # keep all the columns
df.to.GRanges(ranged.to.data.frame(rd,TRUE)) # inverse returns original
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.