[BioC] Re: writing exprSet to a flat file/exprSet superclass

Vincent Carey 525-2265 stvjc@channing.harvard.edu
Wed, 3 Apr 2002 14:27:35 -0500 (EST)

> which do you think is better
> 1 a method for exprSet called write
> 2 a method for exprSet called write.table
> 3 a method for exprSet call write.exprs
> 4 a function called write.exprs

the simple approach suggested in

> >    write.exprs(eset, file="", ...)
> >        write.table(exprs(eset), file, ...)

is very nice, in my view.  it  would just be

    write.exprs <- function(eset, file="", ...)
        write.table(exprs(eset), file, ...)

and now it is a first class function.  lots of flexibility,
no safety.

independently, we might get mileage out of a
"write" method with signature ("exprSet", "character",
"eSetElement", "targetFmt")
and reasonable defaults, so that if one said write(golubTrain,"myExprs")
one just gets write.table of the exprs data to "myFile", or if one said
write(golubTrain, "myPhen.xml", "phenoData", "phenXML") one could get
a suitable markup of the phenoData

we need to enumerate the eSetElements and targetFmts to control
the requests that would be handled

i am not comfortable with the long signature and the need to define
new classes of elements or target formats; perhaps some additional
discussion can clarify.

while we are on this important topic, let's see if there is interest
in a 'superclass' for exprSets.  it seems to me that the key
property of the exprSet is the tight linkage between expression
matrix columns and phenoData rows.  in other applications we
will want to have tightly linked structures, but of different forms.

it seems to me that we might define a binfoSet class, which has
slots binfoData, phenoData, metaData.  the various shaping operations
are defined for this class.  exprSet specializes
binfoSet so that the binfoData slot is the numerical matrix "exprs",
seqSet specializes binfoSet so that the binfoData slot is the
character matrix "seqs".   i am thinking of the case where individuals
are infected with HIV and i have the subject-specific sequences of the
virus associated with each individual

i am not entirely clear on how this could be carried out using
extends and setAs.  can exprSet extend binfoSet and rename the binfoData
slot to exprs?