adapt exprSet class
2
0
Entering edit mode
Vosse, S.J. ▴ 30
@vosse-sj-2409
Last seen 10.2 years ago
An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/bioconductor/attachments/20071003/ e32e0238/attachment.pl
• 669 views
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 4 months ago
United States
Hi Sjoerd -- Actually, you want to start with eSet. The next steps are likely the vignettes ExpressionSetIntroduction (more end-user oriented) and BiobaseDevelopment (developer oriented) in Biobase. > library(Biobase) > openVignettes() I'd then recommend a little refection on the data you're trying to model. In some ways an eSet is a way to organize one or more matrices with identical structure (in the assayData slot) with annotations on the rows (featureData) and columns (phenoData) and on the object as a whole (experiementData). How does this fit in with your data? If the fit is good, then likely you'll want to extend the eSet class; the AnnotatedDataFrame class might be useful to incorporate into other classes where you want a data frame with metadata about columns. The most basic extension is > setClass("MyClass", contains="eSet") If your data model is somehow more elaborate than an eSet, you might add slots to the class, using the 'representation' argument to setClass. You'll also likely add a function to check validity of objects, using the 'validity' argument or setValidity function. Perhaps your data is not all like eSet, and then you should either find another suitable class or start from scratch. Having decided what your data looks like, I'd then suggest going on to define methods for what you'd like to do with your data. These likely include 'accessors' to retrieve slots, 'show' and subset ([, [[, $) methods, etc. If your class is as simple as above, then likely these methods have already been defined for you, your object inherits them from eSet, and you don't have to do anything more. > showMethods(class="eSet") An eSet is defined to contain an assayData slot, but does not specify what is in the assayData. You'll likely put a particular type of data there, and want to write accessors for that data. For instance, the ExpressionSet class puts a matrix of expression values in the assayData. There are accessors to retrieve and set these. They look like setMethod("exprs", ... setReplaceMethod("exprs, ... in Biobase/R/methods-ExpressionSet.R. Likely your object will contain some type of data different from expression values, so you'll define a new accessors for your data. On the other hand, if your assayData _does_ contain something conceptually identical to 'exprs', then you might consider a class that contains 'ExpressionSet' rather than 'eSet'. You'll then automatically inherit the 'exprs' accessors (and also the constraints on what assayData can contain to be a valid ExpressionSet. You'll likely want to define an 'initialize' method, to create your object when you or the user calls new("MyClass"). The initialize (and other) method will almost certainly use 'callNextMethod' to initialize the classes that your class extends from. The key help pages are probably ?Classes, ?Methods, ?setClass, ?setGeneric, ?setMethod. Hope that's enough to get going. The bioc-devel list might be a better forum to continue this discussion. Martin "Vosse, S.J." <s.vosse at="" vumc.nl=""> writes: > Dear all, > > > > to add greater structure to the data exported by our package, we have > been advised to work with S4 classes. As a starting point we would like > to adapt the exprSet class, by adding new slots for example. I'm having > a very hard time finding out where to start though. Does anybody have > any pointers to documentation on S4 classes and the exprSet class? > > > > Thanking you in advance, > > > > Sjoerd Vosse > > > > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- Martin Morgan Bioconductor / Computational Biology http://bioconductor.org
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 1 day ago
United States
Hi Sjoerd, Vosse, S.J. wrote: > Dear all, > > > > to add greater structure to the data exported by our package, we have > been advised to work with S4 classes. As a starting point we would like > to adapt the exprSet class, by adding new slots for example. I'm having > a very hard time finding out where to start though. Does anybody have > any pointers to documentation on S4 classes and the exprSet class? The exprSet class has been deprecated and will likely be defunct Real Soon Now(tm), so you would be advised to use the ExpressionSet class instead. As far as documentation goes, you might look at ?eSet, ?ExpressionSet, and the vignettes that come with Biobase, namely Biobase - An introduction to Biobase and ExpressionSets and Biobase - Notes for eSet developers and Biobase - quick views of eSet instances All of which can be accessed most easily by library(Biobase) openVignette() You might also google 's4 15 pages' which will bring up (as the first item in the list) a tutorial on the use and care of S4 methods. Best, Jim > > > > Thanking you in advance, > > > > Sjoerd Vosse > > > > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- James W. MacDonald, M.S. Biostatistician Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623
ADD COMMENT

Login before adding your answer.

Traffic: 660 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6