A library for working with phylogenetic and population genetic data.
v0.32.0
cathedral_plot.hpp File Reference
#include "genesis/utils/color/color.hpp"
#include "genesis/utils/color/heat_map.hpp"
#include "genesis/utils/containers/matrix.hpp"
#include "genesis/utils/io/base_output_target.hpp"
#include <cassert>
#include <cmath>
#include <cstdint>
#include <deque>
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

struct  CathedralPlotParameters
 Plot parameters to make a cathedral plot. More...
 
struct  CathedralPlotRecord
 Collection of the data used for making for a cathedral plot. More...
 

Namespaces

 genesis
 Container namespace for all symbols of genesis in order to keep them separate when used as a library.
 
 genesis::population
 
 genesis::utils
 

Enumerations

enum  CathedralWindowWidthMethod { kExponential, kGeometric, kLinear }
 Interpolation algorithm for window sizes across the rows of a cathedral plot. More...
 

Functions

genesis::utils::JsonDocument cathedral_plot_parameters_to_json_document (CathedralPlotParameters const &parameters)
 Get a user-readable description of a CathedralPlotParameters as a JsonDocument. More...
 
genesis::utils::JsonDocument cathedral_plot_record_to_json_document (CathedralPlotRecord const &record)
 Get a user-readable description of the data of a CathedralPlotRecord as a JsonDocument. More...
 
double cathedral_window_width (CathedralPlotRecord const &record, size_t row)
 Compute the window width for a row in a cathedral plot. More...
 
CathedralWindowWidthMethod cathedral_window_width_method_from_string (std::string const &method)
 Helper function to return a CathedralWindowWidthMethod from its textual representation. More...
 
std::string cathedral_window_width_method_to_string (CathedralWindowWidthMethod method)
 Helper function to return a textual representation of the method. More...
 
template<class Record , class Accumulator >
void compute_cathedral_matrix (CathedralPlotParameters const &parameters, Record &record, Accumulator accumulator=Accumulator{})
 Template function to compute the value matrix for a cathedral plot, given a recored with plot parameters and per-position data to accumulate per window. More...
 
std::pair< genesis::utils::JsonDocument, genesis::utils::Matrix< double > > load_cathedral_plot_record_components_from_files (std::string const &base_path)
 Load the parts of a cathedral plot from a set of files. More...
 
CathedralPlotRecord load_cathedral_plot_record_from_files (std::string const &base_path)
 Load the record of a cathedral plot from a set of files. More...
 
genesis::utils::Matrix< genesis::utils::Colormake_cathedral_plot_heatmap (CathedralPlotRecord const &record, genesis::utils::HeatmapParameters const &heatmap_parameters)
 Make a cathedral plot heat map as a color matrix. More...
 
genesis::utils::SvgDocument make_cathedral_plot_svg (CathedralPlotRecord const &record, genesis::utils::HeatmapParameters const &heatmap_parameters)
 Make a cathedral plot heat map and add it into an SVG document with legend and axes. More...
 
genesis::utils::SvgDocument make_cathedral_plot_svg (CathedralPlotRecord const &record, genesis::utils::HeatmapParameters const &heatmap_parameters, genesis::utils::Matrix< genesis::utils::Color > const &image)
 Make a cathedral plot heat map and add it into an SVG document with legend and axes. More...
 
void save_cathedral_plot_record_to_files (CathedralPlotRecord const &record, std::string const &base_path)
 Convenience function to save the record of a cathedral plot in a set of files. More...
 
void save_cathedral_plot_record_to_files (genesis::utils::JsonDocument const &record_document, genesis::utils::Matrix< double > const &record_value_matrix, std::string const &base_path)
 Save the record of a cathedral plot in a set of files. More...
 
void save_cathedral_plot_record_to_targets (genesis::utils::JsonDocument const &record_document, genesis::utils::Matrix< double > const &record_value_matrix, std::shared_ptr< genesis::utils::BaseOutputTarget > json_target, std::shared_ptr< genesis::utils::BaseOutputTarget > csv_target)
 Save the record of a cathedral plot in a set of output targets. More...
 
void validate_cathedral_plot_record (CathedralPlotRecord const &record)
 Check a Cathedral Plot record for internal consistency. More...