Skip to content

Transmission mean test (TMT) for genetic causal inference in families

License

Notifications You must be signed in to change notification settings

StoreyLab/geneticTMT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

geneticTMT

R-CMD-check.yaml

The geneticTMT R package implements the Transmission Mean Test (TMT) and the Transmission Disequilibrium Test (TDT) to infer causal genotype-phenotype relationships for population-sampled nuclear families.

Installation

install.packages("devtools")
devtools::install_github("StoreyLab/geneticTMT")

Examples

Input trio data

geneticTMT handles trio genotypes and phenotypes such as the example below:

library(geneticTMT)
# load example trio genotypes and phenotypes
data(triolist)
# trio genotypes can be either phased or unphased
trio_unphased <- matrix(c(triolist$geno_m[1,],
                          triolist$geno_p[1,],
                          triolist$geno_c[1,]),
                        nrow=3, byrow=TRUE)
# phased data include parental transmitted alleles                      
trio_phased <- matrix(c(triolist$geno_m[1,],
                        triolist$geno_p[1,],
                        triolist$allele_m[1,],
                        triolist$allele_p[1,]),
                      nrow=4, byrow=TRUE)

TMT

Calculate the TMT statistic as an unbiased estimate of the average causal effect of the target locus on the child's trait.

dtmt <- calc_dtmt(triolist$y, trio_unphased)

Calculate p-value via the main test function

ptmt <- tmtest(triolist$y, trio_unphased, test='TMT')

TDT

TDT requires dichotomous phenotypes.

# convert quantitative to dichotomous
y_binary <- triolist$y
y_binary <- ifelse(y_binary>median(y_binary), 1, 0)

Calculate the TDT statistic as an unbiased estimate of the average causal effect of the target locus on the child's trait.

dtdt <- calc_dtdt(y_binary, trio_unphased)

Calculate p-value via the main test function

ptdt <- tdtest(y_binary, trio_unphased)$p

Citations

About

Transmission mean test (TMT) for genetic causal inference in families

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages