makeSummarizedExperimentFromDataFrame: Make a RangedSummarizedExperiment from a data.frame or...

View source: R/makeSummarizedExperimentFromDataFrame.R

makeSummarizedExperimentFromDataFrameR Documentation

Make a RangedSummarizedExperiment from a data.frame or DataFrame


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.


                                    seqinfo = NULL,
                           = FALSE)



A data.frame or DataFrame object. If not, then the function first tries to turn df into a data frame with


Additional arguments passed on to makeGRangesFromDataFrame


Either NULL, or a Seqinfo object, or a character vector of seqlevels, or a named numeric vector of sequence lengths. When not NULL, it must be compatible with the genomic ranges in df i.e. it must include at least the sequence levels represented in df.

TRUE or FALSE (the default). If TRUE, then the start positions of the genomic ranges in df are considered to be 0-based and are converted to 1-based in the returned GRanges object. This feature is intended to make it more convenient to handle input that contains data obtained from resources using the "0-based start" convention. A notorious example of such resource is the UCSC Table Browser (


A RangedSummarizedExperiment object with rowRanges and a single assay


M. Ramos

See Also

  • makeGRangesFromDataFrame


## ---------------------------------------------------------------------
## ---------------------------------------------------------------------

# 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]))

exRSE <- makeSummarizedExperimentFromDataFrame(df)




Bioconductor/SummarizedExperiment documentation built on Nov. 4, 2022, 11:59 a.m.