impute.snps {snpMatrix} | R Documentation

## Impute snps

### Description

Given SNPs stored in an object of class `"snpMatrix"` or `"X.snp.matrix"` and a set of imputation equations in as object of class `"snp.reg.imputation"`, this function calculates imputed values.

### Usage

    impute.snps(rules, snps, subset=NULL)

### Arguments

`rules` | The imputation equations; an object of class `"snp.reg.imputation"`
`snps` | The object of class `"snpMatrix"` or `"X.snp.matrix"` containing the observed SNPs
`subset` | A vector describing the subset of subjects to be used. If `NULL` (default), then use all subjects

### Value

A matrix with imputed SNPs as columns. The imputed values are the estimated expected values of each SNP when coded 0, 1 or 2.

### Note

Because the imputation is based on a linear model, the imputed value may lie outside the range 0 to 2.

### Author(s)

David Clayton david.clayton@cimr.cam.ac.uk

### References

Chapman J.M., Cooper J.D., Todd J.A. and Clayton D.G. (2003) Human Heredity, 56:18-31.

### See Also

`snp.imputation`

### Examples

    # Remove 5 SNPs from a datset and derive imputation rules for them
    library(snpMatrix)
    data(for.exercise)
    sel <- c(20, 1000, 2000, 3000, 5000)
    to.impute <- snps.10[,sel]
    impute.from <- snps.10[,-sel]
    pos.to <- snp.support$position[sel]
    pos.fr <- snp.support$position[-sel]
    imp <- snp.imputation(impute.from, to.impute, pos.fr, pos.to)
    # Now calculate the imputed values
    imputed <- impute.snps(imp, impute.from)

[Package snpMatrix version 1.8.0 Index]