main_multi: Fit 'main_p2()' across many SNPs.

View source: R/multi.R

main_multiR Documentation

Fit main_p2() across many SNPs.

Description

Support is provided for parallelization through the future package.

Usage

main_multi(nmat)

Arguments

nmat

A matrix of counts where the columns index the genotypes and the rows index the loci. nmat[i, j] contains the number of individuals with genotype j-1 at locus i.

Value

A matrix with two columns. The first column contains the estimated allele frequency, the second column contains the estimated double reduction parameter. The rows index the loci.

Author(s)

David Gerard

References

  • Jiang, Libo, Xiangyu Ren, and Rongling Wu. 2021. "Computational Characterization of Double Reduction in Autotetraploid Natural Populations." The Plant Journal 105 (6): 1703–9. doi: 10.1111/tpj.15126

Examples

## Fake data
nmat <- matrix(c(1, 2, 3, 2, 1,
                 3, 2, 1, 2, 3),
               nrow = 2,
               byrow = TRUE)

## Run the analysis in parallel on the local computer with two workers
future::plan(future::multisession, workers = 2)
main_multi(nmat = nmat)

## Shut down parallel workers
future::plan("sequential")


dcgerard/phwelike documentation built on July 27, 2022, 8:07 a.m.