haplo_graphs: Generate graphical output of a haplotype analysis

View source: R/haplo_graphs.R

haplo_graphsR Documentation

Generate graphical output of a haplotype analysis

Description

This is a high-level function for taking an object obtained as output from the function haplo_selection and generating graphical output written to files. The graphs argument allows a high degree of coustomization as to the graphs that will be generated. Some graphs input/output combinations are not allowed (see Details).

Usage

haplo_graphs(results, output_dir = ".", graphs = "default", ...)

Arguments

results

A list generated as output from the function haplo_selection and thus containing the results of a haplotype analysis.

output_dir

A character. The name of the directory to which the files should be written.

graphs

A named list containing at most 6 elements corresponding to the names of elements in a list output by function haplo_selection : All_markers, Filtered_markers, Clustered_markers, Selected_clusters, Selected_markers, Haplotypes. Each of the elements of these lists must contain a character vector cotaining at most 4 elements corresponding to the 4 possible graphs that can be output : "density", "matrix", "distance", genotypes. The list provided will determine which graphs will be output from which objects.

...

Arguments passed to function ggplot::ggsave which writes the image file to disc.

Details

The default graphs option currently results in no graphs being generated. Sensible defaults still have to be defined.

The output is directed by default to the current directory. An error is thrown if the suggested output directory already exists, else a new directory with this name is created. This is meant to avoid name conflicts and file overwriting, but this could be changed in the future.

This function calls high-level plotting functions defined in the package itself : density_plot, ld_plot, distance_plot, genotype_plot. These functions are called in the context of haplo_graphs with their default values, but finer control could be obtained by using these functions directly.

Arguments can be passed to function ggplot::ggsave, which directs the output (width and height default to 7). PDF files are generated by default.

Value

NULL, invisibly. The function is called for its side effect of writing graphs to files.

Examples

NULL


malemay/HaplotypeMiner documentation built on Feb. 6, 2024, 3:29 a.m.