Plotting the simulation results¶
After simulating datasets and analyzing those datasets, you might be interested
in looking at some plots that summarize the results of those thousands of
analyses.
To do so, navigate to the scripts directory of the project:
cd /path/to/your/copy/of/codiv-sanger-bake-off/scripts
and activate the Python virtual environment for the project:
source ../pyenv/bin/activate
Then, run the plot_sim_results.py script:
python plot_sim_results.py
The plots generated by this script will be written to the
codiv-sanger-bake-off/results/plots directory, which from inside the
scripts directory is located at ../results/plots.
All of the plots are written as PDF files, and so can be viewed with any PDF viewer.
Note
If the plotting script worked, you can ignore this. If it didn’t, please continue reading…
The plotting script requires the matplotlib package, which requires the
NumPy package.
These requirements were installed to the Python virtual environment when we
set up the project, so in theory, the plotting script should just work.
However, the distributions of the matplotlib and NumPy packages are
“brittle,” and will sometimes fail to work “out-of-the-box” on some systems.
If the plotting script failed for you, it is likely due to this issue.
The brittleness of matplotlib/NumPy is often caused by the
pre-compiled packages having dynamic links to external libraries.
I have seen this with the distributions from both PyPI/pip (what we are
using) and conda.