plot.haplohh: Plot the variants of a haplohh object

Description Usage Arguments Details See Also Examples

View source: R/plot.haplohh.R

Description

Plot the variants of a haplohh object. This method is intended for visualization of very small data sets such as the examples provided by the package.

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
26
27
28
## S3 method for class 'haplohh'
plot(
  x,
  mrk = NA,
  allele = NA,
  group_by_allele = FALSE,
  ignore.distances = FALSE,
  col = c("blue", "red", "violet", "orange"),
  linecol = "gray",
  mrk.col = "gray",
  pch = 19,
  cex = 1,
  lwd = 1,
  hap.names = NULL,
  mrk.names = NULL,
  cex.lab.hap = 0.8,
  cex.lab.mrk = 0.8,
  family.lab = "",
  offset.lab.hap = 0.5,
  offset.lab.mrk = 0.25,
  pos.lab.hap = "left",
  pos.lab.mrk = "top",
  srt.hap = 0,
  srt.mrk = 0,
  highlight.mrk = NULL,
  highlight.mrk.col = c("lightgray", "black", "darkgray"),
  ...
)

Arguments

x

an object of class haplo-hh generated by data2haplohh.

mrk

the focal marker. Used only, if alleles are grouped or (de-)selected.

allele

if NA (default), haplotypes of all alleles are plotted, otherwise for the specified alleles. Alleles must be specified by their internal coding, i.e. '0' for ancestral resp. major allele, etc. Haplotypes with missing values at the focal marker can only be selected in combination with genotyped alleles, e.g. as c(1,NA).

group_by_allele

logical. If TRUE, group chromosomes by their allele at the focal marker; alleles are ordered by their internal coding unless parameter alleles is specified. If FALSE (default), haplotypes are drawn by their order in the input file.

ignore.distances

logical. If TRUE, markers are drawn equally-spaced.

col

color for each allele (as coded internally).

linecol

the color of the background lines. If more than one color is specified and sequences sorted by the marker allele, the specified colors are used to distinguish the alleles; otherwise consecutive sequences are set into the specified colors.

mrk.col

color of the vertical line at the focal marker position.

pch

symbol used for markers. See points.

cex

relative size of marker symbol. See points.

lwd

line width.

hap.names

a vector containing the names of chromosomes.

mrk.names

a vector containing the names of markers.

cex.lab.hap

relative letter size of haplotype labels. See par.

cex.lab.mrk

relative letter size of marker labels. See par.

family.lab

font family for labels. See par.

offset.lab.hap

offset of haplotype labels. See par.

offset.lab.mrk

offset of marker labels. See par.

pos.lab.hap

position of haplotype labels. Either "left" (default), "right", "none" or "both".

pos.lab.mrk

position of marker labels. Either "top" (default) or "none".

srt.hap

rotation of haplotype labels (see par).

srt.mrk

rotation of marker labels (see par).

highlight.mrk

vector of markers to be highlighted

highlight.mrk.col

color for each allele (as coded internally) at highlighted markers.

...

other parameters to be passed to plot.default.

Details

Specifying a haplohh-object with more than 4096 haplotypes or markers produces an error.

See Also

calc_haplen, plot.furcation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#example haplohh object
make.example.files()
hh <- data2haplohh(hap_file = "example1.hap",
                   map_file = "example1.map",
                   allele_coding = "01")
plot(hh)
hh <- data2haplohh(hap_file = "example2.hap",
                   map_file = "example2.map",
                   allele_coding = "01",
                   min_perc_geno.mrk = 50)
plot(hh)
remove.example.files()

rehh documentation built on Sept. 15, 2021, 5:06 p.m.