Froh_inbreeding {detectRUNS} | R Documentation |
Function to calculated Froh genome-wide or chromosome-wide
Description
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
Usage
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) |
Details
Froh is calculated as:
F_{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.
Value
A data frame with the inbreeding coefficients of each 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')
Froh_inbreeding(runs = runsDF, mapFile = mapFile)
Froh_inbreeding(runs = runsDF, mapFile = mapFile, genome_wide=FALSE)
[Package detectRUNS version 0.9.6 Index]