Description Usage Arguments Details Value Examples
Marker-QTL haplotypes are sampled, and their probabilities calculated via MCMC methods.
1 2 | hapsampler(data = NULL, trait = NULL, nchains = 3, runlength = 30,
probthresh = 0.95)
|
data |
a data frame object generated by running |
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 |
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.
A list like object of class HS is returned with elements
trait: the trait name
nchains: the number of chains
canonical.hap: this is the haplotype that is the most common in the input data.
haplotypes: a data.frame object containing
Haplotype: the haplotype index
Count: the frequency of the haplotype in the input data file after data on those animals with a haplotype probability less than
probthresh
have been removed.
MeanProb(Q): the probability of this haplotype carrying the Q qtl allele, averaged over the mean of the Q allele probabilities from each chain
Prob(Q):Chain1: the mean probability of this haplotype carrying the Q qtl allele, for chain 1. This field is repeated for each chain that is run.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.