Population Genetics

Classes and methods for handling genetic data. Includes classes to represent genotypes and haplotypes at single markers up to multiple markers on multiple chromosomes. Function include allele frequencies, flagging homo/heterozygotes, flagging carriers of certain alleles, estimating and testing for Hardy-Weinberg disequilibrium, estimating and testing for linkage disequilibrium, ...


genetics 1.3.8 - 2012-12-14

Bug fixes:

  • Regenerate broken PDF files in inst/doc.

genetics 1.3.7 - 2012-09-14


  • Improve descripiton of last examples in manual page for HWE.test().

Other Changes:

  • Correct warnings issued by recent versions of R CMD CHECK.

genetics 1.3.6 - 2011-02-01

  • Add missing 'locus<-', 'gene<-', and 'marker<-' functions to NAMESPACE file.

  • Update Greg's email address to [email protected]

genetics 1.3.5 - 2011-01-17

  • Fix warning messages from R CMD check

genetics 1.3.4 - 2008-08-20

  • Fix bug in makeGenotypes that caused it to ignore the 'sep' argument when determining which columns contain genotypes & add a corresponing regression test

genetics 1.3.3 - 2007-04-29

  • Correct 'obsolete' use of '$'. R no longer permits '$' to be used to extract named elements from vectors (just lists).

  • Remove the power.casectl() function, which was based on invalid assumpations. It has been marked depreciated. Please use the functions in the Bioconductor package 'GeneticsDesign' instead.

genetics 1.3.2 - 2007-11-20

  • Fix bug in handling of assignment of NA value(s) to elements of an existing genotype object.

  • Fix warning messages from R CMD CHECK

  • Correct documentation error by swapping definitions of kp and alpha arguments of power.casectl().

genetics 1.3.1

  • fixes in genotypeOrder to ensure all genotype/haplotype combinations are used.

  • genotypeOrder<- is now exported

genetics 1.3.0

  • A note is now displayed on startup:

    The R-Genetics project has developed an set of enhanced genetics packages that will shortly replace 'genetics'. Please visit the project homepage at http://rgenetics.org for more information.

  • binsearch() has been moved to the gtools package

  • New function groupGenotype to create groups/levels based on genotype names

  • Added some internal utility functions (.genotype2Haplotype, .genotype2Allele, and .matchGenotype)

  • Genotype class gets additional slot genotypeOrder (and genotype() function gets additional argument with the same name) in order to enable predefined order of genotypes in other functions e.g. summary

  • Added order, sort and %in% methods for genotype and haplotype classes.

  • Fixed genotype() with allow.partial.missing=FALSE when 'alleles' argument is passed

  • There is no more warning in genotype() if 'a1' or 'a2' have NA value(s) and 'alleles'' argument is specified, since NA is NA anyway

  • Fixed documentation of power.casectrl()

  • added gtools to Depends as needed by expectedGenotypes(); the latter now gives sorted genotypes according to order of given alleles

  • print.HWE.test() wasn't displaying the observed vs expected genotype frequency table. Fixed.

genetics 1.2.1

  • Update Greg's email address

  • Fixed a bug in function allele.number, as pointed out by Chris Wallace

genetics 1.2.0

  • Add R^2 to HWE and LD estimates

  • Correct bug in denominator of Heterozygosity calculation, as identified by Christopher Calrson

  • Fix handling of the 'type' and 'what' arguments for plot.genotype()

  • Misc bug fixes in package imports/dependencies/etc.

  • Add expectedGenotypes() and plot.genotypes() contributed by Gregor GORJANC

  • Fix bug in heterozygote when more than one allele.name is provided

  • Return NA and issue a warning if diseq() called on a marker with only one observed allele.

genetics 1.1.2

  • Remove debugging code that printed intermediate values (sometimes a lot of them).

  • Ensure that allele.freq table reported by summary.genotype has the same ordering as allele.names table.

genetics 1.1.1

  • Make it clear that the Yates continuty correction is applied only when simulate.p.value=FALSE, so that the reported test statistics for simulate.p.value=FALSE and simulate.p.value=TRUE will differ.

  • Attempt to fix/clarify HWE diseq. computations & synchronize documentation.

  • Updated to use a namespace and to work with the lastest gregmisc bundle, which was previously a package.

genetics 1.1.0

  • Add namespace support

  • R/diseq.R: Restore ability to show Observed vs. Expected table by adding "table" option for the 'show' parameter.

  • Updates to power.casectrl. (including renaming from power.casectl)

  • Update to work with gregmisc now that it has been converted from a package to a bundle.

genetics 1.0.4

  • Updated to remove warnings in R CMD check for R 1.9.1.

genetics 1.0.2

  • Fixed Heterozygosity (H) and PIC calculations in summary.genotype. (Bug report from Gerard Tromp [email protected].

  • Added experimental, undocumented, and untested function hapmcmc for imputing haplotypes and related functions. (Code submitted by David Duffy [email protected]).

genetics 1.0.1

  • Fixed mislabeling of rows/columns in LDtable

  • Extended LDtable to resize text to fit box area, and to allow selection of which statistics are displayed, and which statistic is used for coloration.

  • Extended LDtable to allow all columns & rows to be shown

  • Added a larger example to plot.LD.data.frame documentation

  • Changed the name of some function parameters to be more clear and/or consistent

  • Added summary.LD.data.frame and print.LD.data.frame

  • Fixed a bug in genotype() when reorder="no", such as when called by haplotype().

genetics 1.0.0

  • New functions to estimate and test linkage disequilibrium (LD): LD, LD.genotype, LD.data.frame

  • New functions to display LD results print.LD, print.LD.data.frame, plot.LD.data.frame, LDtable, LDplot

  • Various bug-fixes and corrections

genetics 0.6.8

  • Added HWE.chisq which performs the Chi-Square test for Hardy-Wienberg Equilibrium.

  • Modified HWE.exact to return an object of class 'htest'.

  • Modified HWE.test to use HWE.exact by default for 2-allele genotypes, and HWE.chisq otherwise.

genetics 0.6.7

  • Added 'HWE.exact()', an exact test for Hardy-Wienberg Equilibrium for two alleles. Code contributed by David Duffy [email protected]

  • Added 'gregorius()', which computes the probability of observing all alleles with a given frequency in a sample of a specified size.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("genetics") by Gregory Warnes, a year ago

Browse source code at https://github.com/cran/genetics

Authors: Gregory Warnes , with contributions from Gregor Gorjanc , Friedrich Leisch , and Michael Man.

Documentation:   PDF Manual  

Task views: Statistical Genetics

GPL license

Depends on combinat, gdata, gtools, MASS, mvtnorm

Imported by LDheatmap, PopGenReport, snp.plotter.

Depended on by MasterBayes, forensic, introgress, luca.

Suggested by gap.

See at CRAN