spider (version 1.5.0)

titv: Number of pairwise transitions and transversions in an alignment.

Description

Calculates the number of pairwise transitions and transversions between sequences.

Usage

titv(DNAbin)

Arguments

DNAbin

A DNA alignment of class `DNAbin'.

Value

A square matrix with dimensions of length(dat). The upper triangle contains the number of transversions. The lower triangle contains the number of transitions.

Examples

Run this code
# NOT RUN {
data(dolomedes)

subs <- titv(dolomedes)

#Transversions
subs[upper.tri(subs)]
tv <- t(subs)
tv <- tv[lower.tri(tv)]

#Transitions
ti <- subs[lower.tri(subs)]


#Saturation plot
doloDist <- ape::dist.dna(dolomedes)
graphics::plot(doloDist, ti, type="p", pch=19, col="blue", 
    main="Saturation plot of number of transitions and transversions\n
    against K2P distance. Red: transversions. Blue: transitions")
graphics::points(doloDist, tv, pch=19, col="red")


# }

Run the code above in your browser using DataLab