Commit d93a3737 authored by Carine Rey's avatar Carine Rey
Browse files

check if input tree is rooted

parent c92ad5ce
......@@ -121,7 +121,7 @@ let derive_from_model ~model ~input_tree ~tree_dataset ~tree_prefix ~profile ~pr
let derive_from_tree ~tree_dir ~tree ~profile ~preview ~use_concat ~ns ~no_Ne ~no_HaPC ~ne_test =
let tree_prefix = Filename.chop_extension tree in
let input_tree = input (Filename.concat tree_dir tree) in
let tree_dataset = Tree_dataset.prepare input_tree in
let tree_dataset = Tree_dataset.prepare ~descr:tree_prefix input_tree in
let models = Convergence_hypothesis.[
[
H0_NeG1 ;
......
......@@ -105,6 +105,12 @@ if t:
features = list(set(features)) # list(set(*)) = remove duplicates
logger.info("No detected tag" if not features else "Detected tags: "+", ".join([f for f in features]))
#check rooted tree
nb_root_children = len(t.get_children())
if nb_root_children > 2:
logger.error("Unrooted tree")
sys.exit(1)
if "ND" in features:
logger.warning("\"ND\" is in the detected tags but it will be removed by the programm")
features.remove("ND")
......
......@@ -5,8 +5,8 @@ open File_formats
let env = docker_image ~account:"carinerey" ~name:"python_basics" ~tag:"07252018" ()
let prepare tree =
workflow ~descr:"utils.parse_input_tree" [
let prepare ?(descr="") tree =
workflow ~descr:("utils.parse_input_tree." ^ descr) [
cmd "python" ~env [
file_dump (string Scripts.parse_input_tree) ;
opt "-t" dep tree ;
......
open Bistro.Std
open File_formats
val prepare : nhx workflow -> [`tree_dataset] directory workflow
val prepare :
?descr : string ->
nhx workflow -> [`tree_dataset] directory workflow
val nodes :
[`tree_dataset] directory workflow ->
Convergence_hypothesis.t ->
......
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