#+title: Validated variant calling: structural, joint, somatic
#+author: Brad Chapman \\ Bioinformatics Core, Harvard School of Public Health \\ https://github.com/chapmanb/bcbio-nextgen \\ http://j.mp/bcbiolinks
#+date: 15 October 2014

#+OPTIONS: toc:nil H:2

#+startup: beamer
#+LaTeX_CLASS: beamer
#+latex_header: \usepackage{url}
#+latex_header: \usepackage{hyperref}
#+latex_header: \hypersetup{colorlinks=true}
#+BEAMER_THEME: default
#+BEAMER_COLOR_THEME: seahorse
#+BEAMER_INNER_THEME: rectangles

* bcbio overview

** Variant calling

[[./images5/SNV_calling.png]]

\footnotesize
http://en.wikipedia.org/wiki/SNV_calling_from_NGS_data
\normalsize

** Ok, VCFs

#+BEGIN_CENTER
#+ATTR_LATEX: :width 1.0\textwidth
[[./images7/exvcf.png]]
#+END_CENTER

** Summary

\Large
- What is bcbio?
- Community software development
- Variation validation
- Software support

** White box software

[[./images5/clear_box.jpg]]

** Overview

#+ATTR_LATEX: :width 1.0\textwidth
[[./images3/bcbio_nextgen_highlevel.png]]

\vspace{1cm}
https://github.com/chapmanb/bcbio-nextgen

** Uses

\Large
- Aligners: bwa-mem, novoalign, bowtie2
- Variantion: FreeBayes, GATK, Platypus, MuTecT, scalpel, SnpEff, VEP, GEMINI, Lumpy, Delly
- RNA-seq: Tophat, STAR, cufflinks, HTSeq
- Quality control: fastqc, bamtools, RNA-SeQC
- Manipulation: bedtools, bcftools, biobambam, sambamba, samblaster, samtools,
  vcflib
\normalsize

** Provides

\Large
- Community -- collected set of expertise
- Tool integration
- Validation -- outputs + automated evaluation
- Scaling
- Installation of tools and data
\normalsize

* Community

** Complex, rapidly changing pipelines

[[./images2/gatk_changes.png]]

** Large number of specialized dependencies

#+ATTR_LATEX: :width .5\textwidth
[[./images/huge_seq.png]]

[[https://github.com/StanfordBioinformatics/HugeSeq]]


** Quality differences between methods

#+ATTR_LATEX: :width .7\textwidth
[[./images/gcat_comparison.png]]

[[http://www.bioplanet.com/gcat]]

** Solution

#+BEGIN_CENTER
#+ATTR_LATEX: :width .5\textwidth
[[./images/community.png]]
#+END_CENTER

\scriptsize
[[http://www.amazon.com/Community-Structure-Belonging-Peter-Block/dp/1605092770]]
\normalsize

** Community: contribution

[[./images5/bcbio_github.png]]

[[https://github.com/chapmanb/bcbio-nextgen]]

** Community: documentation

[[./images/community-docs.png]]

[[https://bcbio-nextgen.readthedocs.org]]

* Variant quality

** Validation

\Large
Tests for implementation and methods

- Family/population calling
- Structural variations
- Cancer tumor/normal
\normalsize

** Reference materials

#+BEGIN_CENTER
#+ATTR_LATEX: :width .6\textwidth
[[./images/giab.png]]

[[http://www.genomeinabottle.org/]]
#+END_CENTER

** Joint variant calling definitions

\Large
- Joint calling
- Squaring off/backfilling
- Pooled calling
- Single sample calling

\vspace{1cm}
http://j.mp/bcbiojoint

** Squared off VCF

#+ATTR_LATEX: :width 1.1\textwidth
[[./images7/squaredoff.png]]
#+END_CENTER

\scriptsize
http://gatkforums.broadinstitute.org/discussion/4150/should-i-analyze-my-samples-alone-or-together

** Implementation

\Large
- GATK HaplotypeCaller -- gVCFs
- FreeBayes -- recalling
- Platypus -- recalling
- samtools 1.x -- recalling

\vspace{1cm}
\normalsize
https://github.com/chapmanb/bcbio.variation.recall

** Scaling and analysis flexibility

\Large
- Parallelize: call samples individually
- Add single new sample to analysis
- Combine existing populations

** Multiple approaches work well

#+BEGIN_CENTER
#+ATTR_LATEX: :width 1.1\textwidth
[[./images7/joint.png]]
#+END_CENTER

** Joint vs batch vs single

#+BEGIN_CENTER
#+ATTR_LATEX: :width 0.9\textwidth
[[./images7/method_compare-gatk-NA12878.png]]
#+END_CENTER

** Structural variations

\Large
- Goal: identify regions with potential issues
- Rough boundaries for additional analysis
- Ensemble: union of all calls
- Understand sensitivity and precision

\vspace{1.0cm}
http://j.mp/bcbiosv

** Structural variant callers

- \Large LUMPY \small https://github.com/arq5x/lumpy-sv
\vspace{0.1cm}
- \Large Delly \small https://github.com/tobiasrausch/delly
\vspace{0.1cm}
- \Large cn.mops \small http://www.bioconductor.org/packages/release/bioc/html/cn.mops.html
\vspace{0.1cm}
- \Large CNVkit \small http://cnvkit.readthedocs.org/
\vspace{0.1cm}
- \Large WHAM \small https://github.com/jewmanchue/wham

** Structural variant evaluation

#+BEGIN_CENTER
#+ATTR_LATEX: :width 0.9\textwidth
[[./images7/svval.png]]
#+END_CENTER

** Cancer tumor/normal

\Large
- Truth calls: synthetic data from DREAM challenge
- Mixed population of subclones
- Need additional complexity: mixed cellularity

\vspace{1cm}
http://j.mp/dreamsyn3

** Community built

#+BEGIN_CENTER
#+ATTR_LATEX: :width 0.7\textwidth
[[./images7/mutect_contrib.png]]
#+END_CENTER

\Large
- Luca Beltrame --  IRCCS, Italy
- Miika Ahdesmaki -- AstraZeneca
- Mario Giovacchini -- SciLifeLab, Sweden
- Lorena Pantano -- HSPH

** Callers available

\Large
- \Large MuTect \small https://www.broadinstitute.org/cancer/cga/mutect
\vspace{0.1cm}
- \Large FreeBayes \small https://github.com/ekg/freebayes
\vspace{0.1cm}
- \Large VarScan \small http://varscan.sourceforge.net/
\vspace{0.1cm}
- \Large VarDict \small https://github.com/AstraZeneca-NGS/VarDict
\vspace{0.1cm}
- \Large Ensemble \small

** Somatic evaluation

#+BEGIN_CENTER
#+ATTR_LATEX: :width 1.0\textwidth
[[./images7/freebayes_lodfreqfilter-syn3-tumor.png]]
#+END_CENTER

** Benefits of improved filtering

#+BEGIN_CENTER
#+ATTR_LATEX: :width 0.9\textwidth
[[./images7/freebayes_improve-syn3-tumor.png]]
#+END_CENTER

** Validation enables scaling

\Large
- Little value in realignment when using haplotype aware caller
- Little value in recalibration when using high quality reads
- Streaming de-duplication approaches provide same quality without disk IO

\vspace{1.0cm}
[[http://j.mp/bcbioeval2]]
\normalsize

* Docker -- installation

** Make installation easy

#+ATTR_LATEX: :width 0.65\textwidth
[[./images2/install_want.png]]

*** Automated Install                                                 :block:
    :PROPERTIES:
    :BEAMER_env: exampleblock
    :END:

We made it easy to install a large number of biological tools. \\
Good or bad idea?

** Need a consistent support environment

[[./images4/install_issues.png]]

** Docker lightweight containers

#+BEGIN_CENTER
#+ATTR_LATEX: :width .6\textwidth
[[./images/homepage-docker-logo.png]]
#+END_CENTER

http://docker.io

** Docker benefits

\Large
- Fully isolated
- Reproducible -- store full environment with analysis (1Gb)
- Improved installation -- single download + data

** bcbio with Docker

\Large
- External Python wrapper
   - \Large Installation
   - Start and run containers
   - Mount external data into containers
   - Parallelize
- All analysis tools inside Docker
\normalsize

\vspace{0.5cm}
https://github.com/chapmanb/bcbio-nextgen-vm
http://j.mp/bcbiodocker


* Summary

** Sustainability

\Large
A piece of software is being sustained if people are using it, fixing it, and
improving it rather than replacing it.

\vspace{0.5cm}

\normalsize
http://software-carpentry.org/blog/2014/08/sustainability.html

** Summary

\Large
- What is bcbio?
- Community software development
- Variation validation
- Software support

\Large
https://github.com/chapmanb/bcbio-nextgen
\normalsize
