hapsampler: Haplotype Sampler

Description Usage Arguments Details Value Examples

Description

Marker-QTL haplotypes are sampled, and their probabilities calculated via MCMC methods.

Usage

1
2
hapsampler(data = NULL, trait = NULL, nchains = 3, runlength = 30,
  probthresh = 0.95)

Arguments

data

a data frame object generated by running read_data.

trait

the column name in the data file of the trait. This must be specified.

nchains

the number of parallel chains to be run.

runlength

the run length of each chain

probthresh

a probability theshold value. Data on animals whose haplotype probability is less than probthresh will be ignored.

Details

This function implements a MCMC algorithm for sampling the space of marker-QTL genotypes, conditional on the observed marker haplotypes for each animal, the trait values, and a penetrance function (i.e. the probability of the trait given the putative QTL alleles).

To guard against convergence issues, parallel chains are run by setting the argument nchains to some integer value greater than 1. runlength is the run length of a chain.

There are several plotting functions (such as plotLike, plotEffects, and plotScatter) available for viewing the results.

Value

A list like object of class HS is returned with elements

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
    complete.name <- system.file("extdata", "dataexample.dat", package="HapSampler")
    # read in phenotypic data which is space separated
    dt <- read_data(path=dirname(complete.name),
                                 file=basename(complete.name))
    
    #  perform analysis for the NAVEL trait
    hapres <- hapsampler(data=dt, trait="NAVEL", nchains=2, runlength=5)
    
    # a plot of the log likelihood for each chain against run length
    plotLike(hapres)

geo047/HapSampler documentation built on May 17, 2019, 1:11 a.m.