count_n_mutations: Count mutations

View source: R/count_n_mutations.R

count_n_mutationsR Documentation

Count mutations

Description

Count mutations

Usage

count_n_mutations(alignment, root_sequence, verbose = FALSE)

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

Value

the number of mutations

Author(s)

Giovanni Laudanno, Richèl J.C. Bilderbeek

Examples

# 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")

richelbilderbeek/pirouette documentation built on Oct. 18, 2023, 3:09 p.m.