plot.haplen: Plot the length of extended haplotypes around a focal marker

Description Usage Arguments See Also Examples

View source: R/plot.haplen.R

Description

Plot the length of extended haplotype around a focal marker.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## S3 method for class 'haplen'
plot(
  x,
  allele = NA,
  group_by_allele = TRUE,
  order_by_length = FALSE,
  col = c("blue", "red", "violet", "orange"),
  mrk.col = "gray",
  lwd = 1,
  hap.names = NULL,
  cex.lab = 1,
  family.lab = "",
  offset.lab = 0.5,
  pos.lab = "left",
  legend = NA,
  legend.xy.coords = "automatic",
  ...
)

Arguments

x

an object of class haplen generated by calc_haplen.

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.

group_by_allele

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

order_by_length

if TRUE, chromosomes are ordered by their shared haplotype length.

col

color for each allele (as coded internally).

mrk.col

color of the vertical line at the focal marker position.

lwd

line width.

hap.names

a vector containing the names of chromosomes.

cex.lab

relative letter size of labels. See par.

family.lab

font family for labels. See par.

offset.lab

offset of labels. See par.

pos.lab

position of haplotype labels. Either "left" , "right" or "both".

legend

legend text.

legend.xy.coords

if "automatic" (default) places legend either top left or top right; if "none", no legend is drawn; otherwise argument is passed to legend.

...

other parameters to be passed to plot.default.

See Also

calc_haplen, plot.furcation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#example haplohh object (280 haplotypes, 1424 SNPs)
#see ?haplohh_cgu_bta12 for details
data(haplohh_cgu_bta12)
#plotting length of extended haplotypes for both ancestral and derived allele
#of the marker "F1205400"
#which displays a strong signal of selection
f <- calc_furcation(haplohh_cgu_bta12, mrk = "F1205400")
h <- calc_haplen(f)
plot(h)
plot(h, hap.names = hap.names(haplohh_cgu_bta12), cex.lab = 0.3)

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