sim_twin_alignment: Creates a twin alignment.

View source: R/sim_twin_alignment.R

sim_twin_alignmentR Documentation

Creates a twin alignment.

Description

A twin alignment is an alignment that has as much acquired the same number of mutations (compared to the root sequence), as the true alingment has (compared to the root sequence).

Usage

sim_twin_alignment(
  twin_phylogeny,
  true_alignment,
  alignment_params,
  twinning_params
)

Arguments

twin_phylogeny

a phylogeny of class phylo

true_alignment

a DNA alignment, of class DNAbin

alignment_params

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

twinning_params

can be NA if no twinning is desired, or can be the twinning parameters, as can be created by create_twinning_params

Details

When an alignment gets very big, say one million base pairs, it will take long to get a twin alignment with exactly the same number of mutations.

Value

an alignment of class DNAbin that has as much mutations accumulated from crown to the tips as the original, 'true' alignment

Author(s)

Richèl J.C. Bilderbeek, Giovanni Laudanno

Examples

true_phylogeny <- ape::read.tree(text = "((A:1, B:1):2, C:3);")
twin_phylogeny <- ape::read.tree(text = "((A:2, B:2):1, C:3);")
root_sequence <- create_blocked_dna(1000)
alignment_params <- create_test_alignment_params()
true_alignment <- create_true_alignment(
  true_phylogeny = true_phylogeny,
  alignment_params = alignment_params
)
twin_alignment <- sim_twin_alignment(
  twin_phylogeny = twin_phylogeny,
  true_alignment = true_alignment,
  alignment_params = alignment_params,
  twinning_params = create_twinning_params()
)

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