You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/man/modeltypes.md
+16-46Lines changed: 16 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,7 @@
1
+
```@setup sm
2
+
using SubstitutionModels
3
+
```
4
+
1
5
# Nucleic Acid Substitution Models
2
6
3
7
## Included Substitution Models
@@ -16,90 +20,56 @@ For the convenience of the user, several construction methods exist for each sub
16
20
17
21
### Method 1
18
22
The most basic construction method detects whether the absolute or relative rate form of a substitution model is being referenced based on the number of parameters, and constructs it:
19
-
```jldoctest
23
+
```@repl sm
20
24
K80(1e-2)
21
-
22
-
# output
23
-
Kimura 1980 model (relative rate form)
24
-
κ = 0.01
25
25
```
26
26
27
27
Substitution model construction involves a number of checks for parameter validity, though these may be optionally bypassed:
28
28
29
-
```jldoctest
30
-
K80(-1e-2, false)
31
-
32
-
# output
33
-
Kimura 1980 model (relative rate form)
34
-
κ = -0.01
29
+
```@repl sm
30
+
K80(-1e-2, safe=false)
35
31
```
36
32
37
33
The exact model type may be specific as well, to avoid the software detection of absolute or relative rate specification. The specific forms are the parent models' name followed by `abs` for absolute or `rel` for relative rate form.
38
34
39
-
```jldoctest
35
+
```@repl sm
40
36
K80rel<:K80, K80abs<:K80
41
-
42
-
# output
43
-
(true, true)
44
37
```
45
38
46
-
```jldoctest
39
+
```@repl sm
47
40
K80abs(1e-2, 1.5e-2)
48
-
49
-
# output
50
-
Kimura 1980 model (absolute rate form)
51
-
α = 0.01, β = 0.015
52
41
```
53
42
54
43
For models requiring specification of base frequencies, those can be provided in the same manner as the other model parameters:
55
44
56
-
```jldoctest
45
+
```@repl sm
57
46
fieldnames(F81abs)
58
-
59
-
# output
60
-
(:β, :πA, :πC, :πG, :πT)
61
47
```
62
48
63
-
```jldoctest
49
+
```@repl sm
64
50
F81abs(1e-2, 0.2475, 0.2425, 0.2575, 0.2525)
65
-
66
-
# output
67
-
Felsenstein 1981 model (absolute rate form)
68
-
β = 0.01, π = [0.2475, 0.2425, 0.2575, 0.2525]
69
51
```
70
52
71
53
### Method 2
72
54
It may be familar or convenient for some SubstitutionModels.jl users to construct substitution model objects using a parameter vector of some kind.
73
55
This is also a supported construction method. When specifying a model with an equal base frequency, a single parameter vector is required for construction.
74
56
For models that support different base frequencies, a parameter vector and a base frequency vector are both required.
75
57
76
-
```jldoctest
58
+
```@repl sm
77
59
F81abs([1e-2], [0.2475, 0.2425, 0.2575, 0.2525])
78
-
79
-
# output
80
-
Felsenstein 1981 model (absolute rate form)
81
-
β = 0.01, π = [0.2475, 0.2425, 0.2575, 0.2525]
82
60
```
83
61
84
62
The unsafe construction method is still available, as is auto-detection of absolute or relative rate types of substitution models.
85
63
86
-
```jldoctest
87
-
K80([1e-2, 1.5e-2], true)
88
-
89
-
# output
90
-
Kimura 1980 model (absolute rate form)
91
-
α = 0.01, β = 0.015
64
+
```@repl sm
65
+
K80([1e-2, 1.5e-2], safe = true)
92
66
```
93
67
94
68
### Method 3
95
69
Lastly, `convert` methods are also provided for each substitution model type:
0 commit comments