pCAInteraction: Epistasis Test by Principal Component Analysis

Description Usage Arguments Details Value Author(s) Examples

View source: R/pCAInteraction.R

Description

Test the epistasis between two genes (or genomic regions) with the principal components analysis method.

Usage

1
pCAInteraction(phenoData, x_A, x_B)

Arguments

phenoData

Vector of phenotype data which can be quantitative trait or binary trait.

x_A

Matrix of genotype of gene A.

x_B

Matrix of genotype of gene B.

Details

This function takes phenotype vector and genotype matrices as input and tests the epistasis using PCA method. The number of principal components is determined by PCA to explain 80 percent of the genetic variation. The interaction between gene A and gene B is tested with chi-squared test.

Value

It returns the p value of chi-squared test for epistasis detection between gene A and gene B.

Author(s)

Futao Zhang

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
smp_num=1000
number_snp_A=25
number_snp_B=20
pheno<-sample(c(0:500),smp_num,replace=TRUE)
smpl=rep(0,number_snp_A*smp_num)
idx_1=sample(c(1:(number_snp_A*smp_num)),ceiling(number_snp_A*smp_num/100))
idx_2=sample(c(1:(number_snp_A*smp_num)),ceiling(number_snp_A*smp_num/200))
smpl[idx_1]=1
smpl[idx_2]=2
geno_A=matrix(smpl,smp_num,number_snp_A)

smpl=sample(c(0,1,2),number_snp_B*smp_num,replace=TRUE)
geno_B=matrix(smpl,smp_num,number_snp_B)
pCAInteraction(pheno,geno_A,geno_B)

FRGEpistasis documentation built on Nov. 8, 2020, 5:51 p.m.