# Detect Runs of Homozygosity and Runs of Heterozygosity in Diploid Genomes

## Documentation for package ‘detectRUNS’ version 0.9.6

- DESCRIPTION file.
- User guides, package vignettes and other documentation.
- Package NEWS.

## Help Pages

consecutiveRUNS.run | Main function to detect genomic RUNS (ROHom/ROHet) using the consecutive method
consecutiveRunsCpp | Function to detect consecutive runs in a vector (individual's genotypes)
createRUNdf | Function to create a dataframe of RUNS per individual animal Requires a map file (other filename to read or R object) Parameters on maximum number of missing and opposite genotypes in the run (not the window) are implemented here
findOppositeAndMissing | Function to calculate oppositeAndMissingGenotypes array
Froh_inbreeding | Function to calculated Froh genome-wide or chromosome-wide
Froh_inbreedingClass | Function to calculated Froh using a ROH-class
genoConvertCpp | Convert 0/1/2 genotypes to 0/1
heteroZygotTest | Function to check whether a window is (loosely) heterozygous or not
heteroZygotTestCpp | Function to check whether a window is (loosely) heterozygous or not
homoZygotTest | Function to check whether a window is (loosely) homozygous or not
homoZygotTestCpp | Function to check whether a window is (loosely) homozygous or not
pedConvertCpp | Convert ped genotypes to 0/1
plot_DistributionRuns | Plot Distribution of runs
plot_InbreedingChr | Plot Froh-based inbreeding coefficients by group
plot_manhattanRuns | Plot the proportion of times SNPs are inside runs - MANHATTAN PLOT
plot_PatternRuns | Plot sum of run-lengths (or average run-lengths) against the number of runs per individual
plot_Runs | Function to plot runs per individual
plot_SnpsInRuns | Plot the number of times each SNP falls inside runs
plot_StackedRuns | Plot stacked runs
plot_ViolinRuns | Violin plot of run length per individual (either sum or mean)
readExternalRuns | Read runs from external files
readPOPCpp | Function to return a dataframe of population (POP, ID)
reorderDF | Function to reorder data frames by CHROMOSOME
slidingRUNS.run | Main function to detect RUNS (ROHom/ROHet) using sliding windows (a la Plink)
slidingWindow | Function to slide a window over a vector (individual's genotypes)
slidingWindowCpp | Function to slide a window over a vector (individual's genotypes)
snpInRun | Function to return a vector of T/F for whether a SNP is or not in a RUN
snpInRunCpp | Function to return a vector of T/F for whether a SNP is or not in a RUN
snpInsideRuns | Function to count number of times a SNP is in a RUN
snpInsideRunsCpp | Function to count number of times a SNP is in a RUN
summaryRuns | Summary statistics on detected runs
tableRuns | Function to retrieve most common runs in the population
writeRUN | Function to write out RUNS per individual animal