Unlimited learning, half price | 50% off
Get 50% off unlimited learning

rehh (version 2.0.4)

calc_ehhs: EHHS and iES computations at a given core SNP

Description

Compute site-specific Extended Haplotype Homozygosity (EHHS) and integrated EHHS (iES) for a given focal SNP.

Usage

calc_ehhs(haplohh, mrk, limhaplo = 2, limehhs = 0.05,
    scalegap = NA, maxgap = NA,
    discard_integration_at_border = TRUE, plotehhs = TRUE,
    lty = 1, lwd = 1.5, col = c("blue", "red"), xlab = "Position",
    ylab = expression(Site ~ specific ~ italic(EHH) ~ (italic(EHHS))),
    cex.lab = 1.25, main = NA, cex.main = 1.5)

Arguments

haplohh

An object of class haplohh (see data2haplohh).

mrk

Either the number of the marker in the haplohh object (as integer) or its name (as string) to specify the focal marker

limhaplo

Minimal number of haplotypes to continue computing EHHS away from the core SNP. Useless, if no missing data. However, when some data are missing, haplotypes with missing data are removed from the computation. Hence as we compute EHH further from the core SNP, less haplotypes are expected

limehhs

Limit at which EHHS stops to be evaluated

scalegap

Scales gaps larger than the specified size to the specified size (default=NA, i.e. no scaling)

maxgap

Maximum allowed gap in bp between two SNPs below which EHHS stops to be evaluated (default=NA, i.e., no limitation)

discard_integration_at_border

If TRUE and if first or last marker or a gap (larger than maxgap) is reached and EHHS is greater than limehh, then IES is set to NA

plotehhs

If TRUE, EHHS estimates are plotted for each position

lty

Line type for the EHHS_Sabeti_et_al_2007 and EHHS_Tang_et_al_2007 (respectively) curves

lwd

Line width for the EHHS_Sabeti_et_al_2007 and EHHS_Tang_et_al_2007 (respectively) curves

col

Color for the EHHS_Sabeti_et_al_2007 and EHHS_Tang_et_al_2007 (respectively) curves

xlab

Legend for the x--axis

ylab

Legend for the y--axis

cex.lab

Size of the axis legend

main

Main legend of the EHHS plot

cex.main

Size of the main legend

Value

The returned value is a list containing the following elements:

EHHS_Tang_et_al_2007

A vector of nsnps columns containing EHHS estimates at each chromosome position relative to the focal SNP computed as described in the Tang et al. (2007).

EHHS_Sabeti_et_al_2007

A vector of nsnps columns containing EHHS estimates at each chromosome position relative to the focal SNP computed as described in the Sabeti et al. (2007).

nhaplo_eval

A matrix of two rows and nsnps columns containing the number of evaluated haplotypes at each chromosome position relative to the focal SNP for the ancestral (first row) and derived (second row) alleles.

IES_Sabeti_et_al_2007

Integrated EHHS (computed using the estimator by Sabeti et al. (2007)) over the chromosome.

IES_Tang_et_al_2007

Integrated EHHS (computed using the estimator by Tang et al. (2007)) over the chromosome.

Details

EHHS are computed at each position upstream and downstream of the focal SNP. This allows in turn the computation of the integrated EHHS relative to map distances (iES).

References

Gautier, M. and Naves, M. (2011). Footprints of selection in the ancestral admixture of a New World Creole cattle breed. Molecular Ecology, 20, 3128--3143.

Sabeti, P.C. et al. (2007). Genome-wide detection and characterization of positive selection in human populations. Nature, 449, 913--918.

Tang, K. and Thornton, K.R. and Stoneking, M. (2007). A New Approach for Using Genome Scans to Detect Recent Positive Selection in the Human Genome. Plos Biology, 7, e171.

See Also

calc_ehh,data2haplohh,scan_hh

Examples

Run this code
# NOT RUN {
#example haplohh object (280 haplotypes, 1424 SNPs)
#see ?haplohh_cgu_bta12 for details
data(haplohh_cgu_bta12)
#computing EHH statistics for the focal SNP at position 456
#which displays a strong signal of selection
res.ehhs<-calc_ehhs(haplohh_cgu_bta12,mrk=456)
# }

Run the code above in your browser using DataLab