<?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=Ylwtx</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=Ylwtx"/>
	<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/wiki/Special:Contributions/Ylwtx"/>
	<updated>2026-09-26T19:56:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Mach2dat:_Association_with_MACH_output&amp;diff=6399</id>
		<title>Mach2dat: Association with MACH output</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Mach2dat:_Association_with_MACH_output&amp;diff=6399"/>
		<updated>2013-02-06T02:12:43Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Association  with MACH output ==&lt;br /&gt;
&lt;br /&gt;
After you have performed the imputation, you can directly use MACH output to assess association for quantitative and qualitative traits in unrelated.&lt;br /&gt;
&lt;br /&gt;
You will need the  *.ped and *.dat files in Merlin format[http://www.sph.umich.edu/csg/abecasis/merlin/tour/input_files.html] to specify the disesase status or quantitative trait of interest (indicated with A and T respectively in the dat file).&lt;br /&gt;
&lt;br /&gt;
Then, you can run the association using the following command line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   mach2dat -p myfile.ped -d myfile.dat --infofile myfile.mlinfo --dosefile  myfile.mldose&lt;br /&gt;
&lt;br /&gt;
where myfile.mlinfo and myfile.mldose are the MACH output files. &lt;br /&gt;
&lt;br /&gt;
You can also add covariates to the phenotype *ped and *dat files if you want to adjust your test for other variables. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Please note that mach2dat analyze only unrelated samples. If you input a pedigree with family relationship, those will be ignored. &lt;br /&gt;
&lt;br /&gt;
If you have family data, you can use merlin-offline [http://www.sph.umich.edu/csg/abecasis/merlin/index.html]&lt;br /&gt;
&lt;br /&gt;
== where to download ==&lt;br /&gt;
Please go to Li software page [http://www.unc.edu/~yunmli/software.html] for the latest version.&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=4855</id>
		<title>Thunder</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=4855"/>
		<updated>2012-05-16T11:56:13Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents how to perform variant calling from low-coverage sequencing data using glfmultiples and thunder. The pipeline was originally developed by [mailto:yunli@med.unc.edu Yun Li] and for [mailto:goncalo@umich.edu Goncalo Abecasis] the 1000 Genomes Low Coverage Pilot Project. &lt;br /&gt;
&lt;br /&gt;
== Input Data  ==&lt;br /&gt;
&lt;br /&gt;
To get started, you will need glf files in the standard format [http://samtools.sourceforge.net/SAM1.pdf glf format]. Sample files are available at [ftp://share.sph.umich.edu/1000genomes/pilot1/examples/glf.tgz sample glf files]. &lt;br /&gt;
&lt;br /&gt;
If you do not have glf files, you can generate them from bam files (bam format also specified in [http://samtools.sourceforge.net/SAM1.pdf glf format bam format]) using the following command line: &lt;br /&gt;
&lt;br /&gt;
  samtools pileup -g -T 1 -f ref.fa my.bam &amp;amp;gt; my.glf&lt;br /&gt;
&lt;br /&gt;
Note: you will need the reference fasta file ref.fa to create glf file from bam file.&lt;br /&gt;
&lt;br /&gt;
== How to Run  ==&lt;br /&gt;
&lt;br /&gt;
This variant calling pipeline has two steps. (step 1) promotion of a set of potential polymorphisms; and (step 2) genotype/haplotype calling using LD information. &lt;br /&gt;
&lt;br /&gt;
=== (step 1) Site promotion using software glfMultiples [https://www.sph.umich.edu/csg/yli/GPT_Freq.011.source.tgz GPT_Freq] ===&lt;br /&gt;
&lt;br /&gt;
  GPT_Freq -b my.out -p 0.9 --minDepth 10 --maxDepth 1000 *.glf &lt;br /&gt;
&lt;br /&gt;
minDepth and maxDepth are the cutoffs on total depth (across all individuals). We have found it useful to exclude sites with extremely low and high total depth. Please see Important Filters below.&lt;br /&gt;
&lt;br /&gt;
=== (step 2) Genotype/haplotype calling using thunder [https://www.sph.umich.edu/csg/yli/thunder/thunder.V011.source.tgz thunder_glf_freq] ===&lt;br /&gt;
&lt;br /&gt;
  thunder_glf_freq --shotgun my.out.$chr --detailedInput -r 100 --states 200 --dosage --phase --interim 25 -o my.final.out&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
&lt;br /&gt;
(1) The program thunder used in step 2 is an extension of MaCH, the genotype imputation software we have previously developed. For details regarding the shared options, please check out [http://www.sph.umich.edu/csg/yli/mach/index.html MaCH website] and [http://genome.sph.umich.edu/wiki/Mach MaCH wiki]. &lt;br /&gt;
&lt;br /&gt;
(2) Check out example files and command lines under examples/thunder/ in the thunder package [https://www.sph.umich.edu/csg/yli/thunder/thunder.V011.source.tgz thunder_glf_freq].&lt;br /&gt;
&lt;br /&gt;
== Example Showing the Whole Pipeline ==&lt;br /&gt;
In the thunder [https://www.sph.umich.edu/csg/yli/thunder/thunder.V011.source.tgz thunder_glf_freq] tarball, you can find under example/thunder/ folder, input files extracted from real data and a C-shell script that executes the whole analysis pipeline.&lt;br /&gt;
&lt;br /&gt;
== Ligate Haplotypes ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/ligateHap.V004.tgz ligateHaplotypes].&lt;br /&gt;
&lt;br /&gt;
== Important Filters ==&lt;br /&gt;
&lt;br /&gt;
We have found that the following filters are helpful.&lt;br /&gt;
&lt;br /&gt;
=== allelic imbalance ===&lt;br /&gt;
A statistic developed by Dr. Tom Blackwell [http://genome.sph.umich.edu/wiki/Genotype_Likelihood_Based_Allele_Balance allelic imbalance]. &lt;br /&gt;
&lt;br /&gt;
=== indel filter ===&lt;br /&gt;
We recommend distance to known indels &amp;gt;= 5bp. A catalog of known indels can be found at [ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/pilot_data/release/2010_07/low_coverage/indels/ indel catalog].&lt;br /&gt;
&lt;br /&gt;
=== site promotion filter ===&lt;br /&gt;
We recommend setting parameter -p at least &amp;gt;= 0.9 in step 1 (running glfMultiples).&lt;br /&gt;
&lt;br /&gt;
=== strand bias filter ===&lt;br /&gt;
&lt;br /&gt;
=== total depth filter ===&lt;br /&gt;
For the 1000 Genomes Project (average depth per individual ~4X), we have found it useful to exclude sites with average total depth per individual &amp;lt; 0.5X or &amp;gt; 20X.&lt;br /&gt;
&lt;br /&gt;
=== coverage filter ===&lt;br /&gt;
We recommend the filter of &amp;gt;50% individuals with coverage.&lt;br /&gt;
&lt;br /&gt;
=== flanking sequence filter ===&lt;br /&gt;
We recommend excluding sites with &amp;gt;0.1% flanking 10-mer frequency among candidate sites. samtools calmd -br performs this base quality re-calibration.&lt;br /&gt;
&lt;br /&gt;
== Citation ==&lt;br /&gt;
Li Y, Sidore C, Kang HM, Boehnke M, Abecasis GR. Low-coverage sequencing: Implications for design of complex trait association studies. &amp;lt;em&amp;gt;Genome Res.&amp;lt;/em&amp;gt; 2011 Jun;21(6):940-51. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inference with External Reference ==&lt;br /&gt;
&lt;br /&gt;
Please refer to [http://genome.sph.umich.edu/wiki/UMAKE UMAKE]. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4820</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4820"/>
		<updated>2012-04-24T20:13:10Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* MaCH-Admix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
&lt;br /&gt;
This is the new 2-step procedure we are recommending, particularly considering people that are performing imputation multiple times (using HapMap as reference, or using updated releases of the 1000 Genomes data as reference). &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is a pre-phasing step using MaCH. This step does not need external reference. This is a time-consuming step BUT is a one-time investment. For computational reason, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]) for this step. In general, we recommend &amp;gt;500Kb overlapping region on each side. For example, for Affymetrix 6.0 panel, if we use core region of 10Mb and flanking/overlapping region of 1Mb on each side, it will correspond to ~3500 SNps in the core region and ~350 SNPs on each side. For 2000 individuals, one job with ~4,200 SNPs running with --states 200 and -r 50, this would take ~40 hours. For other combinations, using the following link to estimate computing time [http://www.sph.umich.edu/csg/yli/MaCH-Admix/runtime.php#est runtime estimate]. &amp;lt;br&amp;gt;&lt;br /&gt;
The second step is the actual imputation step using minimac. This step can run on whole chromosomes. Regarding computing time, one million markers for 1000 individuals using 100 reference haplotypes takes ~ 1 hour; and computing time increases linearly with all the above three parameters. See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== MaCH-Admix ===&lt;br /&gt;
&lt;br /&gt;
If you are doing imputation only a few (&amp;lt;5) times (think twice if this is really true) or under an immediate time pressure, you can use MaCH-Admix, which does not require pre-phased data and takes ~1/7 of the computing time of that typically needed for pre-phasing. For large dataset, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]). Details see [http://www.unc.edu/~yunmli/MaCH-Admix/ MaCH-Admix].&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://genome.sph.umich.edu/wiki/CalcMatch CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest?  ==&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to extract regional pedigree files for your own samples because SNPs in pedigree but not in reference will be automatically discarded. &amp;lt;br&amp;gt; 1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt; 2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then, under csh:&lt;br /&gt;
 @ first = `grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
 @ last = `grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
under bash:&lt;br /&gt;
 first=`grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
 last=`grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Then find out the field that contains the actual haplotypes, where alleles are separated by whitespace&lt;br /&gt;
  head -1 orig.hap | wc -w&lt;br /&gt;
Note: if the haplotypes are gz compressed, do:&lt;br /&gt;
  zcat orig.hap.gz | head -1 | wc -w&lt;br /&gt;
&lt;br /&gt;
* Finally (say you got 3 from the above wc -w command. If you got other numbers, replace the 3 in bold below with the number you got):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $&#039;&#039;&#039;3&#039;&#039;&#039;}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
Note: if the haplotypes are gz compressed, do:&lt;br /&gt;
  zcat orig.hap.gz | awk &#039;{print $&#039;&#039;&#039;3&#039;&#039;&#039;}&#039; | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order.&lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCH ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4819</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4819"/>
		<updated>2012-04-24T20:12:33Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* MaCH-Admix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
&lt;br /&gt;
This is the new 2-step procedure we are recommending, particularly considering people that are performing imputation multiple times (using HapMap as reference, or using updated releases of the 1000 Genomes data as reference). &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is a pre-phasing step using MaCH. This step does not need external reference. This is a time-consuming step BUT is a one-time investment. For computational reason, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]) for this step. In general, we recommend &amp;gt;500Kb overlapping region on each side. For example, for Affymetrix 6.0 panel, if we use core region of 10Mb and flanking/overlapping region of 1Mb on each side, it will correspond to ~3500 SNps in the core region and ~350 SNPs on each side. For 2000 individuals, one job with ~4,200 SNPs running with --states 200 and -r 50, this would take ~40 hours. For other combinations, using the following link to estimate computing time [http://www.sph.umich.edu/csg/yli/MaCH-Admix/runtime.php#est runtime estimate]. &amp;lt;br&amp;gt;&lt;br /&gt;
The second step is the actual imputation step using minimac. This step can run on whole chromosomes. Regarding computing time, one million markers for 1000 individuals using 100 reference haplotypes takes ~ 1 hour; and computing time increases linearly with all the above three parameters. See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== MaCH-Admix ===&lt;br /&gt;
&lt;br /&gt;
If you are doing imputation only once (think twice if this is really true) or under an immediate time pressure, you can use MaCH-Admix, which does not require pre-phased data and takes ~1/7 of the computing time of that typically needed for pre-phasing. For large dataset, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]). Details see [http://www.unc.edu/~yunmli/MaCH-Admix/ MaCH-Admix].&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://genome.sph.umich.edu/wiki/CalcMatch CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest?  ==&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to extract regional pedigree files for your own samples because SNPs in pedigree but not in reference will be automatically discarded. &amp;lt;br&amp;gt; 1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt; 2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then, under csh:&lt;br /&gt;
 @ first = `grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
 @ last = `grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
under bash:&lt;br /&gt;
 first=`grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
 last=`grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Then find out the field that contains the actual haplotypes, where alleles are separated by whitespace&lt;br /&gt;
  head -1 orig.hap | wc -w&lt;br /&gt;
Note: if the haplotypes are gz compressed, do:&lt;br /&gt;
  zcat orig.hap.gz | head -1 | wc -w&lt;br /&gt;
&lt;br /&gt;
* Finally (say you got 3 from the above wc -w command. If you got other numbers, replace the 3 in bold below with the number you got):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $&#039;&#039;&#039;3&#039;&#039;&#039;}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
Note: if the haplotypes are gz compressed, do:&lt;br /&gt;
  zcat orig.hap.gz | awk &#039;{print $&#039;&#039;&#039;3&#039;&#039;&#039;}&#039; | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order.&lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCH ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4740</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4740"/>
		<updated>2012-03-27T19:59:18Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* MaCH-Admix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
&lt;br /&gt;
This is the new 2-step procedure we are recommending, particularly considering people that are performing imputation multiple times (using HapMap as reference, or using updated releases of the 1000 Genomes data as reference). &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is a pre-phasing step using MaCH. This step does not need external reference. This is a time-consuming step BUT is a one-time investment. For computational reason, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]) for this step. In general, we recommend &amp;gt;500Kb overlapping region on each side. For example, for Affymetrix 6.0 panel, if we use core region of 10Mb and flanking/overlapping region of 1Mb on each side, it will correspond to ~3500 SNps in the core region and ~350 SNPs on each side. For 2000 individuals, one job with ~4,200 SNPs running with --states 200 and -r 50, this would take ~40 hours. For other combinations, using the following link to estimate computing time [http://www.sph.umich.edu/csg/yli/MaCH-Admix/runtime.php#est runtime estimate]. &amp;lt;br&amp;gt;&lt;br /&gt;
The second step is the actual imputation step using minimac. This step can run on whole chromosomes. Regarding computing time, one million markers for 1000 individuals using 100 reference haplotypes takes ~ 1 hour; and computing time increases linearly with all the above three parameters. See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== MaCH-Admix ===&lt;br /&gt;
&lt;br /&gt;
If you are doing imputation only once (think twice if this is really true) or under an immediate time pressure, you can use MaCH-Admix, which does not require pre-phased data and takes ~1/7 of the computing time of the original MaCH. For large dataset, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]). Details see [http://www.unc.edu/~yunmli/MaCH-Admix/ MaCH-Admix].&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://genome.sph.umich.edu/wiki/CalcMatch CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest?  ==&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to extract regional pedigree files for your own samples because SNPs in pedigree but not in reference will be automatically discarded. &amp;lt;br&amp;gt; 1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt; 2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then, under csh:&lt;br /&gt;
 @ first = `grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
 @ last = `grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
under bash:&lt;br /&gt;
 first=`grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
 last=`grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Then find out the field that contains the actual haplotypes, where alleles are separated by whitespace&lt;br /&gt;
  head -1 orig.hap | wc -w&lt;br /&gt;
Note: if the haplotypes are gz compressed, do:&lt;br /&gt;
  zcat orig.hap.gz | head -1 | wc -w&lt;br /&gt;
&lt;br /&gt;
* Finally (say you got 3 from the above wc -w command. If you got other numbers, replace the 3 in bold below with the number you got):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $&#039;&#039;&#039;3&#039;&#039;&#039;}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
Note: if the haplotypes are gz compressed, do:&lt;br /&gt;
  zcat orig.hap.gz | awk &#039;{print $&#039;&#039;&#039;3&#039;&#039;&#039;}&#039; | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order.&lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCH ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4739</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4739"/>
		<updated>2012-03-27T19:58:58Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* MaCH-Admix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
&lt;br /&gt;
This is the new 2-step procedure we are recommending, particularly considering people that are performing imputation multiple times (using HapMap as reference, or using updated releases of the 1000 Genomes data as reference). &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is a pre-phasing step using MaCH. This step does not need external reference. This is a time-consuming step BUT is a one-time investment. For computational reason, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]) for this step. In general, we recommend &amp;gt;500Kb overlapping region on each side. For example, for Affymetrix 6.0 panel, if we use core region of 10Mb and flanking/overlapping region of 1Mb on each side, it will correspond to ~3500 SNps in the core region and ~350 SNPs on each side. For 2000 individuals, one job with ~4,200 SNPs running with --states 200 and -r 50, this would take ~40 hours. For other combinations, using the following link to estimate computing time [http://www.sph.umich.edu/csg/yli/MaCH-Admix/runtime.php#est runtime estimate]. &amp;lt;br&amp;gt;&lt;br /&gt;
The second step is the actual imputation step using minimac. This step can run on whole chromosomes. Regarding computing time, one million markers for 1000 individuals using 100 reference haplotypes takes ~ 1 hour; and computing time increases linearly with all the above three parameters. See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== MaCH-Admix ===&lt;br /&gt;
&lt;br /&gt;
If you are doing imputation only once (think twice if this is really true) or under an immediate time pressure, you can use MaCH-Admix, which does not require pre-phased data and takes ~1/7 of the computing time of the original MaCH. For large dataset, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]). Details see [http://www.unc.edu/csg/~yunmli/MaCH-Admix/ MaCH-Admix].&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://genome.sph.umich.edu/wiki/CalcMatch CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest?  ==&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to extract regional pedigree files for your own samples because SNPs in pedigree but not in reference will be automatically discarded. &amp;lt;br&amp;gt; 1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt; 2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then, under csh:&lt;br /&gt;
 @ first = `grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
 @ last = `grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
under bash:&lt;br /&gt;
 first=`grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
 last=`grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Then find out the field that contains the actual haplotypes, where alleles are separated by whitespace&lt;br /&gt;
  head -1 orig.hap | wc -w&lt;br /&gt;
Note: if the haplotypes are gz compressed, do:&lt;br /&gt;
  zcat orig.hap.gz | head -1 | wc -w&lt;br /&gt;
&lt;br /&gt;
* Finally (say you got 3 from the above wc -w command. If you got other numbers, replace the 3 in bold below with the number you got):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $&#039;&#039;&#039;3&#039;&#039;&#039;}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
Note: if the haplotypes are gz compressed, do:&lt;br /&gt;
  zcat orig.hap.gz | awk &#039;{print $&#039;&#039;&#039;3&#039;&#039;&#039;}&#039; | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order.&lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCH ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=4670</id>
		<title>Thunder</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=4670"/>
		<updated>2012-02-23T20:58:18Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents how to perform variant calling from low-coverage sequencing data using glfmultiples and thunder. The pipeline was originally developed by [mailto:yunli@med.unc.edu Yun Li] and for [mailto:goncalo@umich.edu Goncalo Abecasis] the 1000 Genomes Low Coverage Pilot Project. &lt;br /&gt;
&lt;br /&gt;
== Input Data  ==&lt;br /&gt;
&lt;br /&gt;
To get started, you will need glf files in the standard format [http://samtools.sourceforge.net/SAM1.pdf glf format]. Sample files are available at [ftp://share.sph.umich.edu/1000genomes/pilot1/examples/glf.tgz sample glf files]. &lt;br /&gt;
&lt;br /&gt;
If you do not have glf files, you can generate them from bam files (bam format also specified in [http://samtools.sourceforge.net/SAM1.pdf glf format bam format]) using the following command line: &lt;br /&gt;
&lt;br /&gt;
  samtools pileup -g -T 1 -f ref.fa my.bam &amp;amp;gt; my.glf&lt;br /&gt;
&lt;br /&gt;
Note: you will need the reference fasta file ref.fa to create glf file from bam file.&lt;br /&gt;
&lt;br /&gt;
== How to Run  ==&lt;br /&gt;
&lt;br /&gt;
This variant calling pipeline has two steps. (step 1) promotion of a set of potential polymorphisms; and (step 2) genotype/haplotype calling using LD information. &lt;br /&gt;
&lt;br /&gt;
=== (step 1) Site promotion using software glfMultiples [https://www.sph.umich.edu/csg/yli/GPT_Freq.011.source.tgz GPT_Freq] ===&lt;br /&gt;
&lt;br /&gt;
  GPT_Freq -b my.out -p 0.9 --minDepth 10 --maxDepth 1000 *.glf &lt;br /&gt;
&lt;br /&gt;
minDepth and maxDepth are the cutoffs on total depth (across all individuals). We have found it useful to exclude sites with extremely low and high total depth. Please see Important Filters below.&lt;br /&gt;
&lt;br /&gt;
=== (step 2) Genotype/haplotype calling using thunder [https://www.sph.umich.edu/csg/yli/thunder/thunder.V011.source.tgz thunder_glf_freq] ===&lt;br /&gt;
&lt;br /&gt;
  thunder_glf_freq --shotgun my.out.$chr --detailedInput -r 100 --states 200 --dosage --phase --interim 25 -o my.final.out&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
&lt;br /&gt;
(1) The program thunder used in step 2 is an extension of MaCH, the genotype imputation software we have previously developed. For details regarding the shared options, please check out [http://www.sph.umich.edu/csg/yli/mach/index.html MaCH website] and [http://genome.sph.umich.edu/wiki/Mach MaCH wiki]. &lt;br /&gt;
&lt;br /&gt;
(2) Check out example files and command lines under examples/thunder/ in the thunder package [https://www.sph.umich.edu/csg/yli/thunder/thunder.V011.source.tgz thunder_glf_freq].&lt;br /&gt;
&lt;br /&gt;
== Ligate Haplotypes ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/ligateHap.V004.tgz ligateHaplotypes].&lt;br /&gt;
&lt;br /&gt;
== Important Filters ==&lt;br /&gt;
&lt;br /&gt;
We have found that the following filters are helpful.&lt;br /&gt;
&lt;br /&gt;
=== allelic imbalance ===&lt;br /&gt;
A statistic developed by Dr. Tom Blackwell [http://genome.sph.umich.edu/wiki/Genotype_Likelihood_Based_Allele_Balance allelic imbalance]. &lt;br /&gt;
&lt;br /&gt;
=== indel filter ===&lt;br /&gt;
We recommend distance to known indels &amp;gt;= 5bp. A catalog of known indels can be found at [ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/pilot_data/release/2010_07/low_coverage/indels/ indel catalog].&lt;br /&gt;
&lt;br /&gt;
=== site promotion filter ===&lt;br /&gt;
We recommend setting parameter -p at least &amp;gt;= 0.9 in step 1 (running glfMultiples).&lt;br /&gt;
&lt;br /&gt;
=== strand bias filter ===&lt;br /&gt;
&lt;br /&gt;
=== total depth filter ===&lt;br /&gt;
For the 1000 Genomes Project (average depth per individual ~4X), we have found it useful to exclude sites with average total depth per individual &amp;lt; 0.5X or &amp;gt; 20X.&lt;br /&gt;
&lt;br /&gt;
=== coverage filter ===&lt;br /&gt;
We recommend the filter of &amp;gt;50% individuals with coverage.&lt;br /&gt;
&lt;br /&gt;
=== flanking sequence filter ===&lt;br /&gt;
We recommend excluding sites with &amp;gt;0.1% flanking 10-mer frequency among candidate sites. samtools calmd -br performs this base quality re-calibration.&lt;br /&gt;
&lt;br /&gt;
== Citation ==&lt;br /&gt;
Li Y, Sidore C, Kang HM, Boehnke M, Abecasis GR. Low-coverage sequencing: Implications for design of complex trait association studies. &amp;lt;em&amp;gt;Genome Res.&amp;lt;/em&amp;gt; 2011 Jun;21(6):940-51. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inference with External Reference ==&lt;br /&gt;
&lt;br /&gt;
Please refer to [http://genome.sph.umich.edu/wiki/UMAKE UMAKE]. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=4669</id>
		<title>Thunder</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=4669"/>
		<updated>2012-02-23T20:57:50Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* Input Data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents how to perform variant calling from low-coverage sequencing data using glfmultiples and thunder. The pipeline was originally developed by [mailto:yunli@med.unc.edu Yun Li] and for [mailto:goncalo@umich.edu Goncalo Abecasis] the 1000 Genomes Low Coverage Pilot Project. &lt;br /&gt;
&lt;br /&gt;
== Input Data  ==&lt;br /&gt;
&lt;br /&gt;
To get started, you will need glf files in the standard format [http://samtools.sourceforge.net/SAM1.pdf glf format]. Sample files are available at [ftp://share.sph.umich.edu/1000genomes/pilot1/examples/glf.tgz sample glf files]. &lt;br /&gt;
&lt;br /&gt;
If you do not have glf files, you can generate them from bam files (bam format also specified in [http://samtools.sourceforge.net/SAM1.pdf glf format bam format]) using the following command line: &lt;br /&gt;
&lt;br /&gt;
  samtools pileup -g -T 1 -f ref.fa my.bam &amp;amp;gt; my.glf&lt;br /&gt;
&lt;br /&gt;
Note: you will need the reference fasta file ref.fa to create glf file from bam file.&lt;br /&gt;
&lt;br /&gt;
== How to Run  ==&lt;br /&gt;
&lt;br /&gt;
This variant calling pipeline has two steps. (step 1) promotion of a set of potential polymorphisms; and (step 2) genotype/haplotype calling using LD information. &lt;br /&gt;
&lt;br /&gt;
=== (step 1) Site promotion using software glfMultiples [https://www.sph.umich.edu/csg/yli/GPT_Freq.011.source.tgz GPT_Freq] ===&lt;br /&gt;
&lt;br /&gt;
  GPT_Freq -b my.out -p 0.9 --minDepth 10 --maxDepth 1000 *.glf &lt;br /&gt;
&lt;br /&gt;
minDepth and maxDepth are the cutoffs on total depth (across all individuals). We have found it useful to exclude sites with extremely low and high total depth. Please see Important Filters below.&lt;br /&gt;
&lt;br /&gt;
=== (step 2) Genotype/haplotype calling using thunder [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq] ===&lt;br /&gt;
&lt;br /&gt;
  thunder_glf_freq --shotgun my.out.$chr --detailedInput -r 100 --states 200 --dosage --phase --interim 25 -o my.final.out&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
&lt;br /&gt;
(1) The program thunder used in step 2 is an extension of MaCH, the genotype imputation software we have previously developed. For details regarding the shared options, please check out [http://www.sph.umich.edu/csg/yli/mach/index.html MaCH website] and [http://genome.sph.umich.edu/wiki/Mach MaCH wiki]. &lt;br /&gt;
&lt;br /&gt;
(2) Check out example files and command lines under examples/thunder/ in the thunder package [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq].&lt;br /&gt;
&lt;br /&gt;
== Ligate Haplotypes ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/ligateHap.V004.tgz ligateHaplotypes].&lt;br /&gt;
&lt;br /&gt;
== Important Filters ==&lt;br /&gt;
&lt;br /&gt;
We have found that the following filters are helpful.&lt;br /&gt;
&lt;br /&gt;
=== allelic imbalance ===&lt;br /&gt;
A statistic developed by Dr. Tom Blackwell [http://genome.sph.umich.edu/wiki/Genotype_Likelihood_Based_Allele_Balance allelic imbalance]. &lt;br /&gt;
&lt;br /&gt;
=== indel filter ===&lt;br /&gt;
We recommend distance to known indels &amp;gt;= 5bp. A catalog of known indels can be found at [ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/pilot_data/release/2010_07/low_coverage/indels/ indel catalog].&lt;br /&gt;
&lt;br /&gt;
=== site promotion filter ===&lt;br /&gt;
We recommend setting parameter -p at least &amp;gt;= 0.9 in step 1 (running glfMultiples).&lt;br /&gt;
&lt;br /&gt;
=== strand bias filter ===&lt;br /&gt;
&lt;br /&gt;
=== total depth filter ===&lt;br /&gt;
For the 1000 Genomes Project (average depth per individual ~4X), we have found it useful to exclude sites with average total depth per individual &amp;lt; 0.5X or &amp;gt; 20X.&lt;br /&gt;
&lt;br /&gt;
=== coverage filter ===&lt;br /&gt;
We recommend the filter of &amp;gt;50% individuals with coverage.&lt;br /&gt;
&lt;br /&gt;
=== flanking sequence filter ===&lt;br /&gt;
We recommend excluding sites with &amp;gt;0.1% flanking 10-mer frequency among candidate sites. samtools calmd -br performs this base quality re-calibration.&lt;br /&gt;
&lt;br /&gt;
== Citation ==&lt;br /&gt;
Li Y, Sidore C, Kang HM, Boehnke M, Abecasis GR. Low-coverage sequencing: Implications for design of complex trait association studies. &amp;lt;em&amp;gt;Genome Res.&amp;lt;/em&amp;gt; 2011 Jun;21(6):940-51. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inference with External Reference ==&lt;br /&gt;
&lt;br /&gt;
Please refer to [http://genome.sph.umich.edu/wiki/UMAKE UMAKE]. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=4397</id>
		<title>Thunder</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=4397"/>
		<updated>2012-02-02T11:31:46Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* (step 2) Genotype/haplotype calling using thunder thunder_glf_freq */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents how to perform variant calling from low-coverage sequencing data using glfmultiples and thunder. The pipeline was originally developed by [mailto:yunli@med.unc.edu Yun Li] and for [mailto:goncalo@umich.edu Goncalo Abecasis] the 1000 Genomes Low Coverage Pilot Project. &lt;br /&gt;
&lt;br /&gt;
== Input Data  ==&lt;br /&gt;
&lt;br /&gt;
To get started, you will need glf files in the standard format [http://samtools.sourceforge.net/SAM1.pdf glf format]. Sample files are available at [ftp://share.sph.umich.edu/1000genomes/pilot1/examples/glf.tgz sample glf files]. &lt;br /&gt;
&lt;br /&gt;
If you do not have glf files, you can generate them from bam files (bam format also specified in [http://samtools.sourceforge.net/SAM1.pdf glf format bam format]) using the following command line: &lt;br /&gt;
&lt;br /&gt;
  samtools pileup -g -T 1 -f ref.fa my.bam &amp;amp;gt; my.glf&lt;br /&gt;
&lt;br /&gt;
Note: you will need the reference fasta file ref.fa to create glf file from bam file. &lt;br /&gt;
&lt;br /&gt;
== How to Run  ==&lt;br /&gt;
&lt;br /&gt;
This variant calling pipeline has two steps. (step 1) promotion of a set of potential polymorphisms; and (step 2) genotype/haplotype calling using LD information. &lt;br /&gt;
&lt;br /&gt;
=== (step 1) Site promotion using software glfMultiples [https://www.sph.umich.edu/csg/yli/GPT_Freq.011.source.tgz GPT_Freq] ===&lt;br /&gt;
&lt;br /&gt;
  GPT_Freq -b my.out -p 0.9 --minDepth 10 --maxDepth 1000 *.glf &lt;br /&gt;
&lt;br /&gt;
minDepth and maxDepth are the cutoffs on total depth (across all individuals). We have found it useful to exclude sites with extremely low and high total depth. Please see Important Filters below.&lt;br /&gt;
&lt;br /&gt;
=== (step 2) Genotype/haplotype calling using thunder [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq] ===&lt;br /&gt;
&lt;br /&gt;
  thunder_glf_freq --shotgun my.out.$chr --detailedInput -r 100 --states 200 --dosage --phase --interim 25 -o my.final.out&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
&lt;br /&gt;
(1) The program thunder used in step 2 is an extension of MaCH, the genotype imputation software we have previously developed. For details regarding the shared options, please check out [http://www.sph.umich.edu/csg/yli/mach/index.html MaCH website] and [http://genome.sph.umich.edu/wiki/Mach MaCH wiki]. &lt;br /&gt;
&lt;br /&gt;
(2) Check out example files and command lines under examples/thunder/ in the thunder package [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq].&lt;br /&gt;
&lt;br /&gt;
== Ligate Haplotypes ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/ligateHap.V004.tgz ligateHaplotypes].&lt;br /&gt;
&lt;br /&gt;
== Important Filters ==&lt;br /&gt;
&lt;br /&gt;
We have found that the following filters are helpful.&lt;br /&gt;
&lt;br /&gt;
=== allelic imbalance ===&lt;br /&gt;
A statistic developed by Dr. Tom Blackwell [http://genome.sph.umich.edu/wiki/Genotype_Likelihood_Based_Allele_Balance allelic imbalance]. &lt;br /&gt;
&lt;br /&gt;
=== indel filter ===&lt;br /&gt;
We recommend distance to known indels &amp;gt;= 5bp. A catalog of known indels can be found at [ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/pilot_data/release/2010_07/low_coverage/indels/ indel catalog].&lt;br /&gt;
&lt;br /&gt;
=== site promotion filter ===&lt;br /&gt;
We recommend setting parameter -p at least &amp;gt;= 0.9 in step 1 (running glfMultiples).&lt;br /&gt;
&lt;br /&gt;
=== strand bias filter ===&lt;br /&gt;
&lt;br /&gt;
=== total depth filter ===&lt;br /&gt;
For the 1000 Genomes Project (average depth per individual ~4X), we have found it useful to exclude sites with average total depth per individual &amp;lt; 0.5X or &amp;gt; 20X.&lt;br /&gt;
&lt;br /&gt;
=== coverage filter ===&lt;br /&gt;
We recommend the filter of &amp;gt;50% individuals with coverage.&lt;br /&gt;
&lt;br /&gt;
=== flanking sequence filter ===&lt;br /&gt;
We recommend excluding sites with &amp;gt;0.1% flanking 10-mer frequency among candidate sites. samtools calmd -br performs this base quality re-calibration.&lt;br /&gt;
&lt;br /&gt;
== Citation ==&lt;br /&gt;
Li Y, Sidore C, Kang HM, Boehnke M, Abecasis GR. Low-coverage sequencing: Implications for design of complex trait association studies. &amp;lt;em&amp;gt;Genome Res.&amp;lt;/em&amp;gt; 2011 Jun;21(6):940-51. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inference with External Reference ==&lt;br /&gt;
&lt;br /&gt;
Please refer to [http://genome.sph.umich.edu/wiki/UMAKE UMAKE]. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=4396</id>
		<title>Thunder</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=4396"/>
		<updated>2012-02-02T11:31:08Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* (step 2) Genotype/haplotype calling using thunder thunder_glf_freq */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents how to perform variant calling from low-coverage sequencing data using glfmultiples and thunder. The pipeline was originally developed by [mailto:yunli@med.unc.edu Yun Li] and for [mailto:goncalo@umich.edu Goncalo Abecasis] the 1000 Genomes Low Coverage Pilot Project. &lt;br /&gt;
&lt;br /&gt;
== Input Data  ==&lt;br /&gt;
&lt;br /&gt;
To get started, you will need glf files in the standard format [http://samtools.sourceforge.net/SAM1.pdf glf format]. Sample files are available at [ftp://share.sph.umich.edu/1000genomes/pilot1/examples/glf.tgz sample glf files]. &lt;br /&gt;
&lt;br /&gt;
If you do not have glf files, you can generate them from bam files (bam format also specified in [http://samtools.sourceforge.net/SAM1.pdf glf format bam format]) using the following command line: &lt;br /&gt;
&lt;br /&gt;
  samtools pileup -g -T 1 -f ref.fa my.bam &amp;amp;gt; my.glf&lt;br /&gt;
&lt;br /&gt;
Note: you will need the reference fasta file ref.fa to create glf file from bam file. &lt;br /&gt;
&lt;br /&gt;
== How to Run  ==&lt;br /&gt;
&lt;br /&gt;
This variant calling pipeline has two steps. (step 1) promotion of a set of potential polymorphisms; and (step 2) genotype/haplotype calling using LD information. &lt;br /&gt;
&lt;br /&gt;
=== (step 1) Site promotion using software glfMultiples [https://www.sph.umich.edu/csg/yli/GPT_Freq.011.source.tgz GPT_Freq] ===&lt;br /&gt;
&lt;br /&gt;
  GPT_Freq -b my.out -p 0.9 --minDepth 10 --maxDepth 1000 *.glf &lt;br /&gt;
&lt;br /&gt;
minDepth and maxDepth are the cutoffs on total depth (across all individuals). We have found it useful to exclude sites with extremely low and high total depth. Please see Important Filters below.&lt;br /&gt;
&lt;br /&gt;
=== (step 2) Genotype/haplotype calling using thunder [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq] ===&lt;br /&gt;
&lt;br /&gt;
  thunder_glf_freq --shotgun my.out.$chr ----detailedInput -r 100 --states 200 --dosage --phase --interim 25 -o my.final.out&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
&lt;br /&gt;
(1) The program thunder used in step 2 is an extension of MaCH, the genotype imputation software we have previously developed. For details regarding the shared options, please check out [http://www.sph.umich.edu/csg/yli/mach/index.html MaCH website] and [http://genome.sph.umich.edu/wiki/Mach MaCH wiki]. &lt;br /&gt;
&lt;br /&gt;
(2) Check out example files and command lines under examples/thunder/ in the thunder package [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq].&lt;br /&gt;
&lt;br /&gt;
== Ligate Haplotypes ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/ligateHap.V004.tgz ligateHaplotypes].&lt;br /&gt;
&lt;br /&gt;
== Important Filters ==&lt;br /&gt;
&lt;br /&gt;
We have found that the following filters are helpful.&lt;br /&gt;
&lt;br /&gt;
=== allelic imbalance ===&lt;br /&gt;
A statistic developed by Dr. Tom Blackwell [http://genome.sph.umich.edu/wiki/Genotype_Likelihood_Based_Allele_Balance allelic imbalance]. &lt;br /&gt;
&lt;br /&gt;
=== indel filter ===&lt;br /&gt;
We recommend distance to known indels &amp;gt;= 5bp. A catalog of known indels can be found at [ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/pilot_data/release/2010_07/low_coverage/indels/ indel catalog].&lt;br /&gt;
&lt;br /&gt;
=== site promotion filter ===&lt;br /&gt;
We recommend setting parameter -p at least &amp;gt;= 0.9 in step 1 (running glfMultiples).&lt;br /&gt;
&lt;br /&gt;
=== strand bias filter ===&lt;br /&gt;
&lt;br /&gt;
=== total depth filter ===&lt;br /&gt;
For the 1000 Genomes Project (average depth per individual ~4X), we have found it useful to exclude sites with average total depth per individual &amp;lt; 0.5X or &amp;gt; 20X.&lt;br /&gt;
&lt;br /&gt;
=== coverage filter ===&lt;br /&gt;
We recommend the filter of &amp;gt;50% individuals with coverage.&lt;br /&gt;
&lt;br /&gt;
=== flanking sequence filter ===&lt;br /&gt;
We recommend excluding sites with &amp;gt;0.1% flanking 10-mer frequency among candidate sites. samtools calmd -br performs this base quality re-calibration.&lt;br /&gt;
&lt;br /&gt;
== Citation ==&lt;br /&gt;
Li Y, Sidore C, Kang HM, Boehnke M, Abecasis GR. Low-coverage sequencing: Implications for design of complex trait association studies. &amp;lt;em&amp;gt;Genome Res.&amp;lt;/em&amp;gt; 2011 Jun;21(6):940-51. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inference with External Reference ==&lt;br /&gt;
&lt;br /&gt;
Please refer to [http://genome.sph.umich.edu/wiki/UMAKE UMAKE]. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4217</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4217"/>
		<updated>2012-01-15T21:38:39Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* How do I get reference files for an region of interest? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
&lt;br /&gt;
This is the new 2-step procedure we are recommending, particularly considering people that are performing imputation multiple times (using HapMap as reference, or using updated releases of the 1000 Genomes data as reference). &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is a pre-phasing step using MaCH. This step does not need external reference. This is a time-consuming step BUT is a one-time investment. For computational reason, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]) for this step. In general, we recommend &amp;gt;500Kb overlapping region on each side. For example, for Affymetrix 6.0 panel, if we use core region of 10Mb and flanking/overlapping region of 1Mb on each side, it will correspond to ~3500 SNps in the core region and ~350 SNPs on each side. For 2000 individuals, one job with ~4,200 SNPs running with --states 200 and -r 50, this would take ~40 hours. For other combinations, using the following link to estimate computing time [http://www.sph.umich.edu/csg/yli/MaCH-Admix/runtime.php#est runtime estimate]. &amp;lt;br&amp;gt;&lt;br /&gt;
The second step is the actual imputation step using minimac. This step can run on whole chromosomes. Regarding computing time, one million markers for 1000 individuals using 100 reference haplotypes takes ~ 1 hour; and computing time increases linearly with all the above three parameters. See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== MaCH-Admix ===&lt;br /&gt;
&lt;br /&gt;
If you are doing imputation only once (think twice if this is really true) or under an immediate time pressure, you can use MaCH-Admix, which does not require pre-phased data and takes ~1/7 of the computing time of the original MaCH. For large dataset, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]). Details see [http://www.sph.umich.edu/csg/yli/MaCH-Admix/ MaCH-Admix].&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://genome.sph.umich.edu/wiki/CalcMatch CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest?  ==&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to extract regional pedigree files for your own samples because SNPs in pedigree but not in reference will be automatically discarded. &amp;lt;br&amp;gt; 1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt; 2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then, under csh:&lt;br /&gt;
 @ first = `grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
 @ last = `grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
under bash:&lt;br /&gt;
 first=`grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
 last=`grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Then find out the field that contains the actual haplotypes, where alleles are separated by whitespace&lt;br /&gt;
  head -1 orig.hap | wc -w&lt;br /&gt;
Note: if the haplotypes are gz compressed, do:&lt;br /&gt;
  zcat orig.hap.gz | head -1 | wc -w&lt;br /&gt;
&lt;br /&gt;
* Finally (say you got 3 from the above wc -w command. If you got other numbers, replace the 3 in bold below with the number you got):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $&#039;&#039;&#039;3&#039;&#039;&#039;}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
Note: if the haplotypes are gz compressed, do:&lt;br /&gt;
  zcat orig.hap.gz | awk &#039;{print $&#039;&#039;&#039;3&#039;&#039;&#039;}&#039; | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order.&lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCH ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4216</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4216"/>
		<updated>2012-01-15T21:38:22Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* How do I get reference files for an region of interest? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
&lt;br /&gt;
This is the new 2-step procedure we are recommending, particularly considering people that are performing imputation multiple times (using HapMap as reference, or using updated releases of the 1000 Genomes data as reference). &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is a pre-phasing step using MaCH. This step does not need external reference. This is a time-consuming step BUT is a one-time investment. For computational reason, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]) for this step. In general, we recommend &amp;gt;500Kb overlapping region on each side. For example, for Affymetrix 6.0 panel, if we use core region of 10Mb and flanking/overlapping region of 1Mb on each side, it will correspond to ~3500 SNps in the core region and ~350 SNPs on each side. For 2000 individuals, one job with ~4,200 SNPs running with --states 200 and -r 50, this would take ~40 hours. For other combinations, using the following link to estimate computing time [http://www.sph.umich.edu/csg/yli/MaCH-Admix/runtime.php#est runtime estimate]. &amp;lt;br&amp;gt;&lt;br /&gt;
The second step is the actual imputation step using minimac. This step can run on whole chromosomes. Regarding computing time, one million markers for 1000 individuals using 100 reference haplotypes takes ~ 1 hour; and computing time increases linearly with all the above three parameters. See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== MaCH-Admix ===&lt;br /&gt;
&lt;br /&gt;
If you are doing imputation only once (think twice if this is really true) or under an immediate time pressure, you can use MaCH-Admix, which does not require pre-phased data and takes ~1/7 of the computing time of the original MaCH. For large dataset, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]). Details see [http://www.sph.umich.edu/csg/yli/MaCH-Admix/ MaCH-Admix].&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://genome.sph.umich.edu/wiki/CalcMatch CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest?  ==&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to extract regional pedigree files for your own samples because SNPs in pedigree but not in reference will be automatically discarded. &amp;lt;br&amp;gt; 1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt; 2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then, under csh:&lt;br /&gt;
  @ first = `grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
 @ last = `grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
under bash:&lt;br /&gt;
  first=`grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
 last=`grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Then find out the field that contains the actual haplotypes, where alleles are separated by whitespace&lt;br /&gt;
  head -1 orig.hap | wc -w&lt;br /&gt;
Note: if the haplotypes are gz compressed, do:&lt;br /&gt;
  zcat orig.hap.gz | head -1 | wc -w&lt;br /&gt;
&lt;br /&gt;
* Finally (say you got 3 from the above wc -w command. If you got other numbers, replace the 3 in bold below with the number you got):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $&#039;&#039;&#039;3&#039;&#039;&#039;}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
Note: if the haplotypes are gz compressed, do:&lt;br /&gt;
  zcat orig.hap.gz | awk &#039;{print $&#039;&#039;&#039;3&#039;&#039;&#039;}&#039; | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order.&lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCH ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4215</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4215"/>
		<updated>2012-01-13T21:38:09Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* MaCH-Admix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
&lt;br /&gt;
This is the new 2-step procedure we are recommending, particularly considering people that are performing imputation multiple times (using HapMap as reference, or using updated releases of the 1000 Genomes data as reference). &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is a pre-phasing step using MaCH. This step does not need external reference. This is a time-consuming step BUT is a one-time investment. For computational reason, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]) for this step. In general, we recommend &amp;gt;500Kb overlapping region on each side. For example, for Affymetrix 6.0 panel, if we use core region of 10Mb and flanking/overlapping region of 1Mb on each side, it will correspond to ~3500 SNps in the core region and ~350 SNPs on each side. For 2000 individuals, one job with ~4,200 SNPs running with --states 200 and -r 50, this would take ~40 hours. For other combinations, using the following link to estimate computing time [http://www.sph.umich.edu/csg/yli/MaCH-Admix/runtime.php#est runtime estimate]. &amp;lt;br&amp;gt;&lt;br /&gt;
The second step is the actual imputation step using minimac. This step can run on whole chromosomes. Regarding computing time, one million markers for 1000 individuals using 100 reference haplotypes takes ~ 1 hour; and computing time increases linearly with all the above three parameters. See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== MaCH-Admix ===&lt;br /&gt;
&lt;br /&gt;
If you are doing imputation only once (think twice if this is really true) or under an immediate time pressure, you can use MaCH-Admix, which does not require pre-phased data and takes ~1/7 of the computing time of the original MaCH. For large dataset, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]). Details see [http://www.sph.umich.edu/csg/yli/MaCH-Admix/ MaCH-Admix].&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://genome.sph.umich.edu/wiki/CalcMatch CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest?  ==&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to extract regional pedigree files for your own samples because SNPs in pedigree but not in reference will be automatically discarded. &amp;lt;br&amp;gt; 1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt; 2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then:&lt;br /&gt;
&lt;br /&gt;
  @ first = `grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
 @ last = `grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Then find out the field that contains the actual haplotypes, where alleles are separated by whitespace&lt;br /&gt;
  head -1 orig.hap | wc -w&lt;br /&gt;
&lt;br /&gt;
* Finally (say you got 3 from the above wc -w command. If you got other numbers, replace the 3 in bold below with the number you got):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $&#039;&#039;&#039;3&#039;&#039;&#039;}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order.&lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCH ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4214</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4214"/>
		<updated>2012-01-13T21:37:46Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* MaCH-Admix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
&lt;br /&gt;
This is the new 2-step procedure we are recommending, particularly considering people that are performing imputation multiple times (using HapMap as reference, or using updated releases of the 1000 Genomes data as reference). &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is a pre-phasing step using MaCH. This step does not need external reference. This is a time-consuming step BUT is a one-time investment. For computational reason, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]) for this step. In general, we recommend &amp;gt;500Kb overlapping region on each side. For example, for Affymetrix 6.0 panel, if we use core region of 10Mb and flanking/overlapping region of 1Mb on each side, it will correspond to ~3500 SNps in the core region and ~350 SNPs on each side. For 2000 individuals, one job with ~4,200 SNPs running with --states 200 and -r 50, this would take ~40 hours. For other combinations, using the following link to estimate computing time [http://www.sph.umich.edu/csg/yli/MaCH-Admix/runtime.php#est runtime estimate]. &amp;lt;br&amp;gt;&lt;br /&gt;
The second step is the actual imputation step using minimac. This step can run on whole chromosomes. Regarding computing time, one million markers for 1000 individuals using 100 reference haplotypes takes ~ 1 hour; and computing time increases linearly with all the above three parameters. See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== MaCH-Admix ===&lt;br /&gt;
&lt;br /&gt;
If you are doing imputation only once (think twice if this is really true) or under an immediate time pressure, you can use MaCH-Admix, which does not require pre-phased data and takes ~1/7 of the computing time of the original MaCH. For large dataset, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]). Details see [www.sph.umich.edu/csg/yli/MaCH-Admix/ MaCH-Admix].&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://genome.sph.umich.edu/wiki/CalcMatch CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest?  ==&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to extract regional pedigree files for your own samples because SNPs in pedigree but not in reference will be automatically discarded. &amp;lt;br&amp;gt; 1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt; 2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then:&lt;br /&gt;
&lt;br /&gt;
  @ first = `grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
 @ last = `grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Then find out the field that contains the actual haplotypes, where alleles are separated by whitespace&lt;br /&gt;
  head -1 orig.hap | wc -w&lt;br /&gt;
&lt;br /&gt;
* Finally (say you got 3 from the above wc -w command. If you got other numbers, replace the 3 in bold below with the number you got):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $&#039;&#039;&#039;3&#039;&#039;&#039;}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order.&lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCH ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4213</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4213"/>
		<updated>2012-01-13T21:37:00Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* MaCH-Admix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
&lt;br /&gt;
This is the new 2-step procedure we are recommending, particularly considering people that are performing imputation multiple times (using HapMap as reference, or using updated releases of the 1000 Genomes data as reference). &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is a pre-phasing step using MaCH. This step does not need external reference. This is a time-consuming step BUT is a one-time investment. For computational reason, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]) for this step. In general, we recommend &amp;gt;500Kb overlapping region on each side. For example, for Affymetrix 6.0 panel, if we use core region of 10Mb and flanking/overlapping region of 1Mb on each side, it will correspond to ~3500 SNps in the core region and ~350 SNPs on each side. For 2000 individuals, one job with ~4,200 SNPs running with --states 200 and -r 50, this would take ~40 hours. For other combinations, using the following link to estimate computing time [http://www.sph.umich.edu/csg/yli/MaCH-Admix/runtime.php#est runtime estimate]. &amp;lt;br&amp;gt;&lt;br /&gt;
The second step is the actual imputation step using minimac. This step can run on whole chromosomes. Regarding computing time, one million markers for 1000 individuals using 100 reference haplotypes takes ~ 1 hour; and computing time increases linearly with all the above three parameters. See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== MaCH-Admix ===&lt;br /&gt;
&lt;br /&gt;
If you are doing imputation only once (think twice if this is really true) or under an immediate time pressure, you can use MaCH-Admix, which does not require pre-phased data and takes ~1/7 of the computing time of the original MaCH. For large dataset, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]). Details see www.sph.umich.edu/csg/yli/MaCH-Admix/&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://genome.sph.umich.edu/wiki/CalcMatch CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest?  ==&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to extract regional pedigree files for your own samples because SNPs in pedigree but not in reference will be automatically discarded. &amp;lt;br&amp;gt; 1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt; 2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then:&lt;br /&gt;
&lt;br /&gt;
  @ first = `grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
 @ last = `grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Then find out the field that contains the actual haplotypes, where alleles are separated by whitespace&lt;br /&gt;
  head -1 orig.hap | wc -w&lt;br /&gt;
&lt;br /&gt;
* Finally (say you got 3 from the above wc -w command. If you got other numbers, replace the 3 in bold below with the number you got):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $&#039;&#039;&#039;3&#039;&#039;&#039;}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order.&lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCH ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4212</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4212"/>
		<updated>2012-01-13T21:36:26Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* minimac */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
&lt;br /&gt;
This is the new 2-step procedure we are recommending, particularly considering people that are performing imputation multiple times (using HapMap as reference, or using updated releases of the 1000 Genomes data as reference). &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is a pre-phasing step using MaCH. This step does not need external reference. This is a time-consuming step BUT is a one-time investment. For computational reason, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]) for this step. In general, we recommend &amp;gt;500Kb overlapping region on each side. For example, for Affymetrix 6.0 panel, if we use core region of 10Mb and flanking/overlapping region of 1Mb on each side, it will correspond to ~3500 SNps in the core region and ~350 SNPs on each side. For 2000 individuals, one job with ~4,200 SNPs running with --states 200 and -r 50, this would take ~40 hours. For other combinations, using the following link to estimate computing time [http://www.sph.umich.edu/csg/yli/MaCH-Admix/runtime.php#est runtime estimate]. &amp;lt;br&amp;gt;&lt;br /&gt;
The second step is the actual imputation step using minimac. This step can run on whole chromosomes. Regarding computing time, one million markers for 1000 individuals using 100 reference haplotypes takes ~ 1 hour; and computing time increases linearly with all the above three parameters. See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== MaCH-Admix ===&lt;br /&gt;
&lt;br /&gt;
If you are doing imputation only once (think twice if this is really true) or under an immediate time pressure, you can use MaCH-Admix, which does not require pre-phased data and takes ~1/7 of the computing time of the original MaCH. For large dataset, we recommend breaking the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]).&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://genome.sph.umich.edu/wiki/CalcMatch CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest?  ==&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to extract regional pedigree files for your own samples because SNPs in pedigree but not in reference will be automatically discarded. &amp;lt;br&amp;gt; 1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt; 2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then:&lt;br /&gt;
&lt;br /&gt;
  @ first = `grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
 @ last = `grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Then find out the field that contains the actual haplotypes, where alleles are separated by whitespace&lt;br /&gt;
  head -1 orig.hap | wc -w&lt;br /&gt;
&lt;br /&gt;
* Finally (say you got 3 from the above wc -w command. If you got other numbers, replace the 3 in bold below with the number you got):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $&#039;&#039;&#039;3&#039;&#039;&#039;}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order.&lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCH ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4099</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4099"/>
		<updated>2011-11-29T20:58:15Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* minimac */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
&lt;br /&gt;
This is the new 2-step procedure we are recommending, particularly considering people that are performing imputation multiple times (using HapMap as reference, or using updated releases of the 1000 Genomes data as reference). &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is a pre-phasing step using MaCH. This step does not need external reference. This is a time-consuming step BUT is a one-time investment. For computational reason, we recommend break the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]) for this step. In general, we recommend &amp;gt;500Kb overlapping region on each side. For example, for Affymetrix 6.0 panel, if we use core region of 10Mb and flanking/overlapping region of 1Mb on each side, it will correspond to ~3500 SNps in the core region and ~350 SNPs on each side. For 2000 individuals, one job with ~4,200 SNPs running with --states 200 and -r 50, this would take ~40 hours. For other combinations, using the following link to estimate computing time [http://www.sph.umich.edu/csg/yli/MaCH-Admix/runtime.php#est runtime estimate]. &amp;lt;br&amp;gt;&lt;br /&gt;
The second step is the actual imputation step using minimac. This step can run on whole chromosomes. Regarding computing time, one million markers for 1000 individuals using 100 reference haplotypes takes ~ 1 hour; and computing time increases linearly with all the above three parameters. See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://genome.sph.umich.edu/wiki/CalcMatch CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest?  ==&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to extract regional pedigree files for your own samples because SNPs in pedigree but not in reference will be automatically discarded. &amp;lt;br&amp;gt; 1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt; 2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then:&lt;br /&gt;
&lt;br /&gt;
  @ first = `grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
 @ last = `grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Then find out the field that contains the actual haplotypes, where alleles are separated by whitespace&lt;br /&gt;
  head -1 orig.hap | wc -w&lt;br /&gt;
&lt;br /&gt;
* Finally (say you got 3 from the above wc -w command. If you got other numbers, replace the 3 in bold below with the number you got):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $&#039;&#039;&#039;3&#039;&#039;&#039;}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order.&lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCH ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4074</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4074"/>
		<updated>2011-11-17T12:24:08Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* How do I get reference files for an region of interest? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
&lt;br /&gt;
This is the procedure we are recommending, particularly considering people that are performing imputation multiple times (using HapMap as reference, or using updated releases of the 1000 Genomes data as reference). &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is a pre-phasing step using MaCH. This step does not need external reference. This is a time-consuming step BUT is a one-time investment. For computational reason, we recommend break the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]) for this step. In general, we recommend &amp;gt;500Kb overlapping region on each side. For example, for Affymetrix 6.0 panel, if we use core region of 10Mb and flanking/overlapping region of 1Mb on each side, it will correspond to ~3500 SNps in the core region and ~350 SNPs on each side. For 2000 individuals, one job with ~4,200 SNPs running with --states 200 and -r 50, this would take ~40 hours. For other combinations, using the following link to estimate computing time [http://www.sph.umich.edu/csg/yli/MaCH-Admix/runtime.php#est runtime estimate]. &amp;lt;br&amp;gt;&lt;br /&gt;
The second step is the actual imputation step using minimac. This step can run on whole chromosomes. Regarding computing time, one million markers for 1000 individuals using 100 reference haplotypes takes ~ 1 hour; and computing time increases linearly with all the above three parameters. See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://genome.sph.umich.edu/wiki/CalcMatch CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest?  ==&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to extract regional pedigree files for your own samples because SNPs in pedigree but not in reference will be automatically discarded. &amp;lt;br&amp;gt; 1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt; 2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then:&lt;br /&gt;
&lt;br /&gt;
  @ first = `grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
 @ last = `grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Then find out the field that contains the actual haplotypes, where alleles are separated by whitespace&lt;br /&gt;
  head -1 orig.hap | wc -w&lt;br /&gt;
&lt;br /&gt;
* Finally (say you got 3 from the above wc -w command. If you got other numbers, replace the 3 in bold below with the number you got):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $&#039;&#039;&#039;3&#039;&#039;&#039;}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order.&lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCH ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4073</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=4073"/>
		<updated>2011-11-17T12:23:09Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* How do I get reference files for an region of interest? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
&lt;br /&gt;
This is the procedure we are recommending, particularly considering people that are performing imputation multiple times (using HapMap as reference, or using updated releases of the 1000 Genomes data as reference). &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is a pre-phasing step using MaCH. This step does not need external reference. This is a time-consuming step BUT is a one-time investment. For computational reason, we recommend break the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]) for this step. In general, we recommend &amp;gt;500Kb overlapping region on each side. For example, for Affymetrix 6.0 panel, if we use core region of 10Mb and flanking/overlapping region of 1Mb on each side, it will correspond to ~3500 SNps in the core region and ~350 SNPs on each side. For 2000 individuals, one job with ~4,200 SNPs running with --states 200 and -r 50, this would take ~40 hours. For other combinations, using the following link to estimate computing time [http://www.sph.umich.edu/csg/yli/MaCH-Admix/runtime.php#est runtime estimate]. &amp;lt;br&amp;gt;&lt;br /&gt;
The second step is the actual imputation step using minimac. This step can run on whole chromosomes. Regarding computing time, one million markers for 1000 individuals using 100 reference haplotypes takes ~ 1 hour; and computing time increases linearly with all the above three parameters. See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://genome.sph.umich.edu/wiki/CalcMatch CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest?  ==&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to extract regional pedigree files for your own samples because SNPs in pedigree but not in reference will be automatically discarded. &amp;lt;br&amp;gt; 1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt; 2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then:&lt;br /&gt;
&lt;br /&gt;
  @ first = `grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
 @ last = `grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Then find out the field that contains the actual haplotypes, where alleles are separated by whitespace&lt;br /&gt;
  head -1 orig.hap | wc -w&lt;br /&gt;
&lt;br /&gt;
* Finally:&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $&#039;&#039;&#039;3&#039;&#039;&#039;}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order.&lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCH ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Mach_DAC&amp;diff=4037</id>
		<title>Mach DAC</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Mach_DAC&amp;diff=4037"/>
		<updated>2011-11-07T19:27:10Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the MaCH Divide and Conquer page, documenting how to break the genome into smaller pieces before imputation/phasing and how to ligate after imputation/phasing.&lt;br /&gt;
&lt;br /&gt;
== Phasing without External Reference ==&lt;br /&gt;
=== Your Data ===&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 Merlin tutorial [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html]. &amp;lt;br&amp;gt;&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). &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Split Your Data ===&lt;br /&gt;
You can split your data using [http://www.sph.umich.edu/csg/yli/splitPed/ splitPed]. If you follow our recommendation of using MaCH+minimac for imputation, you only need to use splitPed in the MaCH step (to phase your study sample), which does not involve external reference. In the minimac step, imputation finishes within a day for several thousand individuals even for the largest chromosome as a whole: 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, see [http://genome.sph.umich.edu/wiki/Minimac#Imputation minimac wiki] for more details.&lt;br /&gt;
&lt;br /&gt;
== Phasing/Imputation with External Reference ==&lt;br /&gt;
When you phase/impute with external reference panel, you will only need to break the reference files into parts containing subsets of markers because SNPs in your own data (pedigree files) but not in reference files will be automatically ignored by MaCH and minimac. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can split the reference data using [http://www.sph.umich.edu/csg/yli/splitRef/ splitRef].&lt;br /&gt;
&lt;br /&gt;
== Post Phasing/Imputation Ligation ==&lt;br /&gt;
You can use [http://www.sph.umich.edu/csg/yli/ligateHap.V004.tgz LigateHaplotypes ] to ligate the parts.&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=4031</id>
		<title>Thunder</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=4031"/>
		<updated>2011-11-03T15:20:28Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents how to perform variant calling from low-coverage sequencing data using glfmultiples and thunder. The pipeline was originally developed by [mailto:yunli@med.unc.edu Yun Li] and for [mailto:goncalo@umich.edu Goncalo Abecasis] the 1000 Genomes Low Coverage Pilot Project. &lt;br /&gt;
&lt;br /&gt;
== Input Data  ==&lt;br /&gt;
&lt;br /&gt;
To get started, you will need glf files in the standard format [http://samtools.sourceforge.net/SAM1.pdf glf format]. Sample files are available at [ftp://share.sph.umich.edu/1000genomes/pilot1/examples/glf.tgz sample glf files]. &lt;br /&gt;
&lt;br /&gt;
If you do not have glf files, you can generate them from bam files (bam format also specified in [http://samtools.sourceforge.net/SAM1.pdf glf format bam format]) using the following command line: &lt;br /&gt;
&lt;br /&gt;
  samtools pileup -g -T 1 -f ref.fa my.bam &amp;amp;gt; my.glf&lt;br /&gt;
&lt;br /&gt;
Note: you will need the reference fasta file ref.fa to create glf file from bam file. &lt;br /&gt;
&lt;br /&gt;
== How to Run  ==&lt;br /&gt;
&lt;br /&gt;
This variant calling pipeline has two steps. (step 1) promotion of a set of potential polymorphisms; and (step 2) genotype/haplotype calling using LD information. &lt;br /&gt;
&lt;br /&gt;
=== (step 1) Site promotion using software glfMultiples [https://www.sph.umich.edu/csg/yli/GPT_Freq.011.source.tgz GPT_Freq] ===&lt;br /&gt;
&lt;br /&gt;
  GPT_Freq -b my.out -p 0.9 --minDepth 10 --maxDepth 1000 *.glf &lt;br /&gt;
&lt;br /&gt;
minDepth and maxDepth are the cutoffs on total depth (across all individuals). We have found it useful to exclude sites with extremely low and high total depth. Please see Important Filters below.&lt;br /&gt;
&lt;br /&gt;
=== (step 2) Genotype/haplotype calling using thunder [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq] ===&lt;br /&gt;
&lt;br /&gt;
  thunder_glf_freq --shotgun my.out.$chr -r 100 --states 200 --dosage --phase --interim 25 -o my.final.out&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
&lt;br /&gt;
(1) The program thunder used in step 2 is an extension of MaCH, the genotype imputation software we have previously developed. For details regarding the shared options, please check out [http://www.sph.umich.edu/csg/yli/mach/index.html MaCH website] and [http://genome.sph.umich.edu/wiki/Mach MaCH wiki]. &lt;br /&gt;
&lt;br /&gt;
(2) Check out example files and command lines under examples/thunder/ in the thunder package [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq]. &lt;br /&gt;
&lt;br /&gt;
== Ligate Haplotypes ==&lt;br /&gt;
Please use [http://www.sph.umich.edu/csg/yli/ligateHap.V004.tgz ligateHaplotypes].&lt;br /&gt;
&lt;br /&gt;
== Important Filters ==&lt;br /&gt;
&lt;br /&gt;
We have found that the following filters are helpful.&lt;br /&gt;
&lt;br /&gt;
=== allelic imbalance ===&lt;br /&gt;
A statistic developed by Dr. Tom Blackwell [http://genome.sph.umich.edu/wiki/Genotype_Likelihood_Based_Allele_Balance allelic imbalance]. &lt;br /&gt;
&lt;br /&gt;
=== indel filter ===&lt;br /&gt;
We recommend distance to known indels &amp;gt;= 5bp. A catalog of known indels can be found at [ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/pilot_data/release/2010_07/low_coverage/indels/ indel catalog].&lt;br /&gt;
&lt;br /&gt;
=== site promotion filter ===&lt;br /&gt;
We recommend setting parameter -p at least &amp;gt;= 0.9 in step 1 (running glfMultiples).&lt;br /&gt;
&lt;br /&gt;
=== strand bias filter ===&lt;br /&gt;
&lt;br /&gt;
=== total depth filter ===&lt;br /&gt;
For the 1000 Genomes Project (average depth per individual ~4X), we have found it useful to exclude sites with average total depth per individual &amp;lt; 0.5X or &amp;gt; 20X.&lt;br /&gt;
&lt;br /&gt;
=== coverage filter ===&lt;br /&gt;
We recommend the filter of &amp;gt;50% individuals with coverage.&lt;br /&gt;
&lt;br /&gt;
=== flanking sequence filter ===&lt;br /&gt;
We recommend excluding sites with &amp;gt;0.1% flanking 10-mer frequency among candidate sites. samtools calmd -br performs this base quality re-calibration.&lt;br /&gt;
&lt;br /&gt;
== Citation ==&lt;br /&gt;
Li Y, Sidore C, Kang HM, Boehnke M, Abecasis GR. Low-coverage sequencing: Implications for design of complex trait association studies. &amp;lt;em&amp;gt;Genome Res.&amp;lt;/em&amp;gt; 2011 Jun;21(6):940-51. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inference with External Reference ==&lt;br /&gt;
&lt;br /&gt;
Please refer to [http://genome.sph.umich.edu/wiki/UMAKE UMAKE]. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=4030</id>
		<title>Thunder</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=4030"/>
		<updated>2011-11-03T15:18:36Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents how to perform variant calling from low-coverage sequencing data using glfmultiples and thunder. The pipeline was originally developed by [mailto:yunli@med.unc.edu Yun Li] and for [mailto:goncalo@umich.edu Goncalo Abecasis] the 1000 Genomes Low Coverage Pilot Project. &lt;br /&gt;
&lt;br /&gt;
== Input Data  ==&lt;br /&gt;
&lt;br /&gt;
To get started, you will need glf files in the standard format [http://samtools.sourceforge.net/SAM1.pdf glf format]. Sample files are available at [ftp://share.sph.umich.edu/1000genomes/pilot1/examples/glf.tgz sample glf files]. &lt;br /&gt;
&lt;br /&gt;
If you do not have glf files, you can generate them from bam files (bam format also specified in [http://samtools.sourceforge.net/SAM1.pdf glf format bam format]) using the following command line: &lt;br /&gt;
&lt;br /&gt;
  samtools pileup -g -T 1 -f ref.fa my.bam &amp;amp;gt; my.glf&lt;br /&gt;
&lt;br /&gt;
Note: you will need the reference fasta file ref.fa to create glf file from bam file. &lt;br /&gt;
&lt;br /&gt;
== How to Run  ==&lt;br /&gt;
&lt;br /&gt;
This variant calling pipeline has two steps. (step 1) promotion of a set of potential polymorphisms; and (step 2) genotype/haplotype calling using LD information. &lt;br /&gt;
&lt;br /&gt;
=== (step 1) Site promotion using software glfMultiples [https://www.sph.umich.edu/csg/yli/GPT_Freq.011.source.tgz GPT_Freq] ===&lt;br /&gt;
&lt;br /&gt;
  GPT_Freq -b my.out -p 0.9 --minDepth 10 --maxDepth 1000 *.glf &lt;br /&gt;
&lt;br /&gt;
minDepth and maxDepth are the cutoffs on total depth (across all individuals). We have found it useful to exclude sites with extremely low and high total depth. Please see Important Filters below.&lt;br /&gt;
&lt;br /&gt;
=== (step 2) Genotype/haplotype calling using thunder [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq] ===&lt;br /&gt;
&lt;br /&gt;
  thunder_glf_freq --shotgun my.out.$chr -r 100 --states 200 --dosage --phase --interim 25 -o my.final.out&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
&lt;br /&gt;
(1) The program thunder used in step 2 is an extension of MaCH, the genotype imputation software we have previously developed. For details regarding the shared options, please check out [http://www.sph.umich.edu/csg/yli/mach/index.html MaCH website] and [http://genome.sph.umich.edu/wiki/Mach MaCH wiki]. &lt;br /&gt;
&lt;br /&gt;
(2) Check out example files and command lines under examples/thunder/ in the thunder package [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq]. &lt;br /&gt;
&lt;br /&gt;
== Important Filters ==&lt;br /&gt;
&lt;br /&gt;
We have found that the following filters are helpful.&lt;br /&gt;
&lt;br /&gt;
=== allelic imbalance ===&lt;br /&gt;
A statistic developed by Dr. Tom Blackwell [http://genome.sph.umich.edu/wiki/Genotype_Likelihood_Based_Allele_Balance allelic imbalance]. &lt;br /&gt;
&lt;br /&gt;
=== indel filter ===&lt;br /&gt;
We recommend distance to known indels &amp;gt;= 5bp. A catalog of known indels can be found at [ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/pilot_data/release/2010_07/low_coverage/indels/ indel catalog].&lt;br /&gt;
&lt;br /&gt;
=== site promotion filter ===&lt;br /&gt;
We recommend setting parameter -p at least &amp;gt;= 0.9 in step 1 (running glfMultiples).&lt;br /&gt;
&lt;br /&gt;
=== strand bias filter ===&lt;br /&gt;
&lt;br /&gt;
=== total depth filter ===&lt;br /&gt;
For the 1000 Genomes Project (average depth per individual ~4X), we have found it useful to exclude sites with average total depth per individual &amp;lt; 0.5X or &amp;gt; 20X.&lt;br /&gt;
&lt;br /&gt;
=== coverage filter ===&lt;br /&gt;
We recommend the filter of &amp;gt;50% individuals with coverage.&lt;br /&gt;
&lt;br /&gt;
=== flanking sequence filter ===&lt;br /&gt;
We recommend excluding sites with &amp;gt;0.1% flanking 10-mer frequency among candidate sites. samtools calmd -br performs this base quality re-calibration.&lt;br /&gt;
&lt;br /&gt;
== Citation ==&lt;br /&gt;
Li Y, Sidore C, Kang HM, Boehnke M, Abecasis GR. Low-coverage sequencing: Implications for design of complex trait association studies. &amp;lt;em&amp;gt;Genome Res.&amp;lt;/em&amp;gt; 2011 Jun;21(6):940-51. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inference with External Reference ==&lt;br /&gt;
&lt;br /&gt;
Please refer to [http://genome.sph.umich.edu/wiki/UMAKE UMAKE]. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=3436</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=3436"/>
		<updated>2011-08-05T00:15:04Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* How do I get reference files for an region of interest? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
&lt;br /&gt;
This is the procedure we are recommending, particularly considering people that are performing imputation multiple times (using HapMap as reference, or using updated releases of the 1000 Genomes data as reference). &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is a pre-phasing step using MaCH. This step does not need external reference. This is a time-consuming step BUT is a one-time investment. For computational reason, we recommend break the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]) for this step. In general, we recommend &amp;gt;500Kb overlapping region on each side. For example, for Affymetrix 6.0 panel, if we use core region of 10Mb and flanking/overlapping region of 1Mb on each side, it will correspond to ~3500 SNps in the core region and ~350 SNPs on each side. For 2000 individuals, one job with ~4,200 SNPs running with --states 200 and -r 50, this would take ~40 hours. For other combinations, using the following link to estimate computing time [http://www.sph.umich.edu/csg/yli/MaCH-Admix/runtime.php#est runtime estimate]. &amp;lt;br&amp;gt;&lt;br /&gt;
The second step is the actual imputation step using minimac. This step can run on whole chromosomes. Regarding computing time, one million markers for 1000 individuals using 100 reference haplotypes takes ~ 1 hour; and computing time increases linearly with all the above three parameters. See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://genome.sph.umich.edu/wiki/CalcMatch CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest? ==&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to extract regional pedigree files for your own samples because SNPs in pedigree but not in reference will be automatically discarded. &amp;lt;br&amp;gt;&lt;br /&gt;
1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt;&lt;br /&gt;
2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then:&lt;br /&gt;
&lt;br /&gt;
  @ first = `grep -nw rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
  @ last = `grep -nw rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Finally (assuming the third field contains the actual haplotypes, where alleles are separated by whitespace):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $3}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order.&lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCH ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=3434</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=3434"/>
		<updated>2011-07-30T01:22:13Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* Do I always have to sort the pedigree file by marker position? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
&lt;br /&gt;
This is the procedure we are recommending, particularly considering people that are performing imputation multiple times (using HapMap as reference, or using updated releases of the 1000 Genomes data as reference). &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is a pre-phasing step using MaCH. This step does not need external reference. This is a time-consuming step BUT is a one-time investment. For computational reason, we recommend break the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]) for this step. In general, we recommend &amp;gt;500Kb overlapping region on each side. For example, for Affymetrix 6.0 panel, if we use core region of 10Mb and flanking/overlapping region of 1Mb on each side, it will correspond to ~3500 SNps in the core region and ~350 SNPs on each side. For 2000 individuals, one job with ~4,200 SNPs running with --states 200 and -r 50, this would take ~40 hours. For other combinations, using the following link to estimate computing time [http://www.sph.umich.edu/csg/yli/MaCH-Admix/runtime.php#est runtime estimate]. &amp;lt;br&amp;gt;&lt;br /&gt;
The second step is the actual imputation step using minimac. This step can run on whole chromosomes. Regarding computing time, one million markers for 1000 individuals using 100 reference haplotypes takes ~ 1 hour; and computing time increases linearly with all the above three parameters. See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://genome.sph.umich.edu/wiki/CalcMatch CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest? ==&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to extract regional pedigree files for your own samples because SNPs in pedigree but not in reference will be automatically discarded. &amp;lt;br&amp;gt;&lt;br /&gt;
1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt;&lt;br /&gt;
2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then:&lt;br /&gt;
&lt;br /&gt;
  @ first = `grep -n rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
  @ last = `grep -n rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Finally (assuming the third field contains the actual haplotypes, where alleles are separated by whitespace):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $3}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order.&lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCH ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=3433</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=3433"/>
		<updated>2011-07-30T01:21:26Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* How do I get reference files for an region of interest? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
&lt;br /&gt;
This is the procedure we are recommending, particularly considering people that are performing imputation multiple times (using HapMap as reference, or using updated releases of the 1000 Genomes data as reference). &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is a pre-phasing step using MaCH. This step does not need external reference. This is a time-consuming step BUT is a one-time investment. For computational reason, we recommend break the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]) for this step. In general, we recommend &amp;gt;500Kb overlapping region on each side. For example, for Affymetrix 6.0 panel, if we use core region of 10Mb and flanking/overlapping region of 1Mb on each side, it will correspond to ~3500 SNps in the core region and ~350 SNPs on each side. For 2000 individuals, one job with ~4,200 SNPs running with --states 200 and -r 50, this would take ~40 hours. For other combinations, using the following link to estimate computing time [http://www.sph.umich.edu/csg/yli/MaCH-Admix/runtime.php#est runtime estimate]. &amp;lt;br&amp;gt;&lt;br /&gt;
The second step is the actual imputation step using minimac. This step can run on whole chromosomes. Regarding computing time, one million markers for 1000 individuals using 100 reference haplotypes takes ~ 1 hour; and computing time increases linearly with all the above three parameters. See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://genome.sph.umich.edu/wiki/CalcMatch CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest? ==&lt;br /&gt;
&lt;br /&gt;
Note that you do not need to extract regional pedigree files for your own samples because SNPs in pedigree but not in reference will be automatically discarded. &amp;lt;br&amp;gt;&lt;br /&gt;
1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt;&lt;br /&gt;
2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then:&lt;br /&gt;
&lt;br /&gt;
  @ first = `grep -n rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
  @ last = `grep -n rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Finally (assuming the third field contains the actual haplotypes, where alleles are separated by whitespace):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $3}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order. **HOWEVER**, you will probably avoid problems by including markers in the pedigree file sorted in chromosome order. &lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCH ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=3378</id>
		<title>Thunder</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=3378"/>
		<updated>2011-07-11T19:29:17Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents how to perform variant calling from low-coverage sequencing data using glfmultiples and thunder. The pipeline was originally developed by [mailto:yunli@med.unc.edu Yun Li] for the 1000 Genomes Low Coverage Pilot Project. &lt;br /&gt;
&lt;br /&gt;
== Input Data  ==&lt;br /&gt;
&lt;br /&gt;
To get started, you will need glf files in the standard format [http://samtools.sourceforge.net/SAM1.pdf glf format]. Sample files are available at [ftp://share.sph.umich.edu/1000genomes/pilot1/examples/glf.tgz sample glf files]. &lt;br /&gt;
&lt;br /&gt;
If you do not have glf files, you can generate them from bam files (bam format also specified in [http://samtools.sourceforge.net/SAM1.pdf glf format bam format]) using the following command line: &lt;br /&gt;
&lt;br /&gt;
  samtools pileup -g -T 1 -f ref.fa my.bam &amp;amp;gt; my.glf&lt;br /&gt;
&lt;br /&gt;
Note: you will need the reference fasta file ref.fa to create glf file from bam file. &lt;br /&gt;
&lt;br /&gt;
== How to Run  ==&lt;br /&gt;
&lt;br /&gt;
This variant calling pipeline has two steps. (step 1) promotion of a set of potential polymorphisms; and (step 2) genotype/haplotype calling using LD information. &lt;br /&gt;
&lt;br /&gt;
=== (step 1) Site promotion using software glfMultiples [https://www.sph.umich.edu/csg/yli/GPT_Freq.011.source.tgz GPT_Freq] ===&lt;br /&gt;
&lt;br /&gt;
  GPT_Freq -b my.out -p 0.9 --minDepth 10 --maxDepth 1000 *.glf &lt;br /&gt;
&lt;br /&gt;
minDepth and maxDepth are the cutoffs on total depth (across all individuals). We have found it useful to exclude sites with extremely low and high total depth. Please see Important Filters below.&lt;br /&gt;
&lt;br /&gt;
=== (step 2) Genotype/haplotype calling using thunder [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq] ===&lt;br /&gt;
&lt;br /&gt;
  thunder_glf_freq --shotgun my.out.$chr -r 100 --states 200 --dosage --phase --interim 25 -o my.final.out&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
&lt;br /&gt;
(1) The program thunder used in step 2 is an extension of MaCH, the genotype imputation software we have previously developed. For details regarding the shared options, please check out [http://www.sph.umich.edu/csg/yli/mach/index.html MaCH website] and [http://genome.sph.umich.edu/wiki/Mach MaCH wiki]. &lt;br /&gt;
&lt;br /&gt;
(2) Check out example files and command lines under examples/thunder/ in the thunder package [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq]. &lt;br /&gt;
&lt;br /&gt;
== Important Filters ==&lt;br /&gt;
&lt;br /&gt;
We have found that the following filters are helpful.&lt;br /&gt;
&lt;br /&gt;
=== allelic imbalance ===&lt;br /&gt;
A statistic developed by Dr. Tom Blackwell [http://genome.sph.umich.edu/wiki/Genotype_Likelihood_Based_Allele_Balance allelic imbalance]. &lt;br /&gt;
&lt;br /&gt;
=== indel filter ===&lt;br /&gt;
We recommend distance to known indels &amp;gt;= 5bp. A catalog of known indels can be found at [ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/pilot_data/release/2010_07/low_coverage/indels/ indel catalog].&lt;br /&gt;
&lt;br /&gt;
=== site promotion filter ===&lt;br /&gt;
We recommend setting parameter -p at least &amp;gt;= 0.9 in step 1 (running glfMultiples).&lt;br /&gt;
&lt;br /&gt;
=== strand bias filter ===&lt;br /&gt;
&lt;br /&gt;
=== total depth filter ===&lt;br /&gt;
For the 1000 Genomes Project (average depth per individual ~4X), we have found it useful to exclude sites with average total depth per individual &amp;lt; 0.5X or &amp;gt; 20X.&lt;br /&gt;
&lt;br /&gt;
=== coverage filter ===&lt;br /&gt;
We recommend the filter of &amp;gt;50% individuals with coverage.&lt;br /&gt;
&lt;br /&gt;
=== flanking sequence filter ===&lt;br /&gt;
We recommend excluding sites with &amp;gt;0.1% flanking 10-mer frequency among candidate sites. samtools calmd -br performs this base quality re-calibration.&lt;br /&gt;
&lt;br /&gt;
== Citation ==&lt;br /&gt;
Li Y, Sidore C, Kang HM, Boehnke M, Abecasis GR. Low-coverage sequencing: Implications for design of complex trait association studies. &amp;lt;em&amp;gt;Genome Res.&amp;lt;/em&amp;gt; 2011 Jun;21(6):940-51. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inference with External Reference ==&lt;br /&gt;
&lt;br /&gt;
Please refer to [http://genome.sph.umich.edu/wiki/UMAKE UMAKE]. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=3260</id>
		<title>Thunder</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=3260"/>
		<updated>2011-06-19T23:07:30Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents how to perform variant calling from low-coverage sequencing data using glfmultiples and thunder. The pipeline was originally developed by [mailto:yunli@med.unc.edu Yun Li] for the 1000 Genomes Low Coverage Pilot Project. &lt;br /&gt;
&lt;br /&gt;
== Input Data  ==&lt;br /&gt;
&lt;br /&gt;
To get started, you will need glf files in the standard format [http://samtools.sourceforge.net/SAM1.pdf glf format]. Sample files are available at [ftp://share.sph.umich.edu/1000genomes/pilot1/examples/glf.tgz sample glf files]. &lt;br /&gt;
&lt;br /&gt;
If you do not have glf files, you can generate them from bam files (bam format also specified in [http://samtools.sourceforge.net/SAM1.pdf glf format bam format]) using the following command line: &lt;br /&gt;
&lt;br /&gt;
  samtools pileup -g -T 1 -f ref.fa my.bam &amp;amp;gt; my.glf&lt;br /&gt;
&lt;br /&gt;
Note: you will need the reference fasta file ref.fa to create glf file from bam file. &lt;br /&gt;
&lt;br /&gt;
== How to Run  ==&lt;br /&gt;
&lt;br /&gt;
This variant calling pipeline has two steps. (step 1) promotion of a set of potential polymorphisms; and (step 2) genotype/haplotype calling using LD information. &lt;br /&gt;
&lt;br /&gt;
=== (step 1) Site promotion using software glfMultiples [https://www.sph.umich.edu/csg/yli/GPT_Freq.011.source.tgz GPT_Freq] ===&lt;br /&gt;
&lt;br /&gt;
  GPT_Freq -b my.out -p 0.9 --minDepth 10 --maxDepth 1000 *.glf &lt;br /&gt;
&lt;br /&gt;
minDepth and maxDepth are the cutoffs on total depth (across all individuals). We have found it useful to exclude sites with extremely low and high total depth. Please see Important Filters below.&lt;br /&gt;
&lt;br /&gt;
=== (step 2) Genotype/haplotype calling using thunder [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq] ===&lt;br /&gt;
&lt;br /&gt;
  thunder_glf_freq --shotgun my.out.$chr -r 100 --states 200 --dosage --phase --interim 25 -o my.final.out&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
&lt;br /&gt;
(1) The program thunder used in step 2 is an extension of MaCH, the genotype imputation software we have previously developed. For details regarding the shared options, please check out [http://www.sph.umich.edu/csg/yli/mach/index.html MaCH website] and [http://genome.sph.umich.edu/wiki/Mach MaCH wiki]. &lt;br /&gt;
&lt;br /&gt;
(2) Check out example files and command lines under examples/thunder/ in the thunder package [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq]. &lt;br /&gt;
&lt;br /&gt;
== Important Filters ==&lt;br /&gt;
&lt;br /&gt;
We have found that the following filters are helpful.&lt;br /&gt;
&lt;br /&gt;
=== allelic imbalance ===&lt;br /&gt;
A statistic developed by Dr. Tom Blackwell [http://genome.sph.umich.edu/wiki/Genotype_Likelihood_Based_Allele_Balance allelic imbalance]. &lt;br /&gt;
&lt;br /&gt;
=== indel filter ===&lt;br /&gt;
We recommend distance to known indels &amp;gt;= 5bp. A catalog of known indels can be found at [ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/pilot_data/release/2010_07/low_coverage/indels/ indel catalog].&lt;br /&gt;
&lt;br /&gt;
=== site promotion filter ===&lt;br /&gt;
We recommend setting parameter -p at least &amp;gt;= 0.9 in step 1 (running glfMultiples).&lt;br /&gt;
&lt;br /&gt;
=== strand bias filter ===&lt;br /&gt;
&lt;br /&gt;
=== total depth filter ===&lt;br /&gt;
For the 1000 Genomes Project (average depth per individual ~4X), we have found it useful to exclude sites with average total depth per individual &amp;lt; 0.5X or &amp;gt; 20X.&lt;br /&gt;
&lt;br /&gt;
=== coverage filter ===&lt;br /&gt;
We recommend the filter of &amp;gt;50% individuals with coverage.&lt;br /&gt;
&lt;br /&gt;
=== flanking sequence filter ===&lt;br /&gt;
We recommend excluding sites with &amp;gt;0.1% flanking 10-mer frequency among candidate sites. samtools calmd -br performs this base quality re-calibration.&lt;br /&gt;
&lt;br /&gt;
== Citation ==&lt;br /&gt;
Li Y, Sidore C, Kang HM, Boehnke M, Abecasis GR. Low-coverage sequencing: Implications for design of complex trait association studies. &amp;lt;em&amp;gt;Genome Res.&amp;lt;/em&amp;gt; 2011 Jun;21(6):940-51. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=3229</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=3229"/>
		<updated>2011-06-06T16:01:05Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* minimac */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
&lt;br /&gt;
This is the procedure we are recommending, particularly considering people that are performing imputation multiple times (using HapMap as reference, or using updated releases of the 1000 Genomes data as reference). &amp;lt;br&amp;gt;&lt;br /&gt;
The first step is a pre-phasing step using MaCH. This step does not need external reference. This is a time-consuming step BUT is a one-time investment. For computational reason, we recommend break the genome into small overlapping segments ( [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Divide_and_Conquer Divide-and-Conquer]) for this step. In general, we recommend &amp;gt;500Kb overlapping region on each side. For example, for Affymetrix 6.0 panel, if we use core region of 10Mb and flanking/overlapping region of 1Mb on each side, it will correspond to ~3500 SNps in the core region and ~350 SNPs on each side. For 2000 individuals, one job with ~4,200 SNPs running with --states 200 and -r 50, this would take ~40 hours. For other combinations, using the following link to estimate computing time [http://www.sph.umich.edu/csg/yli/MaCH-Admix/runtime.php#est runtime estimate]. &amp;lt;br&amp;gt;&lt;br /&gt;
The second step is the actual imputation step using minimac. This step can run on whole chromosomes. Regarding computing time, one million markers for 1000 individuals using 100 reference haplotypes takes ~ 1 hour; and computing time increases linearly with all the above three parameters. See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://genome.sph.umich.edu/wiki/CalcMatch CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest? ==&lt;br /&gt;
&lt;br /&gt;
1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt;&lt;br /&gt;
2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then:&lt;br /&gt;
&lt;br /&gt;
  @ first = `grep -n rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
  @ last = `grep -n rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Finally (assuming the third field contains the actual haplotypes, where alleles are separated by whitespace):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $3}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order. **HOWEVER**, you will probably avoid problems by including markers in the pedigree file sorted in chromosome order. &lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCH ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=2974</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=2974"/>
		<updated>2011-02-16T00:30:44Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* How do I get imputation quality estimates? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://genome.sph.umich.edu/wiki/CalcMatch CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest? ==&lt;br /&gt;
&lt;br /&gt;
1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt;&lt;br /&gt;
2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then:&lt;br /&gt;
&lt;br /&gt;
  @ first = `grep -n rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
  @ last = `grep -n rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Finally (assuming the third field contains the actual haplotypes, where alleles are separated by whitespace):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $3}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order. **HOWEVER**, you will probably avoid problems by including markers in the pedigree file sorted in chromosome order. &lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCH ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Mach_DAC&amp;diff=2912</id>
		<title>Mach DAC</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Mach_DAC&amp;diff=2912"/>
		<updated>2011-02-10T18:22:22Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* Split Your Data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the MaCH Divide and Conquer page, documenting how to break the genome into smaller pieces before imputation/phasing and how to ligate after imputation/phasing.&lt;br /&gt;
&lt;br /&gt;
== Phasing without External Reference ==&lt;br /&gt;
=== Your Data ===&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 Merlin tutorial [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html]. &amp;lt;br&amp;gt;&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). &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Split Your Data ===&lt;br /&gt;
You can split your data using [http://www.sph.umich.edu/csg/yli/splitPed/ splitPed]. If you follow our recommendation of using MaCH+minimac for imputation, you only need to use splitPed in the MaCH step (to phase your study sample), which does not involve external reference. In the minimac step, imputation finishes within a day for several thousand individuals even for the largest chromosome as a whole: 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, see [http://genome.sph.umich.edu/wiki/Minimac#Imputation minimac wiki] for more details.&lt;br /&gt;
&lt;br /&gt;
== Phasing/Imputation with External Reference ==&lt;br /&gt;
When you phase/impute with external reference panel, you will only need to break the reference files into parts containing subsets of markers because SNPs in your own data (pedigree files) but not in reference files will be automatically ignored by MaCH and minimac. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can split the reference data using [http://www.sph.umich.edu/csg/yli/splitRef/ splitRef].&lt;br /&gt;
&lt;br /&gt;
== Post Phasing/Imputation Ligation ==&lt;br /&gt;
You can use [http://www.sph.umich.edu/csg/yli/ligateHap.V002.tgz LigateHaplotypes ] to ligate the parts.&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac&amp;diff=2909</id>
		<title>Minimac</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac&amp;diff=2909"/>
		<updated>2011-02-10T10:55:56Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &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;
= Download =&lt;br /&gt;
&lt;br /&gt;
A full release of &amp;lt;code&amp;gt;minimac&amp;lt;/code&amp;gt; is expected here soon. In the meantime, a binary only Linux version of minimac is available [http://www.sph.umich.edu/csg/cfuchsb/minimac-beta-2010.Dec.13.tar.gz  from here] for those who are willing to test pre-release software. 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;
== 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 the cost for increasing the number of states is quadratically and the cost for additional rounds is linear.&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^2)&lt;br /&gt;
|- &lt;br /&gt;
| 400 states&lt;br /&gt;
| 48 min = (3 min * 4^2)&lt;br /&gt;
|- &lt;br /&gt;
| 500 states&lt;br /&gt;
| 75 min = (3 min * 5^2)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
 500 states 10 rounds = 75 min * 10 = 750 min&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 Intel X7460 CPU running at 2.66 GHz using 1 core and your mileage may 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;
your data must be on the corresponding build, or in other words, all SNPs must be ordered correctly based on the used build. Therefore, if you want to use your pre-phased data to impute into NCBI build 36 and NCBI build 37 reference panels, you have to exclude all SNPs that change order between builds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here we will provide exclusions list for various genotyping platforms:&lt;br /&gt;
* [http://www.sph.umich.edu/csg/cfuchsb/metab_order_changed.txt Metabo-Chip]&lt;br /&gt;
&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 100 - 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 - 100 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;
&lt;br /&gt;
&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 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;
=== Running Minimac ===&lt;br /&gt;
&lt;br /&gt;
A typical minimac command line might look like this:&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/1000G-2010-06.html MaCH download page])&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;--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/1000G-2010-08.html MaCH download page]. The most recent set of haplotypes are based on genotype calls from August 2010.&lt;br /&gt;
&lt;br /&gt;
=== Imputation quality evaluation ===&lt;br /&gt;
Minimac drops 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 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;
=== 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/0   A/0   C/0&lt;br /&gt;
:::: FAM1004   ID5678  0   0   M   0/0   C/0   G/0&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;
&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]. The latest version 1.0.18 and above accommodate to minimac output.&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>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=2880</id>
		<title>Thunder</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=2880"/>
		<updated>2011-02-08T12:43:35Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* Important Filters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents how to perform variant calling from low-coverage sequencing data using glfmultiples and thunder. The pipeline was originally developed by [mailto:yunli@med.unc.edu Yun Li] for the 1000 Genomes Low Coverage Pilot Project. &lt;br /&gt;
&lt;br /&gt;
== Input Data  ==&lt;br /&gt;
&lt;br /&gt;
To get started, you will need glf files in the standard format [http://samtools.sourceforge.net/SAM1.pdf glf format]. Sample files are available at [ftp://share.sph.umich.edu/1000genomes/pilot1/examples/glf.tgz sample glf files]. &lt;br /&gt;
&lt;br /&gt;
If you do not have glf files, you can generate them from bam files (bam format also specified in [http://samtools.sourceforge.net/SAM1.pdf glf format bam format]) using the following command line: &lt;br /&gt;
&lt;br /&gt;
  samtools pileup -g -T 1 -f ref.fa my.bam &amp;amp;gt; my.glf&lt;br /&gt;
&lt;br /&gt;
Note: you will need the reference fasta file ref.fa to create glf file from bam file. &lt;br /&gt;
&lt;br /&gt;
== How to Run  ==&lt;br /&gt;
&lt;br /&gt;
This variant calling pipeline has two steps. (step 1) promotion of a set of potential polymorphisms; and (step 2) genotype/haplotype calling using LD information. &lt;br /&gt;
&lt;br /&gt;
=== (step 1) Site promotion using software glfMultiples [https://www.sph.umich.edu/csg/yli/GPT_Freq.011.source.tgz GPT_Freq] ===&lt;br /&gt;
&lt;br /&gt;
  GPT_Freq -b my.out -p 0.9 --minDepth 10 --maxDepth 1000 *.glf &lt;br /&gt;
&lt;br /&gt;
minDepth and maxDepth are the cutoffs on total depth (across all individuals). We have found it useful to exclude sites with extremely low and high total depth. Please see Important Filters below.&lt;br /&gt;
&lt;br /&gt;
=== (step 2) Genotype/haplotype calling using thunder [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq] ===&lt;br /&gt;
&lt;br /&gt;
  thunder_glf_freq --shotgun my.out.$chr -r 100 --states 200 --dosage --phase --interim 25 -o my.final.out&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
&lt;br /&gt;
(1) The program thunder used in step 2 is an extension of MaCH, the genotype imputation software we have previously developed. For details regarding the shared options, please check out [http://www.sph.umich.edu/csg/yli/mach/index.html MaCH website] and [http://genome.sph.umich.edu/wiki/Mach MaCH wiki]. &lt;br /&gt;
&lt;br /&gt;
(2) Check out example files and command lines under examples/thunder/ in the thunder package [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq]. &lt;br /&gt;
&lt;br /&gt;
== Important Filters ==&lt;br /&gt;
&lt;br /&gt;
We have found that the following filters are helpful.&lt;br /&gt;
&lt;br /&gt;
=== allelic imbalance ===&lt;br /&gt;
A statistic developed by Dr. Tom Blackwell [http://genome.sph.umich.edu/wiki/Genotype_Likelihood_Based_Allele_Balance allelic imbalance]. &lt;br /&gt;
&lt;br /&gt;
=== indel filter ===&lt;br /&gt;
We recommend distance to known indels &amp;gt;= 5bp. A catalog of known indels can be found at [ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/pilot_data/release/2010_07/low_coverage/indels/ indel catalog].&lt;br /&gt;
&lt;br /&gt;
=== site promotion filter ===&lt;br /&gt;
We recommend setting parameter -p at least &amp;gt;= 0.9 in step 1 (running glfMultiples).&lt;br /&gt;
&lt;br /&gt;
=== strand bias filter ===&lt;br /&gt;
&lt;br /&gt;
=== total depth filter ===&lt;br /&gt;
For the 1000 Genomes Project (average depth per individual ~4X), we have found it useful to exclude sites with average total depth per individual &amp;lt; 0.5X or &amp;gt; 20X.&lt;br /&gt;
&lt;br /&gt;
=== coverage filter ===&lt;br /&gt;
We recommend the filter of &amp;gt;50% individuals with coverage.&lt;br /&gt;
&lt;br /&gt;
=== flanking sequence filter ===&lt;br /&gt;
We recommend excluding sites with &amp;gt;0.1% flanking 10-mer frequency among candidate sites. samtools calmd -br performs this base quality re-calibration.&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=2879</id>
		<title>Thunder</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=2879"/>
		<updated>2011-02-08T12:41:42Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* flanking sequence filter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents how to perform variant calling from low-coverage sequencing data using glfmultiples and thunder. The pipeline was originally developed by [mailto:yunli@med.unc.edu Yun Li] for the 1000 Genomes Low Coverage Pilot Project. &lt;br /&gt;
&lt;br /&gt;
== Input Data  ==&lt;br /&gt;
&lt;br /&gt;
To get started, you will need glf files in the standard format [http://samtools.sourceforge.net/SAM1.pdf glf format]. Sample files are available at [ftp://share.sph.umich.edu/1000genomes/pilot1/examples/glf.tgz sample glf files]. &lt;br /&gt;
&lt;br /&gt;
If you do not have glf files, you can generate them from bam files (bam format also specified in [http://samtools.sourceforge.net/SAM1.pdf glf format bam format]) using the following command line: &lt;br /&gt;
&lt;br /&gt;
  samtools pileup -g -T 1 -f ref.fa my.bam &amp;amp;gt; my.glf&lt;br /&gt;
&lt;br /&gt;
Note: you will need the reference fasta file ref.fa to create glf file from bam file. &lt;br /&gt;
&lt;br /&gt;
== How to Run  ==&lt;br /&gt;
&lt;br /&gt;
This variant calling pipeline has two steps. (step 1) promotion of a set of potential polymorphisms; and (step 2) genotype/haplotype calling using LD information. &lt;br /&gt;
&lt;br /&gt;
=== (step 1) Site promotion using software glfMultiples [https://www.sph.umich.edu/csg/yli/GPT_Freq.011.source.tgz GPT_Freq] ===&lt;br /&gt;
&lt;br /&gt;
  GPT_Freq -b my.out -p 0.9 --minDepth 10 --maxDepth 1000 *.glf &lt;br /&gt;
&lt;br /&gt;
minDepth and maxDepth are the cutoffs on total depth (across all individuals). We have found it useful to exclude sites with extremely low and high total depth. Please see Important Filters below.&lt;br /&gt;
&lt;br /&gt;
=== (step 2) Genotype/haplotype calling using thunder [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq] ===&lt;br /&gt;
&lt;br /&gt;
  thunder_glf_freq --shotgun my.out.$chr -r 100 --states 200 --dosage --phase --interim 25 -o my.final.out&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
&lt;br /&gt;
(1) The program thunder used in step 2 is an extension of MaCH, the genotype imputation software we have previously developed. For details regarding the shared options, please check out [http://www.sph.umich.edu/csg/yli/mach/index.html MaCH website] and [http://genome.sph.umich.edu/wiki/Mach MaCH wiki]. &lt;br /&gt;
&lt;br /&gt;
(2) Check out example files and command lines under examples/thunder/ in the thunder package [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq]. &lt;br /&gt;
&lt;br /&gt;
== Important Filters ==&lt;br /&gt;
&lt;br /&gt;
We have found that the following filters are helpful.&lt;br /&gt;
&lt;br /&gt;
=== allelic imbalance ===&lt;br /&gt;
A statistic developed by Dr. Tom Blackwell [http://genome.sph.umich.edu/wiki/Genotype_Likelihood_Based_Allele_Balance allelic imbalance]. &lt;br /&gt;
&lt;br /&gt;
=== total depth filter ===&lt;br /&gt;
For the 1000 Genomes Project (average depth per individual ~4X), we have found it useful to exclude sites with average total depth per individual &amp;lt; 0.5X or &amp;gt; 20X.&lt;br /&gt;
&lt;br /&gt;
=== coverage filter ===&lt;br /&gt;
We recommend the filter of &amp;gt;50% individuals with coverage.&lt;br /&gt;
&lt;br /&gt;
=== flanking sequence filter ===&lt;br /&gt;
We recommend excluding sites with &amp;gt;0.1% flanking 10-mer frequency among candidate sites. samtools calmd -br performs this base quality re-calibration.&lt;br /&gt;
&lt;br /&gt;
=== indel filter ===&lt;br /&gt;
We recommend distance to known indels &amp;gt;= 5bp. A catalog of known indels can be found at [ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/pilot_data/release/2010_07/low_coverage/indels/ indel catalog].&lt;br /&gt;
&lt;br /&gt;
=== site promotion filter ===&lt;br /&gt;
We recommend setting parameter -p at least &amp;gt;= 0.9 in step 1 (running glfMultiples).&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=2878</id>
		<title>Thunder</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=2878"/>
		<updated>2011-02-08T12:38:28Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* Important Filters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents how to perform variant calling from low-coverage sequencing data using glfmultiples and thunder. The pipeline was originally developed by [mailto:yunli@med.unc.edu Yun Li] for the 1000 Genomes Low Coverage Pilot Project. &lt;br /&gt;
&lt;br /&gt;
== Input Data  ==&lt;br /&gt;
&lt;br /&gt;
To get started, you will need glf files in the standard format [http://samtools.sourceforge.net/SAM1.pdf glf format]. Sample files are available at [ftp://share.sph.umich.edu/1000genomes/pilot1/examples/glf.tgz sample glf files]. &lt;br /&gt;
&lt;br /&gt;
If you do not have glf files, you can generate them from bam files (bam format also specified in [http://samtools.sourceforge.net/SAM1.pdf glf format bam format]) using the following command line: &lt;br /&gt;
&lt;br /&gt;
  samtools pileup -g -T 1 -f ref.fa my.bam &amp;amp;gt; my.glf&lt;br /&gt;
&lt;br /&gt;
Note: you will need the reference fasta file ref.fa to create glf file from bam file. &lt;br /&gt;
&lt;br /&gt;
== How to Run  ==&lt;br /&gt;
&lt;br /&gt;
This variant calling pipeline has two steps. (step 1) promotion of a set of potential polymorphisms; and (step 2) genotype/haplotype calling using LD information. &lt;br /&gt;
&lt;br /&gt;
=== (step 1) Site promotion using software glfMultiples [https://www.sph.umich.edu/csg/yli/GPT_Freq.011.source.tgz GPT_Freq] ===&lt;br /&gt;
&lt;br /&gt;
  GPT_Freq -b my.out -p 0.9 --minDepth 10 --maxDepth 1000 *.glf &lt;br /&gt;
&lt;br /&gt;
minDepth and maxDepth are the cutoffs on total depth (across all individuals). We have found it useful to exclude sites with extremely low and high total depth. Please see Important Filters below.&lt;br /&gt;
&lt;br /&gt;
=== (step 2) Genotype/haplotype calling using thunder [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq] ===&lt;br /&gt;
&lt;br /&gt;
  thunder_glf_freq --shotgun my.out.$chr -r 100 --states 200 --dosage --phase --interim 25 -o my.final.out&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
&lt;br /&gt;
(1) The program thunder used in step 2 is an extension of MaCH, the genotype imputation software we have previously developed. For details regarding the shared options, please check out [http://www.sph.umich.edu/csg/yli/mach/index.html MaCH website] and [http://genome.sph.umich.edu/wiki/Mach MaCH wiki]. &lt;br /&gt;
&lt;br /&gt;
(2) Check out example files and command lines under examples/thunder/ in the thunder package [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq]. &lt;br /&gt;
&lt;br /&gt;
== Important Filters ==&lt;br /&gt;
&lt;br /&gt;
We have found that the following filters are helpful.&lt;br /&gt;
&lt;br /&gt;
=== allelic imbalance ===&lt;br /&gt;
A statistic developed by Dr. Tom Blackwell [http://genome.sph.umich.edu/wiki/Genotype_Likelihood_Based_Allele_Balance allelic imbalance]. &lt;br /&gt;
&lt;br /&gt;
=== total depth filter ===&lt;br /&gt;
For the 1000 Genomes Project (average depth per individual ~4X), we have found it useful to exclude sites with average total depth per individual &amp;lt; 0.5X or &amp;gt; 20X.&lt;br /&gt;
&lt;br /&gt;
=== coverage filter ===&lt;br /&gt;
We recommend the filter of &amp;gt;50% individuals with coverage.&lt;br /&gt;
&lt;br /&gt;
=== flanking sequence filter ===&lt;br /&gt;
We recommend excluding sites with &amp;gt;0.1% flanking 10-mer frequency among candidate sites.&lt;br /&gt;
&lt;br /&gt;
The rationale is ....&lt;br /&gt;
&lt;br /&gt;
=== indel filter ===&lt;br /&gt;
We recommend distance to known indels &amp;gt;= 5bp. A catalog of known indels can be found at [ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/pilot_data/release/2010_07/low_coverage/indels/ indel catalog].&lt;br /&gt;
&lt;br /&gt;
=== site promotion filter ===&lt;br /&gt;
We recommend setting parameter -p at least &amp;gt;= 0.9 in step 1 (running glfMultiples).&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=2877</id>
		<title>Thunder</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=2877"/>
		<updated>2011-02-08T12:37:20Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* total depth filter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents how to perform variant calling from low-coverage sequencing data using glfmultiples and thunder. The pipeline was originally developed by [mailto:yunli@med.unc.edu Yun Li] for the 1000 Genomes Low Coverage Pilot Project. &lt;br /&gt;
&lt;br /&gt;
== Input Data  ==&lt;br /&gt;
&lt;br /&gt;
To get started, you will need glf files in the standard format [http://samtools.sourceforge.net/SAM1.pdf glf format]. Sample files are available at [ftp://share.sph.umich.edu/1000genomes/pilot1/examples/glf.tgz sample glf files]. &lt;br /&gt;
&lt;br /&gt;
If you do not have glf files, you can generate them from bam files (bam format also specified in [http://samtools.sourceforge.net/SAM1.pdf glf format bam format]) using the following command line: &lt;br /&gt;
&lt;br /&gt;
  samtools pileup -g -T 1 -f ref.fa my.bam &amp;amp;gt; my.glf&lt;br /&gt;
&lt;br /&gt;
Note: you will need the reference fasta file ref.fa to create glf file from bam file. &lt;br /&gt;
&lt;br /&gt;
== How to Run  ==&lt;br /&gt;
&lt;br /&gt;
This variant calling pipeline has two steps. (step 1) promotion of a set of potential polymorphisms; and (step 2) genotype/haplotype calling using LD information. &lt;br /&gt;
&lt;br /&gt;
=== (step 1) Site promotion using software glfMultiples [https://www.sph.umich.edu/csg/yli/GPT_Freq.011.source.tgz GPT_Freq] ===&lt;br /&gt;
&lt;br /&gt;
  GPT_Freq -b my.out -p 0.9 --minDepth 10 --maxDepth 1000 *.glf &lt;br /&gt;
&lt;br /&gt;
minDepth and maxDepth are the cutoffs on total depth (across all individuals). We have found it useful to exclude sites with extremely low and high total depth. Please see Important Filters below.&lt;br /&gt;
&lt;br /&gt;
=== (step 2) Genotype/haplotype calling using thunder [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq] ===&lt;br /&gt;
&lt;br /&gt;
  thunder_glf_freq --shotgun my.out.$chr -r 100 --states 200 --dosage --phase --interim 25 -o my.final.out&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
&lt;br /&gt;
(1) The program thunder used in step 2 is an extension of MaCH, the genotype imputation software we have previously developed. For details regarding the shared options, please check out [http://www.sph.umich.edu/csg/yli/mach/index.html MaCH website] and [http://genome.sph.umich.edu/wiki/Mach MaCH wiki]. &lt;br /&gt;
&lt;br /&gt;
(2) Check out example files and command lines under examples/thunder/ in the thunder package [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq]. &lt;br /&gt;
&lt;br /&gt;
== Important Filters ==&lt;br /&gt;
&lt;br /&gt;
We have found that the following filters are helpful.&lt;br /&gt;
&lt;br /&gt;
=== total depth filter ===&lt;br /&gt;
For the 1000 Genomes Project (average depth per individual ~4X), we have found it useful to exclude sites with average total depth per individual &amp;lt; 0.5X or &amp;gt; 20X.&lt;br /&gt;
&lt;br /&gt;
=== coverage filter ===&lt;br /&gt;
We recommend the filter of &amp;gt;50% individuals with coverage.&lt;br /&gt;
&lt;br /&gt;
=== flanking sequence filter ===&lt;br /&gt;
We recommend excluding sites with &amp;gt;0.1% flanking 10-mer frequency among candidate sites.&lt;br /&gt;
&lt;br /&gt;
The rationale is ....&lt;br /&gt;
&lt;br /&gt;
=== indel filter ===&lt;br /&gt;
We recommend distance to known indels &amp;gt;= 5bp. A catalog of known indels can be found at [ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/pilot_data/release/2010_07/low_coverage/indels/ indel catalog].&lt;br /&gt;
&lt;br /&gt;
=== site promotion filter ===&lt;br /&gt;
We recommend setting parameter -p at least &amp;gt;= 0.9 in step 1 (running glfMultiples).&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=2876</id>
		<title>Thunder</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=2876"/>
		<updated>2011-02-08T12:36:18Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents how to perform variant calling from low-coverage sequencing data using glfmultiples and thunder. The pipeline was originally developed by [mailto:yunli@med.unc.edu Yun Li] for the 1000 Genomes Low Coverage Pilot Project. &lt;br /&gt;
&lt;br /&gt;
== Input Data  ==&lt;br /&gt;
&lt;br /&gt;
To get started, you will need glf files in the standard format [http://samtools.sourceforge.net/SAM1.pdf glf format]. Sample files are available at [ftp://share.sph.umich.edu/1000genomes/pilot1/examples/glf.tgz sample glf files]. &lt;br /&gt;
&lt;br /&gt;
If you do not have glf files, you can generate them from bam files (bam format also specified in [http://samtools.sourceforge.net/SAM1.pdf glf format bam format]) using the following command line: &lt;br /&gt;
&lt;br /&gt;
  samtools pileup -g -T 1 -f ref.fa my.bam &amp;amp;gt; my.glf&lt;br /&gt;
&lt;br /&gt;
Note: you will need the reference fasta file ref.fa to create glf file from bam file. &lt;br /&gt;
&lt;br /&gt;
== How to Run  ==&lt;br /&gt;
&lt;br /&gt;
This variant calling pipeline has two steps. (step 1) promotion of a set of potential polymorphisms; and (step 2) genotype/haplotype calling using LD information. &lt;br /&gt;
&lt;br /&gt;
=== (step 1) Site promotion using software glfMultiples [https://www.sph.umich.edu/csg/yli/GPT_Freq.011.source.tgz GPT_Freq] ===&lt;br /&gt;
&lt;br /&gt;
  GPT_Freq -b my.out -p 0.9 --minDepth 10 --maxDepth 1000 *.glf &lt;br /&gt;
&lt;br /&gt;
minDepth and maxDepth are the cutoffs on total depth (across all individuals). We have found it useful to exclude sites with extremely low and high total depth. Please see Important Filters below.&lt;br /&gt;
&lt;br /&gt;
=== (step 2) Genotype/haplotype calling using thunder [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq] ===&lt;br /&gt;
&lt;br /&gt;
  thunder_glf_freq --shotgun my.out.$chr -r 100 --states 200 --dosage --phase --interim 25 -o my.final.out&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
&lt;br /&gt;
(1) The program thunder used in step 2 is an extension of MaCH, the genotype imputation software we have previously developed. For details regarding the shared options, please check out [http://www.sph.umich.edu/csg/yli/mach/index.html MaCH website] and [http://genome.sph.umich.edu/wiki/Mach MaCH wiki]. &lt;br /&gt;
&lt;br /&gt;
(2) Check out example files and command lines under examples/thunder/ in the thunder package [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq]. &lt;br /&gt;
&lt;br /&gt;
== Important Filters ==&lt;br /&gt;
&lt;br /&gt;
We have found that the following filters are helpful.&lt;br /&gt;
&lt;br /&gt;
=== total depth filter ===&lt;br /&gt;
For the 1000 Genomes Project (average depth per individual ~4X), we have found it useful to exclude sites with average total depth per individual &amp;lt; 0.5X or &amp;gt; 10X.&lt;br /&gt;
&lt;br /&gt;
=== coverage filter ===&lt;br /&gt;
We recommend the filter of &amp;gt;50% individuals with coverage.&lt;br /&gt;
&lt;br /&gt;
=== flanking sequence filter ===&lt;br /&gt;
We recommend excluding sites with &amp;gt;0.1% flanking 10-mer frequency among candidate sites.&lt;br /&gt;
&lt;br /&gt;
The rationale is ....&lt;br /&gt;
&lt;br /&gt;
=== indel filter ===&lt;br /&gt;
We recommend distance to known indels &amp;gt;= 5bp. A catalog of known indels can be found at [ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/pilot_data/release/2010_07/low_coverage/indels/ indel catalog].&lt;br /&gt;
&lt;br /&gt;
=== site promotion filter ===&lt;br /&gt;
We recommend setting parameter -p at least &amp;gt;= 0.9 in step 1 (running glfMultiples).&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=CalcMatch&amp;diff=2818</id>
		<title>CalcMatch</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=CalcMatch&amp;diff=2818"/>
		<updated>2011-01-28T11:01:55Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CalcMatch is a C/C++ software developed by [https://www.sph.umich.edu/csg/yli/ Yun Li]. It compares two sets of pedigree files. It was initially written to compare imputed genotypes with their true/experimental counterpart but can be used to compare the concordance between any two sets of pedigree files. The input data are in standard Merlin/QTDT format (http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html). &lt;br /&gt;
&lt;br /&gt;
= Options =&lt;br /&gt;
== --impped --impdat &amp;lt;br&amp;gt; ==&lt;br /&gt;
specify one input pedigree set. &lt;br /&gt;
&lt;br /&gt;
== --trueped --truedat &amp;lt;br&amp;gt; ==&lt;br /&gt;
specify the other input pedigree set.&lt;br /&gt;
&lt;br /&gt;
== --match == &lt;br /&gt;
generates a matrix taking values 0,1,2 indicating # of matched alleles. The dimension of the matrix is # of overlapping individuals times # of overlapping markers of the two input pedigree sets. &lt;br /&gt;
&lt;br /&gt;
== --bySNP == &lt;br /&gt;
is turned on by default (which means: if you put --bySNP in command line, it will be turned OFF!) to generate SNP specific measures. The output .bySNP will contain the following 6 fields for each SNP: &lt;br /&gt;
&lt;br /&gt;
    (1) SNP&amp;amp;nbsp;: SNP name&lt;br /&gt;
    (2) gErr&amp;amp;nbsp;: genotypic discordance rate&lt;br /&gt;
    (3) aErr&amp;amp;nbsp;: allelic discordance rate&lt;br /&gt;
    (4) matchedG&amp;amp;nbsp;: number of genotypes matched&lt;br /&gt;
    (5) matchedA: number of alleles matched&lt;br /&gt;
    (6) maskedG: total number of genotypes evaluated/masked (&amp;amp;lt;=n of course) (I should change the naming to comparedG or evaluatedG)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== --byGeno ==&lt;br /&gt;
NOTE: this option is turned on by default. If you put --byGeno in command line, it will be turned OFF!&lt;br /&gt;
can be added on top of --bySNP. It will generates the following fields after the 6 fields above: &lt;br /&gt;
&lt;br /&gt;
    (7) hetAerr : allelic discordance rate among heterozygotes&lt;br /&gt;
    (8) AL1: allele 1 (an arbitrary allele)&lt;br /&gt;
    (9) AL2: allele 2&lt;br /&gt;
    (10) freq1: frequency of AL1&lt;br /&gt;
    (11) MAF&lt;br /&gt;
    (12) #true 1/1: # individuals with experimental genotype AL1/AL1&lt;br /&gt;
    (13) mm1/2: # of true AL1/AL1 being imputed as AL1/AL2&lt;br /&gt;
    (14) mm2/2: # of true AL1/AL1 being imputed as AL2/AL2&lt;br /&gt;
    (15) #true 1/2&lt;br /&gt;
    (16) mm1/1&lt;br /&gt;
    (17) mm2/2&lt;br /&gt;
    (18) #true 2/2&lt;br /&gt;
    (19) mm1/1&lt;br /&gt;
    (20) mm1/2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== --accuracyByGeno ==&lt;br /&gt;
Similar to --byGeno, it is used on top of --bySNP. It may be used together with --byGeno. It will generate the following fields, after (7-20) is --byGeno is turned on or after the 6th field otherwise. &lt;br /&gt;
&lt;br /&gt;
    (A) almajor: major allele&lt;br /&gt;
    (B) alminor: minor allele&lt;br /&gt;
    (C) freq1: major allele frequency&lt;br /&gt;
    (D) accuracy11: allelic concordance rate for homozygotes major allele&lt;br /&gt;
    (E) accuracy12: allelic concordance rate for heterozygotes&lt;br /&gt;
    (F) accuracy22: allelic concordance rate for homozygotes minor allele&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
== --byPerson ==&lt;br /&gt;
generates a separate output file .byPerson and contains the following information for each person: &lt;br /&gt;
&lt;br /&gt;
    (1) famid&lt;br /&gt;
    (2) subjID&lt;br /&gt;
    (3) gErr&lt;br /&gt;
    (4) aErr&lt;br /&gt;
    (5) matchedG&lt;br /&gt;
    (6) matchedA&lt;br /&gt;
    (7) maskedG&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This --byPerson option is useful if there is potential sample swap or inter-individual difference, e.g., sequencing depth, number of markers genotyped. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== --maskflag --maskped --maskdat ==&lt;br /&gt;
CalcMatch compares all genotypes overlapping the two input sets. However, when --maskflag is turned on AND --maskped and --maskdat are specified (I know ...) it compares only the following subset of the overlapping genotypes: genotypes either not found (i.e., individual or marker not included) or missing (included but with value 0/0, N/N, ./. etc) in --maskped / --maskdat. These options are useful when some individuals were masked for some SNPs while others masked for a different set of SNPs.&lt;br /&gt;
&lt;br /&gt;
= output files =&lt;br /&gt;
== .bySNP ==&lt;br /&gt;
See option --bySNP &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== .byPerson ==&lt;br /&gt;
See option --byPerson &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== .minusstrand ==&lt;br /&gt;
Reports the list of SNPs that appear in minus strand (that is, SNPs for which more than two alleles are seen when combining imputed and true pedigree files. This file will only be generated if --byGeno or --accuracyByGeno is turned on. The former option --byGeno is turned on by default. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= example command lines =&lt;br /&gt;
&lt;br /&gt;
  CalcMatch --trueped true.ped --truedat true.dat --impped imp.ped --impdat imp.dat -o CalcMatch.Output --byPerson &lt;br /&gt;
&lt;br /&gt;
Will generate CalcMatch.Output.bySNP (6 fields only) and CalcMatch.Output.byPerson.&lt;br /&gt;
&lt;br /&gt;
  CalcMatch --trueped true.ped --truedat true.dat --impped imp.ped --impdat imp.dat -o CalcMatch.Output --byGeno --byPerson &lt;br /&gt;
&lt;br /&gt;
Will generate CalcMatch.Output.bySNP (6+20 fields) and CalcMatch.Output.byPerson.&lt;br /&gt;
&lt;br /&gt;
  CalcMatch --trueped true.ped --truedat true.dat --impped imp.ped --impdat imp.dat -o CalcMatch.Output --accuracyByGeno --byPerson &lt;br /&gt;
&lt;br /&gt;
Will generate CalcMatch.Output.bySNP (6+6 fields only) and CalcMatch.Output.byPerson.&lt;br /&gt;
&lt;br /&gt;
  CalcMatch --trueped true.ped --truedat true.dat --impped imp.ped --impdat imp.dat -o CalcMatch.Output --accuracyByGeno --byGeno --byPerson &lt;br /&gt;
&lt;br /&gt;
Will generate CalcMatch.Output.bySNP (6+20+6 fields only) and CalcMatch.Output.byPerson.&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
Please go to http://www.sph.umich.edu/csg/yli/software.html&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=2764</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=2764"/>
		<updated>2011-01-15T16:53:49Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://www.sph.umich.edu/csg/ylwtx/CalcMatch.1.0.5.tgz CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest? ==&lt;br /&gt;
&lt;br /&gt;
1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt;&lt;br /&gt;
2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then:&lt;br /&gt;
&lt;br /&gt;
  @ first = `grep -n rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
  @ last = `grep -n rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Finally (assuming the third field contains the actual haplotypes, where alleles are separated by whitespace):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $3}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order. **HOWEVER**, you will probably avoid problems by including markers in the pedigree file sorted in chromosome order. &lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCH ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=2763</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=2763"/>
		<updated>2011-01-15T16:51:52Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://www.sph.umich.edu/csg/ylwtx/CalcMatch.1.0.5.tgz CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest? ==&lt;br /&gt;
&lt;br /&gt;
1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt;&lt;br /&gt;
2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then:&lt;br /&gt;
&lt;br /&gt;
  @ first = `grep -n rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
  @ last = `grep -n rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Finally (assuming the third field contains the actual haplotypes, where alleles are separated by whitespace):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $3}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order. **HOWEVER**, you will probably avoid problems by including markers in the pedigree file sorted in chromosome order. &lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== Install MaCh ==&lt;br /&gt;
We have source codes available through the MaCH download page: http://www.sph.umich.edu/csg/yli/mach/download/ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=CalcMatch&amp;diff=2755</id>
		<title>CalcMatch</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=CalcMatch&amp;diff=2755"/>
		<updated>2011-01-11T22:04:31Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CalcMatch is a C/C++ software developed by [https://www.sph.umich.edu/csg/yli/ Yun Li]. It compares two sets of pedigree files. It was initially written to compare imputed genotypes with their true/experimental counterpart but can be used to compare the concordance between any two sets of pedigree files. The input data are in standard Merlin/QTDT format (http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html). &lt;br /&gt;
&lt;br /&gt;
= Options =&lt;br /&gt;
== --impped --impdat &amp;lt;br&amp;gt; ==&lt;br /&gt;
specify one input pedigree set. &lt;br /&gt;
&lt;br /&gt;
== --trueped --truedat &amp;lt;br&amp;gt; ==&lt;br /&gt;
specify the other input pedigree set.&lt;br /&gt;
&lt;br /&gt;
== --match == &lt;br /&gt;
generates a matrix taking values 0,1,2 indicating # of matched alleles. The dimension of the matrix is # of overlapping individuals times # of overlapping markers of the two input pedigree sets. &lt;br /&gt;
&lt;br /&gt;
== --bySNP == &lt;br /&gt;
is turned on by default to generate SNP specific measures. The output .bySNP will contain the following 6 fields for each SNP: &lt;br /&gt;
&lt;br /&gt;
    (1) SNP&amp;amp;nbsp;: SNP name&lt;br /&gt;
    (2) gErr&amp;amp;nbsp;: genotypic discordance rate&lt;br /&gt;
    (3) aErr&amp;amp;nbsp;: allelic discordance rate&lt;br /&gt;
    (4) matchedG&amp;amp;nbsp;: number of genotypes matched&lt;br /&gt;
    (5) matchedA: number of alleles matched&lt;br /&gt;
    (6) maskedG: total number of genotypes evaluated/masked (&amp;amp;lt;=n of course) (I should change the naming to comparedG or evaluatedG)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== --byGeno ==&lt;br /&gt;
can be added on top of --bySNP. It will generates the following fields after the 6 fields above: &lt;br /&gt;
&lt;br /&gt;
    (7) hetAerr : allelic discordance rate among heterozygotes&lt;br /&gt;
    (8) AL1: allele 1 (an arbitrary allele)&lt;br /&gt;
    (9) AL2: allele 2&lt;br /&gt;
    (10) freq1: frequency of AL1&lt;br /&gt;
    (11) MAF&lt;br /&gt;
    (12) #true 1/1: # individuals with experimental genotype AL1/AL1&lt;br /&gt;
    (13) mm1/2: # of true AL1/AL1 being imputed as AL1/AL2&lt;br /&gt;
    (14) mm2/2: # of true AL1/AL1 being imputed as AL2/AL2&lt;br /&gt;
    (15) #true 1/2&lt;br /&gt;
    (16) mm1/1&lt;br /&gt;
    (17) mm2/2&lt;br /&gt;
    (18) #true 2/2&lt;br /&gt;
    (19) mm1/1&lt;br /&gt;
    (20) mm1/2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== --accuracyByGeno ==&lt;br /&gt;
Similar to --byGeno, it is used on top of --bySNP. It may be used together with --byGeno. It will generate the following fields, after (7-20) is --byGeno is turned on or after the 6th field otherwise. &lt;br /&gt;
&lt;br /&gt;
    (A) almajor: major allele&lt;br /&gt;
    (B) alminor: minor allele&lt;br /&gt;
    (C) freq1: major allele frequency&lt;br /&gt;
    (D) accuracy11: allelic concordance rate for homozygotes major allele&lt;br /&gt;
    (E) accuracy12: allelic concordance rate for heterozygotes&lt;br /&gt;
    (F) accuracy22: allelic concordance rate for homozygotes minor allele&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
== --byPerson ==&lt;br /&gt;
generates a separate output file .byPerson and contains the following information for each person: &lt;br /&gt;
&lt;br /&gt;
    (1) famid&lt;br /&gt;
    (2) subjID&lt;br /&gt;
    (3) gErr&lt;br /&gt;
    (4) aErr&lt;br /&gt;
    (5) matchedG&lt;br /&gt;
    (6) matchedA&lt;br /&gt;
    (7) maskedG&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; This --byPerson option is useful if there is potential sample swap or inter-individual difference, e.g., sequencing depth, number of markers genotyped. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== --maskflag --maskped --maskdat ==&lt;br /&gt;
CalcMatch compares all genotypes overlapping the two input sets. However, when --maskflag is turned on AND --maskped and --maskdat are specified (I know ...) it compares only the following subset of the overlapping genotypes: genotypes either not found (i.e., individual or marker not included) or missing (included but with value 0/0, N/N, ./. etc) in --maskped / --maskdat. These options are useful when some individuals were masked for some SNPs while others masked for a different set of SNPs.&lt;br /&gt;
&lt;br /&gt;
= example command lines =&lt;br /&gt;
&lt;br /&gt;
  CalcMatch --trueped true.ped --truedat true.dat --impped imp.ped --impdat imp.dat -o CalcMatch.Output --byPerson &lt;br /&gt;
&lt;br /&gt;
Will generate CalcMatch.Output.bySNP (6 fields only) and CalcMatch.Output.byPerson.&lt;br /&gt;
&lt;br /&gt;
  CalcMatch --trueped true.ped --truedat true.dat --impped imp.ped --impdat imp.dat -o CalcMatch.Output --byGeno --byPerson &lt;br /&gt;
&lt;br /&gt;
Will generate CalcMatch.Output.bySNP (6+20 fields) and CalcMatch.Output.byPerson.&lt;br /&gt;
&lt;br /&gt;
  CalcMatch --trueped true.ped --truedat true.dat --impped imp.ped --impdat imp.dat -o CalcMatch.Output --accuracyByGeno --byPerson &lt;br /&gt;
&lt;br /&gt;
Will generate CalcMatch.Output.bySNP (6+6 fields only) and CalcMatch.Output.byPerson.&lt;br /&gt;
&lt;br /&gt;
  CalcMatch --trueped true.ped --truedat true.dat --impped imp.ped --impdat imp.dat -o CalcMatch.Output --accuracyByGeno --byGeno --byPerson &lt;br /&gt;
&lt;br /&gt;
Will generate CalcMatch.Output.bySNP (6+20+6 fields only) and CalcMatch.Output.byPerson.&lt;br /&gt;
&lt;br /&gt;
= Download =&lt;br /&gt;
Please go to http://www.sph.umich.edu/csg/yli/software.html&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=2750</id>
		<title>Thunder</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=2750"/>
		<updated>2011-01-09T12:53:59Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents how to perform variant calling from low-coverage sequencing data using glfmultiples and thunder. The pipeline was originally developed by [mailto:yunli@med.unc.edu Yun Li] for the 1000 Genomes Low Coverage Pilot Project. &lt;br /&gt;
&lt;br /&gt;
== Input Data  ==&lt;br /&gt;
&lt;br /&gt;
To get started, you will need glf files in the standard format [http://samtools.sourceforge.net/SAM1.pdf glf format]. Sample files are available at [ftp://share.sph.umich.edu/1000genomes/pilot1/examples/glf.tgz sample glf files]. &lt;br /&gt;
&lt;br /&gt;
If you do not have glf files, you can generate them from bam files (bam format also specified in [http://samtools.sourceforge.net/SAM1.pdf glf format bam format]) using the following command line: &lt;br /&gt;
&lt;br /&gt;
  samtools pileup -g -T 1 -f ref.fa my.bam &amp;amp;gt; my.glf&lt;br /&gt;
&lt;br /&gt;
Note: you will need the reference fasta file ref.fa to create glf file from bam file. &lt;br /&gt;
&lt;br /&gt;
== How to Run  ==&lt;br /&gt;
&lt;br /&gt;
This variant calling pipeline has two steps. (step 1) promotion of a set of potential polymorphisms; and (step 2) genotype/haplotype calling using LD information. &lt;br /&gt;
&lt;br /&gt;
=== (step 1) Site promotion using software glfMultiples [https://www.sph.umich.edu/csg/yli/GPT_Freq.011.source.tgz GPT_Freq] ===&lt;br /&gt;
&lt;br /&gt;
  GPT_Freq -b my.out -p 0.9 --minDepth 10 --maxDepth 1000 *.glf &lt;br /&gt;
&lt;br /&gt;
minDepth and maxDepth are the cutoffs on total depth (across all individuals). We have found it useful to exclude sites with extremely low and high total depth. Please see Important Filters below.&lt;br /&gt;
&lt;br /&gt;
=== (step 2) Genotype/haplotype calling using thunder [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq] ===&lt;br /&gt;
&lt;br /&gt;
  thunder_glf_freq --shotgun my.out.$chr -r 100 --states 200 --dosage --phase --interim 25 -o my.final.out&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
&lt;br /&gt;
(1) The program thunder used in step 2 is an extension of MaCH, the genotype imputation software we have previously developed. For details regarding the shared options, please check out [http://www.sph.umich.edu/csg/yli/mach/index.html MaCH website] and [http://genome.sph.umich.edu/wiki/Mach MaCH wiki]. &lt;br /&gt;
&lt;br /&gt;
(2) Check out example files and command lines under examples/thunder/ in the thunder package [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq]. &lt;br /&gt;
&lt;br /&gt;
== Important Filters ==&lt;br /&gt;
&lt;br /&gt;
We have found that the following filters are helpful.&lt;br /&gt;
&lt;br /&gt;
=== total depth filter ===&lt;br /&gt;
For the 1000 Genomes Project (average depth per individual ~4X), we have found it useful to exclude sites with average total depth per individual &amp;lt; 0.5X or &amp;gt; 10X.&lt;br /&gt;
&lt;br /&gt;
=== coverage filter ===&lt;br /&gt;
We recommend the filter of &amp;gt;50% individuals with coverage.&lt;br /&gt;
&lt;br /&gt;
=== flanking sequence filter ===&lt;br /&gt;
We recommend excluding sites with &amp;gt;0.1% flanking 10-mer frequency among candidate sites.&lt;br /&gt;
&lt;br /&gt;
The rationale is ....&lt;br /&gt;
&lt;br /&gt;
=== indel filter ===&lt;br /&gt;
We recommend distance to known indels &amp;gt;= 5bp. A catalog of known indels can be found at [ indel catalog].&lt;br /&gt;
&lt;br /&gt;
=== site promotion filter ===&lt;br /&gt;
We recommend setting parameter -p at least &amp;gt;= 0.9 in step 1 (running glfMultiples).&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=2749</id>
		<title>Thunder</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Thunder&amp;diff=2749"/>
		<updated>2011-01-09T12:53:19Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents how to perform variant calling from low-coverage sequencing data using glfmultiples and thunder. The pipeline was originally developed by [mailto:yunli@med.unc.edu Yun Li] for the 1000 Genomes Low Coverage Pilot Project. &lt;br /&gt;
&lt;br /&gt;
== Input Data  ==&lt;br /&gt;
&lt;br /&gt;
To get started, you will need glf files in the standard format [http://samtools.sourceforge.net/SAM1.pdf glf format]. Sample files are available at [ftp://share.sph.umich.edu/1000genomes/pilot1/examples/glf.tgz sample glf files]. &lt;br /&gt;
&lt;br /&gt;
If you do not have glf files, you can generate them from bam files (bam format also specified in [http://samtools.sourceforge.net/SAM1.pdf glf format bam format]) using the following command line: &lt;br /&gt;
&lt;br /&gt;
  samtools pileup -g -T 1 -f ref.fa my.bam &amp;amp;gt; my.glf&lt;br /&gt;
&lt;br /&gt;
Note: you will need the reference fasta file ref.fa to create glf file from bam file. &lt;br /&gt;
&lt;br /&gt;
== How to Run  ==&lt;br /&gt;
&lt;br /&gt;
This variant calling pipeline has two steps. (step 1) promotion of a set of potential polymorphisms; and (step 2) genotype/haplotype calling using LD information. &lt;br /&gt;
&lt;br /&gt;
=== (step 1) Site promotion using software glfMultiples [https://www.sph.umich.edu/csg/yli/GPT_Freq.011.source.tgz GPT_Freq] ===&lt;br /&gt;
&lt;br /&gt;
  GPT_Freq -b my.out -p 0.9 --minDepth 10 --maxDepth 1000 *.glf &lt;br /&gt;
&lt;br /&gt;
minDepth and maxDepth are the cutoffs on total depth (across all individuals). We have found it useful to exclude sites with extremely low and high total depth. Please see Important Filters below.&lt;br /&gt;
&lt;br /&gt;
=== (step 2) Genotype/haplotype calling using thunder [https://www.sph.umich.edu/csg/yli/thunder/thunder.V010.source.tgz thunder_glf_freq] ===&lt;br /&gt;
&lt;br /&gt;
  thunder_glf_freq --shotgun my.out.$chr -r 100 --states 200 --dosage --phase --interim 25 -o my.final.out&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
&lt;br /&gt;
(1) The program thunder used in step 2 is an extension of MaCH, the genotype imputation software we have previously developed. For details regarding the shared options, please check out [http://www.sph.umich.edu/csg/yli/mach/index.html MaCH website] and [http://genome.sph.umich.edu/wiki/Mach MaCH wiki]. &lt;br /&gt;
&lt;br /&gt;
(2) Check out example files and command lines under examples/thunder/ in the thunder package [https://www.sph.umich.edu/csg/yli/thunder/thunder.V009.source.tgz thunder_glf_freq]. &lt;br /&gt;
&lt;br /&gt;
== Important Filters ==&lt;br /&gt;
&lt;br /&gt;
We have found that the following filters are helpful.&lt;br /&gt;
&lt;br /&gt;
=== total depth filter ===&lt;br /&gt;
For the 1000 Genomes Project (average depth per individual ~4X), we have found it useful to exclude sites with average total depth per individual &amp;lt; 0.5X or &amp;gt; 10X.&lt;br /&gt;
&lt;br /&gt;
=== coverage filter ===&lt;br /&gt;
We recommend the filter of &amp;gt;50% individuals with coverage.&lt;br /&gt;
&lt;br /&gt;
=== flanking sequence filter ===&lt;br /&gt;
We recommend excluding sites with &amp;gt;0.1% flanking 10-mer frequency among candidate sites.&lt;br /&gt;
&lt;br /&gt;
The rationale is ....&lt;br /&gt;
&lt;br /&gt;
=== indel filter ===&lt;br /&gt;
We recommend distance to known indels &amp;gt;= 5bp. A catalog of known indels can be found at [ indel catalog].&lt;br /&gt;
&lt;br /&gt;
=== site promotion filter ===&lt;br /&gt;
We recommend setting parameter -p at least &amp;gt;= 0.9 in step 1 (running glfMultiples).&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Mach_DAC&amp;diff=2667</id>
		<title>Mach DAC</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Mach_DAC&amp;diff=2667"/>
		<updated>2010-12-07T13:29:00Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the MaCH Divide and Conquer page, documenting how to break the genome into smaller pieces before imputation/phasing and how to ligate after imputation/phasing.&lt;br /&gt;
&lt;br /&gt;
== Phasing without External Reference ==&lt;br /&gt;
=== Your Data ===&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 Merlin tutorial [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html]. &amp;lt;br&amp;gt;&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). &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Split Your Data ===&lt;br /&gt;
You can split your data using [http://www.sph.umich.edu/csg/yli/splitPed/ splitPed].&lt;br /&gt;
&lt;br /&gt;
== Phasing/Imputation with External Reference ==&lt;br /&gt;
When you phase/impute with external reference panel, you will only need to break the reference files into parts containing subsets of markers because SNPs in your own data (pedigree files) but not in reference files will be automatically ignored by MaCH and minimac. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can split the reference data using [http://www.sph.umich.edu/csg/yli/splitRef/ splitRef].&lt;br /&gt;
&lt;br /&gt;
== Post Phasing/Imputation Ligation ==&lt;br /&gt;
You can use [http://www.sph.umich.edu/csg/yli/ligateHap.V002.tgz LigateHaplotypes ] to ligate the parts.&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Mach_DAC&amp;diff=2666</id>
		<title>Mach DAC</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Mach_DAC&amp;diff=2666"/>
		<updated>2010-12-07T13:27:56Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* Post Phasing/Imputation Ligation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the MaCH Divide and Conquer page, documenting how to break the genome into smaller pieces before imputation/phasing and how to ligate after imputation/phasing.&lt;br /&gt;
&lt;br /&gt;
== Phasing without External Reference ==&lt;br /&gt;
=== Your Data ===&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 Merlin tutorial [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html]. &amp;lt;br&amp;gt;&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). &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Split Your Data ===&lt;br /&gt;
You can split your data using [http://www.sph.umich.edu/csg/yli/splitPed/ splitPed].&lt;br /&gt;
&lt;br /&gt;
== Phasing/Imputation with External Reference ==&lt;br /&gt;
When you phase/impute with external reference panel, you will only need to break the reference files into parts containing subsets of markers because SNPs in your own data (pedigree files) but not in reference files will be automatically ignored by MaCH and minimac. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can split the reference data using [http://www.sph.umich.edu/csg/yli/splitRef/ splitRef].&lt;br /&gt;
&lt;br /&gt;
== Post Phasing/Imputation Ligation ==&lt;br /&gt;
You can use&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Mach_DAC&amp;diff=2665</id>
		<title>Mach DAC</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Mach_DAC&amp;diff=2665"/>
		<updated>2010-12-07T13:27:14Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the MaCH Divide and Conquer page, documenting how to break the genome into smaller pieces before imputation/phasing and how to ligate after imputation/phasing.&lt;br /&gt;
&lt;br /&gt;
== Phasing without External Reference ==&lt;br /&gt;
=== Your Data ===&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 Merlin tutorial [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html]. &amp;lt;br&amp;gt;&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). &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Split Your Data ===&lt;br /&gt;
You can split your data using [http://www.sph.umich.edu/csg/yli/splitPed/ splitPed].&lt;br /&gt;
&lt;br /&gt;
== Phasing/Imputation with External Reference ==&lt;br /&gt;
When you phase/impute with external reference panel, you will only need to break the reference files into parts containing subsets of markers because SNPs in your own data (pedigree files) but not in reference files will be automatically ignored by MaCH and minimac. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can split the reference data using [http://www.sph.umich.edu/csg/yli/splitRef/ splitRef].&lt;br /&gt;
&lt;br /&gt;
== Post Phasing/Imputation Ligation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SplitRef&amp;diff=2664</id>
		<title>SplitRef</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SplitRef&amp;diff=2664"/>
		<updated>2010-12-07T13:19:27Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: Created page with &amp;#039;This page documents the splitRef program, which splits a reference haplotype file into smaller files with subsets of markers.  == Input Files == === Required Input Files === ====…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents the splitRef program, which splits a reference haplotype file into smaller files with subsets of markers.&lt;br /&gt;
&lt;br /&gt;
== Input Files ==&lt;br /&gt;
=== Required Input Files ===&lt;br /&gt;
==== Haplotype file (.hap) ====&lt;br /&gt;
File fed to -hap option. One line for one haplotype, with last field containing the actual alleles with no separators between alleles. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Marker list (.snps) file ====&lt;br /&gt;
File fed to -snps option. One line for each marker: marker name only. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Optional Input Files ===&lt;br /&gt;
==== Map file ====&lt;br /&gt;
File fed to -map option, containing chromosome, marker name, and marker coordinate (in base pairs) information for each marker. Markers should be stored in the same order as in the marker information file. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Options ==&lt;br /&gt;
=== Required options ===&lt;br /&gt;
==== window size ====&lt;br /&gt;
Window size can be specified by one of the following three options: (1) -nWindows (2) -windowSize and (3) -windowLength. &amp;lt;br&amp;gt;&lt;br /&gt;
-nWindows specifies the number of windows to split into and the program splits markers evenly into output windows. &amp;lt;br&amp;gt;&lt;br /&gt;
-windowSize specifies the number of markers in one output window. The remainder goes to the last window. &amp;lt;br&amp;gt;&lt;br /&gt;
-windowLength specifies the length (in base pairs) of one output window. The remainder goes to the last window. Note that this option is only allowed when map input file is specified. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== flanking region ====&lt;br /&gt;
Size of flanking region on each side can be specified by one of the following two options: (1) -overlapSize and (2) -overlapLength. &amp;lt;br&amp;gt;&lt;br /&gt;
-overlapSize specifies the number of markers in each flanking region (so that the total number of flanking markers for each window is twice the number specified except for the first and last window). &amp;lt;br&amp;gt;&lt;br /&gt;
-overlapLength specifies the length (in base pairs) of each flanking region (so that the total length of the flanking regions is twice the number specified except for the first and last window). &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Output prefix ====&lt;br /&gt;
Specified by -o option. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Additional options ===&lt;br /&gt;
==== Estimate window size only ====&lt;br /&gt;
This is controlled by -extimateWindowOnly option. By default, splitting is performed. &amp;lt;br&amp;gt;&lt;br /&gt;
But if one only wishes to peek into how the markers are allocated into output windows, use &amp;quot;-extimateWindowOnly 1&amp;quot;. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example Commands ==&lt;br /&gt;
  splitRef.pl -hap example.hap.gz -snps example.snps -map example.map -windowLength 10000000 -overlapLength 1000000 &lt;br /&gt;
  splitRef.pl -hap example.hap.gz -snps example.snps -windowSize 10000 -overlapSize 1000 &lt;br /&gt;
  splitRef.pl -hap example.hap.gz -snps example.snps -nWindows 12 -overlapSize 1000 &lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
You can download splitPed at [http://www.sph.umich.edu/csg/yli/splitRef/download/ splitRef Download Page].&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=2612</id>
		<title>MaCH FAQ</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=MaCH_FAQ&amp;diff=2612"/>
		<updated>2010-12-05T13:18:47Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: /* How do I get reference files for an region of interest? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to speed up? ==&lt;br /&gt;
&lt;br /&gt;
=== minimac ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Minimac minimac] for details.&lt;br /&gt;
&lt;br /&gt;
=== Divide and Conquer ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/Mach_DAC MaCH Divide and Conquer] for details.&lt;br /&gt;
&lt;br /&gt;
=== 2-step imputation ===&lt;br /&gt;
See [http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F 2-step imputation] for details. &lt;br /&gt;
&lt;br /&gt;
== Why and how to perform a 2-step imputation?  ==&lt;br /&gt;
&lt;br /&gt;
When one has a large number of individuals (&amp;amp;gt;1000), we recommend a 2-step imputation to speed up. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; A 2-step imputation contains the following 2 steps:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 1) a representative subset of &amp;amp;gt;= 200 unrelated individuals are used to calibrate model parameters; and&amp;lt;br&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; (step 2) actual genotype imputation is performed for every person using parameters inferred in step 1. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; Example command lines for a 2-step imputation:&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 # step 1:&lt;br /&gt;
 mach1 -d sample.dat -p subset.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip -r 100 -o par_infer &amp;amp;gt; mach.infer.log&lt;br /&gt;
&lt;br /&gt;
 # step 2:&lt;br /&gt;
 mach1 -d sample.dat -p sample.ped -s chr20.snps -h chr20.hap --compact --greedy --autoFlip --errorMap par_infer.erate --crossoverMap par_infer.rec --mle --mldetails &amp;amp;gt; mach.imp.log&lt;br /&gt;
&lt;br /&gt;
In step1, one can use --greedy in combination with --states XX in MaCH versions 16.b and above. We have found that using 1/3 of the reference haplotypes (with 1/9 computational time) results in almost no power loss for the current HapMap and 1000G reference panels.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In step2, each individual is imputed independently and can therefore be split into as many as n (sample size) jobs for each chromosome for parallelism.&lt;br /&gt;
&lt;br /&gt;
For other approaches to speed up, see [how to speed up].&lt;br /&gt;
&lt;br /&gt;
== Can MaCH perform imputation for chromosome X? ==&lt;br /&gt;
Yes. See [http://genome.sph.umich.edu/wiki/MaCH:_machX MaCH X Chromosome] for details.&lt;br /&gt;
&lt;br /&gt;
== Where can I find combined HapMap reference files?  ==&lt;br /&gt;
&lt;br /&gt;
You can find them at http://www.sph.umich.edu/csg/yli/mach/download/HapMap-r21.html or on the HapMap Project website.&lt;br /&gt;
&lt;br /&gt;
== Where can I find HapMap III / 1000 Genomes reference files? ==&lt;br /&gt;
&lt;br /&gt;
You can find these at the MaCH download page, which is at http://www.sph.umich.edu/csg/yli/mach/download/&lt;br /&gt;
&lt;br /&gt;
== Does --mle overwrite input genotypes?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, but not often. The --mle option outputs the most likely genotype configuration taking into account observed genotypes and integration over the most similar reference haplotypes. The original genotypes will be changed only if the underlying reference haplotypes strongly contradict the input genotype. &lt;br /&gt;
&lt;br /&gt;
== How do I get imputation quality estimates? ==&lt;br /&gt;
&lt;br /&gt;
A simple approach is to use --mask option (in the second step alone if using two-step imputation). For example, --mask 0.02 masks 2% of the genotypes at random, impute them and compare with the masked original to estimate genotypic and allelic error rates. Messages like the following will be generated to stdout: &lt;br /&gt;
&lt;br /&gt;
  Comparing 948352 masked genotypes with MLE estimates ...&lt;br /&gt;
  Estimated per genotype error rate is 0.0568&lt;br /&gt;
  Estimated per allele error rate is 0.0293 &lt;br /&gt;
&lt;br /&gt;
A better approach is to mask a small proportion of SNPs (vs. genotypes in the above simple approach). One can generate a mask.dat from the original .dat file by simply changing the flag of a subset of markers from M to S2 without duplicating the .ped file. Post-imputation, one can use&amp;amp;nbsp;&amp;amp;nbsp; [http://www.sph.umich.edu/csg/ylwtx/CalcMatch.1.0.5.tgz CalcMatch ]and [http://www.sph.umich.edu/csg/ylwtx/doseR2.tgz doseR2.pl ]to estimate genotypic/allelic error rate and correlation respectively. Both programs can be downloaded from [http://www.sph.umich.edu/csg/ylwtx/software.html http://www.sph.umich.edu/csg/ylwtx/software.html]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Imputation involving masked datasets should be performed separately for imputation quality estimation. For production, one should use all available information.&lt;br /&gt;
&lt;br /&gt;
== How do I interpret the imputation quality estimates? ==&lt;br /&gt;
In the simple approach, you will only get concordance/error estimates. There are two aspects to check. (1) the ratio between the genotypic error and allelic error. We expect that only a small proportion of errors where one homozygote is imputed as the other homozygote. Therefore, a ~2:1 ratio is expected. (2) the absolute error rate. There are several factors influencing imputation quality including the population to be imputed, the reference population and the genotyping panel used. Typically, we expect &amp;lt;2% allelic error rate among Caucasians and East Asians; 3-5% among Africans and African Americans. Figure below show imputation quality from the Human Genome Diversity Project (HGDP) for 52 populations across the world and by different HapMap reference panel.&lt;br /&gt;
&lt;br /&gt;
http://www.sph.umich.edu/csg/yli/figure3.gif&lt;br /&gt;
&lt;br /&gt;
Table 3 in the MaCH 1.0 paper  tabulates imputation quality by commercial panel in CEU, YRI, and CHB+JPT.&lt;br /&gt;
&lt;br /&gt;
== Shall I apply QC before or after imputation? If so, how? ==&lt;br /&gt;
&lt;br /&gt;
We strongly recommend QC both before and after imputation. Before imputation, we recommend the standard battery of QC filters including HWE, MAF (recommended cutoff is 1% for genotyping-based GWAS), completeness, Mendelian inconsistency etc. Post-imputation, we recommend Rsq 0.3 (which removes &amp;amp;gt;70% of poorly-imputed SNPs at the cost of &amp;amp;lt;0.5% well-imputed SNPs) and MAF of 1%. &lt;br /&gt;
&lt;br /&gt;
== How do I get reference files for an region of interest? ==&lt;br /&gt;
&lt;br /&gt;
1. For HapMapII format, download haplotypes from http://www.sph.umich.edu/csg/ylwtx/HapMapForMach.tgz &amp;lt;br&amp;gt;&lt;br /&gt;
2. For MACH format, you can do the following: &lt;br /&gt;
&lt;br /&gt;
*First, find the first and last SNP in the region you are interested in. Say &amp;quot;rsFIRST&amp;quot; and &amp;quot;rsLAST&amp;quot;, defined according to position. &lt;br /&gt;
*Then:&lt;br /&gt;
&lt;br /&gt;
  @ first = `grep -n rsFIRST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
  @ last = `grep -n rsLAST orig.snps | cut -f1 -d &#039;:&#039;`&lt;br /&gt;
&lt;br /&gt;
*Finally (assuming the third field contains the actual haplotypes, where alleles are separated by whitespace):&lt;br /&gt;
&lt;br /&gt;
  awk &#039;{print $3}&#039; orig.hap | cut -c${first}-${last} &amp;amp;gt; region.hap&lt;br /&gt;
&lt;br /&gt;
The created reference files are in MaCH format. You do NOT need to turn on --hapmapFormat option.&lt;br /&gt;
&lt;br /&gt;
== Do I always have to sort the pedigree file by marker position?  ==&lt;br /&gt;
&lt;br /&gt;
If you use a reference set of haplotypes, you do not have to as long as the external reference is in correct order. **HOWEVER**, you will probably avoid problems by including markers in the pedigree file sorted in chromosome order. &lt;br /&gt;
&lt;br /&gt;
== What if I specify &#039;&#039;--states R&#039;&#039; where &#039;&#039;R&#039;&#039; exceeds the maximum possible (2*number diploid individuals - 2 + number_haplotypes)?  ==&lt;br /&gt;
&lt;br /&gt;
Mach caps the number of states at the maximum possible value. &lt;br /&gt;
&lt;br /&gt;
== How is AL1 defined? Which allele dosage is .dose/.mldose counting?  ==&lt;br /&gt;
&lt;br /&gt;
AL1 is an arbitrary allele. Typically, it is the first allele read in the reference haplotypes. The earliest versions (prior to April 2007) of mach counted the expected number copies of AL2 and more recent versions count the number of AL1. One can find out which allele is counted following the steps below. &lt;br /&gt;
&lt;br /&gt;
#. First, find the two alleles for one of the markers in your data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -2 mlinfo/chr21.mlinfo &lt;br /&gt;
 SNP      Al1 Al2 Freq1   MAF    Quality  Rsq &lt;br /&gt;
 rs885550 2   4   0.9840  0.0160  0.9682  0.992&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Second, check the dosage for a few individuals at this SNP.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -3 mldose/chr21.mldose | cut -f3 -d &#039; &#039; &lt;br /&gt;
 1.962 &lt;br /&gt;
 1.000&lt;br /&gt;
 0.078&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
#. Finally, compare these dosages to genotypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 prompt&amp;gt; head -1 mlgeno/chr21.mlgeno | cut -f3 -d &#039; &#039; &lt;br /&gt;
 2/2 &lt;br /&gt;
 2/4&lt;br /&gt;
 4/4&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In this example, you can see that the first individual has a high dosage count (1.962) and most likely genotype 2/2. The last individual has a low dosage count and most likely genotype 4/4. Thus, the output corresponds to version of Mach released after April 2007, which should tally allele 1 counts. &lt;br /&gt;
&lt;br /&gt;
Note that, on the example above, .mldose could be replaced with .dose and .mlgeno could be replaced with .geno. &lt;br /&gt;
&lt;br /&gt;
Based on the three files above, we&#039;ve confirmed that dosage is the number of AL1 copies: you will only to check for one informative case (i.e, dosage values close to 0 or 2) since it&#039;s consistent across all individuals and all SNPs.&lt;br /&gt;
&lt;br /&gt;
== Can I used an unphased reference?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. You could create pedigree (.ped) and data files (.dat) that include both reference panel and sample genotypes or request that MaCH merge apppropriate files on the fly. &lt;br /&gt;
&lt;br /&gt;
For example, if you have: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;reference.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 REF1 REF1 0 0 1 A/C C/C G/G G/A A/A&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP4 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sample.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 1 1 0 0 1 A/A G/G&lt;br /&gt;
&lt;br /&gt;
Your could create a combined data set as: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.dat&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 M SNP1&lt;br /&gt;
 M SNP2&lt;br /&gt;
 M SNP3&lt;br /&gt;
 M SNP4&lt;br /&gt;
 M SNP5&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;comb.ped&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
REF1 REF1 0 0 1 A/C C/C G/G G/A A/A &lt;br /&gt;
   1    1 0 0 1 A/A ./. ./. G/G ./. &lt;br /&gt;
&lt;br /&gt;
Equivalently, you could write -d reference.dat,sample.dat -p reference.ped,sample.ped on the command line and MACH would merge both files &#039;&#039;on-the-fly&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== How big are the imputation output file? ==&lt;br /&gt;
For 1,000 individuals with 8 million SNPs, gz compressed geno/dose/prob files take ~5Gb/10Gb/15Gb.&lt;br /&gt;
&lt;br /&gt;
== How long does imputation take? ==&lt;br /&gt;
&lt;br /&gt;
The following factors/parameters affect computational time: &lt;br /&gt;
&lt;br /&gt;
#m, # of genotyped markers (number of markers in .dat file)&amp;lt;br&amp;gt; &lt;br /&gt;
#n, # of individuals&amp;lt;br&amp;gt; &lt;br /&gt;
#h, # of reference haplotypes (determined by --greedy or states, by default, h = 2*number diploid individuals - 2 + number_haplotypes)&amp;lt;br&amp;gt; &lt;br /&gt;
#r, # of rounds (-r or --rounds, --mle corresponds to 1-2 rounds)&lt;br /&gt;
&lt;br /&gt;
Computational time increases linearly with m, n, r and quadratically with h. On our Xeon 3.0GHz machine, imputation with m=25K, n=250, h=120, and r=100 takes ~20 hours (25000*250*120^2*100/4.5/10^11). &lt;br /&gt;
&lt;br /&gt;
If you have a larger number of individuals to impute (e.g., &amp;gt; 1,000), we recommend a 2-step imputation manner http://genome.sph.umich.edu/wiki/MaCH_FAQ#Why_and_how_to_perform_a_2-step_imputation.3F.&lt;br /&gt;
&lt;br /&gt;
== undefined symbol: gzopen64 ==&lt;br /&gt;
If you see this message, you will need to re-compile the program. Type the following commands:&lt;br /&gt;
&lt;br /&gt;
  make clear&lt;br /&gt;
  make all&lt;br /&gt;
&lt;br /&gt;
New executables mach1 and thunder will then be generated under folder executables/&lt;br /&gt;
&lt;br /&gt;
== More questions?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li] or [mailto:goncalo@umich.edu Goncalo Abecasis].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Mach_DAC&amp;diff=2597</id>
		<title>Mach DAC</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Mach_DAC&amp;diff=2597"/>
		<updated>2010-11-29T20:18:24Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the MaCH Divide and Conquer page, documenting how to break the genome into smaller pieces before imputation/phasing and how to ligate after imputation/phasing.&lt;br /&gt;
&lt;br /&gt;
== Phasing without External Reference ==&lt;br /&gt;
=== Your Data ===&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 Merlin tutorial [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html]. &amp;lt;br&amp;gt;&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). &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Split Your Data ===&lt;br /&gt;
You can split your data using [http://www.sph.umich.edu/csg/yli/splitPed/ splitPed].&lt;br /&gt;
&lt;br /&gt;
== Phasing/Imputation with External Reference ==&lt;br /&gt;
When you phase/impute with external reference panel, you will only need to break the reference files into parts containing subsets of markers because SNPs in your own data (pedigree files) but not in reference files will be automatically ignored by MaCH and minimac. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Post Phasing/Imputation Ligation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Mach_DAC&amp;diff=2592</id>
		<title>Mach DAC</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Mach_DAC&amp;diff=2592"/>
		<updated>2010-11-29T19:33:53Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the MaCH Divide and Conquer page, documenting how to break the genome into smaller pieces before imputation/phasing and how to ligate after imputation/phasing.&lt;br /&gt;
&lt;br /&gt;
== Phasing without External Reference ==&lt;br /&gt;
=== Your Data ===&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 Merlin tutorial [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html]. &amp;lt;br&amp;gt;&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). &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Split Your Data ===&lt;br /&gt;
You can split your data using [http://www.sph.umich.edu/csg/yli/splitPed/ splitPed].&lt;br /&gt;
&lt;br /&gt;
== Phasing/Imputation with External Reference ==&lt;br /&gt;
When you phase/impute with external reference panel, you will only need to break the reference files into parts containing subsets of markers because SNPs in your own data (pedigree files) but not in reference files will be automatically ignored by MaCH and minimac. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can split the reference files using [http://www.sph.umich.edu/csg/yli/splitPed/ splitHap].&lt;br /&gt;
&lt;br /&gt;
== Post Phasing/Imputation Ligation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Mach_DAC&amp;diff=2591</id>
		<title>Mach DAC</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Mach_DAC&amp;diff=2591"/>
		<updated>2010-11-29T18:52:23Z</updated>

		<summary type="html">&lt;p&gt;Ylwtx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the MaCH Divide and Conquer page, documenting how to break the genome into smaller pieces before imputation/phasing and how to ligate after imputation/phasing.&lt;br /&gt;
&lt;br /&gt;
== Phase without External Reference ==&lt;br /&gt;
=== Your Data ===&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 Merlin tutorial [http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html]. &amp;lt;br&amp;gt;&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). &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Split Your Data ===&lt;br /&gt;
You can split your data using [http://www.sph.umich.edu/csg/yli/splitPed/ splitPed].&lt;br /&gt;
&lt;br /&gt;
== Phase/Imputation with External Reference ==&lt;br /&gt;
&lt;br /&gt;
== Questions and Comments?  ==&lt;br /&gt;
&lt;br /&gt;
Email [mailto:yunli@med.unc.edu Yun Li].&lt;/div&gt;</summary>
		<author><name>Ylwtx</name></author>
	</entry>
</feed>