[BioC] limma: read.imagene patch

Gordon Smyth smyth at wehi.edu.au
Tue Sep 30 13:24:15 MEST 2003


Dear Yves,

Thanks for the suggested code changes. Before I make commit changes to the 
code, would you mind showing me an example of some headers which change 
length? I know that different versions of Imagene produce different 
headers, but read.imagene() like read.maimages() is designed to read a 
batch of arrays which should in principle have the same layout, so I would 
be uncomfortable about users reading in unrelated arrays. I just want to 
see in what ways the header can change within one experiment.

Note also that if you have two batches of arrays scanned with different 
settings, you can read them into two RGList objects and then combine the 
objects using cbind.

Cheers
Gordon

At 01:48 AM 30/09/2003, Yves Bastide wrote:
>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
>
>--- 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