[BioC] Error while building ExpressionSet from scratch....

john herbert arraystruggles at gmail.com
Mon Nov 14 17:50:21 CET 2011


Hi Bass,
I was playing around building my own expression set last week (there
could be easier ways) It is possible something in it could help you.
This was for 2 colour array data but can be modified for PCR data etc.

# Jump to directory where data files are
setwd("C:/somewhere")

dir()
files = c("two_colour_1.txt", "two_colour_2.txt", "two_colour_3.txt",
"two_colour_4.txt")

library(marray)
# load Agilent files
mraw = read.Agilent(files)
# normalise data
mnorm = maNorm(mraw, "loess")

# ignore control spots
non_controls = mnorm at maGnames@maInfo$ControlType == 0
just_genes = mnorm[non_controls,]

# Take just the expression M values
fullexp = just_genes at maM
rownames(fullexp) = just_genes at maGnames@maInfo$SystematicName

# find something for missing values
library(impute)
imputed = impute.knn(fullexp, k=3)$data

# Average spots for the same gene
averaged = avereps(imputed)

# Give some column names to averaged expression M value matrix
names=c("two_colour_1","two_colour_2","two_colour_3","two_colour_4")
colnames(averaged)=names

# Make up some phenotype data into a data frame (rownames of pframe
must be colnames of gene expression matrix)
Cy3 = rep("control", 4)
Cy5 = rep("treatment", 4)
pframe = data.frame(Cy3=Cy3, Cy5=Cy5)
rownames(pframe) = colnames(averaged)
pframe

# Make some information to store about array (rownames of metadata
must be the same as column names of pframe)
metadata = data.frame(labelDescription=c("Normal RNA labelled with
Cy3", "Treatment RNA was labelled with Cy5"))
metadata
rownames(metadata)=colnames(pframe)
metadata

# Make a new annotated data frame with the above meta and pheno data
library("Biobase")
adf2 = new("AnnotatedDataFrame", data=pframe, varMetadata=metadata)
adf2

# Give some background information in the MIAME format.
experimental_data = new("MIAME", name="john", lab="BigLab",
contact="me", title="Treatment vs. control")

# Make a new expression set object.
exp_set = new("ExpressionSet", exprs=averaged, phenoData=adf2,
experimentData=experimental_data)

Cheers,

John.

On Mon, Nov 14, 2011 at 2:38 PM, Vincent Carey
<stvjc at channing.harvard.edu> wrote:
> On Mon, Nov 14, 2011 at 7:37 AM, Bas Jansen <bjhjansen at gmail.com> wrote:
>
>> Hi Bioconductor gurus:
>>
>> I am trying to make ExpressionSet files for the analysis of PCR
>> arrays, to be able to analyze them in LMGene. However, I get the
>> following error message:
>>
>> > eSet_xxx <- new("ExpressionSet", exprs = exprs_xxx, phenoData =
>> phenoData_xxx, experimentData = experimentData)
>> Error in function (classes, fdef, mtable)  :
>>  unable to find an inherited method for function
>> "annotatedDataFrameFrom", for signature "data.frame"
>>
>> I have done this a gazillion times before without a hitch, and
>> suddenly I'm not able to do so anymore. If anyone knows what's going
>> on, I am all ears.
>>
>> Dear Bas,
>
> Did you have a look at documentation?   There is a vignette in Biobase
> called BiobaseDevelopment that shows that we pass an AnnotatedDataFrame
> instance in for phenoData.
>
> obj <- new("ExpressionSet", phenoData = new("AnnotatedDataFrame"),
> experimentData = new("MIAME"), annotation = character(), exprs =
> new("matrix"))
>
> You don't say what class phenoData_xxx has, but presumably it is a
> data.frame.  The following may be relevant
>
>> new("AnnotatedDataFrame", data=data.frame())
> An object of class "AnnotatedDataFrame": none
>> new("AnnotatedDataFrame", data=data.frame(1))
> An object of class "AnnotatedDataFrame"
>  rowNames: 1
>  varLabels: X1
>  varMetadata: labelDescription
>
>
>
>> Kind regards,
>> Bas
>>
>> > sessionInfo()
>> R version 2.13.2 (2011-09-30)
>> Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
>>
>> locale:
>> [1] C/UTF-8/C/C/C/C
>>
>> attached base packages:
>> [1] splines   tools     stats     graphics  grDevices utils     datasets
>> [8] methods   base
>>
>> other attached packages:
>> [1] LMGene_2.8.0     affy_1.30.0      survival_2.36-10 multtest_2.8.0
>> [5] Biobase_2.12.2
>>
>> loaded via a namespace (and not attached):
>> [1] MASS_7.3-14           affyio_1.20.0         preprocessCore_1.14.0
>> [4] tcltk_2.13.2
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives:
>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>



More information about the Bioconductor mailing list