# Run multipoint linkage analysis.

## Usage

solarMultipoint(formula, data, dir, kinship, traits, covlist = "1", mibddir, chr, interval, multipoint.options = "", multipoint.settings = "", cores = getOption("cores"), ..., verbose = 0)

## Arguments

formula
an object of class formula or one that can be coerced to that class. It is a symbolic description of fixed effects (covariates) to be fitted.
data
A data frame containing the variables in the model, including ID fields needed to construct random effects: genetic and house-hold (both optional). Other classes such as list, environment or object coercible by as.data.frame to a data frame are not supported.
dir
an optional character string, the name of directory, where SOLAR performs the analysis. In this case, the analysis within related input/output files is conducted in the given folder instead of a temporary one (the default work flow).
kinship
A matrix of the kinship coefficients (custom kinship matrix). The IDs are required to be in row and column names.
traits
a vector of characters to specify trait(s) in the model. It is alternative to the formula interface.
covlist
a vector of characters to specify fixed effects (covariates) in the model. It is alternative to the formula interface. The default value is "1".
mibddir
A character, the name of directory with files representing the IBD matrices in SOLAR format. These matrices can be evaluated by SOLAR or by other program. See SOLAR help for ibd command for more details (http://solar.txbiomedgenetics.org/doc/91.appendix_1_text.html#ibd).
chr
A character or one that can be coerced to that class, the value to be passed to SOLAR command chromosome. If it is missing, the default value is "all". See SOLAR help for chromosome command for more details (http://solar.txbiomedgenetics.org/doc/91.appendix_1_text.html#chromosome).
interval
A character or one that can be coerced to that class, the value to be passed to SOLAR command interval. If it is missing, the default value is 1. See SOLAR help for interval command for more details.
multipoint.options
A character of options to be passed to multipoint SOLAR command. For example, one or more LOD scores may be specified to run multi-pass linkage analysis. If the argument is "3", that means a two-pass linkage scan with condition of the highest LOD of 3 to start the second pass. See SOLAR help page for multipoint command for more details (http://solar.txbiomedgenetics.org/doc/91.appendix_1_text.html#multipoint). The default value is "".
multipoint.settings
A vector of characters, that contains SOLAR commands to be executed just before calling multipoint. For example, the fine mapping for the linkage scan can be disabled by setting the given argument to "finemap off". The default value is "".
cores
A positive integer, the number of cores for parallel computing. The default value is taken from getOption("cores"). If the default value is NULL then the number of cores is 1.
...
Arguments to be passed to solarPolygenic function. For example, one of such arguments may be polygenic.settings = "option EnableDiscrete 0". Arguments of solarMultipoint, which are also passed to solarPolygenic, include formula, data, dir, kinship, traits and covlist.
verbose
An non-negative integer of the verbose level. The default value is 0.

## Description

The linkage analysis is conducted in the following sequence: parse input files of multipoint IBD matrices, export data to a directory by df2solar function, run the polygenic analysis in a directory, run the linkage analysis on the top of the polygenic analysis, parse output files and store results in an object of solarMultipoint class (see solarMultipointClass).

## Note

The user is responsible for computation of the MIBD matrices required by solarMultipoint function via mibddir argument. Estimation of the IBD matrices is out of the scope of solarius package. More information is available in http://solar.txbiomedgenetics.org/doc/05.chapter.html.

## Examples

### load phenotype data
data(dat30)

### load marker data
mibddir <- system.file('extdata', 'solarOutput',
'solarMibdsCsv', package = 'solarius')
list.files(mibddir)

[1] "mibd.2.0.gz" "mibd.2.1.gz" "mibd.2.2.gz" "mibd.2.3.gz" "mibd.2.4.gz"
[6] "mibd.2.5.gz" "mibd.5.0.gz" "mibd.5.1.gz" "mibd.5.2.gz" "mibd.5.3.gz"
[11] "mibd.5.4.gz" "mibd.5.5.gz"

## Not run:
# ### basic (univariate) linkage model
# mod <- solarMultipoint(trait1 ~ 1, dat30,
#   mibddir = mibddir, chr = 5)
# mod$lodf # table of results (LOD scores) (the highest 3.56) # # ### basic (bivariate) linkage model # mod <- solarMultipoint(trait1 + trait2 ~ 1, dat30, # mibddir = mibddir, chr = 5) # mod$lodf # table of results (LOD scores) (the highest 2.74)
#
# ### two-pass linkage model
# mod <- solarMultipoint(trait1 ~ 1, dat30,
#   mibddir = mibddir, chr = 5,
#   multipoint.options = "3")
# mod$lodf # table of results (LOD scores, 1 pass) (the highest 2.74) # mod$lodf2 # table of results (LOD scores, 2 pass) (all nearly zero LOD scores)
#
# ## End(Not run)