impute.snps: Impute snps

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/imputation.R

Description

Given SNPs stored in an object of class "SnpMatrix" or "XSnpMatrix" and a set of imputation rules in an object of class "ImputationRules", this function calculates imputed values.

Usage

1
impute.snps(rules, snps, subset = NULL, as.numeric = TRUE)

Arguments

rules

The imputation rules; an object of class "ImputationRules"

snps

The object of class "SnpMatrix" or "XSnpMatrix" containing the observed SNPs

subset

A vector describing the subset of subjects to be used. If NULL (default), then use all subjects

as.numeric

If TRUE, the output is a numeric matrix containing posterior expectations of the imputed SNPs. Otherwise the output matrix is of the same class as snps and contains uncertain genotype calls

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.

Author(s)

David Clayton dc208@cam.ac.uk

References

Wallace, C. et al. (2010) Nature Genetics, 42:68-71

See Also

snp.imputation

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Remove 5 SNPs from a datset and derive imputation rules for them
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)

Example output

Loading required package: survival
Loading required package: Matrix
SNPs tagged by a single SNP: 3
SNPs tagged by multiple tag haplotypes (saturated model): 2

snpStats documentation built on Nov. 8, 2020, 10:59 p.m.