qb.mcmc {qtlbim} | R Documentation |
A computationally efficient MCMC algorithm using the Gibbs sampler or Metropolis-Hastings algorithm is used to produce posterior samples for QTL mapping.
qb.mcmc(cross, data, model, mydir = ".", n.iter = 3000, n.thin = 20, n.burnin = 0.01*n.iter*n.thin, genoupdate = TRUE, seed = 0, verbose = TRUE, ...)
cross |
An object of class cross . See read.cross for details. |
data |
List returned by calling the function qb.data . |
model |
List returned by calling the function qb.model . |
mydir |
A directory to save output from qb.mcmc in several ‘*.dat’ files.
A directory is created using the trait name and the system time and date.
If no directory is specified, the default directory is the current working
directory. |
n.iter |
number of iterations to be saved in mydir , the default being
3000. Note that, n.iter is not the total number of iterations performed but the number iterations saved or considered as posterior
samples for future analysis. The actual number of iterations would be n.burnin + n.iter*n.thin
|
n.thin |
the thinning number which must be a positive number (default=40) |
n.burnin |
the initial burn-in period, i.e number of iterations to discard at the beginning of the MCMC run default being 0.01*n.iter*n.thin. |
genoupdate |
=TRUE will update QTL genotypes and =FALSE will not do so and use the expected value of the QTL genotypes. |
seed |
Specifies the seed for the random number generator. Using the same seed
for two runs of the qb.mcmc function will generate the exact same
output. The seed needs to be an integer. The default value for seed
is the system time. |
verbose |
=TRUE will force periodic output of the number of MCMC iterations saved. The location of the output directory where results are stored and the time taken for the MCMC run will also be displayed to the user. |
... |
Paramters passed to qb.data or
qb.model if data or model , respectively,
is not provided. |
A composite model space approach to develop a Bayesian model selection framework for identifying interacting QTL for complex traits in experimental crosses from two inbred lines. By placing a liberal constraint on the upper bound of the number of detectable QTL we restrict attention to models of fixed dimension. Either Gibbs sampler or Metroplis-Hastings algorithm can be applied to sample from the posterior distribution.
The following data frames in the mcmc.samples
element of the
qb
object contain the MCMC samples. They are used by many other
routines.
The iterations data frame iterdiag
has n.iter
rows and
5 major columns:
niter
= iteration number;
nqtl
= number of putative QTLs included;
mean
= overall mean;
envvar
= residual variance;
var
= total genetic variance.
Depending on the type of cross, presence of covariates and epistatic
effects there would be more columns in the following order:
varadd
= variance of all additive effects;
vardom
= variance of all dominant effects;
varaa
= variance of all additive-additive interactions;
varad
= variance of all additive-dominant interactions;
varda
= variance of all dominant-additive interactions;
vardd
= variance of all dominant-dominant interactions.
Values for variance of environment-additive interaction,
variance of environment-dominant interaction, and variance of
environment effect have names that encode the covariate.
Covariates are in data frame covariates
, with n.iter
rows and
L+M(length(fixcov)+length(rancov)
) columns:
L columns
: Coefficient of the fixed effect.
M columns
: Variance of the random effect.
If an ordinal trait is analyzed, the cutoff points for the threshold
model are also included in additional columns. There would be C-3
bounded threshold values for an ordinal phenotype with C categories.
The mainloci data frame has N rows (N=sum of number of QTLs
detected in n.iter
iterations) and 6-8 columns:
niter
= iteration number;
nqtl
= number of putative QTLs included;
chrom
= chromosome number;
locus
= locus in cM;
add
= additive effect;
dom
= dominance effect (if included);
varadd
= variance of additive effect;
vardom
= variance of dominant effect (if included).
The pairloci data frame has N rows (N=sum of number
of pairs of QTLs with epistatic effect detected) and 8-14 columns:
niter
= iteration number;
n.epis
= number of epistatic pairs included;
chrom1
= first chromosome number;
locus1
= first locus in cM;
chrom2
= second chromosome number;
locus2
= second locus in cM;
aa
= additive-additive effect;
ad
= additive-dominant effect (if included);
da
= dominant-additive effect (if included);
dd
= dominant-dominant effect (if included);
varaa
= variance of additive-additive interaction;
varad
= variance of additive-dominant interaction (if included);
varda
= variance of dominant-additive interaction (if included);
vardd
= variance of dominant-dominant interaction (if included).
The gbye (Gene by Environment) data frame has 7-9 columns:
niter
= iteration number;
n.gbye
= number of GxE terms included;
covar
= fixed covariate identifier;
chrom
= chromosome number;
locus
= locus in cM;
add
= additive effect;
dom
= dominance effect (if included);
varadd
= variance of additive effect;
vardom
= variance of dominant effect (if included).
The deviance data frame has 1 column with the posterior deviance.
There is one deviance value for each iteration, or n.iter
values.
The last value is the deviance calculated at the posterior means, known as Dhat.
Returns a list of class qb
, including:
args |
Arguments passed to qb.mcmc , qb.data and
qb.model . An additional element for subset may be
added by subset.qb if called. |
cross.object |
A clean -ed version of the
original cross object, but only with phenotypes used by
qb.mcmc . |
mcmc.samples |
A list containing the MCMC samples for each
phenotype. There are always data frames for iterdiag and
mainloci , with optional data frames for pairloci ,
covariates and gbye . |
Nengjun Yi, nyi@ms.ssg.uab.edu
qb.sim.cross
, qb.data
,
qb.model
, qb.mcmc
## Not run: example(qb.sim.cross) ## Calculate grids and genotypic probabilites. cross <- qb.genoprob(cross, step=2) ## Create MCMC samples ## First line as qb.data options; second line has qb.model options. qbExample <- qb.mcmc(cross, pheno.col = 3, rancov = 2, fixcov = 1, chr.nqtl = rep(3,nchr(cross)), intcov = 1, interval = rep(10,3), n.iter = 1000, n.thin = 20) ## End(Not run)