[BioC] Eisen-formatted expression data
Steffen Moeller
steffen.moeller at med.uni-rostock.de
Tue Apr 12 12:10:22 CEST 2005
Below I paste a function that reads expression data from files formatted
for Michael Eisen's Cluster tool. If somebody took this (code/idea) and
incorporated it into the core of BioConductor, I would very much
appreciate it. A write.eisen function might be very helpful, too. Is
this of interest, should I go ahead? Where in BioConductor would this
fit in?
Kind regards
Steffen
# Reads microarray expression data formatted for
# Michael Eisen's Cluster tool.
# by Steffen Moeller <moeller at pzr.uni-rostock.de>
read.eisen <- function(file,sep="\t",dec=".") {
f<-read.table(file=file,header=TRUE,sep=sep,dec=dec)
rownames(f)<-f[,1]
if ("UNIQID"!=colnames(f)[1]) {
stop(paste("This is not a proper Eisen-formatted file
('",file,"').",sep=""))
}
if ("NAME"==colnames(f)[2]) {
colstart<-3
} else {
colstart<-2
}
if (""==rownames(f)[1]) {
rowstart<-2
} else {
rowstart<-1
}
r<-f[rowstart:nrow(f),colstart:ncol(f)]
if (2==rowstart) {
attr(r,"second.row")<-f[1,colstart:ncol(f)]
} else {
attr(r,"second.row")<-NULL
}
if (3==colstart) {
attr(r,"NAME")<-f[rowstart:nrow(f),2]
} else {
attr(r,"NAME")<-NULL
}
return(r)
}
More information about the Bioconductor
mailing list