utils.structure.run {dartR.popgen} | R Documentation |
Utility function to run Structure
Description
These functions were copied from package strataG, which is no longer on CRAN (maintained by Eric Archer)
Usage
utils.structure.run(
g,
k.range,
num.k.rep,
label,
delete.files = TRUE,
exec,
burnin,
numreps,
noadmix,
freqscorr,
randomize,
seed,
pop.prior,
locpriorinit,
maxlocprior,
gensback,
migrprior,
pfrompopflagonly,
popflag,
inferalpha,
alpha,
unifprioralpha,
alphamax,
alphapriora,
alphapriorb
)
Arguments
g |
a gtypes object [see |
k.range |
vector of values to for |
num.k.rep |
number of replicates for each value in |
label |
label to use for input and output files |
delete.files |
logical. Delete all files when STRUCTURE is finished? |
exec |
name of executable for STRUCTURE. Defaults to "structure". |
burnin |
Number of burnin reps [default 10000]. |
numreps |
Number of MCMC replicates [default 1000]. |
noadmix |
Logical. No admixture? [default TRUE]. |
freqscorr |
Logical. Correlated frequencies? [default FALSE]. |
randomize |
Randomize [default TRUE]. |
seed |
Set random seed [default 0]. |
pop.prior |
A character specifying which population prior model to use: "locprior" or "usepopinfo" [default NULL]. |
locpriorinit |
Parameterizes locprior parameter r - how informative the populations are. Only used when pop.prior = "locprior" [default 1]. |
maxlocprior |
Specifies range of locprior parameter r. Only used when pop.prior = "locprior" [default 20]. |
gensback |
Integer defining the number of generations back to test for immigrant ancestry. Only used when pop.prior = "usepopinfo" [default 2]. |
migrprior |
Numeric between 0 and 1 listing migration prior. Only used when pop.prior = "usepopinfo" [default 0.05]. |
pfrompopflagonly |
Logical. update allele frequencies from individuals specified by popflag. Only used when pop.prior = "usepopinfo" [default TRUE]. |
popflag |
A vector of integers (0, 1) or logicals identifiying whether or not to use strata information. Only used when pop.prior = "usepopinfo" [default NULL]. |
inferalpha |
Logical. Infer the value of the model parameter # from the data; otherwise is fixed at the value alpha which is chosen by the user. This option is ignored under the NOADMIX model. Small alpha implies that most individuals are essentially from one population or another, while alpha > 1 implies that most individuals are admixed [default FALSE]. |
alpha |
Dirichlet parameter for degree of admixture. This is the initial value if inferalpha = TRUE [default 1]. |
unifprioralpha |
Logical. Assume a uniform prior for alpha which runs between 0 and alphamax. This model seems to work fine; the alternative model (when unfprioralpha = 0) is to take alpha as having a Gamma prior, with mean alphapriora × alphapriorb, and variance alphapriora × alphapriorb^2 [default TRUE]. |
alphamax |
Maximum for uniform prior on alpha when unifprioralpha = TRUE [default 20]. |
alphapriora |
Parameters of Gamma prior on alpha when unifprioralpha = FALSE [default 0.05]. |
alphapriorb |
Parameters of Gamma prior on alpha when unifprioralpha = FALSE [default 0.001]. |
Value
structureRun
a list where each element is a list with results from
structureRead
and a vector of the filenames usedstructureWrite
a vector of the filenames used by STRUCTURE
structureRead
a list containing:
summary
new locus name, which is a combination of loci in group
q.mat
data.frame of assignment probabilities for each id
prior.anc
list of prior ancestry estimates for each individual where population priors were used
files
vector of input and output files used by STRUCTURE
label
label for the run
Author(s)
Bernd Gruber (bugs? Post to https://groups.google.com/d/forum/dartr); original implementation of Eric Archer https://github.com/EricArcher/strataG