polyfreqs
implements a Gibbs sampling algorithm to perform Bayesian inference on the allele frequencies (and other quantities) in a population of autopolyploids.
It is the main function for conducting inference with the polyfreqs
package.
polyfreqs(tM, rM, ploidy, iter = 1e+05, thin = 100, burnin = 20, print = 1000, error = 0.01, genotypes = FALSE, geno_dir = "genotypes", col_header = "", outfile = "polyfreqs-mcmc.out", quiet = FALSE)
thin
generations (default=100).polyfreqs
(default = "genotypes").genotypes=TRUE
) items:
polyfreqs
must be of class "matrix" with row names representing the names of the individuals sampled.
The simplest way to get data into R for running an analysis is to format the total read matrix and reference read matrix as tab delimited text files with the first column containing the individual names and one column after that with the read counts for each locus. These data can then be read in using the read.table
function with the row.names
argument set equal to 1.
An optional tab delimited list of locus names can be included as the first row and are treated as column headers for each locus (set header=T
in the read.table
function).
When running the polyfreqs
, there are a number of options that control what the function returns.
To estimate genotypes and print posterior genotype samples to file, set the genotypes
argument to TRUE
and select a name for the output directory geno_dir
(defaults to "genotypes
").
polyfreqs
also prints the current MCMC generation (with a frequency set by the print_freqs
argument) to the R console so that users can track run times.
This print can be turned off by setting quiet=TRUE
. More details on using polyfreqs
can be found in the introductory vignette.
data(total_reads)
data(ref_reads)
polyfreqs(total_reads,ref_reads,4,iter=100,thin=10)
Run the code above in your browser using DataLab