<?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=Csidore</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=Csidore"/>
	<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/wiki/Special:Contributions/Csidore"/>
	<updated>2026-09-24T03:23:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=15134</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=15134"/>
		<updated>2019-09-17T07:59:52Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Example Dataset */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are participating in the Sardinia Summer School, everything is already installed and you can move on.&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally, we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be available in the workshop folder , so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd WS_Sidore/Workshop_low_pass&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
Note: The total count of C is 4, but 2 of them are duplicates. Similarly the number of T is 2 but one is an orphan read (underlined). Samtools tview shows them, but they will discarded from further analysis&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.snpcall.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz  | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111.&lt;br /&gt;
This time rather than using &amp;quot;zgrep&amp;quot;, that could be very slow for large dataset, we will use &amp;quot;tabix&amp;quot; which provides quick access to every line of the vcf.&lt;br /&gt;
&lt;br /&gt;
We first need to index the .vcf file&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix exome/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
This command creates a .vcf.gz.tbi, the index file which contains position information and allows for quick access.&lt;br /&gt;
&lt;br /&gt;
We can now pick the lines that we want with the notation &amp;quot;CHR:FIRSTPOS-LASTPOS&amp;quot;. Since we are interested in a single position, FIRSTPOS and LASTPOS are the same&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix -h exome/vcfs/chr20/chr20.filtered.vcf.gz 20:33514465-33514465| tail -n2| cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the low-pass and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
* Q12: Check position 33523840 in the low pass VCF for sample HG00111. &lt;br /&gt;
** What is the genotype assigned by the variant caller? &lt;br /&gt;
** What is your predicted genotype according to the reads piling up at this site? &lt;br /&gt;
** What is the genotype in the exome VCF?&lt;br /&gt;
** What is the genotype after LD refinement?  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=15133</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=15133"/>
		<updated>2019-09-17T07:59:03Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you are participating in the Sardinia Summer School, everything is already installed and you can move on.&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd WS_Sidore/Workshop_low_pass&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
Note: The total count of C is 4, but 2 of them are duplicates. Similarly the number of T is 2 but one is an orphan read (underlined). Samtools tview shows them, but they will discarded from further analysis&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.snpcall.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz  | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111.&lt;br /&gt;
This time rather than using &amp;quot;zgrep&amp;quot;, that could be very slow for large dataset, we will use &amp;quot;tabix&amp;quot; which provides quick access to every line of the vcf.&lt;br /&gt;
&lt;br /&gt;
We first need to index the .vcf file&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix exome/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
This command creates a .vcf.gz.tbi, the index file which contains position information and allows for quick access.&lt;br /&gt;
&lt;br /&gt;
We can now pick the lines that we want with the notation &amp;quot;CHR:FIRSTPOS-LASTPOS&amp;quot;. Since we are interested in a single position, FIRSTPOS and LASTPOS are the same&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix -h exome/vcfs/chr20/chr20.filtered.vcf.gz 20:33514465-33514465| tail -n2| cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the low-pass and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
* Q12: Check position 33523840 in the low pass VCF for sample HG00111. &lt;br /&gt;
** What is the genotype assigned by the variant caller? &lt;br /&gt;
** What is your predicted genotype according to the reads piling up at this site? &lt;br /&gt;
** What is the genotype in the exome VCF?&lt;br /&gt;
** What is the genotype after LD refinement?  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=15132</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=15132"/>
		<updated>2019-09-17T07:57:55Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Example Dataset */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd WS_Sidore/Workshop_low_pass&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
Note: The total count of C is 4, but 2 of them are duplicates. Similarly the number of T is 2 but one is an orphan read (underlined). Samtools tview shows them, but they will discarded from further analysis&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.snpcall.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz  | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111.&lt;br /&gt;
This time rather than using &amp;quot;zgrep&amp;quot;, that could be very slow for large dataset, we will use &amp;quot;tabix&amp;quot; which provides quick access to every line of the vcf.&lt;br /&gt;
&lt;br /&gt;
We first need to index the .vcf file&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix exome/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
This command creates a .vcf.gz.tbi, the index file which contains position information and allows for quick access.&lt;br /&gt;
&lt;br /&gt;
We can now pick the lines that we want with the notation &amp;quot;CHR:FIRSTPOS-LASTPOS&amp;quot;. Since we are interested in a single position, FIRSTPOS and LASTPOS are the same&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix -h exome/vcfs/chr20/chr20.filtered.vcf.gz 20:33514465-33514465| tail -n2| cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the low-pass and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
* Q12: Check position 33523840 in the low pass VCF for sample HG00111. &lt;br /&gt;
** What is the genotype assigned by the variant caller? &lt;br /&gt;
** What is your predicted genotype according to the reads piling up at this site? &lt;br /&gt;
** What is the genotype in the exome VCF?&lt;br /&gt;
** What is the genotype after LD refinement?  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=15050</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=15050"/>
		<updated>2018-07-05T14:21:18Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Initial set of variant calls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd DAY2_Jul10/WS_CarloSidore/Workshop_low_pass&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
Note: The total count of C is 4, but 2 of them are duplicates. Similarly the number of T is 2 but one is an orphan read (underlined). Samtools tview shows them, but they will discarded from further analysis&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.snpcall.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz  | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111.&lt;br /&gt;
This time rather than using &amp;quot;zgrep&amp;quot;, that could be very slow for large dataset, we will use &amp;quot;tabix&amp;quot; which provides quick access to every line of the vcf.&lt;br /&gt;
&lt;br /&gt;
We first need to index the .vcf file&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix exome/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
This command creates a .vcf.gz.tbi, the index file which contains position information and allows for quick access.&lt;br /&gt;
&lt;br /&gt;
We can now pick the lines that we want with the notation &amp;quot;CHR:FIRSTPOS-LASTPOS&amp;quot;. Since we are interested in a single position, FIRSTPOS and LASTPOS are the same&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix -h exome/vcfs/chr20/chr20.filtered.vcf.gz 20:33514465-33514465| tail -n2| cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the low-pass and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
* Q12: Check position 33523840 in the low pass VCF for sample HG00111. &lt;br /&gt;
** What is the genotype assigned by the variant caller? &lt;br /&gt;
** What is your predicted genotype according to the reads piling up at this site? &lt;br /&gt;
** What is the genotype in the exome VCF?&lt;br /&gt;
** What is the genotype after LD refinement?  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=15049</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=15049"/>
		<updated>2018-07-05T13:00:38Z</updated>

		<summary type="html">&lt;p&gt;Csidore: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd DAY2_Jul10/WS_CarloSidore/Workshop_low_pass&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
Note: The total count of C is 4, but 2 of them are duplicates. Similarly the number of T is 2 but one is an orphan read (underlined). Samtools tview shows them, but they will discarded from further analysis&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz  | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111.&lt;br /&gt;
This time rather than using &amp;quot;zgrep&amp;quot;, that could be very slow for large dataset, we will use &amp;quot;tabix&amp;quot; which provides quick access to every line of the vcf.&lt;br /&gt;
&lt;br /&gt;
We first need to index the .vcf file&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix exome/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
This command creates a .vcf.gz.tbi, the index file which contains position information and allows for quick access.&lt;br /&gt;
&lt;br /&gt;
We can now pick the lines that we want with the notation &amp;quot;CHR:FIRSTPOS-LASTPOS&amp;quot;. Since we are interested in a single position, FIRSTPOS and LASTPOS are the same&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix -h exome/vcfs/chr20/chr20.filtered.vcf.gz 20:33514465-33514465| tail -n2| cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the low-pass and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
* Q12: Check position 33523840 in the low pass VCF for sample HG00111. &lt;br /&gt;
** What is the genotype assigned by the variant caller? &lt;br /&gt;
** What is your predicted genotype according to the reads piling up at this site? &lt;br /&gt;
** What is the genotype in the exome VCF?&lt;br /&gt;
** What is the genotype after LD refinement?  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=14724</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=14724"/>
		<updated>2017-06-15T07:37:45Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Genotype Refinement Using Linkage Disequilibrium Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd D2.WS03_NGS_variant_calling-CarloSidore/Workshop_low_pass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
Note: The total count of C is 4, but 2 of them are duplicates. Similarly the number of T is 2 but one is an orphan read (underlined). Samtools tview shows them, but they will discarded from further analysis&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz  | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111.&lt;br /&gt;
This time rather than using &amp;quot;zgrep&amp;quot;, that could be very slow for large dataset, we will use &amp;quot;tabix&amp;quot; which provides quick access to every line of the vcf.&lt;br /&gt;
&lt;br /&gt;
We first need to index the .vcf file&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix exome/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
This command creates a .vcf.gz.tbi, the index file which contains position information and allows for quick access.&lt;br /&gt;
&lt;br /&gt;
We can now pick the lines that we want with the notation &amp;quot;CHR:FIRSTPOS-LASTPOS&amp;quot;. Since we are interested in a single position, FIRSTPOS and LASTPOS are the same&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix -h exome/vcfs/chr20/chr20.filtered.vcf.gz 20:33514465-33514465| tail -n2| cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the low-pass and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
* Q12: Check position 33523840 in the low pass VCF for sample HG00111. &lt;br /&gt;
** What is the genotype assigned by the variant caller? &lt;br /&gt;
** What is your predicted genotype according to the reads piling up at this site? &lt;br /&gt;
** What is the genotype in the exome VCF?&lt;br /&gt;
** What is the genotype after LD refinement?  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=14723</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=14723"/>
		<updated>2017-06-15T07:37:02Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Genotype Refinement Using Linkage Disequilibrium Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd D2.WS03_NGS_variant_calling-CarloSidore/Workshop_low_pass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
Note: The total count of C is 4, but 2 of them are duplicates. Similarly the number of T is 2 but one is an orphan read (underlined). Samtools tview shows them, but they will discarded from further analysis&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz  | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111.&lt;br /&gt;
This time rather than using &amp;quot;zgrep&amp;quot;, that could be very slow for large dataset, we will use &amp;quot;tabix&amp;quot; which provides quick access to every line of the vcf.&lt;br /&gt;
&lt;br /&gt;
We first need to index the .vcf file&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix exome/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
This command creates a .vcf.gz.tbi, the index file which contains position information and allows for quick access.&lt;br /&gt;
&lt;br /&gt;
We can now pick the lines that we want with the notation &amp;quot;CHR:FIRSTPOS-LASTPOS&amp;quot;, since we are interested in a single position, FIRSTPOS and LASTPOS are the same&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix -h exome/vcfs/chr20/chr20.filtered.vcf.gz 20:33514465-33514465| tail -n2| cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the low-pass and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
* Q12: Check position 33523840 in the low pass VCF for sample HG00111. &lt;br /&gt;
** What is the genotype assigned by the variant caller? &lt;br /&gt;
** What is your predicted genotype according to the reads piling up at this site? &lt;br /&gt;
** What is the genotype in the exome VCF?&lt;br /&gt;
** What is the genotype after LD refinement?  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=14722</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=14722"/>
		<updated>2017-06-15T07:36:37Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Genotype Refinement Using Linkage Disequilibrium Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd D2.WS03_NGS_variant_calling-CarloSidore/Workshop_low_pass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
Note: The total count of C is 4, but 2 of them are duplicates. Similarly the number of T is 2 but one is an orphan read (underlined). Samtools tview shows them, but they will discarded from further analysis&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz  | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111.&lt;br /&gt;
This time rather than using &amp;quot;zgrep&amp;quot;, that could be very slow for large dataset, we will use &amp;quot;tabix&amp;quot; which provides quick access to every line of the vcf.&lt;br /&gt;
We first need to index the .vcf file&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix exome/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
This command creates a .vcf.gz.tbi, the index file which contains position information and allows for quick access.&lt;br /&gt;
&lt;br /&gt;
We can now pick the lines that we want with the notation &amp;quot;CHR:FIRSTPOS-LASTPOS&amp;quot;, since we are interested in a single position, FIRSTPOS and LASTPOS are the same&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix -h exome/vcfs/chr20/chr20.filtered.vcf.gz 20:33514465-33514465| tail -n2| cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the low-pass and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
* Q12: Check position 33523840 in the low pass VCF for sample HG00111. &lt;br /&gt;
** What is the genotype assigned by the variant caller? &lt;br /&gt;
** What is your predicted genotype according to the reads piling up at this site? &lt;br /&gt;
** What is the genotype in the exome VCF?&lt;br /&gt;
** What is the genotype after LD refinement?  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=14721</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=14721"/>
		<updated>2017-06-15T07:32:11Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Initial set of variant calls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd D2.WS03_NGS_variant_calling-CarloSidore/Workshop_low_pass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
Note: The total count of C is 4, but 2 of them are duplicates. Similarly the number of T is 2 but one is an orphan read (underlined). Samtools tview shows them, but they will discarded from further analysis&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz  | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix -h exome/vcfs/chr20/chr20.filtered.vcf.gz 20:33514465-33514465| tail -n2| cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the low-pass and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
* Q12: Check position 33523840 in the low pass VCF for sample HG00111. &lt;br /&gt;
** What is the genotype assigned by the variant caller? &lt;br /&gt;
** What is your predicted genotype according to the reads piling up at this site? &lt;br /&gt;
** What is the genotype in the exome VCF?&lt;br /&gt;
** What is the genotype after LD refinement?  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=14720</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=14720"/>
		<updated>2017-06-15T07:30:04Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Genotype Refinement Using Linkage Disequilibrium Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd D2.WS03_NGS_variant_calling-CarloSidore/Workshop_low_pass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
Note: The total count of C is 4, but 2 of them are duplicates. Similarly the number of T is 2 but one is an orphan read (underlined). Samtools tview shows them, but they will discarded from further analysis&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix -h snpcall/vcfs/chr20/chr20.filtered.vcf.gz 20:33514465-33514465 | tail -n2 |cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix -h exome/vcfs/chr20/chr20.filtered.vcf.gz 20:33514465-33514465| tail -n2| cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the low-pass and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
* Q12: Check position 33523840 in the low pass VCF for sample HG00111. &lt;br /&gt;
** What is the genotype assigned by the variant caller? &lt;br /&gt;
** What is your predicted genotype according to the reads piling up at this site? &lt;br /&gt;
** What is the genotype in the exome VCF?&lt;br /&gt;
** What is the genotype after LD refinement?  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=14719</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=14719"/>
		<updated>2017-06-15T07:29:14Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Initial set of variant calls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd D2.WS03_NGS_variant_calling-CarloSidore/Workshop_low_pass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
Note: The total count of C is 4, but 2 of them are duplicates. Similarly the number of T is 2 but one is an orphan read (underlined). Samtools tview shows them, but they will discarded from further analysis&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; tabix -h snpcall/vcfs/chr20/chr20.filtered.vcf.gz 20:33514465-33514465 | tail -n2 |cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the low-pass and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
* Q12: Check position 33523840 in the low pass VCF for sample HG00111. &lt;br /&gt;
** What is the genotype assigned by the variant caller? &lt;br /&gt;
** What is your predicted genotype according to the reads piling up at this site? &lt;br /&gt;
** What is the genotype in the exome VCF?&lt;br /&gt;
** What is the genotype after LD refinement?  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=14717</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=14717"/>
		<updated>2017-06-12T13:06:00Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Example Dataset */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd D2.WS03_NGS_variant_calling-CarloSidore/Workshop_low_pass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
Note: The total count of C is 4, but 2 of them are duplicates. Similarly the number of T is 2 but one is an orphan read (underlined). Samtools tview shows them, but they will discarded from further analysis&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the low-pass and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
* Q12: Check position 33523840 in the low pass VCF for sample HG00111. &lt;br /&gt;
** What is the genotype assigned by the variant caller? &lt;br /&gt;
** What is your predicted genotype according to the reads piling up at this site? &lt;br /&gt;
** What is the genotype in the exome VCF?&lt;br /&gt;
** What is the genotype after LD refinement?  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=14254</id>
		<title>Tutorial: Low Pass Sequence Analysis Answers</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=14254"/>
		<updated>2016-06-23T08:10:34Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Low Pass Sequence Analysis Answers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low Pass Sequence Analysis Answers =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The third read in the file is:&lt;br /&gt;
&lt;br /&gt;
 @ERR020230.76497044/1&lt;br /&gt;
 CTGTACTACTAAAGTAAAACTAGTTTTCCAATAGTTTGTTGCAGGATAAGCAGTTTTACTTTTGTTGACAATATGTGTATGAATTTACTTC&lt;br /&gt;
 +&lt;br /&gt;
 DFEEGFKIFKIKLKIJLMMIMKMJKKKIKLMKKLKLLLKKLKLMMJLLJMKMMJLKLLJNLLLIKLJMILKLJKLKKKKKMMMJJJIFJFA&lt;br /&gt;
&lt;br /&gt;
The quality string is the 4th line of each read, then the base quality of the fifth nucleotide is encoded with the character &amp;quot;G&amp;quot;. Its decimal ASCII code is 71, so the base quality of this nucleotide is 38 (71-33) &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q2: Which is the mean depth of the sample HG00108? And the mapping rate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The mean depth is 4.60X and mapping rate is 99.19%. However, keep in mind that these statistics are evaluated only in the 100kb included in our example dataset.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The depth of the sample HG00108 at the position 33594959 is 11, there are 3 G&#039;s and 8 T&#039;s piling up at this position. Just looking at the nucleotide, the most likely genotype would be G/T&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
 33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
The genotype (GT) is encoded as 1/1, which means that both chromosomes carry the alternative allele (ALT), the genotype is then C/C&lt;br /&gt;
The depth at this position is encoded in the GD field and its value is 3.&lt;br /&gt;
Running the mpileup:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33514465| samtools mpileup - | grep 33514465&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  [mpileup] 1 samples in 1 input files&lt;br /&gt;
  &amp;lt;mpileup&amp;gt; Set max per-file depth to 8000&lt;br /&gt;
  20      33514465        N       3       cCc     :65&lt;br /&gt;
&lt;br /&gt;
At this position there are 3 C&#039;s so the result is consistent with the call in the vcf file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Total Depth at Site&amp;quot; is encoded in the INFO field with &amp;quot;DP&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep 33500378 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33500378        DP=37;MQ=58;NS=10;AN=20;AC=15;AF=0.737200;AB=0.6246;AZ=0.9025;FIC=0.1934;SLRT=0.1851;HWEAF=0.7372;HWDAF=0.3125,0.5682;LBS=0,0,0,0,0,1,0,0;OBS=17,14,0,0,5,3,0,0;STR=0.054;STZ=0.335;CBR=0.035;CBZ=0.218;IOR=0.000;IOZ=-0.199;AOI=-180.991;AOZ=-180.792;LQR=0.025;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.026;SVM=0.995957&lt;br /&gt;
&lt;br /&gt;
The total depth at this site is 37 and it is the sum of the depth of the 10 individuals at this position&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q6: How many alternate alleles are found at position 33505937?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The number of alternate alleles (or &amp;quot;Alternate Allele Counts in Samples with Coverage&amp;quot;) is encoded in the INFO field with &amp;quot;AC&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep  33505937 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33505937        DP=54;MQ=59;NS=10;AN=20;AC=14;AF=0.670715;AB=0.4931;AZ=-0.0684;FIC=0.1444;SLRT=0.1432;HWEAF=0.6707;HWDAF=0.3779,0.4753;LBS=0,0,1,3,0,0,0,1;OBS=0,0,14,21,0,0,8,6;STR=0.150;STZ=1.051;CBR=0.295;CBZ=2.068;IOR=0.000;IOZ=-0.154;AOI=-262.472;AOZ=-262.317;LQR=0.093;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.000;SVM=1.03116&lt;br /&gt;
&lt;br /&gt;
At this position, in total there are 14 alternative allele in the 10 individuals genotypes (20 alleles in total).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q7: Is the genotype of HG00108 at position 33538999 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command) &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The sample HG00108 is the 13th column of the file, so :&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33594959&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,13&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00108&lt;br /&gt;
  33594959        G       T       GT:GD:GQ:PL     0/1:11:99:185,0,87&lt;br /&gt;
&lt;br /&gt;
The predicted genotype is then G/T with depth 11, consistent with the mpileup results.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q8: How many variant sites were detected in this dataset?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
193 variants in total&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&#039;&#039;&#039;&lt;br /&gt;
The two genotypes are discordant (0/1 exome vs 1/1 low pass). Since the exome sequenced sample has higher depth (16 vs 3), it should be more accurate (but always double check your variants and your reads to avoid false positive!!)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q10: What can be the reason of the genotype discordance?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason of discordance is in the lower number of reads in the low pass. All the 3 fragments, piling up at this position, belong to the chromosome containing the C allele, there are no fragment from the other chromosome containing the T allele. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00111&lt;br /&gt;
  33514465        T       C       GT:DS:GD:GQ:PL:BD       0|1:1.000:3:10:117,9,0:1.0014&lt;br /&gt;
&lt;br /&gt;
The genotype in the LD-refined vcf and in the exome vcf are now consistent. The LD refinement reconstructs the haplotypes in this small region and it is able to &amp;quot;fix&amp;quot; some genotyping errors generated by the low coverage of the low pass data.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q12: Check position 33523840 in the low pass VCF for sample HG00111.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the genotype assigned by the variant caller?&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is your predicted genotype according to the reads piling up at this site?&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the genotype in the exome VCF?&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;What is the genotype after LD refinement?&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=14253</id>
		<title>Tutorial: Low Pass Sequence Analysis Answers</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=14253"/>
		<updated>2016-06-23T08:10:15Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Low Pass Sequence Analysis Answers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low Pass Sequence Analysis Answers =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The third read in the file is:&lt;br /&gt;
&lt;br /&gt;
 @ERR020230.76497044/1&lt;br /&gt;
 CTGTACTACTAAAGTAAAACTAGTTTTCCAATAGTTTGTTGCAGGATAAGCAGTTTTACTTTTGTTGACAATATGTGTATGAATTTACTTC&lt;br /&gt;
 +&lt;br /&gt;
 DFEEGFKIFKIKLKIJLMMIMKMJKKKIKLMKKLKLLLKKLKLMMJLLJMKMMJLKLLJNLLLIKLJMILKLJKLKKKKKMMMJJJIFJFA&lt;br /&gt;
&lt;br /&gt;
The quality string is the 4th line of each read, then the base quality of the fifth nucleotide is encoded with the character &amp;quot;G&amp;quot;. Its decimal ASCII code is 71, so the base quality of this nucleotide is 38 (71-33) &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q2: Which is the mean depth of the sample HG00108? And the mapping rate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The mean depth is 4.60X and mapping rate is 99.19%. However, keep in mind that these statistics are evaluated only in the 100kb included in our example dataset.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The depth of the sample HG00108 at the position 33594959 is 11, there are 3 G&#039;s and 8 T&#039;s piling up at this position. Just looking at the nucleotide, the most likely genotype would be G/T&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
 33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
The genotype (GT) is encoded as 1/1, which means that both chromosomes carry the alternative allele (ALT), the genotype is then C/C&lt;br /&gt;
The depth at this position is encoded in the GD field and its value is 3.&lt;br /&gt;
Running the mpileup:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33514465| samtools mpileup - | grep 33514465&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  [mpileup] 1 samples in 1 input files&lt;br /&gt;
  &amp;lt;mpileup&amp;gt; Set max per-file depth to 8000&lt;br /&gt;
  20      33514465        N       3       cCc     :65&lt;br /&gt;
&lt;br /&gt;
At this position there are 3 C&#039;s so the result is consistent with the call in the vcf file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Total Depth at Site&amp;quot; is encoded in the INFO field with &amp;quot;DP&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep 33500378 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33500378        DP=37;MQ=58;NS=10;AN=20;AC=15;AF=0.737200;AB=0.6246;AZ=0.9025;FIC=0.1934;SLRT=0.1851;HWEAF=0.7372;HWDAF=0.3125,0.5682;LBS=0,0,0,0,0,1,0,0;OBS=17,14,0,0,5,3,0,0;STR=0.054;STZ=0.335;CBR=0.035;CBZ=0.218;IOR=0.000;IOZ=-0.199;AOI=-180.991;AOZ=-180.792;LQR=0.025;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.026;SVM=0.995957&lt;br /&gt;
&lt;br /&gt;
The total depth at this site is 37 and it is the sum of the depth of the 10 individuals at this position&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q6: How many alternate alleles are found at position 33505937?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The number of alternate alleles (or &amp;quot;Alternate Allele Counts in Samples with Coverage&amp;quot;) is encoded in the INFO field with &amp;quot;AC&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep  33505937 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33505937        DP=54;MQ=59;NS=10;AN=20;AC=14;AF=0.670715;AB=0.4931;AZ=-0.0684;FIC=0.1444;SLRT=0.1432;HWEAF=0.6707;HWDAF=0.3779,0.4753;LBS=0,0,1,3,0,0,0,1;OBS=0,0,14,21,0,0,8,6;STR=0.150;STZ=1.051;CBR=0.295;CBZ=2.068;IOR=0.000;IOZ=-0.154;AOI=-262.472;AOZ=-262.317;LQR=0.093;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.000;SVM=1.03116&lt;br /&gt;
&lt;br /&gt;
At this position, in total there are 14 alternative allele in the 10 individuals genotypes (20 alleles in total).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q7: Is the genotype of HG00108 at position 33538999 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command) &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The sample HG00108 is the 13th column of the file, so :&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33594959&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,13&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00108&lt;br /&gt;
  33594959        G       T       GT:GD:GQ:PL     0/1:11:99:185,0,87&lt;br /&gt;
&lt;br /&gt;
The predicted genotype is then G/T with depth 11, consistent with the mpileup results.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q8: How many variant sites were detected in this dataset?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
193 variants in total&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&#039;&#039;&#039;&lt;br /&gt;
The two genotypes are discordant (0/1 exome vs 1/1 low pass). Since the exome sequenced sample has higher depth (16 vs 3), it should be more accurate (but always double check your variants and your reads to avoid false positive!!)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q10: What can be the reason of the genotype discordance?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason of discordance is in the lower number of reads in the low pass. All the 3 fragments, piling up at this position, belong to the chromosome containing the C allele, there are no fragment from the other chromosome containing the T allele. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00111&lt;br /&gt;
  33514465        T       C       GT:DS:GD:GQ:PL:BD       0|1:1.000:3:10:117,9,0:1.0014&lt;br /&gt;
&lt;br /&gt;
The genotype in the LD-refined vcf and in the exome vcf are now consistent. The LD refinement reconstructs the haplotypes in this small region and it is able to &amp;quot;fix&amp;quot; some genotyping errors generated by the low coverage of the low pass data.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q12: Check position 33523840 in the low pass VCF for sample HG00111.&lt;br /&gt;
&lt;br /&gt;
**&#039;&#039;&#039;What is the genotype assigned by the variant caller?&lt;br /&gt;
&lt;br /&gt;
**&#039;&#039;&#039;What is your predicted genotype according to the reads piling up at this site?&lt;br /&gt;
&lt;br /&gt;
**&#039;&#039;&#039;What is the genotype in the exome VCF?&lt;br /&gt;
&lt;br /&gt;
**&#039;&#039;&#039;What is the genotype after LD refinement?&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=14252</id>
		<title>Tutorial: Low Pass Sequence Analysis Answers</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=14252"/>
		<updated>2016-06-23T08:09:15Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Low Pass Sequence Analysis Answers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low Pass Sequence Analysis Answers =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The third read in the file is:&lt;br /&gt;
&lt;br /&gt;
 @ERR020230.76497044/1&lt;br /&gt;
 CTGTACTACTAAAGTAAAACTAGTTTTCCAATAGTTTGTTGCAGGATAAGCAGTTTTACTTTTGTTGACAATATGTGTATGAATTTACTTC&lt;br /&gt;
 +&lt;br /&gt;
 DFEEGFKIFKIKLKIJLMMIMKMJKKKIKLMKKLKLLLKKLKLMMJLLJMKMMJLKLLJNLLLIKLJMILKLJKLKKKKKMMMJJJIFJFA&lt;br /&gt;
&lt;br /&gt;
The quality string is the 4th line of each read, then the base quality of the fifth nucleotide is encoded with the character &amp;quot;G&amp;quot;. Its decimal ASCII code is 71, so the base quality of this nucleotide is 38 (71-33) &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q2: Which is the mean depth of the sample HG00108? And the mapping rate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The mean depth is 4.60X and mapping rate is 99.19%. However, keep in mind that these statistics are evaluated only in the 100kb included in our example dataset.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The depth of the sample HG00108 at the position 33594959 is 11, there are 3 G&#039;s and 8 T&#039;s piling up at this position. Just looking at the nucleotide, the most likely genotype would be G/T&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
 33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
The genotype (GT) is encoded as 1/1, which means that both chromosomes carry the alternative allele (ALT), the genotype is then C/C&lt;br /&gt;
The depth at this position is encoded in the GD field and its value is 3.&lt;br /&gt;
Running the mpileup:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33514465| samtools mpileup - | grep 33514465&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  [mpileup] 1 samples in 1 input files&lt;br /&gt;
  &amp;lt;mpileup&amp;gt; Set max per-file depth to 8000&lt;br /&gt;
  20      33514465        N       3       cCc     :65&lt;br /&gt;
&lt;br /&gt;
At this position there are 3 C&#039;s so the result is consistent with the call in the vcf file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Total Depth at Site&amp;quot; is encoded in the INFO field with &amp;quot;DP&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep 33500378 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33500378        DP=37;MQ=58;NS=10;AN=20;AC=15;AF=0.737200;AB=0.6246;AZ=0.9025;FIC=0.1934;SLRT=0.1851;HWEAF=0.7372;HWDAF=0.3125,0.5682;LBS=0,0,0,0,0,1,0,0;OBS=17,14,0,0,5,3,0,0;STR=0.054;STZ=0.335;CBR=0.035;CBZ=0.218;IOR=0.000;IOZ=-0.199;AOI=-180.991;AOZ=-180.792;LQR=0.025;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.026;SVM=0.995957&lt;br /&gt;
&lt;br /&gt;
The total depth at this site is 37 and it is the sum of the depth of the 10 individuals at this position&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q6: How many alternate alleles are found at position 33505937?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The number of alternate alleles (or &amp;quot;Alternate Allele Counts in Samples with Coverage&amp;quot;) is encoded in the INFO field with &amp;quot;AC&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep  33505937 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33505937        DP=54;MQ=59;NS=10;AN=20;AC=14;AF=0.670715;AB=0.4931;AZ=-0.0684;FIC=0.1444;SLRT=0.1432;HWEAF=0.6707;HWDAF=0.3779,0.4753;LBS=0,0,1,3,0,0,0,1;OBS=0,0,14,21,0,0,8,6;STR=0.150;STZ=1.051;CBR=0.295;CBZ=2.068;IOR=0.000;IOZ=-0.154;AOI=-262.472;AOZ=-262.317;LQR=0.093;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.000;SVM=1.03116&lt;br /&gt;
&lt;br /&gt;
At this position, in total there are 14 alternative allele in the 10 individuals genotypes (20 alleles in total).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q7: Is the genotype of HG00108 at position 33538999 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command) &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The sample HG00108 is the 13th column of the file, so :&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33594959&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,13&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00108&lt;br /&gt;
  33594959        G       T       GT:GD:GQ:PL     0/1:11:99:185,0,87&lt;br /&gt;
&lt;br /&gt;
The predicted genotype is then G/T with depth 11, consistent with the mpileup results.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q8: How many variant sites were detected in this dataset?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
193 variants in total&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&#039;&#039;&#039;&lt;br /&gt;
The two genotypes are discordant (0/1 exome vs 1/1 low pass). Since the exome sequenced sample has higher depth (16 vs 3), it should be more accurate (but always double check your variants and your reads to avoid false positive!!)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q10: What can be the reason of the genotype discordance?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason of discordance is in the lower number of reads in the low pass. All the 3 fragments, piling up at this position, belong to the chromosome containing the C allele, there are no fragment from the other chromosome containing the T allele. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00111&lt;br /&gt;
  33514465        T       C       GT:DS:GD:GQ:PL:BD       0|1:1.000:3:10:117,9,0:1.0014&lt;br /&gt;
&lt;br /&gt;
The genotype in the LD-refined vcf and in the exome vcf are now consistent. The LD refinement reconstructs the haplotypes in this small region and it is able to &amp;quot;fix&amp;quot; some genotyping errors generated by the low coverage of the low pass data.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q12: Check position 33523840 in the low pass VCF for sample HG00111.&lt;br /&gt;
&lt;br /&gt;
** &#039;&#039;&#039;What is the genotype assigned by the variant caller?&lt;br /&gt;
&lt;br /&gt;
** &#039;&#039;&#039;What is your predicted genotype according to the reads piling up at this site?&lt;br /&gt;
&lt;br /&gt;
** &#039;&#039;&#039;What is the genotype in the exome VCF?&lt;br /&gt;
&lt;br /&gt;
** &#039;&#039;&#039;What is the genotype after LD refinement?&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=14251</id>
		<title>Tutorial: Low Pass Sequence Analysis Answers</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=14251"/>
		<updated>2016-06-23T08:08:19Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Low Pass Sequence Analysis Answers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low Pass Sequence Analysis Answers =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The third read in the file is:&lt;br /&gt;
&lt;br /&gt;
 @ERR020230.76497044/1&lt;br /&gt;
 CTGTACTACTAAAGTAAAACTAGTTTTCCAATAGTTTGTTGCAGGATAAGCAGTTTTACTTTTGTTGACAATATGTGTATGAATTTACTTC&lt;br /&gt;
 +&lt;br /&gt;
 DFEEGFKIFKIKLKIJLMMIMKMJKKKIKLMKKLKLLLKKLKLMMJLLJMKMMJLKLLJNLLLIKLJMILKLJKLKKKKKMMMJJJIFJFA&lt;br /&gt;
&lt;br /&gt;
The quality string is the 4th line of each read, then the base quality of the fifth nucleotide is encoded with the character &amp;quot;G&amp;quot;. Its decimal ASCII code is 71, so the base quality of this nucleotide is 38 (71-33) &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q2: Which is the mean depth of the sample HG00108? And the mapping rate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The mean depth is 4.60X and mapping rate is 99.19%. However, keep in mind that these statistics are evaluated only in the 100kb included in our example dataset.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The depth of the sample HG00108 at the position 33594959 is 11, there are 3 G&#039;s and 8 T&#039;s piling up at this position. Just looking at the nucleotide, the most likely genotype would be G/T&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
 33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
The genotype (GT) is encoded as 1/1, which means that both chromosomes carry the alternative allele (ALT), the genotype is then C/C&lt;br /&gt;
The depth at this position is encoded in the GD field and its value is 3.&lt;br /&gt;
Running the mpileup:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33514465| samtools mpileup - | grep 33514465&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  [mpileup] 1 samples in 1 input files&lt;br /&gt;
  &amp;lt;mpileup&amp;gt; Set max per-file depth to 8000&lt;br /&gt;
  20      33514465        N       3       cCc     :65&lt;br /&gt;
&lt;br /&gt;
At this position there are 3 C&#039;s so the result is consistent with the call in the vcf file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Total Depth at Site&amp;quot; is encoded in the INFO field with &amp;quot;DP&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep 33500378 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33500378        DP=37;MQ=58;NS=10;AN=20;AC=15;AF=0.737200;AB=0.6246;AZ=0.9025;FIC=0.1934;SLRT=0.1851;HWEAF=0.7372;HWDAF=0.3125,0.5682;LBS=0,0,0,0,0,1,0,0;OBS=17,14,0,0,5,3,0,0;STR=0.054;STZ=0.335;CBR=0.035;CBZ=0.218;IOR=0.000;IOZ=-0.199;AOI=-180.991;AOZ=-180.792;LQR=0.025;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.026;SVM=0.995957&lt;br /&gt;
&lt;br /&gt;
The total depth at this site is 37 and it is the sum of the depth of the 10 individuals at this position&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q6: How many alternate alleles are found at position 33505937?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The number of alternate alleles (or &amp;quot;Alternate Allele Counts in Samples with Coverage&amp;quot;) is encoded in the INFO field with &amp;quot;AC&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep  33505937 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33505937        DP=54;MQ=59;NS=10;AN=20;AC=14;AF=0.670715;AB=0.4931;AZ=-0.0684;FIC=0.1444;SLRT=0.1432;HWEAF=0.6707;HWDAF=0.3779,0.4753;LBS=0,0,1,3,0,0,0,1;OBS=0,0,14,21,0,0,8,6;STR=0.150;STZ=1.051;CBR=0.295;CBZ=2.068;IOR=0.000;IOZ=-0.154;AOI=-262.472;AOZ=-262.317;LQR=0.093;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.000;SVM=1.03116&lt;br /&gt;
&lt;br /&gt;
At this position, in total there are 14 alternative allele in the 10 individuals genotypes (20 alleles in total).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q7: Is the genotype of HG00108 at position 33538999 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command) &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The sample HG00108 is the 13th column of the file, so :&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33594959&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,13&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00108&lt;br /&gt;
  33594959        G       T       GT:GD:GQ:PL     0/1:11:99:185,0,87&lt;br /&gt;
&lt;br /&gt;
The predicted genotype is then G/T with depth 11, consistent with the mpileup results.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q8: How many variant sites were detected in this dataset?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
193 variants in total&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&#039;&#039;&#039;&lt;br /&gt;
The two genotypes are discordant (0/1 exome vs 1/1 low pass). Since the exome sequenced sample has higher depth (16 vs 3), it should be more accurate (but always double check your variants and your reads to avoid false positive!!)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q10: What can be the reason of the genotype discordance?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason of discordance is in the lower number of reads in the low pass. All the 3 fragments, piling up at this position, belong to the chromosome containing the C allele, there are no fragment from the other chromosome containing the T allele. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00111&lt;br /&gt;
  33514465        T       C       GT:DS:GD:GQ:PL:BD       0|1:1.000:3:10:117,9,0:1.0014&lt;br /&gt;
&lt;br /&gt;
The genotype in the LD-refined vcf and in the exome vcf are now consistent. The LD refinement reconstructs the haplotypes in this small region and it is able to &amp;quot;fix&amp;quot; some genotyping errors generated by the low coverage of the low pass data.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q12: Check position 33523840 in the low pass VCF for sample HG00111.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the genotype assigned by the variant caller?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is your predicted genotype according to the reads piling up at this site?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the genotype in the exome VCF?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the genotype after LD refinement?&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=14250</id>
		<title>Tutorial: Low Pass Sequence Analysis Answers</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=14250"/>
		<updated>2016-06-23T08:07:48Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Low Pass Sequence Analysis Answers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low Pass Sequence Analysis Answers =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The third read in the file is:&lt;br /&gt;
&lt;br /&gt;
 @ERR020230.76497044/1&lt;br /&gt;
 CTGTACTACTAAAGTAAAACTAGTTTTCCAATAGTTTGTTGCAGGATAAGCAGTTTTACTTTTGTTGACAATATGTGTATGAATTTACTTC&lt;br /&gt;
 +&lt;br /&gt;
 DFEEGFKIFKIKLKIJLMMIMKMJKKKIKLMKKLKLLLKKLKLMMJLLJMKMMJLKLLJNLLLIKLJMILKLJKLKKKKKMMMJJJIFJFA&lt;br /&gt;
&lt;br /&gt;
The quality string is the 4th line of each read, then the base quality of the fifth nucleotide is encoded with the character &amp;quot;G&amp;quot;. Its decimal ASCII code is 71, so the base quality of this nucleotide is 38 (71-33) &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q2: Which is the mean depth of the sample HG00108? And the mapping rate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The mean depth is 4.60X and mapping rate is 99.19%. However, keep in mind that these statistics are evaluated only in the 100kb included in our example dataset.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The depth of the sample HG00108 at the position 33594959 is 11, there are 3 G&#039;s and 8 T&#039;s piling up at this position. Just looking at the nucleotide, the most likely genotype would be G/T&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
 33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
The genotype (GT) is encoded as 1/1, which means that both chromosomes carry the alternative allele (ALT), the genotype is then C/C&lt;br /&gt;
The depth at this position is encoded in the GD field and its value is 3.&lt;br /&gt;
Running the mpileup:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33514465| samtools mpileup - | grep 33514465&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  [mpileup] 1 samples in 1 input files&lt;br /&gt;
  &amp;lt;mpileup&amp;gt; Set max per-file depth to 8000&lt;br /&gt;
  20      33514465        N       3       cCc     :65&lt;br /&gt;
&lt;br /&gt;
At this position there are 3 C&#039;s so the result is consistent with the call in the vcf file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Total Depth at Site&amp;quot; is encoded in the INFO field with &amp;quot;DP&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep 33500378 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33500378        DP=37;MQ=58;NS=10;AN=20;AC=15;AF=0.737200;AB=0.6246;AZ=0.9025;FIC=0.1934;SLRT=0.1851;HWEAF=0.7372;HWDAF=0.3125,0.5682;LBS=0,0,0,0,0,1,0,0;OBS=17,14,0,0,5,3,0,0;STR=0.054;STZ=0.335;CBR=0.035;CBZ=0.218;IOR=0.000;IOZ=-0.199;AOI=-180.991;AOZ=-180.792;LQR=0.025;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.026;SVM=0.995957&lt;br /&gt;
&lt;br /&gt;
The total depth at this site is 37 and it is the sum of the depth of the 10 individuals at this position&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q6: How many alternate alleles are found at position 33505937?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The number of alternate alleles (or &amp;quot;Alternate Allele Counts in Samples with Coverage&amp;quot;) is encoded in the INFO field with &amp;quot;AC&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep  33505937 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33505937        DP=54;MQ=59;NS=10;AN=20;AC=14;AF=0.670715;AB=0.4931;AZ=-0.0684;FIC=0.1444;SLRT=0.1432;HWEAF=0.6707;HWDAF=0.3779,0.4753;LBS=0,0,1,3,0,0,0,1;OBS=0,0,14,21,0,0,8,6;STR=0.150;STZ=1.051;CBR=0.295;CBZ=2.068;IOR=0.000;IOZ=-0.154;AOI=-262.472;AOZ=-262.317;LQR=0.093;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.000;SVM=1.03116&lt;br /&gt;
&lt;br /&gt;
At this position, in total there are 14 alternative allele in the 10 individuals genotypes (20 alleles in total).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q7: Is the genotype of HG00108 at position 33538999 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command) &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The sample HG00108 is the 13th column of the file, so :&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33594959&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,13&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00108&lt;br /&gt;
  33594959        G       T       GT:GD:GQ:PL     0/1:11:99:185,0,87&lt;br /&gt;
&lt;br /&gt;
The predicted genotype is then G/T with depth 11, consistent with the mpileup results.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q8: How many variant sites were detected in this dataset?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
193 variants in total&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&#039;&#039;&#039;&lt;br /&gt;
The two genotypes are discordant (0/1 exome vs 1/1 low pass). Since the exome sequenced sample has higher depth (16 vs 3), it should be more accurate (but always double check your variants and your reads to avoid false positive!!)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q10: What can be the reason of the genotype discordance?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason of discordance is in the lower number of reads in the low pass. All the 3 fragments, piling up at this position, belong to the chromosome containing the C allele, there are no fragment from the other chromosome containing the T allele. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00111&lt;br /&gt;
  33514465        T       C       GT:DS:GD:GQ:PL:BD       0|1:1.000:3:10:117,9,0:1.0014&lt;br /&gt;
&lt;br /&gt;
The genotype in the LD-refined vcf and in the exome vcf are now consistent. The LD refinement reconstructs the haplotypes in this small region and it is able to &amp;quot;fix&amp;quot; some genotyping errors generated by the low coverage of the low pass data.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q12: Check position 33523840 in the low pass VCF for sample HG00111.&lt;br /&gt;
&lt;br /&gt;
What is the genotype assigned by the variant caller?&lt;br /&gt;
&lt;br /&gt;
What is your predicted genotype according to the reads piling up at this site?&lt;br /&gt;
&lt;br /&gt;
What is the genotype in the exome VCF?&lt;br /&gt;
&lt;br /&gt;
What is the genotype after LD refinement?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=14249</id>
		<title>Tutorial: Low Pass Sequence Analysis Answers</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=14249"/>
		<updated>2016-06-23T08:07:23Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Low Pass Sequence Analysis Answers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low Pass Sequence Analysis Answers =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The third read in the file is:&lt;br /&gt;
&lt;br /&gt;
 @ERR020230.76497044/1&lt;br /&gt;
 CTGTACTACTAAAGTAAAACTAGTTTTCCAATAGTTTGTTGCAGGATAAGCAGTTTTACTTTTGTTGACAATATGTGTATGAATTTACTTC&lt;br /&gt;
 +&lt;br /&gt;
 DFEEGFKIFKIKLKIJLMMIMKMJKKKIKLMKKLKLLLKKLKLMMJLLJMKMMJLKLLJNLLLIKLJMILKLJKLKKKKKMMMJJJIFJFA&lt;br /&gt;
&lt;br /&gt;
The quality string is the 4th line of each read, then the base quality of the fifth nucleotide is encoded with the character &amp;quot;G&amp;quot;. Its decimal ASCII code is 71, so the base quality of this nucleotide is 38 (71-33) &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q2: Which is the mean depth of the sample HG00108? And the mapping rate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The mean depth is 4.60X and mapping rate is 99.19%. However, keep in mind that these statistics are evaluated only in the 100kb included in our example dataset.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The depth of the sample HG00108 at the position 33594959 is 11, there are 3 G&#039;s and 8 T&#039;s piling up at this position. Just looking at the nucleotide, the most likely genotype would be G/T&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
 33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
The genotype (GT) is encoded as 1/1, which means that both chromosomes carry the alternative allele (ALT), the genotype is then C/C&lt;br /&gt;
The depth at this position is encoded in the GD field and its value is 3.&lt;br /&gt;
Running the mpileup:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33514465| samtools mpileup - | grep 33514465&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  [mpileup] 1 samples in 1 input files&lt;br /&gt;
  &amp;lt;mpileup&amp;gt; Set max per-file depth to 8000&lt;br /&gt;
  20      33514465        N       3       cCc     :65&lt;br /&gt;
&lt;br /&gt;
At this position there are 3 C&#039;s so the result is consistent with the call in the vcf file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Total Depth at Site&amp;quot; is encoded in the INFO field with &amp;quot;DP&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep 33500378 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33500378        DP=37;MQ=58;NS=10;AN=20;AC=15;AF=0.737200;AB=0.6246;AZ=0.9025;FIC=0.1934;SLRT=0.1851;HWEAF=0.7372;HWDAF=0.3125,0.5682;LBS=0,0,0,0,0,1,0,0;OBS=17,14,0,0,5,3,0,0;STR=0.054;STZ=0.335;CBR=0.035;CBZ=0.218;IOR=0.000;IOZ=-0.199;AOI=-180.991;AOZ=-180.792;LQR=0.025;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.026;SVM=0.995957&lt;br /&gt;
&lt;br /&gt;
The total depth at this site is 37 and it is the sum of the depth of the 10 individuals at this position&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q6: How many alternate alleles are found at position 33505937?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The number of alternate alleles (or &amp;quot;Alternate Allele Counts in Samples with Coverage&amp;quot;) is encoded in the INFO field with &amp;quot;AC&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep  33505937 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33505937        DP=54;MQ=59;NS=10;AN=20;AC=14;AF=0.670715;AB=0.4931;AZ=-0.0684;FIC=0.1444;SLRT=0.1432;HWEAF=0.6707;HWDAF=0.3779,0.4753;LBS=0,0,1,3,0,0,0,1;OBS=0,0,14,21,0,0,8,6;STR=0.150;STZ=1.051;CBR=0.295;CBZ=2.068;IOR=0.000;IOZ=-0.154;AOI=-262.472;AOZ=-262.317;LQR=0.093;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.000;SVM=1.03116&lt;br /&gt;
&lt;br /&gt;
At this position, in total there are 14 alternative allele in the 10 individuals genotypes (20 alleles in total).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q7: Is the genotype of HG00108 at position 33538999 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command) &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The sample HG00108 is the 13th column of the file, so :&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33594959&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,13&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00108&lt;br /&gt;
  33594959        G       T       GT:GD:GQ:PL     0/1:11:99:185,0,87&lt;br /&gt;
&lt;br /&gt;
The predicted genotype is then G/T with depth 11, consistent with the mpileup results.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q8: How many variant sites were detected in this dataset?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
193 variants in total&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&#039;&#039;&#039;&lt;br /&gt;
The two genotypes are discordant (0/1 exome vs 1/1 low pass). Since the exome sequenced sample has higher depth (16 vs 3), it should be more accurate (but always double check your variants and your reads to avoid false positive!!)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q10: What can be the reason of the genotype discordance?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason of discordance is in the lower number of reads in the low pass. All the 3 fragments, piling up at this position, belong to the chromosome containing the C allele, there are no fragment from the other chromosome containing the T allele. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00111&lt;br /&gt;
  33514465        T       C       GT:DS:GD:GQ:PL:BD       0|1:1.000:3:10:117,9,0:1.0014&lt;br /&gt;
&lt;br /&gt;
The genotype in the LD-refined vcf and in the exome vcf are now consistent. The LD refinement reconstructs the haplotypes in this small region and it is able to &amp;quot;fix&amp;quot; some genotyping errors generated by the low coverage of the low pass data.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q12: Check position 33523840 in the low pass VCF for sample HG00111.&lt;br /&gt;
What is the genotype assigned by the variant caller?&lt;br /&gt;
What is your predicted genotype according to the reads piling up at this site?&lt;br /&gt;
What is the genotype in the exome VCF?&lt;br /&gt;
What is the genotype after LD refinement?&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=14248</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=14248"/>
		<updated>2016-06-23T08:05:49Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Genotype Refinement Using Linkage Disequilibrium Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
Note: The total count of C is 4, but 2 of them are duplicates. Similarly the number of T is 2 but one is an orphan read (underlined). Samtools tview shows them, but they will discarded from further analysis&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the low-pass and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
* Q12: Check position 33523840 in the low pass VCF for sample HG00111. &lt;br /&gt;
** What is the genotype assigned by the variant caller? &lt;br /&gt;
** What is your predicted genotype according to the reads piling up at this site? &lt;br /&gt;
** What is the genotype in the exome VCF?&lt;br /&gt;
** What is the genotype after LD refinement?  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=13551</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=13551"/>
		<updated>2015-06-23T13:02:54Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Browsing Alignment Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
Note: The total count of C is 4, but 2 of them are duplicates. Similarly the number of T is 2 but one is an orphan read (underlined). Samtools tview shows them, but they will discarded from further analysis&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=13534</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=13534"/>
		<updated>2015-06-18T09:25:51Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Initial set of variant calls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 6 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
Note: The total count of C is 6, but 2 of them are duplicates. Similarly the number of T is 2 but one is an orphan read (underlined). Samtools tview shows them, but they will discarded from further analysis&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=13202</id>
		<title>Tutorial: Low Pass Sequence Analysis Answers</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=13202"/>
		<updated>2015-05-11T10:39:31Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Low Pass Sequence Analysis Answers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low Pass Sequence Analysis Answers =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The third read in the file is:&lt;br /&gt;
&lt;br /&gt;
 @ERR020230.76497044/1&lt;br /&gt;
 CTGTACTACTAAAGTAAAACTAGTTTTCCAATAGTTTGTTGCAGGATAAGCAGTTTTACTTTTGTTGACAATATGTGTATGAATTTACTTC&lt;br /&gt;
 +&lt;br /&gt;
 DFEEGFKIFKIKLKIJLMMIMKMJKKKIKLMKKLKLLLKKLKLMMJLLJMKMMJLKLLJNLLLIKLJMILKLJKLKKKKKMMMJJJIFJFA&lt;br /&gt;
&lt;br /&gt;
The quality string is the 4th line of each read, then the base quality of the fifth nucleotide is encoded with the character &amp;quot;G&amp;quot;. Its decimal ASCII code is 71, so the base quality of this nucleotide is 38 (71-33) &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q2: Which is the mean depth of the sample HG00108? And the mapping rate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The mean depth is 4.60X and mapping rate is 99.19%. However, keep in mind that these statistics are evaluated only in the 100kb included in our example dataset.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The depth of the sample HG00108 at the position 33594959 is 11, there are 3 G&#039;s and 8 T&#039;s piling up at this position. Just looking at the nucleotide, the most likely genotype would be G/T&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
 33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
The genotype (GT) is encoded as 1/1, which means that both chromosomes carry the alternative allele (ALT), the genotype is then C/C&lt;br /&gt;
The depth at this position is encoded in the GD field and its value is 3.&lt;br /&gt;
Running the mpileup:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33514465| samtools mpileup - | grep 33514465&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  [mpileup] 1 samples in 1 input files&lt;br /&gt;
  &amp;lt;mpileup&amp;gt; Set max per-file depth to 8000&lt;br /&gt;
  20      33514465        N       3       cCc     :65&lt;br /&gt;
&lt;br /&gt;
At this position there are 3 C&#039;s so the result is consistent with the call in the vcf file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Total Depth at Site&amp;quot; is encoded in the INFO field with &amp;quot;DP&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep 33500378 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33500378        DP=37;MQ=58;NS=10;AN=20;AC=15;AF=0.737200;AB=0.6246;AZ=0.9025;FIC=0.1934;SLRT=0.1851;HWEAF=0.7372;HWDAF=0.3125,0.5682;LBS=0,0,0,0,0,1,0,0;OBS=17,14,0,0,5,3,0,0;STR=0.054;STZ=0.335;CBR=0.035;CBZ=0.218;IOR=0.000;IOZ=-0.199;AOI=-180.991;AOZ=-180.792;LQR=0.025;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.026;SVM=0.995957&lt;br /&gt;
&lt;br /&gt;
The total depth at this site is 37 and it is the sum of the depth of the 10 individuals at this position&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q6: How many alternate alleles are found at position 33505937?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The number of alternate alleles (or &amp;quot;Alternate Allele Counts in Samples with Coverage&amp;quot;) is encoded in the INFO field with &amp;quot;AC&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep  33505937 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33505937        DP=54;MQ=59;NS=10;AN=20;AC=14;AF=0.670715;AB=0.4931;AZ=-0.0684;FIC=0.1444;SLRT=0.1432;HWEAF=0.6707;HWDAF=0.3779,0.4753;LBS=0,0,1,3,0,0,0,1;OBS=0,0,14,21,0,0,8,6;STR=0.150;STZ=1.051;CBR=0.295;CBZ=2.068;IOR=0.000;IOZ=-0.154;AOI=-262.472;AOZ=-262.317;LQR=0.093;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.000;SVM=1.03116&lt;br /&gt;
&lt;br /&gt;
At this position, in total there are 14 alternative allele in the 10 individuals genotypes (20 alleles in total).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q7: Is the genotype of HG00108 at position 33538999 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command) &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The sample HG00108 is the 13th column of the file, so :&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33594959&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,13&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00108&lt;br /&gt;
  33594959        G       T       GT:GD:GQ:PL     0/1:11:99:185,0,87&lt;br /&gt;
&lt;br /&gt;
The predicted genotype is then G/T with depth 11, consistent with the mpileup results.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q8: How many variant sites were detected in this dataset?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
193 variants in total&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&#039;&#039;&#039;&lt;br /&gt;
The two genotypes are discordant (0/1 exome vs 1/1 low pass). Since the exome sequenced sample has higher depth (16 vs 3), it should be more accurate (but always double check your variants and your reads to avoid false positive!!)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q10: What can be the reason of the genotype discordance?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason of discordance is in the lower number of reads in the low pass. All the 3 fragments, piling up at this position, belong to the chromosome containing the C allele, there are no fragment from the other chromosome containing the T allele. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00111&lt;br /&gt;
  33514465        T       C       GT:DS:GD:GQ:PL:BD       0|1:1.000:3:10:117,9,0:1.0014&lt;br /&gt;
&lt;br /&gt;
The genotype in the LD-refined vcf and in the exome vcf are now consistent. The LD refinement reconstructs the haplotypes in this small region and it is able to &amp;quot;fix&amp;quot; some genotyping errors generated by the low coverage of the low pass data.&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=13201</id>
		<title>Tutorial: Low Pass Sequence Analysis Answers</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=13201"/>
		<updated>2015-05-11T10:39:04Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Low Pass Sequence Analysis Answers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low Pass Sequence Analysis Answers =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The third read in the file is:&lt;br /&gt;
&lt;br /&gt;
 @ERR020230.76497044/1&lt;br /&gt;
 CTGTACTACTAAAGTAAAACTAGTTTTCCAATAGTTTGTTGCAGGATAAGCAGTTTTACTTTTGTTGACAATATGTGTATGAATTTACTTC&lt;br /&gt;
 +&lt;br /&gt;
 DFEEGFKIFKIKLKIJLMMIMKMJKKKIKLMKKLKLLLKKLKLMMJLLJMKMMJLKLLJNLLLIKLJMILKLJKLKKKKKMMMJJJIFJFA&lt;br /&gt;
&lt;br /&gt;
The quality string is the 4th line of each read, then the base quality of the fifth nucleotide is encoded with the character &amp;quot;G&amp;quot;. Its decimal ASCII code is 71, so the base quality of this nucleotide is 38 (71-33) &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q2: Which is the mean depth of the sample HG00108? And the mapping rate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The mean depth is 4.60X and mapping rate is 99.19%. However, keep in mind that these statistics are evaluated only in the 100kb included in our example dataset.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The depth of the sample HG00108 at the position 33594959 is 11, there are 3 G&#039;s and 8 T&#039;s piling up at this position. Just looking at the nucleotide, the most likely genotype would be G/T&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
 33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
The genotype (GT) is encoded as 1/1, which means that both chromosomes carry the alternative allele (ALT), the genotype is then C/C&lt;br /&gt;
The depth at this position is encoded in the GD field and its value is 3.&lt;br /&gt;
Running the mpileup:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33514465| samtools mpileup - | grep 33514465&lt;br /&gt;
&lt;br /&gt;
  [bam_header_read] EOF marker is absent. The input is probably truncated.&lt;br /&gt;
  [mpileup] 1 samples in 1 input files&lt;br /&gt;
  &amp;lt;mpileup&amp;gt; Set max per-file depth to 8000&lt;br /&gt;
  20      33514465        N       3       cCc     :65&lt;br /&gt;
&lt;br /&gt;
At this position there are 3 C&#039;s so the result is consistent with the call in the vcf file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Total Depth at Site&amp;quot; is encoded in the INFO field with &amp;quot;DP&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep 33500378 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33500378        DP=37;MQ=58;NS=10;AN=20;AC=15;AF=0.737200;AB=0.6246;AZ=0.9025;FIC=0.1934;SLRT=0.1851;HWEAF=0.7372;HWDAF=0.3125,0.5682;LBS=0,0,0,0,0,1,0,0;OBS=17,14,0,0,5,3,0,0;STR=0.054;STZ=0.335;CBR=0.035;CBZ=0.218;IOR=0.000;IOZ=-0.199;AOI=-180.991;AOZ=-180.792;LQR=0.025;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.026;SVM=0.995957&lt;br /&gt;
&lt;br /&gt;
The total depth at this site is 37 and it is the sum of the depth of the 10 individuals at this position&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q6: How many alternate alleles are found at position 33505937?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The number of alternate alleles (or &amp;quot;Alternate Allele Counts in Samples with Coverage&amp;quot;) is encoded in the INFO field with &amp;quot;AC&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep  33505937 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33505937        DP=54;MQ=59;NS=10;AN=20;AC=14;AF=0.670715;AB=0.4931;AZ=-0.0684;FIC=0.1444;SLRT=0.1432;HWEAF=0.6707;HWDAF=0.3779,0.4753;LBS=0,0,1,3,0,0,0,1;OBS=0,0,14,21,0,0,8,6;STR=0.150;STZ=1.051;CBR=0.295;CBZ=2.068;IOR=0.000;IOZ=-0.154;AOI=-262.472;AOZ=-262.317;LQR=0.093;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.000;SVM=1.03116&lt;br /&gt;
&lt;br /&gt;
At this position, in total there are 14 alternative allele in the 10 individuals genotypes (20 alleles in total).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q7: Is the genotype of HG00108 at position 33538999 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command) &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The sample HG00108 is the 13th column of the file, so :&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33594959&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,13&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00108&lt;br /&gt;
  33594959        G       T       GT:GD:GQ:PL     0/1:11:99:185,0,87&lt;br /&gt;
&lt;br /&gt;
The predicted genotype is then G/T with depth 11, consistent with the mpileup results.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q8: How many variant sites were detected in this dataset?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
193 variants in total&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&#039;&#039;&#039;&lt;br /&gt;
The two genotypes are discordant (0/1 exome vs 1/1 low pass). Since the exome sequenced sample has higher depth (16 vs 3), it should be more accurate (but always double check your variants and your reads to avoid false positive!!)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q10: What can be the reason of the genotype discordance?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason of discordance is in the lower number of reads in the low pass. All the 3 fragments, piling up at this position, belong to the chromosome containing the C allele, there are no fragment from the other chromosome containing the T allele. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00111&lt;br /&gt;
  33514465        T       C       GT:DS:GD:GQ:PL:BD       0|1:1.000:3:10:117,9,0:1.0014&lt;br /&gt;
&lt;br /&gt;
The genotype in the LD-refined vcf and in the exome vcf are now consistent. The LD refinement reconstructs the haplotypes in this small region and it is able to &amp;quot;fix&amp;quot; some genotyping errors generated by the low coverage of the low pass data.&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=13200</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=13200"/>
		<updated>2015-05-11T10:28:18Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Browsing Alignment Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 6 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
Note: The total count of C is 6, but 2 of them are duplicates. Similarly the number of T is 2 but one is an orphan read (underlined). Samtools tview shows them, but they will discarded from further analysis&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.snpcall.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=13199</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=13199"/>
		<updated>2015-05-11T10:25:19Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Browsing Alignment Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
Note: The total count of C is 6, but 2 of them are duplicates. Samtools tview shows them, but they will discarded from further analysis&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.snpcall.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=13198</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=13198"/>
		<updated>2015-05-11T10:19:52Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Browsing Alignment Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.snpcall.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=13197</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=13197"/>
		<updated>2015-05-11T10:04:22Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Browsing Alignment Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 6 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.snpcall.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10302</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10302"/>
		<updated>2014-05-12T09:36:33Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Sequence Analysis Workshop */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
&lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.snpcall.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10301</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10301"/>
		<updated>2014-05-12T09:36:23Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Sequence Analysis Workshop */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. &lt;br /&gt;
For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.snpcall.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10300</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10300"/>
		<updated>2014-05-12T09:35:46Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] package&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here]&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.snpcall.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10299</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10299"/>
		<updated>2014-05-12T09:34:59Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Sequence Analysis Workshop */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
[http://genome.sph.umich.edu/wiki/GotCloud GotCloud] installation&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here] &lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.snpcall.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10298</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10298"/>
		<updated>2014-05-12T09:32:59Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Example Dataset */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here] &lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.snpcall.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10297</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10297"/>
		<updated>2014-05-12T09:32:27Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Sequence Analysis Workshop */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/s/426ck61bopx3khu/Workshop_low_pass.zip here] &lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshops/Abecasis/Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.snpcall.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10296</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10296"/>
		<updated>2014-05-12T09:28:07Z</updated>

		<summary type="html">&lt;p&gt;Csidore: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data.  As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data. For questions or comments please contact [mailto:csidore@umich.edu Carlo Sidore].&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
The dataset for the tutorial can be downloaded [https://www.dropbox.com/sh/qmjdskumvqwyksa/AAATmDgC0s1LLoUrGJ1ngl1Za here] &lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshops/Abecasis/Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.snpcall.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10272</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10272"/>
		<updated>2014-04-29T09:49:34Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Initial set of variant calls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data. As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data.&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshops/Abecasis/Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.snpcall.Makefile &amp;amp;&amp;gt; snpcall.log &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10271</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10271"/>
		<updated>2014-04-29T09:49:18Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Initial set of variant calls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data. As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data.&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshops/Abecasis/Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.snpcall.Makefile &amp;amp;&amp;gt; snpcall.log&lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10270</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=10270"/>
		<updated>2014-04-29T09:48:41Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Initial set of variant calls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data. As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data.&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshops/Abecasis/Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.snpcall.Makefile &lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=8554</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=8554"/>
		<updated>2013-09-09T13:34:58Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* A quick look to the fastq files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data. As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data.&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshops/Abecasis/Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]). Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.Makefile &lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=8553</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=8553"/>
		<updated>2013-09-09T13:34:44Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* A quick look to the fastq files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data. As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data.&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshops/Abecasis/Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores (expressed as [http://en.wikipedia.org/wiki/Phred_quality_score Phred score]. Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.Makefile &lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=8552</id>
		<title>Tutorial: Low Pass Sequence Analysis Answers</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=8552"/>
		<updated>2013-09-09T13:33:32Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Low Pass Sequence Analysis Answers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low Pass Sequence Analysis Answers =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The third read in the file is:&lt;br /&gt;
&lt;br /&gt;
 @ERR020230.76497044/1&lt;br /&gt;
 CTGTACTACTAAAGTAAAACTAGTTTTCCAATAGTTTGTTGCAGGATAAGCAGTTTTACTTTTGTTGACAATATGTGTATGAATTTACTTC&lt;br /&gt;
 +&lt;br /&gt;
 DFEEGFKIFKIKLKIJLMMIMKMJKKKIKLMKKLKLLLKKLKLMMJLLJMKMMJLKLLJNLLLIKLJMILKLJKLKKKKKMMMJJJIFJFA&lt;br /&gt;
&lt;br /&gt;
The quality string is the 4th line of each read, then the base quality of the fifth nucleotide is encoded with the character &amp;quot;G&amp;quot;. Its decimal ASCII code is 71, so the base quality of this nucleotide is 38 (71-33) &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q2: Which is the mean depth of the sample HG00108? And the mapping rate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The mean depth is 4.60X and mapping rate is 99.19%. However, keep in mind that these statistics are evaluated only in the 100kb included in our example dataset.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The depth of the sample HG00108 at the position 33594959 is 11, there are 3 G&#039;s and 8 T&#039;s piling up at this position. Just looking at the nucleotide, the most likely genotype would be G/T&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
 33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
The genotype (GT) is encoded as 1/1, which means that both chromosomes carry the alternative allele (ALT), the genotype is then C/C&lt;br /&gt;
The depth at this position is encoded in the GD field and its value is 3.&lt;br /&gt;
Running the mpileup:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33514465| samtools mpileup - | grep 33514465&lt;br /&gt;
&lt;br /&gt;
[bam_header_read] EOF marker is absent. The input is probably truncated.&lt;br /&gt;
[mpileup] 1 samples in 1 input files&lt;br /&gt;
&amp;lt;mpileup&amp;gt; Set max per-file depth to 8000&lt;br /&gt;
20      33514465        N       3       cCc     :65&lt;br /&gt;
&lt;br /&gt;
At this position there are 3 C&#039;s so the result is consistent with the call in the vcf file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Total Depth at Site&amp;quot; is encoded in the INFO field with &amp;quot;DP&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep 33500378 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33500378        DP=37;MQ=58;NS=10;AN=20;AC=15;AF=0.737200;AB=0.6246;AZ=0.9025;FIC=0.1934;SLRT=0.1851;HWEAF=0.7372;HWDAF=0.3125,0.5682;LBS=0,0,0,0,0,1,0,0;OBS=17,14,0,0,5,3,0,0;STR=0.054;STZ=0.335;CBR=0.035;CBZ=0.218;IOR=0.000;IOZ=-0.199;AOI=-180.991;AOZ=-180.792;LQR=0.025;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.026;SVM=0.995957&lt;br /&gt;
&lt;br /&gt;
The total depth at this site is 37 and it is the sum of the depth of the 10 individuals at this position&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q6: How many alternate alleles are found at position 33505937?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The number of alternate alleles (or &amp;quot;Alternate Allele Counts in Samples with Coverage&amp;quot;) is encoded in the INFO field with &amp;quot;AC&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep  33505937 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33505937        DP=54;MQ=59;NS=10;AN=20;AC=14;AF=0.670715;AB=0.4931;AZ=-0.0684;FIC=0.1444;SLRT=0.1432;HWEAF=0.6707;HWDAF=0.3779,0.4753;LBS=0,0,1,3,0,0,0,1;OBS=0,0,14,21,0,0,8,6;STR=0.150;STZ=1.051;CBR=0.295;CBZ=2.068;IOR=0.000;IOZ=-0.154;AOI=-262.472;AOZ=-262.317;LQR=0.093;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.000;SVM=1.03116&lt;br /&gt;
&lt;br /&gt;
At this position, in total there are 14 alternative allele in the 10 individuals genotypes (20 alleles in total).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q7: Is the genotype of HG00108 at position 33538999 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command) &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The sample HG00108 is the 13th column of the file, so :&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33594959&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,13&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00108&lt;br /&gt;
  33594959        G       T       GT:GD:GQ:PL     0/1:11:99:185,0,87&lt;br /&gt;
&lt;br /&gt;
The predicted genotype is then G/T with depth 11, consistent with the mpileup results.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q8: How many variant sites were detected in this dataset?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
193 variants in total&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&#039;&#039;&#039;&lt;br /&gt;
The two genotypes are discordant (0/1 exome vs 1/1 low pass). Since the exome sequenced sample has higher depth (16 vs 3), it should be more accurate (but always double check your variants and your reads to avoid false positive!!)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q10: What can be the reason of the genotype discordance?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason of discordance is in the lower number of reads in the low pass. All the 3 fragments, piling up at this position, belong to the chromosome containing the C allele, there are no fragment from the other chromosome containing the T allele. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00111&lt;br /&gt;
  33514465        T       C       GT:DS:GD:GQ:PL:BD       0|1:1.000:3:10:117,9,0:1.0014&lt;br /&gt;
&lt;br /&gt;
The genotype in the LD-refined vcf and in the exome vcf are now consistent. The LD refinement reconstructs the haplotypes in this small region and it is able to &amp;quot;fix&amp;quot; some genotyping errors generated by the low coverage of the low pass data.&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=8551</id>
		<title>Tutorial: Low Pass Sequence Analysis Answers</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=8551"/>
		<updated>2013-09-09T13:30:55Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Low Pass Sequence Analysis Answers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low Pass Sequence Analysis Answers =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The third read in the file is:&lt;br /&gt;
&lt;br /&gt;
 @ERR020230.76497044/1&lt;br /&gt;
 CTGTACTACTAAAGTAAAACTAGTTTTCCAATAGTTTGTTGCAGGATAAGCAGTTTTACTTTTGTTGACAATATGTGTATGAATTTACTTC&lt;br /&gt;
 +&lt;br /&gt;
 DFEEGFKIFKIKLKIJLMMIMKMJKKKIKLMKKLKLLLKKLKLMMJLLJMKMMJLKLLJNLLLIKLJMILKLJKLKKKKKMMMJJJIFJFA&lt;br /&gt;
&lt;br /&gt;
The quality string is the 4th line of each read, then the base quality of the first nucleotide is encoded with the character &amp;quot;G&amp;quot;. Its decimal ASCII code is 71, so the base quality of this nucleotide is 38 (71-33) &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q2: Which is the mean depth of the sample HG00108? And the mapping rate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The mean depth is 4.60X and mapping rate is 99.19%. However, keep in mind that these statistics are evaluated only in the 100kb included in our example dataset.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The depth of the sample HG00108 at the position 33594959 is 11, there are 3 G&#039;s and 8 T&#039;s piling up at this position. Just looking at the nucleotide, the most likely genotype would be G/T&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
 33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
The genotype (GT) is encoded as 1/1, which means that both chromosomes carry the alternative allele (ALT), the genotype is then C/C&lt;br /&gt;
The depth at this position is encoded in the GD field and its value is 3.&lt;br /&gt;
Running the mpileup:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33514465| samtools mpileup - | grep 33514465&lt;br /&gt;
&lt;br /&gt;
[bam_header_read] EOF marker is absent. The input is probably truncated.&lt;br /&gt;
[mpileup] 1 samples in 1 input files&lt;br /&gt;
&amp;lt;mpileup&amp;gt; Set max per-file depth to 8000&lt;br /&gt;
20      33514465        N       3       cCc     :65&lt;br /&gt;
&lt;br /&gt;
At this position there are 3 C&#039;s so the result is consistent with the call in the vcf file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Total Depth at Site&amp;quot; is encoded in the INFO field with &amp;quot;DP&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep 33500378 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33500378        DP=37;MQ=58;NS=10;AN=20;AC=15;AF=0.737200;AB=0.6246;AZ=0.9025;FIC=0.1934;SLRT=0.1851;HWEAF=0.7372;HWDAF=0.3125,0.5682;LBS=0,0,0,0,0,1,0,0;OBS=17,14,0,0,5,3,0,0;STR=0.054;STZ=0.335;CBR=0.035;CBZ=0.218;IOR=0.000;IOZ=-0.199;AOI=-180.991;AOZ=-180.792;LQR=0.025;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.026;SVM=0.995957&lt;br /&gt;
&lt;br /&gt;
The total depth at this site is 37 and it is the sum of the depth of the 10 individuals at this position&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q6: How many alternate alleles are found at position 33505937?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The number of alternate alleles (or &amp;quot;Alternate Allele Counts in Samples with Coverage&amp;quot;) is encoded in the INFO field with &amp;quot;AC&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep  33505937 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33505937        DP=54;MQ=59;NS=10;AN=20;AC=14;AF=0.670715;AB=0.4931;AZ=-0.0684;FIC=0.1444;SLRT=0.1432;HWEAF=0.6707;HWDAF=0.3779,0.4753;LBS=0,0,1,3,0,0,0,1;OBS=0,0,14,21,0,0,8,6;STR=0.150;STZ=1.051;CBR=0.295;CBZ=2.068;IOR=0.000;IOZ=-0.154;AOI=-262.472;AOZ=-262.317;LQR=0.093;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.000;SVM=1.03116&lt;br /&gt;
&lt;br /&gt;
At this position, in total there are 14 alternative allele in the 10 individuals genotypes (20 alleles in total).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q7: Is the genotype of HG00108 at position 33538999 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command) &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The sample HG00108 is the 13th column of the file, so :&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33594959&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,13&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00108&lt;br /&gt;
  33594959        G       T       GT:GD:GQ:PL     0/1:11:99:185,0,87&lt;br /&gt;
&lt;br /&gt;
The predicted genotype is then G/T with depth 11, consistent with the mpileup results.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q8: How many variant sites were detected in this dataset?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
193 variants in total&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&#039;&#039;&#039;&lt;br /&gt;
The two genotypes are discordant (0/1 exome vs 1/1 low pass). Since the exome sequenced sample has higher depth (16 vs 3), it should be more accurate (but always double check your variants and your reads to avoid false positive!!)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q10: What can be the reason of the genotype discordance?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason of discordance is in the lower number of reads in the low pass. All the 3 fragments, piling up at this position, belong to the chromosome containing the C allele, there are no fragment from the other chromosome containing the T allele. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00111&lt;br /&gt;
  33514465        T       C       GT:DS:GD:GQ:PL:BD       0|1:1.000:3:10:117,9,0:1.0014&lt;br /&gt;
&lt;br /&gt;
The genotype in the LD-refined vcf and in the exome vcf are now consistent. The LD refinement reconstructs the haplotypes in this small region and it is able to &amp;quot;fix&amp;quot; some genotyping errors generated by the low coverage of the low pass data.&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=8550</id>
		<title>Tutorial: Low Pass Sequence Analysis Answers</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=8550"/>
		<updated>2013-09-09T13:30:41Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Low Pass Sequence Analysis Answers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low Pass Sequence Analysis Answers =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The third read in the file is:&lt;br /&gt;
&lt;br /&gt;
 @ERR020230.76497044/1&lt;br /&gt;
 CTGTACTACTAAAGTAAAACTAGTTTTCCAATAGTTTGTTGCAGGATAAGCAGTTTTACTTTTGTTGACAATATGTGTATGAATTTACTTC&lt;br /&gt;
 +&lt;br /&gt;
 DFEEGFKIFKIKLKIJLMMIMKMJKKKIKLMKKLKLLLKKLKLMMJLLJMKMMJLKLLJNLLLIKLJMILKLJKLKKKKKMMMJJJIFJFA&lt;br /&gt;
&lt;br /&gt;
The quality string is the 4th line of each read, then the base quality of the first nucleotide is encoded with the character &amp;quot;G&amp;quot;. Its decimal ASCII code is 71, so the base quality of this nucleotide is 38 (71-33) &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q2: Which is the mean depth of the sample HG00108? And the mapping rate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The mean depth is 4.60X and mapping rate is 99.19%. However, keep in mind that these statistics are evaluated only in the 100kb included in our example dataset.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The depth of the sample HG00108 at the position 33594959 is 11, there are 3 G&#039;s and 8 T&#039;s piling up at this position. Just looking at the nucleotide, the most likely genotype would be G/T&lt;br /&gt;
&lt;br /&gt;
* Q4: &#039;&#039;&#039;What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
 33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
The genotype (GT) is encoded as 1/1, which means that both chromosomes carry the alternative allele (ALT), the genotype is then C/C&lt;br /&gt;
The depth at this position is encoded in the GD field and its value is 3.&lt;br /&gt;
Running the mpileup:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33514465| samtools mpileup - | grep 33514465&lt;br /&gt;
&lt;br /&gt;
[bam_header_read] EOF marker is absent. The input is probably truncated.&lt;br /&gt;
[mpileup] 1 samples in 1 input files&lt;br /&gt;
&amp;lt;mpileup&amp;gt; Set max per-file depth to 8000&lt;br /&gt;
20      33514465        N       3       cCc     :65&lt;br /&gt;
&lt;br /&gt;
At this position there are 3 C&#039;s so the result is consistent with the call in the vcf file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Total Depth at Site&amp;quot; is encoded in the INFO field with &amp;quot;DP&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep 33500378 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33500378        DP=37;MQ=58;NS=10;AN=20;AC=15;AF=0.737200;AB=0.6246;AZ=0.9025;FIC=0.1934;SLRT=0.1851;HWEAF=0.7372;HWDAF=0.3125,0.5682;LBS=0,0,0,0,0,1,0,0;OBS=17,14,0,0,5,3,0,0;STR=0.054;STZ=0.335;CBR=0.035;CBZ=0.218;IOR=0.000;IOZ=-0.199;AOI=-180.991;AOZ=-180.792;LQR=0.025;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.026;SVM=0.995957&lt;br /&gt;
&lt;br /&gt;
The total depth at this site is 37 and it is the sum of the depth of the 10 individuals at this position&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q6: How many alternate alleles are found at position 33505937?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The number of alternate alleles (or &amp;quot;Alternate Allele Counts in Samples with Coverage&amp;quot;) is encoded in the INFO field with &amp;quot;AC&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep  33505937 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33505937        DP=54;MQ=59;NS=10;AN=20;AC=14;AF=0.670715;AB=0.4931;AZ=-0.0684;FIC=0.1444;SLRT=0.1432;HWEAF=0.6707;HWDAF=0.3779,0.4753;LBS=0,0,1,3,0,0,0,1;OBS=0,0,14,21,0,0,8,6;STR=0.150;STZ=1.051;CBR=0.295;CBZ=2.068;IOR=0.000;IOZ=-0.154;AOI=-262.472;AOZ=-262.317;LQR=0.093;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.000;SVM=1.03116&lt;br /&gt;
&lt;br /&gt;
At this position, in total there are 14 alternative allele in the 10 individuals genotypes (20 alleles in total).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q7: Is the genotype of HG00108 at position 33538999 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command) &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The sample HG00108 is the 13th column of the file, so :&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33594959&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,13&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00108&lt;br /&gt;
  33594959        G       T       GT:GD:GQ:PL     0/1:11:99:185,0,87&lt;br /&gt;
&lt;br /&gt;
The predicted genotype is then G/T with depth 11, consistent with the mpileup results.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q8: How many variant sites were detected in this dataset?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
193 variants in total&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&#039;&#039;&#039;&lt;br /&gt;
The two genotypes are discordant (0/1 exome vs 1/1 low pass). Since the exome sequenced sample has higher depth (16 vs 3), it should be more accurate (but always double check your variants and your reads to avoid false positive!!)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q10: What can be the reason of the genotype discordance?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason of discordance is in the lower number of reads in the low pass. All the 3 fragments, piling up at this position, belong to the chromosome containing the C allele, there are no fragment from the other chromosome containing the T allele. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00111&lt;br /&gt;
  33514465        T       C       GT:DS:GD:GQ:PL:BD       0|1:1.000:3:10:117,9,0:1.0014&lt;br /&gt;
&lt;br /&gt;
The genotype in the LD-refined vcf and in the exome vcf are now consistent. The LD refinement reconstructs the haplotypes in this small region and it is able to &amp;quot;fix&amp;quot; some genotyping errors generated by the low coverage of the low pass data.&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=8549</id>
		<title>Tutorial: Low Pass Sequence Analysis Answers</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=8549"/>
		<updated>2013-09-09T13:13:50Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Low Pass Sequence Analysis Answers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low Pass Sequence Analysis Answers =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The third read in the file is:&lt;br /&gt;
&lt;br /&gt;
 @ERR020230.76497044/1&lt;br /&gt;
 CTGTACTACTAAAGTAAAACTAGTTTTCCAATAGTTTGTTGCAGGATAAGCAGTTTTACTTTTGTTGACAATATGTGTATGAATTTACTTC&lt;br /&gt;
 +&lt;br /&gt;
 DFEEGFKIFKIKLKIJLMMIMKMJKKKIKLMKKLKLLLKKLKLMMJLLJMKMMJLKLLJNLLLIKLJMILKLJKLKKKKKMMMJJJIFJFA&lt;br /&gt;
&lt;br /&gt;
The quality string is the 4th line of each read, then the base quality of the first nucleotide is encoded with the character &amp;quot;G&amp;quot;. Its decimal ASCII code is 71, so the base quality of this nucleotide is 38 (71-33) &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q2: Which is the mean depth of the sample HG00108? And the mapping rate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The mean depth is 4.60X and mapping rate is 99.19%. However, keep in mind that these statistics are evaluated only in the 100kb included in our example dataset.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The depth of the sample HG00108 at the position 33594959 is 11, there are 3 G&#039;s and 8 T&#039;s piling up at this position. Just looking at the nucleotide, the most likely genotype would be G/T&lt;br /&gt;
&lt;br /&gt;
* Q4: &#039;&#039;&#039;What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
 33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
The genotype (GT) is encoded as 1/1, which means that both chromosomes carry the alternative allele (ALT), the genotype is then C/C&lt;br /&gt;
The depth at this position is encoded in the GD field and its value is 3.&lt;br /&gt;
Running the mpileup:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33514465| samtools mpileup - | grep 33514465&lt;br /&gt;
&lt;br /&gt;
[bam_header_read] EOF marker is absent. The input is probably truncated.&lt;br /&gt;
[mpileup] 1 samples in 1 input files&lt;br /&gt;
&amp;lt;mpileup&amp;gt; Set max per-file depth to 8000&lt;br /&gt;
20      33514465        N       3       cCc     :65&lt;br /&gt;
&lt;br /&gt;
At this position there are 3 C&#039;s so the result is consistent with the call in the vcf file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Total Depth at Site&amp;quot; is encoded in the INFO field with &amp;quot;DP&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep 33500378 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33500378        DP=37;MQ=58;NS=10;AN=20;AC=15;AF=0.737200;AB=0.6246;AZ=0.9025;FIC=0.1934;SLRT=0.1851;HWEAF=0.7372;HWDAF=0.3125,0.5682;LBS=0,0,0,0,0,1,0,0;OBS=17,14,0,0,5,3,0,0;STR=0.054;STZ=0.335;CBR=0.035;CBZ=0.218;IOR=0.000;IOZ=-0.199;AOI=-180.991;AOZ=-180.792;LQR=0.025;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.026;SVM=0.995957&lt;br /&gt;
&lt;br /&gt;
The total depth at this site is 37 and it is the sum of the depth of the 10 individuals at this position&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q6: How many alternate alleles are found at position 33505937?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The number of alternate alleles (or &amp;quot;Alternate Allele Counts in Samples with Coverage&amp;quot;) is encoded in the INFO field with &amp;quot;AC&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep  33505937 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33505937        DP=54;MQ=59;NS=10;AN=20;AC=14;AF=0.670715;AB=0.4931;AZ=-0.0684;FIC=0.1444;SLRT=0.1432;HWEAF=0.6707;HWDAF=0.3779,0.4753;LBS=0,0,1,3,0,0,0,1;OBS=0,0,14,21,0,0,8,6;STR=0.150;STZ=1.051;CBR=0.295;CBZ=2.068;IOR=0.000;IOZ=-0.154;AOI=-262.472;AOZ=-262.317;LQR=0.093;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.000;SVM=1.03116&lt;br /&gt;
&lt;br /&gt;
At this position, in total there are 14 alternative allele in the 10 individuals genotypes (20 alleles in total).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q7: Is the genotype of HG00108 at position 33538999 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command) &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The sample HG00108 is the 13th column of the file, so :&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33594959&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,13&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00108&lt;br /&gt;
  33594959        G       T       GT:GD:GQ:PL     0/1:11:99:185,0,87&lt;br /&gt;
&lt;br /&gt;
The predicted genotype is then G/T with depth 11, consistent with the mpileup results.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q8: How many variant sites were detected in this dataset?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
193 variants in total&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Q10: What can be the reason of the genotype discordance?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=8548</id>
		<title>Tutorial: Low Pass Sequence Analysis Answers</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=8548"/>
		<updated>2013-09-09T13:13:39Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Low Pass Sequence Analysis Answers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low Pass Sequence Analysis Answers =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The third read in the file is:&lt;br /&gt;
&lt;br /&gt;
 @ERR020230.76497044/1&lt;br /&gt;
 CTGTACTACTAAAGTAAAACTAGTTTTCCAATAGTTTGTTGCAGGATAAGCAGTTTTACTTTTGTTGACAATATGTGTATGAATTTACTTC&lt;br /&gt;
 +&lt;br /&gt;
 DFEEGFKIFKIKLKIJLMMIMKMJKKKIKLMKKLKLLLKKLKLMMJLLJMKMMJLKLLJNLLLIKLJMILKLJKLKKKKKMMMJJJIFJFA&lt;br /&gt;
&lt;br /&gt;
The quality string is the 4th line of each read, then the base quality of the first nucleotide is encoded with the character &amp;quot;G&amp;quot;. Its decimal ASCII code is 71, so the base quality of this nucleotide is 38 (71-33) &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q2: Which is the mean depth of the sample HG00108? And the mapping rate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The mean depth is 4.60X and mapping rate is 99.19%. However, keep in mind that these statistics are evaluated only in the 100kb included in our example dataset.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The depth of the sample HG00108 at the position 33594959 is 11, there are 3 G&#039;s and 8 T&#039;s piling up at this position. Just looking at the nucleotide, the most likely genotype would be G/T&lt;br /&gt;
&lt;br /&gt;
Q4: &#039;&#039;&#039;What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
 POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
 33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
The genotype (GT) is encoded as 1/1, which means that both chromosomes carry the alternative allele (ALT), the genotype is then C/C&lt;br /&gt;
The depth at this position is encoded in the GD field and its value is 3.&lt;br /&gt;
Running the mpileup:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33514465| samtools mpileup - | grep 33514465&lt;br /&gt;
&lt;br /&gt;
[bam_header_read] EOF marker is absent. The input is probably truncated.&lt;br /&gt;
[mpileup] 1 samples in 1 input files&lt;br /&gt;
&amp;lt;mpileup&amp;gt; Set max per-file depth to 8000&lt;br /&gt;
20      33514465        N       3       cCc     :65&lt;br /&gt;
&lt;br /&gt;
At this position there are 3 C&#039;s so the result is consistent with the call in the vcf file.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Total Depth at Site&amp;quot; is encoded in the INFO field with &amp;quot;DP&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep 33500378 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33500378        DP=37;MQ=58;NS=10;AN=20;AC=15;AF=0.737200;AB=0.6246;AZ=0.9025;FIC=0.1934;SLRT=0.1851;HWEAF=0.7372;HWDAF=0.3125,0.5682;LBS=0,0,0,0,0,1,0,0;OBS=17,14,0,0,5,3,0,0;STR=0.054;STZ=0.335;CBR=0.035;CBZ=0.218;IOR=0.000;IOZ=-0.199;AOI=-180.991;AOZ=-180.792;LQR=0.025;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.026;SVM=0.995957&lt;br /&gt;
&lt;br /&gt;
The total depth at this site is 37 and it is the sum of the depth of the 10 individuals at this position&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q6: How many alternate alleles are found at position 33505937?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The number of alternate alleles (or &amp;quot;Alternate Allele Counts in Samples with Coverage&amp;quot;) is encoded in the INFO field with &amp;quot;AC&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep  33505937 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33505937        DP=54;MQ=59;NS=10;AN=20;AC=14;AF=0.670715;AB=0.4931;AZ=-0.0684;FIC=0.1444;SLRT=0.1432;HWEAF=0.6707;HWDAF=0.3779,0.4753;LBS=0,0,1,3,0,0,0,1;OBS=0,0,14,21,0,0,8,6;STR=0.150;STZ=1.051;CBR=0.295;CBZ=2.068;IOR=0.000;IOZ=-0.154;AOI=-262.472;AOZ=-262.317;LQR=0.093;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.000;SVM=1.03116&lt;br /&gt;
&lt;br /&gt;
At this position, in total there are 14 alternative allele in the 10 individuals genotypes (20 alleles in total).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q7: Is the genotype of HG00108 at position 33538999 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command) &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The sample HG00108 is the 13th column of the file, so :&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33594959&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,13&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00108&lt;br /&gt;
  33594959        G       T       GT:GD:GQ:PL     0/1:11:99:185,0,87&lt;br /&gt;
&lt;br /&gt;
The predicted genotype is then G/T with depth 11, consistent with the mpileup results.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q8: How many variant sites were detected in this dataset?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
193 variants in total&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Q10: What can be the reason of the genotype discordance?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=8547</id>
		<title>Tutorial: Low Pass Sequence Analysis Answers</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=8547"/>
		<updated>2013-09-09T13:10:59Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Low Pass Sequence Analysis Answers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low Pass Sequence Analysis Answers =&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz? &lt;br /&gt;
&lt;br /&gt;
The third read in the file is:&lt;br /&gt;
&lt;br /&gt;
 @ERR020230.76497044/1&lt;br /&gt;
 CTGTACTACTAAAGTAAAACTAGTTTTCCAATAGTTTGTTGCAGGATAAGCAGTTTTACTTTTGTTGACAATATGTGTATGAATTTACTTC&lt;br /&gt;
 +&lt;br /&gt;
 DFEEGFKIFKIKLKIJLMMIMKMJKKKIKLMKKLKLLLKKLKLMMJLLJMKMMJLKLLJNLLLIKLJMILKLJKLKKKKKMMMJJJIFJFA&lt;br /&gt;
&lt;br /&gt;
The quality string is the 4th line of each read, then the base quality of the first nucleotide is encoded with the character &amp;quot;G&amp;quot;. Its decimal ASCII code is 71, so the base quality of this nucleotide is 38 (71-33) &lt;br /&gt;
&lt;br /&gt;
* Q2: Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
The mean depth is 4.60X and mapping rate is 99.19%. However, keep in mind that these statistics are evaluated only in the 100kb included in our example dataset.&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.) &lt;br /&gt;
&lt;br /&gt;
The depth of the sample HG00108 at the position 33594959 is 11, there are 3 G&#039;s and 8 T&#039;s piling up at this position. Just looking at the nucleotide, the most likely genotype would be G/T&lt;br /&gt;
&lt;br /&gt;
Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup? &lt;br /&gt;
&lt;br /&gt;
 POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
 33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
The genotype (GT) is encoded as 1/1, which means that both chromosomes carry the alternative allele (ALT), the genotype is then C/C&lt;br /&gt;
The depth at this position is encoded in the GD field and its value is 3.&lt;br /&gt;
Running the mpileup:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33514465| samtools mpileup - | grep 33514465&lt;br /&gt;
&lt;br /&gt;
[bam_header_read] EOF marker is absent. The input is probably truncated.&lt;br /&gt;
[mpileup] 1 samples in 1 input files&lt;br /&gt;
&amp;lt;mpileup&amp;gt; Set max per-file depth to 8000&lt;br /&gt;
20      33514465        N       3       cCc     :65&lt;br /&gt;
&lt;br /&gt;
At this position there are 3 C&#039;s so the result is consistent with the call in the vcf file.&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378? &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Total Depth at Site&amp;quot; is encoded in the INFO field with &amp;quot;DP&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep 33500378 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33500378        DP=37;MQ=58;NS=10;AN=20;AC=15;AF=0.737200;AB=0.6246;AZ=0.9025;FIC=0.1934;SLRT=0.1851;HWEAF=0.7372;HWDAF=0.3125,0.5682;LBS=0,0,0,0,0,1,0,0;OBS=17,14,0,0,5,3,0,0;STR=0.054;STZ=0.335;CBR=0.035;CBZ=0.218;IOR=0.000;IOZ=-0.199;AOI=-180.991;AOZ=-180.792;LQR=0.025;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.026;SVM=0.995957&lt;br /&gt;
&lt;br /&gt;
The total depth at this site is 37 and it is the sum of the depth of the 10 individuals at this position&lt;br /&gt;
&lt;br /&gt;
    Q6: How many alternate alleles are found at position 33505937? &lt;br /&gt;
&lt;br /&gt;
The number of alternate alleles (or &amp;quot;Alternate Allele Counts in Samples with Coverage&amp;quot;) is encoded in the INFO field with &amp;quot;AC&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep  33505937 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33505937        DP=54;MQ=59;NS=10;AN=20;AC=14;AF=0.670715;AB=0.4931;AZ=-0.0684;FIC=0.1444;SLRT=0.1432;HWEAF=0.6707;HWDAF=0.3779,0.4753;LBS=0,0,1,3,0,0,0,1;OBS=0,0,14,21,0,0,8,6;STR=0.150;STZ=1.051;CBR=0.295;CBZ=2.068;IOR=0.000;IOZ=-0.154;AOI=-262.472;AOZ=-262.317;LQR=0.093;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.000;SVM=1.03116&lt;br /&gt;
&lt;br /&gt;
At this position, in total there are 14 alternative allele in the 10 individuals genotypes (20 alleles in total).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Q7: Is the genotype of HG00108 at position 33538999 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command) &lt;br /&gt;
&lt;br /&gt;
The sample HG00108 is the 13th column of the file, so :&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33594959&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,13&lt;br /&gt;
&lt;br /&gt;
  POS     REF     ALT     FORMAT  HG00108&lt;br /&gt;
  33594959        G       T       GT:GD:GQ:PL     0/1:11:99:185,0,87&lt;br /&gt;
&lt;br /&gt;
The predicted genotype is then G/T with depth 11, consistent with the mpileup results.&lt;br /&gt;
&lt;br /&gt;
    Q8: How many variant sites were detected in this dataset?: &lt;br /&gt;
&lt;br /&gt;
193 variants in total&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=8546</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=8546"/>
		<updated>2013-09-09T13:09:05Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Initial set of variant calls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data. As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data.&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshops/Abecasis/Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores. Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.Makefile &lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33594959 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=8545</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=8545"/>
		<updated>2013-09-09T13:06:42Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Browsing Alignment Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data. As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data.&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshops/Abecasis/Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores. Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33594959 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.Makefile &lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33538999 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=8544</id>
		<title>Tutorial: Low Pass Sequence Analysis Answers</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis_Answers&amp;diff=8544"/>
		<updated>2013-09-09T13:03:46Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Low Pass Sequence Analysis Answers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Low Pass Sequence Analysis Answers =&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz? &lt;br /&gt;
&lt;br /&gt;
The third read in the file is:&lt;br /&gt;
&lt;br /&gt;
 @ERR020230.76497044/1&lt;br /&gt;
 CTGTACTACTAAAGTAAAACTAGTTTTCCAATAGTTTGTTGCAGGATAAGCAGTTTTACTTTTGTTGACAATATGTGTATGAATTTACTTC&lt;br /&gt;
 +&lt;br /&gt;
 DFEEGFKIFKIKLKIJLMMIMKMJKKKIKLMKKLKLLLKKLKLMMJLLJMKMMJLKLLJNLLLIKLJMILKLJKLKKKKKMMMJJJIFJFA&lt;br /&gt;
&lt;br /&gt;
The quality string is the 4th line of each read, then the base quality of the first nucleotide is encoded with the character &amp;quot;G&amp;quot;. Its decimal ASCII code is 71, so the base quality of this nucleotide is 38 (71-33) &lt;br /&gt;
&lt;br /&gt;
* Q2: Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
The mean depth is 4.60X and mapping rate is 99.19%. However, keep in mind that these statistics are evaluated only in the 100kb included in our example dataset.&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33538999 for the sample HG00108? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.) &lt;br /&gt;
&lt;br /&gt;
The depth of the sample HG00108 at the position 3353899 is 9, there are 5 G&#039;s and 4 C&#039;s piling up at this position. Just looking at the nucleotide, the most likely genotype would be C/G&lt;br /&gt;
&lt;br /&gt;
Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup? &lt;br /&gt;
&lt;br /&gt;
 POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
 33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
The genotype (GT) is encoded as 1/1, which means that both chromosomes carry the alternative allele (ALT), the genotype is then C/C&lt;br /&gt;
The depth at this position is encoded in the GD field and its value is 3.&lt;br /&gt;
Running the mpileup:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33514465| samtools mpileup - | grep 33514465&lt;br /&gt;
&lt;br /&gt;
[bam_header_read] EOF marker is absent. The input is probably truncated.&lt;br /&gt;
[mpileup] 1 samples in 1 input files&lt;br /&gt;
&amp;lt;mpileup&amp;gt; Set max per-file depth to 8000&lt;br /&gt;
20      33514465        N       3       cCc     :65&lt;br /&gt;
&lt;br /&gt;
At this position there are 3 C&#039;s so the result is consistent with the call in the vcf file.&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378? &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Total Depth at Site&amp;quot; is encoded in the INFO field with &amp;quot;DP&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep 33500378 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33500378        DP=37;MQ=58;NS=10;AN=20;AC=15;AF=0.737200;AB=0.6246;AZ=0.9025;FIC=0.1934;SLRT=0.1851;HWEAF=0.7372;HWDAF=0.3125,0.5682;LBS=0,0,0,0,0,1,0,0;OBS=17,14,0,0,5,3,0,0;STR=0.054;STZ=0.335;CBR=0.035;CBZ=0.218;IOR=0.000;IOZ=-0.199;AOI=-180.991;AOZ=-180.792;LQR=0.025;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.026;SVM=0.995957&lt;br /&gt;
&lt;br /&gt;
The total depth at this site is 37 and it is the sum of the depth of the 10 individuals at this position&lt;br /&gt;
&lt;br /&gt;
    Q6: How many alternate alleles are found at position 33505937? &lt;br /&gt;
&lt;br /&gt;
The number of alternate alleles (or &amp;quot;Alternate Allele Counts in Samples with Coverage&amp;quot;) is encoded in the INFO field with &amp;quot;AC&amp;quot;. To extract it:&lt;br /&gt;
 &amp;gt; zgrep  33505937 snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 1,2,8&lt;br /&gt;
&lt;br /&gt;
 20      33505937        DP=54;MQ=59;NS=10;AN=20;AC=14;AF=0.670715;AB=0.4931;AZ=-0.0684;FIC=0.1444;SLRT=0.1432;HWEAF=0.6707;HWDAF=0.3779,0.4753;LBS=0,0,1,3,0,0,0,1;OBS=0,0,14,21,0,0,8,6;STR=0.150;STZ=1.051;CBR=0.295;CBZ=2.068;IOR=0.000;IOZ=-0.154;AOI=-262.472;AOZ=-262.317;LQR=0.093;MQ0=0.000;MQ10=0.000;MQ20=0.000;MQ30=0.000;SVM=1.03116&lt;br /&gt;
&lt;br /&gt;
At this position, in total there are 14 alternative allele in the 10 individuals genotypes (20 alleles in total).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Q7: Is the genotype of HG00108 at position 33538999 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Q8: How many variant sites were detected in this dataset?: &lt;br /&gt;
&lt;br /&gt;
193 variants in total&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=8543</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=8543"/>
		<updated>2013-09-09T13:03:01Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Initial set of variant calls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data. As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data.&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshops/Abecasis/Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores. Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33538999 for the sample HG00111? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.Makefile &lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33505937?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33538999 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
	<entry>
		<id>http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=8542</id>
		<title>Tutorial: Low Pass Sequence Analysis</title>
		<link rel="alternate" type="text/html" href="http://genome.sph.umich.edu/w/index.php?title=Tutorial:_Low_Pass_Sequence_Analysis&amp;diff=8542"/>
		<updated>2013-09-09T12:39:57Z</updated>

		<summary type="html">&lt;p&gt;Csidore: /* Initial set of variant calls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Sequence Analysis Workshop =&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will illustrate some of the essential steps in the analysis of next generation sequence data. As part of the process, you will learn about many of the file formats commonly used to store next generation sequence data.&lt;br /&gt;
&lt;br /&gt;
We will start with a set of short sequence reads and associated base quality scores (stored in a fastq file), find the most likely genomic location for each read (producing a BAM file), generate an initial list of polymorphic sites and genotypes (stored in a VCF file) and use haplotype information to refine these genotypes (resulting in an updated VCF file).&lt;br /&gt;
&lt;br /&gt;
== Example Dataset ==&lt;br /&gt;
&lt;br /&gt;
Our dataset consists of 10 individuals sequenced by the [http://www.1000genomes.org 1000 Genomes Project]. As with other 1000 Genomes Project samples, these individuals have been sequenced to an average depth of about 4x.&lt;br /&gt;
&lt;br /&gt;
To conserve time and disk-space, our analysis will focus on a small region of chromosome 20, from 33,500,000 to 33,600,000 bp. We will first map reads for 3 individuals.  We will then perform the variant calling by combining the results with mapped reads from the other 7 individuals to generate a list of polymorphic sites and estimate genotypes at each of these sites.&lt;br /&gt;
We will compare the results of the variant calling on the low pass dataset with results from the exome sequencing of the same individual. Finally we will use the LD refinement to increase the accuracy of our genotypes.&lt;br /&gt;
&lt;br /&gt;
The example dataset will be availabe in the folder Workshops/Abecasis/Workshop_lowpass/, so let&#039;s move there&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cd Workshops/Abecasis/Workshop_lowpass/&lt;br /&gt;
&lt;br /&gt;
== Building an Index for Short Read Alignment ==&lt;br /&gt;
&lt;br /&gt;
To quickly place short reads along the genome, BWA and other read mappers typically build a word index for the genome. This index lists the location of particular short words along the genome and can be used to seed and then extend particular matches.&lt;br /&gt;
&lt;br /&gt;
The sequence index is typically not compatible across different BWA versions. To rebuild the sequence index, issue the following commands (they will take approximately 2 minutes to complete):&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; bwa index -a is ref/human_g1k_v37_chr20.fa&lt;br /&gt;
  &amp;gt; samtools faidx ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
== A quick look to the fastq files ==&lt;br /&gt;
&lt;br /&gt;
The sequencers provides unmapped reads which are stored in fastq file. For this workshop, you will find DNA sequence reads for 3 samples in fastq format. To conserve disk space, the files have been compressed with gzip but, since fastq is a simple text format, you can easily view the contents of the files using a command like:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zcat fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz | less&lt;br /&gt;
&lt;br /&gt;
A fastq file consists of a series of multi-line records. Each record starts with a read name, followed by a DNA sequencing, a separator line, and a set of per base quality scores. Base quality scores estimate the probability of error at each sequenced base (a base quality of 10 denotes an error probability of 10%, base quality 20 denotes 1% error probability and base quality 30 denotes 0.1% error probability). These error probabilities are each encoded in a single character (for compactness) and can be decoded using an [http://www.google.com/search?q=ascii+table ascii table] - you can look up the ascii code for each base and subtract 33 to get base quality. By inspecting the fastq file you should be able to learn about the length of reads being mapped and their base qualities (is base quality typically higher at the start or end of each read). You can find more details about the fastq format here [http://en.wikipedia.org/wiki/FASTQ_format Wikipedia fastq format].&lt;br /&gt;
For each sample you will find two fastq files, since the 1000G samples are sequenced in paired end.  In paired end sequencing, each DNA fragment has been sequenced twice, once in the forward and once in the reverse direction.&lt;br /&gt;
&lt;br /&gt;
* Q1: What is the base quality of the fifth nucleotide of the third read in the file HG00111.lowcoverage.chr20.smallregion_1.fastq.gz?&lt;br /&gt;
&lt;br /&gt;
== Mapping reads to the genome ==&lt;br /&gt;
&lt;br /&gt;
There are many different tools for mapping DNA sequence reads. One of the most commonly used tools is BWA, developed by Heng Li and Richard Durbin at the Sanger Center. As with other read mappers, BWA first builds an index of the reference genome and then uses this index to quickly assign each sequence read to a genomic location. &lt;br /&gt;
&lt;br /&gt;
To learn more about BWA, you should visit the BWA website at http://bio-bwa.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
Here, we will use the [http://genome.sph.umich.edu/wiki/GotCloud:_Alignment_Pipeline GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt;]  command to run BWA to find the most likely sequence location for each read. For time reasons we will map only 3 samples, and you will find the remaining 7 samples in the folder bams/.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command requires the configuration file, which contains the index file and the files to be used as reference. &lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat config/gotCloud.align.conf&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 INDEX_FILE = index/gotCloud.align.index&lt;br /&gt;
 ###################&lt;br /&gt;
 # References&lt;br /&gt;
 REF_DIR = ref&lt;br /&gt;
 AS = NCBI37&lt;br /&gt;
 REF = $(REF_DIR)/human_g1k_v37_chr20.fa&lt;br /&gt;
 DBSNP_VCF =  $(REF_DIR)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_DIR)/hapmap_3.3.b37.chr20.smallregion.sites.vcf.gz&lt;br /&gt;
&lt;br /&gt;
You can find the index file containing the samples to be used in the index folder&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; cat index/gotCloud.align.index&lt;br /&gt;
&lt;br /&gt;
 MERGE_NAME      FASTQ1  FASTQ2  RGID    SAMPLE  LIBRARY CENTER  PLATFORM&lt;br /&gt;
 HG00108 fastq/HG00108.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00108.lowcoverage.chr20.smallregion_2.fastq.gz  HG00108 HG00108 HG00108 1000G   ILLUMINA&lt;br /&gt;
 HG00111 fastq/HG00111.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00111.lowcoverage.chr20.smallregion_2.fastq.gz  HG00111 HG00111 HG00111 1000G   ILLUMINA&lt;br /&gt;
 HG00120 fastq/HG00120.lowcoverage.chr20.smallregion_1.fastq.gz   fastq/HG00120.lowcoverage.chr20.smallregion_2.fastq.gz  HG00120 HG00120 HG00120 1000G   ILLUMINA&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We are now ready to align our fastq files. Since we are aligning only 100kb in 3 samples, this step will require more or less 2 minutes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud align --conf config/gotCloud.align.conf --outDir align --basePrefix .&lt;br /&gt;
&lt;br /&gt;
 File sizes of 6 FASTQ input files referenced in &#039;/net/sardinia/progenia/csidore/Bertinoro/testdir/index /gotCloud.align.index&#039; = 0.01 GB&lt;br /&gt;
 Total temp space will be about 0.05 GB&lt;br /&gt;
 Be sure you have enough space to hold all this data&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00111.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00108.Makefile&lt;br /&gt;
 Created /net/sardinia/progenia/csidore/Bertinoro/testdir/align/Makefiles/align_HG00120.Makefile&lt;br /&gt;
 ---------------------------------------------------------------------&lt;br /&gt;
 Waiting while samples are processed...&lt;br /&gt;
 Processing finished in 77 secs with no errors reported&lt;br /&gt;
&lt;br /&gt;
You can now see the bam files (HG00XXX.recal.bam) you just created in :&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls align/bams/&lt;br /&gt;
&lt;br /&gt;
In the same folder you can also see the .bai files (the index files used to quickly access every region of the genome) and some other files specific to the gotCloud pipeline.&lt;br /&gt;
&lt;br /&gt;
The GotCloud &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; command maps the reads to the genome, marks duplicate reads, and recalibrates quality scores to allow better error estimation in genotype evaluation.&lt;br /&gt;
 &lt;br /&gt;
GotCloud also provides some statistics on the identity verification and contamination evaluation by using [http://genome.sph.umich.edu/wiki/VerifyBamID verifyBamID] and some useful quality statistics by using [http://genome.sph.umich.edu/wiki/QPLOT QPLOT]. Let&#039;s take a look at some quality statistics for the sample HG00108&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat align/QCFiles/HG00108.qplot.stats&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q2. Which is the mean depth of the sample HG00108? And the mapping rate?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Browsing Alignment Results ===&lt;br /&gt;
&lt;br /&gt;
You can view the contents of the alignment at any location using the &amp;lt;code&amp;gt;samtools view&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;samtools tview&amp;lt;/code&amp;gt; commands. While &amp;lt;code&amp;gt;tview&amp;lt;/code&amp;gt; generates prettier output,&lt;br /&gt;
it is not compatible with all screens. For example, to view reads overlapping &lt;br /&gt;
starting at position 33,350,971 on chromosome 20, we could run:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; samtools tview align/bams/HG00111.recal.bam ref/human_g1k_v37_chr20.fa&lt;br /&gt;
&lt;br /&gt;
Then, type &amp;quot;g 20:33350971&amp;quot; to move the visualization there and press &amp;quot;.&amp;quot; to hide/unhide the nucleotide equal to the reference.&lt;br /&gt;
&lt;br /&gt;
The first line of the view indicates the positions in the genome.&lt;br /&gt;
&lt;br /&gt;
The second line is the reference genome.&lt;br /&gt;
&lt;br /&gt;
The third line is the reconstruction of the sequence of the individual HG00111 using the reads contained in the bam file. Note the candidate variant at position  33350987. Since at this position there are 4 reads with C and 2 read with T (equal to the reference) the most likely genotype is C/T indicated as Y (according to [http://www.bioinformatics.org/sms2/iupac.html IUPAC] )&lt;br /&gt;
&lt;br /&gt;
The 4th and following lines represent the reads contained in the bam files, each group of letters is a read.&lt;br /&gt;
&lt;br /&gt;
You can play with the visualization help to set different way to visualize nucleotides, base qualities, mapping qualities and so on.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;?&amp;quot; in the tview screen to show the help and the available options&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;q&amp;quot; to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to check the reads covering a position is to use &amp;lt;code&amp;gt;samtools mpileup&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The header of the mpileup format is &amp;quot;CHR     POS             REF     DEPTH   BASES   QUALITIES&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; samtools view  -uh  align/bams/HG00111.recal.bam 20:33350987| samtools mpileup - | grep 33350987&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Q3: What is the depth of position 33538999 for the sample HG00111? What would be the most likely genotype looking at the reads? (You can answer this question by using tview or mpileup.)&lt;br /&gt;
&lt;br /&gt;
== Initial set of variant calls ==&lt;br /&gt;
&lt;br /&gt;
We can also use [http://genome.sph.umich.edu/wiki/GotCloud:_Variant_Calling_Pipeline GotCloud &amp;lt;code&amp;gt;snpcall&amp;lt;/code&amp;gt;] to identify the SNPs present in our bam files and generate a VCF file containing the variant calls.&lt;br /&gt;
&lt;br /&gt;
The variant calling pipeline has multiple built-in steps to generate BAMs:&lt;br /&gt;
&lt;br /&gt;
# Filter out reads with low mapping quality&lt;br /&gt;
# Per Base Alignment Quality Adjustment (BAQ)&lt;br /&gt;
# Resolve overlapping paired end reads&lt;br /&gt;
# Generate genotype likelihood files&lt;br /&gt;
# Perform variant calling&lt;br /&gt;
# Extract features from variant sites&lt;br /&gt;
# Perform variant filtering &lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the variant calling with:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; gotcloud snpcall --conf config/gotCloud.snpcall.conf --outDir snpcall&lt;br /&gt;
&lt;br /&gt;
This step will create a Makefile containing the commands to be executed and their mutual dependencies to facilitate the command parallelization.&lt;br /&gt;
&lt;br /&gt;
Now run the Makefiles as gotcloud suggests and continue with the workshop while gotCloud executes (it will take 5-10 minutes):&lt;br /&gt;
 &lt;br /&gt;
  &amp;gt; make -f snpcall/umake.Makefile &lt;br /&gt;
&lt;br /&gt;
Note that, in this case we are using a single CPU to run the snp calling. If you have multiple CPUs you can run gotcloud in parallel using multiple CPUs by setting the parameter &amp;quot;-j&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
While waiting for gotCloud to take care of all these steps, we will take a look to the configuration and index file.&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat config/gotCloud.snpcall.conf&lt;br /&gt;
&lt;br /&gt;
 CHRS = 20 # you can add here more chromosomes&lt;br /&gt;
 BAM_INDEX = index/gotCloud.snpcall.index&lt;br /&gt;
 ############&lt;br /&gt;
 # References&lt;br /&gt;
 REF_ROOT = ref&lt;br /&gt;
 #&lt;br /&gt;
 REF = $(REF_ROOT)/human_g1k_v37_chr20.fa&lt;br /&gt;
 INDEL_PREFIX = $(REF_ROOT)/1kg.pilot_release.merged.indels.sites.hg19&lt;br /&gt;
 DBSNP_VCF =  $(REF_ROOT)/dbsnp_135.b37.chr20.smallregion.vcf.gz&lt;br /&gt;
 HM3_VCF = $(REF_ROOT)/hapmap_3.3.b37.sites.chr20.smallregion.vcf.gz&lt;br /&gt;
 OMNI_VCF = $(REF_ROOT)/1000G_omni2.5.b37.sites.PASS.chr20.smallregion.vcf.gz&lt;br /&gt;
&lt;br /&gt;
In this case, we want to run a single chromosome (20) and we are using a different index file to include all the 10 samples in the workshop dataset &lt;br /&gt;
&lt;br /&gt;
  &amp;gt; cat index/gotCloud.snpcall.index&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HG00108 1000G   snpcall_bams/HG00108.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00111 1000G   snpcall_bams/HG00111.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00120 1000G   snpcall_bams/HG00120.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00096 1000G   snpcall_bams/HG00096.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00100 1000G   snpcall_bams/HG00100.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00103 1000G   snpcall_bams/HG00103.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00114 1000G   snpcall_bams/HG00114.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00116 1000G   snpcall_bams/HG00116.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00117 1000G   snpcall_bams/HG00117.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
 HG00119 1000G   snpcall_bams/HG00119.lowcoverage.chr20.smallregion.bam&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Results of the variant calling are stored in vcf format, for a complete description of this format, you can take a look at &lt;br /&gt;
[http://www.1000genomes.org/wiki/Analysis/Variant%20Call%20Format/vcf-variant-call-format-version-41 VCF Format Specifications]&lt;br /&gt;
&lt;br /&gt;
The first section of the vcf is the meta-information, every line in this section starts with &amp;quot;##&amp;quot;.&lt;br /&gt;
You can find some useful information about the data that we are going to analyse and the meaning of the fields.&lt;br /&gt;
&lt;br /&gt;
After the meta-information, we can see the header line starting with &amp;quot;#&amp;quot;. This line contains the column description and the identifiers of the samples included in the variant calling.&lt;br /&gt;
&lt;br /&gt;
Finally, in the data section we find a line for each of the variants found. Each line has 8 fixed fields&lt;br /&gt;
( CHROM POS ID REF ALT QUAL FILTER INFO ) followed by a column for each individual included in the analysis.&lt;br /&gt;
&lt;br /&gt;
The INFO column reports a set of features, as described in the meta-information section, and these features help in evaluating the quality and the frequency of a variant. You may also add or customize your own features and report them in the meta-information section and in this column. &lt;br /&gt;
&lt;br /&gt;
The FORMAT field describes the format of each genotype in the sample genotype columns, again you can see some information about their meaning in the meta-information section. &lt;br /&gt;
&lt;br /&gt;
At this point, gotcloud should have completed the snp calling and generated the file:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
&lt;br /&gt;
If not, the &amp;quot;ls&amp;quot; command will report an error, just wait a little bit more:&lt;br /&gt;
  &amp;gt; ls snpcall/split/chr20/subset.OK&lt;br /&gt;
    ls: cannot access snpcall/split/chr20/subset.OK: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take some time to inspect the meta-information and the header sections:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zless -nS snpcall/vcfs/chr20/chr20.filtered.vcf.gz&lt;br /&gt;
&lt;br /&gt;
Let&#039;s consider a sample genotyping at the position 33514465 (if needed, check the FORMAT fields in the meta-information section in the vcf to understand the data format)&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; snpcall/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,4,5,9,14&lt;br /&gt;
&lt;br /&gt;
  POS       REF     ALT     FORMAT       HG00111&lt;br /&gt;
  33514465  T       C       GT:GD:GQ:PL  1/1:3:10:117,9,0&lt;br /&gt;
&lt;br /&gt;
* Q4: What is the genotype at this position? (T/T,C/T or C/C?) How many reads are covering this position? Is this consistent with the result you can obtain by using tview or mpileup?&lt;br /&gt;
&lt;br /&gt;
* Q5: Which is the &amp;quot;Total Depth at Site&amp;quot; for the variant at position 33500378?&lt;br /&gt;
&lt;br /&gt;
* Q6: How many alternate alleles are found at position 33504228?&lt;br /&gt;
&lt;br /&gt;
* Q7: Is the genotype of HG00108 at position 33538999 consistent with what you predicted in Q3? (be careful about choosing the right column with the &amp;quot;cut&amp;quot; command)&lt;br /&gt;
&lt;br /&gt;
* Q8: How many variant sites were detected in this dataset? Try a command like this one:&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -vE ^# snpcall/vcfs/chr20/chr20.filtered.vcf.gz | wc -l&lt;br /&gt;
&lt;br /&gt;
(The grep command line excludes all lines beginning with # and then the wc command counts the number of lines in the file).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
* How many variant sites are estimated to be singletons?&lt;br /&gt;
!--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Genotype Refinement Using Linkage Disequilibrium Information ==&lt;br /&gt;
&lt;br /&gt;
The initial set of genotype calls is generated examining a single individual at a time. These calls are typically quite good for deep sequencing data, but much less accurate for low pass sequence data. &lt;br /&gt;
&lt;br /&gt;
For instance , let&#039;s check the genotype of HG00111 at position 33514465, extracting the information from a vcf generated with gotCloud and exome sequencing on the sample HG00111&lt;br /&gt;
&lt;br /&gt;
  &amp;gt; zgrep -E &amp;quot;CHROM|33514465&amp;quot; exome/vcfs/chr20/chr20.filtered.vcf.gz | cut -f 2,10&lt;br /&gt;
&lt;br /&gt;
  POS  HG00111&lt;br /&gt;
  33514465     0/1:16:85:137,0,82&lt;br /&gt;
&lt;br /&gt;
The pileup of this position from the bam file reports 4T&#039;s and 12C&#039;s&lt;br /&gt;
&lt;br /&gt;
* Q9: Is this genotype concordant with the one found in the low pass variant calling? Which genotype do you think is more accurate?&lt;br /&gt;
* Q10: What can be the reason of the genotype discordance?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Low pass sequencing data, however, can be greatly improved by models that combine information across sites and individuals.&lt;br /&gt;
&lt;br /&gt;
Here is how that might work:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt;  gotcloud ldrefine --conf config/gotCloud.snpcall.conf  --outDir snpcall --numjobs 1&lt;br /&gt;
&lt;br /&gt;
Again, you can review the contents of the updated VCF file using the zless command:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; zless snpcall/thunder/chr20/1000G/thunder/chr20.filtered.PASS.beagled.1000G.thunder.vcf.gz&lt;br /&gt;
&lt;br /&gt;
* Q11: Compare the genotype of the sample HG00111 at position 33514465 in the exome and in the LD-refined VCF. Did something change? Why?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Tutorial:_Low_Pass_Sequence_Analysis_Answers]]&lt;/div&gt;</summary>
		<author><name>Csidore</name></author>
	</entry>
</feed>