Learn R Programming

rehh (version 3.2.2)

calc_pairwise_haplen: Calculate pairwise shared haplotype length between all chromosomes

Description

Calculate pairwise shared haplotype length between all chromosomes at a focal marker.

Usage

calc_pairwise_haplen(
  haplohh,
  mrk,
  phased = TRUE,
  maxgap = NA,
  max_extend = NA,
  side = "both"
)

Arguments

haplohh

an object of class haplohh (see data2haplohh).

mrk

integer representing the number of the focal marker within the haplohh object or string representing its ID/name.

phased

logical. If TRUE (default) chromosomes are expected to be phased. If FALSE, the haplotype data is assumed to consist of pairwise ordered chromosomes belonging to diploid individuals and only the two chromosomes of each individual are compared.

maxgap

maximum allowed gap in bp between two markers. If exceeded, further calculation is stopped at the gap (default=NA, i.e. no limitation).

max_extend

maximum distance in bp to extend shared haplotypes away from the focal marker. (default NA, i.e. no limitation).

side

side to consider, either "left" (positions lower than focal position), "right" (positions higher than focal position) or "both" (default).

Value

The returned value is a matrix with pairwise shared haplotype lengths.

Details

The function computes the length of shared haplotypes (stretches of identical sequence) around the focal marker.

Note that the function calc_haplen calculates for each chromosome the boundaries of its longest shared haplotype; separately upstream and downstream of the focal marker.

See Also

data2haplohh, scan_hh_full.

Examples

Run this code
# NOT RUN {
#example haplohh object (280 haplotypes, 1424 SNPs)
#see ?haplohh_cgu_bta12 for details
data(haplohh_cgu_bta12)
#computing shared haplotype lengths around the marker "F1205400"
#which displays a strong signal of selection
m <- calc_pairwise_haplen(haplohh_cgu_bta12, mrk = "F1205400")
# }

Run the code above in your browser using DataLab