comb: Combinations of loci.

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Create a matrix of combinations between loci for which linkage disequilibrium (LD) should be computed.

Combinations among loci with minimum and maximum distance.

Combinations among adjacent (neighboring) loci.

Combinations among all loci.

Combinations among nearest loci.

Combinations among nearest loci.

Combinations among all loci of two sets.

Combinations among different sets of loci with minimum and maximum distance.

Combinations between flaning loci.

Combinations among loci in a sliding window.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
comb_wind(pos, min_dist, max_dist)

comb_adj(pos)

comb_all(pos)

comb_nearest(indices, indices2, pos, pos2)

comb_nearest_k(indices, indices2, pos, pos2, k)

comb_all_sets(indices, indices2, pos, pos2)

comb_wind_sets(indices, indices2, pos, pos2, min_dist, max_dist)

comb_flank(indices, indices2, pos, pos2)

comb_sliding(pos, start, width, advance)

Arguments

pos

An increasingly sorted numeric vector. The positions of the loci.

min_dist

A numeric vector. The minimum distances between loci. Each entry must be positive.

max_dist

A numeric vector. The maximum distances between loci.

indices

An integer vector. A vector with the indices of the loci.

indices2

An integer vector. A vector with the indices of a second set of loci.

pos2

An increasingly numeric vector. The positions of a second set of loci.

k

An integer. The number of nearest loci to be considered.

start

A double. Specifies where to start with the sliding window.

width

A double. Width of the sliding window.

advance

A double. Increment of the sliding window.

Details

The purpose of these functions is to provide a convenient way to obtain all desired combinations of loci for computation of LD between them. Here is an overview of their functionality:

In general, these functions all return a matrix with three columns. The first two columns refer to the indices of the pair of loci, while the third column indicates to which group of combinations the pair belongs. Currently, the assigned groups only vary for comb_sliding, where the group indicates to which window the pair of loci belongs.

The returned matrix is suitable as input for the function LD_mult for efficient computation of LD.

Value

A numeric matrix.

Author(s)

Dominik Mueller (dominikmueller64@yahoo.de)

See Also

LD_mult

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
pos <- sort(runif(10))
comb_wind(pos, min_dist = c(0.1, 0.3, 0.8), max_dist = c(0.2, 0.7, 0.9))
comb_adj(pos)
comb_all(pos)
pos2 <- sort(runif(10L, min = 0, max = max(pos)))
indices1 <- which(sort(c(pos, pos2)) %in% pos)
indices2 <- which(sort(c(pos, pos2)) %in% pos2)
comb_nearest(indices1, indices2, pos, pos2)
comb_nearest_k(indices1, indices2, pos, pos2, 3)
comb_all_sets(indices1, indices2, pos, pos2)
comb_wind_sets(indices1, indices2, pos, pos2,
               min_dist = c(0.1, 0.3, 0.8), max_dist = c(0.2, 0.7, 0.9))
comb_flank(indices1, indices2, pos, pos2)
comb_sliding(pos, 0, 0.2, 0.1)

DominikMueller64/LDtools documentation built on May 6, 2019, 2:51 p.m.