ABCX
Filed in: Bash
ABCX is a simple bash script to exemplify the Approximate Bayesian Computation approach to population genetic analysis.
Documentation
The script uses a single locus estimate of pi to estimate a most likely value of theta. It should by no means be used for any kind of actual analysis, nor does it accurately represent the power of these approaches, as this is based solely on a single locus and 1000 accepted simulations.
To run, you must already have Hudson's ms program installed. Download the script into the ms directory, and then run "gcc -o samplestats tajd.c sample_stats.c -lm" to compile the summary statistic code that comes with ms.
Then just run the script as "bash ABCX.sh". It'll churn for a while, and print the value of theta from accepted simulations to a file called "accepted.sims". This should have 1000 values in it. A histogram of these values is the posterior probability distribution of theta.
The script includes several variables that can be changed to evaluate different observed values, tolerances, etc.
ABCX.sh
The script uses a single locus estimate of pi to estimate a most likely value of theta. It should by no means be used for any kind of actual analysis, nor does it accurately represent the power of these approaches, as this is based solely on a single locus and 1000 accepted simulations.
To run, you must already have Hudson's ms program installed. Download the script into the ms directory, and then run "gcc -o samplestats tajd.c sample_stats.c -lm" to compile the summary statistic code that comes with ms.
Then just run the script as "bash ABCX.sh". It'll churn for a while, and print the value of theta from accepted simulations to a file called "accepted.sims". This should have 1000 values in it. A histogram of these values is the posterior probability distribution of theta.
The script includes several variables that can be changed to evaluate different observed values, tolerances, etc.
ABCX.sh