Commit 656b6af8 authored by Carine Rey's avatar Carine Rey
Browse files

refactor output directory as "datasets"

parent 8b707edb
......@@ -22,14 +22,42 @@ let select_out parsed_tree t = match t with
| Tree4simu -> parsed_tree / selector [ "tree.only_node_ids.nhx" ]
| Tree_diffsel -> parsed_tree / selector [ "tree.diffsel" ]
let ready_dataset_of_raw_dataset raw_dataset =
let tree = raw_dataset.input_tree in
let fna = raw_dataset.fna in
let parsed_tree = parse_input_tree ~tree in
let faa = Bppsuite.fna2faa ~fna in
{ parsed_tree; fna; faa}
let repo_of_ready_dataset ready_dataset =
Repo.[
item ["ready_dataset/tree.H0.node_ids" ] (ready_dataset.parsed_tree / selector [ "tree.H0.node_ids" ]) ;
item ["ready_dataset/tree.Ha.node_ids" ] (ready_dataset.parsed_tree / selector [ "tree.Ha.node_ids" ]) ;
item ["ready_dataset/tree.only_convergent_tags.nhx" ] (ready_dataset.parsed_tree / selector [ "tree.only_convergent_tags.nhx" ]) ;
item ["ready_dataset/tree.only_node_ids.nhx" ] (ready_dataset.parsed_tree / selector [ "tree.only_node_ids.nhx" ]) ;
item ["ready_dataset/tree.diffsel" ] (ready_dataset.parsed_tree / selector [ "tree.diffsel" ]) ;
item ["ready_dataset/simulated_sequences.fna"] ready_dataset.fna ;
item ["ready_dataset/simulated_sequences.faa"] ready_dataset.faa ;
]
let repo_of_raw_dataset raw_dataset =
Repo.[
item ["raw_dataset/input_tree.nhx"] raw_dataset.input_tree ;
item ["raw_dataset/simulated_sequences.fna"] raw_dataset.fna ;
]
let derive_from_tree ~tree_dir ~tree ~preview =
let tree = input (Filename.concat tree_dir tree) in
let nb_sites = if preview then 10 else 100 in
let parsed_tree = parse_input_tree ~tree in
let fna = Bppsuite.bppseqgen ~nb_sites ~tree:(select_out parsed_tree Tree4simu) in
Repo.[
item ["simulated_sequences.fna"] fna ;
]
let faa = Bppsuite.fna2faa ~fna in
let raw_dataset = { input_tree = tree ; fna} in
let ready_dataset = { parsed_tree; fna; faa} in
if preview then
repo_of_ready_dataset ready_dataset
else
repo_of_raw_dataset raw_dataset
let derive ~tree_dir ~trees ~preview =
List.map trees ~f:(fun tree ->
......
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