Learn R Programming

pegas (version 0.8-2)

haplotype.loci: Haplotype Extraction and Frequencies From Allelic Data

Description

This function extracts haplotypes from phased genotypes.

Usage

## S3 method for class 'loci':
haplotype(x, locus = 1:2, quiet = FALSE, ...)
## S3 method for class 'haplotype.loci':
plot(x, ...)
dist.haplotype.loci(x)

Arguments

x
an object of class "loci" or of class "haplotype.loci".
locus
a vector of integers giving the loci to analyse.
quiet
a logical value specifying whether to not print the progress of the analysis (FALSE by default).
...
arguments passed to and from methods.

Value

  • haplotype returns a matrix of mode character with the loci as rows and the haplotypes as columns. The attribute "freq" gives the counts of each haplotype and the class is "haplotype.loci".

    dist.haplotype.loci returns an object of class "dist".

Details

The individuals with at least one unphased genotype are ignored with a warning.

dist.haplotype.loci computes pairwise distances among haplotypes by counting the number of different alleles.

See Also

haplotype, LD