[BioC] Changing the value of sampleNames for exprSet

Jeff Lande land0038 at umn.edu
Thu Aug 17 21:00:33 CEST 2006


I have a question about editing sampleNames in an exprSet object.  I would
like to get rid of the .CEL portion of the file name (or change it
altogether) that occurs when I use ReadAffy() and rma() to create an
exprSet.  

To put it into context, I am calculating additional phenoData elements from
existing phenoData elements and then assigning the updated phenoData object
to the exprSet.  

I had been using the following assignments in the past

> pd <- read.phenoData(filename="samplenames.txt")
> phenoData(origexprSet) <- pd
> newexprSet <- new('exprSet',exprs=exprs(origexprSet),phenoData=pd)

In the most recent version of R/BioC, this produced an error 

(Error in validObject(.Object) : invalid class "exprSet" object: sampleNames
different from names of phenoData rows).  

To my understanding, this is occurring because of the new object checking
feature.  The exprSets were created in a previous version of R, so I was
previously able to connect the exprSet and phenoData with differing sample
names (the difference being in the .CEL extension in the sampleNames for the
exprSet that is results from the ReadAffy() command and no .CEL extension in
the rownames of the phenoData).  I'm able to modify the phenoData object
with the command

rownames(pData(pd)) <- sampleNames(origexprSet)

and then get the 
	newexprSet <- new('exprSet',exprs=exprs(origexprSet),phenoData=pd)
assignment to work.

I would actually rather get rid of the .CEL extension in the sampleNames of
the exprSet object, but I'm getting an error:

> sampleNames(origexprSet) <- sub(".CEL$","",sampleNames(origexprSet))
Error in slot(object, slotNames[[i]]) : no slot of name "reporterInfo" for
this object of class "exprSet"

Any help would be appreciated.  

> sessionInfo()
Version 2.3.0 (2006-04-24) 
i386-pc-mingw32 

attached base packages:
[1] "tools"     "methods"   "stats"     "graphics"  "grDevices" "utils"    
[7] "datasets"  "base"     

other attached packages:
    affy   affyio  Biobase 
"1.10.0"  "1.0.0" "1.10.0"

Thanks,

Jeff Lande
Univ of MN

CONFIDENTIALITY NOTICE: Electronic messages can be misdirect...{{dropped}}



More information about the Bioconductor mailing list