Giter VIP home page Giter VIP logo

corpse's Introduction

CORPSE - CObRaPy tool SEt

CORPSE is an extension to the CobraPy environment to make some extra functionality - I initiated this because I missed functions for reconstruction of specific models.

The toolset includes functions for:

  • mapping gene expression values to reactions
  • get essential genes/rxn depending on the global lower and upper and local thresholds
  • calculate distances on FVA results for different samples/simulations of the same model
  • extract tissue specific models using fastcore

Installation

Simply use pip to install the package:

pip install git+https://github.com/Porthmeus/CORPSE.git

Alternatively clone/download the package and install it manually

git clone https://github.com/Porthmeus/CORPSE.git
cd CORPSE
python setup.py install

Usage

Fastcore

Here a simple example of how to use fastcore. First we load the E. coli model from cobrapy as a toy model and we take 5 random reactions as a core set.

import cobra
from corpse import simpleFastcore
import random

eco = cobra.io.load_model("textbook") # load the model
core_eco = random.sample([x.id for x in eco.reactions], 5) # sample 5 reactions

To run fastcore instantiate a fastcore object and call run():

fast_mod = simpleFastcore(model = eco, core_set = core_eco)
core_mod = fast_mod.run()

This will run fastcc and fastcore on the model and return the tissue specific model. One can run also only fastcc or fastcore on the model provided:

# run only fastcc
fast_mod.fastcc()
consist_mod = fast_mod.get_model()

# run only fastcore
fast_mod.fastcore()
core_mod = fast_mod.get_model()

To change the solver for the problems, simply change the solver of the initial model object provided:

eco.solver = "cplex"
fast_mod = simpleFastcore(model = eco, core_set = core_eco)

Omics Mapper

To define the active reactions, usually one uses omics data to map these to the reactions. corpse offers to map transcriptomic or proteomic data (or any other measure which can be associated to genes/proteins) to the model in questions. Given you have transcriptomic data where the rows contain genes and the columns samples one can use the following code to map.

import corpse
import cobra
import pandas

mod = cobra.io.read_sbml_model("path/to/model.xml")
df = pandas.read_csv("path/to/csv", index_col = 0)
mapper = corpse.omicsMapper()
RAS_df = mapper.mapExpressionToReaction(model = mod, dataframe = df)

Set protein = True if you want to use the gene names instead of the IDs of the model.

Core set finder

Check out the coreSetFinder function - it is an easy way to apply different thresholding strategies like global and local thresholds and eases up the process of finding the right threshold setting for the given project.

TODO:

Write a good documentation with examples how to use the library

corpse's People

Contributors

porthmeus avatar

Stargazers

Shan avatar Thomas Dost avatar Georgios Marinos avatar

Watchers

James Cloos avatar  avatar Georgios Marinos avatar

Forkers

jotech maringos

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.