From 752a1d6d5ec8e1a3752ddbfdfa68674e141a1e0f Mon Sep 17 00:00:00 2001 From: Daniel Lobo Date: Mon, 14 Aug 2023 13:41:21 -0400 Subject: [PATCH] Clarified documentation regarding exact stoichiometry parameter. --- README.md | 14 +++++++++----- docs/source/usage.rst | 15 ++++++++------- mergem/cli.py | 2 +- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 4d726d6..43f1160 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Command-line options can be viewed using "--help" flag, as shown below: -v Print merging statistics -up Update metabolite ID mapping table -s Save ID mapping table as CSV - -e Uses exact stoichiometry for merging + -e Uses exact stoichiometry when merging reactions --version Show the version and exit. --help Show this message and exit. @@ -44,7 +44,7 @@ To print merging statistics, append the "-v" flag: mergem -i model1.xml -i model2.xml -obj 1 -v -#### Importing mergem +#### Python usage To use mergem modules within a python script, simply import the package within the script: @@ -52,11 +52,15 @@ To use mergem modules within a python script, simply import the package within t Provide the list of models to be merged as a list to the merge function: - merge_results = mergem.merge([model1, model2,..], objective) + merge_results = mergem.merge(input_models, set_objective='merge', exact_sto=False) + +* `input_models` is a list of COBRApy model objects or strings specifying file names. +* `set_objective` specifies if the objective functions are merged ('merge') or copied from a single model (specifying the index of the model: '1', 2', '3', etc.). +* `exact_sto` is set to true for using exact stoichiometry when merging reactions. + -where objective can be 'merge' or model index ('1', '2', '3', etc). The merge function returns a dictionary of results including the merged model, -the metabolite and reaction jaccard distances of each model with respect to first model, and the +the metabolite and reaction Jaccard distances of each model with respect to the first model, and the metabolite and reaction model sources. ------ diff --git a/docs/source/usage.rst b/docs/source/usage.rst index 19f66bb..e9a8424 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -19,7 +19,7 @@ Printing help text displays all the options. :: > mergem --help - Usage: mergem [OPTIONS] [INPUT_FILENAMES]... + Usage: mergem [INPUT_FILENAMES] [OPTIONS] mergem takes genome-scale metabolic models as input, merges them into a single model and saves merged model as .xml. Users can optionally select the @@ -32,7 +32,7 @@ Printing help text displays all the options. -v Print merging statistics -up Update ID mapping table -s Save ID mapping table as CSV - -e Uses exact stoichiometry for merging + -e Uses exact stoichiometry when merging reactions --version Show the version and exit. --help Show this message and exit. @@ -75,7 +75,7 @@ Save the ID mapping table as a CSV file by using the :code:`-s` argument: mergem model1.xml model2.xml -obj 1 -s -To use the exact stoichiometry of the metabolites for merging, use the :code:`-e` argument: +By default, reactions are merged when they have both a similar set of reactants and a similar set of products, without comparing their stoichiometry. To merge reactions only when they have the same exact stoichiometry in their reactants and products, use the :code:`-e` argument: :: @@ -84,7 +84,7 @@ To use the exact stoichiometry of the metabolites for merging, use the :code:`-e .. _python-import: -Python import +Python ======================= Merge models @@ -101,10 +101,11 @@ Provide the list of models to be merged: :: - merge_results = mergem.merge([model1, model2, ..], objective) + merge_results = mergem.merge(input_models, set_objective='merge', exact_sto=False) -where the models can be COBRApy model objects, or filenames and objective can be 'merge' or -model number ('1', 2', '3', etc.). +* :code:`input_models` is a list of COBRApy model objects or strings specifying file names. +* :code:`set_objective` specifies if the objective functions are merged ('merge') or copied from a single model (specifying the index of the model: '1', 2', '3', etc.). +* :code:`exact_sto` is set to true for using exact stoichiometry when merging reactions. Other mergem functions diff --git a/mergem/cli.py b/mergem/cli.py index af9d471..5ce69a2 100644 --- a/mergem/cli.py +++ b/mergem/cli.py @@ -24,7 +24,7 @@ @click.option('-v', help='Print merging statistics', is_flag=True) @click.option('-up', help='Update ID mapping table', is_flag=True) @click.option('-s', help='Save ID mapping table as CSV', is_flag=True) -@click.option('-e', help='Uses exact stoichiometry for merging', is_flag=True) +@click.option('-e', help='Uses exact stoichiometry when merging reactions', is_flag=True) @click.version_option(_version + "\nLobo Lab (https://lobolab.umbc.edu)") def main(input_filenames, obj, o=None, v=False, up=False, s=False, e=False): """