A Bayesian framework for the analysis and interpretation of rare genetic variants