readBSM | R Documentation |

Read BSM represented by a pair of files suffixed by ".bin" and ".id", usually produced by PLINK and GCTA.

```
readBSM(pfx, dgv = 1, fid = NULL, id = NULL, bin = NULL)
```

`pfx` |
prefix of data files |

`dgv` |
diagonal value for matrix without a diagonal (def=1.0) |

`fid` |
separator between FID and IID (def=NULL, use IID only) |

`id` |
use id file instead of the default |

`bin` |
use bin file instead of the default |

The ".bin" is a binary file storing the matrix entries, which can be

- SQR
the

`N`

x`N`

symmetric matrix in full- LWD
the lower triangle with diagonal

- LND
the lower triangle without diagonal

, saved as either single or double precision.

The ".id" is a text file of `N`

family ID (FID) and individual ID (IID) in
two columns. By default, IID is used as matix row and column names.

PLINK option `--make-red bin`

, `--distance bin`

, and GCTA option
`--make-grm`

all creats binary symmetric matrices, widely used in linear
mixed model or kernel based models for genetics.

symmetric matrix loaded, with sample ID as both row and column names.

```
pfx <- file.path(system.file("extdata", package="plinkFile"), "m20.rel")
(readBSM(pfx, fid=":"))
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.