plot_PatternRuns {detectRUNS} | R Documentation |
Plot sum of run-lengths (or average run-lengths) against the number of runs per individual
Description
Function to plot the sum of run lengths (or the average run length) per individual against the average number of runs per individual. Points can be differentially coloured by group/population. This plot can be useful to identify patterns in the distribution of runs in different groups (e.g. few long runs vs many short runs)
Usage
plot_PatternRuns(runs, mapFile, method = c("sum", "mean"),
outputName = NULL, savePlots = FALSE, plotTitle = NULL)
Arguments
runs |
a data.frame with runs per individual (group, id, chrom, nSNP, start, end, length) |
mapFile |
map file (.map) file path |
method |
"sum" or "mean" of run lengths per individual sample |
outputName |
title prefix (the base name of graph, if savePlots is TRUE)#' |
savePlots |
should plots be saved out to files or plotted in the graphical terminal (default)? |
plotTitle |
title in plot (default NULL) |
Value
plot of number of runs vs run-length sum/mean per individual sample
Examples
# getting map and ped paths
genotypeFile <- system.file("extdata", "Kijas2016_Sheep_subset.ped", package = "detectRUNS")
mapFile <- system.file("extdata", "Kijas2016_Sheep_subset.map", package = "detectRUNS")
# calculating runs of Homozygosity
## Not run:
# skipping runs calculation
runs <- slidingRUNS.run(genotypeFile, mapFile, windowSize = 15, threshold = 0.1, minSNP = 15,
ROHet = FALSE, maxOppositeGenotype = 1, maxMiss = 1, minLengthBps = 100000, minDensity = 1/10000)
## End(Not run)
# loading pre-calculated data
runsFile <- system.file("extdata", "Kijas2016_Sheep_subset.sliding.csv", package="detectRUNS")
runsDF <- readExternalRuns(inputFile = runsFile, program = 'detectRUNS')
plot_PatternRuns(runs = runsDF, mapFile = mapFile, method = 'sum')
plot_PatternRuns(runs = runsDF, mapFile = mapFile, method = 'mean')
[Package detectRUNS version 0.9.6 Index]