Giter VIP home page Giter VIP logo

mtmm's Introduction

MTMM - A mixed-model approach for genome-wide association studies of correlated traits in structured populations

Introduction

The MTMM function as published in Nature Genetics currently don't support estimates on missing data and replicates. This is work in progress and will be accordingly updated here.

For questions and comments feel free to contact me: [email protected]

Latest update on Aug,16st 2019: New scripts now support the use of ASREML-R version 4. As there have been major changes between the latest ASREML versions, the old scripts will only run with version 3, and for the use of version 4 there is a whole new set of functions provided.

Additional updates include estimation of effect sizes and SE for the MTMM, the output of only the variance components and the handling of heterozygous genotype data. Also some updates on the visualization of the results

How to use

# new workflow compatible with ASREML-R 4 is described in the mtmm_workflow_as4.r script
# This script is optimized for data from the Arabidopsis 1001 Genomes project.

# EXAMPLE to run the data

source('scripts/prepare_mtmm.r')
load('data/MTMM_SAMPLE_DATA.Rdata')

# generate estimates of the variance components 
mtmm_estimates(Y,k=2,l=3,K,method='default',only.vca=FALSE) 
mydata<-'SD_SDV_mtmm_estimates.rda'
load(mydata)
# Now perform GWAS with this estimates 
results<-mtmm_part2(X,incl.singleGWAS=T)
plot_mtmm(name2='mtmm.pdf',incl.singleGWAS=T)

# all output data can also be found in the data folder

# old workflow with ASREML-R 3
# Load libraries and source needed functions
# The AsREML package needs a valid license that can be obtained at  http://www.vsni.co.uk/software/asreml

library(lattice)
library(asreml)

# msm and nadiv librarys are used to estimate SE of the correlation estimates, only used if run=FALSE 
#library(msm)
#library(nadiv)

source('mtmm_function.r')
source('emma.r')

# load your data (Phenotype(Y),Genotype(X) and Kinship(K))
# note you can calculate K using the emma package K<-emma.kinship(t(X)), make sure to set colnames(K)=rownames(K)=rownames(X)

# alternativley load the sample data
load('data/MTMM_SAMPLE_DATA.Rdata')

# different options include method(default or errorcorrelation, include.single.analysis, calculate.effect.size (if TRUE, #analysis is more time consuming) default for X is binary coding of 0 and 1, if your data are code  0,1 and 2 use #gen.data='heterozygot',  run=FALSE will not perform the GWAS, but only output the correlation estimates (fast)
mtmm(Y,X,K,method='default',include.single.analysis=T,calculate.effect.size=T,gen.data='binary',exclude=T,run=T)

# To only perform a Variance Coponent Analysis use the mtmm_estimate.r script with the flag only.vca=T set
VCA<-mtmm_estimates(Y,K=K,only.vca=T)

# the function outputs a list called results  ($phenotype ,$pvals, $statistics, $kinship)
output<-results$pvals

# manhattan plots
# default plots for include.single.analysis=T
par(mfrow=c(5,1),mar=c(3, 4, 1, 4))
plot_gwas(output,h=8)
plot_gwas(output,h=9)
plot_gwas(output,h=10)
plot_gwas(output,h=11)
plot_gwas(output,h=12)

#qq plots
par(mfrow=c(1,1),mar=c(3, 4, 1, 4))
qq_plot_all(output)

Poster

mtmm's People

Contributors

arthurkorte avatar timeu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.