CoxKM: KM for Survival Traits in GWAS Data (calculate p-value)

Description Usage Arguments Value Examples

View source: R/CoxKM.R

Description

This function (CoxKM) is used to perform the KM analysis (Chen et al., 2014) for survival traits in GWAS data

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
CoxKM(
  object,
  SNPInfo = NULL,
  wts = function(maf) {     dbeta(maf, 1, 25) },
  method = "saddlepoint",
  snpNames = "Name",
  aggregateBy = "gene",
  mafRange = c(0, 0.5),
  verbose = FALSE
)

Arguments

object

Object saved from prepCoxKM.

SNPInfo

The SNP Info file. This should contain the fields listed in snpNames and aggregateBy. Only SNPs in this table will be meta analyzed, so this may be used to restrict the analysis.

wts

Either a function to calculate testing weights, or a character specifying a vector of weights in the SNPInfo file. For skatMeta the default are the ‘beta’ weights.

method

The p-value calculation method. Default is "saddlepoint", "integration" is the Davies method used in the SKAT package.

snpNames

The field of SNPInfo where the SNP identifiers are found. Default is "Name"

aggregateBy

The field of SNPInfo on which the skat results were aggregated. Default is "gene".

mafRange

Range of MAF’s to include in the analysis (endpoints included). Default is all SNPs (0 <= MAF <= 0.5).

verbose

Logical. Whether progress bars should be printed.

Value

output: survival trait KM (CoxKM) p-value

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
##########################################################
### Examples for Survival Traits in GWAS Data using KM ###
##########################################################
data("CoxKM_data")
library(seqMeta)
cov <- as.matrix(pheno1[,2:3])
p<-vector()
for (i in 1:2) {
  Gene <- unique(SNPInfo$gene)[i]
  choose <- SNPInfo$gene == Gene
  geno <- Z1[,choose]
  cohort1 <- prepCoxKM(Z=Z1, Surv(time, status)~strata(sex)+bmi, 
  SNPInfo=SNPInfo[choose,], data=pheno1)
  p[i] <- CoxKM(cohort1, SNPInfo=SNPInfo[choose,])
}

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

Related to CoxKM in KMgene...