# Introduction¶

Set tests are a powerful approach for association testing between groups of genetic variants and quantitative traits. In this tutorial we demonstrate how to use set tests within the LIMIX framework to test for association (mtSet).

# mtSet¶

Multi Trait Set test is an implementation of efficient set test algorithms for testing for associations between multiple genetic variants and multiple traits. mtSet can account for confounding factors such as relatedness and can be used for analysis of single traits. mtSet can be used both with the command line interface using the limix scripts (mtSet_preprocess, mtSet_analyze, mtSet_postprocess, mtSet_simPheno) or within python.

## Quick Start¶

In the following, we give a brief example on how to use mtSet. As a case study, we use a subset of the genotypes from the 1000 project [1] and simulated phenotypes.

All commands can be found in _demos/runmtSet.sh. In the following, we give a short summary of the individual steps. A demo for running mtSet-PC can be found in _demos/runmtSetPC.sh and it is not showcased here.

1. Our software depends on Plink version 1.9 (or greater) for preprocessing. Please, make sure you have it before proceeding.

git clone --depth 1 https://github.com/PMBio/limix.git
pushd limix
python setup.py install
popd


git clone --depth 1 https://github.com/PMBio/limix-tutorials.git
cd limix-tutorials/mtSet
cd data
mkdir out
ls 1000g/

4. Set some handy shell variables

BFILE=1000g/chrom22_subsample20_maf0.10
CFILE=out/chrom22
PFILE=1000g/pheno
WFILE=out/windows
NFILE=out/null
WSIZE=30000
RESDIR=out/results
OUTFILE=out/final

5. Preprocess and phenotype simulation

# Kinship matrix estimation
mtSet_preprocess --compute_covariance --bfile $BFILE --cfile$CFILE
# Fitting the null model and assigning the markers to windows
mtSet_preprocess --precompute_windows --fit_null --bfile $BFILE --cfile$CFILE --pfile $PFILE --wfile$WFILE --nfile $NFILE --window_size$WSIZE --plot_windows

6. Analysing true genotypes

mtSet_analyze --bfile $BFILE --cfile$CFILE --pfile $PFILE --nfile$NFILE --wfile $WFILE --minSnps 4 --resdir$RESDIR --start_wnd 0 --end_wnd 100

7. Analysing permuted genotypes

for i in seq 0 10; do