read_pheno: Read pheno data from CLS or tab-delimited file

View source: R/read_pheno.R

read_phenoR Documentation

Read pheno data from CLS or tab-delimited file

Description

Read pheno (sample annotation) data from CLS file or tab-delimited file (sample information file).

Usage

read_pheno(file)

read_pheno_factor(file)

Arguments

file

A CLS file or tab-delimited file

Details

read_pheno returns a data.frame.

read_pheno_factor returns a factor, indicating sample groups. If the input file is a tab-delimited file, it filters out columns which are identical for all samples and columns which are unique for each sample. Consequently the remaining covariates are concatenated by the underscore character to form a factor. See examples below

Value

read_pheno returns a data.frame containing sample annotations. In case of CLS input file, the data.frame contains two columns: Array (indices of arrays) and Class (classes indexed in the GCT file). In case of tab-delimited file, the file will be parsed into the data.frame, assuming the file having column names but no row names.

Author(s)

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

References

For CLS and sample information file formats, see the GenePattern file formats documentation at https://software.broadinstitute.org/cancer/software/genepattern/file-formats-guide.

See Also

read_cls and read.csv.

Examples


testClsFile <- system.file("extdata/test.cls", package="ribiosIO")
testPhenoFile <- system.file("extdata/testSampleInfo.txt",
package="ribiosIO")

(clsPheno <- read_pheno(testClsFile))
(txtPheno <- read_pheno(testPhenoFile))

## read_pheno_factor
(clsPhenoClass <- read_pheno_factor(testClsFile))
(txtPhenoClass <- read_pheno_factor(testPhenoFile))

testPhenoFileCov <- system.file("extdata/testSampleInfo-cov.txt",package="ribiosIO")
read_pheno_factor(testPhenoFileCov)


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