Commit 94b3e90f authored by Louis Duchemin's avatar Louis Duchemin
Browse files

Mutsel CpG : Fixed error in dinucleotide ratios computation

parent a17d17a6
......@@ -132,13 +132,14 @@ module Evolution_model = struct
let single_counts = nucleotide_counts nucleotide_sequence in
Nucleotide.Table.init (fun nuc1 ->
Nucleotide.Table.init (fun nuc2 ->
let expected = Nucleotide.Table.(get single_counts nuc1 * get single_counts nuc2) in
let expected = float_of_int Nucleotide.Table.(get single_counts nuc1 * get single_counts nuc2) /.
float_of_int (Array.length nucleotide_sequence) in
let observed = Array.counti nucleotide_sequence ~f:(fun pos nuc ->
if pos = Array.length nucleotide_sequence then false
else Nucleotide.(equal nuc nuc1 && equal nucleotide_sequence.(pos+1) nuc2)
)
in
float_of_int observed /. float_of_int expected
float_of_int observed /. expected
)
)
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment