Skip to main content

Processing and integrating data with genome-scale metabolic models (GEM)

Project description

PipeGEM v0.1.0-alpha1

PyPI pyversions MIT license ci


This is a package for visualizing and analyzing metabolic models. Also, it allows users to integrate omic data, metabolic tasks, and medium data with GEMs. The analysis functions in the package are based on cobrapy: https://cobrapy.readthedocs.io/en/latest/


How to get PipeGEM

To install directly from PyPI:
pip install pipegem


How to use this package

single model

import pipeGEM as pg
from pipeGEM.utils import load_model

model = load_model("your_model_path")  # cobra.Model
pmodel = pg.Model(model)

# Print out model information
print(pmodel)

# Do and plot pFBA result
flux_analysis = pmodel.do_flux_analysis("pFBA")
flux_analysis.plot()

multiple models

import pipeGEM as pg
from pipeGEM.utils import load_model

model_1 = load_model("your_model_path_1")
model_2 = load_model("your_model_path_2")
group = pg.Group({"model1": model_1, "model2": model_2})

# Do and plot pFBA result
flux_analysis = group.do_flux_analysis("pFBA")
flux_analysis.plot()

Generate context-specific models

import numpy as np
import pipeGEM as pg
from pipeGEM.utils import load_model
from pipeGEM.data import GeneData, synthesis

# initialize model
mod = pg.Model(load_model("your_model_path_1"))

# create dummy transcriptomic data
dummy_data = synthesis.get_syn_gene_data(mod, n_sample=3)

# calculate reaction activity score
gene_data = GeneData(data=dummy_data["sample_0"], # pd.Series or a dict
                     data_transform=lambda x: np.log2(x), # callable
                     absent_expression=-np.inf) # value
mod.add_gene_data(name_or_prefix="sample_0",  # name of the data
                  data=gene_data, 
                  or_operation="nanmax",  # alternative: nansum
                  threshold=-np.inf, 
                  absent_value=-np.inf)

# apply GIMME algorithm on the model
gimme_result = mod.integrate_gene_data(data_name="sample_0", integrator="GIMME")
context_specific_gem = gimme_result.result_model

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pipeGEM-0.0.1a1.tar.gz (132.8 kB view hashes)

Uploaded Source

Built Distribution

pipeGEM-0.0.1a1-py3-none-any.whl (144.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page