structure | R Documentation |
Run STRUCTURE to assess group membership of samples.
structureRun(
g,
k.range = NULL,
num.k.rep = 1,
label = NULL,
delete.files = TRUE,
exec = "structure",
...
)
structureWrite(
g,
label = NULL,
maxpops = getNumStrata(g),
burnin = 1000,
numreps = 1000,
noadmix = TRUE,
freqscorr = FALSE,
randomize = TRUE,
seed = 0,
pop.prior = NULL,
locpriorinit = 1,
maxlocprior = 20,
gensback = 2,
migrprior = 0.05,
pfrompopflagonly = TRUE,
popflag = NULL,
inferalpha = FALSE,
alpha = 1,
unifprioralpha = TRUE,
alphamax = 20,
alphapriora = 0.05,
alphapriorb = 0.001,
...
)
structureRead(file, pops = NULL)
g |
a gtypes object. |
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". |
... |
arguments to be passed to |
maxpops |
number of groups. |
burnin |
number of iterations for MCMC burnin. |
numreps |
number of MCMC replicates. |
noadmix |
logical. No admixture? |
freqscorr |
logical. Correlated frequencies? |
randomize |
randomize. |
seed |
set random seed. |
pop.prior |
a character specifying which population prior model to use: "locprior" or "usepopinfo". |
locpriorinit |
parameterizes locprior parameter r - how
informative the populations are. Only used when |
maxlocprior |
specifies range of locprior parameter r. Only used
when |
gensback |
integer defining the number of generations back to test for
immigrant ancestry. Only used when |
migrprior |
numeric between 0 and 1 listing migration prior. Only used
when |
pfrompopflagonly |
logical. update allele frequencies from individuals
specified by |
popflag |
a vector of integers (0, 1) or logicals identifiying whether
or not to use strata information. Only used when |
inferalpha |
logical. Infer the value of the model parameter # from the
data; otherwise is fixed at the value |
alpha |
Dirichlet parameter for degree of admixture. This is the initial
value if |
unifprioralpha |
logical. Assume a uniform prior for |
alphamax |
maximum for uniform prior on |
alphapriora , alphapriorb |
parameters of Gamma prior on |
file |
name of the output file from STRUCTURE. |
pops |
vector of population labels to be used in place of numbers in STRUCTURE file. |
structureRun
a list where each element is a
list with results from structureRead
and a vector of the filenames
used
structureWrite
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
STRUCTURE is not included with strataG
and must be downloaded
separately. Additionally, it must be installed such that it can be run from
the command line in the current working directory. See the vignette for
external.programs
for installation instructions.
Eric Archer eric.archer@noaa.gov
Pritchard, J.K., M. Stephens, P. Donnelly. 2000. Inference of
population structure using multilocus genotype data. Genetics
155:945-959.
http://web.stanford.edu/group/pritchardlab/structure.html
structurePlot
, evanno
,
clumpp
## Not run:
data(msats.g)
# Run STRUCTURE
sr <- structureRun(msats.g, k.range = 1:4, num.k.rep = 10)
# Calculate Evanno metrics
evno <- evanno(sr)
evno
# Run CLUMPP to combine runs for K = 2
q.mat <- clumpp(sr, k = 3)
q.mat
# Plot CLUMPP results
structurePlot(q.mat)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.