writeDGEList: Write an DGEList object as plain files for downstream...

View source: R/writeDGEList.R

writeDGEListR Documentation

Write an DGEList object as plain files for downstream analysis

Description

Write an DGEList object as plain files for downstream analysis

Usage

writeDGEList(
  dgeList,
  exprs.file,
  fData.file,
  pData.file,
  group.file,
  groupLevels.file,
  feat.name = NULL,
  feat.desc = NULL
)

Arguments

dgeList

An DGEList object

exprs.file

File name where counts are saved

fData.file

File name where feature annotations are saved

pData.file

File name where sample annotations are saved

group.file

File name where the sample group information is saved

groupLevels.file

File where the sample group levels are saved

feat.name

Feature names. Can be a column name in genes of the DGEList object, or a vector of the same length as the fetaures. If NULL, row names of the count matrix are used.

feat.desc

Feature descriptions, used in GCT files. If NULL, 'GeneSymbol' will be used if the column is present, otherwise no description will be used

Expression values are saved by default in the gct format, unless the file name ends with tsv in which case a tab-separated value (TSV) file will be saved.

Sample group and group level information are derived from the group column of the sample annotation.

Note

In case the input matrix has no feature name, the feature names are set to be the integer array starting from 1.

In case no genes item is available in the DGEList, a minimal data.frame containing one column, Feature, is exported with row names of the count matrix used as both row names as well as the content of the Feature column.

Examples



y <- matrix(rnbinom(10000,mu=5,size=2),ncol=4)
d <- DGEList(counts=y, group=rep(1:2,each=2))

exprsFile <- tempfile()
fDataFile <- tempfile()
pDataFile <- tempfile()
groupFile <- tempfile()
groupLevelsFile <- tempfile()
writeDGEList(d, exprs.file=exprsFile, fData.file=fDataFile, pData.file=pDataFile, 
  group.file=groupFile, groupLevels.file=groupLevelsFile)

head(ribiosIO::read_gct_matrix(exprsFile))
head(ribiosIO::readMatrix(fDataFile))
head(ribiosIO::readMatrix(pDataFile))
head(readLines(groupFile))
head(readLines(groupLevelsFile))


bedapub/ribiosNGS documentation built on Feb. 10, 2025, 12:34 a.m.