[BioC] Edit sample Names

James MacDonald jmacdon at med.umich.edu
Wed Feb 11 18:52:53 MET 2004

I am sure you could extract the sampleNames, hit them with sub and then
put them back in, but I don't know regular expressions well enough to
tell you how to do it (I just tried and failed miserably).

My ugly hack would be to do something like this:

filenames <- list.files(pattern="\\.[cC][eE][lL]$") #Gets all .cel or
.CEL files in current directory

Then, if you used all these files you can do:

sampleNames(eset) <- filenames # Where eset is the exprSet (or
AffyBatch) you need to fix.

otherwise you can subset the filenames to choose the ones you used,
e.g., filenames[c(1,3,4,5,6)] or whatever.

My preferred way to set up the AffyBatch is to use the above list of
filenames in the call to ReadAffy so you don't have the long names:

Data <- ReadAffy(filenames=filenames)



James W. MacDonald
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109

>>> Yen Lin Chia <yenlin at stanford.edu> 02/10/04 06:25PM >>>

When I do Data<-ReadAffy(widget=TRUE), the sample names appeared to be
what I want, i.e. 10E, 2D, etc.  But, after the data are read, when I
type sampleNames(Data), the sample names is the whole path of the
like c:\my documents\....\....CEL, the names are simply too long for
histogram.  Anybody know how to fix the sample names?


Yen Lin

Bioconductor mailing list
Bioconductor at stat.math.ethz.ch 

More information about the Bioconductor mailing list