loadExpr: Load txt files into matrix or dataframe

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/loadExpr.R

Description

Functions to load txt files of gene expression data or clinical data into matrix or dataframe.

Usage

1
2
  loadExpr(file, sep='\t')
  loadClin(file, sep='\t')  

Arguments

file

File path to the text file, in which first row is the header, first column contains row names.

sep

the field separator character. As defined in the read.table function.

Details

loadExpr and loadClin use readLines function to process text files, thus bypass some cases where read.table hangs due to warnings caused by the file. It also provides a progress bar for progress monitoring.

Value

loadExpr returns a matrix with expression values. loadClin returns a matrix with text entries. The popular notations for missing values are treated as 'NA' in the matrix.

Author(s)

Wei-Yi Cheng

See Also

read.table

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# This example requires a Synapse account. It shows how to load expression data and 
# clinical data from Synapse.
## Not run: 
require(synapseClient)
synapseLogin()

# Load TCGA READ IlluminaHiSeq RNASeq data
syn <- loadEntity("syn1446276")
fileName <- file.path(syn$cacheDir, syn$files[[1]])
ge <- loadExpr(fileName)

# Load TCGA READ Clinical_patient file
syn <- loadEntity("syn1446151")
fileName <- file.path(syn$cacheDir, syn$files[[1]])
clnc <- loadClin(fileName)

## End(Not run)

weiyi-bitw/cafr documentation built on May 4, 2019, 4:18 a.m.