Skip to content

Commit

Permalink
Clarified documentation regarding exact stoichiometry parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
dnlobo committed Aug 14, 2023
1 parent 6e6a934 commit 752a1d6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -44,19 +44,23 @@ 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:

import mergem

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.

------
Expand Down
15 changes: 8 additions & 7 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand Down Expand Up @@ -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:

::

Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mergem/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down

0 comments on commit 752a1d6

Please sign in to comment.