readGctCls: Import ExpressionSet into gct/cls files the C version, about...

View source: R/io_gct_cls.R

readGctR Documentation

Import ExpressionSet into gct/cls files the C version, about 5x faster than the R implementation for the ALL dataset

Description

As complementary functions to writeGctCls, readGctCls reads a pair of gct and cls files (with same base names) into an ExpressionSet object.

Usage

readGct(gct.file)

readGctCls(file.base, gct.file, cls.file, add.fData.file, add.pData.file)

Arguments

gct.file

The name of the gct file (only valid when file.base is missing).

file.base

The full file name of gct/cls files without suffixe, if not in the current diretory, must contain the path (dirname) as well . For instance if it is set as ~/my/dir/input, then the function seeks the file ~/my/dir/input.gct and ~/my/dir/input.cls.

cls.file

The name of the cls file (only valid when file.base is missing).

add.fData.file

Optional, file of additional feature data, see details.

add.pData.file

Optional, file of additional phenotype (sample) data, see details.

Details

The readGctCls function calls internally the readGct and read_cls functions to read in two formats respeectively. readGct returns a barely annotated ExpressionSet object, and read_cls returns a vector of levels encoding sample groups.

Since gct/cls contains only one property of features and samples each (Description in the gct file as well as sample groups/levels in the cls file), readGctCls allows users to provide additional fData/pData files. They should be tab-delimited files, with first column machting exactly the names of features or samples. They must be within the path specified by the path option, namely in the same directory of gls/cls files.sample

See example below.

Value

A ExpressionSet object

An ExpressionSet object. The Description column in the gct file is encoded in the desc column in the featureData of the resulting object. The sample groups in the cls file is encoded in the cls column in the phenoData.

Functions

  • readGct(): readGct uses the C implementation of reading in a gct file

Note

The readGct function is a wrapper of the read_gct_matrix function in the ribiosIO package, which makes up the GCT matrix into an ExpressionSet object.

Author(s)

Jitao David Zhang <jitao_david.zhang@roche.com>

See Also

writeGctCls. See read_gct_matrix for underlying C code to import GCT files.

Examples


idir <- system.file("extdata", package="ribiosExpression")

sample.eset <- readGctCls(file.base=file.path(idir, "test"))

ext.eset <- readGctCls(file.base=file.path(idir, "test"),
add.fData.file=file.path(idir, "test.add.fData.txt"),
add.pData.file=file.path(idir, "test.add.pData.txt"))

stopifnot(identical(exprs(sample.eset), exprs(ext.eset)))

## try to compare pData(sample.eset) with pData(ext.eset), and similarly
## fData(sample.eset) with fData(ext.eset)


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