Bayesian estimation of the population size parameter theta from genomic data
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
R First commit May 8, 2017
data Add files via upload Aug 7, 2017
inst First commit May 8, 2017
man First commit May 8, 2017
src Delete Aug 7, 2017
vignettes Rename ThetaMater_Tutorial.Rmd to Jan 22, 2019
.DS_Store First commit May 8, 2017
.Rbuildignore First commit May 8, 2017
.gitignore First commit May 8, 2017
NAMESPACE Update NAMESPACE May 8, 2017 Rename README.rmd to Jan 22, 2019

ThetaMater: Rapid and scalable Bayesian estimation of the population size parameter theta=4Nu from diverse genetic data

NOTE See the file for detailed instructions

Steps for Bayesian estimation of theta and alpha (see tutorial for more details)

  1. Read input files and convert to infinite-sites data used by ThetaMater
  2. Choose a specific Bayesian model for estimating theta along (ThetaMater.M1), theta with a fixed alpha shape parameter (ThetaMater.M2), or the joint posterior distribution of theta and alpha (ThetaMater.M3).
  3. (Optional) Convert the results of ThetaMater into estimates of effective population size by multiplying the posterior distribution of theta by a given mutation rate.
  4. (Optional) Filter out loci with high mutation counts that likely represent spurious loci using the posterior predictive simulator function (ThetaMater.PPS).
  5. (Optional) Identifying the maximum bounds of mutation counts from the posterior distribution, remove loci with outlier mutation counts that are too high beyond the posterior distribution, and re-estimate Theta using filtered dataset

Installing R package GppFst from github

*** IMPORTANT: ThetaMater was written using R.3.3.3. We recommend using this version of R to ensure that the underlying c++ functions will operate correctly (this version of Rcpp works best with R.3.3.3). If you discover memory errors (Rstudio unexpectedly closeles, segmental fault errors, etc.) when attempting to run ThetaMater, please reinstall R.3.3.3 and this should correct any issues. Contact the author ( if any memory errors associated with c++ and Rcpp arise when using ThetaMater. R version 3.3.3 can be download here: These packages will be updated in the future for further support in updated R versions. ***

*** ThetaMater require the Boost c++ libraries to be installed for the fast calculation of the underlying likelihood functions. I recommend install the Boost libraries using brew for Mac systems (brew install boost). The latest version of the Boost c++ libraries here:

The R package ThetaMater is freely available to download and distribute from github To install and load ThetaMater, you must first install the R packages devtools, Rcpp, and MCMCpack. Additionally, make sure the most updated version of R version 3.3.3 is installed (see above warning). Download R version 3.3.3 here:


Now using devtools we can install ThetaMater from github:

library(ThetaMater) # Load package ThetaMater
library(MCMCpack) # Load dependancy phybase

To begin using ThetaMater try using our vignette with example files provided with this package.