SimulationStudy {FEST}R Documentation

Simulation study of family relationships

Description

Assume a given set of true and alternative family relationships. Use simulations and exact likelihood computations to compute likelihood and posterior values. These computations are done for different number of markers.

Usage

SimulationStudy(models, chr=c(1:22), nmarker = c(22 * c(1, 10, 100,
1000), 5e+05), nsim = c(1000, 1000, 1000, 1000, 400), maf = numeric(),
frequencyData = NULL, freqThreshold = c(rep(0.1, 4), 0),
saveMerlinFiles=FALSE, verbose=TRUE)

Arguments

models Object of type Model that specifies true and alternative family relations.
chr Either a vector or a list. If chr is a vector it contains the chromosomes included in the simulation study. If it is list it should have same length as the nmarker vector. Each element of the list is a vector containing chromosomes included in the simulation study.
nmarker Vector of number of markers. A simulation study is done for each number of markers.
nsim Number of simulations. A vector with same length as the nmarker vector.
maf Minor allele frequency. Same for all SNPs, must be specified if frequencyData is not specified.
frequencyData A list with frequency information for each chromosome. See affy for a description of the format.
freqThreshold Selects a sub set of the SNPs in frequencyData: only SNPs with minor allele frequency > freqThreshold are retained. Vector with same length as the nmarker vector.
saveMerlinFiles If TRUE the files used as input to the likelihood computations in merlin are saved. Default value is FALSE.
verbose If TRUE, information about simulations are output to screen. Default TRUE.

Value

An object of type SimStudyObject-class.

Author(s)

Øivind Skare oivind.skare@medisin.uio.no

References

http://folk.uio.no/thoree/FEST

Øivind Skare, Nuala Sheehan, and Thore Egeland Identification of distant family relationships Bioinformatics Advance Access published on July 6, 2009.

See Also

SetModels

Examples

  set.seed(17)
  models <- SetModels(trueModels=paste("HS-", 1:6, sep=""),
                      altModels=c("true", "unrelated"))
  nsim <- rep(10, 2)
  nmarker <- 22*c(1, 10)
  chr <- c(1:22)
  simObj1 <- SimulationStudy(models, chr=chr, nmarker=nmarker, nsim=nsim, maf=0.5)
  stat1 <- ComputeSummaryStatistics(simObj1)
  ## Average posterior results for no of markers=22:
  print(round(stat1$posterior[1,,],4)) # rows: true models, columns: alternative models
###        HS-1   HS-2   HS-3   HS-4   HS-5 HS-6 unrelated
### HS-1 0.5284     NA     NA     NA     NA   NA    0.4716
### HS-2     NA 0.4821     NA     NA     NA   NA    0.5179
### HS-3     NA     NA 0.4945     NA     NA   NA    0.5055
### HS-4     NA     NA     NA 0.5004     NA   NA    0.4996
### HS-5     NA     NA     NA     NA 0.5001   NA    0.4999
### HS-6     NA     NA     NA     NA     NA  0.5    0.5000
  ## No of markers=220:
  print(round(stat1$posterior[2,,],4))

  ## Simulation study using Affymetrix frequency data
  ## The complete 500K data file may be downloaded from
  ## 'http://folk.uio.no/thoree/FEST/affy.RData'
  ## load("affy.RData")

  ## A small subset of the Affymetrix frequency data. 100 markers on
  ## each chromsome
  data(affy.subset)
  simObj2 <- SimulationStudy(models, chr=chr, nmarker=nmarker, nsim=nsim,
                             frequencyData=affy.subset, freqThreshold=c(0.1,0.1))
  stat2 <- ComputeSummaryStatistics(simObj2)
  ## Average posterior results (Affymetrix):
  ## No of markers=22:
  print(round(stat1$posterior[1,,],4)) # rows: true models, columns: alternative models
  ## No of markers=220:
  print(round(stat1$posterior[2,,],4))

[Package FEST version 0.06 Index]