This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Cannot instantiate ExpressionSet

Hello,

I am a beginner with bioinformatics.. I am trying to follow https://app.datacamp.com/learn/courses/differential-expression-analysis-with-limma-in-r

library(tidyverse)
rm(list=ls())
BiocManager::install("breastCancerVDX")
#https://bioconductor.org/packages/release/data/experiment/html/breastCancerVDX.html
library(breastCancerVDX)
library(Biobase)

# load the dataset
data(vdx)
eset <- ExpressionSet(assayData = exprs(vdx),
                      phenoData = AnnotatedDataFrame(pData(vdx)),
                      featureData = AnnotatedDataFrame(data.frame(featureNames(vdx))))

This returns:

Error in validObject(.Object) : invalid class “ExpressionSet” object: featureNames differ between assayData and featureData

However:

identical(featureNames(vdx), rownames(exprs(vdx)) TRUE

How can I fix this?

Many thanks,

Hans

expressionset bioconductor

1 answer

identical(data.frame(featureNames(vdx)), rownames(exprs(vdx))) is FALSE because you convert a vector to a data.frame so the rownames will be 1,2,...nrows

I suggest you to add a step to create featureData :

featureData=data.frame(featureNames(vdx))
rownames(featureData)=featureNames(vdx)
eset <- ExpressionSet(assayData = exprs(vdx),
                      phenoData = AnnotatedDataFrame(pData(vdx)),
                      featureData = AnnotatedDataFrame(featureData))

Log in to answer this question.