Learn R Programming

PopGenReport (version 0.96)

popgenreport: This is the main function of the package. It analyses an object of class genind and then creates a report containing the results of the analysis. There are several routines that can be optionally included in the analysis and there are multip output options including a PDF with the report, R-code and an object (allresults) containing all of the results, which can be used for further analyses.

Description

This function is used to analyse population genetic data. The main idea is to provide a framework for analysing microsatellite genetic data using a mix of existing and new functions. The function works on an object of class genind. There are several ways to convert data into a genind object using existing functions provided by the adegenet package ( import2genind, df2genind,read.fstat, read.structure, read.genetix ,read.genepop) or refer to read.genetable how to import data from an EXCEL (csv) document. The function performs a number of different genetic analyses (e.g. counts of indivuals and alleles across sub-populations, tests for heterozygosity and Hardy-Weinberg Equilibrium, differentiation statistics Fst, G'st, Jost's D, and genetic distance between individuals and populations), with users having the option to select which analysis routines are included in the report. To select a routine, the user simply turns on a switch e.g. mk.map=TRUE returns a map with the sampling location for each individual (if coordinates (latitudes and longitudes in WGS1984) are provided).

Usage

popgenreport(cats = NULL, mk.counts = T, mk.map=F, maptype="satellite", 
mapdotcolor ="blue", mapdotsize=1, mapdotalpha=0.4, mapdottype=19 , 
mk.locihz = F, mk.hwe = F, mk.subgroups = NULL, mk.fst = F, mk.gd.smouse = F, 
mk.gd.kosman = F, mk.allele.dist = F, mk.differ.stats=F, 
fname = "PopGenReport", path.pgr=NULL, mk.Rcode = F, mk.complete=F, mk.pdf=T)

Arguments

Value

The function returns an object that has all of the results produced by this function in it. The structure of the object can be accessed via str(allresults). The main slots in this object (if you ran a full report) are: dataoverview,PopHet,Alleledist,Fst,HsHtdifferentiate,HWEresults,subgroups,GDKosman,GDSmouse Additional ouput is provided in the form of a PDF which will be saved to your current working directory, and maps and figures which will be placed in a figures subfolder which may be generated automatically in your current working directory. If mk.Rcode=T is set, an R file named yourgeninobject.R will be saved to your current working directory.

References

Kosman E., Leonard K.J. 2005. Similarity coefficients for molecular markers in studies of genetic relationships between individuals for haploid, diploid, and polyploidy species. Molecular Ecology 14:415-424 Peakall R., Smouse P. 2012. GenAlEx 6.5: Genetic analysis in Excel. Population genetic software for teaching and research - an update. Bioinformatics 28:2537-2539

See Also

adegenet, pegas, mmod

Examples

Run this code
data(bilby)
popgenreport(bilby[1:100], mk.counts=TRUE, mk.map=TRUE, mk.pdf=FALSE)

### RUN ONLY with a working Latex version installed, see mk.pdf
#popgenreport(bilby, mk.counts=TRUE, mk.map=TRUE, mk.pdf=TRUE)

# for a full report in a single pdf set mk.complete to TRUE
# popgenreport(bilby, mk.complete=TRUE)

Run the code above in your browser using DataLab