MetaDE.Read: Read data sets into R

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

View source: R/utility03282012.r

Description

Function to import data set(s) into R and reformat it (them) to form required for other functions in MetaDE package.

Usage

1
MetaDE.Read(filenames, via = c("txt", "csv"), skip,matched=FALSE, log = TRUE)

Arguments

filenames

a character vecter specifying the names of data sets to read data values from. Should be a tab-separated or comma-separated text file, with one row per gene set.

via

a character to specify the type of data sets. "txt" means tab delimited files and "csv" means comma-delimited files.

skip

a vecter of size K (the number of data sets) composes of 1 or 2. see 'Details'.

matched

a logical to specify whether the gene ProbeIDs have been matched into gene symbols in each data set.

log

a logical to specify wheter data sets need to be log2-transformed.

Details

The files to be read in should be prepared strictly according following format:
If matched is FALSE, column 1 has gene ProbeIds, column 2 has gene symbols, remaining columns are samples. If matched is TRUE, column 1 has gene symbols, remaining columns are samples. If the data set is a survival data, the second row should has the survival time,and third row should have the status of events,and remaining rows are gene expression files . otherwise, the second row should has the labels of samples and remaing rows are gene expression profiles.

If the ith file is a survival data,the corresponding element of skip should be 2, otherwise, 1.

The user can prepare the files according the structure of files wrote out using the example file.

Value

a list of studies. Each study is a list with components:

Author(s)

Jia Li and Xingbin Wang

References

Xingbin Wang, Jia Li and George C Tseng. Conducting Meta-analysis in R with the MetaDE package. http:xxxxx/MetaDE.pdf

See Also

MetaDE.match, MetaDE.rawdata

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#================example test MetaDE.Read ==================================================#
setwd(tempdir())
label1<-rep(0:1,each=5)
label2<-rep(0:1,each=5)
exp1<-cbind(matrix(rnorm(5*20),20,5),matrix(rnorm(5*20,2),20,5))
exp2<-cbind(matrix(rnorm(5*20),20,5),matrix(rnorm(5*20,1.5),20,5))
rownames(exp1)<-paste("g1",1:20,sep="_")
rownames(exp2)<-paste("g2",1:20,sep="_")
study1<-rbind(label1,exp1)
study2<-rbind(label2,exp2)
write.table(study1,"study1.txt",sep="\t")
write.table(study1,"study2.txt",sep="\t")
mydata<-MetaDE.Read(c("study1","study2"),via="txt",skip=rep(1,2),matched=TRUE,log=FALSE)
#================Non-matched  =============================================================#
label1<-rep(0:1,each=5)
label2<-rep(0:1,each=5)
exp1<-cbind(matrix(rnorm(5*20),20,5),matrix(rnorm(5*20,2),20,5))
exp2<-cbind(matrix(rnorm(5*20),20,5),matrix(rnorm(5*20,1.5),20,5))
rownames(exp1)<-paste("g1",1:20,sep="_")
rownames(exp2)<-paste("g2",1:20,sep="_")
symbol1<-sample(c("SST","VGF","CNP"),20,replace=TRUE)
symbol2<-sample(c("SST","VGF","CNP"),20,replace=TRUE)
study1<-cbind(c(NA,symbol1),rbind(label1,exp1))
study2<-cbind(c(NA,symbol2),rbind(label2,exp2))
setwd(tempdir())
write.table(study1,"study1.txt",sep="\t")
write.table(study2,"study2.txt",sep="\t")
mydata<-MetaDE.Read(c("study1","study2"),via="txt",skip=rep(1,2),log=FALSE)

MetaDE documentation built on May 29, 2017, 9 a.m.