Learn R Programming

pegas (version 1.3)

diffHaplo: Comparison Between Two Haplotypes

Description

This function compares two haplotypes and returns a summary of the differences.

Usage

diffHaplo(h, a = 1, b = 2, strict = FALSE, trailingGapsAsN = TRUE)

Value

a data frame with three columns named pos (position of the differences) and the labels of the two haplotypes compared.

Arguments

h

an object of class "haplotype".

a, b

two integers (or character strings) giving the indices (or labels) of the two haplotypes to be compared.

strict

a logical value; if TRUE, ambiguities and gaps in the sequences are ignored and treated as separate characters.

trailingGapsAsN

a logical value; if TRUE (the default), the leading and trailing alignment gaps are considered as unknown bases (i.e., N). This option has no effect if strict = TRUE.

Author

Emmanuel Paradis

Details

The options strict and trailingGapsAsN are passed to seg.sites.

See Also

haploNet, haplotype

Examples

Run this code
data(woodmouse)
h <- haplotype(woodmouse)
diffHaplo(h) # compares the 1st and 2nd haplotypes
diffHaplo(h, 1, 3)
diffHaplo(h, "I", "III") # same than above but using labels

Run the code above in your browser using DataLab