Learn R Programming

hsphase (version 3.0.0)

pm: Probability Matrix

Description

Creates a recombination (probability) matrix based on the blocking structure.

Usage

pm(blockMatrix, method = "constant")

Arguments

blockMatrix

matrix. Blocking structure (output of bmh).

method

character. Method for creating the recombination matrix. Typically "constant" or "relative".

Details

This function identifies recombination between two consecutive sites and marks recombination sites with 1. If there are unknown sites between two blocks, it marks these sites with:

  • 1 for the "constant" method, or

  • \(1 / m\) for the "relative" method, where \(m\) is the number of unknown sites.

Examples

Run this code
genotype <- matrix(c(
  0,2,0,1,0,
  2,0,1,2,2,
  2,2,1,0,2,
  2,2,1,1,1,
  0,0,2,1,0
), ncol = 5, byrow = TRUE)

block <- bmh(genotype)
pm(block)

Run the code above in your browser using DataLab