ReadExpr: Import and reformat gene expression data set

Description Usage Arguments Details Value Author(s) Examples

View source: R/read.expr.R

Description

Import gene expression data set into R and reformat it to the form required for other functions in this package.

Usage

1
2
ReadExpr(file.name, name, dtype, clinical.file = NULL, log = TRUE,
  sep = ",", quote = "\"", header = T)

Arguments

file.name

a character string of the name of the file to be read. See details.

name

The name of the Study object returned

dtype

The data type of the dataset (should be one of DTYPE.all)

clinical.file

if there is a clinical file containing clinical data relevent to the dataset.

log

logical. Specify whether the gene expressions need to be log2-transformed. The default is TRUE.

sep

the field separator character. Values on each line of the file are separated by this character. If sep = "", the separator is 'white space', that is one or more spaces, tabs, newlines or carriage returns. The default is ,. See read.csv.

quote

the set of quoting characters. To disable quoting altogether, use quote = "". See scan for the behaviour on quotes embedded in quotes. Quoting is only considered for columns read as character, which is all of them unless colClasses is specified. The default is \". See read.csv.

header

a logical value indicating whether the file contains the names of the variables as its first line. If missing, the value is determined from the file format: header is set to TRUE if and only if the first row contains one fewer field than the number of columns. The default is TRUE. See read.csv.

Details

The file to be read should be prepared strictly according following format. The first column should be gene ID and the remaining columns should be the gene expressions for samples. The first row should be sample names and the remaining rows should be gene expression profiles for the samples.

Value

A Study object

Author(s)

Lin Wang, Schwannden Kuo

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(study.eg)
data(preproc.option)
write.csv(study.eg@datasets[[1]], file="expr.csv")
write.csv(study.eg@clinicals[[1]], file="clinical.csv")
# Simply read expression data and append clinical data later
study <- ReadExpr(file.name="expr.csv", name="test", dtype=DTYPE.microarray)
clinical <- ReadClinical(file.name="clinical.csv")
study <- setClinical(study, list(clinical))
# Read expression and clinical data
study <- ReadExpr(file.name="expr.csv", name="test", dtype=DTYPE.microarray,
                   clinical.file="clinical.csv")

metaOmic/preproc documentation built on April 10, 2018, 1:25 a.m.