Learn R Programming

PhenotypeSimulator (version 0.3.4)

standardiseGenotypes: Standardise genotypes.

Description

Genotypes are standardised as described in Yang et al: snp_standardised = (snp - 2 * ref_allele_freq)/ sqrt(2 * ref_allele_freq * alt_allele_freq).

Usage

standardiseGenotypes(geno, impute = FALSE)

Arguments

geno

[N x NrSNP] Matrix/dataframe of genotypes [integer]/[double].

impute

[logical] Indicating if missing genotypes should be imputed; if set FALSE and data contains missing values, standardiseGenotypes will return an error.

Value

[N x NrSNP] Matrix of standardised genotypes [double].

Details

Missing genotypes can be mean-imputed and rounded to nearest integer before standardisation. If genotypes contain missing values and impute is set to FALSE, standardiseGenotypes will return an error.

References

Yang, J., Lee, S.H., Goddard, M.E., Visscher, P.M. (2011) GCTA: a tool for genome-wide complex trait analysis, AJHG: 88

See Also

getAlleleFrequencies

Examples

Run this code
# NOT RUN {
geno <- cbind(rbinom(2000, 2, 0.3), rbinom(2000, 2, 0.4),rbinom(2000, 2, 0.5))
geno_sd <- standardiseGenotypes(geno)
# }

Run the code above in your browser using DataLab