Entering edit mode
Yves Bastide
▴
50
@yves-bastide-442
Last seen 10.2 years ago
Hi *,
attached is a small patch for limma's read.imagene function, to read
each files' header and not just the first one. Reason: all files may
not have the same header, thus not the same "skip" amount.
yves
-------------- next part --------------
--- limma/R/input.R~ 2003-09-27 08:42:21.000000000 +0200
+++ limma/R/input.R 2003-09-29 17:34:39.000000000 +0200
@@ -173,7 +173,6 @@ read.imagene <- function(files,path=NULL
fullname <- files[1,1]
if(!is.null(path)) fullname <- file.path(path,fullname)
headers <- getImageneHeaders(fullname)
- skip <- headers$Begin.Raw.Data
printer <-
headers$Field.Dimensions[c("Metarows","Metacols","Rows","Cols")]
nspots <- prod(unlist(printer))
if(verbose) cat("Read header information\n")
@@ -186,12 +185,16 @@ read.imagene <- function(files,path=NULL
for (i in 1:narrays) {
fullname <- files[i,1]
if(!is.null(path)) fullname <-
file.path(path,fullname)
+ headers <- getImageneHeaders(fullname)
+ skip <- headers$Begin.Raw.Data
obj<- read.table(fullname,skip=skip,header=TRUE,sep=se
p,quote=quote,check.names=FALSE,comment.char="",nrows=nspots,...)
if(verbose) cat(paste("Read",fullname,"\n"))
RG$G[,i] <- obj[,columns$f]
RG$Gb[,i] <- obj[,columns$b]
fullname <- files[i,2]
if(!is.null(path)) fullname <-
file.path(path,fullname)
+ headers <- getImageneHeaders(fullname)
+ skip <- headers$Begin.Raw.Data
obj<- read.table(fullname,skip=skip,header=TRUE,sep=se
p,quote=quote,check.names=FALSE,comment.char="",nrows=nspots,...)
if(verbose) cat(paste("Read",fullname,"\n"))
RG$R[,i] <- obj[,columns$f]