Froh_inbreeding: Function to calculated Froh genome-wide or chromosome-wide

Description Usage Arguments Details Value Examples

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

1
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{∑ 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

 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')

Froh_inbreeding(runs = runsDF, mapFile = mapFile)
Froh_inbreeding(runs = runsDF, mapFile = mapFile, genome_wide=FALSE)

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