Commit c2c0c1e0 authored by Philippe Veber's avatar Philippe Veber
Browse files

Simulation_dataset: added nhx_of_convergence_tree

parent f3ec331f
......@@ -15,6 +15,27 @@ type tree =
branch_length2 : float ;
}
let nhx_of_convergence_tree tree =
let f = fun%workflow dest ->
let open Phylogenetics in
let open Codepitk in
let tree =
[%eval tree]
|> Tree.map
~node:(fun () -> { Newick_ast.name = None })
~leaf:(fun s -> { Newick_ast.name = Some s })
~branch:Convergence_tree.(fun bi ->
let tags = match bi.condition with
| `Ancestral -> ["Condition", "0"]
| `Convergent -> ["Condition", "1" ; "Transition", "1"]
in
{ Newick_ast.length = Some bi.length ; tags }
)
in
Newick.to_file (Tree tree) dest
in
Workflow.path_plugin ~descr:"nhx_of_convergence_tree" f
module type S = sig
type query
......
......@@ -9,6 +9,10 @@ type tree =
branch_length2 : float;
}
val nhx_of_convergence_tree :
Codepitk.Convergence_tree.t workflow ->
nhx file
module type S = sig
type query
......
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