Changed: | ||||||||||||||||||||||
< < |
| |||||||||||||||||||||
> > |
| |||||||||||||||||||||
Marker Divergence ExperimentsThis 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.
Example Data
Requirements and InstallationThe current version of the md package is available from our public Mercurial repository:
![]()
MATLAB![]() ![]() ![]()
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:
Help for each individual Perl script can be obtained as follows
1. Fit α and τ empirical parameters from experimental dataThe basic command is:
output.fit is a tab-delimited file containing information about each curve fit. output.fit.pdf shows plots of each fit, so that you can judge whether they accurately reflect the data.
Input file data formatThe 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 , fraction , log_ratio , or 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:
The output file is tab-delimited, with columns containing data as labeled.
Baseline correctionIf 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) that you would like to fit as a baseline. 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% of the population.
Example:
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:
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 curvesThe 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
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 curvesThis step is the same as that used to fit the experimental data.
3.3 Automating and parallelizing this stepGenerally, 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.
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. (Its okay if they are scattered across subdirectories, as long as they are the only files ending in .fit ) .
4. Determine the maximum likelihood effective parametersFinally, 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.
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 contour. The output PDF file should have a black square, representing the best parameter combination, and a blue region, indicating the >95% confidence contour. (If the plot is all blue, then none of your simulated data agreed with the experimental data.)
Note that you can now pass the -n flag, and the program will use a 2-dimensional version of the KS-test to determine the 95% confidence contour.
References
AcknowledgmentsMany 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.
|
Marker Divergence ExperimentsThis 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.
Example Data
| |||||||||||
Changed: | |||||||||||
< < |
| ||||||||||
> > |
| ||||||||||
Changed: | |||||||||||
< < |
| ||||||||||
> > |
| ||||||||||
Requirements and InstallationThe current version of the md package is available from our public Mercurial repository:
![]()
MATLAB![]() ![]() ![]()
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:
Help for each individual Perl script can be obtained as follows
1. Fit α and τ empirical parameters from experimental dataThe basic command is:
output.fit is a tab-delimited file containing information about each curve fit. output.fit.pdf shows plots of each fit, so that you can judge whether they accurately reflect the data.
Input file data formatThe 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 , fraction , log_ratio , or 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:
The output file is tab-delimited, with columns containing data as labeled.
Baseline correctionIf 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) that you would like to fit as a baseline. 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% of the population.
Example:
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:
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 curvesThe 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
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 curvesThis step is the same as that used to fit the experimental data.
3.3 Automating and parallelizing this stepGenerally, 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.
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. (Its okay if they are scattered across subdirectories, as long as they are the only files ending in .fit ) .
4. Determine the maximum likelihood effective parametersFinally, 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.
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 contour. The output PDF file should have a black square, representing the best parameter combination, and a blue region, indicating the >95% confidence contour. (If the plot is all blue, then none of your simulated data agreed with the experimental data.)
Note that you can now pass the -n flag, and the program will use a 2-dimensional version of the KS-test to determine the 95% confidence contour.
References
AcknowledgmentsMany 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. | |||||||||||
Added: | |||||||||||
> > |
| ||||||||||
Marker Divergence ExperimentsThis 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.
Example Data
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Requirements and InstallationThe current version of the md package is available from our public Mercurial repository:
![]()
MATLAB![]() ![]() ![]()
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:
Help for each individual Perl script can be obtained as follows
1. Fit α and τ empirical parameters from experimental dataThe basic command is:
output.fit is a tab-delimited file containing information about each curve fit. output.fit.pdf shows plots of each fit, so that you can judge whether they accurately reflect the data.
Input file data formatThe 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 , fraction , log_ratio , or 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:
The output file is tab-delimited, with columns containing data as labeled.
Baseline correctionIf 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) that you would like to fit as a baseline. 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% of the population.
Example:
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:
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 curvesThe 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
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 curvesThis step is the same as that used to fit the experimental data.
3.3 Automating and parallelizing this stepGenerally, 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.
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. (Its okay if they are scattered across subdirectories, as long as they are the only files ending in .fit ) .
4. Determine the maximum likelihood effective parametersFinally, 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.
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 contour. The output PDF file should have a black square, representing the best parameter combination, and a blue region, indicating the >95% confidence contour. (If the plot is all blue, then none of your simulated data agreed with the experimental data.)
Note that you can now pass the -n flag, and the program will use a 2-dimensional version of the KS-test to determine the 95% confidence contour.
References
AcknowledgmentsMany 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. |
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Marker Divergence ExperimentsThis 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.
| ||||||||
Added: | ||||||||
> > |
Example Data
| |||||||
Requirements and InstallationThe current version of the md package is available from our public Mercurial repository:
![]()
MATLAB![]() ![]() ![]()
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:
Help for each individual Perl script can be obtained as follows
1. Fit α and τ empirical parameters from experimental dataThe basic command is:
output.fit is a tab-delimited file containing information about each curve fit. output.fit.pdf shows plots of each fit, so that you can judge whether they accurately reflect the data.
Input file data formatThe 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 , fraction , log_ratio , or 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:
The output file is tab-delimited, with columns containing data as labeled.
Baseline correctionIf 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) that you would like to fit as a baseline. 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% of the population.
Example:
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:
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 curvesThe 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
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 curvesThis step is the same as that used to fit the experimental data.
3.3 Automating and parallelizing this stepGenerally, 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.
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. (Its okay if they are scattered across subdirectories, as long as they are the only files ending in .fit ) .
4. Determine the maximum likelihood effective parametersFinally, 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.
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 contour. The output PDF file should have a black square, representing the best parameter combination, and a blue region, indicating the >95% confidence contour. (If the plot is all blue, then none of your simulated data agreed with the experimental data.)
Note that you can now pass the -n flag, and the program will use a 2-dimensional version of the KS-test to determine the 95% confidence contour.
References
AcknowledgmentsMany 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. |
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Marker Divergence ExperimentsThis 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 | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > | The current version of the md package is available from our public Mercurial repository: | |||||||
Added: | ||||||||
> > |
| |||||||
Changed: | ||||||||
< < | The Perl scripts require the module Math::Random::MT::Auto and its prerequisites for random number generation. They can be installed from CPAN![]() | |||||||
> > | The Perl scripts require the module Math::Random::MT::Auto and its prerequisites for random number generation. They can be installed from CPAN![]() | |||||||
MATLAB![]() ![]() ![]()
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:
Help for each individual Perl script can be obtained as follows
1. Fit α and τ empirical parameters from experimental dataThe basic command is:
output.fit is a tab-delimited file containing information about each curve fit. output.fit.pdf shows plots of each fit, so that you can judge whether they accurately reflect the data.
Input file data formatThe 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 , fraction , log_ratio , or 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:
The output file is tab-delimited, with columns containing data as labeled.
Baseline correctionIf 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) that you would like to fit as a baseline. 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% of the population.
Example:
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:
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 curvesThe 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
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 curvesThis step is the same as that used to fit the experimental data.
3.3 Automating and parallelizing this stepGenerally, 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.
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. (Its okay if they are scattered across subdirectories, as long as they are the only files ending in .fit ) .
4. Determine the maximum likelihood effective parametersFinally, 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.
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 contour. The output PDF file should have a black square, representing the best parameter combination, and a blue region, indicating the >95% confidence contour. (If the plot is all blue, then none of your simulated data agreed with the experimental data.) | ||||||||
Changed: | ||||||||
< < | Note that you can now pass the -n flag, and the program will use a 2-dimensional version KS-test to determine a true 95% confidence contour, but this has not been extensively tested. | |||||||
> > | Note that you can now pass the -n flag, and the program will use a 2-dimensional version of the KS-test to determine the 95% confidence contour. | |||||||
References
Acknowledgments | ||||||||
Changed: | ||||||||
< < | 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. | |||||||
> > | 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. | |||||||
Deleted: | ||||||||
< < |
| |||||||
Marker Divergence ExperimentsThis 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 | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
The Perl scripts require the module Math::Random::MT::Auto and its prerequisites for random number generation. They can be installed from CPAN![]()
MATLAB![]() | ||||||||
Changed: | ||||||||
< < | R![]() | |||||||
> > | R![]() ![]() | |||||||
Added: | ||||||||
> > |
| |||||||
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:
| ||||||||
Changed: | ||||||||
< < | #!/usr/bin/perl | |||||||
> > | #!/usr/bin/perl | |||||||
Help for each individual Perl script can be obtained as follows
| ||||||||
Changed: | ||||||||
< < | > perldoc <script> | |||||||
> > | >perldoc <script> | |||||||
1. Fit α and τ empirical parameters from experimental dataThe basic command is:
| ||||||||
Changed: | ||||||||
< < | >marker_divergence_fit.pl -i input.tab > output.fit | |||||||
> > | >marker_divergence_fit.pl -i input.tab -o output.fit -p output.fit.pdf | |||||||
Added: | ||||||||
> > | output.fit is a tab-delimited file containing information about each curve fit. output.fit.pdf shows plots of each fit, so that you can judge whether they accurately reflect the data. | |||||||
Input file data format | ||||||||
Changed: | ||||||||
< < | 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 . | |||||||
> > | 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 , fraction , log_ratio , or 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:
The output file is tab-delimited, with columns containing data as labeled.
Baseline correction | ||||||||
Changed: | ||||||||
< < | 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. | |||||||
> > | 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) that you would like to fit as a baseline. 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% of the population. | |||||||
Example:
| ||||||||
Changed: | ||||||||
< < | >marker_divergence_fit.pl -m log_ratio -i input.tab > output.fit | |||||||
> > | >marker_divergence_fit.pl -m log_ratio -i input.tab -o output.fit -p output.fit.pdf | |||||||
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:
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 curvesThe 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
| ||||||||
Changed: | ||||||||
< < | >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 | |||||||
> > | >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 -o 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 curvesThis step is the same as that used to fit the experimental data.
| ||||||||
Changed: | ||||||||
< < | >marker_divergence_fit.pl -i | |||||||
> > | >marker_divergence_fit.pl -m log_ratio -i pop_gen_s_0.08_u_1E-8.tab -o pop_gen_s_0.08_u_1E-8.fit | |||||||
3.3 Automating and parallelizing this stepGenerally, 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.
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. | ||||||||
Changed: | ||||||||
< < | 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. | |||||||
> > | 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. (Its okay if they are scattered across subdirectories, as long as they are the only files ending in .fit ) . | |||||||
4. Determine the maximum likelihood effective parametersFinally, 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.
| ||||||||
Changed: | ||||||||
< < | >marker_divergence_significance.pl -i experimental.fit -d path/to/simulation/fits > experimental.sig | |||||||
> > | >marker_divergence_significance.pl -i experimental.fit -d path/to/simulation/fits -o experimental.sig -p experimental.sig.pdf | |||||||
Changed: | ||||||||
< < | 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. | |||||||
> > | 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 contour. The output PDF file should have a black square, representing the best parameter combination, and a blue region, indicating the >95% confidence contour. (If the plot is all blue, then none of your simulated data agreed with the experimental data.) | |||||||
Added: | ||||||||
> > | Note that you can now pass the -n flag, and the program will use a 2-dimensional version KS-test to determine a true 95% confidence contour, but this has not been extensively tested. | |||||||
References
AcknowledgmentsMany 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. | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Added: | ||||||||
> > |
| |||||||
Marker Divergence ExperimentsThis 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
![]()
MATLAB![]() | ||||||||
Changed: | ||||||||
< < | R![]() | |||||||
> > | R![]() | |||||||
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:
| ||||||||
Changed: | ||||||||
< < | Help for each Perl script can be obtained | |||||||
> > | Help for each individual Perl script can be obtained as follows | |||||||
Added: | ||||||||
> > |
| |||||||
Deleted: | ||||||||
< < | ||||||||
1. Fit α and τ empirical parameters from experimental dataThe basic command is:
Input file data formatThe 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:
The output file is tab-delimited, with columns containing data as labeled.
Baseline correctionIf 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:
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:
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 curvesThe 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
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 curvesThis step is the same as that used to fit the experimental data.
3.3 Automating and parallelizing this stepGenerally, 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.
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 parametersFinally, 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.
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 | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
AcknowledgmentsMany 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.
|
Marker Divergence ExperimentsThis 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 | ||||||||
Added: | ||||||||
> > |
| |||||||
The Perl scripts require the module Math::Random::MT::Auto and its prerequisites for random number generation. They can be installed from CPAN![]()
MATLAB![]() ![]()
Help for each Perl script can be obtained
1. Fit α and τ empirical parameters from experimental dataThe basic command is:
Input file data formatThe 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:
The output file is tab-delimited, with columns containing data as labeled.
Baseline correctionIf 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:
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:
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 curvesThe 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
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 curvesThis step is the same as that used to fit the experimental data.
3.3 Automating and parallelizing this stepGenerally, 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.
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 parametersFinally, 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.
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
AcknowledgmentsMany 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. | ||||||||
Added: | ||||||||
> > |
| |||||||
| ||||||||
Added: | ||||||||
> > |
| |||||||
Marker Divergence ExperimentsThis 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 InstallationThe Perl scripts require the module Math::Random::MT::Auto and its prerequisites for random number generation. They can be installed from CPAN![]()
MATLAB![]() | ||||||||
Changed: | ||||||||
< < | R![]() | |||||||
> > | R![]() | |||||||
Added: | ||||||||
> > | 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:
Help for each Perl script can be obtained | |||||||
1. Fit α and τ empirical parameters from experimental dataThe basic command is:
Input file data formatThe 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:
| ||||||||
Added: | ||||||||
> > | The output file is tab-delimited, with columns containing data as labeled. | |||||||
Baseline correctionIf 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:
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:
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. | ||||||||
Added: | ||||||||
> > | 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 curvesThe 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
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 curvesThis step is the same as that used to fit the experimental data.
3.3 Automating and parallelizing this stepGenerally, 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.
| ||||||||
Changed: | ||||||||
< < | 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. 10-u. | |||||||
> > | 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 parametersFinally, 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.
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
AcknowledgmentsMany 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. |
Marker Divergence ExperimentsThis 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 InstallationThe Perl scripts require the module Math::Random::MT::Auto and its prerequisites for random number generation. They can be installed from CPAN![]()
MATLAB![]() ![]() 1. Fit α and τ empirical parameters from experimental dataThe basic command is:
Input file data formatThe 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:
Baseline correctionIf 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:
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:
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.
3. Simulate and fit idealized marker divergence curvesThe 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
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 curvesThis step is the same as that used to fit the experimental data.
3.3 Automating and parallelizing this stepGenerally, 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.
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. 10-u.
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 parametersFinally, 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.
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
AcknowledgmentsMany 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. |
Marker Divergence ExperimentsThis 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 InstallationThe Perl scripts require the module Math::Random::MT::Auto and its prerequisites for random number generation. They can be installed from CPAN![]()
MATLAB![]() ![]() | ||||||||
Changed: | ||||||||
< < | 1. Fit α and τ Empirical Parameters from Experimental Data | |||||||
> > | 1. Fit α and τ empirical parameters from experimental data | |||||||
The basic command is:
| ||||||||
Changed: | ||||||||
< < | Input File Data Format | |||||||
> > | 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 . | ||||||||
Changed: | ||||||||
< < | Portion of an example marker ratio input file: | |||||||
> > | Portion of an example marker ratio input file: | |||||||
| ||||||||
Changed: | ||||||||
< < | Baseline Correction | |||||||
> > | 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:
Corrects for the baseline by taking the average of the first 5 points. | ||||||||
Changed: | ||||||||
< < | 2. Generate a Table of establishment probabilities with MATLAB. | |||||||
> > | 2. Generate a table of establishment probabilities with MATLAB. | |||||||
Changed: | ||||||||
< < | The population genetics model assumes that each new beneficial mutation that is generated has a certain probability of establishing (not going extinct) during the serial transfer regime of the experiment. A table of these probabilities must be calculated with the MATLAB script. | |||||||
> > | 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:
| ||||||||
Changed: | ||||||||
< < | >>establishment_probability_table(6.64, 5E6, 0.001, 1, 'pr_establishment_T=6.64_No=5E6.tab') | |||||||
> > | >>establishment_probability_table(6.64, 5E6, 0.001, 1, 'pr_establishment_T_6.64_No_5E6.tab') | |||||||
Changed: | ||||||||
< < | 3. Generate α and τ Values from the Population Genetics Simulation | |||||||
> > | 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]. | |||||||
Changed: | ||||||||
< < | 3.1 Generate Simulated Marker Divergence Data for a μ and s Combination | |||||||
> > | 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. | |||||||
Changed: | ||||||||
< < | 3.2 Fit α and τ Empirical Parameters from Experimental Data | |||||||
> > | 3. Simulate and fit idealized marker divergence curves | |||||||
Changed: | ||||||||
< < | 3.3 Helper Script: Automating this Step | |||||||
> > | 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. | |||||||
Changed: | ||||||||
< < | 4 Determine the Effective Parameters where Simulations and Experimental Data Produce the Same Distributions of Empirical Parameters | |||||||
> > | 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. | |||||||
Added: | ||||||||
> > |
3.1 Simulate marker divergence data for a set of μ and s effective beneficial mutation parameters
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 curvesThis step is the same as that used to fit the experimental data.
3.3 Automating and parallelizing this stepGenerally, 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.
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. 10-u.
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 parametersFinally, 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.
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
AcknowledgmentsMany 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. |
Marker Divergence ExperimentsThis 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 InstallationThe Perl scripts require the module Math::Random::MT::Auto and its prerequisites for random number generation. They can be installed from CPAN![]()
| ||||||||
Changed: | ||||||||
< < | _answer yes to any prompts about installing prerequisites_ | |||||||
> > | answer yes to any prompts about installing prerequisites | |||||||
Added: | ||||||||
> > | MATLAB![]() ![]() | |||||||
1. Fit α and τ Empirical Parameters from Experimental DataThe basic command is:
| ||||||||
Changed: | ||||||||
< < | >sudo perl -MCPAN -e shell | |||||||
> > | >marker_divergence_fit.pl -i input.tab > output.fit | |||||||
Deleted: | ||||||||
< < | >Password: ******** >install Math::Random::MT::Auto _answer yes to any prompts about installing prerequisites_ | |||||||
Input File Data Format | ||||||||
Changed: | ||||||||
< < | The input file is a tab-delimited. | |||||||
> > | 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 . | |||||||
Changed: | ||||||||
< < | You should pass the -m option followed by ratio , log_ratio , log10_ratio to this script depending on the format of you data values. | |||||||
> > | Portion of an example marker ratio input file: | |||||||
Added: | ||||||||
> > |
| |||||||
Baseline Correction | ||||||||
Changed: | ||||||||
< < | 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. | |||||||
> > | 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. | |||||||
Added: | ||||||||
> > | Example: | |||||||
| ||||||||
Changed: | ||||||||
< < | >sudo perl -MCPAN -e shell | |||||||
> > | >marker_divergence_fit.pl -m log_ratio -i input.tab > output.fit | |||||||
Deleted: | ||||||||
< < | >Password: ******** >install Math::Random::MT::Auto _answer yes to any prompts about installing prerequisites_ | |||||||
Deleted: | ||||||||
< < | ||||||||
Corrects for the baseline by taking the average of the first 5 points.
2. Generate a Table of establishment probabilities with MATLAB. | ||||||||
Changed: | ||||||||
< < | 3. Generate α and τ Values from a Population Genetics Simulation | |||||||
> > | The population genetics model assumes that each new beneficial mutation that is generated has a certain probability of establishing (not going extinct) during the serial transfer regime of the experiment. A table of these probabilities must be calculated with the MATLAB script. | |||||||
Changed: | ||||||||
< < | 3.1 Generate Simulated Data for a μ and s Combination | |||||||
> > | First, add the directory containing the two ".m" files that come with the distribution to the MATLAB path. | |||||||
Added: | ||||||||
> > | In MATLAB:
3. Generate α and τ Values from the Population Genetics Simulation3.1 Generate Simulated Marker Divergence Data for a μ and s Combination | |||||||
3.2 Fit α and τ Empirical Parameters from Experimental Data3.3 Helper Script: Automating this Step4 Determine the Effective Parameters where Simulations and Experimental Data Produce the Same Distributions of Empirical ParametersReferences
Acknowledgments | ||||||||
Changed: | ||||||||
< < | Many thanks to Noam Shoresh for extensive discussions that made it possible for me to reproduce his methods and providing his raw data to check the results from these tools. | |||||||
> > | 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. | |||||||
Marker Divergence Experiments | ||||||||
Changed: | ||||||||
< < | 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. | |||||||
> > | 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 | ||||||||
Changed: | ||||||||
< < | The Perl scripts require the module Math::Random::MT::Auto and its prerequisites. They can be installed from CPAN![]() | |||||||
> > | The Perl scripts require the module Math::Random::MT::Auto and its prerequisites for random number generation. They can be installed from CPAN![]() | |||||||
| ||||||||
Changed: | ||||||||
< < | answer yes to any prompts about installing prerequisites | |||||||
> > | _answer yes to any prompts about installing prerequisites_ | |||||||
1. Fit α and τ Empirical Parameters from Experimental Data | ||||||||
Added: | ||||||||
> > |
The basic command is:
Input File Data FormatThe input file is a tab-delimited. You should pass the-m option followed by ratio , log_ratio , log10_ratio to this script depending on the format of you data values.
Baseline CorrectionIf 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.
Corrects for the baseline by taking the average of the first 5 points. | |||||||
2. Generate a Table of establishment probabilities with MATLAB.3. Generate α and τ Values from a Population Genetics Simulation3.1 Generate Simulated Data for a μ and s Combination3.2 Fit α and τ Empirical Parameters from Experimental Data3.3 Helper Script: Automating this Step4 Determine the Effective Parameters where Simulations and Experimental Data Produce the Same Distributions of Empirical ParametersReferences
AcknowledgmentsMany thanks to Noam Shoresh for extensive discussions that made it possible for me to reproduce his methods and providing his raw data to check the results from these tools. |
Marker Divergence ExperimentsThis 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 InstallationThe Perl scripts require the module Math::Random::MT::Auto and its prerequisites. They can be installed from CPAN![]()
1. Fit α and τ Empirical Parameters from Experimental Data2. Generate a Table of establishment probabilities with MATLAB.3. Generate α and τ Values from a Population Genetics Simulation3.1 Generate Simulated Data for a μ and s Combination3.2 Fit α and τ Empirical Parameters from Experimental Data3.3 Helper Script: Automating this Step4 Determine the Effective Parameters where Simulations and Experimental Data Produce the Same Distributions of Empirical ParametersReferences
AcknowledgmentsMany thanks to Noam Shoresh for extensive discussions that made it possible for me to reproduce his methods and providing his raw data to check the results from these tools. |