dist.alignment: Pairwise Distances from Aligned Protein or DNA/RNA Sequences

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

View source: R/dist.alignment.R

Description

These functions compute a matrix of pairwise distances from aligned sequences using similarity (Fitch matrix, for protein sequences only) or identity matrix (for protein and DNA sequences). The resulting matrix contains the squared root of the pairwise distances. For example, if identity between 2 sequences is 80 the squared root of (1.0 - 0.8) i.e. 0.4472136.

Usage

1
dist.alignment(x, matrix = c("similarity", "identity"),gap)

Arguments

x

an object of class alignment, as returned by read.alignment for instance

matrix

the matrix distance to be used, partial matching allowed

gap

-optional- with nucleotides, if set to 1, gaps will be counted in the identity measure

Value

The distance matrix, object of class dist, computed by using the specified distance measure.

Author(s)

D. Charif, J.R. Lobry

References

The reference for the similarity matrix is :
Fitch, W.M. (1966) An improved method of testing for evolutionary homology. J. Mol. Biol., 16:9-16.

citation("seqinr")

See Also

read.alignment

Examples

1
2
3
4
 myseqs <- read.alignment(file = system.file("sequences/test.mase", 
 package = "seqinr"), format = "mase")
 dist.alignment(myseqs, matrix = "identity" )
 as.matrix(dist.alignment(myseqs, matrix = "identity" ))

Example output

          Langur    Baboon     Human       Rat       Cow
Baboon 0.3307189                                        
Human  0.3750000 0.3307189                              
Rat    0.5448624 0.5077524 0.5376453                    
Cow    0.4921255 0.5448624 0.5590170 0.6495191          
Horse  0.7071068 0.7071068 0.7015608 0.7015608 0.7342088
          Langur    Baboon     Human       Rat       Cow     Horse
Langur 0.0000000 0.3307189 0.3750000 0.5448624 0.4921255 0.7071068
Baboon 0.3307189 0.0000000 0.3307189 0.5077524 0.5448624 0.7071068
Human  0.3750000 0.3307189 0.0000000 0.5376453 0.5590170 0.7015608
Rat    0.5448624 0.5077524 0.5376453 0.0000000 0.6495191 0.7015608
Cow    0.4921255 0.5448624 0.5590170 0.6495191 0.0000000 0.7342088
Horse  0.7071068 0.7071068 0.7015608 0.7015608 0.7342088 0.0000000

seqinr documentation built on Aug. 13, 2017, 3:01 a.m.