# combinedist: Combine distance matrices into a single such In kbroman/lineup: Lining Up Two Sets of Measurements

## Description

Combine multiple distance matrices into a single distance matrix providing an overall summary

## Usage

 `1` ```combinedist(..., method = c("median", "mean")) ```

## Arguments

 `...` Set of distance matrices, as calculated by `distee` or `disteg`. `method` Indicates whether to summarize using the median or the mean.

## Details

The row and column names of the input distance matrices define the individual IDs.

If the input distance matrices all have an attribute `"denom"` (for denominator) and `method="mean"`, we use a weighted mean, weighted by the denominators. This could be used to calculate an overall proportion.

## Value

A distance matrix, with class `"lineupdist"`. The individual IDs are in the row and column names.

## Author(s)

Karl W Broman, [email protected]

`distee`, `disteg`, `summary.lineupdist`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34``` ```library(qtl) # load example data data(f2cross, expr1, expr2, pmap, genepos) # calculate QTL genotype probabilities f2cross <- calc.genoprob(f2cross, step=1) # find nearest pseudomarkers pmark <- find.gene.pseudomarker(f2cross, pmap, genepos) # line up individuals id1 <- findCommonID(f2cross, expr1) id2 <- findCommonID(f2cross, expr2) # calculate LOD score for local eQTL locallod1 <- calc.locallod(f2cross[,id1\$first], expr1[id1\$second,], pmark) locallod2 <- calc.locallod(f2cross[,id2\$first], expr2[id2\$second,], pmark) # take those with LOD > 25 expr1s <- expr1[,locallod1>25,drop=FALSE] expr2s <- expr2[,locallod2>25,drop=FALSE] # calculate distance between individuals # (prop'n mismatches between obs and inferred eQTL geno) d1 <- disteg(f2cross, expr1s, pmark) d2 <- disteg(f2cross, expr2s, pmark) # combine distances d <- combinedist(d1, d2) # summary of problem samples summary(d) ```