Froh_inbreeding function

Function to calculated Froh genome-wide or chromosome-wide

Function to calculated Froh genome-wide or chromosome-wide

This function calculates the individual inbreeding coefficients based on runs of homozygosity (ROH), either per-chromosome (chromosome-wide) or based on the entire genome (genome-wide). See details of calculations below

Froh_inbreeding(runs, mapFile, genome_wide = TRUE)

Arguments

  • runs: R object (dataframe) with results on runs
  • mapFile: Plink map file (to retrieve SNP position)
  • genome_wide: vector of TRUE/FALSE (genome-wide or chromosome-wide; defaults to TRUE/genome-wide)

Returns

A data frame with the inbreeding coefficients of each individual sample

Details

Froh is calculated as:

FROH=ROHlengthLengthgenomeF_{ROH} = \frac{\sum ROH_{length}}{Length_{genome}}

Depending on whether genome-wide or chromosome-wide calculations are required, the terms in the numerator and denominator will refer to the entire genome or will be restricted to specific chromosomes.

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') Froh_inbreeding(runs = runsDF, mapFile = mapFile) Froh_inbreeding(runs = runsDF, mapFile = mapFile, genome_wide=FALSE)