<?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=Hmkang</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=Hmkang"/>
	<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/wiki/Special:Contributions/Hmkang"/>
	<updated>2026-09-24T01:52:53Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=GotCloud&amp;diff=15176</id>
		<title>GotCloud</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=GotCloud&amp;diff=15176"/>
		<updated>2021-09-11T21:23:16Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Getting Help with GotCloud */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Genomes on the Cloud (GotCloud) Introduction==&lt;br /&gt;
&lt;br /&gt;
To handle the increasing volume of next generation sequencing and genotyping data, we created and developed software pipelines called &#039;&#039;&#039;Genomes on the Cloud (GotCloud).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
GotCloud contains Mapping &amp;amp; Variant Calling Pipelines.&lt;br /&gt;
&lt;br /&gt;
Key Features:&lt;br /&gt;
* Connects sequence analysis tools together in automated pipeline&lt;br /&gt;
** Alignment, quality control, variant calling&lt;br /&gt;
* Robust against unexpected system failure using GNU make&lt;br /&gt;
** easy restart after failure&lt;br /&gt;
* Massively parallel, can run hundreds of jobs&lt;br /&gt;
** Splits large jobs into many pieces&lt;br /&gt;
** Simplifies running on clusters&lt;br /&gt;
* Scalable to tens of thousands of samples&lt;br /&gt;
* Easy to use - Automates series of configurable steps&lt;br /&gt;
** user doesn&#039;t have to understand/configure/know the many tools required to create high quality results&lt;br /&gt;
* Available on Amazon Web Services (AWS) Elastic Compute Cloud (EC2)&lt;br /&gt;
* Run on local machines/clusters&lt;br /&gt;
&lt;br /&gt;
GotCloud incorporates the alignment and variant calling pipelines that we have been using at UM into one easy to use, publicly available tool.  GotCloud can run on a user&#039;s computer, on an instance in a &lt;br /&gt;
compute cloud, and/or can split the work up onto a cluster of machines or instances. &lt;br /&gt;
&lt;br /&gt;
[[File:Gotcloud.puzzles.v2.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Getting Help with GotCloud ===&lt;br /&gt;
&lt;br /&gt;
Please join in the [http://groups.google.com/group/GotCloud GotCloud Google Group] to ask / discuss / comment about these pipelines.&lt;br /&gt;
&lt;br /&gt;
Currently the &amp;quot;join&amp;quot; button appears to be missing.  Click &amp;quot;NEW TOPIC&amp;quot;, then select &amp;quot;Join this group&amp;quot;.  You can then cancel the message post (or post a message).&lt;br /&gt;
&lt;br /&gt;
See [[GotCloud: FAQs]] if you have any questions.  If your questions are not answered there, ask questions in the [https://github.com/statgen/gotcloud GotCloud GitHub repository]&lt;br /&gt;
&lt;br /&gt;
=== Sequence Analysis Background Information ===&lt;br /&gt;
&lt;br /&gt;
There are many essential steps in the analysis of next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
Next generation sequence data analysis starts with [http://en.wikipedia.org/wiki/FASTQ_format FASTQ files], the typical format provided from your sequencing center containing the sequence &amp;amp; base quality information for your data.&lt;br /&gt;
&lt;br /&gt;
The fastq files are processed using the [[GotCloud: Alignment Pipeline|alignment pipeline]] which finds the most likely genomic location for each read and stores that information in a [[BAM|BAM (Binary Sequence Alignment/Map format) file]].  In addition to the sequence and base quality information contained in FASTQ files, a BAM file also contains the genomic location and some additional information about the mapping.  As part of the [[GotCloud: Alignment Pipeline|alignment pipeline]], the base qualities are adjusted to more accurately reflect the likelihood that the base is correct. &lt;br /&gt;
&lt;br /&gt;
The [[GotCloud: Alignment Pipeline|alignment pipeline]] can be skipped if you already have Deduped and Recalibrated BAM files.  If you have BAMs, but they needed to be deduped and recalibrated, you can use our [[GotCloud:_Alignment_Sub-Pipelines#recabQC_2|recabQC pipeline]].&lt;br /&gt;
&lt;br /&gt;
The [[GotCloud: Variant Calling Pipeline|variant calling pipeline]] processes the deduped and recalibrated BAM files produced by the alignment pipeline or that you provide it, generating an initial list of polymorphic sites and genotypes stored in a [http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF (Variant Call Format) file].  The [[GotCloud: Variant Calling Pipeline|variant calling pipeline]] then filters the  variants using both hard filters and a [[SVM Filtering|Support Vector Machine (SVM)]].  It then uses haplotype information to refine these genotypes in an updated VCF file.&lt;br /&gt;
&lt;br /&gt;
After completing the GotCloud Variant Calling Pipeline, [[EPACTS|EPACTS (Efficient and Parallelizable Association Container Toolbox)]] can be used to perform statistical tests to identify genome-wide association from sequence data.&lt;br /&gt;
&lt;br /&gt;
[[File:GotCloudDiagram.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Publication ==&lt;br /&gt;
If you use GotCloud, please cite our publication: &lt;br /&gt;
[http://genome.cshlp.org/content/early/2015/04/14/gr.176552.114.abstract Jun, Goo, et al. &amp;quot;An efficient and scalable analysis framework for variant extraction and refinement from population scale DNA sequence data.&amp;quot; Genome research (2015): gr-176552.]&lt;br /&gt;
&lt;br /&gt;
== GotCloud Setup ==&lt;br /&gt;
&lt;br /&gt;
You may run the GotCloud software in several modes:&lt;br /&gt;
* On your own hardware running Ubuntu or Redhat/CentOS. See the instructions about installing the software below.&lt;br /&gt;
* On an Amazon Elastic Compute Cloud using Ubuntu or Redhat/CentOS if you do not have your own set of machines.&lt;br /&gt;
** See [[GotCloud: Amazon]] for more information.&lt;br /&gt;
** You can run on an EC2 cluster instance created by StarCluster. &lt;br /&gt;
&lt;br /&gt;
GotCloud has been developed and tested on Linux Ubuntu 12.10 and 12.04.2 LTS and Red Hat 6.6.  While it should work on other Linux systems, they have not yet been tested. &lt;br /&gt;
&lt;br /&gt;
=== GotCloud on Amazon ===&lt;br /&gt;
You can take advantage of GotCloud AMI&#039;s when running on Amazon.  The GotCloud already includes GotCloud and default reference files.&lt;br /&gt;
&lt;br /&gt;
See [[GotCloud: Amazon]] for instructions on using GotCloud on Amazon.&lt;br /&gt;
&lt;br /&gt;
=== GotCloud Setup on Any Linux Machine ===&lt;br /&gt;
&lt;br /&gt;
==== GotCloud Dependencies ====&lt;br /&gt;
&lt;br /&gt;
GotCloud requires certain things to be installed in order to run:&lt;br /&gt;
* perl - gotcloud is a perl script and it calls many other perl scripts&lt;br /&gt;
** Zlib.pm - required for perl scripts to read compressed files.&lt;br /&gt;
* make - GNU make is used to run the pipelines&lt;br /&gt;
* java - required to run the beagle step of the ld-aware genotype refinement&lt;br /&gt;
* curses/ncurses (required for samtools)&lt;br /&gt;
** On Ubuntu: &amp;lt;code&amp;gt;sudo apt-get install libncurses5 libncurses5-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
* cmake (required for premo)&lt;br /&gt;
** On Ubuntu: &amp;lt;code&amp;gt;sudo apt-get install cmake&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check if your system has the proper software installed by invoking the command&lt;br /&gt;
 [gotcloud_path]/scripts/check_requirements.sh&lt;br /&gt;
&lt;br /&gt;
==== Install GotCloud Software ====&lt;br /&gt;
&lt;br /&gt;
You can install gotCloud on your system as (follow the links for the appropriate instructions):&lt;br /&gt;
* [[GotCloud: Source Releases|source release]] - contains the scripts and uncompiled source&lt;br /&gt;
* [[GotCloud: Binary Releases|binary release]] - contains the scripts and pre-compiled binaries (no source)&lt;br /&gt;
&lt;br /&gt;
[[GotCloud: Versions]] describes the changes added to each version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Alternatively if you are using Amazon EC2, you can use one of the following sets of instructions:&lt;br /&gt;
* Create a machine instance based on the AMI we provide: [[Amazon Single Node]]&lt;br /&gt;
* Create an EC2 cluster instance using [[StarCluster|StarCluster]]&lt;br /&gt;
For more information on using GotCloud on Amazon, see: [[GotCloud: Amazon]]&lt;br /&gt;
&lt;br /&gt;
For more information on Amazon Web Services, see: https://aws.amazon.com/&lt;br /&gt;
&lt;br /&gt;
==== GotCloud Reference/Resource Files ====&lt;br /&gt;
In order to run gotCloud, you need to provide Genetic Reference and Resource Files.&lt;br /&gt;
&lt;br /&gt;
These include information about the reference sequence and dbnsp positions.&lt;br /&gt;
&lt;br /&gt;
See: [[GotCloud: Genetic Reference and Resource Files]] for information about the required files.  It contains a description of the required files, information about generating your own versions, as well as a downloadable set of files.&lt;br /&gt;
* When running on Amazon, a default set of reference files are included in the GotCloud AMI.&lt;br /&gt;
&lt;br /&gt;
==== Configure GotCloud ====&lt;br /&gt;
* [[Configure GotCloud|Configure Gotcloud]] for your installation&lt;br /&gt;
&lt;br /&gt;
== Running GotCloud Software ==&lt;br /&gt;
&lt;br /&gt;
* [[GotCloud: Alignment Pipeline|Alignment Pipeline]] &lt;br /&gt;
** [[GotCloud: Alignment Sub-Pipelines|Alignment Sub-Pipelines]] - for if you do not want to run the entire Alignment Pipeline&lt;br /&gt;
* [[GotCloud: Variant Calling Pipeline|Variant Calling Pipeline]]&lt;br /&gt;
* Indel Calling Pipeline&lt;br /&gt;
* [[GotCloud: GenomeSTRiP Pipeline|GenomeSTRiP Pipeline]] (Structural Variation)&lt;br /&gt;
* MEI Calling Pipeline - &#039;&#039;Ask if you&#039;re interested&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can also create your own pipelines.  Instructions are here:&lt;br /&gt;
* [[GotCloud: Creating a New Pipeline]] &lt;br /&gt;
&lt;br /&gt;
=== GotCloud Demos ===&lt;br /&gt;
GotCloud Demos (originally from our sequencing workshop):&lt;br /&gt;
* [[SeqShop: Sequence Mapping and Assembly Practical]]&lt;br /&gt;
* [[SeqShop: Variant Calling and Filtering for SNPs Practical]]&lt;br /&gt;
* [[SeqShop: Variant Calling and Filtering for INDELs Practical]]&lt;br /&gt;
* [[SeqShop: Analysis of Structural Variation Practical]]&lt;br /&gt;
&lt;br /&gt;
GotCloud on Amazon Demo (snpcall &amp;amp; indel):&lt;br /&gt;
* [[GotCloud: Amazon Demo]]&lt;br /&gt;
&lt;br /&gt;
Deprecated: [[Tutorial: GotCloud]]&lt;br /&gt;
&lt;br /&gt;
== UMich Development/Release How-To Notes ==&lt;br /&gt;
* [[Releasing GotCloud]]&lt;br /&gt;
* Amazon EC2&lt;br /&gt;
** [[Creating an AMI on EC2]]&lt;br /&gt;
** [[Creating a Snapshot on EC2]] (deprecated)&lt;br /&gt;
** [[Mount S3 Volume]]&lt;br /&gt;
** Notes on sequence data preparation in [[Amazon Storage|Amazon Storage]].&lt;br /&gt;
&lt;br /&gt;
* [[Git_FAQs#Subtrees|Upgrade Git Subtree]]&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Samtools-hybrid&amp;diff=15175</id>
		<title>Samtools-hybrid</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Samtools-hybrid&amp;diff=15175"/>
		<updated>2021-09-11T21:22:19Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= What is samtools-hybrid?=&lt;br /&gt;
samtools-hybrid is a modified version of samtools.&lt;br /&gt;
&lt;br /&gt;
This hybrid version of samtools is essentially samtools version 0.1.7a (r510), except the 0.1.7a bgzf logic and &amp;quot;calmd&amp;quot; functionality have been replaced with the bgzf and &amp;quot;calmd&amp;quot; from samtools revision r983. &lt;br /&gt;
&lt;br /&gt;
The original samtools-hybrid merged in version 0.1.12a (r862), but it has since been upgraded to r983 to bring in the enhanced BAQ logic.&lt;br /&gt;
&lt;br /&gt;
This hybrid version does not provide the samtools &amp;quot;mpileup&amp;quot; SNP calling capability, nor the &amp;quot;idxstats&amp;quot; and &amp;quot;reheader&amp;quot; capabilities that are present in the full version 0.1.12a and later.&lt;br /&gt;
&lt;br /&gt;
== Why was samtools-hybrid created? ==&lt;br /&gt;
The purpose is to provide in one executable Heng Li&#039;s BAQ base call quality score adjustment functionality from &amp;quot;calmd&amp;quot;, as well as to output valid .glf format when using &#039;samtools pileup -g&#039;.  &lt;br /&gt;
&lt;br /&gt;
Some of our tools require both of these methods and since there is not a version of samtools that supports both pileup generating GLF files and the BAQ logic, we created this hybrid version so we could release single version of samtools for use by our tools.&lt;br /&gt;
&lt;br /&gt;
== Where can I get samtools-hybrid? ==&lt;br /&gt;
That code can be downloaded at: https://github.com/statgen/samtools-0.1.7a-hybrid&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can download the file here: [[Media:samtools-0.1.7a-hybrid.v1.1.1.tgz‎|samtools-0.1.7a-hybrid.v1.1.1.tgz]] - Released 7/25/2013&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
If you have additional questions or comments, please raise an issue in the [https://github.com/statgen/samtools-0.1.7a-hybrid Github repository].&lt;br /&gt;
&lt;br /&gt;
; I get a &#039;floating point exception&#039; with a command like &amp;lt;code&amp;gt;samtools-hybrid pileup $bam  -g -f $fasta  &amp;gt; $bam.glf&amp;lt;/code&amp;gt;&lt;br /&gt;
: One potential issue is that the fasta index file (.fai file) is either not correct for the fasta file or it is not in the exact format that samtools-hybrid expects.  Try removing the .fai file and let samtools-hybrid regenerate the file.  That will ensure that samtools-hybrid is reading the file in the format it expects.&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=C%2B%2B_Library:_libStatGen&amp;diff=15174</id>
		<title>C++ Library: libStatGen</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=C%2B%2B_Library:_libStatGen&amp;diff=15174"/>
		<updated>2021-09-11T21:21:15Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Copyrights */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:C++]]&lt;br /&gt;
[[Category:libStatGen]]&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
Open source, freely available (GPL license), easy to use C++ APIs&lt;br /&gt;
* General Operation Classes including:&lt;br /&gt;
** File/Stream I/O – uncompressed, BGZF, GZIP, stdin, stdout&lt;br /&gt;
** String processing&lt;br /&gt;
** Parameter Parsing&lt;br /&gt;
* &#039;&#039;&#039;Statistical Genetic Specific Classes&#039;&#039;&#039; including:&lt;br /&gt;
**Handling Common file formats – SAM/BAM, FASTQ, GLF, VCF (coming soon)&lt;br /&gt;
***Accessors to get/set values&lt;br /&gt;
***Indexed access to BAM files&lt;br /&gt;
**Utility classes, including:&lt;br /&gt;
***Cigar – interpretation and mapping between query and reference&lt;br /&gt;
***Pileup – structured access to data by individual reference position&lt;br /&gt;
&lt;br /&gt;
Can be used to create your own C++ programs.&lt;br /&gt;
&lt;br /&gt;
Currently the repository is recommended for Unix/Linux users with access to the GNU C++ compiler.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Copyrights =&lt;br /&gt;
Here are links to the copyrights for our code and some of the utilities it uses:&lt;br /&gt;
*[https://github.com/statgen/libStatGen/blob/master/general/COPYING GNU GENERAL PUBLIC LICENSE] and [https://github.com/statgen/libStatGen/blob/master/general/LICENSE.txt Our Copyright Note]&lt;br /&gt;
*[https://github.com/statgen/libStatGen/blob/master/general/LICENSE.twister Copyright for MERSENNE TWISTER (used in Random.cpp)]&lt;br /&gt;
*[https://github.com/statgen/libStatGen/blob/master/samtools/COPYING Samtools Copyright (MIT License)]&lt;br /&gt;
Copies of these can be found in our library under libStatGen/copyrights/.&lt;br /&gt;
&lt;br /&gt;
= Join in libStatGen mailing list =&lt;br /&gt;
&lt;br /&gt;
Please join in the [http://groups.google.com/group/libStatGen libStatGen Google Group] to ask / discuss / comment about this library.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
If you are having trouble compiling any of the versions, check [[libStatGen Troubleshooting]] for help.  If that does not solve your problem, email me for support.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Where to Find It =&lt;br /&gt;
&lt;br /&gt;
{{ToolGitRepo|repoName=libStatGen|libStatGen=true|libBaseName=libStatGen}}&lt;br /&gt;
&lt;br /&gt;
== Releases ==&lt;br /&gt;
Released Versions are documented at [[libStatGen Download]]&lt;br /&gt;
&lt;br /&gt;
= What has changed =&lt;br /&gt;
The &amp;lt;code&amp;gt;pipeline&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;statgen&amp;lt;/code&amp;gt; repositories have been deprecated, so please update to our new framework.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;libStatGen&amp;lt;/code&amp;gt; is the new git repository for our library code.  &lt;br /&gt;
&lt;br /&gt;
There are now separate repositories for specific tools/groups of tools, allowing us to track everything separately so it is easier to follow changes that impact a specific tool or the library in general.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Library Documentation =&lt;br /&gt;
Latest Doxygen documentation:&lt;br /&gt;
&amp;lt;!-- &amp;lt;a href=&amp;quot;http://csg.sph.umich.edu//abecasis/GOLD/ --&amp;gt;&lt;br /&gt;
&amp;lt;!-- [http://www.sph.umich.edu/csg/mktrost/doxygen/current/ Current Library Documentation in Doxygen] --&amp;gt;&lt;br /&gt;
[http://csg.sph.umich.edu//mktrost/doxygen/current/ Current Library Documentation in Doxygen]&lt;br /&gt;
&lt;br /&gt;
Additional documentation: &lt;br /&gt;
* [[libStatGen: general]] - General classes for file processing and performing common tasks (used by most other libraries).&lt;br /&gt;
* [[libStatGen: BAM]] - Classes specific for reading/writing/analyzing SAM/BAM files.&lt;br /&gt;
* [[libStatGen: GLF]] - Classes specific for reading/writing/analyzing GLF files.&lt;br /&gt;
* [[libStatGen: FASTQ]] - Classes specific for reading/writing/analyzing FastQ files.&lt;br /&gt;
* [[libStatGen: ASP]] - Classes specific for reading/writing/analyzing ASP files.&lt;br /&gt;
* [[libStatGen: VCF]] - Classes specific for reading/writing/analyzing VCF files.&lt;br /&gt;
&lt;br /&gt;
= Using the Library =&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
* This software requires the following to be installed:&lt;br /&gt;
** g++&lt;br /&gt;
** development version of zlib (zlib1g-dev on ubuntu)&lt;br /&gt;
* Compiles on Linux/Unix&lt;br /&gt;
&lt;br /&gt;
== Building the Library ==&lt;br /&gt;
&lt;br /&gt;
If you type make help, you get the build options.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Makefile help&lt;br /&gt;
-------------&lt;br /&gt;
Type...           To...&lt;br /&gt;
make              Compile opt &lt;br /&gt;
make help         Display this help screen&lt;br /&gt;
make all          Compile everything (opt, debug, &amp;amp; profile)&lt;br /&gt;
make opt          Compile optimized&lt;br /&gt;
make debug        Compile for debug&lt;br /&gt;
make profile      Compile for profile&lt;br /&gt;
make clean        Delete temporary files&lt;br /&gt;
make test         Execute tests (if there are any)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you just type make, it will by default to make opt (optimized).&lt;br /&gt;
&lt;br /&gt;
Make all indicates opt, debug, and profile.&lt;br /&gt;
&lt;br /&gt;
opt creates &amp;lt;code&amp;gt;libStatGen.a&amp;lt;/code&amp;gt;, debug creates &amp;lt;code&amp;gt;libStatGen_debug.a&amp;lt;/code&amp;gt;, profile creates &amp;lt;code&amp;gt;libStatGen_profile.a&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These libraries are created in the top level libStatGen directory and can then be linked to appropriately for building tools as optimized, debugging, and/or profiling.&lt;br /&gt;
&lt;br /&gt;
== Navigating the Library Subdirectories ==&lt;br /&gt;
Under the main libStatGen repository, there are:&lt;br /&gt;
*bam - library code for operating on bam files.&lt;br /&gt;
*copyrights - copyrights for the library and any code included with it.&lt;br /&gt;
*fastq - library code for operating on fastq files.&lt;br /&gt;
*general - library code for general operations&lt;br /&gt;
*glf - library code for operating on glf files.&lt;br /&gt;
*include - after compiling, the library headers are linked here&lt;br /&gt;
*Makefiles - directory containing Makefiles that are used in the library and can be used for developing programs using the library&lt;br /&gt;
*samtools - library code used from samtools&lt;br /&gt;
&lt;br /&gt;
After Compiling: libStatGen.a, libStatGen_debug.a, libStatGen_profile.a are created at the top level.&lt;br /&gt;
&lt;br /&gt;
=== bam, fastq, general, glf, samtools ===&lt;br /&gt;
Object files are placed in an obj directory under each subdirectory with debug &amp;amp; profile objects in obj/debug and obj/profile.&lt;br /&gt;
&lt;br /&gt;
Most also have a test directory. Tests are executed by running &amp;lt;code&amp;gt;make test&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Makefiles ===&lt;br /&gt;
This directory contains base makefiles and makefile settings that are used by the library and by programs being written to use the library.&lt;br /&gt;
&lt;br /&gt;
== Using the Library in Your Own Program ==&lt;br /&gt;
&lt;br /&gt;
=== Starting from a Sample Program (Recommended) ===&lt;br /&gt;
[https://github.com/statgen/SampleProgram https://github.com/statgen/SampleProgram] is a simple program demonstrating how to write a tool that uses libStatGen and can be used as a starting point for your tool.  &lt;br /&gt;
&lt;br /&gt;
SampleProgram has 4 subdirectories:&lt;br /&gt;
* copyrights - contains the copyright information, add your own copyrights as necessary&lt;br /&gt;
* obj - this directory is where the object files are placed when the code is compiled (with a subdirectory for debug and profile objects)&lt;br /&gt;
* src - this is where your own program code goes&lt;br /&gt;
* test - this is where your test code goes.  Test code can be setup to run with &amp;lt;code&amp;gt;make test&amp;lt;/code&amp;gt; to ensure the program works properly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using SampleProgram as a starting point for your tool:&#039;&#039;&#039;&lt;br /&gt;
# Copy SampleProgram into a directory with your program name (it is the starting point for your own program).&lt;br /&gt;
# Update ChangeLog, .gitignore, and README.txt as appropriate.&lt;br /&gt;
# Add any necessary copyrights to the copyrights directory.&lt;br /&gt;
#* No changes to Makefile should be necessary.&lt;br /&gt;
# Update Makefile.inc&lt;br /&gt;
## Update the VERSION as necessary.&lt;br /&gt;
## Replace all occurrences of &amp;lt;code&amp;gt;SAMPLE_PROGRAM&amp;lt;/code&amp;gt; with an all caps name for your program.&lt;br /&gt;
##*  You can then use the &amp;lt;code&amp;gt;LIB_PATH_&amp;lt;your program name&amp;gt;&amp;lt;/code&amp;gt; environment variable to specify an alternate path to libStatGen specific for your program.  In most cases you will not need to do this.&lt;br /&gt;
#* No other updates to Makefile.inc should be necessary.&lt;br /&gt;
# Add your program (cpp &amp;amp; h files) to the &amp;lt;code&amp;gt;src&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
# Update src/Makefile&lt;br /&gt;
## Set EXE to your program executable (replacing sampleProgram)&lt;br /&gt;
## Set TOOLBASE, SRCONLY, and HDRONLY as appropriate for specifying your program file names.&lt;br /&gt;
## Set any of the other optional settings as specified in the sample makefile.&lt;br /&gt;
#* No other changes should be necessary to src/Makefile.&lt;br /&gt;
# Add your tests to the &amp;lt;code&amp;gt;test&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
# Update test/Makefile as appropriate for specifying how to compile/run your tests.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After compiling a &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory is created in the top level directory.  Your executable goes in there.  If you build for &amp;lt;code&amp;gt;debug&amp;lt;/code&amp;gt; and/or &amp;lt;code&amp;gt;profile&amp;lt;/code&amp;gt;, subdirectories for those are created under &amp;lt;code&amp;gt;bin/&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;obj&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Working from Scratch ===&lt;br /&gt;
When compiling your code, be sure to include the library header files found in libStatgen/include/ and link in the appropriate library (opt: libStatGen.a, debug: libStatGen_debug.a, or profile: libStatGen_profile.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Starting from a Sample Set of Tools ===&lt;br /&gt;
[https://github.com/statgen/SampleTools https://github.com/statgen/SampleTools] is a repository containing multiple programs within one directory structure.  It demonstrates how to have subdirectories for each tool using libStatGen and can be used as a starting point for your set of tools.  &lt;br /&gt;
&lt;br /&gt;
SampleTools has 3 subdirectories:&lt;br /&gt;
* copyrights - contains the copyright information, add your own copyrights as necessary&lt;br /&gt;
* SampleProgram1 - a dummy demo program to show the structure for having multiple programs&lt;br /&gt;
* SampleProgram2 - a second dummy demo program to show the structure for having multiple programs&lt;br /&gt;
&lt;br /&gt;
SampleProgram1 &amp;amp; SampleProgram2 have 2 subdirectories:&lt;br /&gt;
* src - this is where your own program code goes&lt;br /&gt;
* test - this is where your test code goes.  Test code can be setup to run with &amp;lt;code&amp;gt;make test&amp;lt;/code&amp;gt; to ensure the program works properly.&lt;br /&gt;
&lt;br /&gt;
Upon compiling, an &amp;lt;code&amp;gt;obj&amp;lt;/code&amp;gt; directory is created under &amp;lt;code&amp;gt;SampleProgram1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;SampleProgram2&amp;lt;/code&amp;gt; and a &amp;lt;code&amp;gt;bin&amp;lt;/code&amp;gt; directory is created at the top level.  If you build for &amp;lt;code&amp;gt;debug&amp;lt;/code&amp;gt; and/or &amp;lt;code&amp;gt;profile&amp;lt;/code&amp;gt;, subdirectories for those are created under &amp;lt;code&amp;gt;bin/&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;SampleProgram1(2)/obj&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using SampleTools as a starting point for your set of tools:&#039;&#039;&#039;&lt;br /&gt;
# Copy &amp;lt;code&amp;gt;SampleTools&amp;lt;/code&amp;gt; into a directory with your toolset name (it is the starting point for your own set of tools).&lt;br /&gt;
# Update &amp;lt;code&amp;gt;ChangeLog&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.gitignore&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;README.txt&amp;lt;/code&amp;gt; as appropriate.&lt;br /&gt;
# Add any necessary copyrights to the copyrights directory.&lt;br /&gt;
# Rename the &amp;lt;code&amp;gt;SampleProgram1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;SampleProgram2&amp;lt;/code&amp;gt; directories&lt;br /&gt;
# Create any additional directories as necessary.&lt;br /&gt;
#* Recursively copy the structure/Makefiles from &amp;lt;code&amp;gt;SampleProgram1&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Update &amp;lt;code&amp;gt;SUBDIRS&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; as necessary.&lt;br /&gt;
# Update &amp;lt;code&amp;gt;Makefile.inc&amp;lt;/code&amp;gt;&lt;br /&gt;
## Update the &amp;lt;code&amp;gt;VERSION&amp;lt;/code&amp;gt; as necessary.&lt;br /&gt;
## Replace all occurrences of &amp;lt;code&amp;gt;SAMPLE_PROGRAM&amp;lt;/code&amp;gt; with an all caps name for your toolset.&lt;br /&gt;
##*  You can then use the &amp;lt;code&amp;gt;LIB_PATH_&amp;lt;your toolset name&amp;gt;&amp;lt;/code&amp;gt; environment variable to specify an alternate path to libStatGen specific for your program.  In most cases you will not need to do this.&lt;br /&gt;
#* No other updates to &amp;lt;code&amp;gt;Makefile.inc&amp;lt;/code&amp;gt; should be necessary.&lt;br /&gt;
# For each Program you want to add:&lt;br /&gt;
## Move into the appropriate subdirectory.&lt;br /&gt;
##* No change should be made to the program&#039;s &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
## Add your program (cpp &amp;amp; h files) to the &amp;lt;code&amp;gt;src&amp;lt;/code&amp;gt; subdirectory.&lt;br /&gt;
## Update src/Makefile&lt;br /&gt;
### Set EXE to your program executable (replacing sampleProgram)&lt;br /&gt;
### Set TOOLBASE, SRCONLY, and HDRONLY as appropriate for specifying your program file names.&lt;br /&gt;
### Set any of the other optional settings as specified in the sample makefile.&lt;br /&gt;
##* No other changes should be necessary to src/Makefile.&lt;br /&gt;
## Add your tests to the &amp;lt;code&amp;gt;test&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
## Update test/Makefile as appropriate for specifying how to compile/run your tests.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How To Use the APIs =&lt;br /&gt;
More coming soon, see: http://genome.sph.umich.edu/wiki/Sam_Library_Usage_Examples&lt;br /&gt;
&lt;br /&gt;
[[LibStatGen: ASP#API for Reading ASP Files| ASP APIs]]&lt;br /&gt;
&lt;br /&gt;
[[LibStatGen: VCF#API for Reading VCF Files| VCF APIs]]&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Software&amp;diff=15173</id>
		<title>Software</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Software&amp;diff=15173"/>
		<updated>2021-09-11T21:20:33Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Software]]&lt;br /&gt;
[[Category:C++]]&lt;br /&gt;
&lt;br /&gt;
=Software=&lt;br /&gt;
Due to increasing volume of next generation sequencing and genotyping data, we have created these C++ library and tools that use that library.&lt;br /&gt;
&lt;br /&gt;
This page points to downloads, documentation, and papers for software that is written here at the [http://genome.sph.umich.edu Center for Statistical Genetics]&lt;br /&gt;
&lt;br /&gt;
If you have any questions or comments, please raise issue in [https://github.com/statgen/ our GitHub repositories].&lt;br /&gt;
&lt;br /&gt;
=StatGen C++ Software=&lt;br /&gt;
&lt;br /&gt;
We have developed a C++ library and tools for handling and analyzing next generation sequencing and genotyping data.&lt;br /&gt;
&lt;br /&gt;
== Library ==&lt;br /&gt;
&lt;br /&gt;
The library contains easy-to-use APIs for developing tools for processing and analyzing next generation sequencing and genotyping data.  Allows easy processing of SAM/BAM, GLF, and FASTQ (VCF is coming).&lt;br /&gt;
&lt;br /&gt;
More information on the library can be found at: [[C++ Library: libStatGen]]&lt;br /&gt;
&lt;br /&gt;
The library can be downloaded at: [[libStatGen Download]]&lt;br /&gt;
&lt;br /&gt;
== Programs/Tools ==&lt;br /&gt;
&lt;br /&gt;
Follow the program links for more information on obtaining the tool.  Some tools are packaged together.&lt;br /&gt;
&lt;br /&gt;
=== SAM/BAM ===&lt;br /&gt;
&lt;br /&gt;
*[[QPLOT]] - Calculate &amp;amp; plot summary statistics&lt;br /&gt;
*[[VerifyBamID]] – Check sample identities for contamination/sample swap&lt;br /&gt;
**Genotype concordance based detection&lt;br /&gt;
**Estimate based on population allele frequencies without genotype data&lt;br /&gt;
*[[Pileup]] – Pileup every base or just bases in specified region and write VCF&lt;br /&gt;
&lt;br /&gt;
==== BAM Util Tools ====&lt;br /&gt;
{{BamUtilPrograms}}&lt;br /&gt;
&lt;br /&gt;
=== FASTQ ===&lt;br /&gt;
* [[FastQValidator|fastqValidator]] - validate a FASTQ file&lt;br /&gt;
**Reports errors for badly formatted files&lt;br /&gt;
**Reports Base Composition Statistics (%reads at each read index)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Meta Analysis ===&lt;br /&gt;
* [[Rare-Metal-Worker|RAREMETALWORKER - generate summary level statistics for meta analysis using Rare-Metal]]&lt;br /&gt;
* [[Rare-Metal|RAREMETAL - perform genome-wide meta analysis of rare variants]]&lt;br /&gt;
&lt;br /&gt;
=== Other Tools ===&lt;br /&gt;
*[[statgenTools#createUMref|createUMref - Create the University of Michigan formatted reference used by many of our tools]]&lt;br /&gt;
*[[Thunder|thunderVCF]]&lt;br /&gt;
*[[vcfCooker]] – Manipulate, filter, summarize VCF/BED file in various forms&lt;br /&gt;
*[[VcfGenomeStat]] – Print flanking sequences and how often they appear for input VCF file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Requested Tools ===&lt;br /&gt;
&lt;br /&gt;
=Other Tools=&lt;br /&gt;
&lt;br /&gt;
* [[samtools-hybrid]] - Since many of our tools still rely on GLF files and samtools stopped supporting GLF files, we created a version of samtools that still supports pileup to GLF files AND incorporates the updated BAQ logic.  This version is called samtools-hybrid That code can be downloaded at: https://github.com/statgen/samtools-0.1.7a-hybrid&lt;br /&gt;
*[[baseQualityCheck]] - tool to calculate the observed base quality vs. empirical base quality (helps to evaluate mappers)&lt;br /&gt;
&lt;br /&gt;
== Variant Calling ==&lt;br /&gt;
* [[glfSingle]] - Variant calling for a single, deeply sequenced individual&lt;br /&gt;
* [[glfMultiples]] - Variant calling for multiple, unrelated individuals&lt;br /&gt;
* [[Polymutt|polymutt]] - Variant and &#039;&#039;de novo&#039;&#039; mutation detection in families (nuclear or extended pedigrees) from sequencing&lt;br /&gt;
&lt;br /&gt;
== Variant Annotation ==&lt;br /&gt;
*[[vcfCodingSnps]] - Annotate coding variants in a VCF file.&lt;br /&gt;
&lt;br /&gt;
== Genotype Imputation ==&lt;br /&gt;
*[[Minimac3]] - Fast and Efficient Genotype Imputation.&lt;br /&gt;
&lt;br /&gt;
== Additional Pedigree &amp;amp; Sequence Analysis Tools ==&lt;br /&gt;
Can be found at: http://sph.umich.edu/csg/abecasis/software.html&lt;br /&gt;
&lt;br /&gt;
= Other Useful Links =&lt;br /&gt;
[[Links to Sequence Analysis Tools]]&lt;br /&gt;
&lt;br /&gt;
= Other =&lt;br /&gt;
ASHG 2010 Poster: [[Media:TrostASHG2010.pdf|C++ library &amp;amp; tools for next generation sequence data]]&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SAM/BAM_Classes_FAQs&amp;diff=15172</id>
		<title>SAM/BAM Classes FAQs</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SAM/BAM_Classes_FAQs&amp;diff=15172"/>
		<updated>2021-09-11T21:20:17Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:libStatGen]]&lt;br /&gt;
[[Category:libStatGen BAM]]&lt;br /&gt;
&lt;br /&gt;
== How Do I? ==&lt;br /&gt;
&lt;br /&gt;
===== Q: What is SAM/BAM? =====&lt;br /&gt;
* A: See: [[SAM]] and [[BAM]].  [[SAM]] also provides additional details as to what is a CIGAR, QUALITY, and TAG.&lt;br /&gt;
&lt;br /&gt;
===== Q: Map between a query/read sequence and a reference sequence to do things like looking up a base/quality at a given reference position or looking up a reference base for a given read position? =====&lt;br /&gt;
* A: Use [[C++ Class: CigarRoller#Mapping Between Reference and Read/Query|Cigar::getQueryIndex &amp;amp; Cigar::getRefOffset]]&lt;br /&gt;
&lt;br /&gt;
===== Q: Read only portions of a sorted &amp;amp; indexed BAM file that fall within a specified region? =====&lt;br /&gt;
* A: &lt;br /&gt;
*# open a sorted and indexed BAM file for reading (&amp;lt;code&amp;gt;SamFile::OpenForRead&amp;lt;/code&amp;gt;)&lt;br /&gt;
*# read the BAM Index file (&amp;lt;code&amp;gt;SamFile::ReadBamIndex&amp;lt;/code&amp;gt;)&lt;br /&gt;
*# read the header (&amp;lt;code&amp;gt;SamFile::ReadHeader&amp;lt;/code&amp;gt;)&lt;br /&gt;
*# set the region to be read (&amp;lt;code&amp;gt;SamFile::SetReadSection&amp;lt;/code&amp;gt;)&lt;br /&gt;
*# Loop calling &amp;lt;code&amp;gt;SamFile::ReadRecord&amp;lt;/code&amp;gt; until it returns false - indicating there are no more reads within this region.  &lt;br /&gt;
These methods are found in [[C++ Class: SamFile]]. &lt;br /&gt;
&lt;br /&gt;
NOTE: ReadRecord will also return false on an error - use &amp;lt;code&amp;gt;SamFile::GetStatus()&amp;lt;/code&amp;gt; to determine if it was an error or the end of the region.  &amp;lt;code&amp;gt;GetStatus&amp;lt;/code&amp;gt; returns SamStatus::NO_MORE_RECS for the end of the region.&lt;br /&gt;
&lt;br /&gt;
See the library usage page for an [[Sam_Library_Usage_Examples#Read_a_Specified_Region_from_a_Sorted_.26_Indexed_BAM_File|Example]].&lt;br /&gt;
&lt;br /&gt;
* Q: How do I read multiple regions?&lt;br /&gt;
** A: Use the above solution, but loop on the SetReadSection/ReadRecord steps until all sections have been processed.&lt;br /&gt;
&lt;br /&gt;
===== Q: Get additional information on this library? =====&lt;br /&gt;
* A: If you have any questions or comments, please raise issue in [https://github.com/statgen/ our GitHub repositories].&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SAM/BAM_Classes_FAQs&amp;diff=15171</id>
		<title>SAM/BAM Classes FAQs</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SAM/BAM_Classes_FAQs&amp;diff=15171"/>
		<updated>2021-09-11T21:19:55Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:libStatGen]]&lt;br /&gt;
[[Category:libStatGen BAM]]&lt;br /&gt;
&lt;br /&gt;
== How Do I? ==&lt;br /&gt;
&lt;br /&gt;
===== Q: What is SAM/BAM? =====&lt;br /&gt;
* A: See: [[SAM]] and [[BAM]].  [[SAM]] also provides additional details as to what is a CIGAR, QUALITY, and TAG.&lt;br /&gt;
&lt;br /&gt;
===== Q: Map between a query/read sequence and a reference sequence to do things like looking up a base/quality at a given reference position or looking up a reference base for a given read position? =====&lt;br /&gt;
* A: Use [[C++ Class: CigarRoller#Mapping Between Reference and Read/Query|Cigar::getQueryIndex &amp;amp; Cigar::getRefOffset]]&lt;br /&gt;
&lt;br /&gt;
===== Q: Read only portions of a sorted &amp;amp; indexed BAM file that fall within a specified region? =====&lt;br /&gt;
* A: &lt;br /&gt;
*# open a sorted and indexed BAM file for reading (&amp;lt;code&amp;gt;SamFile::OpenForRead&amp;lt;/code&amp;gt;)&lt;br /&gt;
*# read the BAM Index file (&amp;lt;code&amp;gt;SamFile::ReadBamIndex&amp;lt;/code&amp;gt;)&lt;br /&gt;
*# read the header (&amp;lt;code&amp;gt;SamFile::ReadHeader&amp;lt;/code&amp;gt;)&lt;br /&gt;
*# set the region to be read (&amp;lt;code&amp;gt;SamFile::SetReadSection&amp;lt;/code&amp;gt;)&lt;br /&gt;
*# Loop calling &amp;lt;code&amp;gt;SamFile::ReadRecord&amp;lt;/code&amp;gt; until it returns false - indicating there are no more reads within this region.  &lt;br /&gt;
These methods are found in [[C++ Class: SamFile]]. &lt;br /&gt;
&lt;br /&gt;
NOTE: ReadRecord will also return false on an error - use &amp;lt;code&amp;gt;SamFile::GetStatus()&amp;lt;/code&amp;gt; to determine if it was an error or the end of the region.  &amp;lt;code&amp;gt;GetStatus&amp;lt;/code&amp;gt; returns SamStatus::NO_MORE_RECS for the end of the region.&lt;br /&gt;
&lt;br /&gt;
See the library usage page for an [[Sam_Library_Usage_Examples#Read_a_Specified_Region_from_a_Sorted_.26_Indexed_BAM_File|Example]].&lt;br /&gt;
&lt;br /&gt;
* Q: How do I read multiple regions?&lt;br /&gt;
** A: Use the above solution, but loop on the SetReadSection/ReadRecord steps until all sections have been processed.&lt;br /&gt;
&lt;br /&gt;
===== Q: Get additional information on this library? =====&lt;br /&gt;
* A: If you have any questions or comments, please raise issue in the corresponding [https://github.com/statgen/ our GitHub repositories].&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Software&amp;diff=15170</id>
		<title>Software</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Software&amp;diff=15170"/>
		<updated>2021-09-11T21:19:13Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Software]]&lt;br /&gt;
[[Category:C++]]&lt;br /&gt;
&lt;br /&gt;
=Software=&lt;br /&gt;
Due to increasing volume of next generation sequencing and genotyping data, we have created these C++ library and tools that use that library.&lt;br /&gt;
&lt;br /&gt;
This page points to downloads, documentation, and papers for software that is written here at the [http://genome.sph.umich.edu Center for Statistical Genetics]&lt;br /&gt;
&lt;br /&gt;
If you have any questions or comments, please raise issue in the corresponding [https://github.com/statgen/ our GitHub repositories].&lt;br /&gt;
&lt;br /&gt;
=StatGen C++ Software=&lt;br /&gt;
&lt;br /&gt;
We have developed a C++ library and tools for handling and analyzing next generation sequencing and genotyping data.&lt;br /&gt;
&lt;br /&gt;
== Library ==&lt;br /&gt;
&lt;br /&gt;
The library contains easy-to-use APIs for developing tools for processing and analyzing next generation sequencing and genotyping data.  Allows easy processing of SAM/BAM, GLF, and FASTQ (VCF is coming).&lt;br /&gt;
&lt;br /&gt;
More information on the library can be found at: [[C++ Library: libStatGen]]&lt;br /&gt;
&lt;br /&gt;
The library can be downloaded at: [[libStatGen Download]]&lt;br /&gt;
&lt;br /&gt;
== Programs/Tools ==&lt;br /&gt;
&lt;br /&gt;
Follow the program links for more information on obtaining the tool.  Some tools are packaged together.&lt;br /&gt;
&lt;br /&gt;
=== SAM/BAM ===&lt;br /&gt;
&lt;br /&gt;
*[[QPLOT]] - Calculate &amp;amp; plot summary statistics&lt;br /&gt;
*[[VerifyBamID]] – Check sample identities for contamination/sample swap&lt;br /&gt;
**Genotype concordance based detection&lt;br /&gt;
**Estimate based on population allele frequencies without genotype data&lt;br /&gt;
*[[Pileup]] – Pileup every base or just bases in specified region and write VCF&lt;br /&gt;
&lt;br /&gt;
==== BAM Util Tools ====&lt;br /&gt;
{{BamUtilPrograms}}&lt;br /&gt;
&lt;br /&gt;
=== FASTQ ===&lt;br /&gt;
* [[FastQValidator|fastqValidator]] - validate a FASTQ file&lt;br /&gt;
**Reports errors for badly formatted files&lt;br /&gt;
**Reports Base Composition Statistics (%reads at each read index)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Meta Analysis ===&lt;br /&gt;
* [[Rare-Metal-Worker|RAREMETALWORKER - generate summary level statistics for meta analysis using Rare-Metal]]&lt;br /&gt;
* [[Rare-Metal|RAREMETAL - perform genome-wide meta analysis of rare variants]]&lt;br /&gt;
&lt;br /&gt;
=== Other Tools ===&lt;br /&gt;
*[[statgenTools#createUMref|createUMref - Create the University of Michigan formatted reference used by many of our tools]]&lt;br /&gt;
*[[Thunder|thunderVCF]]&lt;br /&gt;
*[[vcfCooker]] – Manipulate, filter, summarize VCF/BED file in various forms&lt;br /&gt;
*[[VcfGenomeStat]] – Print flanking sequences and how often they appear for input VCF file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Requested Tools ===&lt;br /&gt;
&lt;br /&gt;
=Other Tools=&lt;br /&gt;
&lt;br /&gt;
* [[samtools-hybrid]] - Since many of our tools still rely on GLF files and samtools stopped supporting GLF files, we created a version of samtools that still supports pileup to GLF files AND incorporates the updated BAQ logic.  This version is called samtools-hybrid That code can be downloaded at: https://github.com/statgen/samtools-0.1.7a-hybrid&lt;br /&gt;
*[[baseQualityCheck]] - tool to calculate the observed base quality vs. empirical base quality (helps to evaluate mappers)&lt;br /&gt;
&lt;br /&gt;
== Variant Calling ==&lt;br /&gt;
* [[glfSingle]] - Variant calling for a single, deeply sequenced individual&lt;br /&gt;
* [[glfMultiples]] - Variant calling for multiple, unrelated individuals&lt;br /&gt;
* [[Polymutt|polymutt]] - Variant and &#039;&#039;de novo&#039;&#039; mutation detection in families (nuclear or extended pedigrees) from sequencing&lt;br /&gt;
&lt;br /&gt;
== Variant Annotation ==&lt;br /&gt;
*[[vcfCodingSnps]] - Annotate coding variants in a VCF file.&lt;br /&gt;
&lt;br /&gt;
== Genotype Imputation ==&lt;br /&gt;
*[[Minimac3]] - Fast and Efficient Genotype Imputation.&lt;br /&gt;
&lt;br /&gt;
== Additional Pedigree &amp;amp; Sequence Analysis Tools ==&lt;br /&gt;
Can be found at: http://sph.umich.edu/csg/abecasis/software.html&lt;br /&gt;
&lt;br /&gt;
= Other Useful Links =&lt;br /&gt;
[[Links to Sequence Analysis Tools]]&lt;br /&gt;
&lt;br /&gt;
= Other =&lt;br /&gt;
ASHG 2010 Poster: [[Media:TrostASHG2010.pdf|C++ library &amp;amp; tools for next generation sequence data]]&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=BamUtil&amp;diff=15169</id>
		<title>BamUtil</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=BamUtil&amp;diff=15169"/>
		<updated>2021-09-11T21:14:59Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:bamUtil]]&lt;br /&gt;
[[Category:C++]]&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
&lt;br /&gt;
= bamUtil Overview =&lt;br /&gt;
&lt;br /&gt;
bamUtil is a repository that contains several programs that perform operations on SAM/BAM files.  All of these programs are built into a single executable, &amp;lt;code&amp;gt;bam&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Getting Help ==&lt;br /&gt;
&lt;br /&gt;
If you have any questions please use the [https://github.com/statgen/bamUtil bamUtil GitHub page] to raise and issue.&lt;br /&gt;
&lt;br /&gt;
See [[BamUtil: FAQ]] to see if your question has already been answered.&lt;br /&gt;
&lt;br /&gt;
== Where to Find It ==&lt;br /&gt;
{{ToolGitRepo|repoName=bamUtil}}&lt;br /&gt;
&lt;br /&gt;
== Releases ==&lt;br /&gt;
&lt;br /&gt;
If you prefer to run the last official release rather than the latest development version, you can download that here.&lt;br /&gt;
&lt;br /&gt;
There are two versions of the release, one that include libStatGen and one that does not.  If you already have libStatGen installed and want to use your own copy, use the version that does not include libStatGen.&lt;br /&gt;
&lt;br /&gt;
=== Full Release (includes libStatGen) ===&lt;br /&gt;
&lt;br /&gt;
To install an official release, unpack the downloaded file (tar xvf), cd into the bamUtil_x.x.x directory and type make all.&lt;br /&gt;
&lt;br /&gt;
For version 1.0.14 and later, please download libStatGen and bamUtil separately: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Version 1.0.14 - Released 7/8/2015&#039;&#039;&#039;&lt;br /&gt;
*[[LibStatGen Download#Official Releases|libStatGen version 1.0.14]]&lt;br /&gt;
*[[#Release of just BamUtil (does not include libStatGen)|bamUtil version 1.0.14]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Older Releases&#039;&#039;&#039;&lt;br /&gt;
* [[Media:BamUtilLibStatGen.1.0.13.tgz|BamUtilLibStatGen.1.0.13.tgz‎]] - Released 2/20/2015&lt;br /&gt;
** Contains: [[LibStatGen Download#Official Releases|libStatGen version 1.0.13]] - see link for version updates&lt;br /&gt;
** Contains: [[#Release of just BamUtil (does not include libStatGen)|bamUtil version 1.0.13]] - see link for version updates&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Media:BamUtilLibStatGen.1.0.12.tar.gz|BamUtilLibStatGen.1.0.12.tgz‎]] - Released 5/14/2014&lt;br /&gt;
** Contains: [[LibStatGen Download#Official Releases|libStatGen version 1.0.12]] - see link for version updates&lt;br /&gt;
** Contains: [[#Release of just BamUtil (does not include libStatGen)|bamUtil version 1.0.12]] - see link for version updates&lt;br /&gt;
** Adds regions to [[BamUtil: mergeBam|mergeBam]]&lt;br /&gt;
** Accept &#039;,&#039; delimiters for the tags string input in [[BamUtil: squeeze|squeeze]], [[BamUtil: revert|revert]], &amp;amp; [[BamUtil: diff|diff]]&lt;br /&gt;
&lt;br /&gt;
*[[Media:BamUtilLibStatGen.1.0.11.tar.gz|BamUtilLibStatGen.1.0.11.tar.gz‎]] - Released 2/28/2014&lt;br /&gt;
** Contains: [[LibStatGen Download#Official Releases|libStatGen version 1.0.11]] - see link for version updates&lt;br /&gt;
** Contains: [[#Release of just BamUtil (does not include libStatGen)|bamUtil version 1.0.11]] - see link for version updates&lt;br /&gt;
** Now properly supports &#039;B&#039; &amp;amp; &#039;f&#039; tags&lt;br /&gt;
** Cleanup - compile issues&lt;br /&gt;
&lt;br /&gt;
*[[Media:BamUtilLibStatGen.1.0.10.tar.gz|BamUtilLibStatGen.1.0.10.tar.gz‎]] - Released 1/2/2014&lt;br /&gt;
** Contains: [[LibStatGen Download#Official Releases|libStatGen version 1.0.10]] - see link for version updates&lt;br /&gt;
** Contains: [[#Release of just BamUtil (does not include libStatGen)|bamUtil version 1.0.10]] - see link for version updates&lt;br /&gt;
** Adds PhoneHome/Version checking. &lt;br /&gt;
&lt;br /&gt;
*[[Media:BamUtilLibStatGen.1.0.9.tgz|BamUtilLibStatGen.1.0.9.tgz‎]] - Released 7/7/2013&lt;br /&gt;
** Contains: [[LibStatGen Download#Official Releases|libStatGen version 1.0.9]] &lt;br /&gt;
** Contains: [[#Release of just BamUtil (does not include libStatGen)|bamUtil version 1.0.9]]&lt;br /&gt;
** Update to [[BamUtil: mergeBam|mergeBam]]&lt;br /&gt;
*** Update to ignore PG lines with duplicate IDs&lt;br /&gt;
*** Update to accept merges of matching RG lines&lt;br /&gt;
*** Update to log to stderr if no log/out file is specified&lt;br /&gt;
* There is no version 1.0.8.  It was skipped to stay in line with libStatGen versions (libStatGen 1.0.8 added vcf support)&lt;br /&gt;
*[[Media:BamUtilLibStatGen.1.0.7.tgz|BamUtilLibStatGen.1.0.7.tgz‎]] - Released 1/29/2013&lt;br /&gt;
** Contains: [[LibStatGen Download#Official Releases|libStatGen version 1.0.7]] &lt;br /&gt;
** Contains: [[#Release of just BamUtil (does not include libStatGen)|bamUtil version 1.0.7]]&lt;br /&gt;
** Update to fix some compile issues on ubuntu 12.10&lt;br /&gt;
** Update use of SamRecord::getStringTag to expect the return of a const string pointer due to libStatGen v1.0.7 updates&lt;br /&gt;
** Update SamReferenceInfo usage due to libStatGen v1.0.7 updates&lt;br /&gt;
** Update to [[BamUtil: diff|diff]]&lt;br /&gt;
***   Fix DIFF to test and properly handle running out of available records.  Previously no message was printed when this happened and there was a bug for which file it freed&lt;br /&gt;
** Update to [[BamUtil: clipOverlap|clipOverlap]]&lt;br /&gt;
*** Update to facilitate adding other overlap handling functions&lt;br /&gt;
** Update to [[BamUtil: mergeBam|mergeBam]] (formerly RGMergeBam)&lt;br /&gt;
*** Rename RGMergeBam to MergeBam&lt;br /&gt;
*** Update to handle files that already have an RG&lt;br /&gt;
&lt;br /&gt;
*[[Media:BamUtilLibStatGen.1.0.6.tgz|BamUtilLibStatGen.1.0.6.tgz‎]] - Released 11/14/2012&lt;br /&gt;
** Contains: [[LibStatGen Download#Official Releases|libStatGen version 1.0.6]] &lt;br /&gt;
** Contains: [[#Release of just BamUtil (does not include libStatGen)|bamUtil version 1.0.6]]&lt;br /&gt;
** Update to [[BamUtil: trimBam|trimBam]]&lt;br /&gt;
*** Update to allow trimming a different number of bases from each end of the read&lt;br /&gt;
*[[Media:BamUtilLibStatGen.1.0.5.tgz|BamUtilLibStatGen.1.0.5.tgz‎]] - Released 10/24/2012&lt;br /&gt;
** Contains: [[LibStatGen Download#Official Releases|libStatGen version 1.0.5]] &lt;br /&gt;
** Contains: [[#Release of just BamUtil (does not include libStatGen)|bamUtil version 1.0.5]]&lt;br /&gt;
** Updates to: [[BamUtil: dedup|dedup]], [[BamUtil: polishBam|polishBam]], [[BamUtil: recab|recab]]&lt;br /&gt;
** Update to add compile option to compile without C++0x/C++11&lt;br /&gt;
** See [[#Release of just BamUtil (does not include libStatGen)|below]] for additional details on updates&lt;br /&gt;
*BamUtilLibStatGen.1.0.4.tgz‎ - Released skipped&lt;br /&gt;
*[[Media:BamUtilLibStatGen.1.0.3.tgz|BamUtilLibStatGen.1.0.3.tgz‎]] - Released 09/19/2012&lt;br /&gt;
** Contains: [[LibStatGen Download#Official Releases|libStatGen version 1.0.3]] &lt;br /&gt;
** Contains: [[#Release of just BamUtil (does not include libStatGen)|bamUtil version 1.0.3]]&lt;br /&gt;
** Adds: [[BamUtil: dedup|dedup]] [[BamUtil: recab|recab]]&lt;br /&gt;
*[[Media:BamUtilLibStatGen.1.0.2.tgz|BamUtilLibStatGen.1.0.2.tgz‎]] - Released 05/16/2012&lt;br /&gt;
** Contains: [[LibStatGen Download#Official Releases|libStatGen version 1.0.2]] &lt;br /&gt;
** Adds: [[BamUtil: bam2FastQ|bam2FastQ]]&lt;br /&gt;
*[[Media:BamUtilLibStatGen.1.0.1.tgz|BamUtilLibStatGen.1.0.1.tgz‎]] - Released 05/04/2012&lt;br /&gt;
** Contains: [[LibStatGen Download#Official Releases|libStatGen version 1.0.1]] &lt;br /&gt;
** Adds: [[BamUtil: splitBam|splitBam]], [[BamUtil: clipOverlap|clipOverlap]],  [[BamUtil: trimBam|trimBam]], [[BamUtil: polishBam|polishBam]], [[BamUtil: rgMergeBam|rgMergeBam]], [[BamUtil: gapInfo|gapInfo]]&lt;br /&gt;
** Adds additional functionality to [[BamUtil: stats|stats]]&lt;br /&gt;
** Adds leftShifting to [[BamUtil: writeRegion|writeRegion]] and [[BamUtil: convert|convert]]&lt;br /&gt;
** Adds more diff fields to [[BamUtil: diff|diff]]&lt;br /&gt;
* [[Media:BamUtilLibStatGen.1.0.0.tgz|BamUtilLibStatGen.1.0.0.tgz‎]] - Released 10/10/2011&lt;br /&gt;
**Initial release of bamUtil that includes libStatGen version 1.0.0.  It started from the tool found in the deprecated StatGen repository.&lt;br /&gt;
**Contains: [[LibStatGen Download#Official Releases|libStatGen version 1.0.0]] [[BamUtil: validate|validate]], [[BamUtil: convert|convert]], [[BamUtil: dumpHeader|dumpHeader]], [[BamUtil: splitChromosome|splitChromosome]], [[BamUtil: writeRegion|writeRegion]], [[BamUtil: dumpRefInfo|dumpRefInfo]], [[BamUtil: dumpIndex|dumpIndex]], [[BamUtil: readIndexedBam|readIndexedBam]], [[BamUtil: filter|filter]], [[BamUtil: readReference|readReference]], [[BamUtil: revert|revert]], [[BamUtil: diff|diff]], [[BamUtil: squeeze|squeeze]], [[BamUtil: findCigars|findCigars]], [[BamUtil: stats|stats]]&lt;br /&gt;
&lt;br /&gt;
=== Release of just BamUtil (does not include libStatGen) ===&lt;br /&gt;
&lt;br /&gt;
To install an official release, unpack the downloaded file (tar xvf), cd into the bamUtil_x.x.x directory and type make all.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;BamUtil.1.0.14 Release Notes&#039;&#039;&#039;&lt;br /&gt;
* BamUtil Version 1.0.14 - Released 7/8/2015&lt;br /&gt;
** https://github.com/statgen/bamUtil/archive/v1.0.14.tar.gz&lt;br /&gt;
** Requires, but does not include: [[LibStatGen Download#Official Releases|libStatGen version 1.0.14]]&lt;br /&gt;
** Update [[BamUtil: trimBam|trimBam]]&lt;br /&gt;
*** Add option to soft clip (-c) instead of trimming&lt;br /&gt;
** Update [[BamUtil: clipOverlap|clipOverlap]]&lt;br /&gt;
*** Add option to mark reads as unmapped if they are entirely clipped&lt;br /&gt;
** Update to [[BamUtil: bam2FastQ|bam2FastQ]]&lt;br /&gt;
*** Add option to gzip the output files&lt;br /&gt;
*** Add option to split Read Groups into separate fastq files&lt;br /&gt;
*** Add option to get the quality from a tag&lt;br /&gt;
** Update [[BamUtil: recab|recab]]&lt;br /&gt;
*** Update to ignore ref &#039;N&#039; when building the recalibration table&lt;br /&gt;
*** Add ability to bin&lt;br /&gt;
** Add Dedup_LowMem tool&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Older Releases&#039;&#039;&#039;&lt;br /&gt;
* BamUtil Version 1.0.13 - Released 2/20/2015&lt;br /&gt;
** https://github.com/statgen/bamUtil/archive/v1.0.13.tar.gz&lt;br /&gt;
** Requires, but does not include: [[LibStatGen Download#Official Releases|libStatGen version 1.0.13]]&lt;br /&gt;
** Makefile Updates&lt;br /&gt;
*** Improve logic to determine actual path for the library&lt;br /&gt;
*** Update to append to USER_COMPILE_VARS even if specified on the command line&lt;br /&gt;
** Update [[BamUtil: writeRegion|writeRegion]]&lt;br /&gt;
*** Add option to specify readnames to keep in a file&lt;br /&gt;
*** Fixed bug that if a read overlapped 2 BED positions, it was printed twice&lt;br /&gt;
** Update to [[BamUtil: bam2FastQ|bam2FastQ]]&lt;br /&gt;
*** Update to skip non-primary reads&lt;br /&gt;
** Update to [[BamUtil: polishBam|polishBam]]&lt;br /&gt;
*** Update to handle &#039;\t&#039; string inputs and to add CO option&lt;br /&gt;
*** Fix MD5sum calculation to convert fasta to uppercase prior to calculating&lt;br /&gt;
&lt;br /&gt;
* [[Media:BamUtil.1.0.12.tgz|BamUtil.1.0.12.tgz‎]] - Released 5/14/2014&lt;br /&gt;
** Requires, but does not include: [[LibStatGen Download#Official Releases|libStatGen version 1.0.12]]&lt;br /&gt;
** Update [[BamUtil: mergeBam|mergeBam]]&lt;br /&gt;
*** Add a regions option&lt;br /&gt;
** Update to [[BamUtil: squeeze|squeeze]], [[BamUtil: revert|revert]], [[BamUtil: diff|diff]]&lt;br /&gt;
*** Also accept &#039;,&#039; instead of just &#039;;&#039; as the delimiter in the input tags string.&lt;br /&gt;
&lt;br /&gt;
* [[Media:BamUtil.1.0.11.tgz|BamUtil.1.0.11.tgz‎]] - Released 2/28/2014&lt;br /&gt;
** Requires, but does not include: [[LibStatGen Download#Official Releases|libStatGen version 1.0.11]]&lt;br /&gt;
*** Adds support for &#039;B&#039; &amp;amp; &#039;f&#039; tags that did not work properly before.&lt;br /&gt;
** Update [[BamUtil: splitBam|splitBam]] &amp;amp; [[BamUtil: polishBam|polishBam]]&lt;br /&gt;
*** Update to work properly if log &amp;amp; output file are not specified (no longer creates &#039;.log&#039;)&lt;br /&gt;
** Update Main dummy/example tool to indicate the correct tool&lt;br /&gt;
** Update to [[BamUtil: bam2FastQ|bam2FastQ]], [[BamUtil: clipOverlap|clipOverlap]], [[BamUtil: filter|filter]], [[BamUtil: mergeBam|mergeBam]], [[BamUtil: splitBam|splitBam]], [[BamUtil: squeeze|squeeze]], [[BamUtil: stats|stats]]&lt;br /&gt;
*** Cleanup usage/parameter descriptions&lt;br /&gt;
** Update [[BamUtil: revert|revert]]&lt;br /&gt;
*** Update compatibility with libStatGen due to &#039;B&#039; &amp;amp; &#039;f&#039; tag handling updates&lt;br /&gt;
** Add tests for &#039;B&#039; &amp;amp; &#039;f&#039; tags&lt;br /&gt;
&lt;br /&gt;
* [[Media:BamUtil.1.0.10.tar.gz|BamUtil.1.0.10.tar.gz‎]] - Released 1/2/2014&lt;br /&gt;
** Requires, but does not include: [[LibStatGen Download#Official Releases|libStatGen version 1.0.10]]&lt;br /&gt;
** All&lt;br /&gt;
*** Add PhoneHome/version checking&lt;br /&gt;
*** Make sub-program names case independent&lt;br /&gt;
*** Fix Logger.cpp compiler warning&lt;br /&gt;
** Adds: [[BamUtil: explainFlags|explainFlags]] - describes the SAM/BAM flags based on the flag value&lt;br /&gt;
** Update to [[BamUtil: stats|stats]]&lt;br /&gt;
*** Fix Stats to not try to not try to process a record after it is out of the loop (it would already have been processed or is invalid)&lt;br /&gt;
** Update to [[BamUtil: splitBam|splitBam]]&lt;br /&gt;
*** fix description of --noeof option&lt;br /&gt;
** Update to [[BamUtil: writeRegion|writeRegion]]&lt;br /&gt;
*** add exclude/required flags&lt;br /&gt;
** Update to [[BamUtil: dedup|dedup]] &amp;amp; [[BamUtil: recab|recab]]&lt;br /&gt;
*** Ignore secondary reads for dedup and making the recalibration table.&lt;br /&gt;
*** skip QC Failures&lt;br /&gt;
*** add excludeFlags parameters&lt;br /&gt;
** Update to [[BamUtil: clipOverlap|clipOverlap]]&lt;br /&gt;
*** add exclude flags&lt;br /&gt;
*** fix bug for readName sorted when a read is filtered due to flags&lt;br /&gt;
*** add sorting validation&lt;br /&gt;
** Update to [[BamUtil: bam2FastQ|bam2FastQ]]&lt;br /&gt;
*** add --merge option to generate interleaved files.&lt;br /&gt;
*** update to open the input file before opening the output files, so if there is an error, the outputs aren&#039;t opened&lt;br /&gt;
** Update to [[BamUtil: mergeBam|mergeBam]]&lt;br /&gt;
*** add option to ignore the RG PI field when checking headers&lt;br /&gt;
*** add more informative header merge error messages&lt;br /&gt;
&lt;br /&gt;
* [[Media:BamUtil.1.0.9.tgz|BamUtil.1.0.9.tgz‎]] - Released 7/7/2013&lt;br /&gt;
** Requires, but does not include: [[LibStatGen Download#Official Releases|libStatGen version 1.0.9]] (version 1.0.7 should also work)&lt;br /&gt;
** Update to [[BamUtil: mergeBam|mergeBam]]&lt;br /&gt;
*** Update to ignore PG lines with duplicate IDs&lt;br /&gt;
*** Update to accept merges of matching RG lines&lt;br /&gt;
*** Update to log to stderr if no log/out file is specified&lt;br /&gt;
&lt;br /&gt;
*[[Media:BamUtil.1.0.7.tgz|BamUtil.1.0.7.tgz‎]] - Released 1/29/2013&lt;br /&gt;
** Requires, but does not include: [[LibStatGen Download#Official Releases|libStatGen version 1.0.7]] or above&lt;br /&gt;
** Update to fix some compile issues on ubuntu 12.10&lt;br /&gt;
** Update use of SamRecord::getStringTag to expect the return of a const string pointer due to libStatGen v1.0.7 updates&lt;br /&gt;
** Update SamReferenceInfo usage due to libStatGen v1.0.7 updates&lt;br /&gt;
** Update to [[BamUtil: diff|diff]]&lt;br /&gt;
***   Fix DIFF to test and properly handle running out of available records.  Previously no message was printed when this happened and there was a bug for which file it freed&lt;br /&gt;
** Update to [[BamUtil: clipOverlap|clipOverlap]]&lt;br /&gt;
*** Update to facilitate adding other overlap handling functions&lt;br /&gt;
** Update to [[BamUtil: mergeBam|mergeBam]] (formerly RGMergeBam)&lt;br /&gt;
*** Rename RGMergeBam to MergeBam&lt;br /&gt;
*** Update to handle files that already have an RG&lt;br /&gt;
*[[Media:BamUtil.1.0.6.tgz|BamUtil.1.0.6.tgz‎]] - Released 11/14/2012&lt;br /&gt;
** Update to [[BamUtil: trimBam|trimBam]]&lt;br /&gt;
*** Update to allow trimming a different number of bases from each end of the read&lt;br /&gt;
*[[Media:BamUtil.1.0.5.tgz|BamUtil.1.0.5.tgz‎]] - Released 10/24/2012&lt;br /&gt;
** Update to [[BamUtil: dedup|dedup]]&lt;br /&gt;
*** Update logic for which pair to keep if they have the same quality&lt;br /&gt;
** Update to [[BamUtil: polishBam|polishBam]]&lt;br /&gt;
*** Update to print the number of successful header additions&lt;br /&gt;
** Update to [[BamUtil: recab|recab]]&lt;br /&gt;
*** Update to print the number of base skipped due to the base quality&lt;br /&gt;
** General Updates&lt;br /&gt;
*** Update to add compile option to compile without C++0x/C++11&lt;br /&gt;
*BamUtil.1.0.4.tgz‎ - Released skipped&lt;br /&gt;
*[[Media:BamUtil.1.0.3.tgz|BamUtil.1.0.3.tgz‎]] - Released 09/19/2012&lt;br /&gt;
** Adds: [[BamUtil: dedup|dedup]] [[BamUtil: recab|recab]]&lt;br /&gt;
** General Updates&lt;br /&gt;
*** Update Logger to write to stderr if output is stdout&lt;br /&gt;
** Update to [[BamUtil: stats|stats]]&lt;br /&gt;
*** Add required/exclude flags&lt;br /&gt;
*** Exclude Clips if excluding umapped&lt;br /&gt;
*** Add --withinRegion flag&lt;br /&gt;
*** Update phred/qual counts to be uint64_t instead of int to avoid overflow&lt;br /&gt;
** Update to [[BamUtil: validate|validate]]&lt;br /&gt;
*** Detect header failures&lt;br /&gt;
** Update to [[BamUtil: diff|diff]]&lt;br /&gt;
*** Update to specify chromosome/pos in ZP as a string rather than int so both can be shown&lt;br /&gt;
** Update to [[BamUtil: readReference|readReference]]&lt;br /&gt;
*** Output error message if the reference name is not found&lt;br /&gt;
** Update to [[BamUtil: splitChromosome|splitChromosome]]&lt;br /&gt;
*** Update to actually split the chromosomes and not just hard coded to output chromosomes ids 0-22&lt;br /&gt;
** Update Makefile to have cloneLib for cloning libStatGen&lt;br /&gt;
*[[Media:BamUtil.1.0.2.tgz|BamUtil.1.0.2.tgz‎]] - Released 05/16/2012&lt;br /&gt;
** Adds: [[BamUtil: bam2FastQ|bam2FastQ]]&lt;br /&gt;
*[[Media:BamUtil.1.0.1.tgz|BamUtil.1.0.1.tgz‎]] - Released 05/04/2012&lt;br /&gt;
** Adds: [[BamUtil: splitBam|splitBam]], [[BamUtil: clipOverlap|clipOverlap]],  [[BamUtil: trimBam|trimBam]], [[BamUtil: polishBam|polishBam]], [[BamUtil: rgMergeBam|rgMergeBam]], [[BamUtil: gapInfo|gapInfo]]&lt;br /&gt;
** Adds additional functionality to [[BamUtil: stats|stats]]&lt;br /&gt;
** Adds leftShifting to [[BamUtil: writeRegion|writeRegion]] and [[BamUtil: convert|convert]]&lt;br /&gt;
** Adds more diff fields to [[BamUtil: diff|diff]]&lt;br /&gt;
*[[Media:BamUtil.1.0.0.tgz|BamUtil.1.0.0.tgz‎]] - Released 10/10/2011&lt;br /&gt;
**Initial release of just bamUtil.  It started from the tool found in the deprecated StatGen repository.&lt;br /&gt;
**Contains: [[BamUtil: validate|validate]], [[BamUtil: convert|convert]], [[BamUtil: dumpHeader|dumpHeader]], [[BamUtil: splitChromosome|splitChromosome]], [[BamUtil: writeRegion|writeRegion]], [[BamUtil: dumpRefInfo|dumpRefInfo]], [[BamUtil: dumpIndex|dumpIndex]], [[BamUtil: readIndexedBam|readIndexedBam]], [[BamUtil: filter|filter]], [[BamUtil: readReference|readReference]], [[BamUtil: revert|revert]], [[BamUtil: diff|diff]], [[BamUtil: squeeze|squeeze]], [[BamUtil: findCigars|findCigars]], [[BamUtil: stats|stats]]&lt;br /&gt;
&lt;br /&gt;
== Citation ==&lt;br /&gt;
If you use BamUtil, please cite our publication on GotCloud which includes BamUtil: &lt;br /&gt;
[http://genome.cshlp.org/content/early/2015/04/14/gr.176552.114.abstract Jun, Goo, et al. &amp;quot;An efficient and scalable analysis framework for variant extraction and refinement from population scale DNA sequence data.&amp;quot; Genome research (2015): gr-176552.]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Programs =&lt;br /&gt;
&lt;br /&gt;
The software reads the beginning of an input file to determine if it is SAM/BAM.  To determine the format (SAM/BAM) of the output file, the software checks the output file&#039;s extension.  If the extension is &amp;quot;.bam&amp;quot; it writes a BAM file, otherwise it writes a SAM file.&lt;br /&gt;
&lt;br /&gt;
{{BamUtilPrograms}}&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=15071</id>
		<title>EPACTS</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=15071"/>
		<updated>2019-02-19T12:03:06Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Output Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;EPACTS&#039;&#039;&#039; (Efficient and Parallelizable Association Container Toolbox) is a versatile software pipeline to perform various statistical tests for identifying genome-wide association from sequence data through a user-friendly interface, both to scientific analysts and to method developers.&lt;br /&gt;
&lt;br /&gt;
== Join in EPACTS mailing list ==&lt;br /&gt;
&lt;br /&gt;
Please join in the [http://groups.google.com/group/epacts EPACTS Google Group] to ask / discuss / comment about EPACTS.&lt;br /&gt;
&lt;br /&gt;
== Lastest ChangeLog ==&lt;br /&gt;
* Dec 15th, 2016 : EPACTS v3.3.0 release (github)&lt;br /&gt;
** Moved the repository into github&lt;br /&gt;
** Some major fixes in handling large sample size (&amp;gt;18,000)&lt;br /&gt;
** Other minor bug fixes &lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs (more comprehensive fix is still pending)&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
See [[#Full ChangeLog]] for full details&lt;br /&gt;
&lt;br /&gt;
== Key Features ==&lt;br /&gt;
&lt;br /&gt;
EPACTS currently provides the following set of key features&lt;br /&gt;
* Robust support for widely used format of sequence-based genotypes (VCF) and phenotypes with pedigree (PED)&lt;br /&gt;
** Efficient library for accessing VCF file to reduce computational burden to analyze large-scale sequencing data&lt;br /&gt;
** Support selecting markers by arbitrary combination of substring matching. &lt;br /&gt;
** Support for using genotype dosages instead of hard genotype calls&lt;br /&gt;
** Utilize PED format to perform test across multiple traits.&lt;br /&gt;
* Supports a large number of widely used statistical tests for single variant association and burden tests.&lt;br /&gt;
** See the &amp;quot;Currently Supported Statistical Tests&amp;quot; section below for more information&lt;br /&gt;
* Easy to Highly Parallelize Jobs&lt;br /&gt;
** Makefile-based partition into and ligation of multiple subtasks&lt;br /&gt;
** Parallel run of job is simply adding one parameter when running EPACTS &lt;br /&gt;
* Integrative and versatile framework that allows easy addition of additional statistical test&lt;br /&gt;
** Core input/output routines are implemented in C++&lt;br /&gt;
** Most statistical tests (except for EMMAX) are implemented in R&lt;br /&gt;
** Adding a simple R function to implement additional statistical test (See [[#Implementing Additional Statistical Tests]] for details)&lt;br /&gt;
* Useful utilities for post-association-analysis tasks&lt;br /&gt;
** Automatic functional annotation of associated variants&lt;br /&gt;
** Automatic generation of QQ and Manhattan Plot&lt;br /&gt;
** (TBA) Zoom plot for the significant associations&lt;br /&gt;
&lt;br /&gt;
== Obtaining EPACTS ==&lt;br /&gt;
&lt;br /&gt;
* The official release of EPACTS software is available at https://github.com/statgen/EPACTS&lt;br /&gt;
** From the CSG cluster, it is available at /net/fantasia/home/bin/epacts/&lt;br /&gt;
* Note that R (version 2.10 or higher) and gnuplot (version 4.2 or higher) must be installed in order to run EPACTS correctly.&lt;br /&gt;
&lt;br /&gt;
== Currently Supported Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
EPACTS supports the following sets of widely used statistical tests for single variant tests and burden tests&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.wald &lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logisitic Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (simply used glm in R)&lt;br /&gt;
|-&lt;br /&gt;
| b.score&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Logistic Score Test &amp;lt;br&amp;gt; (from Lin DY and Tang ZZ, AJHG 2011 89:354-67)&lt;br /&gt;
| Clement Ma &amp;amp; Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.firth&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Firth Bias-Corrected Logistic Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.spa2&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; &lt;br /&gt;
| Moderate&lt;br /&gt;
| Saddlepoint Approximation Method&lt;br /&gt;
| Shawn Lee &amp;amp; Rounak Dey&lt;br /&gt;
|-&lt;br /&gt;
| b.lrt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.glrt&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Fast&lt;br /&gt;
| Genotype Likelihood Ratio Test &amp;lt;br&amp;gt; (use GL or PL field in VCF to perform case-control test)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.lm&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Linear Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (as implemented in lm in R)&lt;br /&gt;
|-&lt;br /&gt;
| q.linear&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Linear Wald Test&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.emmax&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| EMMAX &amp;lt;br&amp;gt; ( Kang et al (2010) Nat Genet 42:348-54 )&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.collapse&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and 0/1 collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.madsen&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Slow&lt;br /&gt;
| Wilcoxon Rank Sum Test between binary phenotypes and weighted rare variant scores (slightly different version from the published method - it uses pooled allele frequency across cases and controls for weighting each variant)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.wcnt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and weighted rare variant scores&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression of phenotypes on binary collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression of phenotypes on collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| skat&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT-O Test by Lee et al, Biostatistics (2012)&lt;br /&gt;
| Seunggeun Lee &amp;lt;br&amp;gt; (adaptive by Xueling Sim and Hyun Min Kang)&lt;br /&gt;
|-&lt;br /&gt;
| VT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed out first)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable Threshold Test &amp;lt;br&amp;gt; with adaptive permutation &amp;lt;br&amp;gt; Price et al, AJHG (2010) 86:832-8&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxCMC&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Collapsing burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxVT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable-threshold burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| mmskat&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT test using EMMAX&lt;br /&gt;
| Seunggeun Lee &amp;amp; Hyun Min Kang&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Installation Details  ==&lt;br /&gt;
&lt;br /&gt;
If you want to use EPACTS in an Ubuntu platform, following the step below &lt;br /&gt;
&lt;br /&gt;
 $ git clone https://github.com/statgen/EPACTS.git&lt;br /&gt;
 $ cd EPACTS&lt;br /&gt;
 $ ./configure --prefix [/path/to/install]&lt;br /&gt;
 $ make&lt;br /&gt;
 $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Important Note: &#039;&#039;&#039;make sure to specify --prefix=/path/to/install&#039;&#039;&#039; to avoid installing to the default path /usr/local/, which you may not have the permission. /home/your_userid/epacts might be a good one, if you are not sure where to install)&lt;br /&gt;
  &lt;br /&gt;
* Now ${EPACTS_DIR} represents the &#039;/path/to/install&#039; directory&lt;br /&gt;
&lt;br /&gt;
* Download the reference FASTA files from 1000 Genomes FTP automatically by running the following commands&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/epacts download&lt;br /&gt;
&lt;br /&gt;
 (For advanced users, to save time for downloading the FASTA files (~900MB), you may copy a local copy of GRCh37 FASTA file and the index file to ${EPACTS_DIR}/share/EPACTS/)&lt;br /&gt;
&lt;br /&gt;
*Perform a test run by running the following command&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
&lt;br /&gt;
In order to use EPACTS in the CSG cluster, you do not need to install them. You can directly use or make a copy of the in-house release version at &lt;br /&gt;
&lt;br /&gt;
 /net/fantasia/home/hmkang/tools/epacts-3.3.0/bin/epacts/&lt;br /&gt;
&lt;br /&gt;
* If you want to access previous versions, visit http://csg-old.sph.umich.edu/kang/epacts/download&lt;br /&gt;
&lt;br /&gt;
== Getting Started With Examples ==&lt;br /&gt;
If you are using EPACTS from the CSG cluster, please set the following environment variable&lt;br /&gt;
 EPACTS_DIR=/net/fantasia/home/hmkang/tools/epacts-3.3.0/bin/epacts (in bash)&lt;br /&gt;
 setenv EPACTS_DIR /net/fantasia/home/hmkang/tools/epacts-3.3.0/bin/epacts (in csh)&lt;br /&gt;
&lt;br /&gt;
If you downloaded EPACTS binary and please set EPACTS_DIR to the full path of the downloaded and uncompressed directory.&lt;br /&gt;
&lt;br /&gt;
=== All-in-one example ===&lt;br /&gt;
&lt;br /&gt;
To get started with EPACTS, run the following command will perform an example run&lt;br /&gt;
 ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
 &lt;br /&gt;
You will find a series of lines in test_run_epacts.sh script commented out for each possible test. &lt;br /&gt;
&lt;br /&gt;
The example phenotype (PED format) and genotype (VCF format) can be found at&lt;br /&gt;
 ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Test ===&lt;br /&gt;
&lt;br /&gt;
Or You can run EPACTS command yourself by running&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
   --vcf  ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
   --ped  ${EPACTS_DIR}/data/1000G_dummy_pheno.ped  \&lt;br /&gt;
   --min-maf 0.001 --chr 20 --pheno DISEASE --cov AGE --cov SEX --test b.score --anno \ &lt;br /&gt;
   --out out/test --run 2&lt;br /&gt;
&lt;br /&gt;
The command above will perform single variant association test using a dummy case-control phenotype file and a subset of 1000 genomes exome VCF file (chr20) using score test statistic for all variants over 1% of higher MAF using 2 parallel runs.&lt;br /&gt;
&lt;br /&gt;
You will see the 4 output files as the main outcome of the analysis&lt;br /&gt;
&lt;br /&gt;
==== Output Text of All Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The filename is out/test.single.b.score.epacts.gz and the contents will look like&lt;br /&gt;
 $ zcat out/test.single.b.score.epacts.gz | head&lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	68303	68303	20:68303_A/G_Upstream:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68319	68319	20:68319_C/A_Upstream:DEFB125	266	1.4467e-36	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68396	68396	20:68396_C/T_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76635	76635	20:76635_A/T_Intron:DEFB125	266	1.534e-37	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76689	76689	20:76689_T/C_Synonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76690	76690	20:76690_T/C_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76700	76700	20:76700_G/A_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76726	76726	20:76726_C/G_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76771	76771	20:76771_C/T_Nonsynonymous:DEFB125	266	3	1	0.0056391	0.68484	0.40587	145	121	0.013793	0.0082645&lt;br /&gt;
&lt;br /&gt;
==== Output Text of Top Associations ====&lt;br /&gt;
&lt;br /&gt;
Same type of file but containing top 5,000 association will be stored at out/test.epacts.top5000&lt;br /&gt;
&lt;br /&gt;
 $ head out/test.single.b.score.epacts.top5000 &lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	1610894	1610894	20:1610894_G/A_Synonymous:SIRPG	266	138.64	1	0.26061	6.9939e-05	3.9765	145	121	0.65177	0.36476&lt;br /&gt;
 20	4162411	4162411	20:4162411_T/C_Intron:SMOX	266	204	1	0.38346	0.00055583	-3.4523	145	121	0.62759	0.93388&lt;br /&gt;
 20	34061918	34061918	20:34061918_T/C_Intron:CEP250	266	41.815	1	0.0786	0.00095471	3.3035	145	121	0.22543	0.075436&lt;br /&gt;
 20	4155948	4155948	20:4155948_G/A_Intron:SMOX	266	215	1	0.40414	0.0020792	-3.0787	145	121	0.68276	0.95868&lt;br /&gt;
 20	4680251	4680251	20:4680251_A/G_Nonsynonymous:PRNP	266	186	1	0.34962	0.0025962	3.0119	145	121	0.8069	0.57025&lt;br /&gt;
 20	36668874	36668874	20:36668874_G/A_Synonymous:RPRD1B	266	96	1	0.18045	0.003031	2.9646	145	121	0.44828	0.2562&lt;br /&gt;
 20	36641871	36641871	20:36641871_G/A_Synonymous:TTI1	266	10	1	0.018797	0.004308	-2.8547	145	121	0.0068966	0.07438&lt;br /&gt;
 20	1616892	1616892	20:1616892_A/G_Synonymous:SIRPG	266	144	1	0.27068	0.0051239	2.7991	145	121	0.63449	0.42975&lt;br /&gt;
 20	25038372	25038372	20:25038372_G/A_Intron:ACSS1	266	103.3	1	0.19418	0.005748	2.7618	145	121	0.47201	0.28813&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;AC&#039;&#039;&#039; : Total Non-reference Allele Count&lt;br /&gt;
* &#039;&#039;&#039;CALLRATE&#039;&#039;&#039; : Fraction of non-missing genotypes.&lt;br /&gt;
* &#039;&#039;&#039;MAF&#039;&#039;&#039; : Minor allele frequencies&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of single variant test&lt;br /&gt;
* &#039;&#039;&#039;AF.CASE&#039;&#039;&#039; : Non-reference allele frequencies for cases&lt;br /&gt;
* &#039;&#039;&#039;AF.CTRL&#039;&#039;&#039; : Non-reference allele frequencies for controls&lt;br /&gt;
&lt;br /&gt;
==== Q-Q plot of test statistics (stratified by MAF) ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.qq.pdf will be generated as shown below&lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_qq.png]]&lt;br /&gt;
&lt;br /&gt;
==== Manhattan Plot of Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.mh.pdf will be generated for chr20 only. &lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_mh.png]]&lt;br /&gt;
&lt;br /&gt;
An example Genome-wide manhattan plot (from a genome-wide run) will look like below&lt;br /&gt;
&lt;br /&gt;
[[File:tes_b_score_epacts_mh_gw.png]]&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise burden test ===&lt;br /&gt;
&lt;br /&gt;
Gene-wise or group-wise burden test requires two steps. First, &#039;group&#039; file containing the list of &lt;br /&gt;
markers per group needs to be generated. Second, group-wise burden test needs to be run&lt;br /&gt;
&lt;br /&gt;
==== Creating marker group file ====&lt;br /&gt;
&lt;br /&gt;
The marker group file has the following format&lt;br /&gt;
&lt;br /&gt;
 [GROUP_ID]  [MARKER_ID_1]   [MARKER_ID_2]  .... [MARKER_ID_N]&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
* [GROUP_ID] is a string representing the group (e.g. gene name)&lt;br /&gt;
* [MARKER_ID_K] is a marker key as a format of [CHROM]:[POS]_[REF]/[ALT] (NOTE THAT THIS IS DIFFERENT FROM TYPICAL VCF MARKER ID field)&lt;br /&gt;
&lt;br /&gt;
Note that [MARKER_ID_K] has to be sorted by increasing order of genomic coordinate&lt;br /&gt;
&lt;br /&gt;
In order to create gene-level group file from typically formatted VCF file, one may use the following utility &lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --nonsyn&lt;br /&gt;
&lt;br /&gt;
The above command create a file [output-group-file] containing a list of missense and nonsense variants per each gene. To incorporate different types of functional annotations, use --type option as follows&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --type [function_type_1] --type [function_type_2] ...&lt;br /&gt;
&lt;br /&gt;
Type &#039;epacts makegroup -man&#039; for the detailed documentation&lt;br /&gt;
&lt;br /&gt;
==== Annotating VCF file using EPACTS ====&lt;br /&gt;
&lt;br /&gt;
If the VCF is not annotated, &#039;epacts makegroup&#039; cannot be used. In order to annotate VCF, one can use the example VCF using ANNOVAR as follows:&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts anno \&lt;br /&gt;
    --in ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
    --out ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
The epacts anno script will add &amp;quot;ANNO=[function]:[genename]&amp;quot; entry into the INFO field based on gencodeV7 (default) or refGene database.&lt;br /&gt;
&lt;br /&gt;
It is important to check whether the VCF file is already annotated or not in order to avoid no or redundant annotation.&lt;br /&gt;
&lt;br /&gt;
==== Running Groupwise Test ====&lt;br /&gt;
&lt;br /&gt;
To perform a groupwise burden test on the example VCF (annotated as above), run the following command&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --vcf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz \&lt;br /&gt;
   --groupf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.grp --out out/test.gene.skat \&lt;br /&gt;
   --ped ${EPACTS_DIR}/data/1000G_dummy_pheno.ped --maxAF 0.05 \&lt;br /&gt;
   --chr 20 --pheno QT --cov AGE --cov SEX --test skat --skat-o --run 2&lt;br /&gt;
&lt;br /&gt;
==== Example Output ====&lt;br /&gt;
 $ head out/test.gene.skat.epacts.top5000&lt;br /&gt;
 #CHROM BEGIN   END     MARKER_ID       NS      FRAC_WITH_RARE     NUM_ALL_VARS    NUM_PASS_VARS   NUM_SING_VARS   PVALUE  STATRHO&lt;br /&gt;
 20     62607037        62608720        20:62607037-62608720_SAMD10     266     0.14662 9       5       1       0.0020064       1&lt;br /&gt;
 20     2816211 2820493 20:2816211-2820493_FAM113A      266     0.011278        12      2       1       0.0032542       0&lt;br /&gt;
 20     47245987        47361692        20:47245987-47361692_PREX1      266     0.1391  54      9       6       0.0054849       1&lt;br /&gt;
 20     34761734        34810279        20:34761734-34810279_EPB41L1    266     0.071429        14      7       5       0.0068492       0.2&lt;br /&gt;
 20     61340671        61391602        20:61340671-61391602_NTSR1      266     0.11278 24      9       3       0.011063        1&lt;br /&gt;
 20     48561952        48568644        20:48561952-48568644_RNF114     266     0.011278        4       2       1       0.015175        0.2&lt;br /&gt;
 20     60962895        60963559        20:60962895-60963559_RPS21      266     0.06015 6       3       2       0.016409        0&lt;br /&gt;
 20     55904961        55917801        20:55904961-55917801_SPO11      266     0.011278        11      3       3       0.018031        0&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;FRAC_WITH_RARE&#039;&#039;&#039; : Fraction of individual carrying rare variants below --max-maf (default : 0.05) threshold.&lt;br /&gt;
* &#039;&#039;&#039;NUM_ALL_VARS&#039;&#039;&#039; : Number of all variants defining the group.&lt;br /&gt;
* &#039;&#039;&#039;NUM_PASS_VARS&#039;&#039;&#039; : Number of variants passing the --min-maf, --min-mac, --max-maf, --min-callrate thresholds&lt;br /&gt;
* &#039;&#039;&#039;NUM_SING_VARS&#039;&#039;&#039; : Number of singletons among variants in NUM_PASS_VARS&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of burden tests&lt;br /&gt;
* Other columns are test specific auxiliary columns. For example, in the VT test, the optimal MAF threshold is recorded as an auxiliary output column.&lt;br /&gt;
&lt;br /&gt;
=== Specialized Instruction for EMMAX tests ===&lt;br /&gt;
&lt;br /&gt;
EMMAX (Efficient Mixed Model Association eXpedited - Kang et al (2010) Nat Genet 42:348-54) is an efficient implementation of mixed model association accounting for sample structure including population structure and hidden relatedness. Currently EPACTS supports EMMAX association mapping in single variant test and CMC-like burden tests. &lt;br /&gt;
&lt;br /&gt;
Because EMMAX is based on linear model, the method fits better to quantiative traits than binary traits. However, p-values for binary traits are expected to be valid in the spirit of Armitage trend test, although the estimated effect size may not be precise.&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
==== Single Variant EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : From VCF, we recommend to set a MAF (e.g. 0.01) and call rate (e.g. 0.95) threshold to select high-quality markers to generate kinship matrix as follows.&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-kin \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped (Optional)] --min-maf 0.01 --minCallRate 0.95 \&lt;br /&gt;
  --sepchr (if VCF is separated by chromosome) --out [outprefix.kinf] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
If you provide [input.ped] file, then it will calculate the subset the individuals contained in the PED file. &lt;br /&gt;
&lt;br /&gt;
The procedure above will create a file [outprefix.kinf] after splitting and merging the genomes into multiple pieces. If only a certain subset of SNPs needs to be considered due to target regions, LD-pruning, or any other reasons, a VCF containing the subset of markers must be created beforehand and should be used as input VCF file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Perform Single Variant Association&#039;&#039;&#039; : From VCF and PED, we recommend to use less stringent MAF threshold (e.g. 0.001) and call rate (e.g. 0.50) to perform single variant association&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --min-maf 0.001 --kin [outputprefix.kinf] \&lt;br /&gt;
  --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] --test q.emmax \&lt;br /&gt;
  --out [outprefix] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
The procedure above will perform single variant association analysis compatible to other types of single variant association analyses implemented in EPACTS&lt;br /&gt;
&lt;br /&gt;
==== Burden-style EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : See &#039;Creating Kinship Matrix&#039; section in [[#Single Variant EMMAX Association Analysis]]&lt;br /&gt;
* &#039;&#039;&#039;Create Marker Group&#039;&#039;&#039;&lt;br /&gt;
** By annotating the VCF and extracting missense and nonsense variants&lt;br /&gt;
*** [[#Annotating VCF file using ANNOVAR]] - This step will be required to create marker group file&lt;br /&gt;
*** [[#Creating marker group file]] - Assume that [group.grp] file is produced&lt;br /&gt;
** Or, by creating your own marker group information&lt;br /&gt;
*** See [[#Creating marker group file]] for details&lt;br /&gt;
* Run CMC-style burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxCMC --out [outprefix] &lt;br /&gt;
* Run Variable Threshold burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxVT --out [outprefix]&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Own Input Data ==&lt;br /&gt;
&lt;br /&gt;
=== VCF file for Genotypes ===&lt;br /&gt;
&lt;br /&gt;
EPACTS support VCF files as input for association with the following requirement&lt;br /&gt;
* Input VCF file must be bgzipped and tabixed before running association to allow efficient random access of the file. Below is an example command to conver plain VCF into bgzipped and tabixed VCF&lt;br /&gt;
  bgzip input.vcf     ## this command will produce input.vcf.gz&lt;br /&gt;
  tabix -pvcf -f input.vcf.gz  ## this command will produce input.vcf.gz.tbi&lt;br /&gt;
* If the VCF file is separated by chromosome, the VCF file specified in the input argument must contain the string &amp;quot;chr1&amp;quot; in the chromosome 1 file, and corresponding chromosome name for other chromosomes. Thus, the files names should be like &amp;lt;code&amp;gt;[prefix]chr1[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chr2[suffix].vcf.gz&amp;lt;/code&amp;gt;, ..., &amp;lt;code&amp;gt;[prefix]chr22[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chrX[suffix].vcf.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Sample IDs in the VCF file must be consistent to those from PED file&lt;br /&gt;
* Currently EPACTS only support bi-allelic variants, but it handles SNPs, INDELs, snd SVs.&lt;br /&gt;
* Currently, EPACTS only support VCF aligned with NCBI build 37 coordinates&lt;br /&gt;
* An example VCF file from 1000 genome project is below. &lt;br /&gt;
 $ zcat example/1000G_integrated_phase1_chr20.vcf.gz | cut -f 1-10 | head -50 &lt;br /&gt;
 ##fileformat=VCFv4.1&lt;br /&gt;
 ##INFO=&amp;lt;ID=LCSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Low coverage VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=EXSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Exome VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=INDEL,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in INDEL VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SV,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in SV VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BAVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BRSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality estimate from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=LDAF,Number=1,Type=Float,Description=&amp;quot;MLE Allele Frequency Accounting for LD&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=RSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=ERATE,Number=1,Type=Float,Description=&amp;quot;Per-marker Mutation rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=THETA,Number=1,Type=Float,Description=&amp;quot;Per-marker Transition rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIEND,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around END for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIPOS,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around POS for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=END,Number=1,Type=Integer,Description=&amp;quot;End position of the variant described in this record&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMLEN,Number=.,Type=Integer,Description=&amp;quot;Length of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMSEQ,Number=.,Type=String,Description=&amp;quot;Sequence of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SOURCE,Number=.,Type=String,Description=&amp;quot;Source of deletion call&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVLEN,Number=1,Type=Integer,Description=&amp;quot;Difference in length between REF and ALT alleles&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVTYPE,Number=1,Type=String,Description=&amp;quot;Type of structural variant&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AC,Number=.,Type=Integer,Description=&amp;quot;Alternate Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AN,Number=1,Type=Integer,Description=&amp;quot;Total Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##ALT=&amp;lt;ID=DEL,Description=&amp;quot;Deletion&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GT,Number=1,Type=String,Description=&amp;quot;Genotype&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=DS,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GL,Number=.,Type=Float,Description=&amp;quot;Genotype Likelihoods&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=BD,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 #CHROM POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  HG00096&lt;br /&gt;
 20 60479   .   C   T   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.894;LDAF=0.0020;AVGPOST=0.9995;RSQ=0.8779;ERATE=0.0005;THETA=0.0008;AC=4;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.19,-0.46,-2.68:0.0022&lt;br /&gt;
 20 60522   .   T   TC  1588    PASS    INDEL;BAVGPOST=1.000;BRSQ=0.994;LDAF=0.0116;AVGPOST=0.9980;RSQ=0.9327;ERATE=0.0004;THETA=0.0167;AC=24;AN=2184   GT:DS:GL:BD 0|0:0.000:0.00,-0.90,-9.20:0&lt;br /&gt;
 20 60571   .   C   A   100 PASS    LCSNP;EXSNP;BAVGPOST=0.999;BRSQ=0.813;LDAF=0.0029;AVGPOST=0.9986;RSQ=0.8085;ERATE=0.0014;THETA=0.0014;AC=5;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.05,-0.96,-5.00:0.0008&lt;br /&gt;
 20 60795   .   G   C   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.930;LDAF=0.0006;AVGPOST=0.9996;RSQ=0.7205;ERATE=0.0003;THETA=0.0041;AC=1;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.03,-1.21,-5.00:0.0001&lt;br /&gt;
 20 60810   .   G   GA  127 PASS    INDEL;BAVGPOST=1.000;BRSQ=0.862;LDAF=0.0013;AVGPOST=0.9987;RSQ=0.5684;ERATE=0.0004;THETA=0.0061;AC=2;AN=2184    GT:DS:GL:BD 0|0:0.000:0.00,-1.80,-18.80:0&lt;br /&gt;
&lt;br /&gt;
=== PED file for Phenotypes and Covariates ===&lt;br /&gt;
&lt;br /&gt;
EPACTS accepts a PED format supported by MERLIN or PLINK software to represent phenotypes. For example, the example.ped file and example.dat file can represent the phenotypes and corresponding column name (from 6th column and after). &lt;br /&gt;
&lt;br /&gt;
 $ head example.ped&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
 $ cat example.dat&lt;br /&gt;
 A DISEASE&lt;br /&gt;
 T QT&lt;br /&gt;
 T AGE&lt;br /&gt;
&lt;br /&gt;
EPACTS also accept a PED format with header information. The above file can be combined into one file as follows&lt;br /&gt;
&lt;br /&gt;
 $ head data/1000G_dummy_pheno.ped&lt;br /&gt;
 #FAM_ID    IND_ID  FAT_ID  MOT_ID  SEX DISEASE QT  AGE&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
The column names can be used to identify the names of phenotypes and covariates in the analysis.&lt;br /&gt;
&lt;br /&gt;
== Frequently Asked Questions ==&lt;br /&gt;
=== Installation ===&lt;br /&gt;
# How should I install EPACTS? &lt;br /&gt;
#* See [[EPACTS#Installation_Details | Installation Details]]&lt;br /&gt;
# I am having the following error message &#039;&#039;&#039;configure: error: libR.{so,a} was not found. Please install it at http://www.r-project.org/ first&#039;&#039;&#039;. What do I have to do?&lt;br /&gt;
#* First, you need to find out where R was installed. Try to type &amp;quot;locate libR.so&amp;quot; and see if it returns anything&lt;br /&gt;
#* If &amp;quot;locate libR.so&amp;quot; returns you something, as explained [[EPACTS#Installation_Details | Installation Details]], try to add &amp;quot;LDFLAGS=-L/path/to/R/library&amp;quot; and rerun &#039;&#039;&#039;configure&#039;&#039;&#039; and &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
#* If you cannot find libR.so, you make have to recompile R with --enable-R-shlib option as described in http://cran.r-project.org/doc/manuals/R-admin.html#Installation&lt;br /&gt;
&lt;br /&gt;
=== Input Files ===&lt;br /&gt;
# What is VCF?&lt;br /&gt;
#* VCF refers to Variant Call Format&lt;br /&gt;
#* See [[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 1000 Genomes wiki page]] for the detailed description of VCF format&lt;br /&gt;
# Should input VCF be compressed into certain format?&lt;br /&gt;
#* Correct. EPACTS assumes that VCF file is bgzipped and tabixed already.&lt;br /&gt;
#* See [[#VCF file for Genotypes]] for details.&lt;br /&gt;
# What are the additional requirements for input VCF file?&lt;br /&gt;
#* Input VCF file used for association mapping must contain individual genotype information at 10-th or higher order columns.&lt;br /&gt;
#* GT field must be encoded as haploid or diploid&lt;br /&gt;
#* Bi-allelic SNPs only : Currently EPACTS may not handle multi-allelic SNPs correctly.&lt;br /&gt;
#* If non-GT field is used, the field is considered as dosage and should be a single numeric value.&lt;br /&gt;
# What are the acceptable input format to encode phenotypes and covariates?&lt;br /&gt;
#* See [[#PED file for Phenotypes and Covariates]] for the detailed information&lt;br /&gt;
# How should I encode binary phenotypes?&lt;br /&gt;
#* If you encode your phenotypes into two different numeric values (e.g. 0/1 or 1/2), EPACTS will automatically recognize them as binary phenotypes and encode them into 1/2 values. Higher value will be considered as cases for case-control association&lt;br /&gt;
# How should I encode missing genotypes?&lt;br /&gt;
#* The default code missing phenotypes in EPACTS are &#039;NA&#039;&lt;br /&gt;
#* One may use --missing option to specify different types of missing values&lt;br /&gt;
#* The encoding of missing genotypes follows the VCF specificiation&lt;br /&gt;
# How do I match the relationship between VCF and PED input files?&lt;br /&gt;
#* EPACTS will assume that the individual IDs in each VCF and PED file are unique, and they follow the saming convention. Thus, the individual IDs overlapping between VCF and PED files will be considered in the associations&lt;br /&gt;
# How the individuals with missing phenotypes are handled?&lt;br /&gt;
#* Currently, EPACTS will automatically remove the individuals without phenotypes or covariates. If one wants to use imputed covariates to increase sample size, the PED file must contain the imputed covariate values.&lt;br /&gt;
#* Markers with missing genotypes won&#039;t be discarded automatically. It can be explicitly discarded by --minCallRate option when performing association&lt;br /&gt;
&lt;br /&gt;
=== Output Files ===&lt;br /&gt;
# Which output files should I be looking at?&lt;br /&gt;
#* [[#Output Text of Top Associations]] is the key file to look at the individual top associations&lt;br /&gt;
#* [[#Q-Q plot of test statistics (stratified by MAF)]] will be important to see the global distribution of test statistics and examine if there are apparent inflation of test statistics&lt;br /&gt;
#* [[#Manhattan Plot of Test Statistics]] will inform us the genome-wide distribution of association signals&lt;br /&gt;
#* [[#Output Text of All Test Statistics]] will contain the full information of test results across all units tested&lt;br /&gt;
# The Q-Q and Manhattan plots cannot be found. Why?&lt;br /&gt;
#* It is probably because gnuplot 4.2 or higher is not installed in your system, or they are included but cannot be found in your ${PATH}. Please visit [[http://gnuplot.info/ GNUPLOT web page]] for installation.&lt;br /&gt;
# How can I read the EMMAX kinship file from produced from EPACTS?&lt;br /&gt;
# * You can run the following command to dump your kinship matrix into a human-readable text format.&lt;br /&gt;
 $(EPACTS_DIR)/bin/pEmmax kin-util --kinf [input.kinf] --outf [output.prefix] --dump&lt;br /&gt;
&lt;br /&gt;
=== More questions ===&lt;br /&gt;
# If you have more questions, please contact [[mailto:hmkang@umich.edu Hyun Min Kang]].&lt;br /&gt;
&lt;br /&gt;
== Detailed Options ==&lt;br /&gt;
&lt;br /&gt;
The detailed options can viewed by running the following commands&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts -man           (for overall structure) &lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts single -man    (for single variant test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts group -man     (for groupwise test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts anno -man      (for annotation)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts plot -man      (for QQ and Manhattan plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts zoom -man      (for zoom plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts meta -man      (for meta-analysis)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts make-group -man (for creating gene group)&lt;br /&gt;
&lt;br /&gt;
== Implementing Additional Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
In order to add additional statistical test to EPACTS, the following procedure are recommended&lt;br /&gt;
&lt;br /&gt;
# Create a file named &#039;single.[testname].R&#039; for single variant test or &#039;gene.[testname].R&#039; for gene-level test under ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
# Test your implementation using --test [testname] option to perform sanity check and debugging&lt;br /&gt;
# If you want to add your test in the official in-house version, please send your code to Hyun&lt;br /&gt;
&lt;br /&gt;
Below is an example of a single variant test implementation ( single.q.lm.R )&lt;br /&gt;
 ## Core functions of EPACTS to perform association&lt;br /&gt;
 &lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## SINGLE VARIANT TEST&lt;br /&gt;
 ## INPUT VARIABLES:&lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   NS       : number of called samples&lt;br /&gt;
 ##   AC       : allele count&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:nrow(NS) after AF/AC threshold&lt;br /&gt;
 ##   genos    : genotype matrix (after AF/AC threshold)&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional columns to add&lt;br /&gt;
 ##   cname    : column names for additional columns&lt;br /&gt;
 ##################################################################  &lt;br /&gt;
 &lt;br /&gt;
 ## single.lm() : Use built-in lm() function to perform association&lt;br /&gt;
 ## KEY FEATURES : SIMPLE, BUT MAY BE SLOW&lt;br /&gt;
 ##                GOOD SNIPPLET TO START A NEW FUNCTION&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, TSTAT&lt;br /&gt;
 ## MISSING VALUES : IGNORED&lt;br /&gt;
 single.q.lm &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;TSTAT&amp;quot;) # column names for additional variables in the EPACTS output&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   p &amp;lt;- rep(NA,m)&lt;br /&gt;
   add &amp;lt;- matrix(NA,m,3) ## BETA, SEBETA, TSTAT&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
    for(i in 1:m) {&lt;br /&gt;
      r &amp;lt;- summary(lm(pheno~genos[i,]+cov-1))$coefficients[1,]  # run simple linear regression&lt;br /&gt;
      p[i] &amp;lt;- r[4]   # store p-value to p[i]&lt;br /&gt;
      add[i,] &amp;lt;- r[1:3] # store additional variables to add[i,]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  return(list(p=p,add=add,cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
As described in the comment, you may assume that the following variables are available for use for testing association across m markers&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker&lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (m * 1 vector) : p-value matrix as output&lt;br /&gt;
* add (m * c matrix) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# AC : Non-ref allele count&lt;br /&gt;
# CALLRATE : Call rate = NS/n&lt;br /&gt;
# MAF : Minor allele frequency&lt;br /&gt;
# PVALUE : P-values&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
Below is an example of a gene-lvel variant test implementation ( single.q.lm.R )&lt;br /&gt;
&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## GENE-LEVEL BURDEN TEST&lt;br /&gt;
 ## INPUT VARIABLES: &lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   genos    : genotype matrix for each gene&lt;br /&gt;
 ##   NS       : number of called samples for each marker&lt;br /&gt;
 ##   AC       : allele count for each marker&lt;br /&gt;
 ##   MAC      : minor allele count for each marker&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:n after AF/AC threshold&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional column values&lt;br /&gt;
 ##   cname    : additional column names&lt;br /&gt;
 ##################################################################      &lt;br /&gt;
 &lt;br /&gt;
 ## gene.q.reverse() : Reverse logistic regression&lt;br /&gt;
 ## KEY FEATURES : 0/1 collapsing variable ~ rare variants&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE (GAUSSIAN)&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, ZSTAT&lt;br /&gt;
 ## MISSING VALUE : IMPUTED AS MAJOR ALLELES&lt;br /&gt;
 gene.q.reverse &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;ZSTAT&amp;quot;)&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
     g &amp;lt;- as.double(colSums(genos,na.rm=T) &amp;gt; 0)&lt;br /&gt;
     sg &amp;lt;- sum(g)&lt;br /&gt;
     if ( ( sg &amp;gt; 0 ) &amp;amp;&amp;amp; ( sg &amp;lt; n ) ) {&lt;br /&gt;
       r &amp;lt;- glm(g~pheno+cov-1,family=binomial)&lt;br /&gt;
        if ( ( r$converged ) &amp;amp;&amp;amp; ( ! r$boundary ) ) {&lt;br /&gt;
         return(list(p=summary(r)$coefficients[1,4],&lt;br /&gt;
                     add=summary(r)$coefficients[1,1:3],&lt;br /&gt;
                     cname=cname))&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   return(list(p=NA,add=rep(NA,3),cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Similar to gene-level test, you may assume the following variables exist for testing A SINGLE GENE. Note that M is the number of markers spanning the gene region&lt;br /&gt;
&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker &lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAC (M * 1 vector) : Minor allele count&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (scalar) : p-value matrix as output&lt;br /&gt;
* add (c * 1 vector) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# MAF_BURDEN : MAF of 0/1 collapsing variables (existence of rare variants)&lt;br /&gt;
# NUM_ALL_VARS : Number of all variants within the gene&lt;br /&gt;
# NUM_RARE_VARS : Number of rare variants below the max-MAF threshold&lt;br /&gt;
# NUM_SING_VARS : Number of singleton variants&lt;br /&gt;
# PVALUE : P-value from the test&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
== Full ChangeLog ==&lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs&lt;br /&gt;
** Some known bugs still exist &lt;br /&gt;
*** SKAT-O Lambda eigenvalue error. This happenes in a particular context but haven&#039;t nailed down a way to prevent it yet.&lt;br /&gt;
*** EMMAX has case and control frequency flipped.&lt;br /&gt;
* EMMAX test has a silly known bug with case / ctrl frequency is flipped&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
* February 28th, 2013 : EPACTS v3.2.0 release&lt;br /&gt;
** R package installation bug (for some users) was fixed&lt;br /&gt;
** A bug in the MAF error for high frequency variants (AF&amp;gt;0.25) was now fixed&lt;br /&gt;
** SKAT version is updated to 0.81&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
* December 4th, 2012 : EPACTS v3.1.0 release&lt;br /&gt;
** Removed dependency on libR.so&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** November 25th, 2012 : EPACTS v3.0.0 release&lt;br /&gt;
** Restructured with source code release (with autoconf / automake / libtools)&lt;br /&gt;
** Added zoom plot feature&lt;br /&gt;
** FRAC_BURDEN keyword was replace to FRAC_WITH_RARE for groupwise testing&lt;br /&gt;
* October 26th, 2012 : EPACTS v2.2.0-beta is released with the following updates&lt;br /&gt;
** Added --max-mac option&lt;br /&gt;
** Fixed Firth&#039;s bias-corrected test (by Clement Ma)&lt;br /&gt;
** Added more informative warning messages when index files do not exist&lt;br /&gt;
** Fixed the bug in the epacts-plot in plotting ties&lt;br /&gt;
** Fixed errors in the MAF estimates per case and control&lt;br /&gt;
** Fixed bug in --minRSQ option&lt;br /&gt;
* September 28, 2012 : EPACTS v2.11-beta is released with the following updates&lt;br /&gt;
** Counts and allele frequencies for case/control added for binary tests&lt;br /&gt;
** --max-maf parameter is added&lt;br /&gt;
** Fixed EMMAX error in MAF in the output&lt;br /&gt;
** More informative error messages &lt;br /&gt;
* September 27, 2012 : EPACTS v2.1-beta is released with the following updates&lt;br /&gt;
** EMMAX interface is changed. --kinOnly option is related with a new command &#039;&#039;&#039;make-kin&#039;&#039;&#039; &lt;br /&gt;
** SKAT-O is upgraded to version 0.77 with additional configurable parameter settings&lt;br /&gt;
** Some parameter names are renamed (e.g. --min-maf, --min-mac)&lt;br /&gt;
** Many minor bugs are fixed&lt;br /&gt;
* Jul 6, 2012 : EPACTS v2.01-beta is released with the following updates&lt;br /&gt;
** SKAT-O is upgraded to version 0.76&lt;br /&gt;
** Fixed minor bugs in option names (Thanks to Xueling Sim)&lt;br /&gt;
* Jul 3, 2012 : EPACTS v2.0-beta is released with the following updates&lt;br /&gt;
** Major restructuring of the software&lt;br /&gt;
** Annotation software is switched with built-in application&lt;br /&gt;
** Addition of SKAT-O and EMMAX burden test&lt;br /&gt;
** Minor bug fixes&lt;br /&gt;
* Apr 8, 2012 : EPACTS v1.2-alpha is released with the following updates, in addition to the following updates&lt;br /&gt;
** EMMAX bug in handling covariates was fixed&lt;br /&gt;
** Variable Threshold Test is added&lt;br /&gt;
** Variable Threshold Test with genomic score (e.g. GERP or PhyloP) is added.&lt;br /&gt;
* Apr 4, 2012 : EPACTS v1.1-alpha is released with the following updates, in addition to minor updates&lt;br /&gt;
** EMMAX burden test (Hyun Min Kang)&lt;br /&gt;
** Likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of Firth bias-corrected likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of EMMAX single variant test (Hyun Min Kang) &lt;br /&gt;
* Mar 29, 2012 : EPACTS v1.0-alpha is released&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Minimac_Diagnostics&amp;diff=14716</id>
		<title>Minimac Diagnostics</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Minimac_Diagnostics&amp;diff=14716"/>
		<updated>2017-06-08T15:35:20Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Estimated Imputation Accuracy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;[[minimac]]&#039;&#039;&#039; is a tool for imputation of missing genotypes into phased haplotypes. At the end of each run, [[minimac]] generates summaries of imputation quality and stores those in a &#039;&#039;.info&#039;&#039; file.&lt;br /&gt;
&lt;br /&gt;
== Basic Descriptors ==&lt;br /&gt;
&lt;br /&gt;
=== Marker and Allele Labels ===&lt;br /&gt;
&lt;br /&gt;
The first three columns in the &#039;&#039;.info&#039;&#039; file list marker name and alleles for each marker. Typically, the most common allele will be listed first, but this is not guaranteed.&lt;br /&gt;
&lt;br /&gt;
=== Estimated Allele Frequency ===&lt;br /&gt;
&lt;br /&gt;
The next column in the &#039;&#039;.info&#039;&#039; file lists the estimated frequency of allele 1 - this corresponds to the average number of imputed copies of allele 1 for each individual, divided by two.&lt;br /&gt;
&lt;br /&gt;
=== Estimated Imputation Accuracy (ImpRsq) ===&lt;br /&gt;
&lt;br /&gt;
Frequency information is followed by an estimate of the squared correlation between imputed genotypes and true, unobserved genotypes. Since true genotypes are not available, this calculation is based on the idea that poorly imputed genotype counts will shrink towards their expectations based on population allele frequencies alone; specifically &amp;lt;math&amp;gt;2p&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; is the frequency of the allele being imputed.&lt;br /&gt;
&lt;br /&gt;
Currently, minimac uses the following definition:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\hat{r}^2 = {{Var(\mbox{Estimated Counts})}\over{\hat{p}(1-\hat{p})}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Leave One Out Statistics ==&lt;br /&gt;
&lt;br /&gt;
To evaluate imputation quality, Minimac hides data for each genotyped SNP in turn and calculates 3 statistics, described below.  &lt;br /&gt;
&lt;br /&gt;
=== looRsq : Estimated R-squared in Leave-One-Out Analysis ===&lt;br /&gt;
&lt;br /&gt;
This first statistic is calculated by hiding all known genotypes for the SNP, imputing it and then estimating imputation accuracy. It doesn&#039;t use the known genotypes for the SNP at all.&lt;br /&gt;
&lt;br /&gt;
=== empR : Correlation Between Imputed and True Genotypes ===&lt;br /&gt;
&lt;br /&gt;
Whereas looRsq statistic completely ignores experimental genotypes, this one is based on a comparison of imputed and experimental genotypes. A negative correlation between imputed and experimental genotypes can indicate allele flips.&lt;br /&gt;
&lt;br /&gt;
=== empRsq : Squared Correlation Between Imputed and True Genotypes ===&lt;br /&gt;
&lt;br /&gt;
Whereas looRsq statistic reports the estimated imputation accuracy, this one reports the &#039;&#039;actual&#039;&#039; imputation accuracy - as estimated by comparing genotypes generated using imputation (after hiding any known genotypes for the marker) and the previously hidden known genotypes. By comparing empRsq and looRsq it should be possible to tell whether estimates of imputation accuracy are well calibrated.&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14715</id>
		<title>EPACTS</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14715"/>
		<updated>2017-06-01T19:24:40Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Single Variant Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;EPACTS&#039;&#039;&#039; (Efficient and Parallelizable Association Container Toolbox) is a versatile software pipeline to perform various statistical tests for identifying genome-wide association from sequence data through a user-friendly interface, both to scientific analysts and to method developers.&lt;br /&gt;
&lt;br /&gt;
== Join in EPACTS mailing list ==&lt;br /&gt;
&lt;br /&gt;
Please join in the [http://groups.google.com/group/epacts EPACTS Google Group] to ask / discuss / comment about EPACTS.&lt;br /&gt;
&lt;br /&gt;
== Lastest ChangeLog ==&lt;br /&gt;
* Dec 15th, 2016 : EPACTS v3.3.0 release (github)&lt;br /&gt;
** Moved the repository into github&lt;br /&gt;
** Some major fixes in handling large sample size (&amp;gt;18,000)&lt;br /&gt;
** Other minor bug fixes &lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs (more comprehensive fix is still pending)&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
See [[#Full ChangeLog]] for full details&lt;br /&gt;
&lt;br /&gt;
== Key Features ==&lt;br /&gt;
&lt;br /&gt;
EPACTS currently provides the following set of key features&lt;br /&gt;
* Robust support for widely used format of sequence-based genotypes (VCF) and phenotypes with pedigree (PED)&lt;br /&gt;
** Efficient library for accessing VCF file to reduce computational burden to analyze large-scale sequencing data&lt;br /&gt;
** Support selecting markers by arbitrary combination of substring matching. &lt;br /&gt;
** Support for using genotype dosages instead of hard genotype calls&lt;br /&gt;
** Utilize PED format to perform test across multiple traits.&lt;br /&gt;
* Supports a large number of widely used statistical tests for single variant association and burden tests.&lt;br /&gt;
** See the &amp;quot;Currently Supported Statistical Tests&amp;quot; section below for more information&lt;br /&gt;
* Easy to Highly Parallelize Jobs&lt;br /&gt;
** Makefile-based partition into and ligation of multiple subtasks&lt;br /&gt;
** Parallel run of job is simply adding one parameter when running EPACTS &lt;br /&gt;
* Integrative and versatile framework that allows easy addition of additional statistical test&lt;br /&gt;
** Core input/output routines are implemented in C++&lt;br /&gt;
** Most statistical tests (except for EMMAX) are implemented in R&lt;br /&gt;
** Adding a simple R function to implement additional statistical test (See [[#Implementing Additional Statistical Tests]] for details)&lt;br /&gt;
* Useful utilities for post-association-analysis tasks&lt;br /&gt;
** Automatic functional annotation of associated variants&lt;br /&gt;
** Automatic generation of QQ and Manhattan Plot&lt;br /&gt;
** (TBA) Zoom plot for the significant associations&lt;br /&gt;
&lt;br /&gt;
== Obtaining EPACTS ==&lt;br /&gt;
&lt;br /&gt;
* The official release of EPACTS software is available at https://github.com/statgen/EPACTS&lt;br /&gt;
** From the CSG cluster, it is available at /net/fantasia/home/bin/epacts/&lt;br /&gt;
* Note that R (version 2.10 or higher) and gnuplot (version 4.2 or higher) must be installed in order to run EPACTS correctly.&lt;br /&gt;
&lt;br /&gt;
== Currently Supported Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
EPACTS supports the following sets of widely used statistical tests for single variant tests and burden tests&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.wald &lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logisitic Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (simply used glm in R)&lt;br /&gt;
|-&lt;br /&gt;
| b.score&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Logistic Score Test &amp;lt;br&amp;gt; (from Lin DY and Tang ZZ, AJHG 2011 89:354-67)&lt;br /&gt;
| Clement Ma &amp;amp; Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.firth&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Firth Bias-Corrected Logistic Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.spa2&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; &lt;br /&gt;
| Moderate&lt;br /&gt;
| Saddlepoint Approximation Method&lt;br /&gt;
| Shawn Lee &amp;amp; Rounak Dey&lt;br /&gt;
|-&lt;br /&gt;
| b.lrt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.glrt&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Fast&lt;br /&gt;
| Genotype Likelihood Ratio Test &amp;lt;br&amp;gt; (use GL or PL field in VCF to perform case-control test)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.lm&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Linear Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (as implemented in lm in R)&lt;br /&gt;
|-&lt;br /&gt;
| q.linear&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Linear Wald Test&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.emmax&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| EMMAX &amp;lt;br&amp;gt; ( Kang et al (2010) Nat Genet 42:348-54 )&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.collapse&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and 0/1 collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.madsen&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Slow&lt;br /&gt;
| Wilcoxon Rank Sum Test between binary phenotypes and weighted rare variant scores (slightly different version from the published method - it uses pooled allele frequency across cases and controls for weighting each variant)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.wcnt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and weighted rare variant scores&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression of phenotypes on binary collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression of phenotypes on collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| skat&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT-O Test by Lee et al, Biostatistics (2012)&lt;br /&gt;
| Seunggeun Lee &amp;lt;br&amp;gt; (adaptive by Xueling Sim and Hyun Min Kang)&lt;br /&gt;
|-&lt;br /&gt;
| VT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed out first)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable Threshold Test &amp;lt;br&amp;gt; with adaptive permutation &amp;lt;br&amp;gt; Price et al, AJHG (2010) 86:832-8&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxCMC&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Collapsing burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxVT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable-threshold burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| mmskat&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT test using EMMAX&lt;br /&gt;
| Seunggeun Lee &amp;amp; Hyun Min Kang&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Installation Details  ==&lt;br /&gt;
&lt;br /&gt;
If you want to use EPACTS in an Ubuntu platform, following the step below &lt;br /&gt;
&lt;br /&gt;
 $ git clone https://github.com/statgen/EPACTS.git&lt;br /&gt;
 $ cd EPACTS&lt;br /&gt;
 $ ./configure --prefix [/path/to/install]&lt;br /&gt;
 $ make&lt;br /&gt;
 $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Important Note: &#039;&#039;&#039;make sure to specify --prefix=/path/to/install&#039;&#039;&#039; to avoid installing to the default path /usr/local/, which you may not have the permission. /home/your_userid/epacts might be a good one, if you are not sure where to install)&lt;br /&gt;
  &lt;br /&gt;
* Now ${EPACTS_DIR} represents the &#039;/path/to/install&#039; directory&lt;br /&gt;
&lt;br /&gt;
* Download the reference FASTA files from 1000 Genomes FTP automatically by running the following commands&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/epacts download&lt;br /&gt;
&lt;br /&gt;
 (For advanced users, to save time for downloading the FASTA files (~900MB), you may copy a local copy of GRCh37 FASTA file and the index file to ${EPACTS_DIR}/share/EPACTS/)&lt;br /&gt;
&lt;br /&gt;
*Perform a test run by running the following command&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
&lt;br /&gt;
In order to use EPACTS in the CSG cluster, you do not need to install them. You can directly use or make a copy of the in-house release version at &lt;br /&gt;
&lt;br /&gt;
 /net/fantasia/home/hmkang/tools/epacts-3.3.0/bin/epacts/&lt;br /&gt;
&lt;br /&gt;
* If you want to access previous versions, visit http://csg-old.sph.umich.edu/kang/epacts/download&lt;br /&gt;
&lt;br /&gt;
== Getting Started With Examples ==&lt;br /&gt;
If you are using EPACTS from the CSG cluster, please set the following environment variable&lt;br /&gt;
 EPACTS_DIR=/net/fantasia/home/hmkang/tools/epacts-3.3.0/bin/epacts (in bash)&lt;br /&gt;
 setenv EPACTS_DIR /net/fantasia/home/hmkang/tools/epacts-3.3.0/bin/epacts (in csh)&lt;br /&gt;
&lt;br /&gt;
If you downloaded EPACTS binary and please set EPACTS_DIR to the full path of the downloaded and uncompressed directory.&lt;br /&gt;
&lt;br /&gt;
=== All-in-one example ===&lt;br /&gt;
&lt;br /&gt;
To get started with EPACTS, run the following command will perform an example run&lt;br /&gt;
 ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
 &lt;br /&gt;
You will find a series of lines in test_run_epacts.sh script commented out for each possible test. &lt;br /&gt;
&lt;br /&gt;
The example phenotype (PED format) and genotype (VCF format) can be found at&lt;br /&gt;
 ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Test ===&lt;br /&gt;
&lt;br /&gt;
Or You can run EPACTS command yourself by running&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
   --vcf  ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
   --ped  ${EPACTS_DIR}/data/1000G_dummy_pheno.ped  \&lt;br /&gt;
   --min-maf 0.001 --chr 20 --pheno DISEASE --cov AGE --cov SEX --test b.score --anno \ &lt;br /&gt;
   --out out/test --run 2&lt;br /&gt;
&lt;br /&gt;
The command above will perform single variant association test using a dummy case-control phenotype file and a subset of 1000 genomes exome VCF file (chr20) using score test statistic for all variants over 1% of higher MAF using 2 parallel runs.&lt;br /&gt;
&lt;br /&gt;
You will see the 4 output files as the main outcome of the analysis&lt;br /&gt;
&lt;br /&gt;
==== Output Text of All Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The filename is out/test.single.b.score.epacts.gz and the contents will look like&lt;br /&gt;
 $ zcat out/test.single.b.score.epacts.gz | head&lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	68303	68303	20:68303_A/G_Upstream:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68319	68319	20:68319_C/A_Upstream:DEFB125	266	1.4467e-36	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68396	68396	20:68396_C/T_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76635	76635	20:76635_A/T_Intron:DEFB125	266	1.534e-37	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76689	76689	20:76689_T/C_Synonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76690	76690	20:76690_T/C_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76700	76700	20:76700_G/A_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76726	76726	20:76726_C/G_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76771	76771	20:76771_C/T_Nonsynonymous:DEFB125	266	3	1	0.0056391	0.68484	0.40587	145	121	0.013793	0.0082645&lt;br /&gt;
&lt;br /&gt;
==== Output Text of Top Associations ====&lt;br /&gt;
&lt;br /&gt;
Same type of file but containing top 5,000 association will be stored at out/test.epacts.top5000&lt;br /&gt;
&lt;br /&gt;
 $ head out/test.single.b.score.epacts.top5000 &lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	1610894	1610894	20:1610894_G/A_Synonymous:SIRPG	266	138.64	1	0.26061	6.9939e-05	3.9765	145	121	0.65177	0.36476&lt;br /&gt;
 20	4162411	4162411	20:4162411_T/C_Intron:SMOX	266	204	1	0.38346	0.00055583	-3.4523	145	121	0.62759	0.93388&lt;br /&gt;
 20	34061918	34061918	20:34061918_T/C_Intron:CEP250	266	41.815	1	0.0786	0.00095471	3.3035	145	121	0.22543	0.075436&lt;br /&gt;
 20	4155948	4155948	20:4155948_G/A_Intron:SMOX	266	215	1	0.40414	0.0020792	-3.0787	145	121	0.68276	0.95868&lt;br /&gt;
 20	4680251	4680251	20:4680251_A/G_Nonsynonymous:PRNP	266	186	1	0.34962	0.0025962	3.0119	145	121	0.8069	0.57025&lt;br /&gt;
 20	36668874	36668874	20:36668874_G/A_Synonymous:RPRD1B	266	96	1	0.18045	0.003031	2.9646	145	121	0.44828	0.2562&lt;br /&gt;
 20	36641871	36641871	20:36641871_G/A_Synonymous:TTI1	266	10	1	0.018797	0.004308	-2.8547	145	121	0.0068966	0.07438&lt;br /&gt;
 20	1616892	1616892	20:1616892_A/G_Synonymous:SIRPG	266	144	1	0.27068	0.0051239	2.7991	145	121	0.63449	0.42975&lt;br /&gt;
 20	25038372	25038372	20:25038372_G/A_Intron:ACSS1	266	103.3	1	0.19418	0.005748	2.7618	145	121	0.47201	0.28813&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;AC&#039;&#039;&#039; : Total Non-reference Allele Count&lt;br /&gt;
* &#039;&#039;&#039;CALLRATE&#039;&#039;&#039; : Fraction of non-missing genotypes.&lt;br /&gt;
* &#039;&#039;&#039;MAF&#039;&#039;&#039; : Minor allele frequencies&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of single variant test&lt;br /&gt;
* &#039;&#039;&#039;AF.CASE&#039;&#039;&#039; : Non-reference allele frequencies for cases&lt;br /&gt;
* &#039;&#039;&#039;AF.CTRL&#039;&#039;&#039; : Non-reference allele frequencies for controls&lt;br /&gt;
&lt;br /&gt;
==== Q-Q plot of test statistics (stratified by MAF) ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.qq.pdf will be generated as shown below&lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_qq.png]]&lt;br /&gt;
&lt;br /&gt;
==== Manhattan Plot of Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.mh.pdf will be generated for chr20 only. &lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_mh.png]]&lt;br /&gt;
&lt;br /&gt;
An example Genome-wide manhattan plot (from a genome-wide run) will look like below&lt;br /&gt;
&lt;br /&gt;
[[File:tes_b_score_epacts_mh_gw.png]]&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise burden test ===&lt;br /&gt;
&lt;br /&gt;
Gene-wise or group-wise burden test requires two steps. First, &#039;group&#039; file containing the list of &lt;br /&gt;
markers per group needs to be generated. Second, group-wise burden test needs to be run&lt;br /&gt;
&lt;br /&gt;
==== Creating marker group file ====&lt;br /&gt;
&lt;br /&gt;
The marker group file has the following format&lt;br /&gt;
&lt;br /&gt;
 [GROUP_ID]  [MARKER_ID_1]   [MARKER_ID_2]  .... [MARKER_ID_N]&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
* [GROUP_ID] is a string representing the group (e.g. gene name)&lt;br /&gt;
* [MARKER_ID_K] is a marker key as a format of [CHROM]:[POS]_[REF]/[ALT] (NOTE THAT THIS IS DIFFERENT FROM TYPICAL VCF MARKER ID field)&lt;br /&gt;
&lt;br /&gt;
Note that [MARKER_ID_K] has to be sorted by increasing order of genomic coordinate&lt;br /&gt;
&lt;br /&gt;
In order to create gene-level group file from typically formatted VCF file, one may use the following utility &lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --nonsyn&lt;br /&gt;
&lt;br /&gt;
The above command create a file [output-group-file] containing a list of missense and nonsense variants per each gene. To incorporate different types of functional annotations, use --type option as follows&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --type [function_type_1] --type [function_type_2] ...&lt;br /&gt;
&lt;br /&gt;
Type &#039;epacts makegroup -man&#039; for the detailed documentation&lt;br /&gt;
&lt;br /&gt;
==== Annotating VCF file using EPACTS ====&lt;br /&gt;
&lt;br /&gt;
If the VCF is not annotated, &#039;epacts makegroup&#039; cannot be used. In order to annotate VCF, one can use the example VCF using ANNOVAR as follows:&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts anno \&lt;br /&gt;
    --in ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
    --out ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
The epacts anno script will add &amp;quot;ANNO=[function]:[genename]&amp;quot; entry into the INFO field based on gencodeV7 (default) or refGene database.&lt;br /&gt;
&lt;br /&gt;
It is important to check whether the VCF file is already annotated or not in order to avoid no or redundant annotation.&lt;br /&gt;
&lt;br /&gt;
==== Running Groupwise Test ====&lt;br /&gt;
&lt;br /&gt;
To perform a groupwise burden test on the example VCF (annotated as above), run the following command&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --vcf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz \&lt;br /&gt;
   --groupf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.grp --out out/test.gene.skat \&lt;br /&gt;
   --ped ${EPACTS_DIR}/data/1000G_dummy_pheno.ped --maxAF 0.05 \&lt;br /&gt;
   --chr 20 --pheno QT --cov AGE --cov SEX --test skat --skat-o --run 2&lt;br /&gt;
&lt;br /&gt;
==== Example Output ====&lt;br /&gt;
 $ head out/test.gene.skat.epacts.top5000&lt;br /&gt;
 #CHROM BEGIN   END     MARKER_ID       NS      FRAC_WITH_RARE     NUM_ALL_VARS    NUM_PASS_VARS   NUM_SING_VARS   PVALUE  STATRHO&lt;br /&gt;
 20     62607037        62608720        20:62607037-62608720_SAMD10     266     0.14662 9       5       1       0.0020064       1&lt;br /&gt;
 20     2816211 2820493 20:2816211-2820493_FAM113A      266     0.011278        12      2       1       0.0032542       0&lt;br /&gt;
 20     47245987        47361692        20:47245987-47361692_PREX1      266     0.1391  54      9       6       0.0054849       1&lt;br /&gt;
 20     34761734        34810279        20:34761734-34810279_EPB41L1    266     0.071429        14      7       5       0.0068492       0.2&lt;br /&gt;
 20     61340671        61391602        20:61340671-61391602_NTSR1      266     0.11278 24      9       3       0.011063        1&lt;br /&gt;
 20     48561952        48568644        20:48561952-48568644_RNF114     266     0.011278        4       2       1       0.015175        0.2&lt;br /&gt;
 20     60962895        60963559        20:60962895-60963559_RPS21      266     0.06015 6       3       2       0.016409        0&lt;br /&gt;
 20     55904961        55917801        20:55904961-55917801_SPO11      266     0.011278        11      3       3       0.018031        0&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;FRAC_WITH_RARE&#039;&#039;&#039; : Fraction of individual carrying rare variants below --max-maf (default : 0.05) threshold.&lt;br /&gt;
* &#039;&#039;&#039;NUM_ALL_VARS&#039;&#039;&#039; : Number of all variants defining the group.&lt;br /&gt;
* &#039;&#039;&#039;NUM_PASS_VARS&#039;&#039;&#039; : Number of variants passing the --min-maf, --min-mac, --max-maf, --min-callrate thresholds&lt;br /&gt;
* &#039;&#039;&#039;NUM_SING_VARS&#039;&#039;&#039; : Number of singletons among variants in NUM_PASS_VARS&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of burden tests&lt;br /&gt;
* Other columns are test specific auxiliary columns. For example, in the VT test, the optimal MAF threshold is recorded as an auxiliary output column.&lt;br /&gt;
&lt;br /&gt;
=== Specialized Instruction for EMMAX tests ===&lt;br /&gt;
&lt;br /&gt;
EMMAX (Efficient Mixed Model Association eXpedited - Kang et al (2010) Nat Genet 42:348-54) is an efficient implementation of mixed model association accounting for sample structure including population structure and hidden relatedness. Currently EPACTS supports EMMAX association mapping in single variant test and CMC-like burden tests. &lt;br /&gt;
&lt;br /&gt;
Because EMMAX is based on linear model, the method fits better to quantiative traits than binary traits. However, p-values for binary traits are expected to be valid in the spirit of Armitage trend test, although the estimated effect size may not be precise.&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
==== Single Variant EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : From VCF, we recommend to set a MAF (e.g. 0.01) and call rate (e.g. 0.95) threshold to select high-quality markers to generate kinship matrix as follows.&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-kin \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped (Optional)] --min-maf 0.01 --minCallRate 0.95 \&lt;br /&gt;
  --sepchr (if VCF is separated by chromosome) --out [outprefix.kinf] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
If you provide [input.ped] file, then it will calculate the subset the individuals contained in the PED file. &lt;br /&gt;
&lt;br /&gt;
The procedure above will create a file [outprefix.kinf] after splitting and merging the genomes into multiple pieces. If only a certain subset of SNPs needs to be considered due to target regions, LD-pruning, or any other reasons, a VCF containing the subset of markers must be created beforehand and should be used as input VCF file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Perform Single Variant Association&#039;&#039;&#039; : From VCF and PED, we recommend to use less stringent MAF threshold (e.g. 0.001) and call rate (e.g. 0.50) to perform single variant association&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --min-maf 0.001 --kin [outputprefix.kinf] \&lt;br /&gt;
  --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] --test q.emmax \&lt;br /&gt;
  --out [outprefix] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
The procedure above will perform single variant association analysis compatible to other types of single variant association analyses implemented in EPACTS&lt;br /&gt;
&lt;br /&gt;
==== Burden-style EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : See &#039;Creating Kinship Matrix&#039; section in [[#Single Variant EMMAX Association Analysis]]&lt;br /&gt;
* &#039;&#039;&#039;Create Marker Group&#039;&#039;&#039;&lt;br /&gt;
** By annotating the VCF and extracting missense and nonsense variants&lt;br /&gt;
*** [[#Annotating VCF file using ANNOVAR]] - This step will be required to create marker group file&lt;br /&gt;
*** [[#Creating marker group file]] - Assume that [group.grp] file is produced&lt;br /&gt;
** Or, by creating your own marker group information&lt;br /&gt;
*** See [[#Creating marker group file]] for details&lt;br /&gt;
* Run CMC-style burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxCMC --out [outprefix] &lt;br /&gt;
* Run Variable Threshold burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxVT --out [outprefix]&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Own Input Data ==&lt;br /&gt;
&lt;br /&gt;
=== VCF file for Genotypes ===&lt;br /&gt;
&lt;br /&gt;
EPACTS support VCF files as input for association with the following requirement&lt;br /&gt;
* Input VCF file must be bgzipped and tabixed before running association to allow efficient random access of the file. Below is an example command to conver plain VCF into bgzipped and tabixed VCF&lt;br /&gt;
  bgzip input.vcf     ## this command will produce input.vcf.gz&lt;br /&gt;
  tabix -pvcf -f input.vcf.gz  ## this command will produce input.vcf.gz.tbi&lt;br /&gt;
* If the VCF file is separated by chromosome, the VCF file specified in the input argument must contain the string &amp;quot;chr1&amp;quot; in the chromosome 1 file, and corresponding chromosome name for other chromosomes. Thus, the files names should be like &amp;lt;code&amp;gt;[prefix]chr1[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chr2[suffix].vcf.gz&amp;lt;/code&amp;gt;, ..., &amp;lt;code&amp;gt;[prefix]chr22[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chrX[suffix].vcf.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Sample IDs in the VCF file must be consistent to those from PED file&lt;br /&gt;
* Currently EPACTS only support bi-allelic variants, but it handles SNPs, INDELs, snd SVs.&lt;br /&gt;
* Currently, EPACTS only support VCF aligned with NCBI build 37 coordinates&lt;br /&gt;
* An example VCF file from 1000 genome project is below. &lt;br /&gt;
 $ zcat example/1000G_integrated_phase1_chr20.vcf.gz | cut -f 1-10 | head -50 &lt;br /&gt;
 ##fileformat=VCFv4.1&lt;br /&gt;
 ##INFO=&amp;lt;ID=LCSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Low coverage VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=EXSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Exome VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=INDEL,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in INDEL VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SV,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in SV VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BAVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BRSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality estimate from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=LDAF,Number=1,Type=Float,Description=&amp;quot;MLE Allele Frequency Accounting for LD&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=RSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=ERATE,Number=1,Type=Float,Description=&amp;quot;Per-marker Mutation rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=THETA,Number=1,Type=Float,Description=&amp;quot;Per-marker Transition rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIEND,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around END for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIPOS,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around POS for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=END,Number=1,Type=Integer,Description=&amp;quot;End position of the variant described in this record&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMLEN,Number=.,Type=Integer,Description=&amp;quot;Length of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMSEQ,Number=.,Type=String,Description=&amp;quot;Sequence of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SOURCE,Number=.,Type=String,Description=&amp;quot;Source of deletion call&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVLEN,Number=1,Type=Integer,Description=&amp;quot;Difference in length between REF and ALT alleles&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVTYPE,Number=1,Type=String,Description=&amp;quot;Type of structural variant&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AC,Number=.,Type=Integer,Description=&amp;quot;Alternate Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AN,Number=1,Type=Integer,Description=&amp;quot;Total Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##ALT=&amp;lt;ID=DEL,Description=&amp;quot;Deletion&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GT,Number=1,Type=String,Description=&amp;quot;Genotype&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=DS,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GL,Number=.,Type=Float,Description=&amp;quot;Genotype Likelihoods&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=BD,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 #CHROM POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  HG00096&lt;br /&gt;
 20 60479   .   C   T   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.894;LDAF=0.0020;AVGPOST=0.9995;RSQ=0.8779;ERATE=0.0005;THETA=0.0008;AC=4;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.19,-0.46,-2.68:0.0022&lt;br /&gt;
 20 60522   .   T   TC  1588    PASS    INDEL;BAVGPOST=1.000;BRSQ=0.994;LDAF=0.0116;AVGPOST=0.9980;RSQ=0.9327;ERATE=0.0004;THETA=0.0167;AC=24;AN=2184   GT:DS:GL:BD 0|0:0.000:0.00,-0.90,-9.20:0&lt;br /&gt;
 20 60571   .   C   A   100 PASS    LCSNP;EXSNP;BAVGPOST=0.999;BRSQ=0.813;LDAF=0.0029;AVGPOST=0.9986;RSQ=0.8085;ERATE=0.0014;THETA=0.0014;AC=5;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.05,-0.96,-5.00:0.0008&lt;br /&gt;
 20 60795   .   G   C   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.930;LDAF=0.0006;AVGPOST=0.9996;RSQ=0.7205;ERATE=0.0003;THETA=0.0041;AC=1;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.03,-1.21,-5.00:0.0001&lt;br /&gt;
 20 60810   .   G   GA  127 PASS    INDEL;BAVGPOST=1.000;BRSQ=0.862;LDAF=0.0013;AVGPOST=0.9987;RSQ=0.5684;ERATE=0.0004;THETA=0.0061;AC=2;AN=2184    GT:DS:GL:BD 0|0:0.000:0.00,-1.80,-18.80:0&lt;br /&gt;
&lt;br /&gt;
=== PED file for Phenotypes and Covariates ===&lt;br /&gt;
&lt;br /&gt;
EPACTS accepts a PED format supported by MERLIN or PLINK software to represent phenotypes. For example, the example.ped file and example.dat file can represent the phenotypes and corresponding column name (from 6th column and after). &lt;br /&gt;
&lt;br /&gt;
 $ head example.ped&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
 $ cat example.dat&lt;br /&gt;
 A DISEASE&lt;br /&gt;
 T QT&lt;br /&gt;
 T AGE&lt;br /&gt;
&lt;br /&gt;
EPACTS also accept a PED format with header information. The above file can be combined into one file as follows&lt;br /&gt;
&lt;br /&gt;
 $ head data/1000G_dummy_pheno.ped&lt;br /&gt;
 #FAM_ID    IND_ID  FAT_ID  MOT_ID  SEX DISEASE QT  AGE&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
The column names can be used to identify the names of phenotypes and covariates in the analysis.&lt;br /&gt;
&lt;br /&gt;
== Frequently Asked Questions ==&lt;br /&gt;
=== Installation ===&lt;br /&gt;
# How should I install EPACTS? &lt;br /&gt;
#* See [[EPACTS#Installation_Details | Installation Details]]&lt;br /&gt;
# I am having the following error message &#039;&#039;&#039;configure: error: libR.{so,a} was not found. Please install it at http://www.r-project.org/ first&#039;&#039;&#039;. What do I have to do?&lt;br /&gt;
#* First, you need to find out where R was installed. Try to type &amp;quot;locate libR.so&amp;quot; and see if it returns anything&lt;br /&gt;
#* If &amp;quot;locate libR.so&amp;quot; returns you something, as explained [[EPACTS#Installation_Details | Installation Details]], try to add &amp;quot;LDFLAGS=-L/path/to/R/library&amp;quot; and rerun &#039;&#039;&#039;configure&#039;&#039;&#039; and &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
#* If you cannot find libR.so, you make have to recompile R with --enable-R-shlib option as described in http://cran.r-project.org/doc/manuals/R-admin.html#Installation&lt;br /&gt;
&lt;br /&gt;
=== Input Files ===&lt;br /&gt;
# What is VCF?&lt;br /&gt;
#* VCF refers to Variant Call Format&lt;br /&gt;
#* See [[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 1000 Genomes wiki page]] for the detailed description of VCF format&lt;br /&gt;
# Should input VCF be compressed into certain format?&lt;br /&gt;
#* Correct. EPACTS assumes that VCF file is bgzipped and tabixed already.&lt;br /&gt;
#* See [[#VCF file for Genotypes]] for details.&lt;br /&gt;
# What are the additional requirements for input VCF file?&lt;br /&gt;
#* Input VCF file used for association mapping must contain individual genotype information at 10-th or higher order columns.&lt;br /&gt;
#* GT field must be encoded as haploid or diploid&lt;br /&gt;
#* Bi-allelic SNPs only : Currently EPACTS may not handle multi-allelic SNPs correctly.&lt;br /&gt;
#* If non-GT field is used, the field is considered as dosage and should be a single numeric value.&lt;br /&gt;
# What are the acceptable input format to encode phenotypes and covariates?&lt;br /&gt;
#* See [[#PED file for Phenotypes and Covariates]] for the detailed information&lt;br /&gt;
# How should I encode binary phenotypes?&lt;br /&gt;
#* If you encode your phenotypes into two different numeric values (e.g. 0/1 or 1/2), EPACTS will automatically recognize them as binary phenotypes and encode them into 1/2 values. Higher value will be considered as cases for case-control association&lt;br /&gt;
# How should I encode missing genotypes?&lt;br /&gt;
#* The default code missing phenotypes in EPACTS are &#039;NA&#039;&lt;br /&gt;
#* One may use --missing option to specify different types of missing values&lt;br /&gt;
#* The encoding of missing genotypes follows the VCF specificiation&lt;br /&gt;
# How do I match the relationship between VCF and PED input files?&lt;br /&gt;
#* EPACTS will assume that the individual IDs in each VCF and PED file are unique, and they follow the saming convention. Thus, the individual IDs overlapping between VCF and PED files will be considered in the associations&lt;br /&gt;
# How the individuals with missing phenotypes are handled?&lt;br /&gt;
#* Currently, EPACTS will automatically remove the individuals without phenotypes or covariates. If one wants to use imputed covariates to increase sample size, the PED file must contain the imputed covariate values.&lt;br /&gt;
#* Markers with missing genotypes won&#039;t be discarded automatically. It can be explicitly discarded by --minCallRate option when performing association&lt;br /&gt;
&lt;br /&gt;
=== Output Files ===&lt;br /&gt;
# Which output files should I be looking at?&lt;br /&gt;
#* [[#Output Text of Top Associations]] is the key file to look at the individual top associations&lt;br /&gt;
#* [[#Q-Q plot of test statistics (stratified by MAF)]] will be important to see the global distribution of test statistics and examine if there are apparent inflation of test statistics&lt;br /&gt;
#* [[#Manhattan Plot of Test Statistics]] will inform us the genome-wide distribution of association signals&lt;br /&gt;
#* [[#Output Text of All Test Statistics]] will contain the full information of test results across all units tested&lt;br /&gt;
# The Q-Q and Manhattan plots cannot be found. Why?&lt;br /&gt;
#* It is probably because gnuplot 4.2 or higher is not installed in your system, or they are included but cannot be found in your ${PATH}. Please visit [[http://gnuplot.info/ GNUPLOT web page]] for installation.&lt;br /&gt;
# How can I read the EMMAX kinship file from produced from EPACTS?&lt;br /&gt;
# * You can run the following command to dump your kinship matrix into a human-readable text format.&lt;br /&gt;
 $(EPACTS_DIR)/bin/epacts/bin/pEmmax kin-util --kinf [input.kinf] --outf [output.prefix] --dump&lt;br /&gt;
&lt;br /&gt;
=== More questions ===&lt;br /&gt;
# If you have more questions, please contact [[mailto:hmkang@umich.edu Hyun Min Kang]].&lt;br /&gt;
&lt;br /&gt;
== Detailed Options ==&lt;br /&gt;
&lt;br /&gt;
The detailed options can viewed by running the following commands&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts -man           (for overall structure) &lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts single -man    (for single variant test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts group -man     (for groupwise test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts anno -man      (for annotation)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts plot -man      (for QQ and Manhattan plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts zoom -man      (for zoom plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts meta -man      (for meta-analysis)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts make-group -man (for creating gene group)&lt;br /&gt;
&lt;br /&gt;
== Implementing Additional Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
In order to add additional statistical test to EPACTS, the following procedure are recommended&lt;br /&gt;
&lt;br /&gt;
# Create a file named &#039;single.[testname].R&#039; for single variant test or &#039;gene.[testname].R&#039; for gene-level test under ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
# Test your implementation using --test [testname] option to perform sanity check and debugging&lt;br /&gt;
# If you want to add your test in the official in-house version, please send your code to Hyun&lt;br /&gt;
&lt;br /&gt;
Below is an example of a single variant test implementation ( single.q.lm.R )&lt;br /&gt;
 ## Core functions of EPACTS to perform association&lt;br /&gt;
 &lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## SINGLE VARIANT TEST&lt;br /&gt;
 ## INPUT VARIABLES:&lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   NS       : number of called samples&lt;br /&gt;
 ##   AC       : allele count&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:nrow(NS) after AF/AC threshold&lt;br /&gt;
 ##   genos    : genotype matrix (after AF/AC threshold)&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional columns to add&lt;br /&gt;
 ##   cname    : column names for additional columns&lt;br /&gt;
 ##################################################################  &lt;br /&gt;
 &lt;br /&gt;
 ## single.lm() : Use built-in lm() function to perform association&lt;br /&gt;
 ## KEY FEATURES : SIMPLE, BUT MAY BE SLOW&lt;br /&gt;
 ##                GOOD SNIPPLET TO START A NEW FUNCTION&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, TSTAT&lt;br /&gt;
 ## MISSING VALUES : IGNORED&lt;br /&gt;
 single.q.lm &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;TSTAT&amp;quot;) # column names for additional variables in the EPACTS output&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   p &amp;lt;- rep(NA,m)&lt;br /&gt;
   add &amp;lt;- matrix(NA,m,3) ## BETA, SEBETA, TSTAT&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
    for(i in 1:m) {&lt;br /&gt;
      r &amp;lt;- summary(lm(pheno~genos[i,]+cov-1))$coefficients[1,]  # run simple linear regression&lt;br /&gt;
      p[i] &amp;lt;- r[4]   # store p-value to p[i]&lt;br /&gt;
      add[i,] &amp;lt;- r[1:3] # store additional variables to add[i,]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  return(list(p=p,add=add,cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
As described in the comment, you may assume that the following variables are available for use for testing association across m markers&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker&lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (m * 1 vector) : p-value matrix as output&lt;br /&gt;
* add (m * c matrix) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# AC : Non-ref allele count&lt;br /&gt;
# CALLRATE : Call rate = NS/n&lt;br /&gt;
# MAF : Minor allele frequency&lt;br /&gt;
# PVALUE : P-values&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
Below is an example of a gene-lvel variant test implementation ( single.q.lm.R )&lt;br /&gt;
&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## GENE-LEVEL BURDEN TEST&lt;br /&gt;
 ## INPUT VARIABLES: &lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   genos    : genotype matrix for each gene&lt;br /&gt;
 ##   NS       : number of called samples for each marker&lt;br /&gt;
 ##   AC       : allele count for each marker&lt;br /&gt;
 ##   MAC      : minor allele count for each marker&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:n after AF/AC threshold&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional column values&lt;br /&gt;
 ##   cname    : additional column names&lt;br /&gt;
 ##################################################################      &lt;br /&gt;
 &lt;br /&gt;
 ## gene.q.reverse() : Reverse logistic regression&lt;br /&gt;
 ## KEY FEATURES : 0/1 collapsing variable ~ rare variants&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE (GAUSSIAN)&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, ZSTAT&lt;br /&gt;
 ## MISSING VALUE : IMPUTED AS MAJOR ALLELES&lt;br /&gt;
 gene.q.reverse &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;ZSTAT&amp;quot;)&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
     g &amp;lt;- as.double(colSums(genos,na.rm=T) &amp;gt; 0)&lt;br /&gt;
     sg &amp;lt;- sum(g)&lt;br /&gt;
     if ( ( sg &amp;gt; 0 ) &amp;amp;&amp;amp; ( sg &amp;lt; n ) ) {&lt;br /&gt;
       r &amp;lt;- glm(g~pheno+cov-1,family=binomial)&lt;br /&gt;
        if ( ( r$converged ) &amp;amp;&amp;amp; ( ! r$boundary ) ) {&lt;br /&gt;
         return(list(p=summary(r)$coefficients[1,4],&lt;br /&gt;
                     add=summary(r)$coefficients[1,1:3],&lt;br /&gt;
                     cname=cname))&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   return(list(p=NA,add=rep(NA,3),cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Similar to gene-level test, you may assume the following variables exist for testing A SINGLE GENE. Note that M is the number of markers spanning the gene region&lt;br /&gt;
&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker &lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAC (M * 1 vector) : Minor allele count&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (scalar) : p-value matrix as output&lt;br /&gt;
* add (c * 1 vector) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# MAF_BURDEN : MAF of 0/1 collapsing variables (existence of rare variants)&lt;br /&gt;
# NUM_ALL_VARS : Number of all variants within the gene&lt;br /&gt;
# NUM_RARE_VARS : Number of rare variants below the max-MAF threshold&lt;br /&gt;
# NUM_SING_VARS : Number of singleton variants&lt;br /&gt;
# PVALUE : P-value from the test&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
== Full ChangeLog ==&lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs&lt;br /&gt;
** Some known bugs still exist &lt;br /&gt;
*** SKAT-O Lambda eigenvalue error. This happenes in a particular context but haven&#039;t nailed down a way to prevent it yet.&lt;br /&gt;
*** EMMAX has case and control frequency flipped.&lt;br /&gt;
* EMMAX test has a silly known bug with case / ctrl frequency is flipped&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
* February 28th, 2013 : EPACTS v3.2.0 release&lt;br /&gt;
** R package installation bug (for some users) was fixed&lt;br /&gt;
** A bug in the MAF error for high frequency variants (AF&amp;gt;0.25) was now fixed&lt;br /&gt;
** SKAT version is updated to 0.81&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
* December 4th, 2012 : EPACTS v3.1.0 release&lt;br /&gt;
** Removed dependency on libR.so&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** November 25th, 2012 : EPACTS v3.0.0 release&lt;br /&gt;
** Restructured with source code release (with autoconf / automake / libtools)&lt;br /&gt;
** Added zoom plot feature&lt;br /&gt;
** FRAC_BURDEN keyword was replace to FRAC_WITH_RARE for groupwise testing&lt;br /&gt;
* October 26th, 2012 : EPACTS v2.2.0-beta is released with the following updates&lt;br /&gt;
** Added --max-mac option&lt;br /&gt;
** Fixed Firth&#039;s bias-corrected test (by Clement Ma)&lt;br /&gt;
** Added more informative warning messages when index files do not exist&lt;br /&gt;
** Fixed the bug in the epacts-plot in plotting ties&lt;br /&gt;
** Fixed errors in the MAF estimates per case and control&lt;br /&gt;
** Fixed bug in --minRSQ option&lt;br /&gt;
* September 28, 2012 : EPACTS v2.11-beta is released with the following updates&lt;br /&gt;
** Counts and allele frequencies for case/control added for binary tests&lt;br /&gt;
** --max-maf parameter is added&lt;br /&gt;
** Fixed EMMAX error in MAF in the output&lt;br /&gt;
** More informative error messages &lt;br /&gt;
* September 27, 2012 : EPACTS v2.1-beta is released with the following updates&lt;br /&gt;
** EMMAX interface is changed. --kinOnly option is related with a new command &#039;&#039;&#039;make-kin&#039;&#039;&#039; &lt;br /&gt;
** SKAT-O is upgraded to version 0.77 with additional configurable parameter settings&lt;br /&gt;
** Some parameter names are renamed (e.g. --min-maf, --min-mac)&lt;br /&gt;
** Many minor bugs are fixed&lt;br /&gt;
* Jul 6, 2012 : EPACTS v2.01-beta is released with the following updates&lt;br /&gt;
** SKAT-O is upgraded to version 0.76&lt;br /&gt;
** Fixed minor bugs in option names (Thanks to Xueling Sim)&lt;br /&gt;
* Jul 3, 2012 : EPACTS v2.0-beta is released with the following updates&lt;br /&gt;
** Major restructuring of the software&lt;br /&gt;
** Annotation software is switched with built-in application&lt;br /&gt;
** Addition of SKAT-O and EMMAX burden test&lt;br /&gt;
** Minor bug fixes&lt;br /&gt;
* Apr 8, 2012 : EPACTS v1.2-alpha is released with the following updates, in addition to the following updates&lt;br /&gt;
** EMMAX bug in handling covariates was fixed&lt;br /&gt;
** Variable Threshold Test is added&lt;br /&gt;
** Variable Threshold Test with genomic score (e.g. GERP or PhyloP) is added.&lt;br /&gt;
* Apr 4, 2012 : EPACTS v1.1-alpha is released with the following updates, in addition to minor updates&lt;br /&gt;
** EMMAX burden test (Hyun Min Kang)&lt;br /&gt;
** Likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of Firth bias-corrected likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of EMMAX single variant test (Hyun Min Kang) &lt;br /&gt;
* Mar 29, 2012 : EPACTS v1.0-alpha is released&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14659</id>
		<title>EPACTS</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14659"/>
		<updated>2017-02-28T11:50:11Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Currently Supported Statistical Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;EPACTS&#039;&#039;&#039; (Efficient and Parallelizable Association Container Toolbox) is a versatile software pipeline to perform various statistical tests for identifying genome-wide association from sequence data through a user-friendly interface, both to scientific analysts and to method developers.&lt;br /&gt;
&lt;br /&gt;
== Join in EPACTS mailing list ==&lt;br /&gt;
&lt;br /&gt;
Please join in the [http://groups.google.com/group/epacts EPACTS Google Group] to ask / discuss / comment about EPACTS.&lt;br /&gt;
&lt;br /&gt;
== Lastest ChangeLog ==&lt;br /&gt;
* Dec 15th, 2016 : EPACTS v3.3.0 release (github)&lt;br /&gt;
** Moved the repository into github&lt;br /&gt;
** Some major fixes in handling large sample size (&amp;gt;18,000)&lt;br /&gt;
** Other minor bug fixes &lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs (more comprehensive fix is still pending)&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
See [[#Full ChangeLog]] for full details&lt;br /&gt;
&lt;br /&gt;
== Key Features ==&lt;br /&gt;
&lt;br /&gt;
EPACTS currently provides the following set of key features&lt;br /&gt;
* Robust support for widely used format of sequence-based genotypes (VCF) and phenotypes with pedigree (PED)&lt;br /&gt;
** Efficient library for accessing VCF file to reduce computational burden to analyze large-scale sequencing data&lt;br /&gt;
** Support selecting markers by arbitrary combination of substring matching. &lt;br /&gt;
** Support for using genotype dosages instead of hard genotype calls&lt;br /&gt;
** Utilize PED format to perform test across multiple traits.&lt;br /&gt;
* Supports a large number of widely used statistical tests for single variant association and burden tests.&lt;br /&gt;
** See the &amp;quot;Currently Supported Statistical Tests&amp;quot; section below for more information&lt;br /&gt;
* Easy to Highly Parallelize Jobs&lt;br /&gt;
** Makefile-based partition into and ligation of multiple subtasks&lt;br /&gt;
** Parallel run of job is simply adding one parameter when running EPACTS &lt;br /&gt;
* Integrative and versatile framework that allows easy addition of additional statistical test&lt;br /&gt;
** Core input/output routines are implemented in C++&lt;br /&gt;
** Most statistical tests (except for EMMAX) are implemented in R&lt;br /&gt;
** Adding a simple R function to implement additional statistical test (See [[#Implementing Additional Statistical Tests]] for details)&lt;br /&gt;
* Useful utilities for post-association-analysis tasks&lt;br /&gt;
** Automatic functional annotation of associated variants&lt;br /&gt;
** Automatic generation of QQ and Manhattan Plot&lt;br /&gt;
** (TBA) Zoom plot for the significant associations&lt;br /&gt;
&lt;br /&gt;
== Obtaining EPACTS ==&lt;br /&gt;
&lt;br /&gt;
* The official release of EPACTS software is available at https://github.com/statgen/EPACTS&lt;br /&gt;
** From the CSG cluster, it is available at /net/fantasia/home/bin/epacts/&lt;br /&gt;
* Note that R (version 2.10 or higher) and gnuplot (version 4.2 or higher) must be installed in order to run EPACTS correctly.&lt;br /&gt;
&lt;br /&gt;
== Currently Supported Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
EPACTS supports the following sets of widely used statistical tests for single variant tests and burden tests&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.wald &lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logisitic Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (simply used glm in R)&lt;br /&gt;
|-&lt;br /&gt;
| b.score&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Logistic Score Test &amp;lt;br&amp;gt; (from Lin DY and Tang ZZ, AJHG 2011 89:354-67)&lt;br /&gt;
| Clement Ma &amp;amp; Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.firth&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Firth Bias-Corrected Logistic Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.spa&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; &lt;br /&gt;
| Moderate&lt;br /&gt;
| Saddlepoint Approximation Method&lt;br /&gt;
| Shawn Lee &amp;amp; Rounak Dey&lt;br /&gt;
|-&lt;br /&gt;
| b.lrt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.glrt&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Fast&lt;br /&gt;
| Genotype Likelihood Ratio Test &amp;lt;br&amp;gt; (use GL or PL field in VCF to perform case-control test)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.lm&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Linear Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (as implemented in lm in R)&lt;br /&gt;
|-&lt;br /&gt;
| q.linear&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Linear Wald Test&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.emmax&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| EMMAX &amp;lt;br&amp;gt; ( Kang et al (2010) Nat Genet 42:348-54 )&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.collapse&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and 0/1 collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.madsen&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Slow&lt;br /&gt;
| Wilcoxon Rank Sum Test between binary phenotypes and weighted rare variant scores (slightly different version from the published method - it uses pooled allele frequency across cases and controls for weighting each variant)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.wcnt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and weighted rare variant scores&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression of phenotypes on binary collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression of phenotypes on collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| skat&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT-O Test by Lee et al, Biostatistics (2012)&lt;br /&gt;
| Seunggeun Lee &amp;lt;br&amp;gt; (adaptive by Xueling Sim and Hyun Min Kang)&lt;br /&gt;
|-&lt;br /&gt;
| VT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed out first)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable Threshold Test &amp;lt;br&amp;gt; with adaptive permutation &amp;lt;br&amp;gt; Price et al, AJHG (2010) 86:832-8&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxCMC&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Collapsing burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxVT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable-threshold burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| mmskat&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT test using EMMAX&lt;br /&gt;
| Seunggeun Lee &amp;amp; Hyun Min Kang&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Installation Details  ==&lt;br /&gt;
&lt;br /&gt;
If you want to use EPACTS in an Ubuntu platform, following the step below &lt;br /&gt;
&lt;br /&gt;
 $ git clone https://github.com/statgen/EPACTS.git&lt;br /&gt;
 $ cd EPACTS&lt;br /&gt;
 $ ./configure --prefix [/path/to/install]&lt;br /&gt;
 $ make&lt;br /&gt;
 $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Important Note: &#039;&#039;&#039;make sure to specify --prefix=/path/to/install&#039;&#039;&#039; to avoid installing to the default path /usr/local/, which you may not have the permission. /home/your_userid/epacts might be a good one, if you are not sure where to install)&lt;br /&gt;
  &lt;br /&gt;
* Now ${EPACTS_DIR} represents the &#039;/path/to/install&#039; directory&lt;br /&gt;
&lt;br /&gt;
* Download the reference FASTA files from 1000 Genomes FTP automatically by running the following commands&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/epacts download&lt;br /&gt;
&lt;br /&gt;
 (For advanced users, to save time for downloading the FASTA files (~900MB), you may copy a local copy of GRCh37 FASTA file and the index file to ${EPACTS_DIR}/share/EPACTS/)&lt;br /&gt;
&lt;br /&gt;
*Perform a test run by running the following command&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
&lt;br /&gt;
In order to use EPACTS in the CSG cluster, you do not need to install them. You can directly use or make a copy of the in-house release version at &lt;br /&gt;
&lt;br /&gt;
 /net/fantasia/home/hmkang/tools/epacts-3.3.0/bin/epacts/&lt;br /&gt;
&lt;br /&gt;
* If you want to access previous versions, visit http://csg-old.sph.umich.edu/kang/epacts/download&lt;br /&gt;
&lt;br /&gt;
== Getting Started With Examples ==&lt;br /&gt;
If you are using EPACTS from the CSG cluster, please set the following environment variable&lt;br /&gt;
 EPACTS_DIR=/net/fantasia/home/hmkang/tools/epacts-3.3.0/bin/epacts (in bash)&lt;br /&gt;
 setenv EPACTS_DIR /net/fantasia/home/hmkang/tools/epacts-3.3.0/bin/epacts (in csh)&lt;br /&gt;
&lt;br /&gt;
If you downloaded EPACTS binary and please set EPACTS_DIR to the full path of the downloaded and uncompressed directory.&lt;br /&gt;
&lt;br /&gt;
=== All-in-one example ===&lt;br /&gt;
&lt;br /&gt;
To get started with EPACTS, run the following command will perform an example run&lt;br /&gt;
 ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
 &lt;br /&gt;
You will find a series of lines in test_run_epacts.sh script commented out for each possible test. &lt;br /&gt;
&lt;br /&gt;
The example phenotype (PED format) and genotype (VCF format) can be found at&lt;br /&gt;
 ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Test ===&lt;br /&gt;
&lt;br /&gt;
Or You can run EPACTS command yourself by running&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
   --vcf  ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
   --ped  ${EPACTS_DIR}/data/1000G_dummy_pheno.ped  \&lt;br /&gt;
   --min-maf 0.001 --chr 20 --pheno DISEASE --cov AGE --cov SEX --test b.score --anno \ &lt;br /&gt;
   --out out/test --run 2&lt;br /&gt;
&lt;br /&gt;
The command above will perform single variant association test using a dummy case-control phenotype file and a subset of 1000 genomes exome VCF file (chr20) using score test statistic for all variants over 1% of higher MAF using 2 parallel runs.&lt;br /&gt;
&lt;br /&gt;
You will see the 4 output files as the main outcome of the analysis&lt;br /&gt;
&lt;br /&gt;
==== Output Text of All Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The filename is out/test.single.b.score.epacts.gz and the contents will look like&lt;br /&gt;
 $ zcat out/test.single.b.score.epacts.gz | head&lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	68303	68303	20:68303_A/G_Upstream:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68319	68319	20:68319_C/A_Upstream:DEFB125	266	1.4467e-36	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68396	68396	20:68396_C/T_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76635	76635	20:76635_A/T_Intron:DEFB125	266	1.534e-37	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76689	76689	20:76689_T/C_Synonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76690	76690	20:76690_T/C_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76700	76700	20:76700_G/A_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76726	76726	20:76726_C/G_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76771	76771	20:76771_C/T_Nonsynonymous:DEFB125	266	3	1	0.0056391	0.68484	0.40587	145	121	0.013793	0.0082645&lt;br /&gt;
&lt;br /&gt;
==== Output Text of Top Associations ====&lt;br /&gt;
&lt;br /&gt;
Same type of file but containing top 5,000 association will be stored at out/test.epacts.top5000&lt;br /&gt;
&lt;br /&gt;
 $ head out/test.single.b.score.epacts.top5000 &lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	1610894	1610894	20:1610894_G/A_Synonymous:SIRPG	266	138.64	1	0.26061	6.9939e-05	3.9765	145	121	0.65177	0.36476&lt;br /&gt;
 20	4162411	4162411	20:4162411_T/C_Intron:SMOX	266	204	1	0.38346	0.00055583	-3.4523	145	121	0.62759	0.93388&lt;br /&gt;
 20	34061918	34061918	20:34061918_T/C_Intron:CEP250	266	41.815	1	0.0786	0.00095471	3.3035	145	121	0.22543	0.075436&lt;br /&gt;
 20	4155948	4155948	20:4155948_G/A_Intron:SMOX	266	215	1	0.40414	0.0020792	-3.0787	145	121	0.68276	0.95868&lt;br /&gt;
 20	4680251	4680251	20:4680251_A/G_Nonsynonymous:PRNP	266	186	1	0.34962	0.0025962	3.0119	145	121	0.8069	0.57025&lt;br /&gt;
 20	36668874	36668874	20:36668874_G/A_Synonymous:RPRD1B	266	96	1	0.18045	0.003031	2.9646	145	121	0.44828	0.2562&lt;br /&gt;
 20	36641871	36641871	20:36641871_G/A_Synonymous:TTI1	266	10	1	0.018797	0.004308	-2.8547	145	121	0.0068966	0.07438&lt;br /&gt;
 20	1616892	1616892	20:1616892_A/G_Synonymous:SIRPG	266	144	1	0.27068	0.0051239	2.7991	145	121	0.63449	0.42975&lt;br /&gt;
 20	25038372	25038372	20:25038372_G/A_Intron:ACSS1	266	103.3	1	0.19418	0.005748	2.7618	145	121	0.47201	0.28813&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;AC&#039;&#039;&#039; : Total Non-reference Allele Count&lt;br /&gt;
* &#039;&#039;&#039;CALLRATE&#039;&#039;&#039; : Fraction of non-missing genotypes.&lt;br /&gt;
* &#039;&#039;&#039;MAF&#039;&#039;&#039; : Minor allele frequencies&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of single variant test&lt;br /&gt;
* &#039;&#039;&#039;AF.CASE&#039;&#039;&#039; : Non-reference allele frequencies for cases&lt;br /&gt;
* &#039;&#039;&#039;AF.CTRL&#039;&#039;&#039; : Non-reference allele frequencies for controls&lt;br /&gt;
&lt;br /&gt;
==== Q-Q plot of test statistics (stratified by MAF) ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.qq.pdf will be generated as shown below&lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_qq.png]]&lt;br /&gt;
&lt;br /&gt;
==== Manhattan Plot of Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.mh.pdf will be generated for chr20 only. &lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_mh.png]]&lt;br /&gt;
&lt;br /&gt;
An example Genome-wide manhattan plot (from a genome-wide run) will look like below&lt;br /&gt;
&lt;br /&gt;
[[File:tes_b_score_epacts_mh_gw.png]]&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise burden test ===&lt;br /&gt;
&lt;br /&gt;
Gene-wise or group-wise burden test requires two steps. First, &#039;group&#039; file containing the list of &lt;br /&gt;
markers per group needs to be generated. Second, group-wise burden test needs to be run&lt;br /&gt;
&lt;br /&gt;
==== Creating marker group file ====&lt;br /&gt;
&lt;br /&gt;
The marker group file has the following format&lt;br /&gt;
&lt;br /&gt;
 [GROUP_ID]  [MARKER_ID_1]   [MARKER_ID_2]  .... [MARKER_ID_N]&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
* [GROUP_ID] is a string representing the group (e.g. gene name)&lt;br /&gt;
* [MARKER_ID_K] is a marker key as a format of [CHROM]:[POS]_[REF]/[ALT] (NOTE THAT THIS IS DIFFERENT FROM TYPICAL VCF MARKER ID field)&lt;br /&gt;
&lt;br /&gt;
Note that [MARKER_ID_K] has to be sorted by increasing order of genomic coordinate&lt;br /&gt;
&lt;br /&gt;
In order to create gene-level group file from typically formatted VCF file, one may use the following utility &lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --nonsyn&lt;br /&gt;
&lt;br /&gt;
The above command create a file [output-group-file] containing a list of missense and nonsense variants per each gene. To incorporate different types of functional annotations, use --type option as follows&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --type [function_type_1] --type [function_type_2] ...&lt;br /&gt;
&lt;br /&gt;
Type &#039;epacts makegroup -man&#039; for the detailed documentation&lt;br /&gt;
&lt;br /&gt;
==== Annotating VCF file using EPACTS ====&lt;br /&gt;
&lt;br /&gt;
If the VCF is not annotated, &#039;epacts makegroup&#039; cannot be used. In order to annotate VCF, one can use the example VCF using ANNOVAR as follows:&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts anno \&lt;br /&gt;
    --in ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
    --out ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
The epacts anno script will add &amp;quot;ANNO=[function]:[genename]&amp;quot; entry into the INFO field based on gencodeV7 (default) or refGene database.&lt;br /&gt;
&lt;br /&gt;
It is important to check whether the VCF file is already annotated or not in order to avoid no or redundant annotation.&lt;br /&gt;
&lt;br /&gt;
==== Running Groupwise Test ====&lt;br /&gt;
&lt;br /&gt;
To perform a groupwise burden test on the example VCF (annotated as above), run the following command&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --vcf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz \&lt;br /&gt;
   --groupf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.grp --out out/test.gene.skat \&lt;br /&gt;
   --ped ${EPACTS_DIR}/data/1000G_dummy_pheno.ped --maxAF 0.05 \&lt;br /&gt;
   --chr 20 --pheno QT --cov AGE --cov SEX --test skat --skat-o --run 2&lt;br /&gt;
&lt;br /&gt;
==== Example Output ====&lt;br /&gt;
 $ head out/test.gene.skat.epacts.top5000&lt;br /&gt;
 #CHROM BEGIN   END     MARKER_ID       NS      FRAC_WITH_RARE     NUM_ALL_VARS    NUM_PASS_VARS   NUM_SING_VARS   PVALUE  STATRHO&lt;br /&gt;
 20     62607037        62608720        20:62607037-62608720_SAMD10     266     0.14662 9       5       1       0.0020064       1&lt;br /&gt;
 20     2816211 2820493 20:2816211-2820493_FAM113A      266     0.011278        12      2       1       0.0032542       0&lt;br /&gt;
 20     47245987        47361692        20:47245987-47361692_PREX1      266     0.1391  54      9       6       0.0054849       1&lt;br /&gt;
 20     34761734        34810279        20:34761734-34810279_EPB41L1    266     0.071429        14      7       5       0.0068492       0.2&lt;br /&gt;
 20     61340671        61391602        20:61340671-61391602_NTSR1      266     0.11278 24      9       3       0.011063        1&lt;br /&gt;
 20     48561952        48568644        20:48561952-48568644_RNF114     266     0.011278        4       2       1       0.015175        0.2&lt;br /&gt;
 20     60962895        60963559        20:60962895-60963559_RPS21      266     0.06015 6       3       2       0.016409        0&lt;br /&gt;
 20     55904961        55917801        20:55904961-55917801_SPO11      266     0.011278        11      3       3       0.018031        0&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;FRAC_WITH_RARE&#039;&#039;&#039; : Fraction of individual carrying rare variants below --max-maf (default : 0.05) threshold.&lt;br /&gt;
* &#039;&#039;&#039;NUM_ALL_VARS&#039;&#039;&#039; : Number of all variants defining the group.&lt;br /&gt;
* &#039;&#039;&#039;NUM_PASS_VARS&#039;&#039;&#039; : Number of variants passing the --min-maf, --min-mac, --max-maf, --min-callrate thresholds&lt;br /&gt;
* &#039;&#039;&#039;NUM_SING_VARS&#039;&#039;&#039; : Number of singletons among variants in NUM_PASS_VARS&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of burden tests&lt;br /&gt;
* Other columns are test specific auxiliary columns. For example, in the VT test, the optimal MAF threshold is recorded as an auxiliary output column.&lt;br /&gt;
&lt;br /&gt;
=== Specialized Instruction for EMMAX tests ===&lt;br /&gt;
&lt;br /&gt;
EMMAX (Efficient Mixed Model Association eXpedited - Kang et al (2010) Nat Genet 42:348-54) is an efficient implementation of mixed model association accounting for sample structure including population structure and hidden relatedness. Currently EPACTS supports EMMAX association mapping in single variant test and CMC-like burden tests. &lt;br /&gt;
&lt;br /&gt;
Because EMMAX is based on linear model, the method fits better to quantiative traits than binary traits. However, p-values for binary traits are expected to be valid in the spirit of Armitage trend test, although the estimated effect size may not be precise.&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
==== Single Variant EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : From VCF, we recommend to set a MAF (e.g. 0.01) and call rate (e.g. 0.95) threshold to select high-quality markers to generate kinship matrix as follows.&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-kin \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped (Optional)] --min-maf 0.01 --minCallRate 0.95 \&lt;br /&gt;
  --sepchr (if VCF is separated by chromosome) --out [outprefix.kinf] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
If you provide [input.ped] file, then it will calculate the subset the individuals contained in the PED file. &lt;br /&gt;
&lt;br /&gt;
The procedure above will create a file [outprefix.kinf] after splitting and merging the genomes into multiple pieces. If only a certain subset of SNPs needs to be considered due to target regions, LD-pruning, or any other reasons, a VCF containing the subset of markers must be created beforehand and should be used as input VCF file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Perform Single Variant Association&#039;&#039;&#039; : From VCF and PED, we recommend to use less stringent MAF threshold (e.g. 0.001) and call rate (e.g. 0.50) to perform single variant association&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --min-maf 0.001 --kin [outputprefix.kinf] \&lt;br /&gt;
  --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] --test q.emmax \&lt;br /&gt;
  --out [outprefix] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
The procedure above will perform single variant association analysis compatible to other types of single variant association analyses implemented in EPACTS&lt;br /&gt;
&lt;br /&gt;
==== Burden-style EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : See &#039;Creating Kinship Matrix&#039; section in [[#Single Variant EMMAX Association Analysis]]&lt;br /&gt;
* &#039;&#039;&#039;Create Marker Group&#039;&#039;&#039;&lt;br /&gt;
** By annotating the VCF and extracting missense and nonsense variants&lt;br /&gt;
*** [[#Annotating VCF file using ANNOVAR]] - This step will be required to create marker group file&lt;br /&gt;
*** [[#Creating marker group file]] - Assume that [group.grp] file is produced&lt;br /&gt;
** Or, by creating your own marker group information&lt;br /&gt;
*** See [[#Creating marker group file]] for details&lt;br /&gt;
* Run CMC-style burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxCMC --out [outprefix] &lt;br /&gt;
* Run Variable Threshold burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxVT --out [outprefix]&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Own Input Data ==&lt;br /&gt;
&lt;br /&gt;
=== VCF file for Genotypes ===&lt;br /&gt;
&lt;br /&gt;
EPACTS support VCF files as input for association with the following requirement&lt;br /&gt;
* Input VCF file must be bgzipped and tabixed before running association to allow efficient random access of the file. Below is an example command to conver plain VCF into bgzipped and tabixed VCF&lt;br /&gt;
  bgzip input.vcf     ## this command will produce input.vcf.gz&lt;br /&gt;
  tabix -pvcf -f input.vcf.gz  ## this command will produce input.vcf.gz.tbi&lt;br /&gt;
* If the VCF file is separated by chromosome, the VCF file specified in the input argument must contain the string &amp;quot;chr1&amp;quot; in the chromosome 1 file, and corresponding chromosome name for other chromosomes. Thus, the files names should be like &amp;lt;code&amp;gt;[prefix]chr1[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chr2[suffix].vcf.gz&amp;lt;/code&amp;gt;, ..., &amp;lt;code&amp;gt;[prefix]chr22[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chrX[suffix].vcf.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Sample IDs in the VCF file must be consistent to those from PED file&lt;br /&gt;
* Currently EPACTS only support bi-allelic variants, but it handles SNPs, INDELs, snd SVs.&lt;br /&gt;
* Currently, EPACTS only support VCF aligned with NCBI build 37 coordinates&lt;br /&gt;
* An example VCF file from 1000 genome project is below. &lt;br /&gt;
 $ zcat example/1000G_integrated_phase1_chr20.vcf.gz | cut -f 1-10 | head -50 &lt;br /&gt;
 ##fileformat=VCFv4.1&lt;br /&gt;
 ##INFO=&amp;lt;ID=LCSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Low coverage VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=EXSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Exome VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=INDEL,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in INDEL VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SV,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in SV VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BAVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BRSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality estimate from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=LDAF,Number=1,Type=Float,Description=&amp;quot;MLE Allele Frequency Accounting for LD&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=RSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=ERATE,Number=1,Type=Float,Description=&amp;quot;Per-marker Mutation rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=THETA,Number=1,Type=Float,Description=&amp;quot;Per-marker Transition rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIEND,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around END for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIPOS,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around POS for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=END,Number=1,Type=Integer,Description=&amp;quot;End position of the variant described in this record&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMLEN,Number=.,Type=Integer,Description=&amp;quot;Length of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMSEQ,Number=.,Type=String,Description=&amp;quot;Sequence of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SOURCE,Number=.,Type=String,Description=&amp;quot;Source of deletion call&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVLEN,Number=1,Type=Integer,Description=&amp;quot;Difference in length between REF and ALT alleles&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVTYPE,Number=1,Type=String,Description=&amp;quot;Type of structural variant&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AC,Number=.,Type=Integer,Description=&amp;quot;Alternate Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AN,Number=1,Type=Integer,Description=&amp;quot;Total Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##ALT=&amp;lt;ID=DEL,Description=&amp;quot;Deletion&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GT,Number=1,Type=String,Description=&amp;quot;Genotype&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=DS,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GL,Number=.,Type=Float,Description=&amp;quot;Genotype Likelihoods&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=BD,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 #CHROM POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  HG00096&lt;br /&gt;
 20 60479   .   C   T   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.894;LDAF=0.0020;AVGPOST=0.9995;RSQ=0.8779;ERATE=0.0005;THETA=0.0008;AC=4;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.19,-0.46,-2.68:0.0022&lt;br /&gt;
 20 60522   .   T   TC  1588    PASS    INDEL;BAVGPOST=1.000;BRSQ=0.994;LDAF=0.0116;AVGPOST=0.9980;RSQ=0.9327;ERATE=0.0004;THETA=0.0167;AC=24;AN=2184   GT:DS:GL:BD 0|0:0.000:0.00,-0.90,-9.20:0&lt;br /&gt;
 20 60571   .   C   A   100 PASS    LCSNP;EXSNP;BAVGPOST=0.999;BRSQ=0.813;LDAF=0.0029;AVGPOST=0.9986;RSQ=0.8085;ERATE=0.0014;THETA=0.0014;AC=5;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.05,-0.96,-5.00:0.0008&lt;br /&gt;
 20 60795   .   G   C   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.930;LDAF=0.0006;AVGPOST=0.9996;RSQ=0.7205;ERATE=0.0003;THETA=0.0041;AC=1;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.03,-1.21,-5.00:0.0001&lt;br /&gt;
 20 60810   .   G   GA  127 PASS    INDEL;BAVGPOST=1.000;BRSQ=0.862;LDAF=0.0013;AVGPOST=0.9987;RSQ=0.5684;ERATE=0.0004;THETA=0.0061;AC=2;AN=2184    GT:DS:GL:BD 0|0:0.000:0.00,-1.80,-18.80:0&lt;br /&gt;
&lt;br /&gt;
=== PED file for Phenotypes and Covariates ===&lt;br /&gt;
&lt;br /&gt;
EPACTS accepts a PED format supported by MERLIN or PLINK software to represent phenotypes. For example, the example.ped file and example.dat file can represent the phenotypes and corresponding column name (from 6th column and after). &lt;br /&gt;
&lt;br /&gt;
 $ head example.ped&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
 $ cat example.dat&lt;br /&gt;
 A DISEASE&lt;br /&gt;
 T QT&lt;br /&gt;
 T AGE&lt;br /&gt;
&lt;br /&gt;
EPACTS also accept a PED format with header information. The above file can be combined into one file as follows&lt;br /&gt;
&lt;br /&gt;
 $ head data/1000G_dummy_pheno.ped&lt;br /&gt;
 #FAM_ID    IND_ID  FAT_ID  MOT_ID  SEX DISEASE QT  AGE&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
The column names can be used to identify the names of phenotypes and covariates in the analysis.&lt;br /&gt;
&lt;br /&gt;
== Frequently Asked Questions ==&lt;br /&gt;
=== Installation ===&lt;br /&gt;
# How should I install EPACTS? &lt;br /&gt;
#* See [[EPACTS#Installation_Details | Installation Details]]&lt;br /&gt;
# I am having the following error message &#039;&#039;&#039;configure: error: libR.{so,a} was not found. Please install it at http://www.r-project.org/ first&#039;&#039;&#039;. What do I have to do?&lt;br /&gt;
#* First, you need to find out where R was installed. Try to type &amp;quot;locate libR.so&amp;quot; and see if it returns anything&lt;br /&gt;
#* If &amp;quot;locate libR.so&amp;quot; returns you something, as explained [[EPACTS#Installation_Details | Installation Details]], try to add &amp;quot;LDFLAGS=-L/path/to/R/library&amp;quot; and rerun &#039;&#039;&#039;configure&#039;&#039;&#039; and &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
#* If you cannot find libR.so, you make have to recompile R with --enable-R-shlib option as described in http://cran.r-project.org/doc/manuals/R-admin.html#Installation&lt;br /&gt;
&lt;br /&gt;
=== Input Files ===&lt;br /&gt;
# What is VCF?&lt;br /&gt;
#* VCF refers to Variant Call Format&lt;br /&gt;
#* See [[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 1000 Genomes wiki page]] for the detailed description of VCF format&lt;br /&gt;
# Should input VCF be compressed into certain format?&lt;br /&gt;
#* Correct. EPACTS assumes that VCF file is bgzipped and tabixed already.&lt;br /&gt;
#* See [[#VCF file for Genotypes]] for details.&lt;br /&gt;
# What are the additional requirements for input VCF file?&lt;br /&gt;
#* Input VCF file used for association mapping must contain individual genotype information at 10-th or higher order columns.&lt;br /&gt;
#* GT field must be encoded as haploid or diploid&lt;br /&gt;
#* Bi-allelic SNPs only : Currently EPACTS may not handle multi-allelic SNPs correctly.&lt;br /&gt;
#* If non-GT field is used, the field is considered as dosage and should be a single numeric value.&lt;br /&gt;
# What are the acceptable input format to encode phenotypes and covariates?&lt;br /&gt;
#* See [[#PED file for Phenotypes and Covariates]] for the detailed information&lt;br /&gt;
# How should I encode binary phenotypes?&lt;br /&gt;
#* If you encode your phenotypes into two different numeric values (e.g. 0/1 or 1/2), EPACTS will automatically recognize them as binary phenotypes and encode them into 1/2 values. Higher value will be considered as cases for case-control association&lt;br /&gt;
# How should I encode missing genotypes?&lt;br /&gt;
#* The default code missing phenotypes in EPACTS are &#039;NA&#039;&lt;br /&gt;
#* One may use --missing option to specify different types of missing values&lt;br /&gt;
#* The encoding of missing genotypes follows the VCF specificiation&lt;br /&gt;
# How do I match the relationship between VCF and PED input files?&lt;br /&gt;
#* EPACTS will assume that the individual IDs in each VCF and PED file are unique, and they follow the saming convention. Thus, the individual IDs overlapping between VCF and PED files will be considered in the associations&lt;br /&gt;
# How the individuals with missing phenotypes are handled?&lt;br /&gt;
#* Currently, EPACTS will automatically remove the individuals without phenotypes or covariates. If one wants to use imputed covariates to increase sample size, the PED file must contain the imputed covariate values.&lt;br /&gt;
#* Markers with missing genotypes won&#039;t be discarded automatically. It can be explicitly discarded by --minCallRate option when performing association&lt;br /&gt;
&lt;br /&gt;
=== Output Files ===&lt;br /&gt;
# Which output files should I be looking at?&lt;br /&gt;
#* [[#Output Text of Top Associations]] is the key file to look at the individual top associations&lt;br /&gt;
#* [[#Q-Q plot of test statistics (stratified by MAF)]] will be important to see the global distribution of test statistics and examine if there are apparent inflation of test statistics&lt;br /&gt;
#* [[#Manhattan Plot of Test Statistics]] will inform us the genome-wide distribution of association signals&lt;br /&gt;
#* [[#Output Text of All Test Statistics]] will contain the full information of test results across all units tested&lt;br /&gt;
# The Q-Q and Manhattan plots cannot be found. Why?&lt;br /&gt;
#* It is probably because gnuplot 4.2 or higher is not installed in your system, or they are included but cannot be found in your ${PATH}. Please visit [[http://gnuplot.info/ GNUPLOT web page]] for installation.&lt;br /&gt;
# How can I read the EMMAX kinship file from produced from EPACTS?&lt;br /&gt;
# * You can run the following command to dump your kinship matrix into a human-readable text format.&lt;br /&gt;
 $(EPACTS_DIR)/bin/epacts/bin/pEmmax kin-util --kinf [input.kinf] --outf [output.prefix] --dump&lt;br /&gt;
&lt;br /&gt;
=== More questions ===&lt;br /&gt;
# If you have more questions, please contact [[mailto:hmkang@umich.edu Hyun Min Kang]].&lt;br /&gt;
&lt;br /&gt;
== Detailed Options ==&lt;br /&gt;
&lt;br /&gt;
The detailed options can viewed by running the following commands&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts -man           (for overall structure) &lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts single -man    (for single variant test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts group -man     (for groupwise test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts anno -man      (for annotation)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts plot -man      (for QQ and Manhattan plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts zoom -man      (for zoom plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts meta -man      (for meta-analysis)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts make-group -man (for creating gene group)&lt;br /&gt;
&lt;br /&gt;
== Implementing Additional Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
In order to add additional statistical test to EPACTS, the following procedure are recommended&lt;br /&gt;
&lt;br /&gt;
# Create a file named &#039;single.[testname].R&#039; for single variant test or &#039;gene.[testname].R&#039; for gene-level test under ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
# Test your implementation using --test [testname] option to perform sanity check and debugging&lt;br /&gt;
# If you want to add your test in the official in-house version, please send your code to Hyun&lt;br /&gt;
&lt;br /&gt;
Below is an example of a single variant test implementation ( single.q.lm.R )&lt;br /&gt;
 ## Core functions of EPACTS to perform association&lt;br /&gt;
 &lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## SINGLE VARIANT TEST&lt;br /&gt;
 ## INPUT VARIABLES:&lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   NS       : number of called samples&lt;br /&gt;
 ##   AC       : allele count&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:nrow(NS) after AF/AC threshold&lt;br /&gt;
 ##   genos    : genotype matrix (after AF/AC threshold)&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional columns to add&lt;br /&gt;
 ##   cname    : column names for additional columns&lt;br /&gt;
 ##################################################################  &lt;br /&gt;
 &lt;br /&gt;
 ## single.lm() : Use built-in lm() function to perform association&lt;br /&gt;
 ## KEY FEATURES : SIMPLE, BUT MAY BE SLOW&lt;br /&gt;
 ##                GOOD SNIPPLET TO START A NEW FUNCTION&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, TSTAT&lt;br /&gt;
 ## MISSING VALUES : IGNORED&lt;br /&gt;
 single.q.lm &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;TSTAT&amp;quot;) # column names for additional variables in the EPACTS output&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   p &amp;lt;- rep(NA,m)&lt;br /&gt;
   add &amp;lt;- matrix(NA,m,3) ## BETA, SEBETA, TSTAT&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
    for(i in 1:m) {&lt;br /&gt;
      r &amp;lt;- summary(lm(pheno~genos[i,]+cov-1))$coefficients[1,]  # run simple linear regression&lt;br /&gt;
      p[i] &amp;lt;- r[4]   # store p-value to p[i]&lt;br /&gt;
      add[i,] &amp;lt;- r[1:3] # store additional variables to add[i,]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  return(list(p=p,add=add,cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
As described in the comment, you may assume that the following variables are available for use for testing association across m markers&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker&lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (m * 1 vector) : p-value matrix as output&lt;br /&gt;
* add (m * c matrix) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# AC : Non-ref allele count&lt;br /&gt;
# CALLRATE : Call rate = NS/n&lt;br /&gt;
# MAF : Minor allele frequency&lt;br /&gt;
# PVALUE : P-values&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
Below is an example of a gene-lvel variant test implementation ( single.q.lm.R )&lt;br /&gt;
&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## GENE-LEVEL BURDEN TEST&lt;br /&gt;
 ## INPUT VARIABLES: &lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   genos    : genotype matrix for each gene&lt;br /&gt;
 ##   NS       : number of called samples for each marker&lt;br /&gt;
 ##   AC       : allele count for each marker&lt;br /&gt;
 ##   MAC      : minor allele count for each marker&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:n after AF/AC threshold&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional column values&lt;br /&gt;
 ##   cname    : additional column names&lt;br /&gt;
 ##################################################################      &lt;br /&gt;
 &lt;br /&gt;
 ## gene.q.reverse() : Reverse logistic regression&lt;br /&gt;
 ## KEY FEATURES : 0/1 collapsing variable ~ rare variants&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE (GAUSSIAN)&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, ZSTAT&lt;br /&gt;
 ## MISSING VALUE : IMPUTED AS MAJOR ALLELES&lt;br /&gt;
 gene.q.reverse &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;ZSTAT&amp;quot;)&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
     g &amp;lt;- as.double(colSums(genos,na.rm=T) &amp;gt; 0)&lt;br /&gt;
     sg &amp;lt;- sum(g)&lt;br /&gt;
     if ( ( sg &amp;gt; 0 ) &amp;amp;&amp;amp; ( sg &amp;lt; n ) ) {&lt;br /&gt;
       r &amp;lt;- glm(g~pheno+cov-1,family=binomial)&lt;br /&gt;
        if ( ( r$converged ) &amp;amp;&amp;amp; ( ! r$boundary ) ) {&lt;br /&gt;
         return(list(p=summary(r)$coefficients[1,4],&lt;br /&gt;
                     add=summary(r)$coefficients[1,1:3],&lt;br /&gt;
                     cname=cname))&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   return(list(p=NA,add=rep(NA,3),cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Similar to gene-level test, you may assume the following variables exist for testing A SINGLE GENE. Note that M is the number of markers spanning the gene region&lt;br /&gt;
&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker &lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAC (M * 1 vector) : Minor allele count&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (scalar) : p-value matrix as output&lt;br /&gt;
* add (c * 1 vector) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# MAF_BURDEN : MAF of 0/1 collapsing variables (existence of rare variants)&lt;br /&gt;
# NUM_ALL_VARS : Number of all variants within the gene&lt;br /&gt;
# NUM_RARE_VARS : Number of rare variants below the max-MAF threshold&lt;br /&gt;
# NUM_SING_VARS : Number of singleton variants&lt;br /&gt;
# PVALUE : P-value from the test&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
== Full ChangeLog ==&lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs&lt;br /&gt;
** Some known bugs still exist &lt;br /&gt;
*** SKAT-O Lambda eigenvalue error. This happenes in a particular context but haven&#039;t nailed down a way to prevent it yet.&lt;br /&gt;
*** EMMAX has case and control frequency flipped.&lt;br /&gt;
* EMMAX test has a silly known bug with case / ctrl frequency is flipped&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
* February 28th, 2013 : EPACTS v3.2.0 release&lt;br /&gt;
** R package installation bug (for some users) was fixed&lt;br /&gt;
** A bug in the MAF error for high frequency variants (AF&amp;gt;0.25) was now fixed&lt;br /&gt;
** SKAT version is updated to 0.81&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
* December 4th, 2012 : EPACTS v3.1.0 release&lt;br /&gt;
** Removed dependency on libR.so&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** November 25th, 2012 : EPACTS v3.0.0 release&lt;br /&gt;
** Restructured with source code release (with autoconf / automake / libtools)&lt;br /&gt;
** Added zoom plot feature&lt;br /&gt;
** FRAC_BURDEN keyword was replace to FRAC_WITH_RARE for groupwise testing&lt;br /&gt;
* October 26th, 2012 : EPACTS v2.2.0-beta is released with the following updates&lt;br /&gt;
** Added --max-mac option&lt;br /&gt;
** Fixed Firth&#039;s bias-corrected test (by Clement Ma)&lt;br /&gt;
** Added more informative warning messages when index files do not exist&lt;br /&gt;
** Fixed the bug in the epacts-plot in plotting ties&lt;br /&gt;
** Fixed errors in the MAF estimates per case and control&lt;br /&gt;
** Fixed bug in --minRSQ option&lt;br /&gt;
* September 28, 2012 : EPACTS v2.11-beta is released with the following updates&lt;br /&gt;
** Counts and allele frequencies for case/control added for binary tests&lt;br /&gt;
** --max-maf parameter is added&lt;br /&gt;
** Fixed EMMAX error in MAF in the output&lt;br /&gt;
** More informative error messages &lt;br /&gt;
* September 27, 2012 : EPACTS v2.1-beta is released with the following updates&lt;br /&gt;
** EMMAX interface is changed. --kinOnly option is related with a new command &#039;&#039;&#039;make-kin&#039;&#039;&#039; &lt;br /&gt;
** SKAT-O is upgraded to version 0.77 with additional configurable parameter settings&lt;br /&gt;
** Some parameter names are renamed (e.g. --min-maf, --min-mac)&lt;br /&gt;
** Many minor bugs are fixed&lt;br /&gt;
* Jul 6, 2012 : EPACTS v2.01-beta is released with the following updates&lt;br /&gt;
** SKAT-O is upgraded to version 0.76&lt;br /&gt;
** Fixed minor bugs in option names (Thanks to Xueling Sim)&lt;br /&gt;
* Jul 3, 2012 : EPACTS v2.0-beta is released with the following updates&lt;br /&gt;
** Major restructuring of the software&lt;br /&gt;
** Annotation software is switched with built-in application&lt;br /&gt;
** Addition of SKAT-O and EMMAX burden test&lt;br /&gt;
** Minor bug fixes&lt;br /&gt;
* Apr 8, 2012 : EPACTS v1.2-alpha is released with the following updates, in addition to the following updates&lt;br /&gt;
** EMMAX bug in handling covariates was fixed&lt;br /&gt;
** Variable Threshold Test is added&lt;br /&gt;
** Variable Threshold Test with genomic score (e.g. GERP or PhyloP) is added.&lt;br /&gt;
* Apr 4, 2012 : EPACTS v1.1-alpha is released with the following updates, in addition to minor updates&lt;br /&gt;
** EMMAX burden test (Hyun Min Kang)&lt;br /&gt;
** Likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of Firth bias-corrected likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of EMMAX single variant test (Hyun Min Kang) &lt;br /&gt;
* Mar 29, 2012 : EPACTS v1.0-alpha is released&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14516</id>
		<title>EPACTS</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14516"/>
		<updated>2016-12-15T22:50:03Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Installation Details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;EPACTS&#039;&#039;&#039; (Efficient and Parallelizable Association Container Toolbox) is a versatile software pipeline to perform various statistical tests for identifying genome-wide association from sequence data through a user-friendly interface, both to scientific analysts and to method developers.&lt;br /&gt;
&lt;br /&gt;
== Join in EPACTS mailing list ==&lt;br /&gt;
&lt;br /&gt;
Please join in the [http://groups.google.com/group/epacts EPACTS Google Group] to ask / discuss / comment about EPACTS.&lt;br /&gt;
&lt;br /&gt;
== Lastest ChangeLog ==&lt;br /&gt;
* Dec 15th, 2016 : EPACTS v3.3.0 release (github)&lt;br /&gt;
** Moved the repository into github&lt;br /&gt;
** Some major fixes in handling large sample size (&amp;gt;18,000)&lt;br /&gt;
** Other minor bug fixes &lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs (more comprehensive fix is still pending)&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
See [[#Full ChangeLog]] for full details&lt;br /&gt;
&lt;br /&gt;
== Key Features ==&lt;br /&gt;
&lt;br /&gt;
EPACTS currently provides the following set of key features&lt;br /&gt;
* Robust support for widely used format of sequence-based genotypes (VCF) and phenotypes with pedigree (PED)&lt;br /&gt;
** Efficient library for accessing VCF file to reduce computational burden to analyze large-scale sequencing data&lt;br /&gt;
** Support selecting markers by arbitrary combination of substring matching. &lt;br /&gt;
** Support for using genotype dosages instead of hard genotype calls&lt;br /&gt;
** Utilize PED format to perform test across multiple traits.&lt;br /&gt;
* Supports a large number of widely used statistical tests for single variant association and burden tests.&lt;br /&gt;
** See the &amp;quot;Currently Supported Statistical Tests&amp;quot; section below for more information&lt;br /&gt;
* Easy to Highly Parallelize Jobs&lt;br /&gt;
** Makefile-based partition into and ligation of multiple subtasks&lt;br /&gt;
** Parallel run of job is simply adding one parameter when running EPACTS &lt;br /&gt;
* Integrative and versatile framework that allows easy addition of additional statistical test&lt;br /&gt;
** Core input/output routines are implemented in C++&lt;br /&gt;
** Most statistical tests (except for EMMAX) are implemented in R&lt;br /&gt;
** Adding a simple R function to implement additional statistical test (See [[#Implementing Additional Statistical Tests]] for details)&lt;br /&gt;
* Useful utilities for post-association-analysis tasks&lt;br /&gt;
** Automatic functional annotation of associated variants&lt;br /&gt;
** Automatic generation of QQ and Manhattan Plot&lt;br /&gt;
** (TBA) Zoom plot for the significant associations&lt;br /&gt;
&lt;br /&gt;
== Obtaining EPACTS ==&lt;br /&gt;
&lt;br /&gt;
* The official release of EPACTS software is available at https://github.com/statgen/EPACTS&lt;br /&gt;
** From the CSG cluster, it is available at /net/fantasia/home/bin/epacts/&lt;br /&gt;
* Note that R (version 2.10 or higher) and gnuplot (version 4.2 or higher) must be installed in order to run EPACTS correctly.&lt;br /&gt;
&lt;br /&gt;
== Currently Supported Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
EPACTS supports the following sets of widely used statistical tests for single variant tests and burden tests&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.wald &lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logisitic Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (simply used glm in R)&lt;br /&gt;
|-&lt;br /&gt;
| b.score&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Logistic Score Test &amp;lt;br&amp;gt; (from Lin DY and Tang ZZ, AJHG 2011 89:354-67)&lt;br /&gt;
| Clement Ma &amp;amp; Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.firth&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Firth Bias-Corrected Logistic Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.spa&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; &lt;br /&gt;
| Moderate&lt;br /&gt;
| Saddlepoint Approximation Method&lt;br /&gt;
| Shawn Lee &amp;amp; Rounak Dey&lt;br /&gt;
|-&lt;br /&gt;
| b.lrt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.glrt&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Fast&lt;br /&gt;
| Genotype Likelihood Ratio Test &amp;lt;br&amp;gt; (use GL or PL field in VCF to perform case-control test)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.lm&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Linear Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (as implemented in lm in R)&lt;br /&gt;
|-&lt;br /&gt;
| q.score&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Quantitative Score Test &amp;lt;br&amp;gt; (from Lin DY and Tang ZZ, AJHG 2011 89:354-67)&lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| q.linear&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Linear Wald Test&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.emmax&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| EMMAX &amp;lt;br&amp;gt; ( Kang et al (2010) Nat Genet 42:348-54 )&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.collapse&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and 0/1 collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.madsen&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Slow&lt;br /&gt;
| Wilcoxon Rank Sum Test between binary phenotypes and weighted rare variant scores (slightly different version from the published method - it uses pooled allele frequency across cases and controls for weighting each variant)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.wcnt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and weighted rare variant scores&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression of phenotypes on binary collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression of phenotypes on collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| skat&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT-O Test by Lee et al, Biostatistics (2012)&lt;br /&gt;
| Seunggeun Lee &amp;lt;br&amp;gt; (adaptive by Xueling Sim and Hyun Min Kang)&lt;br /&gt;
|-&lt;br /&gt;
| VT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed out first)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable Threshold Test &amp;lt;br&amp;gt; with adaptive permutation &amp;lt;br&amp;gt; Price et al, AJHG (2010) 86:832-8&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxCMC&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Collapsing burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxVT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable-threshold burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| mmskat&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT test using EMMAX&lt;br /&gt;
| Seunggeun Lee &amp;amp; Hyun Min Kang&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Installation Details  ==&lt;br /&gt;
&lt;br /&gt;
If you want to use EPACTS in an Ubuntu platform, following the step below &lt;br /&gt;
&lt;br /&gt;
 $ git clone https://github.com/statgen/EPACTS.git&lt;br /&gt;
 $ cd EPACTS&lt;br /&gt;
 $ ./configure --prefix [/path/to/install]&lt;br /&gt;
 $ make&lt;br /&gt;
 $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Important Note: &#039;&#039;&#039;make sure to specify --prefix=/path/to/install&#039;&#039;&#039; to avoid installing to the default path /usr/local/, which you may not have the permission. /home/your_userid/epacts might be a good one, if you are not sure where to install)&lt;br /&gt;
  &lt;br /&gt;
* Now ${EPACTS_DIR} represents the &#039;/path/to/install&#039; directory&lt;br /&gt;
&lt;br /&gt;
* Download the reference FASTA files from 1000 Genomes FTP automatically by running the following commands&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/epacts download&lt;br /&gt;
&lt;br /&gt;
 (For advanced users, to save time for downloading the FASTA files (~900MB), you may copy a local copy of GRCh37 FASTA file and the index file to ${EPACTS_DIR}/share/EPACTS/)&lt;br /&gt;
&lt;br /&gt;
*Perform a test run by running the following command&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
&lt;br /&gt;
In order to use EPACTS in the CSG cluster, you do not need to install them. You can directly use or make a copy of the in-house release version at &lt;br /&gt;
&lt;br /&gt;
 /net/fantasia/home/hmkang/tools/epacts-3.3.0/bin/epacts/&lt;br /&gt;
&lt;br /&gt;
* If you want to access previous versions, visit http://csg-old.sph.umich.edu/kang/epacts/download&lt;br /&gt;
&lt;br /&gt;
== Getting Started With Examples ==&lt;br /&gt;
If you are using EPACTS from the CSG cluster, please set the following environment variable&lt;br /&gt;
 EPACTS_DIR=/net/fantasia/home/hmkang/tools/epacts-3.3.0/bin/epacts (in bash)&lt;br /&gt;
 setenv EPACTS_DIR /net/fantasia/home/hmkang/tools/epacts-3.3.0/bin/epacts (in csh)&lt;br /&gt;
&lt;br /&gt;
If you downloaded EPACTS binary and please set EPACTS_DIR to the full path of the downloaded and uncompressed directory.&lt;br /&gt;
&lt;br /&gt;
=== All-in-one example ===&lt;br /&gt;
&lt;br /&gt;
To get started with EPACTS, run the following command will perform an example run&lt;br /&gt;
 ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
 &lt;br /&gt;
You will find a series of lines in test_run_epacts.sh script commented out for each possible test. &lt;br /&gt;
&lt;br /&gt;
The example phenotype (PED format) and genotype (VCF format) can be found at&lt;br /&gt;
 ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Test ===&lt;br /&gt;
&lt;br /&gt;
Or You can run EPACTS command yourself by running&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
   --vcf  ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
   --ped  ${EPACTS_DIR}/data/1000G_dummy_pheno.ped  \&lt;br /&gt;
   --min-maf 0.001 --chr 20 --pheno DISEASE --cov AGE --cov SEX --test b.score --anno \ &lt;br /&gt;
   --out out/test --run 2&lt;br /&gt;
&lt;br /&gt;
The command above will perform single variant association test using a dummy case-control phenotype file and a subset of 1000 genomes exome VCF file (chr20) using score test statistic for all variants over 1% of higher MAF using 2 parallel runs.&lt;br /&gt;
&lt;br /&gt;
You will see the 4 output files as the main outcome of the analysis&lt;br /&gt;
&lt;br /&gt;
==== Output Text of All Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The filename is out/test.single.b.score.epacts.gz and the contents will look like&lt;br /&gt;
 $ zcat out/test.single.b.score.epacts.gz | head&lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	68303	68303	20:68303_A/G_Upstream:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68319	68319	20:68319_C/A_Upstream:DEFB125	266	1.4467e-36	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68396	68396	20:68396_C/T_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76635	76635	20:76635_A/T_Intron:DEFB125	266	1.534e-37	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76689	76689	20:76689_T/C_Synonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76690	76690	20:76690_T/C_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76700	76700	20:76700_G/A_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76726	76726	20:76726_C/G_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76771	76771	20:76771_C/T_Nonsynonymous:DEFB125	266	3	1	0.0056391	0.68484	0.40587	145	121	0.013793	0.0082645&lt;br /&gt;
&lt;br /&gt;
==== Output Text of Top Associations ====&lt;br /&gt;
&lt;br /&gt;
Same type of file but containing top 5,000 association will be stored at out/test.epacts.top5000&lt;br /&gt;
&lt;br /&gt;
 $ head out/test.single.b.score.epacts.top5000 &lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	1610894	1610894	20:1610894_G/A_Synonymous:SIRPG	266	138.64	1	0.26061	6.9939e-05	3.9765	145	121	0.65177	0.36476&lt;br /&gt;
 20	4162411	4162411	20:4162411_T/C_Intron:SMOX	266	204	1	0.38346	0.00055583	-3.4523	145	121	0.62759	0.93388&lt;br /&gt;
 20	34061918	34061918	20:34061918_T/C_Intron:CEP250	266	41.815	1	0.0786	0.00095471	3.3035	145	121	0.22543	0.075436&lt;br /&gt;
 20	4155948	4155948	20:4155948_G/A_Intron:SMOX	266	215	1	0.40414	0.0020792	-3.0787	145	121	0.68276	0.95868&lt;br /&gt;
 20	4680251	4680251	20:4680251_A/G_Nonsynonymous:PRNP	266	186	1	0.34962	0.0025962	3.0119	145	121	0.8069	0.57025&lt;br /&gt;
 20	36668874	36668874	20:36668874_G/A_Synonymous:RPRD1B	266	96	1	0.18045	0.003031	2.9646	145	121	0.44828	0.2562&lt;br /&gt;
 20	36641871	36641871	20:36641871_G/A_Synonymous:TTI1	266	10	1	0.018797	0.004308	-2.8547	145	121	0.0068966	0.07438&lt;br /&gt;
 20	1616892	1616892	20:1616892_A/G_Synonymous:SIRPG	266	144	1	0.27068	0.0051239	2.7991	145	121	0.63449	0.42975&lt;br /&gt;
 20	25038372	25038372	20:25038372_G/A_Intron:ACSS1	266	103.3	1	0.19418	0.005748	2.7618	145	121	0.47201	0.28813&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;AC&#039;&#039;&#039; : Total Non-reference Allele Count&lt;br /&gt;
* &#039;&#039;&#039;CALLRATE&#039;&#039;&#039; : Fraction of non-missing genotypes.&lt;br /&gt;
* &#039;&#039;&#039;MAF&#039;&#039;&#039; : Minor allele frequencies&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of single variant test&lt;br /&gt;
* &#039;&#039;&#039;AF.CASE&#039;&#039;&#039; : Non-reference allele frequencies for cases&lt;br /&gt;
* &#039;&#039;&#039;AF.CTRL&#039;&#039;&#039; : Non-reference allele frequencies for controls&lt;br /&gt;
&lt;br /&gt;
==== Q-Q plot of test statistics (stratified by MAF) ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.qq.pdf will be generated as shown below&lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_qq.png]]&lt;br /&gt;
&lt;br /&gt;
==== Manhattan Plot of Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.mh.pdf will be generated for chr20 only. &lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_mh.png]]&lt;br /&gt;
&lt;br /&gt;
An example Genome-wide manhattan plot (from a genome-wide run) will look like below&lt;br /&gt;
&lt;br /&gt;
[[File:tes_b_score_epacts_mh_gw.png]]&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise burden test ===&lt;br /&gt;
&lt;br /&gt;
Gene-wise or group-wise burden test requires two steps. First, &#039;group&#039; file containing the list of &lt;br /&gt;
markers per group needs to be generated. Second, group-wise burden test needs to be run&lt;br /&gt;
&lt;br /&gt;
==== Creating marker group file ====&lt;br /&gt;
&lt;br /&gt;
The marker group file has the following format&lt;br /&gt;
&lt;br /&gt;
 [GROUP_ID]  [MARKER_ID_1]   [MARKER_ID_2]  .... [MARKER_ID_N]&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
* [GROUP_ID] is a string representing the group (e.g. gene name)&lt;br /&gt;
* [MARKER_ID_K] is a marker key as a format of [CHROM]:[POS]_[REF]/[ALT] (NOTE THAT THIS IS DIFFERENT FROM TYPICAL VCF MARKER ID field)&lt;br /&gt;
&lt;br /&gt;
Note that [MARKER_ID_K] has to be sorted by increasing order of genomic coordinate&lt;br /&gt;
&lt;br /&gt;
In order to create gene-level group file from typically formatted VCF file, one may use the following utility &lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --nonsyn&lt;br /&gt;
&lt;br /&gt;
The above command create a file [output-group-file] containing a list of missense and nonsense variants per each gene. To incorporate different types of functional annotations, use --type option as follows&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --type [function_type_1] --type [function_type_2] ...&lt;br /&gt;
&lt;br /&gt;
Type &#039;epacts makegroup -man&#039; for the detailed documentation&lt;br /&gt;
&lt;br /&gt;
==== Annotating VCF file using EPACTS ====&lt;br /&gt;
&lt;br /&gt;
If the VCF is not annotated, &#039;epacts makegroup&#039; cannot be used. In order to annotate VCF, one can use the example VCF using ANNOVAR as follows:&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts anno \&lt;br /&gt;
    --in ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
    --out ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
The epacts anno script will add &amp;quot;ANNO=[function]:[genename]&amp;quot; entry into the INFO field based on gencodeV7 (default) or refGene database.&lt;br /&gt;
&lt;br /&gt;
It is important to check whether the VCF file is already annotated or not in order to avoid no or redundant annotation.&lt;br /&gt;
&lt;br /&gt;
==== Running Groupwise Test ====&lt;br /&gt;
&lt;br /&gt;
To perform a groupwise burden test on the example VCF (annotated as above), run the following command&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --vcf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz \&lt;br /&gt;
   --groupf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.grp --out out/test.gene.skat \&lt;br /&gt;
   --ped ${EPACTS_DIR}/data/1000G_dummy_pheno.ped --maxAF 0.05 \&lt;br /&gt;
   --chr 20 --pheno QT --cov AGE --cov SEX --test skat --skat-o --run 2&lt;br /&gt;
&lt;br /&gt;
==== Example Output ====&lt;br /&gt;
 $ head out/test.gene.skat.epacts.top5000&lt;br /&gt;
 #CHROM BEGIN   END     MARKER_ID       NS      FRAC_WITH_RARE     NUM_ALL_VARS    NUM_PASS_VARS   NUM_SING_VARS   PVALUE  STATRHO&lt;br /&gt;
 20     62607037        62608720        20:62607037-62608720_SAMD10     266     0.14662 9       5       1       0.0020064       1&lt;br /&gt;
 20     2816211 2820493 20:2816211-2820493_FAM113A      266     0.011278        12      2       1       0.0032542       0&lt;br /&gt;
 20     47245987        47361692        20:47245987-47361692_PREX1      266     0.1391  54      9       6       0.0054849       1&lt;br /&gt;
 20     34761734        34810279        20:34761734-34810279_EPB41L1    266     0.071429        14      7       5       0.0068492       0.2&lt;br /&gt;
 20     61340671        61391602        20:61340671-61391602_NTSR1      266     0.11278 24      9       3       0.011063        1&lt;br /&gt;
 20     48561952        48568644        20:48561952-48568644_RNF114     266     0.011278        4       2       1       0.015175        0.2&lt;br /&gt;
 20     60962895        60963559        20:60962895-60963559_RPS21      266     0.06015 6       3       2       0.016409        0&lt;br /&gt;
 20     55904961        55917801        20:55904961-55917801_SPO11      266     0.011278        11      3       3       0.018031        0&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;FRAC_WITH_RARE&#039;&#039;&#039; : Fraction of individual carrying rare variants below --max-maf (default : 0.05) threshold.&lt;br /&gt;
* &#039;&#039;&#039;NUM_ALL_VARS&#039;&#039;&#039; : Number of all variants defining the group.&lt;br /&gt;
* &#039;&#039;&#039;NUM_PASS_VARS&#039;&#039;&#039; : Number of variants passing the --min-maf, --min-mac, --max-maf, --min-callrate thresholds&lt;br /&gt;
* &#039;&#039;&#039;NUM_SING_VARS&#039;&#039;&#039; : Number of singletons among variants in NUM_PASS_VARS&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of burden tests&lt;br /&gt;
* Other columns are test specific auxiliary columns. For example, in the VT test, the optimal MAF threshold is recorded as an auxiliary output column.&lt;br /&gt;
&lt;br /&gt;
=== Specialized Instruction for EMMAX tests ===&lt;br /&gt;
&lt;br /&gt;
EMMAX (Efficient Mixed Model Association eXpedited - Kang et al (2010) Nat Genet 42:348-54) is an efficient implementation of mixed model association accounting for sample structure including population structure and hidden relatedness. Currently EPACTS supports EMMAX association mapping in single variant test and CMC-like burden tests. &lt;br /&gt;
&lt;br /&gt;
Because EMMAX is based on linear model, the method fits better to quantiative traits than binary traits. However, p-values for binary traits are expected to be valid in the spirit of Armitage trend test, although the estimated effect size may not be precise.&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
==== Single Variant EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : From VCF, we recommend to set a MAF (e.g. 0.01) and call rate (e.g. 0.95) threshold to select high-quality markers to generate kinship matrix as follows.&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-kin \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped (Optional)] --min-maf 0.01 --minCallRate 0.95 \&lt;br /&gt;
  --sepchr (if VCF is separated by chromosome) --out [outprefix.kinf] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
If you provide [input.ped] file, then it will calculate the subset the individuals contained in the PED file. &lt;br /&gt;
&lt;br /&gt;
The procedure above will create a file [outprefix.kinf] after splitting and merging the genomes into multiple pieces. If only a certain subset of SNPs needs to be considered due to target regions, LD-pruning, or any other reasons, a VCF containing the subset of markers must be created beforehand and should be used as input VCF file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Perform Single Variant Association&#039;&#039;&#039; : From VCF and PED, we recommend to use less stringent MAF threshold (e.g. 0.001) and call rate (e.g. 0.50) to perform single variant association&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --min-maf 0.001 --kin [outputprefix.kinf] \&lt;br /&gt;
  --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] --test q.emmax \&lt;br /&gt;
  --out [outprefix] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
The procedure above will perform single variant association analysis compatible to other types of single variant association analyses implemented in EPACTS&lt;br /&gt;
&lt;br /&gt;
==== Burden-style EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : See &#039;Creating Kinship Matrix&#039; section in [[#Single Variant EMMAX Association Analysis]]&lt;br /&gt;
* &#039;&#039;&#039;Create Marker Group&#039;&#039;&#039;&lt;br /&gt;
** By annotating the VCF and extracting missense and nonsense variants&lt;br /&gt;
*** [[#Annotating VCF file using ANNOVAR]] - This step will be required to create marker group file&lt;br /&gt;
*** [[#Creating marker group file]] - Assume that [group.grp] file is produced&lt;br /&gt;
** Or, by creating your own marker group information&lt;br /&gt;
*** See [[#Creating marker group file]] for details&lt;br /&gt;
* Run CMC-style burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxCMC --out [outprefix] &lt;br /&gt;
* Run Variable Threshold burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxVT --out [outprefix]&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Own Input Data ==&lt;br /&gt;
&lt;br /&gt;
=== VCF file for Genotypes ===&lt;br /&gt;
&lt;br /&gt;
EPACTS support VCF files as input for association with the following requirement&lt;br /&gt;
* Input VCF file must be bgzipped and tabixed before running association to allow efficient random access of the file. Below is an example command to conver plain VCF into bgzipped and tabixed VCF&lt;br /&gt;
  bgzip input.vcf     ## this command will produce input.vcf.gz&lt;br /&gt;
  tabix -pvcf -f input.vcf.gz  ## this command will produce input.vcf.gz.tbi&lt;br /&gt;
* If the VCF file is separated by chromosome, the VCF file specified in the input argument must contain the string &amp;quot;chr1&amp;quot; in the chromosome 1 file, and corresponding chromosome name for other chromosomes. Thus, the files names should be like &amp;lt;code&amp;gt;[prefix]chr1[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chr2[suffix].vcf.gz&amp;lt;/code&amp;gt;, ..., &amp;lt;code&amp;gt;[prefix]chr22[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chrX[suffix].vcf.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Sample IDs in the VCF file must be consistent to those from PED file&lt;br /&gt;
* Currently EPACTS only support bi-allelic variants, but it handles SNPs, INDELs, snd SVs.&lt;br /&gt;
* Currently, EPACTS only support VCF aligned with NCBI build 37 coordinates&lt;br /&gt;
* An example VCF file from 1000 genome project is below. &lt;br /&gt;
 $ zcat example/1000G_integrated_phase1_chr20.vcf.gz | cut -f 1-10 | head -50 &lt;br /&gt;
 ##fileformat=VCFv4.1&lt;br /&gt;
 ##INFO=&amp;lt;ID=LCSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Low coverage VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=EXSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Exome VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=INDEL,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in INDEL VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SV,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in SV VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BAVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BRSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality estimate from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=LDAF,Number=1,Type=Float,Description=&amp;quot;MLE Allele Frequency Accounting for LD&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=RSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=ERATE,Number=1,Type=Float,Description=&amp;quot;Per-marker Mutation rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=THETA,Number=1,Type=Float,Description=&amp;quot;Per-marker Transition rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIEND,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around END for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIPOS,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around POS for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=END,Number=1,Type=Integer,Description=&amp;quot;End position of the variant described in this record&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMLEN,Number=.,Type=Integer,Description=&amp;quot;Length of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMSEQ,Number=.,Type=String,Description=&amp;quot;Sequence of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SOURCE,Number=.,Type=String,Description=&amp;quot;Source of deletion call&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVLEN,Number=1,Type=Integer,Description=&amp;quot;Difference in length between REF and ALT alleles&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVTYPE,Number=1,Type=String,Description=&amp;quot;Type of structural variant&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AC,Number=.,Type=Integer,Description=&amp;quot;Alternate Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AN,Number=1,Type=Integer,Description=&amp;quot;Total Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##ALT=&amp;lt;ID=DEL,Description=&amp;quot;Deletion&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GT,Number=1,Type=String,Description=&amp;quot;Genotype&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=DS,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GL,Number=.,Type=Float,Description=&amp;quot;Genotype Likelihoods&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=BD,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 #CHROM POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  HG00096&lt;br /&gt;
 20 60479   .   C   T   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.894;LDAF=0.0020;AVGPOST=0.9995;RSQ=0.8779;ERATE=0.0005;THETA=0.0008;AC=4;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.19,-0.46,-2.68:0.0022&lt;br /&gt;
 20 60522   .   T   TC  1588    PASS    INDEL;BAVGPOST=1.000;BRSQ=0.994;LDAF=0.0116;AVGPOST=0.9980;RSQ=0.9327;ERATE=0.0004;THETA=0.0167;AC=24;AN=2184   GT:DS:GL:BD 0|0:0.000:0.00,-0.90,-9.20:0&lt;br /&gt;
 20 60571   .   C   A   100 PASS    LCSNP;EXSNP;BAVGPOST=0.999;BRSQ=0.813;LDAF=0.0029;AVGPOST=0.9986;RSQ=0.8085;ERATE=0.0014;THETA=0.0014;AC=5;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.05,-0.96,-5.00:0.0008&lt;br /&gt;
 20 60795   .   G   C   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.930;LDAF=0.0006;AVGPOST=0.9996;RSQ=0.7205;ERATE=0.0003;THETA=0.0041;AC=1;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.03,-1.21,-5.00:0.0001&lt;br /&gt;
 20 60810   .   G   GA  127 PASS    INDEL;BAVGPOST=1.000;BRSQ=0.862;LDAF=0.0013;AVGPOST=0.9987;RSQ=0.5684;ERATE=0.0004;THETA=0.0061;AC=2;AN=2184    GT:DS:GL:BD 0|0:0.000:0.00,-1.80,-18.80:0&lt;br /&gt;
&lt;br /&gt;
=== PED file for Phenotypes and Covariates ===&lt;br /&gt;
&lt;br /&gt;
EPACTS accepts a PED format supported by MERLIN or PLINK software to represent phenotypes. For example, the example.ped file and example.dat file can represent the phenotypes and corresponding column name (from 6th column and after). &lt;br /&gt;
&lt;br /&gt;
 $ head example.ped&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
 $ cat example.dat&lt;br /&gt;
 A DISEASE&lt;br /&gt;
 T QT&lt;br /&gt;
 T AGE&lt;br /&gt;
&lt;br /&gt;
EPACTS also accept a PED format with header information. The above file can be combined into one file as follows&lt;br /&gt;
&lt;br /&gt;
 $ head data/1000G_dummy_pheno.ped&lt;br /&gt;
 #FAM_ID    IND_ID  FAT_ID  MOT_ID  SEX DISEASE QT  AGE&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
The column names can be used to identify the names of phenotypes and covariates in the analysis.&lt;br /&gt;
&lt;br /&gt;
== Frequently Asked Questions ==&lt;br /&gt;
=== Installation ===&lt;br /&gt;
# How should I install EPACTS? &lt;br /&gt;
#* See [[EPACTS#Installation_Details | Installation Details]]&lt;br /&gt;
# I am having the following error message &#039;&#039;&#039;configure: error: libR.{so,a} was not found. Please install it at http://www.r-project.org/ first&#039;&#039;&#039;. What do I have to do?&lt;br /&gt;
#* First, you need to find out where R was installed. Try to type &amp;quot;locate libR.so&amp;quot; and see if it returns anything&lt;br /&gt;
#* If &amp;quot;locate libR.so&amp;quot; returns you something, as explained [[EPACTS#Installation_Details | Installation Details]], try to add &amp;quot;LDFLAGS=-L/path/to/R/library&amp;quot; and rerun &#039;&#039;&#039;configure&#039;&#039;&#039; and &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
#* If you cannot find libR.so, you make have to recompile R with --enable-R-shlib option as described in http://cran.r-project.org/doc/manuals/R-admin.html#Installation&lt;br /&gt;
&lt;br /&gt;
=== Input Files ===&lt;br /&gt;
# What is VCF?&lt;br /&gt;
#* VCF refers to Variant Call Format&lt;br /&gt;
#* See [[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 1000 Genomes wiki page]] for the detailed description of VCF format&lt;br /&gt;
# Should input VCF be compressed into certain format?&lt;br /&gt;
#* Correct. EPACTS assumes that VCF file is bgzipped and tabixed already.&lt;br /&gt;
#* See [[#VCF file for Genotypes]] for details.&lt;br /&gt;
# What are the additional requirements for input VCF file?&lt;br /&gt;
#* Input VCF file used for association mapping must contain individual genotype information at 10-th or higher order columns.&lt;br /&gt;
#* GT field must be encoded as haploid or diploid&lt;br /&gt;
#* Bi-allelic SNPs only : Currently EPACTS may not handle multi-allelic SNPs correctly.&lt;br /&gt;
#* If non-GT field is used, the field is considered as dosage and should be a single numeric value.&lt;br /&gt;
# What are the acceptable input format to encode phenotypes and covariates?&lt;br /&gt;
#* See [[#PED file for Phenotypes and Covariates]] for the detailed information&lt;br /&gt;
# How should I encode binary phenotypes?&lt;br /&gt;
#* If you encode your phenotypes into two different numeric values (e.g. 0/1 or 1/2), EPACTS will automatically recognize them as binary phenotypes and encode them into 1/2 values. Higher value will be considered as cases for case-control association&lt;br /&gt;
# How should I encode missing genotypes?&lt;br /&gt;
#* The default code missing phenotypes in EPACTS are &#039;NA&#039;&lt;br /&gt;
#* One may use --missing option to specify different types of missing values&lt;br /&gt;
#* The encoding of missing genotypes follows the VCF specificiation&lt;br /&gt;
# How do I match the relationship between VCF and PED input files?&lt;br /&gt;
#* EPACTS will assume that the individual IDs in each VCF and PED file are unique, and they follow the saming convention. Thus, the individual IDs overlapping between VCF and PED files will be considered in the associations&lt;br /&gt;
# How the individuals with missing phenotypes are handled?&lt;br /&gt;
#* Currently, EPACTS will automatically remove the individuals without phenotypes or covariates. If one wants to use imputed covariates to increase sample size, the PED file must contain the imputed covariate values.&lt;br /&gt;
#* Markers with missing genotypes won&#039;t be discarded automatically. It can be explicitly discarded by --minCallRate option when performing association&lt;br /&gt;
&lt;br /&gt;
=== Output Files ===&lt;br /&gt;
# Which output files should I be looking at?&lt;br /&gt;
#* [[#Output Text of Top Associations]] is the key file to look at the individual top associations&lt;br /&gt;
#* [[#Q-Q plot of test statistics (stratified by MAF)]] will be important to see the global distribution of test statistics and examine if there are apparent inflation of test statistics&lt;br /&gt;
#* [[#Manhattan Plot of Test Statistics]] will inform us the genome-wide distribution of association signals&lt;br /&gt;
#* [[#Output Text of All Test Statistics]] will contain the full information of test results across all units tested&lt;br /&gt;
# The Q-Q and Manhattan plots cannot be found. Why?&lt;br /&gt;
#* It is probably because gnuplot 4.2 or higher is not installed in your system, or they are included but cannot be found in your ${PATH}. Please visit [[http://gnuplot.info/ GNUPLOT web page]] for installation.&lt;br /&gt;
# How can I read the EMMAX kinship file from produced from EPACTS?&lt;br /&gt;
# * You can run the following command to dump your kinship matrix into a human-readable text format.&lt;br /&gt;
 $(EPACTS_DIR)/bin/epacts/bin/pEmmax kin-util --kinf [input.kinf] --outf [output.prefix] --dump&lt;br /&gt;
&lt;br /&gt;
=== More questions ===&lt;br /&gt;
# If you have more questions, please contact [[mailto:hmkang@umich.edu Hyun Min Kang]].&lt;br /&gt;
&lt;br /&gt;
== Detailed Options ==&lt;br /&gt;
&lt;br /&gt;
The detailed options can viewed by running the following commands&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts -man           (for overall structure) &lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts single -man    (for single variant test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts group -man     (for groupwise test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts anno -man      (for annotation)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts plot -man      (for QQ and Manhattan plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts zoom -man      (for zoom plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts meta -man      (for meta-analysis)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts make-group -man (for creating gene group)&lt;br /&gt;
&lt;br /&gt;
== Implementing Additional Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
In order to add additional statistical test to EPACTS, the following procedure are recommended&lt;br /&gt;
&lt;br /&gt;
# Create a file named &#039;single.[testname].R&#039; for single variant test or &#039;gene.[testname].R&#039; for gene-level test under ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
# Test your implementation using --test [testname] option to perform sanity check and debugging&lt;br /&gt;
# If you want to add your test in the official in-house version, please send your code to Hyun&lt;br /&gt;
&lt;br /&gt;
Below is an example of a single variant test implementation ( single.q.lm.R )&lt;br /&gt;
 ## Core functions of EPACTS to perform association&lt;br /&gt;
 &lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## SINGLE VARIANT TEST&lt;br /&gt;
 ## INPUT VARIABLES:&lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   NS       : number of called samples&lt;br /&gt;
 ##   AC       : allele count&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:nrow(NS) after AF/AC threshold&lt;br /&gt;
 ##   genos    : genotype matrix (after AF/AC threshold)&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional columns to add&lt;br /&gt;
 ##   cname    : column names for additional columns&lt;br /&gt;
 ##################################################################  &lt;br /&gt;
 &lt;br /&gt;
 ## single.lm() : Use built-in lm() function to perform association&lt;br /&gt;
 ## KEY FEATURES : SIMPLE, BUT MAY BE SLOW&lt;br /&gt;
 ##                GOOD SNIPPLET TO START A NEW FUNCTION&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, TSTAT&lt;br /&gt;
 ## MISSING VALUES : IGNORED&lt;br /&gt;
 single.q.lm &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;TSTAT&amp;quot;) # column names for additional variables in the EPACTS output&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   p &amp;lt;- rep(NA,m)&lt;br /&gt;
   add &amp;lt;- matrix(NA,m,3) ## BETA, SEBETA, TSTAT&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
    for(i in 1:m) {&lt;br /&gt;
      r &amp;lt;- summary(lm(pheno~genos[i,]+cov-1))$coefficients[1,]  # run simple linear regression&lt;br /&gt;
      p[i] &amp;lt;- r[4]   # store p-value to p[i]&lt;br /&gt;
      add[i,] &amp;lt;- r[1:3] # store additional variables to add[i,]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  return(list(p=p,add=add,cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
As described in the comment, you may assume that the following variables are available for use for testing association across m markers&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker&lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (m * 1 vector) : p-value matrix as output&lt;br /&gt;
* add (m * c matrix) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# AC : Non-ref allele count&lt;br /&gt;
# CALLRATE : Call rate = NS/n&lt;br /&gt;
# MAF : Minor allele frequency&lt;br /&gt;
# PVALUE : P-values&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
Below is an example of a gene-lvel variant test implementation ( single.q.lm.R )&lt;br /&gt;
&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## GENE-LEVEL BURDEN TEST&lt;br /&gt;
 ## INPUT VARIABLES: &lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   genos    : genotype matrix for each gene&lt;br /&gt;
 ##   NS       : number of called samples for each marker&lt;br /&gt;
 ##   AC       : allele count for each marker&lt;br /&gt;
 ##   MAC      : minor allele count for each marker&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:n after AF/AC threshold&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional column values&lt;br /&gt;
 ##   cname    : additional column names&lt;br /&gt;
 ##################################################################      &lt;br /&gt;
 &lt;br /&gt;
 ## gene.q.reverse() : Reverse logistic regression&lt;br /&gt;
 ## KEY FEATURES : 0/1 collapsing variable ~ rare variants&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE (GAUSSIAN)&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, ZSTAT&lt;br /&gt;
 ## MISSING VALUE : IMPUTED AS MAJOR ALLELES&lt;br /&gt;
 gene.q.reverse &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;ZSTAT&amp;quot;)&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
     g &amp;lt;- as.double(colSums(genos,na.rm=T) &amp;gt; 0)&lt;br /&gt;
     sg &amp;lt;- sum(g)&lt;br /&gt;
     if ( ( sg &amp;gt; 0 ) &amp;amp;&amp;amp; ( sg &amp;lt; n ) ) {&lt;br /&gt;
       r &amp;lt;- glm(g~pheno+cov-1,family=binomial)&lt;br /&gt;
        if ( ( r$converged ) &amp;amp;&amp;amp; ( ! r$boundary ) ) {&lt;br /&gt;
         return(list(p=summary(r)$coefficients[1,4],&lt;br /&gt;
                     add=summary(r)$coefficients[1,1:3],&lt;br /&gt;
                     cname=cname))&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   return(list(p=NA,add=rep(NA,3),cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Similar to gene-level test, you may assume the following variables exist for testing A SINGLE GENE. Note that M is the number of markers spanning the gene region&lt;br /&gt;
&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker &lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAC (M * 1 vector) : Minor allele count&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (scalar) : p-value matrix as output&lt;br /&gt;
* add (c * 1 vector) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# MAF_BURDEN : MAF of 0/1 collapsing variables (existence of rare variants)&lt;br /&gt;
# NUM_ALL_VARS : Number of all variants within the gene&lt;br /&gt;
# NUM_RARE_VARS : Number of rare variants below the max-MAF threshold&lt;br /&gt;
# NUM_SING_VARS : Number of singleton variants&lt;br /&gt;
# PVALUE : P-value from the test&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
== Full ChangeLog ==&lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs&lt;br /&gt;
** Some known bugs still exist &lt;br /&gt;
*** SKAT-O Lambda eigenvalue error. This happenes in a particular context but haven&#039;t nailed down a way to prevent it yet.&lt;br /&gt;
*** EMMAX has case and control frequency flipped.&lt;br /&gt;
* EMMAX test has a silly known bug with case / ctrl frequency is flipped&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
* February 28th, 2013 : EPACTS v3.2.0 release&lt;br /&gt;
** R package installation bug (for some users) was fixed&lt;br /&gt;
** A bug in the MAF error for high frequency variants (AF&amp;gt;0.25) was now fixed&lt;br /&gt;
** SKAT version is updated to 0.81&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
* December 4th, 2012 : EPACTS v3.1.0 release&lt;br /&gt;
** Removed dependency on libR.so&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** November 25th, 2012 : EPACTS v3.0.0 release&lt;br /&gt;
** Restructured with source code release (with autoconf / automake / libtools)&lt;br /&gt;
** Added zoom plot feature&lt;br /&gt;
** FRAC_BURDEN keyword was replace to FRAC_WITH_RARE for groupwise testing&lt;br /&gt;
* October 26th, 2012 : EPACTS v2.2.0-beta is released with the following updates&lt;br /&gt;
** Added --max-mac option&lt;br /&gt;
** Fixed Firth&#039;s bias-corrected test (by Clement Ma)&lt;br /&gt;
** Added more informative warning messages when index files do not exist&lt;br /&gt;
** Fixed the bug in the epacts-plot in plotting ties&lt;br /&gt;
** Fixed errors in the MAF estimates per case and control&lt;br /&gt;
** Fixed bug in --minRSQ option&lt;br /&gt;
* September 28, 2012 : EPACTS v2.11-beta is released with the following updates&lt;br /&gt;
** Counts and allele frequencies for case/control added for binary tests&lt;br /&gt;
** --max-maf parameter is added&lt;br /&gt;
** Fixed EMMAX error in MAF in the output&lt;br /&gt;
** More informative error messages &lt;br /&gt;
* September 27, 2012 : EPACTS v2.1-beta is released with the following updates&lt;br /&gt;
** EMMAX interface is changed. --kinOnly option is related with a new command &#039;&#039;&#039;make-kin&#039;&#039;&#039; &lt;br /&gt;
** SKAT-O is upgraded to version 0.77 with additional configurable parameter settings&lt;br /&gt;
** Some parameter names are renamed (e.g. --min-maf, --min-mac)&lt;br /&gt;
** Many minor bugs are fixed&lt;br /&gt;
* Jul 6, 2012 : EPACTS v2.01-beta is released with the following updates&lt;br /&gt;
** SKAT-O is upgraded to version 0.76&lt;br /&gt;
** Fixed minor bugs in option names (Thanks to Xueling Sim)&lt;br /&gt;
* Jul 3, 2012 : EPACTS v2.0-beta is released with the following updates&lt;br /&gt;
** Major restructuring of the software&lt;br /&gt;
** Annotation software is switched with built-in application&lt;br /&gt;
** Addition of SKAT-O and EMMAX burden test&lt;br /&gt;
** Minor bug fixes&lt;br /&gt;
* Apr 8, 2012 : EPACTS v1.2-alpha is released with the following updates, in addition to the following updates&lt;br /&gt;
** EMMAX bug in handling covariates was fixed&lt;br /&gt;
** Variable Threshold Test is added&lt;br /&gt;
** Variable Threshold Test with genomic score (e.g. GERP or PhyloP) is added.&lt;br /&gt;
* Apr 4, 2012 : EPACTS v1.1-alpha is released with the following updates, in addition to minor updates&lt;br /&gt;
** EMMAX burden test (Hyun Min Kang)&lt;br /&gt;
** Likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of Firth bias-corrected likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of EMMAX single variant test (Hyun Min Kang) &lt;br /&gt;
* Mar 29, 2012 : EPACTS v1.0-alpha is released&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14515</id>
		<title>EPACTS</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14515"/>
		<updated>2016-12-15T22:48:50Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Getting Started With Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;EPACTS&#039;&#039;&#039; (Efficient and Parallelizable Association Container Toolbox) is a versatile software pipeline to perform various statistical tests for identifying genome-wide association from sequence data through a user-friendly interface, both to scientific analysts and to method developers.&lt;br /&gt;
&lt;br /&gt;
== Join in EPACTS mailing list ==&lt;br /&gt;
&lt;br /&gt;
Please join in the [http://groups.google.com/group/epacts EPACTS Google Group] to ask / discuss / comment about EPACTS.&lt;br /&gt;
&lt;br /&gt;
== Lastest ChangeLog ==&lt;br /&gt;
* Dec 15th, 2016 : EPACTS v3.3.0 release (github)&lt;br /&gt;
** Moved the repository into github&lt;br /&gt;
** Some major fixes in handling large sample size (&amp;gt;18,000)&lt;br /&gt;
** Other minor bug fixes &lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs (more comprehensive fix is still pending)&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
See [[#Full ChangeLog]] for full details&lt;br /&gt;
&lt;br /&gt;
== Key Features ==&lt;br /&gt;
&lt;br /&gt;
EPACTS currently provides the following set of key features&lt;br /&gt;
* Robust support for widely used format of sequence-based genotypes (VCF) and phenotypes with pedigree (PED)&lt;br /&gt;
** Efficient library for accessing VCF file to reduce computational burden to analyze large-scale sequencing data&lt;br /&gt;
** Support selecting markers by arbitrary combination of substring matching. &lt;br /&gt;
** Support for using genotype dosages instead of hard genotype calls&lt;br /&gt;
** Utilize PED format to perform test across multiple traits.&lt;br /&gt;
* Supports a large number of widely used statistical tests for single variant association and burden tests.&lt;br /&gt;
** See the &amp;quot;Currently Supported Statistical Tests&amp;quot; section below for more information&lt;br /&gt;
* Easy to Highly Parallelize Jobs&lt;br /&gt;
** Makefile-based partition into and ligation of multiple subtasks&lt;br /&gt;
** Parallel run of job is simply adding one parameter when running EPACTS &lt;br /&gt;
* Integrative and versatile framework that allows easy addition of additional statistical test&lt;br /&gt;
** Core input/output routines are implemented in C++&lt;br /&gt;
** Most statistical tests (except for EMMAX) are implemented in R&lt;br /&gt;
** Adding a simple R function to implement additional statistical test (See [[#Implementing Additional Statistical Tests]] for details)&lt;br /&gt;
* Useful utilities for post-association-analysis tasks&lt;br /&gt;
** Automatic functional annotation of associated variants&lt;br /&gt;
** Automatic generation of QQ and Manhattan Plot&lt;br /&gt;
** (TBA) Zoom plot for the significant associations&lt;br /&gt;
&lt;br /&gt;
== Obtaining EPACTS ==&lt;br /&gt;
&lt;br /&gt;
* The official release of EPACTS software is available at https://github.com/statgen/EPACTS&lt;br /&gt;
** From the CSG cluster, it is available at /net/fantasia/home/bin/epacts/&lt;br /&gt;
* Note that R (version 2.10 or higher) and gnuplot (version 4.2 or higher) must be installed in order to run EPACTS correctly.&lt;br /&gt;
&lt;br /&gt;
== Currently Supported Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
EPACTS supports the following sets of widely used statistical tests for single variant tests and burden tests&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.wald &lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logisitic Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (simply used glm in R)&lt;br /&gt;
|-&lt;br /&gt;
| b.score&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Logistic Score Test &amp;lt;br&amp;gt; (from Lin DY and Tang ZZ, AJHG 2011 89:354-67)&lt;br /&gt;
| Clement Ma &amp;amp; Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.firth&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Firth Bias-Corrected Logistic Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.spa&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; &lt;br /&gt;
| Moderate&lt;br /&gt;
| Saddlepoint Approximation Method&lt;br /&gt;
| Shawn Lee &amp;amp; Rounak Dey&lt;br /&gt;
|-&lt;br /&gt;
| b.lrt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.glrt&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Fast&lt;br /&gt;
| Genotype Likelihood Ratio Test &amp;lt;br&amp;gt; (use GL or PL field in VCF to perform case-control test)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.lm&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Linear Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (as implemented in lm in R)&lt;br /&gt;
|-&lt;br /&gt;
| q.score&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Quantitative Score Test &amp;lt;br&amp;gt; (from Lin DY and Tang ZZ, AJHG 2011 89:354-67)&lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| q.linear&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Linear Wald Test&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.emmax&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| EMMAX &amp;lt;br&amp;gt; ( Kang et al (2010) Nat Genet 42:348-54 )&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.collapse&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and 0/1 collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.madsen&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Slow&lt;br /&gt;
| Wilcoxon Rank Sum Test between binary phenotypes and weighted rare variant scores (slightly different version from the published method - it uses pooled allele frequency across cases and controls for weighting each variant)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.wcnt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and weighted rare variant scores&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression of phenotypes on binary collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression of phenotypes on collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| skat&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT-O Test by Lee et al, Biostatistics (2012)&lt;br /&gt;
| Seunggeun Lee &amp;lt;br&amp;gt; (adaptive by Xueling Sim and Hyun Min Kang)&lt;br /&gt;
|-&lt;br /&gt;
| VT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed out first)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable Threshold Test &amp;lt;br&amp;gt; with adaptive permutation &amp;lt;br&amp;gt; Price et al, AJHG (2010) 86:832-8&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxCMC&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Collapsing burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxVT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable-threshold burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| mmskat&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT test using EMMAX&lt;br /&gt;
| Seunggeun Lee &amp;amp; Hyun Min Kang&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Installation Details  ==&lt;br /&gt;
&lt;br /&gt;
If you want to use EPACTS in an Ubuntu platform, following the step below &lt;br /&gt;
&lt;br /&gt;
 $ git clone https://github.com/statgen/EPACTS.git&lt;br /&gt;
 $ cd EPACTS&lt;br /&gt;
 $ ./configure --prefix [/path/to/install]&lt;br /&gt;
 $ make&lt;br /&gt;
 $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Important Note: &#039;&#039;&#039;make sure to specify --prefix=/path/to/install&#039;&#039;&#039; to avoid installing to the default path /usr/local/, which you may not have the permission. /home/your_userid/epacts might be a good one, if you are not sure where to install)&lt;br /&gt;
  &lt;br /&gt;
* Now ${EPACTS_DIR} represents the &#039;/path/to/install&#039; directory&lt;br /&gt;
&lt;br /&gt;
* Download the reference FASTA files from 1000 Genomes FTP automatically by running the following commands&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/epacts download&lt;br /&gt;
&lt;br /&gt;
 (For advanced users, to save time for downloading the FASTA files (~900MB), you may copy a local copy of GRCh37 FASTA file and the index file to ${EPACTS_DIR}/share/EPACTS/)&lt;br /&gt;
&lt;br /&gt;
*Perform a test run by running the following command&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
&lt;br /&gt;
In order to use EPACTS in the CSG cluster, you do not need to install them. You can directly use or make a copy of the in-house release version at &lt;br /&gt;
&lt;br /&gt;
 /net/fantasia/home/hmkang/bin/epacts/&lt;br /&gt;
&lt;br /&gt;
* If you want to access previous versions, visit http://csg-old.sph.umich.edu/kang/epacts/download&lt;br /&gt;
&lt;br /&gt;
== Getting Started With Examples ==&lt;br /&gt;
If you are using EPACTS from the CSG cluster, please set the following environment variable&lt;br /&gt;
 EPACTS_DIR=/net/fantasia/home/hmkang/tools/epacts-3.3.0/bin/epacts (in bash)&lt;br /&gt;
 setenv EPACTS_DIR /net/fantasia/home/hmkang/tools/epacts-3.3.0/bin/epacts (in csh)&lt;br /&gt;
&lt;br /&gt;
If you downloaded EPACTS binary and please set EPACTS_DIR to the full path of the downloaded and uncompressed directory.&lt;br /&gt;
&lt;br /&gt;
=== All-in-one example ===&lt;br /&gt;
&lt;br /&gt;
To get started with EPACTS, run the following command will perform an example run&lt;br /&gt;
 ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
 &lt;br /&gt;
You will find a series of lines in test_run_epacts.sh script commented out for each possible test. &lt;br /&gt;
&lt;br /&gt;
The example phenotype (PED format) and genotype (VCF format) can be found at&lt;br /&gt;
 ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Test ===&lt;br /&gt;
&lt;br /&gt;
Or You can run EPACTS command yourself by running&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
   --vcf  ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
   --ped  ${EPACTS_DIR}/data/1000G_dummy_pheno.ped  \&lt;br /&gt;
   --min-maf 0.001 --chr 20 --pheno DISEASE --cov AGE --cov SEX --test b.score --anno \ &lt;br /&gt;
   --out out/test --run 2&lt;br /&gt;
&lt;br /&gt;
The command above will perform single variant association test using a dummy case-control phenotype file and a subset of 1000 genomes exome VCF file (chr20) using score test statistic for all variants over 1% of higher MAF using 2 parallel runs.&lt;br /&gt;
&lt;br /&gt;
You will see the 4 output files as the main outcome of the analysis&lt;br /&gt;
&lt;br /&gt;
==== Output Text of All Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The filename is out/test.single.b.score.epacts.gz and the contents will look like&lt;br /&gt;
 $ zcat out/test.single.b.score.epacts.gz | head&lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	68303	68303	20:68303_A/G_Upstream:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68319	68319	20:68319_C/A_Upstream:DEFB125	266	1.4467e-36	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68396	68396	20:68396_C/T_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76635	76635	20:76635_A/T_Intron:DEFB125	266	1.534e-37	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76689	76689	20:76689_T/C_Synonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76690	76690	20:76690_T/C_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76700	76700	20:76700_G/A_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76726	76726	20:76726_C/G_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76771	76771	20:76771_C/T_Nonsynonymous:DEFB125	266	3	1	0.0056391	0.68484	0.40587	145	121	0.013793	0.0082645&lt;br /&gt;
&lt;br /&gt;
==== Output Text of Top Associations ====&lt;br /&gt;
&lt;br /&gt;
Same type of file but containing top 5,000 association will be stored at out/test.epacts.top5000&lt;br /&gt;
&lt;br /&gt;
 $ head out/test.single.b.score.epacts.top5000 &lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	1610894	1610894	20:1610894_G/A_Synonymous:SIRPG	266	138.64	1	0.26061	6.9939e-05	3.9765	145	121	0.65177	0.36476&lt;br /&gt;
 20	4162411	4162411	20:4162411_T/C_Intron:SMOX	266	204	1	0.38346	0.00055583	-3.4523	145	121	0.62759	0.93388&lt;br /&gt;
 20	34061918	34061918	20:34061918_T/C_Intron:CEP250	266	41.815	1	0.0786	0.00095471	3.3035	145	121	0.22543	0.075436&lt;br /&gt;
 20	4155948	4155948	20:4155948_G/A_Intron:SMOX	266	215	1	0.40414	0.0020792	-3.0787	145	121	0.68276	0.95868&lt;br /&gt;
 20	4680251	4680251	20:4680251_A/G_Nonsynonymous:PRNP	266	186	1	0.34962	0.0025962	3.0119	145	121	0.8069	0.57025&lt;br /&gt;
 20	36668874	36668874	20:36668874_G/A_Synonymous:RPRD1B	266	96	1	0.18045	0.003031	2.9646	145	121	0.44828	0.2562&lt;br /&gt;
 20	36641871	36641871	20:36641871_G/A_Synonymous:TTI1	266	10	1	0.018797	0.004308	-2.8547	145	121	0.0068966	0.07438&lt;br /&gt;
 20	1616892	1616892	20:1616892_A/G_Synonymous:SIRPG	266	144	1	0.27068	0.0051239	2.7991	145	121	0.63449	0.42975&lt;br /&gt;
 20	25038372	25038372	20:25038372_G/A_Intron:ACSS1	266	103.3	1	0.19418	0.005748	2.7618	145	121	0.47201	0.28813&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;AC&#039;&#039;&#039; : Total Non-reference Allele Count&lt;br /&gt;
* &#039;&#039;&#039;CALLRATE&#039;&#039;&#039; : Fraction of non-missing genotypes.&lt;br /&gt;
* &#039;&#039;&#039;MAF&#039;&#039;&#039; : Minor allele frequencies&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of single variant test&lt;br /&gt;
* &#039;&#039;&#039;AF.CASE&#039;&#039;&#039; : Non-reference allele frequencies for cases&lt;br /&gt;
* &#039;&#039;&#039;AF.CTRL&#039;&#039;&#039; : Non-reference allele frequencies for controls&lt;br /&gt;
&lt;br /&gt;
==== Q-Q plot of test statistics (stratified by MAF) ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.qq.pdf will be generated as shown below&lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_qq.png]]&lt;br /&gt;
&lt;br /&gt;
==== Manhattan Plot of Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.mh.pdf will be generated for chr20 only. &lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_mh.png]]&lt;br /&gt;
&lt;br /&gt;
An example Genome-wide manhattan plot (from a genome-wide run) will look like below&lt;br /&gt;
&lt;br /&gt;
[[File:tes_b_score_epacts_mh_gw.png]]&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise burden test ===&lt;br /&gt;
&lt;br /&gt;
Gene-wise or group-wise burden test requires two steps. First, &#039;group&#039; file containing the list of &lt;br /&gt;
markers per group needs to be generated. Second, group-wise burden test needs to be run&lt;br /&gt;
&lt;br /&gt;
==== Creating marker group file ====&lt;br /&gt;
&lt;br /&gt;
The marker group file has the following format&lt;br /&gt;
&lt;br /&gt;
 [GROUP_ID]  [MARKER_ID_1]   [MARKER_ID_2]  .... [MARKER_ID_N]&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
* [GROUP_ID] is a string representing the group (e.g. gene name)&lt;br /&gt;
* [MARKER_ID_K] is a marker key as a format of [CHROM]:[POS]_[REF]/[ALT] (NOTE THAT THIS IS DIFFERENT FROM TYPICAL VCF MARKER ID field)&lt;br /&gt;
&lt;br /&gt;
Note that [MARKER_ID_K] has to be sorted by increasing order of genomic coordinate&lt;br /&gt;
&lt;br /&gt;
In order to create gene-level group file from typically formatted VCF file, one may use the following utility &lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --nonsyn&lt;br /&gt;
&lt;br /&gt;
The above command create a file [output-group-file] containing a list of missense and nonsense variants per each gene. To incorporate different types of functional annotations, use --type option as follows&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --type [function_type_1] --type [function_type_2] ...&lt;br /&gt;
&lt;br /&gt;
Type &#039;epacts makegroup -man&#039; for the detailed documentation&lt;br /&gt;
&lt;br /&gt;
==== Annotating VCF file using EPACTS ====&lt;br /&gt;
&lt;br /&gt;
If the VCF is not annotated, &#039;epacts makegroup&#039; cannot be used. In order to annotate VCF, one can use the example VCF using ANNOVAR as follows:&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts anno \&lt;br /&gt;
    --in ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
    --out ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
The epacts anno script will add &amp;quot;ANNO=[function]:[genename]&amp;quot; entry into the INFO field based on gencodeV7 (default) or refGene database.&lt;br /&gt;
&lt;br /&gt;
It is important to check whether the VCF file is already annotated or not in order to avoid no or redundant annotation.&lt;br /&gt;
&lt;br /&gt;
==== Running Groupwise Test ====&lt;br /&gt;
&lt;br /&gt;
To perform a groupwise burden test on the example VCF (annotated as above), run the following command&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --vcf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz \&lt;br /&gt;
   --groupf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.grp --out out/test.gene.skat \&lt;br /&gt;
   --ped ${EPACTS_DIR}/data/1000G_dummy_pheno.ped --maxAF 0.05 \&lt;br /&gt;
   --chr 20 --pheno QT --cov AGE --cov SEX --test skat --skat-o --run 2&lt;br /&gt;
&lt;br /&gt;
==== Example Output ====&lt;br /&gt;
 $ head out/test.gene.skat.epacts.top5000&lt;br /&gt;
 #CHROM BEGIN   END     MARKER_ID       NS      FRAC_WITH_RARE     NUM_ALL_VARS    NUM_PASS_VARS   NUM_SING_VARS   PVALUE  STATRHO&lt;br /&gt;
 20     62607037        62608720        20:62607037-62608720_SAMD10     266     0.14662 9       5       1       0.0020064       1&lt;br /&gt;
 20     2816211 2820493 20:2816211-2820493_FAM113A      266     0.011278        12      2       1       0.0032542       0&lt;br /&gt;
 20     47245987        47361692        20:47245987-47361692_PREX1      266     0.1391  54      9       6       0.0054849       1&lt;br /&gt;
 20     34761734        34810279        20:34761734-34810279_EPB41L1    266     0.071429        14      7       5       0.0068492       0.2&lt;br /&gt;
 20     61340671        61391602        20:61340671-61391602_NTSR1      266     0.11278 24      9       3       0.011063        1&lt;br /&gt;
 20     48561952        48568644        20:48561952-48568644_RNF114     266     0.011278        4       2       1       0.015175        0.2&lt;br /&gt;
 20     60962895        60963559        20:60962895-60963559_RPS21      266     0.06015 6       3       2       0.016409        0&lt;br /&gt;
 20     55904961        55917801        20:55904961-55917801_SPO11      266     0.011278        11      3       3       0.018031        0&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;FRAC_WITH_RARE&#039;&#039;&#039; : Fraction of individual carrying rare variants below --max-maf (default : 0.05) threshold.&lt;br /&gt;
* &#039;&#039;&#039;NUM_ALL_VARS&#039;&#039;&#039; : Number of all variants defining the group.&lt;br /&gt;
* &#039;&#039;&#039;NUM_PASS_VARS&#039;&#039;&#039; : Number of variants passing the --min-maf, --min-mac, --max-maf, --min-callrate thresholds&lt;br /&gt;
* &#039;&#039;&#039;NUM_SING_VARS&#039;&#039;&#039; : Number of singletons among variants in NUM_PASS_VARS&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of burden tests&lt;br /&gt;
* Other columns are test specific auxiliary columns. For example, in the VT test, the optimal MAF threshold is recorded as an auxiliary output column.&lt;br /&gt;
&lt;br /&gt;
=== Specialized Instruction for EMMAX tests ===&lt;br /&gt;
&lt;br /&gt;
EMMAX (Efficient Mixed Model Association eXpedited - Kang et al (2010) Nat Genet 42:348-54) is an efficient implementation of mixed model association accounting for sample structure including population structure and hidden relatedness. Currently EPACTS supports EMMAX association mapping in single variant test and CMC-like burden tests. &lt;br /&gt;
&lt;br /&gt;
Because EMMAX is based on linear model, the method fits better to quantiative traits than binary traits. However, p-values for binary traits are expected to be valid in the spirit of Armitage trend test, although the estimated effect size may not be precise.&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
==== Single Variant EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : From VCF, we recommend to set a MAF (e.g. 0.01) and call rate (e.g. 0.95) threshold to select high-quality markers to generate kinship matrix as follows.&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-kin \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped (Optional)] --min-maf 0.01 --minCallRate 0.95 \&lt;br /&gt;
  --sepchr (if VCF is separated by chromosome) --out [outprefix.kinf] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
If you provide [input.ped] file, then it will calculate the subset the individuals contained in the PED file. &lt;br /&gt;
&lt;br /&gt;
The procedure above will create a file [outprefix.kinf] after splitting and merging the genomes into multiple pieces. If only a certain subset of SNPs needs to be considered due to target regions, LD-pruning, or any other reasons, a VCF containing the subset of markers must be created beforehand and should be used as input VCF file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Perform Single Variant Association&#039;&#039;&#039; : From VCF and PED, we recommend to use less stringent MAF threshold (e.g. 0.001) and call rate (e.g. 0.50) to perform single variant association&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --min-maf 0.001 --kin [outputprefix.kinf] \&lt;br /&gt;
  --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] --test q.emmax \&lt;br /&gt;
  --out [outprefix] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
The procedure above will perform single variant association analysis compatible to other types of single variant association analyses implemented in EPACTS&lt;br /&gt;
&lt;br /&gt;
==== Burden-style EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : See &#039;Creating Kinship Matrix&#039; section in [[#Single Variant EMMAX Association Analysis]]&lt;br /&gt;
* &#039;&#039;&#039;Create Marker Group&#039;&#039;&#039;&lt;br /&gt;
** By annotating the VCF and extracting missense and nonsense variants&lt;br /&gt;
*** [[#Annotating VCF file using ANNOVAR]] - This step will be required to create marker group file&lt;br /&gt;
*** [[#Creating marker group file]] - Assume that [group.grp] file is produced&lt;br /&gt;
** Or, by creating your own marker group information&lt;br /&gt;
*** See [[#Creating marker group file]] for details&lt;br /&gt;
* Run CMC-style burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxCMC --out [outprefix] &lt;br /&gt;
* Run Variable Threshold burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxVT --out [outprefix]&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Own Input Data ==&lt;br /&gt;
&lt;br /&gt;
=== VCF file for Genotypes ===&lt;br /&gt;
&lt;br /&gt;
EPACTS support VCF files as input for association with the following requirement&lt;br /&gt;
* Input VCF file must be bgzipped and tabixed before running association to allow efficient random access of the file. Below is an example command to conver plain VCF into bgzipped and tabixed VCF&lt;br /&gt;
  bgzip input.vcf     ## this command will produce input.vcf.gz&lt;br /&gt;
  tabix -pvcf -f input.vcf.gz  ## this command will produce input.vcf.gz.tbi&lt;br /&gt;
* If the VCF file is separated by chromosome, the VCF file specified in the input argument must contain the string &amp;quot;chr1&amp;quot; in the chromosome 1 file, and corresponding chromosome name for other chromosomes. Thus, the files names should be like &amp;lt;code&amp;gt;[prefix]chr1[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chr2[suffix].vcf.gz&amp;lt;/code&amp;gt;, ..., &amp;lt;code&amp;gt;[prefix]chr22[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chrX[suffix].vcf.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Sample IDs in the VCF file must be consistent to those from PED file&lt;br /&gt;
* Currently EPACTS only support bi-allelic variants, but it handles SNPs, INDELs, snd SVs.&lt;br /&gt;
* Currently, EPACTS only support VCF aligned with NCBI build 37 coordinates&lt;br /&gt;
* An example VCF file from 1000 genome project is below. &lt;br /&gt;
 $ zcat example/1000G_integrated_phase1_chr20.vcf.gz | cut -f 1-10 | head -50 &lt;br /&gt;
 ##fileformat=VCFv4.1&lt;br /&gt;
 ##INFO=&amp;lt;ID=LCSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Low coverage VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=EXSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Exome VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=INDEL,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in INDEL VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SV,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in SV VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BAVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BRSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality estimate from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=LDAF,Number=1,Type=Float,Description=&amp;quot;MLE Allele Frequency Accounting for LD&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=RSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=ERATE,Number=1,Type=Float,Description=&amp;quot;Per-marker Mutation rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=THETA,Number=1,Type=Float,Description=&amp;quot;Per-marker Transition rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIEND,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around END for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIPOS,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around POS for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=END,Number=1,Type=Integer,Description=&amp;quot;End position of the variant described in this record&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMLEN,Number=.,Type=Integer,Description=&amp;quot;Length of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMSEQ,Number=.,Type=String,Description=&amp;quot;Sequence of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SOURCE,Number=.,Type=String,Description=&amp;quot;Source of deletion call&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVLEN,Number=1,Type=Integer,Description=&amp;quot;Difference in length between REF and ALT alleles&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVTYPE,Number=1,Type=String,Description=&amp;quot;Type of structural variant&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AC,Number=.,Type=Integer,Description=&amp;quot;Alternate Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AN,Number=1,Type=Integer,Description=&amp;quot;Total Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##ALT=&amp;lt;ID=DEL,Description=&amp;quot;Deletion&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GT,Number=1,Type=String,Description=&amp;quot;Genotype&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=DS,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GL,Number=.,Type=Float,Description=&amp;quot;Genotype Likelihoods&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=BD,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 #CHROM POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  HG00096&lt;br /&gt;
 20 60479   .   C   T   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.894;LDAF=0.0020;AVGPOST=0.9995;RSQ=0.8779;ERATE=0.0005;THETA=0.0008;AC=4;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.19,-0.46,-2.68:0.0022&lt;br /&gt;
 20 60522   .   T   TC  1588    PASS    INDEL;BAVGPOST=1.000;BRSQ=0.994;LDAF=0.0116;AVGPOST=0.9980;RSQ=0.9327;ERATE=0.0004;THETA=0.0167;AC=24;AN=2184   GT:DS:GL:BD 0|0:0.000:0.00,-0.90,-9.20:0&lt;br /&gt;
 20 60571   .   C   A   100 PASS    LCSNP;EXSNP;BAVGPOST=0.999;BRSQ=0.813;LDAF=0.0029;AVGPOST=0.9986;RSQ=0.8085;ERATE=0.0014;THETA=0.0014;AC=5;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.05,-0.96,-5.00:0.0008&lt;br /&gt;
 20 60795   .   G   C   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.930;LDAF=0.0006;AVGPOST=0.9996;RSQ=0.7205;ERATE=0.0003;THETA=0.0041;AC=1;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.03,-1.21,-5.00:0.0001&lt;br /&gt;
 20 60810   .   G   GA  127 PASS    INDEL;BAVGPOST=1.000;BRSQ=0.862;LDAF=0.0013;AVGPOST=0.9987;RSQ=0.5684;ERATE=0.0004;THETA=0.0061;AC=2;AN=2184    GT:DS:GL:BD 0|0:0.000:0.00,-1.80,-18.80:0&lt;br /&gt;
&lt;br /&gt;
=== PED file for Phenotypes and Covariates ===&lt;br /&gt;
&lt;br /&gt;
EPACTS accepts a PED format supported by MERLIN or PLINK software to represent phenotypes. For example, the example.ped file and example.dat file can represent the phenotypes and corresponding column name (from 6th column and after). &lt;br /&gt;
&lt;br /&gt;
 $ head example.ped&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
 $ cat example.dat&lt;br /&gt;
 A DISEASE&lt;br /&gt;
 T QT&lt;br /&gt;
 T AGE&lt;br /&gt;
&lt;br /&gt;
EPACTS also accept a PED format with header information. The above file can be combined into one file as follows&lt;br /&gt;
&lt;br /&gt;
 $ head data/1000G_dummy_pheno.ped&lt;br /&gt;
 #FAM_ID    IND_ID  FAT_ID  MOT_ID  SEX DISEASE QT  AGE&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
The column names can be used to identify the names of phenotypes and covariates in the analysis.&lt;br /&gt;
&lt;br /&gt;
== Frequently Asked Questions ==&lt;br /&gt;
=== Installation ===&lt;br /&gt;
# How should I install EPACTS? &lt;br /&gt;
#* See [[EPACTS#Installation_Details | Installation Details]]&lt;br /&gt;
# I am having the following error message &#039;&#039;&#039;configure: error: libR.{so,a} was not found. Please install it at http://www.r-project.org/ first&#039;&#039;&#039;. What do I have to do?&lt;br /&gt;
#* First, you need to find out where R was installed. Try to type &amp;quot;locate libR.so&amp;quot; and see if it returns anything&lt;br /&gt;
#* If &amp;quot;locate libR.so&amp;quot; returns you something, as explained [[EPACTS#Installation_Details | Installation Details]], try to add &amp;quot;LDFLAGS=-L/path/to/R/library&amp;quot; and rerun &#039;&#039;&#039;configure&#039;&#039;&#039; and &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
#* If you cannot find libR.so, you make have to recompile R with --enable-R-shlib option as described in http://cran.r-project.org/doc/manuals/R-admin.html#Installation&lt;br /&gt;
&lt;br /&gt;
=== Input Files ===&lt;br /&gt;
# What is VCF?&lt;br /&gt;
#* VCF refers to Variant Call Format&lt;br /&gt;
#* See [[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 1000 Genomes wiki page]] for the detailed description of VCF format&lt;br /&gt;
# Should input VCF be compressed into certain format?&lt;br /&gt;
#* Correct. EPACTS assumes that VCF file is bgzipped and tabixed already.&lt;br /&gt;
#* See [[#VCF file for Genotypes]] for details.&lt;br /&gt;
# What are the additional requirements for input VCF file?&lt;br /&gt;
#* Input VCF file used for association mapping must contain individual genotype information at 10-th or higher order columns.&lt;br /&gt;
#* GT field must be encoded as haploid or diploid&lt;br /&gt;
#* Bi-allelic SNPs only : Currently EPACTS may not handle multi-allelic SNPs correctly.&lt;br /&gt;
#* If non-GT field is used, the field is considered as dosage and should be a single numeric value.&lt;br /&gt;
# What are the acceptable input format to encode phenotypes and covariates?&lt;br /&gt;
#* See [[#PED file for Phenotypes and Covariates]] for the detailed information&lt;br /&gt;
# How should I encode binary phenotypes?&lt;br /&gt;
#* If you encode your phenotypes into two different numeric values (e.g. 0/1 or 1/2), EPACTS will automatically recognize them as binary phenotypes and encode them into 1/2 values. Higher value will be considered as cases for case-control association&lt;br /&gt;
# How should I encode missing genotypes?&lt;br /&gt;
#* The default code missing phenotypes in EPACTS are &#039;NA&#039;&lt;br /&gt;
#* One may use --missing option to specify different types of missing values&lt;br /&gt;
#* The encoding of missing genotypes follows the VCF specificiation&lt;br /&gt;
# How do I match the relationship between VCF and PED input files?&lt;br /&gt;
#* EPACTS will assume that the individual IDs in each VCF and PED file are unique, and they follow the saming convention. Thus, the individual IDs overlapping between VCF and PED files will be considered in the associations&lt;br /&gt;
# How the individuals with missing phenotypes are handled?&lt;br /&gt;
#* Currently, EPACTS will automatically remove the individuals without phenotypes or covariates. If one wants to use imputed covariates to increase sample size, the PED file must contain the imputed covariate values.&lt;br /&gt;
#* Markers with missing genotypes won&#039;t be discarded automatically. It can be explicitly discarded by --minCallRate option when performing association&lt;br /&gt;
&lt;br /&gt;
=== Output Files ===&lt;br /&gt;
# Which output files should I be looking at?&lt;br /&gt;
#* [[#Output Text of Top Associations]] is the key file to look at the individual top associations&lt;br /&gt;
#* [[#Q-Q plot of test statistics (stratified by MAF)]] will be important to see the global distribution of test statistics and examine if there are apparent inflation of test statistics&lt;br /&gt;
#* [[#Manhattan Plot of Test Statistics]] will inform us the genome-wide distribution of association signals&lt;br /&gt;
#* [[#Output Text of All Test Statistics]] will contain the full information of test results across all units tested&lt;br /&gt;
# The Q-Q and Manhattan plots cannot be found. Why?&lt;br /&gt;
#* It is probably because gnuplot 4.2 or higher is not installed in your system, or they are included but cannot be found in your ${PATH}. Please visit [[http://gnuplot.info/ GNUPLOT web page]] for installation.&lt;br /&gt;
# How can I read the EMMAX kinship file from produced from EPACTS?&lt;br /&gt;
# * You can run the following command to dump your kinship matrix into a human-readable text format.&lt;br /&gt;
 $(EPACTS_DIR)/bin/epacts/bin/pEmmax kin-util --kinf [input.kinf] --outf [output.prefix] --dump&lt;br /&gt;
&lt;br /&gt;
=== More questions ===&lt;br /&gt;
# If you have more questions, please contact [[mailto:hmkang@umich.edu Hyun Min Kang]].&lt;br /&gt;
&lt;br /&gt;
== Detailed Options ==&lt;br /&gt;
&lt;br /&gt;
The detailed options can viewed by running the following commands&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts -man           (for overall structure) &lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts single -man    (for single variant test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts group -man     (for groupwise test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts anno -man      (for annotation)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts plot -man      (for QQ and Manhattan plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts zoom -man      (for zoom plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts meta -man      (for meta-analysis)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts make-group -man (for creating gene group)&lt;br /&gt;
&lt;br /&gt;
== Implementing Additional Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
In order to add additional statistical test to EPACTS, the following procedure are recommended&lt;br /&gt;
&lt;br /&gt;
# Create a file named &#039;single.[testname].R&#039; for single variant test or &#039;gene.[testname].R&#039; for gene-level test under ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
# Test your implementation using --test [testname] option to perform sanity check and debugging&lt;br /&gt;
# If you want to add your test in the official in-house version, please send your code to Hyun&lt;br /&gt;
&lt;br /&gt;
Below is an example of a single variant test implementation ( single.q.lm.R )&lt;br /&gt;
 ## Core functions of EPACTS to perform association&lt;br /&gt;
 &lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## SINGLE VARIANT TEST&lt;br /&gt;
 ## INPUT VARIABLES:&lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   NS       : number of called samples&lt;br /&gt;
 ##   AC       : allele count&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:nrow(NS) after AF/AC threshold&lt;br /&gt;
 ##   genos    : genotype matrix (after AF/AC threshold)&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional columns to add&lt;br /&gt;
 ##   cname    : column names for additional columns&lt;br /&gt;
 ##################################################################  &lt;br /&gt;
 &lt;br /&gt;
 ## single.lm() : Use built-in lm() function to perform association&lt;br /&gt;
 ## KEY FEATURES : SIMPLE, BUT MAY BE SLOW&lt;br /&gt;
 ##                GOOD SNIPPLET TO START A NEW FUNCTION&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, TSTAT&lt;br /&gt;
 ## MISSING VALUES : IGNORED&lt;br /&gt;
 single.q.lm &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;TSTAT&amp;quot;) # column names for additional variables in the EPACTS output&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   p &amp;lt;- rep(NA,m)&lt;br /&gt;
   add &amp;lt;- matrix(NA,m,3) ## BETA, SEBETA, TSTAT&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
    for(i in 1:m) {&lt;br /&gt;
      r &amp;lt;- summary(lm(pheno~genos[i,]+cov-1))$coefficients[1,]  # run simple linear regression&lt;br /&gt;
      p[i] &amp;lt;- r[4]   # store p-value to p[i]&lt;br /&gt;
      add[i,] &amp;lt;- r[1:3] # store additional variables to add[i,]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  return(list(p=p,add=add,cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
As described in the comment, you may assume that the following variables are available for use for testing association across m markers&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker&lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (m * 1 vector) : p-value matrix as output&lt;br /&gt;
* add (m * c matrix) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# AC : Non-ref allele count&lt;br /&gt;
# CALLRATE : Call rate = NS/n&lt;br /&gt;
# MAF : Minor allele frequency&lt;br /&gt;
# PVALUE : P-values&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
Below is an example of a gene-lvel variant test implementation ( single.q.lm.R )&lt;br /&gt;
&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## GENE-LEVEL BURDEN TEST&lt;br /&gt;
 ## INPUT VARIABLES: &lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   genos    : genotype matrix for each gene&lt;br /&gt;
 ##   NS       : number of called samples for each marker&lt;br /&gt;
 ##   AC       : allele count for each marker&lt;br /&gt;
 ##   MAC      : minor allele count for each marker&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:n after AF/AC threshold&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional column values&lt;br /&gt;
 ##   cname    : additional column names&lt;br /&gt;
 ##################################################################      &lt;br /&gt;
 &lt;br /&gt;
 ## gene.q.reverse() : Reverse logistic regression&lt;br /&gt;
 ## KEY FEATURES : 0/1 collapsing variable ~ rare variants&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE (GAUSSIAN)&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, ZSTAT&lt;br /&gt;
 ## MISSING VALUE : IMPUTED AS MAJOR ALLELES&lt;br /&gt;
 gene.q.reverse &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;ZSTAT&amp;quot;)&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
     g &amp;lt;- as.double(colSums(genos,na.rm=T) &amp;gt; 0)&lt;br /&gt;
     sg &amp;lt;- sum(g)&lt;br /&gt;
     if ( ( sg &amp;gt; 0 ) &amp;amp;&amp;amp; ( sg &amp;lt; n ) ) {&lt;br /&gt;
       r &amp;lt;- glm(g~pheno+cov-1,family=binomial)&lt;br /&gt;
        if ( ( r$converged ) &amp;amp;&amp;amp; ( ! r$boundary ) ) {&lt;br /&gt;
         return(list(p=summary(r)$coefficients[1,4],&lt;br /&gt;
                     add=summary(r)$coefficients[1,1:3],&lt;br /&gt;
                     cname=cname))&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   return(list(p=NA,add=rep(NA,3),cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Similar to gene-level test, you may assume the following variables exist for testing A SINGLE GENE. Note that M is the number of markers spanning the gene region&lt;br /&gt;
&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker &lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAC (M * 1 vector) : Minor allele count&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (scalar) : p-value matrix as output&lt;br /&gt;
* add (c * 1 vector) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# MAF_BURDEN : MAF of 0/1 collapsing variables (existence of rare variants)&lt;br /&gt;
# NUM_ALL_VARS : Number of all variants within the gene&lt;br /&gt;
# NUM_RARE_VARS : Number of rare variants below the max-MAF threshold&lt;br /&gt;
# NUM_SING_VARS : Number of singleton variants&lt;br /&gt;
# PVALUE : P-value from the test&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
== Full ChangeLog ==&lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs&lt;br /&gt;
** Some known bugs still exist &lt;br /&gt;
*** SKAT-O Lambda eigenvalue error. This happenes in a particular context but haven&#039;t nailed down a way to prevent it yet.&lt;br /&gt;
*** EMMAX has case and control frequency flipped.&lt;br /&gt;
* EMMAX test has a silly known bug with case / ctrl frequency is flipped&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
* February 28th, 2013 : EPACTS v3.2.0 release&lt;br /&gt;
** R package installation bug (for some users) was fixed&lt;br /&gt;
** A bug in the MAF error for high frequency variants (AF&amp;gt;0.25) was now fixed&lt;br /&gt;
** SKAT version is updated to 0.81&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
* December 4th, 2012 : EPACTS v3.1.0 release&lt;br /&gt;
** Removed dependency on libR.so&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** November 25th, 2012 : EPACTS v3.0.0 release&lt;br /&gt;
** Restructured with source code release (with autoconf / automake / libtools)&lt;br /&gt;
** Added zoom plot feature&lt;br /&gt;
** FRAC_BURDEN keyword was replace to FRAC_WITH_RARE for groupwise testing&lt;br /&gt;
* October 26th, 2012 : EPACTS v2.2.0-beta is released with the following updates&lt;br /&gt;
** Added --max-mac option&lt;br /&gt;
** Fixed Firth&#039;s bias-corrected test (by Clement Ma)&lt;br /&gt;
** Added more informative warning messages when index files do not exist&lt;br /&gt;
** Fixed the bug in the epacts-plot in plotting ties&lt;br /&gt;
** Fixed errors in the MAF estimates per case and control&lt;br /&gt;
** Fixed bug in --minRSQ option&lt;br /&gt;
* September 28, 2012 : EPACTS v2.11-beta is released with the following updates&lt;br /&gt;
** Counts and allele frequencies for case/control added for binary tests&lt;br /&gt;
** --max-maf parameter is added&lt;br /&gt;
** Fixed EMMAX error in MAF in the output&lt;br /&gt;
** More informative error messages &lt;br /&gt;
* September 27, 2012 : EPACTS v2.1-beta is released with the following updates&lt;br /&gt;
** EMMAX interface is changed. --kinOnly option is related with a new command &#039;&#039;&#039;make-kin&#039;&#039;&#039; &lt;br /&gt;
** SKAT-O is upgraded to version 0.77 with additional configurable parameter settings&lt;br /&gt;
** Some parameter names are renamed (e.g. --min-maf, --min-mac)&lt;br /&gt;
** Many minor bugs are fixed&lt;br /&gt;
* Jul 6, 2012 : EPACTS v2.01-beta is released with the following updates&lt;br /&gt;
** SKAT-O is upgraded to version 0.76&lt;br /&gt;
** Fixed minor bugs in option names (Thanks to Xueling Sim)&lt;br /&gt;
* Jul 3, 2012 : EPACTS v2.0-beta is released with the following updates&lt;br /&gt;
** Major restructuring of the software&lt;br /&gt;
** Annotation software is switched with built-in application&lt;br /&gt;
** Addition of SKAT-O and EMMAX burden test&lt;br /&gt;
** Minor bug fixes&lt;br /&gt;
* Apr 8, 2012 : EPACTS v1.2-alpha is released with the following updates, in addition to the following updates&lt;br /&gt;
** EMMAX bug in handling covariates was fixed&lt;br /&gt;
** Variable Threshold Test is added&lt;br /&gt;
** Variable Threshold Test with genomic score (e.g. GERP or PhyloP) is added.&lt;br /&gt;
* Apr 4, 2012 : EPACTS v1.1-alpha is released with the following updates, in addition to minor updates&lt;br /&gt;
** EMMAX burden test (Hyun Min Kang)&lt;br /&gt;
** Likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of Firth bias-corrected likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of EMMAX single variant test (Hyun Min Kang) &lt;br /&gt;
* Mar 29, 2012 : EPACTS v1.0-alpha is released&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14514</id>
		<title>EPACTS</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14514"/>
		<updated>2016-12-15T22:47:50Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Obtaining EPACTS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;EPACTS&#039;&#039;&#039; (Efficient and Parallelizable Association Container Toolbox) is a versatile software pipeline to perform various statistical tests for identifying genome-wide association from sequence data through a user-friendly interface, both to scientific analysts and to method developers.&lt;br /&gt;
&lt;br /&gt;
== Join in EPACTS mailing list ==&lt;br /&gt;
&lt;br /&gt;
Please join in the [http://groups.google.com/group/epacts EPACTS Google Group] to ask / discuss / comment about EPACTS.&lt;br /&gt;
&lt;br /&gt;
== Lastest ChangeLog ==&lt;br /&gt;
* Dec 15th, 2016 : EPACTS v3.3.0 release (github)&lt;br /&gt;
** Moved the repository into github&lt;br /&gt;
** Some major fixes in handling large sample size (&amp;gt;18,000)&lt;br /&gt;
** Other minor bug fixes &lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs (more comprehensive fix is still pending)&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
See [[#Full ChangeLog]] for full details&lt;br /&gt;
&lt;br /&gt;
== Key Features ==&lt;br /&gt;
&lt;br /&gt;
EPACTS currently provides the following set of key features&lt;br /&gt;
* Robust support for widely used format of sequence-based genotypes (VCF) and phenotypes with pedigree (PED)&lt;br /&gt;
** Efficient library for accessing VCF file to reduce computational burden to analyze large-scale sequencing data&lt;br /&gt;
** Support selecting markers by arbitrary combination of substring matching. &lt;br /&gt;
** Support for using genotype dosages instead of hard genotype calls&lt;br /&gt;
** Utilize PED format to perform test across multiple traits.&lt;br /&gt;
* Supports a large number of widely used statistical tests for single variant association and burden tests.&lt;br /&gt;
** See the &amp;quot;Currently Supported Statistical Tests&amp;quot; section below for more information&lt;br /&gt;
* Easy to Highly Parallelize Jobs&lt;br /&gt;
** Makefile-based partition into and ligation of multiple subtasks&lt;br /&gt;
** Parallel run of job is simply adding one parameter when running EPACTS &lt;br /&gt;
* Integrative and versatile framework that allows easy addition of additional statistical test&lt;br /&gt;
** Core input/output routines are implemented in C++&lt;br /&gt;
** Most statistical tests (except for EMMAX) are implemented in R&lt;br /&gt;
** Adding a simple R function to implement additional statistical test (See [[#Implementing Additional Statistical Tests]] for details)&lt;br /&gt;
* Useful utilities for post-association-analysis tasks&lt;br /&gt;
** Automatic functional annotation of associated variants&lt;br /&gt;
** Automatic generation of QQ and Manhattan Plot&lt;br /&gt;
** (TBA) Zoom plot for the significant associations&lt;br /&gt;
&lt;br /&gt;
== Obtaining EPACTS ==&lt;br /&gt;
&lt;br /&gt;
* The official release of EPACTS software is available at https://github.com/statgen/EPACTS&lt;br /&gt;
** From the CSG cluster, it is available at /net/fantasia/home/bin/epacts/&lt;br /&gt;
* Note that R (version 2.10 or higher) and gnuplot (version 4.2 or higher) must be installed in order to run EPACTS correctly.&lt;br /&gt;
&lt;br /&gt;
== Currently Supported Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
EPACTS supports the following sets of widely used statistical tests for single variant tests and burden tests&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.wald &lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logisitic Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (simply used glm in R)&lt;br /&gt;
|-&lt;br /&gt;
| b.score&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Logistic Score Test &amp;lt;br&amp;gt; (from Lin DY and Tang ZZ, AJHG 2011 89:354-67)&lt;br /&gt;
| Clement Ma &amp;amp; Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.firth&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Firth Bias-Corrected Logistic Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.spa&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; &lt;br /&gt;
| Moderate&lt;br /&gt;
| Saddlepoint Approximation Method&lt;br /&gt;
| Shawn Lee &amp;amp; Rounak Dey&lt;br /&gt;
|-&lt;br /&gt;
| b.lrt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.glrt&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Fast&lt;br /&gt;
| Genotype Likelihood Ratio Test &amp;lt;br&amp;gt; (use GL or PL field in VCF to perform case-control test)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.lm&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Linear Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (as implemented in lm in R)&lt;br /&gt;
|-&lt;br /&gt;
| q.score&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Quantitative Score Test &amp;lt;br&amp;gt; (from Lin DY and Tang ZZ, AJHG 2011 89:354-67)&lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| q.linear&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Linear Wald Test&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.emmax&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| EMMAX &amp;lt;br&amp;gt; ( Kang et al (2010) Nat Genet 42:348-54 )&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.collapse&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and 0/1 collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.madsen&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Slow&lt;br /&gt;
| Wilcoxon Rank Sum Test between binary phenotypes and weighted rare variant scores (slightly different version from the published method - it uses pooled allele frequency across cases and controls for weighting each variant)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.wcnt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and weighted rare variant scores&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression of phenotypes on binary collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression of phenotypes on collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| skat&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT-O Test by Lee et al, Biostatistics (2012)&lt;br /&gt;
| Seunggeun Lee &amp;lt;br&amp;gt; (adaptive by Xueling Sim and Hyun Min Kang)&lt;br /&gt;
|-&lt;br /&gt;
| VT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed out first)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable Threshold Test &amp;lt;br&amp;gt; with adaptive permutation &amp;lt;br&amp;gt; Price et al, AJHG (2010) 86:832-8&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxCMC&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Collapsing burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxVT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable-threshold burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| mmskat&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT test using EMMAX&lt;br /&gt;
| Seunggeun Lee &amp;amp; Hyun Min Kang&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Installation Details  ==&lt;br /&gt;
&lt;br /&gt;
If you want to use EPACTS in an Ubuntu platform, following the step below &lt;br /&gt;
&lt;br /&gt;
 $ git clone https://github.com/statgen/EPACTS.git&lt;br /&gt;
 $ cd EPACTS&lt;br /&gt;
 $ ./configure --prefix [/path/to/install]&lt;br /&gt;
 $ make&lt;br /&gt;
 $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Important Note: &#039;&#039;&#039;make sure to specify --prefix=/path/to/install&#039;&#039;&#039; to avoid installing to the default path /usr/local/, which you may not have the permission. /home/your_userid/epacts might be a good one, if you are not sure where to install)&lt;br /&gt;
  &lt;br /&gt;
* Now ${EPACTS_DIR} represents the &#039;/path/to/install&#039; directory&lt;br /&gt;
&lt;br /&gt;
* Download the reference FASTA files from 1000 Genomes FTP automatically by running the following commands&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/epacts download&lt;br /&gt;
&lt;br /&gt;
 (For advanced users, to save time for downloading the FASTA files (~900MB), you may copy a local copy of GRCh37 FASTA file and the index file to ${EPACTS_DIR}/share/EPACTS/)&lt;br /&gt;
&lt;br /&gt;
*Perform a test run by running the following command&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
&lt;br /&gt;
In order to use EPACTS in the CSG cluster, you do not need to install them. You can directly use or make a copy of the in-house release version at &lt;br /&gt;
&lt;br /&gt;
 /net/fantasia/home/hmkang/bin/epacts/&lt;br /&gt;
&lt;br /&gt;
* If you want to access previous versions, visit http://csg-old.sph.umich.edu/kang/epacts/download&lt;br /&gt;
&lt;br /&gt;
== Getting Started With Examples ==&lt;br /&gt;
If you are using EPACTS from the CSG cluster, please set the following environment variable&lt;br /&gt;
 EPACTS_DIR=/net/fantasia/home/hmkang/bin/epacts (in bash)&lt;br /&gt;
 setenv EPACTS_DIR /net/fantasia/home/hmkang/bin/epacts (in csh)&lt;br /&gt;
&lt;br /&gt;
If you downloaded EPACTS binary and please set EPACTS_DIR to the full path of the downloaded and uncompressed directory.&lt;br /&gt;
&lt;br /&gt;
=== All-in-one example ===&lt;br /&gt;
&lt;br /&gt;
To get started with EPACTS, run the following command will perform an example run&lt;br /&gt;
 ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
 &lt;br /&gt;
You will find a series of lines in test_run_epacts.sh script commented out for each possible test. &lt;br /&gt;
&lt;br /&gt;
The example phenotype (PED format) and genotype (VCF format) can be found at&lt;br /&gt;
 ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Test ===&lt;br /&gt;
&lt;br /&gt;
Or You can run EPACTS command yourself by running&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
   --vcf  ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
   --ped  ${EPACTS_DIR}/data/1000G_dummy_pheno.ped  \&lt;br /&gt;
   --min-maf 0.001 --chr 20 --pheno DISEASE --cov AGE --cov SEX --test b.score --anno \ &lt;br /&gt;
   --out out/test --run 2&lt;br /&gt;
&lt;br /&gt;
The command above will perform single variant association test using a dummy case-control phenotype file and a subset of 1000 genomes exome VCF file (chr20) using score test statistic for all variants over 1% of higher MAF using 2 parallel runs.&lt;br /&gt;
&lt;br /&gt;
You will see the 4 output files as the main outcome of the analysis&lt;br /&gt;
&lt;br /&gt;
==== Output Text of All Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The filename is out/test.single.b.score.epacts.gz and the contents will look like&lt;br /&gt;
 $ zcat out/test.single.b.score.epacts.gz | head&lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	68303	68303	20:68303_A/G_Upstream:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68319	68319	20:68319_C/A_Upstream:DEFB125	266	1.4467e-36	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68396	68396	20:68396_C/T_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76635	76635	20:76635_A/T_Intron:DEFB125	266	1.534e-37	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76689	76689	20:76689_T/C_Synonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76690	76690	20:76690_T/C_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76700	76700	20:76700_G/A_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76726	76726	20:76726_C/G_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76771	76771	20:76771_C/T_Nonsynonymous:DEFB125	266	3	1	0.0056391	0.68484	0.40587	145	121	0.013793	0.0082645&lt;br /&gt;
&lt;br /&gt;
==== Output Text of Top Associations ====&lt;br /&gt;
&lt;br /&gt;
Same type of file but containing top 5,000 association will be stored at out/test.epacts.top5000&lt;br /&gt;
&lt;br /&gt;
 $ head out/test.single.b.score.epacts.top5000 &lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	1610894	1610894	20:1610894_G/A_Synonymous:SIRPG	266	138.64	1	0.26061	6.9939e-05	3.9765	145	121	0.65177	0.36476&lt;br /&gt;
 20	4162411	4162411	20:4162411_T/C_Intron:SMOX	266	204	1	0.38346	0.00055583	-3.4523	145	121	0.62759	0.93388&lt;br /&gt;
 20	34061918	34061918	20:34061918_T/C_Intron:CEP250	266	41.815	1	0.0786	0.00095471	3.3035	145	121	0.22543	0.075436&lt;br /&gt;
 20	4155948	4155948	20:4155948_G/A_Intron:SMOX	266	215	1	0.40414	0.0020792	-3.0787	145	121	0.68276	0.95868&lt;br /&gt;
 20	4680251	4680251	20:4680251_A/G_Nonsynonymous:PRNP	266	186	1	0.34962	0.0025962	3.0119	145	121	0.8069	0.57025&lt;br /&gt;
 20	36668874	36668874	20:36668874_G/A_Synonymous:RPRD1B	266	96	1	0.18045	0.003031	2.9646	145	121	0.44828	0.2562&lt;br /&gt;
 20	36641871	36641871	20:36641871_G/A_Synonymous:TTI1	266	10	1	0.018797	0.004308	-2.8547	145	121	0.0068966	0.07438&lt;br /&gt;
 20	1616892	1616892	20:1616892_A/G_Synonymous:SIRPG	266	144	1	0.27068	0.0051239	2.7991	145	121	0.63449	0.42975&lt;br /&gt;
 20	25038372	25038372	20:25038372_G/A_Intron:ACSS1	266	103.3	1	0.19418	0.005748	2.7618	145	121	0.47201	0.28813&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;AC&#039;&#039;&#039; : Total Non-reference Allele Count&lt;br /&gt;
* &#039;&#039;&#039;CALLRATE&#039;&#039;&#039; : Fraction of non-missing genotypes.&lt;br /&gt;
* &#039;&#039;&#039;MAF&#039;&#039;&#039; : Minor allele frequencies&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of single variant test&lt;br /&gt;
* &#039;&#039;&#039;AF.CASE&#039;&#039;&#039; : Non-reference allele frequencies for cases&lt;br /&gt;
* &#039;&#039;&#039;AF.CTRL&#039;&#039;&#039; : Non-reference allele frequencies for controls&lt;br /&gt;
&lt;br /&gt;
==== Q-Q plot of test statistics (stratified by MAF) ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.qq.pdf will be generated as shown below&lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_qq.png]]&lt;br /&gt;
&lt;br /&gt;
==== Manhattan Plot of Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.mh.pdf will be generated for chr20 only. &lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_mh.png]]&lt;br /&gt;
&lt;br /&gt;
An example Genome-wide manhattan plot (from a genome-wide run) will look like below&lt;br /&gt;
&lt;br /&gt;
[[File:tes_b_score_epacts_mh_gw.png]]&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise burden test ===&lt;br /&gt;
&lt;br /&gt;
Gene-wise or group-wise burden test requires two steps. First, &#039;group&#039; file containing the list of &lt;br /&gt;
markers per group needs to be generated. Second, group-wise burden test needs to be run&lt;br /&gt;
&lt;br /&gt;
==== Creating marker group file ====&lt;br /&gt;
&lt;br /&gt;
The marker group file has the following format&lt;br /&gt;
&lt;br /&gt;
 [GROUP_ID]  [MARKER_ID_1]   [MARKER_ID_2]  .... [MARKER_ID_N]&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
* [GROUP_ID] is a string representing the group (e.g. gene name)&lt;br /&gt;
* [MARKER_ID_K] is a marker key as a format of [CHROM]:[POS]_[REF]/[ALT] (NOTE THAT THIS IS DIFFERENT FROM TYPICAL VCF MARKER ID field)&lt;br /&gt;
&lt;br /&gt;
Note that [MARKER_ID_K] has to be sorted by increasing order of genomic coordinate&lt;br /&gt;
&lt;br /&gt;
In order to create gene-level group file from typically formatted VCF file, one may use the following utility &lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --nonsyn&lt;br /&gt;
&lt;br /&gt;
The above command create a file [output-group-file] containing a list of missense and nonsense variants per each gene. To incorporate different types of functional annotations, use --type option as follows&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --type [function_type_1] --type [function_type_2] ...&lt;br /&gt;
&lt;br /&gt;
Type &#039;epacts makegroup -man&#039; for the detailed documentation&lt;br /&gt;
&lt;br /&gt;
==== Annotating VCF file using EPACTS ====&lt;br /&gt;
&lt;br /&gt;
If the VCF is not annotated, &#039;epacts makegroup&#039; cannot be used. In order to annotate VCF, one can use the example VCF using ANNOVAR as follows:&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts anno \&lt;br /&gt;
    --in ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
    --out ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
The epacts anno script will add &amp;quot;ANNO=[function]:[genename]&amp;quot; entry into the INFO field based on gencodeV7 (default) or refGene database.&lt;br /&gt;
&lt;br /&gt;
It is important to check whether the VCF file is already annotated or not in order to avoid no or redundant annotation.&lt;br /&gt;
&lt;br /&gt;
==== Running Groupwise Test ====&lt;br /&gt;
&lt;br /&gt;
To perform a groupwise burden test on the example VCF (annotated as above), run the following command&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --vcf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz \&lt;br /&gt;
   --groupf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.grp --out out/test.gene.skat \&lt;br /&gt;
   --ped ${EPACTS_DIR}/data/1000G_dummy_pheno.ped --maxAF 0.05 \&lt;br /&gt;
   --chr 20 --pheno QT --cov AGE --cov SEX --test skat --skat-o --run 2&lt;br /&gt;
&lt;br /&gt;
==== Example Output ====&lt;br /&gt;
 $ head out/test.gene.skat.epacts.top5000&lt;br /&gt;
 #CHROM BEGIN   END     MARKER_ID       NS      FRAC_WITH_RARE     NUM_ALL_VARS    NUM_PASS_VARS   NUM_SING_VARS   PVALUE  STATRHO&lt;br /&gt;
 20     62607037        62608720        20:62607037-62608720_SAMD10     266     0.14662 9       5       1       0.0020064       1&lt;br /&gt;
 20     2816211 2820493 20:2816211-2820493_FAM113A      266     0.011278        12      2       1       0.0032542       0&lt;br /&gt;
 20     47245987        47361692        20:47245987-47361692_PREX1      266     0.1391  54      9       6       0.0054849       1&lt;br /&gt;
 20     34761734        34810279        20:34761734-34810279_EPB41L1    266     0.071429        14      7       5       0.0068492       0.2&lt;br /&gt;
 20     61340671        61391602        20:61340671-61391602_NTSR1      266     0.11278 24      9       3       0.011063        1&lt;br /&gt;
 20     48561952        48568644        20:48561952-48568644_RNF114     266     0.011278        4       2       1       0.015175        0.2&lt;br /&gt;
 20     60962895        60963559        20:60962895-60963559_RPS21      266     0.06015 6       3       2       0.016409        0&lt;br /&gt;
 20     55904961        55917801        20:55904961-55917801_SPO11      266     0.011278        11      3       3       0.018031        0&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;FRAC_WITH_RARE&#039;&#039;&#039; : Fraction of individual carrying rare variants below --max-maf (default : 0.05) threshold.&lt;br /&gt;
* &#039;&#039;&#039;NUM_ALL_VARS&#039;&#039;&#039; : Number of all variants defining the group.&lt;br /&gt;
* &#039;&#039;&#039;NUM_PASS_VARS&#039;&#039;&#039; : Number of variants passing the --min-maf, --min-mac, --max-maf, --min-callrate thresholds&lt;br /&gt;
* &#039;&#039;&#039;NUM_SING_VARS&#039;&#039;&#039; : Number of singletons among variants in NUM_PASS_VARS&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of burden tests&lt;br /&gt;
* Other columns are test specific auxiliary columns. For example, in the VT test, the optimal MAF threshold is recorded as an auxiliary output column.&lt;br /&gt;
&lt;br /&gt;
=== Specialized Instruction for EMMAX tests ===&lt;br /&gt;
&lt;br /&gt;
EMMAX (Efficient Mixed Model Association eXpedited - Kang et al (2010) Nat Genet 42:348-54) is an efficient implementation of mixed model association accounting for sample structure including population structure and hidden relatedness. Currently EPACTS supports EMMAX association mapping in single variant test and CMC-like burden tests. &lt;br /&gt;
&lt;br /&gt;
Because EMMAX is based on linear model, the method fits better to quantiative traits than binary traits. However, p-values for binary traits are expected to be valid in the spirit of Armitage trend test, although the estimated effect size may not be precise.&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
==== Single Variant EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : From VCF, we recommend to set a MAF (e.g. 0.01) and call rate (e.g. 0.95) threshold to select high-quality markers to generate kinship matrix as follows.&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-kin \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped (Optional)] --min-maf 0.01 --minCallRate 0.95 \&lt;br /&gt;
  --sepchr (if VCF is separated by chromosome) --out [outprefix.kinf] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
If you provide [input.ped] file, then it will calculate the subset the individuals contained in the PED file. &lt;br /&gt;
&lt;br /&gt;
The procedure above will create a file [outprefix.kinf] after splitting and merging the genomes into multiple pieces. If only a certain subset of SNPs needs to be considered due to target regions, LD-pruning, or any other reasons, a VCF containing the subset of markers must be created beforehand and should be used as input VCF file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Perform Single Variant Association&#039;&#039;&#039; : From VCF and PED, we recommend to use less stringent MAF threshold (e.g. 0.001) and call rate (e.g. 0.50) to perform single variant association&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --min-maf 0.001 --kin [outputprefix.kinf] \&lt;br /&gt;
  --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] --test q.emmax \&lt;br /&gt;
  --out [outprefix] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
The procedure above will perform single variant association analysis compatible to other types of single variant association analyses implemented in EPACTS&lt;br /&gt;
&lt;br /&gt;
==== Burden-style EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : See &#039;Creating Kinship Matrix&#039; section in [[#Single Variant EMMAX Association Analysis]]&lt;br /&gt;
* &#039;&#039;&#039;Create Marker Group&#039;&#039;&#039;&lt;br /&gt;
** By annotating the VCF and extracting missense and nonsense variants&lt;br /&gt;
*** [[#Annotating VCF file using ANNOVAR]] - This step will be required to create marker group file&lt;br /&gt;
*** [[#Creating marker group file]] - Assume that [group.grp] file is produced&lt;br /&gt;
** Or, by creating your own marker group information&lt;br /&gt;
*** See [[#Creating marker group file]] for details&lt;br /&gt;
* Run CMC-style burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxCMC --out [outprefix] &lt;br /&gt;
* Run Variable Threshold burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxVT --out [outprefix]&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Own Input Data ==&lt;br /&gt;
&lt;br /&gt;
=== VCF file for Genotypes ===&lt;br /&gt;
&lt;br /&gt;
EPACTS support VCF files as input for association with the following requirement&lt;br /&gt;
* Input VCF file must be bgzipped and tabixed before running association to allow efficient random access of the file. Below is an example command to conver plain VCF into bgzipped and tabixed VCF&lt;br /&gt;
  bgzip input.vcf     ## this command will produce input.vcf.gz&lt;br /&gt;
  tabix -pvcf -f input.vcf.gz  ## this command will produce input.vcf.gz.tbi&lt;br /&gt;
* If the VCF file is separated by chromosome, the VCF file specified in the input argument must contain the string &amp;quot;chr1&amp;quot; in the chromosome 1 file, and corresponding chromosome name for other chromosomes. Thus, the files names should be like &amp;lt;code&amp;gt;[prefix]chr1[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chr2[suffix].vcf.gz&amp;lt;/code&amp;gt;, ..., &amp;lt;code&amp;gt;[prefix]chr22[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chrX[suffix].vcf.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Sample IDs in the VCF file must be consistent to those from PED file&lt;br /&gt;
* Currently EPACTS only support bi-allelic variants, but it handles SNPs, INDELs, snd SVs.&lt;br /&gt;
* Currently, EPACTS only support VCF aligned with NCBI build 37 coordinates&lt;br /&gt;
* An example VCF file from 1000 genome project is below. &lt;br /&gt;
 $ zcat example/1000G_integrated_phase1_chr20.vcf.gz | cut -f 1-10 | head -50 &lt;br /&gt;
 ##fileformat=VCFv4.1&lt;br /&gt;
 ##INFO=&amp;lt;ID=LCSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Low coverage VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=EXSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Exome VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=INDEL,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in INDEL VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SV,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in SV VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BAVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BRSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality estimate from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=LDAF,Number=1,Type=Float,Description=&amp;quot;MLE Allele Frequency Accounting for LD&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=RSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=ERATE,Number=1,Type=Float,Description=&amp;quot;Per-marker Mutation rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=THETA,Number=1,Type=Float,Description=&amp;quot;Per-marker Transition rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIEND,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around END for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIPOS,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around POS for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=END,Number=1,Type=Integer,Description=&amp;quot;End position of the variant described in this record&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMLEN,Number=.,Type=Integer,Description=&amp;quot;Length of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMSEQ,Number=.,Type=String,Description=&amp;quot;Sequence of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SOURCE,Number=.,Type=String,Description=&amp;quot;Source of deletion call&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVLEN,Number=1,Type=Integer,Description=&amp;quot;Difference in length between REF and ALT alleles&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVTYPE,Number=1,Type=String,Description=&amp;quot;Type of structural variant&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AC,Number=.,Type=Integer,Description=&amp;quot;Alternate Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AN,Number=1,Type=Integer,Description=&amp;quot;Total Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##ALT=&amp;lt;ID=DEL,Description=&amp;quot;Deletion&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GT,Number=1,Type=String,Description=&amp;quot;Genotype&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=DS,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GL,Number=.,Type=Float,Description=&amp;quot;Genotype Likelihoods&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=BD,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 #CHROM POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  HG00096&lt;br /&gt;
 20 60479   .   C   T   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.894;LDAF=0.0020;AVGPOST=0.9995;RSQ=0.8779;ERATE=0.0005;THETA=0.0008;AC=4;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.19,-0.46,-2.68:0.0022&lt;br /&gt;
 20 60522   .   T   TC  1588    PASS    INDEL;BAVGPOST=1.000;BRSQ=0.994;LDAF=0.0116;AVGPOST=0.9980;RSQ=0.9327;ERATE=0.0004;THETA=0.0167;AC=24;AN=2184   GT:DS:GL:BD 0|0:0.000:0.00,-0.90,-9.20:0&lt;br /&gt;
 20 60571   .   C   A   100 PASS    LCSNP;EXSNP;BAVGPOST=0.999;BRSQ=0.813;LDAF=0.0029;AVGPOST=0.9986;RSQ=0.8085;ERATE=0.0014;THETA=0.0014;AC=5;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.05,-0.96,-5.00:0.0008&lt;br /&gt;
 20 60795   .   G   C   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.930;LDAF=0.0006;AVGPOST=0.9996;RSQ=0.7205;ERATE=0.0003;THETA=0.0041;AC=1;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.03,-1.21,-5.00:0.0001&lt;br /&gt;
 20 60810   .   G   GA  127 PASS    INDEL;BAVGPOST=1.000;BRSQ=0.862;LDAF=0.0013;AVGPOST=0.9987;RSQ=0.5684;ERATE=0.0004;THETA=0.0061;AC=2;AN=2184    GT:DS:GL:BD 0|0:0.000:0.00,-1.80,-18.80:0&lt;br /&gt;
&lt;br /&gt;
=== PED file for Phenotypes and Covariates ===&lt;br /&gt;
&lt;br /&gt;
EPACTS accepts a PED format supported by MERLIN or PLINK software to represent phenotypes. For example, the example.ped file and example.dat file can represent the phenotypes and corresponding column name (from 6th column and after). &lt;br /&gt;
&lt;br /&gt;
 $ head example.ped&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
 $ cat example.dat&lt;br /&gt;
 A DISEASE&lt;br /&gt;
 T QT&lt;br /&gt;
 T AGE&lt;br /&gt;
&lt;br /&gt;
EPACTS also accept a PED format with header information. The above file can be combined into one file as follows&lt;br /&gt;
&lt;br /&gt;
 $ head data/1000G_dummy_pheno.ped&lt;br /&gt;
 #FAM_ID    IND_ID  FAT_ID  MOT_ID  SEX DISEASE QT  AGE&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
The column names can be used to identify the names of phenotypes and covariates in the analysis.&lt;br /&gt;
&lt;br /&gt;
== Frequently Asked Questions ==&lt;br /&gt;
=== Installation ===&lt;br /&gt;
# How should I install EPACTS? &lt;br /&gt;
#* See [[EPACTS#Installation_Details | Installation Details]]&lt;br /&gt;
# I am having the following error message &#039;&#039;&#039;configure: error: libR.{so,a} was not found. Please install it at http://www.r-project.org/ first&#039;&#039;&#039;. What do I have to do?&lt;br /&gt;
#* First, you need to find out where R was installed. Try to type &amp;quot;locate libR.so&amp;quot; and see if it returns anything&lt;br /&gt;
#* If &amp;quot;locate libR.so&amp;quot; returns you something, as explained [[EPACTS#Installation_Details | Installation Details]], try to add &amp;quot;LDFLAGS=-L/path/to/R/library&amp;quot; and rerun &#039;&#039;&#039;configure&#039;&#039;&#039; and &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
#* If you cannot find libR.so, you make have to recompile R with --enable-R-shlib option as described in http://cran.r-project.org/doc/manuals/R-admin.html#Installation&lt;br /&gt;
&lt;br /&gt;
=== Input Files ===&lt;br /&gt;
# What is VCF?&lt;br /&gt;
#* VCF refers to Variant Call Format&lt;br /&gt;
#* See [[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 1000 Genomes wiki page]] for the detailed description of VCF format&lt;br /&gt;
# Should input VCF be compressed into certain format?&lt;br /&gt;
#* Correct. EPACTS assumes that VCF file is bgzipped and tabixed already.&lt;br /&gt;
#* See [[#VCF file for Genotypes]] for details.&lt;br /&gt;
# What are the additional requirements for input VCF file?&lt;br /&gt;
#* Input VCF file used for association mapping must contain individual genotype information at 10-th or higher order columns.&lt;br /&gt;
#* GT field must be encoded as haploid or diploid&lt;br /&gt;
#* Bi-allelic SNPs only : Currently EPACTS may not handle multi-allelic SNPs correctly.&lt;br /&gt;
#* If non-GT field is used, the field is considered as dosage and should be a single numeric value.&lt;br /&gt;
# What are the acceptable input format to encode phenotypes and covariates?&lt;br /&gt;
#* See [[#PED file for Phenotypes and Covariates]] for the detailed information&lt;br /&gt;
# How should I encode binary phenotypes?&lt;br /&gt;
#* If you encode your phenotypes into two different numeric values (e.g. 0/1 or 1/2), EPACTS will automatically recognize them as binary phenotypes and encode them into 1/2 values. Higher value will be considered as cases for case-control association&lt;br /&gt;
# How should I encode missing genotypes?&lt;br /&gt;
#* The default code missing phenotypes in EPACTS are &#039;NA&#039;&lt;br /&gt;
#* One may use --missing option to specify different types of missing values&lt;br /&gt;
#* The encoding of missing genotypes follows the VCF specificiation&lt;br /&gt;
# How do I match the relationship between VCF and PED input files?&lt;br /&gt;
#* EPACTS will assume that the individual IDs in each VCF and PED file are unique, and they follow the saming convention. Thus, the individual IDs overlapping between VCF and PED files will be considered in the associations&lt;br /&gt;
# How the individuals with missing phenotypes are handled?&lt;br /&gt;
#* Currently, EPACTS will automatically remove the individuals without phenotypes or covariates. If one wants to use imputed covariates to increase sample size, the PED file must contain the imputed covariate values.&lt;br /&gt;
#* Markers with missing genotypes won&#039;t be discarded automatically. It can be explicitly discarded by --minCallRate option when performing association&lt;br /&gt;
&lt;br /&gt;
=== Output Files ===&lt;br /&gt;
# Which output files should I be looking at?&lt;br /&gt;
#* [[#Output Text of Top Associations]] is the key file to look at the individual top associations&lt;br /&gt;
#* [[#Q-Q plot of test statistics (stratified by MAF)]] will be important to see the global distribution of test statistics and examine if there are apparent inflation of test statistics&lt;br /&gt;
#* [[#Manhattan Plot of Test Statistics]] will inform us the genome-wide distribution of association signals&lt;br /&gt;
#* [[#Output Text of All Test Statistics]] will contain the full information of test results across all units tested&lt;br /&gt;
# The Q-Q and Manhattan plots cannot be found. Why?&lt;br /&gt;
#* It is probably because gnuplot 4.2 or higher is not installed in your system, or they are included but cannot be found in your ${PATH}. Please visit [[http://gnuplot.info/ GNUPLOT web page]] for installation.&lt;br /&gt;
# How can I read the EMMAX kinship file from produced from EPACTS?&lt;br /&gt;
# * You can run the following command to dump your kinship matrix into a human-readable text format.&lt;br /&gt;
 $(EPACTS_DIR)/bin/epacts/bin/pEmmax kin-util --kinf [input.kinf] --outf [output.prefix] --dump&lt;br /&gt;
&lt;br /&gt;
=== More questions ===&lt;br /&gt;
# If you have more questions, please contact [[mailto:hmkang@umich.edu Hyun Min Kang]].&lt;br /&gt;
&lt;br /&gt;
== Detailed Options ==&lt;br /&gt;
&lt;br /&gt;
The detailed options can viewed by running the following commands&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts -man           (for overall structure) &lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts single -man    (for single variant test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts group -man     (for groupwise test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts anno -man      (for annotation)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts plot -man      (for QQ and Manhattan plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts zoom -man      (for zoom plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts meta -man      (for meta-analysis)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts make-group -man (for creating gene group)&lt;br /&gt;
&lt;br /&gt;
== Implementing Additional Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
In order to add additional statistical test to EPACTS, the following procedure are recommended&lt;br /&gt;
&lt;br /&gt;
# Create a file named &#039;single.[testname].R&#039; for single variant test or &#039;gene.[testname].R&#039; for gene-level test under ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
# Test your implementation using --test [testname] option to perform sanity check and debugging&lt;br /&gt;
# If you want to add your test in the official in-house version, please send your code to Hyun&lt;br /&gt;
&lt;br /&gt;
Below is an example of a single variant test implementation ( single.q.lm.R )&lt;br /&gt;
 ## Core functions of EPACTS to perform association&lt;br /&gt;
 &lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## SINGLE VARIANT TEST&lt;br /&gt;
 ## INPUT VARIABLES:&lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   NS       : number of called samples&lt;br /&gt;
 ##   AC       : allele count&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:nrow(NS) after AF/AC threshold&lt;br /&gt;
 ##   genos    : genotype matrix (after AF/AC threshold)&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional columns to add&lt;br /&gt;
 ##   cname    : column names for additional columns&lt;br /&gt;
 ##################################################################  &lt;br /&gt;
 &lt;br /&gt;
 ## single.lm() : Use built-in lm() function to perform association&lt;br /&gt;
 ## KEY FEATURES : SIMPLE, BUT MAY BE SLOW&lt;br /&gt;
 ##                GOOD SNIPPLET TO START A NEW FUNCTION&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, TSTAT&lt;br /&gt;
 ## MISSING VALUES : IGNORED&lt;br /&gt;
 single.q.lm &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;TSTAT&amp;quot;) # column names for additional variables in the EPACTS output&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   p &amp;lt;- rep(NA,m)&lt;br /&gt;
   add &amp;lt;- matrix(NA,m,3) ## BETA, SEBETA, TSTAT&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
    for(i in 1:m) {&lt;br /&gt;
      r &amp;lt;- summary(lm(pheno~genos[i,]+cov-1))$coefficients[1,]  # run simple linear regression&lt;br /&gt;
      p[i] &amp;lt;- r[4]   # store p-value to p[i]&lt;br /&gt;
      add[i,] &amp;lt;- r[1:3] # store additional variables to add[i,]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  return(list(p=p,add=add,cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
As described in the comment, you may assume that the following variables are available for use for testing association across m markers&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker&lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (m * 1 vector) : p-value matrix as output&lt;br /&gt;
* add (m * c matrix) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# AC : Non-ref allele count&lt;br /&gt;
# CALLRATE : Call rate = NS/n&lt;br /&gt;
# MAF : Minor allele frequency&lt;br /&gt;
# PVALUE : P-values&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
Below is an example of a gene-lvel variant test implementation ( single.q.lm.R )&lt;br /&gt;
&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## GENE-LEVEL BURDEN TEST&lt;br /&gt;
 ## INPUT VARIABLES: &lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   genos    : genotype matrix for each gene&lt;br /&gt;
 ##   NS       : number of called samples for each marker&lt;br /&gt;
 ##   AC       : allele count for each marker&lt;br /&gt;
 ##   MAC      : minor allele count for each marker&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:n after AF/AC threshold&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional column values&lt;br /&gt;
 ##   cname    : additional column names&lt;br /&gt;
 ##################################################################      &lt;br /&gt;
 &lt;br /&gt;
 ## gene.q.reverse() : Reverse logistic regression&lt;br /&gt;
 ## KEY FEATURES : 0/1 collapsing variable ~ rare variants&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE (GAUSSIAN)&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, ZSTAT&lt;br /&gt;
 ## MISSING VALUE : IMPUTED AS MAJOR ALLELES&lt;br /&gt;
 gene.q.reverse &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;ZSTAT&amp;quot;)&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
     g &amp;lt;- as.double(colSums(genos,na.rm=T) &amp;gt; 0)&lt;br /&gt;
     sg &amp;lt;- sum(g)&lt;br /&gt;
     if ( ( sg &amp;gt; 0 ) &amp;amp;&amp;amp; ( sg &amp;lt; n ) ) {&lt;br /&gt;
       r &amp;lt;- glm(g~pheno+cov-1,family=binomial)&lt;br /&gt;
        if ( ( r$converged ) &amp;amp;&amp;amp; ( ! r$boundary ) ) {&lt;br /&gt;
         return(list(p=summary(r)$coefficients[1,4],&lt;br /&gt;
                     add=summary(r)$coefficients[1,1:3],&lt;br /&gt;
                     cname=cname))&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   return(list(p=NA,add=rep(NA,3),cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Similar to gene-level test, you may assume the following variables exist for testing A SINGLE GENE. Note that M is the number of markers spanning the gene region&lt;br /&gt;
&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker &lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAC (M * 1 vector) : Minor allele count&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (scalar) : p-value matrix as output&lt;br /&gt;
* add (c * 1 vector) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# MAF_BURDEN : MAF of 0/1 collapsing variables (existence of rare variants)&lt;br /&gt;
# NUM_ALL_VARS : Number of all variants within the gene&lt;br /&gt;
# NUM_RARE_VARS : Number of rare variants below the max-MAF threshold&lt;br /&gt;
# NUM_SING_VARS : Number of singleton variants&lt;br /&gt;
# PVALUE : P-value from the test&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
== Full ChangeLog ==&lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs&lt;br /&gt;
** Some known bugs still exist &lt;br /&gt;
*** SKAT-O Lambda eigenvalue error. This happenes in a particular context but haven&#039;t nailed down a way to prevent it yet.&lt;br /&gt;
*** EMMAX has case and control frequency flipped.&lt;br /&gt;
* EMMAX test has a silly known bug with case / ctrl frequency is flipped&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
* February 28th, 2013 : EPACTS v3.2.0 release&lt;br /&gt;
** R package installation bug (for some users) was fixed&lt;br /&gt;
** A bug in the MAF error for high frequency variants (AF&amp;gt;0.25) was now fixed&lt;br /&gt;
** SKAT version is updated to 0.81&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
* December 4th, 2012 : EPACTS v3.1.0 release&lt;br /&gt;
** Removed dependency on libR.so&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** November 25th, 2012 : EPACTS v3.0.0 release&lt;br /&gt;
** Restructured with source code release (with autoconf / automake / libtools)&lt;br /&gt;
** Added zoom plot feature&lt;br /&gt;
** FRAC_BURDEN keyword was replace to FRAC_WITH_RARE for groupwise testing&lt;br /&gt;
* October 26th, 2012 : EPACTS v2.2.0-beta is released with the following updates&lt;br /&gt;
** Added --max-mac option&lt;br /&gt;
** Fixed Firth&#039;s bias-corrected test (by Clement Ma)&lt;br /&gt;
** Added more informative warning messages when index files do not exist&lt;br /&gt;
** Fixed the bug in the epacts-plot in plotting ties&lt;br /&gt;
** Fixed errors in the MAF estimates per case and control&lt;br /&gt;
** Fixed bug in --minRSQ option&lt;br /&gt;
* September 28, 2012 : EPACTS v2.11-beta is released with the following updates&lt;br /&gt;
** Counts and allele frequencies for case/control added for binary tests&lt;br /&gt;
** --max-maf parameter is added&lt;br /&gt;
** Fixed EMMAX error in MAF in the output&lt;br /&gt;
** More informative error messages &lt;br /&gt;
* September 27, 2012 : EPACTS v2.1-beta is released with the following updates&lt;br /&gt;
** EMMAX interface is changed. --kinOnly option is related with a new command &#039;&#039;&#039;make-kin&#039;&#039;&#039; &lt;br /&gt;
** SKAT-O is upgraded to version 0.77 with additional configurable parameter settings&lt;br /&gt;
** Some parameter names are renamed (e.g. --min-maf, --min-mac)&lt;br /&gt;
** Many minor bugs are fixed&lt;br /&gt;
* Jul 6, 2012 : EPACTS v2.01-beta is released with the following updates&lt;br /&gt;
** SKAT-O is upgraded to version 0.76&lt;br /&gt;
** Fixed minor bugs in option names (Thanks to Xueling Sim)&lt;br /&gt;
* Jul 3, 2012 : EPACTS v2.0-beta is released with the following updates&lt;br /&gt;
** Major restructuring of the software&lt;br /&gt;
** Annotation software is switched with built-in application&lt;br /&gt;
** Addition of SKAT-O and EMMAX burden test&lt;br /&gt;
** Minor bug fixes&lt;br /&gt;
* Apr 8, 2012 : EPACTS v1.2-alpha is released with the following updates, in addition to the following updates&lt;br /&gt;
** EMMAX bug in handling covariates was fixed&lt;br /&gt;
** Variable Threshold Test is added&lt;br /&gt;
** Variable Threshold Test with genomic score (e.g. GERP or PhyloP) is added.&lt;br /&gt;
* Apr 4, 2012 : EPACTS v1.1-alpha is released with the following updates, in addition to minor updates&lt;br /&gt;
** EMMAX burden test (Hyun Min Kang)&lt;br /&gt;
** Likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of Firth bias-corrected likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of EMMAX single variant test (Hyun Min Kang) &lt;br /&gt;
* Mar 29, 2012 : EPACTS v1.0-alpha is released&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14513</id>
		<title>EPACTS</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14513"/>
		<updated>2016-12-15T22:47:16Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Installation Details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;EPACTS&#039;&#039;&#039; (Efficient and Parallelizable Association Container Toolbox) is a versatile software pipeline to perform various statistical tests for identifying genome-wide association from sequence data through a user-friendly interface, both to scientific analysts and to method developers.&lt;br /&gt;
&lt;br /&gt;
== Join in EPACTS mailing list ==&lt;br /&gt;
&lt;br /&gt;
Please join in the [http://groups.google.com/group/epacts EPACTS Google Group] to ask / discuss / comment about EPACTS.&lt;br /&gt;
&lt;br /&gt;
== Lastest ChangeLog ==&lt;br /&gt;
* Dec 15th, 2016 : EPACTS v3.3.0 release (github)&lt;br /&gt;
** Moved the repository into github&lt;br /&gt;
** Some major fixes in handling large sample size (&amp;gt;18,000)&lt;br /&gt;
** Other minor bug fixes &lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs (more comprehensive fix is still pending)&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
See [[#Full ChangeLog]] for full details&lt;br /&gt;
&lt;br /&gt;
== Key Features ==&lt;br /&gt;
&lt;br /&gt;
EPACTS currently provides the following set of key features&lt;br /&gt;
* Robust support for widely used format of sequence-based genotypes (VCF) and phenotypes with pedigree (PED)&lt;br /&gt;
** Efficient library for accessing VCF file to reduce computational burden to analyze large-scale sequencing data&lt;br /&gt;
** Support selecting markers by arbitrary combination of substring matching. &lt;br /&gt;
** Support for using genotype dosages instead of hard genotype calls&lt;br /&gt;
** Utilize PED format to perform test across multiple traits.&lt;br /&gt;
* Supports a large number of widely used statistical tests for single variant association and burden tests.&lt;br /&gt;
** See the &amp;quot;Currently Supported Statistical Tests&amp;quot; section below for more information&lt;br /&gt;
* Easy to Highly Parallelize Jobs&lt;br /&gt;
** Makefile-based partition into and ligation of multiple subtasks&lt;br /&gt;
** Parallel run of job is simply adding one parameter when running EPACTS &lt;br /&gt;
* Integrative and versatile framework that allows easy addition of additional statistical test&lt;br /&gt;
** Core input/output routines are implemented in C++&lt;br /&gt;
** Most statistical tests (except for EMMAX) are implemented in R&lt;br /&gt;
** Adding a simple R function to implement additional statistical test (See [[#Implementing Additional Statistical Tests]] for details)&lt;br /&gt;
* Useful utilities for post-association-analysis tasks&lt;br /&gt;
** Automatic functional annotation of associated variants&lt;br /&gt;
** Automatic generation of QQ and Manhattan Plot&lt;br /&gt;
** (TBA) Zoom plot for the significant associations&lt;br /&gt;
&lt;br /&gt;
== Obtaining EPACTS ==&lt;br /&gt;
&lt;br /&gt;
* The official release of EPACTS software is available at http://csg-old.sph.umich.edu/kang/epacts/download/index.html&lt;br /&gt;
** From the CSG cluster, it is available at /net/fantasia/home/bin/epacts/&lt;br /&gt;
* Note that R (version 2.10 or higher) and gnuplot (version 4.2 or higher) must be installed in order to run EPACTS correctly.&lt;br /&gt;
&lt;br /&gt;
== Currently Supported Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
EPACTS supports the following sets of widely used statistical tests for single variant tests and burden tests&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.wald &lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logisitic Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (simply used glm in R)&lt;br /&gt;
|-&lt;br /&gt;
| b.score&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Logistic Score Test &amp;lt;br&amp;gt; (from Lin DY and Tang ZZ, AJHG 2011 89:354-67)&lt;br /&gt;
| Clement Ma &amp;amp; Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.firth&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Firth Bias-Corrected Logistic Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.spa&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; &lt;br /&gt;
| Moderate&lt;br /&gt;
| Saddlepoint Approximation Method&lt;br /&gt;
| Shawn Lee &amp;amp; Rounak Dey&lt;br /&gt;
|-&lt;br /&gt;
| b.lrt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.glrt&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Fast&lt;br /&gt;
| Genotype Likelihood Ratio Test &amp;lt;br&amp;gt; (use GL or PL field in VCF to perform case-control test)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.lm&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Linear Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (as implemented in lm in R)&lt;br /&gt;
|-&lt;br /&gt;
| q.score&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Quantitative Score Test &amp;lt;br&amp;gt; (from Lin DY and Tang ZZ, AJHG 2011 89:354-67)&lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| q.linear&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Linear Wald Test&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.emmax&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| EMMAX &amp;lt;br&amp;gt; ( Kang et al (2010) Nat Genet 42:348-54 )&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.collapse&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and 0/1 collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.madsen&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Slow&lt;br /&gt;
| Wilcoxon Rank Sum Test between binary phenotypes and weighted rare variant scores (slightly different version from the published method - it uses pooled allele frequency across cases and controls for weighting each variant)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.wcnt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and weighted rare variant scores&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression of phenotypes on binary collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression of phenotypes on collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| skat&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT-O Test by Lee et al, Biostatistics (2012)&lt;br /&gt;
| Seunggeun Lee &amp;lt;br&amp;gt; (adaptive by Xueling Sim and Hyun Min Kang)&lt;br /&gt;
|-&lt;br /&gt;
| VT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed out first)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable Threshold Test &amp;lt;br&amp;gt; with adaptive permutation &amp;lt;br&amp;gt; Price et al, AJHG (2010) 86:832-8&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxCMC&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Collapsing burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxVT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable-threshold burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| mmskat&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT test using EMMAX&lt;br /&gt;
| Seunggeun Lee &amp;amp; Hyun Min Kang&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Installation Details  ==&lt;br /&gt;
&lt;br /&gt;
If you want to use EPACTS in an Ubuntu platform, following the step below &lt;br /&gt;
&lt;br /&gt;
 $ git clone https://github.com/statgen/EPACTS.git&lt;br /&gt;
 $ cd EPACTS&lt;br /&gt;
 $ ./configure --prefix [/path/to/install]&lt;br /&gt;
 $ make&lt;br /&gt;
 $ make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Important Note: &#039;&#039;&#039;make sure to specify --prefix=/path/to/install&#039;&#039;&#039; to avoid installing to the default path /usr/local/, which you may not have the permission. /home/your_userid/epacts might be a good one, if you are not sure where to install)&lt;br /&gt;
  &lt;br /&gt;
* Now ${EPACTS_DIR} represents the &#039;/path/to/install&#039; directory&lt;br /&gt;
&lt;br /&gt;
* Download the reference FASTA files from 1000 Genomes FTP automatically by running the following commands&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/epacts download&lt;br /&gt;
&lt;br /&gt;
 (For advanced users, to save time for downloading the FASTA files (~900MB), you may copy a local copy of GRCh37 FASTA file and the index file to ${EPACTS_DIR}/share/EPACTS/)&lt;br /&gt;
&lt;br /&gt;
*Perform a test run by running the following command&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
&lt;br /&gt;
In order to use EPACTS in the CSG cluster, you do not need to install them. You can directly use or make a copy of the in-house release version at &lt;br /&gt;
&lt;br /&gt;
 /net/fantasia/home/hmkang/bin/epacts/&lt;br /&gt;
&lt;br /&gt;
* If you want to access previous versions, visit http://csg-old.sph.umich.edu/kang/epacts/download&lt;br /&gt;
&lt;br /&gt;
== Getting Started With Examples ==&lt;br /&gt;
If you are using EPACTS from the CSG cluster, please set the following environment variable&lt;br /&gt;
 EPACTS_DIR=/net/fantasia/home/hmkang/bin/epacts (in bash)&lt;br /&gt;
 setenv EPACTS_DIR /net/fantasia/home/hmkang/bin/epacts (in csh)&lt;br /&gt;
&lt;br /&gt;
If you downloaded EPACTS binary and please set EPACTS_DIR to the full path of the downloaded and uncompressed directory.&lt;br /&gt;
&lt;br /&gt;
=== All-in-one example ===&lt;br /&gt;
&lt;br /&gt;
To get started with EPACTS, run the following command will perform an example run&lt;br /&gt;
 ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
 &lt;br /&gt;
You will find a series of lines in test_run_epacts.sh script commented out for each possible test. &lt;br /&gt;
&lt;br /&gt;
The example phenotype (PED format) and genotype (VCF format) can be found at&lt;br /&gt;
 ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Test ===&lt;br /&gt;
&lt;br /&gt;
Or You can run EPACTS command yourself by running&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
   --vcf  ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
   --ped  ${EPACTS_DIR}/data/1000G_dummy_pheno.ped  \&lt;br /&gt;
   --min-maf 0.001 --chr 20 --pheno DISEASE --cov AGE --cov SEX --test b.score --anno \ &lt;br /&gt;
   --out out/test --run 2&lt;br /&gt;
&lt;br /&gt;
The command above will perform single variant association test using a dummy case-control phenotype file and a subset of 1000 genomes exome VCF file (chr20) using score test statistic for all variants over 1% of higher MAF using 2 parallel runs.&lt;br /&gt;
&lt;br /&gt;
You will see the 4 output files as the main outcome of the analysis&lt;br /&gt;
&lt;br /&gt;
==== Output Text of All Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The filename is out/test.single.b.score.epacts.gz and the contents will look like&lt;br /&gt;
 $ zcat out/test.single.b.score.epacts.gz | head&lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	68303	68303	20:68303_A/G_Upstream:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68319	68319	20:68319_C/A_Upstream:DEFB125	266	1.4467e-36	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68396	68396	20:68396_C/T_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76635	76635	20:76635_A/T_Intron:DEFB125	266	1.534e-37	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76689	76689	20:76689_T/C_Synonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76690	76690	20:76690_T/C_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76700	76700	20:76700_G/A_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76726	76726	20:76726_C/G_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76771	76771	20:76771_C/T_Nonsynonymous:DEFB125	266	3	1	0.0056391	0.68484	0.40587	145	121	0.013793	0.0082645&lt;br /&gt;
&lt;br /&gt;
==== Output Text of Top Associations ====&lt;br /&gt;
&lt;br /&gt;
Same type of file but containing top 5,000 association will be stored at out/test.epacts.top5000&lt;br /&gt;
&lt;br /&gt;
 $ head out/test.single.b.score.epacts.top5000 &lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	1610894	1610894	20:1610894_G/A_Synonymous:SIRPG	266	138.64	1	0.26061	6.9939e-05	3.9765	145	121	0.65177	0.36476&lt;br /&gt;
 20	4162411	4162411	20:4162411_T/C_Intron:SMOX	266	204	1	0.38346	0.00055583	-3.4523	145	121	0.62759	0.93388&lt;br /&gt;
 20	34061918	34061918	20:34061918_T/C_Intron:CEP250	266	41.815	1	0.0786	0.00095471	3.3035	145	121	0.22543	0.075436&lt;br /&gt;
 20	4155948	4155948	20:4155948_G/A_Intron:SMOX	266	215	1	0.40414	0.0020792	-3.0787	145	121	0.68276	0.95868&lt;br /&gt;
 20	4680251	4680251	20:4680251_A/G_Nonsynonymous:PRNP	266	186	1	0.34962	0.0025962	3.0119	145	121	0.8069	0.57025&lt;br /&gt;
 20	36668874	36668874	20:36668874_G/A_Synonymous:RPRD1B	266	96	1	0.18045	0.003031	2.9646	145	121	0.44828	0.2562&lt;br /&gt;
 20	36641871	36641871	20:36641871_G/A_Synonymous:TTI1	266	10	1	0.018797	0.004308	-2.8547	145	121	0.0068966	0.07438&lt;br /&gt;
 20	1616892	1616892	20:1616892_A/G_Synonymous:SIRPG	266	144	1	0.27068	0.0051239	2.7991	145	121	0.63449	0.42975&lt;br /&gt;
 20	25038372	25038372	20:25038372_G/A_Intron:ACSS1	266	103.3	1	0.19418	0.005748	2.7618	145	121	0.47201	0.28813&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;AC&#039;&#039;&#039; : Total Non-reference Allele Count&lt;br /&gt;
* &#039;&#039;&#039;CALLRATE&#039;&#039;&#039; : Fraction of non-missing genotypes.&lt;br /&gt;
* &#039;&#039;&#039;MAF&#039;&#039;&#039; : Minor allele frequencies&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of single variant test&lt;br /&gt;
* &#039;&#039;&#039;AF.CASE&#039;&#039;&#039; : Non-reference allele frequencies for cases&lt;br /&gt;
* &#039;&#039;&#039;AF.CTRL&#039;&#039;&#039; : Non-reference allele frequencies for controls&lt;br /&gt;
&lt;br /&gt;
==== Q-Q plot of test statistics (stratified by MAF) ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.qq.pdf will be generated as shown below&lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_qq.png]]&lt;br /&gt;
&lt;br /&gt;
==== Manhattan Plot of Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.mh.pdf will be generated for chr20 only. &lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_mh.png]]&lt;br /&gt;
&lt;br /&gt;
An example Genome-wide manhattan plot (from a genome-wide run) will look like below&lt;br /&gt;
&lt;br /&gt;
[[File:tes_b_score_epacts_mh_gw.png]]&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise burden test ===&lt;br /&gt;
&lt;br /&gt;
Gene-wise or group-wise burden test requires two steps. First, &#039;group&#039; file containing the list of &lt;br /&gt;
markers per group needs to be generated. Second, group-wise burden test needs to be run&lt;br /&gt;
&lt;br /&gt;
==== Creating marker group file ====&lt;br /&gt;
&lt;br /&gt;
The marker group file has the following format&lt;br /&gt;
&lt;br /&gt;
 [GROUP_ID]  [MARKER_ID_1]   [MARKER_ID_2]  .... [MARKER_ID_N]&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
* [GROUP_ID] is a string representing the group (e.g. gene name)&lt;br /&gt;
* [MARKER_ID_K] is a marker key as a format of [CHROM]:[POS]_[REF]/[ALT] (NOTE THAT THIS IS DIFFERENT FROM TYPICAL VCF MARKER ID field)&lt;br /&gt;
&lt;br /&gt;
Note that [MARKER_ID_K] has to be sorted by increasing order of genomic coordinate&lt;br /&gt;
&lt;br /&gt;
In order to create gene-level group file from typically formatted VCF file, one may use the following utility &lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --nonsyn&lt;br /&gt;
&lt;br /&gt;
The above command create a file [output-group-file] containing a list of missense and nonsense variants per each gene. To incorporate different types of functional annotations, use --type option as follows&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --type [function_type_1] --type [function_type_2] ...&lt;br /&gt;
&lt;br /&gt;
Type &#039;epacts makegroup -man&#039; for the detailed documentation&lt;br /&gt;
&lt;br /&gt;
==== Annotating VCF file using EPACTS ====&lt;br /&gt;
&lt;br /&gt;
If the VCF is not annotated, &#039;epacts makegroup&#039; cannot be used. In order to annotate VCF, one can use the example VCF using ANNOVAR as follows:&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts anno \&lt;br /&gt;
    --in ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
    --out ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
The epacts anno script will add &amp;quot;ANNO=[function]:[genename]&amp;quot; entry into the INFO field based on gencodeV7 (default) or refGene database.&lt;br /&gt;
&lt;br /&gt;
It is important to check whether the VCF file is already annotated or not in order to avoid no or redundant annotation.&lt;br /&gt;
&lt;br /&gt;
==== Running Groupwise Test ====&lt;br /&gt;
&lt;br /&gt;
To perform a groupwise burden test on the example VCF (annotated as above), run the following command&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --vcf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz \&lt;br /&gt;
   --groupf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.grp --out out/test.gene.skat \&lt;br /&gt;
   --ped ${EPACTS_DIR}/data/1000G_dummy_pheno.ped --maxAF 0.05 \&lt;br /&gt;
   --chr 20 --pheno QT --cov AGE --cov SEX --test skat --skat-o --run 2&lt;br /&gt;
&lt;br /&gt;
==== Example Output ====&lt;br /&gt;
 $ head out/test.gene.skat.epacts.top5000&lt;br /&gt;
 #CHROM BEGIN   END     MARKER_ID       NS      FRAC_WITH_RARE     NUM_ALL_VARS    NUM_PASS_VARS   NUM_SING_VARS   PVALUE  STATRHO&lt;br /&gt;
 20     62607037        62608720        20:62607037-62608720_SAMD10     266     0.14662 9       5       1       0.0020064       1&lt;br /&gt;
 20     2816211 2820493 20:2816211-2820493_FAM113A      266     0.011278        12      2       1       0.0032542       0&lt;br /&gt;
 20     47245987        47361692        20:47245987-47361692_PREX1      266     0.1391  54      9       6       0.0054849       1&lt;br /&gt;
 20     34761734        34810279        20:34761734-34810279_EPB41L1    266     0.071429        14      7       5       0.0068492       0.2&lt;br /&gt;
 20     61340671        61391602        20:61340671-61391602_NTSR1      266     0.11278 24      9       3       0.011063        1&lt;br /&gt;
 20     48561952        48568644        20:48561952-48568644_RNF114     266     0.011278        4       2       1       0.015175        0.2&lt;br /&gt;
 20     60962895        60963559        20:60962895-60963559_RPS21      266     0.06015 6       3       2       0.016409        0&lt;br /&gt;
 20     55904961        55917801        20:55904961-55917801_SPO11      266     0.011278        11      3       3       0.018031        0&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;FRAC_WITH_RARE&#039;&#039;&#039; : Fraction of individual carrying rare variants below --max-maf (default : 0.05) threshold.&lt;br /&gt;
* &#039;&#039;&#039;NUM_ALL_VARS&#039;&#039;&#039; : Number of all variants defining the group.&lt;br /&gt;
* &#039;&#039;&#039;NUM_PASS_VARS&#039;&#039;&#039; : Number of variants passing the --min-maf, --min-mac, --max-maf, --min-callrate thresholds&lt;br /&gt;
* &#039;&#039;&#039;NUM_SING_VARS&#039;&#039;&#039; : Number of singletons among variants in NUM_PASS_VARS&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of burden tests&lt;br /&gt;
* Other columns are test specific auxiliary columns. For example, in the VT test, the optimal MAF threshold is recorded as an auxiliary output column.&lt;br /&gt;
&lt;br /&gt;
=== Specialized Instruction for EMMAX tests ===&lt;br /&gt;
&lt;br /&gt;
EMMAX (Efficient Mixed Model Association eXpedited - Kang et al (2010) Nat Genet 42:348-54) is an efficient implementation of mixed model association accounting for sample structure including population structure and hidden relatedness. Currently EPACTS supports EMMAX association mapping in single variant test and CMC-like burden tests. &lt;br /&gt;
&lt;br /&gt;
Because EMMAX is based on linear model, the method fits better to quantiative traits than binary traits. However, p-values for binary traits are expected to be valid in the spirit of Armitage trend test, although the estimated effect size may not be precise.&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
==== Single Variant EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : From VCF, we recommend to set a MAF (e.g. 0.01) and call rate (e.g. 0.95) threshold to select high-quality markers to generate kinship matrix as follows.&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-kin \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped (Optional)] --min-maf 0.01 --minCallRate 0.95 \&lt;br /&gt;
  --sepchr (if VCF is separated by chromosome) --out [outprefix.kinf] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
If you provide [input.ped] file, then it will calculate the subset the individuals contained in the PED file. &lt;br /&gt;
&lt;br /&gt;
The procedure above will create a file [outprefix.kinf] after splitting and merging the genomes into multiple pieces. If only a certain subset of SNPs needs to be considered due to target regions, LD-pruning, or any other reasons, a VCF containing the subset of markers must be created beforehand and should be used as input VCF file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Perform Single Variant Association&#039;&#039;&#039; : From VCF and PED, we recommend to use less stringent MAF threshold (e.g. 0.001) and call rate (e.g. 0.50) to perform single variant association&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --min-maf 0.001 --kin [outputprefix.kinf] \&lt;br /&gt;
  --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] --test q.emmax \&lt;br /&gt;
  --out [outprefix] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
The procedure above will perform single variant association analysis compatible to other types of single variant association analyses implemented in EPACTS&lt;br /&gt;
&lt;br /&gt;
==== Burden-style EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : See &#039;Creating Kinship Matrix&#039; section in [[#Single Variant EMMAX Association Analysis]]&lt;br /&gt;
* &#039;&#039;&#039;Create Marker Group&#039;&#039;&#039;&lt;br /&gt;
** By annotating the VCF and extracting missense and nonsense variants&lt;br /&gt;
*** [[#Annotating VCF file using ANNOVAR]] - This step will be required to create marker group file&lt;br /&gt;
*** [[#Creating marker group file]] - Assume that [group.grp] file is produced&lt;br /&gt;
** Or, by creating your own marker group information&lt;br /&gt;
*** See [[#Creating marker group file]] for details&lt;br /&gt;
* Run CMC-style burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxCMC --out [outprefix] &lt;br /&gt;
* Run Variable Threshold burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxVT --out [outprefix]&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Own Input Data ==&lt;br /&gt;
&lt;br /&gt;
=== VCF file for Genotypes ===&lt;br /&gt;
&lt;br /&gt;
EPACTS support VCF files as input for association with the following requirement&lt;br /&gt;
* Input VCF file must be bgzipped and tabixed before running association to allow efficient random access of the file. Below is an example command to conver plain VCF into bgzipped and tabixed VCF&lt;br /&gt;
  bgzip input.vcf     ## this command will produce input.vcf.gz&lt;br /&gt;
  tabix -pvcf -f input.vcf.gz  ## this command will produce input.vcf.gz.tbi&lt;br /&gt;
* If the VCF file is separated by chromosome, the VCF file specified in the input argument must contain the string &amp;quot;chr1&amp;quot; in the chromosome 1 file, and corresponding chromosome name for other chromosomes. Thus, the files names should be like &amp;lt;code&amp;gt;[prefix]chr1[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chr2[suffix].vcf.gz&amp;lt;/code&amp;gt;, ..., &amp;lt;code&amp;gt;[prefix]chr22[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chrX[suffix].vcf.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Sample IDs in the VCF file must be consistent to those from PED file&lt;br /&gt;
* Currently EPACTS only support bi-allelic variants, but it handles SNPs, INDELs, snd SVs.&lt;br /&gt;
* Currently, EPACTS only support VCF aligned with NCBI build 37 coordinates&lt;br /&gt;
* An example VCF file from 1000 genome project is below. &lt;br /&gt;
 $ zcat example/1000G_integrated_phase1_chr20.vcf.gz | cut -f 1-10 | head -50 &lt;br /&gt;
 ##fileformat=VCFv4.1&lt;br /&gt;
 ##INFO=&amp;lt;ID=LCSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Low coverage VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=EXSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Exome VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=INDEL,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in INDEL VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SV,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in SV VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BAVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BRSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality estimate from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=LDAF,Number=1,Type=Float,Description=&amp;quot;MLE Allele Frequency Accounting for LD&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=RSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=ERATE,Number=1,Type=Float,Description=&amp;quot;Per-marker Mutation rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=THETA,Number=1,Type=Float,Description=&amp;quot;Per-marker Transition rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIEND,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around END for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIPOS,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around POS for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=END,Number=1,Type=Integer,Description=&amp;quot;End position of the variant described in this record&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMLEN,Number=.,Type=Integer,Description=&amp;quot;Length of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMSEQ,Number=.,Type=String,Description=&amp;quot;Sequence of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SOURCE,Number=.,Type=String,Description=&amp;quot;Source of deletion call&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVLEN,Number=1,Type=Integer,Description=&amp;quot;Difference in length between REF and ALT alleles&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVTYPE,Number=1,Type=String,Description=&amp;quot;Type of structural variant&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AC,Number=.,Type=Integer,Description=&amp;quot;Alternate Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AN,Number=1,Type=Integer,Description=&amp;quot;Total Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##ALT=&amp;lt;ID=DEL,Description=&amp;quot;Deletion&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GT,Number=1,Type=String,Description=&amp;quot;Genotype&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=DS,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GL,Number=.,Type=Float,Description=&amp;quot;Genotype Likelihoods&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=BD,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 #CHROM POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  HG00096&lt;br /&gt;
 20 60479   .   C   T   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.894;LDAF=0.0020;AVGPOST=0.9995;RSQ=0.8779;ERATE=0.0005;THETA=0.0008;AC=4;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.19,-0.46,-2.68:0.0022&lt;br /&gt;
 20 60522   .   T   TC  1588    PASS    INDEL;BAVGPOST=1.000;BRSQ=0.994;LDAF=0.0116;AVGPOST=0.9980;RSQ=0.9327;ERATE=0.0004;THETA=0.0167;AC=24;AN=2184   GT:DS:GL:BD 0|0:0.000:0.00,-0.90,-9.20:0&lt;br /&gt;
 20 60571   .   C   A   100 PASS    LCSNP;EXSNP;BAVGPOST=0.999;BRSQ=0.813;LDAF=0.0029;AVGPOST=0.9986;RSQ=0.8085;ERATE=0.0014;THETA=0.0014;AC=5;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.05,-0.96,-5.00:0.0008&lt;br /&gt;
 20 60795   .   G   C   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.930;LDAF=0.0006;AVGPOST=0.9996;RSQ=0.7205;ERATE=0.0003;THETA=0.0041;AC=1;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.03,-1.21,-5.00:0.0001&lt;br /&gt;
 20 60810   .   G   GA  127 PASS    INDEL;BAVGPOST=1.000;BRSQ=0.862;LDAF=0.0013;AVGPOST=0.9987;RSQ=0.5684;ERATE=0.0004;THETA=0.0061;AC=2;AN=2184    GT:DS:GL:BD 0|0:0.000:0.00,-1.80,-18.80:0&lt;br /&gt;
&lt;br /&gt;
=== PED file for Phenotypes and Covariates ===&lt;br /&gt;
&lt;br /&gt;
EPACTS accepts a PED format supported by MERLIN or PLINK software to represent phenotypes. For example, the example.ped file and example.dat file can represent the phenotypes and corresponding column name (from 6th column and after). &lt;br /&gt;
&lt;br /&gt;
 $ head example.ped&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
 $ cat example.dat&lt;br /&gt;
 A DISEASE&lt;br /&gt;
 T QT&lt;br /&gt;
 T AGE&lt;br /&gt;
&lt;br /&gt;
EPACTS also accept a PED format with header information. The above file can be combined into one file as follows&lt;br /&gt;
&lt;br /&gt;
 $ head data/1000G_dummy_pheno.ped&lt;br /&gt;
 #FAM_ID    IND_ID  FAT_ID  MOT_ID  SEX DISEASE QT  AGE&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
The column names can be used to identify the names of phenotypes and covariates in the analysis.&lt;br /&gt;
&lt;br /&gt;
== Frequently Asked Questions ==&lt;br /&gt;
=== Installation ===&lt;br /&gt;
# How should I install EPACTS? &lt;br /&gt;
#* See [[EPACTS#Installation_Details | Installation Details]]&lt;br /&gt;
# I am having the following error message &#039;&#039;&#039;configure: error: libR.{so,a} was not found. Please install it at http://www.r-project.org/ first&#039;&#039;&#039;. What do I have to do?&lt;br /&gt;
#* First, you need to find out where R was installed. Try to type &amp;quot;locate libR.so&amp;quot; and see if it returns anything&lt;br /&gt;
#* If &amp;quot;locate libR.so&amp;quot; returns you something, as explained [[EPACTS#Installation_Details | Installation Details]], try to add &amp;quot;LDFLAGS=-L/path/to/R/library&amp;quot; and rerun &#039;&#039;&#039;configure&#039;&#039;&#039; and &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
#* If you cannot find libR.so, you make have to recompile R with --enable-R-shlib option as described in http://cran.r-project.org/doc/manuals/R-admin.html#Installation&lt;br /&gt;
&lt;br /&gt;
=== Input Files ===&lt;br /&gt;
# What is VCF?&lt;br /&gt;
#* VCF refers to Variant Call Format&lt;br /&gt;
#* See [[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 1000 Genomes wiki page]] for the detailed description of VCF format&lt;br /&gt;
# Should input VCF be compressed into certain format?&lt;br /&gt;
#* Correct. EPACTS assumes that VCF file is bgzipped and tabixed already.&lt;br /&gt;
#* See [[#VCF file for Genotypes]] for details.&lt;br /&gt;
# What are the additional requirements for input VCF file?&lt;br /&gt;
#* Input VCF file used for association mapping must contain individual genotype information at 10-th or higher order columns.&lt;br /&gt;
#* GT field must be encoded as haploid or diploid&lt;br /&gt;
#* Bi-allelic SNPs only : Currently EPACTS may not handle multi-allelic SNPs correctly.&lt;br /&gt;
#* If non-GT field is used, the field is considered as dosage and should be a single numeric value.&lt;br /&gt;
# What are the acceptable input format to encode phenotypes and covariates?&lt;br /&gt;
#* See [[#PED file for Phenotypes and Covariates]] for the detailed information&lt;br /&gt;
# How should I encode binary phenotypes?&lt;br /&gt;
#* If you encode your phenotypes into two different numeric values (e.g. 0/1 or 1/2), EPACTS will automatically recognize them as binary phenotypes and encode them into 1/2 values. Higher value will be considered as cases for case-control association&lt;br /&gt;
# How should I encode missing genotypes?&lt;br /&gt;
#* The default code missing phenotypes in EPACTS are &#039;NA&#039;&lt;br /&gt;
#* One may use --missing option to specify different types of missing values&lt;br /&gt;
#* The encoding of missing genotypes follows the VCF specificiation&lt;br /&gt;
# How do I match the relationship between VCF and PED input files?&lt;br /&gt;
#* EPACTS will assume that the individual IDs in each VCF and PED file are unique, and they follow the saming convention. Thus, the individual IDs overlapping between VCF and PED files will be considered in the associations&lt;br /&gt;
# How the individuals with missing phenotypes are handled?&lt;br /&gt;
#* Currently, EPACTS will automatically remove the individuals without phenotypes or covariates. If one wants to use imputed covariates to increase sample size, the PED file must contain the imputed covariate values.&lt;br /&gt;
#* Markers with missing genotypes won&#039;t be discarded automatically. It can be explicitly discarded by --minCallRate option when performing association&lt;br /&gt;
&lt;br /&gt;
=== Output Files ===&lt;br /&gt;
# Which output files should I be looking at?&lt;br /&gt;
#* [[#Output Text of Top Associations]] is the key file to look at the individual top associations&lt;br /&gt;
#* [[#Q-Q plot of test statistics (stratified by MAF)]] will be important to see the global distribution of test statistics and examine if there are apparent inflation of test statistics&lt;br /&gt;
#* [[#Manhattan Plot of Test Statistics]] will inform us the genome-wide distribution of association signals&lt;br /&gt;
#* [[#Output Text of All Test Statistics]] will contain the full information of test results across all units tested&lt;br /&gt;
# The Q-Q and Manhattan plots cannot be found. Why?&lt;br /&gt;
#* It is probably because gnuplot 4.2 or higher is not installed in your system, or they are included but cannot be found in your ${PATH}. Please visit [[http://gnuplot.info/ GNUPLOT web page]] for installation.&lt;br /&gt;
# How can I read the EMMAX kinship file from produced from EPACTS?&lt;br /&gt;
# * You can run the following command to dump your kinship matrix into a human-readable text format.&lt;br /&gt;
 $(EPACTS_DIR)/bin/epacts/bin/pEmmax kin-util --kinf [input.kinf] --outf [output.prefix] --dump&lt;br /&gt;
&lt;br /&gt;
=== More questions ===&lt;br /&gt;
# If you have more questions, please contact [[mailto:hmkang@umich.edu Hyun Min Kang]].&lt;br /&gt;
&lt;br /&gt;
== Detailed Options ==&lt;br /&gt;
&lt;br /&gt;
The detailed options can viewed by running the following commands&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts -man           (for overall structure) &lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts single -man    (for single variant test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts group -man     (for groupwise test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts anno -man      (for annotation)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts plot -man      (for QQ and Manhattan plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts zoom -man      (for zoom plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts meta -man      (for meta-analysis)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts make-group -man (for creating gene group)&lt;br /&gt;
&lt;br /&gt;
== Implementing Additional Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
In order to add additional statistical test to EPACTS, the following procedure are recommended&lt;br /&gt;
&lt;br /&gt;
# Create a file named &#039;single.[testname].R&#039; for single variant test or &#039;gene.[testname].R&#039; for gene-level test under ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
# Test your implementation using --test [testname] option to perform sanity check and debugging&lt;br /&gt;
# If you want to add your test in the official in-house version, please send your code to Hyun&lt;br /&gt;
&lt;br /&gt;
Below is an example of a single variant test implementation ( single.q.lm.R )&lt;br /&gt;
 ## Core functions of EPACTS to perform association&lt;br /&gt;
 &lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## SINGLE VARIANT TEST&lt;br /&gt;
 ## INPUT VARIABLES:&lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   NS       : number of called samples&lt;br /&gt;
 ##   AC       : allele count&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:nrow(NS) after AF/AC threshold&lt;br /&gt;
 ##   genos    : genotype matrix (after AF/AC threshold)&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional columns to add&lt;br /&gt;
 ##   cname    : column names for additional columns&lt;br /&gt;
 ##################################################################  &lt;br /&gt;
 &lt;br /&gt;
 ## single.lm() : Use built-in lm() function to perform association&lt;br /&gt;
 ## KEY FEATURES : SIMPLE, BUT MAY BE SLOW&lt;br /&gt;
 ##                GOOD SNIPPLET TO START A NEW FUNCTION&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, TSTAT&lt;br /&gt;
 ## MISSING VALUES : IGNORED&lt;br /&gt;
 single.q.lm &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;TSTAT&amp;quot;) # column names for additional variables in the EPACTS output&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   p &amp;lt;- rep(NA,m)&lt;br /&gt;
   add &amp;lt;- matrix(NA,m,3) ## BETA, SEBETA, TSTAT&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
    for(i in 1:m) {&lt;br /&gt;
      r &amp;lt;- summary(lm(pheno~genos[i,]+cov-1))$coefficients[1,]  # run simple linear regression&lt;br /&gt;
      p[i] &amp;lt;- r[4]   # store p-value to p[i]&lt;br /&gt;
      add[i,] &amp;lt;- r[1:3] # store additional variables to add[i,]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  return(list(p=p,add=add,cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
As described in the comment, you may assume that the following variables are available for use for testing association across m markers&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker&lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (m * 1 vector) : p-value matrix as output&lt;br /&gt;
* add (m * c matrix) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# AC : Non-ref allele count&lt;br /&gt;
# CALLRATE : Call rate = NS/n&lt;br /&gt;
# MAF : Minor allele frequency&lt;br /&gt;
# PVALUE : P-values&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
Below is an example of a gene-lvel variant test implementation ( single.q.lm.R )&lt;br /&gt;
&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## GENE-LEVEL BURDEN TEST&lt;br /&gt;
 ## INPUT VARIABLES: &lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   genos    : genotype matrix for each gene&lt;br /&gt;
 ##   NS       : number of called samples for each marker&lt;br /&gt;
 ##   AC       : allele count for each marker&lt;br /&gt;
 ##   MAC      : minor allele count for each marker&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:n after AF/AC threshold&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional column values&lt;br /&gt;
 ##   cname    : additional column names&lt;br /&gt;
 ##################################################################      &lt;br /&gt;
 &lt;br /&gt;
 ## gene.q.reverse() : Reverse logistic regression&lt;br /&gt;
 ## KEY FEATURES : 0/1 collapsing variable ~ rare variants&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE (GAUSSIAN)&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, ZSTAT&lt;br /&gt;
 ## MISSING VALUE : IMPUTED AS MAJOR ALLELES&lt;br /&gt;
 gene.q.reverse &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;ZSTAT&amp;quot;)&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
     g &amp;lt;- as.double(colSums(genos,na.rm=T) &amp;gt; 0)&lt;br /&gt;
     sg &amp;lt;- sum(g)&lt;br /&gt;
     if ( ( sg &amp;gt; 0 ) &amp;amp;&amp;amp; ( sg &amp;lt; n ) ) {&lt;br /&gt;
       r &amp;lt;- glm(g~pheno+cov-1,family=binomial)&lt;br /&gt;
        if ( ( r$converged ) &amp;amp;&amp;amp; ( ! r$boundary ) ) {&lt;br /&gt;
         return(list(p=summary(r)$coefficients[1,4],&lt;br /&gt;
                     add=summary(r)$coefficients[1,1:3],&lt;br /&gt;
                     cname=cname))&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   return(list(p=NA,add=rep(NA,3),cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Similar to gene-level test, you may assume the following variables exist for testing A SINGLE GENE. Note that M is the number of markers spanning the gene region&lt;br /&gt;
&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker &lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAC (M * 1 vector) : Minor allele count&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (scalar) : p-value matrix as output&lt;br /&gt;
* add (c * 1 vector) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# MAF_BURDEN : MAF of 0/1 collapsing variables (existence of rare variants)&lt;br /&gt;
# NUM_ALL_VARS : Number of all variants within the gene&lt;br /&gt;
# NUM_RARE_VARS : Number of rare variants below the max-MAF threshold&lt;br /&gt;
# NUM_SING_VARS : Number of singleton variants&lt;br /&gt;
# PVALUE : P-value from the test&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
== Full ChangeLog ==&lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs&lt;br /&gt;
** Some known bugs still exist &lt;br /&gt;
*** SKAT-O Lambda eigenvalue error. This happenes in a particular context but haven&#039;t nailed down a way to prevent it yet.&lt;br /&gt;
*** EMMAX has case and control frequency flipped.&lt;br /&gt;
* EMMAX test has a silly known bug with case / ctrl frequency is flipped&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
* February 28th, 2013 : EPACTS v3.2.0 release&lt;br /&gt;
** R package installation bug (for some users) was fixed&lt;br /&gt;
** A bug in the MAF error for high frequency variants (AF&amp;gt;0.25) was now fixed&lt;br /&gt;
** SKAT version is updated to 0.81&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
* December 4th, 2012 : EPACTS v3.1.0 release&lt;br /&gt;
** Removed dependency on libR.so&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** November 25th, 2012 : EPACTS v3.0.0 release&lt;br /&gt;
** Restructured with source code release (with autoconf / automake / libtools)&lt;br /&gt;
** Added zoom plot feature&lt;br /&gt;
** FRAC_BURDEN keyword was replace to FRAC_WITH_RARE for groupwise testing&lt;br /&gt;
* October 26th, 2012 : EPACTS v2.2.0-beta is released with the following updates&lt;br /&gt;
** Added --max-mac option&lt;br /&gt;
** Fixed Firth&#039;s bias-corrected test (by Clement Ma)&lt;br /&gt;
** Added more informative warning messages when index files do not exist&lt;br /&gt;
** Fixed the bug in the epacts-plot in plotting ties&lt;br /&gt;
** Fixed errors in the MAF estimates per case and control&lt;br /&gt;
** Fixed bug in --minRSQ option&lt;br /&gt;
* September 28, 2012 : EPACTS v2.11-beta is released with the following updates&lt;br /&gt;
** Counts and allele frequencies for case/control added for binary tests&lt;br /&gt;
** --max-maf parameter is added&lt;br /&gt;
** Fixed EMMAX error in MAF in the output&lt;br /&gt;
** More informative error messages &lt;br /&gt;
* September 27, 2012 : EPACTS v2.1-beta is released with the following updates&lt;br /&gt;
** EMMAX interface is changed. --kinOnly option is related with a new command &#039;&#039;&#039;make-kin&#039;&#039;&#039; &lt;br /&gt;
** SKAT-O is upgraded to version 0.77 with additional configurable parameter settings&lt;br /&gt;
** Some parameter names are renamed (e.g. --min-maf, --min-mac)&lt;br /&gt;
** Many minor bugs are fixed&lt;br /&gt;
* Jul 6, 2012 : EPACTS v2.01-beta is released with the following updates&lt;br /&gt;
** SKAT-O is upgraded to version 0.76&lt;br /&gt;
** Fixed minor bugs in option names (Thanks to Xueling Sim)&lt;br /&gt;
* Jul 3, 2012 : EPACTS v2.0-beta is released with the following updates&lt;br /&gt;
** Major restructuring of the software&lt;br /&gt;
** Annotation software is switched with built-in application&lt;br /&gt;
** Addition of SKAT-O and EMMAX burden test&lt;br /&gt;
** Minor bug fixes&lt;br /&gt;
* Apr 8, 2012 : EPACTS v1.2-alpha is released with the following updates, in addition to the following updates&lt;br /&gt;
** EMMAX bug in handling covariates was fixed&lt;br /&gt;
** Variable Threshold Test is added&lt;br /&gt;
** Variable Threshold Test with genomic score (e.g. GERP or PhyloP) is added.&lt;br /&gt;
* Apr 4, 2012 : EPACTS v1.1-alpha is released with the following updates, in addition to minor updates&lt;br /&gt;
** EMMAX burden test (Hyun Min Kang)&lt;br /&gt;
** Likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of Firth bias-corrected likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of EMMAX single variant test (Hyun Min Kang) &lt;br /&gt;
* Mar 29, 2012 : EPACTS v1.0-alpha is released&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14512</id>
		<title>EPACTS</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14512"/>
		<updated>2016-12-15T22:45:32Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Single Variant Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;EPACTS&#039;&#039;&#039; (Efficient and Parallelizable Association Container Toolbox) is a versatile software pipeline to perform various statistical tests for identifying genome-wide association from sequence data through a user-friendly interface, both to scientific analysts and to method developers.&lt;br /&gt;
&lt;br /&gt;
== Join in EPACTS mailing list ==&lt;br /&gt;
&lt;br /&gt;
Please join in the [http://groups.google.com/group/epacts EPACTS Google Group] to ask / discuss / comment about EPACTS.&lt;br /&gt;
&lt;br /&gt;
== Lastest ChangeLog ==&lt;br /&gt;
* Dec 15th, 2016 : EPACTS v3.3.0 release (github)&lt;br /&gt;
** Moved the repository into github&lt;br /&gt;
** Some major fixes in handling large sample size (&amp;gt;18,000)&lt;br /&gt;
** Other minor bug fixes &lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs (more comprehensive fix is still pending)&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
See [[#Full ChangeLog]] for full details&lt;br /&gt;
&lt;br /&gt;
== Key Features ==&lt;br /&gt;
&lt;br /&gt;
EPACTS currently provides the following set of key features&lt;br /&gt;
* Robust support for widely used format of sequence-based genotypes (VCF) and phenotypes with pedigree (PED)&lt;br /&gt;
** Efficient library for accessing VCF file to reduce computational burden to analyze large-scale sequencing data&lt;br /&gt;
** Support selecting markers by arbitrary combination of substring matching. &lt;br /&gt;
** Support for using genotype dosages instead of hard genotype calls&lt;br /&gt;
** Utilize PED format to perform test across multiple traits.&lt;br /&gt;
* Supports a large number of widely used statistical tests for single variant association and burden tests.&lt;br /&gt;
** See the &amp;quot;Currently Supported Statistical Tests&amp;quot; section below for more information&lt;br /&gt;
* Easy to Highly Parallelize Jobs&lt;br /&gt;
** Makefile-based partition into and ligation of multiple subtasks&lt;br /&gt;
** Parallel run of job is simply adding one parameter when running EPACTS &lt;br /&gt;
* Integrative and versatile framework that allows easy addition of additional statistical test&lt;br /&gt;
** Core input/output routines are implemented in C++&lt;br /&gt;
** Most statistical tests (except for EMMAX) are implemented in R&lt;br /&gt;
** Adding a simple R function to implement additional statistical test (See [[#Implementing Additional Statistical Tests]] for details)&lt;br /&gt;
* Useful utilities for post-association-analysis tasks&lt;br /&gt;
** Automatic functional annotation of associated variants&lt;br /&gt;
** Automatic generation of QQ and Manhattan Plot&lt;br /&gt;
** (TBA) Zoom plot for the significant associations&lt;br /&gt;
&lt;br /&gt;
== Obtaining EPACTS ==&lt;br /&gt;
&lt;br /&gt;
* The official release of EPACTS software is available at http://csg-old.sph.umich.edu/kang/epacts/download/index.html&lt;br /&gt;
** From the CSG cluster, it is available at /net/fantasia/home/bin/epacts/&lt;br /&gt;
* Note that R (version 2.10 or higher) and gnuplot (version 4.2 or higher) must be installed in order to run EPACTS correctly.&lt;br /&gt;
&lt;br /&gt;
== Currently Supported Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
EPACTS supports the following sets of widely used statistical tests for single variant tests and burden tests&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.wald &lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logisitic Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (simply used glm in R)&lt;br /&gt;
|-&lt;br /&gt;
| b.score&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Logistic Score Test &amp;lt;br&amp;gt; (from Lin DY and Tang ZZ, AJHG 2011 89:354-67)&lt;br /&gt;
| Clement Ma &amp;amp; Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.firth&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Firth Bias-Corrected Logistic Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.spa&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; &lt;br /&gt;
| Moderate&lt;br /&gt;
| Saddlepoint Approximation Method&lt;br /&gt;
| Shawn Lee &amp;amp; Rounak Dey&lt;br /&gt;
|-&lt;br /&gt;
| b.lrt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.glrt&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Fast&lt;br /&gt;
| Genotype Likelihood Ratio Test &amp;lt;br&amp;gt; (use GL or PL field in VCF to perform case-control test)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.lm&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Linear Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (as implemented in lm in R)&lt;br /&gt;
|-&lt;br /&gt;
| q.score&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Quantitative Score Test &amp;lt;br&amp;gt; (from Lin DY and Tang ZZ, AJHG 2011 89:354-67)&lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| q.linear&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Linear Wald Test&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.emmax&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| EMMAX &amp;lt;br&amp;gt; ( Kang et al (2010) Nat Genet 42:348-54 )&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.collapse&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and 0/1 collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.madsen&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Slow&lt;br /&gt;
| Wilcoxon Rank Sum Test between binary phenotypes and weighted rare variant scores (slightly different version from the published method - it uses pooled allele frequency across cases and controls for weighting each variant)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.wcnt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and weighted rare variant scores&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression of phenotypes on binary collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression of phenotypes on collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| skat&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT-O Test by Lee et al, Biostatistics (2012)&lt;br /&gt;
| Seunggeun Lee &amp;lt;br&amp;gt; (adaptive by Xueling Sim and Hyun Min Kang)&lt;br /&gt;
|-&lt;br /&gt;
| VT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed out first)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable Threshold Test &amp;lt;br&amp;gt; with adaptive permutation &amp;lt;br&amp;gt; Price et al, AJHG (2010) 86:832-8&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxCMC&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Collapsing burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxVT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable-threshold burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| mmskat&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT test using EMMAX&lt;br /&gt;
| Seunggeun Lee &amp;amp; Hyun Min Kang&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Installation Details  ==&lt;br /&gt;
&lt;br /&gt;
If you want to use EPACTS in an Ubuntu platform, following the step below &lt;br /&gt;
&lt;br /&gt;
*Download EPACTS source distribution at http://csg-old.sph.umich.edu/kang/epacts/download/EPACTS-3.2.6.tar.gz (165MB)&lt;br /&gt;
*Uncompress EPACTS package, and install the package using the following set of commands&lt;br /&gt;
* Visit http://csg-old.sph.umich.edu/kang/epacts/download for checking previous versions&lt;br /&gt;
&lt;br /&gt;
  tar xzvf EPACTS-3.2.6.tar.gz&lt;br /&gt;
  cd EPACTS-3.2.6&lt;br /&gt;
  ./configure --prefix=/path/to/install&lt;br /&gt;
  make&lt;br /&gt;
  make install&lt;br /&gt;
&lt;br /&gt;
(Important Note: &#039;&#039;&#039;make sure to specify --prefix=/path/to/install&#039;&#039;&#039; to avoid installing to the default path /usr/local/, which you may not have the permission. /home/your_userid/epacts might be a good one, if you are not sure where to install)&lt;br /&gt;
  &lt;br /&gt;
* Now ${EPACTS_DIR} represents the &#039;/path/to/install&#039; directory&lt;br /&gt;
&lt;br /&gt;
* Download the reference FASTA files from 1000 Genomes FTP automatically by running the following commands&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/epacts download&lt;br /&gt;
&lt;br /&gt;
 (For advanced users, to save time for downloading the FASTA files (~900MB), you may copy a local copy of GRCh37 FASTA file and the index file to ${EPACTS_DIR}/share/EPACTS/)&lt;br /&gt;
&lt;br /&gt;
*Perform a test run by running the following command&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
&lt;br /&gt;
In order to use EPACTS in the CSG cluster, you do not need to install them. You can directly use or make a copy of the in-house release version at &lt;br /&gt;
&lt;br /&gt;
 /net/fantasia/home/hmkang/bin/epacts/&lt;br /&gt;
&lt;br /&gt;
== Getting Started With Examples ==&lt;br /&gt;
If you are using EPACTS from the CSG cluster, please set the following environment variable&lt;br /&gt;
 EPACTS_DIR=/net/fantasia/home/hmkang/bin/epacts (in bash)&lt;br /&gt;
 setenv EPACTS_DIR /net/fantasia/home/hmkang/bin/epacts (in csh)&lt;br /&gt;
&lt;br /&gt;
If you downloaded EPACTS binary and please set EPACTS_DIR to the full path of the downloaded and uncompressed directory.&lt;br /&gt;
&lt;br /&gt;
=== All-in-one example ===&lt;br /&gt;
&lt;br /&gt;
To get started with EPACTS, run the following command will perform an example run&lt;br /&gt;
 ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
 &lt;br /&gt;
You will find a series of lines in test_run_epacts.sh script commented out for each possible test. &lt;br /&gt;
&lt;br /&gt;
The example phenotype (PED format) and genotype (VCF format) can be found at&lt;br /&gt;
 ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Test ===&lt;br /&gt;
&lt;br /&gt;
Or You can run EPACTS command yourself by running&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
   --vcf  ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
   --ped  ${EPACTS_DIR}/data/1000G_dummy_pheno.ped  \&lt;br /&gt;
   --min-maf 0.001 --chr 20 --pheno DISEASE --cov AGE --cov SEX --test b.score --anno \ &lt;br /&gt;
   --out out/test --run 2&lt;br /&gt;
&lt;br /&gt;
The command above will perform single variant association test using a dummy case-control phenotype file and a subset of 1000 genomes exome VCF file (chr20) using score test statistic for all variants over 1% of higher MAF using 2 parallel runs.&lt;br /&gt;
&lt;br /&gt;
You will see the 4 output files as the main outcome of the analysis&lt;br /&gt;
&lt;br /&gt;
==== Output Text of All Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The filename is out/test.single.b.score.epacts.gz and the contents will look like&lt;br /&gt;
 $ zcat out/test.single.b.score.epacts.gz | head&lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	68303	68303	20:68303_A/G_Upstream:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68319	68319	20:68319_C/A_Upstream:DEFB125	266	1.4467e-36	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68396	68396	20:68396_C/T_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76635	76635	20:76635_A/T_Intron:DEFB125	266	1.534e-37	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76689	76689	20:76689_T/C_Synonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76690	76690	20:76690_T/C_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76700	76700	20:76700_G/A_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76726	76726	20:76726_C/G_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76771	76771	20:76771_C/T_Nonsynonymous:DEFB125	266	3	1	0.0056391	0.68484	0.40587	145	121	0.013793	0.0082645&lt;br /&gt;
&lt;br /&gt;
==== Output Text of Top Associations ====&lt;br /&gt;
&lt;br /&gt;
Same type of file but containing top 5,000 association will be stored at out/test.epacts.top5000&lt;br /&gt;
&lt;br /&gt;
 $ head out/test.single.b.score.epacts.top5000 &lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	1610894	1610894	20:1610894_G/A_Synonymous:SIRPG	266	138.64	1	0.26061	6.9939e-05	3.9765	145	121	0.65177	0.36476&lt;br /&gt;
 20	4162411	4162411	20:4162411_T/C_Intron:SMOX	266	204	1	0.38346	0.00055583	-3.4523	145	121	0.62759	0.93388&lt;br /&gt;
 20	34061918	34061918	20:34061918_T/C_Intron:CEP250	266	41.815	1	0.0786	0.00095471	3.3035	145	121	0.22543	0.075436&lt;br /&gt;
 20	4155948	4155948	20:4155948_G/A_Intron:SMOX	266	215	1	0.40414	0.0020792	-3.0787	145	121	0.68276	0.95868&lt;br /&gt;
 20	4680251	4680251	20:4680251_A/G_Nonsynonymous:PRNP	266	186	1	0.34962	0.0025962	3.0119	145	121	0.8069	0.57025&lt;br /&gt;
 20	36668874	36668874	20:36668874_G/A_Synonymous:RPRD1B	266	96	1	0.18045	0.003031	2.9646	145	121	0.44828	0.2562&lt;br /&gt;
 20	36641871	36641871	20:36641871_G/A_Synonymous:TTI1	266	10	1	0.018797	0.004308	-2.8547	145	121	0.0068966	0.07438&lt;br /&gt;
 20	1616892	1616892	20:1616892_A/G_Synonymous:SIRPG	266	144	1	0.27068	0.0051239	2.7991	145	121	0.63449	0.42975&lt;br /&gt;
 20	25038372	25038372	20:25038372_G/A_Intron:ACSS1	266	103.3	1	0.19418	0.005748	2.7618	145	121	0.47201	0.28813&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;AC&#039;&#039;&#039; : Total Non-reference Allele Count&lt;br /&gt;
* &#039;&#039;&#039;CALLRATE&#039;&#039;&#039; : Fraction of non-missing genotypes.&lt;br /&gt;
* &#039;&#039;&#039;MAF&#039;&#039;&#039; : Minor allele frequencies&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of single variant test&lt;br /&gt;
* &#039;&#039;&#039;AF.CASE&#039;&#039;&#039; : Non-reference allele frequencies for cases&lt;br /&gt;
* &#039;&#039;&#039;AF.CTRL&#039;&#039;&#039; : Non-reference allele frequencies for controls&lt;br /&gt;
&lt;br /&gt;
==== Q-Q plot of test statistics (stratified by MAF) ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.qq.pdf will be generated as shown below&lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_qq.png]]&lt;br /&gt;
&lt;br /&gt;
==== Manhattan Plot of Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.mh.pdf will be generated for chr20 only. &lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_mh.png]]&lt;br /&gt;
&lt;br /&gt;
An example Genome-wide manhattan plot (from a genome-wide run) will look like below&lt;br /&gt;
&lt;br /&gt;
[[File:tes_b_score_epacts_mh_gw.png]]&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise burden test ===&lt;br /&gt;
&lt;br /&gt;
Gene-wise or group-wise burden test requires two steps. First, &#039;group&#039; file containing the list of &lt;br /&gt;
markers per group needs to be generated. Second, group-wise burden test needs to be run&lt;br /&gt;
&lt;br /&gt;
==== Creating marker group file ====&lt;br /&gt;
&lt;br /&gt;
The marker group file has the following format&lt;br /&gt;
&lt;br /&gt;
 [GROUP_ID]  [MARKER_ID_1]   [MARKER_ID_2]  .... [MARKER_ID_N]&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
* [GROUP_ID] is a string representing the group (e.g. gene name)&lt;br /&gt;
* [MARKER_ID_K] is a marker key as a format of [CHROM]:[POS]_[REF]/[ALT] (NOTE THAT THIS IS DIFFERENT FROM TYPICAL VCF MARKER ID field)&lt;br /&gt;
&lt;br /&gt;
Note that [MARKER_ID_K] has to be sorted by increasing order of genomic coordinate&lt;br /&gt;
&lt;br /&gt;
In order to create gene-level group file from typically formatted VCF file, one may use the following utility &lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --nonsyn&lt;br /&gt;
&lt;br /&gt;
The above command create a file [output-group-file] containing a list of missense and nonsense variants per each gene. To incorporate different types of functional annotations, use --type option as follows&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --type [function_type_1] --type [function_type_2] ...&lt;br /&gt;
&lt;br /&gt;
Type &#039;epacts makegroup -man&#039; for the detailed documentation&lt;br /&gt;
&lt;br /&gt;
==== Annotating VCF file using EPACTS ====&lt;br /&gt;
&lt;br /&gt;
If the VCF is not annotated, &#039;epacts makegroup&#039; cannot be used. In order to annotate VCF, one can use the example VCF using ANNOVAR as follows:&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts anno \&lt;br /&gt;
    --in ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
    --out ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
The epacts anno script will add &amp;quot;ANNO=[function]:[genename]&amp;quot; entry into the INFO field based on gencodeV7 (default) or refGene database.&lt;br /&gt;
&lt;br /&gt;
It is important to check whether the VCF file is already annotated or not in order to avoid no or redundant annotation.&lt;br /&gt;
&lt;br /&gt;
==== Running Groupwise Test ====&lt;br /&gt;
&lt;br /&gt;
To perform a groupwise burden test on the example VCF (annotated as above), run the following command&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --vcf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz \&lt;br /&gt;
   --groupf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.grp --out out/test.gene.skat \&lt;br /&gt;
   --ped ${EPACTS_DIR}/data/1000G_dummy_pheno.ped --maxAF 0.05 \&lt;br /&gt;
   --chr 20 --pheno QT --cov AGE --cov SEX --test skat --skat-o --run 2&lt;br /&gt;
&lt;br /&gt;
==== Example Output ====&lt;br /&gt;
 $ head out/test.gene.skat.epacts.top5000&lt;br /&gt;
 #CHROM BEGIN   END     MARKER_ID       NS      FRAC_WITH_RARE     NUM_ALL_VARS    NUM_PASS_VARS   NUM_SING_VARS   PVALUE  STATRHO&lt;br /&gt;
 20     62607037        62608720        20:62607037-62608720_SAMD10     266     0.14662 9       5       1       0.0020064       1&lt;br /&gt;
 20     2816211 2820493 20:2816211-2820493_FAM113A      266     0.011278        12      2       1       0.0032542       0&lt;br /&gt;
 20     47245987        47361692        20:47245987-47361692_PREX1      266     0.1391  54      9       6       0.0054849       1&lt;br /&gt;
 20     34761734        34810279        20:34761734-34810279_EPB41L1    266     0.071429        14      7       5       0.0068492       0.2&lt;br /&gt;
 20     61340671        61391602        20:61340671-61391602_NTSR1      266     0.11278 24      9       3       0.011063        1&lt;br /&gt;
 20     48561952        48568644        20:48561952-48568644_RNF114     266     0.011278        4       2       1       0.015175        0.2&lt;br /&gt;
 20     60962895        60963559        20:60962895-60963559_RPS21      266     0.06015 6       3       2       0.016409        0&lt;br /&gt;
 20     55904961        55917801        20:55904961-55917801_SPO11      266     0.011278        11      3       3       0.018031        0&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;FRAC_WITH_RARE&#039;&#039;&#039; : Fraction of individual carrying rare variants below --max-maf (default : 0.05) threshold.&lt;br /&gt;
* &#039;&#039;&#039;NUM_ALL_VARS&#039;&#039;&#039; : Number of all variants defining the group.&lt;br /&gt;
* &#039;&#039;&#039;NUM_PASS_VARS&#039;&#039;&#039; : Number of variants passing the --min-maf, --min-mac, --max-maf, --min-callrate thresholds&lt;br /&gt;
* &#039;&#039;&#039;NUM_SING_VARS&#039;&#039;&#039; : Number of singletons among variants in NUM_PASS_VARS&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of burden tests&lt;br /&gt;
* Other columns are test specific auxiliary columns. For example, in the VT test, the optimal MAF threshold is recorded as an auxiliary output column.&lt;br /&gt;
&lt;br /&gt;
=== Specialized Instruction for EMMAX tests ===&lt;br /&gt;
&lt;br /&gt;
EMMAX (Efficient Mixed Model Association eXpedited - Kang et al (2010) Nat Genet 42:348-54) is an efficient implementation of mixed model association accounting for sample structure including population structure and hidden relatedness. Currently EPACTS supports EMMAX association mapping in single variant test and CMC-like burden tests. &lt;br /&gt;
&lt;br /&gt;
Because EMMAX is based on linear model, the method fits better to quantiative traits than binary traits. However, p-values for binary traits are expected to be valid in the spirit of Armitage trend test, although the estimated effect size may not be precise.&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
==== Single Variant EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : From VCF, we recommend to set a MAF (e.g. 0.01) and call rate (e.g. 0.95) threshold to select high-quality markers to generate kinship matrix as follows.&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-kin \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped (Optional)] --min-maf 0.01 --minCallRate 0.95 \&lt;br /&gt;
  --sepchr (if VCF is separated by chromosome) --out [outprefix.kinf] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
If you provide [input.ped] file, then it will calculate the subset the individuals contained in the PED file. &lt;br /&gt;
&lt;br /&gt;
The procedure above will create a file [outprefix.kinf] after splitting and merging the genomes into multiple pieces. If only a certain subset of SNPs needs to be considered due to target regions, LD-pruning, or any other reasons, a VCF containing the subset of markers must be created beforehand and should be used as input VCF file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Perform Single Variant Association&#039;&#039;&#039; : From VCF and PED, we recommend to use less stringent MAF threshold (e.g. 0.001) and call rate (e.g. 0.50) to perform single variant association&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --min-maf 0.001 --kin [outputprefix.kinf] \&lt;br /&gt;
  --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] --test q.emmax \&lt;br /&gt;
  --out [outprefix] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
The procedure above will perform single variant association analysis compatible to other types of single variant association analyses implemented in EPACTS&lt;br /&gt;
&lt;br /&gt;
==== Burden-style EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : See &#039;Creating Kinship Matrix&#039; section in [[#Single Variant EMMAX Association Analysis]]&lt;br /&gt;
* &#039;&#039;&#039;Create Marker Group&#039;&#039;&#039;&lt;br /&gt;
** By annotating the VCF and extracting missense and nonsense variants&lt;br /&gt;
*** [[#Annotating VCF file using ANNOVAR]] - This step will be required to create marker group file&lt;br /&gt;
*** [[#Creating marker group file]] - Assume that [group.grp] file is produced&lt;br /&gt;
** Or, by creating your own marker group information&lt;br /&gt;
*** See [[#Creating marker group file]] for details&lt;br /&gt;
* Run CMC-style burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxCMC --out [outprefix] &lt;br /&gt;
* Run Variable Threshold burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxVT --out [outprefix]&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Own Input Data ==&lt;br /&gt;
&lt;br /&gt;
=== VCF file for Genotypes ===&lt;br /&gt;
&lt;br /&gt;
EPACTS support VCF files as input for association with the following requirement&lt;br /&gt;
* Input VCF file must be bgzipped and tabixed before running association to allow efficient random access of the file. Below is an example command to conver plain VCF into bgzipped and tabixed VCF&lt;br /&gt;
  bgzip input.vcf     ## this command will produce input.vcf.gz&lt;br /&gt;
  tabix -pvcf -f input.vcf.gz  ## this command will produce input.vcf.gz.tbi&lt;br /&gt;
* If the VCF file is separated by chromosome, the VCF file specified in the input argument must contain the string &amp;quot;chr1&amp;quot; in the chromosome 1 file, and corresponding chromosome name for other chromosomes. Thus, the files names should be like &amp;lt;code&amp;gt;[prefix]chr1[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chr2[suffix].vcf.gz&amp;lt;/code&amp;gt;, ..., &amp;lt;code&amp;gt;[prefix]chr22[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chrX[suffix].vcf.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Sample IDs in the VCF file must be consistent to those from PED file&lt;br /&gt;
* Currently EPACTS only support bi-allelic variants, but it handles SNPs, INDELs, snd SVs.&lt;br /&gt;
* Currently, EPACTS only support VCF aligned with NCBI build 37 coordinates&lt;br /&gt;
* An example VCF file from 1000 genome project is below. &lt;br /&gt;
 $ zcat example/1000G_integrated_phase1_chr20.vcf.gz | cut -f 1-10 | head -50 &lt;br /&gt;
 ##fileformat=VCFv4.1&lt;br /&gt;
 ##INFO=&amp;lt;ID=LCSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Low coverage VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=EXSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Exome VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=INDEL,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in INDEL VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SV,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in SV VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BAVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BRSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality estimate from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=LDAF,Number=1,Type=Float,Description=&amp;quot;MLE Allele Frequency Accounting for LD&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=RSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=ERATE,Number=1,Type=Float,Description=&amp;quot;Per-marker Mutation rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=THETA,Number=1,Type=Float,Description=&amp;quot;Per-marker Transition rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIEND,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around END for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIPOS,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around POS for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=END,Number=1,Type=Integer,Description=&amp;quot;End position of the variant described in this record&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMLEN,Number=.,Type=Integer,Description=&amp;quot;Length of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMSEQ,Number=.,Type=String,Description=&amp;quot;Sequence of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SOURCE,Number=.,Type=String,Description=&amp;quot;Source of deletion call&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVLEN,Number=1,Type=Integer,Description=&amp;quot;Difference in length between REF and ALT alleles&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVTYPE,Number=1,Type=String,Description=&amp;quot;Type of structural variant&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AC,Number=.,Type=Integer,Description=&amp;quot;Alternate Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AN,Number=1,Type=Integer,Description=&amp;quot;Total Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##ALT=&amp;lt;ID=DEL,Description=&amp;quot;Deletion&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GT,Number=1,Type=String,Description=&amp;quot;Genotype&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=DS,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GL,Number=.,Type=Float,Description=&amp;quot;Genotype Likelihoods&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=BD,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 #CHROM POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  HG00096&lt;br /&gt;
 20 60479   .   C   T   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.894;LDAF=0.0020;AVGPOST=0.9995;RSQ=0.8779;ERATE=0.0005;THETA=0.0008;AC=4;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.19,-0.46,-2.68:0.0022&lt;br /&gt;
 20 60522   .   T   TC  1588    PASS    INDEL;BAVGPOST=1.000;BRSQ=0.994;LDAF=0.0116;AVGPOST=0.9980;RSQ=0.9327;ERATE=0.0004;THETA=0.0167;AC=24;AN=2184   GT:DS:GL:BD 0|0:0.000:0.00,-0.90,-9.20:0&lt;br /&gt;
 20 60571   .   C   A   100 PASS    LCSNP;EXSNP;BAVGPOST=0.999;BRSQ=0.813;LDAF=0.0029;AVGPOST=0.9986;RSQ=0.8085;ERATE=0.0014;THETA=0.0014;AC=5;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.05,-0.96,-5.00:0.0008&lt;br /&gt;
 20 60795   .   G   C   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.930;LDAF=0.0006;AVGPOST=0.9996;RSQ=0.7205;ERATE=0.0003;THETA=0.0041;AC=1;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.03,-1.21,-5.00:0.0001&lt;br /&gt;
 20 60810   .   G   GA  127 PASS    INDEL;BAVGPOST=1.000;BRSQ=0.862;LDAF=0.0013;AVGPOST=0.9987;RSQ=0.5684;ERATE=0.0004;THETA=0.0061;AC=2;AN=2184    GT:DS:GL:BD 0|0:0.000:0.00,-1.80,-18.80:0&lt;br /&gt;
&lt;br /&gt;
=== PED file for Phenotypes and Covariates ===&lt;br /&gt;
&lt;br /&gt;
EPACTS accepts a PED format supported by MERLIN or PLINK software to represent phenotypes. For example, the example.ped file and example.dat file can represent the phenotypes and corresponding column name (from 6th column and after). &lt;br /&gt;
&lt;br /&gt;
 $ head example.ped&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
 $ cat example.dat&lt;br /&gt;
 A DISEASE&lt;br /&gt;
 T QT&lt;br /&gt;
 T AGE&lt;br /&gt;
&lt;br /&gt;
EPACTS also accept a PED format with header information. The above file can be combined into one file as follows&lt;br /&gt;
&lt;br /&gt;
 $ head data/1000G_dummy_pheno.ped&lt;br /&gt;
 #FAM_ID    IND_ID  FAT_ID  MOT_ID  SEX DISEASE QT  AGE&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
The column names can be used to identify the names of phenotypes and covariates in the analysis.&lt;br /&gt;
&lt;br /&gt;
== Frequently Asked Questions ==&lt;br /&gt;
=== Installation ===&lt;br /&gt;
# How should I install EPACTS? &lt;br /&gt;
#* See [[EPACTS#Installation_Details | Installation Details]]&lt;br /&gt;
# I am having the following error message &#039;&#039;&#039;configure: error: libR.{so,a} was not found. Please install it at http://www.r-project.org/ first&#039;&#039;&#039;. What do I have to do?&lt;br /&gt;
#* First, you need to find out where R was installed. Try to type &amp;quot;locate libR.so&amp;quot; and see if it returns anything&lt;br /&gt;
#* If &amp;quot;locate libR.so&amp;quot; returns you something, as explained [[EPACTS#Installation_Details | Installation Details]], try to add &amp;quot;LDFLAGS=-L/path/to/R/library&amp;quot; and rerun &#039;&#039;&#039;configure&#039;&#039;&#039; and &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
#* If you cannot find libR.so, you make have to recompile R with --enable-R-shlib option as described in http://cran.r-project.org/doc/manuals/R-admin.html#Installation&lt;br /&gt;
&lt;br /&gt;
=== Input Files ===&lt;br /&gt;
# What is VCF?&lt;br /&gt;
#* VCF refers to Variant Call Format&lt;br /&gt;
#* See [[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 1000 Genomes wiki page]] for the detailed description of VCF format&lt;br /&gt;
# Should input VCF be compressed into certain format?&lt;br /&gt;
#* Correct. EPACTS assumes that VCF file is bgzipped and tabixed already.&lt;br /&gt;
#* See [[#VCF file for Genotypes]] for details.&lt;br /&gt;
# What are the additional requirements for input VCF file?&lt;br /&gt;
#* Input VCF file used for association mapping must contain individual genotype information at 10-th or higher order columns.&lt;br /&gt;
#* GT field must be encoded as haploid or diploid&lt;br /&gt;
#* Bi-allelic SNPs only : Currently EPACTS may not handle multi-allelic SNPs correctly.&lt;br /&gt;
#* If non-GT field is used, the field is considered as dosage and should be a single numeric value.&lt;br /&gt;
# What are the acceptable input format to encode phenotypes and covariates?&lt;br /&gt;
#* See [[#PED file for Phenotypes and Covariates]] for the detailed information&lt;br /&gt;
# How should I encode binary phenotypes?&lt;br /&gt;
#* If you encode your phenotypes into two different numeric values (e.g. 0/1 or 1/2), EPACTS will automatically recognize them as binary phenotypes and encode them into 1/2 values. Higher value will be considered as cases for case-control association&lt;br /&gt;
# How should I encode missing genotypes?&lt;br /&gt;
#* The default code missing phenotypes in EPACTS are &#039;NA&#039;&lt;br /&gt;
#* One may use --missing option to specify different types of missing values&lt;br /&gt;
#* The encoding of missing genotypes follows the VCF specificiation&lt;br /&gt;
# How do I match the relationship between VCF and PED input files?&lt;br /&gt;
#* EPACTS will assume that the individual IDs in each VCF and PED file are unique, and they follow the saming convention. Thus, the individual IDs overlapping between VCF and PED files will be considered in the associations&lt;br /&gt;
# How the individuals with missing phenotypes are handled?&lt;br /&gt;
#* Currently, EPACTS will automatically remove the individuals without phenotypes or covariates. If one wants to use imputed covariates to increase sample size, the PED file must contain the imputed covariate values.&lt;br /&gt;
#* Markers with missing genotypes won&#039;t be discarded automatically. It can be explicitly discarded by --minCallRate option when performing association&lt;br /&gt;
&lt;br /&gt;
=== Output Files ===&lt;br /&gt;
# Which output files should I be looking at?&lt;br /&gt;
#* [[#Output Text of Top Associations]] is the key file to look at the individual top associations&lt;br /&gt;
#* [[#Q-Q plot of test statistics (stratified by MAF)]] will be important to see the global distribution of test statistics and examine if there are apparent inflation of test statistics&lt;br /&gt;
#* [[#Manhattan Plot of Test Statistics]] will inform us the genome-wide distribution of association signals&lt;br /&gt;
#* [[#Output Text of All Test Statistics]] will contain the full information of test results across all units tested&lt;br /&gt;
# The Q-Q and Manhattan plots cannot be found. Why?&lt;br /&gt;
#* It is probably because gnuplot 4.2 or higher is not installed in your system, or they are included but cannot be found in your ${PATH}. Please visit [[http://gnuplot.info/ GNUPLOT web page]] for installation.&lt;br /&gt;
# How can I read the EMMAX kinship file from produced from EPACTS?&lt;br /&gt;
# * You can run the following command to dump your kinship matrix into a human-readable text format.&lt;br /&gt;
 $(EPACTS_DIR)/bin/epacts/bin/pEmmax kin-util --kinf [input.kinf] --outf [output.prefix] --dump&lt;br /&gt;
&lt;br /&gt;
=== More questions ===&lt;br /&gt;
# If you have more questions, please contact [[mailto:hmkang@umich.edu Hyun Min Kang]].&lt;br /&gt;
&lt;br /&gt;
== Detailed Options ==&lt;br /&gt;
&lt;br /&gt;
The detailed options can viewed by running the following commands&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts -man           (for overall structure) &lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts single -man    (for single variant test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts group -man     (for groupwise test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts anno -man      (for annotation)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts plot -man      (for QQ and Manhattan plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts zoom -man      (for zoom plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts meta -man      (for meta-analysis)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts make-group -man (for creating gene group)&lt;br /&gt;
&lt;br /&gt;
== Implementing Additional Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
In order to add additional statistical test to EPACTS, the following procedure are recommended&lt;br /&gt;
&lt;br /&gt;
# Create a file named &#039;single.[testname].R&#039; for single variant test or &#039;gene.[testname].R&#039; for gene-level test under ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
# Test your implementation using --test [testname] option to perform sanity check and debugging&lt;br /&gt;
# If you want to add your test in the official in-house version, please send your code to Hyun&lt;br /&gt;
&lt;br /&gt;
Below is an example of a single variant test implementation ( single.q.lm.R )&lt;br /&gt;
 ## Core functions of EPACTS to perform association&lt;br /&gt;
 &lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## SINGLE VARIANT TEST&lt;br /&gt;
 ## INPUT VARIABLES:&lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   NS       : number of called samples&lt;br /&gt;
 ##   AC       : allele count&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:nrow(NS) after AF/AC threshold&lt;br /&gt;
 ##   genos    : genotype matrix (after AF/AC threshold)&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional columns to add&lt;br /&gt;
 ##   cname    : column names for additional columns&lt;br /&gt;
 ##################################################################  &lt;br /&gt;
 &lt;br /&gt;
 ## single.lm() : Use built-in lm() function to perform association&lt;br /&gt;
 ## KEY FEATURES : SIMPLE, BUT MAY BE SLOW&lt;br /&gt;
 ##                GOOD SNIPPLET TO START A NEW FUNCTION&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, TSTAT&lt;br /&gt;
 ## MISSING VALUES : IGNORED&lt;br /&gt;
 single.q.lm &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;TSTAT&amp;quot;) # column names for additional variables in the EPACTS output&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   p &amp;lt;- rep(NA,m)&lt;br /&gt;
   add &amp;lt;- matrix(NA,m,3) ## BETA, SEBETA, TSTAT&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
    for(i in 1:m) {&lt;br /&gt;
      r &amp;lt;- summary(lm(pheno~genos[i,]+cov-1))$coefficients[1,]  # run simple linear regression&lt;br /&gt;
      p[i] &amp;lt;- r[4]   # store p-value to p[i]&lt;br /&gt;
      add[i,] &amp;lt;- r[1:3] # store additional variables to add[i,]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  return(list(p=p,add=add,cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
As described in the comment, you may assume that the following variables are available for use for testing association across m markers&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker&lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (m * 1 vector) : p-value matrix as output&lt;br /&gt;
* add (m * c matrix) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# AC : Non-ref allele count&lt;br /&gt;
# CALLRATE : Call rate = NS/n&lt;br /&gt;
# MAF : Minor allele frequency&lt;br /&gt;
# PVALUE : P-values&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
Below is an example of a gene-lvel variant test implementation ( single.q.lm.R )&lt;br /&gt;
&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## GENE-LEVEL BURDEN TEST&lt;br /&gt;
 ## INPUT VARIABLES: &lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   genos    : genotype matrix for each gene&lt;br /&gt;
 ##   NS       : number of called samples for each marker&lt;br /&gt;
 ##   AC       : allele count for each marker&lt;br /&gt;
 ##   MAC      : minor allele count for each marker&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:n after AF/AC threshold&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional column values&lt;br /&gt;
 ##   cname    : additional column names&lt;br /&gt;
 ##################################################################      &lt;br /&gt;
 &lt;br /&gt;
 ## gene.q.reverse() : Reverse logistic regression&lt;br /&gt;
 ## KEY FEATURES : 0/1 collapsing variable ~ rare variants&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE (GAUSSIAN)&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, ZSTAT&lt;br /&gt;
 ## MISSING VALUE : IMPUTED AS MAJOR ALLELES&lt;br /&gt;
 gene.q.reverse &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;ZSTAT&amp;quot;)&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
     g &amp;lt;- as.double(colSums(genos,na.rm=T) &amp;gt; 0)&lt;br /&gt;
     sg &amp;lt;- sum(g)&lt;br /&gt;
     if ( ( sg &amp;gt; 0 ) &amp;amp;&amp;amp; ( sg &amp;lt; n ) ) {&lt;br /&gt;
       r &amp;lt;- glm(g~pheno+cov-1,family=binomial)&lt;br /&gt;
        if ( ( r$converged ) &amp;amp;&amp;amp; ( ! r$boundary ) ) {&lt;br /&gt;
         return(list(p=summary(r)$coefficients[1,4],&lt;br /&gt;
                     add=summary(r)$coefficients[1,1:3],&lt;br /&gt;
                     cname=cname))&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   return(list(p=NA,add=rep(NA,3),cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Similar to gene-level test, you may assume the following variables exist for testing A SINGLE GENE. Note that M is the number of markers spanning the gene region&lt;br /&gt;
&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker &lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAC (M * 1 vector) : Minor allele count&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (scalar) : p-value matrix as output&lt;br /&gt;
* add (c * 1 vector) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# MAF_BURDEN : MAF of 0/1 collapsing variables (existence of rare variants)&lt;br /&gt;
# NUM_ALL_VARS : Number of all variants within the gene&lt;br /&gt;
# NUM_RARE_VARS : Number of rare variants below the max-MAF threshold&lt;br /&gt;
# NUM_SING_VARS : Number of singleton variants&lt;br /&gt;
# PVALUE : P-value from the test&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
== Full ChangeLog ==&lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs&lt;br /&gt;
** Some known bugs still exist &lt;br /&gt;
*** SKAT-O Lambda eigenvalue error. This happenes in a particular context but haven&#039;t nailed down a way to prevent it yet.&lt;br /&gt;
*** EMMAX has case and control frequency flipped.&lt;br /&gt;
* EMMAX test has a silly known bug with case / ctrl frequency is flipped&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
* February 28th, 2013 : EPACTS v3.2.0 release&lt;br /&gt;
** R package installation bug (for some users) was fixed&lt;br /&gt;
** A bug in the MAF error for high frequency variants (AF&amp;gt;0.25) was now fixed&lt;br /&gt;
** SKAT version is updated to 0.81&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
* December 4th, 2012 : EPACTS v3.1.0 release&lt;br /&gt;
** Removed dependency on libR.so&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** November 25th, 2012 : EPACTS v3.0.0 release&lt;br /&gt;
** Restructured with source code release (with autoconf / automake / libtools)&lt;br /&gt;
** Added zoom plot feature&lt;br /&gt;
** FRAC_BURDEN keyword was replace to FRAC_WITH_RARE for groupwise testing&lt;br /&gt;
* October 26th, 2012 : EPACTS v2.2.0-beta is released with the following updates&lt;br /&gt;
** Added --max-mac option&lt;br /&gt;
** Fixed Firth&#039;s bias-corrected test (by Clement Ma)&lt;br /&gt;
** Added more informative warning messages when index files do not exist&lt;br /&gt;
** Fixed the bug in the epacts-plot in plotting ties&lt;br /&gt;
** Fixed errors in the MAF estimates per case and control&lt;br /&gt;
** Fixed bug in --minRSQ option&lt;br /&gt;
* September 28, 2012 : EPACTS v2.11-beta is released with the following updates&lt;br /&gt;
** Counts and allele frequencies for case/control added for binary tests&lt;br /&gt;
** --max-maf parameter is added&lt;br /&gt;
** Fixed EMMAX error in MAF in the output&lt;br /&gt;
** More informative error messages &lt;br /&gt;
* September 27, 2012 : EPACTS v2.1-beta is released with the following updates&lt;br /&gt;
** EMMAX interface is changed. --kinOnly option is related with a new command &#039;&#039;&#039;make-kin&#039;&#039;&#039; &lt;br /&gt;
** SKAT-O is upgraded to version 0.77 with additional configurable parameter settings&lt;br /&gt;
** Some parameter names are renamed (e.g. --min-maf, --min-mac)&lt;br /&gt;
** Many minor bugs are fixed&lt;br /&gt;
* Jul 6, 2012 : EPACTS v2.01-beta is released with the following updates&lt;br /&gt;
** SKAT-O is upgraded to version 0.76&lt;br /&gt;
** Fixed minor bugs in option names (Thanks to Xueling Sim)&lt;br /&gt;
* Jul 3, 2012 : EPACTS v2.0-beta is released with the following updates&lt;br /&gt;
** Major restructuring of the software&lt;br /&gt;
** Annotation software is switched with built-in application&lt;br /&gt;
** Addition of SKAT-O and EMMAX burden test&lt;br /&gt;
** Minor bug fixes&lt;br /&gt;
* Apr 8, 2012 : EPACTS v1.2-alpha is released with the following updates, in addition to the following updates&lt;br /&gt;
** EMMAX bug in handling covariates was fixed&lt;br /&gt;
** Variable Threshold Test is added&lt;br /&gt;
** Variable Threshold Test with genomic score (e.g. GERP or PhyloP) is added.&lt;br /&gt;
* Apr 4, 2012 : EPACTS v1.1-alpha is released with the following updates, in addition to minor updates&lt;br /&gt;
** EMMAX burden test (Hyun Min Kang)&lt;br /&gt;
** Likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of Firth bias-corrected likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of EMMAX single variant test (Hyun Min Kang) &lt;br /&gt;
* Mar 29, 2012 : EPACTS v1.0-alpha is released&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14511</id>
		<title>EPACTS</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14511"/>
		<updated>2016-12-15T22:44:26Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Lastest ChangeLog */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;EPACTS&#039;&#039;&#039; (Efficient and Parallelizable Association Container Toolbox) is a versatile software pipeline to perform various statistical tests for identifying genome-wide association from sequence data through a user-friendly interface, both to scientific analysts and to method developers.&lt;br /&gt;
&lt;br /&gt;
== Join in EPACTS mailing list ==&lt;br /&gt;
&lt;br /&gt;
Please join in the [http://groups.google.com/group/epacts EPACTS Google Group] to ask / discuss / comment about EPACTS.&lt;br /&gt;
&lt;br /&gt;
== Lastest ChangeLog ==&lt;br /&gt;
* Dec 15th, 2016 : EPACTS v3.3.0 release (github)&lt;br /&gt;
** Moved the repository into github&lt;br /&gt;
** Some major fixes in handling large sample size (&amp;gt;18,000)&lt;br /&gt;
** Other minor bug fixes &lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs (more comprehensive fix is still pending)&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
See [[#Full ChangeLog]] for full details&lt;br /&gt;
&lt;br /&gt;
== Key Features ==&lt;br /&gt;
&lt;br /&gt;
EPACTS currently provides the following set of key features&lt;br /&gt;
* Robust support for widely used format of sequence-based genotypes (VCF) and phenotypes with pedigree (PED)&lt;br /&gt;
** Efficient library for accessing VCF file to reduce computational burden to analyze large-scale sequencing data&lt;br /&gt;
** Support selecting markers by arbitrary combination of substring matching. &lt;br /&gt;
** Support for using genotype dosages instead of hard genotype calls&lt;br /&gt;
** Utilize PED format to perform test across multiple traits.&lt;br /&gt;
* Supports a large number of widely used statistical tests for single variant association and burden tests.&lt;br /&gt;
** See the &amp;quot;Currently Supported Statistical Tests&amp;quot; section below for more information&lt;br /&gt;
* Easy to Highly Parallelize Jobs&lt;br /&gt;
** Makefile-based partition into and ligation of multiple subtasks&lt;br /&gt;
** Parallel run of job is simply adding one parameter when running EPACTS &lt;br /&gt;
* Integrative and versatile framework that allows easy addition of additional statistical test&lt;br /&gt;
** Core input/output routines are implemented in C++&lt;br /&gt;
** Most statistical tests (except for EMMAX) are implemented in R&lt;br /&gt;
** Adding a simple R function to implement additional statistical test (See [[#Implementing Additional Statistical Tests]] for details)&lt;br /&gt;
* Useful utilities for post-association-analysis tasks&lt;br /&gt;
** Automatic functional annotation of associated variants&lt;br /&gt;
** Automatic generation of QQ and Manhattan Plot&lt;br /&gt;
** (TBA) Zoom plot for the significant associations&lt;br /&gt;
&lt;br /&gt;
== Obtaining EPACTS ==&lt;br /&gt;
&lt;br /&gt;
* The official release of EPACTS software is available at http://csg-old.sph.umich.edu/kang/epacts/download/index.html&lt;br /&gt;
** From the CSG cluster, it is available at /net/fantasia/home/bin/epacts/&lt;br /&gt;
* Note that R (version 2.10 or higher) and gnuplot (version 4.2 or higher) must be installed in order to run EPACTS correctly.&lt;br /&gt;
&lt;br /&gt;
== Currently Supported Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
EPACTS supports the following sets of widely used statistical tests for single variant tests and burden tests&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.wald &lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logisitic Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (simply used glm in R)&lt;br /&gt;
|-&lt;br /&gt;
| b.score&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Logistic Score Test &amp;lt;br&amp;gt; (from Lin DY and Tang ZZ, AJHG 2011 89:354-67)&lt;br /&gt;
| Clement Ma &amp;amp; Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.firth&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Firth Bias-Corrected Logistic Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.lrt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.glrt&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Fast&lt;br /&gt;
| Genotype Likelihood Ratio Test &amp;lt;br&amp;gt; (use GL or PL field in VCF to perform case-control test)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.lm&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Linear Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (as implemented in lm in R)&lt;br /&gt;
|-&lt;br /&gt;
| q.score&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Quantitative Score Test &amp;lt;br&amp;gt; (from Lin DY and Tang ZZ, AJHG 2011 89:354-67)&lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| q.linear&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Linear Wald Test&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.emmax&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| EMMAX &amp;lt;br&amp;gt; ( Kang et al (2010) Nat Genet 42:348-54 )&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.collapse&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and 0/1 collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.madsen&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Slow&lt;br /&gt;
| Wilcoxon Rank Sum Test between binary phenotypes and weighted rare variant scores (slightly different version from the published method - it uses pooled allele frequency across cases and controls for weighting each variant)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.wcnt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and weighted rare variant scores&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression of phenotypes on binary collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression of phenotypes on collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| skat&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT-O Test by Lee et al, Biostatistics (2012)&lt;br /&gt;
| Seunggeun Lee &amp;lt;br&amp;gt; (adaptive by Xueling Sim and Hyun Min Kang)&lt;br /&gt;
|-&lt;br /&gt;
| VT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed out first)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable Threshold Test &amp;lt;br&amp;gt; with adaptive permutation &amp;lt;br&amp;gt; Price et al, AJHG (2010) 86:832-8&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxCMC&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Collapsing burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxVT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable-threshold burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| mmskat&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT test using EMMAX&lt;br /&gt;
| Seunggeun Lee &amp;amp; Hyun Min Kang&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Installation Details  ==&lt;br /&gt;
&lt;br /&gt;
If you want to use EPACTS in an Ubuntu platform, following the step below &lt;br /&gt;
&lt;br /&gt;
*Download EPACTS source distribution at http://csg-old.sph.umich.edu/kang/epacts/download/EPACTS-3.2.6.tar.gz (165MB)&lt;br /&gt;
*Uncompress EPACTS package, and install the package using the following set of commands&lt;br /&gt;
* Visit http://csg-old.sph.umich.edu/kang/epacts/download for checking previous versions&lt;br /&gt;
&lt;br /&gt;
  tar xzvf EPACTS-3.2.6.tar.gz&lt;br /&gt;
  cd EPACTS-3.2.6&lt;br /&gt;
  ./configure --prefix=/path/to/install&lt;br /&gt;
  make&lt;br /&gt;
  make install&lt;br /&gt;
&lt;br /&gt;
(Important Note: &#039;&#039;&#039;make sure to specify --prefix=/path/to/install&#039;&#039;&#039; to avoid installing to the default path /usr/local/, which you may not have the permission. /home/your_userid/epacts might be a good one, if you are not sure where to install)&lt;br /&gt;
  &lt;br /&gt;
* Now ${EPACTS_DIR} represents the &#039;/path/to/install&#039; directory&lt;br /&gt;
&lt;br /&gt;
* Download the reference FASTA files from 1000 Genomes FTP automatically by running the following commands&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/epacts download&lt;br /&gt;
&lt;br /&gt;
 (For advanced users, to save time for downloading the FASTA files (~900MB), you may copy a local copy of GRCh37 FASTA file and the index file to ${EPACTS_DIR}/share/EPACTS/)&lt;br /&gt;
&lt;br /&gt;
*Perform a test run by running the following command&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
&lt;br /&gt;
In order to use EPACTS in the CSG cluster, you do not need to install them. You can directly use or make a copy of the in-house release version at &lt;br /&gt;
&lt;br /&gt;
 /net/fantasia/home/hmkang/bin/epacts/&lt;br /&gt;
&lt;br /&gt;
== Getting Started With Examples ==&lt;br /&gt;
If you are using EPACTS from the CSG cluster, please set the following environment variable&lt;br /&gt;
 EPACTS_DIR=/net/fantasia/home/hmkang/bin/epacts (in bash)&lt;br /&gt;
 setenv EPACTS_DIR /net/fantasia/home/hmkang/bin/epacts (in csh)&lt;br /&gt;
&lt;br /&gt;
If you downloaded EPACTS binary and please set EPACTS_DIR to the full path of the downloaded and uncompressed directory.&lt;br /&gt;
&lt;br /&gt;
=== All-in-one example ===&lt;br /&gt;
&lt;br /&gt;
To get started with EPACTS, run the following command will perform an example run&lt;br /&gt;
 ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
 &lt;br /&gt;
You will find a series of lines in test_run_epacts.sh script commented out for each possible test. &lt;br /&gt;
&lt;br /&gt;
The example phenotype (PED format) and genotype (VCF format) can be found at&lt;br /&gt;
 ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Test ===&lt;br /&gt;
&lt;br /&gt;
Or You can run EPACTS command yourself by running&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
   --vcf  ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
   --ped  ${EPACTS_DIR}/data/1000G_dummy_pheno.ped  \&lt;br /&gt;
   --min-maf 0.001 --chr 20 --pheno DISEASE --cov AGE --cov SEX --test b.score --anno \ &lt;br /&gt;
   --out out/test --run 2&lt;br /&gt;
&lt;br /&gt;
The command above will perform single variant association test using a dummy case-control phenotype file and a subset of 1000 genomes exome VCF file (chr20) using score test statistic for all variants over 1% of higher MAF using 2 parallel runs.&lt;br /&gt;
&lt;br /&gt;
You will see the 4 output files as the main outcome of the analysis&lt;br /&gt;
&lt;br /&gt;
==== Output Text of All Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The filename is out/test.single.b.score.epacts.gz and the contents will look like&lt;br /&gt;
 $ zcat out/test.single.b.score.epacts.gz | head&lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	68303	68303	20:68303_A/G_Upstream:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68319	68319	20:68319_C/A_Upstream:DEFB125	266	1.4467e-36	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68396	68396	20:68396_C/T_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76635	76635	20:76635_A/T_Intron:DEFB125	266	1.534e-37	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76689	76689	20:76689_T/C_Synonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76690	76690	20:76690_T/C_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76700	76700	20:76700_G/A_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76726	76726	20:76726_C/G_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76771	76771	20:76771_C/T_Nonsynonymous:DEFB125	266	3	1	0.0056391	0.68484	0.40587	145	121	0.013793	0.0082645&lt;br /&gt;
&lt;br /&gt;
==== Output Text of Top Associations ====&lt;br /&gt;
&lt;br /&gt;
Same type of file but containing top 5,000 association will be stored at out/test.epacts.top5000&lt;br /&gt;
&lt;br /&gt;
 $ head out/test.single.b.score.epacts.top5000 &lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	1610894	1610894	20:1610894_G/A_Synonymous:SIRPG	266	138.64	1	0.26061	6.9939e-05	3.9765	145	121	0.65177	0.36476&lt;br /&gt;
 20	4162411	4162411	20:4162411_T/C_Intron:SMOX	266	204	1	0.38346	0.00055583	-3.4523	145	121	0.62759	0.93388&lt;br /&gt;
 20	34061918	34061918	20:34061918_T/C_Intron:CEP250	266	41.815	1	0.0786	0.00095471	3.3035	145	121	0.22543	0.075436&lt;br /&gt;
 20	4155948	4155948	20:4155948_G/A_Intron:SMOX	266	215	1	0.40414	0.0020792	-3.0787	145	121	0.68276	0.95868&lt;br /&gt;
 20	4680251	4680251	20:4680251_A/G_Nonsynonymous:PRNP	266	186	1	0.34962	0.0025962	3.0119	145	121	0.8069	0.57025&lt;br /&gt;
 20	36668874	36668874	20:36668874_G/A_Synonymous:RPRD1B	266	96	1	0.18045	0.003031	2.9646	145	121	0.44828	0.2562&lt;br /&gt;
 20	36641871	36641871	20:36641871_G/A_Synonymous:TTI1	266	10	1	0.018797	0.004308	-2.8547	145	121	0.0068966	0.07438&lt;br /&gt;
 20	1616892	1616892	20:1616892_A/G_Synonymous:SIRPG	266	144	1	0.27068	0.0051239	2.7991	145	121	0.63449	0.42975&lt;br /&gt;
 20	25038372	25038372	20:25038372_G/A_Intron:ACSS1	266	103.3	1	0.19418	0.005748	2.7618	145	121	0.47201	0.28813&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;AC&#039;&#039;&#039; : Total Non-reference Allele Count&lt;br /&gt;
* &#039;&#039;&#039;CALLRATE&#039;&#039;&#039; : Fraction of non-missing genotypes.&lt;br /&gt;
* &#039;&#039;&#039;MAF&#039;&#039;&#039; : Minor allele frequencies&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of single variant test&lt;br /&gt;
* &#039;&#039;&#039;AF.CASE&#039;&#039;&#039; : Non-reference allele frequencies for cases&lt;br /&gt;
* &#039;&#039;&#039;AF.CTRL&#039;&#039;&#039; : Non-reference allele frequencies for controls&lt;br /&gt;
&lt;br /&gt;
==== Q-Q plot of test statistics (stratified by MAF) ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.qq.pdf will be generated as shown below&lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_qq.png]]&lt;br /&gt;
&lt;br /&gt;
==== Manhattan Plot of Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.mh.pdf will be generated for chr20 only. &lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_mh.png]]&lt;br /&gt;
&lt;br /&gt;
An example Genome-wide manhattan plot (from a genome-wide run) will look like below&lt;br /&gt;
&lt;br /&gt;
[[File:tes_b_score_epacts_mh_gw.png]]&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise burden test ===&lt;br /&gt;
&lt;br /&gt;
Gene-wise or group-wise burden test requires two steps. First, &#039;group&#039; file containing the list of &lt;br /&gt;
markers per group needs to be generated. Second, group-wise burden test needs to be run&lt;br /&gt;
&lt;br /&gt;
==== Creating marker group file ====&lt;br /&gt;
&lt;br /&gt;
The marker group file has the following format&lt;br /&gt;
&lt;br /&gt;
 [GROUP_ID]  [MARKER_ID_1]   [MARKER_ID_2]  .... [MARKER_ID_N]&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
* [GROUP_ID] is a string representing the group (e.g. gene name)&lt;br /&gt;
* [MARKER_ID_K] is a marker key as a format of [CHROM]:[POS]_[REF]/[ALT] (NOTE THAT THIS IS DIFFERENT FROM TYPICAL VCF MARKER ID field)&lt;br /&gt;
&lt;br /&gt;
Note that [MARKER_ID_K] has to be sorted by increasing order of genomic coordinate&lt;br /&gt;
&lt;br /&gt;
In order to create gene-level group file from typically formatted VCF file, one may use the following utility &lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --nonsyn&lt;br /&gt;
&lt;br /&gt;
The above command create a file [output-group-file] containing a list of missense and nonsense variants per each gene. To incorporate different types of functional annotations, use --type option as follows&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --type [function_type_1] --type [function_type_2] ...&lt;br /&gt;
&lt;br /&gt;
Type &#039;epacts makegroup -man&#039; for the detailed documentation&lt;br /&gt;
&lt;br /&gt;
==== Annotating VCF file using EPACTS ====&lt;br /&gt;
&lt;br /&gt;
If the VCF is not annotated, &#039;epacts makegroup&#039; cannot be used. In order to annotate VCF, one can use the example VCF using ANNOVAR as follows:&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts anno \&lt;br /&gt;
    --in ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
    --out ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
The epacts anno script will add &amp;quot;ANNO=[function]:[genename]&amp;quot; entry into the INFO field based on gencodeV7 (default) or refGene database.&lt;br /&gt;
&lt;br /&gt;
It is important to check whether the VCF file is already annotated or not in order to avoid no or redundant annotation.&lt;br /&gt;
&lt;br /&gt;
==== Running Groupwise Test ====&lt;br /&gt;
&lt;br /&gt;
To perform a groupwise burden test on the example VCF (annotated as above), run the following command&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --vcf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz \&lt;br /&gt;
   --groupf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.grp --out out/test.gene.skat \&lt;br /&gt;
   --ped ${EPACTS_DIR}/data/1000G_dummy_pheno.ped --maxAF 0.05 \&lt;br /&gt;
   --chr 20 --pheno QT --cov AGE --cov SEX --test skat --skat-o --run 2&lt;br /&gt;
&lt;br /&gt;
==== Example Output ====&lt;br /&gt;
 $ head out/test.gene.skat.epacts.top5000&lt;br /&gt;
 #CHROM BEGIN   END     MARKER_ID       NS      FRAC_WITH_RARE     NUM_ALL_VARS    NUM_PASS_VARS   NUM_SING_VARS   PVALUE  STATRHO&lt;br /&gt;
 20     62607037        62608720        20:62607037-62608720_SAMD10     266     0.14662 9       5       1       0.0020064       1&lt;br /&gt;
 20     2816211 2820493 20:2816211-2820493_FAM113A      266     0.011278        12      2       1       0.0032542       0&lt;br /&gt;
 20     47245987        47361692        20:47245987-47361692_PREX1      266     0.1391  54      9       6       0.0054849       1&lt;br /&gt;
 20     34761734        34810279        20:34761734-34810279_EPB41L1    266     0.071429        14      7       5       0.0068492       0.2&lt;br /&gt;
 20     61340671        61391602        20:61340671-61391602_NTSR1      266     0.11278 24      9       3       0.011063        1&lt;br /&gt;
 20     48561952        48568644        20:48561952-48568644_RNF114     266     0.011278        4       2       1       0.015175        0.2&lt;br /&gt;
 20     60962895        60963559        20:60962895-60963559_RPS21      266     0.06015 6       3       2       0.016409        0&lt;br /&gt;
 20     55904961        55917801        20:55904961-55917801_SPO11      266     0.011278        11      3       3       0.018031        0&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;FRAC_WITH_RARE&#039;&#039;&#039; : Fraction of individual carrying rare variants below --max-maf (default : 0.05) threshold.&lt;br /&gt;
* &#039;&#039;&#039;NUM_ALL_VARS&#039;&#039;&#039; : Number of all variants defining the group.&lt;br /&gt;
* &#039;&#039;&#039;NUM_PASS_VARS&#039;&#039;&#039; : Number of variants passing the --min-maf, --min-mac, --max-maf, --min-callrate thresholds&lt;br /&gt;
* &#039;&#039;&#039;NUM_SING_VARS&#039;&#039;&#039; : Number of singletons among variants in NUM_PASS_VARS&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of burden tests&lt;br /&gt;
* Other columns are test specific auxiliary columns. For example, in the VT test, the optimal MAF threshold is recorded as an auxiliary output column.&lt;br /&gt;
&lt;br /&gt;
=== Specialized Instruction for EMMAX tests ===&lt;br /&gt;
&lt;br /&gt;
EMMAX (Efficient Mixed Model Association eXpedited - Kang et al (2010) Nat Genet 42:348-54) is an efficient implementation of mixed model association accounting for sample structure including population structure and hidden relatedness. Currently EPACTS supports EMMAX association mapping in single variant test and CMC-like burden tests. &lt;br /&gt;
&lt;br /&gt;
Because EMMAX is based on linear model, the method fits better to quantiative traits than binary traits. However, p-values for binary traits are expected to be valid in the spirit of Armitage trend test, although the estimated effect size may not be precise.&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
==== Single Variant EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : From VCF, we recommend to set a MAF (e.g. 0.01) and call rate (e.g. 0.95) threshold to select high-quality markers to generate kinship matrix as follows.&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-kin \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped (Optional)] --min-maf 0.01 --minCallRate 0.95 \&lt;br /&gt;
  --sepchr (if VCF is separated by chromosome) --out [outprefix.kinf] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
If you provide [input.ped] file, then it will calculate the subset the individuals contained in the PED file. &lt;br /&gt;
&lt;br /&gt;
The procedure above will create a file [outprefix.kinf] after splitting and merging the genomes into multiple pieces. If only a certain subset of SNPs needs to be considered due to target regions, LD-pruning, or any other reasons, a VCF containing the subset of markers must be created beforehand and should be used as input VCF file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Perform Single Variant Association&#039;&#039;&#039; : From VCF and PED, we recommend to use less stringent MAF threshold (e.g. 0.001) and call rate (e.g. 0.50) to perform single variant association&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --min-maf 0.001 --kin [outputprefix.kinf] \&lt;br /&gt;
  --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] --test q.emmax \&lt;br /&gt;
  --out [outprefix] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
The procedure above will perform single variant association analysis compatible to other types of single variant association analyses implemented in EPACTS&lt;br /&gt;
&lt;br /&gt;
==== Burden-style EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : See &#039;Creating Kinship Matrix&#039; section in [[#Single Variant EMMAX Association Analysis]]&lt;br /&gt;
* &#039;&#039;&#039;Create Marker Group&#039;&#039;&#039;&lt;br /&gt;
** By annotating the VCF and extracting missense and nonsense variants&lt;br /&gt;
*** [[#Annotating VCF file using ANNOVAR]] - This step will be required to create marker group file&lt;br /&gt;
*** [[#Creating marker group file]] - Assume that [group.grp] file is produced&lt;br /&gt;
** Or, by creating your own marker group information&lt;br /&gt;
*** See [[#Creating marker group file]] for details&lt;br /&gt;
* Run CMC-style burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxCMC --out [outprefix] &lt;br /&gt;
* Run Variable Threshold burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxVT --out [outprefix]&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Own Input Data ==&lt;br /&gt;
&lt;br /&gt;
=== VCF file for Genotypes ===&lt;br /&gt;
&lt;br /&gt;
EPACTS support VCF files as input for association with the following requirement&lt;br /&gt;
* Input VCF file must be bgzipped and tabixed before running association to allow efficient random access of the file. Below is an example command to conver plain VCF into bgzipped and tabixed VCF&lt;br /&gt;
  bgzip input.vcf     ## this command will produce input.vcf.gz&lt;br /&gt;
  tabix -pvcf -f input.vcf.gz  ## this command will produce input.vcf.gz.tbi&lt;br /&gt;
* If the VCF file is separated by chromosome, the VCF file specified in the input argument must contain the string &amp;quot;chr1&amp;quot; in the chromosome 1 file, and corresponding chromosome name for other chromosomes. Thus, the files names should be like &amp;lt;code&amp;gt;[prefix]chr1[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chr2[suffix].vcf.gz&amp;lt;/code&amp;gt;, ..., &amp;lt;code&amp;gt;[prefix]chr22[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chrX[suffix].vcf.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Sample IDs in the VCF file must be consistent to those from PED file&lt;br /&gt;
* Currently EPACTS only support bi-allelic variants, but it handles SNPs, INDELs, snd SVs.&lt;br /&gt;
* Currently, EPACTS only support VCF aligned with NCBI build 37 coordinates&lt;br /&gt;
* An example VCF file from 1000 genome project is below. &lt;br /&gt;
 $ zcat example/1000G_integrated_phase1_chr20.vcf.gz | cut -f 1-10 | head -50 &lt;br /&gt;
 ##fileformat=VCFv4.1&lt;br /&gt;
 ##INFO=&amp;lt;ID=LCSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Low coverage VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=EXSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Exome VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=INDEL,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in INDEL VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SV,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in SV VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BAVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BRSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality estimate from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=LDAF,Number=1,Type=Float,Description=&amp;quot;MLE Allele Frequency Accounting for LD&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=RSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=ERATE,Number=1,Type=Float,Description=&amp;quot;Per-marker Mutation rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=THETA,Number=1,Type=Float,Description=&amp;quot;Per-marker Transition rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIEND,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around END for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIPOS,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around POS for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=END,Number=1,Type=Integer,Description=&amp;quot;End position of the variant described in this record&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMLEN,Number=.,Type=Integer,Description=&amp;quot;Length of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMSEQ,Number=.,Type=String,Description=&amp;quot;Sequence of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SOURCE,Number=.,Type=String,Description=&amp;quot;Source of deletion call&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVLEN,Number=1,Type=Integer,Description=&amp;quot;Difference in length between REF and ALT alleles&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVTYPE,Number=1,Type=String,Description=&amp;quot;Type of structural variant&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AC,Number=.,Type=Integer,Description=&amp;quot;Alternate Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AN,Number=1,Type=Integer,Description=&amp;quot;Total Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##ALT=&amp;lt;ID=DEL,Description=&amp;quot;Deletion&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GT,Number=1,Type=String,Description=&amp;quot;Genotype&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=DS,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GL,Number=.,Type=Float,Description=&amp;quot;Genotype Likelihoods&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=BD,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 #CHROM POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  HG00096&lt;br /&gt;
 20 60479   .   C   T   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.894;LDAF=0.0020;AVGPOST=0.9995;RSQ=0.8779;ERATE=0.0005;THETA=0.0008;AC=4;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.19,-0.46,-2.68:0.0022&lt;br /&gt;
 20 60522   .   T   TC  1588    PASS    INDEL;BAVGPOST=1.000;BRSQ=0.994;LDAF=0.0116;AVGPOST=0.9980;RSQ=0.9327;ERATE=0.0004;THETA=0.0167;AC=24;AN=2184   GT:DS:GL:BD 0|0:0.000:0.00,-0.90,-9.20:0&lt;br /&gt;
 20 60571   .   C   A   100 PASS    LCSNP;EXSNP;BAVGPOST=0.999;BRSQ=0.813;LDAF=0.0029;AVGPOST=0.9986;RSQ=0.8085;ERATE=0.0014;THETA=0.0014;AC=5;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.05,-0.96,-5.00:0.0008&lt;br /&gt;
 20 60795   .   G   C   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.930;LDAF=0.0006;AVGPOST=0.9996;RSQ=0.7205;ERATE=0.0003;THETA=0.0041;AC=1;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.03,-1.21,-5.00:0.0001&lt;br /&gt;
 20 60810   .   G   GA  127 PASS    INDEL;BAVGPOST=1.000;BRSQ=0.862;LDAF=0.0013;AVGPOST=0.9987;RSQ=0.5684;ERATE=0.0004;THETA=0.0061;AC=2;AN=2184    GT:DS:GL:BD 0|0:0.000:0.00,-1.80,-18.80:0&lt;br /&gt;
&lt;br /&gt;
=== PED file for Phenotypes and Covariates ===&lt;br /&gt;
&lt;br /&gt;
EPACTS accepts a PED format supported by MERLIN or PLINK software to represent phenotypes. For example, the example.ped file and example.dat file can represent the phenotypes and corresponding column name (from 6th column and after). &lt;br /&gt;
&lt;br /&gt;
 $ head example.ped&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
 $ cat example.dat&lt;br /&gt;
 A DISEASE&lt;br /&gt;
 T QT&lt;br /&gt;
 T AGE&lt;br /&gt;
&lt;br /&gt;
EPACTS also accept a PED format with header information. The above file can be combined into one file as follows&lt;br /&gt;
&lt;br /&gt;
 $ head data/1000G_dummy_pheno.ped&lt;br /&gt;
 #FAM_ID    IND_ID  FAT_ID  MOT_ID  SEX DISEASE QT  AGE&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
The column names can be used to identify the names of phenotypes and covariates in the analysis.&lt;br /&gt;
&lt;br /&gt;
== Frequently Asked Questions ==&lt;br /&gt;
=== Installation ===&lt;br /&gt;
# How should I install EPACTS? &lt;br /&gt;
#* See [[EPACTS#Installation_Details | Installation Details]]&lt;br /&gt;
# I am having the following error message &#039;&#039;&#039;configure: error: libR.{so,a} was not found. Please install it at http://www.r-project.org/ first&#039;&#039;&#039;. What do I have to do?&lt;br /&gt;
#* First, you need to find out where R was installed. Try to type &amp;quot;locate libR.so&amp;quot; and see if it returns anything&lt;br /&gt;
#* If &amp;quot;locate libR.so&amp;quot; returns you something, as explained [[EPACTS#Installation_Details | Installation Details]], try to add &amp;quot;LDFLAGS=-L/path/to/R/library&amp;quot; and rerun &#039;&#039;&#039;configure&#039;&#039;&#039; and &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
#* If you cannot find libR.so, you make have to recompile R with --enable-R-shlib option as described in http://cran.r-project.org/doc/manuals/R-admin.html#Installation&lt;br /&gt;
&lt;br /&gt;
=== Input Files ===&lt;br /&gt;
# What is VCF?&lt;br /&gt;
#* VCF refers to Variant Call Format&lt;br /&gt;
#* See [[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 1000 Genomes wiki page]] for the detailed description of VCF format&lt;br /&gt;
# Should input VCF be compressed into certain format?&lt;br /&gt;
#* Correct. EPACTS assumes that VCF file is bgzipped and tabixed already.&lt;br /&gt;
#* See [[#VCF file for Genotypes]] for details.&lt;br /&gt;
# What are the additional requirements for input VCF file?&lt;br /&gt;
#* Input VCF file used for association mapping must contain individual genotype information at 10-th or higher order columns.&lt;br /&gt;
#* GT field must be encoded as haploid or diploid&lt;br /&gt;
#* Bi-allelic SNPs only : Currently EPACTS may not handle multi-allelic SNPs correctly.&lt;br /&gt;
#* If non-GT field is used, the field is considered as dosage and should be a single numeric value.&lt;br /&gt;
# What are the acceptable input format to encode phenotypes and covariates?&lt;br /&gt;
#* See [[#PED file for Phenotypes and Covariates]] for the detailed information&lt;br /&gt;
# How should I encode binary phenotypes?&lt;br /&gt;
#* If you encode your phenotypes into two different numeric values (e.g. 0/1 or 1/2), EPACTS will automatically recognize them as binary phenotypes and encode them into 1/2 values. Higher value will be considered as cases for case-control association&lt;br /&gt;
# How should I encode missing genotypes?&lt;br /&gt;
#* The default code missing phenotypes in EPACTS are &#039;NA&#039;&lt;br /&gt;
#* One may use --missing option to specify different types of missing values&lt;br /&gt;
#* The encoding of missing genotypes follows the VCF specificiation&lt;br /&gt;
# How do I match the relationship between VCF and PED input files?&lt;br /&gt;
#* EPACTS will assume that the individual IDs in each VCF and PED file are unique, and they follow the saming convention. Thus, the individual IDs overlapping between VCF and PED files will be considered in the associations&lt;br /&gt;
# How the individuals with missing phenotypes are handled?&lt;br /&gt;
#* Currently, EPACTS will automatically remove the individuals without phenotypes or covariates. If one wants to use imputed covariates to increase sample size, the PED file must contain the imputed covariate values.&lt;br /&gt;
#* Markers with missing genotypes won&#039;t be discarded automatically. It can be explicitly discarded by --minCallRate option when performing association&lt;br /&gt;
&lt;br /&gt;
=== Output Files ===&lt;br /&gt;
# Which output files should I be looking at?&lt;br /&gt;
#* [[#Output Text of Top Associations]] is the key file to look at the individual top associations&lt;br /&gt;
#* [[#Q-Q plot of test statistics (stratified by MAF)]] will be important to see the global distribution of test statistics and examine if there are apparent inflation of test statistics&lt;br /&gt;
#* [[#Manhattan Plot of Test Statistics]] will inform us the genome-wide distribution of association signals&lt;br /&gt;
#* [[#Output Text of All Test Statistics]] will contain the full information of test results across all units tested&lt;br /&gt;
# The Q-Q and Manhattan plots cannot be found. Why?&lt;br /&gt;
#* It is probably because gnuplot 4.2 or higher is not installed in your system, or they are included but cannot be found in your ${PATH}. Please visit [[http://gnuplot.info/ GNUPLOT web page]] for installation.&lt;br /&gt;
# How can I read the EMMAX kinship file from produced from EPACTS?&lt;br /&gt;
# * You can run the following command to dump your kinship matrix into a human-readable text format.&lt;br /&gt;
 $(EPACTS_DIR)/bin/epacts/bin/pEmmax kin-util --kinf [input.kinf] --outf [output.prefix] --dump&lt;br /&gt;
&lt;br /&gt;
=== More questions ===&lt;br /&gt;
# If you have more questions, please contact [[mailto:hmkang@umich.edu Hyun Min Kang]].&lt;br /&gt;
&lt;br /&gt;
== Detailed Options ==&lt;br /&gt;
&lt;br /&gt;
The detailed options can viewed by running the following commands&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts -man           (for overall structure) &lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts single -man    (for single variant test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts group -man     (for groupwise test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts anno -man      (for annotation)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts plot -man      (for QQ and Manhattan plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts zoom -man      (for zoom plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts meta -man      (for meta-analysis)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts make-group -man (for creating gene group)&lt;br /&gt;
&lt;br /&gt;
== Implementing Additional Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
In order to add additional statistical test to EPACTS, the following procedure are recommended&lt;br /&gt;
&lt;br /&gt;
# Create a file named &#039;single.[testname].R&#039; for single variant test or &#039;gene.[testname].R&#039; for gene-level test under ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
# Test your implementation using --test [testname] option to perform sanity check and debugging&lt;br /&gt;
# If you want to add your test in the official in-house version, please send your code to Hyun&lt;br /&gt;
&lt;br /&gt;
Below is an example of a single variant test implementation ( single.q.lm.R )&lt;br /&gt;
 ## Core functions of EPACTS to perform association&lt;br /&gt;
 &lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## SINGLE VARIANT TEST&lt;br /&gt;
 ## INPUT VARIABLES:&lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   NS       : number of called samples&lt;br /&gt;
 ##   AC       : allele count&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:nrow(NS) after AF/AC threshold&lt;br /&gt;
 ##   genos    : genotype matrix (after AF/AC threshold)&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional columns to add&lt;br /&gt;
 ##   cname    : column names for additional columns&lt;br /&gt;
 ##################################################################  &lt;br /&gt;
 &lt;br /&gt;
 ## single.lm() : Use built-in lm() function to perform association&lt;br /&gt;
 ## KEY FEATURES : SIMPLE, BUT MAY BE SLOW&lt;br /&gt;
 ##                GOOD SNIPPLET TO START A NEW FUNCTION&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, TSTAT&lt;br /&gt;
 ## MISSING VALUES : IGNORED&lt;br /&gt;
 single.q.lm &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;TSTAT&amp;quot;) # column names for additional variables in the EPACTS output&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   p &amp;lt;- rep(NA,m)&lt;br /&gt;
   add &amp;lt;- matrix(NA,m,3) ## BETA, SEBETA, TSTAT&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
    for(i in 1:m) {&lt;br /&gt;
      r &amp;lt;- summary(lm(pheno~genos[i,]+cov-1))$coefficients[1,]  # run simple linear regression&lt;br /&gt;
      p[i] &amp;lt;- r[4]   # store p-value to p[i]&lt;br /&gt;
      add[i,] &amp;lt;- r[1:3] # store additional variables to add[i,]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  return(list(p=p,add=add,cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
As described in the comment, you may assume that the following variables are available for use for testing association across m markers&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker&lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (m * 1 vector) : p-value matrix as output&lt;br /&gt;
* add (m * c matrix) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# AC : Non-ref allele count&lt;br /&gt;
# CALLRATE : Call rate = NS/n&lt;br /&gt;
# MAF : Minor allele frequency&lt;br /&gt;
# PVALUE : P-values&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
Below is an example of a gene-lvel variant test implementation ( single.q.lm.R )&lt;br /&gt;
&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## GENE-LEVEL BURDEN TEST&lt;br /&gt;
 ## INPUT VARIABLES: &lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   genos    : genotype matrix for each gene&lt;br /&gt;
 ##   NS       : number of called samples for each marker&lt;br /&gt;
 ##   AC       : allele count for each marker&lt;br /&gt;
 ##   MAC      : minor allele count for each marker&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:n after AF/AC threshold&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional column values&lt;br /&gt;
 ##   cname    : additional column names&lt;br /&gt;
 ##################################################################      &lt;br /&gt;
 &lt;br /&gt;
 ## gene.q.reverse() : Reverse logistic regression&lt;br /&gt;
 ## KEY FEATURES : 0/1 collapsing variable ~ rare variants&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE (GAUSSIAN)&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, ZSTAT&lt;br /&gt;
 ## MISSING VALUE : IMPUTED AS MAJOR ALLELES&lt;br /&gt;
 gene.q.reverse &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;ZSTAT&amp;quot;)&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
     g &amp;lt;- as.double(colSums(genos,na.rm=T) &amp;gt; 0)&lt;br /&gt;
     sg &amp;lt;- sum(g)&lt;br /&gt;
     if ( ( sg &amp;gt; 0 ) &amp;amp;&amp;amp; ( sg &amp;lt; n ) ) {&lt;br /&gt;
       r &amp;lt;- glm(g~pheno+cov-1,family=binomial)&lt;br /&gt;
        if ( ( r$converged ) &amp;amp;&amp;amp; ( ! r$boundary ) ) {&lt;br /&gt;
         return(list(p=summary(r)$coefficients[1,4],&lt;br /&gt;
                     add=summary(r)$coefficients[1,1:3],&lt;br /&gt;
                     cname=cname))&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   return(list(p=NA,add=rep(NA,3),cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Similar to gene-level test, you may assume the following variables exist for testing A SINGLE GENE. Note that M is the number of markers spanning the gene region&lt;br /&gt;
&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker &lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAC (M * 1 vector) : Minor allele count&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (scalar) : p-value matrix as output&lt;br /&gt;
* add (c * 1 vector) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# MAF_BURDEN : MAF of 0/1 collapsing variables (existence of rare variants)&lt;br /&gt;
# NUM_ALL_VARS : Number of all variants within the gene&lt;br /&gt;
# NUM_RARE_VARS : Number of rare variants below the max-MAF threshold&lt;br /&gt;
# NUM_SING_VARS : Number of singleton variants&lt;br /&gt;
# PVALUE : P-value from the test&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
== Full ChangeLog ==&lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs&lt;br /&gt;
** Some known bugs still exist &lt;br /&gt;
*** SKAT-O Lambda eigenvalue error. This happenes in a particular context but haven&#039;t nailed down a way to prevent it yet.&lt;br /&gt;
*** EMMAX has case and control frequency flipped.&lt;br /&gt;
* EMMAX test has a silly known bug with case / ctrl frequency is flipped&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
* February 28th, 2013 : EPACTS v3.2.0 release&lt;br /&gt;
** R package installation bug (for some users) was fixed&lt;br /&gt;
** A bug in the MAF error for high frequency variants (AF&amp;gt;0.25) was now fixed&lt;br /&gt;
** SKAT version is updated to 0.81&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
* December 4th, 2012 : EPACTS v3.1.0 release&lt;br /&gt;
** Removed dependency on libR.so&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** November 25th, 2012 : EPACTS v3.0.0 release&lt;br /&gt;
** Restructured with source code release (with autoconf / automake / libtools)&lt;br /&gt;
** Added zoom plot feature&lt;br /&gt;
** FRAC_BURDEN keyword was replace to FRAC_WITH_RARE for groupwise testing&lt;br /&gt;
* October 26th, 2012 : EPACTS v2.2.0-beta is released with the following updates&lt;br /&gt;
** Added --max-mac option&lt;br /&gt;
** Fixed Firth&#039;s bias-corrected test (by Clement Ma)&lt;br /&gt;
** Added more informative warning messages when index files do not exist&lt;br /&gt;
** Fixed the bug in the epacts-plot in plotting ties&lt;br /&gt;
** Fixed errors in the MAF estimates per case and control&lt;br /&gt;
** Fixed bug in --minRSQ option&lt;br /&gt;
* September 28, 2012 : EPACTS v2.11-beta is released with the following updates&lt;br /&gt;
** Counts and allele frequencies for case/control added for binary tests&lt;br /&gt;
** --max-maf parameter is added&lt;br /&gt;
** Fixed EMMAX error in MAF in the output&lt;br /&gt;
** More informative error messages &lt;br /&gt;
* September 27, 2012 : EPACTS v2.1-beta is released with the following updates&lt;br /&gt;
** EMMAX interface is changed. --kinOnly option is related with a new command &#039;&#039;&#039;make-kin&#039;&#039;&#039; &lt;br /&gt;
** SKAT-O is upgraded to version 0.77 with additional configurable parameter settings&lt;br /&gt;
** Some parameter names are renamed (e.g. --min-maf, --min-mac)&lt;br /&gt;
** Many minor bugs are fixed&lt;br /&gt;
* Jul 6, 2012 : EPACTS v2.01-beta is released with the following updates&lt;br /&gt;
** SKAT-O is upgraded to version 0.76&lt;br /&gt;
** Fixed minor bugs in option names (Thanks to Xueling Sim)&lt;br /&gt;
* Jul 3, 2012 : EPACTS v2.0-beta is released with the following updates&lt;br /&gt;
** Major restructuring of the software&lt;br /&gt;
** Annotation software is switched with built-in application&lt;br /&gt;
** Addition of SKAT-O and EMMAX burden test&lt;br /&gt;
** Minor bug fixes&lt;br /&gt;
* Apr 8, 2012 : EPACTS v1.2-alpha is released with the following updates, in addition to the following updates&lt;br /&gt;
** EMMAX bug in handling covariates was fixed&lt;br /&gt;
** Variable Threshold Test is added&lt;br /&gt;
** Variable Threshold Test with genomic score (e.g. GERP or PhyloP) is added.&lt;br /&gt;
* Apr 4, 2012 : EPACTS v1.1-alpha is released with the following updates, in addition to minor updates&lt;br /&gt;
** EMMAX burden test (Hyun Min Kang)&lt;br /&gt;
** Likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of Firth bias-corrected likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of EMMAX single variant test (Hyun Min Kang) &lt;br /&gt;
* Mar 29, 2012 : EPACTS v1.0-alpha is released&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14160</id>
		<title>EPACTS</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14160"/>
		<updated>2016-05-01T17:22:24Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Single Variant Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;EPACTS&#039;&#039;&#039; (Efficient and Parallelizable Association Container Toolbox) is a versatile software pipeline to perform various statistical tests for identifying genome-wide association from sequence data through a user-friendly interface, both to scientific analysts and to method developers.&lt;br /&gt;
&lt;br /&gt;
== Join in EPACTS mailing list ==&lt;br /&gt;
&lt;br /&gt;
Please join in the [http://groups.google.com/group/epacts EPACTS Google Group] to ask / discuss / comment about EPACTS.&lt;br /&gt;
&lt;br /&gt;
== Lastest ChangeLog ==&lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs (more comprehensive fix is still pending)&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
See [[#Full ChangeLog]] for full details&lt;br /&gt;
&lt;br /&gt;
== Key Features ==&lt;br /&gt;
&lt;br /&gt;
EPACTS currently provides the following set of key features&lt;br /&gt;
* Robust support for widely used format of sequence-based genotypes (VCF) and phenotypes with pedigree (PED)&lt;br /&gt;
** Efficient library for accessing VCF file to reduce computational burden to analyze large-scale sequencing data&lt;br /&gt;
** Support selecting markers by arbitrary combination of substring matching. &lt;br /&gt;
** Support for using genotype dosages instead of hard genotype calls&lt;br /&gt;
** Utilize PED format to perform test across multiple traits.&lt;br /&gt;
* Supports a large number of widely used statistical tests for single variant association and burden tests.&lt;br /&gt;
** See the &amp;quot;Currently Supported Statistical Tests&amp;quot; section below for more information&lt;br /&gt;
* Easy to Highly Parallelize Jobs&lt;br /&gt;
** Makefile-based partition into and ligation of multiple subtasks&lt;br /&gt;
** Parallel run of job is simply adding one parameter when running EPACTS &lt;br /&gt;
* Integrative and versatile framework that allows easy addition of additional statistical test&lt;br /&gt;
** Core input/output routines are implemented in C++&lt;br /&gt;
** Most statistical tests (except for EMMAX) are implemented in R&lt;br /&gt;
** Adding a simple R function to implement additional statistical test (See [[#Implementing Additional Statistical Tests]] for details)&lt;br /&gt;
* Useful utilities for post-association-analysis tasks&lt;br /&gt;
** Automatic functional annotation of associated variants&lt;br /&gt;
** Automatic generation of QQ and Manhattan Plot&lt;br /&gt;
** (TBA) Zoom plot for the significant associations&lt;br /&gt;
&lt;br /&gt;
== Obtaining EPACTS ==&lt;br /&gt;
&lt;br /&gt;
* The official release of EPACTS software is available at http://www.sph.umich.edu/csg/kang/epacts/ . &lt;br /&gt;
** From the CSG cluster, it is available at /net/fantasia/home/bin/epacts/&lt;br /&gt;
* Note that R (version 2.10 or higher) and gnuplot (version 4.2 or higher) must be installed in order to run EPACTS correctly.&lt;br /&gt;
&lt;br /&gt;
== Currently Supported Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
EPACTS supports the following sets of widely used statistical tests for single variant tests and burden tests&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.wald &lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logisitic Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (simply used glm in R)&lt;br /&gt;
|-&lt;br /&gt;
| b.score&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Logistic Score Test &amp;lt;br&amp;gt; (from Lin DY and Tang ZZ, AJHG 2011 89:354-67)&lt;br /&gt;
| Clement Ma &amp;amp; Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.firth&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Firth Bias-Corrected Logistic Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.lrt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.glrt&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Fast&lt;br /&gt;
| Genotype Likelihood Ratio Test &amp;lt;br&amp;gt; (use GL or PL field in VCF to perform case-control test)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.lm&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Linear Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (as implemented in lm in R)&lt;br /&gt;
|-&lt;br /&gt;
| q.score&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Quantitative Score Test &amp;lt;br&amp;gt; (from Lin DY and Tang ZZ, AJHG 2011 89:354-67)&lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| q.linear&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Linear Wald Test&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.emmax&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| EMMAX &amp;lt;br&amp;gt; ( Kang et al (2010) Nat Genet 42:348-54 )&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.collapse&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and 0/1 collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.madsen&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Slow&lt;br /&gt;
| Wilcoxon Rank Sum Test between binary phenotypes and weighted rare variant scores (slightly different version from the published method - it uses pooled allele frequency across cases and controls for weighting each variant)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.wcnt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and weighted rare variant scores&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression of phenotypes on binary collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression of phenotypes on collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| skat&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT-O Test by Lee et al, Biostatistics (2012)&lt;br /&gt;
| Seunggeun Lee &amp;lt;br&amp;gt; (adaptive by Xueling Sim and Hyun Min Kang)&lt;br /&gt;
|-&lt;br /&gt;
| VT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed out first)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable Threshold Test &amp;lt;br&amp;gt; with adaptive permutation &amp;lt;br&amp;gt; Price et al, AJHG (2010) 86:832-8&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxCMC&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Collapsing burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxVT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable-threshold burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| mmskat&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT test using EMMAX&lt;br /&gt;
| Seunggeun Lee &amp;amp; Hyun Min Kang&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Installation Details  ==&lt;br /&gt;
&lt;br /&gt;
If you want to use EPACTS in an Ubuntu platform, following the step below &lt;br /&gt;
&lt;br /&gt;
*Download EPACTS source distribution at http://www.sph.umich.edu/csg/kang/epacts/download/EPACTS-3.2.6.tar.gz (165MB) &lt;br /&gt;
*Uncompress EPACTS package, and install the package using the following set of commands&lt;br /&gt;
* Visit http://www.sph.umich.edu/csg/kang/epacts/download for checking previous versions&lt;br /&gt;
&lt;br /&gt;
  tar xzvf EPACTS-3.2.6.tar.gz&lt;br /&gt;
  cd EPACTS-3.2.6&lt;br /&gt;
  ./configure --prefix=/path/to/install&lt;br /&gt;
  make&lt;br /&gt;
  make install&lt;br /&gt;
&lt;br /&gt;
(Important Note: &#039;&#039;&#039;make sure to specify --prefix=/path/to/install&#039;&#039;&#039; to avoid installing to the default path /usr/local/, which you may not have the permission. /home/your_userid/epacts might be a good one, if you are not sure where to install)&lt;br /&gt;
  &lt;br /&gt;
* Now ${EPACTS_DIR} represents the &#039;/path/to/install&#039; directory&lt;br /&gt;
&lt;br /&gt;
* Download the reference FASTA files from 1000 Genomes FTP automatically by running the following commands&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/epacts download&lt;br /&gt;
&lt;br /&gt;
 (For advanced users, to save time for downloading the FASTA files (~900MB), you may copy a local copy of GRCh37 FASTA file and the index file to ${EPACTS_DIR}/share/EPACTS/)&lt;br /&gt;
&lt;br /&gt;
*Perform a test run by running the following command&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
&lt;br /&gt;
In order to use EPACTS in the CSG cluster, you do not need to install them. You can directly use or make a copy of the in-house release version at &lt;br /&gt;
&lt;br /&gt;
 /net/fantasia/home/hmkang/bin/epacts/&lt;br /&gt;
&lt;br /&gt;
== Getting Started With Examples ==&lt;br /&gt;
If you are using EPACTS from the CSG cluster, please set the following environment variable&lt;br /&gt;
 EPACTS_DIR=/net/fantasia/home/hmkang/bin/epacts (in bash)&lt;br /&gt;
 setenv EPACTS_DIR /net/fantasia/home/hmkang/bin/epacts (in csh)&lt;br /&gt;
&lt;br /&gt;
If you downloaded EPACTS binary and please set EPACTS_DIR to the full path of the downloaded and uncompressed directory.&lt;br /&gt;
&lt;br /&gt;
=== All-in-one example ===&lt;br /&gt;
&lt;br /&gt;
To get started with EPACTS, run the following command will perform an example run&lt;br /&gt;
 ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
 &lt;br /&gt;
You will find a series of lines in test_run_epacts.sh script commented out for each possible test. &lt;br /&gt;
&lt;br /&gt;
The example phenotype (PED format) and genotype (VCF format) can be found at&lt;br /&gt;
 ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Test ===&lt;br /&gt;
&lt;br /&gt;
Or You can run EPACTS command yourself by running&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
   --vcf  ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
   --ped  ${EPACTS_DIR}/data/1000G_dummy_pheno.ped  \&lt;br /&gt;
   --min-maf 0.001 --chr 20 --pheno DISEASE --cov AGE --cov SEX --test b.score --anno \ &lt;br /&gt;
   --out out/test --run 2&lt;br /&gt;
&lt;br /&gt;
The command above will perform single variant association test using a dummy case-control phenotype file and a subset of 1000 genomes exome VCF file (chr20) using score test statistic for all variants over 1% of higher MAF using 2 parallel runs.&lt;br /&gt;
&lt;br /&gt;
You will see the 4 output files as the main outcome of the analysis&lt;br /&gt;
&lt;br /&gt;
==== Output Text of All Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The filename is out/test.single.b.score.epacts.gz and the contents will look like&lt;br /&gt;
 $ zcat out/test.single.b.score.epacts.gz | head&lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	68303	68303	20:68303_A/G_Upstream:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68319	68319	20:68319_C/A_Upstream:DEFB125	266	1.4467e-36	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68396	68396	20:68396_C/T_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76635	76635	20:76635_A/T_Intron:DEFB125	266	1.534e-37	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76689	76689	20:76689_T/C_Synonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76690	76690	20:76690_T/C_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76700	76700	20:76700_G/A_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76726	76726	20:76726_C/G_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76771	76771	20:76771_C/T_Nonsynonymous:DEFB125	266	3	1	0.0056391	0.68484	0.40587	145	121	0.013793	0.0082645&lt;br /&gt;
&lt;br /&gt;
==== Output Text of Top Associations ====&lt;br /&gt;
&lt;br /&gt;
Same type of file but containing top 5,000 association will be stored at out/test.epacts.top5000&lt;br /&gt;
&lt;br /&gt;
 $ head out/test.single.b.score.epacts.top5000 &lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	1610894	1610894	20:1610894_G/A_Synonymous:SIRPG	266	138.64	1	0.26061	6.9939e-05	3.9765	145	121	0.65177	0.36476&lt;br /&gt;
 20	4162411	4162411	20:4162411_T/C_Intron:SMOX	266	204	1	0.38346	0.00055583	-3.4523	145	121	0.62759	0.93388&lt;br /&gt;
 20	34061918	34061918	20:34061918_T/C_Intron:CEP250	266	41.815	1	0.0786	0.00095471	3.3035	145	121	0.22543	0.075436&lt;br /&gt;
 20	4155948	4155948	20:4155948_G/A_Intron:SMOX	266	215	1	0.40414	0.0020792	-3.0787	145	121	0.68276	0.95868&lt;br /&gt;
 20	4680251	4680251	20:4680251_A/G_Nonsynonymous:PRNP	266	186	1	0.34962	0.0025962	3.0119	145	121	0.8069	0.57025&lt;br /&gt;
 20	36668874	36668874	20:36668874_G/A_Synonymous:RPRD1B	266	96	1	0.18045	0.003031	2.9646	145	121	0.44828	0.2562&lt;br /&gt;
 20	36641871	36641871	20:36641871_G/A_Synonymous:TTI1	266	10	1	0.018797	0.004308	-2.8547	145	121	0.0068966	0.07438&lt;br /&gt;
 20	1616892	1616892	20:1616892_A/G_Synonymous:SIRPG	266	144	1	0.27068	0.0051239	2.7991	145	121	0.63449	0.42975&lt;br /&gt;
 20	25038372	25038372	20:25038372_G/A_Intron:ACSS1	266	103.3	1	0.19418	0.005748	2.7618	145	121	0.47201	0.28813&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;AC&#039;&#039;&#039; : Total Non-reference Allele Count&lt;br /&gt;
* &#039;&#039;&#039;CALLRATE&#039;&#039;&#039; : Fraction of non-missing genotypes.&lt;br /&gt;
* &#039;&#039;&#039;MAF&#039;&#039;&#039; : Minor allele frequencies&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of single variant test&lt;br /&gt;
* &#039;&#039;&#039;AF.CASE&#039;&#039;&#039; : Non-reference allele frequencies for cases&lt;br /&gt;
* &#039;&#039;&#039;AF.CTRL&#039;&#039;&#039; : Non-reference allele frequencies for controls&lt;br /&gt;
&lt;br /&gt;
==== Q-Q plot of test statistics (stratified by MAF) ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.qq.pdf will be generated as shown below&lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_qq.png]]&lt;br /&gt;
&lt;br /&gt;
==== Manhattan Plot of Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.mh.pdf will be generated for chr20 only. &lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_mh.png]]&lt;br /&gt;
&lt;br /&gt;
An example Genome-wide manhattan plot (from a genome-wide run) will look like below&lt;br /&gt;
&lt;br /&gt;
[[File:tes_b_score_epacts_mh_gw.png]]&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise burden test ===&lt;br /&gt;
&lt;br /&gt;
Gene-wise or group-wise burden test requires two steps. First, &#039;group&#039; file containing the list of &lt;br /&gt;
markers per group needs to be generated. Second, group-wise burden test needs to be run&lt;br /&gt;
&lt;br /&gt;
==== Creating marker group file ====&lt;br /&gt;
&lt;br /&gt;
The marker group file has the following format&lt;br /&gt;
&lt;br /&gt;
 [GROUP_ID]  [MARKER_ID_1]   [MARKER_ID_2]  .... [MARKER_ID_N]&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
* [GROUP_ID] is a string representing the group (e.g. gene name)&lt;br /&gt;
* [MARKER_ID_K] is a marker key as a format of [CHROM]:[POS]_[REF]/[ALT] (NOTE THAT THIS IS DIFFERENT FROM TYPICAL VCF MARKER ID field)&lt;br /&gt;
&lt;br /&gt;
Note that [MARKER_ID_K] has to be sorted by increasing order of genomic coordinate&lt;br /&gt;
&lt;br /&gt;
In order to create gene-level group file from typically formatted VCF file, one may use the following utility &lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --nonsyn&lt;br /&gt;
&lt;br /&gt;
The above command create a file [output-group-file] containing a list of missense and nonsense variants per each gene. To incorporate different types of functional annotations, use --type option as follows&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --type [function_type_1] --type [function_type_2] ...&lt;br /&gt;
&lt;br /&gt;
Type &#039;epacts makegroup -man&#039; for the detailed documentation&lt;br /&gt;
&lt;br /&gt;
==== Annotating VCF file using EPACTS ====&lt;br /&gt;
&lt;br /&gt;
If the VCF is not annotated, &#039;epacts makegroup&#039; cannot be used. In order to annotate VCF, one can use the example VCF using ANNOVAR as follows:&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts anno \&lt;br /&gt;
    --in ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
    --out ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
The epacts anno script will add &amp;quot;ANNO=[function]:[genename]&amp;quot; entry into the INFO field based on gencodeV7 (default) or refGene database.&lt;br /&gt;
&lt;br /&gt;
It is important to check whether the VCF file is already annotated or not in order to avoid no or redundant annotation.&lt;br /&gt;
&lt;br /&gt;
==== Running Groupwise Test ====&lt;br /&gt;
&lt;br /&gt;
To perform a groupwise burden test on the example VCF (annotated as above), run the following command&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --vcf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz \&lt;br /&gt;
   --groupf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.grp --out out/test.gene.skat \&lt;br /&gt;
   --ped ${EPACTS_DIR}/data/1000G_dummy_pheno.ped --maxAF 0.05 \&lt;br /&gt;
   --chr 20 --pheno QT --cov AGE --cov SEX --test skat --skat-o --run 2&lt;br /&gt;
&lt;br /&gt;
==== Example Output ====&lt;br /&gt;
 $ head out/test.gene.skat.epacts.top5000&lt;br /&gt;
 #CHROM BEGIN   END     MARKER_ID       NS      FRAC_WITH_RARE     NUM_ALL_VARS    NUM_PASS_VARS   NUM_SING_VARS   PVALUE  STATRHO&lt;br /&gt;
 20     62607037        62608720        20:62607037-62608720_SAMD10     266     0.14662 9       5       1       0.0020064       1&lt;br /&gt;
 20     2816211 2820493 20:2816211-2820493_FAM113A      266     0.011278        12      2       1       0.0032542       0&lt;br /&gt;
 20     47245987        47361692        20:47245987-47361692_PREX1      266     0.1391  54      9       6       0.0054849       1&lt;br /&gt;
 20     34761734        34810279        20:34761734-34810279_EPB41L1    266     0.071429        14      7       5       0.0068492       0.2&lt;br /&gt;
 20     61340671        61391602        20:61340671-61391602_NTSR1      266     0.11278 24      9       3       0.011063        1&lt;br /&gt;
 20     48561952        48568644        20:48561952-48568644_RNF114     266     0.011278        4       2       1       0.015175        0.2&lt;br /&gt;
 20     60962895        60963559        20:60962895-60963559_RPS21      266     0.06015 6       3       2       0.016409        0&lt;br /&gt;
 20     55904961        55917801        20:55904961-55917801_SPO11      266     0.011278        11      3       3       0.018031        0&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;FRAC_WITH_RARE&#039;&#039;&#039; : Fraction of individual carrying rare variants below --max-maf (default : 0.05) threshold.&lt;br /&gt;
* &#039;&#039;&#039;NUM_ALL_VARS&#039;&#039;&#039; : Number of all variants defining the group.&lt;br /&gt;
* &#039;&#039;&#039;NUM_PASS_VARS&#039;&#039;&#039; : Number of variants passing the --min-maf, --min-mac, --max-maf, --min-callrate thresholds&lt;br /&gt;
* &#039;&#039;&#039;NUM_SING_VARS&#039;&#039;&#039; : Number of singletons among variants in NUM_PASS_VARS&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of burden tests&lt;br /&gt;
* Other columns are test specific auxiliary columns. For example, in the VT test, the optimal MAF threshold is recorded as an auxiliary output column.&lt;br /&gt;
&lt;br /&gt;
=== Specialized Instruction for EMMAX tests ===&lt;br /&gt;
&lt;br /&gt;
EMMAX (Efficient Mixed Model Association eXpedited - Kang et al (2010) Nat Genet 42:348-54) is an efficient implementation of mixed model association accounting for sample structure including population structure and hidden relatedness. Currently EPACTS supports EMMAX association mapping in single variant test and CMC-like burden tests. &lt;br /&gt;
&lt;br /&gt;
Because EMMAX is based on linear model, the method fits better to quantiative traits than binary traits. However, p-values for binary traits are expected to be valid in the spirit of Armitage trend test, although the estimated effect size may not be precise.&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
==== Single Variant EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : From VCF, we recommend to set a MAF (e.g. 0.01) and call rate (e.g. 0.95) threshold to select high-quality markers to generate kinship matrix as follows.&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-kin \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped (Optional)] --min-maf 0.01 --minCallRate 0.95 \&lt;br /&gt;
  --sepchr (if VCF is separated by chromosome) --out [outprefix.kinf] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
If you provide [input.ped] file, then it will calculate the subset the individuals contained in the PED file. &lt;br /&gt;
&lt;br /&gt;
The procedure above will create a file [outprefix.kinf] after splitting and merging the genomes into multiple pieces. If only a certain subset of SNPs needs to be considered due to target regions, LD-pruning, or any other reasons, a VCF containing the subset of markers must be created beforehand and should be used as input VCF file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Perform Single Variant Association&#039;&#039;&#039; : From VCF and PED, we recommend to use less stringent MAF threshold (e.g. 0.001) and call rate (e.g. 0.50) to perform single variant association&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --min-maf 0.001 --kin [outputprefix.kinf] \&lt;br /&gt;
  --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] --test q.emmax \&lt;br /&gt;
  --out [outprefix] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
The procedure above will perform single variant association analysis compatible to other types of single variant association analyses implemented in EPACTS&lt;br /&gt;
&lt;br /&gt;
==== Burden-style EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : See &#039;Creating Kinship Matrix&#039; section in [[#Single Variant EMMAX Association Analysis]]&lt;br /&gt;
* &#039;&#039;&#039;Create Marker Group&#039;&#039;&#039;&lt;br /&gt;
** By annotating the VCF and extracting missense and nonsense variants&lt;br /&gt;
*** [[#Annotating VCF file using ANNOVAR]] - This step will be required to create marker group file&lt;br /&gt;
*** [[#Creating marker group file]] - Assume that [group.grp] file is produced&lt;br /&gt;
** Or, by creating your own marker group information&lt;br /&gt;
*** See [[#Creating marker group file]] for details&lt;br /&gt;
* Run CMC-style burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxCMC --out [outprefix] &lt;br /&gt;
* Run Variable Threshold burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxVT --out [outprefix]&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Own Input Data ==&lt;br /&gt;
&lt;br /&gt;
=== VCF file for Genotypes ===&lt;br /&gt;
&lt;br /&gt;
EPACTS support VCF files as input for association with the following requirement&lt;br /&gt;
* Input VCF file must be bgzipped and tabixed before running association to allow efficient random access of the file. Below is an example command to conver plain VCF into bgzipped and tabixed VCF&lt;br /&gt;
  bgzip input.vcf     ## this command will produce input.vcf.gz&lt;br /&gt;
  tabix -pvcf -f input.vcf.gz  ## this command will produce input.vcf.gz.tbi&lt;br /&gt;
* If the VCF file is separated by chromosome, the VCF file specified in the input argument must contain the string &amp;quot;chr1&amp;quot; in the chromosome 1 file, and corresponding chromosome name for other chromosomes. Thus, the files names should be like &amp;lt;code&amp;gt;[prefix]chr1[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chr2[suffix].vcf.gz&amp;lt;/code&amp;gt;, ..., &amp;lt;code&amp;gt;[prefix]chr22[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chrX[suffix].vcf.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Sample IDs in the VCF file must be consistent to those from PED file&lt;br /&gt;
* Currently EPACTS only support bi-allelic variants, but it handles SNPs, INDELs, snd SVs.&lt;br /&gt;
* Currently, EPACTS only support VCF aligned with NCBI build 37 coordinates&lt;br /&gt;
* An example VCF file from 1000 genome project is below. &lt;br /&gt;
 $ zcat example/1000G_integrated_phase1_chr20.vcf.gz | cut -f 1-10 | head -50 &lt;br /&gt;
 ##fileformat=VCFv4.1&lt;br /&gt;
 ##INFO=&amp;lt;ID=LCSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Low coverage VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=EXSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Exome VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=INDEL,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in INDEL VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SV,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in SV VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BAVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BRSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality estimate from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=LDAF,Number=1,Type=Float,Description=&amp;quot;MLE Allele Frequency Accounting for LD&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=RSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=ERATE,Number=1,Type=Float,Description=&amp;quot;Per-marker Mutation rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=THETA,Number=1,Type=Float,Description=&amp;quot;Per-marker Transition rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIEND,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around END for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIPOS,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around POS for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=END,Number=1,Type=Integer,Description=&amp;quot;End position of the variant described in this record&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMLEN,Number=.,Type=Integer,Description=&amp;quot;Length of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMSEQ,Number=.,Type=String,Description=&amp;quot;Sequence of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SOURCE,Number=.,Type=String,Description=&amp;quot;Source of deletion call&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVLEN,Number=1,Type=Integer,Description=&amp;quot;Difference in length between REF and ALT alleles&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVTYPE,Number=1,Type=String,Description=&amp;quot;Type of structural variant&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AC,Number=.,Type=Integer,Description=&amp;quot;Alternate Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AN,Number=1,Type=Integer,Description=&amp;quot;Total Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##ALT=&amp;lt;ID=DEL,Description=&amp;quot;Deletion&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GT,Number=1,Type=String,Description=&amp;quot;Genotype&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=DS,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GL,Number=.,Type=Float,Description=&amp;quot;Genotype Likelihoods&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=BD,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 #CHROM POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  HG00096&lt;br /&gt;
 20 60479   .   C   T   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.894;LDAF=0.0020;AVGPOST=0.9995;RSQ=0.8779;ERATE=0.0005;THETA=0.0008;AC=4;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.19,-0.46,-2.68:0.0022&lt;br /&gt;
 20 60522   .   T   TC  1588    PASS    INDEL;BAVGPOST=1.000;BRSQ=0.994;LDAF=0.0116;AVGPOST=0.9980;RSQ=0.9327;ERATE=0.0004;THETA=0.0167;AC=24;AN=2184   GT:DS:GL:BD 0|0:0.000:0.00,-0.90,-9.20:0&lt;br /&gt;
 20 60571   .   C   A   100 PASS    LCSNP;EXSNP;BAVGPOST=0.999;BRSQ=0.813;LDAF=0.0029;AVGPOST=0.9986;RSQ=0.8085;ERATE=0.0014;THETA=0.0014;AC=5;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.05,-0.96,-5.00:0.0008&lt;br /&gt;
 20 60795   .   G   C   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.930;LDAF=0.0006;AVGPOST=0.9996;RSQ=0.7205;ERATE=0.0003;THETA=0.0041;AC=1;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.03,-1.21,-5.00:0.0001&lt;br /&gt;
 20 60810   .   G   GA  127 PASS    INDEL;BAVGPOST=1.000;BRSQ=0.862;LDAF=0.0013;AVGPOST=0.9987;RSQ=0.5684;ERATE=0.0004;THETA=0.0061;AC=2;AN=2184    GT:DS:GL:BD 0|0:0.000:0.00,-1.80,-18.80:0&lt;br /&gt;
&lt;br /&gt;
=== PED file for Phenotypes and Covariates ===&lt;br /&gt;
&lt;br /&gt;
EPACTS accepts a PED format supported by MERLIN or PLINK software to represent phenotypes. For example, the example.ped file and example.dat file can represent the phenotypes and corresponding column name (from 6th column and after). &lt;br /&gt;
&lt;br /&gt;
 $ head example.ped&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
 $ cat example.dat&lt;br /&gt;
 A DISEASE&lt;br /&gt;
 T QT&lt;br /&gt;
 T AGE&lt;br /&gt;
&lt;br /&gt;
EPACTS also accept a PED format with header information. The above file can be combined into one file as follows&lt;br /&gt;
&lt;br /&gt;
 $ head data/1000G_dummy_pheno.ped&lt;br /&gt;
 #FAM_ID    IND_ID  FAT_ID  MOT_ID  SEX DISEASE QT  AGE&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
The column names can be used to identify the names of phenotypes and covariates in the analysis.&lt;br /&gt;
&lt;br /&gt;
== Frequently Asked Questions ==&lt;br /&gt;
=== Installation ===&lt;br /&gt;
# How should I install EPACTS? &lt;br /&gt;
#* See [[EPACTS#Installation_Details | Installation Details]]&lt;br /&gt;
# I am having the following error message &#039;&#039;&#039;configure: error: libR.{so,a} was not found. Please install it at http://www.r-project.org/ first&#039;&#039;&#039;. What do I have to do?&lt;br /&gt;
#* First, you need to find out where R was installed. Try to type &amp;quot;locate libR.so&amp;quot; and see if it returns anything&lt;br /&gt;
#* If &amp;quot;locate libR.so&amp;quot; returns you something, as explained [[EPACTS#Installation_Details | Installation Details]], try to add &amp;quot;LDFLAGS=-L/path/to/R/library&amp;quot; and rerun &#039;&#039;&#039;configure&#039;&#039;&#039; and &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
#* If you cannot find libR.so, you make have to recompile R with --enable-R-shlib option as described in http://cran.r-project.org/doc/manuals/R-admin.html#Installation&lt;br /&gt;
&lt;br /&gt;
=== Input Files ===&lt;br /&gt;
# What is VCF?&lt;br /&gt;
#* VCF refers to Variant Call Format&lt;br /&gt;
#* See [[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 1000 Genomes wiki page]] for the detailed description of VCF format&lt;br /&gt;
# Should input VCF be compressed into certain format?&lt;br /&gt;
#* Correct. EPACTS assumes that VCF file is bgzipped and tabixed already.&lt;br /&gt;
#* See [[#VCF file for Genotypes]] for details.&lt;br /&gt;
# What are the additional requirements for input VCF file?&lt;br /&gt;
#* Input VCF file used for association mapping must contain individual genotype information at 10-th or higher order columns.&lt;br /&gt;
#* GT field must be encoded as haploid or diploid&lt;br /&gt;
#* Bi-allelic SNPs only : Currently EPACTS may not handle multi-allelic SNPs correctly.&lt;br /&gt;
#* If non-GT field is used, the field is considered as dosage and should be a single numeric value.&lt;br /&gt;
# What are the acceptable input format to encode phenotypes and covariates?&lt;br /&gt;
#* See [[#PED file for Phenotypes and Covariates]] for the detailed information&lt;br /&gt;
# How should I encode binary phenotypes?&lt;br /&gt;
#* If you encode your phenotypes into two different numeric values (e.g. 0/1 or 1/2), EPACTS will automatically recognize them as binary phenotypes and encode them into 1/2 values. Higher value will be considered as cases for case-control association&lt;br /&gt;
# How should I encode missing genotypes?&lt;br /&gt;
#* The default code missing phenotypes in EPACTS are &#039;NA&#039;&lt;br /&gt;
#* One may use --missing option to specify different types of missing values&lt;br /&gt;
#* The encoding of missing genotypes follows the VCF specificiation&lt;br /&gt;
# How do I match the relationship between VCF and PED input files?&lt;br /&gt;
#* EPACTS will assume that the individual IDs in each VCF and PED file are unique, and they follow the saming convention. Thus, the individual IDs overlapping between VCF and PED files will be considered in the associations&lt;br /&gt;
# How the individuals with missing phenotypes are handled?&lt;br /&gt;
#* Currently, EPACTS will automatically remove the individuals without phenotypes or covariates. If one wants to use imputed covariates to increase sample size, the PED file must contain the imputed covariate values.&lt;br /&gt;
#* Markers with missing genotypes won&#039;t be discarded automatically. It can be explicitly discarded by --minCallRate option when performing association&lt;br /&gt;
&lt;br /&gt;
=== Output Files ===&lt;br /&gt;
# Which output files should I be looking at?&lt;br /&gt;
#* [[#Output Text of Top Associations]] is the key file to look at the individual top associations&lt;br /&gt;
#* [[#Q-Q plot of test statistics (stratified by MAF)]] will be important to see the global distribution of test statistics and examine if there are apparent inflation of test statistics&lt;br /&gt;
#* [[#Manhattan Plot of Test Statistics]] will inform us the genome-wide distribution of association signals&lt;br /&gt;
#* [[#Output Text of All Test Statistics]] will contain the full information of test results across all units tested&lt;br /&gt;
# The Q-Q and Manhattan plots cannot be found. Why?&lt;br /&gt;
#* It is probably because gnuplot 4.2 or higher is not installed in your system, or they are included but cannot be found in your ${PATH}. Please visit [[http://gnuplot.info/ GNUPLOT web page]] for installation.&lt;br /&gt;
# How can I read the EMMAX kinship file from produced from EPACTS?&lt;br /&gt;
# * You can run the following command to dump your kinship matrix into a human-readable text format.&lt;br /&gt;
 $(EPACTS_DIR)/bin/epacts/bin/pEmmax kin-util --kinf [input.kinf] --outf [output.prefix] --dump&lt;br /&gt;
&lt;br /&gt;
=== More questions ===&lt;br /&gt;
# If you have more questions, please contact [[mailto:hmkang@umich.edu Hyun Min Kang]].&lt;br /&gt;
&lt;br /&gt;
== Detailed Options ==&lt;br /&gt;
&lt;br /&gt;
The detailed options can viewed by running the following commands&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts -man           (for overall structure) &lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts single -man    (for single variant test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts group -man     (for groupwise test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts anno -man      (for annotation)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts plot -man      (for QQ and Manhattan plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts zoom -man      (for zoom plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts meta -man      (for meta-analysis)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts make-group -man (for creating gene group)&lt;br /&gt;
&lt;br /&gt;
== Implementing Additional Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
In order to add additional statistical test to EPACTS, the following procedure are recommended&lt;br /&gt;
&lt;br /&gt;
# Create a file named &#039;single.[testname].R&#039; for single variant test or &#039;gene.[testname].R&#039; for gene-level test under ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
# Test your implementation using --test [testname] option to perform sanity check and debugging&lt;br /&gt;
# If you want to add your test in the official in-house version, please send your code to Hyun&lt;br /&gt;
&lt;br /&gt;
Below is an example of a single variant test implementation ( single.q.lm.R )&lt;br /&gt;
 ## Core functions of EPACTS to perform association&lt;br /&gt;
 &lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## SINGLE VARIANT TEST&lt;br /&gt;
 ## INPUT VARIABLES:&lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   NS       : number of called samples&lt;br /&gt;
 ##   AC       : allele count&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:nrow(NS) after AF/AC threshold&lt;br /&gt;
 ##   genos    : genotype matrix (after AF/AC threshold)&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional columns to add&lt;br /&gt;
 ##   cname    : column names for additional columns&lt;br /&gt;
 ##################################################################  &lt;br /&gt;
 &lt;br /&gt;
 ## single.lm() : Use built-in lm() function to perform association&lt;br /&gt;
 ## KEY FEATURES : SIMPLE, BUT MAY BE SLOW&lt;br /&gt;
 ##                GOOD SNIPPLET TO START A NEW FUNCTION&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, TSTAT&lt;br /&gt;
 ## MISSING VALUES : IGNORED&lt;br /&gt;
 single.q.lm &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;TSTAT&amp;quot;) # column names for additional variables in the EPACTS output&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   p &amp;lt;- rep(NA,m)&lt;br /&gt;
   add &amp;lt;- matrix(NA,m,3) ## BETA, SEBETA, TSTAT&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
    for(i in 1:m) {&lt;br /&gt;
      r &amp;lt;- summary(lm(pheno~genos[i,]+cov-1))$coefficients[1,]  # run simple linear regression&lt;br /&gt;
      p[i] &amp;lt;- r[4]   # store p-value to p[i]&lt;br /&gt;
      add[i,] &amp;lt;- r[1:3] # store additional variables to add[i,]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  return(list(p=p,add=add,cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
As described in the comment, you may assume that the following variables are available for use for testing association across m markers&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker&lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (m * 1 vector) : p-value matrix as output&lt;br /&gt;
* add (m * c matrix) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# AC : Non-ref allele count&lt;br /&gt;
# CALLRATE : Call rate = NS/n&lt;br /&gt;
# MAF : Minor allele frequency&lt;br /&gt;
# PVALUE : P-values&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
Below is an example of a gene-lvel variant test implementation ( single.q.lm.R )&lt;br /&gt;
&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## GENE-LEVEL BURDEN TEST&lt;br /&gt;
 ## INPUT VARIABLES: &lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   genos    : genotype matrix for each gene&lt;br /&gt;
 ##   NS       : number of called samples for each marker&lt;br /&gt;
 ##   AC       : allele count for each marker&lt;br /&gt;
 ##   MAC      : minor allele count for each marker&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:n after AF/AC threshold&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional column values&lt;br /&gt;
 ##   cname    : additional column names&lt;br /&gt;
 ##################################################################      &lt;br /&gt;
 &lt;br /&gt;
 ## gene.q.reverse() : Reverse logistic regression&lt;br /&gt;
 ## KEY FEATURES : 0/1 collapsing variable ~ rare variants&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE (GAUSSIAN)&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, ZSTAT&lt;br /&gt;
 ## MISSING VALUE : IMPUTED AS MAJOR ALLELES&lt;br /&gt;
 gene.q.reverse &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;ZSTAT&amp;quot;)&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
     g &amp;lt;- as.double(colSums(genos,na.rm=T) &amp;gt; 0)&lt;br /&gt;
     sg &amp;lt;- sum(g)&lt;br /&gt;
     if ( ( sg &amp;gt; 0 ) &amp;amp;&amp;amp; ( sg &amp;lt; n ) ) {&lt;br /&gt;
       r &amp;lt;- glm(g~pheno+cov-1,family=binomial)&lt;br /&gt;
        if ( ( r$converged ) &amp;amp;&amp;amp; ( ! r$boundary ) ) {&lt;br /&gt;
         return(list(p=summary(r)$coefficients[1,4],&lt;br /&gt;
                     add=summary(r)$coefficients[1,1:3],&lt;br /&gt;
                     cname=cname))&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   return(list(p=NA,add=rep(NA,3),cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Similar to gene-level test, you may assume the following variables exist for testing A SINGLE GENE. Note that M is the number of markers spanning the gene region&lt;br /&gt;
&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker &lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAC (M * 1 vector) : Minor allele count&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (scalar) : p-value matrix as output&lt;br /&gt;
* add (c * 1 vector) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# MAF_BURDEN : MAF of 0/1 collapsing variables (existence of rare variants)&lt;br /&gt;
# NUM_ALL_VARS : Number of all variants within the gene&lt;br /&gt;
# NUM_RARE_VARS : Number of rare variants below the max-MAF threshold&lt;br /&gt;
# NUM_SING_VARS : Number of singleton variants&lt;br /&gt;
# PVALUE : P-value from the test&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
== Full ChangeLog ==&lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs&lt;br /&gt;
** Some known bugs still exist &lt;br /&gt;
*** SKAT-O Lambda eigenvalue error. This happenes in a particular context but haven&#039;t nailed down a way to prevent it yet.&lt;br /&gt;
*** EMMAX has case and control frequency flipped.&lt;br /&gt;
* EMMAX test has a silly known bug with case / ctrl frequency is flipped&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
* February 28th, 2013 : EPACTS v3.2.0 release&lt;br /&gt;
** R package installation bug (for some users) was fixed&lt;br /&gt;
** A bug in the MAF error for high frequency variants (AF&amp;gt;0.25) was now fixed&lt;br /&gt;
** SKAT version is updated to 0.81&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
* December 4th, 2012 : EPACTS v3.1.0 release&lt;br /&gt;
** Removed dependency on libR.so&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** November 25th, 2012 : EPACTS v3.0.0 release&lt;br /&gt;
** Restructured with source code release (with autoconf / automake / libtools)&lt;br /&gt;
** Added zoom plot feature&lt;br /&gt;
** FRAC_BURDEN keyword was replace to FRAC_WITH_RARE for groupwise testing&lt;br /&gt;
* October 26th, 2012 : EPACTS v2.2.0-beta is released with the following updates&lt;br /&gt;
** Added --max-mac option&lt;br /&gt;
** Fixed Firth&#039;s bias-corrected test (by Clement Ma)&lt;br /&gt;
** Added more informative warning messages when index files do not exist&lt;br /&gt;
** Fixed the bug in the epacts-plot in plotting ties&lt;br /&gt;
** Fixed errors in the MAF estimates per case and control&lt;br /&gt;
** Fixed bug in --minRSQ option&lt;br /&gt;
* September 28, 2012 : EPACTS v2.11-beta is released with the following updates&lt;br /&gt;
** Counts and allele frequencies for case/control added for binary tests&lt;br /&gt;
** --max-maf parameter is added&lt;br /&gt;
** Fixed EMMAX error in MAF in the output&lt;br /&gt;
** More informative error messages &lt;br /&gt;
* September 27, 2012 : EPACTS v2.1-beta is released with the following updates&lt;br /&gt;
** EMMAX interface is changed. --kinOnly option is related with a new command &#039;&#039;&#039;make-kin&#039;&#039;&#039; &lt;br /&gt;
** SKAT-O is upgraded to version 0.77 with additional configurable parameter settings&lt;br /&gt;
** Some parameter names are renamed (e.g. --min-maf, --min-mac)&lt;br /&gt;
** Many minor bugs are fixed&lt;br /&gt;
* Jul 6, 2012 : EPACTS v2.01-beta is released with the following updates&lt;br /&gt;
** SKAT-O is upgraded to version 0.76&lt;br /&gt;
** Fixed minor bugs in option names (Thanks to Xueling Sim)&lt;br /&gt;
* Jul 3, 2012 : EPACTS v2.0-beta is released with the following updates&lt;br /&gt;
** Major restructuring of the software&lt;br /&gt;
** Annotation software is switched with built-in application&lt;br /&gt;
** Addition of SKAT-O and EMMAX burden test&lt;br /&gt;
** Minor bug fixes&lt;br /&gt;
* Apr 8, 2012 : EPACTS v1.2-alpha is released with the following updates, in addition to the following updates&lt;br /&gt;
** EMMAX bug in handling covariates was fixed&lt;br /&gt;
** Variable Threshold Test is added&lt;br /&gt;
** Variable Threshold Test with genomic score (e.g. GERP or PhyloP) is added.&lt;br /&gt;
* Apr 4, 2012 : EPACTS v1.1-alpha is released with the following updates, in addition to minor updates&lt;br /&gt;
** EMMAX burden test (Hyun Min Kang)&lt;br /&gt;
** Likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of Firth bias-corrected likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of EMMAX single variant test (Hyun Min Kang) &lt;br /&gt;
* Mar 29, 2012 : EPACTS v1.0-alpha is released&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14159</id>
		<title>EPACTS</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=EPACTS&amp;diff=14159"/>
		<updated>2016-05-01T17:21:57Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Single Variant Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;EPACTS&#039;&#039;&#039; (Efficient and Parallelizable Association Container Toolbox) is a versatile software pipeline to perform various statistical tests for identifying genome-wide association from sequence data through a user-friendly interface, both to scientific analysts and to method developers.&lt;br /&gt;
&lt;br /&gt;
== Join in EPACTS mailing list ==&lt;br /&gt;
&lt;br /&gt;
Please join in the [http://groups.google.com/group/epacts EPACTS Google Group] to ask / discuss / comment about EPACTS.&lt;br /&gt;
&lt;br /&gt;
== Lastest ChangeLog ==&lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs (more comprehensive fix is still pending)&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
See [[#Full ChangeLog]] for full details&lt;br /&gt;
&lt;br /&gt;
== Key Features ==&lt;br /&gt;
&lt;br /&gt;
EPACTS currently provides the following set of key features&lt;br /&gt;
* Robust support for widely used format of sequence-based genotypes (VCF) and phenotypes with pedigree (PED)&lt;br /&gt;
** Efficient library for accessing VCF file to reduce computational burden to analyze large-scale sequencing data&lt;br /&gt;
** Support selecting markers by arbitrary combination of substring matching. &lt;br /&gt;
** Support for using genotype dosages instead of hard genotype calls&lt;br /&gt;
** Utilize PED format to perform test across multiple traits.&lt;br /&gt;
* Supports a large number of widely used statistical tests for single variant association and burden tests.&lt;br /&gt;
** See the &amp;quot;Currently Supported Statistical Tests&amp;quot; section below for more information&lt;br /&gt;
* Easy to Highly Parallelize Jobs&lt;br /&gt;
** Makefile-based partition into and ligation of multiple subtasks&lt;br /&gt;
** Parallel run of job is simply adding one parameter when running EPACTS &lt;br /&gt;
* Integrative and versatile framework that allows easy addition of additional statistical test&lt;br /&gt;
** Core input/output routines are implemented in C++&lt;br /&gt;
** Most statistical tests (except for EMMAX) are implemented in R&lt;br /&gt;
** Adding a simple R function to implement additional statistical test (See [[#Implementing Additional Statistical Tests]] for details)&lt;br /&gt;
* Useful utilities for post-association-analysis tasks&lt;br /&gt;
** Automatic functional annotation of associated variants&lt;br /&gt;
** Automatic generation of QQ and Manhattan Plot&lt;br /&gt;
** (TBA) Zoom plot for the significant associations&lt;br /&gt;
&lt;br /&gt;
== Obtaining EPACTS ==&lt;br /&gt;
&lt;br /&gt;
* The official release of EPACTS software is available at http://www.sph.umich.edu/csg/kang/epacts/ . &lt;br /&gt;
** From the CSG cluster, it is available at /net/fantasia/home/bin/epacts/&lt;br /&gt;
* Note that R (version 2.10 or higher) and gnuplot (version 4.2 or higher) must be installed in order to run EPACTS correctly.&lt;br /&gt;
&lt;br /&gt;
== Currently Supported Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
EPACTS supports the following sets of widely used statistical tests for single variant tests and burden tests&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.wald &lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logisitic Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (simply used glm in R)&lt;br /&gt;
|-&lt;br /&gt;
| b.score&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Logistic Score Test &amp;lt;br&amp;gt; (from Lin DY and Tang ZZ, AJHG 2011 89:354-67)&lt;br /&gt;
| Clement Ma &amp;amp; Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.firth&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Firth Bias-Corrected Logistic Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.lrt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Likelihood Ratio Test &lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| b.glrt&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Fast&lt;br /&gt;
| Genotype Likelihood Ratio Test &amp;lt;br&amp;gt; (use GL or PL field in VCF to perform case-control test)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.lm&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Linear Wald Test &lt;br /&gt;
| Hyun Min Kang &amp;lt;br&amp;gt; (as implemented in lm in R)&lt;br /&gt;
|-&lt;br /&gt;
| q.linear&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Quantitative Score Test &amp;lt;br&amp;gt; (from Lin DY and Tang ZZ, AJHG 2011 89:354-67)&lt;br /&gt;
| Clement Ma&lt;br /&gt;
|-&lt;br /&gt;
| q.linear&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out)&lt;br /&gt;
| Fast&lt;br /&gt;
| Linear Wald Test&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression &amp;lt;br&amp;gt; of phenotypes on binary genotypes (dominant model)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.emmax&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| EMMAX &amp;lt;br&amp;gt; ( Kang et al (2010) Nat Genet 42:348-54 )&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise tests ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{|&amp;lt;/noinclude&amp;gt; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%; clear: center;&amp;quot;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Test Name&lt;br /&gt;
! Phenotypes&lt;br /&gt;
! Covariates&lt;br /&gt;
! Computational Time&lt;br /&gt;
! Description&lt;br /&gt;
| Implemented by&lt;br /&gt;
|- &lt;br /&gt;
| b.collapse&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and 0/1 collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.madsen&lt;br /&gt;
| Binary&lt;br /&gt;
| NO&lt;br /&gt;
| Slow&lt;br /&gt;
| Wilcoxon Rank Sum Test between binary phenotypes and weighted rare variant scores (slightly different version from the published method - it uses pooled allele frequency across cases and controls for weighting each variant)&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| b.wcnt&lt;br /&gt;
| Binary&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Logistic Wald Test between binary phenotypes and weighted rare variant scores&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.reverse&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| Reverse regression of phenotypes on binary collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| q.wilcox&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Nonparametric Reverse regression of phenotypes on collapsed variables&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| skat&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Joint Estimation)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT-O Test by Lee et al, Biostatistics (2012)&lt;br /&gt;
| Seunggeun Lee &amp;lt;br&amp;gt; (adaptive by Xueling Sim and Hyun Min Kang)&lt;br /&gt;
|-&lt;br /&gt;
| VT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed out first)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable Threshold Test &amp;lt;br&amp;gt; with adaptive permutation &amp;lt;br&amp;gt; Price et al, AJHG (2010) 86:832-8&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxCMC&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Collapsing burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| emmaxVT&lt;br /&gt;
| Binary/Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| Variable-threshold burden test using EMMAX&lt;br /&gt;
| Hyun Min Kang&lt;br /&gt;
|-&lt;br /&gt;
| mmskat&lt;br /&gt;
| Quantitative&lt;br /&gt;
| YES &amp;lt;br&amp;gt; (Regressed Out First)&lt;br /&gt;
| Slow&lt;br /&gt;
| SKAT test using EMMAX&lt;br /&gt;
| Seunggeun Lee &amp;amp; Hyun Min Kang&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Installation Details  ==&lt;br /&gt;
&lt;br /&gt;
If you want to use EPACTS in an Ubuntu platform, following the step below &lt;br /&gt;
&lt;br /&gt;
*Download EPACTS source distribution at http://www.sph.umich.edu/csg/kang/epacts/download/EPACTS-3.2.6.tar.gz (165MB) &lt;br /&gt;
*Uncompress EPACTS package, and install the package using the following set of commands&lt;br /&gt;
* Visit http://www.sph.umich.edu/csg/kang/epacts/download for checking previous versions&lt;br /&gt;
&lt;br /&gt;
  tar xzvf EPACTS-3.2.6.tar.gz&lt;br /&gt;
  cd EPACTS-3.2.6&lt;br /&gt;
  ./configure --prefix=/path/to/install&lt;br /&gt;
  make&lt;br /&gt;
  make install&lt;br /&gt;
&lt;br /&gt;
(Important Note: &#039;&#039;&#039;make sure to specify --prefix=/path/to/install&#039;&#039;&#039; to avoid installing to the default path /usr/local/, which you may not have the permission. /home/your_userid/epacts might be a good one, if you are not sure where to install)&lt;br /&gt;
  &lt;br /&gt;
* Now ${EPACTS_DIR} represents the &#039;/path/to/install&#039; directory&lt;br /&gt;
&lt;br /&gt;
* Download the reference FASTA files from 1000 Genomes FTP automatically by running the following commands&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/epacts download&lt;br /&gt;
&lt;br /&gt;
 (For advanced users, to save time for downloading the FASTA files (~900MB), you may copy a local copy of GRCh37 FASTA file and the index file to ${EPACTS_DIR}/share/EPACTS/)&lt;br /&gt;
&lt;br /&gt;
*Perform a test run by running the following command&lt;br /&gt;
&lt;br /&gt;
  ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
&lt;br /&gt;
In order to use EPACTS in the CSG cluster, you do not need to install them. You can directly use or make a copy of the in-house release version at &lt;br /&gt;
&lt;br /&gt;
 /net/fantasia/home/hmkang/bin/epacts/&lt;br /&gt;
&lt;br /&gt;
== Getting Started With Examples ==&lt;br /&gt;
If you are using EPACTS from the CSG cluster, please set the following environment variable&lt;br /&gt;
 EPACTS_DIR=/net/fantasia/home/hmkang/bin/epacts (in bash)&lt;br /&gt;
 setenv EPACTS_DIR /net/fantasia/home/hmkang/bin/epacts (in csh)&lt;br /&gt;
&lt;br /&gt;
If you downloaded EPACTS binary and please set EPACTS_DIR to the full path of the downloaded and uncompressed directory.&lt;br /&gt;
&lt;br /&gt;
=== All-in-one example ===&lt;br /&gt;
&lt;br /&gt;
To get started with EPACTS, run the following command will perform an example run&lt;br /&gt;
 ${EPACTS_DIR}/bin/test_run_epacts.sh&lt;br /&gt;
 &lt;br /&gt;
You will find a series of lines in test_run_epacts.sh script commented out for each possible test. &lt;br /&gt;
&lt;br /&gt;
The example phenotype (PED format) and genotype (VCF format) can be found at&lt;br /&gt;
 ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
&lt;br /&gt;
=== Single Variant Test ===&lt;br /&gt;
&lt;br /&gt;
Or You can run EPACTS command yourself by running&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
   --vcf  ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
   --ped  ${EPACTS_DIR}/data/1000G_dummy_pheno.ped  \&lt;br /&gt;
   --min-maf 0.001 --chr 20 --pheno DISEASE --cov AGE --cov SEX --test b.score --anno \ &lt;br /&gt;
   --out out/test --run 2&lt;br /&gt;
&lt;br /&gt;
The command above will perform single variant association test using a dummy case-control phenotype file and a subset of 1000 genomes exome VCF file (chr20) using score test statistic for all variants over 1% of higher MAF using 2 parallel runs.&lt;br /&gt;
&lt;br /&gt;
You will see the 4 output files as the main outcome of the analysis&lt;br /&gt;
&lt;br /&gt;
==== Output Text of All Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The filename is out/test.single.b.score.epacts.gz and the contents will look like&lt;br /&gt;
 $ zcat out/test.single.b.score.epacts.gz | head&lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	68303	68303	20:68303_A/G_Upstream:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68319	68319	20:68319_C/A_Upstream:DEFB125	266	1.4467e-36	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	68396	68396	20:68396_C/T_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76635	76635	20:76635_A/T_Intron:DEFB125	266	1.534e-37	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76689	76689	20:76689_T/C_Synonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76690	76690	20:76690_T/C_Nonsynonymous:DEFB125	266	1	1	0.0018797	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76700	76700	20:76700_G/A_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76726	76726	20:76726_C/G_Nonsynonymous:DEFB125	266	0	1	0	NA	NA	NA	NA	NA	NA&lt;br /&gt;
 20	76771	76771	20:76771_C/T_Nonsynonymous:DEFB125	266	3	1	0.0056391	0.68484	0.40587	145	121	0.013793	0.0082645&lt;br /&gt;
&lt;br /&gt;
==== Output Text of Top Associations ====&lt;br /&gt;
&lt;br /&gt;
Same type of file but containing top 5,000 association will be stored at out/test.epacts.top5000&lt;br /&gt;
&lt;br /&gt;
 $ head out/test.single.b.score.epacts.top5000 &lt;br /&gt;
 #CHROM	BEGIN	END	MARKER_ID	NS	AC	CALLRATE	MAF	PVALUE	SCORE	N.CASE	N.CTRL	AF.CASE	AF.CTRL&lt;br /&gt;
 20	1610894	1610894	20:1610894_G/A_Synonymous:SIRPG	266	138.64	1	0.26061	6.9939e-05	3.9765	145	121	0.65177	0.36476&lt;br /&gt;
 20	4162411	4162411	20:4162411_T/C_Intron:SMOX	266	204	1	0.38346	0.00055583	-3.4523	145	121	0.62759	0.93388&lt;br /&gt;
 20	34061918	34061918	20:34061918_T/C_Intron:CEP250	266	41.815	1	0.0786	0.00095471	3.3035	145	121	0.22543	0.075436&lt;br /&gt;
 20	4155948	4155948	20:4155948_G/A_Intron:SMOX	266	215	1	0.40414	0.0020792	-3.0787	145	121	0.68276	0.95868&lt;br /&gt;
 20	4680251	4680251	20:4680251_A/G_Nonsynonymous:PRNP	266	186	1	0.34962	0.0025962	3.0119	145	121	0.8069	0.57025&lt;br /&gt;
 20	36668874	36668874	20:36668874_G/A_Synonymous:RPRD1B	266	96	1	0.18045	0.003031	2.9646	145	121	0.44828	0.2562&lt;br /&gt;
 20	36641871	36641871	20:36641871_G/A_Synonymous:TTI1	266	10	1	0.018797	0.004308	-2.8547	145	121	0.0068966	0.07438&lt;br /&gt;
 20	1616892	1616892	20:1616892_A/G_Synonymous:SIRPG	266	144	1	0.27068	0.0051239	2.7991	145	121	0.63449	0.42975&lt;br /&gt;
 20	25038372	25038372	20:25038372_G/A_Intron:ACSS1	266	103.3	1	0.19418	0.005748	2.7618	145	121	0.47201	0.28813&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;AC&#039;&#039;&#039; : Total Non-reference Allele Count&lt;br /&gt;
* &#039;&#039;&#039;CALLRATE&#039;&#039;&#039; : Fraction of non-missing genotypes.&lt;br /&gt;
* &#039;&#039;&#039;MAF&#039;&#039;&#039; : Minor allele frequencies&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of single variant test&lt;br /&gt;
* &#039;&#039;&#039;AF.CASE&#039;&#039;&#039; : Non-reference allele frequencies for cases&lt;br /&gt;
* &#039;&#039;&#039;AF.CTRL&#039;&#039;&#039; : Non-reference allele frequencies for controls&lt;br /&gt;
&lt;br /&gt;
==== Q-Q plot of test statistics (stratified by MAF) ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.qq.pdf will be generated as shown below&lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_qq.png]]&lt;br /&gt;
&lt;br /&gt;
==== Manhattan Plot of Test Statistics ====&lt;br /&gt;
&lt;br /&gt;
The file out/test.b.score.epacts.mh.pdf will be generated for chr20 only. &lt;br /&gt;
&lt;br /&gt;
[[File:test_b_score_epacts_mh.png]]&lt;br /&gt;
&lt;br /&gt;
An example Genome-wide manhattan plot (from a genome-wide run) will look like below&lt;br /&gt;
&lt;br /&gt;
[[File:tes_b_score_epacts_mh_gw.png]]&lt;br /&gt;
&lt;br /&gt;
=== Gene-wise or group-wise burden test ===&lt;br /&gt;
&lt;br /&gt;
Gene-wise or group-wise burden test requires two steps. First, &#039;group&#039; file containing the list of &lt;br /&gt;
markers per group needs to be generated. Second, group-wise burden test needs to be run&lt;br /&gt;
&lt;br /&gt;
==== Creating marker group file ====&lt;br /&gt;
&lt;br /&gt;
The marker group file has the following format&lt;br /&gt;
&lt;br /&gt;
 [GROUP_ID]  [MARKER_ID_1]   [MARKER_ID_2]  .... [MARKER_ID_N]&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
* [GROUP_ID] is a string representing the group (e.g. gene name)&lt;br /&gt;
* [MARKER_ID_K] is a marker key as a format of [CHROM]:[POS]_[REF]/[ALT] (NOTE THAT THIS IS DIFFERENT FROM TYPICAL VCF MARKER ID field)&lt;br /&gt;
&lt;br /&gt;
Note that [MARKER_ID_K] has to be sorted by increasing order of genomic coordinate&lt;br /&gt;
&lt;br /&gt;
In order to create gene-level group file from typically formatted VCF file, one may use the following utility &lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --nonsyn&lt;br /&gt;
&lt;br /&gt;
The above command create a file [output-group-file] containing a list of missense and nonsense variants per each gene. To incorporate different types of functional annotations, use --type option as follows&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-group --vcf [input-vcf] --out [output-group-file] --format [epacts, annovar, chaos or gatk] --type [function_type_1] --type [function_type_2] ...&lt;br /&gt;
&lt;br /&gt;
Type &#039;epacts makegroup -man&#039; for the detailed documentation&lt;br /&gt;
&lt;br /&gt;
==== Annotating VCF file using EPACTS ====&lt;br /&gt;
&lt;br /&gt;
If the VCF is not annotated, &#039;epacts makegroup&#039; cannot be used. In order to annotate VCF, one can use the example VCF using ANNOVAR as follows:&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts anno \&lt;br /&gt;
    --in ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.vcf.gz \&lt;br /&gt;
    --out ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
The epacts anno script will add &amp;quot;ANNO=[function]:[genename]&amp;quot; entry into the INFO field based on gencodeV7 (default) or refGene database.&lt;br /&gt;
&lt;br /&gt;
It is important to check whether the VCF file is already annotated or not in order to avoid no or redundant annotation.&lt;br /&gt;
&lt;br /&gt;
==== Running Groupwise Test ====&lt;br /&gt;
&lt;br /&gt;
To perform a groupwise burden test on the example VCF (annotated as above), run the following command&lt;br /&gt;
&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --vcf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.vcf.gz \&lt;br /&gt;
   --groupf ${EPACTS_DIR}/data/1000G_exome_chr20_example_softFiltered.calls.anno.grp --out out/test.gene.skat \&lt;br /&gt;
   --ped ${EPACTS_DIR}/data/1000G_dummy_pheno.ped --maxAF 0.05 \&lt;br /&gt;
   --chr 20 --pheno QT --cov AGE --cov SEX --test skat --skat-o --run 2&lt;br /&gt;
&lt;br /&gt;
==== Example Output ====&lt;br /&gt;
 $ head out/test.gene.skat.epacts.top5000&lt;br /&gt;
 #CHROM BEGIN   END     MARKER_ID       NS      FRAC_WITH_RARE     NUM_ALL_VARS    NUM_PASS_VARS   NUM_SING_VARS   PVALUE  STATRHO&lt;br /&gt;
 20     62607037        62608720        20:62607037-62608720_SAMD10     266     0.14662 9       5       1       0.0020064       1&lt;br /&gt;
 20     2816211 2820493 20:2816211-2820493_FAM113A      266     0.011278        12      2       1       0.0032542       0&lt;br /&gt;
 20     47245987        47361692        20:47245987-47361692_PREX1      266     0.1391  54      9       6       0.0054849       1&lt;br /&gt;
 20     34761734        34810279        20:34761734-34810279_EPB41L1    266     0.071429        14      7       5       0.0068492       0.2&lt;br /&gt;
 20     61340671        61391602        20:61340671-61391602_NTSR1      266     0.11278 24      9       3       0.011063        1&lt;br /&gt;
 20     48561952        48568644        20:48561952-48568644_RNF114     266     0.011278        4       2       1       0.015175        0.2&lt;br /&gt;
 20     60962895        60963559        20:60962895-60963559_RPS21      266     0.06015 6       3       2       0.016409        0&lt;br /&gt;
 20     55904961        55917801        20:55904961-55917801_SPO11      266     0.011278        11      3       3       0.018031        0&lt;br /&gt;
&lt;br /&gt;
The key columns represents:&lt;br /&gt;
* &#039;&#039;&#039;NS&#039;&#039;&#039; : Number of phenotyped samples with non-missing genotypes &lt;br /&gt;
* &#039;&#039;&#039;FRAC_WITH_RARE&#039;&#039;&#039; : Fraction of individual carrying rare variants below --max-maf (default : 0.05) threshold.&lt;br /&gt;
* &#039;&#039;&#039;NUM_ALL_VARS&#039;&#039;&#039; : Number of all variants defining the group.&lt;br /&gt;
* &#039;&#039;&#039;NUM_PASS_VARS&#039;&#039;&#039; : Number of variants passing the --min-maf, --min-mac, --max-maf, --min-callrate thresholds&lt;br /&gt;
* &#039;&#039;&#039;NUM_SING_VARS&#039;&#039;&#039; : Number of singletons among variants in NUM_PASS_VARS&lt;br /&gt;
* &#039;&#039;&#039;PVALUE&#039;&#039;&#039; : P-value of burden tests&lt;br /&gt;
* Other columns are test specific auxiliary columns. For example, in the VT test, the optimal MAF threshold is recorded as an auxiliary output column.&lt;br /&gt;
&lt;br /&gt;
=== Specialized Instruction for EMMAX tests ===&lt;br /&gt;
&lt;br /&gt;
EMMAX (Efficient Mixed Model Association eXpedited - Kang et al (2010) Nat Genet 42:348-54) is an efficient implementation of mixed model association accounting for sample structure including population structure and hidden relatedness. Currently EPACTS supports EMMAX association mapping in single variant test and CMC-like burden tests. &lt;br /&gt;
&lt;br /&gt;
Because EMMAX is based on linear model, the method fits better to quantiative traits than binary traits. However, p-values for binary traits are expected to be valid in the spirit of Armitage trend test, although the estimated effect size may not be precise.&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
==== Single Variant EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : From VCF, we recommend to set a MAF (e.g. 0.01) and call rate (e.g. 0.95) threshold to select high-quality markers to generate kinship matrix as follows.&lt;br /&gt;
 ${EPACTS_DIR}/epacts make-kin \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped (Optional)] --min-maf 0.01 --minCallRate 0.95 \&lt;br /&gt;
  --sepchr (if VCF is separated by chromosome) --out [outprefix.kinf] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
If you provide [input.ped] file, then it will calculate the subset the individuals contained in the PED file. &lt;br /&gt;
&lt;br /&gt;
The procedure above will create a file [outprefix.kinf] after splitting and merging the genomes into multiple pieces. If only a certain subset of SNPs needs to be considered due to target regions, LD-pruning, or any other reasons, a VCF containing the subset of markers must be created beforehand and should be used as input VCF file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Perform Single Variant Association&#039;&#039;&#039; : From VCF and PED, we recommend to use less stringent MAF threshold (e.g. 0.001) and call rate (e.g. 0.50) to perform single variant association&lt;br /&gt;
 ${EPACTS_DIR}/epacts single \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --min-maf 0.001 --kin [outputprefix.kinf] \&lt;br /&gt;
  --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] --test q.emmax \&lt;br /&gt;
  --out [outprefix] --run [# of parallel jobs]&lt;br /&gt;
&lt;br /&gt;
The procedure above will perform single variant association analysis compatible to other types of single variant association analyses implemented in EPACTS&lt;br /&gt;
&lt;br /&gt;
==== Burden-style EMMAX Association Analysis ====&lt;br /&gt;
&lt;br /&gt;
In order to run EMMAX analysis from sequence-based genotypes. We recommend running EPACTS multiple times using the following procedure.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Creating Kinship Matrix&#039;&#039;&#039; : See &#039;Creating Kinship Matrix&#039; section in [[#Single Variant EMMAX Association Analysis]]&lt;br /&gt;
* &#039;&#039;&#039;Create Marker Group&#039;&#039;&#039;&lt;br /&gt;
** By annotating the VCF and extracting missense and nonsense variants&lt;br /&gt;
*** [[#Annotating VCF file using ANNOVAR]] - This step will be required to create marker group file&lt;br /&gt;
*** [[#Creating marker group file]] - Assume that [group.grp] file is produced&lt;br /&gt;
** Or, by creating your own marker group information&lt;br /&gt;
*** See [[#Creating marker group file]] for details&lt;br /&gt;
* Run CMC-style burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxCMC --out [outprefix] &lt;br /&gt;
* Run Variable Threshold burden test by&lt;br /&gt;
 ${EPACTS_DIR}/epacts group --groupf [group.grp] \&lt;br /&gt;
  --vcf [input.vcf.gz] --ped  [input.ped] --max-maf [max-MAF-for-rare-variants] \&lt;br /&gt;
  --kin [outputprefix.kinf] --sepchr --pheno [PHENO_NAME] --cov [COV1] --cov [COV2] \&lt;br /&gt;
  --test emmaxVT --out [outprefix]&lt;br /&gt;
&lt;br /&gt;
== Preparing Your Own Input Data ==&lt;br /&gt;
&lt;br /&gt;
=== VCF file for Genotypes ===&lt;br /&gt;
&lt;br /&gt;
EPACTS support VCF files as input for association with the following requirement&lt;br /&gt;
* Input VCF file must be bgzipped and tabixed before running association to allow efficient random access of the file. Below is an example command to conver plain VCF into bgzipped and tabixed VCF&lt;br /&gt;
  bgzip input.vcf     ## this command will produce input.vcf.gz&lt;br /&gt;
  tabix -pvcf -f input.vcf.gz  ## this command will produce input.vcf.gz.tbi&lt;br /&gt;
* If the VCF file is separated by chromosome, the VCF file specified in the input argument must contain the string &amp;quot;chr1&amp;quot; in the chromosome 1 file, and corresponding chromosome name for other chromosomes. Thus, the files names should be like &amp;lt;code&amp;gt;[prefix]chr1[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chr2[suffix].vcf.gz&amp;lt;/code&amp;gt;, ..., &amp;lt;code&amp;gt;[prefix]chr22[suffix].vcf.gz&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[prefix]chrX[suffix].vcf.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Sample IDs in the VCF file must be consistent to those from PED file&lt;br /&gt;
* Currently EPACTS only support bi-allelic variants, but it handles SNPs, INDELs, snd SVs.&lt;br /&gt;
* Currently, EPACTS only support VCF aligned with NCBI build 37 coordinates&lt;br /&gt;
* An example VCF file from 1000 genome project is below. &lt;br /&gt;
 $ zcat example/1000G_integrated_phase1_chr20.vcf.gz | cut -f 1-10 | head -50 &lt;br /&gt;
 ##fileformat=VCFv4.1&lt;br /&gt;
 ##INFO=&amp;lt;ID=LCSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Low coverage VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=EXSNP,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in Exome VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=INDEL,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in INDEL VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SV,Number=0,Type=Flag,Description=&amp;quot;Genotype likelihood in SV VCF in data integration&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BAVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=BRSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality estimate from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=LDAF,Number=1,Type=Float,Description=&amp;quot;MLE Allele Frequency Accounting for LD&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AVGPOST,Number=1,Type=Float,Description=&amp;quot;Average posterior probability from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=RSQ,Number=1,Type=Float,Description=&amp;quot;Genotype imputation quality from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=ERATE,Number=1,Type=Float,Description=&amp;quot;Per-marker Mutation rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=THETA,Number=1,Type=Float,Description=&amp;quot;Per-marker Transition rate from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIEND,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around END for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=CIPOS,Number=2,Type=Integer,Description=&amp;quot;Confidence interval around POS for imprecise variants&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=END,Number=1,Type=Integer,Description=&amp;quot;End position of the variant described in this record&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMLEN,Number=.,Type=Integer,Description=&amp;quot;Length of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=HOMSEQ,Number=.,Type=String,Description=&amp;quot;Sequence of base pair identical micro-homology at event breakpoints&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SOURCE,Number=.,Type=String,Description=&amp;quot;Source of deletion call&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVLEN,Number=1,Type=Integer,Description=&amp;quot;Difference in length between REF and ALT alleles&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=SVTYPE,Number=1,Type=String,Description=&amp;quot;Type of structural variant&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AC,Number=.,Type=Integer,Description=&amp;quot;Alternate Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##INFO=&amp;lt;ID=AN,Number=1,Type=Integer,Description=&amp;quot;Total Allele Count&amp;quot;&amp;gt;&lt;br /&gt;
 ##ALT=&amp;lt;ID=DEL,Description=&amp;quot;Deletion&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GT,Number=1,Type=String,Description=&amp;quot;Genotype&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=DS,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from MaCH/Thunder&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=GL,Number=.,Type=Float,Description=&amp;quot;Genotype Likelihoods&amp;quot;&amp;gt;&lt;br /&gt;
 ##FORMAT=&amp;lt;ID=BD,Number=1,Type=Float,Description=&amp;quot;Genotype dosage from beagle&amp;quot;&amp;gt;&lt;br /&gt;
 #CHROM POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  HG00096&lt;br /&gt;
 20 60479   .   C   T   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.894;LDAF=0.0020;AVGPOST=0.9995;RSQ=0.8779;ERATE=0.0005;THETA=0.0008;AC=4;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.19,-0.46,-2.68:0.0022&lt;br /&gt;
 20 60522   .   T   TC  1588    PASS    INDEL;BAVGPOST=1.000;BRSQ=0.994;LDAF=0.0116;AVGPOST=0.9980;RSQ=0.9327;ERATE=0.0004;THETA=0.0167;AC=24;AN=2184   GT:DS:GL:BD 0|0:0.000:0.00,-0.90,-9.20:0&lt;br /&gt;
 20 60571   .   C   A   100 PASS    LCSNP;EXSNP;BAVGPOST=0.999;BRSQ=0.813;LDAF=0.0029;AVGPOST=0.9986;RSQ=0.8085;ERATE=0.0014;THETA=0.0014;AC=5;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.05,-0.96,-5.00:0.0008&lt;br /&gt;
 20 60795   .   G   C   100 PASS    LCSNP;EXSNP;BAVGPOST=1.000;BRSQ=0.930;LDAF=0.0006;AVGPOST=0.9996;RSQ=0.7205;ERATE=0.0003;THETA=0.0041;AC=1;AN=2184  GT:DS:GL:BD 0|0:0.000:-0.03,-1.21,-5.00:0.0001&lt;br /&gt;
 20 60810   .   G   GA  127 PASS    INDEL;BAVGPOST=1.000;BRSQ=0.862;LDAF=0.0013;AVGPOST=0.9987;RSQ=0.5684;ERATE=0.0004;THETA=0.0061;AC=2;AN=2184    GT:DS:GL:BD 0|0:0.000:0.00,-1.80,-18.80:0&lt;br /&gt;
&lt;br /&gt;
=== PED file for Phenotypes and Covariates ===&lt;br /&gt;
&lt;br /&gt;
EPACTS accepts a PED format supported by MERLIN or PLINK software to represent phenotypes. For example, the example.ped file and example.dat file can represent the phenotypes and corresponding column name (from 6th column and after). &lt;br /&gt;
&lt;br /&gt;
 $ head example.ped&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
 $ cat example.dat&lt;br /&gt;
 A DISEASE&lt;br /&gt;
 T QT&lt;br /&gt;
 T AGE&lt;br /&gt;
&lt;br /&gt;
EPACTS also accept a PED format with header information. The above file can be combined into one file as follows&lt;br /&gt;
&lt;br /&gt;
 $ head data/1000G_dummy_pheno.ped&lt;br /&gt;
 #FAM_ID    IND_ID  FAT_ID  MOT_ID  SEX DISEASE QT  AGE&lt;br /&gt;
 13281  NA12344 NA12347 NA12348 1   1   94.17   66.1&lt;br /&gt;
 13281  NA12347 0   0   1   1   109.54  44.0&lt;br /&gt;
 13281  NA12348 0   0   2   2   119.40  46.6&lt;br /&gt;
 1328   NA06984 0   0   1   2   87.72   39.3&lt;br /&gt;
 1328   NA06989 0   0   2   1   100.60  41.7&lt;br /&gt;
 1328   NA12329 NA06984 NA06989 2   1   100.85  46.4&lt;br /&gt;
 13291  NA06986 0   0   1   2   91.94   61.9&lt;br /&gt;
 13291  NA06995 NA07435 NA07037 1   2   104.36  57.4&lt;br /&gt;
 13291  NA06997 NA06986 NA07045 2   2   107.53  53.1&lt;br /&gt;
&lt;br /&gt;
The column names can be used to identify the names of phenotypes and covariates in the analysis.&lt;br /&gt;
&lt;br /&gt;
== Frequently Asked Questions ==&lt;br /&gt;
=== Installation ===&lt;br /&gt;
# How should I install EPACTS? &lt;br /&gt;
#* See [[EPACTS#Installation_Details | Installation Details]]&lt;br /&gt;
# I am having the following error message &#039;&#039;&#039;configure: error: libR.{so,a} was not found. Please install it at http://www.r-project.org/ first&#039;&#039;&#039;. What do I have to do?&lt;br /&gt;
#* First, you need to find out where R was installed. Try to type &amp;quot;locate libR.so&amp;quot; and see if it returns anything&lt;br /&gt;
#* If &amp;quot;locate libR.so&amp;quot; returns you something, as explained [[EPACTS#Installation_Details | Installation Details]], try to add &amp;quot;LDFLAGS=-L/path/to/R/library&amp;quot; and rerun &#039;&#039;&#039;configure&#039;&#039;&#039; and &#039;&#039;&#039;make&#039;&#039;&#039;&lt;br /&gt;
#* If you cannot find libR.so, you make have to recompile R with --enable-R-shlib option as described in http://cran.r-project.org/doc/manuals/R-admin.html#Installation&lt;br /&gt;
&lt;br /&gt;
=== Input Files ===&lt;br /&gt;
# What is VCF?&lt;br /&gt;
#* VCF refers to Variant Call Format&lt;br /&gt;
#* See [[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 1000 Genomes wiki page]] for the detailed description of VCF format&lt;br /&gt;
# Should input VCF be compressed into certain format?&lt;br /&gt;
#* Correct. EPACTS assumes that VCF file is bgzipped and tabixed already.&lt;br /&gt;
#* See [[#VCF file for Genotypes]] for details.&lt;br /&gt;
# What are the additional requirements for input VCF file?&lt;br /&gt;
#* Input VCF file used for association mapping must contain individual genotype information at 10-th or higher order columns.&lt;br /&gt;
#* GT field must be encoded as haploid or diploid&lt;br /&gt;
#* Bi-allelic SNPs only : Currently EPACTS may not handle multi-allelic SNPs correctly.&lt;br /&gt;
#* If non-GT field is used, the field is considered as dosage and should be a single numeric value.&lt;br /&gt;
# What are the acceptable input format to encode phenotypes and covariates?&lt;br /&gt;
#* See [[#PED file for Phenotypes and Covariates]] for the detailed information&lt;br /&gt;
# How should I encode binary phenotypes?&lt;br /&gt;
#* If you encode your phenotypes into two different numeric values (e.g. 0/1 or 1/2), EPACTS will automatically recognize them as binary phenotypes and encode them into 1/2 values. Higher value will be considered as cases for case-control association&lt;br /&gt;
# How should I encode missing genotypes?&lt;br /&gt;
#* The default code missing phenotypes in EPACTS are &#039;NA&#039;&lt;br /&gt;
#* One may use --missing option to specify different types of missing values&lt;br /&gt;
#* The encoding of missing genotypes follows the VCF specificiation&lt;br /&gt;
# How do I match the relationship between VCF and PED input files?&lt;br /&gt;
#* EPACTS will assume that the individual IDs in each VCF and PED file are unique, and they follow the saming convention. Thus, the individual IDs overlapping between VCF and PED files will be considered in the associations&lt;br /&gt;
# How the individuals with missing phenotypes are handled?&lt;br /&gt;
#* Currently, EPACTS will automatically remove the individuals without phenotypes or covariates. If one wants to use imputed covariates to increase sample size, the PED file must contain the imputed covariate values.&lt;br /&gt;
#* Markers with missing genotypes won&#039;t be discarded automatically. It can be explicitly discarded by --minCallRate option when performing association&lt;br /&gt;
&lt;br /&gt;
=== Output Files ===&lt;br /&gt;
# Which output files should I be looking at?&lt;br /&gt;
#* [[#Output Text of Top Associations]] is the key file to look at the individual top associations&lt;br /&gt;
#* [[#Q-Q plot of test statistics (stratified by MAF)]] will be important to see the global distribution of test statistics and examine if there are apparent inflation of test statistics&lt;br /&gt;
#* [[#Manhattan Plot of Test Statistics]] will inform us the genome-wide distribution of association signals&lt;br /&gt;
#* [[#Output Text of All Test Statistics]] will contain the full information of test results across all units tested&lt;br /&gt;
# The Q-Q and Manhattan plots cannot be found. Why?&lt;br /&gt;
#* It is probably because gnuplot 4.2 or higher is not installed in your system, or they are included but cannot be found in your ${PATH}. Please visit [[http://gnuplot.info/ GNUPLOT web page]] for installation.&lt;br /&gt;
# How can I read the EMMAX kinship file from produced from EPACTS?&lt;br /&gt;
# * You can run the following command to dump your kinship matrix into a human-readable text format.&lt;br /&gt;
 $(EPACTS_DIR)/bin/epacts/bin/pEmmax kin-util --kinf [input.kinf] --outf [output.prefix] --dump&lt;br /&gt;
&lt;br /&gt;
=== More questions ===&lt;br /&gt;
# If you have more questions, please contact [[mailto:hmkang@umich.edu Hyun Min Kang]].&lt;br /&gt;
&lt;br /&gt;
== Detailed Options ==&lt;br /&gt;
&lt;br /&gt;
The detailed options can viewed by running the following commands&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts -man           (for overall structure) &lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts single -man    (for single variant test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts group -man     (for groupwise test)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts anno -man      (for annotation)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts plot -man      (for QQ and Manhattan plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts zoom -man      (for zoom plot)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts meta -man      (for meta-analysis)&lt;br /&gt;
 ${EPACTS_DIR}/bin/epacts make-group -man (for creating gene group)&lt;br /&gt;
&lt;br /&gt;
== Implementing Additional Statistical Tests ==&lt;br /&gt;
&lt;br /&gt;
In order to add additional statistical test to EPACTS, the following procedure are recommended&lt;br /&gt;
&lt;br /&gt;
# Create a file named &#039;single.[testname].R&#039; for single variant test or &#039;gene.[testname].R&#039; for gene-level test under ${EPACTS_DIR}/share/EPACTS/&lt;br /&gt;
# Test your implementation using --test [testname] option to perform sanity check and debugging&lt;br /&gt;
# If you want to add your test in the official in-house version, please send your code to Hyun&lt;br /&gt;
&lt;br /&gt;
Below is an example of a single variant test implementation ( single.q.lm.R )&lt;br /&gt;
 ## Core functions of EPACTS to perform association&lt;br /&gt;
 &lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## SINGLE VARIANT TEST&lt;br /&gt;
 ## INPUT VARIABLES:&lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   NS       : number of called samples&lt;br /&gt;
 ##   AC       : allele count&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:nrow(NS) after AF/AC threshold&lt;br /&gt;
 ##   genos    : genotype matrix (after AF/AC threshold)&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional columns to add&lt;br /&gt;
 ##   cname    : column names for additional columns&lt;br /&gt;
 ##################################################################  &lt;br /&gt;
 &lt;br /&gt;
 ## single.lm() : Use built-in lm() function to perform association&lt;br /&gt;
 ## KEY FEATURES : SIMPLE, BUT MAY BE SLOW&lt;br /&gt;
 ##                GOOD SNIPPLET TO START A NEW FUNCTION&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, TSTAT&lt;br /&gt;
 ## MISSING VALUES : IGNORED&lt;br /&gt;
 single.q.lm &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;TSTAT&amp;quot;) # column names for additional variables in the EPACTS output&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   p &amp;lt;- rep(NA,m)&lt;br /&gt;
   add &amp;lt;- matrix(NA,m,3) ## BETA, SEBETA, TSTAT&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
    for(i in 1:m) {&lt;br /&gt;
      r &amp;lt;- summary(lm(pheno~genos[i,]+cov-1))$coefficients[1,]  # run simple linear regression&lt;br /&gt;
      p[i] &amp;lt;- r[4]   # store p-value to p[i]&lt;br /&gt;
      add[i,] &amp;lt;- r[1:3] # store additional variables to add[i,]&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  return(list(p=p,add=add,cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
As described in the comment, you may assume that the following variables are available for use for testing association across m markers&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker&lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (m * 1 vector) : p-value matrix as output&lt;br /&gt;
* add (m * c matrix) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# AC : Non-ref allele count&lt;br /&gt;
# CALLRATE : Call rate = NS/n&lt;br /&gt;
# MAF : Minor allele frequency&lt;br /&gt;
# PVALUE : P-values&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
Below is an example of a gene-lvel variant test implementation ( single.q.lm.R )&lt;br /&gt;
&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## GENE-LEVEL BURDEN TEST&lt;br /&gt;
 ## INPUT VARIABLES: &lt;br /&gt;
 ##   n        : total # of individuals&lt;br /&gt;
 ##   genos    : genotype matrix for each gene&lt;br /&gt;
 ##   NS       : number of called samples for each marker&lt;br /&gt;
 ##   AC       : allele count for each marker&lt;br /&gt;
 ##   MAC      : minor allele count for each marker&lt;br /&gt;
 ##   MAF      : minor allele frequency&lt;br /&gt;
 ##   vids     : indices from 1:n after AF/AC threshold&lt;br /&gt;
 ## EXPECTED OUTPUT : list(p, addcols, addnames) for each genos row&lt;br /&gt;
 ##   p        : p-value&lt;br /&gt;
 ##   add      : additional column values&lt;br /&gt;
 ##   cname    : additional column names&lt;br /&gt;
 ##################################################################      &lt;br /&gt;
 &lt;br /&gt;
 ## gene.q.reverse() : Reverse logistic regression&lt;br /&gt;
 ## KEY FEATURES : 0/1 collapsing variable ~ rare variants&lt;br /&gt;
 ## TRAITS  : QUANTITATIVE (GAUSSIAN)&lt;br /&gt;
 ## RETURNS : PVALUE, BETA, SEBETA, ZSTAT&lt;br /&gt;
 ## MISSING VALUE : IMPUTED AS MAJOR ALLELES&lt;br /&gt;
 gene.q.reverse &amp;lt;- function() {&lt;br /&gt;
   cname &amp;lt;- c(&amp;quot;BETA&amp;quot;,&amp;quot;SEBETA&amp;quot;,&amp;quot;ZSTAT&amp;quot;)&lt;br /&gt;
   m &amp;lt;- nrow(genos)&lt;br /&gt;
   if ( m &amp;gt; 0 ) {&lt;br /&gt;
     g &amp;lt;- as.double(colSums(genos,na.rm=T) &amp;gt; 0)&lt;br /&gt;
     sg &amp;lt;- sum(g)&lt;br /&gt;
     if ( ( sg &amp;gt; 0 ) &amp;amp;&amp;amp; ( sg &amp;lt; n ) ) {&lt;br /&gt;
       r &amp;lt;- glm(g~pheno+cov-1,family=binomial)&lt;br /&gt;
        if ( ( r$converged ) &amp;amp;&amp;amp; ( ! r$boundary ) ) {&lt;br /&gt;
         return(list(p=summary(r)$coefficients[1,4],&lt;br /&gt;
                     add=summary(r)$coefficients[1,1:3],&lt;br /&gt;
                     cname=cname))&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   return(list(p=NA,add=rep(NA,3),cname=cname))&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Similar to gene-level test, you may assume the following variables exist for testing A SINGLE GENE. Note that M is the number of markers spanning the gene region&lt;br /&gt;
&lt;br /&gt;
* n (scalar) : total number of individuals&lt;br /&gt;
* NS (M * 1 vector) : Number of called samples for each marker &lt;br /&gt;
* AC (M * 1 vector) : Non-reference allele count for each marker&lt;br /&gt;
* MAC (M * 1 vector) : Minor allele count&lt;br /&gt;
* MAF (M * 1 vector) : Minor allele frequency&lt;br /&gt;
* vids (m * 1 vector) : indices of markers passing the inclusion criteria (e.g. MAF threshold) among 1:M &lt;br /&gt;
* genos (m * n matrix) : genotype matrix as a input for association test&lt;br /&gt;
&lt;br /&gt;
The output variables to generate is as follows&lt;br /&gt;
* p (scalar) : p-value matrix as output&lt;br /&gt;
* add (c * 1 vector) : additional columns as output of test (such as SCORE, BETA, etc)&lt;br /&gt;
* cname (c * 1 vector) : column names of add&lt;br /&gt;
&lt;br /&gt;
In the output files, the following columns will be displayed&lt;br /&gt;
# MARKER : Marker ID&lt;br /&gt;
# NS : Number of called samples&lt;br /&gt;
# MAF_BURDEN : MAF of 0/1 collapsing variables (existence of rare variants)&lt;br /&gt;
# NUM_ALL_VARS : Number of all variants within the gene&lt;br /&gt;
# NUM_RARE_VARS : Number of rare variants below the max-MAF threshold&lt;br /&gt;
# NUM_SING_VARS : Number of singleton variants&lt;br /&gt;
# PVALUE : P-value from the test&lt;br /&gt;
# Additional columns specified by return values &#039;add&#039;&lt;br /&gt;
&lt;br /&gt;
== Full ChangeLog ==&lt;br /&gt;
* July 10th, 2014 : EPACTS v3.2.6 release&lt;br /&gt;
** Minor bug fix in epacts-make-kin &lt;br /&gt;
* March 11th, 2014 : EPACTS v3.2.5 release&lt;br /&gt;
** EMMAX-SKAT is implemented with major bug fix&lt;br /&gt;
* November 21th, 2013 : EPACTS v3.2.4 release&lt;br /&gt;
** Fixed a number of minor bugs&lt;br /&gt;
** Some known bugs still exist &lt;br /&gt;
*** SKAT-O Lambda eigenvalue error. This happenes in a particular context but haven&#039;t nailed down a way to prevent it yet.&lt;br /&gt;
*** EMMAX has case and control frequency flipped.&lt;br /&gt;
* EMMAX test has a silly known bug with case / ctrl frequency is flipped&lt;br /&gt;
* March 25th, 2013 : EPACTS v3.2.3 release&lt;br /&gt;
** Relaxed the checking of low-rank matrix in SKAT tests (to avoid unncessary skipping of genes)&lt;br /&gt;
* March 13th, 2013 : EPACTS v3.2.2 release&lt;br /&gt;
** Fixed an error which occasionally report mismatches in the number of samples&lt;br /&gt;
* March 9th, 2013 : EPACTS v3.2.1 release&lt;br /&gt;
**Fixed errors in loading the dynamic library&lt;br /&gt;
** Fixed errors in SKAT-O (thanks to Anubha Mahajan and Jason Flannick)&lt;br /&gt;
** Fixed bugs in emmax-CMC&lt;br /&gt;
** Added emmax-SKAT (contributed by Seunngeun Lee)&lt;br /&gt;
** And additional minor bug fixes&lt;br /&gt;
* February 28th, 2013 : EPACTS v3.2.0 release&lt;br /&gt;
** R package installation bug (for some users) was fixed&lt;br /&gt;
** A bug in the MAF error for high frequency variants (AF&amp;gt;0.25) was now fixed&lt;br /&gt;
** SKAT version is updated to 0.81&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
* December 4th, 2012 : EPACTS v3.1.0 release&lt;br /&gt;
** Removed dependency on libR.so&lt;br /&gt;
** Additional minor bug fixes&lt;br /&gt;
** --bprange option is added to allow testing for small region size&lt;br /&gt;
** November 25th, 2012 : EPACTS v3.0.0 release&lt;br /&gt;
** Restructured with source code release (with autoconf / automake / libtools)&lt;br /&gt;
** Added zoom plot feature&lt;br /&gt;
** FRAC_BURDEN keyword was replace to FRAC_WITH_RARE for groupwise testing&lt;br /&gt;
* October 26th, 2012 : EPACTS v2.2.0-beta is released with the following updates&lt;br /&gt;
** Added --max-mac option&lt;br /&gt;
** Fixed Firth&#039;s bias-corrected test (by Clement Ma)&lt;br /&gt;
** Added more informative warning messages when index files do not exist&lt;br /&gt;
** Fixed the bug in the epacts-plot in plotting ties&lt;br /&gt;
** Fixed errors in the MAF estimates per case and control&lt;br /&gt;
** Fixed bug in --minRSQ option&lt;br /&gt;
* September 28, 2012 : EPACTS v2.11-beta is released with the following updates&lt;br /&gt;
** Counts and allele frequencies for case/control added for binary tests&lt;br /&gt;
** --max-maf parameter is added&lt;br /&gt;
** Fixed EMMAX error in MAF in the output&lt;br /&gt;
** More informative error messages &lt;br /&gt;
* September 27, 2012 : EPACTS v2.1-beta is released with the following updates&lt;br /&gt;
** EMMAX interface is changed. --kinOnly option is related with a new command &#039;&#039;&#039;make-kin&#039;&#039;&#039; &lt;br /&gt;
** SKAT-O is upgraded to version 0.77 with additional configurable parameter settings&lt;br /&gt;
** Some parameter names are renamed (e.g. --min-maf, --min-mac)&lt;br /&gt;
** Many minor bugs are fixed&lt;br /&gt;
* Jul 6, 2012 : EPACTS v2.01-beta is released with the following updates&lt;br /&gt;
** SKAT-O is upgraded to version 0.76&lt;br /&gt;
** Fixed minor bugs in option names (Thanks to Xueling Sim)&lt;br /&gt;
* Jul 3, 2012 : EPACTS v2.0-beta is released with the following updates&lt;br /&gt;
** Major restructuring of the software&lt;br /&gt;
** Annotation software is switched with built-in application&lt;br /&gt;
** Addition of SKAT-O and EMMAX burden test&lt;br /&gt;
** Minor bug fixes&lt;br /&gt;
* Apr 8, 2012 : EPACTS v1.2-alpha is released with the following updates, in addition to the following updates&lt;br /&gt;
** EMMAX bug in handling covariates was fixed&lt;br /&gt;
** Variable Threshold Test is added&lt;br /&gt;
** Variable Threshold Test with genomic score (e.g. GERP or PhyloP) is added.&lt;br /&gt;
* Apr 4, 2012 : EPACTS v1.1-alpha is released with the following updates, in addition to minor updates&lt;br /&gt;
** EMMAX burden test (Hyun Min Kang)&lt;br /&gt;
** Likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of Firth bias-corrected likelihood ratio test (Clement Ma)&lt;br /&gt;
** Updated version of EMMAX single variant test (Hyun Min Kang) &lt;br /&gt;
* Mar 29, 2012 : EPACTS v1.0-alpha is released&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=VerifyBamID&amp;diff=13889</id>
		<title>VerifyBamID</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=VerifyBamID&amp;diff=13889"/>
		<updated>2015-10-31T22:32:26Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Acknowledgements */&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 of verifyBamId, go to: https://github.com/statgen/verifyBamID/releases&lt;br /&gt;
&lt;br /&gt;
Select the latest release and download in one of 3 ways:&lt;br /&gt;
# Binary expected to run in Ubuntu x64 platform. In other platforms, please download the source distribution and build it.&lt;br /&gt;
#* verifyBamID.#.#.#.gz&lt;br /&gt;
#* You will need to run &amp;quot;gunzip&amp;quot; on the .gz file&lt;br /&gt;
# Souce Code including libStatGen (uses a fixed version of libStatGen)&lt;br /&gt;
#* verifyBamIDLibStatGen.#.#.#.tgz&lt;br /&gt;
#* Run &amp;quot;tar xvf&amp;quot; on this file.  Cd into the resulting directory &amp;amp; type make.&lt;br /&gt;
# Source Code without libStatGen (allows alternative/newer versions of libStatGen)&lt;br /&gt;
#* Source code (tar.gz) or Source code (zip)&lt;br /&gt;
#* You will need to download libStatGen separately if you do not already have it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get a copy of older releases 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;
(2014/02/13)&lt;br /&gt;
* Put verifyBamID in github.&lt;br /&gt;
* Added PhoneHome/Version Checking to VerifyBamID&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 that version in Ubuntu 64-bit platform. &lt;br /&gt;
&lt;br /&gt;
If you download the source that includes libStatGen:&lt;br /&gt;
 tar xvf verifyBamIDLibStatGen.#.#.#.tgz&lt;br /&gt;
 cd verifyBamID_#.#.#&lt;br /&gt;
 make&lt;br /&gt;
 Executable: verifyBamID/bin/verifyBamID&lt;br /&gt;
&lt;br /&gt;
If you download the source without libStatGen:&lt;br /&gt;
 tar xvf verifyBamID-#.#.#.tar.gz&lt;br /&gt;
 cd verifyBamID-1.1.0&lt;br /&gt;
 make cloneLib (if ../libStatGen does not exist)&lt;br /&gt;
 make&lt;br /&gt;
 Executable: ./bin/verifyBamID&lt;br /&gt;
&lt;br /&gt;
Note that &#039;&#039;&#039;make cloneLib&#039;&#039;&#039; command will create a directory ../libStatGen under your verifyBamID directory, and &#039;&#039;&#039;make&#039;&#039;&#039; will create binary of verifyBamID under verifyBamID/bin/&lt;br /&gt;
&lt;br /&gt;
If you have a different version of libStatGen at that path, then skip the cloneLib step.  If the libStatGen you want to use is at a different location then update verifyBamID&#039;s Makefile.inc.  Replace: LIB_PATH_VERIFY_BAM_ID ?= $(LIB_PATH_GENERAL) with&lt;br /&gt;
 LIB_PATH_VERIFY_BAM_ID = /path/to/libStatGen&lt;br /&gt;
&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-13.10) x86 and x64 platforms, and later, there are likely other portability issues. &lt;br /&gt;
&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;
See also [[Understanding VerifyBamID output]].&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-likelihood 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;
                               PhoneHome : --noPhoneHome,&lt;br /&gt;
                                           --phoneHomeThinning [50]&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 reference 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;
{{PhoneHomeParameters|hdr=====|bullet=1}}&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]] or [[BAFRegress]] can estimate sample contamination from Illumina genotype array 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, Goncalo Abecasis, and Michael Boehnke. Please email to Hyun Min Kang [hmkang@umich.edu ] for any questions.&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=VerifyBamID&amp;diff=13888</id>
		<title>VerifyBamID</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=VerifyBamID&amp;diff=13888"/>
		<updated>2015-10-31T22:30:51Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Acknowledgements */&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 of verifyBamId, go to: https://github.com/statgen/verifyBamID/releases&lt;br /&gt;
&lt;br /&gt;
Select the latest release and download in one of 3 ways:&lt;br /&gt;
# Binary expected to run in Ubuntu x64 platform. In other platforms, please download the source distribution and build it.&lt;br /&gt;
#* verifyBamID.#.#.#.gz&lt;br /&gt;
#* You will need to run &amp;quot;gunzip&amp;quot; on the .gz file&lt;br /&gt;
# Souce Code including libStatGen (uses a fixed version of libStatGen)&lt;br /&gt;
#* verifyBamIDLibStatGen.#.#.#.tgz&lt;br /&gt;
#* Run &amp;quot;tar xvf&amp;quot; on this file.  Cd into the resulting directory &amp;amp; type make.&lt;br /&gt;
# Source Code without libStatGen (allows alternative/newer versions of libStatGen)&lt;br /&gt;
#* Source code (tar.gz) or Source code (zip)&lt;br /&gt;
#* You will need to download libStatGen separately if you do not already have it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get a copy of older releases 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;
(2014/02/13)&lt;br /&gt;
* Put verifyBamID in github.&lt;br /&gt;
* Added PhoneHome/Version Checking to VerifyBamID&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 that version in Ubuntu 64-bit platform. &lt;br /&gt;
&lt;br /&gt;
If you download the source that includes libStatGen:&lt;br /&gt;
 tar xvf verifyBamIDLibStatGen.#.#.#.tgz&lt;br /&gt;
 cd verifyBamID_#.#.#&lt;br /&gt;
 make&lt;br /&gt;
 Executable: verifyBamID/bin/verifyBamID&lt;br /&gt;
&lt;br /&gt;
If you download the source without libStatGen:&lt;br /&gt;
 tar xvf verifyBamID-#.#.#.tar.gz&lt;br /&gt;
 cd verifyBamID-1.1.0&lt;br /&gt;
 make cloneLib (if ../libStatGen does not exist)&lt;br /&gt;
 make&lt;br /&gt;
 Executable: ./bin/verifyBamID&lt;br /&gt;
&lt;br /&gt;
Note that &#039;&#039;&#039;make cloneLib&#039;&#039;&#039; command will create a directory ../libStatGen under your verifyBamID directory, and &#039;&#039;&#039;make&#039;&#039;&#039; will create binary of verifyBamID under verifyBamID/bin/&lt;br /&gt;
&lt;br /&gt;
If you have a different version of libStatGen at that path, then skip the cloneLib step.  If the libStatGen you want to use is at a different location then update verifyBamID&#039;s Makefile.inc.  Replace: LIB_PATH_VERIFY_BAM_ID ?= $(LIB_PATH_GENERAL) with&lt;br /&gt;
 LIB_PATH_VERIFY_BAM_ID = /path/to/libStatGen&lt;br /&gt;
&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-13.10) x86 and x64 platforms, and later, there are likely other portability issues. &lt;br /&gt;
&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;
See also [[Understanding VerifyBamID output]].&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-likelihood 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;
                               PhoneHome : --noPhoneHome,&lt;br /&gt;
                                           --phoneHomeThinning [50]&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 reference 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;
{{PhoneHomeParameters|hdr=====|bullet=1}}&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]] or [[BAFRegress]] can estimate sample contamination from Illumina genotype array data.&lt;br /&gt;
&lt;br /&gt;
== Acknowledgements ==&lt;br /&gt;
&lt;br /&gt;
VerifyBamID is a result from collaborative effort by Goo Jun, Matthew Flickinger, Mary Kate Wing, Goncalo Abecasis, Michael Boehnke, and Hyun Min Kang. Please email to Hyun Min Kang [[mailto:hmkang@umich.edu| hmkang@umich.edu]] for any questions.&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13447</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13447"/>
		<updated>2015-05-22T15:26:28Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Extracting only exonic SNPs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
 export EPACTS=/net/seqshop-server/home/mktrost/seqshop/epacts/&lt;br /&gt;
 export REF=/net/seqshop-server/home/mktrost/seqshop/singleSample/ref/gotcloud.ref&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 export SAMPLE=SampleXX &lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6 --out runmake.rsid&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example, rs17766217) -- How can we find its position? &lt;br /&gt;
 $HK/tabix ~/NA12878/output/vcfs/chr8/chr8.filtered.rsid.vcf.gz 8:128504497 | less&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,12,13,22 $HK/../data/gwascatalog/gwascatalog.txt | grep -w rs17766217&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6 --out runmake.anno&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6 --out runmake.exome&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
 $HK/tabix -pvcf $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $REF/hs37d5.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OVERALL COURSE FEEDBACK! ==&lt;br /&gt;
Please provide feedback:&lt;br /&gt;
https://docs.google.com/forms/d/1pxfPXKwWfA71ZJM99Sevs3MwAUz2UbHAR8dnRI-kRNM/viewform&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13446</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13446"/>
		<updated>2015-05-22T15:26:17Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Extracting only exonic SNPs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
 export EPACTS=/net/seqshop-server/home/mktrost/seqshop/epacts/&lt;br /&gt;
 export REF=/net/seqshop-server/home/mktrost/seqshop/singleSample/ref/gotcloud.ref&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 export SAMPLE=SampleXX &lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6 --out runmake.rsid&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example, rs17766217) -- How can we find its position? &lt;br /&gt;
 $HK/tabix ~/NA12878/output/vcfs/chr8/chr8.filtered.rsid.vcf.gz 8:128504497 | less&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,12,13,22 $HK/../data/gwascatalog/gwascatalog.txt | grep -w rs17766217&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6 --out runmake.anno&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6 --out runmake.exome&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
  $HK/tabix -pvcf $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $REF/hs37d5.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OVERALL COURSE FEEDBACK! ==&lt;br /&gt;
Please provide feedback:&lt;br /&gt;
https://docs.google.com/forms/d/1pxfPXKwWfA71ZJM99Sevs3MwAUz2UbHAR8dnRI-kRNM/viewform&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13445</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13445"/>
		<updated>2015-05-22T15:23:30Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Friday : More SNP Analysis */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
 export EPACTS=/net/seqshop-server/home/mktrost/seqshop/epacts/&lt;br /&gt;
 export REF=/net/seqshop-server/home/mktrost/seqshop/singleSample/ref/gotcloud.ref&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 export SAMPLE=SampleXX &lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6 --out runmake.rsid&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example, rs17766217) -- How can we find its position? &lt;br /&gt;
 $HK/tabix ~/NA12878/output/vcfs/chr8/chr8.filtered.rsid.vcf.gz 8:128504497 | less&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,12,13,22 $HK/../data/gwascatalog/gwascatalog.txt | grep -w rs17766217&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6 --out runmake.anno&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6 --out runmake.exome&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $REF/hs37d5.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OVERALL COURSE FEEDBACK! ==&lt;br /&gt;
Please provide feedback:&lt;br /&gt;
https://docs.google.com/forms/d/1pxfPXKwWfA71ZJM99Sevs3MwAUz2UbHAR8dnRI-kRNM/viewform&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13444</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13444"/>
		<updated>2015-05-22T15:22:04Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Annotation / Lookup against dbSNP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
 export EPACTS=/net/seqshop-server/home/mktrost/seqshop/epacts/&lt;br /&gt;
 export REF=/net/seqshop-server/home/mktrost/seqshop/singleSample/ref/gotcloud.ref&lt;br /&gt;
&lt;br /&gt;
 export SAMPLE=SampleXX &lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6 --out runmake.rsid&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example, rs17766217) -- How can we find its position? &lt;br /&gt;
 $HK/tabix ~/NA12878/output/vcfs/chr8/chr8.filtered.rsid.vcf.gz 8:128504497 | less&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,12,13,22 $HK/../data/gwascatalog/gwascatalog.txt | grep -w rs17766217&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6 --out runmake.anno&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6 --out runmake.exome&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $REF/hs37d5.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OVERALL COURSE FEEDBACK! ==&lt;br /&gt;
Please provide feedback:&lt;br /&gt;
https://docs.google.com/forms/d/1pxfPXKwWfA71ZJM99Sevs3MwAUz2UbHAR8dnRI-kRNM/viewform&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13443</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13443"/>
		<updated>2015-05-22T15:21:49Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Annotating your genome */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
 export EPACTS=/net/seqshop-server/home/mktrost/seqshop/epacts/&lt;br /&gt;
 export REF=/net/seqshop-server/home/mktrost/seqshop/singleSample/ref/gotcloud.ref&lt;br /&gt;
&lt;br /&gt;
 export SAMPLE=SampleXX &lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6 --out runmake.rsid --autosomes&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example, rs17766217) -- How can we find its position? &lt;br /&gt;
 $HK/tabix ~/NA12878/output/vcfs/chr8/chr8.filtered.rsid.vcf.gz 8:128504497 | less&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,12,13,22 $HK/../data/gwascatalog/gwascatalog.txt | grep -w rs17766217&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6 --out runmake.anno&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6 --out runmake.exome&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $REF/hs37d5.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OVERALL COURSE FEEDBACK! ==&lt;br /&gt;
Please provide feedback:&lt;br /&gt;
https://docs.google.com/forms/d/1pxfPXKwWfA71ZJM99Sevs3MwAUz2UbHAR8dnRI-kRNM/viewform&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13442</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13442"/>
		<updated>2015-05-22T15:21:32Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Extracting only exonic SNPs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
 export EPACTS=/net/seqshop-server/home/mktrost/seqshop/epacts/&lt;br /&gt;
 export REF=/net/seqshop-server/home/mktrost/seqshop/singleSample/ref/gotcloud.ref&lt;br /&gt;
&lt;br /&gt;
 export SAMPLE=SampleXX &lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6 --out runmake.rsid --autosomes&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example, rs17766217) -- How can we find its position? &lt;br /&gt;
 $HK/tabix ~/NA12878/output/vcfs/chr8/chr8.filtered.rsid.vcf.gz 8:128504497 | less&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,12,13,22 $HK/../data/gwascatalog/gwascatalog.txt | grep -w rs17766217&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6 --out runmake.anno --autosomes&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6 --out runmake.exome&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $REF/hs37d5.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OVERALL COURSE FEEDBACK! ==&lt;br /&gt;
Please provide feedback:&lt;br /&gt;
https://docs.google.com/forms/d/1pxfPXKwWfA71ZJM99Sevs3MwAUz2UbHAR8dnRI-kRNM/viewform&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13441</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13441"/>
		<updated>2015-05-22T15:20:59Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Annotation / Lookup against dbSNP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
 export EPACTS=/net/seqshop-server/home/mktrost/seqshop/epacts/&lt;br /&gt;
 export REF=/net/seqshop-server/home/mktrost/seqshop/singleSample/ref/gotcloud.ref&lt;br /&gt;
&lt;br /&gt;
 export SAMPLE=SampleXX &lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6 --out runmake.rsid --autosomes&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example, rs17766217) -- How can we find its position? &lt;br /&gt;
 $HK/tabix ~/NA12878/output/vcfs/chr8/chr8.filtered.rsid.vcf.gz 8:128504497 | less&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,12,13,22 $HK/../data/gwascatalog/gwascatalog.txt | grep -w rs17766217&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6 --out runmake.anno --autosomes&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6 --out runmake.exome --autosomes&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $REF/hs37d5.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OVERALL COURSE FEEDBACK! ==&lt;br /&gt;
Please provide feedback:&lt;br /&gt;
https://docs.google.com/forms/d/1pxfPXKwWfA71ZJM99Sevs3MwAUz2UbHAR8dnRI-kRNM/viewform&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13440</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13440"/>
		<updated>2015-05-22T15:20:40Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Extracting only exonic SNPs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
 export EPACTS=/net/seqshop-server/home/mktrost/seqshop/epacts/&lt;br /&gt;
 export REF=/net/seqshop-server/home/mktrost/seqshop/singleSample/ref/gotcloud.ref&lt;br /&gt;
&lt;br /&gt;
 export SAMPLE=SampleXX &lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6 --out runmake.rsid&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example, rs17766217) -- How can we find its position? &lt;br /&gt;
 $HK/tabix ~/NA12878/output/vcfs/chr8/chr8.filtered.rsid.vcf.gz 8:128504497 | less&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,12,13,22 $HK/../data/gwascatalog/gwascatalog.txt | grep -w rs17766217&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6 --out runmake.anno --autosomes&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6 --out runmake.exome --autosomes&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $REF/hs37d5.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OVERALL COURSE FEEDBACK! ==&lt;br /&gt;
Please provide feedback:&lt;br /&gt;
https://docs.google.com/forms/d/1pxfPXKwWfA71ZJM99Sevs3MwAUz2UbHAR8dnRI-kRNM/viewform&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13439</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13439"/>
		<updated>2015-05-22T15:20:15Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Annotating your genome */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
 export EPACTS=/net/seqshop-server/home/mktrost/seqshop/epacts/&lt;br /&gt;
 export REF=/net/seqshop-server/home/mktrost/seqshop/singleSample/ref/gotcloud.ref&lt;br /&gt;
&lt;br /&gt;
 export SAMPLE=SampleXX &lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6 --out runmake.rsid&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example, rs17766217) -- How can we find its position? &lt;br /&gt;
 $HK/tabix ~/NA12878/output/vcfs/chr8/chr8.filtered.rsid.vcf.gz 8:128504497 | less&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,12,13,22 $HK/../data/gwascatalog/gwascatalog.txt | grep -w rs17766217&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6 --out runmake.anno --autosomes&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6 --out runmake.exome&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $REF/hs37d5.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OVERALL COURSE FEEDBACK! ==&lt;br /&gt;
Please provide feedback:&lt;br /&gt;
https://docs.google.com/forms/d/1pxfPXKwWfA71ZJM99Sevs3MwAUz2UbHAR8dnRI-kRNM/viewform&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13438</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13438"/>
		<updated>2015-05-22T15:04:22Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Friday : More SNP Analysis */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
 export EPACTS=/net/seqshop-server/home/mktrost/seqshop/epacts/&lt;br /&gt;
 export REF=/net/seqshop-server/home/mktrost/seqshop/singleSample/ref/gotcloud.ref&lt;br /&gt;
&lt;br /&gt;
 export SAMPLE=SampleXX &lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6 --out runmake.rsid&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example, rs17766217) -- How can we find its position? &lt;br /&gt;
 $HK/tabix ~/NA12878/output/vcfs/chr8/chr8.filtered.rsid.vcf.gz 8:128504497 | less&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,12,13,22 $HK/../data/gwascatalog/gwascatalog.txt | grep -w rs17766217&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6 --out runmake.anno&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6 --out runmake.exome&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $REF/hs37d5.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OVERALL COURSE FEEDBACK! ==&lt;br /&gt;
Please provide feedback:&lt;br /&gt;
https://docs.google.com/forms/d/1pxfPXKwWfA71ZJM99Sevs3MwAUz2UbHAR8dnRI-kRNM/viewform&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13437</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13437"/>
		<updated>2015-05-22T15:03:06Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Friday : More SNP Analysis */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
 export EPACTS=/net/seqshop-server/home/mktrost/seqshop/epacts/&lt;br /&gt;
 export REF=/net/seqshop-server/home/mktrost/seqshop/singleSample/ref/gotcloud.ref&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6 --out runmake.rsid&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example, rs17766217) -- How can we find its position? &lt;br /&gt;
 $HK/tabix ~/NA12878/output/vcfs/chr8/chr8.filtered.rsid.vcf.gz 8:128504497 | less&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,12,13,22 $HK/../data/gwascatalog/gwascatalog.txt | grep -w rs17766217&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6 --out runmake.anno&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6 --out runmake.exome&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $REF/hs37d5.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OVERALL COURSE FEEDBACK! ==&lt;br /&gt;
Please provide feedback:&lt;br /&gt;
https://docs.google.com/forms/d/1pxfPXKwWfA71ZJM99Sevs3MwAUz2UbHAR8dnRI-kRNM/viewform&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13436</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13436"/>
		<updated>2015-05-22T14:53:22Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Extracting only exonic SNPs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
 export EPACTS=/net/seqshop-server/home/mktrost/seqshop/epacts/&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6 --out runmake.rsid&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example, rs17766217) -- How can we find its position? &lt;br /&gt;
 $HK/tabix ~/NA12878/output/vcfs/chr8/chr8.filtered.rsid.vcf.gz 8:128504497 | less&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,12,13,22 $HK/../data/gwascatalog/gwascatalog.txt | grep -w rs17766217&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6 --out runmake.anno&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6 --out runmake.exome&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $GC/gotcloud.ref/human.g1k.v37.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OVERALL COURSE FEEDBACK! ==&lt;br /&gt;
Please provide feedback:&lt;br /&gt;
https://docs.google.com/forms/d/1pxfPXKwWfA71ZJM99Sevs3MwAUz2UbHAR8dnRI-kRNM/viewform&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13435</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13435"/>
		<updated>2015-05-22T14:52:45Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Annotating your genome */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
 export EPACTS=/net/seqshop-server/home/mktrost/seqshop/epacts/&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6 --out runmake.rsid&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example, rs17766217) -- How can we find its position? &lt;br /&gt;
 $HK/tabix ~/NA12878/output/vcfs/chr8/chr8.filtered.rsid.vcf.gz 8:128504497 | less&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,12,13,22 $HK/../data/gwascatalog/gwascatalog.txt | grep -w rs17766217&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6 --out runmake.anno&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $GC/gotcloud.ref/human.g1k.v37.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OVERALL COURSE FEEDBACK! ==&lt;br /&gt;
Please provide feedback:&lt;br /&gt;
https://docs.google.com/forms/d/1pxfPXKwWfA71ZJM99Sevs3MwAUz2UbHAR8dnRI-kRNM/viewform&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13434</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13434"/>
		<updated>2015-05-22T14:52:14Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Annotation / Lookup against dbSNP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
 export EPACTS=/net/seqshop-server/home/mktrost/seqshop/epacts/&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6 --out runmake.rsid&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example, rs17766217) -- How can we find its position? &lt;br /&gt;
 $HK/tabix ~/NA12878/output/vcfs/chr8/chr8.filtered.rsid.vcf.gz 8:128504497 | less&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,12,13,22 $HK/../data/gwascatalog/gwascatalog.txt | grep -w rs17766217&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $GC/gotcloud.ref/human.g1k.v37.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OVERALL COURSE FEEDBACK! ==&lt;br /&gt;
Please provide feedback:&lt;br /&gt;
https://docs.google.com/forms/d/1pxfPXKwWfA71ZJM99Sevs3MwAUz2UbHAR8dnRI-kRNM/viewform&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13433</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13433"/>
		<updated>2015-05-22T14:50:05Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Annotation / Lookup against dbSNP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
 export EPACTS=/net/seqshop-server/home/mktrost/seqshop/epacts/&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6 --out runmake.rsid&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example, rs17766217) -- How can we find its position? &lt;br /&gt;
 $HK/tabix ~/NA12878/output/vcfs/chr8/chr8.filtered.rsid.vcf.gz 8:128504497 | less&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,22 $HK/../data/gwascatalog/gwascatalog.txt | less&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $GC/gotcloud.ref/human.g1k.v37.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OVERALL COURSE FEEDBACK! ==&lt;br /&gt;
Please provide feedback:&lt;br /&gt;
https://docs.google.com/forms/d/1pxfPXKwWfA71ZJM99Sevs3MwAUz2UbHAR8dnRI-kRNM/viewform&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13429</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13429"/>
		<updated>2015-05-22T14:25:49Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Annotation / Lookup against dbSNP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
 export EPACTS=/net/seqshop-server/home/mktrost/seqshop/epacts/&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6 --out runmake.rsid&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example)&lt;br /&gt;
 $HK/vcf-lookup-rsid --vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --sepchr --rs rs17766217&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,22 $HK/../data/gwascatalog/gwascatalog.txt | less&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $GC/gotcloud.ref/human.g1k.v37.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13428</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13428"/>
		<updated>2015-05-22T14:24:28Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Annotation / Lookup against dbSNP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
 export EPACTS=/net/seqshop-server/home/mktrost/seqshop/epacts/&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example)&lt;br /&gt;
 $HK/vcf-lookup-rsid --vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --sepchr --rs rs17766217&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,22 $HK/../data/gwascatalog/gwascatalog.txt | less&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $GC/gotcloud.ref/human.g1k.v37.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13427</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13427"/>
		<updated>2015-05-22T14:23:07Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Annotation / Lookup against dbSNP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
 export EPACTS=/net/seqshop-server/home/mktrost/seqshop/epacts/&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbsnp_142.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example)&lt;br /&gt;
 $HK/vcf-lookup-rsid --vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --sepchr --rs rs17766217&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,22 $HK/../data/gwascatalog/gwascatalog.txt | less&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $GC/gotcloud.ref/human.g1k.v37.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13425</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13425"/>
		<updated>2015-05-22T13:35:37Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Environmental Variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Association Analysis Tutorial ===&lt;br /&gt;
Now we are going to run the Association Analysis Practical&lt;br /&gt;
&lt;br /&gt;
Please go to: [[SeqShop: Association Analysis, May 2015]]&lt;br /&gt;
&lt;br /&gt;
We will look at our own genomes again after the practical.&lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name (or NA12878) instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setupSS.txt&lt;br /&gt;
&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
&lt;br /&gt;
==== Environmental Variables ====&lt;br /&gt;
&lt;br /&gt;
If you didn&#039;t set the environmental variable, you can set it again&lt;br /&gt;
&lt;br /&gt;
 export SAMPLE=SampleXX (MAKE SURE TO CHANGE XX to your number or use NA12878 instead)&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example)&lt;br /&gt;
 $HK/vcf-lookup-rsid --vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --sepchr --rs rs17766217&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,22 $HK/../data/gwascatalog/gwascatalog.txt | less&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $GC/gotcloud.ref/human.g1k.v37.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13424</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13424"/>
		<updated>2015-05-22T13:26:14Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Annotating your genome */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Association Analysis Tutorial ===&lt;br /&gt;
Now we are going to run the Association Analysis Practical&lt;br /&gt;
&lt;br /&gt;
Please go to: [[SeqShop: Association Analysis, May 2015]]&lt;br /&gt;
&lt;br /&gt;
We will look at our own genomes again after the practical.&lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name (or NA12878) instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setupSS.txt&lt;br /&gt;
&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
&lt;br /&gt;
==== Environmental Variables ====&lt;br /&gt;
&lt;br /&gt;
If you didn&#039;t set the environmental variable, you can set it again&lt;br /&gt;
&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setup.txt&lt;br /&gt;
 export SAMPLE=SampleXX (MAKE SURE TO CHANGE XX to your number or use NA12878 instead)&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setupSS.txt&lt;br /&gt;
&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example)&lt;br /&gt;
 $HK/vcf-lookup-rsid --vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --sepchr --rs rs17766217&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,22 $HK/../data/gwascatalog/gwascatalog.txt | less&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $GC/gotcloud.ref/human.g1k.v37.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13423</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13423"/>
		<updated>2015-05-22T13:25:40Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Annotation / Lookup against dbSNP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Association Analysis Tutorial ===&lt;br /&gt;
Now we are going to run the Association Analysis Practical&lt;br /&gt;
&lt;br /&gt;
Please go to: [[SeqShop: Association Analysis, May 2015]]&lt;br /&gt;
&lt;br /&gt;
We will look at our own genomes again after the practical.&lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name (or NA12878) instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setupSS.txt&lt;br /&gt;
&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
&lt;br /&gt;
==== Environmental Variables ====&lt;br /&gt;
&lt;br /&gt;
If you didn&#039;t set the environmental variable, you can set it again&lt;br /&gt;
&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setup.txt&lt;br /&gt;
 export SAMPLE=SampleXX (MAKE SURE TO CHANGE XX to your number or use NA12878 instead)&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setupSS.txt&lt;br /&gt;
&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --repeat-chr --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example)&lt;br /&gt;
 $HK/vcf-lookup-rsid --vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --sepchr --rs rs17766217&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,22 $HK/../data/gwascatalog/gwascatalog.txt | less&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6 &lt;br /&gt;
 &lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $GC/gotcloud.ref/human.g1k.v37.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13422</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13422"/>
		<updated>2015-05-22T13:25:09Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Environmental Variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Association Analysis Tutorial ===&lt;br /&gt;
Now we are going to run the Association Analysis Practical&lt;br /&gt;
&lt;br /&gt;
Please go to: [[SeqShop: Association Analysis, May 2015]]&lt;br /&gt;
&lt;br /&gt;
We will look at our own genomes again after the practical.&lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name (or NA12878) instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setupSS.txt&lt;br /&gt;
&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
&lt;br /&gt;
==== Environmental Variables ====&lt;br /&gt;
&lt;br /&gt;
If you didn&#039;t set the environmental variable, you can set it again&lt;br /&gt;
&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setup.txt&lt;br /&gt;
 export SAMPLE=SampleXX (MAKE SURE TO CHANGE XX to your number or use NA12878 instead)&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setupSS.txt&lt;br /&gt;
&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/apigenome/bin&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example)&lt;br /&gt;
 $HK/vcf-lookup-rsid --vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --sepchr --rs rs17766217&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,22 $HK/../data/gwascatalog/gwascatalog.txt | less&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6 &lt;br /&gt;
 &lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $GC/gotcloud.ref/human.g1k.v37.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13421</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13421"/>
		<updated>2015-05-22T13:23:46Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: Reverted edits by Hmkang (talk) to last revision by Mktrost&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Association Analysis Tutorial ===&lt;br /&gt;
Now we are going to run the Association Analysis Practical&lt;br /&gt;
&lt;br /&gt;
Please go to: [[SeqShop: Association Analysis, May 2015]]&lt;br /&gt;
&lt;br /&gt;
We will look at our own genomes again after the practical.&lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name (or NA12878) instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setupSS.txt&lt;br /&gt;
&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
&lt;br /&gt;
==== Environmental Variables ====&lt;br /&gt;
&lt;br /&gt;
If you didn&#039;t set the environmental variable, you can set it again&lt;br /&gt;
&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setup.txt&lt;br /&gt;
 export SAMPLE=SampleXX (MAKE SURE TO CHANGE XX to your number or use NA12878 instead)&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setupSS.txt&lt;br /&gt;
&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/net/seqshop-server/home/hmkang/seqshop/bin&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example)&lt;br /&gt;
 $HK/vcf-lookup-rsid --vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --sepchr --rs rs17766217&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,22 $HK/../data/gwascatalog/gwascatalog.txt | less&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6 &lt;br /&gt;
 &lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $GC/gotcloud.ref/human.g1k.v37.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13420</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13420"/>
		<updated>2015-05-22T13:22:22Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Friday */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name (or NA12878) instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setupSS.txt&lt;br /&gt;
&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
&lt;br /&gt;
==== Environmental Variables ====&lt;br /&gt;
&lt;br /&gt;
If you didn&#039;t set the environmental variable, you can set it again&lt;br /&gt;
&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setup.txt&lt;br /&gt;
 export SAMPLE=SampleXX (MAKE SURE TO CHANGE XX to your number or use NA12878 instead)&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setupSS.txt&lt;br /&gt;
&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/home/hmkang/apigenome/bin/&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --repeat-chr --numjobs 6&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example)&lt;br /&gt;
 $HK/vcf-lookup-rsid --vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --sepchr --rs rs17766217&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,22 $HK/../data/gwascatalog/gwascatalog.txt | less&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --repeat-chr --numjobs 6 &lt;br /&gt;
 &lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $GC/gotcloud.ref/human.g1k.v37.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13419</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13419"/>
		<updated>2015-05-22T13:20:52Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name (or NA12878) instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setupSS.txt&lt;br /&gt;
&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
&lt;br /&gt;
==== Environmental Variables ====&lt;br /&gt;
&lt;br /&gt;
If you didn&#039;t set the environmental variable, you can set it again&lt;br /&gt;
&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setup.txt&lt;br /&gt;
 export SAMPLE=SampleXX (MAKE SURE TO CHANGE XX to your number or use NA12878 instead)&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setupSS.txt&lt;br /&gt;
&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/home/hmkang/apigenome/bin/&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-make --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --repeat-chr --numjobs 6&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example)&lt;br /&gt;
 $HK/vcf-lookup-rsid --vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --sepchr --rs rs17766217&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,22 $HK/../data/gwascatalog/gwascatalog.txt | less&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-make --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --repeat-chr --numjobs 6 &lt;br /&gt;
 &lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $GC/gotcloud.ref/human.g1k.v37.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13418</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13418"/>
		<updated>2015-05-22T13:18:34Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Friday */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name (or NA12878) instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setupSS.txt&lt;br /&gt;
&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
&lt;br /&gt;
==== Environmental Variables ====&lt;br /&gt;
&lt;br /&gt;
If you didn&#039;t set the environmental variable, you can set it again&lt;br /&gt;
&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setup.txt&lt;br /&gt;
 export SAMPLE=SampleXX (MAKE SURE TO CHANGE XX to your number or use NA12878 instead)&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setupSS.txt&lt;br /&gt;
&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/home/hmkang/apigenome/bin/&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example)&lt;br /&gt;
 $HK/vcf-lookup-rsid --vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --sepchr --rs rs17766217&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,22 $HK/../data/gwascatalog/gwascatalog.txt | less&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6 &lt;br /&gt;
 &lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $GC/gotcloud.ref/human.g1k.v37.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13417</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13417"/>
		<updated>2015-05-22T13:17:48Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Friday */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content mw-expanded&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name (or NA12878) instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setupSS.txt&lt;br /&gt;
&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
&lt;br /&gt;
==== Environmental Variables ====&lt;br /&gt;
&lt;br /&gt;
If you didn&#039;t set the environmental variable, you can set it again&lt;br /&gt;
&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setup.txt&lt;br /&gt;
 export SAMPLE=SampleXX (MAKE SURE TO CHANGE XX to your number or use NA12878 instead)&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setupSS.txt&lt;br /&gt;
&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/home/hmkang/apigenome/bin/&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example)&lt;br /&gt;
 $HK/vcf-lookup-rsid --vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --sepchr --rs rs17766217&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,22 $HK/../data/gwascatalog/gwascatalog.txt | less&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6 &lt;br /&gt;
 &lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $GC/gotcloud.ref/human.g1k.v37.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13416</id>
		<title>SeqShop: Calling Your Own Genome, May 2015</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=SeqShop:_Calling_Your_Own_Genome,_May_2015&amp;diff=13416"/>
		<updated>2015-05-22T13:17:27Z</updated>

		<summary type="html">&lt;p&gt;Hmkang: /* Friday */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Login instructions for seqshop-server&#039;&#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
{{SeqShopLogin}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
== Tuesday - Start SNP Calling ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
=== Setup Screen ===&lt;br /&gt;
The snpcall pipeline will run overnight, but you&#039;ll want to log out.&lt;br /&gt;
; How do I leave something running on the server even if I log out?&lt;br /&gt;
: One solution is screen!&lt;br /&gt;
&lt;br /&gt;
; How do I use screen?&lt;br /&gt;
: Before running your command, you need to start screen:&lt;br /&gt;
: &amp;lt;pre&amp;gt;screen&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen.png]]&lt;br /&gt;
&lt;br /&gt;
As it says, press &amp;lt;code&amp;gt;Space&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Return&amp;lt;/code&amp;gt;.&lt;br /&gt;
* It should now look basically the same as your normal command line.&lt;br /&gt;
&lt;br /&gt;
=== Setup Variables ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
or&lt;br /&gt;
 export SAMPLE=NA12878&lt;br /&gt;
&lt;br /&gt;
Point to your GotCloud &amp;amp; your output directory:&lt;br /&gt;
 export GC=~/seqshop/gotcloud&lt;br /&gt;
 export OUT=~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
=== List of BAMs ===&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
=== Configuring SNPCALL ===&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
You will see this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# References&lt;br /&gt;
SS_DIR = /net/seqshop-server/home/mktrost/seqshop/singleSample&lt;br /&gt;
REF_DIR = $(SS_DIR)/ref/gotcloud.ref/&lt;br /&gt;
&lt;br /&gt;
######### ALIGNMENT ########&lt;br /&gt;
MAP_TYPE = BWA_MEM&lt;br /&gt;
FASTQ_LIST = fastq.list&lt;br /&gt;
BATCH_TYPE = &lt;br /&gt;
BATCH_OPTS = &lt;br /&gt;
BWA_THREADS = -t 6&lt;br /&gt;
&lt;br /&gt;
# SNP Call Settings&lt;br /&gt;
UNIT_CHUNK = 20000000      # Chunk size of SNP calling : 20Mb&lt;br /&gt;
VCF_EXTRACT = $(SS_DIR)/snpOnly.vcf.gz&lt;br /&gt;
MODEL_GLFSINGLE = TRUE&lt;br /&gt;
MODEL_SKIP_DISCOVER = FALSE&lt;br /&gt;
MODEL_AF_PRIOR = TRUE&lt;br /&gt;
&lt;br /&gt;
EXT_DIR = $(SS_DIR)/ext&lt;br /&gt;
EXT = $(EXT_DIR)/ALL.chrCHR.phase3.combined.sites.unfiltered.vcf.gz $(EXT_DIR)/chrCHR.filtered.sites.vcf.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Running SNP Calling ===&lt;br /&gt;
Run GotCloud snpcall with 8 jobs running in parallel&lt;br /&gt;
* Why 8?  &lt;br /&gt;
** You want to run as many as you can.&lt;br /&gt;
** 2-3 of you on the machine - 3*8 = 24 jobs will be running in parallel on that machine&lt;br /&gt;
 ${GC}/gotcloud snpcall --conf $SAMPLE/gotcloud.conf --numjobs 8 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
=== Log Out ===&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
If you have not detached from screen:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK! ===&lt;br /&gt;
Please provide feedback on today:&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/forms/d/1ADTkBjzT-QNj2lrejyqGqDaahTponrw20kSgDNwqwH4/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible&amp;quot; style=&amp;quot;width:500px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Thursday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Checking if snpcall Completed ===&lt;br /&gt;
==== Resume screen to Check Jobs ====&lt;br /&gt;
&lt;br /&gt;
;How do you log back into screen?&lt;br /&gt;
 screen -r&lt;br /&gt;
This will resume an already running screen.&lt;br /&gt;
&lt;br /&gt;
Your screen session still has your environment variables set, so you do not need to reset them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Verify you got a &amp;quot;completed successfully&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
How long did snpcall calling take?  Look at the log message - time in seconds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== List of BAMs ====&lt;br /&gt;
The list of BAMs has already been created (just 1 BAM, your sample).&lt;br /&gt;
* But it is simply SAMPLE\tBAM_name, so easy to figure out&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/output/bam.list&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;SampleXX   SampleXX/output/bams/SampleXX.recal.bam&amp;lt;/code&amp;gt;&lt;br /&gt;
* Relative path, so assumes running from your home directory (I prefer absolute paths, but for simplicity of the workshop, we just use relative path).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== GotCloud INDEL Configuration ====&lt;br /&gt;
&lt;br /&gt;
 cat ~/$SAMPLE/gotcloud.conf&lt;br /&gt;
&lt;br /&gt;
Same as it looked the other day with no special Configuration settings for INDEL calling.&lt;br /&gt;
&lt;br /&gt;
==== Running INDEL ====&lt;br /&gt;
Run GotCloud indel with 6 jobs running in parallel&lt;br /&gt;
 ${GC}/gotcloud indel --conf $SAMPLE/gotcloud.conf --numjobs 6 --outdir $OUT&lt;br /&gt;
* Only need the configuration, number of threads, and the output directory, rest is specified within the configuration.&lt;br /&gt;
&lt;br /&gt;
This will run overnight.  We will check if it completed at the practical in the morning.&lt;br /&gt;
&lt;br /&gt;
==== Log Out ====&lt;br /&gt;
;Want to log out and leave your job running?&lt;br /&gt;
In the screen window, type:&lt;br /&gt;
 Ctrl-a d&lt;br /&gt;
(Hold down Ctrl and type &#039;a&#039;, let go of both and type &#039;d&#039;)&lt;br /&gt;
* This will &amp;quot;detach&amp;quot; from your screen session while your alignment continues to run.&lt;br /&gt;
&lt;br /&gt;
exit PuTTY&lt;br /&gt;
&lt;br /&gt;
=== FEEDBACK!===&lt;br /&gt;
Please provide feedback for today.&lt;br /&gt;
https://docs.google.com/a/umich.edu/forms/d/1iES6usHxLB7Ec9hRxtqYgH7v05lU3Ume4VJcksx8Ogg/viewform&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:1000px&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Friday ==&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
[[SeqShop: Ancestry On Your Own Genome, May 2015]]&lt;br /&gt;
&lt;br /&gt;
=== Return to SeqShop: Ancestry On Your Own Genome, May 2015 ===&lt;br /&gt;
Return to [[SeqShop:_Ancestry_On_Your_Own_Genome,_May_2015#Checking_if_Pileup_finished]]&lt;br /&gt;
&lt;br /&gt;
=== Reviewing Indel Results ===&lt;br /&gt;
Set these values.  Also, be sure to specify your sample name (or NA12878) instead of SampleXX&lt;br /&gt;
 export SAMPLE=SampleXX&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setupSS.txt&lt;br /&gt;
&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
What in that directory was produced by indel calling?&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
** dump of all configuration settings for this run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile&amp;lt;/code&amp;gt;&lt;br /&gt;
** Makefile that was generated to manage all of the commands to be run&lt;br /&gt;
* &amp;lt;code&amp;gt;gotcloud.indel.Makefile.log&amp;lt;/code&amp;gt;&lt;br /&gt;
** log of all commands run by the Makefile&lt;br /&gt;
* &amp;lt;code&amp;gt;indel/&amp;lt;/code&amp;gt;&lt;br /&gt;
** indel output directory&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the indel output&lt;br /&gt;
 ls ~/$SAMPLE/output/indel &lt;br /&gt;
* 3 directories&lt;br /&gt;
** aux - intermediate files&lt;br /&gt;
** indelvcf - intermediate files&lt;br /&gt;
** &#039;&#039;&#039;final indel files&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Final indel directory:&lt;br /&gt;
 ls ~/$SAMPLE/output/indel/final&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz - output VCF&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;all.genotypes.vcf.gz.tbi - output VCF index file to allow jumping to positions&#039;&#039;&#039;&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.OK - completion indicator&lt;br /&gt;
* merge/ - directory with per chromosome bcf (binary vcf) files&lt;br /&gt;
* all.genotypes.vcf.gz.OK - completion indicator&lt;br /&gt;
* all.genotypes.vcf.gz.tbi.log - log&lt;br /&gt;
* concat.log - log&lt;br /&gt;
&lt;br /&gt;
==== Looking at final INDEL VCF ====&lt;br /&gt;
&lt;br /&gt;
Note that because this is a single sample calling, many of the INFO fields are less meaningful as many of the values like HWE p values, allele frequencies, inbreeding coefficient are a function of a population.&lt;br /&gt;
Nonetheless, we may examine the results.  First, we see how many indels were discovered for your genome:&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz &lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     588566&lt;br /&gt;
           2 alleles (ins/del)            :          588566 (0.87) [273261/315305]&lt;br /&gt;
&lt;br /&gt;
This gives use 588,566 indels with an insertion deletion ratio of 0.87.&lt;br /&gt;
&lt;br /&gt;
We next look at the filtered set. The PASS filter reduces the setof indels to a non overlapping set and the INFO.AC!=0 extracts all indels that are either heterozygous or homozygous alternative.&lt;br /&gt;
Some indels that were originally discovered were found to be the homozygous reference genotype.  Invariably, these are relative high depth calls where the &lt;br /&gt;
alternative allele is discovered less or is mis-specified.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC!=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     549963&lt;br /&gt;
           2 alleles (ins/del)            :          549963 (0.91) [261480/288483]&lt;br /&gt;
&lt;br /&gt;
About 38K indels were removed, the insertion deletion ratio increases to 0.91.  Note that in general, for high depth data, discovered indels are reported with insertion deletion ratios&lt;br /&gt;
close to 1. So this is a good sign.  Next generation sequencing errors are bias for deletions.&lt;br /&gt;
&lt;br /&gt;
It is possible to perform a slightly more stringent filtering using allele balance.  The allele balance estimator in this case is meaningful still for an individual because it is a function of read depth.&lt;br /&gt;
Note that AB&amp;gt;0.5 denotes reference bias and AB&amp;lt;0.5 denotes alternative allele bias.&lt;br /&gt;
&lt;br /&gt;
 $GC/bin/vt peek ~/$SAMPLE/output/indel/final/all.genotypes.vcf.gz -f &amp;quot;PASS&amp;amp;&amp;amp;INFO.AC&amp;gt;0&amp;amp;&amp;amp;INFO.AB&amp;lt;0.7&amp;amp;&amp;amp;INFO.AB&amp;gt;0.3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
       no. Indels                         :     490965&lt;br /&gt;
           2 alleles (ins/del)            :          490965 (0.92) [235254/255711]&lt;br /&gt;
&lt;br /&gt;
The insertion deletion ratio increases from 0.91 to 0.92.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Friday: Reviewing SNPCALL Results ===&lt;br /&gt;
Look in the output directory&lt;br /&gt;
 ls ~/$SAMPLE/output&lt;br /&gt;
&lt;br /&gt;
Look at the vcfs:&lt;br /&gt;
 ls ~/$SAMPLE/output/vcfs&lt;br /&gt;
&lt;br /&gt;
=== Friday : More SNP Analysis ===&lt;br /&gt;
&lt;br /&gt;
==== Environmental Variables ====&lt;br /&gt;
&lt;br /&gt;
If you didn&#039;t set the environmental variable, you can set it again&lt;br /&gt;
&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setup.txt&lt;br /&gt;
 export SAMPLE=SampleXX (MAKE SURE TO CHANGE XX to your number or use NA12878 instead)&lt;br /&gt;
 source /net/seqshop-server/home/mktrost/seqshop/setupSS.txt&lt;br /&gt;
&lt;br /&gt;
In addition, set another environmental variable for locating the binaries for custom analysis&lt;br /&gt;
&lt;br /&gt;
 export HK=/home/hmkang/apigenome/bin/&lt;br /&gt;
&lt;br /&gt;
==== Annotation / Lookup against dbSNP ====&lt;br /&gt;
&lt;br /&gt;
If you want to add rsIDs to your variant files, you can do this by running the following command&lt;br /&gt;
&lt;br /&gt;
 $HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&lt;br /&gt;
 &lt;br /&gt;
If you want to run this command across all chromosomes in parallel, you can use the special script run-command-wgs&lt;br /&gt;
&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;$HK/vcf-add-rsid -vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --db $HK/../data/dbSNP.b138/dbsnp_138.b37.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
Looking up SNPs by rsID is possible by (for example)&lt;br /&gt;
 $HK/vcf-lookup-rsid --vcf $OUT/vcfs/chr1/chr1.filtered.vcf.gz --sepchr --rs rs17766217&lt;br /&gt;
* Be sure to look at the QUAL &amp;amp; your sample&#039;s PL, and not just the GL field.  Check if QUAL is 0 or PL is 0,0,0 - NS is also probably 0; DP is probably 0.  That means you probably didn&#039;t have any copies, so your GT may not be correct/is unknown.&lt;br /&gt;
&lt;br /&gt;
If you want to browse the rsIDs of known GWAS SNPs, you can do this by&lt;br /&gt;
 cut -f 1,8,22 $HK/../data/gwascatalog/gwascatalog.txt | less&lt;br /&gt;
&lt;br /&gt;
==== Annotating your genome ====&lt;br /&gt;
&lt;br /&gt;
You can annotate your genome using EPACTS software packages. Individual chromosome can be annotated by running.&lt;br /&gt;
 $EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Or you can run multiple chromosomes in parallel in one command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;$EPACTS/bin/epacts anno --in $OUT/vcfs/chr1/chr1.filtered.rsid.vcf.gz --out $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz&amp;quot; --numjobs 6 &lt;br /&gt;
 &lt;br /&gt;
==== Extracting only exonic SNPs ====&lt;br /&gt;
&lt;br /&gt;
If you want to look at the exonic SNPs, you can extract using the following command&lt;br /&gt;
 $HK/run-command-wgs --cmd &amp;quot;($HK/tabix -H $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz; zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.vcf.gz | grep Exon;)| $HK/bgzip -c &amp;gt; $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz&amp;quot; --numjobs 6&lt;br /&gt;
&lt;br /&gt;
And they can be combined as follows&lt;br /&gt;
 (zcat $OUT/vcfs/chr1/chr1.filtered.rsid.anno.exon.vcf.gz; zcat $OUT/vcfs/chr[2-9]/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chr??/chr*.filtered.rsid.anno.exon.vcf.gz $OUT/vcfs/chrX/chrX.filtered.rsid.anno.exon.vcf.gz | grep -v ^#) | $HK/bgzip -c &amp;gt; $OUT/wgs.filtered.rsid.anno.exon.vcf.gz&lt;br /&gt;
&lt;br /&gt;
==== Exonic Variants NOT found by 1000G ====&lt;br /&gt;
&lt;br /&gt;
If you are interested in rare variants that are not identified by 1000G, you can extract them by running&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | less&lt;br /&gt;
 &lt;br /&gt;
For example, &lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
 &lt;br /&gt;
will give you the counts of variants, separate by the filtering results&lt;br /&gt;
&lt;br /&gt;
* Q1. How manny novel silent, missense, and nonsense SNPs are found? Is that too few, too small, or just about right?&lt;br /&gt;
* Q2. Looking at each functional category, which functional categories has largest fraction of SNPs failed filter? Why do you think it is?&lt;br /&gt;
* Q3. Can you exclude the sites that are also in dbSNP, and count how many nonsense variants are left?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To also exclude those in dbsnp:&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; | grep -v rs| perl -lane &#039;print &amp;quot;$1\t$F[6]&amp;quot; if ( /ANNO=([^;:]+)/)&#039; | sort | uniq -c&lt;br /&gt;
&lt;br /&gt;
Exclude dbsnp and look at Stop_Gain variants&lt;br /&gt;
 zcat $OUT/wgs.filtered.rsid.anno.exon.vcf.gz | grep &amp;quot;EXTFILTER=NA,NA&amp;quot; | grep -v -w &amp;quot;0/0&amp;quot; |grep -v rs | perl -lane &#039;print &amp;quot;$_&amp;quot; if ( /ANNO=Stop_Gain/)&#039; |grep -w PASS&lt;br /&gt;
&lt;br /&gt;
Want to see this from the BAM file?  Use samtools tview:&lt;br /&gt;
 $GC/bin/samtools tview $SAMPLE/output/bams/$SAMPLE.recal.bam $GC/gotcloud.ref/human.g1k.v37.fa&lt;br /&gt;
Use &#039;g&#039; &amp;amp; enter the Chr:Pos&lt;br /&gt;
* Some patterns may indicate not real variants.&lt;br /&gt;
&lt;br /&gt;
If you want to know predicted functional significance of a particular variant, you can search by&lt;br /&gt;
&lt;br /&gt;
 $HK/tabix $HK/../data/CADD/whole_genome_SNVs.tsv.gz [chr]:[pos] | head -3&lt;br /&gt;
 &lt;br /&gt;
The phred score at the last column quantifies the degree of functional significance&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hmkang</name></author>
	</entry>
</feed>