Heatmap Plotting
You may find it useful to visualise the many matrices that are generated by this pipeline (especially if the models you are comparing are large). If you do want to do this, you'll need to run the Rscript generate_heatmap.R like so:
Rscript .../generate_heatmap.R path/to/matrix path/to/output_file false
The third argument here is to let the script know whether or not the supplied matrix is for emission parameter similarity. This was implemented because a smaller Euclidean distance (emission parameter similarity) implies two states are very similar. However, if two states have very high fold enrichment (spatial similarity), their score will be very high. The fact that these are opposing each other makes the resultant heatmaps harder to quickly interpret (as the colours you are looking for are flipped between them).