[BioC] proposal to modify Limma read.maimages generic import

Gordon Smyth smyth at wehi.edu.au
Thu Jul 22 01:24:06 CEST 2004


At 02:00 AM 22/07/2004, Peter Wilkinson wrote:
>This is a request for Gordon Smyth ...
>
>well, it seems that I have answered my own question "Limma read.maimages 
>generic import ".... I think:
>
>The following seems to import the weights just fine, if I am importing 
>from a file that contains only the data portion of the quantarray file.
>
>RG.test <- read.maimages("SEKH0406.data", columns=list(Rf="ch2 Intensity",
>  Gf="ch1 Intensity" , Rb ="ch2 Background" , Gb ="ch1 Background"), 
> wt.fun=wtIgnore.Filter)
>
>The was not immediately evident, since I was using a generic import, 
>however the wtIgnore.Filter function is:
>
> > wtIgnore.Filter
>function (qta)
>{
>     qta[, "Ignore Filter"]
>}
>
>and that seems to find the right column.
>
>So then I tried the following so that I could include a Garea = "ch1 Area" 
>in the column list, because I would like to include area information for 
>quality control. This DOES NOT work.
>
>I would like to propose that the function that handles the column input be 
>altered so that we can extract any column we wish from the quantarray file 
>with the read.maimages function:
>
>If the initialization of the RG object could initialize itself with the 
>arbitrary list that is supplied with the columns parameter, then we can 
>import whatever data we wish with the generic importer :)

I understand that you may like to read in extra columns to play with, but 
initializing with an arbitrary column list conflicts with the basic 
philosophy of the software development environment. read.maimages() 
produces a microarray data object (an RGList object) which contains 
specified components which have pre-determined meanings. This means that 
any programmer can write functions which take RGList objects as arguments. 
("Design by contract"). Allowing an object to be produced with completely 
arbitrary components defeats the purpose of having a classed object.

If you want to read in arbitrary columns you can do it using read.series() 
or simply do it yourself using read.table(). But in the end if you are 
playing with your own analysis you may have to write some private functions.

Gordon

>The reason is that I am exploring the use of other information from the 
>quantarray output that may help in refining quality weight assignments, 
>but I do not want the calculation to be done on import, as I want the data 
>available in R. I would have to import every time I wanted to apply a new 
>weight function, which would be taxing.
>
>I think that some of the relevant code portions for this modification are:
>
>#       Initialize RG list object
>         Y <- matrix(0,nspots,nslides)
>         colnames(Y) <- names
>         RG <- list(R=Y,G=Y,Rb=Y,Gb=Y)
>         if(!is.null(wt.fun)) RG$weights <- Y
>
>change RG assigment to reflect list in columns parameter
>
>
>#       Now read remainder of files
>         for (i in 1:nslides) {
>                 if(i > 1) {
>                         fullname <- slides[i]
>                         if(!is.null(path)) fullname <- 
> file.path(path,fullname)
>                         obj <- 
> read.table(fullname,skip=skip,header=TRUE,sep=sep,as.is=TRUE,quote=quote,check.names=FALSE,comment.char="",nrows=nspots,...)
>                 }
>                 RG$R[,i] <- obj[,columns$Rf]
>                 RG$G[,i] <- obj[,columns$Gf]
>                 RG$Rb[,i] <- obj[,columns$Rb]
>                 RG$Gb[,i] <- obj[,columns$Gb]
>                 if(!is.null(wt.fun)) RG$weights[,i] <- wt.fun(obj)
>                 if(verbose) cat(paste("Read",fullname,"\n"))
>         }
>         new("RGList",RG)
>}
>
>modify this portion in the same way.
>
>
>Would this be sensible? or does there exist another alternative.
>
>Peter
>
>
>
>At 09:25 AM 7/21/2004, you wrote:
>
>>Hello there,
>>
>>I have been pondering over the help files of    'read.maimages' from the 
>>limma package when it is used for generic import.
>>
>>I have data that I have extracted the data portion of the quantarray 
>>files, since alot of the file is just wasting space on the HD. Now I want 
>>to import but the data section just looks like a regular square tab 
>>delimited file. Is there a parameter (like for specifying which column is 
>>R and which is G etc) for specifying the ignore filter column so the 
>>ignore filter function can be used to generate the $weights matrix on import?
>>
>>I looked at the source code, and I did not see that this was the case, am 
>>I correct?
>>
>>Peter W.



More information about the Bioconductor mailing list