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

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)

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.

Details

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

Value

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

Author(s)

Emmanuel Paradis

See Also

Examples

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

pegas

Population and Evolutionary Genetics Analysis System

v1.0
GPL (>= 2)
Authors
Emmanuel Paradis [aut, cre, cph] (<https://orcid.org/0000-0003-3092-2199>), Thibaut Jombart [aut, cph] (<https://orcid.org/0000-0003-2226-8692>), Zhian N. Kamvar [aut, cph] (<https://orcid.org/0000-0003-1458-7108>), Brian Knaus [aut, cph] (<https://orcid.org/0000-0003-1665-4343>), Klaus Schliep [aut, cph] (<https://orcid.org/0000-0003-2941-0161>), Alastair Potts [aut, cph] (<https://orcid.org/0000-0003-0919-7279>), David Winter [aut, cph] (<https://orcid.org/0000-0002-6165-0029>)
Initial release
2021-04-08

We don't support your browser anymore

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