I am working with the library Affy from Bioconductor, and would like to make some calculations using the oligo library, but without having to read again the CEL files I'm using. For that I need to convert the AffyBatch object to an ExpressionFeatureSet (obtained after reading CEL files with oligo library). Does anybody know how to do it?
if I am not mistaken, affyBatch objects are created with the affy package, which is different than the 'oligo' package.
If you have old 3' affymetrix microarrays, then use affy, but if you have the newer ST microarrays then the 'affy' package won't work and you have to use the 'oligo' package.
Example of code I used: affyRaw is going to be a GeneFeatureSet and AffyNorm is the normalized ExpressionSet you are looking for. If you want to look at the expression matrix, use exprs(AffyNorm/AffyRaw)
## Loading data expression for Affymetrix Gene 2.0 ST array ##
library(oligo)
#### Load the data ####
# Load the CEL files and the phenotypic data
celFiles <- list.celfiles("directory", full.names = TRUE)
pheno_data <- read.AnnotatedDataFrame("phenoData.txt", header=TRUE, sep="\t")
affyRaw <- read.celfiles(celFiles, phenoData=pheno_data, verbose=FALSE, checkType=FALSE)
annotation(affyRaw) <- "pd.mogene.2.0.st"
#### RMA normalization####
affyNorm <- rma(affyRaw, target="core")