linkage: Calculate recombination frequency, LOD and phase

Description Usage Arguments Value Examples

View source: R/exported_functions.R

Description

linkage is used to calculate recombination frequency, LOD and phase within one type of marker or between two types of markers.

Usage

1
2
3
4
5
6
linkage(dosage_matrix, markertype1 = c(1, 0), markertype2 = NULL,
  target_parent = "P1", other_parent = "P2", G2_test = FALSE,
  convert_palindrome_markers = TRUE, LOD_threshold = 0, ploidy = c(4, 6),
  ploidy2 = NULL, pairing = c("random", "preferential"), prefPars = c(0,
  0), combinations_per_iter = NULL, verbose = TRUE, full_output = FALSE,
  iter_RAM = 500, ncores = 1, log = NULL)

Arguments

dosage_matrix

An integer matrix with markers in rows and individuals in columns.

markertype1

A vector of length 2 specifying the first markertype to compare. The first element specifies the dosage in target_parent, the second in other_parent.

markertype2

A vector of length 2 specifying the first markertype to compare. This argument is optional. If not specified, the funciton will calculate linkage within the markertype as specified by markertype1. The first element specifies the dosage in target_parent, the second in other_parent.

target_parent

Character string specifying the target parent as provided in the columnnames of dosage_matrix

other_parent

Character string specifying the other parent as provided in the columnnames of dosage_matrix

G2_test

Apply a G2 test (LOD of indepedence) in addition to the LOD of linkage.

convert_palindrome_markers

Logical. Should markers that behave the same for both parents be converted to a workable format for that parent? E.g.: should 3.1 markers be converted to 1.3? If unsure, set to TRUE.

LOD_threshold

Minimum LOD score of linkages to report. Recommended to use for large number (> millions) of marker comparisons in order to reduce memory usage.

ploidy

Integer. The ploidy of parent 1.

ploidy2

Integer, by default NULL. If parental ploidies differ, the ploidy of parent 2.

pairing

Type of pairing. "random" or "preferential".

prefPars

The estimates for preferential pairing parameters for parent 1 and 2, in range 0 <= p < 2/3. By default this is c(0,0) (so, no preferential pairing). See the function test_prefpairing and the vignette for more details.

combinations_per_iter

Optional integer. Number of marker combinations per iteration.

verbose

Should messages be send to stdout?

full_output

Logical, by default FALSE. If TRUE, the complete output over all phases and showing marker combination counts is returned.

iter_RAM

A (very) conservative estimate of working memory in megabytes used per core. It only takes the size frequency matrices into account. Actual usage is more, espacially with large number of linkages that are reported. Reduce memory usage by using a higher LOD_threshold.

ncores

Number of cores to use. Works both for Windows and UNIX (using doParallel). Use parallel::detectCores() to find out how many cores you have available.

log

Character string specifying the log filename to which standard output should be written. If NULL log is send to stdout.

Value

Returns a data.frame with columns:

marker_a

first marker of comparison. If markertype2 is specified, it has the type of markertype1.

marker_b

second marker of comparison. It has the type of markertype2 if specified.

r

(estimated) recombinations frequency

LOD

(estimated) LOD score

phase

phase between markers

Examples

1
2
3
4
5
6
7
8
9
data("screened_data3")
SN_SN_P1 <- linkage(dosage_matrix = screened_data3,
                   markertype1 = c(1,0),
                   target_parent = "P1",
                   other_parent = "P2",
                   ploidy = 4,
                   pairing = "random",
                   ncores = 1
                   )

mdavy86/polymapR documentation built on May 25, 2019, 9:35 p.m.