Skip to contents

Calculate IBD probabilities for different types of populations.

Usage

calcIBD(
  popType,
  markerFile,
  mapFile,
  evalPos = NULL,
  evalDist = NULL,
  grid = TRUE,
  verbose = FALSE
)

Arguments

popType

A character string indicating the type of population. One of DH, Fx, FxDH, BCx, BCxDH, BC1Sx, BC1SxDH, C3, C3DH, C3Sx, C3SxDH, C4, C4DH, C4Sx, C4SxDH (see Details).

markerFile

A character string indicating the location of the file with genotypic information for the population. The file should be in tab-delimited format with a header containing marker names.

mapFile

A character string indicating the location of the map file for the population. The file should be in tab-delimited format. It should consist of exactly three columns, marker, chromosome and position. There should be no header. The positions in the file should be in centimorgan.

evalPos

A data.frame with evaluation positions to which the calculations should be limited.

evalDist

An optional numerical value indicating the maximum distance for marker positions. Extra markers will be added based on the value of grid.

grid

Should the extra markers that are added to assure the a maximum distince of evalDist be on a grid (TRUE) or in between marker existing marker positions (FALSE).

verbose

Should messages indicating the progress of the process be printed?

Value

An object of class IBDprob, a list with five elements,

map

a data.frame with chromosome and position of the markers.

markers

a 3-dimensional array of IBD probabilities with genotypes, markers and parents as array dimensions.

parents

the parents.

popType

the population type.

Details

IBD probabilities can be calculated for many different types of populations. In the following table all supported populations are listed. Note that the value of x in the population types is variable, with its maximum value depicted in the last column.

Population typeCrossDescriptionmax. x
DHbiparentaldoubled haploid population
FxbiparentalFx population (F1, followed by x-1 generations of selfing)8
FxDHbiparentalFx, followed by DH generation8
BCxbiparentalbackcross, second parent is recurrent parent9
BCxDHbiparentalBCx, followed by DH generation9
BC1SxbiparentalBC1, followed by x generations of selfing7
BC1SxDHbiparentalBC1, followed by x generations of selfing and DH6
C3three-waythree way cross: (AxB) x C
C3DHthree-wayC3, followed by DH generation
C3Sxthree-wayC3, followed by x generations of selfing7
C3SxDHthree-wayC3, followed by x generations of selfing and DH generation6
C4four-wayfour-way cross: (AxB) x (CxD)
C4DHfour-wayC4, followed by DH generation
C4Sxfour-wayC4, followed by x generations of selfing6
C4SxDHfour-wayC4, followed by x generations of selfing and DH generation6

Examples

## Compute IBD probabilities for Steptoe Morex.
SxMIBD <- calcIBD(popType = "DH",
                  markerFile = system.file("extdata/SxM", "SxM_geno.txt",
                                        package = "statgenIBD"),
                  mapFile = system.file("extdata/SxM", "SxM_map.txt",
                                        package = "statgenIBD"))

## Check summary.
summary(SxMIBD)
#> population type:  DH 
#> Number of evaluation points:  116 
#> Number of individuals:  150 
#> Parents:  Morex Steptoe 

## Compute IBD probabilities for Steptoe Morex.
## Add extra evaluation positions in between exiting marker positions
## to assure evaluation positions are at most 5 cM apart.
SxMIBD_Ext <- calcIBD(popType = "DH",
                      markerFile = system.file("extdata/SxM", "SxM_geno.txt",
                                              package = "statgenIBD"),
                      mapFile = system.file("extdata/SxM", "SxM_map.txt",
                                            package = "statgenIBD"),
                      evalDist = 5)

## Check summary.
summary(SxMIBD_Ext)
#> population type:  DH 
#> Number of evaluation points:  226 
#> Number of individuals:  150 
#> Parents:  Morex Steptoe