Changes

From Genome Analysis Wiki
Jump to navigationJump to search
6,941 bytes added ,  12:53, 9 March 2018
no edit summary
Line 1: Line 1:  +
'''You may want to learn about new and improved [[Minimac4]].'''
 +
 
'''minimac''' 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, "mini", refers to the modest amount of computational resources it requires. The second, "mac", is short hand for [[MaCH]], our widely used algorithm for genotype imputation.
 
'''minimac''' 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, "mini", refers to the modest amount of computational resources it requires. The second, "mac", is short hand for [[MaCH]], our widely used algorithm for genotype imputation.
 +
 +
There are several minimac related pages on this wiki. The major ones are:
 +
 +
* [[Minimac]] - This page, the main minimac page.
 +
* [[Minimac: Tutorial]] - A short minimac tutorial.
 +
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac
 +
* [[Minimac Command Reference]] - Summary of minimac options
 +
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac
 +
 +
*[https://imputationserver.sph.umich.edu Imputation server] - We are running imputation (and pre-phasing) for you!
 +
 +
    
= Download =
 
= Download =
 +
A binary Linux (64 bit) version of minimac is available [http://csg.sph.umich.edu/cfuchsb/minimac-beta-2013.7.17.tgz  from here] and source code [http://csg.sph.umich.edu/cfuchsb/minimac.src.tgz  from here]
 +
 +
The current version of minimac should be stamped 2013.7.17 - if your version shows a different version number or date stamp when it runs, it is not current.
   −
A full release of <code>minimac</code> is expected here in October 2010. In the meantime, a binary only Linux version of minimac is available [http://www.sph.umich.edu/csg/cfuchsb/minimac-beta-static-2010.10.12.tar.gz from here]  for those who are eager to try it out. If you use this beta version, please be sure to stop by the [http://www.sph.umich.edu/csg/abecasis/MaCH/downloads/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available.
+
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.  
    
== Multiprocessor Version ==
 
== Multiprocessor Version ==
    
The current version of minimac comes in two flavours, <code>minimac</code> and <code>minimac-omp</code>. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.
 
The current version of minimac comes in two flavours, <code>minimac</code> and <code>minimac-omp</code>. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.
 +
 +
BE AWARE: since this version of minimac runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.
 +
 +
== Change log ==
 +
 +
2013.7.17
 +
 +
- minor bug fixes
 +
 +
-- all variants (SNPs, InDels, SVs) in the reference VCF will be imputed - independent from the FILTER column setting
 +
 +
- improved performance (Thanks to David Hinds - see also [[minimac2]] for the full set of performance improvements)
 +
 +
2012.11.16
 +
 +
- minor bug fixes
 +
 +
2012.10.9
 +
 +
- added: improved support for [http://www.shapeit.fr ShapeIT] phased haplotypes
 +
 +
2012.10.3
 +
 +
- added: full support for reference panel based chunking
 +
 +
2012.9.22
 +
 +
- fixed: chunk chromosome bug
 +
 +
2012.8.6 (early adopter)
 +
 +
- added: chromosome X support
 +
 +
2012.3.14
 +
 +
- fixed: problem with --startposition
 +
 +
2012.2.29
 +
 +
- added: VCF support
 +
 +
- added: IDR (Insertion, Deletion, Reference) support
    
== Questions and Comments ==
 
== Questions and Comments ==
Line 16: Line 75:     
== Pre-phasing ==
 
== Pre-phasing ==
For the pre-phasing step the cost for increasing the number of states is quadratically and the cost for rounds is linear.
+
For the pre-phasing step, cost increases quadratically with the number of states and linearly with the number of rounds. The following table provides a simple example.
 
      
{| class="wikitable" border="1" cellpadding="2"
 
{| class="wikitable" border="1" cellpadding="2"
 
|- bgcolor="lightgray"
 
|- bgcolor="lightgray"
 
! States
 
! States
! Cost
+
! Cost per round
 
|-  
 
|-  
 
| 100 states
 
| 100 states
| 3min
+
| 3 min
 +
|-
 
| 200 states
 
| 200 states
| 12min = (3min * 2^2)
+
| 12 min = (3 min * 2<sup>2</sup>)
 +
|-
 
| 400 states
 
| 400 states
| 56min = (3min * 4^2)
+
| 48 min = (3 min * 4<sup>2</sup>)
 +
|-
 
| 500 states
 
| 500 states
| 75min = (3min * 5^2)
+
| 75 min = (3 min * 5<sup>2</sup>)
 
|}
 
|}
    +
So, in this case running haplotyping with 500 states and 10 rounds would require 75 min * 10 = 750 min.
   −
rounds is linear: 500states 10rounds = 750min * 10 = 7500 min
+
Typically, haplotype quality improves rapidly with the number of states but only slowly with the number of rounds. We recommend running ~20 rounds of the MaCH haplotyper and selecting a number of states as high as your patience will allow (but ideally greater than 200).
 
  −
 
  −
 
      
== Imputation ==
 
== Imputation ==
Line 49: Line 108:  
</math>
 
</math>
   −
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.  
+
These statistics refer to a single core in a modern Intel CPU core and, although your mileage will vary, most modern CPUs should be no more than a few times faster (or slower) than that.  
    
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:
 
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:
Line 69: Line 128:  
=== Preparing Your Data ===
 
=== Preparing Your Data ===
   −
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].  
+
To get started, you will need to store your data in [[Merlin]] format pedigree and data files, one per chromosome. For details, of the Merlin file format, see the [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin Tutorial].  
    
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as 'A', 'C', 'G' or 'T' (there is no need to use numeric identifiers for each allele).  
 
Within each file, markers should be stored by chromosome position. Alleles should be stored in the forward strand and can be encoded as 'A', 'C', 'G' or 'T' (there is no need to use numeric identifiers for each allele).  
Line 76: Line 135:     
If figuring out position and strand for each marker seems like hard work, don't despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.
 
If figuring out position and strand for each marker seems like hard work, don't despair. For you, this should be the hardest bit of the entire process! For the computer, the fun is about to start.
 +
 +
==== NCBI build 36 / NCBI build 37 ====
 +
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:
 +
some SNPs will ordered differently in each genome build (we expect order will be more accurate in more recent builds!). Purists will claim that imputation using NCBI build 36 and NCBI build 37 reference panels requires phasing using the exact same reference panel -- others will claim this makes little difference.
    
=== Running MaCH ===
 
=== Running MaCH ===
Line 91: Line 154:  
|-  
 
|-  
 
|style=white-space:nowrap|<code>-d sample.dat</code>
 
|style=white-space:nowrap|<code>-d sample.dat</code>
| 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.
+
| Data file in [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin format]. Markers should be listed according to their order along the chromosome.
 
|-  
 
|-  
 
| <code>-p sample.ped</code>
 
| <code>-p sample.ped</code>
| 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.
+
| Pedigree file in [http://csg.sph.umich.edu/abecasis/Merlin/tour/input_files.html Merlin format]. Alleles should be labeled on the forward strand.
 
|-
 
|-
 
| <code>--states 200</code>
 
| <code>--states 200</code>
| 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.  
+
| Number of haplotypes to consider during each update. Increasing this value will typically lead to better haplotypes, but can dramatically increase computing time and memory use. A value of 200 - 400 is typical.  
 
|-
 
|-
 
| <code>--rounds 20</code>
 
| <code>--rounds 20</code>
| 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 <code>--states</code> parameter.
+
| Iterations of the Markov sampler to use for haplotyping. Typically, using 20 - 30 rounds should give good results. To obtain better results, it is usually better to increase the <code>--states</code> parameter.
 
|-
 
|-
 
| <code>--interim 5</code>
 
| <code>--interim 5</code>
Line 117: Line 180:  
== Imputation into Phased Haplotypes ==
 
== Imputation into Phased Haplotypes ==
   −
Imputing genotypes using '''minimac''' 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.
+
Imputing genotypes using '''minimac''' is an easy and straightforward process: after selecting a set of reference haplotypes, plugging-in the target haplotypes from the previous step and setting the number of rounds to use for the model parameter estimation, imputation should proceed rapidly.
 +
 
 +
=== Creating SNP List File ===
 +
 
 +
'''Minimac''' requires a file listing markers in the haplotype file. This file can be easily generated by extracting the second column from the .dat file. In a standard Unix system, a command like this should do:
 +
 
 +
  cut -f 2 -d " " sample.dat > target.snps
    
=== Running Minimac ===
 
=== Running Minimac ===
    
A typical minimac command line might look like this:
 
A typical minimac command line might look like this:
 +
 +
==== using a VCF reference panel  ====
 +
  minimac --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results
 +
 +
'''Note''': GWAS SNPs (file --snps target.snps.gz) are by default expected to be in the chr:pos format e.g. 1:1000 and on build37/hg19; otherwise, please set the --rs flag
 +
 +
==== using a MaCH reference panel  ====
    
   minimac --refHaps ref.hap.gz --refSnps ref.snps.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results
 
   minimac --refHaps ref.hap.gz --refSnps ref.snps.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results
Line 136: Line 212:  
|-  
 
|-  
 
| <code>--refHaps ref.hap.gz </code>  
 
| <code>--refHaps ref.hap.gz </code>  
| Reference haplotypes (e.g. from [http://www.sph.umich.edu/csg/abecasis/MACH/download/1000G-2010-06.html MaCH download page])
+
| Reference haplotypes (e.g. from [http://csg.sph.umich.edu/abecasis/MACH/download/ MaCH download page])
 +
|-
 +
| <code>--vcfReference </code>
 +
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.
 +
|-
 +
| <code>--rs </code>
 +
| In combination with --vcfReference, allows to use rs GWAS SNP identifiers
 
|-  
 
|-  
 
| <code>--snps target.snps.gz </code>
 
| <code>--snps target.snps.gz </code>
Line 143: Line 225:  
| <code>--haps target.hap.gz </code>
 
| <code>--haps target.hap.gz </code>
 
| Phased haplotypes where missing genotypes will be imputed.
 
| Phased haplotypes where missing genotypes will be imputed.
 +
|-
 +
| <code>--sample target.sample </code>
 +
| Sample list in ShapeIT format.
 +
|-
 +
| <code>--shape_haps target.hap.gz </code>
 +
| ShapeIT phased haplotypes where missing genotypes will be imputed.
 +
|-
 +
| <code>--chr 22</code>
 +
| Chromosome for which we will carry out imputation (needed to run ShapeIT with chr:pos identifiers - default setting).
 
|-  
 
|-  
 
| <code>--rounds 5</code>
 
| <code>--rounds 5</code>
Line 156: Line 247:  
=== Reference Haplotypes ===
 
=== Reference Haplotypes ===
   −
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-06.html MaCH download page]. The most recent set of haplotypes were generated in June 2010 by combining genotype calls generated at the Broad, Sanger and the University of Michigan. In our hands, this June 2010 release is substantially better than previous 1000 Genome Project genotype call sets.
+
Reference haplotypes generated by the 1000 Genomes project and formatted so that they are ready for analysis are available from the [http://csg.sph.umich.edu/abecasis/MACH/download/ MaCH download page]. As of this writing, the most recent set of haplotypes are based on genotype calls were generated in May 2011 and are an interim analysis of Project's Phase I data.
 +
 
 +
=== Imputation quality evaluation ===
 +
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:
 +
* looRSQ - this is the estimated rsq for that SNP (as if SNP weren't typed).
 +
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped.
 +
* empRSQ - this is the actual R2 value, comparing imputed and true genotypes.
 +
 
 +
These statistics can be found in the .info file
 +
 
 +
=== Additional Sources of Information ===
 +
 
 +
If the combination of MaCH and Minimac still runs too slowly for you, and you have access to a multi-processor compute cluster, you can look at [[ChunkChromosome]] page to learn how to conveniently split each chromosome into multiple segments that can be analyzed in parallel. For information on how to put the resulting chunks back together, see [[Ligate Minimac|this page]].
 +
 
 +
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].
 +
 
 +
== X Chromosome Imputation ==
 +
minimac supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).
 +
 
 +
# Split the X chromosome pedigree file by sex.
 +
## For females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac).
 +
## For males
 +
### 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)
 +
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  "0" or "." or "N" ) and impute using minimac as described above.
 +
 
 +
 
 +
 
 +
::::  '''<Example of a male only pedigree file>'''
 +
:::: FAM1003  ID1234  0  0  M  A/A  A/A  C/C
 +
:::: FAM1004  ID5678  0  0  M  0/0  C/0  G/G
 +
::::  ...
 +
::::  '''<End of pedigree file>'''
 +
 
 +
:::: ''Note that, consistent with the Merlin convention, hemizygous males are listed as if they were homozygous.''
 +
 
 +
::::  '''<Example of the corresponding haplotype file>'''
 +
::::  FAM1003->ID1234 HAPLO1 AAC
 +
::::  FAM1003->ID1234 HAPLO2 AAC
 +
::::  FAM1004->ID5678 HAPLO1 0CG
 +
::::  FAM1004->ID5678 HAPLO2 0CG
 +
::::  ...
 +
::::  '''<End of the corresponding haplotype file>'''
 +
 
 +
= Post-imputation Association Analysis =
 +
== Quantitative Traits ==
 +
Please use [http://csg.sph.umich.edu/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].
 +
 
 +
== Binary Traits ==
 +
Please use [http://csg.sph.umich.edu/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.
 +
 
 +
= Reference =
 +
 
 +
If you use [[minimac]] or [[minimac2]] please cite:
 +
 
 +
Fuchsberger C, Abecasis GR, Hinds DA. minimac2: faster genotype imputation. Bioinformatics 2014 [http://bioinformatics.oxfordjournals.org/content/early/2014/10/22/bioinformatics.btu704.short]
 +
 
 +
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.
 +
Fast and accurate genotype imputation in genome-wide association studies
 +
through pre-phasing. Nature Genetics 2012 [http://www.nature.com/ng/journal/vaop/ncurrent/full/ng.2354.html]
 +
 
 +
= Questions and Comments =
 +
 
 +
Please contact [mailto:goncalo@umich.edu Goncalo Abecasis] or [mailto:cfuchsb@umich.edu Christian Fuchsberger].
    
= Related Pages =
 
= Related Pages =
487

edits

Navigation menu