writeEset: Export an ExpressionSet object as tab-delimited (or gct)...

View source: R/io_tab.R

writeEsetR Documentation

Export an ExpressionSet object as tab-delimited (or gct) files

Description

Export an ExpressionSet object as tab-delimited (or gct) files

Usage

writeEset(
  eset,
  exprs.file,
  fData.file,
  pData.file,
  exprs.file.format = c("gct", "tsv"),
  feat.name = NULL,
  feat.desc = NULL
)

Arguments

eset

The eSet object to be exported

exprs.file

Character, file name where exprs data is written to

fData.file

Character, optional, file name where fData data is written to

pData.file

Character, optional, file name where pData data is written to

exprs.file.format

Character, write exprs data in either gct or tsv format

feat.name

Character, feature names or a column in fData to get feature names. If NULL, feature names of the eSet object will be used. Note that if not NULL, row names of both exprs and fData will be overwritten by the provided feat.name.

feat.desc

Character, feature descriptions or a column in fData to get feature descriptions. If NULL, the column in the gct file will be empty. Only used if exprs.file.format is gct.

readEset and writeEset provide a lightweighted mechanism to import/export essential information from/to plain text files. They can use up to three tab-delimited files to store information of an eSet (oftenly used is its subclass, ExpressionSet) object: a file holding the expression matrix as returned by the exprs function (exprs.file), a file containing feature annotations as returned by the fData function (fData.file), and finally a file containing sample annotations, as returned by pData (pData.file).

Value

NULL, only side effect is used

Note

One limitation of readEset and writeEset functions is that they only support the export/import of exactly one expression matrix from one ExpressionSet object. Although an ExpressionSet can hold more than one matrices other than the one known as exprs, they are currently not handled by writeEset or readEset. If such an ExprssionSet object is first written in plain files, and then read back as an ExpressionSet, matrices other than the one accessible by exprs will be discarded.

Similarly, other pieces of information saved in an ExpressionSet, e.g. experimental data, are lost as well after a cycle of exporting and subsequent importing. If keeping these information is important for you, other functions should be considered instead of readEset and writeEset, for instance to save an image in a binary file with the save function.

Yet another limitation is that factor information is lost. This hits especially the phenoData where factor information, such as sample groupping and orders of levels, may be important.

See Also

readEset

Examples

data(sample.ExpressionSet, package="Biobase")
exprs.file <- tempfile()
fData.file <- tempfile()
pData.file <- tempfile()
writeEset(sample.ExpressionSet, exprs.file, fData.file, pData.file,
exprs.file.format="gct")
writeEset(sample.ExpressionSet, exprs.file, fData.file, pData.file,
exprs.file.format="tsv")

bedapub/ribiosExpression documentation built on Sept. 2, 2023, 4:37 a.m.