[Bioc-devel] accession methods to new ExpressionSet objects
Martin Morgan
mtmorgan at fhcrc.org
Thu Apr 12 15:42:06 CEST 2007
Hi Martino,
Martino Barenco <sejjmba at ucl.ac.uk> writes:
> Hi,
>
> I am in the process of updating the package I am maintaining (rHVDM)
> in the view of the upcoming deprecation of exprSet objects R2.5/
> BiobaseX.Y and I have a few questions about accession methods of the
> new ExpressionSet objects. In particular:
>
> 1) Will the pData method be still valid in the near future? I am
> asking because it is semantically identical to the old one.
Yes, pData will remain
> 2) The se.exprs method does not work on R2.4.0/Biobase 1.12.2,
> actually, it is more a remark than a question
The new ExpressionSet does not require an element se.exprs, so there
is no method defined.
> 3) But I have found a workaround using assayData
> (Name_of_ExpressionSet)$se.exprs, will this be still valid in the
> near future?
Yes assayData(obj) returns the assay data (list or environment), and $
(or [[) can be used to extract an 'se.exprs' element (if it
exists!). You can check on the names of the assay data elements with
assayDataElementNames.
> 4) I also need to be able to modify the se.exprs matrix and the above
> command does not allow that, the only way this can be done is by
> reallocating a whole new object.
obj <- assayDataElementReplace(obj, 'se.exprs', <matrix>)
or, with the very latest Biobase
assayDataElement(obj, 'se.exprs') <- <matrix>
do the trick; The awkwardness of the syntax emphasize that these are
departing from the 'usual' ExpressisonSet interface, that somehow the
se.exprs element is different from what an ExpressionSet 'is'. Likely
you should do validObject(obj) after the addition, to make sure that
the object you create is consistent with an ExpressionSet (there may
be row or column name issues with your 'se.exprs' matrix).
> 5) This update completely passed under my (admitedly poor) radar: in
> which R/Biobase were these changes first introduced so that I can
> update the "DESCRIPTION" file as well. I am interested in backward-
> as much as forward- compatibility.
Are you thinking of the 'Depends' field? You should probably indicate
the version of Biobase you used when updating your code.
> Many thanks and I hope these questions are not too silly, you might
> have guessed that I am a total beginner.
Hope that helps, and feel free to ask further questions if you need
more help.
Martin
> Martino
>
>
>
> Here is the relevant listing, I am converting an exprSet object
> (fiveGyMAS5) into a new ExpressionSet object (fiveGyMAS5), note that
> it has two data slots (exprs and se.exprs):
>
> > class(fiveGyMAS5)
> [1] "exprSet"
> attr(,"package")
> [1] "Biobase"
> > fiveGyMAS5_ES<-as(fiveGyMAS5,"ExpressionSet")
> > fiveGyMAS5_ES
> ExpressionSet (storageMode: lockedEnvironment)
> assayData: 22283 features, 21 samples
> element names: exprs, se.exprs
> phenoData
> sampleNames: cARP3-6hrs.CEL, cARP3-2hrs.CEL, ..., cARP3-10hrs.CEL
> (21 total)
> varLabels and varMetadata:
> replicate: NULL
> time: NULL
> experiment: NULL
> featureData
> featureNames: 1007_s_at, 1053_at, ..., AFFX-r2-P1-cre-5_at (22283
> total)
> varLabels and varMetadata: none
> experimentData: use 'experimentData(object)'
> Annotation [1] "hgu133a"
> > pData(fiveGyMAS5_ES)
> replicate time experiment
> cARP3-6hrs.CEL 3 6 5Gy
> cARP3-2hrs.CEL 3 2 5Gy
> cARP3-0hrs.CEL 3 0 5Gy
> cARP2-0hrs.CEL 2 0 5Gy
> cARP2-12hrs.CEL 2 12 5Gy
> cARP1-6hrs.CEL 1 6 5Gy
> cARP1-12hrs.CEL 1 12 5Gy
> cARP1-2hrs.CEL 1 2 5Gy
> cARP3-8hrs.CEL 3 8 5Gy
> cARP2-8hrs.CEL 2 8 5Gy
> cARP3-12hrs.CEL 3 12 5Gy
> cARP1-0hrs.CEL 1 0 5Gy
> cARP2-4hrs.CEL 2 4 5Gy
> cARP1-8hrs.CEL 1 8 5Gy
> cARP2-10hrs.CEL 2 10 5Gy
> cARP2-2hrs.CEL 2 2 5Gy
> cARP1-4hrs.CEL 1 4 5Gy
> cARP2-6hrs.CEL 2 6 5Gy
> cARP3-4hrs.CEL 3 4 5Gy
> cARP1-10hrs.CEL 1 10 5Gy
> cARP3-10hrs.CEL 3 10 5Gy
> > exprs(fiveGyMAS5_ES)[1,]
> cARP3-6hrs.CEL cARP3-2hrs.CEL cARP3-0hrs.CEL cARP2-0hrs.CEL
> cARP2-12hrs.CEL
> 142.3257 78.6030 78.2122
> 82.0896 162.3600
> cARP1-6hrs.CEL cARP1-12hrs.CEL cARP1-2hrs.CEL cARP3-8hrs.CEL
> cARP2-8hrs.CEL
> 152.0475 141.0750 97.6976
> 176.5356 222.5884
> cARP3-12hrs.CEL cARP1-0hrs.CEL cARP2-4hrs.CEL cARP1-8hrs.CEL
> cARP2-10hrs.CEL
> 156.5543 99.3000 125.4226
> 130.5018 175.9454
> cARP2-2hrs.CEL cARP1-4hrs.CEL cARP2-6hrs.CEL cARP3-4hrs.CEL
> cARP1-10hrs.CEL
> 85.4280 106.2817 170.4510
> 90.2580 157.8746
> cARP3-10hrs.CEL
> 185.9463
> > se.exprs(fiveGyMAS5_ES)[1,]
> Error in function (classes, fdef, mtable) :
> unable to find an inherited method for function "se.exprs", for
> signature "ExpressionSet"
> > assayData(fiveGyMAS5_ES)$se.exprs[1,]
> cARP3-6hrs.CEL cARP3-2hrs.CEL cARP3-0hrs.CEL cARP2-0hrs.CEL
> cARP2-12hrs.CEL
> 21.20778 15.79627 14.20352
> 12.50463 20.83215
> cARP1-6hrs.CEL cARP1-12hrs.CEL cARP1-2hrs.CEL cARP3-8hrs.CEL
> cARP2-8hrs.CEL
> 17.21553 16.22317 13.97164
> 31.00531 38.83279
> cARP3-12hrs.CEL cARP1-0hrs.CEL cARP2-4hrs.CEL cARP1-8hrs.CEL
> cARP2-10hrs.CEL
> 21.60900 13.49323 18.31659
> 14.55734 22.28536
> cARP2-2hrs.CEL cARP1-4hrs.CEL cARP2-6hrs.CEL cARP3-4hrs.CEL
> cARP1-10hrs.CEL
> 14.94011 14.53037 24.42759
> 17.59149 19.52623
> cARP3-10hrs.CEL
> 30.85853
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioc-devel at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
--
Martin Morgan
Bioconductor / Computational Biology
http://bioconductor.org
More information about the Bioc-devel
mailing list