View source: R/segment_utils.R
segmentStats | R Documentation |
Compute summary statistics for segments identified by findPattern()
.
segmentStats(
x,
quantiles = c(0.025, 0.5, 0.975),
returnAll = FALSE,
unit = "mb"
)
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. |
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 in summary
): A summary of all segments from all
simulations
findPattern()
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.