5.13 thetaRatio

Estimate the ratio in heterozygosity (theta) between genomic regions

thetaRatio uses an MCMC (Metropolis-Hastings Algorithm) to estimate the ratio of the expected heterozygosity from sites in two different regions.

\[\Phi = log(\frac{\theta_1}{\theta_2})\]

5.13.1 Parameters

5.13.1.1 Input

--bam Input_bam_file.bam Input bam file
--region1 region_1 --region2 region_2 Two files, region_1 and region_2 that define the regions of the two thetas

5.13.2 Output

*_thetaRatioMCMC.txt.gz File containing MCMC chain.

5.13.3 Usage Example

# Simulate a BAM File with specific theta
atlas simulate --chrLength "10000,20000" --theta "0.001,0.002"

# Create region files
echo "chr1 1 10000" > region1.bed
echo "chr2 1 10000" > region2.bed

# 
atlas thetaRatio --bam ATLAS_simulations.bam --region1 region1.bed --region2 region2.bed

5.13.4 Method

The likelihood function is:

\[ {P}(\boldsymbol{d}_1,\boldsymbol{d}_2|\theta_1,\theta_2, \boldsymbol{\pi}_1, \boldsymbol{\pi}_2) = \dfrac{\prod\limits_{i=1}^I \sum\limits_g \prod\limits_{j=1}^{n_i} \mathbb{P}(d_{1_{ij}}|g_i=g)\mathbb{P}(g_i=g|\theta_1,\boldsymbol{\pi}_1)}{\prod\limits_{i=1}^I \sum\limits_{g} \prod\limits_{j=1}^{n_i} \mathbb{P}(d_{2_{ij}}|g_i=g)\mathbb{P}(g_i=g|\theta_2,\boldsymbol{\pi}_2)} \] An MCMC is used to infer the posterior distribution for all parameters. Updates are performed for all: \((\boldsymbol{\pi})\) and \((\log(\theta_1))\) and \((\log(\theta_2))\).

\(U[0,1]\) prior is used for \((\log(\theta_1))\) and \((\log(\theta_1))\) and \(N(0, 1)\). is used for \((\boldsymbol{\pi})\).