Learn R Programming

rehh (version 3.2.2)

calc_haplen: Calculate length of longest shared haplotypes around a focal marker

Description

Calculate for each chromosome the maximum length of its extended haplotype homozygosity.

Usage

calc_haplen(furcation)

Arguments

furcation

an object of class furcation calculated by calc_furcation.

Value

The functions returns a list containing four elements:

mrk.name

name/identifier of the focal marker.

position

position of the focal marker.

xlim

positions of left- and rightmost markers covered by extended haplotypes.

haplen

a data frame with the coordinates of extended haplotypes around the focal marker.

Details

Extended haplotype homozygosity is defined as the region around a focal marker in which a particular chromosome shares a haplotype with (its sequence is identical to) another chromosome. The function calculates for each chromosome the boundaries of its longest shared haplotype. These correspond to the last furcations of a chromsome in a furcation diagram. Note that the calculation is performed independently upstream and downstream of the focal marker and hence upper and lower boundaries do not necessarily arise from the same chromosomal pair.

Examples

Run this code
# NOT RUN {
#example haplohh object (280 haplotypes, 1424 SNPs)
#see ?haplohh_cgu_bta12 for details
data(haplohh_cgu_bta12)
#plotting haplotype lengths 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)
# }

Run the code above in your browser using DataLab