expectedGenotypes: Construct expected genotypes/haplotypes according to known...

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

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

1
2
3
4

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

allele.names, genotype

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  ## 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]

kindlychung/genetics documentation built on May 20, 2019, 9:58 a.m.