Commit 7d9f163c authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

[cmd] Rename identifiers_mapping to model_identifiers_mapping

parent 49dac337
......@@ -169,7 +169,7 @@ def queries_2_occcurrence_matrix(args):
)
def identifiers_mapping(args):
def model_identifier_mapping(args):
"""Mapping of identifiers from external databases.
This function exports a CSV formated file presenting the list of known
......@@ -178,7 +178,7 @@ def identifiers_mapping(args):
# Module import
import solution_repr
solution_repr.identifiers_mapping(**args)
solution_repr.model_identifier_mapping(**args)
@check_output_dir
......@@ -523,21 +523,21 @@ def main():
# subparser: Mapping of identifiers
# output: CSV file
parser_identifiers_mapping = subparsers.add_parser(
'identifiers_mapping',
help=identifiers_mapping.__doc__,
parser_model_identifier_mapping = subparsers.add_parser(
'model_identifier_mapping',
help=model_identifier_mapping.__doc__,
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
parser_identifiers_mapping.add_argument('model_file',
parser_model_identifier_mapping.add_argument('model_file',
help="bcx model file.")
group = parser_identifiers_mapping.add_mutually_exclusive_group(required=True)
group = parser_model_identifier_mapping.add_mutually_exclusive_group(required=True)
group.add_argument('--external_file',
help="File with 1 external identifiers to be mapped per line."
)
group.add_argument('--external_identifiers', nargs='+',
help="Multiple external identifiers to be mapped."
)
parser_identifiers_mapping.set_defaults(func=identifiers_mapping)
parser_model_identifier_mapping.set_defaults(func=model_identifier_mapping)
# subparser: Model comparison
......
......@@ -53,7 +53,7 @@ from cadbiom.models.guard_transitions.analyser.static_analysis import StaticAnal
from tools.models import Reporter
from tools.models import get_transitions, \
get_frontier_places, \
get_identifiers_mapping
get_model_identifier_mapping
from tools.models import get_places_data
from tools.graphs import build_graph, get_json_graph, export_graph, get_solutions_graph_data
......@@ -547,7 +547,7 @@ def low_model_info(model_file,
return info
def identifiers_mapping(model_file, *args, **kwargs):
def model_identifier_mapping(model_file, *args, **kwargs):
"""Entry point for the mapping of identifiers from external databases
:param model_file: File for the model.
......@@ -563,7 +563,7 @@ def identifiers_mapping(model_file, *args, **kwargs):
else:
external_identifiers = set(kwargs['external_identifiers'])
mapping = get_identifiers_mapping(model_file, external_identifiers)
mapping = get_model_identifier_mapping(model_file, external_identifiers)
# Make CSV file
with open("mapping.csv", 'w') as csvfile:
......
......@@ -555,7 +555,7 @@ def get_places_data(places, model):
return [{"cadbiomName": place_name} for place_name in places]
def get_identifiers_mapping(model_file, external_identifiers):
def get_model_identifier_mapping(model_file, external_identifiers):
"""Get Cadbiom names corresponding to the given external identifiers (xrefs)
.. note:: This function works only on v2 formated models with JSON additional data
......
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