%global _empty_manifest_terminate_build 0 Name: python-MetEvolSim Version: 0.6.3 Release: 1 Summary: MetEvolSim (Metabolome Evolution Simulator) Python Package License: GNU General Public License v3 (GPLv3) URL: https://github.com/charlesrocabert/MetEvolSim Source0: https://mirrors.nju.edu.cn/pypi/web/packages/e8/bf/a4902d47bca920fed13dd30d77d7b8491854dbbe0a7ede2c1cf1543a46a1/MetEvolSim-0.6.3.tar.gz BuildArch: noarch Requires: python3-libsbml Requires: python3-numpy Requires: python3-networkx %description
MetEvolSim (Metabolome Evolution Simulator) is a Python package providing numerical tools to simulate the long-term evolution of metabolic abundances in kinetic models of metabolic network. MetEvolSim takes as an input a SBML-formatted metabolic network model. Kinetic parameters and initial metabolic concentrations must be specified, and the model must reach a stable steady-state. Steady-state concentrations are computed thanks to Copasi software.
MetEvolSim is being developed by Charles Rocabert, Gábor Boross, Orsolya Liska and Balázs Papp.
Do you plan to use MetEvolSim for research purpose? Do you encounter issues with the software? Do not hesitate to contact Charles Rocabert.
## Table of contents - [Citing MetEvolSim](#citing) - [Dependencies](#dependencies) - [Installation](#installation) - [First usage](#first_usage) - [Help](#help) - [Ready-to-use examples](#examples) - [List of tested metabolic models](#tested_models) - [Copyright](#copyright) - [License](#license) ## Citing MetEvolSim - O. Liska, G. Boross, C. Rocabert, B. Szappanos, R. Tengölics, B. Papp. Principles of metabolome conservation in animals. BioRXiv preprint (2022) (https://doi.org/10.1101/2022.08.15.503737). ## Dependencies - Python ≥ 3, - Numpy ≥ 1.21 (automatically installed when using pip), - Python-libsbml ≥ 5.19 (automatically installed when using pip), - NetworkX ≥ 2.6 (automatically installed when using pip), - CopasiSE ≥ 4.27 (to be installed separately), - pip ≥ 21.3.1 (optional). ## Installation • To install Copasi software, visit http://copasi.org/. You will need the command line version named CopasiSE. • To install the latest release of MetEvolSim: ```shell pip install MetEvolSim ``` Alternatively, download the latest release in the folder of your choice and unzip it. Then follow the instructions below: ```shell # Navigate to the MetEvolSim folder cd /path/to/MetEvolSim # Install MetEvolSim Python package python3 setup.py install ``` ## First usage MetEvolSim has been tested with tens of publicly available metabolic networks, but we cannot guarantee it will work with any model (see the [list of tested metabolic models](#tested_models)). The package provides a class to manipulate SBML models: the class
Model
. It is also necessary to define an objective function (a list of target reactions and their coefficients), and to provide the path of CopasiSE software. Please note that coefficients are not functional in the current version of MetEvolSim.
```python
# Import MetEvolSim package
import metevolsim
# Create an objective function
target_fluxes = [['ATPase', 1.0], ['PDC', 1.0]]
# Load the SBML metabolic model
model = metevolsim.Model(sbml_filename='glycolysis.xml',
objective_function=target_fluxes,
copasi_path='/Applications/COPASI/CopasiSE')
# Print some informations on the metabolic model
print(model.get_number_of_species())
print(model.get_wild_type_species_value('Glc'))
# Get a kinetic parameter at random
param = model.get_random_parameter()
print(param)
# Mutate this kinetic parameter with a log-scale mutation size 0.01
model.random_parameter_mutation(param, sigma=0.01)
# Compute wild-type and mutant steady-states
model.compute_wild_type_steady_state()
model.compute_mutant_steady_state()
# Run a metabolic control analysis on the wild-type
model.compute_wild_type_metabolic_control_analysis()
# This function will output two datasets:
# - output/wild_type_MCA_unscaled.txt containing unscaled control coefficients,
# - output/wild_type_MCA_scaled.txt containing scaled control coefficients.
# Compute all pairwise metabolite shortest paths
model.build_species_graph()
model.save_shortest_paths(filename="glycolysis_shortest_paths.txt")
# Compute a flux drop analysis to measure the contribution of each flux to the fitness
# (in this example, each flux is dropped at 1% of its original value)
model.flux_drop_analysis(drop_coefficient=0.01,
filename="flux_drop_analysis.txt",
owerwrite=True)
```
MetEvolSim offers two specific numerical approaches to analyze the evolution of metabolic abundances:
- Evolution experiments, based on a Markov Chain Monte Carlo (MCMC) algorithm,
- Sensitivity analysis, either by exploring every kinetic parameters in a given range and recording associated fluxes and metabolic abundances changes (One-At-a-Time sensitivity analysis), or by exploring the kinetic parameters space at random, by mutating a single kinetic parameter at random many times (random sensitivity analysis).
All numerical analyses output files are saved in a subfolder output
.
### Evolution experiments:
Algorithm overview: A. The model of interest is loaded as a wild-type from a SBML file (kinetic equations, kinetic parameter values and initial metabolic concentrations must be specified). B. At each iteration t, a single kinetic parameter is selected at random and mutated through a log10-normal distribution of standard deviation σ. C. The new steady-state is computed using Copasi software, and the MOMA distance z between the mutant and the wild-type target fluxes is computed. D. If z is under a given selection threshold ω, the mutation is accepted. Else, the mutation is discarded. E. A new iteration t+1 is computed.
MUTATION_ACCUMULATION
: Run a mutation accumulation experiment by accepting all new mutations without any selection threshold,
- ABSOLUTE_METABOLIC_SUM_SELECTION
: Run an evolution experiment by applying a stabilizing selection on the sum of absolute metabolic abundances,
- ABSOLUTE_TARGET_FLUXES_SELECTION
: Run an evolution experiment by applying a stabilizing selection on the MOMA distance of absolute target fluxes,
- RELATIVE_TARGET_FLUXES_SELECTION
: Run an evolution experiment by applying a stabilizing selection on the MOMA distance of relative target fluxes.
```python
# Load a Markov Chain Monte Carlo (MCMC) instance
mcmc = metevolsim.MCMC(sbml_filename='glycolysis.xml',
objective_function=target_fluxes,
total_iterations=10000,
sigma=0.01,
selection_scheme="MUTATION_ACCUMULATION",
selection_threshold=1e-4,
copasi_path='/Applications/COPASI/CopasiSE')
# Initialize the MCMC instance
mcmc.initialize()
# Compute the successive iterations and write output files
stop_MCMC = False
while not stop_MCMC:
stop_mcmc = mcmc.iterate()
mcmc.write_output_file()
mcmc.write_statistics()
```
### One-At-a-Time (OAT) sensitivity analysis:
For each kinetic parameter p, each metabolic abundance [Xi] and each flux νj, the algorithm numerically computes relative derivatives and control coefficients.
```python
# Load a sensitivity analysis instance
sa = metevolsim.SensitivityAnalysis(sbml_filename='glycolysis.xml',
copasi_path='/Applications/COPASI/CopasiSE')
# Run the full OAT sensitivity analysis
sa.run_OAT_analysis(factor_range=1.0, factor_step=0.01)
```
### Random sensitivity analysis:
At each iteration, a single kinetic parameter p is mutated at random in a log10-normal distribution of size σ, and relative derivatives and control coefficients are computed.
```python
# Load a sensitivity analysis instance
sa = metevolsim.SensitivityAnalysis(sbml_filename='glycolysis.xml',
copasi_path='/Applications/COPASI/CopasiSE')
# Run the full OAT sensitivity analysis
sa.run_random_analysis(sigma=0.01, nb_iterations=1000)
```
## Help
To get some help on a MetEvolSim class or method, use the Python help function:
```python
help(metevolsim.Model.set_species_initial_value)
```
to obtain a quick description and the list of parameters and outputs:
```
Help on function set_species_initial_value in module metevolsim:
set_species_initial_value(self, species_id, value)
Set the initial concentration of the species 'species_id' in the
mutant model.
%package -n python3-MetEvolSim
Summary: MetEvolSim (Metabolome Evolution Simulator) Python Package
Provides: python-MetEvolSim
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-MetEvolSim
MetEvolSim (Metabolome Evolution Simulator) is a Python package providing numerical tools to simulate the long-term evolution of metabolic abundances in kinetic models of metabolic network. MetEvolSim takes as an input a SBML-formatted metabolic network model. Kinetic parameters and initial metabolic concentrations must be specified, and the model must reach a stable steady-state. Steady-state concentrations are computed thanks to Copasi software.
MetEvolSim is being developed by Charles Rocabert, Gábor Boross, Orsolya Liska and Balázs Papp.
Do you plan to use MetEvolSim for research purpose? Do you encounter issues with the software? Do not hesitate to contact Charles Rocabert.
## Table of contents - [Citing MetEvolSim](#citing) - [Dependencies](#dependencies) - [Installation](#installation) - [First usage](#first_usage) - [Help](#help) - [Ready-to-use examples](#examples) - [List of tested metabolic models](#tested_models) - [Copyright](#copyright) - [License](#license) ## Citing MetEvolSim - O. Liska, G. Boross, C. Rocabert, B. Szappanos, R. Tengölics, B. Papp. Principles of metabolome conservation in animals. BioRXiv preprint (2022) (https://doi.org/10.1101/2022.08.15.503737). ## Dependencies - Python ≥ 3, - Numpy ≥ 1.21 (automatically installed when using pip), - Python-libsbml ≥ 5.19 (automatically installed when using pip), - NetworkX ≥ 2.6 (automatically installed when using pip), - CopasiSE ≥ 4.27 (to be installed separately), - pip ≥ 21.3.1 (optional). ## Installation • To install Copasi software, visit http://copasi.org/. You will need the command line version named CopasiSE. • To install the latest release of MetEvolSim: ```shell pip install MetEvolSim ``` Alternatively, download the latest release in the folder of your choice and unzip it. Then follow the instructions below: ```shell # Navigate to the MetEvolSim folder cd /path/to/MetEvolSim # Install MetEvolSim Python package python3 setup.py install ``` ## First usage MetEvolSim has been tested with tens of publicly available metabolic networks, but we cannot guarantee it will work with any model (see the [list of tested metabolic models](#tested_models)). The package provides a class to manipulate SBML models: the class
Model
. It is also necessary to define an objective function (a list of target reactions and their coefficients), and to provide the path of CopasiSE software. Please note that coefficients are not functional in the current version of MetEvolSim.
```python
# Import MetEvolSim package
import metevolsim
# Create an objective function
target_fluxes = [['ATPase', 1.0], ['PDC', 1.0]]
# Load the SBML metabolic model
model = metevolsim.Model(sbml_filename='glycolysis.xml',
objective_function=target_fluxes,
copasi_path='/Applications/COPASI/CopasiSE')
# Print some informations on the metabolic model
print(model.get_number_of_species())
print(model.get_wild_type_species_value('Glc'))
# Get a kinetic parameter at random
param = model.get_random_parameter()
print(param)
# Mutate this kinetic parameter with a log-scale mutation size 0.01
model.random_parameter_mutation(param, sigma=0.01)
# Compute wild-type and mutant steady-states
model.compute_wild_type_steady_state()
model.compute_mutant_steady_state()
# Run a metabolic control analysis on the wild-type
model.compute_wild_type_metabolic_control_analysis()
# This function will output two datasets:
# - output/wild_type_MCA_unscaled.txt containing unscaled control coefficients,
# - output/wild_type_MCA_scaled.txt containing scaled control coefficients.
# Compute all pairwise metabolite shortest paths
model.build_species_graph()
model.save_shortest_paths(filename="glycolysis_shortest_paths.txt")
# Compute a flux drop analysis to measure the contribution of each flux to the fitness
# (in this example, each flux is dropped at 1% of its original value)
model.flux_drop_analysis(drop_coefficient=0.01,
filename="flux_drop_analysis.txt",
owerwrite=True)
```
MetEvolSim offers two specific numerical approaches to analyze the evolution of metabolic abundances:
- Evolution experiments, based on a Markov Chain Monte Carlo (MCMC) algorithm,
- Sensitivity analysis, either by exploring every kinetic parameters in a given range and recording associated fluxes and metabolic abundances changes (One-At-a-Time sensitivity analysis), or by exploring the kinetic parameters space at random, by mutating a single kinetic parameter at random many times (random sensitivity analysis).
All numerical analyses output files are saved in a subfolder output
.
### Evolution experiments:
Algorithm overview: A. The model of interest is loaded as a wild-type from a SBML file (kinetic equations, kinetic parameter values and initial metabolic concentrations must be specified). B. At each iteration t, a single kinetic parameter is selected at random and mutated through a log10-normal distribution of standard deviation σ. C. The new steady-state is computed using Copasi software, and the MOMA distance z between the mutant and the wild-type target fluxes is computed. D. If z is under a given selection threshold ω, the mutation is accepted. Else, the mutation is discarded. E. A new iteration t+1 is computed.
MUTATION_ACCUMULATION
: Run a mutation accumulation experiment by accepting all new mutations without any selection threshold,
- ABSOLUTE_METABOLIC_SUM_SELECTION
: Run an evolution experiment by applying a stabilizing selection on the sum of absolute metabolic abundances,
- ABSOLUTE_TARGET_FLUXES_SELECTION
: Run an evolution experiment by applying a stabilizing selection on the MOMA distance of absolute target fluxes,
- RELATIVE_TARGET_FLUXES_SELECTION
: Run an evolution experiment by applying a stabilizing selection on the MOMA distance of relative target fluxes.
```python
# Load a Markov Chain Monte Carlo (MCMC) instance
mcmc = metevolsim.MCMC(sbml_filename='glycolysis.xml',
objective_function=target_fluxes,
total_iterations=10000,
sigma=0.01,
selection_scheme="MUTATION_ACCUMULATION",
selection_threshold=1e-4,
copasi_path='/Applications/COPASI/CopasiSE')
# Initialize the MCMC instance
mcmc.initialize()
# Compute the successive iterations and write output files
stop_MCMC = False
while not stop_MCMC:
stop_mcmc = mcmc.iterate()
mcmc.write_output_file()
mcmc.write_statistics()
```
### One-At-a-Time (OAT) sensitivity analysis:
For each kinetic parameter p, each metabolic abundance [Xi] and each flux νj, the algorithm numerically computes relative derivatives and control coefficients.
```python
# Load a sensitivity analysis instance
sa = metevolsim.SensitivityAnalysis(sbml_filename='glycolysis.xml',
copasi_path='/Applications/COPASI/CopasiSE')
# Run the full OAT sensitivity analysis
sa.run_OAT_analysis(factor_range=1.0, factor_step=0.01)
```
### Random sensitivity analysis:
At each iteration, a single kinetic parameter p is mutated at random in a log10-normal distribution of size σ, and relative derivatives and control coefficients are computed.
```python
# Load a sensitivity analysis instance
sa = metevolsim.SensitivityAnalysis(sbml_filename='glycolysis.xml',
copasi_path='/Applications/COPASI/CopasiSE')
# Run the full OAT sensitivity analysis
sa.run_random_analysis(sigma=0.01, nb_iterations=1000)
```
## Help
To get some help on a MetEvolSim class or method, use the Python help function:
```python
help(metevolsim.Model.set_species_initial_value)
```
to obtain a quick description and the list of parameters and outputs:
```
Help on function set_species_initial_value in module metevolsim:
set_species_initial_value(self, species_id, value)
Set the initial concentration of the species 'species_id' in the
mutant model.
%package help
Summary: Development documents and examples for MetEvolSim
Provides: python3-MetEvolSim-doc
%description help
MetEvolSim (Metabolome Evolution Simulator) is a Python package providing numerical tools to simulate the long-term evolution of metabolic abundances in kinetic models of metabolic network. MetEvolSim takes as an input a SBML-formatted metabolic network model. Kinetic parameters and initial metabolic concentrations must be specified, and the model must reach a stable steady-state. Steady-state concentrations are computed thanks to Copasi software.
MetEvolSim is being developed by Charles Rocabert, Gábor Boross, Orsolya Liska and Balázs Papp.
Do you plan to use MetEvolSim for research purpose? Do you encounter issues with the software? Do not hesitate to contact Charles Rocabert.
## Table of contents - [Citing MetEvolSim](#citing) - [Dependencies](#dependencies) - [Installation](#installation) - [First usage](#first_usage) - [Help](#help) - [Ready-to-use examples](#examples) - [List of tested metabolic models](#tested_models) - [Copyright](#copyright) - [License](#license) ## Citing MetEvolSim - O. Liska, G. Boross, C. Rocabert, B. Szappanos, R. Tengölics, B. Papp. Principles of metabolome conservation in animals. BioRXiv preprint (2022) (https://doi.org/10.1101/2022.08.15.503737). ## Dependencies - Python ≥ 3, - Numpy ≥ 1.21 (automatically installed when using pip), - Python-libsbml ≥ 5.19 (automatically installed when using pip), - NetworkX ≥ 2.6 (automatically installed when using pip), - CopasiSE ≥ 4.27 (to be installed separately), - pip ≥ 21.3.1 (optional). ## Installation • To install Copasi software, visit http://copasi.org/. You will need the command line version named CopasiSE. • To install the latest release of MetEvolSim: ```shell pip install MetEvolSim ``` Alternatively, download the latest release in the folder of your choice and unzip it. Then follow the instructions below: ```shell # Navigate to the MetEvolSim folder cd /path/to/MetEvolSim # Install MetEvolSim Python package python3 setup.py install ``` ## First usage MetEvolSim has been tested with tens of publicly available metabolic networks, but we cannot guarantee it will work with any model (see the [list of tested metabolic models](#tested_models)). The package provides a class to manipulate SBML models: the class
Model
. It is also necessary to define an objective function (a list of target reactions and their coefficients), and to provide the path of CopasiSE software. Please note that coefficients are not functional in the current version of MetEvolSim.
```python
# Import MetEvolSim package
import metevolsim
# Create an objective function
target_fluxes = [['ATPase', 1.0], ['PDC', 1.0]]
# Load the SBML metabolic model
model = metevolsim.Model(sbml_filename='glycolysis.xml',
objective_function=target_fluxes,
copasi_path='/Applications/COPASI/CopasiSE')
# Print some informations on the metabolic model
print(model.get_number_of_species())
print(model.get_wild_type_species_value('Glc'))
# Get a kinetic parameter at random
param = model.get_random_parameter()
print(param)
# Mutate this kinetic parameter with a log-scale mutation size 0.01
model.random_parameter_mutation(param, sigma=0.01)
# Compute wild-type and mutant steady-states
model.compute_wild_type_steady_state()
model.compute_mutant_steady_state()
# Run a metabolic control analysis on the wild-type
model.compute_wild_type_metabolic_control_analysis()
# This function will output two datasets:
# - output/wild_type_MCA_unscaled.txt containing unscaled control coefficients,
# - output/wild_type_MCA_scaled.txt containing scaled control coefficients.
# Compute all pairwise metabolite shortest paths
model.build_species_graph()
model.save_shortest_paths(filename="glycolysis_shortest_paths.txt")
# Compute a flux drop analysis to measure the contribution of each flux to the fitness
# (in this example, each flux is dropped at 1% of its original value)
model.flux_drop_analysis(drop_coefficient=0.01,
filename="flux_drop_analysis.txt",
owerwrite=True)
```
MetEvolSim offers two specific numerical approaches to analyze the evolution of metabolic abundances:
- Evolution experiments, based on a Markov Chain Monte Carlo (MCMC) algorithm,
- Sensitivity analysis, either by exploring every kinetic parameters in a given range and recording associated fluxes and metabolic abundances changes (One-At-a-Time sensitivity analysis), or by exploring the kinetic parameters space at random, by mutating a single kinetic parameter at random many times (random sensitivity analysis).
All numerical analyses output files are saved in a subfolder output
.
### Evolution experiments:
Algorithm overview: A. The model of interest is loaded as a wild-type from a SBML file (kinetic equations, kinetic parameter values and initial metabolic concentrations must be specified). B. At each iteration t, a single kinetic parameter is selected at random and mutated through a log10-normal distribution of standard deviation σ. C. The new steady-state is computed using Copasi software, and the MOMA distance z between the mutant and the wild-type target fluxes is computed. D. If z is under a given selection threshold ω, the mutation is accepted. Else, the mutation is discarded. E. A new iteration t+1 is computed.
MUTATION_ACCUMULATION
: Run a mutation accumulation experiment by accepting all new mutations without any selection threshold,
- ABSOLUTE_METABOLIC_SUM_SELECTION
: Run an evolution experiment by applying a stabilizing selection on the sum of absolute metabolic abundances,
- ABSOLUTE_TARGET_FLUXES_SELECTION
: Run an evolution experiment by applying a stabilizing selection on the MOMA distance of absolute target fluxes,
- RELATIVE_TARGET_FLUXES_SELECTION
: Run an evolution experiment by applying a stabilizing selection on the MOMA distance of relative target fluxes.
```python
# Load a Markov Chain Monte Carlo (MCMC) instance
mcmc = metevolsim.MCMC(sbml_filename='glycolysis.xml',
objective_function=target_fluxes,
total_iterations=10000,
sigma=0.01,
selection_scheme="MUTATION_ACCUMULATION",
selection_threshold=1e-4,
copasi_path='/Applications/COPASI/CopasiSE')
# Initialize the MCMC instance
mcmc.initialize()
# Compute the successive iterations and write output files
stop_MCMC = False
while not stop_MCMC:
stop_mcmc = mcmc.iterate()
mcmc.write_output_file()
mcmc.write_statistics()
```
### One-At-a-Time (OAT) sensitivity analysis:
For each kinetic parameter p, each metabolic abundance [Xi] and each flux νj, the algorithm numerically computes relative derivatives and control coefficients.
```python
# Load a sensitivity analysis instance
sa = metevolsim.SensitivityAnalysis(sbml_filename='glycolysis.xml',
copasi_path='/Applications/COPASI/CopasiSE')
# Run the full OAT sensitivity analysis
sa.run_OAT_analysis(factor_range=1.0, factor_step=0.01)
```
### Random sensitivity analysis:
At each iteration, a single kinetic parameter p is mutated at random in a log10-normal distribution of size σ, and relative derivatives and control coefficients are computed.
```python
# Load a sensitivity analysis instance
sa = metevolsim.SensitivityAnalysis(sbml_filename='glycolysis.xml',
copasi_path='/Applications/COPASI/CopasiSE')
# Run the full OAT sensitivity analysis
sa.run_random_analysis(sigma=0.01, nb_iterations=1000)
```
## Help
To get some help on a MetEvolSim class or method, use the Python help function:
```python
help(metevolsim.Model.set_species_initial_value)
```
to obtain a quick description and the list of parameters and outputs:
```
Help on function set_species_initial_value in module metevolsim:
set_species_initial_value(self, species_id, value)
Set the initial concentration of the species 'species_id' in the
mutant model.
%prep
%autosetup -n MetEvolSim-0.6.3
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-MetEvolSim -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Mon May 15 2023 Python_Bot