{"items":["5f7007605f9fcc0017abe9e4","5f7007605f9fcc0017abe9e5","5f7007605f9fcc0017abe9e6"],"styles":{"galleryType":"Columns","groupSize":1,"showArrows":true,"cubeImages":true,"cubeType":"max","cubeRatio":1.7777777777777777,"isVertical":true,"gallerySize":30,"collageAmount":0,"collageDensity":0,"groupTypes":"1","oneRow":false,"imageMargin":30,"galleryMargin":0,"scatter":0,"chooseBestGroup":true,"smartCrop":false,"hasThumbnails":false,"enableScroll":true,"isGrid":true,"isSlider":false,"isColumns":false,"isSlideshow":false,"cropOnlyFill":false,"fixedColumns":0,"enableInfiniteScroll":true,"isRTL":false,"minItemSize":50,"rotatingGroupTypes":"","rotatingCubeRatio":"","gallerySliderImageRatio":1.7777777777777777,"numberOfImagesPerRow":3,"numberOfImagesPerCol":1,"groupsPerStrip":0,"borderRadius":0,"boxShadow":0,"gridStyle":0,"mobilePanorama":false,"placeGroupsLtr":false,"viewMode":"preview","thumbnailSpacings":4,"galleryThumbnailsAlignment":"bottom","isMasonry":false,"isAutoSlideshow":false,"slideshowLoop":false,"autoSlideshowInterval":4,"bottomInfoHeight":0,"titlePlacement":["SHOW_ON_THE_RIGHT","SHOW_BELOW"],"galleryTextAlign":"center","scrollSnap":false,"itemClick":"nothing","fullscreen":true,"videoPlay":"hover","scrollAnimation":"NO_EFFECT","slideAnimation":"SCROLL","scrollDirection":0,"overlayAnimation":"FADE_IN","arrowsPosition":0,"arrowsSize":23,"watermarkOpacity":40,"watermarkSize":40,"useWatermark":true,"watermarkDock":{"top":"auto","left":"auto","right":0,"bottom":0,"transform":"translate3d(0,0,0)"},"loadMoreAmount":"all","defaultShowInfoExpand":1,"allowLinkExpand":true,"expandInfoPosition":0,"allowFullscreenExpand":true,"fullscreenLoop":false,"galleryAlignExpand":"left","addToCartBorderWidth":1,"addToCartButtonText":"","slideshowInfoSize":200,"playButtonForAutoSlideShow":false,"allowSlideshowCounter":false,"hoveringBehaviour":"NEVER_SHOW","thumbnailSize":120,"magicLayoutSeed":1,"imageHoverAnimation":"NO_EFFECT","imagePlacementAnimation":"NO_EFFECT","calculateTextBoxWidthMode":"PERCENT","textBoxHeight":60,"textBoxWidth":200,"textBoxWidthPercent":75,"textImageSpace":10,"textBoxBorderRadius":0,"textBoxBorderWidth":0,"loadMoreButtonText":"","loadMoreButtonBorderWidth":1,"loadMoreButtonBorderRadius":0,"imageInfoType":"ATTACHED_BACKGROUND","itemBorderWidth":0,"itemBorderRadius":0,"itemEnableShadow":false,"itemShadowBlur":20,"itemShadowDirection":135,"itemShadowSize":10,"imageLoadingMode":"BLUR","expandAnimation":"NO_EFFECT","imageQuality":90,"usmToggle":false,"usm_a":0,"usm_r":0,"usm_t":0,"videoSound":false,"videoSpeed":"1","videoLoop":true,"gallerySizeType":"px","gallerySizePx":1000,"allowTitle":true,"allowContextMenu":true,"textsHorizontalPadding":-30,"itemBorderColor":{"themeName":"color_12","value":"rgba(230,230,230,0)"},"showVideoPlayButton":true,"galleryLayout":2,"calculateTextBoxHeightMode":"MANUAL","targetItemSize":1000,"selectedLayout":"2|bottom|1|max|true|0|true","layoutsVersion":2,"selectedLayoutV2":2,"isSlideshowFont":true,"externalInfoHeight":60,"externalInfoWidth":0.75},"container":{"width":300,"galleryWidth":330,"galleryHeight":0,"scrollBase":0,"height":null}}

# MCMC II: Applying MCMC in somatic variant calling

In PREVIOUS ARTICLE, we introduced theoretical basis of MCMC, its components and how it approximates the posterior distribution of interest via sampling in high dimension data. Here let's put MCMC into actual application in genomic research.

Next Generation Sequencing (NGS) is a relatively complicated process. Multiple experimental steps can introduce technical noise, such as during sequencing. These noise affects the accuracy of cancer mutation detection. Traditional method assumes equal error rate across different genomic loci. However, numerous factors, such as sequence context, yield distinct error rate across different genomic loci. To build a more precise variant caller, it is reasonable to take those factors into consideration and put them in a Bayesian structure model, for instance MCMC.

**How do we choose Bayesian model**

With advance of NGS technique, mature sequencing platform now demonstrates relatively low sequencing error (~0.1% on illumina sequencer). On the other hand, sequencing depth of a tumor sample is relatively high (mostly > 500). Therefore, we can use Poisson distribution to model sequencing error rate. average error rate is denoted as *λ*. For each genomic locus *p, *mutation depth *y *follows specific error rate:

* λ ~ d*µ;*

where *d *is total sequencing depth and *µ *is variant depth. Given the sequencing depth and variant depth, we have likelihood function:

*y ~ Possion(λ)*

We choose a Gamma distribution, a conjugate distribution to Poisson, as prior;

*y ~ Gamma (α, β)*

This prior represents certain specific property of each genomic locus, such as sequence context and mappability. Estimated Gamma distribution will be different across genomic loci. We will use this site specific prior distribution to adjust likelihood function and derive posterior distribution (Gamma-Poisson distribution, alternatively called negative binomial distribution).

**Approximating prior distirbution using Gibbs sampler**

We can image that these site specific prior distribution is too complicated to be derived in a closed form solution. **We therefore utilize MCMC to approximate the prior distribution via sampling:**

In practice, we can use white blood cells (WBC) or cfDNA of healthy individual for training distribution of technical noise. With this Bayesian model, we can use approximated posterior distribution for hypothesis test on each variant candidate. Those variants with allele frequency significantly away from our estimated posterior distribution are likely to be true somatic variant.

These modeling strategy is especially suitable for somatic variant detection in cfDNA since those variants are of low allele frequency and suitable control sample is usually unavailable.