R package FEST.

 

Updated Friday, 14 August 2009

 

The software FEST is an R package for simulations and likelihood calculations of pair-wise family relationships using DNA marker data. The R-library FEST (version FEST_0.06.zip) may be downloaded here or from the official R site: http://www.r-project.org/

    There is a separate ‘Getting started manual’ (Welander, Skare and Egeland, 2009) and some example files and a file with commands. The package accompanies the paper “Identification of distant family relationships”, Skare, Sheehan and Egeland, Bioinformatics Advance Access published July 6, 2009 and is coded by Řivind Skare oivind.skare@medisin.uio.no. 

Affymetrix data used for some of the examples are available here.

 

FEST requires the following freeware to be installed and path variables to be set:

 

When you load FEST into R the first time you may be prompted to install other R-packages (like kinship).

 

This note supplements the mentioned paper and documentation by providing a detailed example. The examples also serve to check FEST.

 

Example T1:  This example is based on Donnelly (1983) and involves two pedigrees which cannot be distinguished using any amount of linked autosomal markers. We include this example to check that likelihoods and also the posteriors (based on flat priors) coincide.

 

Below follows some R-code, ## indicates start of a comment.

 

First, the function PlotPedigree is used to plot the two pedigrees. Two persons, A and B, are typed. Pedigree 1 corresponds to the case where A and B are third cousins. The first relation is denoted “S-4” in FEST (see documentation of the FEST function SetModels)  and the second relation is “Second cousins twice removed” and this is denoted S-5-3. Figure 1 shows the pedigrees and is produced by the below commands

 

par(mfcol=c(1,2))
PlotPedigree("S-4")
title("Third cousins (S-4)",cex.main=0.9)
PlotPedigree("S-5-3")
title("Second cousins twice removed (S-5-3)",cex.main=0.9)
 

The  below commands calculate the log likelihoods (Table T1) and posterior (Table 2). The likelihoods concide and the posteriors are 0.5 as they should

 
set.seed(17)
nsim <- 5
nmarker <- 100
nchr <- 1
n <- length(nmarker) ##1
modeller<-c("S-4","S-5-3")
models <- SetModels(trueModels=modeller, altModels=modeller)
simObj1 <- SimulationStudy(models, chr=nchr, nmarker=nmarker, nsim=nsim, maf=0.5)
 
stat <- ComputeSummaryStatistics(simObj1)
S.4=stat$posterior[1,1,] ##simulated from S-4
S.5.3=stat$posterior[1,2,] ##simulated from S-5-3
res=rbind(S.4,S.5.3)
row.names(res)=c("S.4","S.5.3")
colnames(res)=c("S.4","S.5.3")
sibling.4=stat$posterior[1,1,] ##simulated from S.3
sibling.5.3=stat$posterior[1,2,] ##simulated from S.4.2
res=rbind(S.4,S.5.3)
row.names(res)=c("S.4","S.5.3")
colnames(res)=c("S.4","S.5.3")
loglik=simObj1@logLik[[1]][[1]]
row.names(loglik)=c("S.4","S.5.3")
colnames(loglik)=paste("Sim:",1:nsim)
loglik
##Results are now contained in res and loglik and displayed in tables below
 
 

 

 

Figure 1 The relation to the  left  is denoted “S-4” in FEST (see documentation of the FEST function SetModels)  and the one to the right relation is “Second cousins twice removed” and this denoted “S-5-3”.

 

 

 

 

Table 1 The posteriors are 0.5 as they should be.

 

 

True relation

Simulations

 

Sim: 1

Sim: 2

Sim: 3

Sim: 4

Sim: 5

S-4

-204.539

-204.355

-214.294

-212.137

-207.973

S-5-3

-204.539

-204.355

-214.294

-212.137

-207.973

 

Table 2 For a specific simulation  the log likelihoods coincide as they should.