distance-methods: Calculates absolute pairwise character difference matrix...

distance-methodsR Documentation

Calculates absolute pairwise character difference matrix using a Dna object

Description

Computes and returns an absolute pairwise character difference matrix from DNA sequences.

Usage

## S4 method for signature 'Dna'
distance(x,subset=NULL,indels="sic")

Arguments

x

an object of class Dna.

subset

a vector of integers in the range [1,nrow(x)], specifying which sequence(s) are used in the distance calculation. Only distance between selected sequence(s) and the rest of the sequences are calculated. If it is NULL, all comparisons are done.

indels

the indel coding method to be used. This must be one of "sic", "5th" or "missing". Any unambiguous substring can be given. See also ‘Details’

Details

Available indel coding methods:

sic:

Treating gaps as a missing character and coding them separately following the simple indel coding method.

5th:

Treating gaps as a fifth state character.

missing:

Treating gaps as a missing character.

Value

returns an object of class dist.

Methods

signature(x = "Dna")

Computes and returns an absolute pairwise character difference matrix from Dna objects.

Author(s)

Caner Aktas, caktas.aca@gmail.com

References

Giribet, G. and Wheeler, W.C. (1999) On gaps. Molecular Phylogenetics and Evolution 13, 132-143.

Simmons, M., Ochoterena, H. (2000) Gaps as characters in sequence-based phylogenetic analyses. Systematic Biology 49, 369-381.

See Also

indelcoder and subs

Examples

data("dna.obj")
x<-dna.obj[4:7,13:22,as.matrix=FALSE]

## Simple indel coding.
distance(x,indels="s")

## Gaps as 5th state characters.
distance(x,indels="5")

## Gaps as missing characters.
distance(x,indels="m")

## Not run: 
## Using 'subset'.
x<-dna.obj[4:10,13:22,as.matrix=FALSE]
distance(x, NULL)
distance(x, subset=c(1))
distance(x, subset=c(2,4))

## End(Not run)

haplotypes documentation built on July 26, 2023, 5:22 p.m.