[BioC] Changing the value of sampleNames for exprSet

James W. MacDonald jmacdon at med.umich.edu
Thu Aug 17 21:21:43 CEST 2006


Hi Jeff,

I would just use the sampleNames argument to ReadAffy() or justRMA() to 
read in the names you want to use instead of trying to change after the 
fact.

 > eset <- justRMA(filenames = list.celfiles()[1:5],sampleNames = 
sub("\\.CEL$","", list.celfiles()[1:5]))
Background correcting
Normalizing
Calculating Expression
 > sampleNames(eset)
[1] "EA02014_40455_H133A_1" "EA02014_40456_H133A_2" "EA02014_40457_H133A_3"
[4] "EA02014_40459_H133A_5" "EA02014_40461_H133A_7"

HTH,

Jim


Jeff Lande wrote:
> 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}}
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor


-- 
James W. MacDonald, M.S.
Biostatistician
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623


**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.



More information about the Bioconductor mailing list