Description Usage Arguments Value Examples

On a regular matrix, this is essentially a wrapper for colMeans or rowMeans depending on `loci_on_cols`

.
On a BEDMatrix object, the locus allele frequencies are computed keeping memory usage low.

1 | ```
allele_freqs(X, loci_on_cols = FALSE, mem_factor = 0.7, mem_lim = NA)
``` |

`X` |
The genotype matrix (regular R matrix or BEDMatrix object). Missing values are ignored in averages. |

`loci_on_cols` |
If |

`mem_factor` |
BEDMatrix-specific, sets proportion of available memory to use loading genotypes.
Ignored if |

`mem_lim` |
BEDMatrix-specific, sets total memory to use loading genotypes, in GB.
If |

The vector of allele frequencies, one per locus. Names are set to the locus names, if present.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ```
# Construct toy data
X <- matrix(
c(0, 1, 2,
1, 0, 1,
1, NA, 2),
nrow = 3,
byrow = TRUE
)
# row means
allele_freqs(X)
c(1/2, 1/3, 3/4)
# col means
allele_freqs(X, loci_on_cols = TRUE)
c(1/3, 1/4, 5/6)
``` |

OchoaLab/simtrait documentation built on Oct. 18, 2019, 5:42 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.