R/coercion.R

Defines functions .sce_to_tse

.sce_to_tse <- function(sce){
    tse <- new("TreeSummarizedExperiment",
               sce,
               rowTree = NULL,
               colTree = NULL,
               rowLinks = NULL,
               colLinks = NULL)
    tse
}

#' @importClassesFrom SingleCellExperiment SingleCellExperiment
setAs("SingleCellExperiment", "TreeSummarizedExperiment",function(from) {
    .sce_to_tse(from)
})

#' @importClassesFrom SummarizedExperiment SummarizedExperiment
setAs("SummarizedExperiment", "TreeSummarizedExperiment",function(from) {
    .sce_to_tse(as(from,"SingleCellExperiment"))
})

#' @importClassesFrom SummarizedExperiment RangedSummarizedExperiment
setAs("RangedSummarizedExperiment", "TreeSummarizedExperiment",function(from) {
    .sce_to_tse(as(from,"SingleCellExperiment"))
})

Try the TreeSummarizedExperiment package in your browser

Any scripts or data that you put into this service are public.

TreeSummarizedExperiment documentation built on Dec. 8, 2020, 2 a.m.