add_alignments: Add an alignment to a file

Description Usage Arguments Value Author(s) Examples

Description

Add an alignment to a file

Usage

1
add_alignments(filename)

Arguments

filename

Parameter filename

Value

Nothing, modifies the parameter file

Author(s)

Richel Bilderbeek

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 # Create a file with parameters
 filename <- "add_alignment_example.RDa"
 save_parameters_to_file(
   rng_seed = 42,
   sirg = 0.5,
   siri = 0.5,
   scr = 0.5,
   erg = 0.5,
   eri = 0.5,
   age = 5,
   mutation_rate = 0.1,
   n_alignments = 1,
   sequence_length = 10,
   nspp = 10,
   n_beast_runs = 1,
   filename = filename
 )

 # Add an incipient species tree
 add_pbd_output(filename)

 # Add the sampled species trees
 add_species_trees(filename = filename)

 # Test if there are no alignments yet
 testit::assert(
   has_alignments(read_file(filename = filename))
   == rep(FALSE, times = 2)
 )

 # Add the alignments (n_alignments per species tree)
 add_alignments(filename = filename)

 # Test if there are alignments now
 testit::assert(
   has_alignments(read_file(filename = filename))
   == rep(TRUE, times = 2)
 )

 # Cleanup
 file.remove(filename)

richelbilderbeek/wiritttes documentation built on May 27, 2019, 8:14 a.m.