plot_Runs: Function to plot runs per individual

Description Usage Arguments Value Examples

View source: R/plots.R

Description

Function to plot runs per individual (see Williams et al. 2016, Animal Genetics, for an example with animal data) Individual IDs on the y-axis, bps on the x-axis (position along the chromosome)

Usage

1
2
plot_Runs(runs, suppressInds = FALSE, savePlots = FALSE,
  separatePlots = FALSE, outputName = NULL)

Arguments

runs

a data.frame with runs per individual (group, id, chrom, nSNP, start, end, length)

suppressInds

shall we suppress individual IDs on the y-axis? (defaults to FALSE)

savePlots

should plots be saved out to files (one pdf file for all chromosomes) or plotted in the graphical terminal (default)?

separatePlots

should plots for each chromosome be saved out to separate files?

outputName

title prefix (the base name of graph, if savePlots is TRUE)

Value

plot of runs by chromosome

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# 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 runs per animal (interactive)
plot_Runs(runs = runsDF, suppressInds = FALSE, savePlots = FALSE, outputName = "ROHom")

detectRUNS documentation built on Oct. 30, 2019, 11:41 a.m.