How to subset SummarizedExperiment object with multiple experiments?
0
0
Entering edit mode
3.3 years ago

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?

RNA-Seq R • 3.0k views
ADD COMMENT
0
Entering edit mode

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 is id here? I do not see exactly how filtering for rows of colData makes sense.

ADD REPLY

Login before adding your answer.

Traffic: 3205 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6