manhattanplot: Manhattan plot of iHS, XP-EHH or Rsb over a genome.

Description Usage Arguments Details Value See Also Examples

View source: R/manhattanplot.R

Description

Manhattanplot of iHS, XP-EHH or Rsb over a genome.

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
manhattanplot(
  data,
  pval = FALSE,
  threshold = c(-2, 2),
  chr.name = NA,
  cr = NULL,
  cr.col = "gray",
  cr.opacity = 0.5,
  cr.lab.cex = 0.6,
  cr.lab.offset = 0,
  cr.lab.pos = "top",
  mrk = NULL,
  mrk.cex = 1,
  mrk.col = "gray",
  mrk.pch = 1,
  mrk.lab.cex = 0.4,
  mrk.lab.pos = 4,
  ignore_sign = FALSE,
  cex = 0.5,
  las = 1,
  pch = 20,
  inset = 5e+06,
  resolution = NULL,
  ...
)

Arguments

data

output of either ihh2ihs, ies2xpehh or ines2rsb.

pval

logical. If TRUE, the p-value is plotted, otherwise the score itself.

threshold

a horizontal line is added at the corresponding value(s), for instance to represent a significance threshold. A single value (upper or lower threshold) or two values (upper and lower) can be specified.

chr.name

if NA (default), all chromosomes are plotted, otherwise only those specified.

cr

highlight "candidate regions" specified by a data.frame with columns CHR, START and END as obtained by the function calc_candidate_regions.

cr.col

the color for highlighting

cr.opacity

a value between 0 (invisible) and 1 (opaque).

cr.lab.cex

text size of candidate region labels.

cr.lab.offset

offset of candidate region labels.

cr.lab.pos

if "top" (default) or "bottom", candidate regions are labeled by numbers; to turn off, use "none"

mrk

highlight marker specified by a data.frame containing the colums CHR and POSITION. The row names of that data frame are taken as labels. Alternatively a vector with marker IDs can be specified. In the latter case the ID is used as label.

mrk.cex

size of marker label.

mrk.col

color of the highlighted points.

mrk.pch

type of the highlighted points.

mrk.lab.cex

text size of marker label. If zero, no labels are printed.

mrk.lab.pos

a position specifier for the text. Values of 1, 2, 3 and 4, respectively indicate positions below, to the left of, above and to the right of the highlighted marker.

ignore_sign

logical. If TRUE, absolute values are plotted.

cex

size of the points representing markers in the plot(s) (see par).

las

orientation of axis labels (see par).

pch

type of the points representing markers in the plot(s) (see points).

inset

inset (in bases) between chromosomes to avoid overlap of data points. Default: 5,000,000 bases.

resolution

Rasterize data points to the specified resolution and remove duplicate points. Defaults to NULL, i.e. no rasterization. A typical value might be c(1E5, 0.01), meaning that resolution on the x-axis (chromosomal position) is 100000 and on the y-axis (score or p-value) is 0.01.

...

further arguments to be passed to plot.default.

Details

The color of chromosomes is taken from the "Graphics Palette", see palette.

If a single chromosome is plotted, a genomic region can be specified by argument xlim.

Other statistics can be plotted as well, although a warning is issued. They must be given by a data.frame with columns CHR and POSITION and the statistic in the third column.

Value

The function returns a plot.

See Also

ihh2ihs, ies2xpehh, ines2rsb, calc_candidate_regions.

Examples

1
2
3
4
5
6
library(rehh.data)
data(wgscan.cgu)
## results from a genome scan (44,057 SNPs)
## see ?wgscan.eut and ?wgscan.cgu for details
wgscan.ihs <- ihh2ihs(wgscan.cgu)
manhattanplot(wgscan.ihs)

Example output

Discard focal markers with Minor Allele Frequency equal to or below 0.05 .
6890 markers discarded.
37167 markers remaining.

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