Skip to content

Repository files navigation

Bayesian Estimator of Selfing (BES)

BES is a software package for estimating self-fertilization (selfing) rates and other mating system parameters from genotype data. BES estimates parameters in a Bayesian framework using Markov chain Monte Carlo (MCMC).

BES contains a generic model for estimating selfing rates and mutation rates independent of a mating system. BES also contains models of

  • pure hermaphroditism
  • androdioecy (hermaphrodites + males)
  • gynodioecy (hermaphrodites + females)

Additional non-genetic information, such as field observations of the number of females or males, is required to estimate mating system parameters.

See the paper and figures.

BES 0.2.0 updates the package and model templates for BAli-Phy 4.3.

A more robust estimator

BES version 0.1.3 has been changed to be more robust by estimating the loss-of-heterozygosity (F[other]) that is not due to selfing as well as the selfing rate (s or s*). Without allowing other sources of inbreeding, the estimates of the selfing rate can be too high, since they assume that selfing is the only source of decreased heterozygosity.

With enough loci, it is easy to separate the loss of heterozygosity that comes from selfing versus loss of heterozygosity that comes from other sources. This is because selfing affects different individuals in different ways, having no effect on non-selfed individuals and a large effect on individuals with many generations of selfing. Other sources of inbreeding cause a loss of heterozygosity in all individuals alike.

The model of non-selfing inbreeding assumes that the two alleles in an outbred individual have probability (1 - F[other]) of being drawn independently from the gene pool, and probability F[other] of being identical-by-descent (IBD). No mechanism is specified for the IBD case, except that the two IBD alleles are assumed to have coalesced quickly compared to a normal coalesent event.

In addition to s* (the selfing rate), the example scripts now report the inbreeding coefficients:

  • F[other]
  • F[selfing] = s*/(2-s*)
  • F[total] = 1 - (1 - F[selfing]) * (1 - F[other])

Install

  1. Install the MCMC program BAli-Phy version 4.3 or higher.

    See the full documentation or the quick install documentation.

  2. Install the BES package for bali-phy:

    bali-phy --version
    bali-phy-pkg install BES
    bali-phy-pkg packages
    
  3. Install the BES example scripts:

    git clone https://github.com/bredelings/BayesianEstimatorSelfing.git
    

For further instructions in installation and usage, see the README.pdf

Overview

BES is run as a Unix command line program. It is not a GUI program; instead you must run it in a terminal. Therefore, you might want to keep a Unix Tutorial or Unix cheat sheet handy while you work.

BES runs on Linux, Mac OS X, and Windows. BES is distributed as an extension package for the BAli-Phy inference framework. You might therefore wish to refer to the BAli-Phy Documentation as well.

BES contains a number of modules that correspond to different mating system models. Each model allows estimating a different set of parameters. The generic model and the pure hermaphrodite model without inbreeding depression can be run without modification to estimate the selfing rate and locus-specific mutation rates.

However, the gynodioecious and androdioecious models require additional information besides the genetic data. The corresponding scripts require observed male or female counts on the command line. Some models also require the user to edit the module to choose priors, fix parameters, or add other identifying information. This manual describes how to add information, but is not a substitute for understanding the structure of the model.

Usage

  1. To try a test run, do
cd BayesianEstimatorSelfing
bali-phy run Generic.hs -l tsv --test Examples/outfile.001.70.001.phase1
bali-phy run Generic.hs -l tsv        Examples/outfile.001.70.001.phase1

The script Generic.hs is a template can be modified if you wish to adjust the priors.

  1. If you want to use a FastPhase of Phase2-formatted input file, you can use the Generic2.hs template:
bali-phy run Generic2.hs -l tsv --test Examples/test.fastphase
bali-phy run Generic2.hs -l tsv --test Examples/test.phase2
  1. If you leave off the -l tsv then logging will be done in JSON format.

  2. The included runnable androdioecious example requires the observed number of males and the total number of surveyed individuals:

bali-phy run Examples/Andro.hs -l tsv --males 20 --total 2000 Examples/outfile.001.70.001.phase1

The runnable gynodioecious example similarly requires the observed number of females:

bali-phy run Examples/Gyno.hs -l tsv --females 27 --total 221 Examples/outfile.001.70.001.phase1

These observations no longer require editing the source file. Changing priors, fixing parameters, or adding another kind of identifying information still requires editing the model template.

Installing the development version of BES

Note: You should probably just run bali-phy-pkg install BES instead of doing this!

To install the unreleased development version of BES from github:

git clone https://github.com/bredelings/BayesianEstimatorSelfing.git
cd BayesianEstimatorSelfing
./make_package
bali-phy-pkg install-archive BES_<version>.tar.gz

This will probably require the latest (unreleased) version of bali-phy from github as well.

Contact

You can send questions to the mailing list [https://groups.google.com/forum/#!forum/bayesian-estimator-selfing]. If you don't join the group first, your question will be held until I have a chance to check that it is not spam.

About

A Bayesian method for estimating self-fertilization rates and other mating system parameters

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages