sim_true_alignment: Simulate the true alignment from the true phylogeny

View source: R/sim_true_alignment.R

sim_true_alignmentR Documentation

Simulate the true alignment from the true phylogeny

Description

Simulate the true alignment from the true phylogeny

Usage

sim_true_alignment(
  true_phylogeny,
  alignment_params = pirouette::create_alignment_params(),
  verbose = FALSE
)

Arguments

true_phylogeny

the true phylogeny; the actual evolutionary history of the species, of class phylo

alignment_params

parameters to simulate an alignment, as can be created by create_alignment_params

verbose

if TRUE, show more output

Value

an alignment of type DNAbin

Author(s)

Richèl J.C. Bilderbeek

See Also

Use create_tral_file to save the simulated alignment directly to a file

Examples


# Create the phylogeny to simulate the alignment on
n_taxa <- 5
true_phylogeny <- ape::rcoal(n_taxa)

root_sequence <- "aaaacgt"

# Use default settings to create the alignment
alignment_params <- create_alignment_params(
  sim_tral_fun =
    get_sim_tral_with_std_nsm_fun(
      mutation_rate = 1.0
  ),
  root_sequence = root_sequence
)

# Simulate the alignment
alignment <- sim_true_alignment(
  true_phylogeny = true_phylogeny,
  alignment_params = alignment_params,
)
check_alignment(alignment)

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