Question: Subsetting ESet object based on featuredata
0
gravatar for kaushal Raj Chaudhary
5.0 years ago by
United States
kaushal Raj Chaudhary10 wrote:

Hello all,

I am trying to subset ESet object base on feature data.  Eset with with feature data was created using following code.

 

library(ragene10sttranscriptcluster.db)
library(annotate)
library(R2HTML)
library(limma)

ID <- featureNames(eset)  

Symbol <- getSYMBOL(ID, "ragene10sttranscriptcluster.db")
Name <- as.character(lookUp(ID, "ragene10sttranscriptcluster.db", "GENENAME"))
tmp <- data.frame(ID=ID, Symbol=Symbol, Name=Name)  
fData(eset) <- tmp  

> eset
ExpressionSet (storageMode: lockedEnvironment)
assayData: 28826 features, 13 samples 
  element names: exprs 
protocolData
  sampleNames: M11001NB1H-Heart-1-RatGeneArray.CEL M11003NB1H-Heart-3-RatGeneArray.CEL ...
    M11024NB2H-Heart-24-2-RatGeneArray.CEL (13 total)
  varLabels: ScanDate
  varMetadata: labelDescription
phenoData
  sampleNames: M11001NB1H-Heart-1-RatGeneArray.CEL M11003NB1H-Heart-3-RatGeneArray.CEL ...
    M11024NB2H-Heart-24-2-RatGeneArray.CEL (13 total)
  varLabels: sample
  varMetadata: labelDescription
featureData
  featureNames: 10700001 10700003 ... 10940690 (28826 total)
  fvarLabels: ID Symbol Name
  fvarMetadata: labelDescription
experimentData: use 'experimentData(object)'
Annotation: ragene10stv1 

 

Now I want to get eset object only where Symbol is available for corresponding ID 

sub<-eset[fData(eset)[2]!="NA"]

This gives me whole 28826 features again.

I appreciate any help.

Regards,

affy • 1.6k views
ADD COMMENTlink modified 5.0 years ago by James W. MacDonald52k • written 5.0 years ago by kaushal Raj Chaudhary10
Answer: Subsetting ESet object based on featuredata
2
gravatar for James W. MacDonald
5.0 years ago by
United States
James W. MacDonald52k wrote:

You don't want to use getSYMBOL() any longer. Instead you want to do

gns <- select(ragene10sttranscriptcluster.db, featureNames(eset), c("SYMBOL","GENENAME"))

at which time you will get a warning stating that you have multiply-mapped probesets. You will have to deal with this as you see fit; I tend to simply keep the first of the duplicates, as in aggregate this tends to select what I consider to be the 'right' one.

gns <- gns[!duplicated(gns[,1]),]
fData(eset) <- gns

And you can also then do

sub <- eset[!is.na(gns[,2]),]

 

ADD COMMENTlink written 5.0 years ago by James W. MacDonald52k

Thanks, Jim.

ADD REPLYlink written 5.0 years ago by kaushal Raj Chaudhary10
Please log in to add an answer.

Help
Access

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