[BioC] limma: read.imagene patch

Yves Bastide Yves.Bastide at irisa.fr
Mon Sep 29 18:48:31 MEST 2003


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=sep,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=sep,quote=quote,check.names=FALSE,comment.char="",nrows=nspots,...)
 		if(verbose) cat(paste("Read",fullname,"\n"))
 		RG$R[,i] <- obj[,columns$f]


More information about the Bioconductor mailing list