visualiseHaplo: Visualise haplotypes in certain individuals in a certain...

Description Usage Arguments Value Examples

View source: R/polyqtlR_functions.R

Description

Function to visualise the haplotypes of a certain region in certain individuals

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
visualiseHaplo(
  IBD_list,
  display_by = c("phenotype", "name"),
  linkage_group = NULL,
  Phenotype.df = NULL,
  genotype.ID = NULL,
  trait.ID = NULL,
  pheno_range = NULL,
  cM_range = "all",
  highlight_region = NULL,
  select_offspring = NULL,
  recombinant_scan = NULL,
  allele_fish = NULL,
  presence_threshold = 0.95,
  xlabl = TRUE,
  ylabl = TRUE,
  mainTitle = NULL,
  multiplot = NULL,
  append = FALSE,
  colPal = c("white", "navyblue", "darkred"),
  hap.wd = 0.4,
  recombination_data = NULL,
  reset_par = TRUE,
  log = NULL
)

Arguments

IBD_list

List of IBD probabilities

display_by

Option to display a subset of the population's haplotypes either by "phenotype" or "name". If "phenotype" is supplied, then Phenotype.df,genotype.ID,trait.ID and pheno_range must also be specified. if "name" is supplied, then select_offspring must be specified.

linkage_group

Numeric identifier of the linkage group being examined, based on the order of IBD_list. Only a single linkage group is allowed. If IBD_list corresponds to a single linkage group, default value of NULL will suffice

Phenotype.df

A data.frame containing phenotypic values, which can be used to select a subset of the population to visualise (with extreme phenotypes for example). By default NULL, in which case a subset of the population may be selected using the select_offspring argument.

genotype.ID

The colname of Phenotype.df that contains the population identifiers (F1 names) (must be a colname of Phenotype.df)

trait.ID

The colname of Phenotype.df that contains the response variable to use in the model (must be a colname of Phenotype.df)

pheno_range

Vector of numeric bounds of the phenotypic scores to include (offspring selection).

cM_range

Vector of numeric bounds of the genetic region to be explored. If none are specified, the default of "all" means all cM positions will be included.

highlight_region

Option to hightlight a particular genetic region on the plot; can be a single position or a vector of 2 positions. By default NULL.

select_offspring

Vector of offspring identifiers to visualise, must be supplied if display_by = "name". Specifying "all" will result in all offspring haplotypes being visualised.

recombinant_scan

Vector of homologue numbers between which to search for recombinant offspring in the visualised region and selected individuals. By default NULL, in which case no search is preformed.

allele_fish

Vector of homologue numbers of interest, for which to search for offspring that carry these homologues (in the visualised region). By default NULL, in which case no search ("fishing") is performed.

presence_threshold

Numeric. The minimum probability used to declare presence of a homologue in an individual. This is only needed if a recombinant_scan is performed. By default a value of 0.95 is used. When searching for recombinants, this value is also used to denote the proportion of loci carrying the required number of homologues (i.e. by default 95 per cent of loci should have between 0.95 and 1.1 copies of the specified recombinant homologues).

xlabl

Logical, by default TRUE. Should an x-axis label be used?

ylabl

Logical, by default TRUE. Should a y-axis label be used?

mainTitle

Option to override default plot titles with a (vector of) captions. By default NULL.

multiplot

Vector of integers. By default NULL so haplotypes are plotted singly; otherwise a vector specifying the number of rows and columns in the plot layout.

append

Option to allow user to append new plots to spaces generated by multiplot, otherwise these are filled with blank plots. By default FALSE. If TRUE, then a large enough multiplot grid should be generated to make this option meaningful.

colPal

Colour palette to use in the visualisation (best to provide 3 colours).

hap.wd

The width of the haplotype tracks to be plotted, generally recommended to be about 0.4 (default value)

recombination_data

List object as returned by the function count_recombinations. By default NULL, in which case no overlay of predicted recombination events is performed. However, it can be useful to visualise predicted recombination events, particularly as this might help inform the choice of argument plausible_pairing_prob of that function. See count_recombinations for more details.

reset_par

By default TRUE, reset par on exit.

log

Character string specifying the log filename to which standard output should be written. If NULL log is send to stdout.

Value

If recombinant_scan vector is supplied, a vector of recombinant offspring ID in the region of interest (otherwise NULL).

Examples

1
2
3
4
5
6
data("IBD_4x")
visualiseHaplo(IBD_list = IBD_4x,
               display_by = "name",
               linkage_group = 1,
               select_offspring = "all",
               multiplot = c(3,3))

polyqtlR documentation built on Feb. 2, 2022, 5:09 p.m.