findPattern | R Documentation |
Find segments satisfying a particular pattern of IBD sharing, in a list of IBD simulations.
findPattern(sims, pattern, merge = TRUE, cutoff = 0, unit = "mb")
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 |
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 autozygous
all of pattern$heterozygous
have exactly one copy
all of pattern$carriers
have at least one copy
none of pattern$noncarriers
carry the allele.
A matrix (if sims
is a single genomeSim
object), or a list of
matrices.
segmentStats()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.