segment_count_dist {ibdsegments}R Documentation

Compute probability distribution of IBD segment count

Description

The segment_count_dist function computes the probability distribution of the number of IBD segments (i.e., the count of IBD intervals) between pairs of individuals in a pedigree, for a given IBD state and chromosome length(s).

Usage

segment_count_dist(
  pedigree,
  ids = pedtools::leaves(pedigree),
  states = "ibd",
  ibd_state = 1L,
  chromosome_length = 267.77,
  convolve = TRUE
)

Arguments

pedigree

Pedigree in pedtools::ped form.

ids

Ids for which IBD is observed. Default is pedtools::leaves(pedigree).

states

One of "ibd" (default), "kappa", "identity" or "detailed".

ibd_state

Default is 1.

chromosome_length

Default is 267.77 cM (an estimate of the length of chromosome 1).

convolve

Should the distribution of the sum (across chromosomes) be obtained?

Details

This function is analogous to total_ibd_dist() but focuses on the number of IBD segments rather than the total IBD length.

Value

object of class segment_count_dist

See Also

total_ibd_dist() for the distribution of IBD length.

Examples

ped_hs <- pedtools::halfSibPed()

dist <- segment_count_dist(ped_hs, chromosome_length = 100)
dist
plot(dist)
E(dist)
sd(dist)

r <- r_cibd(n = 1e4, pedigree = ped_hs, chromosome_length = 100)
mean(r$stats$segment_count)
sd(r$stats$segment_count)


[Package ibdsegments version 1.0.1 Index]