Statistical analysis of DNA mixtures with artefacts

by Therese Graversen

Installing DNAmixtures

Once the dependencies are installed (see below), the most recent version of DNAmixtures can be installed by

install.packages("DNAmixtures", repos = "http://dnamixtures.r-forge.r-project.org/",
type = "source", INSTALL_opts = "--no-multiarch")

Note that older versions of DNAmixtures are still available for download from Rforge.

Getting started

The package help page contains the most essential information as well as an example analysis.

library(DNAmixtures) ## load the package
help(DNAmixtures) ## main help page

The initial part of the example -- involving only known contributors -- can be run with the trial version of Hugin, whereas the second part substituting known contributor for an unknown contributor requires a full licenced version of Hugin.

Installing Dependencies

Hugin: Efficient computations in Bayesian networks

When a hypothesis includes any unknown contributors, there is a need for summation over a large number of possible allocations of genotypes. Our implementation relies on the Hugin software for performing such computations.

Which license do I need?

The package has been developed under a Hugin Researcher license and relies on the Hugin C API.

DNAmixtures may be installed with the free version of Hugin, HuginLite, though due to a limitation in the size of networks allowed by the free version, in practice this will restrict the functionality in DNAmixtures to mixtures with no unknown contributors.

The package should also be compatible with e.g. Hugin Developer, which provides the full Hugin C API with no limitations in network size, though this has not been tested.

Hugin is solely used for performing computations on the Bayesian networks created by DNAmixtures and, in principle, another engine could be used in place of Hugin; however, this is currently not supported.

The RHugin package: an API for working with Hugin in R

DNAmixtures calls Hugin through the API provided in the RHugin package, meaning that the user can easily manipulate the Bayesian networks directly from R. RHugin depends on packages graph and Rgraphviz that can be installed by

biocLite(c("graph", "Rgraphviz"))

Installation under Windows

Download and install RTools. Accept all the defaults, in particular that Cygwin dlls are installed and that the PATH variable is changed.

Now open R (or RStudio) and do the following:

Set the variable HUGINHOME to point to the location of Hugin, changing the file path to match the specific location and version on your system. If you run 64-bit R, then you should use the 64-bit Hugin.

Sys.setenv(HUGINHOME = "C:/Program Files/Hugin Expert/Hugin Dist 8.3 (x64)") ## 64 bit
## Sys.setenv(HUGINHOME = "C:/Program Files (x86)/Hugin Expert/Hugin Dist 8.3") ## 32 bit

Install RHugin


You can check whether R is 64 or 32 bit by


Here "x86_64" means 64 bit and "i386" means 32 bit.

Installation on Linux and Mac OS X

See the RHugin package homepage on how to install RHugin and its dependencies.

Installing other dependencies in R

DNAmixtures depends on R packages Rsolnp, Matrix, and numDeriv. Usually these are automatically installed, but otherwise they can be obtained by

install.packages(c("Rsolnp","Matrix", "numDeriv"))