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

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

Description

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

Usage

1
2
## 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
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)

Example output

Loading required package: network
network: Classes for Relational Data
Version 1.13.0 created on 2015-08-31.
copyright (c) 2005, Carter T. Butts, University of California-Irvine
                    Mark S. Handcock, University of California -- Los Angeles
                    David R. Hunter, Penn State University
                    Martina Morris, University of Washington
                    Skye Bender-deMoll, University of Washington
 For citation information, type citation("network").
 Type help("network-package") to get started.


Attaching package: 'haplotypes'

The following object is masked from 'package:base':

    grouping

     seq4 seq5 seq6
seq5    2          
seq6    2    0     
seq7    0    2    2
     seq4 seq5 seq6
seq5    3          
seq6    3    0     
seq7    0    3    3
     seq4 seq5 seq6
seq5    1          
seq6    1    0     
seq7    0    1    1
      seq4 seq5 seq6 seq7 seq8 seq9
seq5     2                         
seq6     2    0                    
seq7     0    2    2               
seq8     0    2    2    0          
seq9     0    2    2    0    0     
seq10    0    2    2    0    0    0
      seq4 seq5 seq6 seq7 seq8 seq9
seq5     2                         
seq6     2   NA                    
seq7     0   NA   NA               
seq8     0   NA   NA   NA          
seq9     0   NA   NA   NA   NA     
seq10    0   NA   NA   NA   NA   NA
      seq4 seq5 seq6 seq7 seq8 seq9
seq5     2                         
seq6    NA    0                    
seq7     0    2    2               
seq8    NA    2   NA    0          
seq9    NA    2   NA    0   NA     
seq10   NA    2   NA    0   NA   NA

haplotypes documentation built on Feb. 28, 2020, 5:08 p.m.