Question: How to output a gene expression table using feature data corresponding to certain labels from an ExpressionSet?
0
gravatar for grokaine
4.5 years ago by
grokaine20
Germany
grokaine20 wrote:

Here is what I am doing:

#GDS download and processing test
source("http://bioconductor.org/biocLite.R")
biocLite()
library(GEOquery)
gds <- getGEO('GDS756')
#Convert to ExpressionSet
eset <- GDS2eSet(gds,do.log2=TRUE)

eset is summarized like this:

ExpressionSet (storageMode: lockedEnvironment)
assayData: 22283 features, 6 samples 
  element names: exprs 
protocolData: none
phenoData
  sampleNames: GSM21712 GSM21713 ... GSM21718 (6 total)
  varLabels: sample disease.state description
  varMetadata: labelDescription
featureData
  featureNames: 1007_s_at 1053_at ... AFFX-TrpnX-M_at (22283 total)
  fvarLabels: ID Gene title ... GO:Component ID (21 total)
  fvarMetadata: Column labelDescription
experimentData: use 'experimentData(object)'
  pubMedIds: 16531451 
Annotation: 

What I want is to output a table in a text file, containing the following columns: (Affymetrix probe ID, ENTREZ Gene ID, expression for sample 1, ..., expression for sample n).

Weirdly enough, GEOQuery manual says that eset should not contain annotated genes, but it seems from my basic object inspection that the featureData contains just that. However my R knowledge is limited so I was unable to produce my table from it.

geoquery R • 7.5k views
ADD COMMENTlink modified 4.5 years ago by Sean Davis25k • written 4.5 years ago by grokaine20
4
gravatar for Sean Davis
4.5 years ago by
Sean Davis25k
National Institutes of Health, Bethesda, MD
Sean Davis25k wrote:
write.table(data.frame(fData(eset),exprs(eset)),file="expression.txt",row.names=FALSE,sep="\t")
ADD COMMENTlink written 4.5 years ago by Sean Davis25k
1

Thanks, I modded @Sean Davis line to match my desire output:

feset <- fData(eset)
teset <- exprs(eset)
cnames <- c( c("ID", "GeneID"), colnames(teset))
write.table(data.frame(feset$ID, feset$"Gene ID",teset),file="expression.txt",row.names=FALSE, col.names=cnames, sep="\t")

 

ADD REPLYlink modified 4.5 years ago • written 4.5 years ago by grokaine20
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 2.3.0
Traffic: 1544 users visited in the last hour