Commit 0e43ad72 authored by Carine Rey's avatar Carine Rey Committed by Philippe Veber
Browse files

add tests

parent 35a594d0
......@@ -93,6 +93,33 @@ except Exception as exc:"Ali (%s) ok after checking",
leaves_names = [ for l in t.get_leaves()]
seq_names = [ for s in alignment]"leaves names: %s",leaves_names )"sequences names: %s",seq_names )
seq_not_in_tree = set(seq_names) - set(leaves_names)
leaves_not_in_ali = set(leaves_names) - set(seq_names)
if len(set(seq_names)) != len(seq_names):
logger.error("There are duplicated sequence names")
if len(set(leaves_names)) != len(leaves_names):
logger.error("There are duplicated leaf names")
if seq_not_in_tree:
logger.error("Some sequences do not match with a leaf: %s",",".join(list(seq_not_in_tree)))
logger.error("All sequence names must match with a leaf")
elif leaves_not_in_ali:
logger.error("Some leaves do not match with a sequence: %s",",".join(list(leaves_not_in_ali)))
else:"Sequence and leaf names match.")
# Create output files
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