get_sim_twal_same_n_muts_fun: of mutations as the true alignment has.

View source: R/get_sim_twal_with_same_n_mutation_fun.R

get_sim_twal_same_n_muts_funR Documentation

of mutations as the true alignment has.

Description

The twin alignment is simulated from the twin tree. The number of mutations it will have is counted by comparing it to the root sequence. The twin alignment will have an equal amount of mutations as the true alignment.

Usage

get_sim_twal_same_n_muts_fun(
  mutation_rate = 1,
  site_model = beautier::create_jc69_site_model(),
  max_n_tries = 100,
  verbose = FALSE
)

Arguments

mutation_rate

the mutation rate per base pair per time unit. Use check_mutation_rate to check if a mutation rate is valid.

site_model

a nucleotide substitution model, which can be:

  • A standard nucloetide substitution model, as created by create_site_model

  • lns: a linked node-substitution model

  • uns: an unlinked node-substitution model

max_n_tries

maximum number of tries before giving up

verbose

if TRUE, show more output

Details

This is an adapter function (see https://en.wikipedia.org/wiki/Adapter_pattern), with the purpose of passing check_sim_twal_fun, by being a function with the function arguments twin_phylogeny and true_alignment.

Value

the function sim_twal_with_same_n_mutation

See Also

See check_sim_twal_fun to the the other functions to simulate a twin alignment. Use sim_twin_alignment to use this function to create a twin alignment.


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