Learn R Programming

poppr (version 1.0.1)

poppr: Produce a basic summary table for population genetic analyses.

Description

This function allows the user to quickly view indecies of distance, heterozygosity, and inbreeding to aid in the decision of a path to further analyze a specified dataset. It natively takes genind formatted files, but can convert any raw data formats that adegenet can take (fstat, structure, gentix, and genpop) as well as genalex files exported into a csv format (see read.genalex for details).

Usage

poppr(pop, total = TRUE, sublist = c("ALL"),
    blacklist = c(NULL), sample = 0, method = 1,
    missing = "ignore", cutoff = 0.05, quiet = "minimal",
    clonecorrect = FALSE, hier = c(1),
    dfname = "population_hierarchy", keep = 1, hist = TRUE,
    minsamp = 10)

Arguments

pop
a genind object OR any fstat, structure, gentix, genpop, or genalex formatted file.
total
default TRUE. Should indecies be calculated for the combined populations represented in the entire file?
sublist
a list of character strings or integers to indicate specific population names (located in $pop.names within the genind object) Defaults to "ALL".
blacklist
a list of character strings or integers to indicate specific populations to be removed from analysis. Defaults to NULL.
sample
an integer indicating the number of permutations desired to obtain p-values. Sampling will shuffle genotypes at each locus to simulate a panmictic population using the observed genotypes. Calculating the p-value includes the observed statistics, s
method
an integer from 1 to 4 indicating the method of sampling desired. see popsample for details.
missing
how should missing data be treated? "zero" and "mean" will set the missing values to those documented in na.replace. "loci" and "geno" will remov
cutoff
numeric a number from 0 to 1 indicating the percent missing data allowed for analysis. This is to be used in conjunction with the flag missing (see missingno for details)
quiet
Should the function print anything to the screen while it is performing calculations? TRUE prints nothing, "minimal" (defualt) will print the population name and dots indicating permutation progress, FALSE wi
clonecorrect
default FALSE. must be used with the hier and dfname parameters, or the user will potentially get undesiered results. see clonecorrect for details.
hier
a numeric or character list. This is the list of vectors within a data frame (specified in dfname) in the 'other' slot of the genind object. The list should indicate the pop
dfname
a character string. This is the name of the data frame or list containing the vectors of the population hierarchy within the other slot of the genind object.
keep
an integer. This indicates the levels of the population hierarchy you wish to keep after clone correcting your data sets. To combine the hierarchy, just set keep from 1 to the length of your hierarchy. see
hist
logical if TRUE a histogram will be produced for each population.
minsamp
an integer indicating the minimum number of individuals to resample for rarefaction analysis.

Value

  • PopA vector indicating the pouplation factor
  • NAn integer vector indicating the number of individuals/isolates in the specified population.
  • MLGAn integer vector indicating the number of multilocus genotypes found in the specified poupulation, (see: mlg)
  • eMLGThe expected number of MLG at the lowest common sample size (set by the parameter minsamp.
  • SEThe standard error for the rarefaction analysis
  • HShannon-Weiner Diversity index
  • GStoddard and Taylor's Index
  • HexpExpected heterozygosity or Nei's 1987 genotypic diversity corrected for sample size.
  • E.5Evenness
  • IaA numeric vector giving the value of the Index of Association for each population factor, (see ia).
  • p.IaA numeric vector indicating the p-value for Ia from the number of reshufflings indicated in sample. Lowest value is 1/n where n is the number of observed values.
  • rbarDA numeric vector giving the value of the Standardized Index of Association for each population factor, (see ia).
  • p.rDA numeric vector indicating the p-value for rbarD from the number of reshufflings indicated in sample. Lowest value is 1/n where n is the number of observed values.
  • FileA vector indicating the name of the original data file.

See Also

clonecorrect, poppr.all, ia, missingno, mlg

Examples

Run this code
data(nancycats)
poppr(nancycats)

poppr(nancycats, sample=99, total=FALSE, quiet=FALSE)

# Note: this is a larger data set that could take a couple of minutes to run
# on slower computers.
data(H3N2)
poppr(H3N2, total=FALSE, sublist=c("Austria", "China", "USA"),
				clonecorrect=TRUE, hier="country", dfname="x")

Run the code above in your browser using DataLab