<?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=Gjun</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=Gjun"/>
	<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/wiki/Special:Contributions/Gjun"/>
	<updated>2026-09-24T04:44:44Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_June_2014&amp;diff=10812</id>
		<title>SeqShop: June 2014</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_June_2014&amp;diff=10812"/>
		<updated>2014-06-17T03:25:44Z</updated>

		<summary type="html">&lt;p&gt;Gjun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sequence Analysis Workshop June 16-20, 2014&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; cellpadding=5&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ABE&amp;quot; | Monday Lecture !! style=&amp;quot;background:#ABE&amp;quot; | Practical&lt;br /&gt;
|-&lt;br /&gt;
| [[Media:2014.06_-_Abecasis_Workshop_Introduction.pdf|Design of Human Genetic Studies]]&lt;br /&gt;
| [[SeqShop: Design of Human Genetic Studies Practical]]&lt;br /&gt;
|-&lt;br /&gt;
| [[Media:Mapping and assembly.pdf|Sequence Mapping and Assembly]]&lt;br /&gt;
| [[SeqShop: Sequence Mapping and Assembly Practical]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ABE&amp;quot; | Tuesday Lecture !! style=&amp;quot;background:#ABE&amp;quot; | Practical&lt;br /&gt;
|-&lt;br /&gt;
| [[Media:SNPcalling.pdf|Variant Calling and Filtering for SNPs]]&lt;br /&gt;
| [[SeqShop: Variant Calling and Filtering for SNPs Practical]]&lt;br /&gt;
|-&lt;br /&gt;
| Variant Calling and Filtering for INDELs&lt;br /&gt;
| [[SeqShop: Variant Calling and Filtering for INDELs Practical]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ABE&amp;quot; | Wednesday Lecture !! style=&amp;quot;background:#ABE&amp;quot; | Practical&lt;br /&gt;
|-&lt;br /&gt;
| Analysis of Structural Variation&lt;br /&gt;
| [[SeqShop: Analysis of Structural Variation Practical]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:#ABE&amp;quot; | Thursday Lecture !! style=&amp;quot;background:#ABE&amp;quot; | Practical&lt;br /&gt;
|-&lt;br /&gt;
| Estimates of Genetic Ancestry&lt;br /&gt;
| [[SeqShop: Estimates of Genetic Ancestry Practical]]&lt;br /&gt;
|-&lt;br /&gt;
| Genetic Association Analysis&lt;br /&gt;
| [[SeqShop: Genetic Association Analysis Practical]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Gjun</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=File:SNPcalling.pdf&amp;diff=10811</id>
		<title>File:SNPcalling.pdf</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=File:SNPcalling.pdf&amp;diff=10811"/>
		<updated>2014-06-17T03:24:37Z</updated>

		<summary type="html">&lt;p&gt;Gjun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gjun</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=VerifyIDintensity&amp;diff=10254</id>
		<title>VerifyIDintensity</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=VerifyIDintensity&amp;diff=10254"/>
		<updated>2014-04-24T19:34:16Z</updated>

		<summary type="html">&lt;p&gt;Gjun: /* Download verifyIDintensity */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Software|VerifyIDintensity]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;verifyIDintensity&#039;&#039;&#039; is a software that detects and estimates sample contamination using intensity data from Illumina genotyping arrays using a mixture model. &lt;br /&gt;
&lt;br /&gt;
== Download verifyIDintensity ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/gjun/verifyIDintensity GitHub repository]&lt;br /&gt;
&lt;br /&gt;
== Build verifyID intensity ==&lt;br /&gt;
&lt;br /&gt;
To build verifyIDintensity, run the following series of commands. You need [http://www.boost.org/ boost library] and [http://tclap.sourceforge.net/ tclap].&lt;br /&gt;
&lt;br /&gt;
   $ tar xzvf verifyIDintensity.tgz &lt;br /&gt;
   $ make&lt;br /&gt;
&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
&lt;br /&gt;
verifyIDintensity  [-t &amp;lt;float&amp;gt;] [-m &amp;lt;int&amp;gt;] -n &amp;lt;int&amp;gt; [-b &amp;lt;string&amp;gt;] [-s &amp;lt;string&amp;gt;] -i &amp;lt;string&amp;gt; [-v] [-p] [--] [--version] [-h]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Options ==&lt;br /&gt;
&lt;br /&gt;
   -t &amp;lt;float&amp;gt;,  --threshold &amp;lt;float&amp;gt;&lt;br /&gt;
     Minimum allele frequency for likelihood estimation, default is 0.01&lt;br /&gt;
&lt;br /&gt;
   -m &amp;lt;int&amp;gt;,  --marker &amp;lt;int&amp;gt;&lt;br /&gt;
     (required) Number of markers&lt;br /&gt;
&lt;br /&gt;
   -n &amp;lt;int&amp;gt;,  --number &amp;lt;int&amp;gt;&lt;br /&gt;
     (required) Number of samples&lt;br /&gt;
&lt;br /&gt;
   -b &amp;lt;string&amp;gt;,  --abf &amp;lt;string&amp;gt;&lt;br /&gt;
     Allele frequency file (ABF), which is a plain text file with SNP_ID and Allele_B frequency. &lt;br /&gt;
     SNP_IDs should be sorted in the same order as the intensity file&lt;br /&gt;
&lt;br /&gt;
   -s &amp;lt;string&amp;gt;,  --stat &amp;lt;string&amp;gt;&lt;br /&gt;
     Statistics file (created if not exist)&lt;br /&gt;
&lt;br /&gt;
   -i &amp;lt;string&amp;gt;,  --in &amp;lt;string&amp;gt;&lt;br /&gt;
     (required)  Input pre-computed intensity (.adpc.bin) file&lt;br /&gt;
&lt;br /&gt;
   -v,  --verbose&lt;br /&gt;
     Turn on verbose mode&lt;br /&gt;
&lt;br /&gt;
   -p,  --persample&lt;br /&gt;
     Do per-sample analysis, default is per-marker analysis&lt;br /&gt;
&lt;br /&gt;
   --,  --ignore_rest&lt;br /&gt;
     Ignores the rest of the labeled arguments following this flag.&lt;br /&gt;
&lt;br /&gt;
   --version&lt;br /&gt;
     Displays version information and exits.&lt;br /&gt;
&lt;br /&gt;
   -h,  --help&lt;br /&gt;
     Displays usage information and exits.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
&lt;br /&gt;
Please cite the following paper:&lt;br /&gt;
&lt;br /&gt;
G. Jun, M. Flickinger, K. N. Hetrick, Kurt, J. M. Romm, K. F. Doheny, G. Abecasis, M. Boehnke,and H. M. Kang, &#039;&#039;Detecting and Estimating Contamination of Human DNA Samples in Sequencing and Array-Based Genotype Data&#039;&#039;, American journal of human genetics doi:10.1016/j.ajhg.2012.09.004 (volume 91 issue 5 pp.839 - 848) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== For sequence data ==&lt;br /&gt;
&lt;br /&gt;
[[VerifyBamID]] software can estimate sample contamination from aligned sequence reads and population minor allele frequency&lt;/div&gt;</summary>
		<author><name>Gjun</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=VerifyBamID&amp;diff=6564</id>
		<title>VerifyBamID</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=VerifyBamID&amp;diff=6564"/>
		<updated>2013-02-26T05:55:02Z</updated>

		<summary type="html">&lt;p&gt;Gjun: /* For array intensity data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Software|VerifyBamID]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;verifyBamID&#039;&#039;&#039; is a software that verifies whether the reads in particular file match previously known genotypes for an individual (or group of individuals), and checks whether the reads are contaminated as a mixture of two samples. &#039;&#039;&#039;verifyBamID&#039;&#039;&#039; can detect sample contamination and swaps when external genotypes are available. When external genotypes are not available, &#039;&#039;&#039;verifyBamID&#039;&#039;&#039; still robustly detects sample swaps.&lt;br /&gt;
&lt;br /&gt;
== Download verifyBamID  ==&lt;br /&gt;
&lt;br /&gt;
To get a copy go to the [http://www.sph.umich.edu/csg/kang/verifyBamID/download VerifyBamID Download] download page.&lt;br /&gt;
&lt;br /&gt;
== Join in verifyBamID mailing list ==&lt;br /&gt;
&lt;br /&gt;
Please join in the [http://groups.google.com/group/verifybamid VerifyBamID Google Group] to ask / discuss / comment about verifyBamID.&lt;br /&gt;
&lt;br /&gt;
== What&#039;s new ==&lt;br /&gt;
&lt;br /&gt;
(2012/06/20) &lt;br /&gt;
* Fixed a bug of incorrect estimate of contamination when --chip-full option was used (Thanks to Richard Smith)&lt;br /&gt;
* Fixed a bug of incorrect per-readgroup output in --chip-* parameter&lt;br /&gt;
&lt;br /&gt;
(2012/05/24) &lt;br /&gt;
* Fixed a bug of incorrect per-readgroup output (Thanks to Matthew Flickinger)&lt;br /&gt;
* &#039;&#039;&#039;(IMPORTANT)&#039;&#039;&#039; Add an option to remove either side of overlapping fragment. This option is turned on by default, and can be turned off usig --ignoreOverlapPair. If your sequence data has very short insert size, this update may increase the sensitivity of estimated contamination.&lt;br /&gt;
* Changes in the directory structure and Makefile&lt;br /&gt;
&lt;br /&gt;
(2012/05/18) The new release of verifyBamID have undergone major change since the last version (as of 2011 April). Here are the highlights&lt;br /&gt;
* The genotype / allele frequency file is now based on VCF format rather than PLINK format.&lt;br /&gt;
* The reference sequence information is no longer required&lt;br /&gt;
* Uses Brent&#039;s method for precise estimation of contamination parameters&lt;br /&gt;
* Generate the depth distribution statistics.&lt;br /&gt;
* Estimated reference-bias parameters (useful mostly for ABI SOLiD sequence data)&lt;br /&gt;
&lt;br /&gt;
== Build verifyBamID  ==&lt;br /&gt;
&lt;br /&gt;
The binary download of verifyBamID is available. You may use the version in Ubuntu 64-bit platform. To build verifyBamID, download the statgen library and run the following series of commands&lt;br /&gt;
 tar xzvf verifyBamID.20120620.tar.gz&lt;br /&gt;
 cd verifyBamID&lt;br /&gt;
 make cloneLib (in the case ../libStatGen does not exist)&lt;br /&gt;
 make&lt;br /&gt;
 ./bin/verifyBamID&lt;br /&gt;
&lt;br /&gt;
Note that &#039;&#039;&#039;git clone&#039;&#039;&#039; command will create a directory ./libStatGen under your working directory, and &#039;&#039;&#039;make&#039;&#039;&#039; will create binary of verifyBamID under verifyBamID/bin/&lt;br /&gt;
&lt;br /&gt;
verifyBamID is designed to be reasonably portable. &lt;br /&gt;
&lt;br /&gt;
However, since development occurs only on Ubuntu 9.10 x86 and x64 platforms, and later, there are likely other portability issues. &lt;br /&gt;
&lt;br /&gt;
Currently we support verifyBamID only on Ubuntu 9.10 and later on 64-bit processors.&lt;br /&gt;
&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
&lt;br /&gt;
A key step in any genetic analysis is to verify whether data being generated matches expectations. &#039;&#039;verifyBamID&#039;&#039; checks whether reads in a BAM file match previous genotypes for a specific sample. In addition, it detects possible sample mixture from population allele frequency only, which can be particularly useful when the genotype data is not available.&lt;br /&gt;
&lt;br /&gt;
Using a mathematical model that relates observed sequence reads to an hypothetical true genotype, &#039;&#039;verifyBamID&#039;&#039; tries to decide whether sequence reads match a particular individual or are more likely to be contaminated (including a small proportion of foreign DNA), derived from a closely related individual, or derived from a completely different individual.&lt;br /&gt;
&lt;br /&gt;
== Basic Usage Example ==&lt;br /&gt;
&lt;br /&gt;
Here is a typical command line:&lt;br /&gt;
&lt;br /&gt;
 verifyBamID --vcf [input.vcf] --bam [input.bam] --out [output.prefix] --verbose --ignoreRG&lt;br /&gt;
 &lt;br /&gt;
 where&lt;br /&gt;
 [input.bam] is a BAM (Binary Alignment Map) file of a sequence reads&lt;br /&gt;
 [input.vcf] is input VCF file containing individual genotypes or AF or AC/AN fields in the INFO field. gzipped VCF is also allowed.&lt;br /&gt;
 [outPrefix] is output prefix of output files - [outPrefix].{selfRG,selfSM,bestRG,bestSM,depthRG,depthSM} will be created.&lt;br /&gt;
&lt;br /&gt;
More detailed description of command line input is below&lt;br /&gt;
&lt;br /&gt;
== Preparing input files ==&lt;br /&gt;
&lt;br /&gt;
verifyBamID requires two input files - VCF file containing external genotypes or allele frequency information, and the BAM file.&lt;br /&gt;
&lt;br /&gt;
=== VCF input genotype file ===&lt;br /&gt;
&lt;br /&gt;
The input VCF file contains (1) external genotype information and/or (2) allele frequency information as AF entry or AC/AN entries in the INFO field. (See [http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 | VCF specification] for further details). If neither information is provided, verifyBamID will not work properly.&lt;br /&gt;
&lt;br /&gt;
If external genotype information is provided, sequence+array method will identify contamination and sample swaps by comparing the concordance between the external genotypes and the sequence reads. Additionally, sequence-only method will provide additional contamination estimates by modeling the sequence reads as mixture of two unknown samples based on the allele frequency information in the VCF file.&lt;br /&gt;
&lt;br /&gt;
Input VCF file needs to meet several additional contraints need to meet in order to properly run verifyBamID.&lt;br /&gt;
* The VCF is assumed to be well-formed. For example, verifyBamID does not check whether REF allele actually matches with reference sequence.  &lt;br /&gt;
* The VCF should only contain SNPs. Current version of verifyBamID does not accept INDELs, MNPs, Structural Variations, or other complex variants.&lt;br /&gt;
* The individual IDs in the VCF file, must be identical with the individual identifier in the BAM file. Otherwise, --smID option can override the sample ID information of the BAM file to the ID that matches to the individual IDs in the VCF file.&lt;br /&gt;
* IMPORTANT : For targeted sequencing data, it is important to subselect the markers to only include on-target markers in the genotype file. Off-target markers are not likely to have multiple non-duplicated reads at the marker position, and it may create artifacts in the analysis due to overlapping fragments.&lt;br /&gt;
* Currently, verifyBamID takes only autosomal chromosomes as input VCF.&lt;br /&gt;
&lt;br /&gt;
An example input VCF file (without external genotype) is provided below. Note that AC and AC entries exists in the INFO field for the allele frequency information.&lt;br /&gt;
&lt;br /&gt;
 #CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO&lt;br /&gt;
 20	61651	SNP20-9651	C	A	.	PASS	CR=99.86851;GentrainScore=0.7055;HW=0.077647716;AN=2180;AC=11&lt;br /&gt;
 20	63231	SNP20-11231	T	G	.	PASS	CR=99.93036;GentrainScore=0.7837;HW=0.035481825;AN=2182;AC=275&lt;br /&gt;
 20	63244	rs6139074	A	C	.	PASS	CR=98.893394;GentrainScore=0.8001;HW=7.327299E-7;AN=2162;AC=501&lt;br /&gt;
 20	63799	rs1418258	C	T	.	PASS	CR=99.75217;GentrainScore=0.8170;HW=0.6653377;AN=2182;AC=881&lt;br /&gt;
&lt;br /&gt;
=== Input BAM file ===&lt;br /&gt;
&lt;br /&gt;
verifyBamID requires a sorted, indexed, base quality recalibrated, and duplication-marked BAM file. It also requires to contain &amp;quot;@RG&amp;quot; header lines to annotation different readGroups (sequencing runs and lanes). The SM tag in the &amp;quot;@RG&amp;quot; header should match with one of the genotyped sample. Otherwise, verifyBamID may not be able to test whether the sequenced sample matches with genotyped sample, but will try to detect sample mixture from allele frequency, and will try to detect the best-matching sample among the genotyped sample.&lt;br /&gt;
&lt;br /&gt;
== What the default option does ==&lt;br /&gt;
&lt;br /&gt;
The default option of &#039;&#039;&#039;verifyBamID&#039;&#039;&#039; is the recommended setting for the most sequencing studies to provide a rapid and informative response. The default option provides the following features:&lt;br /&gt;
* --free-mix is turned on for estimating contamination using sequence-only method&lt;br /&gt;
* --chip-mix is turned on for estimating contamination or swap using sequence+array method, if the external genotype file is provided in the VCF&lt;br /&gt;
* --self is turnd on : The default option does not try to compare the sequence reads to identify the best matching individual (which is possible with --best option). It only compares with the external genotypes from the same individual to the sequenced individual.&lt;br /&gt;
* --maxDepth 20 is used without --precise option : The default option is intended for whole genome low coverage sequencing. For the targeted exome sequencing, --maxDepth 1000 and --precise is recommended.&lt;br /&gt;
* --ignoreRG is not a default option, but a recommended option, when you want to check the contamination for the entire BAM rather than examining each read group separately. This option will increase the computational efficiency especially in the case whether the sequence reads are multiplexed across many sequencing runs.&lt;br /&gt;
&lt;br /&gt;
== Interpreting output files ==&lt;br /&gt;
&lt;br /&gt;
=== Output files ===&lt;br /&gt;
When verifyBamID runs successfully, the following sets of files may be generated.&lt;br /&gt;
* [outPrefix].selfSM - Per-sample statistics describing how well the sample matches to the annotated sample.&lt;br /&gt;
* [outPrefix].depthSM - The depth distribution of the sequence reads per sample&lt;br /&gt;
* [outPrefix].selfRG - Per-readGroup statistics describing how well each lane matches to the annotated sample. (available only without --ignoreRG option)&lt;br /&gt;
* [outPrefix].depthRG - The depth distribution of the sequence reads per readGroup. (available only without --ignoreRG option)&lt;br /&gt;
* [outPrefix].bestSM - Per-sample best-match statistics with best-matching sample among the genotyped sample (available only with --best option)&lt;br /&gt;
* [outPrefix].bestRG - Per-readgroup best-match statistics with best-matching sample among the genotyped sample (available only with --best and without --ignoreRG option)&lt;br /&gt;
&lt;br /&gt;
=== Column information in the output files ===&lt;br /&gt;
The .selfSM/.selfRG/.bestSM/.bestRG files have the following 19 columns per sample, or per readgroup (lane). &lt;br /&gt;
&lt;br /&gt;
# SEQ_SM : Sample ID of the sequenced sample. Obtained from @RG header / SM tag in the BAM file&lt;br /&gt;
# RG : ReadGroup ID of sequenced lane. For [outPrefix].selfSM and [outPrefix].bestSM, these values are &amp;quot;ALL&amp;quot;&lt;br /&gt;
# CHIP_ID : Sample ID compared to in the genotype file. For [outPrefix].selfRG and [outPrefix].selfSM, these values should be identical to [SEQ_SM] or &amp;quot;NA&amp;quot; if the genotype of sequenced samples are unavailable. For [outPrefix].bestRG and [outPrefix].bestSM, these values should be the ID of best-matching sample among the genotype files compared to.&lt;br /&gt;
# # SNPs : # of SNPs passing the criteria from the VCF file&lt;br /&gt;
# # READS : Total # of reads loaded from the BAM file&lt;br /&gt;
# # AVG_DP : Average sequencing depth at the sites in the VCF file&lt;br /&gt;
# FREEMIX : Sequence-only estimate of contamination (0-1 scale)&lt;br /&gt;
# FREELK1 : Maximum log-likelihood of the sequence reads given estimated contamination under sequence-only method&lt;br /&gt;
# FREELK0 : Log-ikelihood of the sequence reads given no contamination under sequence-only method&lt;br /&gt;
# FREE_RH : Estimated reference bias parameter Pr(refBase|HET) (when --free-refBias or --free-full is used)&lt;br /&gt;
# FREE_RA : Estimated reference bias parameter Pr(refBase|HOMALT) (when --free-refBias or --free-full is used)&lt;br /&gt;
# CHIPMIX : Sequence+array estimate of contamination (NA if the external genotype is unavailable) (0-1 scale)&lt;br /&gt;
# CHIPLK1 : Maximum log-likelihood of the sequence reads given estimated contamination under sequence+array method (NA if the external genotypes are unavailable)&lt;br /&gt;
# CHIPLK0 : Log-likelihood of the sequence reads given no contamination under sequence+array method (NA if the external genotypes are unavailable)&lt;br /&gt;
# CHIP_RH : Estimated reference bias parameter Pr(refBase|HET) (when --chip-refBias or --chip-full is used)&lt;br /&gt;
# CHIP_RA : Estimated reference bias parameter Pr(refBase|HOMALT) (when --chip-refBias or --chip-full is used)&lt;br /&gt;
# DPREF : Depth (Coverage) of HomRef site (based on the genotypes of (SELF_SM/BEST_SM), passing mapQ, baseQual, maxDepth thresholds.&lt;br /&gt;
# RDPHET : DPHET/DPREF, Relative depth at Heterozygous site.&lt;br /&gt;
# RDPALT : DPHET/DPREF, Relative depth at HomAlt site.&lt;br /&gt;
&lt;br /&gt;
=== A guideline to interpret output files ===&lt;br /&gt;
&lt;br /&gt;
verifyBamID provides a series of information that is informative to determine whether the sample is possibly contaminated or swapped, but there is no single criteria that works for every circumstances. There are a few unmodeled factor in the estimation of [SELF-IBD]/[BEST-IBD] and [%MIX], so please note that the MLE estimation may not always exactly match to the true amount of contamination. Here we provide a guideline to flag potentially contaminated/swapped samples &lt;br /&gt;
&lt;br /&gt;
*  Each sample or lane can be checked in this way. When [CHIPMIX] &amp;gt;&amp;gt; 0.02 and/or [FREEMIX] &amp;gt;&amp;gt; 0.02, meaning 2% or more of non-reference bases are observed in reference sites, we recommend to examine the data more carefully for the possibility of contamination.&lt;br /&gt;
* We recommend to check each lane for the possibility of sample swaps. When [CHIPMIX] ~ 1 AND [FREEMIX] ~ 0, then it is possible that the sample is swapped with another sample. When [CHIPMIX] ~ 0 in .bestSM file, [CHIP_ID] might be actually the swapped sample. Otherwise, the swapped sample may not exist in the genotype data you have compared. &lt;br /&gt;
* When genotype data is not available but allele-frequency-based estimates of [FREEMIX] &amp;gt;= 0.03 and [FREELK1]-[FREELK0] is large, then it is possible that the sample is contaminated with other sample. We recommend to use per-sample data rather than per-lane data for checking this for low coverage data, because the inference will be more confident when there are large number of bases with depth 2 or higher.&lt;br /&gt;
&lt;br /&gt;
== Command Line Options ==&lt;br /&gt;
&lt;br /&gt;
 The following parameters are available.  Ones with &amp;quot;[]&amp;quot; are in effect:&lt;br /&gt;
 &lt;br /&gt;
 Available Options&lt;br /&gt;
                             Input Files : --vcf [], --bam [], --subset [],&lt;br /&gt;
                                           --smID []&lt;br /&gt;
                    VCF analysis options : --genoError [1.0e-03],&lt;br /&gt;
                                           --minAF [0.01],&lt;br /&gt;
                                           --minCallRate [0.50]&lt;br /&gt;
   Individuals to compare with chip data : --site, --self, --best&lt;br /&gt;
          Chip-free optimization options : --free-none, --free-mix [ON],&lt;br /&gt;
                                           --free-refBias, --free-full&lt;br /&gt;
          With-chip optimization options : --chip-none, --chip-mix [ON],&lt;br /&gt;
                                           --chip-refBias, --chip-full&lt;br /&gt;
                    BAM analysis options : --ignoreRG, --ignoreOverlapPair,&lt;br /&gt;
                                           --noEOF, --precise, --minMapQ [10],&lt;br /&gt;
                                           --maxDepth [20], --minQ [13],&lt;br /&gt;
                                           --maxQ [40], --grid [0.05]&lt;br /&gt;
                 Modeling Reference Bias : --refRef [1.00], --refHet [0.50],&lt;br /&gt;
                                           --refAlt [0.00]&lt;br /&gt;
                          Output options : --out [], --verbose&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each option provides the following features:&lt;br /&gt;
* --vcf : specify required VCF file&lt;br /&gt;
* --bam : specify required BAM file (indexed with .bam.bai or .bai file)&lt;br /&gt;
* --subset : list of individual IDs to calculate the allele frequency. All individuals are used if unspecified&lt;br /&gt;
* --smID : If the individual ID in the BAM file and VCF file does not match, substitute the BAM file&#039;s ID into the specified argument&lt;br /&gt;
* --genoError : error rate of the external genotype file&lt;br /&gt;
* --minAF : minimum allele frequency of the markers to include&lt;br /&gt;
* --minAF : minimum call rate of the markers to include&lt;br /&gt;
* --site : If set, use only site information in the VCF and do not compare with the actual genotypes&lt;br /&gt;
* --self : Only compare the ID-matching individuals between the VCF and BAM file&lt;br /&gt;
* --best : Find the best matching individuals (.bestSM and .bestRG files will be produced). This option is substantially longer than the default option&lt;br /&gt;
* --free-none : Do not perform sequence-only method to estimate parameters&lt;br /&gt;
* --free-mix : (default) Estimate contamination using sequence-only method with Brent&#039;s single dimensional optimization.&lt;br /&gt;
* --free-refBias : Estimate the refernece bias parameters using sequence-only method with Simplex method&lt;br /&gt;
* --free-full : Estimate both reference bias parameters and the contamination parameters using sequence-only method&lt;br /&gt;
* --chip-none : Do not perform sequence+array method to estimate parameters&lt;br /&gt;
* --free-mix : (default) Estimate contamination using sequence+array method with Brent&#039;s single dimensional optimization.&lt;br /&gt;
* --free-refBias : Estimate the refernece bias parameters using sequence+array method with Simplex method&lt;br /&gt;
* --free-full : Estimate both reference bias parameters and the contamination parameters using sequence+array method&lt;br /&gt;
* --ignoreRG : ignore the read grouup level comparison and compare samples only (recommended for an expedited run)&lt;br /&gt;
* --ignoreOverlapPair : ignore overlapping pair end fragment covering the same base. Disabling this option may decrease the sensitivity of the method when the insert size is short (with slight gain in the computational speed)&lt;br /&gt;
* --noEOF : do not check the EOF marker of the BAM file (for earlier version of BAM)&lt;br /&gt;
* --precise : calculate the likelihood in log-scale for high-depth data (recommended when --maxDepth is greater than 20. Can be a little bit slower)&lt;br /&gt;
* --minMapQ : minimum mapping quality of the sequence reads to compare&lt;br /&gt;
* --minQ : minimum base quality to include&lt;br /&gt;
* --maxQ : maximum base quality to cap&lt;br /&gt;
* --grid : the grid interval to search the optimum before running Brent&#039;s algorithm.&lt;br /&gt;
* --refRef : Initial Pr(refBase|HOMREFGeno) parameter&lt;br /&gt;
* --refHet : Initial Pr(refBase|HETGeno) parameter&lt;br /&gt;
* --refAlt : Initial Pr(refBase|HOMALTGeno) parameter&lt;br /&gt;
* --out : output file prefix (required)&lt;br /&gt;
* --verbose : print the progress of the method on the screeen&lt;br /&gt;
&lt;br /&gt;
== Principle of Operation ==&lt;br /&gt;
&lt;br /&gt;
Each read group in a BAM file is evaluated independently. This means that in file with multiple read groups, problems will be flagged at the read group level (a plus). However, it also means that it might be hard to discern the correct assignment of read groups with very little data.&lt;br /&gt;
&lt;br /&gt;
For each aligned base that overlaps a known genotype, we calculate the probability the probability that it was derived from a particular known genotype. This comparison considers only bases that overlap previously known genotypes and that meet the base quality and mapping quality thresholds.&lt;br /&gt;
&lt;br /&gt;
Each individual in a pedigree has a different combination of genotypes, and bamGenotypeCheck will systematically search for the individual whose genotypes best match the observed read data.&lt;br /&gt;
&lt;br /&gt;
For more about the technical details, see the page [[Verifying Sample Identities - Implementation]]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
&lt;br /&gt;
Please cite the following paper:&lt;br /&gt;
&lt;br /&gt;
G. Jun, M. Flickinger, K. N. Hetrick, Kurt, J. M. Romm, K. F. Doheny, G. Abecasis, M. Boehnke,and H. M. Kang, &#039;&#039;Detecting and Estimating Contamination of Human DNA Samples in Sequencing and Array-Based Genotype Data&#039;&#039;, American journal of human genetics doi:10.1016/j.ajhg.2012.09.004 (volume 91 issue 5 pp.839 - 848) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Contamination in Array Data ==&lt;br /&gt;
&lt;br /&gt;
[[VerifyIDintensity]] software can estimate sample contamination from Illumina genotype array intensity data.&lt;br /&gt;
&lt;br /&gt;
== Acknowledgements ==&lt;br /&gt;
&lt;br /&gt;
VerifyBamID is a result from collaborative effort by Hyun Min Kang, Goo Jun, Matthew Flickinger, Mary Kate Wing, and Goncalo Abecasis. Please email to Hyun Min Kang [[mailto:hmkang@umich.edu| hmkang@umich.edu ]] for any questions.&lt;/div&gt;</summary>
		<author><name>Gjun</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=VerifyBamID&amp;diff=6563</id>
		<title>VerifyBamID</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=VerifyBamID&amp;diff=6563"/>
		<updated>2013-02-26T05:54:30Z</updated>

		<summary type="html">&lt;p&gt;Gjun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Software|VerifyBamID]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;verifyBamID&#039;&#039;&#039; is a software that verifies whether the reads in particular file match previously known genotypes for an individual (or group of individuals), and checks whether the reads are contaminated as a mixture of two samples. &#039;&#039;&#039;verifyBamID&#039;&#039;&#039; can detect sample contamination and swaps when external genotypes are available. When external genotypes are not available, &#039;&#039;&#039;verifyBamID&#039;&#039;&#039; still robustly detects sample swaps.&lt;br /&gt;
&lt;br /&gt;
== Download verifyBamID  ==&lt;br /&gt;
&lt;br /&gt;
To get a copy go to the [http://www.sph.umich.edu/csg/kang/verifyBamID/download VerifyBamID Download] download page.&lt;br /&gt;
&lt;br /&gt;
== Join in verifyBamID mailing list ==&lt;br /&gt;
&lt;br /&gt;
Please join in the [http://groups.google.com/group/verifybamid VerifyBamID Google Group] to ask / discuss / comment about verifyBamID.&lt;br /&gt;
&lt;br /&gt;
== What&#039;s new ==&lt;br /&gt;
&lt;br /&gt;
(2012/06/20) &lt;br /&gt;
* Fixed a bug of incorrect estimate of contamination when --chip-full option was used (Thanks to Richard Smith)&lt;br /&gt;
* Fixed a bug of incorrect per-readgroup output in --chip-* parameter&lt;br /&gt;
&lt;br /&gt;
(2012/05/24) &lt;br /&gt;
* Fixed a bug of incorrect per-readgroup output (Thanks to Matthew Flickinger)&lt;br /&gt;
* &#039;&#039;&#039;(IMPORTANT)&#039;&#039;&#039; Add an option to remove either side of overlapping fragment. This option is turned on by default, and can be turned off usig --ignoreOverlapPair. If your sequence data has very short insert size, this update may increase the sensitivity of estimated contamination.&lt;br /&gt;
* Changes in the directory structure and Makefile&lt;br /&gt;
&lt;br /&gt;
(2012/05/18) The new release of verifyBamID have undergone major change since the last version (as of 2011 April). Here are the highlights&lt;br /&gt;
* The genotype / allele frequency file is now based on VCF format rather than PLINK format.&lt;br /&gt;
* The reference sequence information is no longer required&lt;br /&gt;
* Uses Brent&#039;s method for precise estimation of contamination parameters&lt;br /&gt;
* Generate the depth distribution statistics.&lt;br /&gt;
* Estimated reference-bias parameters (useful mostly for ABI SOLiD sequence data)&lt;br /&gt;
&lt;br /&gt;
== Build verifyBamID  ==&lt;br /&gt;
&lt;br /&gt;
The binary download of verifyBamID is available. You may use the version in Ubuntu 64-bit platform. To build verifyBamID, download the statgen library and run the following series of commands&lt;br /&gt;
 tar xzvf verifyBamID.20120620.tar.gz&lt;br /&gt;
 cd verifyBamID&lt;br /&gt;
 make cloneLib (in the case ../libStatGen does not exist)&lt;br /&gt;
 make&lt;br /&gt;
 ./bin/verifyBamID&lt;br /&gt;
&lt;br /&gt;
Note that &#039;&#039;&#039;git clone&#039;&#039;&#039; command will create a directory ./libStatGen under your working directory, and &#039;&#039;&#039;make&#039;&#039;&#039; will create binary of verifyBamID under verifyBamID/bin/&lt;br /&gt;
&lt;br /&gt;
verifyBamID is designed to be reasonably portable. &lt;br /&gt;
&lt;br /&gt;
However, since development occurs only on Ubuntu 9.10 x86 and x64 platforms, and later, there are likely other portability issues. &lt;br /&gt;
&lt;br /&gt;
Currently we support verifyBamID only on Ubuntu 9.10 and later on 64-bit processors.&lt;br /&gt;
&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
&lt;br /&gt;
A key step in any genetic analysis is to verify whether data being generated matches expectations. &#039;&#039;verifyBamID&#039;&#039; checks whether reads in a BAM file match previous genotypes for a specific sample. In addition, it detects possible sample mixture from population allele frequency only, which can be particularly useful when the genotype data is not available.&lt;br /&gt;
&lt;br /&gt;
Using a mathematical model that relates observed sequence reads to an hypothetical true genotype, &#039;&#039;verifyBamID&#039;&#039; tries to decide whether sequence reads match a particular individual or are more likely to be contaminated (including a small proportion of foreign DNA), derived from a closely related individual, or derived from a completely different individual.&lt;br /&gt;
&lt;br /&gt;
== Basic Usage Example ==&lt;br /&gt;
&lt;br /&gt;
Here is a typical command line:&lt;br /&gt;
&lt;br /&gt;
 verifyBamID --vcf [input.vcf] --bam [input.bam] --out [output.prefix] --verbose --ignoreRG&lt;br /&gt;
 &lt;br /&gt;
 where&lt;br /&gt;
 [input.bam] is a BAM (Binary Alignment Map) file of a sequence reads&lt;br /&gt;
 [input.vcf] is input VCF file containing individual genotypes or AF or AC/AN fields in the INFO field. gzipped VCF is also allowed.&lt;br /&gt;
 [outPrefix] is output prefix of output files - [outPrefix].{selfRG,selfSM,bestRG,bestSM,depthRG,depthSM} will be created.&lt;br /&gt;
&lt;br /&gt;
More detailed description of command line input is below&lt;br /&gt;
&lt;br /&gt;
== Preparing input files ==&lt;br /&gt;
&lt;br /&gt;
verifyBamID requires two input files - VCF file containing external genotypes or allele frequency information, and the BAM file.&lt;br /&gt;
&lt;br /&gt;
=== VCF input genotype file ===&lt;br /&gt;
&lt;br /&gt;
The input VCF file contains (1) external genotype information and/or (2) allele frequency information as AF entry or AC/AN entries in the INFO field. (See [http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 | VCF specification] for further details). If neither information is provided, verifyBamID will not work properly.&lt;br /&gt;
&lt;br /&gt;
If external genotype information is provided, sequence+array method will identify contamination and sample swaps by comparing the concordance between the external genotypes and the sequence reads. Additionally, sequence-only method will provide additional contamination estimates by modeling the sequence reads as mixture of two unknown samples based on the allele frequency information in the VCF file.&lt;br /&gt;
&lt;br /&gt;
Input VCF file needs to meet several additional contraints need to meet in order to properly run verifyBamID.&lt;br /&gt;
* The VCF is assumed to be well-formed. For example, verifyBamID does not check whether REF allele actually matches with reference sequence.  &lt;br /&gt;
* The VCF should only contain SNPs. Current version of verifyBamID does not accept INDELs, MNPs, Structural Variations, or other complex variants.&lt;br /&gt;
* The individual IDs in the VCF file, must be identical with the individual identifier in the BAM file. Otherwise, --smID option can override the sample ID information of the BAM file to the ID that matches to the individual IDs in the VCF file.&lt;br /&gt;
* IMPORTANT : For targeted sequencing data, it is important to subselect the markers to only include on-target markers in the genotype file. Off-target markers are not likely to have multiple non-duplicated reads at the marker position, and it may create artifacts in the analysis due to overlapping fragments.&lt;br /&gt;
* Currently, verifyBamID takes only autosomal chromosomes as input VCF.&lt;br /&gt;
&lt;br /&gt;
An example input VCF file (without external genotype) is provided below. Note that AC and AC entries exists in the INFO field for the allele frequency information.&lt;br /&gt;
&lt;br /&gt;
 #CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO&lt;br /&gt;
 20	61651	SNP20-9651	C	A	.	PASS	CR=99.86851;GentrainScore=0.7055;HW=0.077647716;AN=2180;AC=11&lt;br /&gt;
 20	63231	SNP20-11231	T	G	.	PASS	CR=99.93036;GentrainScore=0.7837;HW=0.035481825;AN=2182;AC=275&lt;br /&gt;
 20	63244	rs6139074	A	C	.	PASS	CR=98.893394;GentrainScore=0.8001;HW=7.327299E-7;AN=2162;AC=501&lt;br /&gt;
 20	63799	rs1418258	C	T	.	PASS	CR=99.75217;GentrainScore=0.8170;HW=0.6653377;AN=2182;AC=881&lt;br /&gt;
&lt;br /&gt;
=== Input BAM file ===&lt;br /&gt;
&lt;br /&gt;
verifyBamID requires a sorted, indexed, base quality recalibrated, and duplication-marked BAM file. It also requires to contain &amp;quot;@RG&amp;quot; header lines to annotation different readGroups (sequencing runs and lanes). The SM tag in the &amp;quot;@RG&amp;quot; header should match with one of the genotyped sample. Otherwise, verifyBamID may not be able to test whether the sequenced sample matches with genotyped sample, but will try to detect sample mixture from allele frequency, and will try to detect the best-matching sample among the genotyped sample.&lt;br /&gt;
&lt;br /&gt;
== What the default option does ==&lt;br /&gt;
&lt;br /&gt;
The default option of &#039;&#039;&#039;verifyBamID&#039;&#039;&#039; is the recommended setting for the most sequencing studies to provide a rapid and informative response. The default option provides the following features:&lt;br /&gt;
* --free-mix is turned on for estimating contamination using sequence-only method&lt;br /&gt;
* --chip-mix is turned on for estimating contamination or swap using sequence+array method, if the external genotype file is provided in the VCF&lt;br /&gt;
* --self is turnd on : The default option does not try to compare the sequence reads to identify the best matching individual (which is possible with --best option). It only compares with the external genotypes from the same individual to the sequenced individual.&lt;br /&gt;
* --maxDepth 20 is used without --precise option : The default option is intended for whole genome low coverage sequencing. For the targeted exome sequencing, --maxDepth 1000 and --precise is recommended.&lt;br /&gt;
* --ignoreRG is not a default option, but a recommended option, when you want to check the contamination for the entire BAM rather than examining each read group separately. This option will increase the computational efficiency especially in the case whether the sequence reads are multiplexed across many sequencing runs.&lt;br /&gt;
&lt;br /&gt;
== Interpreting output files ==&lt;br /&gt;
&lt;br /&gt;
=== Output files ===&lt;br /&gt;
When verifyBamID runs successfully, the following sets of files may be generated.&lt;br /&gt;
* [outPrefix].selfSM - Per-sample statistics describing how well the sample matches to the annotated sample.&lt;br /&gt;
* [outPrefix].depthSM - The depth distribution of the sequence reads per sample&lt;br /&gt;
* [outPrefix].selfRG - Per-readGroup statistics describing how well each lane matches to the annotated sample. (available only without --ignoreRG option)&lt;br /&gt;
* [outPrefix].depthRG - The depth distribution of the sequence reads per readGroup. (available only without --ignoreRG option)&lt;br /&gt;
* [outPrefix].bestSM - Per-sample best-match statistics with best-matching sample among the genotyped sample (available only with --best option)&lt;br /&gt;
* [outPrefix].bestRG - Per-readgroup best-match statistics with best-matching sample among the genotyped sample (available only with --best and without --ignoreRG option)&lt;br /&gt;
&lt;br /&gt;
=== Column information in the output files ===&lt;br /&gt;
The .selfSM/.selfRG/.bestSM/.bestRG files have the following 19 columns per sample, or per readgroup (lane). &lt;br /&gt;
&lt;br /&gt;
# SEQ_SM : Sample ID of the sequenced sample. Obtained from @RG header / SM tag in the BAM file&lt;br /&gt;
# RG : ReadGroup ID of sequenced lane. For [outPrefix].selfSM and [outPrefix].bestSM, these values are &amp;quot;ALL&amp;quot;&lt;br /&gt;
# CHIP_ID : Sample ID compared to in the genotype file. For [outPrefix].selfRG and [outPrefix].selfSM, these values should be identical to [SEQ_SM] or &amp;quot;NA&amp;quot; if the genotype of sequenced samples are unavailable. For [outPrefix].bestRG and [outPrefix].bestSM, these values should be the ID of best-matching sample among the genotype files compared to.&lt;br /&gt;
# # SNPs : # of SNPs passing the criteria from the VCF file&lt;br /&gt;
# # READS : Total # of reads loaded from the BAM file&lt;br /&gt;
# # AVG_DP : Average sequencing depth at the sites in the VCF file&lt;br /&gt;
# FREEMIX : Sequence-only estimate of contamination (0-1 scale)&lt;br /&gt;
# FREELK1 : Maximum log-likelihood of the sequence reads given estimated contamination under sequence-only method&lt;br /&gt;
# FREELK0 : Log-ikelihood of the sequence reads given no contamination under sequence-only method&lt;br /&gt;
# FREE_RH : Estimated reference bias parameter Pr(refBase|HET) (when --free-refBias or --free-full is used)&lt;br /&gt;
# FREE_RA : Estimated reference bias parameter Pr(refBase|HOMALT) (when --free-refBias or --free-full is used)&lt;br /&gt;
# CHIPMIX : Sequence+array estimate of contamination (NA if the external genotype is unavailable) (0-1 scale)&lt;br /&gt;
# CHIPLK1 : Maximum log-likelihood of the sequence reads given estimated contamination under sequence+array method (NA if the external genotypes are unavailable)&lt;br /&gt;
# CHIPLK0 : Log-likelihood of the sequence reads given no contamination under sequence+array method (NA if the external genotypes are unavailable)&lt;br /&gt;
# CHIP_RH : Estimated reference bias parameter Pr(refBase|HET) (when --chip-refBias or --chip-full is used)&lt;br /&gt;
# CHIP_RA : Estimated reference bias parameter Pr(refBase|HOMALT) (when --chip-refBias or --chip-full is used)&lt;br /&gt;
# DPREF : Depth (Coverage) of HomRef site (based on the genotypes of (SELF_SM/BEST_SM), passing mapQ, baseQual, maxDepth thresholds.&lt;br /&gt;
# RDPHET : DPHET/DPREF, Relative depth at Heterozygous site.&lt;br /&gt;
# RDPALT : DPHET/DPREF, Relative depth at HomAlt site.&lt;br /&gt;
&lt;br /&gt;
=== A guideline to interpret output files ===&lt;br /&gt;
&lt;br /&gt;
verifyBamID provides a series of information that is informative to determine whether the sample is possibly contaminated or swapped, but there is no single criteria that works for every circumstances. There are a few unmodeled factor in the estimation of [SELF-IBD]/[BEST-IBD] and [%MIX], so please note that the MLE estimation may not always exactly match to the true amount of contamination. Here we provide a guideline to flag potentially contaminated/swapped samples &lt;br /&gt;
&lt;br /&gt;
*  Each sample or lane can be checked in this way. When [CHIPMIX] &amp;gt;&amp;gt; 0.02 and/or [FREEMIX] &amp;gt;&amp;gt; 0.02, meaning 2% or more of non-reference bases are observed in reference sites, we recommend to examine the data more carefully for the possibility of contamination.&lt;br /&gt;
* We recommend to check each lane for the possibility of sample swaps. When [CHIPMIX] ~ 1 AND [FREEMIX] ~ 0, then it is possible that the sample is swapped with another sample. When [CHIPMIX] ~ 0 in .bestSM file, [CHIP_ID] might be actually the swapped sample. Otherwise, the swapped sample may not exist in the genotype data you have compared. &lt;br /&gt;
* When genotype data is not available but allele-frequency-based estimates of [FREEMIX] &amp;gt;= 0.03 and [FREELK1]-[FREELK0] is large, then it is possible that the sample is contaminated with other sample. We recommend to use per-sample data rather than per-lane data for checking this for low coverage data, because the inference will be more confident when there are large number of bases with depth 2 or higher.&lt;br /&gt;
&lt;br /&gt;
== Command Line Options ==&lt;br /&gt;
&lt;br /&gt;
 The following parameters are available.  Ones with &amp;quot;[]&amp;quot; are in effect:&lt;br /&gt;
 &lt;br /&gt;
 Available Options&lt;br /&gt;
                             Input Files : --vcf [], --bam [], --subset [],&lt;br /&gt;
                                           --smID []&lt;br /&gt;
                    VCF analysis options : --genoError [1.0e-03],&lt;br /&gt;
                                           --minAF [0.01],&lt;br /&gt;
                                           --minCallRate [0.50]&lt;br /&gt;
   Individuals to compare with chip data : --site, --self, --best&lt;br /&gt;
          Chip-free optimization options : --free-none, --free-mix [ON],&lt;br /&gt;
                                           --free-refBias, --free-full&lt;br /&gt;
          With-chip optimization options : --chip-none, --chip-mix [ON],&lt;br /&gt;
                                           --chip-refBias, --chip-full&lt;br /&gt;
                    BAM analysis options : --ignoreRG, --ignoreOverlapPair,&lt;br /&gt;
                                           --noEOF, --precise, --minMapQ [10],&lt;br /&gt;
                                           --maxDepth [20], --minQ [13],&lt;br /&gt;
                                           --maxQ [40], --grid [0.05]&lt;br /&gt;
                 Modeling Reference Bias : --refRef [1.00], --refHet [0.50],&lt;br /&gt;
                                           --refAlt [0.00]&lt;br /&gt;
                          Output options : --out [], --verbose&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each option provides the following features:&lt;br /&gt;
* --vcf : specify required VCF file&lt;br /&gt;
* --bam : specify required BAM file (indexed with .bam.bai or .bai file)&lt;br /&gt;
* --subset : list of individual IDs to calculate the allele frequency. All individuals are used if unspecified&lt;br /&gt;
* --smID : If the individual ID in the BAM file and VCF file does not match, substitute the BAM file&#039;s ID into the specified argument&lt;br /&gt;
* --genoError : error rate of the external genotype file&lt;br /&gt;
* --minAF : minimum allele frequency of the markers to include&lt;br /&gt;
* --minAF : minimum call rate of the markers to include&lt;br /&gt;
* --site : If set, use only site information in the VCF and do not compare with the actual genotypes&lt;br /&gt;
* --self : Only compare the ID-matching individuals between the VCF and BAM file&lt;br /&gt;
* --best : Find the best matching individuals (.bestSM and .bestRG files will be produced). This option is substantially longer than the default option&lt;br /&gt;
* --free-none : Do not perform sequence-only method to estimate parameters&lt;br /&gt;
* --free-mix : (default) Estimate contamination using sequence-only method with Brent&#039;s single dimensional optimization.&lt;br /&gt;
* --free-refBias : Estimate the refernece bias parameters using sequence-only method with Simplex method&lt;br /&gt;
* --free-full : Estimate both reference bias parameters and the contamination parameters using sequence-only method&lt;br /&gt;
* --chip-none : Do not perform sequence+array method to estimate parameters&lt;br /&gt;
* --free-mix : (default) Estimate contamination using sequence+array method with Brent&#039;s single dimensional optimization.&lt;br /&gt;
* --free-refBias : Estimate the refernece bias parameters using sequence+array method with Simplex method&lt;br /&gt;
* --free-full : Estimate both reference bias parameters and the contamination parameters using sequence+array method&lt;br /&gt;
* --ignoreRG : ignore the read grouup level comparison and compare samples only (recommended for an expedited run)&lt;br /&gt;
* --ignoreOverlapPair : ignore overlapping pair end fragment covering the same base. Disabling this option may decrease the sensitivity of the method when the insert size is short (with slight gain in the computational speed)&lt;br /&gt;
* --noEOF : do not check the EOF marker of the BAM file (for earlier version of BAM)&lt;br /&gt;
* --precise : calculate the likelihood in log-scale for high-depth data (recommended when --maxDepth is greater than 20. Can be a little bit slower)&lt;br /&gt;
* --minMapQ : minimum mapping quality of the sequence reads to compare&lt;br /&gt;
* --minQ : minimum base quality to include&lt;br /&gt;
* --maxQ : maximum base quality to cap&lt;br /&gt;
* --grid : the grid interval to search the optimum before running Brent&#039;s algorithm.&lt;br /&gt;
* --refRef : Initial Pr(refBase|HOMREFGeno) parameter&lt;br /&gt;
* --refHet : Initial Pr(refBase|HETGeno) parameter&lt;br /&gt;
* --refAlt : Initial Pr(refBase|HOMALTGeno) parameter&lt;br /&gt;
* --out : output file prefix (required)&lt;br /&gt;
* --verbose : print the progress of the method on the screeen&lt;br /&gt;
&lt;br /&gt;
== Principle of Operation ==&lt;br /&gt;
&lt;br /&gt;
Each read group in a BAM file is evaluated independently. This means that in file with multiple read groups, problems will be flagged at the read group level (a plus). However, it also means that it might be hard to discern the correct assignment of read groups with very little data.&lt;br /&gt;
&lt;br /&gt;
For each aligned base that overlaps a known genotype, we calculate the probability the probability that it was derived from a particular known genotype. This comparison considers only bases that overlap previously known genotypes and that meet the base quality and mapping quality thresholds.&lt;br /&gt;
&lt;br /&gt;
Each individual in a pedigree has a different combination of genotypes, and bamGenotypeCheck will systematically search for the individual whose genotypes best match the observed read data.&lt;br /&gt;
&lt;br /&gt;
For more about the technical details, see the page [[Verifying Sample Identities - Implementation]]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
&lt;br /&gt;
Please cite the following paper:&lt;br /&gt;
&lt;br /&gt;
G. Jun, M. Flickinger, K. N. Hetrick, Kurt, J. M. Romm, K. F. Doheny, G. Abecasis, M. Boehnke,and H. M. Kang, &#039;&#039;Detecting and Estimating Contamination of Human DNA Samples in Sequencing and Array-Based Genotype Data&#039;&#039;, American journal of human genetics doi:10.1016/j.ajhg.2012.09.004 (volume 91 issue 5 pp.839 - 848) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== For array intensity data ==&lt;br /&gt;
&lt;br /&gt;
[[VerifyIDintensity]] software can estimate sample contamination from Illumina genotype array intensity data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Acknowledgements ==&lt;br /&gt;
&lt;br /&gt;
VerifyBamID is a result from collaborative effort by Hyun Min Kang, Goo Jun, Matthew Flickinger, Mary Kate Wing, and Goncalo Abecasis. Please email to Hyun Min Kang [[mailto:hmkang@umich.edu| hmkang@umich.edu ]] for any questions.&lt;/div&gt;</summary>
		<author><name>Gjun</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=VerifyBamID&amp;diff=6562</id>
		<title>VerifyBamID</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=VerifyBamID&amp;diff=6562"/>
		<updated>2013-02-26T05:54:03Z</updated>

		<summary type="html">&lt;p&gt;Gjun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Software|VerifyBamID]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;verifyBamID&#039;&#039;&#039; is a software that verifies whether the reads in particular file match previously known genotypes for an individual (or group of individuals), and checks whether the reads are contaminated as a mixture of two samples. &#039;&#039;&#039;verifyBamID&#039;&#039;&#039; can detect sample contamination and swaps when external genotypes are available. When external genotypes are not available, &#039;&#039;&#039;verifyBamID&#039;&#039;&#039; still robustly detects sample swaps.&lt;br /&gt;
&lt;br /&gt;
== Download verifyBamID  ==&lt;br /&gt;
&lt;br /&gt;
To get a copy go to the [http://www.sph.umich.edu/csg/kang/verifyBamID/download VerifyBamID Download] download page.&lt;br /&gt;
&lt;br /&gt;
== Join in verifyBamID mailing list ==&lt;br /&gt;
&lt;br /&gt;
Please join in the [http://groups.google.com/group/verifybamid VerifyBamID Google Group] to ask / discuss / comment about verifyBamID.&lt;br /&gt;
&lt;br /&gt;
== What&#039;s new ==&lt;br /&gt;
&lt;br /&gt;
(2012/06/20) &lt;br /&gt;
* Fixed a bug of incorrect estimate of contamination when --chip-full option was used (Thanks to Richard Smith)&lt;br /&gt;
* Fixed a bug of incorrect per-readgroup output in --chip-* parameter&lt;br /&gt;
&lt;br /&gt;
(2012/05/24) &lt;br /&gt;
* Fixed a bug of incorrect per-readgroup output (Thanks to Matthew Flickinger)&lt;br /&gt;
* &#039;&#039;&#039;(IMPORTANT)&#039;&#039;&#039; Add an option to remove either side of overlapping fragment. This option is turned on by default, and can be turned off usig --ignoreOverlapPair. If your sequence data has very short insert size, this update may increase the sensitivity of estimated contamination.&lt;br /&gt;
* Changes in the directory structure and Makefile&lt;br /&gt;
&lt;br /&gt;
(2012/05/18) The new release of verifyBamID have undergone major change since the last version (as of 2011 April). Here are the highlights&lt;br /&gt;
* The genotype / allele frequency file is now based on VCF format rather than PLINK format.&lt;br /&gt;
* The reference sequence information is no longer required&lt;br /&gt;
* Uses Brent&#039;s method for precise estimation of contamination parameters&lt;br /&gt;
* Generate the depth distribution statistics.&lt;br /&gt;
* Estimated reference-bias parameters (useful mostly for ABI SOLiD sequence data)&lt;br /&gt;
&lt;br /&gt;
== Build verifyBamID  ==&lt;br /&gt;
&lt;br /&gt;
The binary download of verifyBamID is available. You may use the version in Ubuntu 64-bit platform. To build verifyBamID, download the statgen library and run the following series of commands&lt;br /&gt;
 tar xzvf verifyBamID.20120620.tar.gz&lt;br /&gt;
 cd verifyBamID&lt;br /&gt;
 make cloneLib (in the case ../libStatGen does not exist)&lt;br /&gt;
 make&lt;br /&gt;
 ./bin/verifyBamID&lt;br /&gt;
&lt;br /&gt;
Note that &#039;&#039;&#039;git clone&#039;&#039;&#039; command will create a directory ./libStatGen under your working directory, and &#039;&#039;&#039;make&#039;&#039;&#039; will create binary of verifyBamID under verifyBamID/bin/&lt;br /&gt;
&lt;br /&gt;
verifyBamID is designed to be reasonably portable. &lt;br /&gt;
&lt;br /&gt;
However, since development occurs only on Ubuntu 9.10 x86 and x64 platforms, and later, there are likely other portability issues. &lt;br /&gt;
&lt;br /&gt;
Currently we support verifyBamID only on Ubuntu 9.10 and later on 64-bit processors.&lt;br /&gt;
&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
&lt;br /&gt;
A key step in any genetic analysis is to verify whether data being generated matches expectations. &#039;&#039;verifyBamID&#039;&#039; checks whether reads in a BAM file match previous genotypes for a specific sample. In addition, it detects possible sample mixture from population allele frequency only, which can be particularly useful when the genotype data is not available.&lt;br /&gt;
&lt;br /&gt;
Using a mathematical model that relates observed sequence reads to an hypothetical true genotype, &#039;&#039;verifyBamID&#039;&#039; tries to decide whether sequence reads match a particular individual or are more likely to be contaminated (including a small proportion of foreign DNA), derived from a closely related individual, or derived from a completely different individual.&lt;br /&gt;
&lt;br /&gt;
== Basic Usage Example ==&lt;br /&gt;
&lt;br /&gt;
Here is a typical command line:&lt;br /&gt;
&lt;br /&gt;
 verifyBamID --vcf [input.vcf] --bam [input.bam] --out [output.prefix] --verbose --ignoreRG&lt;br /&gt;
 &lt;br /&gt;
 where&lt;br /&gt;
 [input.bam] is a BAM (Binary Alignment Map) file of a sequence reads&lt;br /&gt;
 [input.vcf] is input VCF file containing individual genotypes or AF or AC/AN fields in the INFO field. gzipped VCF is also allowed.&lt;br /&gt;
 [outPrefix] is output prefix of output files - [outPrefix].{selfRG,selfSM,bestRG,bestSM,depthRG,depthSM} will be created.&lt;br /&gt;
&lt;br /&gt;
More detailed description of command line input is below&lt;br /&gt;
&lt;br /&gt;
== Preparing input files ==&lt;br /&gt;
&lt;br /&gt;
verifyBamID requires two input files - VCF file containing external genotypes or allele frequency information, and the BAM file.&lt;br /&gt;
&lt;br /&gt;
=== VCF input genotype file ===&lt;br /&gt;
&lt;br /&gt;
The input VCF file contains (1) external genotype information and/or (2) allele frequency information as AF entry or AC/AN entries in the INFO field. (See [http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 | VCF specification] for further details). If neither information is provided, verifyBamID will not work properly.&lt;br /&gt;
&lt;br /&gt;
If external genotype information is provided, sequence+array method will identify contamination and sample swaps by comparing the concordance between the external genotypes and the sequence reads. Additionally, sequence-only method will provide additional contamination estimates by modeling the sequence reads as mixture of two unknown samples based on the allele frequency information in the VCF file.&lt;br /&gt;
&lt;br /&gt;
Input VCF file needs to meet several additional contraints need to meet in order to properly run verifyBamID.&lt;br /&gt;
* The VCF is assumed to be well-formed. For example, verifyBamID does not check whether REF allele actually matches with reference sequence.  &lt;br /&gt;
* The VCF should only contain SNPs. Current version of verifyBamID does not accept INDELs, MNPs, Structural Variations, or other complex variants.&lt;br /&gt;
* The individual IDs in the VCF file, must be identical with the individual identifier in the BAM file. Otherwise, --smID option can override the sample ID information of the BAM file to the ID that matches to the individual IDs in the VCF file.&lt;br /&gt;
* IMPORTANT : For targeted sequencing data, it is important to subselect the markers to only include on-target markers in the genotype file. Off-target markers are not likely to have multiple non-duplicated reads at the marker position, and it may create artifacts in the analysis due to overlapping fragments.&lt;br /&gt;
* Currently, verifyBamID takes only autosomal chromosomes as input VCF.&lt;br /&gt;
&lt;br /&gt;
An example input VCF file (without external genotype) is provided below. Note that AC and AC entries exists in the INFO field for the allele frequency information.&lt;br /&gt;
&lt;br /&gt;
 #CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO&lt;br /&gt;
 20	61651	SNP20-9651	C	A	.	PASS	CR=99.86851;GentrainScore=0.7055;HW=0.077647716;AN=2180;AC=11&lt;br /&gt;
 20	63231	SNP20-11231	T	G	.	PASS	CR=99.93036;GentrainScore=0.7837;HW=0.035481825;AN=2182;AC=275&lt;br /&gt;
 20	63244	rs6139074	A	C	.	PASS	CR=98.893394;GentrainScore=0.8001;HW=7.327299E-7;AN=2162;AC=501&lt;br /&gt;
 20	63799	rs1418258	C	T	.	PASS	CR=99.75217;GentrainScore=0.8170;HW=0.6653377;AN=2182;AC=881&lt;br /&gt;
&lt;br /&gt;
=== Input BAM file ===&lt;br /&gt;
&lt;br /&gt;
verifyBamID requires a sorted, indexed, base quality recalibrated, and duplication-marked BAM file. It also requires to contain &amp;quot;@RG&amp;quot; header lines to annotation different readGroups (sequencing runs and lanes). The SM tag in the &amp;quot;@RG&amp;quot; header should match with one of the genotyped sample. Otherwise, verifyBamID may not be able to test whether the sequenced sample matches with genotyped sample, but will try to detect sample mixture from allele frequency, and will try to detect the best-matching sample among the genotyped sample.&lt;br /&gt;
&lt;br /&gt;
== What the default option does ==&lt;br /&gt;
&lt;br /&gt;
The default option of &#039;&#039;&#039;verifyBamID&#039;&#039;&#039; is the recommended setting for the most sequencing studies to provide a rapid and informative response. The default option provides the following features:&lt;br /&gt;
* --free-mix is turned on for estimating contamination using sequence-only method&lt;br /&gt;
* --chip-mix is turned on for estimating contamination or swap using sequence+array method, if the external genotype file is provided in the VCF&lt;br /&gt;
* --self is turnd on : The default option does not try to compare the sequence reads to identify the best matching individual (which is possible with --best option). It only compares with the external genotypes from the same individual to the sequenced individual.&lt;br /&gt;
* --maxDepth 20 is used without --precise option : The default option is intended for whole genome low coverage sequencing. For the targeted exome sequencing, --maxDepth 1000 and --precise is recommended.&lt;br /&gt;
* --ignoreRG is not a default option, but a recommended option, when you want to check the contamination for the entire BAM rather than examining each read group separately. This option will increase the computational efficiency especially in the case whether the sequence reads are multiplexed across many sequencing runs.&lt;br /&gt;
&lt;br /&gt;
== Interpreting output files ==&lt;br /&gt;
&lt;br /&gt;
=== Output files ===&lt;br /&gt;
When verifyBamID runs successfully, the following sets of files may be generated.&lt;br /&gt;
* [outPrefix].selfSM - Per-sample statistics describing how well the sample matches to the annotated sample.&lt;br /&gt;
* [outPrefix].depthSM - The depth distribution of the sequence reads per sample&lt;br /&gt;
* [outPrefix].selfRG - Per-readGroup statistics describing how well each lane matches to the annotated sample. (available only without --ignoreRG option)&lt;br /&gt;
* [outPrefix].depthRG - The depth distribution of the sequence reads per readGroup. (available only without --ignoreRG option)&lt;br /&gt;
* [outPrefix].bestSM - Per-sample best-match statistics with best-matching sample among the genotyped sample (available only with --best option)&lt;br /&gt;
* [outPrefix].bestRG - Per-readgroup best-match statistics with best-matching sample among the genotyped sample (available only with --best and without --ignoreRG option)&lt;br /&gt;
&lt;br /&gt;
=== Column information in the output files ===&lt;br /&gt;
The .selfSM/.selfRG/.bestSM/.bestRG files have the following 19 columns per sample, or per readgroup (lane). &lt;br /&gt;
&lt;br /&gt;
# SEQ_SM : Sample ID of the sequenced sample. Obtained from @RG header / SM tag in the BAM file&lt;br /&gt;
# RG : ReadGroup ID of sequenced lane. For [outPrefix].selfSM and [outPrefix].bestSM, these values are &amp;quot;ALL&amp;quot;&lt;br /&gt;
# CHIP_ID : Sample ID compared to in the genotype file. For [outPrefix].selfRG and [outPrefix].selfSM, these values should be identical to [SEQ_SM] or &amp;quot;NA&amp;quot; if the genotype of sequenced samples are unavailable. For [outPrefix].bestRG and [outPrefix].bestSM, these values should be the ID of best-matching sample among the genotype files compared to.&lt;br /&gt;
# # SNPs : # of SNPs passing the criteria from the VCF file&lt;br /&gt;
# # READS : Total # of reads loaded from the BAM file&lt;br /&gt;
# # AVG_DP : Average sequencing depth at the sites in the VCF file&lt;br /&gt;
# FREEMIX : Sequence-only estimate of contamination (0-1 scale)&lt;br /&gt;
# FREELK1 : Maximum log-likelihood of the sequence reads given estimated contamination under sequence-only method&lt;br /&gt;
# FREELK0 : Log-ikelihood of the sequence reads given no contamination under sequence-only method&lt;br /&gt;
# FREE_RH : Estimated reference bias parameter Pr(refBase|HET) (when --free-refBias or --free-full is used)&lt;br /&gt;
# FREE_RA : Estimated reference bias parameter Pr(refBase|HOMALT) (when --free-refBias or --free-full is used)&lt;br /&gt;
# CHIPMIX : Sequence+array estimate of contamination (NA if the external genotype is unavailable) (0-1 scale)&lt;br /&gt;
# CHIPLK1 : Maximum log-likelihood of the sequence reads given estimated contamination under sequence+array method (NA if the external genotypes are unavailable)&lt;br /&gt;
# CHIPLK0 : Log-likelihood of the sequence reads given no contamination under sequence+array method (NA if the external genotypes are unavailable)&lt;br /&gt;
# CHIP_RH : Estimated reference bias parameter Pr(refBase|HET) (when --chip-refBias or --chip-full is used)&lt;br /&gt;
# CHIP_RA : Estimated reference bias parameter Pr(refBase|HOMALT) (when --chip-refBias or --chip-full is used)&lt;br /&gt;
# DPREF : Depth (Coverage) of HomRef site (based on the genotypes of (SELF_SM/BEST_SM), passing mapQ, baseQual, maxDepth thresholds.&lt;br /&gt;
# RDPHET : DPHET/DPREF, Relative depth at Heterozygous site.&lt;br /&gt;
# RDPALT : DPHET/DPREF, Relative depth at HomAlt site.&lt;br /&gt;
&lt;br /&gt;
=== A guideline to interpret output files ===&lt;br /&gt;
&lt;br /&gt;
verifyBamID provides a series of information that is informative to determine whether the sample is possibly contaminated or swapped, but there is no single criteria that works for every circumstances. There are a few unmodeled factor in the estimation of [SELF-IBD]/[BEST-IBD] and [%MIX], so please note that the MLE estimation may not always exactly match to the true amount of contamination. Here we provide a guideline to flag potentially contaminated/swapped samples &lt;br /&gt;
&lt;br /&gt;
*  Each sample or lane can be checked in this way. When [CHIPMIX] &amp;gt;&amp;gt; 0.02 and/or [FREEMIX] &amp;gt;&amp;gt; 0.02, meaning 2% or more of non-reference bases are observed in reference sites, we recommend to examine the data more carefully for the possibility of contamination.&lt;br /&gt;
* We recommend to check each lane for the possibility of sample swaps. When [CHIPMIX] ~ 1 AND [FREEMIX] ~ 0, then it is possible that the sample is swapped with another sample. When [CHIPMIX] ~ 0 in .bestSM file, [CHIP_ID] might be actually the swapped sample. Otherwise, the swapped sample may not exist in the genotype data you have compared. &lt;br /&gt;
* When genotype data is not available but allele-frequency-based estimates of [FREEMIX] &amp;gt;= 0.03 and [FREELK1]-[FREELK0] is large, then it is possible that the sample is contaminated with other sample. We recommend to use per-sample data rather than per-lane data for checking this for low coverage data, because the inference will be more confident when there are large number of bases with depth 2 or higher.&lt;br /&gt;
&lt;br /&gt;
== Command Line Options ==&lt;br /&gt;
&lt;br /&gt;
 The following parameters are available.  Ones with &amp;quot;[]&amp;quot; are in effect:&lt;br /&gt;
 &lt;br /&gt;
 Available Options&lt;br /&gt;
                             Input Files : --vcf [], --bam [], --subset [],&lt;br /&gt;
                                           --smID []&lt;br /&gt;
                    VCF analysis options : --genoError [1.0e-03],&lt;br /&gt;
                                           --minAF [0.01],&lt;br /&gt;
                                           --minCallRate [0.50]&lt;br /&gt;
   Individuals to compare with chip data : --site, --self, --best&lt;br /&gt;
          Chip-free optimization options : --free-none, --free-mix [ON],&lt;br /&gt;
                                           --free-refBias, --free-full&lt;br /&gt;
          With-chip optimization options : --chip-none, --chip-mix [ON],&lt;br /&gt;
                                           --chip-refBias, --chip-full&lt;br /&gt;
                    BAM analysis options : --ignoreRG, --ignoreOverlapPair,&lt;br /&gt;
                                           --noEOF, --precise, --minMapQ [10],&lt;br /&gt;
                                           --maxDepth [20], --minQ [13],&lt;br /&gt;
                                           --maxQ [40], --grid [0.05]&lt;br /&gt;
                 Modeling Reference Bias : --refRef [1.00], --refHet [0.50],&lt;br /&gt;
                                           --refAlt [0.00]&lt;br /&gt;
                          Output options : --out [], --verbose&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each option provides the following features:&lt;br /&gt;
* --vcf : specify required VCF file&lt;br /&gt;
* --bam : specify required BAM file (indexed with .bam.bai or .bai file)&lt;br /&gt;
* --subset : list of individual IDs to calculate the allele frequency. All individuals are used if unspecified&lt;br /&gt;
* --smID : If the individual ID in the BAM file and VCF file does not match, substitute the BAM file&#039;s ID into the specified argument&lt;br /&gt;
* --genoError : error rate of the external genotype file&lt;br /&gt;
* --minAF : minimum allele frequency of the markers to include&lt;br /&gt;
* --minAF : minimum call rate of the markers to include&lt;br /&gt;
* --site : If set, use only site information in the VCF and do not compare with the actual genotypes&lt;br /&gt;
* --self : Only compare the ID-matching individuals between the VCF and BAM file&lt;br /&gt;
* --best : Find the best matching individuals (.bestSM and .bestRG files will be produced). This option is substantially longer than the default option&lt;br /&gt;
* --free-none : Do not perform sequence-only method to estimate parameters&lt;br /&gt;
* --free-mix : (default) Estimate contamination using sequence-only method with Brent&#039;s single dimensional optimization.&lt;br /&gt;
* --free-refBias : Estimate the refernece bias parameters using sequence-only method with Simplex method&lt;br /&gt;
* --free-full : Estimate both reference bias parameters and the contamination parameters using sequence-only method&lt;br /&gt;
* --chip-none : Do not perform sequence+array method to estimate parameters&lt;br /&gt;
* --free-mix : (default) Estimate contamination using sequence+array method with Brent&#039;s single dimensional optimization.&lt;br /&gt;
* --free-refBias : Estimate the refernece bias parameters using sequence+array method with Simplex method&lt;br /&gt;
* --free-full : Estimate both reference bias parameters and the contamination parameters using sequence+array method&lt;br /&gt;
* --ignoreRG : ignore the read grouup level comparison and compare samples only (recommended for an expedited run)&lt;br /&gt;
* --ignoreOverlapPair : ignore overlapping pair end fragment covering the same base. Disabling this option may decrease the sensitivity of the method when the insert size is short (with slight gain in the computational speed)&lt;br /&gt;
* --noEOF : do not check the EOF marker of the BAM file (for earlier version of BAM)&lt;br /&gt;
* --precise : calculate the likelihood in log-scale for high-depth data (recommended when --maxDepth is greater than 20. Can be a little bit slower)&lt;br /&gt;
* --minMapQ : minimum mapping quality of the sequence reads to compare&lt;br /&gt;
* --minQ : minimum base quality to include&lt;br /&gt;
* --maxQ : maximum base quality to cap&lt;br /&gt;
* --grid : the grid interval to search the optimum before running Brent&#039;s algorithm.&lt;br /&gt;
* --refRef : Initial Pr(refBase|HOMREFGeno) parameter&lt;br /&gt;
* --refHet : Initial Pr(refBase|HETGeno) parameter&lt;br /&gt;
* --refAlt : Initial Pr(refBase|HOMALTGeno) parameter&lt;br /&gt;
* --out : output file prefix (required)&lt;br /&gt;
* --verbose : print the progress of the method on the screeen&lt;br /&gt;
&lt;br /&gt;
== Principle of Operation ==&lt;br /&gt;
&lt;br /&gt;
Each read group in a BAM file is evaluated independently. This means that in file with multiple read groups, problems will be flagged at the read group level (a plus). However, it also means that it might be hard to discern the correct assignment of read groups with very little data.&lt;br /&gt;
&lt;br /&gt;
For each aligned base that overlaps a known genotype, we calculate the probability the probability that it was derived from a particular known genotype. This comparison considers only bases that overlap previously known genotypes and that meet the base quality and mapping quality thresholds.&lt;br /&gt;
&lt;br /&gt;
Each individual in a pedigree has a different combination of genotypes, and bamGenotypeCheck will systematically search for the individual whose genotypes best match the observed read data.&lt;br /&gt;
&lt;br /&gt;
For more about the technical details, see the page [[Verifying Sample Identities - Implementation]]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
&lt;br /&gt;
Please cite the following paper:&lt;br /&gt;
&lt;br /&gt;
G. Jun, M. Flickinger, K. N. Hetrick, Kurt, J. M. Romm, K. F. Doheny, G. Abecasis, M. Boehnke,and H. M. Kang, &#039;&#039;Detecting and Estimating Contamination of Human DNA Samples in Sequencing and Array-Based Genotype Data&#039;&#039;, American journal of human genetics doi:10.1016/j.ajhg.2012.09.004 (volume 91 issue 5 pp.839 - 848) &lt;br /&gt;
&lt;br /&gt;
== For array intensity data ==&lt;br /&gt;
&lt;br /&gt;
== For sequence data ==&lt;br /&gt;
&lt;br /&gt;
[[VerifyIDintensity]] software can estimate sample contamination from Illumina genotype array intensity data.&lt;br /&gt;
&lt;br /&gt;
== Acknowledgements ==&lt;br /&gt;
&lt;br /&gt;
VerifyBamID is a result from collaborative effort by Hyun Min Kang, Goo Jun, Matthew Flickinger, Mary Kate Wing, and Goncalo Abecasis. Please email to Hyun Min Kang [[mailto:hmkang@umich.edu| hmkang@umich.edu ]] for any questions.&lt;/div&gt;</summary>
		<author><name>Gjun</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=VerifyIDintensity&amp;diff=6561</id>
		<title>VerifyIDintensity</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=VerifyIDintensity&amp;diff=6561"/>
		<updated>2013-02-26T05:53:04Z</updated>

		<summary type="html">&lt;p&gt;Gjun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Software|VerifyIDintensity]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;verifyIDintensity&#039;&#039;&#039; is a software that detects and estimates sample contamination using intensity data from Illumina genotyping arrays using a mixture model. &lt;br /&gt;
&lt;br /&gt;
== Download verifyIDintensity ==&lt;br /&gt;
&lt;br /&gt;
* [[File:VerifyIDintensity.tgz]]&lt;br /&gt;
&lt;br /&gt;
== Build verifyID intensity ==&lt;br /&gt;
&lt;br /&gt;
To build verifyIDintensity, run the following series of commands. You need [http://www.boost.org/ boost library] and [http://tclap.sourceforge.net/ tclap].&lt;br /&gt;
&lt;br /&gt;
   $ tar xzvf verifyIDintensity.tgz &lt;br /&gt;
   $ make&lt;br /&gt;
&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
&lt;br /&gt;
verifyIDintensity  [-t &amp;lt;float&amp;gt;] [-m &amp;lt;int&amp;gt;] -n &amp;lt;int&amp;gt; [-b &amp;lt;string&amp;gt;] [-s &amp;lt;string&amp;gt;] -i &amp;lt;string&amp;gt; [-v] [-p] [--] [--version] [-h]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Options ==&lt;br /&gt;
&lt;br /&gt;
   -t &amp;lt;float&amp;gt;,  --threshold &amp;lt;float&amp;gt;&lt;br /&gt;
     Minimum allele frequency for likelihood estimation, default is 0.01&lt;br /&gt;
&lt;br /&gt;
   -m &amp;lt;int&amp;gt;,  --marker &amp;lt;int&amp;gt;&lt;br /&gt;
     (required) Number of markers&lt;br /&gt;
&lt;br /&gt;
   -n &amp;lt;int&amp;gt;,  --number &amp;lt;int&amp;gt;&lt;br /&gt;
     (required) Number of samples&lt;br /&gt;
&lt;br /&gt;
   -b &amp;lt;string&amp;gt;,  --abf &amp;lt;string&amp;gt;&lt;br /&gt;
     Allele frequency file (ABF), which is a plain text file with SNP_ID and Allele_B frequency. &lt;br /&gt;
     SNP_IDs should be sorted in the same order as the intensity file&lt;br /&gt;
&lt;br /&gt;
   -s &amp;lt;string&amp;gt;,  --stat &amp;lt;string&amp;gt;&lt;br /&gt;
     Statistics file (created if not exist)&lt;br /&gt;
&lt;br /&gt;
   -i &amp;lt;string&amp;gt;,  --in &amp;lt;string&amp;gt;&lt;br /&gt;
     (required)  Input pre-computed intensity (.adpc.bin) file&lt;br /&gt;
&lt;br /&gt;
   -v,  --verbose&lt;br /&gt;
     Turn on verbose mode&lt;br /&gt;
&lt;br /&gt;
   -p,  --persample&lt;br /&gt;
     Do per-sample analysis, default is per-marker analysis&lt;br /&gt;
&lt;br /&gt;
   --,  --ignore_rest&lt;br /&gt;
     Ignores the rest of the labeled arguments following this flag.&lt;br /&gt;
&lt;br /&gt;
   --version&lt;br /&gt;
     Displays version information and exits.&lt;br /&gt;
&lt;br /&gt;
   -h,  --help&lt;br /&gt;
     Displays usage information and exits.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
&lt;br /&gt;
Please cite the following paper:&lt;br /&gt;
&lt;br /&gt;
G. Jun, M. Flickinger, K. N. Hetrick, Kurt, J. M. Romm, K. F. Doheny, G. Abecasis, M. Boehnke,and H. M. Kang, &#039;&#039;Detecting and Estimating Contamination of Human DNA Samples in Sequencing and Array-Based Genotype Data&#039;&#039;, American journal of human genetics doi:10.1016/j.ajhg.2012.09.004 (volume 91 issue 5 pp.839 - 848) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== For sequence data ==&lt;br /&gt;
&lt;br /&gt;
[[VerifyBamID]] software can estimate sample contamination from aligned sequence reads and population minor allele frequency&lt;/div&gt;</summary>
		<author><name>Gjun</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=VerifyBamID&amp;diff=5991</id>
		<title>VerifyBamID</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=VerifyBamID&amp;diff=5991"/>
		<updated>2012-12-04T04:15:15Z</updated>

		<summary type="html">&lt;p&gt;Gjun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Software|VerifyBamID]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;verifyBamID&#039;&#039;&#039; is a software that verifies whether the reads in particular file match previously known genotypes for an individual (or group of individuals), and checks whether the reads are contaminated as a mixture of two samples. &#039;&#039;&#039;verifyBamID&#039;&#039;&#039; can detect sample contamination and swaps when external genotypes are available. When external genotypes are not available, &#039;&#039;&#039;verifyBamID&#039;&#039;&#039; still robustly detects sample swaps.&lt;br /&gt;
&lt;br /&gt;
== Download verifyBamID  ==&lt;br /&gt;
&lt;br /&gt;
To get a copy go to the [http://www.sph.umich.edu/csg/kang/verifyBamID/download VerifyBamID Download] download page.&lt;br /&gt;
&lt;br /&gt;
== Join in verifyBamID mailing list ==&lt;br /&gt;
&lt;br /&gt;
Please join in the [http://groups.google.com/group/verifybamid | VerifyBamID Google Group] to ask / discuss / comment about verifyBamID.&lt;br /&gt;
&lt;br /&gt;
== What&#039;s new ==&lt;br /&gt;
&lt;br /&gt;
(2012/06/20) &lt;br /&gt;
* Fixed a bug of incorrect estimate of contamination when --chip-full option was used (Thanks to Richard Smith)&lt;br /&gt;
* Fixed a bug of incorrect per-readgroup output in --chip-* parameter&lt;br /&gt;
&lt;br /&gt;
(2012/05/24) &lt;br /&gt;
* Fixed a bug of incorrect per-readgroup output (Thanks to Matthew Flickinger)&lt;br /&gt;
* &#039;&#039;&#039;(IMPORTANT)&#039;&#039;&#039; Add an option to remove either side of overlapping fragment. This option is turned on by default, and can be turned off usig --ignoreOverlapPair. If your sequence data has very short insert size, this update may increase the sensitivity of estimated contamination.&lt;br /&gt;
* Changes in the directory structure and Makefile&lt;br /&gt;
&lt;br /&gt;
(2012/05/18) The new release of verifyBamID have undergone major change since the last version (as of 2011 April). Here are the highlights&lt;br /&gt;
* The genotype / allele frequency file is now based on VCF format rather than PLINK format.&lt;br /&gt;
* The reference sequence information is no longer required&lt;br /&gt;
* Uses Brent&#039;s method for precise estimation of contamination parameters&lt;br /&gt;
* Generate the depth distribution statistics.&lt;br /&gt;
* Estimated reference-bias parameters (useful mostly for ABI SOLiD sequence data)&lt;br /&gt;
&lt;br /&gt;
== Build verifyBamID  ==&lt;br /&gt;
&lt;br /&gt;
The binary download of verifyBamID is available. You may use the version in Ubuntu 64-bit platform. To build verifyBamID, download the statgen library and run the following series of commands&lt;br /&gt;
 tar xzvf verifyBamID.20120620.tar.gz&lt;br /&gt;
 cd verifyBamID&lt;br /&gt;
 make cloneLib (in the case ../libStatGen does not exist)&lt;br /&gt;
 make&lt;br /&gt;
 ./bin/verifyBamID&lt;br /&gt;
&lt;br /&gt;
Note that &#039;&#039;&#039;git clone&#039;&#039;&#039; command will create a directory ./libStatGen under your working directory, and &#039;&#039;&#039;make&#039;&#039;&#039; will create binary of verifyBamID under verifyBamID/bin/&lt;br /&gt;
&lt;br /&gt;
verifyBamID is designed to be reasonably portable. &lt;br /&gt;
&lt;br /&gt;
However, since development occurs only on Ubuntu 9.10 x86 and x64 platforms, and later, there are likely other portability issues. &lt;br /&gt;
&lt;br /&gt;
Currently we support verifyBamID only on Ubuntu 9.10 and later on 64-bit processors.&lt;br /&gt;
&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
&lt;br /&gt;
A key step in any genetic analysis is to verify whether data being generated matches expectations. &#039;&#039;verifyBamID&#039;&#039; checks whether reads in a BAM file match previous genotypes for a specific sample. In addition, it detects possible sample mixture from population allele frequency only, which can be particularly useful when the genotype data is not available.&lt;br /&gt;
&lt;br /&gt;
Using a mathematical model that relates observed sequence reads to an hypothetical true genotype, &#039;&#039;verifyBamID&#039;&#039; tries to decide whether sequence reads match a particular individual or are more likely to be contaminated (including a small proportion of foreign DNA), derived from a closely related individual, or derived from a completely different individual.&lt;br /&gt;
&lt;br /&gt;
== Basic Usage Example ==&lt;br /&gt;
&lt;br /&gt;
Here is a typical command line:&lt;br /&gt;
&lt;br /&gt;
 verifyBamID --vcf [input.vcf] --bam [input.bam] --out [output.prefix] --verbose --ignoreRG&lt;br /&gt;
 &lt;br /&gt;
 where&lt;br /&gt;
 [input.bam] is a BAM (Binary Alignment Map) file of a sequence reads&lt;br /&gt;
 [input.vcf] is input VCF file containing individual genotypes or AF or AC/AN fields in the INFO field. gzipped VCF is also allowed.&lt;br /&gt;
 [outPrefix] is output prefix of output files - [outPrefix].{selfRG,selfSM,bestRG,bestSM,depthRG,depthSM} will be created.&lt;br /&gt;
&lt;br /&gt;
More detailed description of command line input is below&lt;br /&gt;
&lt;br /&gt;
== Preparing input files ==&lt;br /&gt;
&lt;br /&gt;
verifyBamID requires two input files - VCF file containing external genotypes or allele frequency information, and the BAM file.&lt;br /&gt;
&lt;br /&gt;
=== VCF input genotype file ===&lt;br /&gt;
&lt;br /&gt;
The input VCF file contains (1) external genotype information and/or (2) allele frequency information as AF entry or AC/AN entries in the INFO field. (See [http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 | VCF specification] for further details). If neither information is provided, verifyBamID will not work properly.&lt;br /&gt;
&lt;br /&gt;
If external genotype information is provided, sequence+array method will identify contamination and sample swaps by comparing the concordance between the external genotypes and the sequence reads. Additionally, sequence-only method will provide additional contamination estimates by modeling the sequence reads as mixture of two unknown samples based on the allele frequency information in the VCF file.&lt;br /&gt;
&lt;br /&gt;
Input VCF file needs to meet several additional contraints need to meet in order to properly run verifyBamID.&lt;br /&gt;
* The VCF is assumed to be well-formed. For example, verifyBamID does not check whether REF allele actually matches with reference sequence.  &lt;br /&gt;
* The VCF should only contain SNPs. Current version of verifyBamID does not accept INDELs, MNPs, Structural Variations, or other complex variants.&lt;br /&gt;
* The individual IDs in the VCF file, must be identical with the individual identifier in the BAM file. Otherwise, --smID option can override the sample ID information of the BAM file to the ID that matches to the individual IDs in the VCF file.&lt;br /&gt;
* IMPORTANT : For targeted sequencing data, it is important to subselect the markers to only include on-target markers in the genotype file. Off-target markers are not likely to have multiple non-duplicated reads at the marker position, and it may create artifacts in the analysis due to overlapping fragments.&lt;br /&gt;
* Currently, verifyBamID takes only autosomal chromosomes as input VCF.&lt;br /&gt;
&lt;br /&gt;
An example input VCF file (without external genotype) is provided below. Note that AC and AC entries exists in the INFO field for the allele frequency information.&lt;br /&gt;
&lt;br /&gt;
 #CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO&lt;br /&gt;
 20	61651	SNP20-9651	C	A	.	PASS	CR=99.86851;GentrainScore=0.7055;HW=0.077647716;AN=2180;AC=11&lt;br /&gt;
 20	63231	SNP20-11231	T	G	.	PASS	CR=99.93036;GentrainScore=0.7837;HW=0.035481825;AN=2182;AC=275&lt;br /&gt;
 20	63244	rs6139074	A	C	.	PASS	CR=98.893394;GentrainScore=0.8001;HW=7.327299E-7;AN=2162;AC=501&lt;br /&gt;
 20	63799	rs1418258	C	T	.	PASS	CR=99.75217;GentrainScore=0.8170;HW=0.6653377;AN=2182;AC=881&lt;br /&gt;
&lt;br /&gt;
=== Input BAM file ===&lt;br /&gt;
&lt;br /&gt;
verifyBamID requires a sorted, indexed, base quality recalibrated, and duplication-marked BAM file. It also requires to contain &amp;quot;@RG&amp;quot; header lines to annotation different readGroups (sequencing runs and lanes). The SM tag in the &amp;quot;@RG&amp;quot; header should match with one of the genotyped sample. Otherwise, verifyBamID may not be able to test whether the sequenced sample matches with genotyped sample, but will try to detect sample mixture from allele frequency, and will try to detect the best-matching sample among the genotyped sample.&lt;br /&gt;
&lt;br /&gt;
== What the default option does ==&lt;br /&gt;
&lt;br /&gt;
The default option of &#039;&#039;&#039;verifyBamID&#039;&#039;&#039; is the recommended setting for the most sequencing studies to provide a rapid and informative response. The default option provides the following features:&lt;br /&gt;
* --free-mix is turned on for estimating contamination using sequence-only method&lt;br /&gt;
* --chip-mix is turned on for estimating contamination or swap using sequence+array method, if the external genotype file is provided in the VCF&lt;br /&gt;
* --self is turnd on : The default option does not try to compare the sequence reads to identify the best matching individual (which is possible with --best option). It only compares with the external genotypes from the same individual to the sequenced individual.&lt;br /&gt;
* --maxDepth 20 is used without --precise option : The default option is intended for whole genome low coverage sequencing. For the targeted exome sequencing, --maxDepth 1000 and --precise is recommended.&lt;br /&gt;
* --ignoreRG is not a default option, but a recommended option, when you want to check the contamination for the entire BAM rather than examining each read group separately. This option will increase the computational efficiency especially in the case whether the sequence reads are multiplexed across many sequencing runs.&lt;br /&gt;
&lt;br /&gt;
== Interpreting output files ==&lt;br /&gt;
&lt;br /&gt;
=== Output files ===&lt;br /&gt;
When verifyBamID runs successfully, the following sets of files may be generated.&lt;br /&gt;
* [outPrefix].selfSM - Per-sample statistics describing how well the sample matches to the annotated sample.&lt;br /&gt;
* [outPrefix].depthSM - The depth distribution of the sequence reads per sample&lt;br /&gt;
* [outPrefix].selfRG - Per-readGroup statistics describing how well each lane matches to the annotated sample. (available only without --ignoreRG option)&lt;br /&gt;
* [outPrefix].depthRG - The depth distribution of the sequence reads per readGroup. (available only without --ignoreRG option)&lt;br /&gt;
* [outPrefix].bestSM - Per-sample best-match statistics with best-matching sample among the genotyped sample (available only with --best option)&lt;br /&gt;
* [outPrefix].bestRG - Per-readgroup best-match statistics with best-matching sample among the genotyped sample (available only with --best and without --ignoreRG option)&lt;br /&gt;
&lt;br /&gt;
=== Column information in the output files ===&lt;br /&gt;
The .selfSM/.selfRG/.bestSM/.bestRG files have the following 19 columns per sample, or per readgroup (lane). &lt;br /&gt;
&lt;br /&gt;
# SEQ_SM : Sample ID of the sequenced sample. Obtained from @RG header / SM tag in the BAM file&lt;br /&gt;
# RG : ReadGroup ID of sequenced lane. For [outPrefix].selfSM and [outPrefix].bestSM, these values are &amp;quot;ALL&amp;quot;&lt;br /&gt;
# CHIP_ID : Sample ID compared to in the genotype file. For [outPrefix].selfRG and [outPrefix].selfSM, these values should be identical to [SEQ_SM] or &amp;quot;NA&amp;quot; if the genotype of sequenced samples are unavailable. For [outPrefix].bestRG and [outPrefix].bestSM, these values should be the ID of best-matching sample among the genotype files compared to.&lt;br /&gt;
# # SNPs : # of SNPs passing the criteria from the VCF file&lt;br /&gt;
# # READS : Total # of reads loaded from the BAM file&lt;br /&gt;
# # AVG_DP : Average sequencing depth at the sites in the VCF file&lt;br /&gt;
# FREEMIX : Sequence-only estimate of contamination&lt;br /&gt;
# FREELK1 : Maximum log-likelihood of the sequence reads given estimated contamination under sequence-only method&lt;br /&gt;
# FREELK0 : Log-ikelihood of the sequence reads given no contamination under sequence-only method&lt;br /&gt;
# FREE_RH : Estimated reference bias parameter Pr(refBase|HET) (when --free-refBias or --free-full is used)&lt;br /&gt;
# FREE_RA : Estimated reference bias parameter Pr(refBase|HOMALT) (when --free-refBias or --free-full is used)&lt;br /&gt;
# CHIPMIX : Sequence+array estimate of contamination (NA if the external genotype is unavailable)&lt;br /&gt;
# CHIPLK1 : Maximum log-likelihood of the sequence reads given estimated contamination under sequence+array method (NA if the external genotypes are unavailable)&lt;br /&gt;
# CHIPLK0 : Log-likelihood of the sequence reads given no contamination under sequence+array method (NA if the external genotypes are unavailable)&lt;br /&gt;
# CHIP_RH : Estimated reference bias parameter Pr(refBase|HET) (when --chip-refBias or --chip-full is used)&lt;br /&gt;
# CHIP_RA : Estimated reference bias parameter Pr(refBase|HOMALT) (when --chip-refBias or --chip-full is used)&lt;br /&gt;
# DPREF : Depth (Coverage) of HomRef site (based on the genotypes of (SELF_SM/BEST_SM), passing mapQ, baseQual, maxDepth thresholds.&lt;br /&gt;
# RDPHET : DPHET/DPREF, Relative depth at Heterozygous site.&lt;br /&gt;
# RDPALT : DPHET/DPREF, Relative depth at HomAlt site.&lt;br /&gt;
&lt;br /&gt;
=== A guideline to interpret output files ===&lt;br /&gt;
&lt;br /&gt;
verifyBamID provides a series of information that is informative to determine whether the sample is possibly contaminated or swapped, but there is no single criteria that works for every circumstances. There are a few unmodeled factor in the estimation of [SELF-IBD]/[BEST-IBD] and [%MIX], so please note that the MLE estimation may not always exactly match to the true amount of contamination. Here we provide a guideline to flag potentially contaminated/swapped samples &lt;br /&gt;
&lt;br /&gt;
*  Each sample or lane can be checked in this way. When [CHIPMIX] &amp;gt;&amp;gt; 0.02 and/or [FREEMIX] &amp;gt;&amp;gt; 0.02, meaning 2% or more of non-reference bases are observed in reference sites, we recommend to examine the data more carefully for the possibility of contamination.&lt;br /&gt;
* We recommend to check each lane for the possibility of sample swaps. When [CHIPMIX] ~ 1 AND [FREEMIX] ~ 0, then it is possible that the sample is swapped with another sample. When [CHIPMIX] ~ 0 in .bestSM file, [CHIP_ID] might be actually the swapped sample. Otherwise, the swapped sample may not exist in the genotype data you have compared. &lt;br /&gt;
* When genotype data is not available but allele-frequency-based estimates of [FREEMIX] &amp;gt;= 0.03 and [FREELK1]-[FREELK0] is large, then it is possible that the sample is contaminated with other sample. We recommend to use per-sample data rather than per-lane data for checking this for low coverage data, because the inference will be more confident when there are large number of bases with depth 2 or higher.&lt;br /&gt;
&lt;br /&gt;
== Command Line Options ==&lt;br /&gt;
&lt;br /&gt;
 The following parameters are available.  Ones with &amp;quot;[]&amp;quot; are in effect:&lt;br /&gt;
 &lt;br /&gt;
 Available Options&lt;br /&gt;
                             Input Files : --vcf [], --bam [], --subset [],&lt;br /&gt;
                                           --smID []&lt;br /&gt;
                    VCF analysis options : --genoError [1.0e-03],&lt;br /&gt;
                                           --minAF [0.01],&lt;br /&gt;
                                           --minCallRate [0.50]&lt;br /&gt;
   Individuals to compare with chip data : --site, --self, --best&lt;br /&gt;
          Chip-free optimization options : --free-none, --free-mix [ON],&lt;br /&gt;
                                           --free-refBias, --free-full&lt;br /&gt;
          With-chip optimization options : --chip-none, --chip-mix [ON],&lt;br /&gt;
                                           --chip-refBias, --chip-full&lt;br /&gt;
                    BAM analysis options : --ignoreRG, --ignoreOverlapPair,&lt;br /&gt;
                                           --noEOF, --precise, --minMapQ [10],&lt;br /&gt;
                                           --maxDepth [20], --minQ [13],&lt;br /&gt;
                                           --maxQ [40], --grid [0.05]&lt;br /&gt;
                 Modeling Reference Bias : --refRef [1.00], --refHet [0.50],&lt;br /&gt;
                                           --refAlt [0.00]&lt;br /&gt;
                          Output options : --out [], --verbose&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each option provides the following features:&lt;br /&gt;
* --vcf : specify required VCF file&lt;br /&gt;
* --bam : specify required BAM file (indexed with .bam.bai or .bai file)&lt;br /&gt;
* --subset : list of individual IDs to calculate the allele frequency. All individuals are used if unspecified&lt;br /&gt;
* --smID : If the individual ID in the BAM file and VCF file does not match, substitute the BAM file&#039;s ID into the specified argument&lt;br /&gt;
* --genoError : error rate of the external genotype file&lt;br /&gt;
* --minAF : minimum allele frequency of the markers to include&lt;br /&gt;
* --minAF : minimum call rate of the markers to include&lt;br /&gt;
* --site : If set, use only site information in the VCF and do not compare with the actual genotypes&lt;br /&gt;
* --self : Only compare the ID-matching individuals between the VCF and BAM file&lt;br /&gt;
* --best : Find the best matching individuals (.bestSM and .bestRG files will be produced). This option is substantially longer than the default option&lt;br /&gt;
* --free-none : Do not perform sequence-only method to estimate parameters&lt;br /&gt;
* --free-mix : (default) Estimate contamination using sequence-only method with Brent&#039;s single dimensional optimization.&lt;br /&gt;
* --free-refBias : Estimate the refernece bias parameters using sequence-only method with Simplex method&lt;br /&gt;
* --free-full : Estimate both reference bias parameters and the contamination parameters using sequence-only method&lt;br /&gt;
* --chip-none : Do not perform sequence+array method to estimate parameters&lt;br /&gt;
* --free-mix : (default) Estimate contamination using sequence+array method with Brent&#039;s single dimensional optimization.&lt;br /&gt;
* --free-refBias : Estimate the refernece bias parameters using sequence+array method with Simplex method&lt;br /&gt;
* --free-full : Estimate both reference bias parameters and the contamination parameters using sequence+array method&lt;br /&gt;
* --ignoreRG : ignore the read grouup level comparison and compare samples only (recommended for an expedited run)&lt;br /&gt;
* --ignoreOverlapPair : ignore overlapping pair end fragment covering the same base. Disabling this option may decrease the sensitivity of the method when the insert size is short (with slight gain in the computational speed)&lt;br /&gt;
* --noEOF : do not check the EOF marker of the BAM file (for earlier version of BAM)&lt;br /&gt;
* --precise : calculate the likelihood in log-scale for high-depth data (recommended when --maxDepth is greater than 20. Can be a little bit slower)&lt;br /&gt;
* --minMapQ : minimum mapping quality of the sequence reads to compare&lt;br /&gt;
* --minQ : minimum base quality to include&lt;br /&gt;
* --maxQ : maximum base quality to cap&lt;br /&gt;
* --grid : the grid interval to search the optimum before running Brent&#039;s algorithm.&lt;br /&gt;
* --refRef : Initial Pr(refBase|HOMREFGeno) parameter&lt;br /&gt;
* --refHet : Initial Pr(refBase|HETGeno) parameter&lt;br /&gt;
* --refAlt : Initial Pr(refBase|HOMALTGeno) parameter&lt;br /&gt;
* --out : output file prefix (required)&lt;br /&gt;
* --verbose : print the progress of the method on the screeen&lt;br /&gt;
&lt;br /&gt;
== Principle of Operation ==&lt;br /&gt;
&lt;br /&gt;
Each read group in a BAM file is evaluated independently. This means that in file with multiple read groups, problems will be flagged at the read group level (a plus). However, it also means that it might be hard to discern the correct assignment of read groups with very little data.&lt;br /&gt;
&lt;br /&gt;
For each aligned base that overlaps a known genotype, we calculate the probability the probability that it was derived from a particular known genotype. This comparison considers only bases that overlap previously known genotypes and that meet the base quality and mapping quality thresholds.&lt;br /&gt;
&lt;br /&gt;
Each individual in a pedigree has a different combination of genotypes, and bamGenotypeCheck will systematically search for the individual whose genotypes best match the observed read data.&lt;br /&gt;
&lt;br /&gt;
For more about the technical details, see the page [[Verifying Sample Identities - Implementation]]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
&lt;br /&gt;
Please cite the following paper:&lt;br /&gt;
&lt;br /&gt;
G. Jun, M. Flickinger, K. N. Hetrick, Kurt, J. M. Romm, K. F. Doheny, G. Abecasis, M. Boehnke,and H. M. Kang, &#039;&#039;Detecting and Estimating Contamination of Human DNA Samples in Sequencing and Array-Based Genotype Data&#039;&#039;, American journal of human genetics doi:10.1016/j.ajhg.2012.09.004 (volume 91 issue 5 pp.839 - 848) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Acknowledgements ==&lt;br /&gt;
&lt;br /&gt;
VerifyBamID is a result from collaborative effort by Hyun Min Kang, Goo Jun, Matthew Flickinger, Mary Kate Trost, and Goncalo Abecasis. Please email to Hyun Min Kang [[mailto:hmkang@umich.edu| hmkang@umich.edu ]] for any questions.&lt;/div&gt;</summary>
		<author><name>Gjun</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=File:VerifyIDintensity.tgz&amp;diff=5921</id>
		<title>File:VerifyIDintensity.tgz</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=File:VerifyIDintensity.tgz&amp;diff=5921"/>
		<updated>2012-11-21T16:16:45Z</updated>

		<summary type="html">&lt;p&gt;Gjun: uploaded a new version of &amp;quot;File:VerifyIDintensity.tgz&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gjun</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=VerifyIDintensity&amp;diff=5756</id>
		<title>VerifyIDintensity</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=VerifyIDintensity&amp;diff=5756"/>
		<updated>2012-11-12T18:36:22Z</updated>

		<summary type="html">&lt;p&gt;Gjun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Software|VerifyIDintensity]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;verifyIDintensity&#039;&#039;&#039; is a software that detects and estimates sample contamination using intensity data from Illumina genotyping arrays using a mixture model. &lt;br /&gt;
&lt;br /&gt;
== Download verifyIDintensity ==&lt;br /&gt;
&lt;br /&gt;
* [[File:VerifyIDintensity.tgz]]&lt;br /&gt;
&lt;br /&gt;
== Build verifyID intensity ==&lt;br /&gt;
&lt;br /&gt;
To build verifyIDintensity, run the following series of commands. You need [http://www.boost.org/ boost library] and [http://tclap.sourceforge.net/ tclap].&lt;br /&gt;
&lt;br /&gt;
   $ tar xzvf verifyIDintensity.tgz &lt;br /&gt;
   $ make&lt;br /&gt;
&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
&lt;br /&gt;
verifyIDintensity  [-t &amp;lt;float&amp;gt;] [-m &amp;lt;int&amp;gt;] -n &amp;lt;int&amp;gt; [-b &amp;lt;string&amp;gt;] [-s &amp;lt;string&amp;gt;] -i &amp;lt;string&amp;gt; [-v] [-p] [--] [--version] [-h]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Options ==&lt;br /&gt;
&lt;br /&gt;
   -t &amp;lt;float&amp;gt;,  --threshold &amp;lt;float&amp;gt;&lt;br /&gt;
     Minimum allele frequency for likelihood estimation, default is 0.01&lt;br /&gt;
&lt;br /&gt;
   -m &amp;lt;int&amp;gt;,  --marker &amp;lt;int&amp;gt;&lt;br /&gt;
     (required) Number of markers&lt;br /&gt;
&lt;br /&gt;
   -n &amp;lt;int&amp;gt;,  --number &amp;lt;int&amp;gt;&lt;br /&gt;
     (required) Number of samples&lt;br /&gt;
&lt;br /&gt;
   -b &amp;lt;string&amp;gt;,  --abf &amp;lt;string&amp;gt;&lt;br /&gt;
     Allele frequency file (ABF), which is a plain text file with SNP_ID and Allele_B frequency. &lt;br /&gt;
     SNP_IDs should be sorted in the same order as the intensity file&lt;br /&gt;
&lt;br /&gt;
   -s &amp;lt;string&amp;gt;,  --stat &amp;lt;string&amp;gt;&lt;br /&gt;
     Statistics file (created if not exist)&lt;br /&gt;
&lt;br /&gt;
   -i &amp;lt;string&amp;gt;,  --in &amp;lt;string&amp;gt;&lt;br /&gt;
     (required)  Input pre-computed intensity (.adpc.bin) file&lt;br /&gt;
&lt;br /&gt;
   -v,  --verbose&lt;br /&gt;
     Turn on verbose mode&lt;br /&gt;
&lt;br /&gt;
   -p,  --persample&lt;br /&gt;
     Do per-sample analysis, default is per-marker analysis&lt;br /&gt;
&lt;br /&gt;
   --,  --ignore_rest&lt;br /&gt;
     Ignores the rest of the labeled arguments following this flag.&lt;br /&gt;
&lt;br /&gt;
   --version&lt;br /&gt;
     Displays version information and exits.&lt;br /&gt;
&lt;br /&gt;
   -h,  --help&lt;br /&gt;
     Displays usage information and exits.&lt;/div&gt;</summary>
		<author><name>Gjun</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Polymutt&amp;diff=5404</id>
		<title>Polymutt</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Polymutt&amp;diff=5404"/>
		<updated>2012-10-05T16:21:31Z</updated>

		<summary type="html">&lt;p&gt;Gjun: /* Creation of GLF files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Updates ==&lt;br /&gt;
The latest version of 0.04 is available for [[#Download | Download]].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
* The program &#039;&#039;&#039;polymutt&#039;&#039;&#039; implemented a likelihood-based framework  for calling &#039;&#039;&#039;single nucleotide variants&#039;&#039;&#039; and detecting &#039;&#039;&#039;&#039;&#039;de novo&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;point mutation&#039;&#039;&#039; events in families for next-generation sequencing data. The program takes as input genotype likelihood format (GLF) files which can be generated following the  [[#Creation of GLF files | Creation of GLF files]] instruction and outputs the result in the [[http://www.1000genomes.org/node/101 VCF]] format. The variant calling and &#039;&#039;de novo&#039;&#039; mutation detection are modelled jointly within families and can handle both nuclear and extended pedigrees without consanguinity loops. The input is a set of GLF files for each of family members and the relationships are specified through the .ped file.&lt;br /&gt;
&lt;br /&gt;
* The evidence of variants and &#039;&#039;de novo&#039;&#039; mutations are assessed probabilistically. For a variant, the QUAL value is calculated as -10*log10(1-posterior(Variant | Data)) and for &#039;&#039;de novo&#039;&#039; mutation events a &#039;&#039;de novo&#039;&#039; quality (DQ) value is defined as log10(lk_denovo / lk_no_denovo) where lk_denovo and lk_no_denovo are the likelihoods of data allowing and disallowing &#039;&#039;de novo&#039;&#039; mutations respectively. Similarly, for each genotype, a genotype quality (GQ) value is defined as -10*log10(1-posterior(Genotype | Data)).&lt;br /&gt;
&lt;br /&gt;
* Since unrelated individuals are kind of special case of families, unrelated individuals or a mixture of related and unrelated individuals can be handled. &lt;br /&gt;
&lt;br /&gt;
* If some individuals in a family are not sequenced, this can be handled by setting the corresponding GLF file indices to zero for those family members who are not sequenced.&lt;br /&gt;
&lt;br /&gt;
* NOTE: This version only works for autosomes. Variant calling for X, Y and MT is in the testing process and will be available in next version.&lt;br /&gt;
&lt;br /&gt;
* See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
A command without any input will display the basic usage&lt;br /&gt;
&lt;br /&gt;
 polymutt&lt;br /&gt;
&lt;br /&gt;
 The following parameters are in effect:&lt;br /&gt;
                       pedfile :                 (-pname)&lt;br /&gt;
                       datfile :                 (-dname)&lt;br /&gt;
                  glfIndexFile :                 (-gname)&lt;br /&gt;
              posterior cutoff :           0.500 (-c99.999)&lt;br /&gt;
&lt;br /&gt;
 Additional Options&lt;br /&gt;
       Map Quality Filter : --minMapQuality&lt;br /&gt;
             Depth Filter : --minDepth, --maxDepth,&lt;br /&gt;
                            --minPercSampleWithData [0.00]&lt;br /&gt;
     Scaled mutation rate : --theta [1.0e-03]&lt;br /&gt;
     Prior of ts/tv ratio : --poly_tstv [2.00]&lt;br /&gt;
         de novo mutation : --denovo, --rate_denovo [1.5e-08],&lt;br /&gt;
                            --tstv_denovo [2.00], --minLLR_denovo [1.00]&lt;br /&gt;
   Optimization precision : --prec [1.0e-04]&lt;br /&gt;
       Multiple threading : --nthreads [1]&lt;br /&gt;
   Chromosomes to process : --chr2process []&lt;br /&gt;
                   Output : --vcf [variantCalls.vcf], --gl_off&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example command for variant calling looks like the following:&lt;br /&gt;
 polymutt -p in.ped -d in.dat -g glfIndexFile --vcf out.vcf --nthreads 4&lt;br /&gt;
&lt;br /&gt;
An example command for &#039;&#039;de novo&#039;&#039; mutation detection is as follows:&lt;br /&gt;
 polymutt -p in.ped -d in.dat -g glfIndexFile --denovo --rate_denovo 1.5e-08 --min_denovo_LLR 1.0 --vcf out.denovo.vcf --nthreads 4&lt;br /&gt;
&lt;br /&gt;
== Input files ==&lt;br /&gt;
&lt;br /&gt;
Required input files are -p input.ped -d input.dat -g glfIndex files&lt;br /&gt;
&lt;br /&gt;
* An example in.ped file looks like the following:&lt;br /&gt;
 fam1 p1  0  0   1  1&lt;br /&gt;
 fam1 p2  0  0   2  2&lt;br /&gt;
 fam1 p3  p1 p2  1  3&lt;br /&gt;
 fam2 p4  0  0   1  4&lt;br /&gt;
 fam2 p5  0  0   2  5&lt;br /&gt;
 fam2 p6  p4 p5  1  6&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
* An example in.dat file is like the following (for the 6th column above and in addition other traits/markers can be specified but will be ignored):&lt;br /&gt;
 T GLF_Index&lt;br /&gt;
&lt;br /&gt;
* An example glfIndex file is like the following and the numbers (except zeros) in the 6th column in the above in.ped file have to be present in the first column.&lt;br /&gt;
 1  /home/me/sample1.glf&lt;br /&gt;
 2  /home/me/sample2.glf&lt;br /&gt;
 3  /home/me/sample3.glf&lt;br /&gt;
 4  /home/me/sample4.glf&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
* If some of the members are not sequenced but are in the pedigree because of the relatedness with other members, the GLF_Index column (6th column) in the ped file should be set to zero&lt;br /&gt;
* For unrelated individuals, you can either (1) create a family for each unrelated individual as a founder or (2) put all unrelated individuals as founders in a single family.&lt;br /&gt;
&lt;br /&gt;
== Other options ==&lt;br /&gt;
&lt;br /&gt;
Some of command line options are explained below and others are self-explanatory.&lt;br /&gt;
 &lt;br /&gt;
 -c : minimum cutoff of posterior probability to output a variant [&#039;&#039;Default: 0.5&#039;&#039;]&lt;br /&gt;
 --theta : scaled mutation rate per site [&#039;&#039;Default: 0.001&#039;&#039;]&lt;br /&gt;
 --tstv: prior of ts:tv ratio [&#039;&#039;Default: 2.0&#039;&#039;]&lt;br /&gt;
 --nthreads : number of threads to run and it is recommended to use 4 threads for small number of input files [&#039;&#039;Default: 1&#039;]&lt;br /&gt;
&lt;br /&gt;
 --denovo : a boolean flag to turn on &#039;&#039;de novo&#039;&#039; mutation detection. The following options take effect only when this flag is ON&lt;br /&gt;
 --rate_denovo : mutation rate per haplotype per generation. [&#039;&#039;Default: 1.5e-08&#039;&#039;]&lt;br /&gt;
 --tstv_denovo : the prior ts/tv ratio of &#039;&#039;de novo&#039;&#039; mutations. [&#039;&#039;Default: 2.0&#039;&#039;]&lt;br /&gt;
 --minLLR_denovo : minimum value of log10 likelihood ratio of allowing vs. disallowing &#039;&#039;de novo&#039;&#039; mutations in the data to output [&#039;&#039;Default: 1.0&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
 --chr2process: the chromosome names to process. Default is empty and is to process all chromosomes in the input.&lt;br /&gt;
                If multiple chromosomes are provided, they should be separated by comma, e.g. --chr2process 2,10 or --chr2process chr2,chr10&lt;br /&gt;
&lt;br /&gt;
 --gl_off: not to output genotype likelihood values for each individual. Default is to output 3 GLs for polymorphisms and 10 GLs for de novo mutations&lt;br /&gt;
&lt;br /&gt;
== Output files ==&lt;br /&gt;
* The output file is a VCF file and the specification can be found [[http://www.1000genomes.org/node/101 here]]&lt;br /&gt;
* Since there is no standard to represent &#039;&#039;de novo&#039;&#039; mutations in the current VCF specification, actual genotypes (e.g. [ACGT]/[ACGT]) are output in the VCF file for &#039;&#039;de novo&#039;&#039; mutations.&lt;br /&gt;
* A summary about variant calling statistics is output to STDOUT and it may be redirected to a file for a record.&lt;br /&gt;
&lt;br /&gt;
 Summary of reference -- 9&lt;br /&gt;
 Total Entry Count: 141213431 &lt;br /&gt;
 Total Base Cout: 120124735&lt;br /&gt;
 Total &#039;0&#039; Base Count:       137&lt;br /&gt;
 Non-Polymorphic Count:   655457&lt;br /&gt;
 Transition Count:      6556&lt;br /&gt;
 Transversion Count:      3127&lt;br /&gt;
 Other Polymorphism Count:         0&lt;br /&gt;
 Filter counts:&lt;br /&gt;
        minMapQual 4550&lt;br /&gt;
        minTotalDepth 1089&lt;br /&gt;
        maxTotalDepth 736&lt;br /&gt;
 Hard to call:         0&lt;br /&gt;
 Skipped bases: 134&lt;br /&gt;
&lt;br /&gt;
== Creation of GLF files ==&lt;br /&gt;
&lt;br /&gt;
* The current version performs variant calling and &#039;&#039;de novo&#039;&#039; mutation detection from files in the genotype likelihood format (GLF). In future versions we plan to take [[http://samtools.sourceforge.net/ SAM/BAM]] files as input. See the following for instructions on how to create GLF files.&lt;br /&gt;
** Download a [[Samtools-hybrid|modified version of samtools]] ( [[https://github.com/statgen/samtools-0.1.7a-hybrid samtools-hybrid]] )&lt;br /&gt;
** Prepare the reference genome in fasta format and sequence alignments in [[http://samtools.sourceforge.net/ SAM/BAM]] format&lt;br /&gt;
** Generate BAQ adjusted GLF files using the following command&lt;br /&gt;
 samtools-hybrid view -bh chr1.bam 1:0 | samtools-hybrid calmd -Abr - human.v37.fa 2&amp;gt; /dev/null | samtools-hybrid pileup - -g -f human.v37.fa &amp;gt; chr1.bam.glf&lt;br /&gt;
** If you want to clip overlapping reads, you can add clipOverlap command&lt;br /&gt;
 samtools-hybrid view -bh chr1.bam 1:0 |samtools-hybrid calmd -Abr - human.v37.fa 2&amp;gt; /dev/null | bam clipOverlap --in -.bam --out -.ubam| samtools-hybrid pileup - -g -f human.v37.fa &amp;gt; chr1.bam.glf&lt;br /&gt;
* For other functionalities please refer to the  [[http://samtools.sourceforge.net/ samtools]] website.&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
The latest version of source code v0.04 with test files can be [[Media:polymutt.0.04.tar.gz | downloaded]] here.&lt;br /&gt;
&lt;br /&gt;
== Contact ==&lt;br /&gt;
For questions please contact the authors (Bingshan Li:  [mailto:bingshan@umich.edu bingshan@umich.edu] or Goncalo Abecasis: [mailto:goncalo@umich.edu goncalo@umich.edu])&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Gjun</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Polymutt&amp;diff=5403</id>
		<title>Polymutt</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Polymutt&amp;diff=5403"/>
		<updated>2012-10-05T16:20:15Z</updated>

		<summary type="html">&lt;p&gt;Gjun: /* Creation of GLF files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Updates ==&lt;br /&gt;
The latest version of 0.04 is available for [[#Download | Download]].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
* The program &#039;&#039;&#039;polymutt&#039;&#039;&#039; implemented a likelihood-based framework  for calling &#039;&#039;&#039;single nucleotide variants&#039;&#039;&#039; and detecting &#039;&#039;&#039;&#039;&#039;de novo&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;point mutation&#039;&#039;&#039; events in families for next-generation sequencing data. The program takes as input genotype likelihood format (GLF) files which can be generated following the  [[#Creation of GLF files | Creation of GLF files]] instruction and outputs the result in the [[http://www.1000genomes.org/node/101 VCF]] format. The variant calling and &#039;&#039;de novo&#039;&#039; mutation detection are modelled jointly within families and can handle both nuclear and extended pedigrees without consanguinity loops. The input is a set of GLF files for each of family members and the relationships are specified through the .ped file.&lt;br /&gt;
&lt;br /&gt;
* The evidence of variants and &#039;&#039;de novo&#039;&#039; mutations are assessed probabilistically. For a variant, the QUAL value is calculated as -10*log10(1-posterior(Variant | Data)) and for &#039;&#039;de novo&#039;&#039; mutation events a &#039;&#039;de novo&#039;&#039; quality (DQ) value is defined as log10(lk_denovo / lk_no_denovo) where lk_denovo and lk_no_denovo are the likelihoods of data allowing and disallowing &#039;&#039;de novo&#039;&#039; mutations respectively. Similarly, for each genotype, a genotype quality (GQ) value is defined as -10*log10(1-posterior(Genotype | Data)).&lt;br /&gt;
&lt;br /&gt;
* Since unrelated individuals are kind of special case of families, unrelated individuals or a mixture of related and unrelated individuals can be handled. &lt;br /&gt;
&lt;br /&gt;
* If some individuals in a family are not sequenced, this can be handled by setting the corresponding GLF file indices to zero for those family members who are not sequenced.&lt;br /&gt;
&lt;br /&gt;
* NOTE: This version only works for autosomes. Variant calling for X, Y and MT is in the testing process and will be available in next version.&lt;br /&gt;
&lt;br /&gt;
* See below for more details.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
A command without any input will display the basic usage&lt;br /&gt;
&lt;br /&gt;
 polymutt&lt;br /&gt;
&lt;br /&gt;
 The following parameters are in effect:&lt;br /&gt;
                       pedfile :                 (-pname)&lt;br /&gt;
                       datfile :                 (-dname)&lt;br /&gt;
                  glfIndexFile :                 (-gname)&lt;br /&gt;
              posterior cutoff :           0.500 (-c99.999)&lt;br /&gt;
&lt;br /&gt;
 Additional Options&lt;br /&gt;
       Map Quality Filter : --minMapQuality&lt;br /&gt;
             Depth Filter : --minDepth, --maxDepth,&lt;br /&gt;
                            --minPercSampleWithData [0.00]&lt;br /&gt;
     Scaled mutation rate : --theta [1.0e-03]&lt;br /&gt;
     Prior of ts/tv ratio : --poly_tstv [2.00]&lt;br /&gt;
         de novo mutation : --denovo, --rate_denovo [1.5e-08],&lt;br /&gt;
                            --tstv_denovo [2.00], --minLLR_denovo [1.00]&lt;br /&gt;
   Optimization precision : --prec [1.0e-04]&lt;br /&gt;
       Multiple threading : --nthreads [1]&lt;br /&gt;
   Chromosomes to process : --chr2process []&lt;br /&gt;
                   Output : --vcf [variantCalls.vcf], --gl_off&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example command for variant calling looks like the following:&lt;br /&gt;
 polymutt -p in.ped -d in.dat -g glfIndexFile --vcf out.vcf --nthreads 4&lt;br /&gt;
&lt;br /&gt;
An example command for &#039;&#039;de novo&#039;&#039; mutation detection is as follows:&lt;br /&gt;
 polymutt -p in.ped -d in.dat -g glfIndexFile --denovo --rate_denovo 1.5e-08 --min_denovo_LLR 1.0 --vcf out.denovo.vcf --nthreads 4&lt;br /&gt;
&lt;br /&gt;
== Input files ==&lt;br /&gt;
&lt;br /&gt;
Required input files are -p input.ped -d input.dat -g glfIndex files&lt;br /&gt;
&lt;br /&gt;
* An example in.ped file looks like the following:&lt;br /&gt;
 fam1 p1  0  0   1  1&lt;br /&gt;
 fam1 p2  0  0   2  2&lt;br /&gt;
 fam1 p3  p1 p2  1  3&lt;br /&gt;
 fam2 p4  0  0   1  4&lt;br /&gt;
 fam2 p5  0  0   2  5&lt;br /&gt;
 fam2 p6  p4 p5  1  6&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
* An example in.dat file is like the following (for the 6th column above and in addition other traits/markers can be specified but will be ignored):&lt;br /&gt;
 T GLF_Index&lt;br /&gt;
&lt;br /&gt;
* An example glfIndex file is like the following and the numbers (except zeros) in the 6th column in the above in.ped file have to be present in the first column.&lt;br /&gt;
 1  /home/me/sample1.glf&lt;br /&gt;
 2  /home/me/sample2.glf&lt;br /&gt;
 3  /home/me/sample3.glf&lt;br /&gt;
 4  /home/me/sample4.glf&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
* If some of the members are not sequenced but are in the pedigree because of the relatedness with other members, the GLF_Index column (6th column) in the ped file should be set to zero&lt;br /&gt;
* For unrelated individuals, you can either (1) create a family for each unrelated individual as a founder or (2) put all unrelated individuals as founders in a single family.&lt;br /&gt;
&lt;br /&gt;
== Other options ==&lt;br /&gt;
&lt;br /&gt;
Some of command line options are explained below and others are self-explanatory.&lt;br /&gt;
 &lt;br /&gt;
 -c : minimum cutoff of posterior probability to output a variant [&#039;&#039;Default: 0.5&#039;&#039;]&lt;br /&gt;
 --theta : scaled mutation rate per site [&#039;&#039;Default: 0.001&#039;&#039;]&lt;br /&gt;
 --tstv: prior of ts:tv ratio [&#039;&#039;Default: 2.0&#039;&#039;]&lt;br /&gt;
 --nthreads : number of threads to run and it is recommended to use 4 threads for small number of input files [&#039;&#039;Default: 1&#039;]&lt;br /&gt;
&lt;br /&gt;
 --denovo : a boolean flag to turn on &#039;&#039;de novo&#039;&#039; mutation detection. The following options take effect only when this flag is ON&lt;br /&gt;
 --rate_denovo : mutation rate per haplotype per generation. [&#039;&#039;Default: 1.5e-08&#039;&#039;]&lt;br /&gt;
 --tstv_denovo : the prior ts/tv ratio of &#039;&#039;de novo&#039;&#039; mutations. [&#039;&#039;Default: 2.0&#039;&#039;]&lt;br /&gt;
 --minLLR_denovo : minimum value of log10 likelihood ratio of allowing vs. disallowing &#039;&#039;de novo&#039;&#039; mutations in the data to output [&#039;&#039;Default: 1.0&#039;&#039;]&lt;br /&gt;
&lt;br /&gt;
 --chr2process: the chromosome names to process. Default is empty and is to process all chromosomes in the input.&lt;br /&gt;
                If multiple chromosomes are provided, they should be separated by comma, e.g. --chr2process 2,10 or --chr2process chr2,chr10&lt;br /&gt;
&lt;br /&gt;
 --gl_off: not to output genotype likelihood values for each individual. Default is to output 3 GLs for polymorphisms and 10 GLs for de novo mutations&lt;br /&gt;
&lt;br /&gt;
== Output files ==&lt;br /&gt;
* The output file is a VCF file and the specification can be found [[http://www.1000genomes.org/node/101 here]]&lt;br /&gt;
* Since there is no standard to represent &#039;&#039;de novo&#039;&#039; mutations in the current VCF specification, actual genotypes (e.g. [ACGT]/[ACGT]) are output in the VCF file for &#039;&#039;de novo&#039;&#039; mutations.&lt;br /&gt;
* A summary about variant calling statistics is output to STDOUT and it may be redirected to a file for a record.&lt;br /&gt;
&lt;br /&gt;
 Summary of reference -- 9&lt;br /&gt;
 Total Entry Count: 141213431 &lt;br /&gt;
 Total Base Cout: 120124735&lt;br /&gt;
 Total &#039;0&#039; Base Count:       137&lt;br /&gt;
 Non-Polymorphic Count:   655457&lt;br /&gt;
 Transition Count:      6556&lt;br /&gt;
 Transversion Count:      3127&lt;br /&gt;
 Other Polymorphism Count:         0&lt;br /&gt;
 Filter counts:&lt;br /&gt;
        minMapQual 4550&lt;br /&gt;
        minTotalDepth 1089&lt;br /&gt;
        maxTotalDepth 736&lt;br /&gt;
 Hard to call:         0&lt;br /&gt;
 Skipped bases: 134&lt;br /&gt;
&lt;br /&gt;
== Creation of GLF files ==&lt;br /&gt;
&lt;br /&gt;
* The current version performs variant calling and &#039;&#039;de novo&#039;&#039; mutation detection from files in the genotype likelihood format (GLF). In future versions we plan to take [[http://samtools.sourceforge.net/ SAM/BAM]] files as input. See the following for instructions on how to create GLF files.&lt;br /&gt;
** Download a [[Samtools-hybrid|modified version of samtools]] ( [[https://github.com/statgen/samtools-0.1.7a-hybrid samtools-hybrid]] )&lt;br /&gt;
** Prepare the reference genome in fasta format and sequence alignments in [[http://samtools.sourceforge.net/ SAM/BAM]] format&lt;br /&gt;
** Generate BAQ adjusted GLF files using the following command&lt;br /&gt;
 samtools-hybrid view -bh chr1.bam 1:0 | samtools-hybrid calmd -Abr - human.v37.fa 2&amp;gt; /dev/null | samtools-hybrid pileup - -g -f human.v37.fa &amp;gt; chr1.bam.glf&lt;br /&gt;
** If you want to clip overlapping reads, you can add clipOverlap command&lt;br /&gt;
 samtools-hybrid view -bh chr1.bam 1:0 |bam clipOverlap --in -.bam --out -.ubam| samtools-hybrid calmd -Abr - human.v37.fa 2&amp;gt; /dev/null | samtools-hybrid pileup - -g -f human.v37.fa &amp;gt; chr1.bam.glf&lt;br /&gt;
* For other functionalities please refer to the  [[http://samtools.sourceforge.net/ samtools]] website.&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
The latest version of source code v0.04 with test files can be [[Media:polymutt.0.04.tar.gz | downloaded]] here.&lt;br /&gt;
&lt;br /&gt;
== Contact ==&lt;br /&gt;
For questions please contact the authors (Bingshan Li:  [mailto:bingshan@umich.edu bingshan@umich.edu] or Goncalo Abecasis: [mailto:goncalo@umich.edu goncalo@umich.edu])&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Gjun</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=ContaminationDetection&amp;diff=4824</id>
		<title>ContaminationDetection</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=ContaminationDetection&amp;diff=4824"/>
		<updated>2012-04-24T21:19:06Z</updated>

		<summary type="html">&lt;p&gt;Gjun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
DNA sample contamination (or sample swap) is quite common in sequencing studies. It is possible to detect DNA contamination from sequence reads of intensity data from SNP genotyping arrays by modeling the likelihood of sequence reads as a mixture of two samples and estimating the fraction of reads contributed by contaminating samples. &lt;br /&gt;
&lt;br /&gt;
Depending on the types of available data, one can detect DNA sample contamination in the following ways.&lt;br /&gt;
&lt;br /&gt;
# When a sequenced sample has also external array-based genotypes available&lt;br /&gt;
#* [[VerifyBamID]] software can estimate the levels of sample contamination and detect sample swap from alignment sequence reads and the external genotypes&lt;br /&gt;
#* The basic mathematical concept is described in [[Verifying_Sample_Identities_-_Implementation]]&lt;br /&gt;
# When a sequenced sample does not have external genotypes available&lt;br /&gt;
#* [[VerifyBamID]] software can still estimate sample contamination from aligned sequence reads and population minor allele frequency&lt;br /&gt;
#* The key idea of the method is to capture the excessive heterozygosity in the contaminated sample by modeling the sequence reads as mixture of independent samples. &lt;br /&gt;
# When a sample has array-based genotypes but not yet sequenced&lt;br /&gt;
#* [[VerifyIDintensity]] software can estimate the levels of DNA sample contamination from pre-computed intensity data using likelihood-based model.&lt;br /&gt;
#** The key idea is similar to that of [[VerifyBamID]] with sequence data alone&lt;br /&gt;
#** [[VerifyIDintensity]] models array intensity data instead of sequence reads&lt;br /&gt;
#** When a large number of samples are genotyped together, the &#039;multi-sample&#039; option will estimate the intensity distribution for each marker across multiple samples. When only one a few samples are genotyped, &#039;per-sample&#039; option will estimate the intensity distribution for each sample across all markers.&lt;br /&gt;
#* [[BAFRegress]] software can estimate levels of sample contamination and test the presence of contamination by regressing the allele frequency with respect to the B allele frequency (BAF).&lt;br /&gt;
#** This method is sensitive to estimate low levels of contamination.&lt;br /&gt;
#** The method provides a well calibrated Type I error to test the null hypothesis of no contamination from a DNA sample.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
* Initial description of method 1 can be found at [[Verifying_Sample_Identities_-_Implementation]] (last modified in April 29, 2010)&lt;/div&gt;</summary>
		<author><name>Gjun</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=VerifyIDintensity&amp;diff=4823</id>
		<title>VerifyIDintensity</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=VerifyIDintensity&amp;diff=4823"/>
		<updated>2012-04-24T21:16:20Z</updated>

		<summary type="html">&lt;p&gt;Gjun: Created page with &amp;#039;VerifyIDintensity  &amp;#039;&amp;#039;&amp;#039;verifyIDintensity&amp;#039;&amp;#039;&amp;#039; is a software that detects and estimates sample contamination using intensity data from Illumina genotyping array…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Software|VerifyIDintensity]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;verifyIDintensity&#039;&#039;&#039; is a software that detects and estimates sample contamination using intensity data from Illumina genotyping arrays using a mixture model. &lt;br /&gt;
&lt;br /&gt;
== Download verifyIDintensity ==&lt;br /&gt;
&lt;br /&gt;
* [[File:VerifyIDintensity.tgz]]&lt;br /&gt;
&lt;br /&gt;
== Build verifyID intensity ==&lt;br /&gt;
&lt;br /&gt;
To build verifyIDintensity, run the following series of commands. You need [http://www.boost.org/ boost library] and [http://tclap.sourceforge.net/ tclap].&lt;br /&gt;
tar xzvf verifyIDintensity.tgz&lt;br /&gt;
make&lt;br /&gt;
&lt;br /&gt;
== Basic Usage ==&lt;br /&gt;
&lt;br /&gt;
verifyIDintensity  [-t &amp;lt;float&amp;gt;] [-m &amp;lt;int&amp;gt;] -n &amp;lt;int&amp;gt; [-b &amp;lt;string&amp;gt;] [-s &amp;lt;string&amp;gt;] -i &amp;lt;string&amp;gt; [-v] [-p] [--] [--version] [-h]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Options ==&lt;br /&gt;
&lt;br /&gt;
   -t &amp;lt;float&amp;gt;,  --threshold &amp;lt;float&amp;gt;&lt;br /&gt;
     Minimum allele frequency for likelihood estimation, default is 0.01&lt;br /&gt;
&lt;br /&gt;
   -m &amp;lt;int&amp;gt;,  --marker &amp;lt;int&amp;gt;&lt;br /&gt;
     (required) Number of markers&lt;br /&gt;
&lt;br /&gt;
   -n &amp;lt;int&amp;gt;,  --number &amp;lt;int&amp;gt;&lt;br /&gt;
     (required) Number of samples&lt;br /&gt;
&lt;br /&gt;
   -b &amp;lt;string&amp;gt;,  --abf &amp;lt;string&amp;gt;&lt;br /&gt;
     Allele frequency file (ABF), which is a plain text file with SNP_ID and Allele_B frequency. &lt;br /&gt;
     SNP_IDs should be sorted in the same order as the intensity file&lt;br /&gt;
&lt;br /&gt;
   -s &amp;lt;string&amp;gt;,  --stat &amp;lt;string&amp;gt;&lt;br /&gt;
     Statistics file (created if not exist)&lt;br /&gt;
&lt;br /&gt;
   -i &amp;lt;string&amp;gt;,  --in &amp;lt;string&amp;gt;&lt;br /&gt;
     (required)  Input pre-computed intensity (.adpc.bin) file&lt;br /&gt;
&lt;br /&gt;
   -v,  --verbose&lt;br /&gt;
     Turn on verbose mode&lt;br /&gt;
&lt;br /&gt;
   -p,  --persample&lt;br /&gt;
     Do per-sample analysis, default is per-marker analysis&lt;br /&gt;
&lt;br /&gt;
   --,  --ignore_rest&lt;br /&gt;
     Ignores the rest of the labeled arguments following this flag.&lt;br /&gt;
&lt;br /&gt;
   --version&lt;br /&gt;
     Displays version information and exits.&lt;br /&gt;
&lt;br /&gt;
   -h,  --help&lt;br /&gt;
     Displays usage information and exits.&lt;/div&gt;</summary>
		<author><name>Gjun</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=File:VerifyIDintensity.tgz&amp;diff=4822</id>
		<title>File:VerifyIDintensity.tgz</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=File:VerifyIDintensity.tgz&amp;diff=4822"/>
		<updated>2012-04-24T21:12:43Z</updated>

		<summary type="html">&lt;p&gt;Gjun: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gjun</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=ContaminationDetection&amp;diff=4821</id>
		<title>ContaminationDetection</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=ContaminationDetection&amp;diff=4821"/>
		<updated>2012-04-24T20:48:21Z</updated>

		<summary type="html">&lt;p&gt;Gjun: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
DNA sample contamination (or sample swap) is quite common in sequencing studies. It is possible to detect DNA contamination from sequence reads of intensity data from SNP genotyping arrays by modeling the likelihood of sequence reads as a mixture of two samples and estimating the fraction of reads contributed by contaminating samples. &lt;br /&gt;
&lt;br /&gt;
Depending on the types of available data, one can detect DNA sample contamination in the following ways.&lt;br /&gt;
&lt;br /&gt;
# When a sequenced sample has also external array-based genotypes available&lt;br /&gt;
#* [[VerifyBamID]] software can estimate the levels of sample contamination and detect sample swap from alignment sequence reads and the external genotypes&lt;br /&gt;
#* The basic mathematical concept is described in [[Verifying_Sample_Identities_-_Implementation]]&lt;br /&gt;
# When a sequenced sample does not have external genotypes available&lt;br /&gt;
#* [[VerifyBamID]] software can still estimate sample contamination from aligned sequence reads and population minor allele frequency&lt;br /&gt;
#* The key idea of the method is to capture the excessive heterozygosity in the contaminated sample by modeling the sequence reads as mixture of independent samples. &lt;br /&gt;
# When a sample has array-based genotypes but not yet sequenced&lt;br /&gt;
#* [[VerifyIDintensity]] software can estimate the levels of DNA sample contamination from aligned sequence reads and population allele frequency&lt;br /&gt;
#** The key idea is similar to that of [[VerifyBamID]] with sequence data alone&lt;br /&gt;
#** [[VerifyIDintensity]] models array intensity data instead of sequence reads&lt;br /&gt;
#** When a large number of samples are genotyped together, the &#039;multi-sample&#039; option will estimate the intensity distribution for each marker across multiple samples. When only one a few samples are genotyped, &#039;per-sample&#039; option will estimate the intensity distribution for each sample across all markers.&lt;br /&gt;
#* [[BAFRegress]] software can estimate levels of sample contamination and test the presence of contamination by regressing the allele frequency with respect to the B allele frequency (BAF).&lt;br /&gt;
#** This method is sensitive to estimate low levels of contamination.&lt;br /&gt;
#** The method provides a well calibrated Type I error to test the null hypothesis of no contamination from a DNA sample.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
* Initial description of method 1 can be found at [[Verifying_Sample_Identities_-_Implementation]] (last modified in April 29, 2010)&lt;/div&gt;</summary>
		<author><name>Gjun</name></author>
	</entry>
</feed>