Warning!
This tool is under active development. Its capabilities and usage may change without warning, and it has not been adequately tested.

Marker Divergence Experiments

This workflow implements a method for extracting effective beneficial mutation rates (μ) and selection coefficients (s) from marker divergence experiments [1]. This is a way of parameterizing the evolvability of a bacterial strain.

Requirements and Installation

Download Download version 0.01 21 September 2008

The Perl scripts require the module Math::Random::MT::Auto and its prerequisites for random number generation. They can be installed from CPAN. The Math::Random::MT::Auto module has a code component that must be compiled. If you have root access on a system you can probably install these from the command line as follows:

 >sudo perl -MCPAN -e shell
 >Password: ********
 >install Math::Random::MT::Auto
  answer yes to any prompts about installing prerequisites

MATLAB is required for calculating establishment probabilities.

R is required for fitting marker divergence curves. It should be present in your $PATH, so that the Perl scripts can invoke it.

You may want to add the location of the perl scripts to your $PATH. You may need to change the first line of each script to the correct path to your Perl executable if it is not located at:

#!/usr/bin/perl

Help for each Perl script can be obtained

1. Fit α and τ empirical parameters from experimental data

The basic command is:

 >marker_divergence_fit.pl -i input.tab > output.fit

Input file data format

The input file is tab-delimited. The header row begins with "transfer", and the other columns are labels indicating the name of an experimental time series of marker ratio measurements. Each following row begins with the number of the transfer followed by the marker ratio measurements for that series at that time point. Marker ratios may be given in a variety of formats. Pass the -m option followed by ratio, log_ratio, log10_ratio to this script depending on the format of you data values. The default mode is ratio.

Portion of an example marker ratio input file:

transfer exp-1  exp-2  exp-3
0        0.5087 0.5068 0.4990
3        0.5000 0.4844 0.5174
6        0.4853 0.5393 0.5115
9        0.4802 0.4862 0.4522
12       0.4884 0.4431 0.5170
15       0.5277 0.5196 0.5266
18       0.4983 0.4638 0.4607
21       0.5221 0.5361 0.5000

The output file is tab-delimited, with columns containing data as labeled.

Baseline correction

If some of your experimental curves do not start at a 1:1 ratio of the neutral marker states, you will also want to pass the -b option followed by the number of initial points (not transfers) . The script corrects for the initial marker imbalance by fitting τ and α to a modified equation that accounts for the fact that for a population diverging toward marker state A, where A was initially present in less than 50% of the population, the marker ratio will be shifted sooner than in a population where it was initially present in 50% or more of the population.

Example:

 >marker_divergence_fit.pl -m log_ratio -i input.tab > output.fit
Corrects for the baseline by taking the average of the first 5 points.

2. Generate a table of establishment probabilities with MATLAB.

The population genetics model assumes that each new beneficial mutation that is generated has a certain probability of establishing (escaping loss due to dilution) during the serial transfer regime of the experiment. A table of these probabilities must be calculated with the MATLAB script.

First, add the directory containing the two ".m" files that come with the distribution to the MATLAB path.

In MATLAB:

 >>establishment_probability_table(6.64, 5E6, 0.001, 1, 'pr_establishment_T_6.64_No_5E6.tab')

The arguments are the number of generations per transfer, the initial population size immediately after each transfer, the precision of the file to be generated, the maximum selection coefficient to consider, and the output filename. Output is a tab-delimited list of selection coefficient and probability of establishment when a new mutant has this advantage relative to the population average [2].

It is important to allow a maximum selection coefficient value several fold greater than the expected effective selection coefficient (s) because multiple mutations may occur that give a large benefit relative to the population average. Reasonable values are typically 0.0001 to 0.001 for the precision and 1 to 5 for the maximum.

A file (pr_establishment_T_6.64_N_5E6_LT.tab) is provided with the distribution that can be used for experiments conducted under the conditions of the long-term E. coli evolution experiment.

3. Simulate and fit idealized marker divergence curves

The next step is to simulate marker divergence curves generated by a simplified population genetics model where there is only one category of beneficial mutation with selection coefficient s. These beneficial mutations occur with a rate μ. Selection coefficients are defined such that wnew=winitial (1+s). This model takes into account the population bottlenecks that occur during a serial transfer evolution experiment.

For each combination of s and μ, a distribution of the effective parameters α and &tau is determined from the idealized data. Comparing the effective parameters extracted from the experimental data to all of these distributions allows the maximum likelihood values of s and μ that best explain the experimental data to be determined.

3.1 Simulate marker divergence data for a set of μ and s effective beneficial mutation parameters

 >marker_divergence_pop_gen_simulation.pl -T 6.64 -N 5E6 -u 1E-8 -s 0.08 -p pr_establishment_T_6.64_No_5E6.tab -k 22 -i 3 -r 100 > pop_gen_s_0.08_u_1E-8.tab

The generations per transfer (-T), initial population size at the beginning of each growth cycle (-N), per generation mutations rate (-u), per generation selection coefficient (-s), file of establishment probabilities produced by MATLAB (-p), number of generations during outgrowth (before printing any data) (-k), print out marker ratio each time this many transfers pass (-i), number of simulation replicates to perform (-r).

3.2 Fit α and τ empirical parameters from simulated curves

This step is the same as that used to fit the experimental data.

 >marker_divergence_fit.pl -i

3.3 Automating and parallelizing this step

Generally, many combinations of μ and s must be calculated to determine the maximum likelihood effective parameters. This script combines the two previous steps to serially create marker ratio and fit files over a range of these parameters.

 >marker_divergence_background_model.pl -T 6.64 -N 5E6 -u -8:-6:0.5 -s 0.06:0.2:0.02 -p pr_establishment_T_6.64_No_5E6.tab -i 1 -r 100 -k 22

Parameters are the same as in marker_divergence_pop_gen_simulation.pl, except -u and -s are supplied as start:end:step_size combinations, and -u is in log10 units, i.e. passing a value of -8 gives a mutation rate of 10-8.

This procedure can be farmed out to a computer cluster. Consolidate all of the output files into a single directory before proceeding to the next step.

4. Determine the maximum likelihood effective parameters

Finally, we determine what values of μ and s produce α and τ distributions in the simulated data that are statistically indistinguishable from those fit from the experimental data.

 >marker_divergence_significance.pl -i experimental.fit -d path/to/simulation/fits > experimental.sig

The output file experimental.sig has starred lines where the experimental data and simulations agree. Since α and τ are not independent, this represents a greater than 95% confidence cloud.

References

  1. Hegreness, M., Shoresh, N., Hartl, D., and Kishony, R. (2006) An equivalence principle for the incorporation of favorable mutations in asexual populations. Science 311, 1615-1617.
  2. Wahl, L.M., and Gerrish, P.J. (2001) The probability that beneficial mutations are lost in populations with periodic bottlenecks. Evolution 55, 2606-2610.

Acknowledgments

Many thanks to Noam Shoresh for extensive discussions that made it possible for me to reproduce his methods and for providing his raw data to check the results from these tools.
Topic attachments
I Attachment History Action Size Date Who Comment
Compressed Zip archivetgz md_v0_01.tgz r1 manage 441.1 K 2008-09-21 - 16:58 JeffreyBarrick  
Edit | Attach | Watch | Print version | History: r14 | r9 < r8 < r7 < r6 | Backlinks | Raw View | More topic actions...

 Barrick Lab  >  ToolList  >  ToolsMarkerDivergence

Contributors to this topic Edit topic JeffreyBarrick
Topic revision: r7 - 2008-09-21 - 16:58:23 - Main.JeffreyBarrick
 
This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright ©2024 Barrick Lab contributing authors. Ideas, requests, problems? Send feedback