cleanDataset: Clean the dataset

cleanDatasetR Documentation

Clean the dataset

Description

Clean the SummarizedExperiment by making sure that names of various fields are available and unique. Also transfer any information stored in rowRanges into rowData.

Usage

cleanDataset(se)

## S4 method for signature 'SummarizedExperiment'
cleanDataset(se)

## S4 method for signature 'SingleCellExperiment'
cleanDataset(se)

Arguments

se

A SummarizedExperiment object or one of its subclasses.

Details

Various Panels assume that the row and column names of the input SummarizedExperiment are available and unique. This function enforces that, adding consecutive integer names if not available and calling make.unique if they are duplicated.

Various Panels further assume that the assay, rowData, colData names are unique; if this is not the case, selectInput behaves in unexpected (and incorrect) ways. This function enforces that as well by running them through make.unique.

Finally, positional information in rowRanges is not accessible to iSEE. This function moves this information into rowData, prefixing the column names with rowRanges_.

For SingleCellExperiment object, we enforce uniqueness in the reducedDims.

All changes result in warnings as a “sensible” object is not expected to require any work.

Value

A cleaned version of se.

Author(s)

Aaron Lun, Charlotte Soneson

Examples

# Creating a very naughty SE.
se <- SummarizedExperiment(list(cbind(1:10, 2:11), cbind(2:11, 3:12)),
   colData=DataFrame(A=1:2, A=3:4, check.names=FALSE), 
   rowData=DataFrame(B=1:10, B=1:10, check.names=FALSE))
se

cleanDataset(se)

csoneson/SEE documentation built on Dec. 13, 2024, 6:43 p.m.