plot_SnpsInRuns {detectRUNS}R Documentation

Plot the number of times each SNP falls inside runs

Description

Function to plot the number of times/percentage each SNP is inside a run (population-specific signals) against the SNP positions in the genome. Proportions on the y-axis, bps on the x-axis

Usage

plot_SnpsInRuns(runs, genotypeFile, mapFile, savePlots = FALSE,
  separatePlots = FALSE, outputName = NULL)

Arguments

runs

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

genotypeFile

genotype (.ped) file path

mapFile

map file (.map) file path

savePlots

should plots be saved out in files (default) or plotted in the graphical terminal?

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 number of times a SNP is in a run by chromosome and population (pdf files)

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
# skipping runs calculation
## Not run: 
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_SnpsInRuns(runs = runsDF, genotypeFile = genotypeFile, mapFile = mapFile,
savePlots = FALSE, outputName = "ROHom")


[Package detectRUNS version 0.9.6 Index]