calc_pairwise_haplen: Calculate pairwise shared haplotype length between all...

Description Usage Arguments Details Value See Also Examples

View source: R/calc_pairwise_haplen.R

Description

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

Usage

1
2
3
4
5
6
7
8
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).

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.

Value

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

See Also

data2haplohh, scan_hh_full.

Examples

1
2
3
4
5
6
#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")

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