findPattern {ibdsim2} | R Documentation |
Find specific IBD patterns
Description
Find segments satisfying a particular pattern of IBD sharing, in a list of IBD simulations.
Usage
findPattern(sims, pattern, merge = TRUE, cutoff = 0, unit = "mb")
Arguments
sims |
A |
pattern |
A named list of vectors containing ID labels. Allowed names
are |
merge |
A logical, indicating if adjacent segments should be merged. Default: TRUE. |
cutoff |
A non-negative number. Segments shorter than this are excluded from the output. Default: 0. |
unit |
The unit of |
Details
For each simulation, this function extracts the subset of rows satisfying the
allele sharing specified by pattern
. That is, segments where, for some allele,
all of
pattern$autozygous
are autozygousall of
pattern$heterozygous
have exactly one copyall of
pattern$carriers
have at least one copynone of
pattern$noncarriers
carry the allele.
Value
A matrix (if sims
is a single genomeSim
object), or a list of
matrices.
See Also
Examples
x = nuclearPed(3)
s = ibdsim(x, N = 1, map = uniformMap(M = 1), seed = 1729)
# Segments where some allele is shared by 3 and 4, but not 5
pattern = list(carriers = 3:4, noncarriers = 5)
findPattern(s, pattern)
# Exclude segments less than 7 cM
findPattern(s, pattern, cutoff = 7)
# Visual confirmation:
haploDraw(x, s)