How to subset SummarizedExperiment object with multiple experiments?
I have a big SummarizedExperiment object. I want to subset all of the tables based on the information in the colData. I think there should be an efficient way rather than piping filters like:
filter <- colData(dat)[id ,which(colData(dat)$parameter) == "cancer" ]
cancer <- assays(dat)[,filter]
Now, I need to do that for all the values of parameter. There should be a complete function somewhere to automate this process and be memory efficient.
Any ideas?
• 4,439 views
•
link
0 answers
No answers yet.
Log in to answer this question.
dat[,dat$parameter == "cancer"]will subset the entire SE. You can then extract assays as you like. The idea of SE is exactly that, so not having the need to filter every assay but one filter call on the entire object subsets all assays, all colData etc. What isidhere? I do not see exactly how filtering for rows of colData makes sense.