Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

expectedGenotypes

Construct expected genotypes/haplotypes according to known allele variants


Description

expectedGenotypes constructs expected genotypes according to known allele variants, which can be quite tedious with large number of allele variants. It can handle different level of ploidy.

Usage

expectedGenotypes(x, alleles=allele.names(x), ploidy=2, sort=TRUE,
                  haplotype=FALSE)
expectedHaplotypes(x, alleles=allele.names(x), ploidy=2, sort=TRUE,
                   haplotype=TRUE)

Arguments

x

genotype or haplotype

alleles

character, vector of allele names

ploidy

numeric, number of chromosome sets i.e. 2 for human autosomal genes

sort

logical, sort genotypes according to order of alleles in alleles argument

haplotype

logical, construct haplotypes i.e. ordered genotype

At least one of x or alleles must be given.

Details

expectedHaplotypes() just calls expectedGenotypes() with argument haplotype=TRUE.

Value

A character vector with genotype names as "alele1/alele2" for diploid example. Length of output is (n*(n+1))/2 for genotype (unordered genotype) and n*n for haplotype (ordered genotype) for n allele variants.

Author(s)

Gregor Gorjanc

See Also

Examples

## On genotype
  prp <- c("ARQ/ARQ", "ARQ/ARQ", "ARR/ARQ", "AHQ/ARQ", "ARQ/ARQ")
  alleles <- c("ARR", "AHQ", "ARH", "ARQ", "VRR", "VRQ")
  expectedGenotypes(as.genotype(prp))
  expectedGenotypes(as.genotype(prp, alleles=alleles))
  expectedGenotypes(as.genotype(prp, alleles=alleles, reorder="yes"))

  ## Only allele names
  expectedGenotypes(alleles=alleles)
  expectedGenotypes(alleles=alleles, ploidy=4)

  ## Haplotype
  expectedHaplotypes(alleles=alleles)
  expectedHaplotypes(alleles=alleles, ploidy=4)[1:20]

genetics

Population Genetics

v1.3.8.1.3
GPL
Authors
Gregory Warnes, with contributions from Gregor Gorjanc, Friedrich Leisch, and Michael Man.
Initial release
2012-11-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.