From c437931a354dce9489297913e272e762978034d7 Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Mon, 10 Dec 2018 17:09:00 +0100 Subject: [PATCH] Cython: fixed history dot graph for all views, and fixed history recording for build_ref_db and ecotag --- python/obitools3/commands/build_ref_db.pyx | 7 ++++++- python/obitools3/commands/ecotag.pyx | 8 +++++++- python/obitools3/dms/view/view.pyx | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/python/obitools3/commands/build_ref_db.pyx b/python/obitools3/commands/build_ref_db.pyx index cae09fc..2cf103f 100755 --- a/python/obitools3/commands/build_ref_db.pyx +++ b/python/obitools3/commands/build_ref_db.pyx @@ -75,7 +75,11 @@ def run(config): # Save command config in View comments command_line = " ".join(sys.argv[1:]) - comments = View.print_config(config, "build_ref_db", command_line, input_dms_name=[i_dms_name], input_view_name=[i_view_name]) + input_dms_name=[i_dms_name] + input_view_name= [i_view_name] + input_dms_name.append(config['obi']['taxoURI'].split("/")[-3]) + input_view_name.append("taxonomy/"+config['obi']['taxoURI'].split("/")[-1]) + comments = View.print_config(config, "build_ref_db", command_line, input_dms_name=input_dms_name, input_view_name=input_view_name) if build_reference_db(tobytes(i_dms_name), tobytes(i_view_name), tobytes(taxonomy_name), tobytes(o_view_name), comments, config['build_ref_db']['threshold']) < 0: raise Exception("Error building a reference database") @@ -96,3 +100,4 @@ def run(config): o_dms.close() i_dms.close() + diff --git a/python/obitools3/commands/ecotag.pyx b/python/obitools3/commands/ecotag.pyx index c8fb742..e00c711 100755 --- a/python/obitools3/commands/ecotag.pyx +++ b/python/obitools3/commands/ecotag.pyx @@ -93,7 +93,13 @@ def run(config): # Save command config in View comments command_line = " ".join(sys.argv[1:]) - comments = View.print_config(config, "ecotag", command_line, input_dms_name=[i_dms_name], input_view_name=[i_view_name]) # TODO no. fix + input_dms_name=[i_dms_name] + input_view_name= [i_view_name] + input_dms_name.append(ref_dms_name) + input_view_name.append(ref_view_name) + input_dms_name.append(config['obi']['taxoURI'].split("/")[-3]) + input_view_name.append("taxonomy/"+config['obi']['taxoURI'].split("/")[-1]) + comments = View.print_config(config, "ecotag", command_line, input_dms_name=input_dms_name, input_view_name=input_view_name) if obi_ecotag(tobytes(i_dms_name), tobytes(i_view_name), \ tobytes(ref_dms_name), tobytes(ref_view_name), \ diff --git a/python/obitools3/dms/view/view.pyx b/python/obitools3/dms/view/view.pyx index fb12838..7f12093 100755 --- a/python/obitools3/dms/view/view.pyx +++ b/python/obitools3/dms/view/view.pyx @@ -485,7 +485,7 @@ cdef class View(OBIWrapper) : @property def dot_history_graph(self): uniq_graph = [] - for elt in self.history_graph_list: + for elt in self.dot_history_graph_list: if elt not in uniq_graph: uniq_graph.append(elt) uniq_graph.insert(0, b"digraph \""+self.name+b"\" {\n")