Changes

From Genome Analysis Wiki
Jump to navigationJump to search
689 bytes added ,  12:53, 9 March 2018
no edit summary
Line 1: Line 1: −
'''minimac2''' is an improved version of minimac. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, "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.
+
'''New Version [[Minimac4]] available ! Please Check out !!!'''
 +
 
 +
'''minimac2''' is an improved version of [[Minimac]]. It is designed to work on phased genotypes and can handle very large reference panels with hundreds or thousands of haplotypes. The name has two parts. The first, "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(2) related pages on this wiki. The major ones are:
 
There are several minimac(2) related pages on this wiki. The major ones are:
   −
* [[Minimac]] - This page, the main minimac page.
+
* [[Minimac2]] - This page, the main minimac2 page.
* [[Minimac: Tutorial]] - A short minimac tutorial.
+
* [[Minimac: Tutorial]] - A short minimac(2) tutorial.
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac
+
* [[Minimac: 1000 Genomes Imputation Cookbook]] - Cookbook instructions for 1000 Genomes Imputation with Minimac(2)
* [[Minimac Command Reference]] - Summary of minimac options
+
* [[Minimac Command Reference]] - Summary of minimac(2) options
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac
+
* [[Minimac Diagnostics]] - Summary of diagnostics for imputation performance generated by minimac(2)
   −
*[https://imputationserver.sph.umich.edu Imputation server] - We are running imputation (and pre-phasing) for you!
+
* We are happy to run imputation (and pre-phasing) for you: try our [https://imputationserver.sph.umich.edu Imputation server]
          
= Download =
 
= Download =
 +
A binary Linux (64 bit) version of minimac2 is available [http://csg.sph.umich.edu/cfuchsb/minimac2.2014.9.15.tgz  from here] and source code [http://csg.sph.umich.edu/cfuchsb/minimac2.2014.9.15.src.tgz from here]. For compiling the source code, you need a recent [https://gcc.gnu.org gcc] (>=4.8), [http://www.openblas.net OpenBlas ], and [https://gcc.gnu.org/fortran/ GFortran].
    +
The current version of minimac2 should be stamped  2014.9.15 - if your version shows a different version number or date stamp when it runs, it is not current.
 +
 +
If you use this version, please be sure to stop by the [http://csg.sph.umich.edu/abecasis/MaCH/download/ MaCH download page] and fill out the registration form, so that we can let you know when an official release is available and keep you updated with respect to any bug fixes.
    
== Multiprocessor Version ==
 
== Multiprocessor Version ==
    +
Minimac2 comes in two flavours, <code>minimac2</code> and <code>minimac2-omp</code>. The latter version uses the [[OpenMP]] protocol to support multi-threading, resulting in faster throughput.
 +
 +
BE AWARE: since this version of minimac2 runs in parallel the order of samples in the output files (*dose, *haps,...) will vary between runs. Therefore, e.g. chunks have to be merged by sample id.
 +
[[Ligate_Minimac]] will help you with this.
    
== Change log ==
 
== Change log ==
    +
2014.9.15 - initial release
    
== Questions and Comments ==
 
== Questions and Comments ==
Line 28: Line 39:  
= Performance =
 
= Performance =
   −
== Pre-phasing ==
+
== Imputation ==
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"
+
A good rule of thumb is that minimac2 should take about 1 hour to impute 1,000,000 markers in 1,000 individuals using a reference panel with 1000 haplotypes (>10x faster than [[minimac]] 2012.11.16). Performance should scale linearly with respect to all these factors. So, your approximate computing time in hours should be about:
|- bgcolor="lightgray"
+
 
! States
+
:<math>
! Cost per round
+
E(\mbox{Run Time in Hours}) = N_{markers} * N_{individuals} * N_{haplotypes} * 10^{-10}
|-
+
</math>
| 100 states
+
 
| 3 min
+
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.
|-
+
 
| 200 states
+
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:
| 12 min = (3 min * 2<sup>2</sup>)
  −
|-
  −
| 400 states
  −
| 48 min = (3 min * 4<sup>2</sup>)
  −
|-
  −
| 500 states
  −
| 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.
+
:<math>
 +
E(\mbox{Run Time in Hours}) = N_{markers} * ({N_{individuals} + N_{rounds} * N_{states} * 0.75 }) * N_{haplotypes} * 10^{-10}
 +
</math>
   −
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).
+
In this updated formula, N<sub>rounds</sub> represents the number of iterations used for parameter refinement and N<sub>states</sub> represents the maximum number of reference and target haplotypes considered for each update.
    
= Getting Started =
 
= Getting Started =
   −
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.  
+
Using minimac2 for genotype imputation involves two steps. First, you will have to estimate haplotypes for your entire sample -- this will be the more computationally demanding step. Once that is done, you will be ready to quickly impute missing genotypes using the reference panel of your choice.  
    
== Estimating Haplotypes for Your Sample ==
 
== Estimating Haplotypes for Your Sample ==
   −
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.  
+
For the haplotyping step, you can use [[MaCH]] with the --phase command line option or [https://mathgen.stats.ox.ac.uk/genetics_software/shapeit/shapeit.html ShapeIT]. As input [[MaCH]] will need [[Merlin]] format pedigree and data files. All markers should be ordered according to their physical position and alleles should be labeled on the forward strand.  
    
=== 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).  
  −
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.
      
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 89: Line 88:  
|-  
 
|-  
 
|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>
Line 115: Line 114:  
== Imputation into Phased Haplotypes ==
 
== Imputation into Phased Haplotypes ==
   −
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.
+
Imputing genotypes using '''minimac2''' 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 ===
 
=== 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:
+
'''Minimac2''' 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
 
   cut -f 2 -d " " sample.dat > target.snps
   −
=== Running Minimac ===
+
=== Running Minimac2 ===
   −
A typical minimac command line might look like this:
+
A typical minimac2 command line might look like this:
    
==== using a VCF reference panel  ====
 
==== 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
+
   minimac2 --vcfReference --refHaps ref.vcf.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200  
 
+
--vcfchr 20 --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  ====
+
'''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
   −
  minimac --refHaps ref.hap.gz --refSnps ref.snps.gz --haps target.hap.gz --snps target.snps.gz --rounds 5 --states 200 --prefix results
+
A detailed description of all minimac2 options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:
 
  −
A detailed description of all minimac options is available [[Minimac Command Reference|elsewhere]]. Here is a brief description of the above parameters:
      
{| class="wikitable" border="1" cellpadding="2"
 
{| class="wikitable" border="1" cellpadding="2"
Line 147: Line 143:  
|-  
 
|-  
 
| <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/ MaCH download page])
+
| Reference haplotypes (e.g. from [http://csg.sph.umich.edu/abecasis/MACH/download/ MaCH download page])
 
|-  
 
|-  
 
| <code>--vcfReference </code>  
 
| <code>--vcfReference </code>  
 
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.
 
| This option specifies that the provided --refHaps file is provided in VCF format , no --refSNPs file needed.
 +
|-
 +
| <code>--vcfchr </code>
 +
| Chromosome for which we will carry out imputation.
 
|-  
 
|-  
 
| <code>--rs </code>  
 
| <code>--rs </code>  
Line 182: Line 181:  
=== 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/ 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.
+
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].
    
=== Imputation quality evaluation ===
 
=== Imputation quality evaluation ===
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics:
+
To evaluate imputation quality, Minimac2 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).  
 
* 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.  
 
* empR - this is the empirical correlation between true and imputed genotypes for the SNP. If this is negative, the SNP is probably flipped.  
Line 193: Line 192:     
=== Additional Sources of Information ===
 
=== 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.
      
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].
 
If you are especially interested in 1000 Genomes Imputation, then you should look at the [[Minimac: 1000 Genomes Imputation Cookbook]].
    
== X Chromosome Imputation ==
 
== X Chromosome Imputation ==
minimac supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).
+
minimac2 supports the imputation of genotypes on the X chromosome (non-pseudo-autosomal part).
    
# Split the X chromosome pedigree file by sex.
 
# 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 females: follow the same protocol as for autosomes (phase with MaCH and impute with minimac2).
 
## For males
 
## 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)
 
### 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.
+
### Convert the pedigree file into a MaCH haplotype file (missing genotypes should be encoded as:  "0" or "." or "N" ) and impute using minimac2 as described above.
      Line 227: Line 224:  
= Post-imputation Association Analysis =
 
= Post-imputation Association Analysis =
 
== Quantitative Traits ==
 
== Quantitative Traits ==
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].
+
Please use [http://csg.sph.umich.edu/yli/mach/download/mach2qtl.source.V108.tgz mach2qtl].
    
== Binary Traits ==
 
== Binary Traits ==
Please use [http://www.sph.umich.edu/csg/yli/mach/download/mach2dat.source.1.0.18.tgz mach2dat]. Versions 1.0.18 and above accommodate to minimac output.
+
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 =
 
= Reference =
   −
If you use minimac, please cite:  
+
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.
 
Howie B, Fuchsberger C, Stephens M, Marchini J, and Abecasis GR.
487

edits

Navigation menu