Learn R Programming

pirouette (version 1.6.9)

Create a Bayesian Posterior from a Phylogeny

Description

Theoretical biologists are interested in measuring the extent at which we can measure the truth. This package allows to create a Bayesian posterior from a phylogeny that depicts the true evolutionary relationships. The given and true phylogeny can than be compared to the posterior phylogenies. Richèl J. C. Bilderbeek, Giovanni Laudanno, Rampal S. Etienne (2020) "Quantifying the impact of an inference model in Bayesian phylogenetics" .

Copy Link

Version

Install

install.packages('pirouette')

Monthly Downloads

41

Version

1.6.9

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Richel Bilderbeek

Last Published

October 7th, 2023

Functions in pirouette (1.6.9)

check_alignment_params_names

Checks if the list elements' names match that of a valid alignment_params
check_experiments_all_inference_models_are_unique

Internal function
check_error_fun

Check that the error_fun is valid.
check_candidates_save_to_same_files

Check if all experiments save to the same files
check_alignment_params

check_experiments

Checks if the argument is a list of one or more pirouette experiments.
check_beast2_installed

Checks if BEAST2 is installed
check_error_measure_params

check_alignment

Check if the alignment is of the right type
check_experiment

Checks if the argument is a valid pirouette experiment.
check_experiments_candidates_have_same_mcmcs

Check that the candidate experiments have a same MCMC
check_model_type

check_inference_model_weights

Check the one or more inference model's weights
check_inference_conditions

check_inference_model_type_names

Check the model type names
check_gen_and_cand_exps_save_to_different_files

Check that generative and candidate experiments save to different files.
check_sim_tral_fun

Check if the function to create a true alignment with (from the true phylogeny) is valid.
check_sim_twal_fun

Check if the function to create a twin alignment with (from a true phylogeny and a true alignment) is valid.
check_init_pir_params

Check if the pir_params is initialized
check_mutation_rate

Check if the mutation rate is valid
check_pir_out

Checks if the argument is a valid pirouette parameter set.
check_is_ns_beast2_pkg_installed

Checks if the NS BEAST2 package is installed.
check_pir_params_names

Checks if the pir_params has all the named elements needed
check_pir_out_errors_above_zero

Checks that pir_out errors all are more than zero
check_pir_params_data_types

Checks if the pir_params elements are all of the right data type.
check_twinning_params

Checks if the argument is a valid twinning parameters structure.
check_pir_params

Checks if the argument is a valid pirouette parameter set.
check_root_sequence

Check if the root sequence is valid
check_tree_type

check_twin_phylogeny

Check if a twin phylogeny is a valid phylogeny
check_pir_paramses

Check if all elements in the list of pir_params are valid.
check_reconstructed_phylogeny

Check if the phylogeny is a reconstructed phylogeny.
copy_true_alignment

Adapter function to create a twin alignment by simply copying the true alignment
create_alignment_params

Create the parameters for the alignment simulation.
check_sim_twin_tree_fun

Check if the sim_twin_tree_fun is valid
check_tree_types

count_n_mutations

Count mutations
create_exemplary_dd_tree

Create an exemplary diversity-dependent (DD) birth-death tree.
check_pir_out_names

Checks if the pir_out has elements with the names needed.
create_all_bd_experiments

Create all pirouette experiments that have a tree prior that follows a birth-death model.
create_error_measure_params

Create the parameters to specify how the error between the given phylogeny and the Bayesian posterior trees is measured.
check_tree_and_model_errors

Check if the tree_and_model_errors is valid.
create_all_experiments

Create all pirouette experiments.
create_all_coal_experiments

Create all pirouette experiments that have a tree prior that follows a coalescent model.
convert_pir_out_to_long

Convert a pir_out to its long form
check_tree_and_models

Check if the tree_and_model is valid
collapse_tree_and_model

Internal function
combine_models

Combine a combination of site models, clock models and tree priors into a collection of inference models.
create_bd_tree

Create a (constant-rate) birth-death (BD) tree
check_twinning_params_names

Check that the twinning_params has all the list elements' names
create_sim_yule_twin_tree_fun

Create a partially evaluated function to to sim_yule_twin_tree.
check_tree_and_model

Check if the tree_and_model is valid
complete_treelog_filename

Complete a treelog's filename
create_blocked_dna

Create a 'blocked' DNA sequence, which is a sequence with four equal-sized nucleotide sections
create_standard_mutation_rate

Create the parameters for the mutation rate
collect_pir_outs

Collect the results of multiple pirouette runs
combine_brts_and_topology

Substitute branching times keeping the topology
create_test_cand_experiment

Create a valid testing pirouette candidate experiment.
create_inference_conditions

Create the inference conditions
create_gen_experiment

Create a valid testing pirouette generative experiment.
create_cand_experiment

Create a valid testing pirouette candidate experiment.
convert_tree2brts

Convert a tree into branching times
create_tral_file

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

Create the parameters for pirouette
create_experiment

Create a valid pirouette experiment.
create_test_alignment_params

Create testing parameters for the alignment simulation.
create_exemplary_dd_tree_giappo

Create an exemplary diversity-dependent (DD) birth-death tree.
create_std_pir_params

Create a standard pir_params
create_copy_twtr_from_true_fun

Create a function that can simulate the twin tree from the true tree, by just copying the true tree
create_std_pir_paramses

Create a number of standard pir_params
create_test_pir_params_setup

Create a pir_params that follows a specific setup
create_test_marg_liks

Create a testing marginal likelihoods data frame.
create_mono_nuc_dna

Create a 'blocked' DNA sequence, which is a sequence with four equal-sized nucleotide sections
create_test_pir_params

Create a set of testing parameters for pirouette
create_test_pir_run_output

Create the same output of pir_run to be used for testing
create_test_pir_run_output2

Create the same output of pir_run to be used for testing, but with more data
create_true_alignment

Create the true alignment from the true/given phylogeny.
create_tree_and_model_errors_from_folder

Internal function to create a tree_and_model_errors from the files in a folder
create_test_phylogeny

Create a testing phylogeny with 3 taxa and a crown age of 3
delete_beast2_state_files

Delete the BEAST2 state files, if present.
create_yule_tree

Create a Yule tree.
create_tree_and_model_errors_from_folders

Internal function to create a tree_and_model_errors from the files in one or more folders
create_test_experiment

Create a valid testing pirouette experiment.
errorses_to_data_frame

Convert the collect of errors to a data frame
create_test_gen_experiment

Create a valid testing pirouette generative experiment.
get_pir_plot_fill_colors

Internal function to get the fill colors for pir_plot
get_experiment_filenames

Extract the filenames from an experiment
get_remove_hex_twin_fun

Get a function that removes the hex string from filenames.
default_params_doc

This function does nothing. It is intended to inherit is parameters' documentation.
create_twal_file

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

Get a function to 'simulate' a twin alignment by simply copying the true alignment.
create_twin_branching_times

Generate twin branching times given estimated lambda and mu and the original tree
create_twinning_params

Create the parameters for the twinning simulation
get_pir_plot_line_colors

Internal function to get the line colors for pir_plot
create_twin_tree

Create a twin tree
get_temp_tree_filename

Get the name for a temporary file to store a tree in Newick format
get_temp_fasta_filename

Get the name for a temporary file to store an alignment in the FASTA format
get_nltt_error_fun

Get an error function that uses the nLTT statistic
get_pir_params_filenames

Extract the filenames from a pir_params
get_model_selections

Get the possible ways to select an inference model
get_temp_evidence_filename

Get the name for a temporary file to store the evidences (aka marginal likelihoods) as a comma-separated file
get_temp_errors_filename

Get the name for a temporary file to store inference errors.
get_model_type_names

Get the names of the model types
get_sim_yule_twin_tree_fun

Create a partially evaluated function to to sim_yule_twin_tree.
init_pir_params

Initialize the pir_params.
get_experiments_filenames

Extract the filesnames in the experiments
get_sim_tral_with_lns_nsm_fun

Get a partially evaluated function to simulate a true alignment with a linked node substitution site model.
get_sim_twal_with_std_nsm_fun

Get a function to simulate a twin alignment which uses a standard site model
get_sim_bd_twin_tree_fun

Create a partially evaluated function to to sim_bd_twin_tree.
get_tree_and_model_values

Get the valid tree_and_model values
get_sim_twal_same_n_muts_fun

of mutations as the true alignment has.
init_experiment

Initialize the experiment.
get_gamma_error_fun

Get an error function that uses the difference in gamma statistic.
get_test_alignment

Get an alignment for testing.
get_twin_models

Twin models
get_twin_methods

Twin methods
get_sim_tral_with_std_nsm_fun

Get a function to simulate the true alignment with, that uses a standard site model.
get_sim_tral_with_uns_nsm_fun

Get a partially evaluated function to simulate a true alignment with an unlinked node substitution site model.
get_tree_types

Get the names of the tree types
get_alignment_sequences

Get the sequences from an alignment
has_twinning

Determine if these pir_params use twinning
pir_plots

Plot the output of pir_runs.
get_alignment_sequence_length

Get the sequence length of an alignment
est_evidences

Estimate the evidences
%>%

Pipe operator
get_tree_and_model_descriptions

Internal function to create a mapping from a tree_and_model to a description
has_candidate_experiments

Detect if there is at least one candidate model among the set of experiments.
get_alignment_n_taxa

Get the number of taxa of an alignment
pir_save

Save all output from pir_run
pir_to_pics

Create all pictures created by the pirouette pipeline
pir_plot_from_file

Plot the error BEAST2 make from the known phylogeny
pir_rename

Rename the filenames in a pir_params using a rename function.
is_pir_params

Determine if the pir_params is valid.
pir_rename_to_std

Rename the pir_params filenames to follow a standard naming scheme.
pir_to_tables

Create all tables to checks pirouette pipeline
pir_plot_from_long

Plot the error 'BEAST2' makes from a known phylogeny from tidy data
pir_run

Measure the error BEAST2 makes from a known phylogeny.
pir_run_distribution

Do multiple pirouette runs off a distribition of phylogenies
plot_alignment_from_file

Plot an alignment stored as a file
pirouette-package

pirouette: A package to estimate the error BEAST2 makes in inferring a phylogeny.
pir_plot

Plot the error 'BEAST2' makes from a known phylogeny
phylo_to_errors

Measure the error BEAST2 makes from a true phylogeny.
sim_alignment_with_std_nsm_from_params

Create an alignment with a standard site model
sim_bd_twin_tree

Simulate a Birth-Death (BD) twin tree from the true phylogeny
relevel_tree_and_model

Internal function
relevel_inference_model

Internal function
renum_rng_seeds

Renumber the RNG seeds
is_dna_seq

Determine if the string is a lowercase DNA sequence of at least one base pair
is_best_candidate

Is the experiment the one with the most evidence?
replicate_pir_params

Replicate pir_params assigning new names to each file
get_pir_plot_tree_and_model_descriptions

Internal function to obtain the pir_plot legend labels
get_pir_plot_theme

Get the pir_plot theme
to_twin_filenames

Convert multiple filenames to their twin equivalent
read_errors_csv

Read the errors from a .csv file
select_experiments

Select the experiments to do a Bayesian inference with.
sim_alignment_with_n_mutations

Converts a phylogeny to a random DNA alignment
sim_twal_with_lns_nsm

Adapter function to simulate the twin alignment using the lns site model
pir_run_true_tree

Measure the error BEAST2 makes from a phylogeny
sim_alignment_with_std_nsm

Create an alignment with a standard site model using a raw interface
shorten_experiments

Shorten the experiments' runtime
will_measure_evidence

Determine if there is an experiment in which the evidence will be measured.
pir_run_twin_tree

Measure the error BEAST2 makes from a phylogeny
select_candidate_evidences

Select the evidences for candidate experiments
rm_pir_param_files

Deletes all files
sim_twal_with_same_n_mutation

Simulate a twin alignment using a standard site model
sim_twal_with_std_nsm

Simulate a twin alignment using a standard site model
sim_true_alignment

Simulate the true alignment from the true phylogeny
shorten_pir_paramses

Shorten the list of pir_params
pir_runs

Do multiple pirouette runs
sim_tral_with_lns_nsm

Create an alignment with the lns site model
sim_twin_alignment

Creates a twin alignment.
shorten_pir_params

Shorten the pir_params
sim_tral_with_uns_nsm

Adapter function to simulate an alignment with the linked_node_sub (lns) site model.
sim_twal_with_uns_nsm

Adapter function to simulate an alignment with the linked_node_sub (lns) site model.
sim_tral_with_std_nsm

Adapter function to simulate a twin alignment using a standard site model
sim_yule_twin_tree

Create a twin tree from a phylogeny using a Yule process
to_twin_filename

Converts true tree filenames to twin tree filenames
to_evidence_filename

Converts a filename to an evidence filename