Learn R Programming

RZooRoH (version 0.1.1)

zooplot_partitioning: Plot the partitioning of the genome in different HBD classes for each individual

Description

Plot HBD segments identified with the ZooROH model for one or several populations.

Usage

zooplot_partitioning(input, cols = NULL, plotids = TRUE, toplot = NULL,
  randomids = FALSE, nrandom = NULL, seed = 100, ylim = c(0, 1),
  border = TRUE, nonhbd = TRUE, vertical = FALSE)

Arguments

input

a named list with one or several zres objects obtained after running zoorun. The zres objects are the output of the zoorun function. For instance, putting list(name1 = zres1, name2 = zres2). The function will then use the names in the plot (in case several zres objects are used).

cols

A vector with the colors to be used for each population or zres object.

plotids

A logical indicating whether the IDs of the individuals are plotted on the graph (TRUE by default).

toplot

A list of vectors indicating the zres@ids to be plotted. This option can be used to select the individuals to plot. The list must contain one vector per population or zres object. By default, all individuals are plotted.

randomids

A logical indicating whether a randomset of individuals is plotted. This option allows to reduce the number of individuals in the plot. The option can not be used simultaneously with the toplot option. By default, randomids is FALSE.

nrandom

A vector indicating the number of individuals to be randomly sampled per population or per zres object when randomids is TRUE. By default, we select 10 individuals per zres object. This vector must have the same length as the input list.

seed

A value for the random seed used to sample individuals to plot (when the randomids option is TRUE).

ylim

The limits of the y-axis.

border

Whether a border is plotted around each block of the barplot. When set to FALSE, it allows to get a less dense plot when many individuals are plotted.

nonhbd

Whether the a border is plotted around the non-hbd contribution. When set to FALSE, it allows to get a less dense plot when many individuals are plotted.

vertical

Whether the populations or zres labels are printed vertically or not.

Value

The function plots the HBD segments identified in the region, using different colors for different zres object. Each line represents a different individual.