se_to_rowcoldata | R Documentation |
Get SE colData and rowData consistently for SummarizedExperiment,
SingleCellExperiment, Seurat data, and generic Biobase eSet
compatible objects that provide featureData()
and phenoData()
.
se_to_rowcoldata(se, verbose = FALSE, ...)
se |
recognized object:
|
... |
additional arguments are ignored |
This function provides a straightforward way to return
the equivalent of data.frame(check.names=FALSE, rowData(se))
and data.frame(check.names=FALSE, colData(se))
for several
types of object types.
It also defines rownames()
and colnames()
if either are missing.
When rowData
has no annotation columns, it defines one column "rows"
using rownames(se)
.
If slot name "rowRanges"
exists, and "rowData"
either does not
exist or has zero columns, it will use rowRanges()
.
When colData
has no annotation columns, it defines one column
"columns"
using colnames(se)
.
When input se
class is "Seurat"
, it converts the object with
Seurat::as.SingleCellExperiment()
Any other object uses Biobase::featureData()
for "rowData_se"
,
and Biobase::phenoData()
for "colData_se"
.
To verify the logic used at each step, set verbose=TRUE
.
For Class "NanoStringGeoMxSet"
defined in GeomxTools
, the
colData_se
is defined using GeomxTools::sData()
in order to
return the combined data.frame
with protocolData()
and pData()
together. Accordingly, it is possible to have duplicated colnames,
which becomes a problem for many downstream tools, so the second
instance of any duplicated colnames have "_v1"
added by using
jamba::makeNames(x, renameFirst=FALSE)
. The first instance of
each duplicated colname is not renamed. Use verbose=TRUE
to confirm
when duplicated columns are detected and renamed.
list
with two components:
"colData_se"
as a data.frame
with column metadata from se
"rowData_se"
as a data.frame
with row metadata from se
Other jamses SE utilities:
make_se_test()
,
se_collapse_by_column()
,
se_collapse_by_row()
,
se_detected_rows()
,
se_normalize()
,
se_rbind()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.