Description Usage Arguments Value Author(s) See Also Examples
makeSummarizedExperimentFromDataFrame
uses data.frame
or DataFrame
column names to create a GRanges object for the
rowRanges
of the resulting SummarizedExperiment object.
It requires that non-range data columns be coercible into a numeric
matrix
for the SummarizedExperiment constructor. All columns
that are not part of the row ranges attribute are assumed to be experiment
data; thus, keeping metadata columns will not be supported. Note that this
function only returns SummarizedExperiment objects with a single
assay.
If metadata columns are to be kept, one can first construct the row ranges attribute by using the makeGRangesFromDataFrame function and subsequently creating the SummarizedExperiment.
1 2 3 4 | makeSummarizedExperimentFromDataFrame(df,
...,
seqinfo = NULL,
starts.in.df.are.0based = FALSE)
|
df |
A data.frame or DataFrame object. If not, then
the function first tries to turn |
... |
Additional arguments passed on to makeGRangesFromDataFrame |
seqinfo |
Either |
starts.in.df.are.0based |
|
A RangedSummarizedExperiment object with rowRanges and a single assay
M. Ramos
makeGRangesFromDataFrame
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## ---------------------------------------------------------------------
## BASIC EXAMPLES
## ---------------------------------------------------------------------
# Note that rownames of the data.frame are also rownames of the result
df <- data.frame(chr="chr2", start = 11:15, end = 12:16,
strand = c("+", "-", "+", "*", "."), expr0 = 3:7,
expr1 = 8:12, expr2 = 12:16,
row.names = paste0("GENE", letters[5:1]))
df
exRSE <- makeSummarizedExperimentFromDataFrame(df)
exRSE
assay(exRSE)
rowRanges(exRSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.