Commit 5ea7464a authored by Philippe Veber's avatar Philippe Veber
Browse files

update wrt phylogenetics

parent 1ece636f
......@@ -46,12 +46,16 @@ let nucleotide_fasta_gc ?pos fa =
seq_gc ?pos seqs
let nucleotide_fasta_gc_ac ?pos tree fa =
let open Codepitk in
let module BI = Phylogenetics_convergence.Simulator.Branch_info in
let tree = Codepitk.Utils.tree_from_file tree in
let tree =
Convergence_tree.from_file tree
|> Rresult.R.failwith_error_msg
in
let seqs = strings_from_fasta fa in
let root = { BI.length = 0. ; condition = `Ancestral } in
let leaf_state =
Phylogenetics.Tree.map_leaves tree ~root ~f:Poly.(fun _ b -> BI.condition b = `Ancestral)
Convergence_tree.leaves tree
|> List.map ~f:Poly.(fun (_, cond) -> cond = `Ancestral)
|> Array.of_list
in
let ancestral_seqs, convergent_seqs =
......
......@@ -244,7 +244,7 @@ let%pworkflow concatenate_calibration_figure ~nsites ~trees =
List.map ~f:(fun tree_path ->
Newick.from_file tree_path
|> Newick.with_inner_tree ~f:(
Tree.pre ~init:0.
Tree.prefix_traversal ~init:0.
~node:(fun acc _ -> acc) ~leaf:(fun acc _ -> acc)
~branch:(fun acc bi ->
match bi.Newick.length with
......
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