Bioconductor / SummarizedExperiment

A container (S4 class) for matrix-like assays
https://bioconductor.org/packages/SummarizedExperiment
33 stars 9 forks source link

Add a showAsCell method for SummarizedExperiment objects #50

Closed LTLA closed 3 years ago

LTLA commented 3 years ago

Consider the following:

library(SummarizedExperiment)
se <- SummarizedExperiment(list(counts=cbind(1:10)))
y <- DataFrame(SE=I(se))
## DataFrame with 10 rows and 1 column
## Error: C stack usage  7969716 is too close to the limit
## In addition: There were 50 or more warnings (use warnings() to see the first 50)

One quick solution would be to just admit that we can't do anything sensible here:

setMethod("showAsCell", "SummarizedExperiment", function(object) rep.int("####", NROW(object)))
y
## DataFrame with 10 rows and 1 column
##                        SE
##    <SummarizedExperiment>
## 1                    ####
## 2                    ####
## 3                    ####
## 4                    ####
## 5                    ####
## 6                    ####
## 7                    ####
## 8                    ####
## 9                    ####
## 10                   ####

This is relevant to LTLA/TrajectoryUtils#4; tagging @kstreet13.

hpages commented 3 years ago

I've added this. Thanks!