read_gct_matrix: Calling C routine to read GCT file into a matrix

View source: R/read_gct.R

read_gct_matrixR Documentation

Calling C routine to read GCT file into a matrix

Description

The function read_gct_matrix calls the C routine read_gct to read GCT file into a matrix.

Usage

read_gct_matrix(gct.file, keep.desc = TRUE)

read_gctstr_matrix(string, keep.desc = TRUE)

Arguments

gct.file

Character, name of a gct-format file

keep.desc

Logical, whether the description of features should be returned as an attribute of the matrix

string

Character string, a character string in the GCT-file format

Details

The function read_gctstr_matrix calls the C rountine as well, to parse a character string in the GCT file format into a matrix.

This function reads GCT files into a matrix, which is a basic data structure of R. For integration with Bioconductor's ExpressionSet objects, consider using the ribiosExpression package (available on GitHub).

Value

An matrix, optionally with feature descriptions as an attribute (desc) when keep.desc is set to TRUE.

Author(s)

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

See Also

isGctFile to test if a file is in GCT format.

Examples


idir <- system.file("extdata", package="ribiosIO")
sample.gct.file <- file.path(idir, "test.gct")

test.mat <- read_gct_matrix(sample.gct.file, keep.desc=TRUE)
test.simmat <- read_gct_matrix(sample.gct.file, keep.desc=FALSE)

sample.gct.string <- paste(readLines(sample.gct.file),collapse="\n")
teststr.mat <- read_gctstr_matrix(sample.gct.string, keep.desc=TRUE)


ribiosIO documentation built on Feb. 20, 2026, 5:09 p.m.