Question: Difficulty creating SummarizedExperiment
gravatar for C Ng
19 months ago by
C Ng0
Colorado, USA
C Ng0 wrote:

I've been able to create a summarized experiment but I'm having some difficulty subsetting and expressing my data. For example, I have arranged my summarizedexperiment by gene with RNA-seq (seq) and methylation data (methyl) See example code:


seq <- data.frame("GAPDH" = c(1,5,NA, NA), "ACTB" = c(10,15, NA, NA))

methyl <- data.frame("GAPDH" = c(10,20,0,0), "ACTB" = c(0,0,50,100))

A = SummarizedExperiment(assays=list(seq,methyl))

what I'd like to be able to do next is to pull both the seq and methyl data for "GAPDH". 

I realize that this is probably simple but I've looked over the subsetting section and am still have some difficulty figuring it out. 

summarizedexperiment • 306 views
ADD COMMENTlink modified 19 months ago by Aaron Lun25k • written 19 months ago by C Ng0
Answer: Difficulty creating SummarizedExperiment
gravatar for Aaron Lun
19 months ago by
Aaron Lun25k
Cambridge, United Kingdom
Aaron Lun25k wrote:

Typically in genomics, rows are features while columns are samples. So we would generally expect:

A <- SummarizedExperiment(assays=list(t(seq),t(methyl)))

... such that you can subset with:

subA <- A["GAPDH",]

... and then get the RNA-seq or methylation data with:

assay(subA, 1) # seq
assay(subA, 2) # methyl

You can also name the assays to make it easier for yourself when you're extracting the data, instead of having to remember that the first assay is RNA-seq and the second assay is methylation.

ADD COMMENTlink written 19 months ago by Aaron Lun25k

Thanks! Naming is something that I'm working on! If you have a quick answer for that I'd appreciate it otherwise that I'm pretty sure I can find in the vignette etc. 

ADD REPLYlink written 19 months ago by C Ng0
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 405 users visited in the last hour