Learn R Programming

pirouette (version 1.6.9)

count_n_mutations: Count mutations

Description

Count mutations

Usage

count_n_mutations(alignment, root_sequence, verbose = FALSE)

Value

the number of mutations

Arguments

alignment

a DNA alignment, of class DNAbin

root_sequence

the DNA sequence at the root of the phylogeny. By default, this will consist out of an equal amount of each letter Use check_root_sequence to check if a root sequence is valid.

verbose

if TRUE, show more output

Author

Giovanni Laudanno, Richèl J.C. Bilderbeek

Examples

Run this code
# Check cleanup by other functions
beastier::check_empty_beaustier_folders()

# Create an AAAA alignent
alignment <- ape::as.DNAbin(
  x = list(species_1 = strsplit("aaaa", split = "")[[1]])
)
# Count the number of mutations from AAAA
# 0
count_n_mutations(alignment, "aaaa")
# 1
count_n_mutations(alignment, "acaa")
# 2
count_n_mutations(alignment, "acga")
# 3
count_n_mutations(alignment, "acgt")
# 4
count_n_mutations(alignment, "ccgt")

Run the code above in your browser using DataLab