BAnOCC is a package for analyzing compositional covariance while accounting for the compositional structure. Briefly, the model assumes that the unobserved counts are log-normally distributed and then infers the correlation matrix of the log-basis (see the BAnOCC User Manual for a more detailed explanation). The inference is made using No U-Turn Sampling for Hamiltonian Monte Carlo (Hoffman and Gelman 2014) as implemented in the rstan R package (Stan Development Team 2015).

For more information on the technical aspects:

User Manual || User Tutorial || Forum


Emma SchwagerHimel MallickSteffen VentzCurtis Huttenhower

A Bayesian method for detecting pairwise associations in compositional data


  1. R software (version >= 3.3)
  2. R package “rstan” (version >= 2.10.1)
  3. R package “coda” (version >= 0.18.1)
  4. R package “mvtnorm”
  5. R package “stringr”


There are three options for installing BAnOCC:

  • Within R
  • Using compressed file from bitbucket
  • Directly from bitbucket

From Github (Directly)

Clone the repository using git clone, which downloads the package as its own directory called banocc.

git clone

Then, install BAnOCC’s dependencies. If these are already installed on your machine, this step can be skipped.

Rscript -e "install.packages(c('rstan', 'mvtnorm', 'coda', 'stringr'))"

Lastly, install BAnOCC using R CMD INSTALL. This command should be run in the parent directory of banocc/. Note that this will not automatically install the dependencies, so they must be installed first.



Hoffman, Matthew D., and Andrew Gelman. 2014. “The No-U-Turn Sampler: Adaptively Setting Path Lengths in Hamiltonian Monte Carlo.” J. Mach. Learn. Res. 15 (1). 1593–1623.

Stan Development Team. 2015. “Stan: A C++ Library for Probability and Sampling, Version 2.10.0.”