exampledata: Example dataset

Description Usage Format Examples

Description

A simulated example dataset of ECCO. The variables are as follows:

Usage

1

Format

Contains the following objects:

gene_name

a vector containg the names of all genes.

M_matrix

a matrix containing the whole gene expression data.

peer

a data list containing the whole gene expression data after removing the PEER factors.

snp_raw

a data list containing the whole genotype data.

Y

the phenotype data.

peerlist

the number of peer factors to be examined.

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
29
30
31
32
33
34
35
36
data(exampledata)
attach(exampledata)
N=length(gene_name)
iv_snp=c()
summary0=c()
for(ind in 1:N)
{
tryCatch({
 gene=M_matrix[,ind]
 geno=snp_raw[[ind]]
 genename=gene_name[ind]
 result=ecco0(gene,genename,gene_name,geno,ind,Y)
 iv_snp=rbind(iv_snp,result$iv_snp)
 summary0=rbind(summary0,result$summary)
 },
 error=function(e){})
 }
 res=c()
 summary_total=summary0
 for(num_peer in 1:length(peerlist))
 {
  tryCatch({
  pheno=Y
  gene=M_matrix
  gene_name=gene_name
  peerlist=c(1,2,5)
  summary<-ecco(pheno,peer[[num_peer]],gene_name,iv_snp,peerlist[num_peer],summary0)
  },
  error=function(e){})
  summary_total=rbind(summary_total,summary)
  res=rbind(res,c(cor(as.numeric(summary[,4]),as.numeric(summary[,5])),peerlist[num_peer]))
  }
  res=data.frame(res)
  optimal_num_peer=res[which(res[,1]==max(res[,1])),2]
closeAllConnections()
detach(exampledata)

fanyue322/ECCO documentation built on July 11, 2020, 1:10 p.m.