Difficulty creating SummarizedExperiment
1
1
Entering edit mode
C Ng ▴ 10
@c-ng-15206
Last seen 6.7 years ago
Colorado, USA

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 • 1.5k views
ADD COMMENT
2
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 18 hours ago
The city by the bay

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 COMMENT
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 448 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