create_true_alignment: Create the true alignment from the true/given phylogeny.

View source: R/create_true_alignment.R

create_true_alignmentR Documentation

Create the true alignment from the true/given phylogeny.

Description

We call this the true alignment, as it could thruthfully be found in nature, when assuming the true phylogeny is the true evolutionary history.

Usage

create_true_alignment(true_phylogeny, alignment_params)

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

Value

an alignment of type DNAbin

Author(s)

Richèl J.C. Bilderbeek, Giovanni Laudanno

See Also

Use create_tral_file to save the created alignment directly to a file

Examples

# Check cleanup by other functions
beastier::check_empty_beaustier_folders()

# Create the ancestor's DNA sequence
n_base_pairs <- 4
root_sequence <- create_blocked_dna(length = n_base_pairs)

# How to simulate the alignment
alignment_params <- create_alignment_params(
  root_sequence = root_sequence
)

# Create a phylogeny to simulate the DNA sequences on
n_taxa <- 5
phylogeny <- ape::rcoal(n_taxa)

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

# Cleanup
beastier::remove_beaustier_folders()
beastier::check_empty_beaustier_folders()

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