Description Usage Arguments Details Author(s) See Also Examples
This function creates the DNA sequence for a new case, with or without a known
infector. If the infector is missing (NULL, default), the case is imported according to
parameters in config
.
1 |
dna |
An optional location of the infector; if provided, it must be a list with the following slots: 'location', 'dna' |
generation_time |
The number of days separating the dates of infection of the infector, and the infectee. Only needed if the infector is provided. |
... |
further arguments passed to |
config |
optionally, a config returned by |
We consider that all markers are biallelic, and store only mutations.
Thibaut Jombart thibautjombart@gmail.com
dist_dna
to compute pairwise genetic distances from
vectors of mutations.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## without initial location
x_dna <- new_dna()
x_dna
## drift from this sequence, different nb of generations
new_dna(x_dna, 1L) # 1 generation
new_dna(x_dna, 12L) # 12 generations
## 100 generations, other genetic params
new_dna(x_dna, 100, mutation_rate = 1e-6, genome_length = 2e6)
## illustrate reverse mutations
my_config <- new_config(mutation_rate = 0.1, genome_length = 10)
x <- integer(0)
set.seed(1)
x <- new_dna(x, 5); x
x <- new_dna(x, 5); x
x <- new_dna(x, 5); x
x <- new_dna(x, 5); x
x <- new_dna(x, 5); x
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.