create_tral_file: Simulates a DNA alignment and saves it to a FASTA file.

View source: R/create_tral_file.R

create_tral_fileR Documentation

Simulates a DNA alignment and saves it to a FASTA file.

Description

The simulation is performed by create_true_alignment.

Usage

create_tral_file(phylogeny, alignment_params, verbose = FALSE)

Arguments

phylogeny

a phylogeny 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

nothing

Author(s)

Richèl J.C. Bilderbeek

See Also

Use create_true_alignment to only simulate the alignment, without saving the alignment to 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 (and where to save) 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 and save the alignment
create_tral_file(
  phylogeny = phylogeny,
  alignment_params = alignment_params
)

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

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