Hello I have an ExpressionSet object that I would like to save it to csv file. My question is how to transpose it to have the genes names on the rows and the columns name on the columns. Also how to save it with columns and rows headers? Below is the code.
library(Biobase) library(genefilter) library(data.table)
phenoData:
tmp <- read.csv("pdata.csv", row.names = 1) pdata <- AnnotatedDataFrame(tmp)
featureData:
tmp <- read.csv("fdata.csv", row.names = 1) fdata <- AnnotatedDataFrame(tmp)
expression data:
tmp <- read.table("exprs.txt") m <- as.matrix(tmp)
create ExpressionSet object:
eset <- new("ExpressionSet", exprs = m, phenoData = pdata, featureData = fdata)
f1 <- kOverA(5, 800) ffun <- filterfun(f1) wh1 <- genefilter(exprs(eset), ffun) eset=eset[wh1] write.csv( eset, file = "cleanData.csv", col.names=TRUE)
I try it. I got this error:
t(eset) Error in t.default(eset) : argument is not a matrix