######################################################### # mstep: choose a model by mBIC in backcross population # ######################################################### mstep(trait,mdat,mpos,qtl.main=NULL,qtl.eps=NULL, direction = c("both", "backward","forward"),by=2,steps=1000,w=c(1,1),const=c(2.2,2.2)) Arguments: trait: a numerical vector of length n (n is the number of observations), which represents a trait of interest. mdat: a n by m numerical matrix. Each column represents a marker variable. Each entry of mdat should be 0 or 1, representing the genotypic value at the marker. Note, the order of the columns in mdat should be the same that of the markers on the genome. mpos: genetic map, which is a data frame consisting of "id", "chr", "m" and "dist". The makers are numbered by 1, 2, ..., etc. Then mpos$id is the corresponding number. The chromosomes are numbered by 1, 2, ..., etc. Then mpos$chr is the corresponding number. The markers on each chromosome is numbered by 1, 2, ..., etc. Then mpos$m is the corresponding number. mpos$dist is the chromosomal genetic position (in cM). qtl.main: specifies the QTL with main effects for mstep to start with. It should be a data frame consisting of "chr" and "position". Each row represents a QTL; "chr" specifies the chromosome the QTL is on, and "position" specifies its chromosomal location (in cM). qtl.main is NULL if mstep starts with no QTL with main effects. qtl.eps: specifies the QTL with epistatic effects for mstep to start with. It should be a data frame consisting of "chr1", "position1", "chr2" and "position2". Each row represents a QTL; "chr1" specifies the chromosome the first QTL is on and "position1" specifies its chromosomal location (in cM), and "chr2" specifies the chromosome the second QTL is on and "position2" specifies its chromosomal location (in cM). qtl.eps is NULL if mstep starts with no epistatic QTL. direction: the mode of stepwise search, can be one of "both", "backward", or "forward", with a default of "both". by: specifies the walk speed in cM when scanning the genome for QTL. The default is 2 (cM). If "by" is larger than the maximum interval length (e.g. "by=Inf"), then mstep only searches over markers specified by mpos. steps: the maximum number of steps to be considered. The default is 1000. It can be used to stop the process early. w: a vector of length 2 that specifies the weights. w[1] is the weight on main effects, and w[2] is the weight on epistasis. The default is c(1,1). const: specifies the constants (in the denominator) with a default c(2.2,2.2) Value: The resulting model is specified by a list that consisting "main" and/or "epistasis". "main" specifies the resulting QTL of main effects. It is a data frame consisting of "effects", which gives the estimated main effects, and "QTL_locations", which gives the genetic locations of the QTL. "epistasis" specifies the resulting QTL of epistatic effects. It is a data frame consisting of "effects", which gives the estimated epistatic effects, and "QTL_locations", which gives the genetic locations of the QTL. mstep also provides R-squared by "Rsquare".