MicroArrayReader.r

### Procedures for reading array data into R
#

library(limma);

## Agilent:

agilent.datacolumns=list(E='gMeanSignal', meanSignal='gMeanSignal', processedSignal='gProcessedSignal', backgroundSignal='gBGMeanSignal', isNonUniform='gIsFeatNonUnifOL', isPopOutlier='gIsFeatPopnOL', multDetrendSignal='gMultDetrendSignal');

read.agilent=function(files,path=NULL,source='agilent',green.only=TRUE,columns=agilent.datacolumns,...) {
	arrays=read.maimages(files,path=path,source=source,green.only=green.only,columns=columns,...);
	invisible(arrays);
};

preprocess.agilent=function(arrays) {
	arrays$exclude=(arrays$isNonUniform>0)|(arrays$isPopOutlier>0);
	arrays$log2.raw=log2(arrays$meanSignal/arrays$multDetrendSignal);
	arrays$log2.raw[arrays$exclude]=NA;
	grp=arrays$genes$ProbeName;
	grp[arrays$genes$ControlType!=0]=NA;
	arrays$log2.probe=matrix.mean(arrays$log2.raw,2,grp);
	arrays$log2.probe[is.na(arrays$log2.probe)]=NA;
	invisible(arrays);
}
Last modified March 06, 2014.