limma: read.imagene patch
1
0
Entering edit mode
Yves Bastide ▴ 50
@yves-bastide-442
Last seen 9.6 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]
• 681 views
ADD COMMENT
0
Entering edit mode
@gordon-smyth
Last seen 6 hours ago
WEHI, Melbourne, Australia
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]
ADD COMMENT

Login before adding your answer.

Traffic: 1013 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6