segmentStats {ibdsim2} | R Documentation |
Summary statistics for identified segments
Description
Compute summary statistics for segments identified by findPattern()
.
Usage
segmentStats(
x,
quantiles = c(0.025, 0.5, 0.975),
returnAll = FALSE,
unit = "mb"
)
Arguments
x |
A list of matrices produced with |
quantiles |
A vector of quantiles to include in the summary. |
returnAll |
A logical, by default FALSE. If TRUE, the output includes a
vector |
unit |
Either "mb" (megabases) or "cm" (centiMorgan); the length unit for genomic segments. |
Value
A list containing a data frame perSim
, a matrix summary
and (if
returnAll
is TRUE) a vector allSegs
.
Variables used in the output:
-
Count
: The total number of segments in a simulation -
Total
: The total sum of the segment lengths in a simulation -
Average
: The average segment lengths in a simulation -
Shortest
: The length of the shortest segment in a simulation -
Longest
: The length of the longest segment in a simulation -
Overall
(only insummary
): A summary of all segments from all simulations
See Also
Examples
x = nuclearPed(3)
sims = ibdsim(x, N = 2, map = uniformMap(M = 2), model = "haldane", seed = 1729)
# Segments where all siblings carry the same allele
segs = findPattern(sims, pattern = list(carriers = 3:5))
# Summarise
segmentStats(segs, unit = "mb")
# The unit does not matter in this case (since the map is trivial)
segmentStats(segs, unit = "cm")