Code Monkey home page Code Monkey logo

rare_var_assoc's Introduction

***********************************************************************
Simulating association studies in a spatially structured population

Code related to "Differential confounding of rare and common
variants in spatially structured populations; Mathieson I, McVean G;
Nature Genetics; 2012". Please cite this paper if you use this code
in your own work.
 
***********************************************************************

REQUIREMENTS 

You need to have R andd gcc installed. I have used R 2.12 and gcc version
4.2.1 on Mac OSX. It has also been tested with R 2.13 and gcc 4.5.2 on 
Ubuntu. I see no reason why it should't work fine on other platforms. You 
also need the R package "RColorBrewer" installed. 

COMPILING

R CMD SHLIB kpop.c

RUNNING

All the files that end in "simulation.R" can just be run from R - either
"R --vanilla < association_simulation.R" from the command line or 
source("association_simulation.R") from the R prompt. They produce graphs
and text output in the current directory. 

CALLING

If you don't want to run the scripts, and just want to generate haplotypes
for your own nefarious purposes, then just do (from the R prompt): 

source("association.R")
dyn.load("kpop.so")
gt <- simulate.genotypes(G, L, c, k, M)

where:
G: Number of independent genealogies to simulate
L: Number of variants at each locus
c: Number of individuals in each deme
k: Grid size (k*k)
M: Migration rate

NROW(gt)=number of individuals (i.e. c*k*k)
NCOL(gt)=number of variants (i.e. L*G)

You may wish to use the standalone program ggs, which does the same thing, 
available from https://github.com/mathii/ggs.

FILES

assocation_simulation.R: Simulates association tests under different models
of spatial risk. Saves qq plot summaries, and inflation as a function of MAF.

composite_correction_simulation.R: Shows the effect of standard corrections on
the association tests for different models of spatial risk. In order to use 
the mixed model implementation of Pirinen et al, you will need their software,
installed in a sub-directory called "mm". 

burden_test_simulation.R: Simulate the simple rare variant burden test of 
Morris & Zeggini. 

allele_sharing_simulation: Calculate the excess allele sharing statistic 
described in the paper. 

CONTACT

[email protected]
http://genetics.med.harvard.edu/Reich_Lab/People/imathieson/index.html

rare_var_assoc's People

Stargazers

Boyang Fu avatar

Watchers

James Cloos avatar Iain Mathieson 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.