<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://genome.sph.umich.edu/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cfuchsb</id>
	<title>Genome Analysis Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://genome.sph.umich.edu/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cfuchsb"/>
	<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/wiki/Special:Contributions/Cfuchsb"/>
	<updated>2026-09-24T05:34:54Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=12531</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=12531"/>
		<updated>2015-01-28T10:24:44Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* using a VCF reference panel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://csg.sph.umich.edu/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://csg.sph.umich.edu/cfuchsb//cfuchsb/minimac2.2014.9.15.src.tgz from here]. For compiling the source code, you need a recent [https://gcc.gnu.org gcc] (&amp;gt;=4.8), [http://www.openblas.net OpenBlas ], and [https://gcc.gnu.org/fortran/ GFortran].&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://csg.sph.umich.edu/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
[[Ligate_Minimac]] will help you with this.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
2014.9.15 - initial release&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]] 2012.11.16). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 &lt;br /&gt;
--vcfchr 20 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://csg.sph.umich.edu/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfchr &amp;lt;/code&amp;gt; &lt;br /&gt;
| Chromosome for which we will carry out imputation. &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://csg.sph.umich.edu/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://csg.sph.umich.edu/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://csg.sph.umich.edu/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use [[minimac]] or [[minimac2]] please cite: &lt;br /&gt;
&lt;br /&gt;
Fuchsberger C, Abecasis GR, Hinds DA. minimac2: faster genotype imputation. Bioinformatics 2014 [http://bioinformatics.oxfordjournals.org/content/early/2014/10/22/bioinformatics.btu704.short]&lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac&amp;diff=12530</id>
		<title>Minimac</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac&amp;diff=12530"/>
		<updated>2015-01-28T07:42:43Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Please check out [[minimac2]]!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;minimac&#039;&#039;&#039; is a low memory, computationally efficient implementation of the MaCH algorithm for genotype imputation. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac]] - This page, the main minimac page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac&lt;br /&gt;
&lt;br /&gt;
*[https://imputationserver.sph.umich.edu Imputation server] - We are running imputation (and pre-phasing) for you!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac is available [http://csg.sph.umich.edu/cfuchsb/minimac-beta-2013.7.17.tgz  from here] and source code [http://csg.sph.umich.edu/cfuchsb/minimac.src.tgz  from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac should be stamped 2013.7.17 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this beta version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
The current version of minimac comes in two flavours, &amp;lt;code&amp;gt;minimac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
2013.7.17&lt;br /&gt;
&lt;br /&gt;
- minor bug fixes&lt;br /&gt;
&lt;br /&gt;
-- all variants (SNPs, InDels, SVs) in the reference VCF will be imputed - independent from the FILTER column setting&lt;br /&gt;
&lt;br /&gt;
- improved performance (Thanks to David Hinds - see also [[minimac2]] for the full set of performance improvements)&lt;br /&gt;
&lt;br /&gt;
2012.11.16&lt;br /&gt;
&lt;br /&gt;
- minor bug fixes&lt;br /&gt;
&lt;br /&gt;
2012.10.9&lt;br /&gt;
&lt;br /&gt;
- added: improved support for [http://www.shapeit.fr ShapeIT] phased haplotypes&lt;br /&gt;
&lt;br /&gt;
2012.10.3&lt;br /&gt;
&lt;br /&gt;
- added: full support for reference panel based chunking&lt;br /&gt;
&lt;br /&gt;
2012.9.22&lt;br /&gt;
&lt;br /&gt;
- fixed: chunk chromosome bug&lt;br /&gt;
&lt;br /&gt;
2012.8.6 (early adopter)&lt;br /&gt;
&lt;br /&gt;
- added: chromosome X support&lt;br /&gt;
&lt;br /&gt;
2012.3.14&lt;br /&gt;
&lt;br /&gt;
- fixed: problem with --startposition &lt;br /&gt;
&lt;br /&gt;
2012.2.29&lt;br /&gt;
&lt;br /&gt;
- added: VCF support&lt;br /&gt;
&lt;br /&gt;
- added: IDR (Insertion, Deletion, Reference) support&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Pre-phasing ==&lt;br /&gt;
For the pre-phasing step, cost increases quadratically with the number of states and linearly with the number of rounds. The following table provides a simple example.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! States&lt;br /&gt;
! Cost per round&lt;br /&gt;
|- &lt;br /&gt;
| 100 states&lt;br /&gt;
| 3 min&lt;br /&gt;
|- &lt;br /&gt;
| 200 states&lt;br /&gt;
| 12 min = (3 min * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 400 states&lt;br /&gt;
| 48 min = (3 min * 4&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 500 states&lt;br /&gt;
| 75 min = (3 min * 5&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, in this case running haplotyping with 500 states and 10 rounds would require 75 min * 10 = 750 min.&lt;br /&gt;
&lt;br /&gt;
Typically, haplotype quality improves rapidly with the number of states but only slowly with the number of rounds. We recommend running ~20 rounds of the MaCH haplotyper and selecting a number of states as high as your patience will allow (but ideally greater than 200).&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 100 haplotypes. Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, we current recommend using [[MaCH]] with the --phase command line option. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
We recommend that, if at all possible, you should phase your chromosomes according to NCBI build 37. Future releases of the 1000 Genomes Reference panel and other public sets of reference haplotypes are expected to use this genome build.&lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
==== NCBI build 36 / NCBI build 37 ====&lt;br /&gt;
The 1000G June reference panel is on build 36, future 1000G reference panels will be on build 37. This has also some impact on the pre-phasing:&lt;br /&gt;
some SNPs will ordered differently in each genome build (we expect order will be more accurate in more recent builds!). Purists will claim that imputation using NCBI build 36 and NCBI build 37 reference panels requires phasing using the exact same reference panel -- others will claim this makes little difference.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
==== using a MaCH reference panel  ====&lt;br /&gt;
&lt;br /&gt;
  minimac --refHaps ref.hap.gz --refSnps ref.snps.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://csg.sph.umich.edu/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://csg.sph.umich.edu/abecasis/MACH/download/ MaCH download page]. As of this writing, the most recent set of haplotypes are based on genotype calls were generated in May 2011 and are an interim analysis of Project&#039;s Phase I data.&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If the combination of MaCH and Minimac still runs too slowly for you, and you have access to a multi-processor compute cluster, you can look at [[ChunkChromosome]] page to learn how to conveniently split each chromosome into multiple segments that can be analyzed in parallel. For information on how to put the resulting chunks back together, see [[Ligate Minimac|this page]].&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://csg.sph.umich.edu/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://csg.sph.umich.edu/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use [[minimac]] or [[minimac2]] please cite: &lt;br /&gt;
&lt;br /&gt;
Fuchsberger C, Abecasis GR, Hinds DA. minimac2: faster genotype imputation. Bioinformatics 2014 [http://bioinformatics.oxfordjournals.org/content/early/2014/10/22/bioinformatics.btu704.short]&lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac&amp;diff=12529</id>
		<title>Minimac</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac&amp;diff=12529"/>
		<updated>2015-01-28T07:42:30Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Please check out [[minimac2]]. [[minimac2]] is an improved version of Minimac.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;minimac&#039;&#039;&#039; is a low memory, computationally efficient implementation of the MaCH algorithm for genotype imputation. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac]] - This page, the main minimac page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac&lt;br /&gt;
&lt;br /&gt;
*[https://imputationserver.sph.umich.edu Imputation server] - We are running imputation (and pre-phasing) for you!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac is available [http://csg.sph.umich.edu/cfuchsb/minimac-beta-2013.7.17.tgz  from here] and source code [http://csg.sph.umich.edu/cfuchsb/minimac.src.tgz  from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac should be stamped 2013.7.17 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this beta version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
The current version of minimac comes in two flavours, &amp;lt;code&amp;gt;minimac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
2013.7.17&lt;br /&gt;
&lt;br /&gt;
- minor bug fixes&lt;br /&gt;
&lt;br /&gt;
-- all variants (SNPs, InDels, SVs) in the reference VCF will be imputed - independent from the FILTER column setting&lt;br /&gt;
&lt;br /&gt;
- improved performance (Thanks to David Hinds - see also [[minimac2]] for the full set of performance improvements)&lt;br /&gt;
&lt;br /&gt;
2012.11.16&lt;br /&gt;
&lt;br /&gt;
- minor bug fixes&lt;br /&gt;
&lt;br /&gt;
2012.10.9&lt;br /&gt;
&lt;br /&gt;
- added: improved support for [http://www.shapeit.fr ShapeIT] phased haplotypes&lt;br /&gt;
&lt;br /&gt;
2012.10.3&lt;br /&gt;
&lt;br /&gt;
- added: full support for reference panel based chunking&lt;br /&gt;
&lt;br /&gt;
2012.9.22&lt;br /&gt;
&lt;br /&gt;
- fixed: chunk chromosome bug&lt;br /&gt;
&lt;br /&gt;
2012.8.6 (early adopter)&lt;br /&gt;
&lt;br /&gt;
- added: chromosome X support&lt;br /&gt;
&lt;br /&gt;
2012.3.14&lt;br /&gt;
&lt;br /&gt;
- fixed: problem with --startposition &lt;br /&gt;
&lt;br /&gt;
2012.2.29&lt;br /&gt;
&lt;br /&gt;
- added: VCF support&lt;br /&gt;
&lt;br /&gt;
- added: IDR (Insertion, Deletion, Reference) support&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Pre-phasing ==&lt;br /&gt;
For the pre-phasing step, cost increases quadratically with the number of states and linearly with the number of rounds. The following table provides a simple example.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! States&lt;br /&gt;
! Cost per round&lt;br /&gt;
|- &lt;br /&gt;
| 100 states&lt;br /&gt;
| 3 min&lt;br /&gt;
|- &lt;br /&gt;
| 200 states&lt;br /&gt;
| 12 min = (3 min * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 400 states&lt;br /&gt;
| 48 min = (3 min * 4&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 500 states&lt;br /&gt;
| 75 min = (3 min * 5&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, in this case running haplotyping with 500 states and 10 rounds would require 75 min * 10 = 750 min.&lt;br /&gt;
&lt;br /&gt;
Typically, haplotype quality improves rapidly with the number of states but only slowly with the number of rounds. We recommend running ~20 rounds of the MaCH haplotyper and selecting a number of states as high as your patience will allow (but ideally greater than 200).&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 100 haplotypes. Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, we current recommend using [[MaCH]] with the --phase command line option. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
We recommend that, if at all possible, you should phase your chromosomes according to NCBI build 37. Future releases of the 1000 Genomes Reference panel and other public sets of reference haplotypes are expected to use this genome build.&lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
==== NCBI build 36 / NCBI build 37 ====&lt;br /&gt;
The 1000G June reference panel is on build 36, future 1000G reference panels will be on build 37. This has also some impact on the pre-phasing:&lt;br /&gt;
some SNPs will ordered differently in each genome build (we expect order will be more accurate in more recent builds!). Purists will claim that imputation using NCBI build 36 and NCBI build 37 reference panels requires phasing using the exact same reference panel -- others will claim this makes little difference.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
==== using a MaCH reference panel  ====&lt;br /&gt;
&lt;br /&gt;
  minimac --refHaps ref.hap.gz --refSnps ref.snps.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://csg.sph.umich.edu/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://csg.sph.umich.edu/abecasis/MACH/download/ MaCH download page]. As of this writing, the most recent set of haplotypes are based on genotype calls were generated in May 2011 and are an interim analysis of Project&#039;s Phase I data.&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If the combination of MaCH and Minimac still runs too slowly for you, and you have access to a multi-processor compute cluster, you can look at [[ChunkChromosome]] page to learn how to conveniently split each chromosome into multiple segments that can be analyzed in parallel. For information on how to put the resulting chunks back together, see [[Ligate Minimac|this page]].&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://csg.sph.umich.edu/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://csg.sph.umich.edu/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use [[minimac]] or [[minimac2]] please cite: &lt;br /&gt;
&lt;br /&gt;
Fuchsberger C, Abecasis GR, Hinds DA. minimac2: faster genotype imputation. Bioinformatics 2014 [http://bioinformatics.oxfordjournals.org/content/early/2014/10/22/bioinformatics.btu704.short]&lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac_Command_Reference&amp;diff=12528</id>
		<title>Minimac Command Reference</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac_Command_Reference&amp;diff=12528"/>
		<updated>2015-01-28T07:40:36Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Minimac]] and [[Minimac2]] runs are controled by a series of command line parameters that specify input file names, an initial model for recombination and error rates, an optional series of iterations of model refinement using either [[Monte-Carlo]] methods or an [[Expectation-Maximization]] algorithm, and output file names.&lt;br /&gt;
&lt;br /&gt;
== Reference Haplotype Set ==&lt;br /&gt;
&lt;br /&gt;
;  --refSNPs [filename]&lt;br /&gt;
: This option specifies the name of a text file listing markers in the reference haplotype set, one per line.&lt;br /&gt;
&lt;br /&gt;
;  --refHaps [filename]&lt;br /&gt;
: This option specifies the name of a text file listing reference haplotypes. This file is typically generated by [[MaCH]].&lt;br /&gt;
: Each line in the reference haplotype file starts with a haplotype label. This is followed by a series of alleles (one character per marker), optionally separated by whitespace to improve readability. Acceptable allele labels are &amp;quot;A&amp;quot;, &amp;quot;C&amp;quot;, &amp;quot;G&amp;quot;, &amp;quot;T&amp;quot;,&amp;quot;I&amp;quot;,&amp;quot;D&amp;quot;,&amp;quot;R&amp;quot; (I..Insertions, D..Deletion, R..Reference); upper and lower case letters are treated identically. The digits &amp;quot;1&amp;quot;, &amp;quot;2&amp;quot;, &amp;quot;3&amp;quot;, &amp;quot;4&amp;quot; are also acceptable and treated as aliases for &amp;quot;A&amp;quot;, &amp;quot;C&amp;quot;, &amp;quot;G&amp;quot;, &amp;quot;T&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
;  --vcfReference&lt;br /&gt;
: This option specifies that the provided --refHaps file is provided in [http://www.1000genomes.org/wiki/Analysis/vcf4.0 VCF format] , no --refSNPs file needed.&lt;br /&gt;
&lt;br /&gt;
; --vcfstart&lt;br /&gt;
: This option specifies the start position for chunk based imputation  &lt;br /&gt;
&lt;br /&gt;
;  --vcfend&lt;br /&gt;
: This option specifies the end position for chunk based imputation &lt;br /&gt;
&lt;br /&gt;
; --vcfwindow&lt;br /&gt;
: This option specifies the size of the buffer region (in bp) to add on each side for chunk based imputation to avoid edge effects. These buffers are not included in the output files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; --snpAliases [filename]&lt;br /&gt;
: This option points to a file listing mappings between alternate marker names. Each row should include two columns. The first column lists a previous commonly used name for a marker (perhaps from an earlier version of dbSNP) and the second column lists the current preferred name for the marker. An example input file, which maps ids from the 1000 Genomes Project and earlier versions of dbSNP to dbSNP build 134, see [http://csg.sph.umich.edu/abecasis/downloads/dbsnp134-merges.txt.gz dbsnp134-merges.txt.gz].&lt;br /&gt;
&lt;br /&gt;
== Target Haplotype Set ==&lt;br /&gt;
&lt;br /&gt;
=== MaCH Format ===&lt;br /&gt;
&lt;br /&gt;
;  --snps [filename]&lt;br /&gt;
: This option specifies the name of a text file listing markers in the target haplotypes. Only markers that are included in both the reference panel and the target haplotype set will be used to identify shared haplotype stretches.&lt;br /&gt;
&lt;br /&gt;
;  --haps [filename]&lt;br /&gt;
: This option specifies the name of a text file listing reference haplotypes. This file is typically generated by [[MaCH]]. The file should be formatted just like the reference haplotype file, described in the previous section.&lt;br /&gt;
&lt;br /&gt;
; --rs&lt;br /&gt;
: In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
&lt;br /&gt;
=== ShapeIT Format ===&lt;br /&gt;
&lt;br /&gt;
; --sample [filename]&lt;br /&gt;
: Sample list in ShapeIT format&lt;br /&gt;
&lt;br /&gt;
;--shape_haps [filename]&lt;br /&gt;
: ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
&lt;br /&gt;
;--chr [integer]&lt;br /&gt;
: Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
&lt;br /&gt;
== Model Refinement ==&lt;br /&gt;
&lt;br /&gt;
;  --rounds [integer]&lt;br /&gt;
: Iterations of Monte-Carlo or Expectation-Maximization algorithm model refinement algorithm.&lt;br /&gt;
&lt;br /&gt;
;  --states [integer]&lt;br /&gt;
: Maximum number of reference and target haplotypes to consider during model refinement.&lt;br /&gt;
&lt;br /&gt;
;  --em &lt;br /&gt;
: Instead of performing Monte-Carlo updates to parameter values, use an Expectation-Maximization algorithm.&lt;br /&gt;
&lt;br /&gt;
== Output Parameters ==&lt;br /&gt;
&lt;br /&gt;
;  --prefix [label]&lt;br /&gt;
: Use requested prefix for all output files.&lt;br /&gt;
&lt;br /&gt;
;  --phased&lt;br /&gt;
: Output dosages and most likely alleles for each haplotype separately. &lt;br /&gt;
&lt;br /&gt;
;  --probs&lt;br /&gt;
: Output probabilities for each genotype. Each row in the output will include two columns per marker. The first of these columns denotes the probability of an homozygote for allele 1. The second column denotes the probability of an heterozygote.&lt;br /&gt;
&lt;br /&gt;
;  --gzip&lt;br /&gt;
: Compress output files on the fly, reducing disk space requirements.&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac:_1000_Genomes_Imputation_Cookbook&amp;diff=12527</id>
		<title>Minimac: 1000 Genomes Imputation Cookbook</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac:_1000_Genomes_Imputation_Cookbook&amp;diff=12527"/>
		<updated>2015-01-28T07:40:12Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents how to impute 1000 Genome SNPs using [[Minimac]], which is typically the preferred approach for imputation using large reference panels such as the 1000 Genomes data. For pointers on how to carry out 1000 Genomes Imputation using [[IMPUTE2]], see [[IMPUTE2:_1000_Genomes_Imputation_Cookbook]]. &lt;br /&gt;
&lt;br /&gt;
Before reading this tutorial, you might find it useful to spend a few minutes reading through the main [[Minimac]] documentation. &lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
=== Your Own Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin tutorial].&lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
The latest reference panel generated by the 1000 Genomes project uses NCBI Build 37 (HG 19). Make sure that your data is on Build 37 (or Minimac may ignore genotyped markers whose names have changed in Build 37). If you are trying to convert your data from an earlier genome build to Build 37, you&#039;ll probably find the [ftp://ftp.ncbi.nih.gov/snp/organisms/human_9606/database/organism_data/RsMergeArch.bcp.gz dbSNP merge table] ([http://www.ncbi.nlm.nih.gov/SNP/snp_db_table_description.cgi?t=RsMergeArch table description on the NCBI website]), which logs rs# changes between dbSNP builds, and the UCSC online [http://genome.ucsc.edu/cgi-bin/hgLiftOver liftOver tool], which converts genome positions between different genome builds, to be quite useful. We have also documented ([[LiftOver | Link]]) a general procedure to convert genome positions and rs number between builds.&lt;br /&gt;
&lt;br /&gt;
If you are planning to use imputation with the MetaboChip, you might find a list of SNPs whose order varies between NCBI genome Build 36 and 37 convenient. Here it is: [http://csg.sph.umich.edu/cfuchsb/metab_order_changed.txt List of Metabochip SNPs Whose Order Changes With Build]&lt;br /&gt;
&lt;br /&gt;
Note: For the most recent reference panel in VCF format by default GWAS SNPs are expected to be in the chr:pos format e.g. 1:1000; otherwise, for GWAS SNPs in the rs format you have to set the --rs flag&lt;br /&gt;
&lt;br /&gt;
=== Quality Control ===&lt;br /&gt;
&lt;br /&gt;
You should apply standard quality control filters to the set of SNPs that you use as input to the imputation procedure. These filters are typically study specific but usually a series of per marker and per individual quality checks. &lt;br /&gt;
&lt;br /&gt;
Per marker quality checks typically evaluate:&lt;br /&gt;
&lt;br /&gt;
* Genotype completeness (markers with relatively high missingness rates are typically excluded)&lt;br /&gt;
* [[Hardy Weinberg equilibrium]] (markers with clear deviations from Hardy Weinberg proportions are typically excluded) &lt;br /&gt;
* Duplicate concordance (markers with high discordance rates are excluded)&lt;br /&gt;
* Mendelian inconsistencies (when parent-offspring pairs are available, markers with an excess of Mendelian inconsistencies are typically excluded).&lt;br /&gt;
* Polymorphism check (monomorphic markers can represent assay failures and are typically excluded).&lt;br /&gt;
&lt;br /&gt;
Per individual quality checks typically include:&lt;br /&gt;
&lt;br /&gt;
* Check for per sample completeness (samples with high missingness rates are typically excluded)&lt;br /&gt;
* Check for per sample heterozygosity (samples with unusual heterozygosity are typically excluded)&lt;br /&gt;
* Inspection of principal component or multi-dimensional scaling plots (genetic ancestry outliers are usually excluded)&lt;br /&gt;
* Check for related individuals (if related samples are identified, the analysis plan must be adjusted or they must be removed)&lt;br /&gt;
&lt;br /&gt;
With older genotyping platforms, low frequency SNPs are also often excluded because they are hard to genotype accurately. With more modern genotyping arrays, the accuracy of genotype calls for low frequency SNPs is less of a concern.&lt;br /&gt;
&lt;br /&gt;
Two good ways to verify that you have used appropriate quality control steps are to generate a Q-Q plot for your dataset and to calculate a genomic control parameter. If these verifications are not satisfactory, it may be useful to investigate before proceeding to imputation.&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://csg.sph.umich.edu/abecasis/MaCH/download/ MaCH download page]. In our hands, it is ideal to always use the most recent release since generation of additional sequence data, improvements in variant discovery, genotyping and haplotyping strategies typically result in noticeable improvements in data quality. When this page was written, the most recent release of 1000 Genomes project haplotypes was the [http://www.sph.umich.edu/csg/abecasis/MACH/download/1000G.2012-03-14.html Integrated Phase I release], including 1092 individuals. We recommend using the reduced GIANT all population panel (no monomorphic and singleton sites)&lt;br /&gt;
[ftp://share.sph.umich.edu/1000genomes/fullProject/2012.03.14/GIANT.phase1_release_v3.20101123.snps_indels_svs.genotypes.refpanel.ALL.vcf.gz.tgz GIANT.phase1_release_v3.20101123.snps_indels_svs.genotypes.refpanel.ALL.vcf.gz.tgz]&lt;br /&gt;
&lt;br /&gt;
Furthermore, we provide also a [http://www.plosgenetics.org/article/info%3Adoi%2F10.1371%2Fjournal.pgen.1002793 Metabochip] specific reference panel ([ftp://share.sph.umich.edu/1000genomes/fullProject/2012.03.14/GIANT.metabo.phase1_release_v3.20101123.snps_indels_svs.genotypes.refpanel.ALL.vcf.gz.tgz GIANT.metabo.phase1_release_v3.20101123.snps_indels_svs.genotypes.refpanel.ALL.vcf.gz.tgz]). This reduced reference panel is a time saver, since it focuses on the well-imputable fine-mapping regions.&lt;br /&gt;
&lt;br /&gt;
== Minimac Imputation ==&lt;br /&gt;
&lt;br /&gt;
[[Minimac]] relies on a two step approach. First, the samples that are to be analyzed must be phased into a series of estimated haplotypes. Second, imputation is carried out directly into these phased haplotypes. As newer reference panels become available, only the second step must be repeated.&lt;br /&gt;
&lt;br /&gt;
=== Pre-phasing - MaCH ===&lt;br /&gt;
&lt;br /&gt;
A convenient way to haplotype your sample is to use MaCH. A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d chr1.dat -p chr1.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --prefix chr$chr.haps&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the [http://csg.sph.umich.edu/abecasis/MaCH/ MaCH website]):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. If computing time is a constraints, you may consider decreasing this parameter to 100. If you have substantial computing resources, consider increasing this value to 600 or even 800.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20-30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful. If you are not short of disk space, you should consider enabling this parameter.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You should be able to run this step in parallel and in our cluster we&#039;d use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   foreach chr (`seq 1 22`)&lt;br /&gt;
&lt;br /&gt;
     runon -m 4096 mach -d chr$chr.dat -p chr$chr.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --prefix chr$chr.haps&lt;br /&gt;
&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Imputation into Phased Haplotypes - minimac ===&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is a straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for estimating model parameters (which describe the length and conservation of haplotype stretches shared between the reference panel and your study samples), imputation should proceed rapidly. Because marker names can change between dbSNP versions, it is usually a good idea to include an &#039;&#039;aliases&#039;&#039; file that provides mappings between earlier marker names and the current preferred name for each polymorphism.&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line, where the string $chr should be replaced with an appropriate chromosome number, might look like this:&lt;br /&gt;
&lt;br /&gt;
 == using a VCF reference panel ==&lt;br /&gt;
 minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
 Note: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; &lt;br /&gt;
          otherwise, please set the --rs flag and include an aliases file --snpAliase [http://www.sph.umich.edu/csg/abecasis/downloads/dbsnp134-merges.txt.gz dbsnp134-merges.txt.gz]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://csg.sph.umich.edu/abecasis/MACH/download/1000G-2010-06.html MaCH download page])&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps chr.snps &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps chr.haps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
&amp;lt;!-- |- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Again, you can speed up things by running imputation in parallel. For example, in our cluster we&#039;d use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   foreach chr (`seq 1 22`)&lt;br /&gt;
&lt;br /&gt;
     runon -m 1024 minimac --refHaps ref.hap.$chr.gz  --vcfReference  \&lt;br /&gt;
                           --haps chr$chr.haps.gz --snps chr.$chr.snps --prefix chr$chr.imputed                          &lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Furthermore, minimac itself can be run in parallel by launching the [http://genome.sph.umich.edu/wiki/Minimac#Multiprocessor_Version minimac-omp] version. On our cluster 4 cpus per minimac is optimal (--cpus 4).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
   foreach chr (`seq 1 22`)&lt;br /&gt;
&lt;br /&gt;
     runon -m 1024 minimac-omp --cpus 4 --refHaps ref.hap.$chr.gz  --vcfReference  \&lt;br /&gt;
                           --haps chr$chr.haps.gz --snps chr.$chr.snps --prefix chr$chr.imputed                    &lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Further Time Savings ==&lt;br /&gt;
&lt;br /&gt;
=== Target based chunking ===&lt;br /&gt;
&lt;br /&gt;
The recipe above imputes whole chromosomes, one a time. A further time savings is possible by imputing chromosomes in chunks, a process that can be facilitated using the [[ChunkChromosome]] tool. This tool automates some of the manual editing steps that would be required to divide each chromosome into more manageable chunks. It also interfaces with minimac to ensure SNPs that overlap between chunks are only imputed once.&lt;br /&gt;
&lt;br /&gt;
Recall that the original analysis script might have looked like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/tcsh&lt;br /&gt;
&lt;br /&gt;
# Build SNP lists for each chromosome&lt;br /&gt;
foreach chr (`seq 1 22`)&lt;br /&gt;
   awk &#039;{ if ($1 == &amp;quot;M&amp;quot;) print $2; }&#039; &amp;lt; chr${chr}.dat &amp;gt; chr${chr}.snps&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
# Estimate haplotypes for all individuals, one chromosome at a time&lt;br /&gt;
foreach chr (`seq 1 22`)&lt;br /&gt;
   mach -d chr$chr.dat -p chr$chr.ped --rounds 20 --states 200 --phase --sample 5 --prefix chr$chr.haps &amp;gt;&amp;amp; chr$chr-mach.log &amp;amp;&lt;br /&gt;
end&lt;br /&gt;
wait&lt;br /&gt;
&lt;br /&gt;
# Impute into phased haplotypes&lt;br /&gt;
foreach chr (`seq 1 22`)&lt;br /&gt;
   minimac --refHaps ref.hap.$chr.gz  --vcfReference  \&lt;br /&gt;
           --haps chr$chr.haps.gz --snps chr$chr.snps --prefix chr$chr.imputed &amp;gt;&amp;amp; chr$chr-minimac.log &amp;amp;&lt;br /&gt;
end&lt;br /&gt;
wait&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A modified script, using [[ChunkChromosome]] would look like this (chr:pos GWAS SNP IDs):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/tcsh&lt;br /&gt;
&lt;br /&gt;
@ length = 2500&lt;br /&gt;
@ overlap = 500&lt;br /&gt;
&lt;br /&gt;
# Estimate haplotypes for all individuals, in 2500 marker chunks, with 500 marker overhang&lt;br /&gt;
foreach chr (`seq 1 22`)&lt;br /&gt;
&lt;br /&gt;
   ChunkChromosome -d chr$chr.dat -n $length -o $overlap&lt;br /&gt;
&lt;br /&gt;
   foreach chunk (chunk*-chr$chr.dat)&lt;br /&gt;
&lt;br /&gt;
      mach -d $chunk -p chr$chr.ped --prefix ${chunk:r} \&lt;br /&gt;
           --rounds 20 --states 200 --phase --sample 5 &amp;gt;&amp;amp; ${chunk:r}-mach.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
wait&lt;br /&gt;
&lt;br /&gt;
# Impute into phased haplotypes&lt;br /&gt;
foreach chr (`seq 1 22`)&lt;br /&gt;
&lt;br /&gt;
   foreach chunk (chunk*-chr$chr.dat)&lt;br /&gt;
&lt;br /&gt;
      set haps = /data/1000g/hap/all/20101123.chr$chr.hap.gz&lt;br /&gt;
      set snps = /data/1000g/snps/chr$chr.snps&lt;br /&gt;
&lt;br /&gt;
      minimac --refHaps $haps --refSnps $snps  --vcfReference  \&lt;br /&gt;
              --haps ${chunk:r}.gz --snps ${chunk}.snps  --autoClip autoChunk-chr$chr.dat  \&lt;br /&gt;
              --prefix ${chunk:r}.imputed &amp;gt;&amp;amp; ${chunk:r}-minimac.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
wait&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using [[ChunkChromosome]] would look like this (rs GWAS SNP IDs):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/tcsh&lt;br /&gt;
&lt;br /&gt;
@ length = 2500&lt;br /&gt;
@ overlap = 500&lt;br /&gt;
&lt;br /&gt;
# Estimate haplotypes for all individuals, in 2500 marker chunks, with 500 marker overhang&lt;br /&gt;
foreach chr (`seq 1 22`)&lt;br /&gt;
&lt;br /&gt;
   ChunkChromosome -d chr$chr.dat -n $length -o $overlap&lt;br /&gt;
&lt;br /&gt;
   foreach chunk (chunk*-chr$chr.dat)&lt;br /&gt;
&lt;br /&gt;
      mach -d $chunk -p chr$chr.ped --prefix ${chunk:r} \&lt;br /&gt;
           --rounds 20 --states 200 --phase --sample 5 &amp;gt;&amp;amp; ${chunk:r}-mach.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
wait&lt;br /&gt;
&lt;br /&gt;
# Impute into phased haplotypes&lt;br /&gt;
foreach chr (`seq 1 22`)&lt;br /&gt;
&lt;br /&gt;
   foreach chunk (chunk*-chr$chr.dat)&lt;br /&gt;
&lt;br /&gt;
      set haps = /data/1000g/hap/all/20101123.chr$chr.hap.gz&lt;br /&gt;
      set snps = /data/1000g/snps/chr$chr.snps&lt;br /&gt;
&lt;br /&gt;
      minimac --refHaps $haps --refSnps $snps  --vcfReference  --rs --snpAliases dbsnp134-merges.txt.gz \&lt;br /&gt;
              --haps ${chunk:r}.gz --snps ${chunk}.snps  --autoClip autoChunk-chr$chr.dat  \&lt;br /&gt;
              --prefix ${chunk:r}.imputed &amp;gt;&amp;amp; ${chunk:r}-minimac.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
wait&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although the loss in accuracy will typically be small, analyses of small chromosome chunks will necessarily result in slightly less accurate results. The differences will be large in populations where haplotype sharing is expected to extend further (for example, in Finland and Sardinia we find that haplotypes can be estimated accurately over several megabases and focusing on small chunks of chromosome will make these matches harder to identify).&lt;br /&gt;
&lt;br /&gt;
=== Reference based chunking ===&lt;br /&gt;
&lt;br /&gt;
REMARK: this works only with SNPIDs in the chr:pos format, or in other words, rs numbers are not supported here.&lt;br /&gt;
&lt;br /&gt;
In case you didn&#039;t split your data with ChunkChromosome, we highly recommend running imputation using our reference based chunking method (minimac.11.16.12 or newer required)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
chromend=57000000 # for chr 20 &lt;br /&gt;
chunksize=7000000&lt;br /&gt;
overlap=250000&lt;br /&gt;
vcfref=&amp;quot;your_vcf_ref.vcf&amp;quot;&lt;br /&gt;
gwas=&amp;quot;your_gwas_filename&amp;quot;&lt;br /&gt;
out=&amp;quot;your_output_filename&amp;quot;&lt;br /&gt;
&lt;br /&gt;
for start in `seq 0 $chunksize $chromend`&lt;br /&gt;
do&lt;br /&gt;
&lt;br /&gt;
   end=$(($start+$chunksize))&lt;br /&gt;
   start=$((start+1))&lt;br /&gt;
&lt;br /&gt;
   minimac --vcfReference \&lt;br /&gt;
   --refHaps $vcfref \&lt;br /&gt;
   --snps ${gwas}.snps --haps ${gwas}.haps.gz \&lt;br /&gt;
   --vcfstart $start --vcfend $end \&lt;br /&gt;
   --vcfwindow $overlap \&lt;br /&gt;
   --prefix $out.$start.$end &amp;gt; $out.$start.$end.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac (version 9.22.12 or newer) supports the imputation of genotypes on the X chromosome&lt;br /&gt;
(reference haplotypes can be found [ftp://share.sph.umich.edu/1000genomes/fullProject/2012.03.14/GIANT.chrX.phase1_release_v3.20101123.snps_indels_svs.genotypes.refpanel.ALL.vcf.gz.tgz here])&lt;br /&gt;
&lt;br /&gt;
X chromosome imputation consists of the following 3 steps:&lt;br /&gt;
&lt;br /&gt;
=== 1. Split X chromosome pedigree file by sex  ===&lt;br /&gt;
&lt;br /&gt;
# For females: follow the same protocol as for autosomes&lt;br /&gt;
# For males: they have only one X chromosome and are therefore already phased. Simply convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file; hemizygous males appear as &#039;&#039;homozygotes&#039;&#039; &amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/C   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===  2. Impute non-pseudo-autosomal part by sex ===&lt;br /&gt;
&lt;br /&gt;
Impute females and males separately&lt;br /&gt;
&lt;br /&gt;
 minimac  --refHaps chrX.no.auto.phase1_release_v3.20101123.snps_indels_svs.genotypes.refpanel.ALL.vcf.gz --vcfReference&lt;br /&gt;
                --haps females.hap --snps females.snps&lt;br /&gt;
 minimac  --refHaps chrX.no.auto.phase1_release_v3.20101123.snps_indels_svs.genotypes.refpanel.ALL.vcf.gz --vcfReference&lt;br /&gt;
                --haps males.hap --snps males.snps&lt;br /&gt;
&lt;br /&gt;
===  3. Impute pseudo-autosomal part by sex ===&lt;br /&gt;
&lt;br /&gt;
Impute females and males separately&lt;br /&gt;
&lt;br /&gt;
 minimac  --refHaps chrX.auto.phase1_release_v3.20101123.snps_indels_svs.genotypes.refpanel.ALL.vcf.gz --vcfReference&lt;br /&gt;
                --haps females.hap --snps females.snps&lt;br /&gt;
 minimac  --refHaps chrX.auto.phase1_release_v3.20101123.snps_indels_svs.genotypes.refpanel.ALL.vcf.gz --vcfReference&lt;br /&gt;
                --haps males.hap --snps males.snps&lt;br /&gt;
&lt;br /&gt;
== Imputation quality evaluation ==&lt;br /&gt;
Minimac hides each of the genotyped SNPs in turn and then calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP alleles are probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the *.info file&lt;br /&gt;
&lt;br /&gt;
Be aware that, unfortunately, imputation quality statistics are not directly comparable between different imputation programs (MaCH/minimac vs. Impute vs. Beagle etc.).&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis], [mailto:cfuchsb@umich.edu Christian Fuchsberger (minimac)] or [mailto:yunli@med.unc.edu Yun Li (MaCH)].&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac:_Tutorial&amp;diff=12526</id>
		<title>Minimac: Tutorial</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac:_Tutorial&amp;diff=12526"/>
		<updated>2015-01-28T07:38:44Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Before reading this tutorial, you might find it useful to spend a few minutes reading through the main [[Minimac]] and [[Minimac2]] documentation. &lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
Download [http://csg.sph.umich.edu/abecasis/MaCH/download/ MaCH] and [http://genome.sph.umich.edu/wiki/Minimac#Download Minimac] or [http://genome.sph.umich.edu/wiki/Minimac2#Download Minimac2]. Furthermore, example data used in this tutorial can be found [http://csg.sph.umich.edu/cfuchsb/minimac2_example.tgz here]&lt;br /&gt;
&lt;br /&gt;
== Minimac and Minimac2 Imputation ==&lt;br /&gt;
&lt;br /&gt;
[[Minimac]] and [[Minimac2]] relies on a two step approach. First, the samples that are to be analyzed must be phased into a series of estimated haplotypes. Second, imputation is carried out directly into these phased haplotypes. As newer reference panels become available, only the second step must be repeated.&lt;br /&gt;
&lt;br /&gt;
=== Pre-phasing - MaCH ===&lt;br /&gt;
&lt;br /&gt;
A convenient way to haplotype your sample is to use MaCH. A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
 ./mach1 -d sample.dat -p sample.ped --rounds 20 --states 50 --phase --interim 5 --sample 5  --prefix sample.pp | tee mach.log&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 50 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the [http://csg.sph.umich.edu/abecasis/MaCH/ MaCH website]):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. If computing time is a constraints, you may consider decreasing this parameter to 100. If you have substantial computing resources, consider increasing this value to 600 or even 800.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20-30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful. If you are not short of disk space, you should consider enabling this parameter.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Imputation into Phased Haplotypes - minimac(2)===&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac(2)&#039;&#039;&#039; is a straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for estimating model parameters (which describe the length and conservation of haplotype stretches shared between the reference panel and your study samples), imputation should proceed rapidly. Because marker names can change between dbSNP versions, it is usually a good idea to include &#039;&#039;aliases&#039;&#039; file that provides mappings between earlier marker names and the current preferred name for each polymorphism.&lt;br /&gt;
&lt;br /&gt;
The minimac command line would look like this:&lt;br /&gt;
&lt;br /&gt;
 ./minimac --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac.log&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 ./minimac2 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample2.imp | tee minimac2.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac(2) options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps hapmap.hap &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from HapMap or the 1000 genomes Project).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps hapmap.snps &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of sites in the reference haplotypes; needed unless the reference haplotypes are in VCF format.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps chr.snps &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps chr.haps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
&amp;lt;!-- |- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can speed-up things by running minimac in parallel by launching the [http://genome.sph.umich.edu/wiki/Minimac2#Multiprocessor_Version minimac2-omp] version. On our cluster 4 cpus per minimac(2) is optimal (--cpus 4).&lt;br /&gt;
&lt;br /&gt;
 ./minimac-omp --cpus 4 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac-omp.log&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 ./minimac2-omp --cpus 4 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample2.imp | tee minimac-omp.log&lt;br /&gt;
&lt;br /&gt;
== Imputation quality evaluation ==&lt;br /&gt;
Minimac hides each of the genotyped SNPs in turn and then calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP alleles are probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the *.info file&lt;br /&gt;
&lt;br /&gt;
Be aware that, unfortunately, imputation quality statistics are not directly comparable between different imputation programs (MaCH/minimac vs. Impute vs. Beagle etc.).&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac or minimac2, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis], [mailto:cfuchsb@umich.edu Christian Fuchsberger (minimac)] or [mailto:yunli@med.unc.edu Yun Li (MaCH)].&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac&amp;diff=12525</id>
		<title>Minimac</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac&amp;diff=12525"/>
		<updated>2015-01-28T07:38:00Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac&#039;&#039;&#039; is a low memory, computationally efficient implementation of the MaCH algorithm for genotype imputation. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac]] - This page, the main minimac page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac&lt;br /&gt;
&lt;br /&gt;
*[https://imputationserver.sph.umich.edu Imputation server] - We are running imputation (and pre-phasing) for you!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac is available [http://csg.sph.umich.edu/cfuchsb/minimac-beta-2013.7.17.tgz  from here] and source code [http://csg.sph.umich.edu/cfuchsb/minimac.src.tgz  from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac should be stamped 2013.7.17 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this beta version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
The current version of minimac comes in two flavours, &amp;lt;code&amp;gt;minimac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
2013.7.17&lt;br /&gt;
&lt;br /&gt;
- minor bug fixes&lt;br /&gt;
&lt;br /&gt;
-- all variants (SNPs, InDels, SVs) in the reference VCF will be imputed - independent from the FILTER column setting&lt;br /&gt;
&lt;br /&gt;
- improved performance (Thanks to David Hinds - see also [[minimac2]] for the full set of performance improvements)&lt;br /&gt;
&lt;br /&gt;
2012.11.16&lt;br /&gt;
&lt;br /&gt;
- minor bug fixes&lt;br /&gt;
&lt;br /&gt;
2012.10.9&lt;br /&gt;
&lt;br /&gt;
- added: improved support for [http://www.shapeit.fr ShapeIT] phased haplotypes&lt;br /&gt;
&lt;br /&gt;
2012.10.3&lt;br /&gt;
&lt;br /&gt;
- added: full support for reference panel based chunking&lt;br /&gt;
&lt;br /&gt;
2012.9.22&lt;br /&gt;
&lt;br /&gt;
- fixed: chunk chromosome bug&lt;br /&gt;
&lt;br /&gt;
2012.8.6 (early adopter)&lt;br /&gt;
&lt;br /&gt;
- added: chromosome X support&lt;br /&gt;
&lt;br /&gt;
2012.3.14&lt;br /&gt;
&lt;br /&gt;
- fixed: problem with --startposition &lt;br /&gt;
&lt;br /&gt;
2012.2.29&lt;br /&gt;
&lt;br /&gt;
- added: VCF support&lt;br /&gt;
&lt;br /&gt;
- added: IDR (Insertion, Deletion, Reference) support&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Pre-phasing ==&lt;br /&gt;
For the pre-phasing step, cost increases quadratically with the number of states and linearly with the number of rounds. The following table provides a simple example.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! States&lt;br /&gt;
! Cost per round&lt;br /&gt;
|- &lt;br /&gt;
| 100 states&lt;br /&gt;
| 3 min&lt;br /&gt;
|- &lt;br /&gt;
| 200 states&lt;br /&gt;
| 12 min = (3 min * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 400 states&lt;br /&gt;
| 48 min = (3 min * 4&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 500 states&lt;br /&gt;
| 75 min = (3 min * 5&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, in this case running haplotyping with 500 states and 10 rounds would require 75 min * 10 = 750 min.&lt;br /&gt;
&lt;br /&gt;
Typically, haplotype quality improves rapidly with the number of states but only slowly with the number of rounds. We recommend running ~20 rounds of the MaCH haplotyper and selecting a number of states as high as your patience will allow (but ideally greater than 200).&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 100 haplotypes. Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, we current recommend using [[MaCH]] with the --phase command line option. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
We recommend that, if at all possible, you should phase your chromosomes according to NCBI build 37. Future releases of the 1000 Genomes Reference panel and other public sets of reference haplotypes are expected to use this genome build.&lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
==== NCBI build 36 / NCBI build 37 ====&lt;br /&gt;
The 1000G June reference panel is on build 36, future 1000G reference panels will be on build 37. This has also some impact on the pre-phasing:&lt;br /&gt;
some SNPs will ordered differently in each genome build (we expect order will be more accurate in more recent builds!). Purists will claim that imputation using NCBI build 36 and NCBI build 37 reference panels requires phasing using the exact same reference panel -- others will claim this makes little difference.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
==== using a MaCH reference panel  ====&lt;br /&gt;
&lt;br /&gt;
  minimac --refHaps ref.hap.gz --refSnps ref.snps.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://csg.sph.umich.edu/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://csg.sph.umich.edu/abecasis/MACH/download/ MaCH download page]. As of this writing, the most recent set of haplotypes are based on genotype calls were generated in May 2011 and are an interim analysis of Project&#039;s Phase I data.&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If the combination of MaCH and Minimac still runs too slowly for you, and you have access to a multi-processor compute cluster, you can look at [[ChunkChromosome]] page to learn how to conveniently split each chromosome into multiple segments that can be analyzed in parallel. For information on how to put the resulting chunks back together, see [[Ligate Minimac|this page]].&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://csg.sph.umich.edu/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://csg.sph.umich.edu/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use [[minimac]] or [[minimac2]] please cite: &lt;br /&gt;
&lt;br /&gt;
Fuchsberger C, Abecasis GR, Hinds DA. minimac2: faster genotype imputation. Bioinformatics 2014 [http://bioinformatics.oxfordjournals.org/content/early/2014/10/22/bioinformatics.btu704.short]&lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=12524</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=12524"/>
		<updated>2015-01-28T07:36:22Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://csg.sph.umich.edu/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://csg.sph.umich.edu/cfuchsb//cfuchsb/minimac2.2014.9.15.src.tgz from here]. For compiling the source code, you need a recent [https://gcc.gnu.org gcc] (&amp;gt;=4.8), [http://www.openblas.net OpenBlas ], and [https://gcc.gnu.org/fortran/ GFortran].&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://csg.sph.umich.edu/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
[[Ligate_Minimac]] will help you with this.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
2014.9.15 - initial release&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]] 2012.11.16). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://csg.sph.umich.edu/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://csg.sph.umich.edu/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://csg.sph.umich.edu/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://csg.sph.umich.edu/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use [[minimac]] or [[minimac2]] please cite: &lt;br /&gt;
&lt;br /&gt;
Fuchsberger C, Abecasis GR, Hinds DA. minimac2: faster genotype imputation. Bioinformatics 2014 [http://bioinformatics.oxfordjournals.org/content/early/2014/10/22/bioinformatics.btu704.short]&lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11824</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11824"/>
		<updated>2014-10-23T10:12:46Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.src.tgz from here]. For compiling the source code, you need a recent [https://gcc.gnu.org gcc] (&amp;gt;=4.8), [http://www.openblas.net OpenBlas ], and [https://gcc.gnu.org/fortran/ GFortran].&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
[[Ligate_Minimac]] will help you with this.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
2014.9.15 - initial release&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]] 2012.11.16). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use [[minimac]] or [[minimac2]] please cite: &lt;br /&gt;
&lt;br /&gt;
Fuchsberger C, Abecasis GR, Hinds DA. minimac2: faster genotype imputation. Bioinformatics 2014 [http://bioinformatics.oxfordjournals.org/content/early/2014/10/22/bioinformatics.btu704.short]&lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac&amp;diff=11823</id>
		<title>Minimac</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac&amp;diff=11823"/>
		<updated>2014-10-23T10:12:09Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac&#039;&#039;&#039; is a low memory, computationally efficient implementation of the MaCH algorithm for genotype imputation. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac]] - This page, the main minimac page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac&lt;br /&gt;
&lt;br /&gt;
*[https://imputationserver.sph.umich.edu Imputation server] - We are running imputation (and pre-phasing) for you!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac is available [http://www.sph.umich.edu/csg/cfuchsb/minimac-beta-2013.7.17.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac.src.tgz  from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac should be stamped 2013.7.17 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this beta version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
The current version of minimac comes in two flavours, &amp;lt;code&amp;gt;minimac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
2013.7.17&lt;br /&gt;
&lt;br /&gt;
- minor bug fixes&lt;br /&gt;
&lt;br /&gt;
-- all variants (SNPs, InDels, SVs) in the reference VCF will be imputed - independent from the FILTER column setting&lt;br /&gt;
&lt;br /&gt;
- improved performance (Thanks to David Hinds - see also [[minimac2]] for the full set of performance improvements)&lt;br /&gt;
&lt;br /&gt;
2012.11.16&lt;br /&gt;
&lt;br /&gt;
- minor bug fixes&lt;br /&gt;
&lt;br /&gt;
2012.10.9&lt;br /&gt;
&lt;br /&gt;
- added: improved support for [http://www.shapeit.fr ShapeIT] phased haplotypes&lt;br /&gt;
&lt;br /&gt;
2012.10.3&lt;br /&gt;
&lt;br /&gt;
- added: full support for reference panel based chunking&lt;br /&gt;
&lt;br /&gt;
2012.9.22&lt;br /&gt;
&lt;br /&gt;
- fixed: chunk chromosome bug&lt;br /&gt;
&lt;br /&gt;
2012.8.6 (early adopter)&lt;br /&gt;
&lt;br /&gt;
- added: chromosome X support&lt;br /&gt;
&lt;br /&gt;
2012.3.14&lt;br /&gt;
&lt;br /&gt;
- fixed: problem with --startposition &lt;br /&gt;
&lt;br /&gt;
2012.2.29&lt;br /&gt;
&lt;br /&gt;
- added: VCF support&lt;br /&gt;
&lt;br /&gt;
- added: IDR (Insertion, Deletion, Reference) support&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Pre-phasing ==&lt;br /&gt;
For the pre-phasing step, cost increases quadratically with the number of states and linearly with the number of rounds. The following table provides a simple example.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! States&lt;br /&gt;
! Cost per round&lt;br /&gt;
|- &lt;br /&gt;
| 100 states&lt;br /&gt;
| 3 min&lt;br /&gt;
|- &lt;br /&gt;
| 200 states&lt;br /&gt;
| 12 min = (3 min * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 400 states&lt;br /&gt;
| 48 min = (3 min * 4&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 500 states&lt;br /&gt;
| 75 min = (3 min * 5&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, in this case running haplotyping with 500 states and 10 rounds would require 75 min * 10 = 750 min.&lt;br /&gt;
&lt;br /&gt;
Typically, haplotype quality improves rapidly with the number of states but only slowly with the number of rounds. We recommend running ~20 rounds of the MaCH haplotyper and selecting a number of states as high as your patience will allow (but ideally greater than 200).&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 100 haplotypes. Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, we current recommend using [[MaCH]] with the --phase command line option. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
We recommend that, if at all possible, you should phase your chromosomes according to NCBI build 37. Future releases of the 1000 Genomes Reference panel and other public sets of reference haplotypes are expected to use this genome build.&lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
==== NCBI build 36 / NCBI build 37 ====&lt;br /&gt;
The 1000G June reference panel is on build 36, future 1000G reference panels will be on build 37. This has also some impact on the pre-phasing:&lt;br /&gt;
some SNPs will ordered differently in each genome build (we expect order will be more accurate in more recent builds!). Purists will claim that imputation using NCBI build 36 and NCBI build 37 reference panels requires phasing using the exact same reference panel -- others will claim this makes little difference.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
==== using a MaCH reference panel  ====&lt;br /&gt;
&lt;br /&gt;
  minimac --refHaps ref.hap.gz --refSnps ref.snps.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page]. As of this writing, the most recent set of haplotypes are based on genotype calls were generated in May 2011 and are an interim analysis of Project&#039;s Phase I data.&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If the combination of MaCH and Minimac still runs too slowly for you, and you have access to a multi-processor compute cluster, you can look at [[ChunkChromosome]] page to learn how to conveniently split each chromosome into multiple segments that can be analyzed in parallel. For information on how to put the resulting chunks back together, see [[Ligate Minimac|this page]].&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use [[minimac]] or [[minimac2]] please cite: &lt;br /&gt;
&lt;br /&gt;
Fuchsberger C, Abecasis GR, Hinds DA. minimac2: faster genotype imputation. Bioinformatics 2014 [http://bioinformatics.oxfordjournals.org/content/early/2014/10/22/bioinformatics.btu704.short]&lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac&amp;diff=11820</id>
		<title>Minimac</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac&amp;diff=11820"/>
		<updated>2014-10-22T15:56:08Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac&#039;&#039;&#039; is a low memory, computationally efficient implementation of the MaCH algorithm for genotype imputation. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac]] - This page, the main minimac page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac&lt;br /&gt;
&lt;br /&gt;
*[https://imputationserver.sph.umich.edu Imputation server] - We are running imputation (and pre-phasing) for you!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac is available [http://www.sph.umich.edu/csg/cfuchsb/minimac-beta-2013.7.17.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac.src.tgz  from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac should be stamped 2013.7.17 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this beta version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
The current version of minimac comes in two flavours, &amp;lt;code&amp;gt;minimac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
2013.7.17&lt;br /&gt;
&lt;br /&gt;
- minor bug fixes&lt;br /&gt;
&lt;br /&gt;
-- all variants (SNPs, InDels, SVs) in the reference VCF will be imputed - independent from the FILTER column setting&lt;br /&gt;
&lt;br /&gt;
- improved performance (Thanks to David Hinds - see also [[minimac2]] for the full set of performance improvements)&lt;br /&gt;
&lt;br /&gt;
2012.11.16&lt;br /&gt;
&lt;br /&gt;
- minor bug fixes&lt;br /&gt;
&lt;br /&gt;
2012.10.9&lt;br /&gt;
&lt;br /&gt;
- added: improved support for [http://www.shapeit.fr ShapeIT] phased haplotypes&lt;br /&gt;
&lt;br /&gt;
2012.10.3&lt;br /&gt;
&lt;br /&gt;
- added: full support for reference panel based chunking&lt;br /&gt;
&lt;br /&gt;
2012.9.22&lt;br /&gt;
&lt;br /&gt;
- fixed: chunk chromosome bug&lt;br /&gt;
&lt;br /&gt;
2012.8.6 (early adopter)&lt;br /&gt;
&lt;br /&gt;
- added: chromosome X support&lt;br /&gt;
&lt;br /&gt;
2012.3.14&lt;br /&gt;
&lt;br /&gt;
- fixed: problem with --startposition &lt;br /&gt;
&lt;br /&gt;
2012.2.29&lt;br /&gt;
&lt;br /&gt;
- added: VCF support&lt;br /&gt;
&lt;br /&gt;
- added: IDR (Insertion, Deletion, Reference) support&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Pre-phasing ==&lt;br /&gt;
For the pre-phasing step, cost increases quadratically with the number of states and linearly with the number of rounds. The following table provides a simple example.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! States&lt;br /&gt;
! Cost per round&lt;br /&gt;
|- &lt;br /&gt;
| 100 states&lt;br /&gt;
| 3 min&lt;br /&gt;
|- &lt;br /&gt;
| 200 states&lt;br /&gt;
| 12 min = (3 min * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 400 states&lt;br /&gt;
| 48 min = (3 min * 4&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 500 states&lt;br /&gt;
| 75 min = (3 min * 5&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, in this case running haplotyping with 500 states and 10 rounds would require 75 min * 10 = 750 min.&lt;br /&gt;
&lt;br /&gt;
Typically, haplotype quality improves rapidly with the number of states but only slowly with the number of rounds. We recommend running ~20 rounds of the MaCH haplotyper and selecting a number of states as high as your patience will allow (but ideally greater than 200).&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 100 haplotypes. Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, we current recommend using [[MaCH]] with the --phase command line option. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
We recommend that, if at all possible, you should phase your chromosomes according to NCBI build 37. Future releases of the 1000 Genomes Reference panel and other public sets of reference haplotypes are expected to use this genome build.&lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
==== NCBI build 36 / NCBI build 37 ====&lt;br /&gt;
The 1000G June reference panel is on build 36, future 1000G reference panels will be on build 37. This has also some impact on the pre-phasing:&lt;br /&gt;
some SNPs will ordered differently in each genome build (we expect order will be more accurate in more recent builds!). Purists will claim that imputation using NCBI build 36 and NCBI build 37 reference panels requires phasing using the exact same reference panel -- others will claim this makes little difference.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
==== using a MaCH reference panel  ====&lt;br /&gt;
&lt;br /&gt;
  minimac --refHaps ref.hap.gz --refSnps ref.snps.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page]. As of this writing, the most recent set of haplotypes are based on genotype calls were generated in May 2011 and are an interim analysis of Project&#039;s Phase I data.&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If the combination of MaCH and Minimac still runs too slowly for you, and you have access to a multi-processor compute cluster, you can look at [[ChunkChromosome]] page to learn how to conveniently split each chromosome into multiple segments that can be analyzed in parallel. For information on how to put the resulting chunks back together, see [[Ligate Minimac|this page]].&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use [[minimac]] or [[minimac2]] please cite: &lt;br /&gt;
&lt;br /&gt;
Fuchsberger C, Abecasis GR, Hinds DA. minimac2: faster genotype imputation. Bioinformatics 2014 (accepted)&lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11819</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11819"/>
		<updated>2014-10-22T15:55:44Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.src.tgz from here]. For compiling the source code, you need a recent [https://gcc.gnu.org gcc] (&amp;gt;=4.8), [http://www.openblas.net OpenBlas ], and [https://gcc.gnu.org/fortran/ GFortran].&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
[[Ligate_Minimac]] will help you with this.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
2014.9.15 - initial release&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]] 2012.11.16). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use [[minimac]] or [[minimac2]] please cite: &lt;br /&gt;
&lt;br /&gt;
Fuchsberger C, Abecasis GR, Hinds DA. minimac2: faster genotype imputation. Bioinformatics 2014 (accepted)&lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11818</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11818"/>
		<updated>2014-10-21T00:17:59Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.src.tgz from here]. For compiling the source code, you need a recent [https://gcc.gnu.org gcc] (&amp;gt;=4.8), [http://www.openblas.net OpenBlas ], and [https://gcc.gnu.org/fortran/ GFortran].&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
[[Ligate_Minimac]] will help you with this.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
2014.9.15 - initial release&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]] 2012.11.16). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use [[minimac2]], please cite: &lt;br /&gt;
&lt;br /&gt;
Fuchsberger C, Abecasis GR, Hinds DA. minimac2: faster genotype imputation. Bioinformatics 2014 (accepted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you use [[minimac]] please cite: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11817</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11817"/>
		<updated>2014-10-21T00:17:18Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.src.tgz from here]. For compiling the source code, you need a recent [https://gcc.gnu.org gcc] (&amp;gt;=4.8), [http://www.openblas.net OpenBlas ], and [https://gcc.gnu.org/fortran/ GFortran].&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
[[Ligate_Minimac]] will help you with this.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
2014.9.15 - initial release&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]] 2012.11.16). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use [[minimac]] or [[minimac2]], please cite: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fuchsberger C, Abecasis GR, Hinds DA. minimac2: faster genotype imputation. Bioinformatics 2014 (accepted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11816</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11816"/>
		<updated>2014-10-21T00:16:55Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.src.tgz from here]. For compiling the source code, you need a recent [https://gcc.gnu.org gcc] (&amp;gt;=4.8), [http://www.openblas.net OpenBlas ], and [https://gcc.gnu.org/fortran/ GFortran].&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
[[Ligate_Minimac]] will help you with this.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
2014.9.15 - initial release&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]] 2012.11.16). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use [[minimac]] or [[minimac2]], please cite: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fuchsberger C, Abecasis GR, Hinds DA. minimac2: faster genotype imputation Bioinformatics 2014 (accepted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11615</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11615"/>
		<updated>2014-09-18T07:26:51Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Change log */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.src.tgz from here]. For compiling the source code, you need a recent [https://gcc.gnu.org gcc] (&amp;gt;=4.8), [http://www.openblas.net OpenBlas ], and [https://gcc.gnu.org/fortran/ GFortran].&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
[[Ligate_Minimac]] will help you with this.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
2014.9.15 - initial release&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]] 2012.11.16). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use [[minimac]] or [[minimac2]], please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11614</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11614"/>
		<updated>2014-09-18T07:26:11Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Multiprocessor Version */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.src.tgz from here]. For compiling the source code, you need a recent [https://gcc.gnu.org gcc] (&amp;gt;=4.8), [http://www.openblas.net OpenBlas ], and [https://gcc.gnu.org/fortran/ GFortran].&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
[[Ligate_Minimac]] will help you with this.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]] 2012.11.16). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use [[minimac]] or [[minimac2]], please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11613</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11613"/>
		<updated>2014-09-18T07:24:48Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* using a VCF reference panel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.src.tgz from here]. For compiling the source code, you need a recent [https://gcc.gnu.org gcc] (&amp;gt;=4.8), [http://www.openblas.net OpenBlas ], and [https://gcc.gnu.org/fortran/ GFortran].&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]] 2012.11.16). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use [[minimac]] or [[minimac2]], please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11612</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11612"/>
		<updated>2014-09-18T07:23:48Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.src.tgz from here]. For compiling the source code, you need a recent [https://gcc.gnu.org gcc] (&amp;gt;=4.8), [http://www.openblas.net OpenBlas ], and [https://gcc.gnu.org/fortran/ GFortran].&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]] 2012.11.16). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use [[minimac]] or [[minimac2]], please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11605</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11605"/>
		<updated>2014-09-16T10:00:44Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.src.tgz from here]. For compiling the source code, you need a recent [https://gcc.gnu.org gcc] (&amp;gt;=4.8), [http://www.openblas.net OpenBlas ], and [https://gcc.gnu.org/fortran/ GFortran].&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]] 2012.11.16). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac or minimac2, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11604</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11604"/>
		<updated>2014-09-16T09:59:34Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.src.tgz from here]. For compiling the source code, you need a recent [https://gcc.gnu.org gcc] (&amp;gt;=4.8), [http://www.openblas.net OpenBlas ], and  [https://gcc.gnu.org/fortran/ GFortran].&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]] 2012.11.16). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac or minimac2, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11603</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11603"/>
		<updated>2014-09-16T09:59:14Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.src.tgz from here]. For compiling the source code, you need a recent [https://gcc.gnu.org gcc] (&amp;gt;=4.8), [http://www.openblas.net OpenBlas ], and  [https://gcc.gnu.org/fortran/ GFortran].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]] 2012.11.16). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac or minimac2, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11602</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11602"/>
		<updated>2014-09-16T09:58:18Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.src.tgz from here]. For compiling the source code you need a need recent [https://gcc.gnu.org gcc] (&amp;gt;=4.8), [http://www.openblas.net OpenBlas ], and  [https://gcc.gnu.org/fortran/ GFortran].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]] 2012.11.16). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac or minimac2, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11601</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11601"/>
		<updated>2014-09-16T09:57:12Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.src.tgz from here]. For compiling the source code you need: gcc &amp;gt; 4.8, OpenBlas [http://www.openblas.net], and GFortran [https://gcc.gnu.org/fortran/].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]] 2012.11.16). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac or minimac2, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11600</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11600"/>
		<updated>2014-09-16T09:56:55Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.src.tgz from here]. The requirements for compiling the source code are: gcc &amp;gt; 4.8, OpenBlas [http://www.openblas.net], and GFortran [https://gcc.gnu.org/fortran/].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]] 2012.11.16). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac or minimac2, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac:_Tutorial&amp;diff=11592</id>
		<title>Minimac: Tutorial</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac:_Tutorial&amp;diff=11592"/>
		<updated>2014-09-16T07:24:05Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Imputation into Phased Haplotypes - minimac(2) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Before reading this tutorial, you might find it useful to spend a few minutes reading through the main [[Minimac]] and [[Minimac2]] documentation. &lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
Download [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH] and [http://genome.sph.umich.edu/wiki/Minimac#Download Minimac] or [http://genome.sph.umich.edu/wiki/Minimac2#Download Minimac2]. Furthermore, example data used in this tutorial can be found [http://www.sph.umich.edu/csg/cfuchsb/minimac2_example.tgz here]&lt;br /&gt;
&lt;br /&gt;
== Minimac and Minimac2 Imputation ==&lt;br /&gt;
&lt;br /&gt;
[[Minimac]] and [[Minimac2]] relies on a two step approach. First, the samples that are to be analyzed must be phased into a series of estimated haplotypes. Second, imputation is carried out directly into these phased haplotypes. As newer reference panels become available, only the second step must be repeated.&lt;br /&gt;
&lt;br /&gt;
=== Pre-phasing - MaCH ===&lt;br /&gt;
&lt;br /&gt;
A convenient way to haplotype your sample is to use MaCH. A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
 ./mach1 -d sample.dat -p sample.ped --rounds 20 --states 50 --phase --interim 5 --sample 5  --prefix sample.pp | tee mach.log&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 50 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the [http://www.sph.umich.edu/csg/abecasis/MaCH/ MaCH website]):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. If computing time is a constraints, you may consider decreasing this parameter to 100. If you have substantial computing resources, consider increasing this value to 600 or even 800.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20-30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful. If you are not short of disk space, you should consider enabling this parameter.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Imputation into Phased Haplotypes - minimac(2)===&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac(2)&#039;&#039;&#039; is a straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for estimating model parameters (which describe the length and conservation of haplotype stretches shared between the reference panel and your study samples), imputation should proceed rapidly. Because marker names can change between dbSNP versions, it is usually a good idea to include &#039;&#039;aliases&#039;&#039; file that provides mappings between earlier marker names and the current preferred name for each polymorphism.&lt;br /&gt;
&lt;br /&gt;
The minimac command line would look like this:&lt;br /&gt;
&lt;br /&gt;
 ./minimac --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac.log&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 ./minimac2 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample2.imp | tee minimac2.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac(2) options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps hapmap.hap &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from HapMap or the 1000 genomes Project).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps hapmap.snps &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of sites in the reference haplotypes; needed unless the reference haplotypes are in VCF format.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps chr.snps &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps chr.haps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
&amp;lt;!-- |- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can speed-up things by running minimac in parallel by launching the [http://genome.sph.umich.edu/wiki/Minimac2#Multiprocessor_Version minimac2-omp] version. On our cluster 4 cpus per minimac(2) is optimal (--cpus 4).&lt;br /&gt;
&lt;br /&gt;
 ./minimac-omp --cpus 4 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac-omp.log&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 ./minimac2-omp --cpus 4 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample2.imp | tee minimac-omp.log&lt;br /&gt;
&lt;br /&gt;
== Imputation quality evaluation ==&lt;br /&gt;
Minimac hides each of the genotyped SNPs in turn and then calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP alleles are probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the *.info file&lt;br /&gt;
&lt;br /&gt;
Be aware that, unfortunately, imputation quality statistics are not directly comparable between different imputation programs (MaCH/minimac vs. Impute vs. Beagle etc.).&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac or minimac2, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis], [mailto:cfuchsb@umich.edu Christian Fuchsberger (minimac)] or [mailto:yunli@med.unc.edu Yun Li (MaCH)].&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac:_Tutorial&amp;diff=11591</id>
		<title>Minimac: Tutorial</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac:_Tutorial&amp;diff=11591"/>
		<updated>2014-09-16T07:23:41Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Getting Started */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Before reading this tutorial, you might find it useful to spend a few minutes reading through the main [[Minimac]] and [[Minimac2]] documentation. &lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
Download [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH] and [http://genome.sph.umich.edu/wiki/Minimac#Download Minimac] or [http://genome.sph.umich.edu/wiki/Minimac2#Download Minimac2]. Furthermore, example data used in this tutorial can be found [http://www.sph.umich.edu/csg/cfuchsb/minimac2_example.tgz here]&lt;br /&gt;
&lt;br /&gt;
== Minimac and Minimac2 Imputation ==&lt;br /&gt;
&lt;br /&gt;
[[Minimac]] and [[Minimac2]] relies on a two step approach. First, the samples that are to be analyzed must be phased into a series of estimated haplotypes. Second, imputation is carried out directly into these phased haplotypes. As newer reference panels become available, only the second step must be repeated.&lt;br /&gt;
&lt;br /&gt;
=== Pre-phasing - MaCH ===&lt;br /&gt;
&lt;br /&gt;
A convenient way to haplotype your sample is to use MaCH. A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
 ./mach1 -d sample.dat -p sample.ped --rounds 20 --states 50 --phase --interim 5 --sample 5  --prefix sample.pp | tee mach.log&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 50 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the [http://www.sph.umich.edu/csg/abecasis/MaCH/ MaCH website]):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. If computing time is a constraints, you may consider decreasing this parameter to 100. If you have substantial computing resources, consider increasing this value to 600 or even 800.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20-30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful. If you are not short of disk space, you should consider enabling this parameter.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Imputation into Phased Haplotypes - minimac(2)===&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac(2)&#039;&#039;&#039; is a straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for estimating model parameters (which describe the length and conservation of haplotype stretches shared between the reference panel and your study samples), imputation should proceed rapidly. Because marker names can change between dbSNP versions, it is usually a good idea to include &#039;&#039;aliases&#039;&#039; file that provides mappings between earlier marker names and the current preferred name for each polymorphism.&lt;br /&gt;
&lt;br /&gt;
The minimac command line would look like this:&lt;br /&gt;
&lt;br /&gt;
 ./minimac --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac.log&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 ./minimac2 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac2.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac(2) options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps hapmap.hap &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from HapMap or the 1000 genomes Project).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps hapmap.snps &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of sites in the reference haplotypes; needed unless the reference haplotypes are in VCF format.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps chr.snps &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps chr.haps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
&amp;lt;!-- |- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can speed-up things by running minimac in parallel by launching the [http://genome.sph.umich.edu/wiki/Minimac2#Multiprocessor_Version minimac2-omp] version. On our cluster 4 cpus per minimac(2) is optimal (--cpus 4).&lt;br /&gt;
&lt;br /&gt;
 ./minimac-omp --cpus 4 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac-omp.log&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 ./minimac2-omp --cpus 4 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac-omp.log&lt;br /&gt;
&lt;br /&gt;
== Imputation quality evaluation ==&lt;br /&gt;
Minimac hides each of the genotyped SNPs in turn and then calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP alleles are probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the *.info file&lt;br /&gt;
&lt;br /&gt;
Be aware that, unfortunately, imputation quality statistics are not directly comparable between different imputation programs (MaCH/minimac vs. Impute vs. Beagle etc.).&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac or minimac2, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis], [mailto:cfuchsb@umich.edu Christian Fuchsberger (minimac)] or [mailto:yunli@med.unc.edu Yun Li (MaCH)].&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac:_Tutorial&amp;diff=11590</id>
		<title>Minimac: Tutorial</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac:_Tutorial&amp;diff=11590"/>
		<updated>2014-09-16T07:23:19Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Getting Started */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Before reading this tutorial, you might find it useful to spend a few minutes reading through the main [[Minimac]] and [[Minimac2]] documentation. &lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
Download [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH] and [http://genome.sph.umich.edu/wiki/Minimac#Download Minimac] or [http://genome.sph.umich.edu/wiki/Minimac2#Download Minimac2]. Furthermore, example data used in this tutorial can be found [http://www.sph.umich.edu/csg/abecasis/downloads/minimac2_example.tgz here]&lt;br /&gt;
&lt;br /&gt;
== Minimac and Minimac2 Imputation ==&lt;br /&gt;
&lt;br /&gt;
[[Minimac]] and [[Minimac2]] relies on a two step approach. First, the samples that are to be analyzed must be phased into a series of estimated haplotypes. Second, imputation is carried out directly into these phased haplotypes. As newer reference panels become available, only the second step must be repeated.&lt;br /&gt;
&lt;br /&gt;
=== Pre-phasing - MaCH ===&lt;br /&gt;
&lt;br /&gt;
A convenient way to haplotype your sample is to use MaCH. A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
 ./mach1 -d sample.dat -p sample.ped --rounds 20 --states 50 --phase --interim 5 --sample 5  --prefix sample.pp | tee mach.log&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 50 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the [http://www.sph.umich.edu/csg/abecasis/MaCH/ MaCH website]):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. If computing time is a constraints, you may consider decreasing this parameter to 100. If you have substantial computing resources, consider increasing this value to 600 or even 800.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20-30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful. If you are not short of disk space, you should consider enabling this parameter.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Imputation into Phased Haplotypes - minimac(2)===&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac(2)&#039;&#039;&#039; is a straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for estimating model parameters (which describe the length and conservation of haplotype stretches shared between the reference panel and your study samples), imputation should proceed rapidly. Because marker names can change between dbSNP versions, it is usually a good idea to include &#039;&#039;aliases&#039;&#039; file that provides mappings between earlier marker names and the current preferred name for each polymorphism.&lt;br /&gt;
&lt;br /&gt;
The minimac command line would look like this:&lt;br /&gt;
&lt;br /&gt;
 ./minimac --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac.log&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 ./minimac2 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac2.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac(2) options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps hapmap.hap &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from HapMap or the 1000 genomes Project).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps hapmap.snps &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of sites in the reference haplotypes; needed unless the reference haplotypes are in VCF format.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps chr.snps &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps chr.haps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
&amp;lt;!-- |- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can speed-up things by running minimac in parallel by launching the [http://genome.sph.umich.edu/wiki/Minimac2#Multiprocessor_Version minimac2-omp] version. On our cluster 4 cpus per minimac(2) is optimal (--cpus 4).&lt;br /&gt;
&lt;br /&gt;
 ./minimac-omp --cpus 4 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac-omp.log&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 ./minimac2-omp --cpus 4 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac-omp.log&lt;br /&gt;
&lt;br /&gt;
== Imputation quality evaluation ==&lt;br /&gt;
Minimac hides each of the genotyped SNPs in turn and then calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP alleles are probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the *.info file&lt;br /&gt;
&lt;br /&gt;
Be aware that, unfortunately, imputation quality statistics are not directly comparable between different imputation programs (MaCH/minimac vs. Impute vs. Beagle etc.).&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac or minimac2, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis], [mailto:cfuchsb@umich.edu Christian Fuchsberger (minimac)] or [mailto:yunli@med.unc.edu Yun Li (MaCH)].&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac&amp;diff=11589</id>
		<title>Minimac</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac&amp;diff=11589"/>
		<updated>2014-09-16T07:09:43Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Change log */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac&#039;&#039;&#039; is a low memory, computationally efficient implementation of the MaCH algorithm for genotype imputation. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac]] - This page, the main minimac page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac&lt;br /&gt;
&lt;br /&gt;
*[https://imputationserver.sph.umich.edu Imputation server] - We are running imputation (and pre-phasing) for you!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac is available [http://www.sph.umich.edu/csg/cfuchsb/minimac-beta-2013.7.17.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac.src.tgz  from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac should be stamped 2013.7.17 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this beta version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
The current version of minimac comes in two flavours, &amp;lt;code&amp;gt;minimac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
2013.7.17&lt;br /&gt;
&lt;br /&gt;
- minor bug fixes&lt;br /&gt;
&lt;br /&gt;
-- all variants (SNPs, InDels, SVs) in the reference VCF will be imputed - independent from the FILTER column setting&lt;br /&gt;
&lt;br /&gt;
- improved performance (Thanks to David Hinds - see also [[minimac2]] for the full set of performance improvements)&lt;br /&gt;
&lt;br /&gt;
2012.11.16&lt;br /&gt;
&lt;br /&gt;
- minor bug fixes&lt;br /&gt;
&lt;br /&gt;
2012.10.9&lt;br /&gt;
&lt;br /&gt;
- added: improved support for [http://www.shapeit.fr ShapeIT] phased haplotypes&lt;br /&gt;
&lt;br /&gt;
2012.10.3&lt;br /&gt;
&lt;br /&gt;
- added: full support for reference panel based chunking&lt;br /&gt;
&lt;br /&gt;
2012.9.22&lt;br /&gt;
&lt;br /&gt;
- fixed: chunk chromosome bug&lt;br /&gt;
&lt;br /&gt;
2012.8.6 (early adopter)&lt;br /&gt;
&lt;br /&gt;
- added: chromosome X support&lt;br /&gt;
&lt;br /&gt;
2012.3.14&lt;br /&gt;
&lt;br /&gt;
- fixed: problem with --startposition &lt;br /&gt;
&lt;br /&gt;
2012.2.29&lt;br /&gt;
&lt;br /&gt;
- added: VCF support&lt;br /&gt;
&lt;br /&gt;
- added: IDR (Insertion, Deletion, Reference) support&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Pre-phasing ==&lt;br /&gt;
For the pre-phasing step, cost increases quadratically with the number of states and linearly with the number of rounds. The following table provides a simple example.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! States&lt;br /&gt;
! Cost per round&lt;br /&gt;
|- &lt;br /&gt;
| 100 states&lt;br /&gt;
| 3 min&lt;br /&gt;
|- &lt;br /&gt;
| 200 states&lt;br /&gt;
| 12 min = (3 min * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 400 states&lt;br /&gt;
| 48 min = (3 min * 4&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 500 states&lt;br /&gt;
| 75 min = (3 min * 5&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, in this case running haplotyping with 500 states and 10 rounds would require 75 min * 10 = 750 min.&lt;br /&gt;
&lt;br /&gt;
Typically, haplotype quality improves rapidly with the number of states but only slowly with the number of rounds. We recommend running ~20 rounds of the MaCH haplotyper and selecting a number of states as high as your patience will allow (but ideally greater than 200).&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 100 haplotypes. Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, we current recommend using [[MaCH]] with the --phase command line option. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
We recommend that, if at all possible, you should phase your chromosomes according to NCBI build 37. Future releases of the 1000 Genomes Reference panel and other public sets of reference haplotypes are expected to use this genome build.&lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
==== NCBI build 36 / NCBI build 37 ====&lt;br /&gt;
The 1000G June reference panel is on build 36, future 1000G reference panels will be on build 37. This has also some impact on the pre-phasing:&lt;br /&gt;
some SNPs will ordered differently in each genome build (we expect order will be more accurate in more recent builds!). Purists will claim that imputation using NCBI build 36 and NCBI build 37 reference panels requires phasing using the exact same reference panel -- others will claim this makes little difference.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
==== using a MaCH reference panel  ====&lt;br /&gt;
&lt;br /&gt;
  minimac --refHaps ref.hap.gz --refSnps ref.snps.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page]. As of this writing, the most recent set of haplotypes are based on genotype calls were generated in May 2011 and are an interim analysis of Project&#039;s Phase I data.&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If the combination of MaCH and Minimac still runs too slowly for you, and you have access to a multi-processor compute cluster, you can look at [[ChunkChromosome]] page to learn how to conveniently split each chromosome into multiple segments that can be analyzed in parallel. For information on how to put the resulting chunks back together, see [[Ligate Minimac|this page]].&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11588</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11588"/>
		<updated>2014-09-16T07:07:33Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Imputation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.src.tgz from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]] 2012.11.16). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac or minimac2, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11587</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11587"/>
		<updated>2014-09-16T07:00:46Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac2.2014.9.15.src.tgz from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]]). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac or minimac2, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11586</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11586"/>
		<updated>2014-09-16T07:00:27Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Download */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [http://www.sph.umich.edu/csg/cfuchsb/minimac.2014.9.15.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac.2014.9.15.src.tgz from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]]). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac or minimac2, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac:_Tutorial&amp;diff=11585</id>
		<title>Minimac: Tutorial</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac:_Tutorial&amp;diff=11585"/>
		<updated>2014-09-16T06:41:42Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Minimac Imputation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Before reading this tutorial, you might find it useful to spend a few minutes reading through the main [[Minimac]] and [[Minimac2]] documentation. &lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
Download [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH] and [http://genome.sph.umich.edu/wiki/Minimac#Download Minimac] or [http://genome.sph.umich.edu/wiki/Minimac2#Download Minimac2]. Furthermore, example data used in this tutorial can be found [http://www.sph.umich.edu/csg/abecasis/downloads/minimac_example.tar.gz here]&lt;br /&gt;
&lt;br /&gt;
== Minimac and Minimac2 Imputation ==&lt;br /&gt;
&lt;br /&gt;
[[Minimac]] and [[Minimac2]] relies on a two step approach. First, the samples that are to be analyzed must be phased into a series of estimated haplotypes. Second, imputation is carried out directly into these phased haplotypes. As newer reference panels become available, only the second step must be repeated.&lt;br /&gt;
&lt;br /&gt;
=== Pre-phasing - MaCH ===&lt;br /&gt;
&lt;br /&gt;
A convenient way to haplotype your sample is to use MaCH. A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
 ./mach1 -d sample.dat -p sample.ped --rounds 20 --states 50 --phase --interim 5 --sample 5  --prefix sample.pp | tee mach.log&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 50 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the [http://www.sph.umich.edu/csg/abecasis/MaCH/ MaCH website]):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. If computing time is a constraints, you may consider decreasing this parameter to 100. If you have substantial computing resources, consider increasing this value to 600 or even 800.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20-30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful. If you are not short of disk space, you should consider enabling this parameter.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Imputation into Phased Haplotypes - minimac(2)===&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac(2)&#039;&#039;&#039; is a straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for estimating model parameters (which describe the length and conservation of haplotype stretches shared between the reference panel and your study samples), imputation should proceed rapidly. Because marker names can change between dbSNP versions, it is usually a good idea to include &#039;&#039;aliases&#039;&#039; file that provides mappings between earlier marker names and the current preferred name for each polymorphism.&lt;br /&gt;
&lt;br /&gt;
The minimac command line would look like this:&lt;br /&gt;
&lt;br /&gt;
 ./minimac --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac.log&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 ./minimac2 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac2.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac(2) options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps hapmap.hap &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from HapMap or the 1000 genomes Project).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps hapmap.snps &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of sites in the reference haplotypes; needed unless the reference haplotypes are in VCF format.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps chr.snps &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps chr.haps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
&amp;lt;!-- |- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can speed-up things by running minimac in parallel by launching the [http://genome.sph.umich.edu/wiki/Minimac2#Multiprocessor_Version minimac2-omp] version. On our cluster 4 cpus per minimac(2) is optimal (--cpus 4).&lt;br /&gt;
&lt;br /&gt;
 ./minimac-omp --cpus 4 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac-omp.log&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 ./minimac2-omp --cpus 4 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac-omp.log&lt;br /&gt;
&lt;br /&gt;
== Imputation quality evaluation ==&lt;br /&gt;
Minimac hides each of the genotyped SNPs in turn and then calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP alleles are probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the *.info file&lt;br /&gt;
&lt;br /&gt;
Be aware that, unfortunately, imputation quality statistics are not directly comparable between different imputation programs (MaCH/minimac vs. Impute vs. Beagle etc.).&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac or minimac2, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis], [mailto:cfuchsb@umich.edu Christian Fuchsberger (minimac)] or [mailto:yunli@med.unc.edu Yun Li (MaCH)].&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac:_Tutorial&amp;diff=11584</id>
		<title>Minimac: Tutorial</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac:_Tutorial&amp;diff=11584"/>
		<updated>2014-09-16T06:41:22Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Before reading this tutorial, you might find it useful to spend a few minutes reading through the main [[Minimac]] and [[Minimac2]] documentation. &lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
Download [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH] and [http://genome.sph.umich.edu/wiki/Minimac#Download Minimac] or [http://genome.sph.umich.edu/wiki/Minimac2#Download Minimac2]. Furthermore, example data used in this tutorial can be found [http://www.sph.umich.edu/csg/abecasis/downloads/minimac_example.tar.gz here]&lt;br /&gt;
&lt;br /&gt;
== Minimac Imputation ==&lt;br /&gt;
&lt;br /&gt;
[[Minimac]] and [[Minimac2]] relies on a two step approach. First, the samples that are to be analyzed must be phased into a series of estimated haplotypes. Second, imputation is carried out directly into these phased haplotypes. As newer reference panels become available, only the second step must be repeated.&lt;br /&gt;
&lt;br /&gt;
=== Pre-phasing - MaCH ===&lt;br /&gt;
&lt;br /&gt;
A convenient way to haplotype your sample is to use MaCH. A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
 ./mach1 -d sample.dat -p sample.ped --rounds 20 --states 50 --phase --interim 5 --sample 5  --prefix sample.pp | tee mach.log&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 50 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the [http://www.sph.umich.edu/csg/abecasis/MaCH/ MaCH website]):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. If computing time is a constraints, you may consider decreasing this parameter to 100. If you have substantial computing resources, consider increasing this value to 600 or even 800.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20-30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful. If you are not short of disk space, you should consider enabling this parameter.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Imputation into Phased Haplotypes - minimac(2)===&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac(2)&#039;&#039;&#039; is a straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for estimating model parameters (which describe the length and conservation of haplotype stretches shared between the reference panel and your study samples), imputation should proceed rapidly. Because marker names can change between dbSNP versions, it is usually a good idea to include &#039;&#039;aliases&#039;&#039; file that provides mappings between earlier marker names and the current preferred name for each polymorphism.&lt;br /&gt;
&lt;br /&gt;
The minimac command line would look like this:&lt;br /&gt;
&lt;br /&gt;
 ./minimac --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac.log&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 ./minimac2 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac2.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac(2) options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps hapmap.hap &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from HapMap or the 1000 genomes Project).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps hapmap.snps &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of sites in the reference haplotypes; needed unless the reference haplotypes are in VCF format.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps chr.snps &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps chr.haps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
&amp;lt;!-- |- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can speed-up things by running minimac in parallel by launching the [http://genome.sph.umich.edu/wiki/Minimac2#Multiprocessor_Version minimac2-omp] version. On our cluster 4 cpus per minimac(2) is optimal (--cpus 4).&lt;br /&gt;
&lt;br /&gt;
 ./minimac-omp --cpus 4 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac-omp.log&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 ./minimac2-omp --cpus 4 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac-omp.log&lt;br /&gt;
&lt;br /&gt;
== Imputation quality evaluation ==&lt;br /&gt;
Minimac hides each of the genotyped SNPs in turn and then calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP alleles are probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the *.info file&lt;br /&gt;
&lt;br /&gt;
Be aware that, unfortunately, imputation quality statistics are not directly comparable between different imputation programs (MaCH/minimac vs. Impute vs. Beagle etc.).&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac or minimac2, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis], [mailto:cfuchsb@umich.edu Christian Fuchsberger (minimac)] or [mailto:yunli@med.unc.edu Yun Li (MaCH)].&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac:_Tutorial&amp;diff=11583</id>
		<title>Minimac: Tutorial</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac:_Tutorial&amp;diff=11583"/>
		<updated>2014-09-16T06:40:51Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Minimac Imputation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Before reading this tutorial, you might find it useful to spend a few minutes reading through the main [[Minimac]] and [[Minimac2]] documentation. &lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
Download [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH] and [http://genome.sph.umich.edu/wiki/Minimac#Download Minimac] or [http://genome.sph.umich.edu/wiki/Minimac2#Download Minimac2]. Furthermore, example data used in this tutorial can be found [http://www.sph.umich.edu/csg/abecasis/downloads/minimac_example.tar.gz here]&lt;br /&gt;
&lt;br /&gt;
== Minimac Imputation ==&lt;br /&gt;
&lt;br /&gt;
[[Minimac]] and [[Minimac2]] relies on a two step approach. First, the samples that are to be analyzed must be phased into a series of estimated haplotypes. Second, imputation is carried out directly into these phased haplotypes. As newer reference panels become available, only the second step must be repeated.&lt;br /&gt;
&lt;br /&gt;
=== Pre-phasing - MaCH ===&lt;br /&gt;
&lt;br /&gt;
A convenient way to haplotype your sample is to use MaCH. A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
 ./mach1 -d sample.dat -p sample.ped --rounds 20 --states 50 --phase --interim 5 --sample 5  --prefix sample.pp | tee mach.log&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 50 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the [http://www.sph.umich.edu/csg/abecasis/MaCH/ MaCH website]):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. If computing time is a constraints, you may consider decreasing this parameter to 100. If you have substantial computing resources, consider increasing this value to 600 or even 800.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20-30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful. If you are not short of disk space, you should consider enabling this parameter.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Imputation into Phased Haplotypes - minimac(2)===&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac(2)&#039;&#039;&#039; is a straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for estimating model parameters (which describe the length and conservation of haplotype stretches shared between the reference panel and your study samples), imputation should proceed rapidly. Because marker names can change between dbSNP versions, it is usually a good idea to include &#039;&#039;aliases&#039;&#039; file that provides mappings between earlier marker names and the current preferred name for each polymorphism.&lt;br /&gt;
&lt;br /&gt;
The minimac command line would look like this:&lt;br /&gt;
&lt;br /&gt;
 ./minimac --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac.log&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 ./minimac2 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac2.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac(2) options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps hapmap.hap &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from HapMap or the 1000 genomes Project).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps hapmap.snps &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of sites in the reference haplotypes; needed unless the reference haplotypes are in VCF format.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps chr.snps &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps chr.haps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
&amp;lt;!-- |- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can speed-up things by running minimac in parallel by launching the [http://genome.sph.umich.edu/wiki/Minimac2#Multiprocessor_Version minimac2-omp] version. On our cluster 4 cpus per minimac(2) is optimal (--cpus 4).&lt;br /&gt;
&lt;br /&gt;
 ./minimac-omp --cpus 4 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac-omp.log&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 ./minimac2-omp --cpus 4 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac-omp.log&lt;br /&gt;
&lt;br /&gt;
== Imputation quality evaluation ==&lt;br /&gt;
Minimac hides each of the genotyped SNPs in turn and then calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP alleles are probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the *.info file&lt;br /&gt;
&lt;br /&gt;
Be aware that, unfortunately, imputation quality statistics are not directly comparable between different imputation programs (MaCH/minimac vs. Impute vs. Beagle etc.).&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis], [mailto:cfuchsb@umich.edu Christian Fuchsberger (minimac)] or [mailto:yunli@med.unc.edu Yun Li (MaCH)].&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac:_Tutorial&amp;diff=11582</id>
		<title>Minimac: Tutorial</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac:_Tutorial&amp;diff=11582"/>
		<updated>2014-09-16T06:39:02Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Getting Started */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Before reading this tutorial, you might find it useful to spend a few minutes reading through the main [[Minimac]] and [[Minimac2]] documentation. &lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
Download [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH] and [http://genome.sph.umich.edu/wiki/Minimac#Download Minimac] or [http://genome.sph.umich.edu/wiki/Minimac2#Download Minimac2]. Furthermore, example data used in this tutorial can be found [http://www.sph.umich.edu/csg/abecasis/downloads/minimac_example.tar.gz here]&lt;br /&gt;
&lt;br /&gt;
== Minimac Imputation ==&lt;br /&gt;
&lt;br /&gt;
[[Minimac]] relies on a two step approach. First, the samples that are to be analyzed must be phased into a series of estimated haplotypes. Second, imputation is carried out directly into these phased haplotypes. As newer reference panels become available, only the second step must be repeated.&lt;br /&gt;
&lt;br /&gt;
=== Pre-phasing - MaCH ===&lt;br /&gt;
&lt;br /&gt;
A convenient way to haplotype your sample is to use MaCH. A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
 ./mach1 -d sample.dat -p sample.ped --rounds 20 --states 50 --phase --interim 5 --sample 5  --prefix sample.pp | tee mach.log&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 50 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the [http://www.sph.umich.edu/csg/abecasis/MaCH/ MaCH website]):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. If computing time is a constraints, you may consider decreasing this parameter to 100. If you have substantial computing resources, consider increasing this value to 600 or even 800.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20-30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful. If you are not short of disk space, you should consider enabling this parameter.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Imputation into Phased Haplotypes - minimac ===&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is a straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for estimating model parameters (which describe the length and conservation of haplotype stretches shared between the reference panel and your study samples), imputation should proceed rapidly. Because marker names can change between dbSNP versions, it is usually a good idea to include &#039;&#039;aliases&#039;&#039; file that provides mappings between earlier marker names and the current preferred name for each polymorphism.&lt;br /&gt;
&lt;br /&gt;
The minimac command line would look like this:&lt;br /&gt;
&lt;br /&gt;
 ./minimac --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac.log&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps hapmap.hap &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from HapMap or the 1000 genomes Project).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps hapmap.snps &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of sites in the reference haplotypes; needed unless the reference haplotypes are in VCF format.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps chr.snps &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps chr.haps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
&amp;lt;!-- |- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can speed-up things by running minimac in parallel by launching the [http://genome.sph.umich.edu/wiki/Minimac#Multiprocessor_Version minimac-omp] version. On our cluster 4 cpus per minimac is optimal (--cpus 4).&lt;br /&gt;
&lt;br /&gt;
 ./minimac-omp --cpus 4 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac-omp.log&lt;br /&gt;
&lt;br /&gt;
== Imputation quality evaluation ==&lt;br /&gt;
Minimac hides each of the genotyped SNPs in turn and then calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP alleles are probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the *.info file&lt;br /&gt;
&lt;br /&gt;
Be aware that, unfortunately, imputation quality statistics are not directly comparable between different imputation programs (MaCH/minimac vs. Impute vs. Beagle etc.).&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis], [mailto:cfuchsb@umich.edu Christian Fuchsberger (minimac)] or [mailto:yunli@med.unc.edu Yun Li (MaCH)].&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac:_Tutorial&amp;diff=11581</id>
		<title>Minimac: Tutorial</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac:_Tutorial&amp;diff=11581"/>
		<updated>2014-09-16T06:38:32Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Before reading this tutorial, you might find it useful to spend a few minutes reading through the main [[Minimac]] and [[Minimac2]] documentation. &lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
Download [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH] and [http://genome.sph.umich.edu/wiki/Minimac#Download Minimac]. Furthermore, example data used in this tutorial can be found [http://www.sph.umich.edu/csg/abecasis/downloads/minimac_example.tar.gz here]&lt;br /&gt;
&lt;br /&gt;
== Minimac Imputation ==&lt;br /&gt;
&lt;br /&gt;
[[Minimac]] relies on a two step approach. First, the samples that are to be analyzed must be phased into a series of estimated haplotypes. Second, imputation is carried out directly into these phased haplotypes. As newer reference panels become available, only the second step must be repeated.&lt;br /&gt;
&lt;br /&gt;
=== Pre-phasing - MaCH ===&lt;br /&gt;
&lt;br /&gt;
A convenient way to haplotype your sample is to use MaCH. A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
 ./mach1 -d sample.dat -p sample.ped --rounds 20 --states 50 --phase --interim 5 --sample 5  --prefix sample.pp | tee mach.log&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 50 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the [http://www.sph.umich.edu/csg/abecasis/MaCH/ MaCH website]):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. If computing time is a constraints, you may consider decreasing this parameter to 100. If you have substantial computing resources, consider increasing this value to 600 or even 800.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20-30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful. If you are not short of disk space, you should consider enabling this parameter.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Imputation into Phased Haplotypes - minimac ===&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is a straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for estimating model parameters (which describe the length and conservation of haplotype stretches shared between the reference panel and your study samples), imputation should proceed rapidly. Because marker names can change between dbSNP versions, it is usually a good idea to include &#039;&#039;aliases&#039;&#039; file that provides mappings between earlier marker names and the current preferred name for each polymorphism.&lt;br /&gt;
&lt;br /&gt;
The minimac command line would look like this:&lt;br /&gt;
&lt;br /&gt;
 ./minimac --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac.log&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps hapmap.hap &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from HapMap or the 1000 genomes Project).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps hapmap.snps &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of sites in the reference haplotypes; needed unless the reference haplotypes are in VCF format.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps chr.snps &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps chr.haps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
&amp;lt;!-- |- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can speed-up things by running minimac in parallel by launching the [http://genome.sph.umich.edu/wiki/Minimac#Multiprocessor_Version minimac-omp] version. On our cluster 4 cpus per minimac is optimal (--cpus 4).&lt;br /&gt;
&lt;br /&gt;
 ./minimac-omp --cpus 4 --refHaps hapmap.hap --refSnps hapmap.snps --haps sample.pp.gz --snps sample.snps --prefix sample.imp | tee minimac-omp.log&lt;br /&gt;
&lt;br /&gt;
== Imputation quality evaluation ==&lt;br /&gt;
Minimac hides each of the genotyped SNPs in turn and then calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP alleles are probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the *.info file&lt;br /&gt;
&lt;br /&gt;
Be aware that, unfortunately, imputation quality statistics are not directly comparable between different imputation programs (MaCH/minimac vs. Impute vs. Beagle etc.).&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis], [mailto:cfuchsb@umich.edu Christian Fuchsberger (minimac)] or [mailto:yunli@med.unc.edu Yun Li (MaCH)].&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11580</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11580"/>
		<updated>2014-09-16T06:37:26Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac.src.tgz  from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac2 should be stamped  2014.9.15- if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
Minimac2 comes in two flavours, &amp;lt;code&amp;gt;minimac2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac2-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (&amp;gt;10x faster than [[minimac]]). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac2&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac2&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac2 ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac2 command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac2 hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac or minimac2, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11579</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11579"/>
		<updated>2014-09-16T06:33:24Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* X Chromosome Imputation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac.src.tgz  from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac should be stamped  - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
The current version of minimac comes in two flavours, &amp;lt;code&amp;gt;minimac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Pre-phasing ==&lt;br /&gt;
For the pre-phasing step, cost increases quadratically with the number of states and linearly with the number of rounds. The following table provides a simple example.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! States&lt;br /&gt;
! Cost per round&lt;br /&gt;
|- &lt;br /&gt;
| 100 states&lt;br /&gt;
| 3 min&lt;br /&gt;
|- &lt;br /&gt;
| 200 states&lt;br /&gt;
| 12 min = (3 min * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 400 states&lt;br /&gt;
| 48 min = (3 min * 4&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 500 states&lt;br /&gt;
| 75 min = (3 min * 5&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, in this case running haplotyping with 500 states and 10 rounds would require 75 min * 10 = 750 min.&lt;br /&gt;
&lt;br /&gt;
Typically, haplotype quality improves rapidly with the number of states but only slowly with the number of rounds. We recommend running ~20 rounds of the MaCH haplotyper and selecting a number of states as high as your patience will allow (but ideally greater than 200).&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes. Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac2 as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac or minimac2, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11578</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11578"/>
		<updated>2014-09-16T06:32:59Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac.src.tgz  from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac should be stamped  - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
The current version of minimac comes in two flavours, &amp;lt;code&amp;gt;minimac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Pre-phasing ==&lt;br /&gt;
For the pre-phasing step, cost increases quadratically with the number of states and linearly with the number of rounds. The following table provides a simple example.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! States&lt;br /&gt;
! Cost per round&lt;br /&gt;
|- &lt;br /&gt;
| 100 states&lt;br /&gt;
| 3 min&lt;br /&gt;
|- &lt;br /&gt;
| 200 states&lt;br /&gt;
| 12 min = (3 min * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 400 states&lt;br /&gt;
| 48 min = (3 min * 4&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 500 states&lt;br /&gt;
| 75 min = (3 min * 5&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, in this case running haplotyping with 500 states and 10 rounds would require 75 min * 10 = 750 min.&lt;br /&gt;
&lt;br /&gt;
Typically, haplotype quality improves rapidly with the number of states but only slowly with the number of rounds. We recommend running ~20 rounds of the MaCH haplotyper and selecting a number of states as high as your patience will allow (but ideally greater than 200).&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes. Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac or minimac2, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac&amp;diff=11544</id>
		<title>Minimac</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac&amp;diff=11544"/>
		<updated>2014-09-11T08:00:03Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Change log */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac&#039;&#039;&#039; is a low memory, computationally efficient implementation of the MaCH algorithm for genotype imputation. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac]] - This page, the main minimac page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac&lt;br /&gt;
&lt;br /&gt;
*[https://imputationserver.sph.umich.edu Imputation server] - We are running imputation (and pre-phasing) for you!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac is available [http://www.sph.umich.edu/csg/cfuchsb/minimac-beta-2013.7.17.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac.src.tgz  from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac should be stamped 2013.7.17 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this beta version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
The current version of minimac comes in two flavours, &amp;lt;code&amp;gt;minimac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
2013.7.17&lt;br /&gt;
&lt;br /&gt;
- minor bug fixes&lt;br /&gt;
&lt;br /&gt;
-- all variants (SNPs, InDels, SVs) in the reference VCF will be imputed - independent from the FILTER column setting&lt;br /&gt;
&lt;br /&gt;
- improved performance (Thanks to David Hinds)&lt;br /&gt;
&lt;br /&gt;
2012.11.16&lt;br /&gt;
&lt;br /&gt;
- minor bug fixes&lt;br /&gt;
&lt;br /&gt;
2012.10.9&lt;br /&gt;
&lt;br /&gt;
- added: improved support for [http://www.shapeit.fr ShapeIT] phased haplotypes&lt;br /&gt;
&lt;br /&gt;
2012.10.3&lt;br /&gt;
&lt;br /&gt;
- added: full support for reference panel based chunking&lt;br /&gt;
&lt;br /&gt;
2012.9.22&lt;br /&gt;
&lt;br /&gt;
- fixed: chunk chromosome bug&lt;br /&gt;
&lt;br /&gt;
2012.8.6 (early adopter)&lt;br /&gt;
&lt;br /&gt;
- added: chromosome X support&lt;br /&gt;
&lt;br /&gt;
2012.3.14&lt;br /&gt;
&lt;br /&gt;
- fixed: problem with --startposition &lt;br /&gt;
&lt;br /&gt;
2012.2.29&lt;br /&gt;
&lt;br /&gt;
- added: VCF support&lt;br /&gt;
&lt;br /&gt;
- added: IDR (Insertion, Deletion, Reference) support&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Pre-phasing ==&lt;br /&gt;
For the pre-phasing step, cost increases quadratically with the number of states and linearly with the number of rounds. The following table provides a simple example.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! States&lt;br /&gt;
! Cost per round&lt;br /&gt;
|- &lt;br /&gt;
| 100 states&lt;br /&gt;
| 3 min&lt;br /&gt;
|- &lt;br /&gt;
| 200 states&lt;br /&gt;
| 12 min = (3 min * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 400 states&lt;br /&gt;
| 48 min = (3 min * 4&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 500 states&lt;br /&gt;
| 75 min = (3 min * 5&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, in this case running haplotyping with 500 states and 10 rounds would require 75 min * 10 = 750 min.&lt;br /&gt;
&lt;br /&gt;
Typically, haplotype quality improves rapidly with the number of states but only slowly with the number of rounds. We recommend running ~20 rounds of the MaCH haplotyper and selecting a number of states as high as your patience will allow (but ideally greater than 200).&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 100 haplotypes. Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, we current recommend using [[MaCH]] with the --phase command line option. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
We recommend that, if at all possible, you should phase your chromosomes according to NCBI build 37. Future releases of the 1000 Genomes Reference panel and other public sets of reference haplotypes are expected to use this genome build.&lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
==== NCBI build 36 / NCBI build 37 ====&lt;br /&gt;
The 1000G June reference panel is on build 36, future 1000G reference panels will be on build 37. This has also some impact on the pre-phasing:&lt;br /&gt;
some SNPs will ordered differently in each genome build (we expect order will be more accurate in more recent builds!). Purists will claim that imputation using NCBI build 36 and NCBI build 37 reference panels requires phasing using the exact same reference panel -- others will claim this makes little difference.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
==== using a MaCH reference panel  ====&lt;br /&gt;
&lt;br /&gt;
  minimac --refHaps ref.hap.gz --refSnps ref.snps.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page]. As of this writing, the most recent set of haplotypes are based on genotype calls were generated in May 2011 and are an interim analysis of Project&#039;s Phase I data.&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If the combination of MaCH and Minimac still runs too slowly for you, and you have access to a multi-processor compute cluster, you can look at [[ChunkChromosome]] page to learn how to conveniently split each chromosome into multiple segments that can be analyzed in parallel. For information on how to put the resulting chunks back together, see [[Ligate Minimac|this page]].&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac&amp;diff=11543</id>
		<title>Minimac</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac&amp;diff=11543"/>
		<updated>2014-09-11T07:59:24Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Change log */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac&#039;&#039;&#039; is a low memory, computationally efficient implementation of the MaCH algorithm for genotype imputation. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac]] - This page, the main minimac page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac&lt;br /&gt;
&lt;br /&gt;
*[https://imputationserver.sph.umich.edu Imputation server] - We are running imputation (and pre-phasing) for you!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac is available [http://www.sph.umich.edu/csg/cfuchsb/minimac-beta-2013.7.17.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac.src.tgz  from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac should be stamped 2013.7.17 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this beta version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
The current version of minimac comes in two flavours, &amp;lt;code&amp;gt;minimac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
2013.7.17&lt;br /&gt;
&lt;br /&gt;
- minor bug fixes&lt;br /&gt;
&lt;br /&gt;
-- all variants (SNPs, InDels, SVs) in the reference VCF will be imputed - independent from the FILTER column setting&lt;br /&gt;
&lt;br /&gt;
-- improved performance&lt;br /&gt;
&lt;br /&gt;
2012.11.16&lt;br /&gt;
&lt;br /&gt;
- minor bug fixes&lt;br /&gt;
&lt;br /&gt;
2012.10.9&lt;br /&gt;
&lt;br /&gt;
- added: improved support for [http://www.shapeit.fr ShapeIT] phased haplotypes&lt;br /&gt;
&lt;br /&gt;
2012.10.3&lt;br /&gt;
&lt;br /&gt;
- added: full support for reference panel based chunking&lt;br /&gt;
&lt;br /&gt;
2012.9.22&lt;br /&gt;
&lt;br /&gt;
- fixed: chunk chromosome bug&lt;br /&gt;
&lt;br /&gt;
2012.8.6 (early adopter)&lt;br /&gt;
&lt;br /&gt;
- added: chromosome X support&lt;br /&gt;
&lt;br /&gt;
2012.3.14&lt;br /&gt;
&lt;br /&gt;
- fixed: problem with --startposition &lt;br /&gt;
&lt;br /&gt;
2012.2.29&lt;br /&gt;
&lt;br /&gt;
- added: VCF support&lt;br /&gt;
&lt;br /&gt;
- added: IDR (Insertion, Deletion, Reference) support&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Pre-phasing ==&lt;br /&gt;
For the pre-phasing step, cost increases quadratically with the number of states and linearly with the number of rounds. The following table provides a simple example.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! States&lt;br /&gt;
! Cost per round&lt;br /&gt;
|- &lt;br /&gt;
| 100 states&lt;br /&gt;
| 3 min&lt;br /&gt;
|- &lt;br /&gt;
| 200 states&lt;br /&gt;
| 12 min = (3 min * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 400 states&lt;br /&gt;
| 48 min = (3 min * 4&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 500 states&lt;br /&gt;
| 75 min = (3 min * 5&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, in this case running haplotyping with 500 states and 10 rounds would require 75 min * 10 = 750 min.&lt;br /&gt;
&lt;br /&gt;
Typically, haplotype quality improves rapidly with the number of states but only slowly with the number of rounds. We recommend running ~20 rounds of the MaCH haplotyper and selecting a number of states as high as your patience will allow (but ideally greater than 200).&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 100 haplotypes. Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, we current recommend using [[MaCH]] with the --phase command line option. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
We recommend that, if at all possible, you should phase your chromosomes according to NCBI build 37. Future releases of the 1000 Genomes Reference panel and other public sets of reference haplotypes are expected to use this genome build.&lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
==== NCBI build 36 / NCBI build 37 ====&lt;br /&gt;
The 1000G June reference panel is on build 36, future 1000G reference panels will be on build 37. This has also some impact on the pre-phasing:&lt;br /&gt;
some SNPs will ordered differently in each genome build (we expect order will be more accurate in more recent builds!). Purists will claim that imputation using NCBI build 36 and NCBI build 37 reference panels requires phasing using the exact same reference panel -- others will claim this makes little difference.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
==== using a MaCH reference panel  ====&lt;br /&gt;
&lt;br /&gt;
  minimac --refHaps ref.hap.gz --refSnps ref.snps.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page]. As of this writing, the most recent set of haplotypes are based on genotype calls were generated in May 2011 and are an interim analysis of Project&#039;s Phase I data.&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If the combination of MaCH and Minimac still runs too slowly for you, and you have access to a multi-processor compute cluster, you can look at [[ChunkChromosome]] page to learn how to conveniently split each chromosome into multiple segments that can be analyzed in parallel. For information on how to put the resulting chunks back together, see [[Ligate Minimac|this page]].&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11542</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11542"/>
		<updated>2014-09-11T07:57:41Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Reference Haplotypes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac.src.tgz  from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac should be stamped  - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
The current version of minimac comes in two flavours, &amp;lt;code&amp;gt;minimac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Pre-phasing ==&lt;br /&gt;
For the pre-phasing step, cost increases quadratically with the number of states and linearly with the number of rounds. The following table provides a simple example.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! States&lt;br /&gt;
! Cost per round&lt;br /&gt;
|- &lt;br /&gt;
| 100 states&lt;br /&gt;
| 3 min&lt;br /&gt;
|- &lt;br /&gt;
| 200 states&lt;br /&gt;
| 12 min = (3 min * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 400 states&lt;br /&gt;
| 48 min = (3 min * 4&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 500 states&lt;br /&gt;
| 75 min = (3 min * 5&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, in this case running haplotyping with 500 states and 10 rounds would require 75 min * 10 = 750 min.&lt;br /&gt;
&lt;br /&gt;
Typically, haplotype quality improves rapidly with the number of states but only slowly with the number of rounds. We recommend running ~20 rounds of the MaCH haplotyper and selecting a number of states as high as your patience will allow (but ideally greater than 200).&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes. Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page].&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11541</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11541"/>
		<updated>2014-09-11T07:56:45Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Estimating Haplotypes for Your Sample */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac.src.tgz  from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac should be stamped  - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
The current version of minimac comes in two flavours, &amp;lt;code&amp;gt;minimac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Pre-phasing ==&lt;br /&gt;
For the pre-phasing step, cost increases quadratically with the number of states and linearly with the number of rounds. The following table provides a simple example.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! States&lt;br /&gt;
! Cost per round&lt;br /&gt;
|- &lt;br /&gt;
| 100 states&lt;br /&gt;
| 3 min&lt;br /&gt;
|- &lt;br /&gt;
| 200 states&lt;br /&gt;
| 12 min = (3 min * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 400 states&lt;br /&gt;
| 48 min = (3 min * 4&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 500 states&lt;br /&gt;
| 75 min = (3 min * 5&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, in this case running haplotyping with 500 states and 10 rounds would require 75 min * 10 = 750 min.&lt;br /&gt;
&lt;br /&gt;
Typically, haplotype quality improves rapidly with the number of states but only slowly with the number of rounds. We recommend running ~20 rounds of the MaCH haplotyper and selecting a number of states as high as your patience will allow (but ideally greater than 200).&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes. Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page]. As of this writing, the most recent set of haplotypes are based on genotype calls were generated in May 2011 and are an interim analysis of Project&#039;s Phase I data.&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11540</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11540"/>
		<updated>2014-09-11T07:56:24Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: /* Estimating Haplotypes for Your Sample */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac.src.tgz  from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac should be stamped  - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
The current version of minimac comes in two flavours, &amp;lt;code&amp;gt;minimac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Pre-phasing ==&lt;br /&gt;
For the pre-phasing step, cost increases quadratically with the number of states and linearly with the number of rounds. The following table provides a simple example.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! States&lt;br /&gt;
! Cost per round&lt;br /&gt;
|- &lt;br /&gt;
| 100 states&lt;br /&gt;
| 3 min&lt;br /&gt;
|- &lt;br /&gt;
| 200 states&lt;br /&gt;
| 12 min = (3 min * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 400 states&lt;br /&gt;
| 48 min = (3 min * 4&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 500 states&lt;br /&gt;
| 75 min = (3 min * 5&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, in this case running haplotyping with 500 states and 10 rounds would require 75 min * 10 = 750 min.&lt;br /&gt;
&lt;br /&gt;
Typically, haplotype quality improves rapidly with the number of states but only slowly with the number of rounds. We recommend running ~20 rounds of the MaCH haplotyper and selecting a number of states as high as your patience will allow (but ideally greater than 200).&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes. Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [[https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page]. As of this writing, the most recent set of haplotypes are based on genotype calls were generated in May 2011 and are an interim analysis of Project&#039;s Phase I data.&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11539</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11539"/>
		<updated>2014-09-11T07:53:50Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac.src.tgz  from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac should be stamped  - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
The current version of minimac comes in two flavours, &amp;lt;code&amp;gt;minimac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Pre-phasing ==&lt;br /&gt;
For the pre-phasing step, cost increases quadratically with the number of states and linearly with the number of rounds. The following table provides a simple example.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! States&lt;br /&gt;
! Cost per round&lt;br /&gt;
|- &lt;br /&gt;
| 100 states&lt;br /&gt;
| 3 min&lt;br /&gt;
|- &lt;br /&gt;
| 200 states&lt;br /&gt;
| 12 min = (3 min * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 400 states&lt;br /&gt;
| 48 min = (3 min * 4&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 500 states&lt;br /&gt;
| 75 min = (3 min * 5&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, in this case running haplotyping with 500 states and 10 rounds would require 75 min * 10 = 750 min.&lt;br /&gt;
&lt;br /&gt;
Typically, haplotype quality improves rapidly with the number of states but only slowly with the number of rounds. We recommend running ~20 rounds of the MaCH haplotyper and selecting a number of states as high as your patience will allow (but ideally greater than 200).&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes. Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, you can use [[MaCH]] with the --phase command line option. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page]. As of this writing, the most recent set of haplotypes are based on genotype calls were generated in May 2011 and are an interim analysis of Project&#039;s Phase I data.&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11538</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11538"/>
		<updated>2014-09-11T07:51:50Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac.src.tgz  from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac should be stamped  - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
The current version of minimac comes in two flavours, &amp;lt;code&amp;gt;minimac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Pre-phasing ==&lt;br /&gt;
For the pre-phasing step, cost increases quadratically with the number of states and linearly with the number of rounds. The following table provides a simple example.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! States&lt;br /&gt;
! Cost per round&lt;br /&gt;
|- &lt;br /&gt;
| 100 states&lt;br /&gt;
| 3 min&lt;br /&gt;
|- &lt;br /&gt;
| 200 states&lt;br /&gt;
| 12 min = (3 min * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 400 states&lt;br /&gt;
| 48 min = (3 min * 4&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 500 states&lt;br /&gt;
| 75 min = (3 min * 5&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, in this case running haplotyping with 500 states and 10 rounds would require 75 min * 10 = 750 min.&lt;br /&gt;
&lt;br /&gt;
Typically, haplotype quality improves rapidly with the number of states but only slowly with the number of rounds. We recommend running ~20 rounds of the MaCH haplotyper and selecting a number of states as high as your patience will allow (but ideally greater than 200).&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 100 haplotypes. Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, we current recommend using [[MaCH]] with the --phase command line option. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page]. As of this writing, the most recent set of haplotypes are based on genotype calls were generated in May 2011 and are an interim analysis of Project&#039;s Phase I data.&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11537</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11537"/>
		<updated>2014-09-11T07:50:21Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac2 is available [  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac.src.tgz  from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac should be stamped  - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
The current version of minimac comes in two flavours, &amp;lt;code&amp;gt;minimac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Pre-phasing ==&lt;br /&gt;
For the pre-phasing step, cost increases quadratically with the number of states and linearly with the number of rounds. The following table provides a simple example.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! States&lt;br /&gt;
! Cost per round&lt;br /&gt;
|- &lt;br /&gt;
| 100 states&lt;br /&gt;
| 3 min&lt;br /&gt;
|- &lt;br /&gt;
| 200 states&lt;br /&gt;
| 12 min = (3 min * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 400 states&lt;br /&gt;
| 48 min = (3 min * 4&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 500 states&lt;br /&gt;
| 75 min = (3 min * 5&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, in this case running haplotyping with 500 states and 10 rounds would require 75 min * 10 = 750 min.&lt;br /&gt;
&lt;br /&gt;
Typically, haplotype quality improves rapidly with the number of states but only slowly with the number of rounds. We recommend running ~20 rounds of the MaCH haplotyper and selecting a number of states as high as your patience will allow (but ideally greater than 200).&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 100 haplotypes. Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, we current recommend using [[MaCH]] with the --phase command line option. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
We recommend that, if at all possible, you should phase your chromosomes according to NCBI build 37. Future releases of the 1000 Genomes Reference panel and other public sets of reference haplotypes are expected to use this genome build.&lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
==== NCBI build 36 / NCBI build 37 ====&lt;br /&gt;
The 1000G June reference panel is on build 36, future 1000G reference panels will be on build 37. This has also some impact on the pre-phasing:&lt;br /&gt;
some SNPs will ordered differently in each genome build (we expect order will be more accurate in more recent builds!). Purists will claim that imputation using NCBI build 36 and NCBI build 37 reference panels requires phasing using the exact same reference panel -- others will claim this makes little difference.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page]. As of this writing, the most recent set of haplotypes are based on genotype calls were generated in May 2011 and are an interim analysis of Project&#039;s Phase I data.&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11536</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11536"/>
		<updated>2014-09-11T07:49:28Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac is available [http://www.sph.umich.edu/csg/cfuchsb/minimac-beta-2013.7.17.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac.src.tgz  from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac should be stamped 2013.7.17 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this beta version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
The current version of minimac comes in two flavours, &amp;lt;code&amp;gt;minimac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Pre-phasing ==&lt;br /&gt;
For the pre-phasing step, cost increases quadratically with the number of states and linearly with the number of rounds. The following table provides a simple example.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! States&lt;br /&gt;
! Cost per round&lt;br /&gt;
|- &lt;br /&gt;
| 100 states&lt;br /&gt;
| 3 min&lt;br /&gt;
|- &lt;br /&gt;
| 200 states&lt;br /&gt;
| 12 min = (3 min * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 400 states&lt;br /&gt;
| 48 min = (3 min * 4&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 500 states&lt;br /&gt;
| 75 min = (3 min * 5&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, in this case running haplotyping with 500 states and 10 rounds would require 75 min * 10 = 750 min.&lt;br /&gt;
&lt;br /&gt;
Typically, haplotype quality improves rapidly with the number of states but only slowly with the number of rounds. We recommend running ~20 rounds of the MaCH haplotyper and selecting a number of states as high as your patience will allow (but ideally greater than 200).&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 100 haplotypes. Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, we current recommend using [[MaCH]] with the --phase command line option. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
We recommend that, if at all possible, you should phase your chromosomes according to NCBI build 37. Future releases of the 1000 Genomes Reference panel and other public sets of reference haplotypes are expected to use this genome build.&lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
==== NCBI build 36 / NCBI build 37 ====&lt;br /&gt;
The 1000G June reference panel is on build 36, future 1000G reference panels will be on build 37. This has also some impact on the pre-phasing:&lt;br /&gt;
some SNPs will ordered differently in each genome build (we expect order will be more accurate in more recent builds!). Purists will claim that imputation using NCBI build 36 and NCBI build 37 reference panels requires phasing using the exact same reference panel -- others will claim this makes little difference.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page]. As of this writing, the most recent set of haplotypes are based on genotype calls were generated in May 2011 and are an interim analysis of Project&#039;s Phase I data.&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11535</id>
		<title>Minimac2</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac2&amp;diff=11535"/>
		<updated>2014-09-11T07:24:42Z</updated>

		<summary type="html">&lt;p&gt;Cfuchsb: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;minimac2&#039;&#039;&#039; is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, &amp;quot;mini&amp;quot;, refers to the modest amount of computational resources it requires. The second, &amp;quot;mac&amp;quot;, is short hand for [[MaCH]], our widely used algorithm for genotype imputation.&lt;br /&gt;
&lt;br /&gt;
There are several minimac(2) related pages on this wiki. The major ones are:&lt;br /&gt;
&lt;br /&gt;
* [[Minimac2]] - This page, the main minimac2 page.&lt;br /&gt;
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.&lt;br /&gt;
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)&lt;br /&gt;
* [[Minimac Command Reference]] - Summary of minimac(2) options&lt;br /&gt;
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)&lt;br /&gt;
&lt;br /&gt;
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
A binary Linux (64 bit) version of minimac is available [http://www.sph.umich.edu/csg/cfuchsb/minimac-beta-2013.7.17.tgz  from here] and source code [http://www.sph.umich.edu/csg/cfuchsb/minimac.src.tgz  from here]&lt;br /&gt;
&lt;br /&gt;
The current version of minimac should be stamped 2013.7.17 - if your version shows a different version number or date stamp when it runs, it is not current. &lt;br /&gt;
&lt;br /&gt;
If you use this beta version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes. &lt;br /&gt;
&lt;br /&gt;
== Multiprocessor Version ==&lt;br /&gt;
&lt;br /&gt;
The current version of minimac comes in two flavours, &amp;lt;code&amp;gt;minimac&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;minimac-omp&amp;lt;/code&amp;gt;. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.&lt;br /&gt;
&lt;br /&gt;
BE AWARE: since this version of minimac runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.&lt;br /&gt;
&lt;br /&gt;
== Change log ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments ==&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Performance =&lt;br /&gt;
&lt;br /&gt;
== Pre-phasing ==&lt;br /&gt;
For the pre-phasing step, cost increases quadratically with the number of states and linearly with the number of rounds. The following table provides a simple example.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! States&lt;br /&gt;
! Cost per round&lt;br /&gt;
|- &lt;br /&gt;
| 100 states&lt;br /&gt;
| 3 min&lt;br /&gt;
|- &lt;br /&gt;
| 200 states&lt;br /&gt;
| 12 min = (3 min * 2&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 400 states&lt;br /&gt;
| 48 min = (3 min * 4&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|- &lt;br /&gt;
| 500 states&lt;br /&gt;
| 75 min = (3 min * 5&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So, in this case running haplotyping with 500 states and 10 rounds would require 75 min * 10 = 750 min.&lt;br /&gt;
&lt;br /&gt;
Typically, haplotype quality improves rapidly with the number of states but only slowly with the number of rounds. We recommend running ~20 rounds of the MaCH haplotyper and selecting a number of states as high as your patience will allow (but ideally greater than 200).&lt;br /&gt;
&lt;br /&gt;
== Imputation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good rule of thumb is that minimac should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 100 haplotypes. Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that. &lt;br /&gt;
&lt;br /&gt;
If you are estimating model parameters at the same time as imputing missing genotypes, you can account for the time needed for parameter estimation with the following formula:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-11}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this updated formula, N&amp;lt;sub&amp;gt;rounds&amp;lt;/sub&amp;gt; represents the number of iterations used for parameter refinement and N&amp;lt;sub&amp;gt;states&amp;lt;/sub&amp;gt; represents the maximum number of reference and target haplotypes considered for each update.&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
&lt;br /&gt;
Using minimac for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice. &lt;br /&gt;
&lt;br /&gt;
== Estimating Haplotypes for Your Sample ==&lt;br /&gt;
&lt;br /&gt;
For the haplotyping step, we current recommend using [[MaCH]] with the --phase command line option. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand. &lt;br /&gt;
&lt;br /&gt;
=== Preparing Your Data ===&lt;br /&gt;
&lt;br /&gt;
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin Tutorial]. &lt;br /&gt;
&lt;br /&gt;
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as &#039;A&#039;, &#039;C&#039;, &#039;G&#039; or &#039;T&#039; (there is no need to use numeric identifiers for each allele). &lt;br /&gt;
&lt;br /&gt;
We recommend that, if at all possible, you should phase your chromosomes according to NCBI build 37. Future releases of the 1000 Genomes Reference panel and other public sets of reference haplotypes are expected to use this genome build.&lt;br /&gt;
&lt;br /&gt;
If figuring out position and strand for each marker seems like hard work, don&#039;t despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.&lt;br /&gt;
&lt;br /&gt;
==== NCBI build 36 / NCBI build 37 ====&lt;br /&gt;
The 1000G June reference panel is on build 36, future 1000G reference panels will be on build 37. This has also some impact on the pre-phasing:&lt;br /&gt;
some SNPs will ordered differently in each genome build (we expect order will be more accurate in more recent builds!). Purists will claim that imputation using NCBI build 36 and NCBI build 37 reference panels requires phasing using the exact same reference panel -- others will claim this makes little difference.&lt;br /&gt;
&lt;br /&gt;
=== Running MaCH ===&lt;br /&gt;
&lt;br /&gt;
A typical MaCH command line to estimate phased haplotypes might look like this:&lt;br /&gt;
&lt;br /&gt;
  mach1 -d sample.dat -p sample.ped --rounds 20 --states 200 --phase --interim 5 --sample 5 --compact&lt;br /&gt;
&lt;br /&gt;
This will request that MaCH estimate haplotypes for your sample, using 20 iterations of its Markov sampler and conditioning each update on up to 200 haplotypes. A summary description of these parameters follows (but for a more complete description, you should go to the MaCH website):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
|style=white-space:nowrap|&amp;lt;code&amp;gt;-d sample.dat&amp;lt;/code&amp;gt;&lt;br /&gt;
| Data file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;-p sample.ped&amp;lt;/code&amp;gt;&lt;br /&gt;
| Pedigree file in [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 20&amp;lt;/code&amp;gt;&lt;br /&gt;
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the &amp;lt;code&amp;gt;--states&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--interim 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that intermediate results should be saved to disk periodically. These will facilitate analyses in case a run doesn&#039;t complete.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--sample 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Request that random (but plausible) sets of haplotypes for each individual should be drawn every 5 iterations. This parameter is optional, but for some rare variant analyses, these alternative haplotypes can be very useful.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--phase&amp;lt;/code&amp;gt; &lt;br /&gt;
| Tell [[MaCH]] to estimate phased haplotypes for each individual.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;--compact&amp;lt;/code&amp;gt;&lt;br /&gt;
| Reduce memory use at the cost of approximately doubling runtime. This option is recommended for most GWAS scale datasets and computing platforms.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Imputation into Phased Haplotypes ==&lt;br /&gt;
&lt;br /&gt;
Imputing genotypes using &#039;&#039;&#039;minimac&#039;&#039;&#039; is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.&lt;br /&gt;
&lt;br /&gt;
=== Creating SNP List File ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Minimac&#039;&#039;&#039; requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:&lt;br /&gt;
&lt;br /&gt;
  cut -f 2 -d &amp;quot; &amp;quot; sample.dat &amp;gt; target.snps&lt;br /&gt;
&lt;br /&gt;
=== Running Minimac ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line might look like this:&lt;br /&gt;
&lt;br /&gt;
==== using a VCF reference panel  ====&lt;br /&gt;
  minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag&lt;br /&gt;
&lt;br /&gt;
==== using a MaCH reference panel  ====&lt;br /&gt;
&lt;br /&gt;
  minimac --refHaps ref.hap.gz --refSnps ref.snps.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results&lt;br /&gt;
&lt;br /&gt;
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|- bgcolor=&amp;quot;lightgray&amp;quot;&lt;br /&gt;
! Parameter &lt;br /&gt;
! Description&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refSnps ref.snps.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| List of SNPs in the reference panel &lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--refHaps ref.hap.gz &amp;lt;/code&amp;gt; &lt;br /&gt;
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page])&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--vcfReference &amp;lt;/code&amp;gt; &lt;br /&gt;
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rs &amp;lt;/code&amp;gt; &lt;br /&gt;
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--snps target.snps.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| SNPs in phased haplotypes. These should largely be a subset of the SNPs in the reference panel.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| Phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--sample target.sample &amp;lt;/code&amp;gt;&lt;br /&gt;
| Sample list in ShapeIT format.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--shape_haps target.hap.gz &amp;lt;/code&amp;gt;&lt;br /&gt;
| ShapeIT phased haplotypes where missing genotypes will be imputed.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--chr 22&amp;lt;/code&amp;gt;&lt;br /&gt;
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--rounds 5&amp;lt;/code&amp;gt;&lt;br /&gt;
| Rounds of optimization for model parameters, which describe population recombination rates and per SNP error rates.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--states 200&amp;lt;/code&amp;gt;&lt;br /&gt;
| Maximum number of reference (or target) haplotypes to be examined during parameter optimization.&lt;br /&gt;
|- &lt;br /&gt;
| &amp;lt;code&amp;gt;--prefix imputed&amp;lt;/code&amp;gt;&lt;br /&gt;
| Optionally, a string that is used to help generate output file names.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reference Haplotypes ===&lt;br /&gt;
&lt;br /&gt;
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://www.sph.umich.edu/csg/abecasis/MACH/download/ MaCH download page]. As of this writing, the most recent set of haplotypes are based on genotype calls were generated in May 2011 and are an interim analysis of Project&#039;s Phase I data.&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:&lt;br /&gt;
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren&#039;t typed). &lt;br /&gt;
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped. &lt;br /&gt;
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes. &lt;br /&gt;
&lt;br /&gt;
These statistics can be found in the .info file&lt;br /&gt;
&lt;br /&gt;
=== Additional Sources of Information ===&lt;br /&gt;
&lt;br /&gt;
If the combination of MaCH and Minimac still runs too slowly for you, and you have access to a multi-processor compute cluster, you can look at [[ChunkChromosome]] page to learn how to conveniently split each chromosome into multiple segments that can be analyzed in parallel. For information on how to put the resulting chunks back together, see [[Ligate Minimac|this page]].&lt;br /&gt;
&lt;br /&gt;
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].&lt;br /&gt;
&lt;br /&gt;
== X Chromosome Imputation ==&lt;br /&gt;
minimac supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).&lt;br /&gt;
&lt;br /&gt;
# Split the X chromosome pedigree file by sex.&lt;br /&gt;
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac).&lt;br /&gt;
## For males&lt;br /&gt;
### Remove the pseudo-autosomal part (for build hg18: chrX:1-2709520 and chrX:154584238-154913754 ; for build hg19 chrX:60001-2699520 and chrX:154931044-155260560)&lt;br /&gt;
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  &amp;quot;0&amp;quot; or &amp;quot;.&amp;quot; or &amp;quot;N&amp;quot; ) and impute using minimac as described above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of a male only pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
:::: FAM1003   ID1234  0   0   M   A/A   A/A   C/C&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/G&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of pedigree file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::: &#039;&#039;Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;Example of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO1 AAC&lt;br /&gt;
::::  FAM1003-&amp;gt;ID1234 HAPLO2 AAC&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO1 0CG&lt;br /&gt;
::::  FAM1004-&amp;gt;ID5678 HAPLO2 0CG&lt;br /&gt;
::::  ...&lt;br /&gt;
::::  &#039;&#039;&#039;&amp;lt;End of the corresponding haplotype file&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Post-imputation Association Analysis =&lt;br /&gt;
== Quantitative Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].&lt;br /&gt;
&lt;br /&gt;
== Binary Traits ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.&lt;br /&gt;
&lt;br /&gt;
= Reference =&lt;br /&gt;
&lt;br /&gt;
If you use minimac, please cite: &lt;br /&gt;
&lt;br /&gt;
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.&lt;br /&gt;
Fast and accurate genotype imputation in genome-wide association studies&lt;br /&gt;
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]&lt;br /&gt;
&lt;br /&gt;
= Questions and Comments =&lt;br /&gt;
&lt;br /&gt;
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].&lt;br /&gt;
&lt;br /&gt;
= Related Pages =&lt;br /&gt;
&lt;br /&gt;
If you are looking to learn about small computers made by Apple, Inc., you have come to the wrong page. Try looking at http://www.apple.com/macmini/, instead.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a low calorie version of the Big Mac sandwich, you&#039;ll be sad to know the Mini Mac has been discontinued. However, you are not the only one who likes the idea of a Mini Mac and you&#039;ll probably find some company on the web [http://mcchronicles.blogspot.com/2009/08/mini-mac-experiment-searching-for-big.html].&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Cfuchsb</name></author>
	</entry>
</feed>