Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
VEBER Philippe
codepi
Commits
8092353c
Commit
8092353c
authored
Mar 11, 2021
by
Louis Duchemin
Browse files
Mutsel CpG simulator: update make_param signature
Also adds some convenience functions for flat and random params
parent
e764974c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
10 deletions
+31
-10
lib/tk/mutsel_simulator_cpg.ml
lib/tk/mutsel_simulator_cpg.ml
+19
-9
lib/tk/mutsel_simulator_cpg.mli
lib/tk/mutsel_simulator_cpg.mli
+12
-1
No files found.
lib/tk/mutsel_simulator_cpg.ml
View file @
8092353c
...
...
@@ -40,7 +40,7 @@ module Evolution_model = struct
Amino_acid
.
Vector
.
init
(
fun
_
->
1
.
/.
float
Amino_acid
.
card
)
|>
fitness_of_profile
let
make_param
state
pos
_branch
=
let
make_param
~
gBGC
~
scaled_fitness
~
omega
~
nucleotide_rates
~
nucleotide_stat_dist
~
rate_CpG
state
pos
_branch
=
let
context_CpG
=
if
pos
=
0
then
context_CpG_of_codons
state
.
(
pos
)
~
rh
:
state
.
(
pos
+
1
)
()
...
...
@@ -49,19 +49,29 @@ module Evolution_model = struct
else
context_CpG_of_codons
state
.
(
pos
)
~
lh
:
state
.
(
pos
-
1
)
~
rh
:
state
.
(
pos
+
1
)
()
in
let
pi
=
Nucleotide
.
flat_profile
()
in
let
rho
=
Linear_algebra
.
Lacaml
.
Vector
.
init
6
~
f
:
(
fun
_
->
1
.
/.
6
.
)
in
let
nucleotide_rates
=
Rate_matrix
.
Nucleotide
.
gtr
~
equilibrium_frequencies
:
pi
~
transition_rates
:
rho
in
{
nucleotide_rates
;
nucleotide_stat_dist
=
pi
;
omega
=
1
.
;
scaled_fitness
=
flat_fitness
()
;
gBGC
=
0
.
;
rate_CpG
=
0
.
;
nucleotide_stat_dist
;
omega
;
scaled_fitness
;
gBGC
;
rate_CpG
;
context_CpG
;
}
let
flat_param
()
=
let
pi
=
Nucleotide
.
flat_profile
()
in
let
rho
=
Linear_algebra
.
Lacaml
.
Vector
.
init
6
~
f
:
(
fun
_
->
1
.
/.
6
.
)
in
let
nucleotide_rates
=
Rate_matrix
.
Nucleotide
.
gtr
~
equilibrium_frequencies
:
pi
~
transition_rates
:
rho
in
make_param
~
gBGC
:
0
.
~
scaled_fitness
:
(
flat_fitness
()
)
~
omega
:
1
.
~
nucleotide_rates
~
nucleotide_stat_dist
:
pi
~
rate_CpG
:
1
.
let
random_param
~
alpha_nuc
~
alpha_fitness
=
let
pi
=
Nucleotide
.
random_profile
alpha_nuc
in
let
rho
=
Utils
.
random_profile
6
in
let
nucleotide_rates
=
Rate_matrix
.
Nucleotide
.
gtr
~
equilibrium_frequencies
:
pi
~
transition_rates
:
rho
in
let
scaled_fitness
=
Amino_acid
.
random_profile
alpha_fitness
|>
fitness_of_profile
in
make_param
~
gBGC
:
0
.
~
scaled_fitness
~
omega
:
1
.
~
nucleotide_rates
~
nucleotide_stat_dist
:
pi
~
rate_CpG
:
1
.
let
rate_increase_CpG
(
pos
,
x_a
,
x_b
)
context
=
match
Nucleotide
.(
pos
,
inspect
x_a
,
inspect
x_b
)
,
context
with
|
(
0
,
C
,
T
)
,
{
codon
=
(
_
,
G
,
_
)
;
_
}
...
...
lib/tk/mutsel_simulator_cpg.mli
View file @
8092353c
...
...
@@ -23,7 +23,18 @@ module Evolution_model : sig
val
stationary_distribution
:
param
->
NSCodon
.
vector
val
make_param
:
NSCodon
.
t
array
->
int
->
'
a
->
param
val
make_param
:
gBGC
:
float
->
scaled_fitness
:
Amino_acid
.
vector
->
omega
:
float
->
nucleotide_rates
:
Nucleotide
.
matrix
->
nucleotide_stat_dist
:
Nucleotide
.
vector
->
rate_CpG
:
float
->
NSCodon
.
t
array
->
int
->
'
a
->
param
val
flat_param
:
unit
->
NSCodon
.
t
array
->
int
->
'
a
->
param
val
random_param
:
alpha_nuc
:
float
->
alpha_fitness
:
float
->
NSCodon
.
t
array
->
int
->
'
a
->
param
end
module
Make
(
BI
:
Simulator
.
Branch_info
)
:
sig
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment