LKM_Int: KM for Traits by Time Interaction in Longitudinal GWAS Data

Description Usage Arguments Value Examples

View source: R/LKM_Int.R

Description

This function (LKM_Int) is used to perform Kernel Machine analysis for quantitative traits by time interaction in GWAS longitudinal data.
# It considers random intercept and random time

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
LKM_Int(
  phenotype,
  time,
  yid,
  genotypes,
  gid,
  covariates = NULL,
  acc = 1e-04,
  append.write = NULL
)

Arguments

phenotype

A vector of quantitative trait in the analysis (class: vector). The order should match the vector yid. No missing.

time

A vector of time points (class: vector). The order should match the vector yid. No missing.

yid

A vector of id (class: vector). Although it doesn't have to be sorted, observations from the same subject have to be connected with each other. The repeated id numbers indicate multiple time points for one subject. Make sure it is not a factor. No missing.

genotypes

1st column: gene name; 2nd column: snp name; 3rd-end columns: A matrix of genotypes for each subject (class: data.frame). The order of 3rd-end columns should match unique(yid). Coded as 0, 1, 2 and no missing. This genotype file can be a big file containing all genes or it can be files containing one single gene.

gid

A vector of id mapping to samples in genotype file (class: vector). So the order of samples in gid must be the same as the order in genotypes. Make sure it is not a factor. Although gid doesn't have to be in the same order as yid, it is suggested to make them sorted in the same order in order to make all files easily to be tracked. No missing.

covariates

A matrix of covariates (class: data.frame). The order of rows should match the vector yid. Default NULL. No missing.

acc

Accuracy of numerical integration used in Davies' method. Default 1e-4.

append.write

The name of pvalue output file. Write out p-values in real time. Don't need to wait until all genes are processed to get the final output.

Value

output: longitudinal time by marker interaction (LKM_Int) p-value

Examples

1
2
3
4
5
6
7
8
9
######################################################################################
### Examples for Marker by Time Interaction in Longitudinal Continuous Traits in GWAS
######################################################################################
###################
# Data using KM ###
###################
data("LKM_numID_int")
pvalue1 <- LKM_Int(phenotype=lkm_int_n_y$y, genotypes=lkm_int_n_gene, time=lkm_int_n_y$time,
yid=lkm_int_n_y$id, gid=lkm_int_n_gid$gid, covariates=NULL)

KMgene documentation built on July 8, 2020, 6:09 p.m.

Related to LKM_Int in KMgene...