matrixQtl: matrixQtl

Description Usage Arguments Value Author(s) See Also Examples

Description

matrixQtl calculates the correlation between snp and quantitative trait

Usage

1
matrixQtl(snp, trait, covariate = NULL)

Arguments

snp

a matrix of numeric values in size of sample*snp

trait

a matrix of numeric values in size of sample*trait

covariate

a matrix of numeric values in size of sample*covariate

Value

A list containing two components:

Author(s)

Shijia Zhu, shijia.zhu@mssm.edu

See Also

matrixPval;

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
snp <- sapply(1:100,function(i) rnorm(1000) )
alpha <- sapply(1:10,function(i) rnorm(100) )
trait <- snp %*% alpha
covariates <- prcomp(snp)$x[,1:5]

qtl <- matrixQtl( snp, trait , covariates )
pval1 <- matrixPval( r=qtl$r , df=qtl$df)

pval2 <- matrix(nrow=ncol(snp),ncol=ncol(trait),data=0)
for(i in 1:ncol(snp))
{
  for(j in 1:ncol(trait))
  {
    pval2[i,j] <- summary(lm(trait[,j]~snp[,i]+covariates))$coef[2,4]
  }
}


head(pval1)
head(pval2)

fanglab/MatrixEpistasis documentation built on May 25, 2019, 5:22 p.m.