zooplot_hbdseg: Plot HBD segments identified with the ZooROH model

zooplot_hbdsegR Documentation

Plot HBD segments identified with the ZooROH model

Description

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

Usage

zooplot_hbdseg(
  input,
  chr = NULL,
  coord = NULL,
  minlen = 0,
  cols = NULL,
  plotids = TRUE,
  toplot = NULL,
  randomids = FALSE,
  nrandom = (rep(10, length(input))),
  seed = 100
)

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).

chr

the number of the chromosome where we are looking for HBD segments. This chromosome number refers to the position of the chromosome in the list of all chromsomes present in the input genotype data.

coord

a vector with the start and end position (in bp) of the region to plot.

minlen

the minimal length (in cM or Mb) of HBD segments to be plotted (set to 0 by default).

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).

Value

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


RZooRoH documentation built on Oct. 27, 2023, 9:07 a.m.