Learn R Programming

KinMixLite (version 2.2.1)

KinMix: Create a DNA mixture model, with possibly related contributors

Description

Create a DNA mixture model, with possibly related contributors.

Usage

KinMix(data,k,C,database,K=character(0),reference.profiles = NULL, 
	contribs=NULL,typed.gts=NULL,IBD=NULL,targets=NULL,pars=NULL,mle=FALSE,
	dir=character(0),domainnamelist=NULL,
	load=FALSE,write=FALSE,dyes=NULL, 
	triangulate=TRUE,compile=TRUE,compress=TRUE,use.order=TRUE)

Value

An object of class DNAmixture. This contains amongst other things

markers

The joint set of markers used for the mixtures specified.

domains

For models involving unknown contributors, a list containing one Bayesian network (hugin.domain) per marker; see buildMixtureDomains for details on the networks

data

A list containing for each marker the combined allele frequencies, peak heights, and reference profiles as produced by DNAmixtureData.

It may also contain

mle

Maximum likelihood estimates of the peak height model parameters

logL

log-likelihood of model evaluated at pars

Arguments

data

A list containing one data.frame for each DNA mixture. Note, that in the special case of analysing just one mixture, this still has to be specified as list(data). Each dataset should contain variables marker, allele, and frequency. Optionally, also a column for each reference profile specified in K.

k

Number of contributors.

C

A list of thresholds, one for each mixture.

database

A data.frame containing at least variables marker, allele, frequency.

K

Names of reference profiles; these can be chosen freely, but should match (possibly only a subset of) the names specified by the reference profiles.

reference.profiles

A data.frame containing allele counts for each reference profile, if not specified in data.

contribs

vector of character tags identifying contributors to the mixture

typed.gts

list of named genotype profiles

IBD

IBD pattern distribution, or any object accepted as an argument to as.IBD

targets

vector of character tags identifying individuals related according to IBD

pars

optionally, a mixpar object providing parameter values for peak height model

mle

logical: should mixML be called to estimate parameters by MLE?

dir

Location of network files if loading or saving the networks.

domainnamelist

Names of marker-wise network files (without hkb-extension). Default is the set of markers.

load

Read networks from disk?

write

Save networks as hkb files?

dyes

A list containing a list of dyes indexed by markers

triangulate

Triangulate the networks? Default is to triangulate the network using a good elimination order.

compile

Compile the networks?

compress

Compress the network? Defaults to TRUE and is strongly recommended for models with a large number of contributors.

use.order

Should the default elimination order be used for triangulation? Otherwise the "total.weight" heuristic for triangulation in Hugin is used.

Details

Generalises DNAmixture to allow relatedness as in rpt.IBD

See Also

[DNAmixturesLite]{DNAmixture}

Examples

Run this code
data(test2data)

## Fit 2-person mixture - baseline model

mixD<-DNAmixture(list(epg),k=2,C=list(0.001),database=db)
pars<-mixpar(rho=list(2),eta=list(100),xi=list(0.1),phi=list(c(U1=0.7,U2=0.3)))
baseline<-logL(mixD)(pars)
baseline

mixD<-DNAmixture(list(epg),k=2,C=list(0.001),database=db)
pars<-mixpar(rho=list(2),eta=list(100),xi=list(0.1),phi=list(c(U1=0.7,U2=0.3)))
mlD <- mixML(mixD, pars)
print(mlD$mle)
pars<-mlD$mle

baseline<-logL(mixD)(pars)
baseline

## Fit 2-person mixture model in which contributor 1 is parent of a typed individual Cgt

mixD<-KinMix(list(epg),k=2,C=list(0.001),database=db,
	contribs=c('F'),typed.gts=list(C=Cgt),IBD='parent-child',targets=c('F','C'),
	pars=pars)
log10LR<-(mixD$logL-baseline)/log(10)
cat('log10 LR',log10LR,'\n')

## Fit 2-person mixture model in which contributor 1 is father of a typed individual Cgt 
## with mother Mgt

mixD<-KinMix(list(epg),k=2,C=list(0.001),database=db,
	contribs=c('F'),typed.gts=list(M=Mgt,C=Cgt),IBD='trio',targets=c('F','M','C'),
	pars=pars)
log10LR<-(mixD$logL-baseline)/log(10)
cat('log10 LR',log10LR,'\n')

Run the code above in your browser using DataLab